How To – Control Your Computer with an Xbox Controller


Today I’m going to walk you through setting up an xbox controller to work on your computer and control the mouse / keyboard.

First your going to need an Xbox Controller that works on Windows.  If you already have an Xbox controller you can just pick up one of these receivers. (Both links to Amazon, you can  find on  eBay cheaper).

Next you’ll need to install the drivers for the controller. You can find them on Microsoft’s website here.

Now you should be able to connect your controller to the computer and play any games using it. However you can’t use it to control the mouse yet. What we will need to do next is download JoyToKey from here. I went with the latest Beta version however you can also download the stable (v 4.6 at time of writing).

The second last step is to download my config and shortcut to the on-screen keyboard put the configuration in the folders shown and run JoyToKey.

The last step is to enjoy being lazy! 😉


Posted on January 25, 2012

CSS Code for Wrapping Long URLs and Text

Ran into the problem last night that a long email was messing up a design in smaller screen resoloutions.

Perfect fix down below:

pre {
white-space: pre; /* CSS 2.0 */
white-space: pre-wrap; /* CSS 2.1 */
white-space: pre-line; /* CSS 3.0 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: -moz-pre-wrap; /* Mozilla */
white-space: -hp-pre-wrap; /* HP Printers */
word-wrap: break-word; /* IE 5+ */ }

Thanks to perishiable press for this one, read more about it here.


Posted on October 04, 2011

WordPress – Shortcode in PHP files

So in WordPress with plugins etc. you end up using shortcode in posts to keep things simplier, an example would be if you want to display a gallery you would just use:
[galleries id="1"]
However trying to this when your outside of the “WordPress Loop” [in your theme files usually] you will hit the problem that WordPress won’t parse the shortcode. So whats the soloution? Super simple just append the following to your shortcode:
echo apply_filters('the_content', '[galleries id="1"]');
Presto, it works!

To read up more on shortcodes in WordPress click here.


Posted on September 11, 2011

Why I’m learning Perl

So this post may not be to everyones taste, its more a post to remind myself why I’ve decided to learn Perl. If anyone doesn’t know I already know PHP and some Java.

Perl is a programming language, It’s Object Oriented, simple to learn and very powerful. Perl stands for: “Practical Extraction and Reporting Language” but others have come up with many more interesting and colorful names for it;
Perl is “the little language that could” it’s designed to be able to do as many tasks as possible in as little time as possible.

“A good perl program is one that gets the job done before your boss fires you.”
Larry Wall, the creator of Perl.

Perl is an Interpreted language, so you don’t have to compile it like you do Java, C, C++ etc. For fast development work, that’s a godsend.

Perl has been successfully used for a lot of diverse tasks: text processing, system administration, web programming, web automation, GUI programming, games programming, code generation, bio-informatics and geneological research, lingual and etymological research, number crunching, and testing and quality assurance.

Perl Pros:

  • Cross Platform compatability. A perl script for linux/unix will work just as well in windows and vice versa, and the only exceptions to that rule are those dicticated by the operating system itself. (for example file paths are different in windows and unix.)
  • Online support. Perl has been around since the early 90’s, its exceptionally well known and thousands of tutorial and help sites abound on the internet.
  • CPAN.org, a massive collection of perl modules that can do almost anything, someone has usually done the work for you.
  • Taint mode, this helps you to write secure code by not trusting any data provided by the users until you have tested and declared it safe.

Perl Cons

  • Speed. Apparently with a very large program [Like word or something] the  sheer size of it would make it extrememly slow to compile at runtime.. This is the only Con I’ve found about Perl!

 


Posted on August 19, 2011

PyroCMS – CMS on the CodeIgnitor Framework

So lately I’ve been playing around with PyroCMS, for any of you who don’t know about Pyro, its basically an open source content  management solution thats based on the CodeIgnitor framework. What does that mean you ask?

  • MVC design pattern. (Model->View->Controller)
  • Security,  Cross-Site Request Forgery protection, XSS filtering and very secure password encryption.
  • Caching, in order to achieve maximum performance.
  • Translated into 16 languages!
  • Extremely lightweight!
  • Support for modules, themes, plugins and widgets!
  • Multi – Site Manager (In Pro Version £45 )

Really it takes the pain out of  making your standard websites, you’ll have an area where the client can update their website in a simple environment  and thanks to ‘permissions’ you can be sure they won’t mess anything up!

Of course there is always going to be a stage when your better off without a framework, but for projects that it will work for, PyroCMS will save you a BUNCH of time!


Posted on August 14, 2011

Esprimo Mobile v5535 and Ubuntu 10.10

So I ended up picking up a cheap Esprimo Mobile v5535 a few days ago, long story short; laptop broke, Argos have sent it off for repairs that will take 2-3 weeks, don’t buy a laptop from Argos! 😛

Anyway the Esprimo Mobile isn’t exactly a cutting edge laptop, if you said it was outdated you wouldn’t be wrong! 😉 When I got it the OS installed was Windows Vista, “ambitious” I thought, of course I can’t have any kind of computer without tinkering with it endlessly to find out the best way performance wise for it to be running, Ubuntu was in my head from the start but an apparently broken CD-drive was putting an end to that.. I’ve never tried to install Ubuntu from a network and I wasn’t going to start now, [USB wasn’t an option in boot] instructions on Ubuntu’s Support don’t make a network install look simple!

A few Registry edits later, (one too many infact) I had the CD-drive working but Windows locked in that state of “somethings missing, would you like to use Startup Repair?” and then when using Startup repair just rebooting the computer into the same cycle. No worries though at this stage I just began installation of Ubuntu. I was surprised to see that the Wi-Fi worked from the get-go, is nDiswrapper ever needed any more? 😛 The only issue was the resolution seemed to go no higher than 800×600.. Of course a few google searches later and I found this article which explains how to install the drivers for SiS Graphics. Using their default Xorg.conf and driver I rebooted only to find the machine now screwed graphic wise, lines all down the screen changing.. I originally thought it was the refresh rate but hell this is Linux, you could set every setting to the absolute worst one possible and still be able to change back, where is that option Windows? So I switched to a terminal window [Ctrl + Shift + F5 (any F key) for those interested] opened up Xorg.conf using "sudo nano" changed what seemed to be affecting the graphics;  Option  "UseTiming1366" "yes" to Option "UseTiming1366" "no" [didn’t know yet if it was the problem] rebooted and presto a 1280×800 resolution!

So the point of this story is; It’s great how in Linux you’ll mess something up and still be able to repair it via a terminal window, and if you need better resoloution on your Esprimo Mobile click this link.


Posted on February 04, 2011

Installing PEAR in WAMP

So this evening I went about attempting to install PEAR on my WAMP installation, this should be as simple as opening up a command window navigating to C:/wamp/bin/php/*phpversion* and running “go-pear.bat”, however upon doing this I ran into the following errors:

phar “C:\wamp\bin\php\php5.3.0\PEAR\go-pear.phar” does not have a signaturePHP W
arning: require_once(phar://go-pear.phar/index.php): failed to open stream: pha
r error: invalid url or non-existent phar “phar://go-pear.phar/index.php” in C:\
wamp\bin\php\php5.3.0\PEAR\go-pear.phar on line 1236

Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: pha
r error: invalid url or non-existent phar “phar://go-pear.phar/index.php” in C:\
wamp\bin\php\php5.3.0\PEAR\go-pear.phar on line 1236
Press any key to continue . . .

A couple of Google searches later I got the answer needed to fix my problem, simply running this command instead:

php -d phar.require_hash=0 PEAR/go-pear.phar

A couple of questions later PEAR was successfully installed and running, so if your running into the above error you now know what to do! 🙂


Posted on December 27, 2010

Food For Thought – Cross Browser .PNGs

I don’t know about you, but I’m hoping for a 2011 where all browsers handle .PNG’s the same!


Posted on December 24, 2010

Saving Your Windows PC From Virus Infections with Linux

Often you get a friend or other times a client who has gotten themselves locked out of their system by a virus. I’m talking about the seriously nasty virus’s out there that will just corrupt every .dll file they can get their hands on so the minute you try to open any program, your reopening the virus.

When this is the case there isn’t much you can do in terms of anti-virus scans etc. your only option is to wipe the machine and go for a clean re-install of Windows.

But what about all my files?

Well we backup all of those files onto an external hard drive before wiping by loading up a “Live CD” of Ubuntu, simply navigating to the computers hard drive,  selecting what we need and loading it onto the external hard drive.

The beauty of a “Live CD” is that the entire operating system runs of the CD [believe me you’ll here it spinning around the place] so the virus has no chance to load since Windows never gets booted.

Ontop of that Linux systems aren’t vulnerable to Windows virus’s so you can be sure your not infecting your external hard drive aswell.


Posted on October 30, 2010