.NET 下的 JavaScript 引擎 - ClearScript
今天找了一圈 .NET 下的 JavaScript 引擎,包括 jint, Javascript.Net, ClearScript 等。最后感觉还是 ClearScript 比较靠谱。

这篇 Which .NET JavaScript Engine is the fastest? 对一些 JS 引擎做了速度测试,结果中 JavaScript.Net 是最快的,但看了眼它的 github 页面,已经一年多没更新了。而第二快的 ClearScript 还是微软自家的,就是它了。
Current language: 中文 (简体)
Permanently disable driver signature enforcement in Windows 8.1
For some unsigned driver, you must disable driver signature enforcement to make it work. In Windows 8.1, this operation requires a reboot. And the settings is not permanent. It will backed to default enabled after turning on again or restart normally.

Through search, I found the program Driver Signature Enforcement Overrider from the post Permanently disable driver signature enforcement on Win 8.1 x64. It could disable driver signature enforcement permanently.



Although there is no Win 8.1 in its Supported OS list, it could work. Just follow its built-in instructions:

So how do I use it?
First and foremost; you are using this software at your own risk, we do not
take responsibility for any damages to your system, but we do not believe it
can harm anyone anyway. Secondly, User Account Control (UAC) must be
disabled in-order to use this tool as well.

1. Go ahead download and launch the application from the link below. Inside
its main menu, press on the "Enable Test Mode" button and follow the
instructions on the screen. This will enable TESTSIGNING mode, which
allows unverified system files to be loaded.

2. Now all you have to do is to add the unverified signature to the required
system files. To do so press on the "Sign a System File" button from the main
menu, and enter specific filename including full path. For example: if
ATITool64.sys from C:\Windows\System32\drivers refuses to load due to
driver signature enforcement, you should type: "C:\Windows
\System32\drivers\ATITool64.sys", and if you would like to sign more than a
single file, just repeat this procedure until you’re done, and finally reboot.

After you enabled Test Mode and added signatures to the required system
files, they should bypass Windows’s driver signature enforcement and load
without any issues. However, if for some reason you are interested to revert
it, you can re-launch the application, choose "Disable Test Mode" from the
main menu, and reboot. If you encounter issues or having questions, feel free
to post it on our forums.
Current language: English · 其他语言: 中文 (简体)
物理禁用中兴小兴看看 mini 网络摄像头的麦克风和喇叭
这篇文章有点水,主要是想说一下这个摄像头非常容易拆。

1. 撬开外壳的接缝处:


2. 拧下固定电路板的 3 颗螺丝,然后撬下电路板:


3. 拔下扬声器的插头:


4. 用胶布缠上扬声器插头防止意外的短路,堵上麦克风的拾音口:


5. 装回外壳时发现堵麦克风的胶布太大了,改成合适的尺寸:


6. 通过前面拆解能看出,其实如果只是想物理禁用麦克风的话,直接堵上外壳的拾音孔应该也行,为了保险我又粘了块胶布:

Current language: 中文 (简体)
FileSystemFinder: A PHP library that can list files and directories hierarchically using wildcard and regex patterns
Actually, this PHP library was created in the National Day holiday last year. But at that time, it was not as complete as it is now.

Today I cleaned up the code, made a few improvements, and commited it to github:

https://github.com/wudicgi/file-system-finder

The example is as follows:
  1. <?php
  2. include_once 'FileSystemFinder.php';
  3.  
  4. // List files using static method FileSystemFinder::find()
  5.  
  6. $filelist = FileSystemFinder::find('C:/php/ext/php_pdo_*.dll');
  7.  
  8. print_r($filelist);                 // via __debugInfo()
  9. echo "\r\n";
  10.  
  11.  
  12. // List files using file() method with a wildcard pattern
  13.  
  14. $filelist = (new FileSystemFinder('C:/php/ext'))
  15.     ->file('php_pdo_*.dll');
  16.  
  17. print_r($filelist->toArray());      // using toArray()
  18. echo "\r\n";
  19.  
  20.  
  21. // List files using dir() and file() method with wildcard and regex patterns
  22.  
  23. $filelist = (new FileSystemFinder('C:/php'))
  24.     ->dir('dev|ext')                                    // using default wildcard matcher
  25.     ->file('/[0-9]/', FileSystemFinder::REGEX_MATCHER); // using the specified regex matcher
  26.  
  27. foreach ($filelist as $path) {      // via SeekableIterator interface
  28.     echo "$path\r\n";
  29. }
  30. echo "\r\n";
  31.  
  32.  
  33. // A combination of using both static and non-static method
  34.  
  35. $filelist = FileSystemFinder::find('C:/php/dev|ext', FileSystemFinder::DIR_ONLY);
  36. print_r($filelist);
  37.  
  38. $filelist = $filelist->file('/[0-9]/', FileSystemFinder::REGEX_MATCHER);
  39. print_r($filelist);
  40.  
  41. echo "\r\n";
  42.  
  43.  
  44. // List files using wfio extension
  45.  
  46. if (extension_loaded('wfio')) {
  47.     $filelist = FileSystemFinder::find('wfio://E:/Music/* 笑话/* 欢乐剧场/??? *大*.wma');
  48.  
  49.     for ($i = 0; $i < count($filelist); $i++) {     // via Countable interface
  50.         echo "[$i] => $filelist[$i]\r\n";           // via ArrayAccess interface
  51.     }
  52. } else {
  53.     echo "The wfio extension is not loaded.\r\n";
  54. }
  55.  
  56. ?>

This will output:
FileSystemFinder Object
(
    [0] => C:/php/ext/php_pdo_firebird.dll
    [1] => C:/php/ext/php_pdo_mysql.dll
    [2] => C:/php/ext/php_pdo_oci.dll
    [3] => C:/php/ext/php_pdo_odbc.dll
    [4] => C:/php/ext/php_pdo_pgsql.dll
    [5] => C:/php/ext/php_pdo_sqlite.dll
)

Array
(
    [0] => C:/php/ext/php_pdo_firebird.dll
    [1] => C:/php/ext/php_pdo_mysql.dll
    [2] => C:/php/ext/php_pdo_oci.dll
    [3] => C:/php/ext/php_pdo_odbc.dll
    [4] => C:/php/ext/php_pdo_pgsql.dll
    [5] => C:/php/ext/php_pdo_sqlite.dll
)

C:/php/dev/php5ts.lib
C:/php/ext/php_bz2.dll
C:/php/ext/php_gd2.dll
C:/php/ext/php_oci8_12c.dll
C:/php/ext/php_sqlite3.dll

FileSystemFinder Object
(
    [0] => C:/php/dev
    [1] => C:/php/ext
)
FileSystemFinder Object
(
    [0] => C:/php/dev/php5ts.lib
    [1] => C:/php/ext/php_bz2.dll
    [2] => C:/php/ext/php_gd2.dll
    [3] => C:/php/ext/php_oci8_12c.dll
    [4] => C:/php/ext/php_sqlite3.dll
)

[0] => wfio://E:/Music/04 笑话/01 欢乐剧场/036 武大日记.wma
[1] => wfio://E:/Music/04 笑话/01 欢乐剧场/087 大学趣闻.wma
[2] => wfio://E:/Music/04 笑话/01 欢乐剧场/109 武大郎后传.wma
[3] => wfio://E:/Music/04 笑话/01 欢乐剧场/117 孙大圣“评职”申请书.wma
[4] => wfio://E:/Music/04 笑话/01 欢乐剧场/120 肖大明白.wma
[5] => wfio://E:/Music/04 笑话/01 欢乐剧场/156 吃大户.wma
[6] => wfio://E:/Music/04 笑话/01 欢乐剧场/160 说大道小.wma
[7] => wfio://E:/Music/04 笑话/01 欢乐剧场/168 四大…….wma
[8] => wfio://E:/Music/04 笑话/01 欢乐剧场/197 过大年.wma
Current language: English · 其他语言: 中文 (简体)
Making Windows 8.1 better to use
The following steps were recorded when I configure my Windows 8.1 64-bit system. For reference only.

1. UAC

  • Settings -> Control Panel -> User Accounts -> Change User Account Control settings
  • Choose "Never notify"

2. DPI

  • Right click on desktop -> Screen resolution -> Make text and other items larger or smaller
  • Choose "Medium - 125%"
  • Check "Let me choose one scaling level for all my displays"
  • Sign out & in
  • Right click on desktop -> View -> Small icons

3. Animate Effects

  • Settings -> Control Panel -> System -> Advanced system settings
  • Advanced -> Performance -> Settings... -> Visual Effects -> Uncheck all animate effects

4. Classic Shell

  • Install Classic Shell (Do not install Classic IE9 and Update) (Download)
  • Config
  • File Explorer -> Hide Classic Explorer Bar

5. 7+ Taskbar Tweak

  • Install 7+ Taskbar Tweak (Download)
  • Config

6. Taskbar and Navigation properties

  • Right click on taskbar -> Properties
  • Taskbar -> Check "Auto-hide the taskbar"
  • Taskbar -> Check "Use small taskbar buttons"
  • Taskbar -> Taskbar buttons: Never combine
  • Jump Lists -> Uncheck "Store and display recently opened items in Jump Lists"

7. Install Drivers

8. Default Font

  • Use Windows 8 Font Changer (Download) to modify the default font to Tahoma
  • Restart
  • Adjust ClearType

9. Region

  • Settings -> Control Panel -> Region
  • Short date: yyyy-M-d
  • First day of week: 星期日

10. Keyboard Shortcuts Underline

  • Settings -> Control Panel -> Ease of Access Center -> Make the keyboard easier to use -> Make it easier to use keyboard shortcuts
  • Check "Underline keyboard shortcuts and access keys"
  • Check "Prevent windows from being automatically arranged when moved to the edge of the screen"

11. AutoPlay

  • Start -> Control Panel -> AutoPlay
  • Uncheck "Use AutoPlay for all media and devices"
  • Each selection remains the default "Choose a default"

  • Run "gpedit.msc"
  • User Configuration -> Administrative Templates -> Windows Components -> AutoPlay Policies -> Turn off AutoPlay -> Enabled on All drives
  • Computer Configuration -> Administrative Templates -> Windows Components -> AutoPlay Policies -> Turn off AutoPlay -> Enabled on All drives

12. Built-in CD Burning

  • Run "gpedit.msc"
  • User Configuration -> Administrative Templates -> Windows Components -> File Explorer -> Remove CD Burning features -> Enabled

13. Temp Folder (optional)

  • Start -> Control Panel -> System -> Advanced system settings
  • Advanced -> Environment Variables...
  • Set TEMP, TMP = F:\Temp
  • Clear original files (%USERPROFILE%\AppData\Local\Temp)

14. Folder Recognition

  • Run Restore_Default_Folder_Templates.bat (Download)
  • Run All_Folders_Use_General_Items_Folder_Template.bat (Same download page as above)

15. Hide Library Folders


16. Set Folder Default View

17. Zip Folder

  • Import Disable_ZIP_Compressed_Folders.reg

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\CompressedFolder\CLSID]

[-HKEY_CLASSES_ROOT\SystemFileAssociations\.zip\CLSID]

  • Import Disable_CAB_Files.reg

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\CABFolder\CLSID]

[-HKEY_CLASSES_ROOT\SystemFileAssociations\.cab\CLSID]

18. Compression Software

  • Install WinRAR or 7-zip

19. Configs

  • Config Sounds (Set to no sounds)
  • Config Windows Color
  • Config Quick Launch Bar

20. Install Input Method

21. Language

  • Start -> Control Panel -> Language
  • Advanced Settings -> Switching input methods -> Let me set a different input method for each app window
  • Change language bar hot keys -> Between input languages: Ctrl + Shift
  • Config as the following screenshots:









22. AutoHotkey

  • Install AutoHotkey
  • Edit the startup script as below:

; Ctrl + Shift
^space::^shift

23. WinSAT Scheduled Task

  • Start -> Control Panel -> Administrative Tools -> Task Scheduler
  • Task Scheduler Library -> Microsoft -> Windows -> Maintenance
  • Right click WinSAT, and choose "Disable"

24. Set Power Options
Current language: English · 其他语言: 中文 (简体)
今天才知道 SysWOW64 是什么意思
现在平时很少有机会手动往 System32 目录里复制 dll 文件了。今天把 VC++ 2010 Debug 版的运行时 dll 文件复制到 System32 和 SysWOW64 目录后,运行程序还是报错。用 Dependency Walker 查看,发现这个 32 位的程序加载的是 64 位版本的 dll。

在网上一番搜索才知道,原来在 64 位 Windows 中,System32 目录下存放的都是 64 位的东西,而 SysWOW64 下存放的才是 32 位的东西。为了保持兼容性,System32 的名称就没改,而 SysWOW64 其实也没体现出来 32-bit Windows on 64-bit Windows,所以这两个文件夹的名称现在看着很容易让人糊涂。

文章就是这篇《什么是SysWow64》,推荐阅读一下。
Current language: 中文 (简体)
Notepad++ with enhanced PHP syntax highlighting
During the National Day holiday, I searched for a alternative text editor and intend to use Notepad++. But when I start using it, I found its syntax highlighting feature is a bit weak.

From this article, I knew that the Scintilla editor component using by Notepad++ uses hard-coded method to deal with syntax highlighting. To add a new type of highlighting keywords, you need to modify the C++ source code. As for the problem that keywords and function names are mixed together for PHP, it has been there for 9 years.

I could have put it away and looking for commercial softwares. But I felt the well-known Sublime Text is not good as well after trying it out. So I came back to consider modifying the source code of Notepad++. Through the modification on Oct 5, I had figured it out and commited it to the repository I forked on github:

https://github.com/wudicgi/npp-customized

Today, I merged the code of v6.8.6 to my enhanced branch

This is the PHP syntax highlighting result in original edition:


And below is my enhanced version:


Now, in the Style Configurator, you can specify the PHP keywords (WORD) and function names (FUNCTION) to different colors:

Current language: English · 其他语言: 中文 (简体)
Transform Windows 7 into Windows 8.1
A few days ago, I changed the theme of Win 7 on my office computer to Win 8.1. Now, it looks much better. Through all these years, I still cannot accept the default theme of Win 7.



You can download the Win 8.1 theme for Win 7 here:
http://www.askvg.com/download-windows-8-rtm-theme-for-windows-7/

And if you want to change the start button, login screen and so forth as well, you can refer to this article:
http://www.askvg.com/transform-windows-7-into-windows-8-vnext-without-using-customization-pack/
Current language: English · 其他语言: 中文 (简体)
Wrote a new PHP library: HtmlMinerDocument
During the National Day holiday, I wrote a new PHP library by which you can retrieve DOM elements from HTML using the simple CSS selector syntax.

Now I have commited it to github, at:
https://github.com/wudicgi/html-miner-document

The usage is straightforward. For example, the code below could retrieve the title and link of all headline news from Netease News:
  1. <?php
  2. include_once 'HtmlMinerDocument.php';
  3.  
  4. // Find all elements matching the given CSS selectors
  5.  
  6. $doc = new HtmlMinerDocument(file_get_contents('http://news.163.com/'));
  7.  
  8. $news_list = $doc->findAll('div.ns-wnews h3 a');
  9.  
  10. foreach ($news_list as $news) {
  11.     echo "$news[text] ($news[href])\r\n";
  12. }
  13.  
  14. echo "\r\n";
  15. ?>

And using the code below, you can get all threads from the collection forum of amobbs:
  1. <?php
  2. include_once 'HtmlMinerDocument.php';
  3.  
  4. // Find elements by group
  5.  
  6. $doc = new HtmlMinerDocument(file_get_contents('http://www.amobbs.com/forum-9892-1.html'));
  7.  
  8. $threads = $doc
  9.     ->findFirst('table#threadlisttableid')
  10.     ->findAll('tr')
  11.     ->findAllByGroup(array(
  12.         'title'         => 'th a.s',
  13.         'author'        => 'td.by cite a',
  14.         'last_reply'    => 'td.by em span'
  15.     ));
  16.  
  17. foreach ($threads as $thread) {
  18.     echo $thread['title']['text'];
  19.     echo ' by ' . $thread['author']['text'];
  20.     echo ' (' . $thread['last_reply']['text'] . ')';
  21.     echo "\r\n";
  22. }
  23. ?>
Current language: English · 其他语言: 中文 (简体)
入手 Kindle DXG
今天收到了前两天在淘宝上买的盒装未拆封官翻的 Kindle DXG, 收到后刷了多看。

看扫描版的 PDF, 裁边后和纸质书对比如下:


能看出字号比纸质书还是稍小一些:


整页对比,把 PDF 四周的空白裁掉,9.7 寸屏的显示区域也还是比 16 开纸质书的文字部分小:


上边对比所选的书是《你必须知道的495个C语言问题》,之所以选这本书不是因为近期在看,而是这本书是我以 2 倍定价的价格从 china-pub 买的 POD (按需印刷) 的书。如果当时有 Kindle DXG, 不知道是不是就不会买纸质书收藏了。

不过 Kindle DXG 实际看起书来,字号和分辨率的影响不算大,主要是翻页时的刷新速度比较慢,翻几页后还会黑屏全刷。这应该就是说电子书不适合看技术类书籍的原因了,将来技术类的图书还是要接着买的。

2016-5-22 后记: Kindle DXG 除了看一个规范 (specification) 的 PDF 文档用过几天外,大部分时间都是在吃灰,扫描版的技术类书籍不如看纸质的,其他类型的书自己找电子书也很麻烦。所以后来还是又入手了 Kindle Paperwhite 3, 可以在淘宝上买中亚的充值卡充值,之后用一键下单买书,很方便。买一些非技术类书籍,便宜又不占地。而且 KPW3 有背光确实比较省眼。
Current language: 中文 (简体)
More entries: [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... [17]
« Previous page · Next page »