Thursday, 2 January 2014

CPU whine hotfix for Ivy Bridge

Even on the modern Ivy Bridge Intel CPU's we have coal whine frequently.
There were plenty of solutions during the last, hm, 5 years. But here is the simplest workaround:
1) To activate: reg add HKLM\System\CurrentControlSet\Control\Processor /v Capabilities /t REG_DWORD /d 0x0007e066
2) To deactivate: reg delete HKLM\System\CurrentControlSet\Control\Processor /v Capabilities /f
Restart PC.
It really works on my new Lenovo T430s with i5-3230, on all the default power schemes, no fancy tweaking for them. Together with TPFanControl and SSD inside, I have the most silent powerhouse laptop I have ever had. But I didn't test how it drowns the battery. Will surely test it and post results here.

UPD Haven't noticed any significant difference in heat and power consumption by now (Jan 13). Highly recommend to use.

Wednesday, 1 January 2014

Highlight current line

Always look for this while tuning new Windows setups. NB.


Here is the preferable color:


Friday, 27 December 2013

Copy full path for current file in Total Commander

Add keystroke for the cm_CopyFullNamesToClip command (I use Ctrl+P):


To put the same into TC command field, use Ctrl+Shift+Enter.

Run Visual Studio under Admin always

Of course you can set "Microsoft Visual Studio 2010" link properties in the Start menu, but it doesn't suffice if you want to open your sln-files from Explorer in Admin mode. So set Admin rights for c:\Program Files (x86)\Common Files\microsoft shared\MSENV\VSLauncher.exe. If you don't do this, you will get something like "do you want to save changes to devenv.sln?" after opening the solution.

Tuesday, 3 December 2013

Use HunSpell in .NET and speed it up

To use HunSpell for Russian.

1) Take a demo-archive from NHunSpell.
2) Take AOT-based dictionary from LibreOffice. Open oxt-file with 7zip, take .dic and .aff files.
3) Load them in CSharpConsoleSample program, use the demo to test.
4) Update to latest DLLs.

The speed of the solution is acceptable in context suggesters, but not in search applications. HunSpell provides rich lists of variants, while we need short, precise lists. To achieve it, deactivate ngram-based suggesting by editing aff-file: add
MAXNGRAMSUGS 0
after
SET KOI8-R
This increases the speed dramatically (from 2 secs to several msecs for the list of 5 misspelled words), but you can get empty lists on some nontrivial typos.

Tuesday, 12 November 2013

Some strange problems with MS Word

Living with fresh installations of MS Word of different versions for a while, you can face strange problems. E.g., "File not found" window from VBA while creating default document in Office 2013, or loosing some panels from, e.g., ORFO, in Office 2003. One action will help you figure it out. Close Word, go to c:\Users\%UserName%\AppData\Roaming\Microsoft and rename Templates dir to something else. When starting Word once again, it will recreate the default Templates folder, this should fix a wast majority of "strange" problems.

Thursday, 7 November 2013

Precise time in Windows batch

The well-known time /T prints only HH:MM. But we actually have microseconds in win-batches. To have them printed, use this: echo %time%. Use this variable any way you want.