Archive for October, 2009
10 ways to tell if you're a geek workaholic
Oct 26th
- You eat all your meals in front of your computer (sure, you may watch YouTube, but you’re still in the workzone)
- You have a monitor tan
- You have blisters on your mouse hand – and it’s (probably) not from all the porn you watch…
- You can type 90+ words a minute while not looking at your keyboard, talking to someone and feigning interest in whatever they have to say, at once
- You have memorized all your favourite sites’ URLs… In bit.ly form!
- You use Twitter to ask your siblings/roommates/cohabitants to bring you toiletpaper
- You know all the tech-support guys at your ISP by name
- You ignore your bladder until the very last second, but only after you’ve at least started to compile your code… then run to the nearest bathroom
- You get anxious when your internet goes down, you’re away from your computer for more that an hour or if your mailserver has crashed
- You actually think people give a fuck about 10 ways to tell if you’re a geek workaholic
Adobe WeatherLab Beta
Oct 23rd
Over the past few months, Adobe has really been pulling out all the stops. They’ve been releasing some ridiculously useful and innovative tools and additions to existing software, but their latest offering has dropped my jaw even further!
Introducing Adobe WeatherLab Beta
This latest release from Adobe will surely change the way we see the world around us and how we interact with it. Adobe WeatherLab Beta is a the latest addition to Adobe’s impressive line of Adobe AIR-based tools, and it boasts some pretty innovative features!
Adobe WeatherLab Beta allows you to communicate directly with whichever skygod(s) you please via RPC (Remote Procedure Calls) in either XML, AMF or JSON. Adobe WeatherLab Beta boasts an expansive, extensible API for changing the weather in realtime and – most importantly – it integrates with all of the CS4 and upcoming CS5 products.
Finally, you can adjust your environment to suit your specific needs. If you’re more of a sunshine and beer kind of person, simply call the Weather singleton and change it to sunny by using the constant Weather.SUNNY (code samples to follow).
Insiders at Adobe have revealed that they have been working on improving the feature-sets of applications such as Illustrator, Flash Professional, Flash Builder & Flex SDK and Photoshop, but found that these applications were just getting to the stage where no more work could be done on them
“We wanted a new challenge. We had reached a point where we realised that our applications were near perfect, aside from a few bugs, and we needed something to throw at our engineers. Luckily, one of our engineers knew how to rain-dance and this set off a chain reaction of events, all leading up to Adobe WeatherLab Beta“.
Much work has still to be done on this application, but engineers over at Adobe have assured me that any bugs in the system will not cause any universal constants to go out of whack.
When I first heard of this innovative and – let’s face it – ingenious application, I was skeptical. My skepticism was soon lifted when I used the mapping API from Google to pinpoint a parade which I subsequently used Adobe WeatherLab Beta to rain on.
Here’s the code I used:
// Code snippet for changing the weather import com.adobe.weatherlab.Weather; import com.adobe.weatherlab.Geography; public function changeWeather():void { var weather:Weather = Weather.getInstance(); // get weather singleton weather.change(Weather.SUNNY, new Geography(37.433868, -121.884155)); // target weather change }
To download Adobe WeatherLab Beta, click here.
AIR 2.0 – The Answer to Our Prayers (mostly)
Oct 11th
Wow.
http://tv.adobe.com/watch/max-2009-develop/whats-coming-in-adobe-air-2-/
Great job Adobe Team!
The Whirlwind that is Adobe in 2009
Oct 9th
Wow.
It’s been quite a fascinating year thus far; Adobe has really started getting serious about Flash, Flex and the developers involved. This year, we have seen two amazing additions to Adobe’s web-dominating arsenal – Adobe Flash Catalyst (now in beta 2) and Adobe Flash Builder 4 (now in beta 2). After some preliminary buggering around in both of these, I came to the conclusion that working with a beta version of any software to create enterprise applications is putting yourself on the edge of the cliff, and working on a version 1.0 beta is hiring somebody to push you over the edge.
This raises an interesting catch-22:
When a massive piece of software is released, the community has the onus to test it and give feedback on any bugs, requested features and expedience tips – however, if your beta software tends to be very buggy (and how could it not be? The SDK is huge) then how are you going to get developers to test your software on real, enterprise projects?
In any case, Adobe has really been playing the part this year. This year we have seen the release of the Flex 4 SDK, major advancements in the Open Screen Project, Flash Player 10′s penetration rate to 93.5%, AIR surpassing 100 million installations and the introduction of Flash Player 10.1 most recently. Other great things i’ve seen are WorkflowLab, BrowserLab, Project Squiggly, Slider previews, Flash CS5 sneak previews and Community Help.
For all of those unlucky and miserable enough to miss Adobe Max this year (myself included), there’s an entire channel dedicated to Max 2009 Developer talks… Go check them out!
Oh, and if you have any luck getting these videos to play in Adobe Media Player, let me know. That app is more full of bugs than a salad in Nigeria.
PHP Thumbnail Generator
Oct 6th
Here’s a very simple PHP class that i wrote to make thumbnail generation on JPG, PNG & GIF images really simple and painless.
NOTE: You will need to have GD installed on your server for this class to work!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | < ?php /** * Image thumbnail generator * Based on the work from http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng */ class ThumbnailGenerator { public $sourceFile; public $destinationFile; public $width; public $height; public $format; public $scale; /** * ThumbnailGenerator::__construct() * * @param mixed $sourceFile Path to source file * @param mixed $destinationFile Path to destination file * @param mixed $width Thumbnail file width * @param mixed $height Thumbnail file height * @param string $format jpeg, png or gif * @param bool $scale Scale thumbnail * @return */ public function __construct($sourceFile, $destinationFile, $width, $height, $format="jpeg", $scale=true) { $this->sourceFile = $sourceFile; $this->destinationFile = $destinationFile; $this->width = $width; $this->height = $height; $this->format = $format; $this->scale = $scale; } /** * ThumbnailGenerator::generate() * * @return */ public function generate() { $fromFormat = "imagecreatefrom".$this->format; $sourceImage = $fromFormat($this->sourceFile); $sourceWidth = imagesx($sourceImage); $sourceHeight = imagesy($sourceImage); if($this->scale) { $ratio = $this->width / $sourceWidth; $this->width = $sourceWidth * $ratio; $this->height = $sourceHeight * $ratio; } $targetImage = imagecreate($this->width,$this->height); imagecopyresized($targetImage,$sourceImage,0,0,0,0,$this->width, $this->height,imagesx($sourceImage),imagesy($sourceImage)); $imageFunction = "image".$this->format; return $imageFunction($targetImage, $this->destinationFile, 100); } } ?> |
All credit goes to http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng for the snippet!
Sample usage:
$tg = new ThumbnailGenerator("image.png", "thumbs/newimage.png", 100, 100, "png"); echo $tg->generate() ? "Thumbnail generated successfully" : "Failure!";
PHP Process Viewer for Unix
Oct 4th
While working on a project lately, i needed a script that would allow me to find certain processes with PHP and inspect their running times, etc. After struggling for a little bit, i came up with the following script that can output a plain view, JSON or XML of the running processes whose names match a regular expression passed to the script. The script can also kill all processes that match the search term.
This script is by no means complete, but i thought i’d share it with my readers ![]()
Save it as process_viewer and run it from the command line.
Please keep in mind that this script is still in a very rough form and should not be used on enterprise products; it’s merely a bit of buggering around for fun
Click here to download the script.
Usage:
process_viewer [search_regex] [mode] -o [format]
- search_regex – search term to find running processes (defaults to .+)
- mode – script mode (defaults to view)
- view | kill
- -o – flag to indicate that the script must output in a specified format
- format – output format (defaults to plain)
- plain | json | xml
Sample usage:
./process_viewer bash view -o xml
