I’ve been using Visual Studio since forever, yet it always takes me a while to remember how to show line numbers. It’s especially hard to remember after a fresh install of Visual Studio. Assuming you have it installed and open, here’s how to display line numbers in your code.
- Click Tools in the menu bar
- Options
- Expand Text Editor ( in the popup window )
- Click ‘All Languages’
- Check the ‘Line numbers’ box under the Display heading ( on the right )
- Click OK
- Happy Happy Joy Joy!

Tags: display, line numbers, text editor, Visual Studio, visual studio options
Posted in .net, C#, Visual Studio, development, microsoft, tips and tricks | No Comments »
PLEASE BACKUP YOUR iPhone BEFORE REMOVING iOS4! I lost everything on my phone prior to removing iOS4 and didn’t think about saying this originally.
In case you need help removing iOS4 from your iPhone 3G, here are the steps that I followed to downgrade my iPhone 3G to OS 3.1.3. Before we get going, I’m not taking credit for these instructions since this is a cleaned up version of this MacRumors forum post. Shout out to my buddy Tony Rodgers for sending me the original link.
Required Downloads
Before you get to the steps, be sure to download these two files first.
Restore iPhone 3G to OS 3.1.3
- Connect your iPhone, open iTunes, then click your iPhone to go to the Summary screen.
- While holding down Alt ( OSX ) or Shift ( windows ), click the Restore button. If you held the correct key when clicking restore, you should get a File Open prompt.
- Select iPhone1,2_3.1.3_7E18_Restore.ipsw that you downloaded earlier and let iTunes do it’s work.
- After iTunes tries to verify the update, it should throw an error. This error is normal, so disregard even though iTunes has left your iPhone 3G in restore mode. Close iTunes.
- With your iPhone still connected, open blackra1n and click “Make it rain”.
- Manually power cycle your iPhone 3G if it doesn’t restart automatically for you.
That’s all there is to it. I know these steps work because it’s exactly what I did on my iPhone. The last part of the uninstall is pretty hairy since I wasn’t able to close iTunes without unplugging my phone. Also, when I ran blackra1n, my phone never rebooted on it’s own. The screen went black and I just unplugged the iPhone and forced a restart. When my iPhone booted up, I was back on 3.1.3.
I hope this helps somebody out because iOS4 on an iPhone 3G is horrible.
Tags: Apple, downgrade, iOS4, iphone, iPhone 3G, iTunes
Posted in hack, iphone, osx, tips and tricks, utility | 20 Comments »
One of my favorite features of the Eclipse IDE is ‘Open Resource’ ( Ctrl + Shift + R ).

Don't point and click to your files, just type their name
If you’re unfamiliar with this, it’s a File Open dialog that let’s you type the name of the file you’re looking for, instead of requiring you to point and click your way to the file. This is one of the few features I still can’t believe Visual Studio doesn’t have built in. Now I’ve had other MS experts show me similar “quick find” features of Visual Studio, but it’s still not as easy as Ctrl+Shift+R > type the filename.
When I was using Visual Studio 2008 I came across the Sonic File Finder plugin and I was hooked. Then I upgraded to Visual Studio 2010 and my plugin went away. Today I solved my quick open plugin issue by browsing the Visual Studio Gallery and installing Quick Open File. This quick open plugin does exactly what Eclipse’ Open Resource does, and it’s a good bit simpler than Sonic File Finder. Now that I’ve got the plugin installed, the next step is to configure Visual Studio to open this plugin when I hit the Ctrl + Shirt + R keyboard combination.
Add Ctrl+Shift+R to Visual Studio
- Fire up Visual Studio
- Click Tools > Options > Environment > Keyboard
- You should now be at the window for assigning keyboard shortcuts

- Type “Quick” into the Show commands containing box
- Click inside the “Press shortcut keys” box, and then press Ctrl + Shift + R on your keyboard
- Assuming you’ve set this to Global, you are now good to go.
**NOTE : When assigning a keyboard shortcut in Visual Studio, you want to make sure your new shortcut isn’t already assigned to a different command. If this is the case, you should remove your shortcut assignment from the other command before assigning to your new command. This dialog will show you what is already assigned to a keyboard combination like so.

Assuming you made it this far, pressing Ctrl + Shift + R in Visual Studio should now show you this Quick File Open dialog.

There you go, quick open in Eclipse and Visual Studio!
Tags: eclipse, msdn, open resource, plugin, quick open file, visual studio 2010, visual studio gallery, vs gallery, vs plugin
Posted in .net, Visual Studio, cool, microsoft, tips and tricks, windows | 2 Comments »
Here’s a clever little solution I would like to add to the book of ‘get it done’. While this particular example uses ASP.NET controls, this concept really applies to any language that supports DataBinding to a control.
The base concept is using your knowledge of SQL’s UNION operator to add a temp value to the beginning of a list of data from a sql query. In the past I’ve done this countless times via code, and recently I didn’t have the time to do this, so I updated the query to a UNION, and I was good to go.
Now I’m not selling this as a ‘best practice’, but I do consider this one more reason why it’s good to know SQL.
Problem : Using a SQLDataSource to populate a DropDown component, how do you inject a spacer value in position 0? EX : “- select value -”
Solution : Inject your spacer value in your SelectCommand via sql’s UNION operator
ComboBox
<asp:DropDownList runat="server" ID="meter_manufacturer_dd" DataSourceID="sql_meterManufacturer" DataTextField="Manufacturer" />
DataSource
<asp:SqlDataSource runat="server" ID="sql_meterManufacturer"
SelectCommand="
SELECT '- Choose Manufacturer -' as Manufacturer
UNION
SELECT DISTINCT Manufacturer FROM Smart_Meter_DEF"
/>
What this solution gets you.
1. Your spacer value shows up in position 0 ( because the first character is – and not alphanumeric )

2. Auto ViewState caching ( EG : going straight .NET solution, .NET handles persisting your dropdown selection between postbacks )

* in this sample, the connectionString for the SqlDataSource is set in code.
Tags: combobox, DataBind, DataBound, sql, union, viewstate
Posted in .net, database, random, sql, tips and tricks | No Comments »