Skip to content

Instantly share code, notes, and snippets.

View BalicantaYao's full-sized avatar

Balicanta BalicantaYao

View GitHub Profile
id name quantity last_modified
1 Apple 2 2024/01/18 13:00:59
id name quantity
1 Apple 2
package application;
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<title>Class Sign Up Form</title>
<!-- Bootstrap -->
public class FileNameUtils {
private static final String[] ILLEGAL_CHARACTERS =
{ "/", "\n", "\r", "\t", "\0", "\f", "`", "?", "*", "\\", "<", ">", "|", "\"", ":" };
private static final String DEFAULT_SEPARATOR = "_";
public static String normalizeFileName(String fileName, String separator){
for (String illegalCharacter : ILLEGAL_CHARACTERS) {
package controller;
import java.io.IOException;
import java.sql.SQLException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
public static MailList findByEmailAndPhone(String email, String phone) throws ClassNotFoundException, SQLException {
// 0.
Class.forName("com.mysql.jdbc.Driver");
// 定義連結資料庫型態以及位置
// (jdbc:資料庫種類)://資料庫ip:port/資料庫名稱
String connURL = "jdbc:mysql://192.168.64.2:3306/test?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";
// 1. 取得資料庫連結(connection)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="Garmin" version="13">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
public boolean isValidEmailAddress(String email) {
String ePattern = "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$";
Pattern p = Pattern.compile(ePattern);
Matcher m = p.matcher(email);
return m.matches();
}
1. 接收使用者輸入的數,直到使用者輸入 -1 為止,並將使用者過去輸入的數,全部一起於一列印出,並用空白分開。
- Scanner, nextInt
- ArrayList - 使用者輸入的數字存在這
- 透過 for 印出
2. 電腦產生 7 個 1 - 42 的亂數,並不得重覆。
- Random
- HashSet