Category Archives: 计算机与 Internet

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

Write a function to give out all the time (hour:minute) that the angle between minute hand and hour hand on a clock is 90 degree.

static void Main(string[] args) { for (int h = 0; h < 12; h++) { double m = 1.0; double angle = 1.0 if (h < 9) { m = 1.0*(60 * h + 180) / 11; angle = (m … Continue reading

Posted in 计算机与 Internet | Leave a comment

Reporting Services中如何对数据进行分页合计?

Report services中不直接支持分页合计,实现这个功能得加些vb code(report code). 右键report区域(BIDS中最外层的黄色区域),选择report properties;打开code tab. 加入如下代码 public shared Dim _rowCount As Int32=0public shared Dim _sum as Int32=0 public Function AddToRowCount() as Int32 _rowCount = _rowCount + 1 return _rowCount End Function public Function AddToSum(ByVal quantity as Int32) as Int32 _sum+=quantity  return … Continue reading

Posted in 计算机与 Internet | Leave a comment

Adding a custom control in Datagridview cell – MSDN Forums

  Adding a custom control in Datagridview cell – MSDN Forums This article helps me add AutoComplete function in datagridview.

Posted in 计算机与 Internet | Leave a comment

实现IE7的搜索框效果

不光是IE7, 这种搜索框在VISTA上到处可见。它的特点是用浅灰色显示提示信息,在用户开始输入时变成正常的TextBox。用户再次离开该输入框时, 如果刚才输入了内容则显示输入的内容,没有输入则继续显示提示信息。这个主要涉及到获得和失去焦点的事件的处理。 先定义两个不同的字体来表示提示信息和正常输入的区别。 Font regularFont;Font ItalicFont; 初始化它们 regularFont = this.toolStripTextBoxSearch.Font;ItalicFont = new Font(regularFont, FontStyle.Italic); toolStripTextBoxSearch就是要操作的TextBox. 添加对Enter和Leave事件的处理 private void toolStripTextBoxSearch_Enter(object sender, EventArgs e)        {            if (string.IsNullOrEmpty(searchContent))            {                HideSearchContent();            }        }         private void HideSearchContent()        {            this.toolStripTextBoxSearch.Text = String.Empty;            this.toolStripTextBoxSearch.ForeColor = … Continue reading

Posted in 计算机与 Internet | Leave a comment