Some useful scripts for windows.

Posted by stu at September 6th, 2009

Stoyan of PHPIED.com has found the joy using javascript for scripting in the OS

I’ve put up a few scripts I find useful in windows (download at the end of the article):

  • addpath.js – Add a path to the registry path.
  • dt.cmd – Change to desktop folder.
  • e.cmd – Open explorer in current or specified folder.
  • regpath.js  – Output the path stored in the registry.
  • updateenvironment.js – Updates running apps with any changed settings in the registry.

And a couple that use python and pywin32:

  • ccwd.py – Copy the current working directory to the clipboard
  • cpath.py – Copy the current path to the clipboard

All of have acompanying batch files to run them, I generally have everything in a folder c:\usr\cmd, but they should work from anywhere in the path.

Download  cmd.zip

Posted in making a really nice work environment in windows, making windows usable| 1 Comment | 

Using Java2Python to port a JavaCairo tutorial

Posted by stu at August 21st, 2009

I recently came across Java2Python.  As I’m interested in Cairo I thought it would be interesting to try porting one of the example tutorials from ZetCode.

I’ll run through the steps involved in porting then try and reach some conclusions at the end :) .

1. Get setup

This is easiest in Linux, I’m running Ubuntu (in vmware), and installed

antlr 2.x
python2.5.x
sun java6
pygtk
java-gnome

You can install them like this:

# sudo apt-get install antlr python2.5 sun-java6-bin libjava-gnome-java

Then install Python2Java with easy_install

# sudo easy_install-2.5 java2python

To test if it’s working run j2py -i.  It should complain there is no file:

# j2py -i
Usage: j2py [options]

j2py: error: -i option requires an argument

If you get any other errors your missing some packages.

2. Get the Java Code from the Simple Example.

Save the ‘simple.java’ example as ‘GSimple.java’

If java-gnome is running ok, compiling and running it you should see a window:

# javac GSimple.java
# java GSimple

gsimple

Now we’ll run through the code, it’s important to understand what it does before we port it…

(more…)

Posted in projects, Uncategorized| 9 Comments | 

The Bloggage and slacking

Posted by stu at August 7th, 2009

Just been checking out what Mr Palmer has been up to… quite a lot it seems…   if I could get further than 2 chapters in 6 months with Getting Things Done maybe I could stop procrastination and start GTD too :)

And I’ve been checking out some online comics…

My 6 monthlyish check on SayUncle comics blog always makes me want to do some drawing.

Also Quite enjoying the Beartato in space storyline in nedroid.

Posted in Uncategorized| No Comments | 

Toast

Posted by stu at January 9th, 2009

Lyrics

Posted in Uncategorized| No Comments | 

Router upgrade nixed xbmc

Posted by stu at December 14th, 2008

It turns out my lack of networked media consumption utopia via xbmc was all down to upgrading my router… the xbox was fixed on 10.0.0.x while everything else moved over to 192.168.1.x  …so I learned that SMB doesn’t like that at all.

Oh well, one task down… many more todo… maybe I can actually setup my kurobox in the next few days and then some really nice things might be possible.

Posted in Uncategorized| No Comments | 

Flex for developers – Bootstrapping

Posted by stu at November 29th, 2008

A lot of information on the web is aimed at people who use flashdevelop and other guis to build flex apps, this article is aimed at developers.  I’ll give you the information to get started with flex development quickly, using the free sdk and building with ant from the commandline.

A passing knowledge of ant wouldn’t hurt either.

This tutorial uses the file blankapp.zip to help bootstrap you into the world of flex / actionscript development.

Prerequisites

Flex SDK

You will need the flex sdk available from the flex developer center

Apache ant

You will need apache ant, make sure that the bin folder is in your path.

Copy flexTasks.jar from the flex ant lib into your own ant lib folder.

Setup

Extract the blankapp.zip to a folder

Open build.xml and change the line <property name=”FLEX_HOME” value=”/usr/flex/sdk3″ /> to point to the flex sdk.

Build

You can build it by typing

ant build

You should see some output like this

Buildfile: build.xml

clean:
   [delete] Deleting directory C:\Documents and Settings\Stuart\Desktop\projects\flex\blankapp\build

init:
    [mkdir] Created dir: C:\Documents and Settings\Stuart\Desktop\projects\flex\blankapp\build

build:
    [mxmlc] Loading configuration file C:\usr\flex\sdk3\frameworks\flex-config.xml
    [mxmlc] Initial setup: 172ms
    [mxmlc] Loaded 8 SWCs: 391ms
    [mxmlc] C:\Documents and Settings\Stuart\Desktop\projects\flex\blankapp\src\blankapp_333027.cache (The system cannot
 find the file specified)
    [mxmlc] Files: 328 Time: 1562ms
    [mxmlc] Linking... 16ms
    [mxmlc] Optimizing... 125ms
    [mxmlc] SWF Encoding... 47ms
    [mxmlc] C:\Documents and Settings\Stuart\Desktop\projects\flex\blankapp\build\blankapp.swf (159158 bytes)
    [mxmlc] Persisting 33 compilation units... 15ms
    [mxmlc] Total time: 2328ms
    [mxmlc] Peak memory usage: 59 MB (Heap: 33, Non-Heap: 26)

BUILD SUCCESSFUL
Total time: 2 seconds

A new file, blankapp.swf should now be in the build folder

Type

ant deploy

To copy it to the deploy directory (later you can customise this later).

If you open the blankapp.swf in the browser you should see something like this

It’s fairly bare, but demonstrates some basic techniques and a couple of widgets.

Mxml and Actionscript, how they link together

There are two important parts, the blankapp.mxml and org/blankapp/BlankApp.as.

The mxml file defines the layout while the actionscript contains code to be executed.   In this case there is one mxml file, BlankApp.mxml which links to a single actionscript class, BlankApp (in the file src/org/blankapp/BlankApp.as).

The directory structure org/blankapp, defines the package, in much the same way as java packages.

The graphic below shows how the class is linked to the mxml and where the instance of the class is:

The app is very basic, but should provide a jumping off point.

Adding libraries

If you need to add any libraries, just place the swc files in the lib folder and they will be included, the build.xml can be changed if this isn’t satisfactory.

Afterword

I only wanted to get started with papervision, but found it a bit of hassle to get started, hopefully this post will help people get started quickly.

Acknowledgements

The ant build file is by no means my own, owes inspiration to previous ant files I’ve known, including the pyAMF one and information available on the web.

This blog entry: http://talsma.tv/post.cfm/ant-mxmlc-and-swc-files for the info on how to include swc files.

Posted in projects| 5 Comments | 

Aggregated angst

Posted by stu at October 5th, 2008

A little python, a lot of angst…  for just 3 hours of work this was definitely worth it :)

Click the image to view it in wordle where you can mess with it.

I love the way that Im is the biggest word, you can really see how egotistical they are on grouphug.

(Cheers to Andy for turning me onto wordle and helping with ideas).

Posted in projects| No Comments | 

Noodleglue – found!

Posted by stu at October 1st, 2008

For the last few days I’ve been looking for a project called NoodleGlue.  I got interested when I wanted to look into generating java wrappings for the Verse library.

If you just want to download Noodleglue skip to the end of the article.

Verse is a network protocol that lets 3d applications talk to each other in realtime, being developed by the Blender foundation.  I was wondering how difficult it would be to link the ease of use of processing with the power of Blender.

(more…)

Posted in Uncategorized| 8 Comments | 

Virtual Machines in version control

Posted by stu at September 28th, 2008

I’ve been interested for a while in putting virtual machines into version control – I haven’t tried it yet as I’d imagine most modern vcs would grind to a halt.    The idea is – keep your machine in something like git (I hear it’s the most space efficient – svn would be a definate nono), and keep a copy on one of the large usb sticks that are now available.

(more…)

Posted in general| No Comments | 

Track all your forum posts in delicious

Posted by stu at September 21st, 2008

I’ve been using delicious for a while, but have started bookmarking all my forum posts in there, it should be a lot easier for me to find out whatever I was talking about in the future :)

Posted in Uncategorized| No Comments | 

« Previous Postings | Next Postings »