Thursday, May 06, 2010
Win 7 Taskbar Shortcuts
via LifeHacker: http://lifehacker.com/5532578/the-power-users-guide-to-the-windows-7-taskbar
- Win+number (1-9): Starts the application pinned to the taskbar in that position, or switches to that program.
- Shift+Win+number (1-9): Starts a new instance of the application pinned to the taskbar in that position.
- Ctrl+Win+number (1-9): Cycles through open windows for the application pinned to the taskbar in that position.
- Alt+Win+number (1-9): Opens the Jump List for the application pinned to the taskbar.
- Win+T: Focus and scroll through items on the taskbar.
- Win+B: Focuses the System Tray icons.
- Drag+Drop taskbar buttons or System Tray icons: to reorganize them.
- Shift+Click on a taskbar button: Open a program or quickly open another instance of a program.
- Ctrl+Shift+Click on a taskbar button: Open a program as an administrator.
- Shift+Right-click on a taskbar button: Show the window menu for the program (like XP does).
- Shift+Right-click on a grouped taskbar button: Show the window menu for the group.
- Ctrl+Click on a grouped taskbar button: Cycle through the windows of the group.
- Drag a File to a taskbar button: to pin the file to the current application's Jump List.
- Shift+Drag a File to a taskbar button: to open a file with the current application.
- Middle-Click on a taskbar button: to open a new instance of the application.
- Middle-Click on a Aero Thumbnail: to close that application instance.
- Left-Click + Drag upwards: to open the Jump List for an application.
Visual Studio 2010 – Multiple Monitors – Display weirdness
I was having crazy problems/issues with Visual Studio 2010 and multiple monitors. Intelisense would not show up on the secondary monitor. Code would suddenly disappear. Detaching a window on the main monitor and then moving it to the secondary monitor would cause the detached window to permanently disappear.
It was getting to be very annoying.
Found a fix, which looks to me that the cause has something to do with VS2010 and support for my laptop’s display adapter.
Go to Tools –> Options –> General. Disable hardware acceleration.
Sample User Story - Scrum
User Stories are an important component of any Agile project. Here is a sample one (from the agile alliance):
Title: Search for providers by provider specialty.
Description:
As a provider search user, I need the ability to search for providers by specialty so that I can more efficiently refer patients to specialists.
Acceptance criteria:
The provider search mechanism has the ability to enter a specialty.
The specialty search will have a list of provider specialties from which to select.
Searching via the provider specialty will return a list of matching specialists or a message indicating that there are no matches.
If there are more results than can fit on one page, the system will provide the capability to view the list in pages or sections.
Tuesday, May 04, 2010
Entity Framework: Inserting objects with parent/child relationships
Code to add a person object and associated addresses:
using (Model1Container mctx = new Model1Container())
{
Person person = new Person();
person.Name = "Raj";
Address address1 = new Address();
address1.Line1 = "Line 1";
person.Addresses.Add(address1);
Address address2 = new Address();
address2.Line1 = "Line 2";
person.Addresses.Add(address2);
mctx.People.AddObject(person);
mctx.SaveChanges();
}
Once SaveChanges is called, all objects (person, address1, address2) will all have the updated Id values, which can be used for other purposes in your code.
Internet Explorer crashes when you open an Office document in a Sharepoint portal
Problem: IE (7 and 8) crash when you try and open an Office document (word, excel, etc) that is part of a document library in a Sharepoint portal/site.
Fix:
- Check your MS office installation folder (typically: C:\Program Files\Microsoft Office)
- If you have 2 Office folders (named OfficeVersionNumber: Office11, Office12), then you probably have the same problem as me.
Basically there are 2 versions of Office on your machine and the version that is causing a conflict for IE when it tries to load the Office document from the Sharepoint site.
The specific DLL the conflict arises in is called “OWSSUPP.DLL”
- In my case we have Office 2003, so it should use the OWSSUPP.DLL in the Office11 folder, so all I had to do was rename the OWSSUPP.DLL to OWSSUPP.bak in the Office12 folder.
Once that was done – everything started working properly.
Sunday, May 02, 2010
C# – Useful generic delegates
Useful generic delegates, especially when you are working with lambda expressions.
Action<T> Delegate:
public delegate void Action<in T>(T obj)
Predicate<T> Delegate:
public delegate bool Predicate<in T>(T obj)
Func<T, TResult> Delegate:
public delegate TResult Func<in T, out TResult>(T arg)
Comparison<T> Delegate:
public delegate int Comparison<in T>(T x,T y)
Converter<TInput, TOutput> Delegate:
public delegate TOutput Converter<in TInput, out TOutput>(TInput input)
EventHandler<TEventArgs> Delegate:
public delegate void EventHandler<TEventArgs>(Object sender,TEventArgs e) where TEventArgs : EventArgs
VS2010 – New Feature – Searching/Navigation
Incremental Search: Find as you type in the current file
To enter incremental search mode: CTRL + I
Begin typing
To find next occurrence: F3
Navigate To: Find occurrences across all files. The new feature is that the navigate to dialog allows you find methods, files, etc using pascal casing, i.e., find “ClickMeButton_Click” by just typing CMBC.
To bring up the dialog: CTRL + ,
And if you dont already know:
CTRL + F: Find in current file
CTRL + SHIFT + F: Find in solution
VS 2010 New Feature – Multi Line Editing
This feature allows you to edit multiple lines in one go. Why? ever wanted to change the access on multiple class members (eg: private to public).
Basically you hold down the ALT key and drag a selection rectangle in front of the lines where you want the edits to appear and then start typing. Though this is hard, especially when you are working on your laptop.
So instead, use the shortcut key ALT+SHIFT+(down or up arrow key) to create the selection rectangle (in the red circle) and then start typing
Saturday, May 01, 2010
Hello World – Windows Phone 7
Loading an image in SilverLight at run-time.
Drag an image control onto the design surface. Call it SampleImage.
if (Uri.IsWellFormedUriString(UrlTextBox.Text, UriKind.RelativeOrAbsolute))
{
BitmapImage bi = new BitmapImage();
bi.UriSource = new Uri(UrlTextBox.Text, UriKind.RelativeOrAbsolute);
SampleImage.Source = bi;
}