Posts archived in Coding

One big win for last week, which I havn’t mentioned was that work is picking up the tab for my TechEd 2007 ticket. (Thanks, Malcolm – even though I’m sure you don’t read my blog)

So, I’ve gone ahead and booked flights and accomodation for then.

Looks like I’m going to be busy in the next few months – Google Developer Day in Sydney on May 31st (free), ReMIX in Melbourne on June 25-26th ($140), and finally TechEd on August 7-11.

Thanks to Paul‘s alerts via SMS & MSN, and both Frank Arrigo and Andrew Coates – I’ve registered myself for the Developer Track for ReMIX Melbourne 2007.

I’ll be in Melbourne from Sunday 24th June to Sunday 1st July.

Rough Itinerary:
Sunday 24th June:
- 12:35PM: Williamtown to Melbourne, Virgin Blue Flight DJ692, Arriving 2:05pm
- Check in @ The Albany.

Monday:
- 8AM-6:15PM: ReMIX Melbourne, Day 1

Tuesday:
- 8AM-6:15PM: ReMIX Melbourne, Day 2
- ? ‘ReMIX After Party’ @ Galactic Circus.

Wednesday, Thursday, Friday:
- 8AM-5PM: Work – Exhibition St. Melbourne
(One of the benefits of working for a large company – we’ve got offices everywhere)

Saturday
- Paul & Chickz0r’s Engagement Party

Sunday 1st July:
- 1:30pm: Melbourne to Williamtown, Qantaslink Flight QF2796, Arriving 3:55

Bernard Oh posts that that the TechEd 2007 Australia site is now up

The price for standard ticket is $1,999, but $1,599 for early-bird registrations (before 21 May), looks like my estimate of $1500 wasn’t far off.  Add on another $300 for the Deep Dive Workshops if thats your thing.

I wonder if Paul Stovell is going to update his TechED Session Picker for 2007? Hint-hint :)

0 comments

No TechEd For Me?

(Edited for Clarity)

A few weeks back I asked work to pay for my entry to TechEd 2007 in Queensland, under the understanding that I’d cover all the other costs.

Just for reference, here’s a Summary of Costs (Estimate):
- Accommodation (6 Nights): $1,080
- Flights & Transfers: $650
- Food & Drink: $660

Non-Conference Costs Total: $2,390
TechEd Conference-Only Cost: $1,500 approx, inc GST. (Less for the company rate)

Today (Tuesday) I got word back that they wouldn’t come to the party.  So, now I have to consider whether I can afford the additional cost of the TechEd entry on my own. 

Microsoft have, thankfully, changed their decision not to include the Expression suite available to MSDN Subscribers.

Soma announced that Expression Web is available now to all MSDN Premium subscribers.

“I am pleased to say that we will be making Expression Web available starting today to all MSDN Premium subscribers.  We will also make Expression Blend available to MSDN Premium subscribers shortly after the Expression Studio release later in Q2 2007. Expression Blend and Expression Web are intended to help creative professionals collaborate with developers to create rich user experiences for the Web, Windows Vista applications and beyond, which means we need to make sure both tools are readily available to our developer community.”

Thanks to Frank ArringtonArrigo for mentioning it.

Note: This seems to include MSDN Volume Licence subscribers too, since I’ve got it in my list.  Find it in your Subscriber Downloads page, under Developer Tools -> Expression Web -> Expression Web (English).

Edit: Sorry for futzing your name Frank!

Microsoft’s Knowledgebase is full of handy information, like this: How to populate DataGrid on background thread with data binding by using Visual Basic 2005 or Visual Basic .NET

Which is handy for doing background loading/refreshing of DataBound information.

At work, I’m using a slightly different way of databinding though. I’ve got DataSources, and TableAdaptors generated by Visual Studio based on Stored Procedures in my SQL Database. This means it’s really (really) simple to do databinding – it’s fairly much a matter of drag and drop.   When you want to go ahead and actually load some data -  you use a 1-line function:

    Me.Get_Q_Details_V111TableAdapter.Fill(Me.DsQueue.Get_Q_Details_V111, Me.QueueID)

The only issue is that your entire application locks, whilst this happens. Not fun if you need to execute 3-4 of these and update them every minute or so.

So, modifying the KB Article, I went with something like this:

    Dim CallBindQueue As New MethodInvoker(AddressOf BindQueue)

    Dim Thread_BindQueue As Thread
    Dim ThreadStart_BindQueue As New ThreadStart(AddressOf RefreshQueueNow_BG)
    Private Sub RefreshQueueNow_BG()
        Me.Get_Q_Details_V111TableAdapter.Fill(Me.DsQueue.Get_Q_Details_V111, Me.QueueID)
        Me.BeginInvoke(Me.CallBindQueue)
    End Sub
    Private Sub BindQueue()
        Me.DataGridView1.DataSource = Me.DsQueue.Get_Q_Details_V111
    End Sub
    Public Sub RefreshQueueNow()
        Thread_BindQueue = New Thread(ThreadStart_BindQueue)
        Thread_BindQueue.IsBackground = True
        Thread_BindQueue.Name = "Queue-UpdateThread"
        Thread_BindQueue.Start()
    End Sub

To kick-off the process, you just call RefreshQueueNow, and it spawns a background thread, which does the actual fetching of data.
Because this is executing in a different thread, the standard Fill command doesn’t actually do the databinding any more – so The background thread invokes BindQueue, which sets the DataSource manually – ho-hum.

In the end – this works fine. The first time. If you ever issue another Fill command, and then for any reason need to re-draw any of the cell-contents, you’ll run into issues.

So, to fix it – you need to set the DataSource of your DataGrid to a shallow copy of the actual data.  There might be a ‘neater’ way to fix this, but if there is – I don’t know about it.

So now BindQueue becomes this:

    Private Sub BindQueue()
        Me.DataGridView1.DataSource = Me.DsQueue.Get_Q_Details_V111.Copy
    End Sub

If you’re only ever issuing this command once per instance, you shouldn’t need to worry.

I hope this is helpful to someone else.

Key Words: TableAdaptor SQLTableAdaptor

Back in 2002 and 2003 I was mainly doing VBA type work, hacking together reporting tools using only the resources I had at hand. The kind of things that still haunt me to this day. In short: I wasn’t terribly experienced.

For the first 5 weeks of 2004, I (along with a former colleague, now friend) wrote a .NET 1.1 app that is still in use today. Looking back now, I realise the code (for the client portion – which was my portion) is terrible. But, the good thing was that all parties were happy, and for the most part – the application needs very little maintenance. (If you can call burning a SQL Backup file to DVD once a week “maintenance”)

Anyway, to cut a long story short: I needed to make some fairly minor changes – mainly to remove a few things that are no longer needed, and to change the server referenced in the installer*. All of the business logic is in the database, just a few things to manage the display of that data.

I decided to rebuild the client in Visual Studio.NET 2005 (up from VS 2002). I’ve spent about 3 hours on it so far, and I’ve got all the major interface elements done.

All the field elements were pulled from a dataset I created that maps all the existing stored procedures. If I needed a field – I dragged in that field. If I needed an entire datagrid – I dragged in a TableView.

VS.NET 2005 went and did the heavy lifting of writing the code that goes and loads the data from the database, and setting databinding on the fields.

There will be, of course, some things that will take longer – but hey, even if I spend another day on it – that’s still a fraction of the time spent originally.

All up – Winforms Databinding in VS 2005 really does rock.

*: Due to my inexperience, I implemented an… “interesting” way of determining the environments (production/development/etc) available — asking the current default server, which was initially set by the installer. Yeah, I didn’t think that one through properly.

0 comments

TechEd 2007

I’m trying to organise to go to a few different tech conferences this year – CodeCampOz in Wagga (March 31st & April 1st), and TechEd 2007 (Aug 7-10) on the Gold Coast.

Andrew Coates looks like he’s organising some of TechEd 2007 - and wrote back in January about the different personas of people that Microsoft think might be attending.

The two personas they have listed are both what I identify with:

Dave-ish:

  • I have over 4 years in development (professionally – I spent time hacking together scripts and basic pages for at least another 4-5 on top of that)
  • I am still primarily using .NET 1.x (due to the work environment), though I have developed and maintained app’s in both .NET 2.0
  • I know about more than just .NET and VB6 development – I get in there with a bunch of other technologies (both Microsoft and non-MS), and I have no issue picking up most new/different technologies once I have the concept behind the technology.
  • TechEd 2007 would be my first TechEd (Assuming I can get work to pay for my TechEd pass)
  • I use (mainly) Microsoft tools and Technologies at work, and I work at a large well-known company.

Ulrich-ish:

  • I get most, if not all, of my information about current/emerging/new technologies online (RSS++, Forums, Podcasts).
  • I participate in tech communities online.

I’m hoping to move more to the Ulrich side of things – but retain the overall knowledge that I have atm.

Attributes which don’t fit in anywhere:

  • I’m generally the go-to guy at work (for the people that know me) with almost any IT or telco question, even though I don’t necessarily work on that product.
  • I work primarily on my own, both physically and organisationally. (Again, due to the work environment).  Though, I have no problems working with others.
0 comments

More Cranky-Geek

I’m making an effort to not be so cranky. Yesterday I had a follow-up meeting with the same outsourcing/vendor folks from before. It went rather well, they had more of an idea what they were after, and I could offer a bunch of alternatives/suggestions that would make things easier for all of us.  All up, a rather productive meeting.

I thought I was doing fairly well, until I got this call from some random person in one of our IT Areas:

Random: “I’m just calling to ask a few questions about [Application], are you able to spare a few minutes?”
Me: “Yeah, sure – what did you need to know?”
Random: “What are the operational hours for [Application]?”
Me: “…I don’t understand the question? It’s a web application.”
Random: “What times can people use it?”
Me: “It’ll work whenever people access it, aside from weekly maintenance periods.”
Random: “Right… okay,”

[snipped stuff about support contracts]

Random: “So, you’re the person to contact for all support issues?”
Me: “Yep, during business hours.”
Random: “Okay, so can I just get your details? You’re located in…?”
Me: “Uhh.. Newcastle”
Random: “Right, but what address?”
Me: (confused why he didn’t look it up in Outlook’s Employee Address Book) “The same one in Outlook. [...address...]”
Random: “And your phone number?”
Me: (Thinking “wtf?”): “The same one you just called me on.”
Random: (sounds of flicking pages) “Right… uhm…. What area code was that?”
Me: *sigh* “02 [....my number...]”

Grrr..

…I just had a realisation. I’m becoming that cranky/cantankerous geek that growls at people.

Just now, I was on a meeting with someone from work, and a few outsourced/vendor folks who are building an application for another area at work.
They wanted to find out if I could modify one of the applications I own, and we were throwing around technical ideas, there were several different approaches discussed, ranging from fairly simple, to rather complex.

Vendor: “So, can you do these modifications?” (not having picked any specific alternative)
Me: “Yeah, sure – I’ve got plenty of experience with [all these technologies]”
Vendor: “So, will this be able to be done by [our timeframe]?”
Me: “I can’t answer that, it’ll depend on a number of factors, and whether I’m assigned to do the work.”
Vendor: “So…. How long will these changes take?”
Me: “I can’t answer that until the decisions have been made as to the final requirements.”
Vendor: [rephrases previous questions]
Me: “That’s not up to me, [our rep], would need to go through the process to get me assigned. My Manager(s) assign me work, and that’s what I work on.”