Image by jisc_infonet via Flickr
Saturday, April 17, 2010
Color Tools That Will Make Your Web Shine
Wednesday, February 24, 2010
Intuit Ruby with Ruby Koans
Image by Getty Images via Daylife

Tuesday, January 13, 2009
Showing and Hiding Divs in Facebook FBML
But if you want to open or close a div whenever a particular link is clicked, all you need do is add a "clicktoshow" or "clicktoshow" attribute to the anchor tag for a ink.
This code presents the "link_only" div initially. Clicking the link it creates will hide this div and present the "link_and_about" div.
<div id="link_only">
<a href="#" clicktohide="link_only" clicktoshow="link_and_about">What is this?</a></div>
<div id="link_and_about" style="display: none;">
About text
<a href="#" clicktohide="link_and_about" clicktoshow="link_only">Ok</a></div>
The value for these attributes can be a single div id or a list of them separated by commas.
There's also a "clicktotoggle" attribute you can use for a link that will always be available.
It would be nice if you could call a javascript method from a form element that could open and close the same divs. Haven't found an easy way to do this myself, but this post has some code that could be called to simulate a click.
This code won't work as is on Facebook though, as the createEvent method is undefined. FBJS does have some event listener functionality; perhaps this code be used to make that happen. Of course, this complexity is probably more trouble than what I did above.
Javascript for Facebook
FBJS rewrites all of your method and variable names so your code is confined to a sandbox and cannot mess with any of Facebook's code.
This renaming confines your code to a document called "aXXXXX.document", where "XXXXX" has to be your Facebook app's numeric id. So if you have this code:
Facebook changes it to this:
You can see this if you look at the source for the page finally presented by Facebook.
You'll also see that the id attributes for HTML elements are also changed in the page source. The original attribute may have been:
but is actually rendered as:
When using making use of methods and id, your code should use the originals, not the replacements. The FBJS version of getElementById will add the appropriate prefix to whatever you pass it, so it will look for an element with the id "app19756161464_app19756161464_choice1_option_id" if you prepend the id first.
FBJS also requires that you use different method names than you would if you are writing straight Javascript. For example, instead of using ".target" to look at or change an element's target, you use ".getTarget" or ".setTarget".
You can see a list of the methods affected here. There is much more on FBJS on that page and I highly recommend reading and understanding the material there before beginning a project.
If you do anything complex, you'll probably want to use a tool like Firebug to set breakpoints and watch the values of key expressions. I had a lot of trouble with the newest version, but version 1.2.2 worked fine.
Wednesday, December 3, 2008
Capitalism in the Workplace
I would love to see people derive a large part of their compensation from revenue from the projects they've worked on. Employees could be given a percentage of the project's profits (shares) in exchange for not getting part of their salary.
If a project fails, employees would lose money too.
But what if employees could buy and sell those shares of the project's future revenue (or some amount of money earned by success) in an internal market? A stock price for all your projects would give you a pretty good idea of what employees working on the project really think.
What could be more valuable? Believe me, employees will not be blowing sunshine you know where when their own money is at stake.
I'd also make it so everybody could select what projects to work on and could leave them if they decided another project would be more profitable. By having some skin in the game and being able to act in their own interests, employees would be helping make decisions about where the company can most profitably deploy its capital.
Can't get on a project? Maybe you need some skills development or a course in manners. The company can offer a coach that gets his extra compensation only when you're on projects that succeed.
Still can't get someone to pick you for your team? Well maybe your base compensation starts declining gradually until you change that situation or decide another easier company is right for you.
I think such an approach would make everyone in the organization tune in to what really matters. High value opportunities, revenue-rich markets, eliminating effort wherever it doesn't create value. And everyone would be selling themselves, selling others on opportunities and selling to the world.
How About Really Going Capitalist?
Image via WikipediaWhy is capitalism more productive than centralized economic systems? Perhaps its because people have incentives to make decisions that benefit the system as a whole.
Most companies make their decisions from the top down, making them more like the Soviet Union than a free market economy. But could they make a change?
I would like to see companies be more like startups internally. Employees know an enormous amount about the markets, technology and other employees that goes unleveraged when decisions are made from the top down.
I'd like to see people rewarded for the risks they take and for making decisions when their own compensation is at stake in the projects on which they work.
An important strength of capitalism is its decentralization of decision making, with commensurate risks and rewards. But traditionally companies are run from the top down, which makes slower to react and much more inaccurate when they do.
Startups do a much better job at taking risks and responding to the market. But there are advantages to scale that they cannot benefit from at the same time. But a large company could combine both with the right philosophy and information systems.
Interestingly, part of the appeal of scale comes from the tax code. Transactions between companies are taxed, but transactions between employees in a company are not, so the tax burden is lower per transaction. But often the loss of effectiveness more than swamps the advantages in size.
Saturday, November 29, 2008
Ideas are the Bomb
Image by cogdogblog via FlickrI'm currently working on a provisional patent application for this idea I have, which will make life significantly better for older people.I'm also reading a book on the topic called Patent Pending in 24 Hours. A good resource, but its taking way more than 24 hours!
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=fd78c586-a140-435a-b66c-2c5da317ccae)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=e88fbe74-ea09-45a5-8b38-028094b8f91a)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=935e7c02-4bac-44b5-a1f8-c891d080b3fd)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=cd717fd8-9e81-4195-bcb2-c01ae8955ace)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=758a357b-9e17-4fc6-aa14-f0beba72b1af)
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=bd753ce7-8e1b-4e2a-9519-7472191f138a)