A user-friendly Update Notifier and Downloader (C#, WPF)

For quite some time, my update notification mechanism for most of my projects consisted of a Web Client async request to download a version file, check it against the current version, and show a message that would lead the user to a download page. This is all simple and great, but if you’re like me and you release updates constantly, you’d be better off using a delta updater, that knows which files have been updated since the last release, downloads them and installs them. For NBA Stats Tracker, I’ve taken the middle road. I release new versions quite frequently, so getting the user to the download page, then using the download link, then going through all the steps of installing it could be a hassle, deterring them from downloading and thus using the latest version. I thought I’d make the update process just a few clicks and minimize the time it requires to update to a few seconds.

Here’s how it works.

Continue reading

How to get detailed error reports on unhandled (and forced) exceptions in WPF (Updated)

UPDATE: The post has been updated since first being published with some improvements to the code.
UPDATE #2 (May 15, 2013): The post has been updated again with much cleaner code and additional functionality.

To err is human. And so, many (well, hopefully, not that many) times your programs may crash. And most of the time, they won’t crash inside your development environment, hooked to a debugger that will give you all the information you need on why and where the error happened. They’ll crash on your client’s machine. So, what can you do if you’re developing a WPF application, and want your program to produce nice, detailed error reports that the users can send to you?

It’s quite easy, actually.

Continue reading

Leap of Faith

For quite some time now, actually it’s been since I first decided I wanted my thesis to be a full-blown basketball statistical analysis tool, I’d been wondering if, and how, I would ever be able to earn some money, even little, out of it. That’s the main reason that even after submitting it as my thesis, the project remained closed-source. I was thinking that I would keep it that way, find a way to put a decent protection on it, and sell it for a fee.

And then I came to my senses. In an era where every proprietary piece of software that’s locked down is cracked, what’s the point of keeping your source closed? All the rest of my work is open-source, why should this be any different? Sure, anyone could take the source now and compile it and have the tool for free, but even when it comes to open-source projects, there’s ways to earn something. Especially a tool like this gives you the chance to be hired to actually use it for a team, rather than have them learn how to use it, or you could “sell” “priority support”, as in get paid to work on features or to be stand-by for bug-fixes and support 24/7 (or, to put it better, to offer support to the client as soon as humanly possible).

Plus, going open-source gives you all the well-known advantages of having the whole open-source community help, and even contribute directly if they want to.

So, it is a leap of faith. Maybe it was the right move to make, or maybe I’m an optimist and a delusional and I should be instead gathering money to buy some good protection.

Well, the leap of faith was taken. So, open-source community, fellow developers, make me proud.

P.S. The GitHub repository is at https://github.com/leftos/nba-stats-tracker. I’ve also migrated most of my current projects to GitHub from BitBucket, and you can find them at (well… duh) https://github.com/leftos.

It’s good to go back to basics once in a while

I like being randomly given small, simple programming challenges, because after dealing with NBA Stats Tracker for so long, I can find myself straying away from the simplest approaches in favor of something more complicated, that looks “up to par” with the rest of my coding as of late. (Yeah, talking big… I know.)

That false sense of “I’m really good right now” can make you forget of how simple some things are, and the simple ways with which they can be approached. Those simple ways tend to have applications in much more complex problems, at times, so keeping them at the back of your head should be important. “It can’t be that easy” is a thought that makes quite a lot of people mess up what should be the simplest of answers.

Continue reading

Analyzing the current NBA season with my thesis

As my Computer Engineering studies, at least at an undergraduate level, are coming to a close, I should probably be kicking back doing nothing, right? Yeah, ain’t happening.

Hadn’t had that happen for a while, but last night I got those ideas in my sleep again, ideas on how to improve the Basketball Analysis tool I created as part of my thesis. And so I did. I won’t go into much detail, but here’s some screenshots that made me smile, after NBA Stats Tracker automatically downloaded the stats of the current NBA season from Basketball-Reference.com and reminded me how much my Pistons suck so far, as the season gets going.

What is Hex Editing?

With the GRE out of the way, I should be wrapping up my thesis and looking for universities in the US to apply to. But oh no. I had to hit one of those creative streaks that keep me up until 5.40am, when the silliest of bugs is right in front of my eyes and I just can’t see it. I’ve been doing a lot of other stuff lately, including creating a Speech Recognition tool for NBA 2K13 (a basketball video game) and a lot of reverse engineering via hex editing. I’ve created a lot of hex editing automation tools, most of them used to customize various aspects in the NBA 2K13 game I mentioned, such as edit the rosters or edit the values of the lighting shaders used in the game that affect how the players are lit and shadowed. To get an idea of what I call “programming as a hobby”, you can take a look here at all the tools I created for last year’s iteration of the game. It’s been just a few days since the game was released, and I’ve been hard at work, juggling finishing my thesis and programming those tools, working 10-14 hours a day in front of my computer.

So, I was asked by a user at the OperationSports forum, “what’s hex editing?” Since, as most of you know by now, I aspire to be a teacher, I love “101” questions like that. Here’s my answer:

Continue reading

The Thesis Experience, Part 0: Before The Prologue

I haven’t posted anything for a while, mostly because I’ve been busy with going through the exams for my last 2 subjects in order to get my diploma. I’m still quite busy, considering this Thursday I’m sitting the GRE examination, a requirement for most post-graduate programs in the US. However, I wanted to get this up as a prologue to a series of posts I’ll be making after this Thursday.

As I wrap-up the final pieces of code (21,000 lines and still counting) of my thesis, and work out the paper that will go with it, I’m going through an almost moving process. The whole experience of how the idea of the thesis came up, how I started working on it by reworking an almost irrelevant tool I had made for a game I was playing at the time, all the things I’ve learned while doing it, the long nights and early mornings, the restlessness in bed as ideas were hitting me even in my sleep, the notebook I was keeping on the fluffy bear I use as a bedstand that is filled with notes.

It’s been an amazing experience, the apogee of everything I’ve done during these 5 years in the Computer Engineering department of the University of Patras. It’s the experience that erased whatever doubts I had left. I now know that I wouldn’t rather be doing anything else than this.

The Thesis Experience series will be starting soon, and I’m looking forward to hearing your opinions and stories on each part of the process as well. If you have any related series or posts in your blogs about how your thesis came together, I’ll be happy to link to them and even reblog the best of them.