Mac cheaper than Dell

I’m getting ready to replace my Dell Latitude D420 laptop. I love it. It’s very light, very portable, has an extended battery that gets 3-5 hours of life. If I could change only two things it would be a slightly larger screen (or more specifically, a slightly lower DPI) and a standard dual core cpu rather than the ultra-low voltage (ULV) dual core cpu. Dell and Apple both offer a computer that meets my requirements but to my surprise, the Apple is cheaper almost identical (corrected, see below) .

In Dell’s line of computers the natural upgrade path is to the Latitude E4300. Base model with 2GB RAM, 160GB Hard drive and a 3 year warranty + additional 802.11n, webcam and bluetooth is $1,409.

These add-ons to the dell give it near feature parity to the new Mac Book Pro 13 inch which sells for $1,199.

Do you get anything for the additional $210? Well, the Dell is 1.2lbs lighter, or 26%, which is nice. You also have the availability of a docking port and accidental damage warranty. The Apple has a backlit keyboard, a better video chipset and a multi-touch trackpad. The Apple also gives you the ability to develop iPhone and iTouch applications. I’ve heard it will be unlikely to see this capability ported to Windows, so that may be a big selling point.

The good news? Ubuntu works well on both computers. :-)

Correction - the Dell has a 3 year warranty, the Mac has only 1 year. You have to add AppleCare which makes the Mac about $40 more expensive to bring it to 3 years. But that also gives you technical support which is an add on for Dell, which brings up the cost of the Dell a bit too, I think giving the Mac about a $50 advantage. All of this is a moot point because it used to be that there was a 30% price premium for the Mac and now they’re too close to call.

Two essential books every web dev should read

My brother is applying for a jr. web-dev position so I was thinking about what tips to give him. That thought process lead from one thing to another and I realized that two of the most influential web-dev books I’ve read are not ones that would normally jump out at you. These are not replacements for a good HTML or JavaScript book, these are a bit more high-level. No matter what your development expertise (front-end, java, php, ruby, etc) these books will each take you up a significant notch in your web-dev skills and will set your web-applications way above the norm.

RESTful Web Services by Leonard Richardson and Sam Ruby

From the title you might think this is just another book about web services. You would be so wrong. This book is about HTTP. Doesn’t that sound far more exciting? :-) Actually, this book provides the reader with a great understanding of how the web works by looking at the interaction between a web-client and a web application (i.e. a web service). Think of it as seeing how to surf the web without a web-browser. By understanding concepts such as statelessness (which a lot of web applications don’t get right), http response codes, cookies, authentication and request headers you’ll be able to create web applications that work robustly, are search engine friendly, and are very web 2.0 friendly (mashups, json, xml, etc). Get it. Oh, by the way, Leonard is a co-worker of mine but I didn’t know that when I bought the book. It’s always fun to order a book and then see the author and go, “oh hey, I know that guy!”

Mastering Regular Expressions by Jeffrey Friedl

Until you learn them well, regular expressions seem like magic. If you don’t know what they are, the short definition is “powerful, flexible text patterns for doing complex find or find and replace operations.” After finishing the second chapter of that book I was able to do things with a few lines of code that made other developers think I was a programming god. Want to strip all the html attributes from some markup except the a href and img src attributes while leaving the tags in place? Wish you could get a list of hrefs in a page that link to local resources? Separate CSV data? All easy with regular expressions. But the benefits go far beyond the actual results. Since most developer’s editors support regex syntax you can be more productive or use Unix command line tools to find files.

OK, those are my two major recommendations. Anyone who calls themselves a web-dev will find them a great read. If you know others, leave suggestions in the comments.

A few final recommendations

Oh, before this article ends, here are some other books that I found to be greatly influential to me. They lack the universal appeal of the previous two books though:

  • Danny Goodman’s JavaScript Bible (I own the 3rd edition, a lot has changed since then though)
  • Danny Goodman’s Dynamic HTML: The Definitive Reference getting old but a great reference covering HTML markup, CSS and essential JavaScript techniques (I didn’t realize it was the same author as JavaScript Bible until just now. ;-))
  • Eric Meyer’s CSS: The Definitive Guide Great CSS book by one of the masters
  • Roger Parker’s Looking Good in Print perfect introduction to essential design techniques. There is a reference for the web but it’s not as good as the print version imho.

I own (or have owned) and read cover to cover all of the books mentioned above. And yes, despite the long list, there are numerous books that I have owned and read that I didn’t feel worth mentioning. :-)

Cutting Pizza Asymmetriclly

I’ve invested a non-trivial amount of thought and research into the optimal way to cut a pizza for a small family and have come to the firm conclusion that in most cases cutting asymmetrically is the best.

By this I mean that I now deliberately try to cut the pieces so that they are not the same size. There are some instances where this is not the best route but for a typical family dinner it works out ideally.

Imagine a family like this, a husband, a wife and two kids that are not the same age. We’ll use some stereotypes here which of course are not valid some times but it will work to make my point.

In such a family you could imagine that the father would have a slightly bigger appetite than the mother, who would have a bigger appetite than the older child who would have a bigger appetite than the younger child.

If you cut the pizza symmetrically then the youngest child may not be satisfied with a single piece of pizza but would be unable to eat a full second piece, causing waste. Likewise, the older child may be able to eat a little more than two but not three. You can see where this is leading. There’s nothing a hungry dad likes less than seeing partial pieces of pizza go into the trash.

So take a look at this picture:

Asymmetric cut

The father, who in our example has the biggest appetite, would take pieces “a” and “b.” The mother would take pieces “c” and “h.” The older child would take pieces “d” and “g” while the younger child would take pieces “e” and “f.” Everyone gets two pieces yet everyone gets a portion that is satisfying to them.

Brilliant, yet simple, eh? Well, there are two things that can go wrong that I should warn you about. First, if you’re feeding a group of kids it is important to not use this technique - instead go for perfect symmetry. If you don’t know why this is important then you probably aren’t a parent. Trust me, symmetry is ideal.

Second, you may have several people with similar appetites. For this group I’ll suggest an alternate solution, the “restaurant cut.” This cuts a piece into more, but smaller pieces. See the image below:

Restaurant cut

This is a bit unconventional compared to common pizza delivery methods but it has numerous benefits:

  • Some people don’t like crust, they get an interior piece
  • Some people love crust, they get an outside piece
  • Pieces are smaller so people eat more pieces
  • Smaller pieces decrease the chance of waste
  • Works great if you have a variety of pizzas and people want to try a little of each

It is scary to consider but I’ve actually been working on this for years. Despite this I’m sure that there are people with other experiences who can contribute, please leave comments to share your insight.

Can ads boost your credibility?

OK, the previous blog post was on site credibility, lets continue on that theme for another post. This may seem off-key but follow with me. If you see a woman join a group of attractive women you will formulate an opinion of her. If you see a man join a group of other men who look like they are of ill repute you will probably hold him in a similar low regard.

We have a tendency to make assumptions based on association. I’m no psychologist but I’ve seen enough sitcoms to know that it’s true. The saying is that birds of a feather flock together, right? But how does this relate to your website and what does it have to do with ads? I’m glad you asked.

First, let me clarify that there are several kinds of ads. Anyone in the world can get Google Ads. Showing them on your website is kind of like hanging out with a woman who is wearing a sign that says, “you too can date me for only $20.” Again, I apologize profusely for the off-key illustrations, I can’t think of a better way to describe it though. The point is that you’re not going to boost your credibility by showing these kind of ads. If all you want is money then go for it, I know numerous people who make good income from Google. We’re not talking about income though, we’re talking about credibility. Same goes for your run of the mill random, untargeted banner ad service which is pretty much extinct now days.

Another kind of ad is contextual affiliate ads. For example, Get Rich Slowly uses these. They recommend products that they actually like and they get affiliate commission for them. These, in my opinion, are my favourite kind of ad. However they too are not going to boost your credibility in large part because they don’t look like an ad.

That last kind of major ad I want to talk about is, for lack of a better description, “elite ads.” These are ads that are high quality attractive ads and feature high end services. They typically avoid animations and other annoyances and often look hand picked to fit the site and the site’s content and the site’s typical visitors. They probably don’t advertise in-house products. And most importantly, they’re not going to be run-of-the-mill ads that you see just anywhere.

I’m going to postulate that well placed, well designed and well targeted ads can possibly boost your site’s credibility. Just like you might associate a person’s reputation or attractiveness with the company they keep you might also associate a site’s credibility by whose ads they show. Here is an example:

Example site with ads

(I may replace the above image after some more searching, for now a web design site is shown)

Thoughts? Examples to either support or disprove this?

At a glance credibility - link to content ratio

Have you ever mis-typed a domain name and been taken to one of these parked sites filled with links? It only takes you a fraction of a second to tell you’re in the wrong place. I’m not talking about porn, gambling or pop-up laden websites, just these squatter-style parked domain web pages with tons of links. Sometimes I’ve come across sites that are legitimate sites but my first thought is, uh-oh, I mis-typed, I hit a parked domain site. This is because something intangible about the site’s homepage is communicating that the site doesn’t really contain any information.

I’m going through a bit of a mental exercise to try and understand what about a site gives it instant credibility. What makes a site say to a person in the first fraction of a second, “you’ve found a real site, there’s good stuff here.”

I think there are a number of factors but the one I’m thinking about right now is the link to text ratio. That is the number of links a person sees in proportion to content. For example, see this screenshot of the free bsd homepage:

freebsd homepage

To my eye it feels like they’ve crossed the line where there are too many links. If it weren’t for the recognizable demon I’d probably have hit my back button without a second thought. (This shows that there is more than just this theoretical “link to text” ratio involved in the credibility of a site, but more on that later)

But then look at a site like Yahoo:

Yahoo! homepage

It has far more links than the freebsd site does. But there are differences:

  • When you go to Yahoo! you expect to see a bunch of links
  • Yahoo! does not use underlines
  • Many of the links on Yahoo are buttons or graphics

I’d love to hear your thoughts on the subject. What other elements give a site credibility? Is there something about the graphic design, the colours, the domain name or the layout that you can do to help?

Awesome creative commons images for your website

Finding awesome images to use for your website can be a challenge. However with this little trick it’s quite easy to find exciting, fresh images that have creative commons licenses allowing you to publish photos on your blog or website (as long as you give attribution to the artist and don’t use them for commercial purposes - see the image’s license for details, but the trick I’m demonstrating here only includes CC licensed images that allow derivative works). Total time to find and add an exciting image to your blog post is 2 - 3 minutes.


The Scoble Show” by Thomas hawk

Create a bookmark and add the following code as the link for the bookmark:

javascript:void(location.href='http://www.flickr.com/search/?l=deriv&ct=0&mt=photos&q='+encodeURIComponent(prompt("Search%20Term")))

Or drag this link to your bookmark toolbar Flickr CC.

Then when you click the link or bookmark you’ll be prompted to enter a search term. I get the most interesting results when I limit my search to one word.

On the search results page you’ll see a listing of images, click the thumb nail of an image you like. Right above the image you’ll see a link that says “ALL SIZES” which shows you the available image sizes and the license for the image. Confirm the license is OK with you, then grab the largest image size and download it to your PC. The image name by default looks like this:

253375694_718b7fb386_o.jpg

The image name can be used to find the path to the image later on. For the image above just search for “253375694_718b7fb386_o” and it will bring you to the correct place. (The “o” in the image name means “original size.”)

Despite this I still give my images a more meaningful name. Sometimes I use the image name + author’s name + original name, other times I use search term + original name. So for example, “The Scoble Show by Thomas Hawk 253375694_718b7fb386_o.jpg” or “photos 253375694_718b7fb386_o.jpg” (because I searched for the word photos and found this image).

I like to go to the extra step of bringing the image into the Gimp or whatever your graphics editor is and do some interesting cropping on the image. Have fun, I’d love to see what you come up with, share your links. :-)

Beagle Board vs. Hammer

The Beagle Board is getting a lot of attention lately. It should, it’s an awesome platform. How does it compare to the Tin Can Tools Hammer (discussed in a previous blog post here)? Well, the Beagle is faster and cheaper for one thing, it also has excellent video and audio output capabilities. But that doesn’t necessarily make it better. It all depends on the application.

If I were wanting to do something like port Ubuntu to Arm and develop or test desktop apps on an ARM based computer, I’d chose a Beagle Board. However the Beagle just doesn’t have the i/o ports I’d want if I were doing embedded hardware/firmware development. The Hammer fits into a standard 40 pin dip socket and gives tons of i/o flexibility so I could do things like build a wifi connected robot or run a CNC.

As a matter of fact, imagine that: Run EMC on the CNC itself! I’ve not heard anyone discuss this but it would be a cool idea. Just plug a wifi usb card into your CNC machine and send jobs by email or the web. Or maybe it could appear as a network printer and you hit the print button from eagle and it spits out a circuit board (far fetched, I know). It would be entirely possible to use something like the Hammer and interface it to your FETs and a nice power supply and have it control your motors directly (assuming EMC ports cleanly to ARM). However a Beagle would need to use a serial port and a traditional microcontroller based motion controller to do the same.

Alas my hardware hacking free time is becoming quite infrequent. Therefore there’s no way I’m going to pull off anything like the above. You folks will have to try it and tell me how your hacking goes. I’d love to see what people are doing with clutter or android on the beagle or what kinds of cool hardware apps you’ve rigged up to the hammer.

By the way, for some reason I’m getting thousands of hits to my blog in the last couple weeks for the Hammer Board blog post. I wonder why…

How do you explain fair use to little children?

My seven year old son doesn’t know it yet but he’s getting an MP3 player for Christmas. This is cool and I’m glad he’s enjoying music. We’re listening to all kinds of music together, from Chopin and “Hiding” (Haydn) to Beastie Boys and Daft Punk to Alicia Keys and Brian Setzer to Rich Mullins and Barlow Girl. (Basically we’re getting a variety)

Now we have a difficult issue to address: fair use. While he has a CD player on his computer that kind of defeats the purpose of having a portable music player. Therefore it makes most sense for him to use his computer to download songs onto his player. We have a variety of CDs in our personal collection (most already ripped and ready) but what about when he wants to go looking for other music? I envision three scenarios:

  • A friend brings a CD over for him to listen to
  • Checking out music CDs at the library
  • Looking for songs on the Internet

I personally disagree with the concepts of DRM and restricting what you can do with music you acquire legally. I kind of ride the line because I also agree with paying artists (and their labels) for producing music and don’t agree with the idea of circumventing that process. (The library issue is an interesting side-issue)

I’ve seen this problem on the horizon - earlier this fall I saw him playing a game I’d never seen before. Apparently a neighbour brought it over to play and he found out after she left the game still worked without the CD.

I’m really torn, do I tell him it’s wrong to listen to music when he doesn’t have the CD in his possession (or personally purchased and downloaded the music, or the music is distributed for free, or …)? The rules are complex and I don’t fully understand them and I’m not sure I agree with them. And how does the library case fit in?

What do you do? If something is wrong and I don’t correct him them I’m basically teaching him it’s not wrong. I definitely disagree with the idea of teaching him something is OK that isn’t.

Do It With Drupal in review

Please let me know if you find errors in this document or if you’d like me to add clarification. These notes are based on my hearing of the conference sessions and it’s entirely possible I mis-understood the speakers or in the heat of the moment a slight error was communicated.

Drupal is the software we use to manage our main websites. Last week while UDS was happening I was able to attend a training seminar in New Orleans, Louisiana called Do it with Drupal to learn how to better make use of this platform. It was a powerful training program and I came away with a wealth of information that will help us in the future.

This report is quite long because I know that a number of people will be interested in the various parts, so I’ll start with a one-page summary:

My Goals for This Seminar:

  1. Make it easier to delegate tasks to others
  2. Simplify common tasks for users creating content
  3. Evaluate the process of upgrading to Drupal 6
  4. Learn about Acquia, a professionally supported version of Drupal created by the Drupal founder and various other core developers

Nutshell:

  • Drupal 6 is a major improvement, in large part because a significant amount of time was spent re-architecting key add-on modules such as views and CCK.
  • Future Drupal upgrades will not be as challenging because the key modules will not go through this same upheaval in the foreseeable future (I go this from the mouths of the CCK, Views and other modules developers)
  • My observation is that Drupal developers are focused on the needs of integrators more than end users - this makes it a powerful tool with a wealth of APIs and add-ons, but it is still a challenge to use it as an end user CMS
  • There are some major sites doing some cool stuff with Drupal - Sony/BMG, Warner Brothers and a few newspapers were demoed
  • We at Canonical are using only a tiny subset of the most basic features - I can see some great benefits for us if we adopt some of the more advanced Drupal functionality. Potentially this could allow us to have fewer websites, manage content more efficiently and do some things we can’t do now.

(by the way, this last week the BIS team at Canonical released an open source plugin that allows drupal websites to authenticate and get group information from Launchpad)

Key Modules:

Some of the powerful applications demoed relied on a few key modules, namely:

  • Views 2
  • CCK (aka Content Construction Kit)
  • Flag
  • Advanced Help
  • Image Cache (powerful image uploading/resizing)
  • Numerous CCK related fields
  • Panels (Currently still relies on Drupal 5, same author as Views and Views2, he is now focusing his efforts on updating this powerful module)

Other interesting modules were:

  • Organic Groups
  • Workflow
  • Revision Moderation (combined with workflow eliminates the need for a staging server)
  • Date and Calendar (to replace event)
  • Admin Menus (when logged in gives quick access to admin function)
  • Markdown (wiki syntax for drupal)
  • Developer Module
  • Boost - big performance boost for sites with mostly anonymous traffic

Also, someone said I should check out “Selenium macro recorder” to record web-browser interaction and then re-play it later. Sounds slick.

/end one page summary

Session breakdown:

Keynote by lullabot, seminar organizers:

Drupal is not just a CMS, it is a framework for building web applications (as discovered later in the program and outlined below many of these can be built with no code).

Drupal’s flexibility comes from its lack of assumptions, which is makes it less usable.

The last 10% of a project (the polish) often takes 90% of your time - not a surprise to many of us.

Use the code “DRUP4” on O’reilly website to get a big discount on the new Drupal book soon to be released (I believe called “Using Drupal” co-authored by Angela Byron - supposedly teaches by walking through building several drupal websites).

Good explanation of open source philosophy including referencing how Sony/BMG sponsors a lot of Drupal development which often directly benefits Warner Brothers, their major competitor, who then feeds testing and bug reports back. (don’t tell the PHB’s)

How we built Twitter with Drupal (Drupal fantasy site)

http://www.doitwithdrupal.com/sessions/how-we-built-twitter-drupal

Goal, build a twitter clone with Drupal

  • Don’t really make twitter with drupal
  • It’s like blogging but you only post the title
  • Ruby on Rails is lighter weight than drupal (but D has more features)
  • Completed in 24 hours
  • Views 2 module with 5 views total
  • Flag module for following users and favorite posts
  • About 200 lines of PHP needed, mostly to tie loose pieces together including the user information block
  • Page title module
  • Only one content type - custom - only contains body
  • Custom page.tpl.php
  • Form api gives validation for free
  • Drupal builds up info and then pushes it through the theme which only shows the parts it wants (contrast to other systems where the theme calls functions to build the dataset)
  • Templates - page, page-node, block, node, views-table, views-fields
  • “posted x min ago” done with “Format interval function” “time ago” in date format of views

Acquia info session

Acquia does for Drupal what Canonical does for Debian / Ubuntu - creates a commercially supported version and gives it away for free but adds value (including a nifty administration interface) for those who want to pay for commercial support.

Started by Dries Buytaert, creator of Drupal, accompanied by several core drupal contributors.

Includes Mollom, advanced spam blocking solution that passes good comments and prompts with a captcha for suspicious comments. Offers hosted search that is better integrated into the site’s unique features than a custom google search box but much more powerful than Drupal’s built in search.

Web, phone or email support available depending on pricing tiers.

http://acquia.com/

Flickr with Drupal (Drupal fantasy site)

http://www.doitwithdrupal.com/sessions/how-we-built-flickr-drupal

Goal, clone Flickr using Drupal 5

  • Modules: Views, Panels, Image Cache, Swif uploader (for multi upload)
  • Panels of views
  • Blocks and panels can be combined
  • Blocks are best when they will be on multiple pages across the site
  • Blocks can only be positioned in one place (you can’t say, “on this page put it here, on that page put it there)
  • Panels can put blocks anywhere and can re-use any existing block
  • Panels can pass special arguments into views and can accept args
  • Views for gallery listing, don’t use image module, use Image field (for CCK) instead - image node is rough

Basecamp built with Drupal (Drupal fanatasy site)

http://www.doitwithdrupal.com/sessions/basecamp-built-drupal

Features:

  • Write board is kind of like a wiki / blueprint
  • Milestones are calendars / events
  • Todo list
  • Messages
  • File uploads
  • Chat (not implemented, felt it was superflous)
  • People and roles/permissions
  • Projects

Uses:

  • Organic groups (for projects)
  • OG Access control ?? for project privacy
  • File uploads = CCK + file field
  • Todo lists = CCK + flag
  • Wikis = CCK + Markdown
  • Calendar = Date + Calendar

  • File field has advantages over Upload (Upload is scorned pretty much across the board during the seminar for being messy and simplistic), configurable by filetype

  • Flag is awesome - it provides a toggle on/off for everything
  • Date is better than event (also scorned severely)
  • Zen is a good base theme that can be styled through CSS alone (no PHP needed)
  • Subscriptions & Notifications framework
  • CCK lets you have node references like foreign keys
  • Core profile module allows you to add fields to users
  • In a view an “attachment” is a sub-view
  • The API hook “form alter” lets you modify forms

Get satisfaction keynote by Lane Becker

(regarding community building, one of the tracks for the seminar)

  • People are fun, radical and interesting. Building tools for them is fun, radical and interesting
  • “It’s broken until it’s done.”
  • The role “Community manager” is very broad and not very specific, kind of like webmaster
  • When starting his company he picked a picture from flickr (creative commons license) that he felt identified the personality of his company
  • Twitter’s imagery (and corporate identity) is built in and evident through and through
  • “Myspace is so far beyond sell-out. I guess when you start at sell-out and keep going where do you end up?” (regarding that they have ads for their background images)
  • “You’re all jerks” (to the audience, then a minute later) “Number one rule, don’t get up on stage and call your audience jerks. What was I thinking?”
  • The difference between a church and a stadium is the design - it communicates to people what the expectations are
  • Dogster founder realized in week 3 that he wasn’t in charge of his site anymore (the community was)
  • BIG GOAL: What is your purpose, what kind of community are you building?
    • Who belongs? Persona - describe the ideal community member
    • Who doesn’t? Who are you trying to keep out?
    • Building a leader board says competitive (cf: Digg)
    • Outline your expectations
    • What does success look like?
    • Look for metrics that will accurately measure success

Content Construction Kit (aka CCK) by Karen Stevenson

http://www.doitwithdrupal.com/sessions/content-construction-kit
Karen is the author of CCK

  • Use CCK instead of views when the extra bit of data is integral to the data, for example the “Artist” field for an album.
  • Strongly suggest “advanced help” module, CCK uses it extensively
  • Only use shared fields selectively - Use new fields unless necessary
    • For example, a phone number field shared between “company” content types and “person” content types allows you to create a view of phone numbers
    • Shared fields let you set up views that have an exposed filter that can show multiple content types
  • Node reference is very powerful
  • Advanced help for CCK includes docs for themeing (I looked at this on the airplane home - it indeed is very powerful and helpful)
  • Contemplate (??) module (??) is a template editor
  • Templates are used to theme CCK content (see advanced help for suggested file names for your templates which allow you to have great control over the look of your content. Once demoed you’ll see that this is very very powerful at creating custom web applications with no code.
  • Diff module integrates nicely with CCK so you can compare one revision to another
  • devel_generate (??) is a module which fills your site with sample content (useful for themeing)
  • Computed fields are very powerful
  • Leave CCK permissions off until your site is created or you may not see the fields you create - fields without permissions cannot be viewed - i.e. default to hidden
  • Content types can be exported and imported
  • “Node save” to create nodes automatically (??)

Basic Views (Views2) by Earl Miles

http://www.doitwithdrupal.com/sessions/basic-views
Earl is the author of Views and Panels

  • Views don’t need to be in a database, they can be created in a module
    • Sidenote: Many bigger sites (ubuntu.com included) have a module of site-specific functions - you can put your views into these modules and track them with version control
  • Overridden views are code based views that have been modified for the local site
  • There are three questions:
    1. What to display? (also include fields for sorting and filtering even if hidden)
    2. How do you want to display it? (default is unformatted)
    3. Additional display options: feed, page, block, attachment
  • When looking at fields on the Views page italicized means default value, bold means overriden
  • IMPORTANT: You haven’t changed anything until you hit “SAVE” - refresh if you leave the page and come back and you think you’ve lost your data since the values are stored in your session before saving
  • View name must be machine readable - description should be human readable
  • You can export your views and put them into code (aka your site’s custom module)
  • Views is just an SQL query builder and shows you the SQL at the bottom of the page so you can modify it or optimize it when putting the view into a module
  • Data does not have to be in the same database as your drupal site - it can be in any database the drupal site has access to but it must be in the same type of database (i.e. MySQL sites can use any MySQL database) - this could allow one site to syndicate content from another
  • Modules to investigate: Node que, views bulk operations, views bonus pack, views data source (jsonp, xml)

Organic groups

Looks powerful but I skipped this because it looked like something I won’t need right away. There will be a video I’ll watch down the road.

Jquery by John Resig

http://www.doitwithdrupal.com/sessions/powerful-interfaces-jquery
John is the author of jQuery

Session was mostly the absolute basics, though I did learn stuff about chaining and some shortcut functions.
#(‘form’).submit() adds a callback to the form (for validation, etc), it does not submit the form.
#(‘#somediv’).load(‘file.html’) grabs the body tag of the file file.html and inserts it into #somediv
#(‘#somediv’).load(‘file.html h2’) grabs the h2’s from file.html and inserts them into #somediv

Check out “theme roller” for jquery ui - gives you a gui to customize the themes for the jquery ui components

To clarify the meaning of “this”:

$('a').each(function() {
    this = '<a>'
    $(this) = [<a>] (a jquery set containg the current <a> tag)
    $('this') = [] (an empty set because there's no <this>)
});

Talked with John outside the session, he’s working on “Sizzle” which is a high performance and library independent selector library. All the tools (jquery, dojo, yui, etc) have basically standardized on a selector syntax but each have their own implementation. Sizzle will be able to plug into any of the tools and many of the major libraries are planning to integrate it (dojo, yui, jquery all mentioned I believe).

Themeing by (I won’t say who)

What a train wreck. I learned little. Poorly organized, poorly planned, poorly presented. Here are my notes supplemented with some info I picked up elsewhere:

  • Fine-tune your data’s appearance and presentation in properly named .tpl files in your theme folder. For example, node-story.tpl.php. Views’ and CCK’s advanced help menus will tell you what to name your tpl files and even give you boiler plate code to paste in and customize.
  • There’s a module called devel module that gives you a firebug-like interface where you can click a section of a page and it will tell you what to name your .tpl files to override and what functions where used to produce the output.
  • In Drupal 6 there are pre-process functions where are supposedly quite powerful
  • For a bare-bones theme check out hunchbaque

Multimedia Handling by Nate Haug

http://www.doitwithdrupal.com/sessions/media-handling
Nate was another awesome presenter, however this topics scope was quite broad so we didn’t get to cover nearly enough info.

Tail end of the session was a presentation by Kaltura which demoed an awesome web-based tool that allows you to create your own video mashups from stock media, media you upload and even directly from a web-cam connected to your PC: http://drupal.kaltura.org/

  • Image / Video / Audio modules are pretty much DEAD
  • Use CCK / Views2
  • Drupal 6 has improved things a lot
  • Don’t use the upload module (he said this quite emphatically)
  • Image galleries can be easily created with CCK / Views / Image field / File field / Image cache / Image API / Actions
  • Image cache was especially interesting. I was concerned about performance, talked to the guys doing the performance session who assured me that it was well thought out and implemented so that heavy caching was done
  • Image cache module basically resizes or adjusts images on the fly in the browser. Quite powerful and has add ons for doing a multitude of adjustments beyond resizing, cropping and titling that is built in.
  • Audio - CCK / Views / File field / file field podcaster / SWF tools / 1 pixel player
  • Video (self hosted) - CCK / Views / File field / SWF tools / JW Player or Flow Player
  • Video (offsite / youtube) - CCK / Views / Embedded media field / SWF tools / JW Player / Flow player
  • Transliteration module very useful for generating url friend file names
  • Image resize filter - resize images for IMCE (a multi-purpose uploader that does not use CCK)

Things to look into: What is Red 5 (something to do with recording video using flash and a webcam)?

Advanced Views by Earl Miles

http://www.doitwithdrupal.com/sessions/advanced-views
Earl is the author of Views and Panels

  • Related fields - foreign keys
    • I asked if you could add values to the related fields list while creating or editing content - no, not at the moment
  • Arguments can be passed into views, for example from the URL or logged in user id, used for filtering etc - cannot be used by blocks
  • Validator can check args before passing into views
  • Summary view - for views when an argument is left out - for example if you have a view that shows up at somesite/events/2009-01-01 then a summary view can be shown at somesite/events/
  • Themeing - see advanced help for template (.tpl) file names for fields or views - more specific names will override templates with less specific file names
  • CCK fields, especially multiple or shared fields impact performance
  • You can add indexes to the database tables to improve performance (CCK fields don’t get indexes by default I believe) but be careful, sharing a field changes the DB structure so you may need to recreate your indexes when sharing a field
  • Views shows the SQL - use explain to learn how to optimize
  • Attachments allow you to combine multiple views on one page
  • Views calc (??) is a module that allows you to do summing / totaling at the bottom of a view (imagine a table of values)

Dates and Calendar by Karen Stevenson

http://www.doitwithdrupal.com/sessions/date-and-calendar
Karen is the author of CCK and the Date and Calendar modules

  • Date widgets (of CCK) can be in different formats, Karen prefers ISO format (aka 2008-12-15), can be input as:
    • text field
    • select list
    • calendar pop-up
  • Use the calendar module
  • Recurring dates is in transistion, you can use:
    • repeating date field
    • a date field with multiple dates
    • date field with multiple values (this wasn’t clear to me but hopefully some experimentation will enlighten me)
  • Export ical is done and working nicely
  • Import ical is hard but improving steadily

(Sorry, at this point of the conference my brain was getting tired)

Performance and Scalability by Matt Westgate and John VanDyk

http://www.doitwithdrupal.com/sessions/performance-and-scalability

  • Use mod_expires (for apache)
  • CDN can help
  • Boost module for drupal serves content as static for sites with mostly anonymous users
  • Opcode caching like APC or xcode
  • Query caching (a MySQL setting) can have a big impact
  • mem cache is a BIG WIN - look for the memcache module
    • puts sessions table into memcache
    • puts url alias table into memcache
      (from my experience, using mysql and default myisam table there can be a lot of contention for the session table - I can see this being a big win)

Apache

  • Properly adjust maxclients (simplistic formula, see how much RAM an apache child uses then take total ram (not counting swap) you can allocate for apache and divid by the amount used per apache child and use this value for maxclients - setting too high hurts performance as your site gets busy
  • Keep alive on, time out 2

PHP

  • Opcode cache APC / Eaccelerator / xcode
  • max_execution_time 60
  • max_input_time = 60
  • memory_limit = 75 - image cache benefits from extra ram

Drupal

  • More modules make the site slower
  • When writing code, unset() on large views frees up memory

MySQL

  • in ini file, [mysqld] query_cache_size = 32m
  • [drupal] Views are SQL queries, use explain to help optimize them
  • Log slow queries and hand optimize them

Cron

  • Keeps the database clean

Caching tweaks

  • Aggressive cache (setting in drupal)
  • min cache lifetime
  • CSS preprocess (there’s something called aggregator that combines css files and also javascript files for fewer http requests)
  • A JS/CSS compressor is in works for D7

For Devs

  • use cache_get() and cache_set() for storing values in a cachable way

If using NFS (and many large sites do use it) make sure the PHP upload dir is also on NFS

Final Notes and Thoughts:

  • When upgrading from D5 to D6 read and follow the instructions, especially for CCK.
  • There’s no upgrade path for views/image field.
  • You can use the combination of Workflow and Revision Moderation modules to remove the need for a staging server. Instead, create content on the live server and have a manual review process to publish changes (even changes to existing pages) live when ready. Assign the ability to publish to different roles if so desired.
  • Blocks are not versioned, someone suggested using views to create blocks that are versioned (research needed)
  • Remarkable by its absence was any kind of discussion on security
  • Based on the discussions, end-user usability is not high on the priority list of developers. The target audience is technical integrators and people who are willing to RTFM. The only person who mentioned usability in the sessions I was in did so while making an erroneous (or at least contestable) statement about usability - specifically that users find a single check box more usable than radio buttons offering the option of yes / no for a boolean value.
  • When asked during the wrap up multiple panel experts laughed at and mocked the idea of it being a good thing to offer users a WYSIWYG editor. This is on the podcast at http://www.lullabot.com/audiocast/podcast-67-diwd-08-live (if you care to listen to a 57m podcast). A panel expert literally said that we should teach our users HTML if they want to edit content on the site. I was very disappointed at this statement - I spend a significant amount of time helping users and it would be nice if I could spend less time helping them and more time doing the stuff that can’t easily be delegated. Despite the lack of interest by those at the conference there are good wysiwyg options available and their support is being improved on via the “wysiwyg module”.
  • I feel I accomplished all my goals though the first two listed were realized better via my conversations with other users rather than developers. Jeff Eaton of Lullabot was especially helpful at discussing technical topics relating to deploying content across sites and Mark Jarrell of Jones Knowledge Group demonstrated what he’s doing to solve this problem (workflow + revision moderation modules).

Thanks everyone!

from cmsInfo on Wed, 2008-12-17 01:08

Your story was featured in cmsInfo! Here is the link to vote it up and promote it: http://www.cmsinfo.org/News/Do-It-With-Drupal-in-review-Bearfruit

Firefox autocomplete meme

OK, I’m making my own meme, though I’ve not googled it, someone may have come up with it before me.

  1. Click in your firefox address bar,
  2. delete what’s there,
  3. type the letter “w” and list the first four or five entries that firefox suggests

(feel free to use whatever web browser you like if they offer the same functionality)

Mine are:

  1. Google Analytics - www.google.com/analytics
  2. Canonical Homepage - www.canonical.com
  3. Netbook Redirect Page - www.canonical.com/netbooks
  4. Bearfruit.org comments moderation page - hidden page on this site
  5. Ubuntu.com homepage - www.ubuntu.com

Post yours in the comments or a link to your blog post that continues the meme.

Using session tokens with google's AuthSub python api

If you’re a little frustrated with the API docs for the gdata python api I’m right there with you. I’m trying to build a django app that accesses Google calendar. The basic “hello world” stuff works fine but when I want to actually use it for my own app I get frustrated. For example, the doc explains how to deal with authsub tokens but doesn’t really tell you about what to do with session tokens. Finally after banging my head on the wall a few times I figured it out.

First you have to get a one-time use authsub token. This is pretty clear from the docs linked above. The tutorial’s example code looks like this (authsub_token is probably set from the ?token=… GET param):

calendar_service = gdata.calendar.service.CalendarService()
calendar_service.auth_token = authsub_token
calendar_service.UpgradeToSessionToken()
feed = calendar_service.GetCalendarListFeed()
for i, a_calendar in enumerate(feed.entry):
print '\t%s. %s' % (i, a_calendar.title.text,)

You probably want to store your upgraded session token in a database so that you can access the feed later. To do that realize that calendar_service.auth_token now contains a new token, different than what was previously in your authsub_token variable. Store this in your database and the next time you instantiate gdata.calendar.service.CalendarService() set auth_token to this stored session token and skip the UpgradeToSessionToken() step. For example, this code will work (session_token is retrieved from your database or wherever you put it):

calendar_service = gdata.calendar.service.CalendarService()
calendar_service.auth_token = session_token
feed = calendar_service.GetCalendarListFeed()
for i, a_calendar in enumerate(feed.entry):
print '\t%s. %s' % (i, a_calendar.title.text,)

I hope this helps make things slightly more clear to someone.

Congratulations Netbeans (updated)

Congratulations Netbeans team on the release of 6.5. I’ve been using the pre-release versions but as expected experienced some problems that prevented me from using it seriously. I’m excited with 6.5 because PHP has been given first class status and includes what appears to be simple debugging. I’m downloading the full version now so hopefully will have something interesting to report soon. Request for next release - Django support built in. It looks like the Python Early Access release is shaping up and I noticed some of the milestone builds had Django support so hopefully this isn’t a far-fetched request.

Edit: I built a simple PHP application and enabled debugging. On Ubuntu it took about 90s to configure it Apache and PHP and voila! I can now debug php web apps. The integrated PHP feature has improved dramatically since the last release. If you’re following the tutorial for Ubuntu configuration please note that the path to xdebug.so may differ depending on which version of Ubuntu you’re using. One of the tutorial videos on their website teaches you how to create a wordpress plugin - what a cool idea.

Back to top