KB927917

You get an error in IE6/7/8

Message: HTML Parsing Error: Unable to modify the parent container element 
before the child element is closed (KB927917)

Your javascript is attempting to append something to the body element before the body element is closed.

You need to enclose your javascript in an on-load event handler.

$(document).ready(function(){/* Your JS */});

What if the IRS had an API?

GET /people/123456789/year/2009/balance HTTP/1.1
Host           ssl.irs.gov
Accept         application/json
Secret-Api-Key f24b35a8f2e1dda6ca5a5166a5530b96
 
-
HTTP/1.1 200 OK
 
{"ssn":123456789, "balance":"12345.00"}
 
-
POST /people/123456789/year/2009/payments
Host           ssl.irs.gov
Accept         application/json
Secret-Api-Key f24b35a8f2e1dda6ca5a5166a5530b96
 
amount=12345.00&card[number]=1234567890123456&card[exp]=0112&card[name]=kev%20burns
 
-
HTTP/1.1 201 Created
Location: /people/123456789/year/2009/payments/1
 
{"ssn":123456789, "amount":"12345.00", "created_at":1265432844}
 
-
GET /people/123456789/year/2009/balance HTTP/1.1
Host           ssl.irs.gov
Accept         application/json
Secret-Api-Key f24b35a8f2e1dda6ca5a5166a5530b96
 
-
HTTP/1.1 200 OK
 
{"ssn":123456789, "balance":"0.00"}

Coupling vs. Cost vs. Time

In response to Subbu’s Coupling Vs. Cost

coupling-cost-time

It’s a wave, isn’t it? The sweet spot is somewhere between 0,1,0 and 1,0,1 depending on the project.

Bad future.

launch

Launch Launch Mass Effect 2 or Launch Mass Effect 2 Launcher?

Sometimes life makes you laugh.

2010-01-28 irc.freenode.net #startups
[23:06] <votz> rfrtfgghuyjhrt
[23:06] <votz> try to type your name with your chin
[23:06] <votz> its win
[23:06] <Daeken> heh
[23:07] <KevBurnsJr> i9e3v burdfn zxsjnrf
[23:07] <votz> haha

Tablet == Folding Desk

Show me a lecture hall with one of these embedded into every fold-away desk.

CakePHP and Doctrine

“As far as cakePHP goes, Cake is pretty reliant on the database and the cake native modeling, so if you were to use Doctrine instead of native modeling, you would lose all the magic helpers/features that you get in Cake.” — jwage

Damnit.

recordMyDesktop audio lag ubuntu

You are recording a screencast and the audio plays too quickly; finishing before the video, out of sync.

You need to switch your device from hw:0,0 to plughw:0,0

If you’re running from command line:

recordmydesktop -device plughw:0,0

If you’re running from gtk-recordmydesktop:

Advanced -> Sound -> Device change DEFAULT to plughw:0,0

We have the technology

Just ordered a new computer at NewEgg. Should be in the mail come Monday. Hoping to piece it together by next weekend.

1 x COOLER MASTER Storm Scout SGC-2000-KKN1-GP Black Steel / Plastic ATX Mid Tower Computer Case

1 x ASUS P6T LGA 1366 Intel X58 ATX Intel Motherboard

2 x SAPPHIRE 100286L Radeon HD 4860 1GB 256-bit GDDR5 PCI Express 2.0 x16 HDCP Ready CrossFireX Support Video Card

(thats right, 2 of ‘em)

1 x OCZ Gold 6GB (3 x 2GB) 240-Pin DDR3 SDRAM DDR3 1600 (PC3 12800) Low Voltage Desktop Memory Model OCZ3G1600LV6GK

1 x COOLER MASTER Silent Pro 600 RS-600-AMBA-D3 600W ATX12V V2.3 SLI Certified CrossFire Ready 80 PLUS Certified Modular Active

1 x Intel Core i7-920 Bloomfield 2.66GHz LGA 1366 130W Quad-Core Processor Model BX80601920

1 x COOLER MASTER Intel Core i7 compatible V8 RR-UV8-XBU1-GP 120mm Rifle CPU Cooler

1 x OCZ Vertex Series OCZSSD2-1VTX120G 2.5″ 120GB SATA II MLC Internal Solid State Drive (SSD)

1 x Seagate Barracuda LP ST31500541AS 1.5TB 5900 RPM SATA 3.0Gb/s 3.5″ Hard Drive -Bare Drive

1 x Microsoft Windows 7 Home Premium 64-bit 1-Pack for System Builders – OEM
1 x LG DVD Burner – Bulk Black SATA Model GH24NS50 – OEM

I’m really excited about the 120Gb SSD
Also really excited about the dual 1Gb GDDR5 graphics cards.
and also really excited about the 6Gb of triple channel DDR3.

I’m totally not excited about Windows 7, but I must do it for the 64-bit RAM capacity and SSD Performance enhancements.

This shit’s going to SCREAM.

I feel like I’m taking crazy pills

I wish PHP frameworks were more than just tightly coupled collections of libraries. So much of the code in Zend overlaps with similar functionality in CakePHP, Yii, Symfony, and others. Glad to see Zend ceasing work on Zend_Db in favor of Doctrine.

The PHP Application Framework landscape needs more consolidation, less overlapping functionality and less coupling. The frameworks I write tend to capture the 80% of developer interaction (bootstrap, router, base controller, view renderer) with very little code and steal the remaining 20% from other open source projects.

Wishing libraries like CakePHP’s Validation library were more portable. Wishing libraries like CakePHP’s Validation library were created without the crutch of a framework. Better to write a solid library and let others create adapters.

The PHP Application Framework of my dreams would come bundled with 0 unnecessary libraries and would play nice with all libraries created/appropriated by others.

Waxing lackadaisical

Usually my posts emerge naturally as a more or less cohesive synthesis of thoughts found nagging away at the back of my mind. I go to the place I find myself when my mind has slack enough to focus on something other than the present and let its gaze fall where it may. In the noise and confusion of the last few weeks, this usual buffer is so awash with uncertainty that when the inspiration comes to synthesize I find a marked lack of focus in my mind’s lackadaisical stare.

Pity. I have come to despise it. It is not easy to convey to someone that you feel no shame in your behavior without appearing to be a coward denying his own emotion. Yet they express their pity, empathizing with that which you are not. So how does one react? The politics of our culture would advocate a politely feigned heartfelt thank you. However, this reaction is an out-of-hand dismissal of the true intent of the expression; an attempt at empathy. When we can truly empathize with one another, we feel we are part of the same whole. When we feign empathy, we distance ourselves from one another.

It is easy to appear genuine to a child. The emotions of human beings become more complex as we mature. A newborn knows only hunger and sleep. It is not until much later that we are taught disingenuity and deceit. In fact we are indoctrinated with disingenuity from a young age. We are not taught to feel sorry, we are taught to say we feel sorry. Despite our feelings. We are taught to infantilize ourselves and those under our care. Homogeneity heralded as a virtuous and admirable trait.

If we are self-conscious, we choose how we express ourselves. We train ourselves over time to channel our emotions through laughter, silence or hatred. We choose to what degree we reveal these channels to those around us. We strive to do so with honesty and integrity, always staying true to the self.

Faced with misplaced pity do we shut down and mutter a feigned heart-felt thanks? Do we channel our discomfort through anger? Or do we recognize the attempt at empathy for what it is and belch a hearty laugh and a quip genuine response?

My first response to a new type of difficult situation is usually silence. I’ve learned from opening my mouth that I can’t assume anything about another person.

Next time I find myself in silence I will do my best to flip the interaction from disingenuous and sterile to something real and meaningful.

Breaking, mending and replacing these unhealthy cycles that ail us is what shamanism is all about.

Friction feedback loop

Your organization is highly focused on time-to-market. Burn rate is high and revenue is low. Proposals to spend time optimizing development processes are entertained on principle and swiftly discarded out-of-hand; every ounce of developer attention must be devoted directly to product development.

Yet developers are spending increasingly large portions of their time on tasks not directly related to product development. Hand-copying file revisions across release branches, rewriting functionality and interfaces to match violently flagellating specs, while still turning out heaps of code optimized for schedule rather than maintainability and reuse.

Heaps of hacky code makes for heaps of bugs. Specs change again and bugs continue to roll in. The workload continues to increase as time ticks away, the project’s air supply growing heavy and toxic. Management caves to pressure, granting a milestone slip and the team has a momentary breath of fresh air. The loop continues, only now behind schedule.

Development progress slips into the red as each day more bugs are reported than fixed. The release date approaches on the long crunch toward release. Eyes go bloodshot as nerves begin to fray. Weekend and vacation work become the norm. Then the big day.

Release! To a cheerful management with plenty of rewards and good-on-yas with cherries on top and glimpses of grand rewrites in the sky. Just another speed bump. Back to the grindstone as customers do their own QA, reporting blazing hot ultra-mega-high priority bugs with varying degrees of rage, elation and flippancy.

Your product is cool.
Your product is hot.
Your product sucks.
Your product is moot.
Your product is a dream come true.

But does your product make money?

If not, you’d better cancel that second honeymoon and gear up for what can only be described as war. Man Vs. Machine, developers hack through twisted wrecks of code leaning heavy on what-were-supposed-to-be-temporary structures that ought to be condemned. Days bleed into weeks and all semblance of a unified product direction is drowned by the cries of screaming souls.

What if we could do this better?

Do we need to release a fully-configurable decision making platform in order to start generating revenue for our organization? Is there something that we could create today and ship tomorrow that would generate more revenue from our customers than the 2 days it cost us to produce? What kind of feedback would we get from customers? Bug reports or feature requests? What would a grand rewrite cost at this stage? A day? How about a spec change? Hours? Could we turn that into minutes?

What can we do to front-load this most critical aspect of any software development project?

This makes me less afraid to swim in the ocean.

A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306)

PHP 5.3 on Window Vista

Comment out this line from your hosts file (C:\Windows\System32\drivers\etc\hosts)

::1             localhost
#::1             localhost

Apparently MySQL won’t support IPv6 til MySQL 6.0

Deciduous software

In a startup environment, hypotheses are abundant and useless until they are vetted in reality. Rapid prototyping can be a very valuable tool in determining the potential utility of a new piece of software for less than the sticker price of a full-scale assault.

ButYOU MUST THROW AWAY THE PROTOTYPE.

That’s right, YOU. Fools will see your solution and mistake it for their problem. It is your job to remove your client’s head from the solution and return them to the domain of the problem to explain that your prototype is one solution, and that “you’re almost there, all you need is social networking and ecommerce” is a pipe dream. If your prototype didn’t make more money for your client (ie business) than it cost to produce, then it needs to be culled. Unplug that sucker and sweep it under the rug.

Like the leaves of autumn, let obsolete components of your software fall gently to rest.

Sexy overlaps in CSS (signalong)

Serving lots of images that weigh in at less than a hundred bytes is a great way to bog down your front page. I’ve seen a lot of these sexy overlaps around and most people seem to be using images which is a terrible waste of internets. I present to you a more bananular solution using CSS borders.

Please sing along.

Ring Ring Ring Ring Ring Ring Ring

Banana phone!

Ring Ring Ring Ring Ring Ring Ring

Banana phoooooooone!

I’ve got this

Feeeeeling!

so

Appeeealing!

for us to get together and sing.

Sing!

Ring Ring Ring Ring Ring Ring Ring

Banana phone!

Ding Dong Ding Dong Ding Dong Ding

Donana phone!

It grows in bunches, I’ve got my hunches, It’s the best! Beats the rest!

Cellular

Modular

Interactivodular

Ring Ring Ring Ring Ring Ring Ring

Banana phone!

Ping Pong Ping Pong Ping Pong Ping

Panana phone!

It’s no baloney, it ain’t a phony, My cellular

Bananular phone!

Now get back to work.

<div class="bananular">
<div class="mod0 mod">
    <p>Ring Ring Ring Ring Ring Ring Ring</p>
    <h2>Banana phone!</h2>
    <div class='overlap'><div></div></div>
</div>
 
<div class="mod1 mod">
    <p>Ring Ring Ring Ring Ring Ring Ring</p>
    <h2>Banana phoooooooone!</h2>
    <div class='overlap'><div></div></div>
</div>
 
<div class="mod2b mod">
    <p>I've got this </p>
    <h2>Feeeeeling!</h2>
    <div class='overlap'><div></div></div>
</div>
 
<div class="mod2c mod">
    <p>so</p>
    <h2>Appeeealing!</h2>
    <div class='overlap'><div></div></div>
</div>
 
<div class="mod2 mod">
    <p>Ive got this feeling, so appealing, for us to get together and sing.</p>
    <h2>Sing!</h2>
    <div class='overlap'><div></div></div>
</div>
 
<div class="mod3 mod">
    <p>Ring Ring Ring Ring Ring Ring Ring</p>
    <h2>Banana phone!</h2>
    <div class='overlap'><div></div></div>
</div>
 
<div class="mod4 mod">
    <p>Ding Dong Ding Dong Ding Dong Ding</p>
    <h2>Donana phone!</h2>
    <div class='overlap'><div></div></div>
</div>
 
<div class="mod5 mod">
    <p>It grows in bunches, Ive got my hunches, Its the best! Beats the rest!</p>
    <div class='feature'><h2>Cellular</h2><div class='overlap'><div></div></div></div>
    <div class='feature'><h2>Modular</h2><div class='overlap'><div></div></div></div>
    <div class='feature'><h2>Interactivodular</h2><div class='overlap'><div></div></div></div>
</div>
 
<div class="mod6 mod">
    <p>Ring Ring Ring Ring Ring Ring Ring</p>
    <h2>Banana phone!</h2>
    <div class='overlap'><div></div></div>
</div>
 
<div class="mod7 mod">
    <p>Ping Pong Ping Pong Ping Pong Ping</p>
    <h2>Panana phone!</h2>
    <div class='overlap'><div></div></div>
</div>
 
<div class="mod8 mod">
    <p>Its no baloney, it aint a phony, My cellular</p>
    <h2>Bananular phone!</h2>
    <div class='overlap'><div></div></div>
</div>
 
</div>
<style>
.bananular .overlap { 
    position: absolute; 
    height: 0; width: 405px; 
    border-top:   10px solid #777;
    border-left:  10px solid transparent; 
    border-right: 10px solid transparent; 
}
.bananular .overlap div { 
    height: 10px; 
    margin-top: -10px; 
    background: #fff; 
}
 
.bananular { width: 425px; margin: 10px auto; background: transparent; }
.bananular h2 { padding: 30px 0; background: #ccc; font-size: 48px; text-align: center; color: #000; font-weight: bold; }
.bananular p, .bananular ul { margin: 0 10px; padding: 10px 20px; background: #fff; font-size: 12px; color: #999; }
.bananular .mod { clear: left; }
.bananular .mod1 .overlap { position: static; font-size: 36px; }
.bananular .mod1 .overlap div { display: none; }
.bananular .mod1 h2 { font-size: 32px; }
.bananular .mod2 h2 { background: #FF007F; font-size:100px; }
.bananular .mod2 .overlap { border-top-color: #78003C; }
.bananular .mod2b h2 { background: #FFAA00; }
.bananular .mod2b .overlap { border-top-color: #6E4900; }
.bananular .mod2c h2 { background: #00AAFF; }
.bananular .mod2c .overlap { border-top-color: #005F8E; }
.bananular .mod3 h2 { background: #FFFF4C; }
.bananular .mod3 .overlap { border-top-color: #929300; }
.bananular .mod3 .overlap div { height: 7px; margin-top: -7px; }
.bananular .mod4 { margin: 0 10px; background: #fff; }
.bananular .mod4 p { margin: 0; }
.bananular .mod4 h2 { padding: 10px 0; font-size: 32px; background: #ddd; margin: 0 20px; }
.bananular .mod4 .overlap { width: 0; border-left-width: 355px; border-right-width: 10px; border-top: 2px solid #333; margin: 0 0 0 20px; }
.bananular .mod5 { background: #fff; margin: 0 10px; float: left; padding-bottom: 10px; width: 405px; }
.bananular .mod5 p { margin: 0; }
.bananular .mod5 .feature { float: left; margin: 0 0 0 19px; }
.bananular .mod5 .feature h2 { width: 110px; font-size: 12px; padding: 10px 0; background: #ddd; }
.bananular .mod5 .feature .overlap { width: 90px; font-size: 12px; border-left-width: 55px; border-right-width: 55px; border-top: 2px solid #333; width: 0; }
.bananular .mod6 h2 { border-top: 2px solid #ddd; border-bottom: 2px solid #bbb }
.bananular .mod7 h2 { border: 4px solid #fff; }
.bananular .mod8 { margin-left: -20px; width: 465px; }
.bananular .mod8 p { margin: 0 30px; }
.bananular .mod8 .overlap { border-width: 30px; border-top-width: 10px; }
.bananular .mod8 .overlap div { height: 10px; margin-top: -10px; }
</style>

Prototype vs jQuery

I chose jQuery over Prototype as my framework of choice a long time ago and have found little reason to look back. Today I started working on a project that uses Prototype. This is my first time in a long time using Prototype. I just spent the last hour translating this 3-liner from jQuery to Prototype. I’ve written procedures very similar to this at least a dozen times for navigation lists on various other projects, so the original 3-liner literally took less than 20 seconds to write. If that.

Here it is in jQuery

$('#twelvesteps ul.nav a').click(function(){
    $(this).addClass('active').siblings().removeClass('active');
});

And here it is in Prototype

$$("#twelvesteps ul.nav a").each(function(el, index){
    el.observe('click',function(e){
        var li = el.up();
        li.addClassName('active');
        li.siblings().each(function(el2, index){
            el2.removeClassName('active');
        });
    });
});

And you know what? It’s slow. It takes like a hundred milliseconds to switch the classes. WTF.

The Tao of Programming

” When I first began to program I would see before me the whole problem in one mass. After three years I no longer saw this mass. Instead, I used subroutines. But now I see nothing. My whole being exists in a formless void. My senses are idle. My spirit, free to work without plan, follows its own instinct. In short, my program writes itself. True, sometimes there are difficult problems. I see them coming, I slow down, I watch silently. Then I change a single line of code and the difficulties vanish like puffs of idle smoke. I then compile the program. I sit still and let the joy of the work fill my being. I close my eyes for a moment and then log off. “

http://tr.im/taoprog

Framework: The Next Generation

There have been a lot of new PHP frameworks coming into existence. With the release of PHP 5.3, many frameworks are taking the leap with a total do-over of their codebase to take advantage of 5.3’s namespacing and other advancements. But most seem to be missing the mark.

PHP 5.3-specific frameworks :

  • Recess has a 5.3 branch in development
  • Sensio is working toward Symphony 2.0 (in dev)
  • Some CakePHP core devs have gone AWOL to start Lithium (0.2 released yesterday)

These last two are both total do-overs. Lithium seems very promising. It comes with very good support for schemaless key-value stores like MongoDB which to me is a huge win. Also they use the same view template extension convention as Recess (index.html.php) which is nice. But still I can’t tell you what a pain in the ass it is to open a layout and find code like this :

<html>
<head>
	<title><?=$title; ?></title>
	<?php echo $this->html->charset(); ?>
	<?php echo $this->html->style('base'); ?>
	<?php echo $this->scripts(); ?>
	<?php echo $this->html->link('Icon', null, array('type' => 'icon')); ?>
</head>
// ...

Do you really need to abstract away the stylesheet tags?
Is it that hard to type in a meta tag for the charset?
Why make me hunt through the code to find this stuff?

I think there’s a problem with the way people are writing frameworks these days.
I think people are afraid of HTML.

And it’s sad.
Because that’s what websites are.

We should be embracing our HTML, not hiding it.
We may like to think that we’re Ajaxy, but the goal of development should not be to write less HTML.
The goal of development should be to quickly produce code that works well and is easy to understand and maintain.

Fancy framework shenanigans be damned.

Cookie Monstar!

Thanks Google, you just made my day.

« Previous PageNext Page »