Daniel's Stuff

I write code

Category: Windows

Apps

I’ve been making some apps recently.  One for the new Windows 8 modern UI and one for iOS using swift.  One was a joy to code, the other was not 😉

Swift is an interesting language and I look forward to writing more code in it.  C# is also a nice language, however writing code for “modern” Windows apps is much harder than it should be.  This is mainly because many of the more useful parts of the .Net API just are available any more 🙁  No System.Data was the real problem for me and meant that I had to roll my own database access layer on top of a SQLite database.  An app that should have taken a couple of days to whip up took a couple of weeks.  Every time I thought I was getting somewhere I would hit yet another assembly or class that wasn’t available, or worked slightly differently to the “normal” way things should work.

Both apps are working now, so I’m happy 🙂

VMWare or Parallels?

Since Parallels released the new version of their Mac virtualization software recently and it reportedly works under OS X Yosemite (10.10), I decided to give it a go.  Converting my Linux VMs was a breeze, but converting my Windows 7 VM wasn’t as much fun.  The Windows VM converted perfectly, Windows itself on the other hand decided it needed to re-authorize.  Once I sorted all that mess out (another story for another time), I was able to get back to work.

So far I’m pleased with the performance of Parallels Desktop 10 for Mac.  It seems to be running better than when I was using VMWare Fusion 6.0.  I don’t have any solid numbers on this, but the fans in my Mac seem to not run as often under Parallels.  Booting my main Linux VM is almost instantaneous, and my Windows 7 VM seems to be running really well 🙂

More Windows Live decompression progress

I’ve not had much time recently to work on the decompression routines as family and work need to take priority over side projects…  Last night I picked the code up again and had a bit more of a look.  I found a couple of mistakes in the code I’d written and am now getting a bit further in the decompression 🙂

The expected results as before:

X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0wO0Q9MTtTQ0w9MA==

X-Message-Status: n:0

X-SID-PRA: Daniel Parnell <me@danielparnell.com>

X-Message-Info: JGTYoYF78jHVrAq/T4xfKLLpTvwPwE0t6g/vyq6tyzbqln5iNnXwcSMg41wQCSulCxd5N8UB57Lq6un/ug7i0YsGX30yo+pm

Received: from randymail-a4.g.dreamhost.com ([208.97.132.207]) by bay0-mc8-f11.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668);

Thu, 29 Jan 2009 16:06:38 -0800

Received: from 192-168-1-101.tpgi.com.au (60-241-72-192.static.tpgi.com.au [60.241.72.192])

(using TLSv1 with cipher AES128-SHA (128/128 bits))

(No client certificate requested)

by randymail-a4.g.dreamhost.com (Postfix) with ESMTP id 97A67194DD3

for <danielparnell@live.com>; Thu, 29 Jan 2009 16:06:26 -0800 (PST)

Message-Id: <8EEE4310-25CC-47BE-8FCB-330EBCD75A21@danielparnell.com>

From: Daniel Parnell <me@danielparnell.com>

To: danielparnell@live.com

Content-Type: multipart/mixed; boundary=Apple-Mail-33–583770588

Mime-Version: 1.0 (Apple Message framework v930.3)

Subject: more test messages

Date: Fri, 30 Jan 2009 11:06:23 +1100

X-Mailer: Apple Mail (2.930.3)

Return-Path: me@danielparnell.com

X-OriginalArrivalTime: 30 Jan 2009 00:06:38.0411 (UTC) FILETIME=[9F1AB1B0:01C9826E]

What I’m getting now:

X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0wO0Q9MTtTQ0w9MA==

X-Message-Status: n:0

X-SID-PRA: Daniel Parnell <me@danielparnell.com>

X-Message-Info: JGTYoYF78jHVrAq/T4xfKLLpTvwPwE0t6g/vyq6tyzbqln5iNnXwcSMg41wQCSulCxd5N8UB57Lq6un/ug7i0YsGX30yo+pm

Received: from randymail-a4.g.dreamhost.com ([208.97.132.207]) by bay0-mc8-f11.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668);

Thu, 29 Jan 2009 16:06:38 -0800

Received: from 192-168-1-101.tpgi.com.au (60-241-72-192.static.tpgi.com.au [60.241.72.192])

(using TLSv1 with cipher AES128-SHA (128/128 bits))

(No client certificate requested)

by 


Hopefully I’ll get some more time to work on the code soon 🙂

ASP.Net blows chunks

Really big nasty chunks! I guess I’ve been spoilt by working with rails, and to be fair it’s not really ASP.Net I don’t like, it’s ADO.Net. I mean really, who wants to write 12 lines of code to fill a grid with data from a database! 
 
1. construct a new SqlConnection object 
2. construct a new SqlCommand object 
3. construct a new SqlParameter object 
4. set the parameter name 
5. set the parameter value 
6. add the parameter to the select command 
7. construct a new DataSource object 
8. construct a new SqlDataAdapter object 
9. fill the DataSource using the SqlDataAdapter 
10. connect the DataSource property of the grid to the DataSource object constructed earlier 
11. call the DataBind method of the grid to actually load the data 
12. close the database connection 
 
I guess it’s all supposed to be used via the GUI editing tools which should build a lot of that stuff for me automatically. I assume the GUI built data binding can handle parameters for the select. 
 
Another feature of Rails that I’m missing in ASP.Net is partials. I’m using master pages to give me some of the things that I would have used a layout for in Rails, but there doesn’t seem to be anything quite like partials in ASP.Net 🙁 Fortunately for me it’s a simple application I have to build so there are only a couple of repeated sections of code. 
 
Also, what’s up with not allowing the TextBox control to be bound to a DataSource? I’ve got better things to do with my time than to write a line of code for each TextBox on my form to fill it with data and another to then put that data back into a DataTable so I can have it saved to a database. 
 
A word of advice to all ASP.Net developers who read this, don’t use Ruby on Rails. It will only make you realize how bad you’ve got it 😉

Another reason to hate windows

Well, yesterday the task bar and start menu on my Windows dev box decided to crash. I’ve got my explorer set up to open new explorer windows in their own process, so I didn’t loose my opened windows and so loose my place in svn (as well as cvs and darcs). Ordinarily when this happens I just restart explorer and up comes my start menu. Not this time however. I put up with no start bar for the rest of the day as I was busy doing things and didn’t want to mess up my flow. It was an interesting experience. Everything seems to work quite happily without the task bar, however maximizing my windows didn’t use the area at the bottom of the screen reserved for the start menu. I started to find the empty space at the bottom of the screen quite distracting. 
This morning after taking my daughter for a swim at the local pool I decided that I’d had enough. I did a bit of research on the net to see if there were some magical command line arguments needed to pass to get my task bar back. I suppose I could have just rebooted the machine, but I was trying to avoid that as much as possible. Finally I thought to myself, “Everything is checked in to their various repositories, so I might as well close down all my explorer windows and see what happens when I start explorer.exe”. I did this and hey presto up came my task bar 🙂 It looks like if explorer starts and it doesn’t see any instances of itself running then it becomes the start bar and desk top. 
The more I use windows the more I miss my mac. I really need to get an intel mac so I can run ‘doze in a vm for those rare occasions I need to do something in Visual Studio .Net or some other windows only program.