$('select').change(function($this){
console.log($this);
$($this.target).children().attr('selected' ,false);
$($this.target).children(':selected').attr('selected' ,true);
})
2015年9月8日 星期二
2015年4月1日 星期三
[MAC] 重開機後無法讀取 exFat 磁區
用 macbook 的人似乎很少在關機或重開機的
尤其是現在全面改用 SSD 之後, 闔上螢幕了馬上就可以走,打開就喚醒
整個是輕巧快速又方便
但偶爾還是會遇到了要重開機的狀況
然後慘劇就發生了,
有一個磁區掛不上
有一個磁區掛不上
有一個磁區掛不上
一般來說, 磁區掛不上不是太少見的問題
標準作業流程是打開磁碟工具程式 -> 驗證磁碟 -> 然後修復磁碟, 完成了就可以掛上
但是夜路走多了總是會...磁區髒久了會...
無法修復此磁碟
無法修復此磁碟
無法修復此磁碟
G。O。D~~~~~
裡面有我 100G 的謎...呃不..是照片啊啊啊啊~~~~~
重複了了幾次磁碟工具之後, 看樣子只能放棄修復它了
甚至已經弄了 disk drill 這個工具, 準備recovery 它
不得不說, disk drill 還頗厲害, 從磁區內救了也快要 100G 的檔案
不過美中不足的是, 資料夾結構和檔名變成流水號, 然後大約有 1% 的照片檔案有問題
但是已經覺得很強了
不過就算大部分的檔案都救回來
但是心中還是有點惆悵
所以應該要把 data 槽 format 掛回來的這件事, 也就被擱置了五天之久
正當要下手之前, 還是最後一次再問一下股溝大神
這次試用它的 naive language 問「mac cannot read expat after reboot」
果然用母語問他還是比較厲害的
然後看到這篇 blog :
http://craigsmith.id.au/2014/07/06/repairing-a-corrupted-mac-osx-exfat-partition/
他是說 exfat /ntfs /hfs 這些都沒有很完善的被osx支援, 特別是在刪檔的時候
雖然很多人說用 CHKDSK /F 可以解決問題, 但是事實上還是沒有用
最後終於找到一篇, 上面提到用這個指令
跑了之後的結果
他會問是不是要更新 MBR
打了 YES 之後, 就可以重新驗證和修復磁碟, 然後就可以掛起來了~YAAA
尤其是現在全面改用 SSD 之後, 闔上螢幕了馬上就可以走,打開就喚醒
整個是輕巧快速又方便
但偶爾還是會遇到了要重開機的狀況
然後慘劇就發生了,
有一個磁區掛不上
有一個磁區掛不上
有一個磁區掛不上
一般來說, 磁區掛不上不是太少見的問題
標準作業流程是打開磁碟工具程式 -> 驗證磁碟 -> 然後修復磁碟, 完成了就可以掛上
但是夜路走多了總是會...磁區髒久了會...
無法修復此磁碟
無法修復此磁碟
無法修復此磁碟
G。O。D~~~~~
裡面有我 100G 的謎...呃不..是照片啊啊啊啊~~~~~
重複了了幾次磁碟工具之後, 看樣子只能放棄修復它了
甚至已經弄了 disk drill 這個工具, 準備recovery 它
不得不說, disk drill 還頗厲害, 從磁區內救了也快要 100G 的檔案
不過美中不足的是, 資料夾結構和檔名變成流水號, 然後大約有 1% 的照片檔案有問題
但是已經覺得很強了
不過就算大部分的檔案都救回來
但是心中還是有點惆悵
所以應該要把 data 槽 format 掛回來的這件事, 也就被擱置了五天之久
正當要下手之前, 還是最後一次再問一下股溝大神
這次試用它的 naive language 問「mac cannot read expat after reboot」
果然用母語問他還是比較厲害的
然後看到這篇 blog :
http://craigsmith.id.au/2014/07/06/repairing-a-corrupted-mac-osx-exfat-partition/
他是說 exfat /ntfs /hfs 這些都沒有很完善的被osx支援, 特別是在刪檔的時候
雖然很多人說用 CHKDSK /F 可以解決問題, 但是事實上還是沒有用
最後終於找到一篇, 上面提到用這個指令
- sudo fsck_exfat -d disk0s4
跑了之後的結果
他會問是不是要更新 MBR
- Main boot region needs to be updated. Yes/No?
打了 YES 之後, 就可以重新驗證和修復磁碟, 然後就可以掛起來了~YAAA
2014年12月12日 星期五
20141212_拆拆 Apple magic trackpad
APPLE magic trackpad
話說 Apple 的產品真的很神奇
以這塊 magic trackpad 來說
剛拿到的時候覺得最神奇的就是
看不出任何按鍵卻會有按壓的手感,
翻來翻去推敲之後, 原來是下面的這兩顆蛋..是偽裝成緩衝墊的蛋按紐
不過最近一直覺得左邊的手感不太好, 今天終於受不了, 打算把它拆看看看裡面到底有什麼毛病
立馬參考著名的ifuckitifixit
然後到了 step 4 ......
把下方的卡榫挑起來後, 怎麼樣都掀不開 .... 認真的看了說明發現
Don't pry up along the bottom
Don't pry up along the bottom
Don't pry up along the bottom
要從上方掰開...話說你不要放這麼容易讓人誤會的圖阿 =_=
不過就算從上方, 也是花了一點力氣
原來下蓋是和這塊用像是這個蛛絲一樣的東西黏住的

接下來就是把下面的這個鐵片拆開, 應該就可以看到
那個有問題的薄膜按鍵了
來一張小到不行的螺絲照

話說拆開了之後發現
左邊沒有按鍵
左邊居然沒有按鍵
左邊居然沒有按鍵阿阿阿!!

那我覺得左邊越來越鬆是我的錯覺嗎 Orz
默默的把下方鐵片裝回去之後
想說不能就這樣算了
至少也動一些手腳吧
於是就

把左邊的鐵片稍微凹了 1~2 度(看不出來)
然後把下蓋黏回去之後...
還好真的有那麼一點手感回來的錯感覺
也不算是白拆了這一回.....(嘴硬)
話說 Apple 的產品真的很神奇
以這塊 magic trackpad 來說
剛拿到的時候覺得最神奇的就是
看不出任何按鍵卻會有按壓的手感,
翻來翻去推敲之後, 原來是下面的這兩顆
不過最近一直覺得左邊的手感不太好, 今天終於受不了, 打算把它拆看看看裡面到底有什麼毛病
立馬參考著名的
然後到了 step 4 ......
把下方的卡榫挑起來後, 怎麼樣都掀不開 .... 認真的看了說明發現
Don't pry up along the bottom
Don't pry up along the bottom
Don't pry up along the bottom
要從上方掰開...話說你不要放這麼容易讓人誤會的圖阿 =_=
不過就算從上方, 也是花了一點力氣
原來下蓋是和這塊用像是這個蛛絲一樣的東西黏住的

接下來就是把下面的這個鐵片拆開, 應該就可以看到
那個有問題的薄膜按鍵了
來一張小到不行的螺絲照

話說拆開了之後發現
左邊沒有按鍵
左邊居然沒有按鍵
左邊居然沒有按鍵阿阿阿!!

那我覺得左邊越來越鬆是我的錯覺嗎 Orz
默默的把下方鐵片裝回去之後
想說不能就這樣算了
至少也動一些手腳吧
於是就

把左邊的鐵片稍微凹了 1~2 度(看不出來)
然後把下蓋黏回去之後...
還好真的有那麼一點手感回來的
也不算是白拆了這一回.....(嘴硬)
2013年7月22日 星期一
[sql server]列出 engine 內所有 database
ref : http://msdn.microsoft.com/en-us/library/ms188613.aspx
select * from sys.databases
[sql server]取得目前所在資料庫名稱
ref : http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/
SELECT DB_NAME()
2013年7月16日 星期二
[SQL server] 字串前的 'N'
code like this :
表示後面接的字串是 unicode 的文字
SELECT *
FROM tableA
WHERE columnA
LIKE N'%文字%'
表示後面接的字串是 unicode 的文字
2013年7月15日 星期一
[C#] using() 的意義
-----------------------------------------------------------
ref : http://msdn.microsoft.com/zh-tw/library/yh598w02.aspx
-----------------------------------------------------------
在 using() 宣告並初始化的物件, 在離開 using(){} 前會自動 Dispose() .
記憶體管理用
也就是說, 以上這段 code, 實際上會有以下這段的功能
ref : http://msdn.microsoft.com/zh-tw/library/yh598w02.aspx
-----------------------------------------------------------
在 using() 宣告並初始化的物件, 在離開 using(){} 前會自動 Dispose() .
記憶體管理用
using (Font font1 = new Font("Arial", 10.0f))
{
byte charset = font1.GdiCharSet;
}也就是說, 以上這段 code, 實際上會有以下這段的功能
{
Font font1 = new Font("Arial", 10.0f);
try
{
byte charset = font1.GdiCharSet;
}
finally
{
if (font1 != null)
((IDisposable)font1).Dispose();
}
}
[C#] @的用法
------------------------------------
ref : http://note.tc.edu.tw/209.html
------------------------------------
@之後的字串會把 \ 當成一般字元處理
sample 1 :
c:\program files\
string d = "c:\\program files\\"
string e = @"c:\program files\"
sample 2 : 要使用特殊字的話
"c:\program files\"
string f = "\"c:\\program files\\\""
string e = @""c:\program files\""
2013年3月30日 星期六
[objective C] 定時重複執行 NSTimer
NSTimer 可以設定倒數時間, 時間到了就去把指定的方法叫起來跑,
例如說我要每 0.5 秒換一次背景顏色, 就要先定義好
1) 換顏色的方法 - (void) changeBgColorOfRootView:(NSTimer *)sender,
2) 生出一個 0.5 秒後會觸發的 NSTimer 出來,
使用的方法如下:
viewController.m :
- (void) changeBgColorOfRootView:(NSTimer*)sender
{
[self.view setBackgroundColor:
[UIColor colorWithRed: (float)rand()/RAND_MAX
green:(float)rand()/RAND_MAX
blue:(float)rand()/RAND_MAX
alpha:(float)rand()/RAND_MAX ]] ;
[UIColor colorWithRed: (float)rand()/RAND_MAX
green:(float)rand()/RAND_MAX
blue:(float)rand()/RAND_MAX
alpha:(float)rand()/RAND_MAX ]] ;
- (void)viewDidLoad
{
...
[NSTimer
scheduledTimerWithTimeInterval:0.5
target:self
selector:@selector(changeBgColorOfRootView:)
userInfo:nil
repeats:YES];
scheduledTimerWithTimeInterval:0.5
target:self
selector:@selector(changeBgColorOfRootView:)
userInfo:nil
repeats:YES];
...
}
相關說明
-----------------------------------------------------
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval) seconds
target:(id)target
selector:(SEL)aSelector
userInfo:(id)userInfo
repeats:(BOOL)repeats
Description
Creates and returns a new NSTimer object and schedules it on the current run loop in the default mode. After seconds seconds have elapsed, the timer fires, sending the message aSelector to target.
Parameters
secondsThe number of seconds between firings of the timer. If seconds is less than or equal to 0.0, this method chooses the nonnegative value of 0.1 milliseconds instead.
target
The object to which to send the message specified by aSelector when the timer fires. The target object is retained by the timer and released when the timer is invalidated.
aSelector
The message to send to target when the timer fires. The selector must correspond to a method that returns void and takes a single argument. The timer passes itself as the argument to this method.
userInfoThe user info for the timer. The object you specify is retained by the timer and released when the timer is invalidated. This parameter may be nil.
repeats
If YES, the timer will repeatedly reschedule itself until invalidated. If NO, the timer will be invalidated after it fires. Returns A new NSTimer object, configured according to the specified parameters. Availability iOS (2.0 and later)
Declared NSTimer.h Reference
2013年3月27日 星期三
[objective C] .m 裡面的 @interface
ref : http://stackoverflow.com/questions/3967187/difference-between-interface-definition-in-h-and-m-file#_=_
一般來說, 在 objective C 宣告和實作應該會分別存放在 .h 和 .m 檔中,
然後用 @interface ... @end 和 @implementation ...@end 標開來,
但是有時候 @interface 也會出現在 .m 中 , 像這樣
文中的解釋是說. 在 .m 檔的 @interface 中的宣告叫做 "class extension"(類別延伸?), 自動會變成 private ,
more info : http://macdevelopertips.com/objective-c/objective-c-categories.html
一般來說, 在 objective C 宣告和實作應該會分別存放在 .h 和 .m 檔中,
然後用 @interface ... @end 和 @implementation ...@end 標開來,
但是有時候 @interface 也會出現在 .m 中 , 像這樣
Person.h:
@interface Person
{
NSString *_name;
}
@property(readwrite, copy) NSString *name;
-(NSString*)makeSmallTalkWith:(Person*)person;
@end
Person.m:
@interface Person () //Not specifying a name for the category makes compiler checks that these methods are implemented.
-(void)startThinkOfWhatToHaveForDinner;
@end
@implementation Person
@synthesize name = _name;
-(NSString*)makeSmallTalkWith:(Person*)person
{
[self startThinkOfWhatToHaveForDinner];
return @"How's your day?";
}
-(void)startThinkOfWhatToHaveForDinner
{
}
@end
文中的解釋是說. 在 .m 檔的 @interface 中的宣告叫做 "class extension"(類別延伸?), 自動會變成 private ,
more info : http://macdevelopertips.com/objective-c/objective-c-categories.html
2011年6月13日 星期一
[周二剪] 令人掬一把同情淚的津津蘆筍汁
還是寫在前面好了
目前市面上津津賣的蘆筍汁早就沒有用塑化劑當起雲劑了!!!
津津蘆筍汁曾是大家耳熟能詳的飲料, 說起蘆筍汁, 大概也只想得起津津這個品牌
雖然夜市打彈珠或是
但總是想不起前面那兩個字到底是律律還是聿聿...總之不會是水字旁 ...
話說這家公司從年銷 13 億, 員工上千人, 到現在營收 600 萬, 員工 40 人,
中間的轉折就是民國 94 年被老闆虧空 6 億, 甚至差點被拍賣
到現在好不容易能打平的時候, 又爆出了起雲劑的事件
起雲劑原本就是要讓液體內溶解的東西不分離出來, 也就是說, 濁濁的飲料內大概就是會有加起雲劑
運動飲料 -> 濁
果汁-> 濁
沖泡式乳酸製品 -> 濁
蘆筍汁 -> 濁......
但是津津自從老闆落跑之後, 起雲劑的原料商就改成在地的供應商了
所以目前的起雲劑是正常的東西, 所以應該要請大家安心食用才對
但是請看各大報的標題
塑化劑風暴/津津蘆筍汁 60年老店涉塑毒風暴/TVBS
津津蘆筍汁曾摻塑化劑 4億瓶早喝光/ 聯合新聞網
津津蘆筍汁3年前摻塑化劑 4億罐早已喝下肚 / NOWnews
這....看了之後還敢喝嗎.........
我如果是現在津津的員工的小孩, 一定會每天做草人插針阿!!!!
而且一定先扎嘴!!扎嘴!!扎嘴!!扎嘴!!扎嘴!!
不曉得會有多少人隔天頂著東成西就的香腸嘴出現在公司
嘖!!
相關連結:
救救「津津蘆筍汁」/FACEBOOK
津津蘆筍汁,其他罐裝飲料,飲品/ 礦泉水,快速到貨- Yahoo!奇摩購物中心
津津蘆筍汁-津津老員工32人 5年沒薪自己賺_/一隻笨臘腸和我
下面是一些備份的新聞
最有趣的是TVBS .... 我怎麼不知道津津有出酸酸甜甜的蘆筍汁....
不知道是新口味還是 .......
2010年11月9日 星期二
[Incurable diseases] 跑不出正常速度的電腦 ......
206 這台電腦挾帶著 Q9400 + 4G ram 的威力跑起來應該會有令人滿意的速度,
但老師應該也體驗過它不僅運做速度還好, 操作起來還會有莫明其妙的頓顛.
但是一直都沒有辦法找出原因, 最近因為聽耳機常有爆音去找了一下資料
http://modernmusician.com/forum/showthread.php?t=87166
發現了這個叫 DPC 的東西, 嘗試前人的方法後灌了新的 graphic driver.

情況有改善,但 DPC latency 仍在2000 上下徘徊,

後來發現有人有同樣的問題
http://www.mobile01.com/topicdetail.php?f=488&t=1810787&p=1
於是進了bios 亂調......沒想到把 acpi 2.0 打開後 .... 情況就變好了 Orz

現在終於有感覺Q9400 正常的威力了 Orz
但老師應該也體驗過它不僅運做速度還好, 操作起來還會有莫明其妙的頓顛.
但是一直都沒有辦法找出原因, 最近因為聽耳機常有爆音去找了一下資料
http://modernmusician.com/forum/showthread.php?t=87166
發現了這個叫 DPC 的東西, 嘗試前人的方法後灌了新的 graphic driver.
情況有改善,但 DPC latency 仍在2000 上下徘徊,
後來發現有人有同樣的問題
http://www.mobile01.com/topicdetail.php?f=488&t=1810787&p=1
於是進了bios 亂調......沒想到把 acpi 2.0 打開後 .... 情況就變好了 Orz
現在終於有感覺Q9400 正常的威力了 Orz
2010年11月4日 星期四
[Java] super 的用法
ref: http://www.wretch.cc/blog/ez880/11180898
/**使用super保留字來呼叫父類別的成員
*super通常有兩種用途
*第一種是讓子類別用來呼叫父類別的建構式(ConsTructor)
*第二種是在子類別中透過super來呼叫父類別那些相同名稱的的成員
*語法如下
*super([引數串列]) //呼叫父類別的建構式
*super.資料成員 //存取父類別的資料成員
*super.方法成員([引數串列]) //呼叫父類別的方法成員
*/
class Student{
private int weight,height; //受保護的weight,height變數
Student(){ // Student方法
weight = 0; height=0; //初始化weight height
}
Student(int weight,int height){ //Student方法
this.weight = weight; //使用this保留字來參考目前的類別成員(解決名稱重複的方法)
this.height = height; //使用this保留字來辨認資料成員height等於參數height
}
void showData(){ //showData方法
System.out.printf("身高:%s \t體重 %s",this.weight, this.height); //使用this保留字讓系統讀取參數weight height
}
}
class SonStudent extends Student{//繼承Student父類別
private int score;//受保護的score變數
SonStudent(){//SonStudent方法
super(); //呼叫Student父類別的Student()建構式
score=0;
}
SonStudent(int weight,int height,int score){ //SonStudent
super(weight,height); //呼叫Student父類別的Student(int weight,int height)方法
this.score = score; //使用this保留字讓系統辨認資料成員score等於參數score
}
void showData(){ //showData方法
super.showData(); //呼叫父類別的showData方法
System.out.print("\t成績:"+this.score); //使用this保留字來讓系統辨認資料成員score為SonStudent方法中的參數score }
}
public class SuperDemo {//SuperDemo類別
public static void main(String[] args) { //宣告一個static靜態成員 無回傳型態(void) 並是(main)程式進入點 Student Peter= new Student(50,170); //宣告Peter物件屬於Student並建立Peter物件 使用SonStudent(50,170) Peter.showData(); //呼叫父類別的showData方法
System.out.println("\n");
SonStudent Lung = new SonStudent(65,164,99); //宣告Peter物件屬於Student並建立Peter物件
Lung.showData(); //呼叫子類別的showData()方法
}
}
引用: Java2 完美的演譯 知城數位
/**使用super保留字來呼叫父類別的成員
*super通常有兩種用途
*第一種是讓子類別用來呼叫父類別的建構式(ConsTructor)
*第二種是在子類別中透過super來呼叫父類別那些相同名稱的的成員
*語法如下
*super([引數串列]) //呼叫父類別的建構式
*super.資料成員 //存取父類別的資料成員
*super.方法成員([引數串列]) //呼叫父類別的方法成員
*/
class Student{
private int weight,height; //受保護的weight,height變數
Student(){ // Student方法
weight = 0; height=0; //初始化weight height
}
Student(int weight,int height){ //Student方法
this.weight = weight; //使用this保留字來參考目前的類別成員(解決名稱重複的方法)
this.height = height; //使用this保留字來辨認資料成員height等於參數height
}
void showData(){ //showData方法
System.out.printf("身高:%s \t體重 %s",this.weight, this.height); //使用this保留字讓系統讀取參數weight height
}
}
class SonStudent extends Student{//繼承Student父類別
private int score;//受保護的score變數
SonStudent(){//SonStudent方法
super(); //呼叫Student父類別的Student()建構式
score=0;
}
SonStudent(int weight,int height,int score){ //SonStudent
super(weight,height); //呼叫Student父類別的Student(int weight,int height)方法
this.score = score; //使用this保留字讓系統辨認資料成員score等於參數score
}
void showData(){ //showData方法
super.showData(); //呼叫父類別的showData方法
System.out.print("\t成績:"+this.score); //使用this保留字來讓系統辨認資料成員score為SonStudent方法中的參數score }
}
public class SuperDemo {//SuperDemo類別
public static void main(String[] args) { //宣告一個static靜態成員 無回傳型態(void) 並是(main)程式進入點 Student Peter= new Student(50,170); //宣告Peter物件屬於Student並建立Peter物件 使用SonStudent(50,170) Peter.showData(); //呼叫父類別的showData方法
System.out.println("\n");
SonStudent Lung = new SonStudent(65,164,99); //宣告Peter物件屬於Student並建立Peter物件
Lung.showData(); //呼叫子類別的showData()方法
}
}
引用: Java2 完美的演譯 知城數位
2010年6月30日 星期三
2010年3月24日 星期三
[ubuntu] 加新網卡
ubnutu 增加新網卡後似乎不會自動啟動
所以要手動更改
1.用 dmesg | grep eth 找出網卡
mar@ubuntu-hadoop:~$ dmesg | grep eth
[ 2.013388] eth0: registered as PCnet/FAST III 79C973
2.修改 /etc/network/interfaces ,加入
auto eth0
iface eth0 inet dhcp
以上是 dhcp 的設定法, 如果要指定網路位置的話要設
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.254
3.重啟網路
sudo /etc/init.d/networking restart
這樣就可以囉 ...
所以要手動更改
1.用 dmesg | grep eth 找出網卡
mar@ubuntu-hadoop:~$ dmesg | grep eth
[ 2.013388] eth0: registered as PCnet/FAST III 79C973
2.修改 /etc/network/interfaces ,加入
auto eth0
iface eth0 inet dhcp
以上是 dhcp 的設定法, 如果要指定網路位置的話要設
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.254
3.重啟網路
sudo /etc/init.d/networking restart
這樣就可以囉 ...
2010年1月6日 星期三
[軟工]C# 中更改資料庫連線的位置
訂閱:
文章 (Atom)








