My credit card company has a new site where you can win $10,000 if your idea is voted the monthly winner. I’m not too sure the risk/reward ratio is good enough to put your idea up on a public site (maybe lock down a trademark and submit some patents first).
My favorite show lately is The Big Idea with Donny Deutsch. Donny is a fiery character so if nothing else the show is like a daily pep talk that gets you motivated to work after dinner rather than sit in front of the teevee. The show doesn’t focus too much on tech/internet but once you put yourself in an entrepreneurial mindset you’d be amazed how ideas just start popping up in your head.
If your Rails app uses Rmagick to resize images on shared hosting you may have had your app shut down because of a RAM spikes (the spike can be > 40mb when processing an image > 2mb).
MiniMagick accesses ImageMagick directly, similar to exec(’my ImageMagick command’); in PHP. Since shared hosts are looking for Rails spikes not ImageMagick spikes your app won’t get killed. If you use Rick Olson’s excellent attachement_fu plug-in MiniMagick support is baked right in.
It’s thanksgiving eve so I was being super productive by surfing every blog known to man when I came across one of my favorite topics, programming fonts, which is so nerdy that it occupies it’s own brane.
If you can’t decide between Cairngorm or PureMVC, Luke Bayes and Ali Mills have a presentation up that walks through the pros and cons of ten different frameworks:
ARP (I read somewhere that v3 was going to be Rails like in it’s ease of use ARP development seems to have stalled now that Aral Balkan is focusing on SWX)
Of the above I’ve tried/used ARP, MVCS, Cairngorm, and PureMVC. My favorite being PureMVC, I was using Cairngorm for a while but most of my Flex projects are one developer (me myself and I) and don’t last longer than a month. I know a lot of enterprisey applications use Cairngorm but everytime I write (or generate) a bunch of files or whatever for just one user gesture I have voice in the back of my mind - with a Danish accent eerily similar to David Heinemeier Hansson’s - saying “six files to do one thing? AYFKM?”. PureMVC takes it down to like three files, but as with Cairngorm unless you have Computer Science degree to learning curve is still quite steep.
Luke and Ali included ‘None of the Above’ as one of the choices and that’s what I usually go with for my two day to two week projects. Flex is a framework itself and with my simple custom MVC setup adds what’s missing (basicly a way to consistently structure the files). I still wish there was a Flex framework that’s as accessible as Ruby on Rails, I think much of the problem is that Flex was originally targeted (and often still is) as a front-end for Java apps so framework developers bring all this Java baggage to with them. Where’s the friendly Flex framework?
Adobe is now selling Flex Builder 2 for $249, still no word on the pricing for upgrading to Flex Builder 3 (how about free for everyone who paid $499 for FB2?) :P
I try to keep this blog free from my political views (go Ron Paul!) but this is one topic that never gets enough coverage in the news. You may have noticed that at the bottom of a post’s permalink page I have an appeal to donate to the National Coalition for Homeless Veterans, today there’s a story that veterans of the current wars are becoming homeless faster than ever. Whether you think a war is just or not it always has one by-product; scores of mentally ill veterans many of whom become homeless.
These are not your father’s Vietnam era veterans, they are the same age as you and me.
Veterans make up one in four homeless people in the United States, though they are only 11 percent of the general adult population, according to a report to be released Thursday.
And homelessness is not just a problem among middle-age and elderly veterans. Younger veterans from Iraq and Afghanistan are trickling into shelters and soup kitchens seeking services, treatment or help with finding a job.
Some advocates say the early presence of veterans from Iraq and Afghanistan at shelters does not bode well for the future. It took roughly a decade for the lives of Vietnam veterans to unravel to the point that they started showing up among the homeless. Advocates worry that intense and repeated deployments leave newer veterans particularly vulnerable.
“We’re going to be having a tsunami of them eventually because the mental health toll from this war is enormous,” said Daniel Tooth, director of veterans affairs for Lancaster County, Pa.
The end of the year is coming up, if you’ve been a productive web developer you’ll need some tax deductions to reduce the amount the government takes from you. Why not make a donation to the NCHV throught Network for Good.
Part of the brief was the ability to print at small sizes and to work in black and white, it might be sour grapes coming through, but I don’t think the winner would hold up. The ruby masses don’t seem too pleased…
Update: actually I know why I lost my logo looks too much like a) superman’s b) a strawberry c) the bad guy from Tron (or is that a plus?)
Here’s the brief load an external image into Flex, resize it to fit in a container (but don’t make it bigger than the original), center it in the container, and smooth the image to get rid of any aliasing. Sounds like a simple job, slap down a VBox, set vertical and horizontal alignment, add an Image component and set it’s width and height to 100%, grab some handy image smoothing code, you’re done no? No. There’s a issue with every one of those steps.
First up the VBox. If a VBox contains a dynamic image (who’s size is undermined) the VBox will no pick up the Image component’s new size once the image has loaded so it can’t adjust the image to be centered properly.
Next is the Image component, setting the Image Component’s width and height to 100% seems like a good idea until you get an image with smaller dimensions than it’s container. The image will stretch to fit and become blurry. Setting the scaling to false will then not allow images that are larger than the container to scale down. We’ll have to handle image resizing manually.
Finally smoothing, dynamically loaded images do not smooth when you change their size. The solution is to use Ben Longoria’s image smoothing component but it if you don’t set your security model property your app will still crash and burn as you can’t get an image’s properties if the Flash player barfs a security sand box violation (no smoothing and no resizing as you can’t even get contentWidth or contentHeight).
Anyways long story short here is my solution to the problem:
Don’t set any image component properties before hand, once it’s loaded use it’s ‘complete’ event to resize it.
Use a Canvas instead of a VBox and handle positioning by hand
Set a loaderContext for the image, and make sure your cross domain policy is set up correctly
Here’s an example. The top image isn’t centered correctly and it’s aliased because it’s a regular Image component (you can see jaggies on the curves and angles). Right click to view source.