Cool Things You Can Do With Unused Keyboard Keys

January 14th, 2010

Most computer keyboards have one or more keys that see next to no use in day-to-day work. The standard 104-key Windows keyboard has a whole bunch of them – ScrollLock, Pause/Break, CapsLock, the Menu key. Depending on your typing style, even more keys – like the extra Alt and Ctrl keys to the right of [...]

Continue Reading...

Reliably Detecting The WordPress Version

December 2nd, 2009

Sometimes you might want to find out if a website is built with WordPress, and which specific version of WP it’s running. In this post I’ll discuss a number of detection techniques, including ways to deal with sites that hide the fact that they’re running WordPress or spoof the version info.
For non-programmers : If you [...]

Continue Reading...

Detecting Parked Domains

November 13th, 2009

Some time ago, a commenter asked me if it was possible to make one of my WordPress plugins detect and report parked domains. I’ve done some research since then, and while it’s probably not practical to add such a feature to the plugin, I did come up with several ways to programmatically detect parked pages. [...]

Continue Reading...

How To Extract HTML Tags And Their Attributes With PHP

October 20th, 2009

There are several ways to extract specific tags from an HTML document. The one that most people will think of first is probably regular expressions. However, this is not always – or, as some would insist, ever – the best approach. Regular expressions can be handy for small hacks, but using a real HTML parser [...]

Continue Reading...

How To Make a “Falling Sand” Style Water Simulation

September 29th, 2009

Have you ever wondered how all those “falling sand” games work under the hood? If so, read on. Today I will discuss one of the possible ways how you could implement the “falling” part of the game – sand particles falling under the effects of gravity, water (or other liquids) flowing down a hillside, and [...]

Continue Reading...

Simple Fluid Simulation With Cellular Automata

September 1st, 2009

Last week I couldn’t use my regular dev. machine (broken graphics card), so all my WordPress-related plans were on hold. To pass the time, I built a simple water simulation in Processing. Today I’m going to show you this little application and explain how it works. Online demo and source code are included.
Big Words, or [...]

Continue Reading...

Make Any Application Remember Window Size

June 23rd, 2009

Many applications have this convenient feature where they automatically save the current window state (like size and position) when they shut down and then restore it the next time you run them. For example, all modern web browsers will automatically remember their window size and most IM clients/media players/gadget apps will obediently stay put in [...]

Continue Reading...

How To Get Per-Core CPU Usage

April 17th, 2009

It’s pretty easy to get the average CPU usage, but how about calculating the per-code load on multicore systems? Turns out it’s also simple enough if you use performance counters.
Windows API includes a subset of functions that provide various performance-related information, which includes data on how busy individual processors or cores are. In this [...]

Continue Reading...

How To Open .MDF Files

March 18th, 2009

What is a .MDF file anyway?
The .MDF file extension usually designates a proprietary disk image format used by Alcohol 120%. Like ISO files, MDF files contain an exact copy a CD or DVD. This format is typically used for backing up discs and also for sharing the “backups” over BitTorrent or other P2P networks.
There [...]

Continue Reading...

Text Classification With PHP

March 7th, 2009

Text classification is probably the most popular real-world application of machine learning and other AI techniques. This is because the adaptive spam filters that guard our inboxes, comment forms and guestbooks are basically specialized text classifiers that only deal with two categories – “spam” and “not spam”. Text categorization can also be used to detect [...]

Continue Reading...

Make Your Plugin Faster With Conditional Tags

February 22nd, 2009

One of the reasons why WordPress can be slow is that it loads all active plugins on each and every page, even if some of those plugins aren’t actually used on that page. For example, an active anti-spam plugin will still be loaded even if the current page doesn’t contain a comment form (e.g. category [...]

Continue Reading...

How To Identify a WordPress Theme

February 15th, 2009

Say you stumble upon a WordPress blog that has a gorgeous design. Amazed, you wonder what theme they’re using. Of course, it would be straightforward to just email the blog’s author and ask, but it might take a few hours (or days) until they get back to you. Here are three simple ways to identify [...]

Continue Reading...

Does Adblock Matter For Your Site?

January 26th, 2009

There’s been some controversy about the ethics of using Adblock. Webmasters want advertising income, users want a better browsing experience. Yadda yadda yadda. I can certainly sympathize with both sides of the debate – on the one hand, I hate intrusive ads as much as anyone. On the other hand, this site is mainly ad-supported.
But [...]

Continue Reading...

WordPress API Resources

January 14th, 2009

[Here's some list-cliche-filler stuff while I fight off a (hopefully) temporary bout of unproductivity and dentists]
WordPress internals are documented pretty well, but sometimes finding the right API/Codex page can take a while. That’s why I’ve decided to put together a comprehensive list of all APIs used by WordPress to serve as a “jump-off point” for [...]

Continue Reading...

How To Speed Up Sociable

January 10th, 2009

I’ve always cared about WordPress performance. I’ve optimized my database, tweaked the server’s configuration, used plugin profilers and installed WP Super Cache and PHP Speedy WP – the “heavy artillery” of performance-related plugins. However, only recently did I decide to finally track down and fix all the remaining subtle issues that may cause slow loading [...]

Continue Reading...

Get Google Search Results With PHP – Google AJAX API And The SEO Perspective

January 5th, 2009

If you’ve ever tried to write a program that fetches search results from Google, you’ll no doubt be familiar with the excrutiating annoyances of parsing the results and getting blocked periodically. Run a couple hundred queries in a row and bam! – your script is banned until proven innocent by entering an captcha. Even that [...]

Continue Reading...

Fast Weighted Random Choice In PHP

December 10th, 2008

Sometimes you may need to randomly select items from a list so that some items are selected more frequently than others. For example, you might take a list of applications and their download counts, and randomly pick a “featured application” based on the number of downloads.
There are several ways to accomplish this in PHP. [...]

Continue Reading...

Copying A Lot Of Discs/Flash Drives To The HDD

December 2nd, 2008

Optional Intro [skip straight to instructions]
It all started in the ancient days of 5 Years Ago when I, as a poor university student, couldn’t afford a spacious 1TB hard drive. Instead I used CDs and DVDs to store and transfer large files, e.g. movies and music. Over the years, I accumulated huge stacks of unsorted [...]

Continue Reading...

Cross-Domain POST With JavaScript

November 20th, 2008

Normally you can’t send cross-domain requests in JavaScript due to restrictions imposed by the same-origin security policy. There are many clever hacks that circumvent this by using remote script includes (even CSS includes) or proxy scripts, but so far I haven’t seen anything useful for client-side, cross-domain POST requests.
However, it turns out you can [...]

Continue Reading...

Displaying Recent Posts On a Non-WordPress Page

November 15th, 2008

Listing recent posts on a WordPress page is easy – there are various widgets and theme functions available just for that purpose. But what about a non-WP page, or even a different site? That’s not that hard either – simply grab some posts from the blog’s RSS feed and output them on your page. In [...]

Continue Reading...

Parse, Edit And Create Torrent Files With PHP

November 11th, 2008

A .torrent file contains assorted metadata that is stored in a “bencoded dictionary” format. Bencoding is a relatively simple cross-platform encoding used by BitTorrent and a dictionary is basically an associative array. You can find a high-level overview of the file structure here.
To open or edit a .torrent file in PHP you can either parse [...]

Continue Reading...

Custom TV Torrent Feed Via Yahoo! Pipes

October 20th, 2008

There is this problem of being unaware of previous solutions because you didn’t care about the problem when the solutions were invented. There’s also this problem of reinventing stuff because you think you can do better (than the existing solutions). Here’s one of my re-inventions.
I wasn’t around when TorrentFreak posted the useful tutorial on how [...]

Continue Reading...

RAR Converter

September 10th, 2008

These are not the droids you’re looking for.
Let me clear this up for all the people looking for .rar file converters (and trust me, there are many) : RAR files are simply archives, just like ZIP files. They contain other files and folders in a compressed form. The compression, encryption and volume splitting features of [...]

Continue Reading...

How To Convert FLV to AVI

September 9th, 2008

Yay, another tutorial. In this short how-to I will show you an easy way to convert FLV files (AKA Flash video) to AVI. We’ll use a freeware video converter that is designed specifically for converting from the FLV format and works on most versions of Windows. So, without further ado, let’s get started.
1. Download [...]

Continue Reading...

FLV Player For Linux

August 30th, 2008

I’ve seen this question a few times on various Linux forums – how do you play FLV files (AKA Flash video) on Linux? – so I figured I’d write up a short post about my favorite Linux FLV player. As you would expect, it’s open source and it can also handle lots of video formats [...]

Continue Reading...

How To Enable Regedit

August 19th, 2008

If you get the error saying “Regedit has been disabled by the system administrator” when trying to use the Windows XP registry editor, fear not. There is an easy way to re-enable regedit.
Click Start -> Run… and enter this command (all on one line) :
REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableRegistryTools /t REG_DWORD /d 0 /f
You may [...]

Continue Reading...

How To : Opera Password Recovery

July 23rd, 2008

How to recover or export cached passwords from the Opera Wand password manager. While the Wand does not have a built-in recovery function you can use free third-party tools or simple JS hacks to restore Wand passwords.

Continue Reading...

Convert Anything To ISO

July 19th, 2008

A list of free tools and tutorials that will let you convert your disk image files from various proprietary formats (e.g. MDF, NRG, DMG and so on) to the universally supported ISO format.

Continue Reading...

How To Get Redirect URL In PHP

July 5th, 2008

HTTP redirects usually have the response status 301 or 302 and provide the redirection URL in the “Location” header. I’ve written three complementary PHP functions that you can use to find out where an URL redirects to (based on a helpful thread at WebmasterWorld). You don’t even need CURL for this – fsockopen() will do [...]

Continue Reading...

ImageShack Torrent Hack : Get Download Resuming In a Roundabout Way

July 4th, 2008

ImageShack torrent service does not support download resuming for the HTTP download links. However, there is a way to work around that if you are tech-savvy…

Continue Reading...