Archive for the ‘Development’ Category

Automated webcam capture/image downloader

Wednesday, January 2nd, 2008

The other day I was checking out a webcam at a local ski resort, and wanted to see what an entire day’s worth of shots looked like played in a movie. I’m sure there are apps out there that do this sort of thing, and might even be an easier way of doing this. Regardless, I decided to have a play.

Below is a simple VB Script file (sorry windowless folks) that will download and save an image to your hard drive. It will save the images in the same directory the script is running.

Dim imageURL
imageURL = "http://www.mtbachelor.com/@@/cams/wvskycam.jpg"
Function SaveBinaryData(FileName, ByteArray)
	Const adTypeBinary = 1
	Const adSaveCreateOverWrite = 2
	Dim BinaryStream
	Set BinaryStream = CreateObject("ADODB.Stream")
	BinaryStream.Type = adTypeBinary
	BinaryStream.Open
	BinaryStream.Write ByteArray
	BinaryStream.SaveToFile FileName, adSaveCreateOverWrite
End Function
Function BinaryGetURL(URL)
	Dim Http
	Set Http = CreateObject("WinHttp.WinHttpRequest.5.1")
	Http.Open "GET", URL, False
	Http.Send
	BinaryGetURL = Http.ResponseBody
End Function
Function doSave()
	Dim image, fName, p_month, p_day, p_hour, p_minute, p_second
	image = BinaryGetURL(imageURL)
	p_month = padZero(Month(Now))
	p_day = padZero(Day(Now))
	p_hour = padZero(Hour(Now))
	p_minute = padZero(Minute(Now))
	p_second = padZero(Second(Now))
	fName = p_month & "_" & p_day & "_" & Year(Now) & "-" & p_hour & "_" & p_minute & "_" & p_second & ".jpg"
	SaveBinaryData fName,image
End Function
Function padZero(val)
	If(Len(val) < 2) Then
		val = "0" & val
	End If
	padZero = val
End Function
doSave()

Copy and paste the above script into an empty text file. Go find a webcam you’d like to capture. When viewing the webcam image, right click and copy the images URL. Change the imageURL variable at the top of the script. Save the script (.vbs extension). Next you’ll need to set up an automated task to run the script. For help on how to set up tasks, check out this KB article. You’ll want to schedule it run somewhat frequently, but no more frequent than the webcam updates.

That’s pretty much all you need to do. If everything goes right, image files should start appearing in the directory that the script is located.

To create a movie from the sequence, you’ll need to find some software to do that. Out of sheer laziness, I just use QuickTime Pro, but there’s a bunch of shareware/freeware options available out there.

Have fun…

Accordion 2.0

Friday, September 21st, 2007

Kevin Miller has updated his accordion control. The new version includes:

  • Open/Close functionality added (Click on an active accordion)
  • Nested Vertical Accordions
  • Accordions will dynamically resize on content added REAL TIME!

One of the better accordion widgets out there I must say.

Check it out!

CSSVista: Tweak CSS and see it in IE and Firefox at the same time

Friday, September 21st, 2007

CSSVista is a free Windows application for web developers which lets you edit your CSS code live in both Internet Explorer and Firefox simultaneously.

CSSVista is from the folks who gaves us Litmus

RegexPal - JavaScript Regular Expressions Tester

Friday, August 10th, 2007

RegexPal is a great little utility for testing JavaScript regular expressions. It’s fast and quite helpful to those learning regular expressions.

Some note features include:

  • Real-time regex syntax highlighting with backwards and forwards context awareness.
  • Lightning-fast match highlighting with alternating styles.
  • Inverted matches (match any text not matched by the regex).

dsHistory - Back button management with JavaScript

Wednesday, August 1st, 2007

dsHistory internally works somewhat similar to the other history solutions that exist, but it is implemented more like dojo’s bind than anything else. It requires no supporting libraries, it checks in at just over 7kb when compressed, and it is easy to use. The history is thought of as a series of events that have functions attached to them, and the bookmarkable window hash data is designed to be controlled independently from the events (if it is even utilized at all, which I’ve found isn’t desired at times).

See dsHistory in action
Read the full article

@tomic XML-RPC JavaScript Client

Wednesday, August 1st, 2007

Jon Brisbin has created an XML-RPC JavaScript client called @tomic:

The @tomic XML-RPC client requires ExtJS 1.1, but has no other external requirements. It’s designed to be easy-to-use, flexible, and robust enough for anything you might throw at it. Since this is an initial release, I’m putting it out as a beta (under the GPL).

Ext.onReady( function()
{
    var xmlrpc = new Atomic.util.XMLRPC( {
        url: "xmlrpc.php",
        method: "blogger.getUsersBlogs"
    } );
    // Add parameters to the RPC call
    xmlrpc.addParameter( "0123456789ABCDEF" );
    xmlrpc.addParameter( "MyUsername" );
    xmlrpc.addParameter( "mypassword" );

    // Subscribe to events
    xmlrpc.addListener( "success", function( xhr, xml ) {
        // Handle the response from the XML-RPC service, which is in the 'xml' object
        console.log( xml );
    } );
    xmlrpc.addListener( "fault", function( xhr, fault ) {
        // Handle any faults issued by the XML-RPC server
        Ext.MessageBox.alert( "XML-RPC fault #" + fault.code, fault.message );
    } );

    // make the call
    xmlrpc.call( {
        method: "blogger.getUsersBlogs",
        params: [
             "0123456789ABCDEF",
             "MyUsername",
             "mypassword"
        ]
    } );
}

8BitBoy - Andre Michelle

Monday, July 30th, 2007

http://8bitboy.popforge.de/

Karsten Obarski invented 1987 - twenty years ago - the MOD format for his Ultimate Tracker running on Amiga computers. Since then, countless songs are created, especially for the demoscene.

MODs have special attributes. All samples are stored in 8bits and the number of voices is limited to four. To have something similarly to chords, the three notes of it are repeated very fast. This makes MODs sound so freaky.

Finally 8BitBoy brings those songs back online.

Installing Apache, PHP and MySQL on Vista

Friday, July 27th, 2007

I was expecting the worst, but got everything up and running in about 30 minutes due to some damn easy to follow tutorials. I guess I probably could have figured it out myself, but it’s nice to just get it done.

Installing Apache on Vista
Installing PHP on Vista

Installing MySQL is a no-brainer. Hell, even I could do it.

Saffron UML in AIR

Friday, July 27th, 2007

Saffron is a pretty slick looking and powerfull UML modeling tool built on the AIR platform. Can’t wait to see the final release!

Top features:

  • Wireframe editor allows both developers and/or designers to create wireframes for their projects
  • Allows for Actionscript 2, Actionscript 3, PHP4 and Java Code generation directly from the app.
  • Sports an entirely customizable UI which contains several dock-able panels that can be placed anywhere by the user.
  • Enterprise level capability having the ability to support models with hundreds of classes without performance degradation
  • Beautiful UI
  • Integrated Version Control
  • Sophisticated printing options give you complete control over how your diagram is printed
  • Cross Platform on both OS X and Windows
  • Full round trip support for both AS2 and AS3 (Java will soon follow), always keeping your model and code in synch every step of the way.

screenshot
screenshot

Ajax Plug-ins for Wordpress

Tuesday, July 24th, 2007

Pete Cashmore has posted a list of 30+ Ajax plugins for Wordpress that he considers good.

Here’s a sample:

  • AjaxWP - Adds AJAX to all aspects of your WordPress site speeding up the load times.
  • Alexa Rank - Display your Alexa rank with pride.
  • Ajax Comment Preview - Allows readers to preview their comment before submitting.
  • asTunes - Retrieves data from your Audioscrobbler/last.fm profile and posts it as a list on your blog.
  • Codebox - Side scrolling box for displaying code snippets.
  • Crossroads - Adds thumbnails and comments from your Flickr account.
  • FireStats - Full featured statistics including referrers and popular pages.
  • Google PageRank - Allows you to display your Google Page rank on your blog.
  • Hardened-Trackback - Generates a single use trackback to help fight trackback spam.
  • imgViewJX - Refreshes an image on your main page from a selected directory.
  • Live Spell Checker - Adds a spell checker to the admin area to check your posts with.
  • Plug ‘n’ Play Google Map - Adds any post you make with longitude and latitude to a Google Map on a separate page. Very useful for blogs writing restaurant reviews or about events.
  • Wordpress Mailing List - Have a mailing list? Let readers subscribe and unsubscribe simply from the front page of your site.
  • WP e-Commerce - Adds a shopping cart to your WordPress powered site.
  • WP-Polls - Adds fully customizable polls for your readers to take.
  • WP-Post Ratings - Allows readers to rate your posts.
  • Zorpia That’s Hot Box - Allows visitors to send posts they like Zorpia.com and vote on their favorite articles.

Uniform Event Model: Making IE think W3C

Tuesday, July 24th, 2007

Tavs Dokkedahl has written a small script that makes IE conform to the W3C DOM3 Event recommendation (at least the part that FF supports).

The Uniform Event Model adds support for the capture, atTarget and bubbling phases and provide most of the EventListener interface including among others the addEventListener, removeEventListener, createEvent, initEvent and dispactEvent methods. All handlers are passed an event object with almost complete information according to standards. See the list of features for detailed information on event flow, methods and properties.

(from ajaxian)

Wicked Pissah Games

Tuesday, July 24th, 2007

Check out Bit-101’s new project Wiked Pissah Games. There’s only one game so far, but I expect good things to come.

Onslaught 2

Thursday, July 19th, 2007

This game is a total time suck! Prepare to get nothing done today :)

Robot Replay: Watch your users via Ajax

Thursday, July 19th, 2007

Ever wonder how exactly your users are interacting with your site? Robot Replay is a Rails application what allows you to record user events as they interact with your site and then play them back later.

Just include some JavaScript in your site and events are compiled and set back to the server. Once the user is done with their session, you can play it back right in your own browser.

Watch an example of mouse gestures and forms.

iPhone advertisement remix

Wednesday, July 11th, 2007

Bringing the Browser to the Server

Tuesday, July 10th, 2007

Bringing JavaScript server side raises some interesting possibilities for automated testing, screen scraping and Web application development. Check it out.

Protoload: Ajax Loading

Tuesday, July 10th, 2007

Andreas Kalsch has written a simple library, Protoload, that handles the Ajax loading events that are common place as a way to show users that something is happening on the server, in a particular location.

RSS to JSON Convertor

Thursday, July 5th, 2007

Very cool little script for converting an RSS (or Atom) feed into a valid JSON object. Check it out here

DVD Jon - hackin’ the iPhone

Wednesday, July 4th, 2007

Jon Lech Johansen, aka “DVD Jon,” claims he has activated an iPhone without service through AT&T. Although the phone function doesn’t work, everything else does. Johansen says the purpose of this little exercise was for people that don’t wish to enter into a 2-year contract with AT&T and would rather just use the iPhone as a pimped out iPod.

Visit Jahansen’s blog for more info and downloads

There’s other ways of doing this too, which involves purchasing and then canceling a prepaid plan from AT&T.

BIT-101 Wins an Emmy

Wednesday, July 4th, 2007

I love seeing this. Credit where credit is due. Congrats to Keith.
http://www.bit-101.com/blog/?p=1037