How we see the world differently with mobile phone- VVS

This is probable an old video, but it is really funny. Shooting video in portrait with mobile phone, also known as “Vertical Video Syndrome”/VVS.

What we can see here is the merging of 2 different technologies (video tech and mobile phone). The vertical format of most mobile phones is definitely a sensible design, but it wouldn’t work when the orientation of the camera (landscape/portrait) correspond to the orientation of phone. What is the solution?

A simple approach maybe having a phone that shoots in landscape mode while being hold “up-right”.

Mm… why isn’t there a phone like this?


Printing with AppleScript + Processing/Java

For one of the recent project, I have to write an application that generate QR code and send the generated image/file for printing.

Java printing API
Since I used processing as the development platform, I tried Java Printing API. The original plan was:

  1. Use the XZing library for code generation (
  2. Using the ecoder class in the core library, a bitArray will be returned, basically it is a 1d array recording 0 & 1s, so it could be easily translated to PImage using the pixel access class.
  3. Draw the generated QRCode image to the canvas or an offscreen PGraphics.
  4. Save the image file and send the file to print.

The constrain for using Java printing API was the default PDF output library comes with Processing can only produce images that in 72dpi, and it is difficult to utilize the print options of printers (e.g. fit to page, media size…etc).

Thus despite of the initial success, this method was abandoned.

Apple script and printing
The good news is that for this project we are planning to use Mac OS X platform. After fighting with CUPS printing server back in Ubuntu time, I am planning to use BASH script to accomplish this.

Bash + Java
Before doing anything further, the first thing to test is whether Java can trigger and execute a bash script, then write a bash script that will actually print a file.

I knew that if you type “open ~/Desktop” in OS X terminal, a Finder window will actually pop up showing the content on the Desktop folder, thus I wrote a script like this.

open Desktop

and saved the above text in, to test it I have to first make it executable

chmod +X

Then in Processing I simply put the following lines and ran it. (Reference:

          theProcess = Runtime.getRuntime().exec("java");
      catch(IOException e)
         System.err.println("Error on exec() method");

And it worked!

Print script
The next step is to find references for writing bash script that will actually print in OS X, and luckily I found some useful references

Basically you can simply write a bash script like the following for printing

ls -d PrinterName -o landscape -o fit-to-page path_to_file

In order to find the printer name, you can run the following command in terminal

lpstat -p -d

It worked like a charm until I tried with another printer (Hiti P510L)

Setting the media size
No matter how I changed the image size the printer was simply not printing. It kept showing “unsupported paper size” error. The reason for not trying this option in the beginning was that I’ve already set the default options through CUPS web interface (localhost:631), by combining this with the “-o fit-to-page” options, it should automatically convert and print. However it wasn’t the case.

Out of desperation, I tried listing and specifying the size and orientation in the bash script.

To list the supported media size, use the following command

lpoptions -p printer -l

In the actual bash script I wrote the following

lp -d printerName -o portriat -o fit-to-page -o media=6x4 filename

And it worked!

Problem solved!

Raspberry Pi

Raspberry Pi is a highly anticipated product created by some folks from Cambridge.

It costs only USD25 for this little, highly compact board. It is capable of outputting 1080P video with full fledged USB, wifi, and GPIO (General Purpose Input/Output) connection. So basically you can have a mini computer with only 25 US dollars!

Since the mass-production is still on the way, at the moment I can’t even place an order… waiting…