A Beginner’s Guide to Joysticks and Fightsticks

I’ve been playing a lot of fighting games and Street Fighter IV recently, and while I’m looking to up my game through practice, I still want to have the right tools for the job – and this means having a good fightstick. I currently have a Mad Catz Tournament Edition (TE) for the Xbox 360 which uses a Sanwa joystick and buttons – and frankly it’s excellent.

However, I’ve been trying to take my new-found fightin’ chops back to some older games like the Street Fighter Alpha series, SNK Vs. Capcom etc, and for that I have an X-Arcade (XA) dual-stick with a PS1/PS2/DC/Gamecube/Wii adapter. While the X-Arcade stick is okay for fighting games, it’s absolutely nowhere near as good as the TE, and quite frankly I perform pretty poorly with it – missing simple shory’s, ‘doukens and supers all over the place.

A MadKatz Tournament Edition fightstick

An X-Arcade Dual Stick joystick

I know I can do these moves consistently on the TE, but I live in a world of fail on the XA i.e. if I flub an ultra on the TE I’m disappointed, but I’m barely able to even make an ultra on the XA. So what’s going on?

Continue reading A Beginner’s Guide to Joysticks and Fightsticks

Useful SQL Commands

I recently needed to take a database with separate date and time columns, convert that combined date-time data into Unix time format (i.e. seconds since the epoch [1st Jan 1970]), and add a new column to the database with that data. It took me a fair bit of googling to get it all working, so here’s my notes.

Sorry this isn’t really in an article format – but I need this written down and available for the future… Also, I wrote a small Java app to read the separate date and time text files and spit out a timezone-correct unixtime text file, which I then added to a spreadsheet containing just the the primary key rows and exported it as tab-separated values suitable for MySQL (or really, MariaDB in this case) import.

Show the table structure for the ‘accidents’ table

Count unique values in the UNIX_TIME column in the accidents table

Find duplicate values in a column (cannot make column a primary key if there are dupes!)

Make a column be the primary key for a table

Drop the UNIX_TIME column

Add a new column UNIX_TIME to the accidents table after the last column (STAT_DIV_NAME)

Add an empty column with no default value

Create a temporary table in memory with a single column called UNIX_TIME which is of type BIGINT

Import from local CSV file

I created a tab-separated CSV file which had just the ACCIDENT_NO as primary key and the UNIX_TIME field. We can then import that data into the temptable with:

Load all the single-line data values fromthe UNIX_TIME.txt file into the UNIX_TIME column of our temp table

Merge the temptable with just the ACCIDENT_NO and UNIX_TIME into the accidents table using ACCIDENT_NO as the primary key

So in this particular instance where I had a partial update, I was missing 13,375 UNIX_TIME values!

Make sure this worked by setting all the UNIX_TIME values in the accidents table to zero, and then re-importing

Now finally, we can drop the in-memory temptable!

Export the database

To export the database we can use the mysqldump utility (this is NOT within the MySQL command line!):

Then to import this dump, let’s say we don’t have a govhack2015 database

Followed by (in the MySQL command line):

It all works! =D

How to stop a MySQL action which is taking forever… (like when I bodge a merge) – in a different MySQL commandline interface