category: Programming

Sublime Text Customisation

8 Jan, 2016 - 1 minutes
Here are a list of some plugins I like to use with Sublime Text, you can install the Package Manager from: I do a lot of markdown editing and pandoc converting. e.g. Markdown to PDF, which first converts it to LaTeX so it looks pretty good. Plugins Pandoc: Converts markdown into, HTML5, PDF, and Word Documents. Word Count: Displays a word count in the status bar, I like to enable the enable_readtime setting to give me an indication of how long my text will take to read.

Python Learning

16 Apr, 2014 - 7 minutes
Random Talk Meta Programming Ruby - Book Netflix - Chaos monkey/gortilla/kong Testing thing which randomly shuts down servers, racks and data centers. Jython - Python+Java Mainly used in admin and QA """ HereDoc - Here be documentation (note it’s three double quotes) Execution in the kingdom of nouns Eric Evans, Domain Driven Design.

Script to get HTTP Headers

2 Aug, 2013 - 1 minutes
The below script uses urllib2 to connect to the given URL(s) then prints out the HTTP headers. #:/bin/python import urllib2, sys if len(sys.argv) == 1: print "Please feed me a URL...\n\n<3\n" sys.exit(0) for url in sys.argv[1:]: r = urllib2.urlopen(url) print 'URL: ' + url + '\n' + str( An example of it working is shown below. From a “security through obscurity” view, you’d want to conceal your HTTP server information.

Eclipse and Android Dev

2 Sep, 2012 - 1 minutes
If you get the following error with Eclipse on Linux (Maybe Windows): Cannot complete the install because one or more required items could not be found. Software being installed: Android Development Tools 0.9.4.v200910220141-17704 ( 0.9.4.v200910220141-17704) Missing requirement: Android Development Tools 0.9.4.v200910220141-17704 ( 0.9.4.v200910220141-17704) requires 'org.eclipse.wst.sse.core 0.0.0' but it could not be found Go to Help->Install Software Click on “Available Software Sites” Set “check” on check box - (for helios - Eclipse 3.

Git password caching

25 Jun, 2012 - 1 minutes
git config –global credential.helper cache git config –global credential.helper ‘cache –timeout=3600’ The first command enables the password caching, the second sets the timeout to 1hr. Note this won’t work with ssh, but you will have already setup SSH Keys, right?

Find your Twitter ID

25 Jun, 2012 - 1 minutes
To locate your twitter ID, you can get all inforamtion about your account from this link. Make sure you replace screen name with your twitter username.<username> Now that you have your twitter ID, you can do cool things such as get your twitter timeline as an RSS feed.

Android SDK on Linux 64bit

25 Jun, 2012 - 1 minutes
Dispite there being only a 32bit version of the android SDK, you can still work with it on your 64bit machine, make sure you have the following packages installed: Debian, Ubuntu, etc apt-get install ia32-libs apt-get install sun-java6-jdk Fedora, CentOS, etc yum install glibc.i686 zlib.i686 libstdc++.i686 Download the 32bit SDK wget (If link is dead see Reference) Extract and change into the newly created directory and run tools/android update sdk –no-ui.

Playing with Unetbootin

25 Jun, 2012 - 1 minutes
I was using netbootin like I always do, got annoyed about the fact that I couldn’t find my iso image in the mess of files which is called my home directory. That’s when I thought I could implement a filter… Objective To add a filter to the image selection screen. Action First I searched unetbootin’s bug system for any referrence to a file filter and found this, which I assigned to my self.

Wordpress edit media not working

9 Apr, 2011 - 1 minutes
I was attempting to edit an image from my media library, and found that I was unable to crop or resize it. There wasn’t even a sign of the image. The only error that the error console gave was “Image corrupt or truncated” I found that if you are to remove all white space, after the closing php tag from the functions.php, it fixes the problem . Wordpress Ticket #10633

Netbeans illegal instruction Ubuntu

12 Dec, 2010 - 1 minutes
If you keep getting ‘illegal instruction’ whilst trying to run simple working code in using NetBeans and Ubuntu. It Can help if you disable profiling on your project. simply project -> properties -> profiling .. disable all. Might help, Pete

C Force stop on warnings

5 Jul, 2010 - 1 minutes
To make sure that you write good clean code, you might be wondering how to make your complier stop on warnings, well now you can with this additional command line option: -Werror

How to turn off CYGWIN MS-DOS style path warnings

29 Jun, 2010 - 1 minutes
Add a new Windows system variable with a variable name of “CYGWIN” and variable value of “nodosfilewarning”. That should disable the very annoying error, or you could fix it by using correct UNIX pathnames.

Game development Update

31 Aug, 2009 - 1 minutes
For the last couple of days I’ve been playing around with panada3D game engine. So far with out much problems I’ve been able to create 3D sound, landscape collision, 3rd and first person camera. I have also been messing around with blender and been able to UV map my models that I make useing it. This means that my boaring white meshs are all nice and colourfull see; The orb of Azumanga spins!

Set start_point for Panda3D useing Blender

How to create a start point position for your maps/models useing blender and Panda3D. When I was following the Roaming Ralph sample code I was unable to recreate the world model to use the start point value. This is how to do it. Step One Create a Vertex or plane, any thing, in the place where you want your start_point to be. Step Two Make sure that you are in Object Mode not edit.

Frame rate independent movement in PyGame

19 Aug, 2009 - 1 minutes
To make sure that your game runs the same on all computers that can handle it. You will need to make sure that your actions are independent from the frame rate. To do this in python you can put this code above the game loop framerate = 60 #frames per second clock = pygame.time.Clock() and then at the end of your game loop put timepassed = clock.tick(framerate) This should help with makeing the game more playable ^_^ Hope this helps.

Stale Desktop Environments

I am bored of all the same desktop environments, they all look the same. They all have the same flat 2D display. since the release of Vista they have all gone flashy and shiny, that’s great but it is still the same as the old ‘95 desktop, it has a menu at the bottom and flat 2D windows. Yes there are some desktops that have some sort of 3D or 2.

JScrollPane back to top

1 May, 2009 - 1 minutes
If you want to make your JScrollPane return to the top once you have enter some text, try this: myTextArea.setCaretPosition( 0 ) It places the curser back to zero and in turn makes the JScrollPane go back to the top. Worked for me, hope this helps someone.

MMORPG Update #2

9 Mar, 2009 - 2 minutes
Okay so after a very long time here is a MMORPG Codename Starquest Update. This only contains some basic images, which have been created useing the IrrLicht engine and varius other applications such as 3D Studios Max, Blender, Earth Sculptor and Photoshop. Below shows the lightmapping test on a room mesh. [Image lost] The lighting was created useing irrEdit, it generates the light effect and creates an image to be placed over the mesh.

Programming Variables Very Basic

12 Sep, 2008 - 1 minutes
A variable is data that is stored in the computers memory. A variable can be a number (Integar, Float) or just one letter or number (Char) or it can be a string of letters or number (String) in some programming languages like Java and C/C++ you need to declare and initialize the variable, this means that you have to say what type it is and what it is called. With some scripting languages like Python and PHP you don’t have to declare them which means that you don’t have to say what type they are you just give them an name.

PHP #1

11 Dec, 2007 - 2 minutes
To start with PHP you need to have a web server that supports PHP. You can either use a free web host, or run your own server. If you want to run your own web server on windows just download XAMPP. Once you have that downloaded and installed, all you do is save your PHP scripts in the htdocs folder (Same for all web servers) then navigate (in a web browser) to http://localhost/.


9 Dec, 2007 - 3 minutes
Okay lets start of with some simple HTML. Today we will earn how to use the heading tags (H1, H2, H3 etc) and the bold (B) tag. And we will also learn how to setup your (possible) first page. Start by opening up your text editor, I will be using gedit, feel free to use any plain text editor such as Notepad (Windows). Okay so now that we have our text editor open.

Programming Comments

9 Dec, 2007 - 2 minutes
It is good practice to include lots of comments in your code so that when you or someone else comes back and looks at the code you/they will understand what it is meant to do. A comment will be ignored by the compiler, this means that anything in between the comment tags will not become a program. (Makes any scene?) Normally there are two ways to write comments, one is a single line, and one is a multi line comment.

Python #1

8 Dec, 2007 - 1 minutes
Okay to start download python (If your running Linux, you will allready have it installed. And don’t goto Once you have python installed look for the python interpreator or shell. Once you have located that you simply type: print "Hello World!" That will print “Hello World!” to the screen. If you want that to be in afile so that you can save it open up your best text editor and write

C++ #1

8 Dec, 2007 - 2 minutes
Okay to start programming in C++ you need to have a compiler. A compiler turns your source code into binary computer talk. The best compiler for you if your running Linux will be g++ (Just type g++ <filename>, in the terminal), or if your on Windows you might want to try Dev C++. Dev C++ is an IDE, which stands for Integrated Development Environment, an IDE combines the editor, compiler and other useful tools in the same software package.

Java #1

8 Dec, 2007 - 1 minutes
Right to start writing Java programs you need to download the Java Software Development Kit (SDK) from here at the site. Once you have that done you may what to use an IDE, one good one for Java is JCreator, you can use it for free. Now open up the IDE/Text Editor and enter the following for the Basic Hello World Example! public class <filename> { public static void main(String args []){ System.

Programming Task #1

8 Dec, 2007 - 1 minutes
I have a small task for anyone who wants to learn a programming language be it Python, Java or C++. I would like you to write a program that can: Output your name and your age on two different lines Output your address on multiple lines And if you know how add some comments if not see me tomorrow. Pete Out