Better HN
topnewbestaskshowjobs
Log inSign up

tr4nslator

267 karma · joined Sep 5, 2007 (19y ago) · 42 submissions

Freelance Japanese translator. Working on langwidget.

tr [atto] nslator [dotto] jp

Submissions

comment 16y ago · link · parent

Because I'd rather write my programs in a Lisp like Javascript?

comment 16y ago · link · parent

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...

comment 16y ago · link · parent

"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_...

comment 16y ago · link · parent

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.

comment 16y ago · link · parent

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.

6.

UTF-n: Brainstorming alternate text encodings(jed.github.com ↗)

9 points · by tr4nslator · 16y ago · 5 comments

comment 16y ago · link · parent

The Japanese government is not unique here. Earmarks and pork are just as big a problem in the United States.

comment 16y ago · link · parent

Do you anticipate that the use of WebSockets will improve performance? If so, can you estimate to what degree?

comment 16y ago · link · parent

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.

comment 16y ago · link · parent

Indeed you can. (fab) is 100% async:

http://gist.github.com/287475#file_hello_async.js

comment 16y ago · link · parent

Indeed, CoffeeScript was built on Ruby, and its REPL on Narwhal.

comment 16y ago · link · parent

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:

http://gist.github.com/287475#file_hello_middleware.js

comment 16y ago · link · parent

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.

comment 16y ago · link · parent

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.

15.

(fab) - A pure javascript DSL for building async web apps(fabjs.org ↗)

86 points · by tr4nslator · 16y ago · 26 comments

comment 16y ago · link · parent

.live() : DOM event handling :: CSS : DOM styling

comment 16y ago · link · parent

The latter was just from my framework of choice until now, Tornado.

comment 16y ago · link · parent

Server-side Javascript frameworks seem to be in the midst of a Cambrian explosion right now.

I just pushed my own today:

http://github.com/jed/fab/

comment 17y ago · link · parent

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...

comment 17y ago · link · parent

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/

comment 17y ago · link · parent

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.

comment 17y ago · link · parent

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...

comment 17y ago · link · parent

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.png

24.

On Leaky Abstractions and Objective-J(cappuccino.org ↗)

52 points · by tr4nslator · 17y ago · 46 comments

comment 18y ago · link · parent

Check 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.

comment 18y ago · link · parent

Yes, that is why it's not a translation, but a localization (you know, for the locals).

comment 18y ago · link · parent

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")

28.

· discuss

comment 18y ago · link · parent

Is this cheating?

http://www.google.com/search?q=00000000000000000000000000000...

comment 18y ago · link · parent

That's a good point. Fixed.
12