7.31.2014

How can I get the Google cache age of any URL or web page?

http://stackoverflow.com/questions/4560400/how-can-i-get-the-google-cache-age-of-any-url-or-web-page

 How can I get the Google cache age of any URL or web page?

Use the URL
http://webcache.googleusercontent.com/search?q=cache:
Example:
http://webcache.googleusercontent.com/search?q=cache:stackoverflow.com
It contains a header like this:
This is Google's cache of http://stackoverflow.com/. It is a snapshot of the page as it appeared on 21 Aug 2012 11:33:38 GMT. The current page could have changed in the meantime. Learn more
Tip: To quickly find your search term on this page, press Ctrl+F or +F (Mac) and use the find bar.

6.01.2014

How to Add "Open with Notepad" to Right-Click (轉貼)

同理可應用到Notepad++,
參:http://www.instructables.com/id/How-to-Add-Open-with-Notepad-to-Right-Click/

How to Add "Open with Notepad" to Right-Click

I personally hate to use "open with" due to the time, even if its only a few seconds, and having to then remember where exactly a certain program is located in my directory.

This will show you how to add ANY program to the Right-Click (Context Menu for all of your Files).

It's Easy, you cant screw it up, and it saves a bunch of time and hassle.

Since we will be dealing with regedit, and not everyone is familiar with it, i will be breaking down the steps to very simple, easy, and concise steps that anyone can follow.

 
Remove these adsRemove these ads by Signing Up

Step 1: First

Go to Start and open Run

Step 2: Second

Type in regedit.exe and click OK.

Step 3: Third

Find and expand (click on the + to the left) HKEY_CLASSES_ROOT

Step 4: Fourth

Browse down to the * key and expand it (click on the + to the left of the folder)

Step 5: Fifth

Find the key shell

Step 6: Sixth

Right Click on the key shell, go to New and create a new Key

Step 7: Seventh

Name that Key "Open with Notepad"

Right click on the Open with Notepad key and make another Key

Step 8: Eighth

Name the new Key "command"

Step 9: Ninth

Click on the command key and double click on 'the (Default) value

Step 10: Tenth

Type in "notepad.exe %1" There is a space between "notepad.exe" and "%1"

Click on OK

Step 11: Finished

Close regedit and marvel at the ease of opening text documents!

Effects should occur immediately.

Remember:

This can be used for any and all programs.

In case you are just completely confused, use the following zip file (which also comes with a handy uninstall) that will change your regedit key accordingly)

Download OpenWithNotepad registry hack

12.12.2013

GOG.com

遊戲網站,有時會送遊戲。http://www.gog.com/

2.02.2013

tortoisegit: git did not exit cleanly (exit code 128 or code 1)解法

用tortoise git,出現git did not exit cleanly (exit code 128),

但是用git卻成功。我發現移除後,再重灌無效。

但是 

1. 移除tortoise git後,

2. Open 'regedit', 再手動search 'tortoisegit'機碼,

全部刪除後。

3. 再重灌,重灌選git default的ssh,

就不會有錯了。enjoy~

 Note: 有試過這樣也無效,後來就放棄tortoise git,直接改用Git了。 

 也有可能是Git的路徑多了空白的問題:

B

Hmmm....

I unzipped the portable version into the typical install dir: "C:\Program Files (x86)\Git", and got the same errors.
Unzipped into "C:\git2", and it worked as expected.
Perhaps the problem is with the spaces in the path?

(But why does it work on the other computer....?!)

 

9.26.2012

Don't always declare global variable in C/C++

If you always declare global variable instead of local,
Once you using recursive call, you may get run time error.
See

SPOJ Problem 1436: Is it a tree – PT07Y

if you move

list<int>::iterator it;
 
 from local variable to global variable, you will get run time error 
by input following:
3 2
1 3
3 2 




4.09.2012

Random Go program ~ Brown

幾天前想寫一個GTP(Go Text Protocol) base的隨機下棋程式,
不過看了一下GTP Spec. 雖然不是很複雜,但真正要寫,
也需要一些時間,所以一直沒有實際下去寫。
今天重看GTP spec. 的網站,突然發現一個叫Brown的程式,
正好符合我的需求,很快地就下載source回來看看能否Build win版…
首先用wxDevC++,開啟一個C++的console專案,
將main.cpp的內容換成brown.c的內容,並且加入剩下的檔案到專案中,
結果在Build時,有一些錯誤,
在interface.c加上#include "string.h"就OK了。
Build成exe後,發現用Panda-glGo還是不能玩,
就去下載Drago, 稍微設定一下,
It's work!

後記:
我改了一下,使Brown go可以在Panda-glGo上玩,
下載檔案及source code

8.27.2011

Python: assign list to all zero

我學python 一陣子了,但一直不知道如何一次assign給list同一個值,
之前都是用range()來assign給list的,查了一下google,但似乎沒相關的說明,
原來我要問的問題太基本了,後來終於發現,原來很簡單,
如果要assign給list a,10000個0,那就:

a = [0] * 10000

同理,如果要assign給list a,9999個1,那就:

a = [1] * 9999