Sunday, 12 January 2014

gcc and -ldl

Whenever you want to use POSIX functions like dlopen and dlsyn, should you put -ldl at the very end of the linking command, like:
g++ -rdynamic -Wl,-rpath,. -L. -o Progr ./Progr.o -ldl
but not like:
g++ -rdynamic  -ldl -Wl,-rpath,. -L. -o Progr ./Progr.o
Yet don't know why, accept as a fact.

Saturday, 4 January 2014

Make process run with high priority

Dirty but works. For Windows certainly :)
system ("wmic process where name=\"MyExe.exe\" CALL setpriority 128 > dummy.txt");

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: