Windows 3.1 on a Nokia N95

February 24th, 2009 by Blake Cormier

It would appear our Polish friends are beating us on the Archaic-versions-of-Windows-on-mobile-devices front. This fellow used the Symbian version of DOSbox to get a full Windows 3.1 desktop running on an N95. While this may not be the most useful hack in the world, it does bring back memories of many hours of my childhood spent playing Chips Challenge and SkiFree.

[OSNews via Gizmodo]

HOW-TO: Use the Calendar class in Java

February 24th, 2009 by Blake Cormier

Sometimes a program needs to know something about a date, like what day of the week it occured. Maybe you want to do something like know which months have 31 days in them. All of this can be done with the Calendar class in the java.util package.

First we need to import the package:
import java.util.Calendar;

Next we have to get an instance of the Calendar class:
Calendar cal = Calendar.getInstance();

Notice that we cannot directly invoke the constructor with new Calendar();, as it is an abstract class.

Next we have to set the date and time that we want to know stuff about:

For the month parameter, January is 0, February is 1, etc. You can also use the constants Calendar.MONTH.

Now we can do some really neat stuff with our calendar. Each calendar has a set of parameters that are automatically updated when the calendar is changed. These can be accessed with the get() method and a set of constants that define a number of accessible fields.

For instance, to find the week of the year that a day falls on:
int week = cal.get(Calendar.WEEK_OF_YEAR)

Another interesting method is getActualMaximum(). This allows you to find, for instance, the number of days in a particular month:
int daysInMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);

Some fields that may be useful:

  • DAY_OF_WEEK - Returns the day of the week that a day falls on, 1-7
  • DAY_OF_YEAR - Returns the number of days into the year that the date occurs
  • WEEK_OF_MONTH - Returns the week in the current month where the date occurs
  • DAY_OF_MONTH - Returns the current day of the month

More information is available from the Javadoc page on the Calendar class

Next time I will cover some of the time aspects of the Calendar class.

Xbox 360 Portable

December 3rd, 2008 by Blake Cormier

Ben Heckendorn has released his latest luggable console: the Xbox 360 Portable. It boasts an internal hard drive, built-in Wi-Fi and camera, and an abundance of brushed aluminum. I always enjoy Ben’s awesome console mods.

via hack-a-day

DIY PC Tilt-Shift Lens

November 27th, 2008 by Blake Cormier

Tilt-shift is a great technique to get neat effects from photographs, but commercial lenses can cost upwards of $1000. The guys over at Digital-Foto-Web built one out of an old lens and a toilet plunger. The results were excellent. This is a great way to get tilt-shift effects on the cheap without using Photoshop.

via Make

Computer-controlled Ambient Orb

November 26th, 2008 by Blake Cormier

Ambient orbs can be used to display all sorts of information, such as new email or voicemail, the weather forecast, and a number of other items. This one is based on an ATmega8 and can be controlled via serial communication. Includes a simple python script for controlling the color of the orb.

via Embedded Projects

VGA to USB Power Adapter

November 26th, 2008 by Blake Cormier

gmgfarrand posted this Instructable on how to create a VGA to USB charging adapter. It’s great for those whose netbooks only have two or three USB ports, and would like to charge a cell phone or iPod without tying up a port. Only requires a few bucks worth of parts and some soldering skills.

via Gizmodo

Analog MIDI Drum Machine

November 26th, 2008 by Blake Cormier

R. Scott from quiet_channel built a midi-controlled analog drum machine inside an old recipe card box. He took the rhythm secion from an old Farfisa organ and built a power supply for it. After adding pots to control the volume, he added a midi decoder kit from Highly Liquid to trigger seven drum sounds and variable decay settings for the high-hat.

via Make

Slot Loading Xbox 360

November 25th, 2008 by Daniel Quillen

Xbox hacker [rdc] has spent many valuable hours converting his Xbox 360 to a slot loading system, similar to that found on the Wii. It uses the slot drive from an iMac G3 with a little bit of hacker magic sprinkled here and there to make everything work the way it should. Hopefully he won’t be needing his now void warranty any time soon.

via Hack a Day

Fuzebox, an open-source game console

November 25th, 2008 by Blake Cormier

ladyada has released the Fuzebox, an open-source 8-bit game console. Features:

  • Full 256 simultaneous output colors, 240×224 pixel resolution
  • Tile & sprite support
  • Two player ports, either with Super Nintendo or classic Nintendo controllers (although the kit comes with SNES)
  • NTSC RCA composite and S-video out (PAL not supported at this time :( )
  • 4 channel PCM output mono audio for music and effects
  • SD/MMC card support for future expansion
  • Built on an Atmel AVR core, 64KB flash and 4KB of RAM
  • Main microcontroller chip is preprogrammed with an STK500-compatible (sometimes referred to as Arduino-compatible) bootloader
  • Write game code in C, using fully open source tools on any platform

You can purchase a kit, or assemble it from schematics and source.

HOW-TO: HP PCL/PJL For Fun and Profit

November 25th, 2008 by Blake Cormier

PCL stands for Printer Command Language. It is built in to most Hewlet-Packard LaserJet Printers. It includes commands for changing various default printer settings, but the one we’re concerned with is the Ready message. The ready message is the text that is displayed on the LCD screen on the printer when the printer is ready to print. That is changeable via PCL. I am not responsible if you jack up your printer.

You Will Need:

  • An HP Printer that supports PCL/PJL and has an LCD screen
  • Access to the command line

Step 1: Creating a Text File

Open a command prompt. Type “edit” (without the quotes). Hit Control + P, then the Esc key to insert an escape character.
Enter the following text:
%-12345X@PJL RDYMSG DISPLAY=”Your Text Here”, substituting something for Your Text Here

Start a new line, insert another escape character, and put this text:

Save the document as “printer.txt” and close Edit.

Step 2: Mapping a Printer

In the command line, type (without quotes) “net use lpt1 \\yourserver\yourprinter” where Yourserver is the computer where the printer is attached and Yourprinter is the printer’s share name. If you are using a local printer, you can skip this step

Step 3: Copying the Text File

Type “copy /b printer.txt lpt1″ at the command prompt. That’s it. Now check your printer. It should say whatever you entered in the text file.

Step 4: Using my Automated Program

This is a simple Python script for JetDirect networked printers. They have a telnet connection available on port 9100 that you can send PCL commands to.

You can get it here.

To use: Unzip the file. From a command line in the same directory as the script run “python”, or you can double-click to run it. Enter the IP of the printer, and then your message. The rest is automatic.

Step 5: Further use of PCL

Some guides to PCL are available here.