今天在寫文件和html簡單頁面時,發現在chrome的圖片有用alt來顯示訊息,卻顯示不出來,拜讀估狗大神,發現似乎是 webkit bug ,底下是我試出的解決方式,須新增3個attribute: height, width, title,這樣就可以正確顯示訊息。
原本:
<img src="xxx.png" alt="test" />
修改後:
<img height="90" width="90" src="xxx.png" alt="test" title="test" />

mark528 發表在 痞客邦 留言(0) 人氣()


好久沒編了,還好沒忘記。

mark528 發表在 痞客邦 留言(0) 人氣()


I'm from Kinmen. 歐亞水獺保護棲地大作戰。
看到這紙模就馬上下載來做做看。有幾個小缺點,頭部那樣的黏貼邊不是很好黏,身體的底部設計過小,容易皺皺彎曲,且會變成頭重腳輕,很容易倒,所以我把尾吧稍微捲一下好站穩。
整體設計的蠻可愛的。

mark528 發表在 痞客邦 留言(0) 人氣()


相信很多人都有這困擾, Windows 自帶的記事本開些大檔案很慢很容易卡住,用 Ultraedit 又是一筆費用,於是就上網找免費又好用的替代軟體,本來在 PSPAD 和 Notepad++ 兩者中抉擇,最後選用了 Notepad++ 。
Notepad++ 此時最新的版本為 6.6.5 ,可至官網 免費下載使用,我選擇的是 Notepad++ 7z package : Don't want to use installer? 7z format. 免安裝版本,解開即可使用,只是有個小缺點,用安裝的版本,預設有整合滑鼠右鍵選單(即點檔案按右鍵可點選"使用 Notepad++ 開啟"來打開檔案),免安裝的版本就要自己增加這功能。
在官網討論區有提供相關說明及指令,底下是簡略的步驟:
1. 首先要下載 NppShell.dll(64位元用 NppShell64.dll),可由此處下載。下載後,將檔案解開放置 Notepad++ 的目錄內(壓縮檔裡面有兩個檔案請放置到 Notepad++.exe 同一目錄內)。
2. 執行指令 regsvr32 /s /i NppShell.dll (OS如果是64位元請使用 NppShell64.dll)後,會顯示如下面畫面
請確認勾選[Add context menu item],也可以在[Menu text]輸入自己喜歡的說明,最後按[OK]即可完成設定。

mark528 發表在 痞客邦 留言(0) 人氣()

哈,又是編碼問題。本來用 WebSphere 和 DB2 的環境,資料新增至資料庫中文都沒問題,怎麼一換到 tomcat 和 MySQL 這組合就中文新增到資料庫時就變成了問號。
最後試驗的結果,需在 connection string 加上 useUnicode=true&characterEncoding=utf8 這段設定,這樣中文新增到資料庫就會正常了,不會再是?字元。
JDBC use like
String conString = "jdbc:mysql://host/database?useUnicode=true&characterEncoding=utf8";
DataSource resource url like
url="jdbc:mysql://host/database?useUnicode=true&characterEncoding=utf8"

mark528 發表在 痞客邦 留言(0) 人氣()

use command:<br/>
drop index index_name

mark528 發表在 痞客邦 留言(0) 人氣()

To add columns to an existing table using the command line, enter:<br/>
ALTER TABLE table_name ADD column_name data_type null_attribute<br/>
<br/>
EX:<br/>
ALTER TABLE MyTable<br/>
ADD COLUMN1 VARCHAR(5) NOT NULL WITH DEFAULT<br/>
ADD COLUMN2 CHAR(3)

mark528 發表在 痞客邦 留言(0) 人氣()

1. drop the existing primary key, use
ALTER TABLE Table_Name DROP PRIMARY KEY;
2. add new primary key, use
ALTER TABLE Table_Name ADD PRIMARY KEY (Column1, Column2, ...);

mark528 發表在 痞客邦 留言(0) 人氣()

以前在網頁上要限制只能輸入數字都要 javascript 來輔助,查了一下網上的資料 html5 有提供 <input type="number"> 這簡便的方式來處理,BUT.....實驗之後,發現我又回去找以前的 javascript 來用了。
Input Type: number
The number type is used for input fields that should contain a numeric value.
Use the following attributes to specify restrictions:
max - specifies the maximum value allowed
min - specifies the minimum value allowed
step - specifies the legal number intervals
value - Specifies the default value
我用下面的 sample 試了一下
<!DOCTYPE html>
<html>
<body>
<form action="demo_form.aspx">
Quantity (between 1 and 5): <input type="number" name="quantity" min="1" max="5">
<input type="submit">
</form>
<p><b>Note:</b> type="number" is not supported in Internet Explorer 9 and earlier versions.</p>
</body>
</html>
當我輸入超過5或是其他英文字,一切如船過水無痕,什麼檢測都沒發生..........

mark528 發表在 痞客邦 留言(0) 人氣()

原本在 WebSphere 跑得好好的程式,怎麼換到 Tomcat 又出問題了?
2014/2/23 下午 09:30:16 org.apache.catalina.core.StandardContext filterStart
嚴重的: Exception starting filter struts2
Unable to load configuration. - bean - jar:file:/D:/WebServer/tomcat-7.0.33/webapps/1qrcardadm/WEB-INF/lib/struts2-core-2.3.15.1.jar!/struts-default.xml:53:178
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:502)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
... 19 more
Caused by: Unable to load configuration. - bean - jar:file:/D:/WebServer/tomcat-7.0.33/webapps/1qrcardadm/WEB-INF/lib/struts2-core-2.3.15.1.jar!/struts-default.xml:53:178
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
... 20 more
Caused by: Unable to load bean: type:org.apache.struts2.dispatcher.multipart.MultiPartRequest class:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest - bean - jar:file:/D:/WebServer/tomcat-7.0.33/webapps/1qrcardadm/WEB-INF/lib/struts2-core-2.3.15.1.jar!/struts-default.xml:53:178
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:245)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:226)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 22 more
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileUploadBase$SizeLimitExceededException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getDeclaredConstructors(Class.java:1836)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:235)
... 25 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 29 more
最後從 Caused by: java.lang.NoClassDefFoundError: org/apache/commons/fileupload 看出個大概,將 commons-fileupload-1.3.jar 丟到 lib 去,問題解決。

mark528 發表在 痞客邦 留言(0) 人氣()

目錄
1. Connection to database with Java
2. MySQL JDBC Driver
3. Java JDBC connection example
1. Connect to database with java
在 java 要連接到資料最簡單就是使用各資料庫提供的驅動程式,透過 JDBC 提供的接口來使用和操作資料庫。
2. MySQL JDBC Driver
從 Java 要連接到 MySQL ,你必須使用 MySQL JDBC 驅動程式。最新版的驅動程式可以從 MySQL 官網 下載,要下載此驅動程式需要有 Oracle Web 的帳號(沒有,可以註冊一個新的)。
NOTE: 安裝過程完全沒顯示會裝在哪,直接會裝在系統槽,如C:,目錄則為 C:\Program Files\MySQL\MySQL Connector J ,目錄中一拖車的東西,其實所需要的只有 mysql-connector-java-版號-bin.jar 這個檔案。
3. Java JDBC connection example
NOTE:請記得將驅動程式的 jar 加到 classpath 中。

mark528 發表在 痞客邦 留言(0) 人氣()



歷經的十個月,有空時就抓緊時間一個零件一個零件的完成,我最想做的紙模終於整個完成了,現在擺在家裡的櫃子裡。
這兩天老爸從金門來台灣,看了看,說這支很不錯,做大隻一點更好。

mark528 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。