發表文章

目前顯示的是 2月, 2018的文章

[Java] PrintStream

Java.io.PrintStream 是一個 print 的方法,不同的地方在於將字串寫到檔案的時候不會產生 IOException ,使用方法請看下面的筆記:    PrintStream ps = new PrintStream(System.out); // 一般的 output    PrintStream ps = new PrintStream(new File()); // 寫到檔案    ps.print("values"); // 要寫入的值 範例: import java . io .*; public class PrintStreamDemo { public static void main ( String [] args ) { // create printstream object PrintStream ps = new PrintStream ( System . out ); // print this string ps . print ( "This is a String" ); // print new line ps . println (); // print a new string ps . println ( "New line" ); // flush the stream ps . flush (); } } 結果: This is a String New line

查電腦是否被監視

Step1.先看看有沒有不認識的連在自己的電腦上: winXp:開始-->程式集-->附屬應用程式-->命令提示字元 鍵入「netstat」,此時在Foreign Address下面會出現所有連到自己電腦上面的名稱。 舉例來說: Grace:5438 代表有個電腦名稱叫做Grace的經由5438這個連接埠連上自己的電腦, 由於不認識此人,故認定他是駭客。 Step2.接著再把秘密客的ip找出來: 接著繼續鍵入「netstat -n」,此時Foreign Address下方出現的就是IP位置了。 舉例來說: 140.112.2.100:5438 那個從5438連進來的傢伙,IP位置就是140.112.2.100 (這是台大椰林風情BBS的位置,借來說明一下),現在把這個IP 記下來。 Step3.最後我們來查一下這人到底是誰: 進入台灣網路資訊中心的網頁 http://www.whois.twnic.net.tw/ 輸入剛剛那個IP查詢一下,就出來相關的資料了!

[Java]OCAJP證照通過

耗費了一年的時間,才通過OCAJP的證照,至於為什麼這麼久,也是因為我沒認真的在準備他。 我也不是一次就成功,而是到了第四次才通過它。這時候有些人因該就開始動金錢腦,算出我花了多少?

永遠只會說"You're Welcome!”嗎?教你更多”不客氣”的英語用法

總是只會用"You're welcome"來回覆嗎? 這的確是個非常有禮貌,在任何場合都適用的句子,但是其實還是有許多其他用法可以表達的, 很多甚至都比"You're welcome,"還簡潔,更可以讓你很快就能掌握並立即運用。 這次Engoo統整了些native speakers們都很常用的句子,有很多的機會都可以做使用, 快一起來學學道地的用語,增加你”客套”表達不客氣的能力喲! 1.Anytime! 可以用來回覆當對方向你表達感謝之意時,就跟短語"You're welcome! I'm happy to help you anytime!"一樣, 表示”不用客氣,隨時都很樂意喲!” A:”Thanks for checking my essay.” 「謝謝你幫忙檢查我的文章。」 B:”Anytime!” 「不客氣,隨時都樂意!」 2.Sure. / Sure thing. "Sure"在這邊即代表"of course!(當然!)"的意思,從字面上來說也就跟"certainly," "naturally," or "absolutely,"一樣, 皆表示這一點幫助只是理所當然,再正常不過的事呦~你也可以說"sure thing,",這跟"sure."是一樣的用法。

Java - String類別

String 類別有以下幾種:

Java- 字串比較equal & equalsIgnoreCase差別

以下資料為轉載來自『 此 』 1、使用equals( )方法比較兩個字符串是否相等。它具有如下的一般形式: boolean equals(Object str) 這裡str是一個用來與調用字符串(String)對像做比較的字符串(String)對象。如果兩個字符串具有相同的字符和長度,它返回true,否則返回false。這種比較是區分大小寫的。

Sublime Text 3 for Java

Sublime Text 就不多說介紹了,畢竟網路上一堆。 相信大家的重點是放在 如何設定給Java。

[Java] for & if 語法 1~100不顯示某數字

數字從1到100,但不顯示數字8

[知識]GUI圖形使用者介面

圖片
  Definition - What does Graphical User Interface (GUI) mean? A graphical user interface (GUI) is an interface through which a user interacts with electronic devices such as computers, hand-held devices and other appliances. This interface uses icons, menus and other visual indicator (graphics) representations to display information and related user controls, unlike text-based interfaces, where data and commands are in text. GUIl representations are manipulated by a pointing device such as a mouse, trackball, stylus, or a finger on a touch screen. The need for GUI became apparent because the first human/computer text interface was through keyboard text creation by what is called a prompt (or DOS prompt). Commands were typed on a keyboard at the DOS prompt to initiate responses from a computer. The use of these commands and the need for exact spelling created a cumbersome and inefficient interface. Reference: https://www.techopedia.com/definition/5435/graphical-u

[Windows]KB 2976978 & Windows Compatability Telemetry

今日Win10 更新update後,很明顯的感覺得有東西拖慢了系統。所以打開了Task Manager一看,出現了之前沒看過的程式並且幾乎大量佔用了硬碟的讀寫。這個程式名稱【Windows Compatability Telemetry】or【CompatTelRunner】。

[UML] Mac版 StarUML破解

1,打開對應mac版本的安裝包位置,在對應目錄/Applications/StarUML.app/Contents/www/license/node/LicenseManagerDomain.js文件中。 2,找到文件23行,修改對應下面函數更改為如下代碼:  function validate ( PK , name , product , licenseKey ) {        var pk , decrypted ;         // edit by 0xcb         return {            name : "0xcb" ,            product : "StarUML" ,            licenseType : "vip" ,            quantity : "mergades.com" ,            licenseKey : "later equals never!"         };         try {            pk = new NodeRSA ( PK );            decrypted = pk . decrypt ( licenseKey , 'utf8' );         } catch ( err ) {             return false ;         }        var terms = decrypted . trim (). split ( "\n" );         if ( terms [ 0 ] === name && terms [ 1 ] === product ) {             return {                name : name ,                product : product ,                

[Excel]國曆轉農曆VBA

建立並開啟Excel  =>  開發人員  =>  Visual Basic  =>  插入 模組   =>  輸入以下資料 : Excel公式 =NongLi(A1) 產生的結果範例: 2017/12/14 => 農曆丁酉年(雞)十一月二八日 Public Function NongLi(Optional XX_DATE As Date) Dim MonthAdd(11), NongliData(99), TianGan(9), DiZhi(11), ShuXiang(11), DayName(30), MonName(12) Dim curTime, curYear, curMonth, curDay Dim GongliStr, NongliStr, NongliDayStr Dim i, m, n, k, isEnd, bit, TheDate '獲取當前系統時間 curTime = XX_DATE '天干名稱 TianGan(0) = "甲" TianGan(1) = "乙" TianGan(2) = "丙" TianGan(3) = "丁" TianGan(4) = "戊" TianGan(5) = "己" TianGan(6) = "庚" TianGan(7) = "辛" TianGan(8) = "壬" TianGan(9) = "癸" '地支名稱 DiZhi(0) = "子" DiZhi(1) = "丑" DiZhi(2) = "寅" DiZhi(3) = "卯" DiZhi(4) = "辰" DiZhi(5) = "巳" DiZhi(6) = "午" DiZhi(7) = "未" DiZhi(8) = "申" DiZhi(9) = "酉" DiZhi(10) = "戌"

[Java][API]Action Listener

Document Reference By: https://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html  The Action Listener API The ActionListener Interface Because ActionListener has only one method, it has no corresponding adapter class. Method Purpose actionPerformed(actionEvent) Called just after the user performs an action. The ActionEvent Class Method Purpose String getActionCommand() Returns the string associated with this action. Most objects that can fire action events support a method called setActionCommand that lets you set this string. int getModifiers() Returns an integer representing the modifier keys the user was pressing when the action event occurred. You can use the ActionEvent -defined constants SHIFT_MASK , CTRL_MASK , META_MASK , and ALT_MASK to determine which keys were pressed. For example, if the user Shift-selects a menu item, then the following expression is nonzero: actionEvent.getModifiers() & ActionEvent.SHIFT_MASK Object getSour

[Blogger] 程式碼套色

1. 建立新 HTML/JavaScript 小工具 2. 輸入以下資料: <script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script> 3. 然後點選確認 4. 建立新文章,在內文中輸入 <pre class="codeblock prettyprint"> 程式碼................ </pre> 就能看到程式碼變更顏色

[Blogger] 文章中插入程式碼

1. 建立新 HTML/JavaScript 小工具 2. 輸入以下資料: <style> .post .codeblock { display: block; /* fixes a strange ie margin bug */ font-family: Courier New; font-size: 10pt; overflow:auto; background: #f0f0f0 url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAASwCAYAAAAt7rCDAAAABHNCSVQICAgIfAhkiAAAAQJJREFUeJzt0kEKhDAMBdA4zFmbM+W0upqFOhXrDILwsimFR5pfMrXW5jhZr7PwRlxVX8//jNHrGhExjXzdu9c5IiIz+7iqVmB7Hwp4OMa2nhhwN/PRGEMBh3Zjt6KfpzPztxW9MSAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzAMwzB8HS+J9kUTvzEDMwAAAABJRU5ErkJggg==) left top repeat-y; border: 1px solid #ccc; padding: 10px 10px 10px 21px; max-height:1000px; line-height: 1.2em; } </style>    3. 然後點選確認 4. 建立新文章,在內文中輸入 <pre class="codeblock prettyprint"> 程式碼................ </pre>

[Java] for迴圈 - 九九乘法表

public class Level { public static void main(String[] args){ for(int j=1;j<10;j++){ for(int i=2;i<10;i++){ System.out.printf("%d*%d=%2d ", i,j,i*j); } System.out.println(); } } } 2*1= 2 3*1= 3 4*1= 4 5*1= 5 6*1= 6 7*1= 7 8*1= 8 9*1= 9 2*2= 4 3*2= 6 4*2= 8 5*2=10 6*2=12 7*2=14 8*2=16 9*2=18 2*3= 6 3*3= 9 4*3=12 5*3=15 6*3=18 7*3=21 8*3=24 9*3=27 2*4= 8 3*4=12 4*4=16 5*4=20 6*4=24 7*4=28 8*4=32 9*4=36 2*5=10 3*5=15 4*5=20 5*5=25 6*5=30 7*5=35 8*5=40 9*5=45 2*6=12 3*6=18 4*6=24 5*6=30 6*6=36 7*6=42 8*6=48 9*6=54 2*7=14 3*7=21 4*7=28 5*7=35 6*7=42 7*7=49 8*7=56 9*7=63 2*8=16 3*8=24 4*8=32 5*8=40 6*8=48 7*8=56 8*8=64 9*8=72 2*9=18 3*9=27 4*9=36 5*9=45 6*9=54 7*9=63 8*9=72 9*9=81

[Java] Switch條件式

import java.util.Scanner; public class Level { public static void main(String[] args){ //int scor =88; //int quotient = scor/10; //char level; Scanner scanner = new Scanner(System.in); System.out.println("Please type score: "); int score = scanner.nextInt(); int quotient = score /10; char level; switch(quotient){ case 10: case 9: level = 'A'; break; case 8: level = 'B'; break; case 7: level = 'C'; break; case 6: level = 'D'; break; default: level = 'E'; break; } System.out.printf("成績為%c%n",level); } }