This is a brain dump, knowing that if I don't write this now, I probably won't ever.
[screenshot donated by Chu Yeow - thanks!]
It is hard to do SharedCopy justice by describing it in words. It needs a demo. I'm glad I had the chance to do a quick one in RailsConf. My only regret is that I forgot to show the read-later feature.
Posted by choonkeat at 04:43 AM in life | Permalink | Comments (4) | TrackBack (0)
the issue certainly isn’t with creating new messages, the issue is when you check your own messages For eg, if I am following 200 people, the query needs to check the new messages from all those people and sort them into date order. That query would be really intense link »- from Twitter At Scale: Will It Work? via sharedcopy.com
if you only ask this once, the server side batch solution will be faster. But when the client starts asking this once a minute or more repeatedly, resources go to waste and scalability is more expensive. link »Once the server is only serving data with limited scope, usually providing the messages of a single person with the optional perspective of the reader (to enforce access control), scaling becomes a much easier task as data can be segmented easier. link »- from Hueniverse: Scaling a Microblogging Service - Part III via sharedcopy.com
Posted by choonkeat at 06:30 PM in software | Permalink | Comments (3) | TrackBack (0)
I dislike the increasing (still?) trend of websites deploying a lightbox (or thickbox) effect. Not so much for the strobing visuals, but more because it is nothing but an irrelevant technique dragged over from the desktop world to the web - just for the sake of familiarity.
Modal dialog boxes are those which temporarily halt the program in the sense that the user cannot continue until the dialog has been closed link »
- from Dialog box - Wikipedia, the free encyclopedia via sharedcopy.comModal dialogs are generally regarded as bad design solutions by usability practitioners, since they are prone to produce mode errors . link »
The web is free flowing and has no vertical constraint. And it's good that way!
My personal preference as a developer is to use div-expansion/collapse everywhere possible, until I can't. By introducing new content in-place, and reflowing the rest of the document, a user is not required to take action just to back out. If he choose to proceed, he can interact with the new content (usually a form), or simply continue browsing, scrolling down or click elsewhere.
Even if situation calls for a lightbox-ish design, it isn't too much to ask for [as much of the] surrounding content to be pushed aside whilst showing a thickbox at the centre of the screen. You get to reduce overlap & maintain document flow at the same time.
Try it, click on the Wikipedia quote above. Though the right columns of this blog is obscured by virtue of their floats, the content of this entry will remain in full view.
Posted by choonkeat at 08:43 PM in web | Permalink | Comments (5) | TrackBack (0)
Using a little bit of artificial intelligence, a computer program has been created that mimics the thought process of someone who would be responsible for doing such a study link »
- from He wrote 200,000 books (but computers did some of the work) | Tech News on ZDNet via sharedcopy.comIt will then open a Word document and export the information into Word, just like a real author would out of their minds, so to speak, or spreadsheets link »
Reminds me of this t-shirt.
Posted by choonkeat at 03:21 PM | Permalink | Comments (1) | TrackBack (0)
I've just released my Poorman's Trends Rails plugin as an excuse to do something with my GitHub account. Much like its distant cousin, Poor Man's CRM, this software aims to be plug-and-play, self-sufficient and useful enough to make sense of existing data.
3 Steps to get it:
./script/plugin install git://github.com/choonkeat/poormans-trends.gitadmin_controller.rbinclude Poormans::Trendshttp://yourserver/admin/poormans_trends and Viola!You should see a simple page greeting you, like in this screenshot:
Pick a Model class, and you should see some pretty graphs making their AJAXy entrance:
What's happening is that a few interesting columns are picked up from
the Model's table and a few popular values are picked up from those
columns. A count is done for all of them, divided up by weeks and
spitted out as HTML tables. These tables are then turned into pretty
charts using the nice HTML-table-to-canvas javascript library from Filament Group.
Without configuration nor knowledge of what your application does, is there any hope that it can make sense?
That's where the "picking of interesting columns" come in. Assuming zero domain knowledge of your application, I'd say the foreign keys are most interesting (in Rails convention, any column ending with "_id"), together with sub-classes ("type" and any columns ending with "_type"). The time aspect relies on the Rails convention of using "created_at".
The end result actually looks pretty good for something requiring no configuration! :-)
Posted by choonkeat at 05:31 PM in rails | Permalink | Comments (6) | TrackBack (0)
Here are my slides to yesterday's talk. Thanks to all who attended, and Michael Cheng and gang for organizing it! I tried to make it more constructive instead of anything X vs Y
Posted by choonkeat at 10:55 AM in rails | Permalink | Comments (0) | TrackBack (0)
Update 28 Sept 2008: checkout the working code at github repository, and a short video demo on vimeo.
I've been swimming in jQuery-bliss for a few months now - thanks Divya & Tien Dung for introducing me to it! I'm yearning to do it on the server-side.
But to enjoy the jQuery-bliss (aka "no special case pattern"), I'd need to be in a problem where I have a document to sculpt. My recent toys (cleartz and tryanslator.. and actually most Javascript apps?) for example, are built the via sculpting way: a very basic HTML structure, then Javascript comes in to flesh out its form and introduce function. A very pleasant development experience overall.
Aside: Back in Java days, I remember I used to hate XML DOM parsing a
lot. NodeList? hasChildNodes? But XPath came and suddenly pain became pleasure.
On the server-side, Model (of MVC) stuff seems to fit (maybe sqlQuery( "people[gender='Male']" ).update({ salutation: "mister" }) ?) but ActiveRecord (& Ambition?) is already nice to work with, and I have no major problems there.
My gripe is with the View (and consequently the Controller). Views are generally powered by some templating system. These gnarly things are just a pile of bastardized HTML files good for neither designers nor developers. The best templating systems are only best because you'll choke yourself slower by using them. Anyways, pretend you agree that templates == bad.
Wouldn't it be nice if your web framework 1) loads up pure HTML as a document object, 2) you modify them in the jQuery-bliss way in your Controller, then finally 3) the resulting HTML is spit back to the client browser?
No nasty <? %> } or custom syntax for dynamic content, or loops, or if-else. Just pure HTML with dummy data baked in.
# display_user.html
<span class="tel">
<span class="type">home</span>:
<span class="value">+1.415.555.1212</span>
</span>
Then modify them before serving:
# inside controller
def display_user(doc)
user = User.find( params[:user_id] )
(doc/".tel .value").inner_html = user.phone_number
return doc.to_html
end
And because it is an in-memory tree instead of some opaque String, you can do everything programatically around the document: looping, if-else, removing nodes, replacing sub menus, partials? Furthermore, when you need to do dynamic behaviors on the client-side, the programming paradigm is exactly the same!
Designers can be happy churning out the HTML/CSS in whatever tool they like (be it Dreamweaver or notepad.exe), and developers just poke their DOM.
What say you?
PS: Oh well, I guess what I'm trying to say is maybe we should not waste time finding better ways of constructing webpages (i.e. templating systems) when we could approach the problem as "modifying a document" - which is much cleaner and (with the right API) much easier.
Posted by choonkeat at 06:54 PM in web | Permalink | Comments (14) | TrackBack (0)
Finally! Google Translate gets API-ed. I was glad to see a "detect" method provided - meaning you tell what language a piece of text is in. Weird that the actual Google Translate service still doesn't use it to improve their form defaults.
So I gave my old "Tryanslator" (try and translate) an update, and a new home:
Few notes
Posted by choonkeat at 05:28 PM | Permalink | Comments (0) | TrackBack (0)
There are so many things to read on the web - tech news, links from friends and blogs - and I’d open them, “hmm looks interesting, will read them later” but never could find time to do so in day.
grokked: hi, do you know any web service that can add arbitary web pages to an RSS feed? like i have a whole bunch of pages open in my browser and i want to just add them into google reader for review later
me: maybe can email urself the page or soemthing.. or maybe delicious them. that’s also an RSS
grokked: i was thinking more of the actual page appearing within google reader… this only give me urls
me: hmmm
And hence an experimental feature was quietly launched: The “read later” bookmarklet - Click on the bookmarklet and SharedCopy will stash the page somewhere for you to read later, in your favourite feed reader:
Try it out! You can find your own “read later” feed at the bottom of your account “Settings” page :-)
Posted by choonkeat at 12:16 AM in sharedcopy | Permalink | Comments (4) | TrackBack (0)