Tuesday, March 27, 2012

Grace Hopper to Programmers: Mind Your Nanoseconds!

Computing pioneer Grace Hopper, inventor of the compiler, searched for a concrete way to create an intuitive understanding of just how fast is a nanosecond, a billionth of a second, which was the speed of their new computer circuits. As an illustration she settled on the length of wire that is as long as light can travel in one nanosecond. The length is a very portable 11.8 inches. A microseconds worth of wire is a still portable, but a much bulkier 984 feet. In one millisecond light travels 186 miles, which only Hercules could carry. In today's terms, at a 3.06 GHz clock speed, there's .33 nanoseconds between ticks, or 3.73 inches of light travel.


Understanding the profligate ways of programmers, she suggests that every programmer wear a necklace of a microseconds worth of wire so they know what they are wasting when they throw away microseconds. And if a General is busting your chops about satellite messages taking too long to send, you can bust out your piece of wire and explain there's a lot of nanoseconds between here and there.
Here's a short, witty, and wise video of her famous nanosecond demonstration. An amazing lady, great innovator, an engaging speaker, and an inspiring teacher.






All credit to the http://highscalability.com/ blog.

Saturday, March 17, 2012

Essential Windows Keyboard Shortcuts

After reading an interesting tweet about the time saved utilizing shortcuts, but with no useful link attached I figured it’s worthwhile to do a post about the basics I use daily.

OS
'PrtScn' - Save screen capture to clipboard.
'Windows button' - Opens start menu.
'Windows button' + 'Tab' - Show all active windows in task bar.
'Windows button' + 'm' - Show desktop \ minimize all.
'Windows button' + 'l' - Lock computer.
'Alt' + 'Tab' - Toggle open programs.
'Alt' + 'PrtScn' - Save focused window as screen cap to clipboard.
   
General App Shortcuts
'Ctrl' + 'z' - Undo last action.
'Ctrl' + 'y' - Redo last action.
'Crtl' + 'o' - Open.
'Crtl' + 's' - Save.
'Ctrl' + 'w' - Close active file/window.
'Crtl' + 'q' - Quit application.
'Ctrl' + 'f' - Find.
   
Text or files & folders
'Ctrl' + 'a' - Select all.
'Ctrl' + 'x' - Cut to clipboard.
'Ctrl' + 'c' - Copy.
'Ctrl' + 'v' - Paste.
   
Browser Shortcuts
'F5' - Refresh current page.
'Ctrl' + 'F5' - Force reload of current page.
'Backspace' - Back to previous page(s).
   

Update (2012/06/17):
http://www.microsoft.com/enable/products/keyboard.aspx
Currently the above link provides all the Microsoft shortcut keys you’ll ever need: Windows, Internet Explorer, Office 2003-2010 to name but a few.

Wednesday, March 7, 2012

Runas

'Runas' allows a user to run specific tools and programs with different permissions than the user's current logon provides.

Scenario:
Your happily busy supporting a client ‘contoso’ from a remote location using a local VM that mimics most of their environment, along with an active VPN connection to be able to make the required network calls to the backend system while actively debugging.

This works fine in most cases for example interfacing with contoso's TFS, SQL, ect.
However I was faced with a bit of a predicament where the VM in question was not on contoso’s domain so the instance of VS was running under the local admin account and not my contoso AD account. This resulted in the one call going via a com+ proxy to use my local creds even thow its set to impersonate user X. After a LONG struggle of trying to jump throw the one hoop after the other I found myself running face first into the one wall after the other till I found this handy little parameter for the runas command… /netonly Indicating that the user information specified is for remote access only and so doing I could open VS and continue solving the issue at hand. :)

Happy coding

Syntax:
runas [{/profile|/noprofile}]
[/env]
[/netonly]
[/smartcard]
[/showtrustlevels]
[/trustlevel]
/user:UserAccountName program
Example:
runas /netonly /user:contoso\petri.malherbe 
"C:\Program Files (x86)\...\IDE\devenv.exe"

Parameters:

/profile
Loads the user's profile. /profile is the default.
/no profile
Specifies that the user's profile is not to be loaded. This allows the application to load more quickly, but it can also cause a malfunction in some applications.
/env
Specifies that the current network environment be used instead of the user's local environment.
/netonly
Indicates that the user information specified is for remote access only.
/smartcard
Indicates whether the credentials are to be supplied from a smartcard.
/showtrustlevels
Lists the /trustlevel options.
/trustlevel
Specifies the level of authorization at which the application is to run. Use /showtrustlevels to see the trust levels available.
/user:UserAccountName
Specifies the name of the user account under which to run the program. The user account format should be user@domain or Domain\User.
program
Specifies the program or command to run using the account specified in /user.
/?
Displays help at the command prompt.


Microsoft Remarks:
It is good practice for administrators to use an account with restrictive permissions to perform routine, nonadministrative tasks, and to use an account with broader permissions only when performing specific administrative tasks. To accomplish this without logging off and back on, log on with a regular user account, and then use the runas command to run the tools that require the broader permissions.