jwatte's picture

MD5, SHA1, SHA256 and SHA512 hex digests in Erlang

Orignal post 2011-06-10:
In various web APIs, there is some confusion between the representation of a hash value.
There exists APIs where a password is validated as, say, MD5(challenge + MD5(salt + password)).
Let's leave aside the fact that MD5 is not a secure algorithm anymore (you can procedurally generate an input that generates any MD5 hash value you want in cheap-to-compute time).

jwatte's picture

The XNA Offline and Online Highscores Component Version 2 (distributed leaderboards, sort-of)

XNA Game Studio makes it possible to write games for the Xbox without being a developer with good publisher contacts and lots of money to pay for marketing and Xbox development kits. This is great!

However, because the XNA Indie Games system is not fully controlled by Microsoft, certain features of Xbox Live! are not available, because they would be too easily abused. These features include online Leaderboards, and unlockable Achievements.

The XNA community has developed alternatives to those functions. Many XNA games contain "Awardments" that can be unlocked, and many more XNA games use the XNA Network Highscores component to implement distributed, peer-to-peer highscore sharing. The name for this is generally "Online Highscores" rather than "Leaderboards," because the latter name is reserved for use by Microsoft-certified titles that use the real Xbox Live! functionality.

This article introduces version 2 of the XNA Online highscores component, which is free for you to use in your own game under the terms of the MIT license.

jwatte's picture

Structure of a user-hosted client/server network game

Recently, a question came up about how to structure a client/server networked game where users can host games that other users can join. I think I did a reasonably concise write-up of a common-sense approach that's been successful for many years, so I'm archiving it here for posterity:

jwatte's picture

VMWare Workstation DNS doesn't work right

VMWare workstation is in many ways a great product. It allows you to do all kinds of nifty set-ups that let multiple virtual machines talk to each other and the rest of the world, within the confines of your local PC.

However, there are some problems with it. I have a couple of virtual machines that I use as a sandbox for developing networked applications at work. These are hosted inside a Dell Inspiron XPS 1330 laptop. The laptop travels between networks frequently. At work, it's usually plugged in, but sometimes gets un-plugged and goes on wireless-G. On the train, it goes on a Sprint WAN card. At home, it generally goes on another wireless-G network.

jwatte's picture

Remote controls, wireless and Linux

I have a home theater with a reasonably advanced remote control set-up -- the Universal Remote 950 MX. While having a conventional "remote stick" form factor, it is actually an embedded system running some small version of Windows CE.

jwatte's picture

Android programming, layouts and activities

I've been doing some Android programming, trying to get a feel for what an Android app would look like when structured as a main screen, some set-up screens, and a main gameplay screen (which then wants to go back to the main screen). I've fought a bit with the built-in Android layout views. They seem to be missing some capabilities that would be really useful.

jwatte's picture

A simple approach to native network marshalling

I used to do serialization using all kinds of fancy templates and macros. You can create pretty elegant systems that way. However, at some point, simplicity should win out. Here's a system that might work just fine for you:

A simple packet class, which really is all you need:

class packet {
public:
  packet() : pos_(0) {}
  void append(void const *data, size_t size) {

jwatte's picture

An update on Dell Inspiron XPS 1340 memory leak problems

Here's a new perfmon graph of the memory leak progress over half a day that I'm seeing on my computer. It's definitely *something* slowly eating my memory. But it doesn't show up in the process monitor.

Syndicate content