Officially, Lasso Professional is only supported on one flavor and version of linux: Red Hat Enterprise Linux 4. However, many Lasso users have opted to forego RHEL4, which requires a commercial support subscription, for its community supported twin, CentOS 4, despite the fact that it isn’t officially supported by LassoSoft. Because CentOS 4 is based More »
At the 2008 Lasso Developer Conference in Chicago, I presented a paper entitled Server Side Techniques for Client Side Optimization, in which I reviewed the original 13 Rules For Making Web Sites Fast from Yahoo!’s Exceptional Performance Team. These rules quickly became the seminal document on the topic of client side optimization and have since More »
Over the past few weeks, I’ve been preparing for this year’s Lasso Developer Conference in Chicago. It’s my second time speaking at the event, and although it’s not until September, a written paper and demo materials which will accompany the presentation were due July 1st are due July 14th (thanks to LassoSoft for the gracious More »
Cory S.N. LaViska over at A Beautiful Site has created a very nice jQuery plugin for displaying file trees called, naturally, jQuery File Tree. The great thing about it is its simplicity. It doesn’t have an overabundance of bells and whistles, but it’s super easy to integrate with a simple API (it even includes Lasso More »
This article describes different ways to load custom tags into memory in Lasso, and presents an alternative method of managing tag libraries. LassoStartup and LassoLibraries Lasso provides a number of different ways to make custom tags (and types) available for use in your scripts. Tag definitions can be pasted directly into scripts, or included from More »
An important aspect of web application design is error management. Many factors outside a developer’s control can cause problems, even if the deployed code is free of syntax errors, from changes in the underlying subsystems to edge cases in user input that haven’t been accounted for, to remote services that stop responding. It’s the responsibility More »
I needed to generate some short intros/teasers from longer body text today, and not having anything readily at hand, decided to see what was available at tagSwap. Searching for “truncate” brought up two tags, one based on the other.
The first is [string_truncate] by John Burwell. It’s pretty straightforward. Pass in a string and the desired length, and it will return the string truncated to exactly the specified length, plus an optional string to indicate the continuation (for instance, an ellipsis). It checks to see if the source string is shorter than the given length, in which case it returns the string unaltered.
This looked like it would do the trick, but I decided to check out the other tag anyway. It was [gf_lowtext] by Gaetano Frascolla. Gaetano’s tag is based on John’s, but adds an additional check to see if the truncated string ends with a space. If not, it assumes a word is being split, and truncates an additional character until it reaches a space before returning the result.
It’s a nice enhancement, but only checking for a space presents some potential limitations. First of all, there are plenty of other whitespace characters that may break up words, and secondly, it doesn’t take punctuation and other special characters into consideration. I’d rather not see the result end with a comma or apostrophe, especially when followed by an ellipsis.
It seemed as if a little regex and some elbow grease might provide me with a few additional enhancements, so I grabbed Gaetano’s tag and got to work.