Posted in catalyst, imagemagick
Wed, 19 Jul 2006 04:05:00 GMT
I just migrated my Catalyst app to use GD instead of ImageMagick based on some reported compatibility issues.
- Chris Laco reported Apache2/mod_perl2 would core dump with ImageMagick (on FreeBSD). He moved to FastCGI+ImageMagick first and is now using FastCGI+Imager. ImageMagick has been reported to work with Mason+Apache1.x+mod_perl1.3.
- Andreas Marienborg reported on #catalyst IRC that Imager doesn't work with Catalyst+PAR and has moved to GD.
- Someone on #rubyonrails IRC mentioned having problems with RMagick and was looking to migrate to ruby-gd
Wanting the best of all worlds, I moved to GD which also has a smaller memory footprint than ImageMagick. I ended up writing my own wrapper for Lincoln Stein's GD module using the Image::Magick API (drop-in replacement for a very limited set of functionality) though something like Image::Thumbnail, which provides a uniform interface to GD, ImageMagick and Imager, is probably better for general use.
Thanks to Chris and Andreas for their reporting issues. Hopefully I'll be all set with GD.
no comments
Posted in ajax, autocomplete, dojo, google, jquery, scriptaculous, yui
Tue, 18 Jul 2006 04:15:00 GMT
Here are some screen shots of various autocomplete effects in action to show what people are doing. The images and names above the images have links to the relevant sites with the domain name shown. I'll add more screen shots here as I get them. Let me know if there are any other toolkits demos or interesting implementations.
Here are some observations:
- All of the screen shots and links are for toolkits except for Google which is just shown as an example.
- The jQuery and Scriptaculous demos do not automatically display "autocomplete" text in the input element.
- All of the demos, except Dojo, include text that will end up in the input field as well as extra display text that will not.
- Where both simple and customized demos are available, the customized one is used for the screen shot.
- Del.icio.us also has nice variable horizontal location/width autocomplete for tags that I don't have a screen shot for atm. Gmail also has a nice autocomplete that isn't shown.
The observations are just for the particular demos available. The libraries may have the ability to be configured in additional ways.
NOTE: The jQuery screen shot has been edited to size it better from the demo page: (a) the number of results was reduced and (b) the width has been reduced because there's a lot of blank space in the demo. The original jQuery screen shot is also available.
UPDATE: CAPXOUS has an interesting paged autocomplete variation which adds Next and Prev links when applicable. The one minor issue I ran into when using this is that it would switch location (above/below the input) if it was near a browser edge and the number of items changed as shown below. I found this a bit disconcerting. I wonder if there's a way to making it always used the side for the larger list? CAPXOUS can also show info that's searched on but not shown but this was less interesting than the paging. One final note, unlike the other JS libraries listed above which are free open source software (FOSS), CAPXOUS is commecial requires a license fee. Pretty interesting idea.
6 comments
Posted in perl6
Sun, 16 Jul 2006 15:33:00 GMT
Damian Conway just posted a message about Perl 6 comment enhancement on PerlMonks. I especially like the nestable feature.
Perl 6 [...] introduces an indentable, nestable, multi-line-able delimited comment:
#{ comment
here
}
#[ comment
here
]
#( comment here )
#< comment here >
#« comment etc. »
A delimited comment is introduced by a # followed immediately by any kind of opening bracket. It is closed by the corresponding closing bracket.
John Porter asks for an enhancement which I think would be useful:
Would it be too much to ask that it accept any sequence of openingbrackets — e.g.
#<<<
#<{[
because I could easily see myself wanting to comment out blocks of code with unbalanced closing brackets of all four types (or, more to the point, a dynamic selection of closing bracket types). Having an unlimited variety of comment "identifiers" also facilitates arbitrarily nesting comments without artificial restrictions.
Damian replies:
Not to much to ask at all. At least, not as long as you can be satisfied with multiple repetitions of the same delimiter character. From the latest update of Synopsis 2:
For all quoting constructs that use user-selected brackets, multiple, adjacent, identical opening brackets must always be matched by an equal number of adjacent closing brackets. Bracket counting naturally applies only to sets of brackets of the same length:
say #{{
Comment contains unmatched } and { { { {
plus a counted {{ ... }} pair.
}} q<< <<woot>> >> # says "<<woot>>"
People have editor macros and other workarounds today but this seems much cleaner.
I saw a few other very cool things in Damian and Larry Wall's Perl 6 presentation at YAPC::NA. Just hope Perl 6 comes out sooner rather than later.
no comments
Posted in typo
Sat, 15 Jul 2006 23:09:00 GMT
I just listened to The Web 2.0 Show, episode 23 with Steven Smith where they discuss Typo and the memory leak problem. This issue was recently solved by Scott Laird for Typo 4.0 and is currently in the trunk. Thanks to Ajay for making me aware of this podcast on the #typo IRC channel.
Here's a transcript of the podcast relevant to Typo for anyone interested (let me know if I got anything wrong). There has been some minor editing to make the text flow better but nothing of substance. If you want to listen for yourself, it's at the 10:30 to 12:30 minute mark. Given the memory leak fix, I'm not sure how much of the performance discussion is still relevant but it's an interesting read/listen.
- Josh Owens: I had a question for you as far as Rails scalability goes. We ran into a problem with one of our servers. We were running Typo actually for The Web 2.0 Show and for the Steelpixel blog and all that stuff; and it just went out of control and all of a sudden we were seeing the Ruby processes were hitting like 300, 400MB each as far as memory goes. Have you guys had any experience tracking down bugs within Rails.
- Steven Smith: Well, I'll be very gentle on the call cause I know it's a podcast but the problem that you experienced was not with Rails, it was with Typo. Not that Typo is a bad blog.
- Josh Owens: No, not Typo, come on.
- Steven Smith: It's used heavily. It was written by Toby, as you know. Toby's kind of moved on. Still a great group of guys working on it so I want to make sure it comes across that we're not saying anything negative about it, but Typo is very resource intensive. Typo tries to do a lot of things as a blog engine. And as a result, I mean they kind of, I don't know if you kind of ever ran it in development mode, for example, under Rails but they advise you really to not even do that when you're doing development. It in and of itself is a very high-powered application so most likely the problems you experienced were more so related to the application than they were to the Rails framework per-se, would be my guess. Because we are investigating blog engines at the moment, and have invested quite heavily in Typo actually, in terms of checking it out, things of that nature. Mephisto is another. It doesn't do near what Typo will do but it's a simple straight-forward blog engine, looks like it's got a lot of momentum behind it and that's kind of what we're looking at right now as well.
Can anyone provide a reference for the recommendation against doing Typo development under development mode mentioned by Steven?
Scott is also working on Akismet itegration for Typo 4.0 to stop comment spam. 4.0 will resolve the following major issues:
- Typo will run on the latest version of Rails
- memory leak is fixed
- spam issues are addressed
Here's a full list of the changes since 2.6.0. With Typo 4.0 on the way, are there still reasons to consider Mephisto?
4 comments
Posted in dojo, ajax
Fri, 14 Jul 2006 04:57:00 GMT
When using Dojo Toolkit, you should avoid using <body onload="..."> or window.onload (make sure to check external scripts you use as well). This is because Dojo does it's own window.onload and doing it yourself can interfere with Dojo's initialization routines (including DOM rewriting). Dojo has provided dojo.addOnLoad for this which allows you to load functions after Dojo has finished its own initilization.
To use dojo.addOnLoad you need to pass a function which can be in either of the following formats:
dojo.addOnLoad( myinit );
dojo.addOnLoad( function() { myinit(); });
You cannot, however, use a function call like the following since Dojo is expecting an object, not a function call.
dojo.addOnLoad( myinit() );
I discussed using dojo.addOnLoad in a previous entry about setting Dojo's combobox default value but thought it worthwhile to have a separate entry since this issue continues to come up.
3 comments
Posted in typo
Thu, 13 Jul 2006 03:10:00 GMT
Geoffrey Grosenbach of Topfunky has a neat Typo plugin for Mint, a commerical PHP stats package, to display a popular articles list on his Nuby on Rails blog. It currently appears on his blog as the following (screen shot cut off at 5 results of 20):
It works by using data from Mint's mint_visit table which can be populated by Mint or using an included script to import data from server logs logs. To address performance issues from reading the table, the plugin has the ability to create a mint_caches table using an included rake task:
rake mint:create_cache_table
The table can be populated by the following which can be run periodically via cron:
rake mint:rebuild
See the following for additional details:
I haven't tried this yet but it's on the list.
no comments
Posted in typo, scriptaculous, hacks, dhtml
Wed, 12 Jul 2006 06:48:00 GMT
Several Typo themes have nice DHTML effects and I thought it would be useful to extract some of these for use in other themes. In particular I am interested in adding Modernist's DHTML Scriptaculous ScrollTo article slider to my modded Azure theme. You can see this in action at poocs.net which is currently running Modernist. This article covers the steps necessary to repurpose the DHTML article slider and involves templates, CSS and images. I've shown how Modernist does it and, where applicable, how I prefer to do it. It turns out to be pretty easy.
I've added this feature to my test system, however it's not here yet because I've decided to create a custom Dev411_Azure theme to handle the views (and controller/helper patches) for the growing number of mods I'm using rather than to continue manually hacking files under themes/azure and app. This should be here before long.
Read more...
2 comments
Posted in typo
Sun, 09 Jul 2006 14:36:00 GMT
I decided to see how easy it was to add category icons to my Typo install and it turns out to be pretty easy. Only some categories have icons now. They are shown if they exist otherwise they are skipped. The category icon will also appear in the table of contents when the page is a category page. When I migrate to Typo 4.0 these will become tag icons. This is a quick hack for now and should be cleaned up a bit.
Step 1 is to add the icons to the articles. Right now I just code a list of categories I have icons for in the helper method below but I should either put the list in a config setting or make a model for it. The modified files are:
- app/helpers/articles_helper.rb: add an article_icons method to generate the icons given an article.
- app/views/articles/_article.rhtml: add call to the new article_icons helper method.
- app/views/articles/read.rhtml: add call to the new article_icons helper method.
Step 2 is to add it to the TOC if you have one. If you don't have one yet, you can follow the directions here. The modified files are:
- app/controllers/articles_controller.rb: set @category instance variable in the category action.
- app/helpers/articles_helper.rb: add a category_icon method to generate the icon given an category.
- app/views/articles/_articles_toc.rhtml: add call to new category_icon helper method and pass it the @category instance variable if it exists.
I also created a category sidebar that uses icons instead of text names but found that it's really only useful if all your categories/tags have icons. If a reasonable percentage don't, having a bunch of default icons kind of defeats the purpose.
I'll post some code once it's been migrated to Typo 4.0 and has been cleaned up a little. I'm still not sure what's the best way to package mods that require changes to controllers, helpers and templates. My current thoughts are patches for controllers / helpers and either patches for Azure or instructions on how to mod your own templates. Let me know what you think.
no comments
Posted in typo
Sun, 09 Jul 2006 13:57:00 GMT
Here are some Typo blogs I've run across with nice custom themes:
The Vivabit one reminds me a bit of the Django framework website but is nicer due to the curves.
If any of these happen to be FOSS templates, let me know. For Typo themes you can use on your own blog, see the Typo Themes Viewer and Tim Freund's Digital Achievement.
I'll continue to update this entry as I find more themes.
no comments
Posted in hp, lancearmstrong, amd, marketing
Sun, 09 Jul 2006 07:40:00 GMT
I was recently in the market for a AMD 64 notebook because I wanted a portable system to do x86_64 linux testing. The HP Lance Armstrong L2000 series notebook was one that I came across. The technical features were fairly standard so it didn't stand out for me. From a marketing perspective however, each laptop is branded with the LIVESTRONG logo, has Lance's signature, comes with a yellow wrist band and provided a $50 donation to the Lance Armstrong Foundation. Certainly the yellow LIVESTRONG wrist bands were decent business (counterfeiters were convicted and fined $111,000 for selling fake wrist bands), but I wondered how many people would buy a notebook computer because of Lance Armstrong and the LIVESTRONG program
.
My question was answered in July's Business 2.0 magazine which says the Lance Armstrong notebook has sold over 40,000 units and is the best selling laptop at CompUSA for 2005Q3. Originally $50 was donated for each laptop sold but now it's been increased to $150 and the laptop has its own website. The laptop is now sold exclusively at CompUSA - I'm not sure if CompUSA had an exclusive before or if this after their great success. Additionally, HP has picked up 2 points in market share against Dell since the program started and AMD's market share has gone from 9% to 11% (of course a lot of AMD's rise is due to price-performance, not Lance's notebook; the HP vs. Dell numbers may also be due to Dell's reluctance to use AMD). Some good insight into the power of brands.
no comments