Developing


I have been playing with Flex a bit, to write an Flash application for my masters degree (I find the flex environment much better for programming than flash), and like most people working with flash I have come up against the cross domain issue (where the player won’t pull data from a domain which doesn’t have a cross domain policy allowing them to do so). This is a problem for the application I am working with, because I want to pull RSS feeds.

The obvious answer, a php proxy. In a way that makes it sound grander than it is because all it really is is a script to pull data from a remote source to get around the cross domain issue.

here is the script (simplified):

<?php
	header("Content-Type: application/xml; charset=UTF-8");
	$url = $_GET['url'];
	readfile($url);
?>

Now the code pulls back the feed as expected, but prepends this:

67c0

immediately before the content. Where does that come from, any ideas? Wherever it comes from it obviously means the feed won’t parse!

In the end, I used curl like this (simplified):

<?php
	header("Content-Type: application/xml; charset=UTF-8");

	// note that this will not follow redirects

	$url = $_GET['url'];

	// create a new curl resource
	$ch = curl_init();

	// set URL and other appropriate options
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_HEADER, 0);

	// grab URL and pass it to the browser
	curl_exec($ch);

	// close curl resource, and free up system resources
	curl_close($ch);
?>

Technorati Tags:
, , , ,

A while back, I was doing some work with Arduino, passing serial data to the mac to a small application written with Processing which converted the serial data into MIDI data and pushed it out into other apps. Now Processing is a Java thing; and the standalone applications it creates are Java applications.

All fine, but a mere few days before an assessment, I couldn’t get the Serial to Midi application to work; I recalled an article on createdigitalmotion.com which I admit, I didn’t read fully, which said the following:

On the music side, Apple dumped its com.apple.audio.midi java package with 10.4.8. Result: not only do you lose all the features that make the Mac great for MIDI, like the IAC bus for inter-application MIDI routing, but your external devices also spontaneously disappear. Nice.

Now at this point, I put 2 + 2 together and got 5 … Apple have broken my app… Ahh what to do - revert my entire computer to 10.4.7?

So, I sat down and over the next few days and with much help, I managed to build (read: hack together) a serial to midi converter in Objective-C and Cocoa. Works perfectly (now!).

So, no more problem. Indeed. And not 1 day later, I remembered that I had bought an Java extension from Mandolane, which was needed for my original app. I reinstalled that and bingo, that worked too. Doh. Doh. Doh.

Oh well; I wanted to start learning Cocoa etc!

SteamSHIFT out.

Technorati Tags:
, , , , , ,

I recently wanted to create an application to allow uploads to a website, in the simplest possible way; so I made a little BASH script which used cURL to post the files to the server. Then with a little Platypus (mixed up with CocoaDialog) magic, I ended up with a droplet style application. If you’re a scripter, and want some application magic then do check it out.

SteamSHIFT out.

Technorati Tags:
, ,

Presenting Version 1.3 of my Wordpress Category Cloud widget. This one is compatible with Wordpress 2.1 (use Category Cloud Widget Version 1.2 for earlier versions of Wordpress). As before, the credit goes to sw-guide.de for the original Category Tagging plugin on which this is based; and also Alex for getting a version of this running under 2.1.

NB: Unlike Alex’s version, this widget is self contained and does not require the Category Tagging plug-in.

SteamSHIFT out.

Technorati Tags:
, ,

I have built a quicky site for my application(s). Loads more to be done on it, but wanted to get it up there. Check it out at: http://apps.steamshift.com.

Laters. SteamSHIFT out.

bcf2000.jpg

New version (BCF2000_1.1.dmg) available now. Download and enjoy!

What’s new?

  • Auto update system.
  • Code clean-up ready for new features!

bcf2000.jpg

Ever since I started using a BCF2000 midi controller for my visual experiments with Quartz Composer, I have been left with the problem of having to carry the controller around with me if I want to do any work with my patches; which makes it all rather less portable. The answer; a virtual BCF2000.

I put this to my friend Joe and we began work; here is the fruit of that labour:- I proudly present the Virtual BCF2000. It is built using Cocoa.

There are a few things you need to know:-

  1. It requires MidiPipe or similar; this is because it doesn’t act as a midi endpoint in and of itself - it requires an application to do that for it.
  2. Because of the origin of the application, it is designed to work in a very specific way; it is designed to mimic the way that the BCF2000 controller works once you have applied Steve Mokris’ Quartz Composer Sysex files. In short, this basically maps all of the buttons (barring the encoder group buttons) as midi controllers.

Usage

First launch MidiPipe and create a new pipe - with just a midi in element and a midi out element. Then launch the BCF2000 application; you can now select the MidiPipe midi input from the drop down list. For control of Garageband, for example, that’s all you have to do.

Enjoy (and if you use it let us know how we can make it better). SteamSHIFT out.

Technorati Tags:
, , , , , ,

Many thanks to my friend Joe, who has been helping with mess about with cocoa (fruits of the labours coming soon). Here are a few links to third party controls some of which may be useful (lifted from http://alastairs-place.net/cocoa/faq.txt).

Technorati Tags:
, , ,

If you use MySQL on a remote server for web sites, you may want a nice way of backing them up or moving them to another server (perhaps keeping 2 servers in sync). To get you started try this:

Use an SSH client, like putty (if your database is on a remote server), to connect to your server and export the databse you want simply with:

mysqldump --user=username --password=1234 --databases your_database --opt --quote-names --allow-keywords --complete-insert | bzip2 -c > your_database.sql.bz2

download the .bz2 file created, unzip it using 7-zip (if you dont have any other uncompress utility), and backup your database in mysql using:

mysql --user=username --password your_database < your_database.sql

Via Sephiroth.it

Also note, that if you have mysql installed locally, by including a host / port in the mysqldump arguements, you don’t need to run the command remotely (although you would probably want to get mysql to do the compression rather than piping it through the bzip command).

I’ll upload a full mysql mirror script in a few days. SteamSHIFT out.

Technorati Tags:
, ,

Since I’ve been contracting again, I’ve been working for a few different companies; one of the things that I have found interesting is the different approach to version control. The latest experience was working at a company who use Microsoft Visual Studio 2005. It’s a pretty ugly application but it did show the use of decent version control - something that some of the other places I have been could have done with.

So, working on my own stuff, I thought it was about time I put in place a more structured approach to version control than the ‘make a backup copy when I think about it’ approach.

Enter Subversion. I had heard the name bandied about, but never really looked much into it until I saw the Clickable Bliss video introducing Subversion, posted on Del.icio.us. I followed the instructions in the video and then added SvnX into the mix (an OS X GUI svn client).

Brilliant. Sweet version control goodness.

One little thing that makes life easier for web developers:- make your working directory part of your local web server document root (I use a copy of apache/mysql/php5 on my local machine for web development before deploy), that way you can check it in a ‘live’ environment.

Also see this tutorial.

SteamSHIFT out.

Technorati Tags:
, , ,

Next Page »