Archive for the ‘tutorials’ Category

How to install WordPress on web10

Thursday, April 17th, 2008

I just spent a while looking for a way to install the current (2.5) release of the WordPress blog on the web host web10.se. I failed. However, I did manage to install Wordpress 2.3. If you want to know how I did it, read on.

(more…)

How to drag an off-screen window back to the desktop (in Windows)

Monday, January 28th, 2008

This is a problem I just had (in Windows XP): My graphics card was set to force a TV display, even though I did not in fact have anything hooked up to my TV-out connection. Unfortunately my system chose to use the (non-existing) TV display as the primary display, so when I right-clicked on the desktop to access the display settings (so I could turn the TV output off), the display settings were displayed… on the TV screen. Which I couldn’t see. A nice little catch-22 there. Not to worry, there’s a solution.

Solution one: using the taskbar. If your off-screen application shows up in the taskbar, just right-click the application there, and select “move” from the pop-up menu. Then, without moving the mouse, click, then drag. Your window pointer should have been moved to the application window, so now you should holding the window, and should be able to drag it back to the screen you are seeing.

Solution two: for applications that do not show up in the taskbar. The desktop settings window does not show up in the taskbar, so you can’t do it as described above. Here’s what to do.

  1. Right-click the desktop and select “properties”. The “Display Properties” window open, but you can’t see it because it’s on a secondary, invisible screen.
  2. Press alt-space. This will open the window menu, like when you right-click on a window title bar.
  3. Press ‘m‘ on your keyboard. This will select “move” from the window menu. (This may not work if you are using Windows in another language… try it on a window yuo can see and figure out what key to use)
  4. Without moving the mouse, click, and then drag until you can see your window. Alternatively, you may use the arrow keys to nudge the window back to your desktop. (You can also use the arrow keys to move a window off-screen, although I’m not sure why you would ever want to do that.)

How to switch on an iMac (sic!)

Monday, January 21st, 2008

OK, this is just plain embarrassing.

I just spent several minutes trying to figure out how to switch on an iMac. Seeing there is no power switch on it, I figured this was some sort of Apple design decision - probably you just use the keyboard. So I pressed all the keys on the keyboard, wiggled the mouse, made sure there was power in the socket, etc. Nothing.

Eventually I had a closer look…

The power button is on the back!

The reason I didn’t find it is that it’s not where the connectors are, but down in the lower right corner (seen from the back). Silly.

Update:  Mike - I was feeling a tad embarrassed myself, failing to live up to my generally tech-savvy self image. On second thoughts though, I guess the general designer rules apply to Apple designers as well:  if “the user” can’t even find the power button, your work is not really ideal.

How to tunnel your SMTP outgoing mail over SSH

Friday, December 14th, 2007

The problem

You’re this guy, or gal, somewhere where you have a crippled internet access. Probably for security reasons, somebody closed most of the outgoing ports in a firewall. You can surf, and use SSH.

(more…)

How to start a Java application with web start

Friday, December 14th, 2007

These are some notes I made while trying to get a Java OpenAL (JOAL) application start from a web page. The tutorial applies to Java 1.4.2, but it probably works similarly in newer versions.

There are some things you need to master:

  1. Generate a manifest that indicates the main class
  2. Package everything in jar file(s)
  3. Generate your keys using java keytool
  4. Sign the jar file(s)
  5. Make the JNLP XML file
  6. Put everything on a web server

(more…)

How to get started using mobile processing

Wednesday, December 12th, 2007

Processing is a free, open-source programming environment based on Java and the weapon of choice for most people doing artistic productions that require a bit of coding. Get it at processing.org

Mobile Processing is a cousin of Processing, but aimed at mobile phones and other smaller devices.

The problem

I want to be able to write simple programs on my computer and run them on my mobile phone. My computer is a Windows XP laptop with bluetooth, my phone is a java-enabled phone, also with bluetooth.

The solution

I did it by installing mobile processing, exporting to MIDlet and then transferring the jar file to my phone using Windows XP’s Bluetooth File Transfer Wizard. All of this is absolutely free, btw.

Setup

  1. Download and install a Java JDK. See how to set up java development.
  2. Download and install Sun Java Wireless Toolkit for CLDC (WTK)
    http://java.sun.com/products/sjwtoolkit/
  3. Download and install mobile processing.Since you’ve installed Java yourself, get the expert version. To install, just to unzip the archive where you want to have it, e.g. c:\sdk\mobile
    http://mobile.processing.org
  4. Restarting your computer at this point is probably a good idea.
  5. Start mobile processing by running the start-expert.bat in the mobile processing

How to set up a Java JDK

Wednesday, December 12th, 2007

This refers to doing it on Windows XP - Vista is probably very similar.

For starters…

Java is a programming language, but it’s also something called a virtual machine. The way it works is you write code - source code - in text files, typically ending in .java. Then you compile them, using a java compiler. There’s a command line java compiler called javac, included in the JDK. When you’ve compiled the programs, they don’t become Windows executable programs - “.exe files” - but compiled java class files, files called .class. These you can run, but to do that you need a java runtime environment, a “JRE”. Most likely you already have a bunch of Java runtimes on your computer.

The Java Development Kit - JDK - contains what you need to compile java source code files to class files, and comes with a java runtime to run them. The JDK does not come with an editor, but you can those for free elsewhere. One really good is eclipse (www.eclipse.org). Another good tool for building Java files (and other stuff) is something called Ant (ant.apache.org).

(more…)

How to run java MIDP applications on a Palm handheld

Wednesday, December 12th, 2007

The problem

I have a Java MIDP application, made with WTK, maybe using EclipseME or mobile processing. I want to run it on my Palm.

After digging into ways of doing this, I wound up running an application called jartoprc but it kept giving me “Error: An invalid PRC was created (0 bytes in size).”.

The solution

Prerequisites

I’m assuming you already know how to set up Java JDK and about building MIDP applications - maybe how to get started using mobile processing.

Step by step

  1. Get the websphere micro edition - one way is it might be bundled with your Palm, another is buying it from Palm [where was it? Have to look], and another is joing PalmSource Developer ACCESS network, after which you can download it for free. You should do this anyway to apply for a palm developer id.
  2. Install websphere - unpacking it, e.g. in c:\SDK\websphere
  3. Install the websphere java runtime on your palm. (J9JavaVMMidp20.prc and j9pref.prc)
  4. Add C:\SDK\websphere\Tools\bin to your PATH (Control Panel > System, Advanced tab, click Environment Variables, edit the System variable called Path)
  5. Here’s the trick: the files in the C:\SDK\websphere\Tools\lib folder - charconv.zip and the folder jclFoundation10 containing classes.zip, locale.zip and maps.zip - should all be copied to your JAVA_HOME/lib folder. Copy the single zip file and the folder. It will not work (at least not for me) to add these to your classpath in other ways.
  6. When you have the jad and jar file, go to the directory and build the prc using a command like jartoprc -jar:MyApp.jar -id:MYID
  7. Double-click on the .prc and then hotsync to transfer it to your palm.
  8. The MIDP application should end up on your Palm and you can launch it just like a regular Palm app, just tap it.

References

http://pluggedin.palm.com/regac/pluggedin/JavaFAQ.jsp

How to get Puredata to start with audio enabled

Thursday, November 22nd, 2007

When PD starts, audio is off, and you have to click the “compute audio” tick box. But what do you do when you want to start it automatically, like from a batch file?

The answer is, cryptically enough, “; pd dsp 1″. Below is a screenshot. Make sure that this goes in a message box.

Note that you can start a pd patch just with a “pd patch.pd” command from a command prompt or batch file. This patch does nothing interesting (it just plays an annoying sine tone) but it does it automatically.

puredata startup

 

Switching and reversing arduino relay shield

Wednesday, November 14th, 2007

Switching and reversing arduino relay shield (photo)

This is a little thing I made for artist Petra Vargova. It’s a home-made “shield” for the Arduino, i.e. this circuit fits on top of an Arduino board. (Indeed, it is sitting on top of an Arduino in the photo).

It’s not made using an Arduino shield PCB (which would be much more elegant) but just made using a piece of stripboard and some pin connectors. It contains two relays - two omron G6S-2 4.5 VDC relays.

Switching and reversing arduino relay shield (sketch)

It works like this: The lower relay is used for reversing polarity. It’s got plus and minus coming in on its input pins (the second from the right on top and bottom). When the lower relay is off (the control pin labeled reverse is low) the power is just connected straight away to the load. When the “reverse” control pin goes high, the power comes out on the two rightmost pins on the relay, which are connected to the load in reverse.

The top relay is just a switch that switches to positive input on and off.

To control it you just need two digital pins on the Arduino, one for the main on/off and one to reverse polarity.

Switching and reversing relay shield - arduino code