This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DISPLAY_ERRORS_VAL=`grep display_errors.*=.* '/etc/php5/apache2/php.ini'` | |
clear | |
echo "Info: 目前 ${DISPLAY_ERRORS_VAL}"; | |
echo "Info: 修改檔案需要權限, 請先輸入密碼 .." | |
sudo -v | |
if [ $? -eq 1 ]; then | |
clear | |
echo "Error: 未輸入正確密碼, 無法繼續執行" | |
sleep 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if you want to kill all process with name "inetsim" | |
ps -aux | grep inetsim | grep -v grep | awk '{print $2}' | sudo xargs kill -9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int MaxVal = 5; // Max | |
ArrayList<Integer> list=new ArrayList<Integer>(); | |
for (int i = 1; i <= MaxVal; i++) { | |
list.add(i); | |
} | |
Collections.shuffle(list); | |
for(Integer result:list) { | |
Log.e("ValOut", result+""); // Result | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Const n As Integer = 7 'edit this | |
For i As Integer = 0 To n | |
DirectCast(Me.Controls("TextBox" & n), System.Windows.Forms.TextBox).Text = 0 | |
Next |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Constellation_main { | |
public static void main(String[] args) { | |
System.out.println(getConstellationFromDate("10/01")); | |
} | |
private static String getConstellationFromDate(String strBirthday) { | |
int intBirthday = Integer.valueOf(strBirthday.replace("/","")); | |
if (intBirthday < 11 | intBirthday > 1231) { |
NewerOlder