Yossi Kreinin writes a very fair and positive blog entry about why he can't believe he's praising Tcl. In response, I left this comment on his blog:
I'm so glad you've put aside language bigotry and evaluated Tcl fairly--when you do, it's easy to see how convenient it can be for some tasks.
Of course I'm biased, but I also think Tcl is a fantastic language for developing web applications-thus, my affinity for AOLserver.
When you reduce web development to the simple process of "consume bits from a data source, transform strings, output bits to a network socket" ... Tcl's simplicity really makes rapid development a breeze, coupled with AOLserver's library of Tcl procs to ease some common tasks.
I hope more folks give Tcl a fair shake, given it's one of the oldest and arguably the most mature scripting language out there.
Even if you have no interest in Tcl, do read Yossi's blog entry about it. He really takes a close look at what makes for a good embedded scripting language and that's useful for anyone who is building an application today that needs such a thing.
Tags: programming, Yossi Kreinin, Tcl
I love it when I can go against the angry mob!
Marten & Jonathan: Good for you! Take those bits closed-source, make customers pay for the functionality, and use that money to hire talented QA engineers. Let companies pay for the stuff and demand actual timely bug fixes to the real problems that linger in the MySQL code base.
Of course, I wholly expect that 18-24 months later, you re-open the source for these products, once they've been polished up. The companies will be pissed, but we all benefit from higher quality products.
Look around, folks ... this is the cycle we've observed many times of open source software. The fact that Sun is making these changes now is a good sign for MySQL's longevity as a technology and product and that is only good for the open source community.
Tags: Sun, MySQL, open source, business
Configuring a binary or combined binary & Tcl module into your server -
| ←Older revision | Revision as of 19:36, 16 April 2008 | ||
| (3 intermediate revisions not shown.) | |||
| Line 1: | Line 1: | ||
Typical AOLServer modules are written in either Tcl, C, or some combination of those languages (though, of course, new languages can be added via the C module interface). They are included into your runtime using a section of the [[AOLServer Configuration]] file. | Typical AOLServer modules are written in either Tcl, C, or some combination of those languages (though, of course, new languages can be added via the C module interface). They are included into your runtime using a section of the [[AOLServer Configuration]] file. | ||
== Configuring a binary or combined binary & Tcl module into your server == | == Configuring a binary or combined binary & Tcl module into your server == | ||
| - | As documented [ | + | As documented [http://aolserver.com/docs/devel/c/ in the AOLServer C Developer's Guide], a binary module is a dynamically loadable library (.so or .dll) that will be linked into the server at startup. To get AOLServer to try to link it in: |
# Put the file in the right directory: | # Put the file in the right directory: | ||
#* In the default configuration of AOLServer, the right place is usually {your installation directory}/bin (e.g., /usr/local/aolserver/lib). In the AOLServer configuration file, by convention, this directory name is written as "${bindir}". Some installations use a separate "${homedir}/lib" (thus ${libdir}) directory. | #* In the default configuration of AOLServer, the right place is usually {your installation directory}/bin (e.g., /usr/local/aolserver/lib). In the AOLServer configuration file, by convention, this directory name is written as "${bindir}". Some installations use a separate "${homedir}/lib" (thus ${libdir}) directory. | ||
| Line 29: | Line 29: | ||
extern "C" | extern "C" | ||
{ | { | ||
| - | NS_EXPORT int | + | NS_EXPORT int |
| - | Foo_ModInit(char* server, char* module) | + | Foo_ModInit(char* server, char* module) |
| - | { | + | { |
| - | ... | + | ... |
| + | } | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> | ||
| Line 40: | Line 41: | ||
MODINIT = Foo_ModInit | MODINIT = Foo_ModInit | ||
</pre> | </pre> | ||
| + | |||
== Tcl Modules == | == Tcl Modules == | ||
Developing Tcl modules for use with AOLServer is just as straightforward, but have some interesting additional features: a Tcl library really can be installed only into the Tcl interpreters for a specific virtual server, and they can usually be reloaded dynamically. | Developing Tcl modules for use with AOLServer is just as straightforward, but have some interesting additional features: a Tcl library really can be installed only into the Tcl interpreters for a specific virtual server, and they can usually be reloaded dynamically. | ||
| Line 53: | Line 55: | ||
The syntax for loading pure-Tcl library modules is: | The syntax for loading pure-Tcl library modules is: | ||
| - | + | :<code>ns_param ''moduleName'' '''Tcl'''</code> | |
| - | + | For example: | |
| - | + | :<pre><nowiki>ns_param nssession Tcl</nowiki></pre> | |
[[Category:Documentation]] | [[Category:Documentation]] | ||
| ←Older revision | Revision as of 19:27, 16 April 2008 | ||
| (One intermediate revision not shown.) | |||
| Line 1: | Line 1: | ||
''(Lets not split these into seperate pages until there's enough content.)'' | ''(Lets not split these into seperate pages until there's enough content.)'' | ||
| + | We assume the reader is somewhat familiar with http://aolserver.com/docs/devel/c/, or its peer pages, and now is looking for more advanced development topics. | ||
* [[AOLserver and Tcl Crash Course]] - A Programmer's Introduction (Outline) | * [[AOLserver and Tcl Crash Course]] - A Programmer's Introduction (Outline) | ||
* '''AOLserver Internals''' -- a guide to common [[data structures]], a description of the lifetimes of a [[thread]], an [[interpreter]], a [[request]], and a [[connection]]. Discussions of memory allocation. The [[Private C API]]. | * '''AOLserver Internals''' -- a guide to common [[data structures]], a description of the lifetimes of a [[thread]], an [[interpreter]], a [[request]], and a [[connection]]. Discussions of memory allocation. The [[Private C API]]. | ||
| Line 7: | Line 8: | ||
---- | ---- | ||
* '''AOLserver Configuration''' -- a walk-through of the basic steps to properly configure AOLserver, from database pools to virtual hosting. | * '''AOLserver Configuration''' -- a walk-through of the basic steps to properly configure AOLserver, from database pools to virtual hosting. | ||
| - | |||
** Here's a starter for [[Virtual Hosting]] in AOLserver 3.x and 4.x. | ** Here's a starter for [[Virtual Hosting]] in AOLserver 3.x and 4.x. | ||
** [[Module inclusion]] and how your files are treated. | ** [[Module inclusion]] and how your files are treated. | ||
provide some factual information about SMLserver when it was AOLserver-related
| ←Older revision | Revision as of 20:39, 14 April 2008 | ||
| Line 1: | Line 1: | ||
| + | Early SMLserver releases provided a Stanard ML module for AOLserver (nssml.so). | ||
| + | == See also == | ||
| + | |||
| + | * A Functional Approach to Web Publishing ([http://www.itu.dk/~mael/mypapers/smlserver-4.1.0.pdf smlserver-4.1.0.pdf]), by Martin Elsman and Niels Hallenberg. | ||
| + | * [http://www.springerlink.com/content/vbkf26yab0elru3g/ Web Programming with SMLserver], ISBN 978-3-540-00389-2. | ||
Filled in the basics from reading the code.
New page
Wrote a draft of the page based on reading the code. Have not tried to generate examples.
New page
Even though the deadline for filing US Income Taxes is still a week and a day away, I decided to procrstinate no longer and get it taken care of tonight.
On the way home for work I stopped at an office supply store and bought TurboTax Deluxe, which I've used in years past. It's usually been pretty painless, but this year I had to fight with it before I even got started on the actual tax stuff...
Since I did last years taxes I've upgraded to a MacBook Pro and "trickled down" my PowerBook to Shauna. Once I bought the new machine I hooked the two laptops up with a cross over cable and rsync'ed the contents of ~michael/ off of the PowerBook and onto ~michael/PowerBook on the MacBook.
As needed I've had ready access to saved files & data and haven't had any problems with the rsync approach. TurboTax, however, doesn't believe it can open last years return (which I want since it'll speed things up for this year since I won't have to re-enter a lot of information that hasn't changed, etc.)
I went to the TurboTax website, but it wants me to "login" before it'll let me read the search results whose titles seem like they might plausibly be of help. I'm fairly sure I have a login but since I can guarantee it'd be a fairly complex password (and one that I've never used anywhere else) I know it'd take me a while to remember or find it.
So I ask Caleb to let me use his mother's laptop, login, go to Finder and see that it lists last years saved return as being a "Turbo Tax File" in Finder. On the MacBook finder shows it being a "plain text" kind of file. Running the Unix file command on both laptops reports that the file is data.
So I wonder; how does Finder know to associate the file on the PowerBook with TurboTax? And why on the PowerBook does it think it is a text file? The first thing that comes to mind: rscyncing the file wouldn't have preserved the resource fork.
In OS X you can examine the resource fork of a file using standard Unix tools using the filename/rsrc. That is, for my file "2006_Return" I can ls -l 2006_Return/rsrc.
That, however, only showed me that the resource fork was 0-bytes (i.e., empty) on both laptops.
Back to square one. Googling on "kind" (what the Finder column-label calls the file type it displays) is a bit difficult since kind is rather generic and people don't normally talk about a "kind of file" as much as a "file type."
I finally found a very detailed post on the Mac OS X Hints forums that laid out the algorithm Apple uses to associate a given file with a given application in the Finder.
From those clues I did some more searching on file type and creator signature codes and came up with a very helpful Indiana University Information Technology Services knowledge base article entitled "In Mac OS and Mac OS X, what are file types and creators?".
In old (pre-OS X) versions of the Macintosh operating system the file system mainted various pieces of metadata (apparently separate from the resource fork) for every file. Specifically a 4-character "file type" code and a 4-character "creator" code. Most new OS X software doesn't carry on this tradition, apparently, but might TurboTax?
Next question: how to check what the file type and creator codes are? (The Indiana U. KB article had links to some shareware/freeware tools that let you set & see them but I didn't think I should have to download or buy additional software.)
I fired up tclsh trying to remember if, on the Mac, there were any extra file subcomands for dealing with such things. I didn't see any; (file stat $file var, for example, did not have any legacy-Macintosh values in it. I'm pretty sure Tcl on the Mac could have solved it for me, but rather than dig up that arcane knowledge I decided to search and find what installed Unix tools might be up to the task.
I found that there were two helpful utilities available since I'd installed Apple's Developers Tools on both laptops: GetFileInfo and SetFile.
Running /Developer/Tools/GetFileInfo on the PowerBook showed me:
file: "/Path/to/return" type: "TaxR" creator: "MIT6"
On the MacBook the type & creator were the empty string. I was able to set these values with:
$ /Developer/Tools/SetFile -t TaxR /Path/to/return $ /Developer/Tools/SetFile -c MIT6 /Path/to/return
I restarted TurboTax 2007 and this time it saw my 2006 return and so I'm able to start finally...
Perhaps this blog post will be helpful to some future TurboTax Macintosh user who has transfered files from one machine to another...
The Netcraft February 2008 Web Server Survey says:
Unusually, America Online's open source AOLserver sees tremendous growth, jumping from 35 thousand to 105 thousand sites in just one month. AOLserver is a multithreaded, Tcl-enabled web server which can be used for large scale, dynamic web sites, but has not seen the release of a new version since 2006. The majority of the new sites served by AOLserver are hosted in Poland.
This isn't going to make any headlines, but for all those doubters out there who keep wondering who actually uses AOLserver, check out that growth.
The sad thing is, we could easily game the Netcraft survey by doing a few simple things:
The costs involved would be around $10K for the first year, plus the cost of the actual AOLserver hosting, plus the $70K working capital in reserve to meet ICANN's requirements. This could all be set up on Amazon EC2/S3 to avoid having to provision real hardware as the customer demand grows.
Of course, what would be the point? Would having more significant numbers in the Netcraft surveys give AOLserver more credibility? I sure hope not--that would be foolish.
(via Mark Mcgaha)
by Ham-the-geek (noreply@blogger.com) at February 22, 2008 10:50 AM
Missed a space in the indenting fix.
| ←Older revision | Revision as of 18:21, 8 February 2008 | ||
| (One intermediate revision not shown.) | |||
| Line 16: | Line 16: | ||
'''EXAMPLES''' | '''EXAMPLES''' | ||
| + | <pre><nowiki> | ||
| + | % set html {One good website is <A href='http://google.com/'>Google</A>. | ||
| + | Another is <a href='http://www.yahoo.com'>Yahoo!</a>} | ||
| - | + | % ns_hrefs $html | |
| - | + | http://google.com/ http://www.yahoo.com | |
| - | + | </nowiki></pre> | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
---- | ---- | ||
[[Category Documentation]] - [[Category Core Tcl API]] | [[Category Documentation]] - [[Category Core Tcl API]] | ||
EnterpriseDB, the Oracle-compatible database company, today announced EnterpriseDB Advanced Server Cloud Edition, a version of the company’s flagship RDBMS that is built on the Amazon Elastic Compute Cloud (Amazon EC2) and Amazon Simple Storage Service (Amazon S3) Web services. EnterpriseDB has selected Elastra, the world’s first provider of elastic relational databases on demand, as its premier cloud computing software partner. Elastra’s Elastic Database Technology enables EnterpriseDB Advanced Server to run in a virtual, highly scalable, cloud-computing environmentWow.

Jane Austen uses double em-dashes at times. The naive approach I tried in TeX at first— consisting of two consecutive em-dashes—leaves a small but visible amount of whitespace.
A bit of Googling turned up a 1994 comp.text.tex post from Donald Arseneau (who, in addition to being a TeX-nician is also a Tcl'er!) that gave a satisfactory solution:
\mbox{---\kern-1pt---}\penalty\exhyphenpenalty
It's been over two years since we've taken the photo album down on the family website, shiobara.com--June 2005, to be exact. It's time to give it some proper care and feeding. The first step was to replace the old site with Wordpress, which required some changes to AOLserver in order to get it to work right. I then created a new theme that's a little less cluttered and with colors that aren't quite as offensive. Here's a "before and after" set of screenshots:

(shiobara.com, before)

(shiobara.com, after)
I realize I have no graphic design ability--hell, I can't even coordinate colors when I dress myself. Someday, I'll find someone who's ridiculously talented and wants to do the graphic design for me to save me the embarassment of doing it myself. Until then, I'll just keep hacking away at it myself.
Now that the site is all in Wordpress, the next step is to clean up the photo album. I took it down back in 2005 and wanted to redo it, but never got around to it. So, recently, I've started working on a Media Gallery plugin for Wordpress that uses jQuery, jCarousel Lite and ThickBox. It's pretty slick, and once we've launched the photo album, I'll release the plugin as open source. If you'd like a sneak peak to beta test it, just ask.
Tags: family, photos, Wordpress, plugins, web design, jQuery
Among all the Marginal Revolution Markets in Everything posts, one that personally intrigued me was #4, personalized romance novels.
For $55.95 a company in Florida will produce a unique book based on various details you provide (name, hair color, favorite car, favorite radio station etc.) and then plug those details into a pre-fabricated story running between 180 and 210 pages.
As Tyler Cowen noted:
Some people actually like this idea:
"It was an addictive read because it makes you the star," said Pete Hart, 34, who received a pre-fan novel called "Vampire Kisses" from his girlfriend. "I was referred to as Pedro in the book, which is my nickname. I found that quite charming."Another fellow noted:
"It read more like a novel or novelette and less like a typical romance novel," he said. "I enjoyed reading it. Besides, I was in it."
I'm intrigued, since I've made typesetting a hobby, and in part because of the huge profit margins. In my experience producing a single 180-210 page book shouldn't cost more than ~$7, so $55.95 would represent an eight times markup. Not bad...
Of course not being a reader of romance novels (or chick-lit generally) I'm somewhat skeptical of the appeal. But I recognize I'm probably not representative of the demographic and so I shouldn't necessarily consider my own opinion too highly. Better to try an experiment and attempt to quantify the appeal generally.
I am going to prepare a personalized book for my wife for Valentine's. This will provide me with one data point. However a sample size of one (especially when she might be biased to say nice things regardless of what she really thinks) isn't large enough to draw any conclusions from.
As long as I'm going to be creating a personalized book for my wife the marginal effort to create an additional personalized book for someone else is very low. (I'm already going to write a Tcl script to take a list of changes and apply it to the original text; re-running the script with someone elses list of changes would be trivial.)
My inivitation to you, dear reader:
I'm willing to produce a personalized trade-paperback (6"x9") version of Jane Austen's Pride and Prejudice for you.
I only ask two things:
The characters whose names could be changed to customize the story (links are to character summaries at Wikipedia) include:
This chart from Wikipedia shows the relationships between the aforementioned characters.
Location names that could be changed include: Rosings (Lady Catherine de Bourgh's estate); Netherfield (the estate leased by Mr. Bingley); Meryton (the village near where the Bennet's live); Brighton (where Lydia is invited to go with the militia); and Pemberley (Mr. Darcy's estate).
Given that Valnetine's Day is two and a half weeks away, and to allow time for production and shipping, please email me (michael at cleverly dot com) with the following no later than Saturday, February 2nd, 2008:
Please put Pride & Prejudice in the subject line of your email to decrease the chances of your email being inadvertantly miscategorized as spam. If you haven't received an acknowledgement from me within 48-hours please send another message.
I'm willing to ship internationally; however, I doubt time would permit your books arrival prior to February 14th, and the shipping expense would undoubtedly be greater.
Incidentally, if the idea of this experiment offends any die-hard fans of Jane Austen you have my apologies in advance.
In the "scratch your own itch" department, I decided to get Wordpress working under AOLserver. Wordpress is written in PHP, and while AOLserver can load PHP as a module, it doesn't play nice when you configure AOLserver with multiple virtual servers. The other option, running PHP as CGI using nscgi and php-cgi, does work for the most part. However, there were a few issues I ran into that required changes to nscgi, which I'll outline below.
PHP expects an additional environment variable, REQUEST_URI, to be included on CGI requests. Of course, this isn't part of the CGI/1.1 specification. Basically, PHP expects REQUEST_URI to contain the Request-URI (from the HTTP/1.1 specification, see section 5.1.2). So, I added this in.
In order to map an URL to be handled by nscgi, you previously had to make the change in your config .tcl and restart AOLserver. One of the great things about AOLserver is the fact that you can modify some settings at runtime, without a restart. So, I looked at whether it would be possible to add additional mappings at runtime, and it appears that under the hood, nscgi also uses the Ns_RegisterRequest C API which is supposed to be safe to execute at runtime. So, I added a new Tcl command, ns_register_cgi, which is now part of nscgi. It is just a wrapper around CgiRegister, and thus takes the same argument.
For example, if you wanted to map all requests to "/foo" (including "/foo/bar") to a PHP script "/var/www/myfoo.php", you would use something like this:
foreach method {GET POST HEAD} {
ns_register_cgi "$method /foo /var/www/myfoo.php"
}
This maps GET, POST and HEAD requests to URLs starting with "/foo" to the script specified.
Caveat: It is currently possible to load the nscgi module multiple times in the same AOLserver process, for each virtual server. It is also possible to load it multiple times for the same virtual server. I'm not sure why anyone would do that, but it's possible. In that circumstance, the behavior of ns_register_cgi is undefined--as in, I haven't tested it. It may or may not work correctly. If you run such a configuration, where nscgi is loaded multiple times in the same virtual server, please test this carefully and share your findings. Thanks.
I've commited the changes to SourceForge CVS, both in HEAD (rev 1.33, diff) and the aolserver_v40_bp branch (rev 1.23.2.4, diff).

After yesterday's yawner of a Macworld Expo, I wasn't really expecting today to yield much interesting news. Of course, I wake up to the news that Sun acquired MySQL! Both Jonathan Schwartz and Kaj Arnö share with us some of the best-laid plans of mice and men.
My first reaction was most definitely "WTF?!?" After the initial shock subsided, I wondered if it was April already. Checking my calendar, I realized it wasn't. Ah, maybe I'm still sleeping and this is just a really lucid dream? Nope. Okay, so how do I get from "denial" to "acceptance" as quickly as possible?
Sure, the next phase set in quick: anger. How dare they do this? First, Sun gives up the legacy of their SUNW ticker symbol in exchange for JAVA. Now they're going after my beloved MySQL database? Please don't tell me the next press release to come out is the announcement of a renamed MySQL into some craptastic "Sun Enterprise Data Management Suite," codenamed "Monkeybutter."
Fine, I'm being completely irrational, I know it. Things can't get that bad, that quickly, right? I mean, if we're all supportive and positive, things will just keep getting better for both Sun and MySQL, right? I mean, Sun infusing more money into MySQL will inevitably make it a better product, right? Just let some good come out of this situation, please?
Oh, what's the use? Companies are struggling so hard to find MySQL talent, and it's allegedly "the world's most popular open source database" according to MySQL itself. Sun bet the farm on Java and subsequently we've watched the company fall into the pit of irrelevancy. Who really cares what happens to either of these companies any more?
You know who? I do. I love Sun hardware and I love using MySQL databases. If there's some benefit to be had here, I'm sure Jonathan Schwartz will find it and exploit it to the benefit of his customers. In any business, if I had to bet on someone, I'll always pick the guy with the pony-tail and T-shirt to win. If you've ever seen me in person, you'll know exactly why. :-)
As much as people wonder "who still uses Tcl?" or "what the heck is Tcl?" ... it's still alive and well and under steady new development. The long-awaited release of Tcl 8.5 happened this past December 20, 2007. You can download it from here.
The discussion on Slashdot about it shows that there's still a lot of misinformation and outright FUD being spread about Tcl, now 20 years old. Of course, the Tcl community seems to focus more on excellence in engineering than evangelism and PR, so Tcl will likely remain "a well-kept secret, sitting out in plain sight" for the next 20 years.
For people who are already familiar with Tcl but would like to know what significant changes were introduced in Tcl 8.5, Michael Cleverly has a fantastic write-up on it. I highly recommend reading what he wrote if you're looking to take advantage of Tcl 8.5's new features.
Tags: Tcl
| ←Older revision | Revision as of 16:49, 10 January 2008 | ||
| (One intermediate revision not shown.) | |||
| Line 480: | Line 480: | ||
<pre> | <pre> | ||
ns_limits set default -maxupload [expr 25 * 1024 * 1024] ;# Maximum file size set to 25Mb | ns_limits set default -maxupload [expr 25 * 1024 * 1024] ;# Maximum file size set to 25Mb | ||
| + | </pre> | ||
| + | |||
| + | |||
| + | == Return a file generated live == | ||
| + | |||
| + | Example using the db_foreach function from OpenACS, for the sake of code readability: | ||
| + | |||
| + | <pre> | ||
| + | db_foreach get_mailing_addrs " | ||
| + | |||
| + | select company_name, | ||
| + | address, | ||
| + | city, | ||
| + | province_abbrev, | ||
| + | postal_code | ||
| + | from ce_members | ||
| + | order by company_name" { | ||
| + | |||
| + | append csv_text "\"$company_name\",\"$address\",\"$city\",\"$province_abbrev\",\"$postal_code\"\r\n" | ||
| + | } | ||
| + | |||
| + | ns_set update [ns_conn outputheaders] content-disposition "attachment; filename=\"member-addresses.csv\"" | ||
| + | |||
| + | ns_return 200 application/octet-stream $csv_text | ||
</pre> | </pre> | ||
Mark Roseman has created a new Tk website (tkdocs.com) which aims to provide "a language neutral, up-to-date (8.5+) best practice tutorial and associated documentation".
The tutorial is coming along quite nicely, with code examples for both Tcl and Ruby. Presumably examples for other languages (Python, Perl, etc.) may yet be forthcoming—or would be included if someone steps up and contributes them.
The site, as new is it is, is already off to an excellent start. Kudos to Mark!
The weekly Hackfest took a bit of a break due to the winter holiday and resumed this past Monday. The goal for this session was to turn the visual design created last time into actual FBML that would render inside a profile box.
The first step was to create the database schema, which was mostly outlined in the design document. I went ahead and created actual DDL scripts for MySQL based on what was described in the design doc. I'm expecting these to change as development progresses, but this represents the minimum required to implement our current visual design.
The general approach for the profile box implementation is to use profile.setFBML to set the FBML of the profile box to simply "<fb:ref handle="profile_box"/>". We want to do this because every day when the profile box needs to be updated for every single Facebook user who has added our application, we don't want to have to invoke profile.setFBML with the newest information--that just won't scale well. Having the profile box simply contain an <fb:ref> means we can effectively update everyone's profile box with a single call to fbml.setRefHandle, once per day.
I've also created a SQL script that can be used to populate the MySQL database with sample data for testing. The only MySQL-specific part of it is the use of "CREATE TABLE ... LIKE ..." which allows us to use the submission_template and votes_template tables to create our individual instances of those tables for each list_id, rather than embedding the DDL for each of those in our code itself.
After all this, here's a screenshot of the profile box off my own Facebook profile page, pulling the sample data out of the database and rendering it via FBML:

The rating widgets--the "thumbs up" and "x" icons--don't actually work yet, but that's going to be next week's challenge, getting the Facebook "mock AJAX" working.
Tags: Hackfest, New Jersey, Facebook, MySQL
Once upon a time (Tcl 7.x; probably earlier too?) the best way to test for string equality in Tcl was:
if {[string compare $x $y] == 0} ...
Beginning with Tcl 8.1.1 the preferred way became:
if {[string equal $x $y]} ...
Beginning with Tcl 8.4 and the introduction of the eq and ne operators testing for string equality became much more concise:
if {$x eq $y} ...
Much more readable, concise, and less to type. In Tcl 8.5 we get a simillar improvement for testing whether a particular item is a member (or not) of a list:
if {$x in $y} ...
Which IMHO is a huge improvement over the former idiom:
if {[lsearch -exact $y $x] != -1} ...
Naturally ni is to ne as in is to
eq. And to top it all off, ni is fun to say too.
In Tcl 8.5 you can now define, at the script level (instead of needing to write in C) custom math functions. For example here is a factorial function:
proc tcl::mathfunc::fact {n} { if {![string is integer -strict $n] || $n < 0} then { return -code error "fact is only defined for non-negative integers" } set result 1 # remember, n! (n factorial) is the product of all integers between 1 and n # except 0! which is defined to be 1 for {set i 2} {$i <= $n} {incr i} { incr result [expr {$result * $i}] } return $result }
Then we can use fact($n) in expr, if, while, for, etc. just like any of the "built-in" math functions.
Since we now have arbitrary precision integers (thanks Kevin!) we can compute factorials that exceed the native size of a long integer, i.e., 42!
% expr fact(42)
1405006117752879898543142606244511569936384000000000
Defining your own math functions makes solutions to Project Euler problems easier to write. YMMV. The other features of Tcl 8.5 will probably be exciting to an even wider audience.
As of January 2008 the Google calculator can only calculate up to 170!. We can do twice as better quite quickly (timings from my 2.4 GHz MacBook Pro laptop):
% time {expr {fact(171)}} 1000
295.348728 microseconds per iteration
% time {expr {fact(340)}} 1000
791.435306 microseconds per iterationAfter more than four years in the making, Tcl 8.5 was released a few days before Christmas. And wow, what a treat it is!
This release is, in my opinion, the best ever.
I first became acquainted with Tcl 10-years ago via Philip Greenspun's original Database Backed Websites book. At the time AOLserver 2.x was closed source but available at no cost. I never had much hands on experience with the Tcl 7.6, 8.0, 8.1 and 8.2 releases; I made the jump straight to Tcl 8.3 (IIRC) once America Online open sourced the code base for AOLserver 3.x.
Since Tcl has been around for twenty years now, there is a fair amount of outdated information on the web regarding Tcl's features, performance and capabilities that doesn't apply at all to modern Tcl versions.
There are a number of features that excite me in this release. I intend to blog a bit about each of the following (I'll update this post with links to subsequent posts as they get written):
Stay tuned.
Addendum: Dossy points out that I overlooked the biggest news: the {*} expand operator, which means an expansion from the 11-rule endekalogue to a 12-rule dodekalogue. (Tcl 8.5, now with 9% more syntax!)
| ←Older revision | Revision as of 21:19, 23 December 2007 | ||
| Line 1: | Line 1: | ||
| - | : mailto:ximon.eighteen@ | + | : mailto:ximon.eighteen@gmail.com |
| - | + | See: http://ximoneighteen.com/ | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
[[Category:Person|Eighteen, Ximon]] | [[Category:Person|Eighteen, Ximon]] | ||
del.icio.us/dossy (RSS) links since December 10, 2007 at 09:00 AM:
After hearing about the Taproot Foundation from Jennifer, who came to the November MySQL Meetup and told me about it, I decided to complete a profile as a volunteer. Shortly after, someone contacted me and we had a brief chat and scheduled me for their December 11th orientation at the Time-Life Building in NYC, which was this past Tuesday.
In a nutshell, the Taproot Foundation is nonprofit organization that awards service grants for other nonprofits' projects, to be performed by volunteers, for free.
Attending the orientation and completing the volunteer agreement form was the last step before I could be selected by an account director to work on a service grant (project). Now, I'm just waiting to hear from someone who wants me on their team.
Why am I signing up to volunteer my time for free? Especially after my recent financial stumble just a few weeks ago? How can I possibly have time to volunteer when I should be trying to squeeze every billable hour out of my non-sleeping time?
I like to say, "The best gifts are the ones you cannot wrap." I've always enjoyed giving of my time and talents where they are wanted. As a teenager, I worked as a volunteer at a local hospital, as well as at a homeless shelter. As an adult, I've been playing guitar for the Sunday school children at church, as well as singing in the church choir, and I plan to participate in the Sierra Bravo's F1 Overnight Website Challenge in March 2008. Volunteering through the Taproot Foundation is the kind of thing that really suits me.
I'll write more about my experiences volunteering for Taproot once I'm on a service grant. Until then, if you want to ask me questions, feel free to leave a comment below. Or, perhaps you want to sign up as a volunteer yourself!
Tags: Taproot Foundation, volunteering
| ←Older revision | Revision as of 16:49, 12 December 2007 | ||
| Line 1: | Line 1: | ||
| - | + | NsRuby is a module for serving Ruby on Aolserver. What is it's status? | |
| - | + | It currently sits starving at: http://sourceforge.net/projects/nsruby | |
Ruby on Rails on AOLserver? -
| ←Older revision | Revision as of 16:48, 12 December 2007 | ||
| (2 intermediate revisions not shown.) | |||
| Line 4: | Line 4: | ||
* What would be the point? Rails already includes a Ruby-based HTTP listener that's closely integrated with Rails. You would get no performance benefit from putting AOLserver in front of Rails, as Rails is all single-threaded so requests get processed in serial, as I understand it. If you wanted to accelerate a Rails app, I'd front it with a load balancing switch and run a bunch of Rails listeners. But, that'd mean Rails couldn't keep in-memory state information unless you want to run the switch in sticky-session mode, which is lame. ''-- [[User:Dossy|Dossy]] 07:50, 10 December 2005 (EST)'' | * What would be the point? Rails already includes a Ruby-based HTTP listener that's closely integrated with Rails. You would get no performance benefit from putting AOLserver in front of Rails, as Rails is all single-threaded so requests get processed in serial, as I understand it. If you wanted to accelerate a Rails app, I'd front it with a load balancing switch and run a bunch of Rails listeners. But, that'd mean Rails couldn't keep in-memory state information unless you want to run the switch in sticky-session mode, which is lame. ''-- [[User:Dossy|Dossy]] 07:50, 10 December 2005 (EST)'' | ||
| + | |||
| + | * Dossy is correct here, as far as I understand. It's amazing how long it has taken for other web servers to begin to approach Aolserver, and even now, the hottest thing around (Rails) faces such terrible scalability issues. The problem is most people won't notice until their web site really blows up -- [[User:Jadeforrest|Jadeforrest]] | ||
| + | |||
| + | == Ruby on Aolserver? == | ||
| + | |||
| + | Yes, but Ruby on Aolserver would absolutely ROCK! | ||
del.icio.us/dossy (RSS) links since December 3, 2007 at 09:00 AM:
Tonight was the December Northern NJ MySQL Meetup, and Martin Adamec gave a presentation on the Content Management System, or CMS, that he's implementing at work.
He's using XML, XML Schema, XSLT and XForms to generate the UI for the CMS, as well as perform data validation to provide data quality controls. The work is done once when defining the XML Schema for a particular data entity, and the web forms are generated using XForms and XSLT. He's doing this all using PHP's XML support.
Thanks, Martin, for sharing your work and expertise with us.
Tags: MySQL, Meetup, Martin Adamec, XML, XSLT, XForms
New page
What happens to special characters?
New page
I posted a reply to Bugtraq today (that somehow got disassociated from the original thread I was replying to). My message outlined bug fixes/enhancements to the Tcl code in the research report, "Creating Backdoors in Cisco IOS using Tcl," recently released by Information Risk Management Plc (a UK-based information security consultancy).
Today, in addition to deleting the occasional stray piece of spam that makes it through various levels of filtering, I've had to delete message after message from around the world outlining that so-and-so of Big Organization Inc. is out of the office (often for quite awhile). These emails are often quite helpful in providing other contact information that it seems like could be used for nefarious social engineering purposes. ("Hi Bob, this is Carol. I'd been working with Alice on ______; she told me to contact you if I had any problems while she's gone. Anyway, I forgot how to connect to the _______ system; can you give me those connection settings again so I can get through the corporate firewall?")
Anyway, how wise is it for people working in information security to advertise the fact that they are out of the office (and, at least personally, not minding the proverbial store) to random strangers (that they've never had any contact with previously)? Regardless, it seems like poor netiquette to ever reply to a mailing list with an out of office autoresponse. Maybe it's just an Exchange/Outlook social norm to do so...?
So far I've received messages in various languages: English and Portuguese (that I can read); French and Italian (where I can pick out some words), and Russian—which might as well be Greek to me.
del.icio.us/dossy (RSS) links since November 19, 2007 at 09:00 AM:
The last time I had business cards printed was back around 1995. I think I ordered a box of 250 cards, ended up giving out maybe 100 at most, and used the rest as scrap paper for disposable notes on my desk. Since then, I haven't bothered to order updated business cards as I've changed phone numbers, addresses or jobs.
Recently, though, I've been asked by people if I have a business card often enough that saying "no" has become a pattern. Just last night, I went out to dinner with my family, and while outside smoking a cigarette, I started chatting with another patron who was doing the same. Turns out he also works a tech. job and asked me for my card. I ended up jotting down my contact information on a card for the restaurant and handed it to him.
In the past, this wouldn't have mattered to me. But, now that I'm consulting full-time, these quick introductions could turn into valuable business leads that I could really use, now. The lack of preparedness and professionalism isn't going to give that prospective client the sense of confidence I want them to have in my abilities and overall product.
So, last night I decided I was going to design and order myself a set of business cards. I wanted to create a card that was unusual, humorous, unique and memorable--qualities that reflect my nature and approach. The front of the card borrows from the LOLcats meme, as well as the "let me show you them" meme. I have yet to hear of anyone else making semi-serious LOLbusiness cards, so let me be the first. (FIRST!)
The back of the card is simple, informative and efficient--qualities that represent the kind of work I perform. I list my name, a title and contact information with as little clutter as possible. I use the remaining space to list popular technologies (think: keyword stuffing) that I don't mind taking on work doing. I list AOLserver and Tcl at the top because as the recipient quickly scans down the list, they should cause a hesitation and very likely a question like "what are AOLserver and Tcl" which give me the opportunity to explain them, rather than coming across as pushing them directly.
In case you're wondering, here's what the proofs of the card look like, showing front and back:


In theory, the order I placed online today should be arriving sometime during the first week of December. When I get them, I might write a little something about where I ordered them.
So, what do you think of the cards? Too edgy? Too risky? Not serious enough? Fun, or funny? Would you give me your business if I handed you one of these cards?
Tags: business cards, meme, consulting, freelance
added CiteULike
| Revision as of 13:11, 21 November 2007 | Current revision | ||
| Line 44: | Line 44: | ||
| |- | |- | ||
| | Bayt.com || AOLserver/4.0.10 || http://www.bayt.com/ || | | Bayt.com || AOLserver/4.0.10 || http://www.bayt.com/ || | ||
| + | |- | ||
| + | | CiteULike || AOLserver/4.0.10 || http://www.citeulike.org/ || | ||
| |- | |- | ||
| | OpenACS || AOLserver/4.0.9 || http://openacs.org/ || | | OpenACS || AOLserver/4.0.9 || http://openacs.org/ || | ||
removed doubling of brackets in a tcl command in the example code so it doesn't appear as a wiki link
| Revision as of 12:05, 21 November 2007 | Current revision | ||
| Line 26: | Line 26: | ||
| off | off | ||
| - | % string length [[ns_config dummy dummy]] | + | % string length [ns_config dummy dummy] |
| 0 | 0 | ||
November's MySQL Meetup was fun, having two new members attend: Jen and Mor. Pete also made it to the meetup, and the four of us talked about:
As convenient as it is to meet at Panera Bread as meetup attendees can get themselves food and drinks easily, I'm somewhat disappointed with its management's inability to manage the reservations for their private room in back. I really do want to start digging deeper into MySQL and try to get speakers to present to the group, and the unpredictable availability of the meeting room makes this frustrating.
Amy Kearns suggested that I call the local public libraries about hosting the meetup in their space. Apparently many now have free wi-fi and some may even have a projector we can use. Certainly, the price is right (free!) and the benefits of having a dependable reservation and possibly a projector, in my mind, outweighs the convenience of food and beverages at Panera.
So, for December's meetup, I'd like to experiment by having the meetup at a public library. The currently scheduled date for the meetup is December 5th, the first Wednesday of the month. How many people think they can make that date? Of those who think they can, where are you travelling from? I'd like to pick a library that is centrally located for the majority of the people who plan to attend.
Please RSVP for the December meetup and in the "comment?" box, indicate if you have a preferred library where you'd like the meetup to be held--especially indicate if you're already a patron of that library. Once I get some responses, I'll start making calls and travel to some of these libraries to see which would work best for us.
I look forward to seeing you in December!
Tags: New Jersey, MySQL, Meetup
I have way too many saved emails in my inbox, over 5,500 when I started writing this. Of those, over 2,200 are AOLserver-related. I haven't them filed away yet because they represent a loosely organized "to do" list for me. But, with so many open items, it's a daunting task to go pluck out interesting things to work on, so I've mostly avoided doing it and haven't gotten anything done.
I've wanted to get my inbox back down to a manageable size for a while, so I'm going to go through it and create a high-level summary of the open issues so I can finally file all those old emails (dating back to 2004, some of them) away.
On with the list ...
... and this is only a partial list. I still have plenty of emails to go through in my inbox--I'm only down to 5,100 messages, now.
Of course, if you'd like to help out by tackling any of the items on the above list, don't let me stop you--go right ahead! If you want to know more about anything in particular, just ask.
Tags: AOLserver
It's not fully baked yet, but let me take a break from coding to ... squee! You have no idea how excited I am right now.
Back in February, I blogged about nsjsapi, an AOLserver module that makes the SpiderMonkey JavaScript interpreter (written in C) available to Tcl. Then, in July, John Resig blogged about env.js, which he used to load jQuery under the Rhino JavaScript interpreter (written in Java). env.js is neat because it's a JavaScript implementation of a basic browser and DOM environment which isn't provided by either SpiderMonkey or Rhino.
However, env.js assumes its running under Rhino, or at least has all the java.* and javax.* and org.w3c.dom.* APIs available, so it doesn't completely work under SpiderMonkey. So, I've set out to implement all those missing bits in JavaScript, in nsjsapi.js. (Yes, I know I'm crazy ...)
After a few days of furious coding and much head-desking, I've gotten far enough that I can do this from an AOLserver control port:
nscp 1> set js [js create]
js0x88e0838
nscp 2> js load $js /home/dossy/htdocs/js/nsjsapi.js
undefined
nscp 3> js load $js /home/dossy/htdocs/js/env.js
undefined
nscp 4> js load $js /home/dossy/htdocs/js/jquery-1.2.1.js
undefined
nscp 5> js eval $js {jQuery.fn.toString = DOMNodeList.prototype.toString; true;}
true
nscp 6> js eval $js {window.location = 'test/index.html';}
undefined
nscp 7> js eval $js {$('body').html()}
<div><span id='foo'>This is a test.</span></div>
nscp 8> js eval $js {$('div').append('<span>Hello world!</span>')}
[ <div> ]
nscp 9> js eval $js {$('body').html()}
<div><span id='foo'>This is a test.</span><span>Hello world!</span></div>
I guess this doesn't seem like much of an accomplishment, but it's a huge first step towards being able to do actual JS-based server-side web development under AOLserver.
I want to iron out a strange crash bug when the JS interp. is destroyed via [js destroy], and complete the file I/O stub that isn't finished yet, then check in nsjsapi.js. I plan to get this done in time for my talk at jQueryCamp07 this weekend.
Tags: AOLserver, jQuery, JavaScript, nsjsapi