Whew, let’s see. I’ve gotten about eight more chapters into Learn Java for Android Development. I haven’t posted the end chapter quizzes because, frankly, they’re really obnoxiously long. I’ll get around to that sooner or later.
Finished the game Infested Planet. Great little indie game but damn, I guarantee you will be cussing at the screen on more than one level.
Another independent game worthy of your time is Gods Will Be Watching.
Also finished Sam and Max Season 1, Episode 1: Culture Shock, Episode 2: Situation: Comedy, Episode 3: The Mole, The Mob, and the Meatball, and Episode 4: Abe Lincoln Must Die!
My daughter’s reading Fahrenheit 451. I’m a bit astonished to see her reading a book which was written prior to the age of cell phones. It does fit into her future society fetish well though.
About it for now.
I ran across this problem recently. The normal code I see looks like this:
If sortExpression = "Property1" And sortDirection = "Ascending" Then
sortResults = sortResults.OrderBy(Function(x) x.Property1).ToList()
ElseIf sortExpression = "Property1" And sortDirection = "Descending" Then
sortResults = sortResults.OrderByDescending(Function(x) x.Property1).ToList()
ElseIf sortExpression = "Property2" And sortDirection = "Ascending" Then
sortResults = sortResults.OrderBy(Function(x) x.Property2).ToList()
ElseIf sortExpression = "Property2" And sortDirection = "Descending" Then
sortResults = sortResults.OrderByDescending(Function(x) x.Property2).ToList()
ElseIf sortExpression = "Property3" And sortDirection = "Ascending" Then
sortResults = sortResults.OrderBy(Function(x) x.Property3).ToList()
ElseIf sortExpression = "Property3" And sortDirection = "Descending" Then
sortResults = sortResults.OrderByDescending(Function(x) x.Property3).ToList()
Assumptions for the above code: sortExpression is a String, sortDirection is a String, sortResults is a List or derivative thereof.
Ugh. That sort of code is infuriating. It’s exactly the sort of repetition that modern languages are supposed to free us from, right?
Well, with a bit of reflection, we can clean this up substantially.
Dim sortProperty as PropertyDescriptor = TypeDescriptor.GetProperties(GetType(T)).Find(sortExpression, True)
If sortDirection = "Ascending" Then
sortResults = sortResults.OrderBy(Function(x) sortProperty.GetValue(x)).ToList()
sortResults = sortResults.OrderByDescending(Function(x) sortProperty.GetValue(x)).ToList()
Yes, reflection is slower and there is a price paid. However, the cleaner code and type safety make it worthwhile; if sortExpression doesn’t exist as a property on T an exception is thrown whereas with the previous if..else ladder you would’ve simply exited out without any sorting being done.
“I love deadlines. I like the whooshing sound they make as they fly by.”
— Douglas Adams
“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.”
— Tom Cargill, Code Complete, Chapter 31: Personal Character
I signed up for Apress’ All Access because I buy way more than 3 computer books a year, and generally speaking, way more than 3 of what I buy are Apress books. Might as well reward the publisher, right? That’s the common saying at least: if they made it available at a decent price, we’d buy it.
$149 is a very reasonable price for access to Apress’ entire library. The ability to download ePubs for $4.99 is a side benefit that I will take advantage of.
Of course I still have to do something with my knowledge.
I’ve accepted a job at Schnucks, where I was contracting. Everyone cheer!
Also, programming != computer science. But what if you could pick up the knowledge distributed in a computer science course for free? You can! This is here for me more than you; I admit that unashamedly. Check out http://blog.agupieware.com/2014/05/online-learning-bachelors-level.html.
First, I’m looking for a new job. If you’re interested my StackExchange profile can be found at http://careers.stackoverflow.com/bmschkerke. I’m currently a contractor and frankly, I don’t like being a contractor. Promises to be hired on have not been followed through with so it’s time to move on.
Second, I finally upgraded my home network to Gigabit. I probably should have done this years earlier but I always balked at the price. Now, with the Linksys SE2500 at $40.00 or so it was a no brainer. Most of the machines I have already had Gigabit interface cards.
Third, I just picked up the Kindle HDX for $140.00. Time to pass my iPad 3 on to my daughter, I think. While I enjoy the Apple products I have much heavier investments in the Android ecosystem. Might as well leverage them.
Finally, I got sucked into World of Warcraft, specifically the Draenor expansion. It is comfortingly mind numbing, but I wish I had something else to challenge me other than this.
Here’s the official Microsoft release.
This is great. This provides an alternative path for developers to smash into Linux and Mac development while using their existing skill set. This expands the Microsoft base and allows them to offer Premium services (becoming more service oriented like a Red Hat or Ubuntu) while providing their world class tools to developers.
.NET was never sold, so I can’t see a down side to this announcement. Much kudos to Satya Nadella for this change.
Disclaimer: This is the announcement. We won’t see the actual result of this change for a while yet, but it is exciting to see. And I do predict that we will see impact from this change.
Hanselman has a great summary of everything happening here.