SubClosure

{ Don't Repeat Yourself ! }

Browsing Posts published in November, 2009

The Eclipse core icons are great icons to use in any application.
Here is a online archive of all (3904) 16×16 eclipse icons.
Great if you don’t have eclipse on your machine or for just quick browsing of these super useful icons.

http://xantorohara.110mb.com/core-icons/Eclipse-16×16.html

note: this page also has a nice list of open office icons available.

Getting class not found errors even though the require and include statements work fine?
It might be the case that the php configuration (php.ini) does not allow short opening tags.

short_open_tag = 0

A short opening tags in php looks like this <? instead of <?php
Some older libraries use these short opening tags. Best practice is to replace them by standard php opening tags.

After installing mysql on Mac Os 10.5.8, I could connect to the mysql server from the command line.
But when I tired to open phpmyadmin I got this error:

Error: The server is not responding (or the local MySQL server’s socket is not correctly configured)

Solution that worked for me:

  1. sudo mkdir /var/mysql
  2. sudo ln -s /private/tmp/mysql.sock /var/mysql/mysql.sock
  3. restart apache

I recently joined Amazon’s S3 simple file storage service to use for my server backups.
I’m very happy with it.

To get the backups running on a Debain Server I had to do the following:

  1. Install Duplicity – apt-get install duplicity
  2. generate a GPG key (gpg –gen-key)
  3. create a little backup script – following these steps.
  4. set up a cron job for automatic backups

Great site that explains how to do it: https://help.ubuntu.com/community/DuplicityBackupHowto

Got this nice bug coming right out of the Zend frameworks 1.9 AMF Routines.

“Unable to parse null body data flex.messaging.io.ArrayCollection mapped class  is not defined”
in file: library/Zend/Amf/Request.php:174

Was trying to send an object that has an Arraycollection as one of its parameters to the gateway.
Found this Bug Report http://framework.zend.com/issues/browse/ZF-6601
It is supposed to be fixed in 1.8.2 ?! Why is it happening in 1.9 then?

Instead of modifying the zend framework I decided to convert the object I wanted to send into an object without arraycollections.
But definitely not a proper solution. Hopefully that bug will be fixed soon. Otherwise maybe AMFPHP is a better choice then Zend AMF.

I recently ran into problems when trying to set the currenState property on a component that was part of a TabNavigator.

I had the component as a direct child in the TabNavigator.
Setting the currentState property in the component resulted in Null pointer exceptions in the Flex Framework – RemoveChild Class.

I got around it by first adding a canvas to my TabNavigator and then adding my component inside the canvas. This fixed the problem.

It is because of flex’s deferred instantiation. Flex called the creationComplete handler on my custom component even though its components were not added yet.
Thats why the RemoveChild tag in my states failed.

By first embedding the component into a canvas and then into the TabNavigator, it only created the canvas but not any parts of my component.

So you got yourself a new Macbook or an iPhone and someone swiped it? Good news – if you were lucky and installed something like Undercover you will most likely be able to track down the thieves and recover your lovely little machine.

How does it work?
Undercover installs itself into the bios of the Apple device and with the installation you get a unique device ID, that you need to provide when reporting a theft.
When the machine goes online Undercover constantly checks if the device ID is reported as stolen or not. If it is reported as stolen the device will send geographical information about its location to Undercover. It will also transmit screen shots and if possible photos of the thief. Undercover will then contact local law enforcement to recover the stolen device.

If law enforcement fails to recover it, Undercover slowly renders the device useless and counts on the fact that the thief will then either sell the device or send it in for repair. Because of geographical awareness, Undercover then display a message to the repair center or new buyer, that this is a stolen machine that needs to be returned.

Undercover can not be disabled by the thief. If you install Apple’s firmware password, your Mac can not be formatted without knowing your firmware password.

This seems to be an awesome protection from thieves and it comes at a very reasonable price.

A list of the best libraries for Flex and Flash that can save heaps of development time and add extra functionality to your projects.

  • casalib Lots of useful utility classes.
  • as3corelib A collection of utility classes by Adobe for handling encoding and serialization among other things.
  • Mate Framework – my favorite MVC  framework for Flex – it’s based on property injection
  • PureMVC – another great MVC framework, works with flash as well and has ports to many other languages
  • Cairngorm – popular MVC framework for Flex that’s officially supported by Adobe
  • FlexUnit – unit testing framework for flex – essential for test infected developers and professional projects
  • AS3Crypto – add cryptography to your Flash/Flex Applications
  • AlivePDF – lets you create PDF files from within flash and flex
  • Degrafa – Flex Graphics Framework to easily create graphic with mxml tags – awesome
  • TweenLite The easiest to use Tween library out there.
  • Papervision probably the most used 3D library
  • Away3D Another 3D library that some people prefer to Papervision as it is easier to use.
  • Modest Maps – great mapping library for using different map providers – also supports openstreemaps
  • SWFObject very useful to embed flash movies into html pages
  • SWFAddress Takes swfobject one step further and supports deep-linking.
  • Hi-ReS! Stats a class that shows you when your SWF framerate chokes.
  • BIT-101 MinimalComps A set of ActionScript-only UI components for use in non-Flex projects.
  • Underware – not a library but a nice tool that lets you package and download sets of popular libraries
  • Deface – Face detection for AS3
  • FLARManager – tool for augmented reality
  • Discollision – advanced collision detection library fro AS3
  • Flash Camouflage - easily skin Flash Applications with png, jpg, or gif images
  • MojoColors – easy color library for AS3
  • Flint Particle System - the name says it all – create particles in AS3

If you use ant to build and deploy your application,
the scp task comes in quite handy to automatically upload you project to the production server.

In your ant build.xml file you can add a line like this to your target

<scp file=”${zipfile}” todir=”${server.username}:${server.password}@${server.name}:” trust=”true” />

Where ${zipfile}, ${server.username}, etc are properties that where earlier declared
e.g. <property name=”server.name” value=”192.168.0.1″ />

The ant scp task depends on an external library that can be found here.
You need to download the jsch-0.1.42.jar and copy it into your eclipse ant library folder

e.g. /Applications/Adobe\ Flex\ Builder\ 3/plugins/org.apache.ant_1.7.0.v200706080842/lib/

(on mac I had to copy this file to ~/.ant/lib to work )

Important! You need to restart Flex Builder after that.

After that you can run your ant target and the zip file will be uploaded to your server through scp

Get Adobe Flash player