RSS ? Recent Blog Posts

Blogs ยป Archive for March, 2006

Prototype Element Methods More Convenient

by Kevin Yank

Since we so recently published Dan Webb’s article on the Prototype library, it makes sense to continue tracking the evolution of the library here in this blog.

In the Prototype library, the Element object (documentation) provides a bunch of methods that operate on a specified element in the document. Here’s the list of the most notable methods from the article:

var element = $(’someId’);

// Hides an element
Element.hide(element)
// Shows an element
Element.show(element)
// Adds a CSS class to the element
Element.addClassName(element, “cssClassName”)
// Removes a CSS class from the element
Element.removeClassName(element, “cssClassName”)
// Returns true if element has the CSS class
Element.hasClassName(element, “cssClassName”)
// Returns {width: 123, height: 45}
Element.getDimensions(element)
// replaces the innerHTML of element with newHtml
Element.update(element, newHtml)

For a library designed to reduce the pain of writing JavaScript, this stuff was actually fairly verbose. But designer/developer JasonJustin Palmer has the scoop on some changes that are in the pipeline. Before long, you’ll be able to write the above method calls like this instead:

var element = $(’someId’);

element.hide()
element.show()
element.addClassName(”cssClassName”)
element.removeClassName(”cssClassName”)
element.hasClassName(”cssClassName”)
element.getDimensions()
element.update(newHtml)

Prototype’s handy $ function, which can fetch any element given its ID, will now enhance that element with the methods of the Element object before returning it to you. The same goes for the $$ and getElementsByClassName methods provided by Prototype.

The catch at …

 

SXSW – Day two, still going strong

by Ian Lloyd

One of the most problematic aspects of SXSW is knowing what to attend and what not to attend. At any given time there may be up to six different sessions that you can attend. That means each day you have to miss out on five sessions, four times over. When you’ve paid for the registration, it seems a shame to miss out on so many potentially great sessions, but that’s just how it is. This morning I had to make a choice from:

  • What’s hot in web applications
  • Respect your elder bloggers
  • Important startup decisions
  • How/why to podcast an event
  • Digitally convergent business
  • Design and social responsibility

Which would you choose? This year I’ve tried not to make a judgment based on who’s presenting but basing it on the title alone. Many of the sessions sound like some that I’ve attended at previous SXSWs or they’re simply not something that applies to me (like the startup session mentioned above), but maybe advice in that session would be good for all web sites? It’s tricky, and there’s nothing more annoying than coming out of a lacklustre session and hearing someone else raving about the one they’ve been to – …

 

Pro::PHP Webcast meets Microsoft

by Harry Fuecks

Marcus Whitney handled another podcast very coolly last Friday with MicrosoftBrian Goldfarb and Joe Stagner, covering their cross training strategy – http://www.learn2asp.net/ – and what they’re doing to smooth rough edges with PHP on Windows, as well as coining a new term: “coopetition” (but let’s just hope it doesn’t enter the Web 2.0 dictionary)

There’s one particularly surprising and insightful remark in there by Brian (if I remember right) to the effect of PHP developers being much more interested in technological “what if?” questions and getting stuff done vs. spending time on language politics, in his view. The thinking and research implied by that remark suggests a really good understanding of PHP. Taking a step back, it’s funny how much things have changed from even two years ago, of PHP being pretty much grass roots and Microsoft being “the enemy” to some level of mutual understanding. In a way this relates to something Marco Tabini said a while back;

PHP software is being commodified

Anyway – thanks to Joe for the compliment, although you kinda managed to avoid the question ;)

 

SXSW – First day roundup

by Ian Lloyd

Another March comes around, and with it another South By Southwest (SXSW). Once again I find myself making the pilgrimage with other like-minded web geeks to the web conference that really sets the standards (no pun intended) for all others.

This is my forth time attending the conference and as a measure of how highly I rate it I usually offer up this anecdote: two years ago I was taking a year-long sabbatical from work and during that time I was not earning – I was not working my way around the world, but had instead remortgaged the house to pay for the trip. Despite having limited funds, I still managed to find the money to take me from my holidaying in Australia, flying a somewhat long-winded route from Sydney via San Francisco and Denver to get to Austin, Texas. Yep, it really is a conference that justifies this kind of lunacy!

As I write this, SXSW Interactive (there is also a film and music portion for the conference) has just begun. The first day’s sessions are over and everyone …

 

How to assert appropriately

by Andrew Neitlich

Thanks for the comments to the last post, about being accessible. It seems in many responses that some readers could use a refresher (or first-time) course on appropriate assertion.

Assertion is what you do when someone oversteps legitimate boundaries — like calling you too much, being too chatty, or not being available or responsive.

Rule #1 about assertion: If you don’t say anything, no one will know that you have a problem. Lots of smart people let things boil up inside, never say anything, and are really just helpless victims. You have to — as we tell our 4-year old — use words.

Rule #2 about assertion: If you assert too hard, you end up coming across as coercive and you hurt the relationship. Be careful not to make threats, get personal, insult the other person, have an angry tone of voice, etc.

Rule #3: There are ways to assert and be appropriate and keep the relationship in tact. This goes against the upbringing and cultural style of a variety of people, who tend to violate rule #1 all the time. Look at your own values and what keeps you from asserting.

Here are some “scripts” to use when asserting:

- I have a request….Could you….?

- …

 

What won’t be in PHP 6

by Harry Fuecks

Pierre-Alain Joye picked this one up last week, and it needs repeating. For PHP6 the following are already gone from CVS:

  • Register globals
  • Magic quotes
  • Safe mode

As blogged a while back, you’ll find these changes discussed here. Nice use of carrot and stick in fact – for the pain on fixing your apps to run under PHP6, you get Unicode.

Update: just noticed a new ini setting here;

allow_url_include “0″ PHP_INI_SYSTEM Available since PHP 6.0.0.

Excellent! That eliminates another major source of exploits (perhaps the biggest) – have moaned about that before here and here

 

Be accessible

by Andrew Neitlich

Just a quick reminder: Be accessible, especially to clients.

There is nothing worse than trying to reach a professional with a full voice mail box or who takes more than a few hours to return a call.

Give your clients a way to reach you with requests or emergencies. They expect it.

 

Zend Framework 0.1.2 released

by Harry Fuecks

Another update, because this release contains some notable additions, namely unit tests (needs PHPUnit2) and the all important controller documentation. There’s a release announcement here.

Also, perhaps a sign of things to come, part of the docs have been translated to Chinese and some developers working at Telekom Austria have offered to provide some mail reading libraries.

 

Why you should stop coding and designing right now

by Andrew Neitlich

Many Sitepoint readers ask how they can build a firm that is worth something, that has employees, that lasts longer than their participation in it — in short, a firm that they can sell.

Here is how to do it:

Stop coding. Stop designing. Stop being an employee and start being a firm builder.

That’s it. Imaging what happens next:

- You have to find low-cost, high-quality resources to serve clients. You become an expert on finding great talent.

- You have to develop a consistent methodology to get results for clients (e.g., clone yourself and what you used to do).

- You spend your time marketing the firm and putting in place processes and systems so that the company runs without you.

- You insert yourself when needed to provide expert guidance, set standards, and build the culture of your business.

Get clients, get talent, and support talent so that they delight clients: That becomes your new job.

It’s not easy, first of all because you may need some financial reserves while you build your firm. When you are not working in the business, you give up revenues. Also, you need to be smart in how you grow — doing it step-by-step instead of investing foolishly in full-time …

 

Zend Framework Tutorial

by Harry Fuecks

Seem to be spilling links today. Anyway – via the Zend Framework mailing list (subscribe to fw-general-subscribe _at_ lists.zend.com), the first full tutorial, written by Chris Shiflett, is online at http://www.phparch.com/zftut/ and the corresponding code is available here (.tar.gz). Provides a gentle introduction.