Monthly Archives: March 2010

Product of everything except current

Product of everything except currentWrite a function that takes as input two integer arrays of length len, input and index, and generates a third array, result, such that:result[i] = product of everything in input except input[index[i]] Specifically:void everythingExcept(int len,                // … Continue reading

Posted in 计算机与 Internet | Leave a comment

修鼠标记

今天刚把一贼漂亮贼漂亮的鼠标送人,回到家想起了扔在旧物堆里的IE4.0,再看看摆在电脑旁的滚轮鼠标,不由感慨万千。IE4.0是被一鼠标杀手游戏活生生点坏的(Caution: 不要以为好鼠标玩这类游戏很爽,等玩坏了就后悔了),左键间歇性无反应。抱着破罐子破摔的想法决定尽最后的努力修一下。IE4.0还不真好拆,网上的文章只说了隐藏的螺丝的位置,却没有说前部是怎么卡住的。用了点猛劲把它掰开,直接按微动还是很起用的,感觉不是电路毛病。所以打算在按键底下垫点东西,于是粘上两片胶带纸,合上上盖,My IE4.0 is back

Posted in 计算机与 Internet | 3 Comments

Powershell script that grap books list form www.free-ebooks-download.org

Don’t use it too much.   $wc = New-Object System.Net.WebClient$homePage = $wc.DownloadString("http://www.free-ebooks-download.org/&quot;)$regex = [regex]’http://www.free-ebooks-download.org/free-ebook/%5B-\.\w/\s]*’$categoryMatches = $regex.Matches($homePage) foreach($cm in $categoryMatches){    $categoryPage = $wc.DownloadString($cm.Value);    $pageRegex = [regex]’&nbsp;<a href="([-\w.]+)">’;    $pageMatches = $pageRegex.Matches($categoryPage);    foreach($pm in $pageMatches)    {        $bookPage = $wc.DownloadString($cm.Value + $pm.Groups[1].Value);        $bookRegex = … Continue reading

Posted in 计算机与 Internet | Leave a comment