Monday, December 20, 2010

Don't forget the colon on ASP.NET MVC Html helpers!

Note to self: On ASP.NET MVC 2, when using Html helpers, like Html.DropDownListFor, they don't work if you leave out the colon after the opening "crow's beak".

This won't work:

<% Html.DropDownListFor(model => model.Country, ViewData["Countries"] as SelectList) %>

This will:

<%: Html.DropDownListFor(model => model.Country, ViewData["Countries"] as SelectList) %>

Thursday, July 1, 2010

Getting Business Intelligence projects in Visual Studio 2008

Note to self:

To get SQL Server Reporting Services Business Intelligence projects installed into Visual Studio 2008: When you're installing SQL Server 2008 R2, select at least these items in the Feature list: Database Engine Services, Reporting Services and Business Intelligence Development Studio.

Wednesday, June 30, 2010

Windows 7 & External Hard Drives

I recently built myself a new computer that's running Windows 7 64-bit edition. Most things worked fine with it -- until I plugged in my Western Digital Passport portable hard drive. I knew the drive was okay because it was working fine on my other Windows XP 32-bit machine. I finally figured out how to get it working. I'm not sure why, but it turns out that Windows wasn't assigning it a drive letter. To fix the problem I followed these step:

1) Plug in the drive
2) Open the start menu
3) Right click on "Computer"
4) Select "Manage"
5) Under "Storage" click on "Disk Management"
6) Find the external hard drive in the list at the bottom
7) Right click on it and select "Change Drive Letter and Path"
8) Click the Add button
9) Pick a drive letter and okay your way out



Thursday, April 1, 2010

A tip on multithreading in PowerBuilder

The way you do multithreading in PowerBuilder is to create an object that contains the code you want to run in another thread. You then create an instance of this object as a “shared object”. You also code another object – the “interface object” and pass the shared object a reference to it. You can then call functions on the shared object and have them run in the other thread. The shared object communicates back to the main thread via the interface object.

The other day I set up a program using a shared object. I had a shared object that was running some code asynchronously. When it was done, it called a function on the interface object and the interface object called a function in my window to let me know it was complete (by setting a variable). At one point I needed to wait until the shared object was done with its processing before I continued what I was doing in the main thread. I had it coded something like this:


Integer li_status

Li_status = wf_get_status()

Do while li_status = NOT_COMPLETE
Li_status = wf_get_status()
Loop

I couldn’t figure out why it never exited the loop. Then I added a yield:

Integer li_status

Li_status = wf_get_status()

Do while li_status = NOT_COMPLETE
Yield()
Li_status = wf_get_status()
Loop

That worked. But it wasn’t until later that it hit me why. The other thread was completing and calling back into my thread – but since I was stuck in a loop and not yielding – I wasn’t letting the code in my thread that set the status variable run.

Friday, March 12, 2010

Blogaway


This post is a test of the Android app Blogaway.

It seems there are a lot more blogging apps for iPhone/iPod than for Android. Hopefully that will change soon.

Wednesday, January 13, 2010

Mobile blogging


This is a test post to see if I can post from my iPod using BlogPress.