<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<!-- <div id="quadratic"> -->
<div id="polyline">
</div>
<input type = "text" name = "A" id="input-id" value="1" placeholder = "Введите а"><br> <!-- определяем элемент управления для текстовой информации -->
<button onclick="f()">Вычислить</button>
</body>
<!-- <script src="d3.min.js"></script>
<script src="function-plot.js"></script>
-->
<script src="https://unpkg.com/d3@3/d3.min.js"></script>
<script src="https://unpkg.com/function-plot@1/dist/function-plot.js"></script>
<script type="application/javascript">
function f(){
functionPlot({
target: <!-- '#quadratic'-->
'#polyline'
,
data: [
{
<!-- fn: document.getElementById("input-id").value -->
points:[
[document.getElementById("input-id").value,-3],
[document.getElementById("input-id").value,-2],
[document.getElementById("input-id").value,-1],
[document.getElementById("input-id").value,0],
[document.getElementById("input-id").value,1],
[document.getElementById("input-id").value,2],
[document.getElementById("input-id").value,3],
],
fnType: 'points',
graphType: 'polyline'
}
]
})
}
</script>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<div id="quadratic">
</div>
<input type = "text" name = "A" id="input-id" value="2" placeholder = "Введите а"><br> <!-- определяем элемент управления для текстовой информации -->
<button>Кнопка с текстом</button>
</body>
<script src="d3.min.js"></script>
<script src="function-plot.js"></script>
<script type="application/javascript">
functionPlot({
target: '#quadratic',
data: [
{ fn: document.getElementById("input-id").value }
]
})
var message = document.getElementById("input-id").value;
console.log(message)
</script>
</html>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package example;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.Statement;
import java.time.LocalDate;
import java.time.ZoneId;
import org.apache.commons.codec.digest.DigestUtils;
import java.util.*;
/**
*
* @author User
*/
public class Example {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Java Правит Интернетом!");
System.out.println(md5Apache("root"));
try{
String url = "jdbc:mysql://localhost/test?serverTimezone=Europe/Moscow";
String username = "root";
String password = "root";
Class.forName("com.mysql.cj.jdbc.Driver").getDeclaredConstructor().newInstance();
try (Connection conn = DriverManager.getConnection(url, username, password)){
System.out.println("Connection to Store DB succesfull!");
Statement statement = conn.createStatement();
String pass = md5Apache("root");
LocalDate date = LocalDate.now( ZoneId.of( "Europe/Moscow" ) );
String sql = "INSERT users(nickname,email,password,reg_date) VALUES ('i-rinat','rinat@mail.ru',?,?)";
PreparedStatement preparedStatement = conn.prepareStatement(sql);
preparedStatement.setString(1, pass);
preparedStatement.setDate(2, java.sql.Date.valueOf(date));
int rows = preparedStatement.executeUpdate();
System.out.printf("Added %d rows", rows);
}
}
catch(Exception ex){
System.out.println("Connection failed...");
System.out.println(ex);
}
}
public static String md5Apache(String st) {
String md5Hex = DigestUtils.md5Hex(st);
return md5Hex;
}
}