Because I'd rather write my programs in a Lisp like Javascript?
HN user
tr4nslator
Freelance Japanese translator. Working on langwidget.
tr [atto] nslator [dotto] jp
Actually, a bunch of us are working on taking the pain out of async programming. Here's my approach, using (fab)'s chained continuations:
http://www.flickr.com/photos/tr4nslator/4532445014/in/set-72...
"Traditional Chinese characters are widely used, and are the de facto writing standard in Hong Kong."
from http://en.wikipedia.org/wiki/Languages_of_Hong_Kong#Written_...
You can even do that in half the bytes by making use of all unary operators together:
-~+[]
-~ is a good proxy for ++ when incrementing unassigned variables.I think this should probably point here:
http://jashkenas.github.com/coffee-script/#scripts
The salient point is that CoffeeScript now automatically compiles any code in a script tag with type text/coffeescript. Pretty cool.
The Japanese government is not unique here. Earmarks and pork are just as big a problem in the United States.
Do you anticipate that the use of WebSockets will improve performance? If so, can you estimate to what degree?
I actually think this is less magical than most approaches, since there's no pre-compilation or "with" scoping magic. Sinatra's hello world is awesome, until you realize that a lot of the cool stuff is scoping magic that you have to throw out when your app has to play nicely with others.
My original approach for (fab) was like jQuery:
fab()
.find( path )
.bind( method, handler )
.find( subpath )
.bind( method, handler )
.end()
.end()
.end()
but I realized that I could simplify things by getting rid of methods entirely, and reserving methods for HTTP methods and status codes.As for people not realizing they can define functions outside of the DSL, I'm hoping that the extensibility of middleware will mitigate that, just as the ecosystem of plugins did for jQuery.
Indeed you can. (fab) is 100% async:
Indeed, CoffeeScript was built on Ruby, and its REPL on Narwhal.
It's vaguely lispy, but without all that nesting.
Multi-line functions work okay, but it's definitely cleaner to name them and put them somewhere else so that your code ends up looking like a site map:
Yeah, a (fab) function just returns itself. It's like jQuery's chaining, but using argument signatures instead of object methods to delegate work. The last (fab) is just a way to indicate the chain is over so that a listener can be returned, and has the additional benefit of making it look declarative.
Hey all,
I just launched a dead-simple web framework on top of node.js. It uses (abuses?) a lot of the dynamic nature of javascript to create a jQuery-inspired DSL that's pure javascript, allowing you to create really concise web apps like this:
( fab )
( "/time", function(){ return "the time is " + (new Date).toTimeString() } )
( "/date", function(){ return "the date is " + (new Date).toDateString() } )
( fab )
I'd love to hear any feedback from the folks here, so check it out and let me know what you think..live() : DOM event handling :: CSS : DOM styling
The latter was just from my framework of choice until now, Tornado.
Server-side Javascript frameworks seem to be in the midst of a Cambrian explosion right now.
I just pushed my own today:
Actually, I'm pretty sure this is another version of the Picasa scrollbar, which has been around for a few years:
http://news.cnet.com/i/bto/20090102/PIcasaMac-main_610x449.p...
Or for a more quantitative approach, with 1.7 Chinese characters per English word[1] and an average English word length at 5.1 letters[2], then somewhere around 420 characters.
(But of course, it really depends on the nature of the text.)
[1] http://itre.cis.upenn.edu/~myl/languagelog/archives/002379.h... [2] http://blogamundo.net/lab/wordlengths/
Actually, I think their solution is pretty elegant; any task that takes that long is abstracted to its own HTTP request, which itself can be blocking without blocking the original request.
I'm pretty sure they're not using much metadata, but instead using collaborative filtering based on the libraries other iTunes users.
"Apple's proprietary recommendation engine that uses collaborative filtering and iTunes' built-in rating system to generate music recommendations"
from http://www.appleinsider.com/articles/09/03/24/apple_switches...
You might want to create your own original "feedback" image for the tab on the left. Yours[1] appears to have been copied from uservoice[2] (probably a leftover from deciding to use their feedback or use your own, am I right?).
[1] http://www.fromabirdie.com/images/feedback_tab_white.png
[2] http://cdn.uservoice.com/images/widgets/en/feedback_tab_white.pngCheck out the jQuery Metadata plugin:
http://plugins.jquery.com/project/metadata
It lets you choose where to define this kind of custom data: in an arbitrary attribute, as a class within the className attribute, or in a script tag.
Yes, that is why it's not a translation, but a localization (you know, for the locals).
It's a lesson in the difference between translation and localization.
In this case, Google's approach confuses the latter for the former, because its corpus contains parallel texts that have not only been translated (into a different language), but also localized (into a different locale). For example, it may be extrapolating incorrectly from a French document and an English document with the following phrases in the same location:
FR Cliquez ici pour la version anglaise.
EN Click here for the French version.
This sign is another good example of how parallel texts are not always translations:http://flickr.com/photos/jadelin/2205088201/
(the Japanese "おかえりなさい" here means "Welcome home")
Is this cheating?
http://www.google.com/search?q=00000000000000000000000000000...
That's a good point. Fixed.
I'm having trouble recreating this. What's your OS/browser?
I agree. It's not monetizable in its current state, but I'm curious what features you think would get it closer, such as:
* more rich replacement (including functions/regex) * dynamic content like stock prices * ability to chain expansions quasi-recursively * SSL / privacy
As a reference point, TextExpander (http://www.smileonmymac.com/TextExpander/) is an OS X app that offers similar functionality, and it's $30.
After getting such useful feedback on HN for typd.in this week (special thanks to huhtenberg/LogicHoleFlaw/ken), I thought I'd put our next project out there to get some more ideas.
textpanda is a simple bookmarklet that lets you define shortcuts for any text input on the web (think really simple emacs bindings). Since it's more of a quick proof of concept than anything, we're not quite sure what to add next (functions and other dynamic replacement? real user authentication? subscriptions to other users' macros?) and would love to hear what you guys think.
Thanks for the good feedback. I think we'll need to move the indicator to the left side and pad the input to offset it, so that it's more visible.
Correcting scrolling is less trivial, and will have to wait for v2.