Posts for 'Development'


Regex Tester, online and now with AJAX!

March 9, 2010 •

Regex-Tester.com - Online version of TiM's Regex TesterWhew. Sorry about that. I was doing some server maintenance in preparation for this new system and I inadvertently broke the backend of my blog. It’s  still a bit hinky here and there, but thankfully we can now return you to your regular program. XD

So, I bought the domain (STILL can’t believe it was still free haha), and then spent a good chunk of the weekend getting it all working. 🙂
As a follow-up to the regex tester script I wrote and released last week, I’ve now created an online version, free for all to use anytime!  ^_^

So, presenting: http://www.regex-tester.com/

If you were wanting to test out the last script but couldn’t set it up locally, you can try it out online now. 🙂

In contrast to the last versions, I modified this one quite a bit:

-Broken up the JavaScript, CSS and PHP into separate files for easier reading/editing.
-Rewrote the JavaScript code using jQuery (Soo much cleaner).
-Added AJAX functionality so the page doesn’t have to refresh each time.
-Added a couple of default regex strings to get you started.

So feel free to use it at your leisure! Depending on my situation, I’ll probably wind up using this one more often than the offline version.
If you do have any suggestions on how to improve it, be sure to check out the UserVoice page as well.

Enjoy!

Well I might let you get back to it then hehe. 🙂
I just saw you online for the first time and thought I

/Regular Expression[s] Script!/

March 1, 2010 •

TiM's Regex Tester after a successful query.I think it’s fair to say that since graduating from univeristy, I’ve wound up doing a LOT of web development. XD

With heaps of small-time client work, building dynamic web apps at a company in Japan as well as pimping out and maintaining WesternAustralia.com for Tourism WA, and now developing for several web apps and web sites at ECU… so far it’s looking pretty diverse hehe. But in any case, I’m totally not complaining here; I love every minute of it! 😀

One thing I’ve found myself doing quite a lot of recently however is content migration. A lot of my work revolves around content management systems, and when it comes to upgrading to a new platform, it usually means having to copy the blocks of text/code out of the old one, re-twiddle any custom tags or syntax inside it, and then paste it into the new one.

But that being said, I quickly discovered a tool which eased the pain significantly: regular expressions! (Or regex, after you get tired of saying regular expressions all the time hehe XD)

Continue reading

DesktopTweet v1.0 Released!

February 14, 2010 •

DesktopTweet LogoWhew! After several weeks worth of coding and debugging, it’s finally finished!

So here it is folks! Presenting DesktopTweet v1.0!! 😀

Sorry about the wait there; the last version of DesktopTweet  I released was back in July of last year. With work and other higher priority commitments, it’s taken this long to finally push out a new version. ^_^;
But I’m hoping it’ll be worth the wait. 🙂

I had a lot of great suggestions on how to improve DesktopTweet over last time, and I did my best to try and add as many new features as I could. 🙂

Continue reading

MySQL + phpMyAdmin Backups = fail

March 4, 2009 •

The System is DownSo… my father often says to me that you shouldn’t make mistakes yourself. You should watch as the people around you make mistakes and learn from them what not to do. That clearly wasn’t the case here. >_<

This is the story of what I’ve been doing in the past 3 days hehe. I’ve been trying to migrate all of the content from our old mod, RPG-X’s forum, to the new UberGames forum me and some friends have been working on. The reasoning for this is to consolidate resources as well as effort.

So, before the migration, I got phpMyAdmin to dump the UberGames forum to a big SQL source file (roughly 30MB worth of letters ) and stored it on my hard drive, and then installed the upgrade script.

My first mistake, I didn’t Read The Flippity Manual (RTFM btw), and I executed the upgrade script from the wrong entry point. This subsequently made the script confused about what system the UG forum was (It figured it was Invision in the end O_o ) and subsequently corrupted several tables in the process. This wasn’t too bad as the tables were really small, and I pasted the data back in from my backup.

Now the colossal fail. Once I’d sorted out the import script and executed it in vBulletin mode, the forum looked like it just exploded. In the process, a whole pile of data mingled as well (ie my account got overwritten by RedTechie’s…? O_o ) and I’m still wondering if that was my fault, or some residual glitches from before.

Sadly… and here’s the kicker, when I went to revert the database, not only did it remove the RPG-X stuff, but it deleted a whole pile of UberGames posts with it, as well as all of the admin accounts, which meant I was no longer logged in… and it kind of collapsed in on itself. XP

Sooo….. I realised I had no choice but to restore the entire SQL database I made, since by this point, the database was riddled with corrupted tables.
At this point, I found out I couldn’t just feed the data back into phpMyAdmin, because it was too big and caused timeouts.

So, RedTechie suggested I go and find a script that handles staggered MySQL queries, and use that. Thankfully, I found an awesome one called BigDump (http://www.ozerov.de/bigdump.php).

And now… icing on the cake, BigDump refused to load my file because it was encoded wrong. Turns out it can’t handle INSERT queries that try to insert all of the data at once… something called extended inserts.

So… long story short, I’ve spent up until now, writing a utlity in C# .NET that could take my SQL file, resequence it into 1 on 1 insertion queries and then debugged it until it worked.

What was meant to be an easy 4 hour task has dragged onto 3 days. Ugh…
I guess I should be happy I learnt a tonne of new stuff in the meanwhile… but I’m not so sure.

So the moral of this story is:
1) ALWAYS (!!!) RTFM!!!!!!!! No matter how simple something looks, there’s always a way to screw it up.
2) When exporting SQL from phpMyAdmin, make sure to uncheck the ‘extended inserts’ checkbox.
3) Test backup restoration before assuming it’ll just work.
4) Save the alcohol-based celebrations until after it works. XD

So yeah…. the forum’s all back online, and I’ve taken proper backups now… so I’m ready to try again haha.

In the meantime, I might also release my ‘SQL Splitter’ program as well, in case anyone else runs into the same problem I had…