Writing a shoutbox in nihongoresources
Thursday 22nd of July 2010, 09:55:58 pm
Because I'm migrating some of the functionality of nihongoresources to a new domain, dictionaries.nihongoresources.com I figured this was a good opportunity to let people voice their opinion in a less barrier, more direct way. Shoutbox style.
I tried a few premade ones, but they all had their own issues, so I figured I have enough technical skill, why not write one myself? After all, how hard can it be? This not being Top Gear, the answer is "not really that hard", you just need to make sure to do things in such a way that other people will be able to customise it easily. Because that means you'll be able too, as well.
The result is a pretty simple PHP SQLITE backend / JS CSS frontend shoutbox that uses the remarkably simple on-page code "<div id='shoutbox'></div>" and that's all you have to do (well, and load the shoutbox.js script of course).
It works well enough for me. To see an example in action, just head over that aforementioned dictionaries.nihongoresources.com!
Download: here
I, for one, welcome our North Korean traffic wardens in odds and ends
Wednesday 7th of July 2010, 07:51:03 pm
Futuristic deployment methods are futuristics.
Thinking of buying Ziro? in odds and ends
Monday 21st of June 2010, 10:44:18 am
If you're thinking of buying Ziro, the puzzle game, you may want to wait to see if the developers ever write a fix for the terrible mouse lag that the game suffers from. A game this simple (think iPhone app game) should not, and frankly speaking cannot, come with mouse lag. Yet it does. Terrible mouse lag. This makes the game utterly unplayable. Save your $5 or so for now. It really isn't worth the hatred you'll be spewing at your screen.
A simple website link mapper in programming
Friday 14th of May 2010, 02:31:16 pm
Ever had the problem where you needed to do a forward and backlink analysis of a website? Sure, for a simple homepage it's pretty easy, and some blog software will let you do it, and if you like google analytics (why do you like google analytics?) that will conceivably be able to help you do it too, but sometimes you're like me, and you just want a tool to do the job for you. You're thinking of using wget, but it doesn't actually do link mapping, just recursive webmirroring, so what are you to do...
Well, you download this script, rename it from getlinks.php.txt to getlinks.php and run it after you've run wget for the site you need to profile:
shell> wget --output-file=result.log --no-cache --html-extension --no-cookies --recursive --domains=mywebsite.com --accept *.html http://www.mywebsite.com
shell> php getlinks.php > result.txt
Job's a good'n.
And yes, I could have written it in PERL (heck, I already have several dirstructure traversing perl scripts for the various odds and ends jobs I do) but honestly, finding people who can actually READ perl code has become a rarity in and of itself. PHP is just as functional (oh, get off it, yes it is. I said functional. As in: it gets the bloody job done) and easier to read for most people who are passingly familiar with programming.
Internationally Published Author in me
Wednesday 21st of April 2010, 01:33:42 am
At long last, my book "An introduction to Japanese - Syntax, Grammar & Language" is properly published and available for purchasing. I will be selling autographed copies via http://www.sjgrpublishing.com and regular copies are available through amazon US, Canada, UK and Germany (since there's no amazon.eu) although that said, the German site seems to sell it at a price 100% higher than they should.
The book costs $30 (both US and Canadian), £20 (in UKish regions) and €20 for the European market. Amazon.de charges €39. I have no idea why.
Anyway, hurray for publication, now to move focus to sales!
Computing bezier curve bounding boxes in odds and ends
Tuesday 20th of April 2010, 05:04:04 am
Have you ever needed to compute the bounding box for a vector shape? You may have run into the problem that computing bounding boxes for lines is really easy, and that computing bounding boxes for arbitrary curves is, in fact, not. Not to worry! If you don't mind getting your brain dirty, I suffered this problem so that you don't have to. Compute the bounding box for Bezier curves in the knowledge that math is on your side!
Let's talk about democracy in Articles
Friday 26th of March 2010, 02:26:12 pm
For the first time in quite a while, I've written a new article on my live journal. This time on the concept of democracy, and how what the US has just pulled off is nothing even close to a democratic process. Feel free to peruse it.
Photoshop CS4 without all the rest in odds and ends
Sunday 3rd of January 2010, 10:28:45 am
I had to redo my computer setup, as I literally fried my system disk (ever seen an HD short circuit? There's a lot of smoke...) and that meant reinstalling Photoshop CS4. This time round I wanted to make sure I only installed what I needed, without all the crap Adobe's installer forces on you, so in the hopes that Adobe doesn't delete the post, instructions on how are here.
If they do, a verbatim copy:
All the dependencies that are not marked as "critical" in the proxy payload XML files for Bridge3All, CSIAll, Photoshop11-Core and Photoshop11-Core x64 need to be commented off, prior to running the installer. This will give you the ability to uncheck everything (except for Drive x64, which can be turned off by turning off the 32 bit version of Drive, so no loss there).
In order to just get Photoshop installed without all the unwanted/unnecessary components, the only things that need to be checked are:
- CMaps (required for proper typesetting for fonts with CID maps, which you care about even if you don't know what that means)
- All Color specifications
- Photoshop (obviously)
- Type Support (lets you type text in photoshop. rather essential)
- XMP Panels (required for the user inferface)
Optional, but recommended:
- Fonts (quite a number of good fonts, no reason not to install these)
- Photoshop Support
- Search for Help
- Commoncolor components (if you care about synchronised/calibrated color work)
- Update Manager (updates are good)
Do you use dokuwiki? in odds and ends
Thursday 20th of August 2009, 02:46:27 am
If you do, then perhaps this plugin that I wrote will be of use to you; it lets you use standard tab delimited tables in your wiki, turning it into proper tables when you view the page in a browser.
This allows you to keep your data as pure as possible (ie, not having to stick in annoying wiki tabling formatting) for processing by other programs or utilities.
Enjoy.
Playing games in windowed mode in odds and ends
Saturday 6th of June 2009, 08:39:26 am
First off, if you play Maple Story, go away.
If that statement didn't make sense to you, allow me to explain. "Maple Story" is an online multiplayer RPG gamy that doesn't let users play it windowed, because that lets you run bots (gasp! imagine!). A bit like WoW, really. Of course, that's also incredibly inconvenient in an age of instant messengers, and so every single Maple Story player has been begging for a way to play it windowed.
Which has made them clutter up the internet something awful. Their millions of posts on forums about getting their game to run in a window makes trying to find a proper solution to running games (or more precise, applications) that use DirectX in windowed mode a ridiculous pain.
Now, I've suffered for you, so you don't have to. Before we continue: the "-win", "-window", "-windowed" etc. command line flags rarely ever work because they're not a universal. Programmers have to explicitly add argument interpretation to their executable, and most will go "fuck that, that's what the in-app configuration is for". So tough luck, don't you dare spout that nonsense on the internet as a viable solution.
With that covered, in the hopes that you don't have to go through the same pain I did, here's the list of programs you will want to have run across (but most likely won't have, because searching for them takes forever):
This is an old (2006), discontinued, DirectX hook utility that lets you play, yes, Maple Story in windowed mode. Also, Starcraft. However, that's pretty much where its compatibility ends. Want something more powerful? You then probably want...
3D-Analyze (click on files, then click the 3D-Analyze picture)
This is an even older (2004), and discontinued, DirectX hook utility that lets you force a hell of a lot of DirectX properties, as well as faking different graphics devices, to see how well the application copes. One of the options is a "force windowed" mode, but like DxWnd, this doesn't work with all applications. If it doesn't, you'll probably want to try...
D3DWindower (real version at geocities but it's a Japanese page, which I doubt you'll be able to read)
This is a slightly more up to date utility (2007) which will hook into DirectX and tries to make it behave, window wise. Generally, this is a good utility, but if it doesn't work, don't despair just yet, because there's always the ultimate solution...
Why is this the ultimate solution? Because this is a DirectX debugging utility. It may be older than DirectX 10, but it was designed to hook into DirectX so hardcore that it would allow DirectX programmers to debug full-screen applications by forcing their fullscreen resolution to something smaller than full screen.
Because of this. it seems to work for most applications that DxWnd, 3D-Analyze and D3DWindower do not work for. Unsurprisingly, this utility too is discontinued, although development stopped in may 2008, so it's only been discontinued relatively recently. Despite of this, if your game is preDX10, good chance this hook will do magical things to otherwise ridiculously stubborn games (I'm looking at you, Lego Star Wars II)
So there you go, four utilities that you can try to get your games to bloody run the way you want them to, rather than the way the game companies want you to. And not a moment too soon, here I was fearing I had to learn Windows and DirectX programming so I could write a stupid fullscreen-disabling-hook myself.
If you're a windows programmer with DirectX knowledge, do the rest of the world a favour... update D3DLookingGlass (it's open source!) for us so it also works with DX10.
Cheers!
- Pomax