... all I'm offering is the truth. Nothing more. RSS 2.0
# Monday, March 15, 2010

At the MIX ‘10 Keynote Scott Guthrie announced that you can immediately the Windows Phone Developer Tools at http://developer.windowsphone.com. They are free, and will be “free forever”! It includes the following:

  • Visual Studio 2010 Express for Windows Phone
  • Windows Phone 7 Series Add-in for Visual Studio, for developers already working with Visual Studio 2010 RC1.
  • Windows Phone 7 Series emulator.
  • XNA Game Studio 4.0

Happy coding!

Technorati Tags:
Monday, March 15, 2010 1:58:55 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] - Trackback
Phones | Programming
# Friday, October 26, 2007

I have doing a little too much work with legacy code (Visual Basic 6) recently, I was actually a better than good VB6 developer at one point but suddenly my mind cannot get around the fact that Strings in VB6 just simply do not have all the trappings (.Length, .Trim, .Remove, .Split etc) of their C# equivalents.

Anyway, I was tackling an issue that required me to remove all the unprintable characters (specifically the ASCII range 0-31) from a string in VB6 and this is what I came up with:

Dim lIndex as Integer
Dim sParseThis as String

sParse = GetDataWithWierdCharacters

For lIndex = 0 to 31
     sParse = Replace(sParse, Chr(lIndex), "")
Next

When I started thinking about this code in terms of C# my immediate desire was to make sure I am taking advantage of the glorious spackle that is the .NET Framework. Simply put I did not want to copy the above code, line for line in C#. So I thought I could take advantage of regular expressions.

string sParse;
sParse = GetDataWithWierdCharacters();
sParse = Regex.Replace(sParse, "[\x01-\x1F]", "");

Much better!

Friday, October 26, 2007 8:30:14 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] - Trackback
C# | Programming | Visual Basic
# Friday, March 23, 2007

I generally only blog and comment on stuff I am directly working but Don passed on this fantastic article that really brings the whole JSON vs XML into High Definition.

Currently all my work involves XML, we have not made the jump to AJAX in the banking world, and while I am sure that will change in the not to distant future, it appears that JSON really provides the light weight alternative. Unfortunately I can see this coming down to whatever Microsoft will decide to back.

People like me want mature IDE's and rich well supported tool set, so I will invariably go with the flow!

"Responsibility is the price of freedom." - Elbert Hubbard

Technorati tags: ,
Friday, March 23, 2007 4:58:45 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] - Trackback
Programming
# Wednesday, February 28, 2007

I had to jump on this one! After the recent discussions on FizzBuzz and how to measure the goods on a good programmer.

In my last job I interviewed what seemed like an unending stream of really bad people. What strikes me about our industry of software development is that we have no way of taking our important work with us and showing it to anybody. In fact most companies insist you sign away the rights to show any code you write. My wife on the other hand, who is a Graphic Designer, has a metric tonne of work in her portfolio. She can walk into an interview and immediately state "this is how good I am ... This is what I did for this marketing campaign ... and this was my time constraint". As developers we are required to somehow prove our competency within a few short hours by describing our understanding of some abstract concepts that we may or may not have used recently.

I have worked on a lot of great code in my life, along with some really talented developers, I have had those great ideas that appear as inspiration from the heavens (imagine the beam of light and heavenly music). Yet I find it difficult to describe how beautifully weighted and measured my code was to a potential employer without showing them. I am left with simply listing the projects I have worked on and hope they ask me an intelligent question that unleashes the true triumph of all my accomplishments.

Another problem is that a good developer, IMHO, is also just a good problem solver. I do not necessarily care that they do not remember the exact syntax of a command, or in the FizzBuzz example, whether they remembers how to use Modulus. My concern is what kind and variety of projects has worked on, does he know how to find answers and finally can he follow instructions well.

I think the problem is a two way street! Good developers need a good means to show they are good developers too.

"He was always late on principle, his principle being that punctuality is the thief of time." - Oscar Wilde

Wednesday, February 28, 2007 5:41:09 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] - Trackback
Programming
# Tuesday, February 13, 2007

Agent Smith (aka Jason S) had me looking at what it would take to consume some XML files in VB6. Thankfully I had been doing work with VB recently and so had some clue's about what to do.

It should be noted that I was loading the XML into DOM, which actually puts the whole thing into memory so while it is flexible (forward and backwards reads) it will potentially consume a lot of memory.

'If we consider this XML snippet.
<?xml version='1.0'?>
<MyInfo>
<LastName>Agent</LastName>
<FirstName>Smith</FirstName>
<Email>asmith@matrix.com </Email>
</MyInfo>

'Then we can access it like this.
Dim Xml As New MSXML2.FreeThreadedDOMDocument
Dim Root As MSXML2.IXMLDOMNode
Dim Agents As MSXML2.IXMLDOMNode
Dim Agent As MSXML2.IXMLDOMNode
Dim sLastName as String
Dim sFirstName as String
Dim sEmail as String
'Load the XML string to the DOM document
Xml.async = False
If Xml.Load(Left("C\MyFile.xml") Then
    Set Root = Xml.documentElement
    Set Agents = Root.selectSingleNode ("/MyInfo")
  sLastName = Agents.selectSingleNode("LastName").Text
  sFirstName = Agents.selectSingleNode("FirstName").Text
  sEmail = Agents.selectSingleNode("Email").Text
End If

'or if there are multiple agents as below looping could be done like this...
<?xml version='1.0'?>
<MyInfo>
<MatrixAgents>
  <Agent>
   <LastName>Smith</LastName>
   <FirstName>Agent</FirstName>
   <Email>asmith@matrix.com</Email>
  </Agent>
  <Agent>
   <LastName>OtherGuy</LastName>
   <FirstName>WithGlasses</FirstName>
   <Email>wg@matrix.com</Email>
  </Agent>
  <Agent>
   <LastName>Last</LastName>
   <FirstName>Agent</FirstName>
   <Email>la@matrix.com</Email>
  </Agent>
</MatrixAgents>
</MyInfo>

Xml.async = False
If Xml.Load(Left("C:\MyFile.xml") Then
   Set Root = Xml.documentElement
    Set Agents = Root.selectSingleNode ("/MyInfo/MatrixAgents")
    For Each Agent In Agents.childNodes
  'Get Agent Smith
  if Agent.selectSingleNode("LastName").Text = "Smith" THen
   sLastName = Agent.selectSingleNode ("LastName").Text
   sFirstName = Agent.selectSingleNode("FirstName").Text
   sEmail = Agent.selectSingleNode("Email").Text
  End if
    Next
    GoTo Done
End If

'Remember to clean up after yourself with vb6 ... Xml = Nothing ... etc

"He who praises everybody, praises nobody." - Samuel Johnson

Technorati tags: , ,
Tuesday, February 13, 2007 5:19:46 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] - Trackback
Programming | Visual Basic
# Saturday, October 14, 2006

I heard from Agent Smith the other day (he actually works really close to a building owned by the MATRIX, I am not making this up), he was giving a small rant on the craziness of null in its various forms, more specifically in the world of the SQL where it is not quite the null you would expect.

Anyway, the Angry Irish Man found this post on the Daily WTF that I thought would cheer us all up,it is hilarious. Sometimes the way people think and the way they write code are contrary. One of my favorites, and there are many, is this beautiful piece of code...

if b = b then
     b = true
end if

The words beautiful and code can be replace with almost anything negative.

 

"The trouble with jogging is that, by the time you realize you're not in shape for it, it's too far to walk back." - Franklin P. Jones

Saturday, October 14, 2006 1:00:42 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] - Trackback
Programming
# Tuesday, August 15, 2006

"Everything that irritates us about others can lead us to an understanding of ourselves." - Carl Jung

I spent some of last last week pouring over code in C# trying to get to the bottom of Support issue that I was following up on and I found some examples of irritating code that seems to raise the hairs on the back of my neck ... It should not ... when I think rationally it should not bother me at all, but if code is not immediately readable, if the initial form it takes effects the readability then we all need to get on the same page as it effects someone in the software life cycle.

So here is a simple if statement. that I simply do not like:
if (MyShirt == "Long") MyBoots.Height = MyBoots.Height - 20;

I prefer to see this
if (MyShirt == "Long")
    MyBoots.Height = MyBoots.Height - 20;

or, if I am in a particularly verbose mood then the following is preferred.

if (MyShirt == "Long")
{
    MyBoots.Height = MyBoots.Height - 20;
}

The intention just appears to be clearer, a logical statement followed by decision. Are we that interested in saving white space? I know this is really picky hence the title of the post, and I know what your thinking how can everyone I work with account for my neurosis quirks? Not sure but something has got to give!

My Solution:

All permutations on if, while, do while, for, case select etc should be viewable based on the preference. Much like the CLR it should determine the intent and display it based on your preferences. So the three if statements above would actually be rendered when you open the Visual Studio Project based on preference. There is, actually, no difference between them it just a visual cue of the intent of the developer.

This concept is a little avant-garde, so I will start work on this right away ;)

Tuesday, August 15, 2006 11:25:42 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] - Trackback
Programming
Blogroll
Statistics
Total Posts: 334
This Year: 22
This Month: 0
This Week: 0
Comments: 32
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Mark Downie
Sign In
All Content © 2010, Mark Downie
DasBlog theme 'Business' created by Christoph De Baene (delarou)