Managed meets functional

Blog about programming and having fun with .Net

About me

 Venice, 2009

profile for Alexander Galkin on Stack Exchange, a network of free, community-driven Q&A sites

Project Euler

Greetings here in my blog!
My name is Alexander Galkin. I was born 1979 in Kazan, Russia, where I graduated in child medicine.
Since 2001 I live in Hamburg, Germany and work as a freelancer software and database architect and trainer for Microsoft technologies.

 Microsoft Certified Trainer
Microsoft Certified Professional Developer
MCTS Logo
MCITP Logo

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

The Zen of live coding: Win7 Zoom feature and ZoomIt from Sysinternals!

If you have ever presented something to the developer audience you have definitely had to show some features or code samples live. I often combine live coding with slide presentations, not only because it makes people wake up, but also because it gives your presentation a professional and lively touch, helping you to win the audience in case if the topic does not seem to be extremely interesting to the majority of them.

During these live shows I often feel the need to zoom to certain area of my screen in order to emphasize the actions I am taking or the code menu items I choose. The easiest way to achieve it if you present on a foreign laptop is to use the new Win7 zoom feature. By holding Winkey (the key located between Ctrl and Alt on the left-hand side of keyboard) and pressing "+" and "-" on the additional keyboard (known as "Grey Plus" and "Grey Minus") you can zoom in and out respectively.

There are several zoom levels you can reach if you press these buttons several times, enabling you to focus on the tiny little part of your screen. Your system remains fully responsive during and after zoom, you can just continue typing or choosing menu item, the magnifier would normally follow the mouse cursor (this feature is called "live zoom") unless explicitly set otherwise. If you want to leave the zoom modus you have to left-click on the magnifying glass and close the magnifier panel.

This built-in option equips you with a very handy presentation tool working right out-of-the-box. However, you might sometimes need a little bit more than just zooming. During my live presentations I often have the situation where I need to freeze the screen content for a while and to explain something in more details. I was desperately looking for a free solution which would assist me here and found a very nice tool from Systeinternals webpage called ZoomIt.

This is a small single executable (about 500 Kb) which has to be started manually and which resides in your tray after start watching for the keystrokes. The default key-mappings (Ctrl + 1..4) collide with keyboard layout switch in my system that is why I changed those, in your case you may wish to do the same, you just have to right-click on the magnifying glass icon in the tray and choose "Options":

As you can already guess the from context menu, there are basically three different functions you can run by pressing keystrokes or from this context menu.

  1. Zoom

    Zoom works similarly to the Win7 zoom feature, except for the fact that there is no more mouse pointer visible; the screen zoom, however, follows your mouse movements until the first mouse click, which unveils the reason for such a strange behavior. Basically, zoom mode captures the screenshot of your desktop and you zoom to the still non-interactive image. Being in this modus you have two options: by clicking the right mouse button you fall back to the normal screen and can continue working, by clicking the left mouse button you enter the drawing mode and can now draw with your mouse pointer, depicted as a small cross.

    By clicking the right mouse button you can go one step back and continue to zoom throughout the screenshot of your desktop. You can go back to the normal working mode either by clicking right mouse button twice or just by pressing Esc in the draw zoom mode. There are multiple keystrokes you can use in the drawing mode; you get the full description if you go to the "Draw" tab of the "Options"-Form.

    Strangely enough, there is however one keystroke which is missing in this very detailed description (you'll however find this keystroke on the adjacent tab). If you press "t" in the drawing mode you can enter any text (it will be printed using the color of you pen) and finish the text entry by pressing Esc. This helps you to annotate the screenshots quickly.

     

  2. Draw

    Draw mode is practically the same we were describing just above, the only difference is that you don't need to zoom first and you the screenshot of your complete desktop as a template for your artistic exercises.

  3. Timer

    This is a nice option if you deliver talk or workshop where you have some assignments (like implementing "Hello, World!"). In order to dim down your presentation or IDE and to stress the importance of the exercise you can start the stop clock which would countdown the time (default for 10 minutes) until the deadline.

  4. LiveZoom

    Working only on the systems starting from Vista on this mode completely mimics the zoom feature of Win7, e.g. you have a completely functional desktop you zoom at and you can continue working (typing) whereas the part of your desktop is shown magnified. Even though it may be also handy to use it as alternative to the built-in feature, I feel myself often trapped while using this feature because it is not evident how to live this mode (since the Escape button does not help you). Just press the keystroke once more to go back.

In conclusion I can just recommend you to have ZoomIt on your memory stick together with your PowerPoint presentation, so you can start this handy tool every time you need to present something (there is no need for elevated privileges to start it). With some practice you will be able to produce rather complex annotations to your desktop using this tool only!


Categories: english | sysinternals
Permalink | Comments (0) | Post RSSRSS comment feed

How to disable password request on logon in Windows 2000 – Windows7?

Password protection is essential part of the security policy and you should consider disabling it as the uttermost measure. The possible scenario includes home machine with no domain identification used only at home by family members. Do not disable the password request on your laptop under any circumstances, you may probably want to configure your laptop not to re-request your password on wake-up, but it is essential for keeping your private data secured against undesired access in case of laptop being lost or stolen.

So, in order to disable logon password request you have to do the following:

  1. Download the Autologon utility from sysinternals collection from here:
    http://technet.microsoft.com/de-de/sysinternals/bb963905.aspx
  2. Start the tool with elevated privileges:
  3. Confirm the start with elevated privileges (using safe desktop if you have UAC activated on Vista/Win7).
  4. Accept the license agreement.
  5. Enter your computer name for logon as a local user or domain name for domain logon.
    Then enter your username (local or domain) and password (shown as asterisks).
  6. Click "Enable" to enable autologon.

From now on your system will logon automatically.

In order to disable autologon in the future you have to either change the password of your account or re-start the tool and click "Disable". A message window will prompt the new status of autologon (enabled or disabled).

This solution was tested on Windows XP Professional and Windows 7 Ultimate, reportedly it also works for Windows 2000.


Categories: sysinternals | english
Permalink | Comments (0) | Post RSSRSS comment feed

How to measure the execution time of your program in Windows?

There are often cases that you need to measure the execution time of your program. Working in Windows or Linux one gets used to the "time" system utility, which allows one to measure both system and kernel time of any executable just by preceding it with complete parameter set in the command line (for instance "time du").

Pity, there is no such a handy routine in (usual) Windows installation and the "timeit.exe" solution which one might find on many Internet forums does not seem to work in all cases (at least it does not in my case of Windows 7 Ultimate). There is, however, a nice workaround for this problem, provided you want to measure the execution time of one or few runs, by using Process Explorer from Sysinternals toolset by Mark Russinovich. This solution, however, does not help in case you need to perform multiple performance run tests of your software. Please, refer to Visual Studio Profiler in this case.

  1. So, first you need to download the latest version of Process Explorer from here:
    http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
       
  2. Once you downloaded it and agreed to the user agreement you can see the main screen:

  3. You first should add the parameters you'd like to get from your program to the list of visible columns. For this purpose go to View and choose Select Columns

  4. Go to the "Process Performance" tab



    and select the counters you'd like to see in the general process list. In order to get the total execution time you'll need to tick the "CPU Time" option:



    Click OK to go back to the main screen and you will see the new column CPU Time to the very right of the process table. The order of columns can be easily changed just clicking on the column caption and dragging it to the desired position.

    Note: You might need to enlarge your Process Explorer window to see the new column.
  5. Now you are almost ready to capture the information you need. However if you now start your process and immediately switch back to the Process Explorer, find it in the list of running processes and wait until it terminates you can read the total execution time in the CPU Time column. It works fine in many cases, but you may encounter two types of problems:
    1. If the process you start just runs shortly you may miss your process, for it is already finished by the time you have switched back to Process Explorer and found it in the list.
    2. Even if you managed to get your process, the information about total runtime is quickly purged from the process list.
  6. To solve these problems let us increase the time process is shown in the list after it has terminated. For this purpose go to Options -> Difference Highlight Duration and set the duration to 9 seconds:



    Now the process will remain in the list for 9 seconds after its termination.



    That should be enough to write down its execution time. Now just start your program and read the execution time after its termination. You can easily identify the process which terminated shortly by the red background highlighting (on the screenshot you can see the "pan.exe", the compiled verifier from Spin).


Categories: general | sysinternals
Permalink | Comments (0) | Post RSSRSS comment feed