Sunday, February 21, 2010

YUI + Struts2 + asyncRequest + POST

I finally figured out this issue today - working with the YUI 2.x, Struts2. I am using YAHOO.util.Connect.asyncRequest('POST', url, callback, postData), and was finding that the postData was not being set in my action. Turns out - YUI wasn't setting the content type header to "application/x-www-form-urlencoded" and because of this Struts wasn't parsing the post data. The problem was this section of asyncRequest:


if((method.toUpperCase() == 'POST' && this._use_default_post_header) && this._isFormSubmit === false){
this.initHeader('Content-Type', this._default_post_header);
YAHOO.log('Initialize header Content-Type to application/x-www-form-urlencoded; UTF-8 for POST transaction.', 'info', 'Connection');
}


Turns out, this._isFormSubmit was undefined here, so === false turned out to be false. Changing it to !this._isFormSubmit solved the problem.

Tuesday, February 16, 2010

Developers aren't important in startups?

Dave McClure at Business Week says at startups "Design and marketing aren't just as important as engineering: They are way more important." Full Article.


I agree with Dave 100%, but I don't think he did a great job justifying his viewpoint. So, let me help him out.


His point is clearer when you consider all the real world examples of his philosophy in action. Just look at all those startups out there killing it by ignoring engineering and focusing on design and marketing. Companies like, um, well, hey, have you seen those mac ads, now that's marketing! If only Microsoft had marketing like that! My next statement is really going to blow you away. Wait for it... wait for it... "human sexuality". Now you know I'm right! Sexual humans. Human sex-u-ality. BAM!


And, let's not forget to look at the disaster that comes from believing engineering is a key skill needed. Take google, they epitomize "engineers above all else". Hell, I've know engineers who have passed on job offers from Google because they thought they were too "pro engineer". But, google was founded a long time ago, like when we were all 10 years younger. Today, it's all just styling forms and cutting distribution deals.


So, in summary, yes, all the big names in start ups were founded by engineers and solved lots of hard problem; but, shit moves fast, and now it's just forms, killer design, and marketing, but not marketing like traditional marketing, like new twitter distribution channels.


HUMAN SEXUALITY!

Monday, October 5, 2009

Software and Football

Football has metrics - yards per rush, completion percentage, time of possession. Do you think Mike Tomlin talked about their yards after the catch after they won the super bowl? Do you think Arizona fans cared that their team won the time of possession battle? In football, metrics are useful tools for the teams and only important in fantasy football. Every football player and coach in the NFL understands that the only metric that matters is W's.

We have metrics in software - burn downs, lines of code, reopen rates. We spend years delivering metrics and no products. We have SMART goals to justify our bonuses. We WORSHIP our metrics. In our fantasy world, we are world class developers and have the metrics to prove it. When our products don't fly in the market, our business owners are idiots, we got bad requirements, our sales people suck; but our metrics are awesome.

Are you smarter than the average linebacker? Has your software career been concusion-free? Then stop trying to be a rock star in fantasy development and start focusing on your product's success.

Saturday, February 7, 2009

A startup isn't a business

At a startup you are not really "In Business", you are trying to build a business.

When you work at a startup, all you see is the vision. The customers, the business model, the cash-o-la, your expanding team of minions. WE CANNOT FAIL. When you look at your competition, you see their current business - and it looks like crap.

Trust me, their vision is just as grand as yours.

And your reality is just as crappy as theirs.

Have a vision, but don't lose site of the current state.

Monday, June 30, 2008

Cisco VPN on Vista

If you use the Cisco VPN client on Vista this, bookmark this: http://www.verier.co.uk/subtext/archive/2008/01/09/reason-442-failed-to-enable-virtual-adapter-with-cisco-vpn.aspx


And, to avoid such problems, disconnect the VPN before you let you computer go to sleep.

Wednesday, April 9, 2008

Installing DB2 on Vista

In case anyone else runs into this, you have to log in as an administrator to install DB2 on Vista. Logging in as administrator is different than logging in with an account that has administrator access. And, because they said so, the administrator account is disabled by default. Follow life hacker's instructions to enable vista's administrator account.

Wednesday, January 16, 2008

My actions GET POSTs

Quick note on a pattern I've picked up from tinkering with Rails and have happily used in other web platforms - using the same controller action for both GETs and POSTs. Basic pattern looks like this (pseudo code):


someAction()
{
if( request.isPost() ){
handle the posted data...
}
else{
handle setting up the form...
}
}


In your HTML, you don't have to specify an action, it will just POST to whatever GET was used to fetch the form in the first place. I'm implementing some file-import functionality today, and this came in handy as I can reuse the file form view for all of my various import actions.

In Rails, you can accomplish this with routing - same rout pattern sent to different actions based on the request method. There isn't an equivalent in my Struts 1.x app, so far that hasn't bothered me, though.

I would love to hear what other people think about this pattern. My initial thought was that coupling generating the form and handling the response was a negative, but in my day to day work I've yet to run into an example where coupling them together was a bad thing.