personal experiences and code :)

Monday, October 30, 2006

flexible flexifying flex

this post is about two new tools to get you flexing your muscles... err sorry, i almost got carried away ;P

john grden, your boy behind red5, is making it flexible to flex :) ... and hot on the heels of that (could be the other way around) Ted Patrick, Ray Camden and Ben Forta want you to flexify with the flexifier

FLEXible gives you some limited capabilities of Adobe's Eclipse-based Flex Builder IDE, by allowing you drag/drop flex components, edit src and see changes in real time. It was built in flex, and here's a demo video here.

FLEXifier allows you to write and try flex code, directly on the application page, without needing to download or install anything. Also built with flex, and a mix of cf and spry.

tasty morsels of your own dog food, and very good tools for the adoption of flex. go check em out. And thx guys.

cheers,
-- eokyere :)


UPDATE

Nov 1 2006 -- Since there's a flash 9 player for linux out there and no support for linux yet, with Flex Builder, these tools (especially, flexible) should come in quite handy, shd you find yourself on a linux distro. Cheers.

Friday, October 27, 2006

familiar software experiences

i'm what you could probably call a keyboard nut; probably for the same reason people get used to vi and then can't ever get used to any other editor. i'm not in that circle though... for practical reasons, i'd pick an ide over vi any day, but i digress

anyway, i'm doing some writing stuff in neooffice (openoffice) and one of the things I like to do in eclipse is select a bunch of text and use Alt + cursor (up/down) to move them around. [when using this with the jdt, you actually get code formating as a bonus too :)]

out of habit, I tried that on NO/OOo and it didn't work. i thought for a second that NO probably had the feature and so went asearching... playing around with various keyboard combinations... I found a few things... and yup, NO has that baby locked down too.

On the mac, its Cmd + cursor (up/down) to move text around.

brilliant!

cheers,
-- eokyere :)

Tuesday, October 24, 2006

codepress: real-time syntax highlighting in a textarea

i'm very jealous; something i always wanted to do with actionscript; create an online rich text editor that does real-time syntax highlighting (at least for Java/Actionscript).

the guys over at CodePress site nailed it with javascript ;)

nice. very nice. awesome stuff.

-- eokyere :)

get Wiser with SubEthaSMTP

You won't think it should be so difficult to write effective test cases for the bits of your application where you have to send/receive emails.

Sample use case:

You have a 2-step registration process where after a user has submitted their info, they are sent a challenge token (via email) to validate the submission/make sure the email address is actually in use (and that they have access to it), before you add them to your 'users' table.

Ideally, to test this little piece of functionality, you need to be able to give your test mua a fake smtp port, have a dummy server listening on that port, have a convenient way of starting this server, retrieving messages it has to transfer, be able to retrieve all the usual suspects from a sent message (sender, receiver, subject, content etc), and be able to make assertions against these and your test data.

A long time ago, I found dumbster; I figured it solved the author's problems when he/she wrote it then, but just couldn't cut it for what I wanted to use it for.

So I went asearching, and found greenmail, which seemed to relieve me of the pains I was having with dumbster, although it still felt kinda kludgy; for instance, this is a snippet taken of the examples doc on the greenmail page:

[code]
servers = new Servers(ServerSetupTest.ALL); servers.start();
//use random content to avoid potential residual lingering problems final String
subject = servers.util().random(); final String body = servers.util().random();

//wait for max 5s for 1 email to arrive
assertTrue(servers.waitForIncomingEmail(5000, 1)); //Retrieve using GreenMail API
Message[] messages = servers.getReceivedMessages();
[/code]


the servers.waitForIncomingEmail(5000, 1) bit is clearly kludgy; it also seemed to treat ccs as sent mail, so if you sent one mail and cc'ed it to 10 people, then you had to remember to test for 11 mails to be sent by the mta; i found workarounds for this, and all in all it caused me far less pain than dumbster, so I was actually quite happy with it... at least until Geert pointed me to Wiser

From the Wiser page:

[code]
Using Wiser is trivial:

Wiser wiser = new Wiser();
wiser.setPort(2500); // Default is 25
wiser.start();

Now, use a mail client to send email to your Wiser server. To get your JavaMail messages out of the Wiser server, just use this code:

for (WiserMessage message : wiser.getMessages())
{
String envelopeSender = message.getEnvelopeSender();
String envelopeReceiver = message.getEnvelopeReceiver();

MimeMessage mess = message.getMimeMessage();

// now do something fun!
}
[/code]


It really doesn't get simpler (and wiser than that); and yes, writing effective email test cases has, thanks to Wiser, become quite simple; and fun too :)

cheers.

-- eokyere :)

Monday, October 23, 2006

IoC: Inversion of Consequence

when i write code, and it causes you pain, try to find a positive spin to it ;P ... it might be the only thing that keeps you sane enough to get through the maintenance job/babysitting that you have to put it through... it's been a hell of a weekend, and I found Malcolm Forbes just about when I needed it - "Failure is success if we learn from it." If experience teaches us best, then hopefully it follows that you learn to avoid more code smells, the more brittle code you help to correct

my valley of despair has finally hit a minimum and i'm off to find some much-needed sleep

zzzzzz

-- eokyere :)

Thursday, October 19, 2006

tux: we've been ria wora'ed ;P



joining the earlier birds in announcing to the world the availability of player 9 for the tux family... in that screenshot, running happily on lampetia, fc4 over parallels in firefox 1.0.8 :)

tinic uro, over at his blog, is really happy about the performance of this release. He metions this is the fastest gnu/linux version they've ever released, and that "in some cases the GNU/Linux version is up to 20% faster on the same hardware compared to the Windows 32bit version." It looks like tuxland finally found first-class citizenship in Adobe land--at least with the flash platform.

while there are still problems with the current release that the Adobe engineers have to look at, as tinic notes, it should be interesting to see if releases from here on follow more of a parallel pattern.

Developers sure would love that; all the features you've been coding to for the mac and win boxen, will now be free to run on all the gnu/linux flavors out there. A hat tip; a raised glass to the Tinic, Mike and the rest of the unsung heroes on this release.

go grab it here http://labs.adobe.com/technologies/flashplayer9/


-- eokyere :)

Wednesday, October 18, 2006

mac a honey witcha zune?

"In a word, no. I've seen the demonstrations on the Internet about how you can find another person using a Zune and give them a song they can play three times. It takes forever. By the time you've gone through all that, the girl's got up and left! You're much better off to take one of your earbuds out and put it in her ear. Then you're connected with about two feet of headphone cable."

truer words haven't been said, and coming from the 'mac daddy' himself, u know u can take it to the bank ;P

-- eokyere :)

Wednesday, October 11, 2006

RIFE - as DRY as it comes

Aral has a post on some DRY pains with RoR (http://aralbalkan.com/764)... aral's blacklist of ips also managed to scoop me in, so my comment could not be retained

anyways, Aral, I feel your pain; I don't know enough about Ruby or RoR to give a meaningful suggestion wrt them; in the RIFE community (http://rifers.org) though, we believe that centralizing the metadata for your business objects, and allowing that to drive all the other connecting layers of your application is quite RIFE (read kewl ;P)

say you have an object instance of Foo, foo, where

Foo { String name; String email; }

the metadata facility allows you to say, for example:

addConstraint(new ConstrainedProperty("name").notNull(true).notEmpty(true));
addConstraint(new ConstrainedProperty("email").email(true).unique(true).maxLength(100));

the email field could, for instance, be representing the login field in your authentication toolkit

by defining such metadata for the email field, the framework is able to (among a whole load of things):

* through it's database layer, use an sql query builder to limit the size of the column in which the text will stored when the table creation sql is generated (by the framework for you, from your business object/bean),
* through the metadata facility, validate/check that data entered indeed conforms to those constraints: that it's a well-formed email address, that it is unique (by applying a datasource context to it) and that it's size does not exceed the size constraints applied to it.
* through it's template engine, use an html form builder to create a field that doesn't allow the entry of longer text
* through it's template/validation engines, generate meaningful, customizable (through properties) error messages when constraints have been violated.
...

these, to paraphrase Steven Grimm, "cross-layer synergies" (enabled by RIFE's centralized metadata facility) are some of the reasons we are seeing an influx of developers adopting the RIFE way.. I don't believe it gets DRYer (or RIFEr for that matter) than that ;)

-- eokyere :)

Tuesday, October 10, 2006

the mbp club

most of the posts on this blog will be made on my trusty new (for about 4 months now) friend, charybdis; it's an mbp, that as of this posts spots OS X 10.4, instances of fedora core 4 and windows xp sp2 (over parallels). the first time someone asked me how i felt about her, i said she was graceful--that hasn't changed in 4 months.

i run smultron as my basic development editor (vim for purely text stuff), have instances of Callisto (and Europa), Netbeans (5b2, 6m3), Xcode and ANTLRWorks for dev stuff; Callisto finds more use most of the time though. looking forward to adding an adobe (or whoever creates one's) flex ide (for mac) to that list

my fc4 install, forms my basic 'remote' test environment (with tomcat 5.5.17, postgresql 8.0x among others for a current project), and will continue to play this role with added software as and when I need a linux test deployment target.

windows is on there for a few random stuff i still haven't found mac/linux equivalents for, as well as for adobe software i'm either testing out or still using; i might strip out most of the unnecessary stuff over time, and use it as a target for any .net /winfx stuff i decide to dabble in, in the future.

for writing and word processing stuff, as well as the planning that leads to them, I have neooffice, freemind, and omnioutliner.

a couple of other random code running around here include colloquy (irc), skype b2/msn messenger 6, democracy (i'net tv), firefox 2rc2, iterm (and terminal), the google stuff for mac (google.com/mac), keynote etc

you've been introduced to my trusty mbp; joined the club yet? how is it helping u do what u do?

-- eokyere :)