Archive for the 'stupid' Category

Dependency Injection: Coke with Lime

Friday, January 29th, 2010

I have in the past expressed skepticism regarding the utility of Spring’s XML-based dependency injection configuration files. A bit ago, in one of these conversations, I was pointed to Martin Fowler’s article on dependency injection. I found it hilarious.

(more…)

Brain-Dead

Monday, December 21st, 2009

Java is somewhat brain-dead at times. For instance:

while(c=System.in.read()>-1){
  System.out.print(backspaceChar);
}

Doesn’t do what you’d expect. (hide console input) It appears that System.in is being silently buffered.

So a little googling: http://java.sun.com/developer/technicalArticles/Security/pwordmask/

Sun’s recommendation is a busy-wait loop in a separate thread that constantly rewrites the previous character?!? I mean, seriously, WTF?!?

Edit: It looks like Sun implemented a new API for non-echoing prompts in v1.6: http://java.sun.com/javase/6/docs/api/java/io/Console.html

But this is still crappy. Introducing a new API to partially work around the broken functionality of an old API is how you get bloated monstrosities to begin with.

Food, Inc.

Friday, December 4th, 2009

I watched Food, Inc. last night. Was not impressed. Yes, we mass-produce food. Yes, it’s gross in parts. But so was the small-scale chicken slaughtering the film touted. Why is a smaller, open-air assembly line better than a larger, more environmentally controlled one?

Plus they played with the stats too much. “There used to be X thousand meat processing plants, but now 13 produce 80% of the meat in this country.” This doesn’t tell me anything. That last 20%, is that 2,000 smaller plants? Or 3 other really huge ones? What percentage did the top 13 used to produce? Apples-to-oranges statistical comparisons make me distrust the source.

Not to say it was all bad. The patenting of GMOs and the strong-arm tactics of their producers are definitively abusive, which I have ranted about before.

But overall, it seemed more anti-corporate, anti-science and hippy-ish than anything resembling a reasonable collection of recommendations on how to better our food production system.

XiMpLode

Wednesday, July 29th, 2009

It has been said before, but it deserves repeating: XML is overused. And often, made unnecessarily over-complicated for the task. Take for instance the example “A Simple Soap Client“.

Here is the request:

<?xml version="1.0"?>
<SOAP-ENV:Envelope
 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <SOAP-ENV:Body>
    <calculateFibonacci
      xmlns="http://namespaces.cafeconleche.org/xmljava/ch3/"
      type="xsi:positiveInteger">10</calculateFibonacci>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Here is the response:

<?xml version="1.0"?>
<SOAP-ENV:Envelope
 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" />
  <SOAP-ENV:Body>
    <Fibonacci_Numbers
      xmlns="http://namespaces.cafeconleche.org/xmljava/ch3/">
      <fibonacci index="1">1</fibonacci>
      <fibonacci index="2">1</fibonacci>
      <fibonacci index="3">2</fibonacci>
      <fibonacci index="4">3</fibonacci>
      <fibonacci index="5">5</fibonacci>
      <fibonacci index="6">8</fibonacci>
      <fibonacci index="7">13</fibonacci>
      <fibonacci index="8">21</fibonacci>
      <fibonacci index="9">34</fibonacci>
      <fibonacci index="10">55</fibonacci>
    </Fibonacci_Numbers>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Dear $DEITY, why do we need to define a new data type to hold a list of integers? And what in the world is that “index” attribute doing there? IT’S A FUCKING LIST. This is like a real-life example of the old XML binary encoding joke:

<data>
  <binary>
    <bit index="0">0</bit>
    <bit index="1">0</bit>
    <bit index="2">1</bit>
    ...
    <bit index="n">1</bit>
  </binary>
</data>

It’s just sad…

For the sake of it, let’s compare to a JSON-RPC version: (not the epitome of efficiency mind you, but an order of magnitude better)

--> { "method": "calculateFibonacci", "params": [10,], "id": 1}
<-- { "result": [1,1,2,3,5,8,13,21,34,55], "error": null, "id": 1}

Which would you rather use? :)

Don't Register at Target

Friday, December 19th, 2008

My fiancĂ©e and I registered at Target a few days ago, and after spending more than a little time wandering the store with the special scanner gun they give you, we handed it back to them and they said “Thank you very much! Your items will be viewable online within 1-2 hours.” We said great, went home, and went to bed.

The next day I tried to look it up online, and low and behold we have an empty registry. I call up the local store, and they explain the syncing happens automatically, wirelessly through the unit. They assured me it wasn’t sitting around unsynced somewhere, forgotten. They then transfer me to some regional office, they transfer me to general customer support, who transfers me to the bridal registry, who assures me (quite curtly) it’s in the system, just that it takes up to two days to display on the website. She said there was nothing to do but to wait another day, and call back if it didn’t appear.

Well, today, it’s still an empty registry. I go through the same series of phone calls again, and I’m told there are no items registered in either system, and that we need to return to the store to select the items again. Or, “we have convenient registry access online! You can pick out what you want there without having to go back again!” Gee, thanks lady. I’m astonished by the ease and convenience of the options you have presented me, and and eternally thankful for the care and level of professional support Target has provided me so far. Would you please delete my registry from your system?

Grrr. Argh.

Google News Photos

Tuesday, April 29th, 2008

The Google News photo algorithm comes up with some hilarious combinations sometimes. :-P

homer_brain.png

(it’s from an old Simpson’s episode, if you don’t get it…)

WAR IS PEACE FREEDOM IS SLAVERY IGNORANCE IS STRENGTH

Thursday, February 21st, 2008

Vote W in ‘08.

Northern Illinois University

Friday, February 15th, 2008

People kill people. Guns just make them more efficient.

http://www.nytimes.com/2008/02/15/us/15shoot.html

Never Buy a Nice Car

Sunday, December 9th, 2007

Ok, so in the 2.5 years I’ve owned my little toy, I’ve been keyed no less than 3 times, had my front AND rear emblems stolen, and now my window smashed and my radar detector stolen. This just isn’t worth the hassle.

poor z4

I got Slashdotted!

Wednesday, November 7th, 2007

For my FlyBack project:


<Kered.org>   © Copyright 2000-2005 by Derek Anderson
Get Firefox