原创 配置CSS的方法

有4種不同的方法將CSS技術集成到網站:內聯、嵌入、外部和導入。 內聯樣式:內聯樣式是指直接將代碼寫入網頁的主體區域,作爲HTML標記的屬性。只適合提供了樣式屬性的特定元素。 嵌入樣式:嵌入樣式在網頁的頁頭區域(<head></he

原创 LeetCode第1題(two sum) 暴力法性能優化

最近開始刷LeetCode上的題目, 第一題 two sum 中, 先使用了一下暴力法, 運行了一下, 發現速度和題目給出的答案有出入, 看了一下, 發現了不同。我的代碼如下: private static int[] twoSum(i

原创 java.sql.SQLException: Column 'id' not found.

發生這種錯誤的原因可能有多種情況。 最近在寫DAO層的時候,寫了一個統計數據庫中商品數量的方法,結果在調用的時候,發生了這個錯誤。於是看了下報的錯誤,找到了錯誤的根源: java.sql.SQLException: Column 'id

原创 數據分頁顯示 之 確定總頁碼數(優化)

對數據進行分頁顯示的時候,要定義4個變量: pageNow     表示第幾頁,由用戶決定 pageSize     每頁顯示幾條記錄,由程序指定,也可以由用戶定製 pageCount   表示共有多少頁,該變量通過計算得到 rowCo

原创 IntelliJ IDEA 提示"Form input without an associated label or title attribute"

在HTML中如果用了input標籤,沒有指定placeholder的話,IDE會提示: Form input without an associated label or title attribute 解決方案:指定placehold

原创 在JSP中圖片上傳到服務器後無法讀取(已解決)

原圖片名稱是中文的, 中間有一個空格. 解決辦法: 上傳圖片時, 圖片用 java.uti.UUID.UUID.randomUUID()命名, 不要用原來的圖片名!!! File saveFile = new File(request.

原创 The maximum-subarray problem

package com.zkdx.test; import java.util.HashMap; /** * @Author: Chintsai Hwo * @Date: Created on 8:37 PM 6/27/2019

原创 Chapter 2:Getting Started

  2.1 Insertion Sort   2.2 Analyzing algorithms Worst-case and average-case analysis In our analysis of insertion sor

原创 Merge Sort in Java, C,C++ and Python

public class MergeSort { public static void main(String[] args) { int[] a = {4, 6, 8, 4, 22, 65, 3, 75, 2,

原创 MySQL 中設置了自增字段 ID,如何在刪除某些記錄之後能夠重新再將這些 ID 補齊?

MySQL中設置了自增字段id之後,如果刪除了記錄,例如本來是1,2,3....9,10,現在刪除了4,5,10,那麼當插入下一條記錄時ID將會是11,我們有什麼辦法可以讓系統在下次插入時重新補齊ID,即插入的ID爲4,再下一次插入就是5

原创 Insertion Sort in Java, C,C++ and Python

/** * @Author: Chintsai Hwo * @Date: Created on 5:40 AM 6/2/2019 */ import java.util.Scanner; public class Insert

原创 java.lang.NumberFormatException: For input string: " 2"

解決辦法(有點low哈哈哈) String id = String.format("%s", request.getParameter("productId")); int realId = Integer.parseI

原创 Chapter 7 : Transcendental Functions

  7.1 Inverse Functions and Their Derivatives One-to-One Functions Inverse Functions Since each output of a one-to-on

原创 Chapter 1 : The Role of Algorithms in Computing

Before there were computers, there were algorithms. But now that there are computers,there are even more algorithms, an

原创 Techniques of Integration

  8.1 Basic Integration Formulas   8.2 Integration by Parts   8.3 Integration of Rational Functions by