Saturday, November 7, 2009

Edit Mac hosts file

If I don't write this down, I'll forget it. To edit the hosts file on a Mac, open Terminal and issue the following command:

sudo nano /private/etc/hosts

You can probably figure out the rest from there.

Saturday, August 15, 2009

devLink: Objective C for Experienced OO Developers

Had a great time with you all today. Here is the slide deck from the presentation. Here is the keyboard shortcuts (from the wall ... oops! I didn't take them down. :P). Here is teh sample code we worked with.

devLink: Introduction to iPhone Development

Here's the slides from this morning's presentation. Thanks for coming out.

Wednesday, June 3, 2009

Disabling animation in Expression Blend

I have some Silverlight animations that kick off right when the control loads. Expression Blend runs these animations in the designer. Do not want. :( I found this solution. Yuk! ... but it works. Thanks.

Monday, May 18, 2009

Windows Explorer opens a new window every time I click on a folder

I made the terrible mistake of installing Windows updates this morning.  Got to work and found that ever single time I open a folder in explorer, it launches a new explorer window.  Hunted around and didn't find a satisfactory solution.  Tried to post my fix on stackoverflow, but the issue was closed.  My solution:
  1. From command prompt, regedit.
  2. Go to HKEY_CLASSES_ROOT\Folder\shell\explore\command
  3. Change (Default) from: %SystemRoot%\Explorer.exe /seperate, /e,/idlist,%I,%L
  4. To: %SystemRoot%\Explorer.exe /e,/idlist,%I,%L

Sigh ... Windows ... bless its heart.

Friday, May 8, 2009

Short Paths

Digging into Jellyfish today. A step in their documentation says, "Please do not place these files into path that includes spaces. for example, "visual studio 2008". We are fixing this problem, but not yet fixed." I happen to use the default C:\Users\FirstName LastName\Documents\Visual Studio 2008\Projects and similar paths. I am not terribly keen on putting development projects in weird places that I will forget later. So a little poking around showed me how to make simple, short paths for all this stuff. You can jimmy with these scripts to suite your taste, but I ended up happiest with a new drive letter, B, under which I could easily get to my Visual Studio projects (B:\vs\Projects), SQL Server projects (B:\sql\Projects), documents (B:\doc), etc..

  1. To get started, create a new folder to which you will map your new drive.
    1. (optional) Create a folder called link under C:\Users\FirstName LastName\.
    2. If you like, you can just use C:\Users\FirstName LastName\Documents, but I prefered to use a seperate folder so that it doesn't appear to clutter my real Documents folder with the new shortcuts (vs, sql, etc.)
  2. Open a command prompt with Administrator privileges and map your folder to a drive:
    1. subst B: "C:\Users\FirstName LastName\link"
    2. You will also want to open another command prompt without Administrator privileges and do this one same command there.
  3. Now create your links
    1. DeepZoom: mklink B:\dz /d "C:\Users\FirstName LastName\Documents\Expression\Deep Zoom Composer Projects"
    2. SQL Server: mklink B:\sql /d "C:\Users\FirstName LastName\Documents\SQL Server Management Studio"
    3. Visual Studio: mklink B:\vs /d "C:\Users\FirstName LastName\Documents\Visual Studio 2008"
    4. Documents: mklink B:\doc /d "C:\Users\FirstName LastName\Documents"
Now, from command prompts, Explorer or wherev, you can use that B drive and its sub-folders as if they were "real" paths.

If you want to delete all this stuff:
  1. Open a command prompt (with or without Administrator privileges) and remove each of the links
    1. DeepZoom: rd B:\dz
    2. SQL Server: rd B:\sql
    3. Visual Studio: rd B:\vs
    4. Documents: rd B:\doc
  2. Open a command prompt with Administrator privileges and remove your mapped drive:
    1. subst /D B:
    2. You will also want to open another command prompt without Administrator privileges and do this one same command there.
  3. Delete the link folder, if you created it.

Wednesday, April 29, 2009

SQL Server lockout

If you find yourself spending almost all of your time in SQL Server Management Studio working with the same database, it is kind of handy to set your login's default database from master to that particular database.  That way, when you fire up SSMS, the query window is ready to get to work, and you run less of a risk of adding yet another eronious table to master.  99% of the time this is pretty good.

However, if you do something like ... oh, say ... bring that database offline to dump connections so you can do a restore, and then you try to do .. oh, maybe ... anything else in SSMS, you might find that you are pretty much hosed.

Here's a quick fix:

- fire up SSMS, but don't log in yet
- click 'options>>' on the login screen
- change your default database to master
- proceed with the login
- run the following script, changing your login name:  alter login [domain\user] with default_database = master
- bring the offline database back online
- proceed wreaking havoc on your server

I'm not saying this has ever happened to me.  I'm just passing along hypothetical help to all my anonymouse friends on the interwebs.

Wednesday, March 18, 2009

Is there protection in this virus?

So ... I have McAfee products installed on my PC laptop. They are supposed to protect me from undesirable processes that hog system resources, and protect me from things like annoying pop ups. McAfee software does this by hogging system resources,

and annoying me with pop ups.

Wednesday, March 11, 2009

different blogs?

While researching some features of hosting, I found the following blog software that might be useful for future use.

- GoDaddy reference
- free, open source .net
- Features
- multi-author support

- cool demo
- Features
- easy deployment, "plug n' play"
- easy YouTube

Thursday, March 5, 2009

Blend Feng Shui (Keyboard Shortcuts)

I am having a poopy experience somewhere in the combination of Visual Studio 2008, ReSharper 4.5 and XAML editing. Lots of crashing and slowness. So, I have been using Microsoft Expression Blend to edit XAML controls. I find myself performing the following keyboard shortcuts almost every time I open Blend and/or a XAML file:

  • F4 - Hide Panels (sort of like Full Screen)

XAML file:
  • F11 (twice) - Cycle Code/Designer view to split screen
  • [CTRL]+0 - Sets the Designer zoom to Fit Screen and, more importantly, centers the control in the Designer pane


Sunday, March 1, 2009

Vista 64-bit on Inspiron 1720 ... meh

I am in the process gathering all the resources to rebuild my PC laptop. It's been about 18 months since the OS was installed, and Windows is getting old and cranky. I have a Dell Inspiron 1720 with 3gb of RAM. I considering trying to do Vista 64 bit, but just glancing down the following thread convinced me it wasn't worth it:

meh ...

I guess, all this time I have had a few issues with Vista, but certainly not the angst that keeps getting spouted about it. I still have UAP enabled. I run Visual Studio as a non-administrator, etc., etc. But, all the talk about Windows 7 and Microsoft's pseudo-admission that they missed the boat with Vista has done more to dampen my enthusiasm for Vista than any actual or perceived failure of the OS.

So, if trying out something new on Vista, like putting 64bit Os on my box, requires even a little extra amount of effort, I loose my appetite. Kind of a shame, really. Poor, maligned Vista.

Cancel or allow? ... allow

Friday, February 6, 2009

WPF control that shows today's date

All I wanted was to show today's date on a screen. It took a few minutes of Googling to put the pieces together.

Here's the short and skinny:
<TextBlock Text="{Binding Source={x:Static System:DateTime.Now}, StringFormat=\{0:MM/dd/yyyy\}}"></TextBlock>

Just to be sure, here's how it would fit in if you were to start up a brand new WPF project and paste the TextBlock into a Window:
<Window x:Class="WpfApplication3.Window1"
<TextBlock Text="{Binding Source={x:Static System:DateTime.Now}, StringFormat=\{0:MM/dd/yyyy\}}"></TextBlock>

Here are a few places from which I have pieced together this minor epiphany:

Friday, January 16, 2009

IEnumerable<Dimecast> Expect(this IEnumerable<Dimecast> source, Func<Dimecast, bool> predicate); ?

Dimecast's slogan says:

Dimcasts.Expect(x => x.ToLearn()).Something.New()

So ... there is an IEnumerable of Dimecasts. Not all of the Dimecasts can do 'ToLearn'. Therefore they want to whittle away the ones that can't. The new subset then has a 'Something', and that 'Something' does 'New'? Is that what they meant to say?

Do the Dimecasts learn? Shouldn't something consume the Dimecasts and then learn from them? What are the side-effects of calling 'ToLearn' on a Dimecast? What if calling ToLearn on the individual leaves the called IEnumerable of Dimecasts in an inconsistant state?

Or maybe they mean that the big family of Dimecasts expects each one if its members to go out there and 'ToLearn'. When they do that and then all come home, the family can get together and new up a big something. What do they do with the new Something? They go to all this trouble to new up a Something, but then they drop the pointer to it. Is that intentional? Does the new Something not have a point?