remove Intel GMA driver’s dummy “Graphics xxxx” context menu in shell integration
run as Administrator:
regsvr32 /u C:\Windows\system32\igfxpph.dll
If you want the menu back, run the command again but remove "/u".
idle bot
- #define WIN32_LEAN_AND_MEAN
- #include <windows.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- DWORD GenerateSleepMilliseconds()
- {
- unsigned int range_min = 5*60; // 5 minutes
- unsigned int range_max = 8*60; // 8 minutes
- DWORD u = (DWORD)(((double)rand() / (RAND_MAX + 1) * (range_max - range_min) + range_min)*1000);
- return u;
- }
- int main(int argc, TCHAR * argv[])
- {
- DWORD sleepms = 0;
- HWND handle = FindWindow(NULL, TEXT("魔兽世界"));
- if (handle == NULL)
- {
- return 1;
- }
- srand( (unsigned)time( NULL ) );
- while (true)
- {
- SendMessage(handle, WM_KEYDOWN,VK_SPACE, 0);
- SendMessage(handle, WM_KEYUP, VK_SPACE, 0);
- sleepms = GenerateSleepMilliseconds();
- printf_s("Sleep %d milliseconds.\n", sleepms);
- Sleep(sleepms);
- }
- }
My web proxy is reloaded. Access now at http://bit.ly/pr0xy.
It's still there http://us.feuvan.net/.
Or you may prefer this short url http://bit.ly/pr0xy.
It's now hosted on Linode.com.
Let's see when it will be suspended.
A Wordpress broken link helper
Just an example.
For wordpress ppl who changed their perm link.
- <?php
- require_once( dirname(__FILE__) . '/wp-load.php' );
- global $wpdb;
- $uri = $_SERVER["REQUEST_URI"];
- $pattern = "/^\/(\d{4})\/(\d{2})\/(\d{2})\/([^\d].*|\d+[.^-]*).html$/";
- if (preg_match($pattern, $uri, $match) == 1)
- {
- $year = $match[1];
- $month = $match[2];
- $mday = $match[3];
- $post_name = $match[4];
- if ((string)(int)$post_name == $post_name) {
- $id = (int)$post_name;
- $link = get_permalink($id);
- if ($link)
- wp_redirect($link, '301'); // Permanent redirect
- }
- $query = "SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID=post_id ".
- "AND YEAR(post_date) = $year AND MONTH(post_date) = $month AND DAYOFMONTH(post_date) = $mday ".
- "AND post_name = \"$post_name\" LIMIT 1";
- $id = (int)$wpdb->get_var($query);
- $link = get_permalink($id);
- if ($link) wp_redirect($link, '301'); // Permanent redirect
- $query = "SELECT ID FROM $wpdb->posts WHERE ".
- "YEAR(post_date) = $year AND MONTH(post_date) = $month AND DAYOFMONTH(post_date) = $mday ".
- "AND post_name = \"$post_name\" LIMIT 1";
- $id = (int)$wpdb->get_var($query);
- $link = get_permalink($id);
- if ($link) wp_redirect($link, '301'); // Permanent redirect
- $link = "/$year/$month/$mday/";
- if (strstr($_SERVER["HTTP_USER_AGENT"], "Mozilla") === FALSE) // if it's not a user
- {
- wp_redirect($link, '302');
- }
- ?>
- <html><head>
- <meta http-equiv="refresh" content="5;url=<?php echo $link;?>" / > <title>Page has moved</title> </head>
- <body><p>The permant link changes, however <i>broken link helper</i> can't solve it automaticlly, it will redirect you to <a href="<?php echo $link;?>">the date archive page</a>. It would be nice if you can report broken links to feuvan#feuvan.net.</p>
- </body></html>
- <?php } ?>
Corresponding nginx configuration block:
server {
listen 80;
server_name blog.feuvan.net;root /home/feuvan/wwwdata/blog;
index index.php;
if (-e $request_filename) {
break;
}rewrite ^/index.php/(.+)$ /index.php?q=$1 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/([^\d].*|\d+[.^-]*).html" /brokenlinkhelper.php last;
#rewrite ^/(.+)$ /index.php?q=$1 last;
rewrite ^/ /index.php last;location ~ \.php$ {
fastcgi_pass unix:/tmp/php.sock;
}
}
Hope it helps.
2009: A dynamic future of C#
70s coders learn C, Pascal, COBOL(one of the best IT jobs in economic crisis)
80s coders learn C
90s coders learn C++, Java, Delphi
21-century (long time no see this hot word during 1999-2001) coders learn C#?
- A homemade rumor by anonymous craven
On PDC 2008, Anders, former architecture of Turbo Pascal, Delphi, Visual J++, currently the father of C#, gives us a presentation “The Future of C#” about what new features C# 4.0 will have. The demo “Compiler as a service” is really cool. Think about the prompt “C# >”.
Mads Torgersen, C# Language PM gives a public released document on C# Future site, describes four main new features:
Dynamic lookup
Dynamic lookup allows you to write method, operator and indexer calls, property and field accesses, and even object invocations which bypass the C# static type checking and instead gets resolved at runtime.
Named and optional parameters
Parameters in C# can now be specified as optional by providing a default value for them in a member declaration. When the member is invoked, optional arguments can be omitted. Furthermore, any argument can be passed by parameter name instead of position.
COM specific interop features
Dynamic lookup as well as named and optional parameters both help making programming against COM less painful than today. On top of that, however, we are adding a number of other small features that further improve the interop experience.
Variance
It used to be that an IEnumerable<string> wasn’t an IEnumerable<object>. Now it is – C# embraces type safe “co-and contravariance” and common BCL types are updated to take advantage of that.
My comments:
| features | benefit | side effect |
|---|---|---|
| Dynamic lookup | dynamic (runtime type detection) versus var (compile time type inference) introduced in C#3.0. No handwritten reflection codes any more. |
No IntelliSense when programming. Difficult to defend unknown runtime exceptions, errors. |
| Named and optional parameters | ease function call of COM interop like VSTO, etc. | Named parameters looks Pythonic. But maybe Jim like this? |
| COM specific interop features | based on previous two new features, it’s easier. The biggest benefit: no runtime PIA more! |
N/A? Time to migrate old workaround code. |
| Variance | more friendly | as above. |
These new features certainly relies on new .NET framework. At least, dynamic is not a language sugar like var.
Overall, C# is becoming more and more free-style language, combined compile-time and run-time power. It’s worthy to take a look at what C# will be if you are a C# developer or even a Java, C++ lover. Write less, do more. That’s the best value of the C# evolution, IMO.












