Blog

  • Post AJUG: AJAX & ThinkCAP

    The Atlanta Java Users’ Group meeting tonight was about AJAX. Takeaways:

    1. Back button becomes Cancel
    2. Submit button becomes Save
    3. Tons of open source frameworks to bridge to the backend
    4. Code does not need to exist on the client beyond connection scripts; JavaScript can be sent to browser to be executed; basically remote invoking via passing of code (aka using eval with JavaScript received from the result handler)
    5. ThinkCAP is a program by a company called ClearNova; it is made up of an IDE visual layout tool, a JavaScript framework, and Java servlet backend, all to create web applications via AJAX; you can toggle AJAX functionality off
    6. Rich Internet Applications was a word that rolled off the presenter’s tongue with no problems.
    7. Many are now thinking of building web applications, not websites; key difference in mindset & goal
    8. Many just discovering the wonders of Prototype
    9. Java peeps are still interested in learning about Laszlo

    To go into more detail, it was fantastic to have the AJAX community question the “breaking” of the back button; expanding on what Brandspanking new said in response to Mario Klingemann’s post. “Do we really need it?” This is an application, not a page by page metaphor. As a Flash Developer, my take is “no shit, Sherlock” but having another community, mainly Web Developers, echoing the sentiment on already engrained technologies says a lot, lends credence to our original claims, and helps the cause. Unlikely allies.

    The questioning of conventional wisdom by that many more people on how the web is supposed to work is just great; really excited to have another movement going on.

    What is scary is the Java developers all chomping at the bit; with the remote invocation (sending JavaScript to the browser which is then eval’d) allows them to have very little presentation logic/code on the client, allowing that to be stored in databases & templates.

    Additionally, one good point made by one of the presenters, Steve Benfield, was how he thinks AJAX will shake up the open source framework community for Java. Many are page based metaphors; none think like application front-ends, like Flex does currently.

    Another point my colleague, formerly of JBoss & Spring fame, Les brought up was there are clients who do not want, or can’t, install anything, and simply want to use installed software that can scale to hundreds of thousands of users (ie Java clustered backend). Since you can’t use Flash or Flex on the front-end for such situations, he has a valid point. Good thing I’ll just keep sucking at HTML & CSS to ensure I don’t get assigned to such projects.

    Another point he brought up during the post-preso question phase; anyone done tests with 200,000 user requests?

    Both Flash & AJAX both increase the amount of server requests, but reduce the bandwith of those requests. No one there could answer if the effects have been tested to actually cause problems. Yes, the bandwidth is lower, but you are now accepting more continous connections.

    As all of my past clients, fulltime & contract, none have reported server errors which lead me to believe I’m either better at server-side coding than I thought, or more likely I’ve never had my applications reach the concurrent user base Les was asking about. Time will tell, but I’m banking on AMF vs. Gzipped strings.

    It’ll be nice to have Java programmers screwing with a prototype language (JavaScript). Curious what the long term affects will be. Will they help find better conventions so prototypes can be used in team environments?

    Really neat demo of ThinkCAP. Really cool to see a small(?) company build a RIA development tool, complete with JavaScript framework & back-end which allows easy plugging to things like Spring, Hibernate, and other frameworks.

    Did I mention it was funny to see a Java programmer showing his code, and he wrote it like this?

    this.addStyle = function()
    {
    // stuff
    };

    BWAHAHA!!! Awesome…

    Thanks again, Burr!

  • You, or Someone You Know Can Fix the Machines of the Future

    I’m convinced I’ll have a job in technology till the day I die. At the rate things are going, maybe it won’t be coding, but I’ll bet my last dollar it’s in maintenance.

    I spent, oh, 20 minutes at lunch trying to fix my blower; it’s a 2 stroke engine with a fan that generates massive air blowing power. It is used by me to blow mowed grass off my driveway, my back porch, and I can even invert it to vacuum up grass since my mower is bagless (came with house, not much I can do). After 2 weeks of no lawn mowing, with 1 foot high under the tree, the covenant police we’re chomping at the bit to get me on a “mowed grass in lawn” violation. Thankfully, someone at the corner entrance into my cowpasture-turned-suburbia neihborhood hasn’t sold their house in like over a year, gave up and left, and tend to their yard every month, if that; decoy saves the day again.

    Can’t say I blame ’em; if I were looking to purchase a house, and noticed a yard unkempt, I too would develop a judgement that said yard owner was a slob, and would keep to his un-sightly habits, and make it hard for me to sell my house, and continue the horrid cycle of seller insecurity. Still, the teenager in me wants to tennis-racket their mailbox if they even touch mine with another frikin’ flyer; it’s bad enough I have to Tabasco sauce my eyes just to stay awake on my roof to catch that rogue junk-mail paper delivery boy in the sites of my sniper rifle. Haven’t caught him (her?) yet either… have about 3 sheriffs in my neihborhood, and don’t want to cause a ruckus, ya’ know. Speaking of ruckus’, I wonder if they caught that 6ft wiry, white male who keeps breaking into houses naked? …and you thought I was weird sitting on my roof with hot sauce and a gun?

    Anyway, yeah, 20 minutes, gave up, hit the Subway and aquired more food than I could utilize. After the last Subversion check-in, I surveyed my surroundings, and figured I’d give it a go again. So, I start unscrewing every screw I can find. Frikin’ crackhead engineers; either I do not have an appreciation for the finer points of screw head vs. phillips head vs. alan wrench head… or my former adjective usage was well placed, if not an abused conjunction. Thankfully, her majesty recognized my testosterone yearning awhile back, and satiated me with a drill set. It had every type, and with enough sizes to disassemble Johnny-5. STEFFANEEE… neeeed INPUT!

    It kept getting uncomfortable too; I tried to make rows, even fantasized about construction paper & chalk outlines… but gave up, and made a bolt haiku on the ground at my garage door, wide open. I obviously need to throw some stuff away; I kept getting people offering me money for boat shelves I have out front, and I had to politely decline their purchase, as this was not a yard sale, I was merely “working in my garage” as guys are like… supposed to do and stuff. The weird looks were a tad uncomfortable (sorry, out of lemonaide, nothing to offer), but southern hospitality prevailed.

    The same, morbid urge one gets to look at an accident on the highway somehow wrapped it’s black tendrils around my motivation, and pushed me onwards. I knew my blower was screwed; there was no turning back now. I couldn’t code in Flex; too burnt out. I had to move this grass, and the thought of manual labor was laughable… HA! I had to justify 60k worth of degrees somehow (obviously that wasn’t in economics, because that price guess wasn’t even close). So, I’d look at the… uh… “standing plate bar insert” thing as I detached it; as if it were some alien parasite piece of detached flesh (formerly attached, whole, to the ship), and the aliens had left, we had worked through the religious issues of the aliens coming, and the government assured us our tax dollars did NOT pay for that incursion, and so I after the stay-puff guyz in the suits confirmed there were no alien diseases on said parasite, I continued to disect it since the aliens weren’t really gray’s, and disecting your planetary neihbors is just rude; we in the south keep to ourselves.

    So yeah, piece by piece, I removed things. Halfway through, I hit Google and apparently found a clue via RC-car sites. Is it me, or is there a common trend in tutorial sites, for any discipline, coming off as patronizing? Condescending? Feels like it. Anyway, yeah, pully or something. It just so happens the pull cord was, WHERE? At the core… the cold, hard, steel center behind tons of complex machinery. I get uncomfortable enough opening my Alienware to remove the dust, so this was just wrong. Upon reaching the center, the cord was wrapped upon itself, a kite wind gone astray, a fishing lure with heavy weight being dropped into sea horribly wrong; tension, man, TENSION! Ease it in, control it.

    I thought the engine was locked since I pretty much had hay bales in my yard, and had to gather said yard trimmings in a pile. What to do with them afterwards? No no… this is primal time, must work, the process will wrestle itself out, it always does. Mid-yard blow (I was doing laps; my new iPod-mini raving me till dawn), even over the din of an 808, I could hear the blower trying to tell me something. Another pitch shift and I definately knew something was wrong. I was hot, the sun was relentless, and as a geek (yes, I still had some protective tan left) in the sun, well… the only radiation that should be hitting my face is from a Viewsonic, not from a ball of gas you can’t even put into her majesty’s Element. If I can survive this, SO can you. Damn empathy… strikes at the worst times. Shakespeare had it easy; good people are TOO EASY to mess with. Thus, as soon as I turned off my blower to give it a breather, it breathed it’s last. I couldn’t pull the cord to start it again, not matter what button, or dial I modified & tweaked.

    Upon re-assembly, I was confident I had actually fixed my first piece of hardware. And why not? Shouldn’t the skillset of modifying code personify onto hardware, and lament the same degree of success?

    All was for naught. 3 hours later, I still couldn’t pull the cord. But MAN, that thing is pretty slick in terms of how it’s put together. If a Java guy wrote it, I’d be able to use one screwdriver, and be able to get to all of the screws with my drill… but it wouldn’t have been as cheap.

    So, grabbing the rake before my inner fire unleashed hellish frustration upon my garage of boat shelves, and … God, what the hell IS in there anyway? Her majesty’s walking out with a painting & a charcoal drawing? I swear to God that is going BACK in that room of stuff holding if it’s not on some wall by tomorrow night!

    About 5 minutes, I realized my muscles needed proper audio stimulation via the iPod or the pace would be about as consistent in it’s livery as picante sauce made in New York city handed to Montana Joe and his merry men. Dark breaks, and some old school Pantera later, I had ported and entire weeks worth of “yard” into some wanna-be pond in my backyard. Why did I buy a house with a yard again? Oh yeah, so I can put the front-yard’s leftovers in the back, right, right.

    …almost done, and it hit me; technology breaks. Seriously, all the frikin time. Yes yes, I’m reaching the point of this post, quite right. How many hours a day do you spend “fixing” things? Fixing bugs, cleaning spam, rebooting Outlook, restarting Tomcat, ALT+F4 out of a crashed game, replacing a haddrive, re-typing an email with tact… the list goes ON! Hell, my dad when I was a kid worked on his boat 24-7; that’s the main reason I keep telling her majesty no when she asks for us to buy one. In a typical 3 week period of around the clock grease-monkey insanity, we’d maybe go water skiing once… and maybe fishing twice… in a month. He enjoyed it, I spose.

    I started realizing the fine line between “bugs” and “workarounds” and “lack of knowlege”, and realized the same thing applies to technology. If a blower breaks because you overheated it, is that a faulty blower, faulty user, or lack of good documentation?

    That’s not the real question; the real question is, why do some people win those robot contests. A lot of the underdogs have better chances (underdogs being underfunded school systems… oh wait, they all are… well, the lowest of the low). They come with the mindset of “keep it simple”. The more complex a system is, the exponential amount (did I get it right Patrick?) of errors that system can produce. Thus, the more technology gets ingrained in our culture, the more points it can break, and the more need for either self-ability to fix it, or new jobs.

    Going off of the example, when fast food finally does replace humans (has 50% up in Richmond, Virginia at a gas station. You use a kiosk to order food; you choose breakfast or dinner, sides, toppings, and condiments. A human hands you the package; do they need to? Naw, I worked at Wendys, a fast food chain here in the states created by a really nice guy named Dave, and I know making a sandwhich isn’t hard at all. Hell, Terminators’ cousin makes my Honda. Damn big paranthesis, gotta stop the insanity now… :: grunt :: UGH ). Anyway, they can’t remove people entirely; MacDonalds I think is like the #1 or #2 private company employer in the United States. You can replace the obnoxious countenance of cashiers with a PSD beveled button interface, but you can’t remove the lobbylists from capitol hill (don’t know politics, just guessing they have lobbyists for jobs there; remember reading some insanity that programmers can’t get jobs and they lobby congress to stop visa’s or something whack). Too many jobs would get replaced by machines.

    BUT, anyway, when we do, and those people are replaced, those machines WILL break. Even Kroger & Publix, grocery stores here in the south of the states, have automated checkout lines which have at least 1 dude watching to ensure you don’t steal, you don’t illegally buy beer or cigs underage, and also to fix the machines when they break. Does God watch me until I break?

    That being the case, what if I break it down? Naw, just kidding, what I meant was, that being the case, even if Rational Rose becomes a behometh, and starts coding EVERYTHING for you, you’d still need a human to configure XML files (hell, Java & Flash guyz do that now), make sure machines are up and running. The cycle’d continue, and going off of that sleep attack post, we’re all gonna be a bunch of f00king Scotties, albeit not Scottish (I’m 33% Irish), with a bunch of IT Managers going, “I need more power, sucka!” or “Fix this in 1 hour less than you time estimate!”.

    Maybe it was the kids joy riding in the pimped out Civic whilst I raked my yard. The iPod didn’t compensate; I felt old; an adult, doing yard work… with a rake… outdoors at a house I own. I had to justify my future in software somehow, mabye this post was it, maybe it wasn’t. I just felt frustrated that we live in a world where there are not just 1, but 3 pills for everything, you can surivive at a gas station when zombie’s attack, and I can talk to anyone in the world who’s jacked in… and I can’t even use a machine to blow some grass away for more than 20 minutes.

    Someday, Half-Life 2 will NOT have a loading bar. That’ll be the day my blower never breaks… or if it does, it’s because whatever fixes it broke, and the dude responsible for fixing that robot was busy doing something else.

    Bloody full moon.

  • No Complete Event for Internal Content

    Both Flash & Flex have a Loader component to load content into. It’s nice in Flash because it abstracts sizing & loading code. It’s even cooler in Flex because you can bind to contentPath.

    However, if the content you are loading in Flash is an internal symbol, or embedded content in Flex (same thing), you will not get a “complete” event.

    I find this wrong since expectations are, “I load content, I get an event while it’s loading, ‘progress’, and I get an event when it is completed, ‘completed’.” However, you only get these events for external content, like external JPEG’s & SWF’s. The documentation for both Flash & Flex versions does not state anything to the contrary.

    Frankly, since this component abstracts the loading process, it should be up to the component omit events regardless of loaded content, or emit different events. This now requires the user of the component to know which content type they are loading.

    This is an important distinction, because such low level details of whether something is an internal asset are not easily determined at runtime in both Flash & Flex. The more OOP something is, the less you know about where an asset came from. Simply adding the “Embed” metatag in Flex above an asset path, and it’s internal; your code doesn’t change.

    Additionally, Flex abstracts control via binding. Since this connection is handled for you, one assumes (wrongly) that those bindings work without data inspection intervention.

    What I’ve been doing is just checking if the asset I’m loading has a prefix of “__Resources” in it; if so, it’s an internal asset in Flex, and thus I must immediately call my complete event myself. Hack.

  • Flex Chronicles #12: External Text Files for String Variables

    Typically, if you want external content in Flash, you link to an external text file, and load it into a text field like so:

    lv = new LoadVars();
    lv.owner = this;
    lv.onData = function(str)
    {
      this.owner.my_txt.text = str;
    };
    lv.load("yourTextFile.txt");

    Quick and dirty, right? Well, Flex does the same thing for you, but without all the work; check this out:

    <mx:String id="data_str" source="some.txt" />
    <mx:TextArea text="{data_str}" />

    Yes, that’s it, I swear! The line between authortime & compile time is blurred so technically this is compiled in, but it remains an external text file you can check into source control & deploy on your webserver, or keep locally.