John Tokash

Entries categorized as ‘Coding’

Found

September 5, 2009 · Leave a Comment

Some interesting reading this morning.

Shirt Pocket software is working on fixes for SuperDuper!, the state-of-the-art backup software for OS X. The biggest issue right now seems to be the unconventional system that Apple is using for hiding file compression from applications (which seems to be necessary for backwards compatibility). The great news is that even without these fixes, SuperDuper! is not experiencing any data loss. Dave Nanian’s article is here.

If you want to learn more about Snow Leopard’s file compression or ANYTHING ELSE, check out John Siracusa’s massive 23 page review at Ars Technica. While I understand that some users are finding Snow Leopard more of a Service Pack than a new OS, I have to say that I’m loving some of the features. The new changes to Expose alone are worth the $30 bucks to me. You can read up on the Expose features and other cool bits over on the TidBits blog. Try hitting the Expose key and then tabbing through your applications. FUN!

It sounds like the new hero Massively Multiplayer game, Champions Online is off to a rough start. They ratcheted down the effectiveness of players who participated in the beta. This is called a ‘nerf’ in the MMO world. Matt Franklin contrasts this with the rate at which the lead MMO (World of Warcraft) is making game play (especially beginner game play) easier and easier.

This Commodore 64 Visual Debugger is incredible. You start out with a window that shows EVERY address in memory and then zoom in to look at specific locations. The waves of memory changes during file loading are neat! I can’t wait to run this thing while playing Paradroid!

Backblaze has a how-to article up about the homebrew storage solution they’ve created. 7 terabyte 4U servers for $7,867.

JKK checked out the Nokia N900. It merges the best work they’ve done on phones and the work they’ve done on Internet Tablets (Nokia 770, N800, N810). It looks great and has a lot of power in the OS (Linux/Maemo) and the hardware. The Internet Tablet community must be really excited!

PAX, Penny-Arcade’s SOLD-OUT Video Game and Geekery convention (which started yesterday) just added 1,000 tickets.

Alex King spent some time these past few weeks trying to figure out which Network and BlackBerry Phone to use. He wanted to use a BlackBerry Bold, but ended up with a Tour on Verizon. His story is full of the idiosyncrasies of various carriers and devices. Part one. Part two.

Jack Shedd has some things to say about HTML 5. If you are watching the HTML 5 changes closely, Jack’s sentiments will likely resonate with you, including the frustration AND the respect for the team.

Lifehacker has an article on creating a Snow Leopard Hackintosh for $900 (plus the price of Snow Leopard standalone which is $169). I’d be interested in seeing a $500 model.

Categories: Apple · Coding · Conferences · Games · Make · Mobile · Visualization

CSS 3D Demos

July 18, 2009 · 1 Comment

I’m looking forward to the rollout of CSS 3D to modern desktop web browsers (and, hopefully, mobile web browsers).

This demo (clearly inspired by Cooliris) shows an interactive HTML document being manipulated in 3D.

Simon Fraser has a detailed explanation of CSS 3D’s capabilities.

And here is a video showing off CSS 3D Rotation.

Very cool stuff!

Categories: Browsers · Coding

Python + OS X + Arduino + BlinkM

March 23, 2009 · Leave a Comment

I have a bunch of BlinkMs and an Arduino from an old project and I spent some time with them this weekend. This time, I used Python on a Mac to connect. I learned a little in the process, so I thought I’d share.

1. I used darwinports‘ Python2.4 and the pyserial library.
2. On the Arduino, I flashed the BlinkMCommunicator code available here.
3. When writing to the BlinkM’s eeprom, you need to pause briefly before sending another command.
4. The attached code uses decode(“hex”). I’ll explain that design choice later.
5. The code assumes you have 3 BlinkM’s hooked up to the Arduino with their addresses set as 1, 2 and 3.

import serial
import time

def toBlinkM (ser, command):
	print ">\t Sending "+command
	ser.write(command.decode("hex"))
	print ">\t\t Sent "+command

def setBlinkMToPlaySimpleScript (ser, address, color1, color2, color3, color4, duration, fadespeed):
	# example: write line 0 of script 0 on BlinkM 1
	# 	01	Start code
	#	01	BlinkM address
	#	08	bytes to send
	#	00	bytes to receive
	#	57	command: write line
	#	00	script number
	#	00	line number
	#	20	duration
	#	63	fade
	#	20	R
	#	20	G
	#	00	B

	print ("> Playing Simple Script on "+address)

	toBlinkM(ser, "01"+address+"0800570000"+duration+"63"+color1)
	time.sleep (.2)
	toBlinkM(ser, "01"+address+"0800570001"+duration+"63"+color2)
	time.sleep (.2)
	toBlinkM(ser, "01"+address+"0800570002"+duration+"63"+color3)
	time.sleep (.2)
	toBlinkM(ser, "01"+address+"0800570003"+duration+"63"+color4)
	time.sleep (.2)
	# last line: play script 0 1 time
	toBlinkM(ser, "01"+address+"0800570004"+"00"+"70"+"000100")
	time.sleep (.2)

	# set script id 0 to a len. of 5, 1 repeats
	toBlinkM(ser, "01"+address+"04004C000501")
	time.sleep (.2)

	# set fade speed
	toBlinkM(ser, "01"+address+"020066"+fadespeed)
	time.sleep (.2)

	# play script id 0
	toBlinkM(ser, "01"+address+"040070008000")
	time.sleep (.2)

ser = serial.Serial('/dev/tty.usbserial-A4001lcU',19200, timeout=1)

counter = 0

print "> Waiting for Arduino."

while 1:
	serialline = ser.readline()
	if (serialline):
		print serialline.strip()
	if ('ready' in serialline):
		break

print "> Arduino ready."

# tell #1 to stop animating
toBlinkM(ser, "010101006f")

# tell #1 to show only green and red at 1 bright
toBlinkM(ser, "0101040063010100")

# tell #2 to stop animating
toBlinkM(ser, "010201006f")

# tell #2 to show only blue and green at 1 bright
toBlinkM(ser, "0102040063000101")

# tell #3 to stop animating
toBlinkM(ser, "010301006f")

# tell #3 to show only red at 3 bright
toBlinkM(ser, "0103040063030000")

time.sleep (10)

setBlinkMToPlaySimpleScript(ser,"01","404040","FF0000","0000FF","FF0000","05","10")
setBlinkMToPlaySimpleScript(ser,"02","400000","FF0000","800000","FF0000","05","10")
setBlinkMToPlaySimpleScript(ser,"03","000000","FF0000","000000","FF0000","20","10")

Categories: Coding · Gadgets · Make

A Happy Accident

February 28, 2009 · 1 Comment

While working on a new Ajax Indicator, my code accidentally generated this. Pretty cool!
ajaxindicator

Categories: Coding · Visualization

iPhone Accelerometer Code

September 4, 2007 · 2 Comments

As I mentioned in the comments over here, getting UIKit to give your app Accelerometer data is pretty straightforward. Here’s my sample code that combines the accelerometer howto from the standard iphone hello world app and Erica’s slider howto.

Note: Kroo from IRC warns that this technique will only work if the app is launched from launcher or the springboard.

Also: Drunknbass found that you may have to restart springboard before it will work.

And: Check out Erling’s code if you want a faster sample rate.

Categories: Apple · Coding · Mobile

iPhone Dev

August 25, 2007 · Leave a Comment

I’ve been playing around with the iPhone toolchain. The first project I’m working on is something I need (an Exchange client), but I’d like to make something fun afterwards. For inspiration, I’ve been looking at the old Nokia Concept Videos.

Categories: Apple · Coding · Mobile

Google Gears Podcasts

June 10, 2007 · Leave a Comment

These two podcasts provide great background on the new Google Gears (AJAX apps, offline) project. The first, with Brad Neuberg (THE expert in the field of offline AJAX), covers the basics and discusses the connection between Dojo’s offline functionality and Gears. The second, with Mike Tsao, covers the short history of Gears development and gives a great technical overview.

Categories: Coding · Google

Firebug video

February 11, 2007 · Leave a Comment

Joe Hewitt demos firebug. If you’ve been using firebug a lot, this will mostly be a review, but I saw several things I hadn’t noticed before:

  • calling console.profile in your javascript to turn on the profiler for specific regions of code, rather than the bazooka style profiling that the profile button gives you.
  • There is a “log all calls to” option in the right click menu when you are inside a function definition in the script tab. Params are logged! If you want to log the stack traces, use console.trace.
  • I use the box model display often, but I didn’t notice before that rulers are added to your page when you mouse-over the box. Nice.
  • When you are editing an attribute in the HTML or the CSS edit modes, you can use cursor keys to increase or decrease dimensions.
  • Documentation for the firebug API is coming soon!
  • Ctrl-Click while debugging will “run to the clicked line”.
  • When you are in the DOM tab, the variables you added to the name space are in bold at the top… handy.
  • When you paste multi-line text into the console’s command line, you get a larger text area to enter your code.
  • The copy button in that larger javascript area mushes together the current javascript into a string suitable for bookmarklets.

Questions:

When will Javascript be directly editable in Firebug?

When will Javascript have syntax highlighting?

Categories: Coding

Firebug 1.0 beta

December 4, 2006 · Leave a Comment

The new version of Firebug is awesome. Joe revved it to 1.0 beta and there are a ton of new features and lots of nice improvements. If you write or debug Javascript (AJAX include), CSS, or HTML, Firebug is a must. I can’t find the release notes, but here’s a list of what I think is new after a few minutes of testing:

  • New font (smaller and more readable)
  • The breadcrumb of the selected dom item (during inspection) is now interactive. You can highlight and select any ancestor of the currently selected item.
  • The inspected item now has a graphical depiction of its box model (‘layout’ in the right pane).
  • All CSS lines in the CSS tab and the Style tab of the inspected item can now be toggled on and off just by clicking them.
  • Editing the CSS and HTML now seems smoother somehow – before the feedback didn’t seem as immediate.
  • The net tab gives a graphical representation of requests to the server. And it’s not just XMLHTTPRequests anymore – it’s everything.
  • You can turn firebug on for one site only, now, rather than for everything. Nice.

Categories: Coding

Adobe Kuler – Find and create great color schemes!

December 3, 2006 · 1 Comment

Greg is right! Adobe Kuler is excellent and a lot of fun! The comments in the lifehacker post on the subject are filled with other color scheme apps, too!

Screenshot of Adobe Kuler Color Scheme Editor

Categories: Coding · Web