How to measure runtimes for applications not in the program itself?
Therefore the PowerShell is a nice utility under windows. Sometimes there are reasons why it’s not possible to measure the runtime of a specific algorithm or program in itself. Means not in the native code of the program. Or you just want to measure different programs automated. Get the job done by the Windows PowerShell!
The function “Pause” I’ve taken from Windows Powershell Blog. The function “Benchmark” handles the measurments for the given program (program path).
For measuring the time while the program is running it first gets the date and saves it as a long (milliseconds since 01.01.1970) in $startTimeLong. Afterwards the external program is started, the parameter “-wait” lets the script pause until it terminates. After termination it the gets the date again and saves it as $endTimeLong. The result in milliseconds is the execution time.
Sick of *.bat – shell scripts? – Powershell (2.0)!
It’s not really something new, but I just did need it until now. So I’m surprised by the mighty of it. Additional it comes with a small IDE which makes developing and debugging very handy.
Before you enjoy the power of the shell you have to activate the script execution within your system. Therefore you have to set the execution policies:
Start the PowerShell as administrator
Get-ExecutionPolicy
Displays the current policy
Set-ExecutionPolicy RemoteSigned
This sets a policy. Valid values are:
Restricted -> Impossible to run any PS script (standart)
AllSigned -> Each script needs to be signed (check PS Blog for details). Possible choice but to unhandy for my taste.
RemoteSigned -> Each local script can run unsigned, scripts from the web need to be signed. My choice!
Unrestricted -> Each script runs! Way to insecure!!!
After changing the policy it’s possible to run your scripts. You can simply work with a text editor (eg. Notepad++) and save the script as *.ps1. If you’re doing so, you can start the script by double click in your file browser.
Even more comfortable is the PowerShell ISE. It comes with syntax highligthing, part execution and real debugging.
Finally I have an other scope: Using it as a calculator! Nice if you want to see your calculation and not just the final result. More…
Just install the driver by running the corresponding *.exe file. Afterwards switch to debugging mode at your Galaxy: Settings -> Application -> Development; Tick the debugging mode! Finally you have to plug in the USB cable. Now “run” your application from Eclipse and it will automated chose your mobile as target!
I found a nice piece in the web. A guy upgrading through all versions of Windows since 1.0 in a VM. Games from this early Version (1985) still work on Win 7 (2009)
Did you ever think about hacking a mobile operating system?
If you do so be carefully, Apple or Sony won’t laugh. They are going to discuss the legal aspect at a court
Microsoft has a different approach: The developer team ChevronWP7 jailbreaked a Windows Phone 7 and got a free T-Shirt (see here).
Furthermore they are going to have an open discussion with the community to make “home-brew” possible. We’ll see if it’s just a marketing strategy or if they going to follow a new approach…
Everybody wants to have a notebook which is as silent as possible but how to test that quickly while you are in the store? Mostly the CPU fan makes most noise in a computer. There is a very simple solution to set a CPU under full load with Windows XP.
Just open a calculator (win key + r; enter ‘calc’; [calculator opens] switch to scientific view; calculate the factorial for a big number > 10000;) Repeat that for every existing core and check with taskmanager the load.
–> The PC will be under full load for several minutes and the fan is going to speed up to maximum.
This trick doesn’t work with Win7 because the calculator has been improved. For Win7 and Linux I developed an small application to set the CPU under full load.
Mit wie vielen Kernen Bootet Windows 7? Wie kann man das ändern?
Ein Kommilitone von mir behauptet das Windows 7 standardmäßig mit nur einem Kern bootet. Da das einem Poweruser mit mindestens 4 echten Kernen nicht genügen kann, wird beschrieben wie (und wo) man dieses Detail ändern kann.
Allerdings scheint mir das alles Unsinn zu sein. Auf meinem Testsystem mit einem Core 2 Quad Q9500 habe ich diverse Einstellungen getestet (jeweils 2x) und kam zu folgenden (mit der Hand gestoppten) Messwerten:
Booten ohne gesetzten Harken:
48.5s, 49.0s
Booten mit 4 Kernen:
48.7s, 49.0s
Booten mit 1 Kern:
50.4s, 50.3s
Booten mit 2 Kernen:
51.8s, 52.0s
Daraus lässt sich ableiten das Windows 7 automatisch mit den meisten Kernen bootet, also keine Veränderung gegenüber der Einstellung “mit 4 Kernen booten” zu erkennen ist. Alle anderen Konfigurationen sind langsamer, warum ein Kern schneller ist als zwei (für einen Messfehler zu großer Unterschied) kann ich auch nicht erklären.
I found a very nice tool to clean up autoruns, it’s even from Sysinternals again. Just download and start it, it’s not necessary to install it. So you can just take it with you on your USB device to help friends for example.
After starting the tool you can walk through the different tabs and see lists eg. services or logons. You can see the detail information about the keys and programs. It’s handy to clean up autoruns and find malware even though some knowledge of what you’re doing is required.
How to move the pagefile.sys from c:\ to an other destination?
I found one more solution for a to small C:\ partition. It’s possibe to move the pagefile.sys for logical adressing to an other drive.
For folks who using an english version of Win7 please just change in the registry ‘HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management’ the key ‘PagingFiles’.
For german version:
Systemsteuerung -> System -> Erweiterte Systemeinstellungen
Im Reiter ‘Erweitert’ in der ‘Leistung-Box’ auf ‘Einstellungen’
Im Reiter ‘Erweitert’ auf ‘Ändern’
Den Haken bei ‘Auslagerungsdateigröße für [...]‘ entfernen
Den Radiobutton für C:\ auf ‘Keine Auslagerungsdatei’ ändern
Für z.B. D:\ auf ‘Größe wird vom System [...]‘ setzen
Alles mit OK bestätigen und das System neustarten.
German version users can edit the registry as well of course, but it’s maybe not as clear how to do that.