Cannot declare class, PHP?!?

One of the most annoying errors to debug when working with a litany of autoloaders using required instead of include_once in PHP: PHP Fatal error:┬áCannot declare class SomeClass, because the name is already in use in /somewhere/SomeClass.php on line 1234 What makes it annoying is the lack of a trace. You know it was only […]

Get Video Duration with FFMPEG and Python

For this to work, you’ll need FFMPEG and Python on your machine or server already. Configuration of this is beyond the scope of this post, but installation through yum or apt-get should be sufficient (or equivalent on a Windows or Mac). To pull the duration of a video from any machine with FFMPEG and Python […]

FizzBuzz in 68k Assembly

Fizz buzz is a group word game for children to teach them about division. Players take turns to count incrementally, replacing any number divisible by three with the word “fizz”, and any number divisible by five with the word “buzz”. ORG $1000 FIZZ DC.B ‘FIZZ’,$0D,$0A,0 BUZZ DC.B ‘BUZZ’,$0D,$0A,0 FBUZZ DC.B ‘FIZZBUZZ’,$0D,$0A,0 CRLF DC.B $0D,$0A,0   […]

Arduino Default Fuse Settings

Here are the default fuse settings for each Arduino from the boards.txt included with the Arduino development software. To understand more about the fuse settings for your microcontroller, visit Engbedded’s AVR Fuse Calculator. To write fuse settings, you will need a programmer with this capability. I use Mighty Ohm’s high-voltage rescue shield available here. Arduino […]

Generate Random IP with Python

In need of an IP address on-the-fly that appears to be valid? Try this: from random import randrange   def generateIP(): blockOne = randrange(0, 255, 1) blockTwo = randrange(0, 255, 1) blockThree = randrange(0, 255, 1) blockFour = randrange(0, 255, 1) print ‘Random IP: ‘ + str(blockOne) + ‘.’ + str(blockTwo) + ‘.’ + str(blockThree) […]