programming

41 posts under this tag.

Star
Why are far things small? 2
0
0
8
May
30

Where, but the web, would you find someone like Oliver Steele? This ain’t no metaphor. That name was a link. I’m not talking about Oliver Steele the person, I haven’t met him (though I apparently am 1-degree of separation from him; weird, that). I’m not talking about the sweating, walking, pinchable, space-and-time-and-flesh-bound avatar, I’m talking about his online persona. And either I’ve gotten crazy enough or technology has advanced enough that I’m ready to treat Oliver Steele —the link, his blog, words, diagrams, code, and further media— as a person by its own merits.

And, boy, is he an interesting guy:

syntax across (programming) languages 2
0
0
7
Dec
12

Boy, boy, boy. Syntax across languages, a massive compilation of programming language features, is so damn cool, so damn useful, so damn usable in its text-only simplicity, in its many angles to approach the collection (sorted by language or by categories, or all in one big page). If you’re a programmer you must bookmark this. Now. (If only a similar thing existed for general languages…)

Star
Beyond books 2
0
0
7
Oct
16

People who seem to have had a new idea have often simply stopped having an old idea.
Edwin Land, inventor of Polaroid
If you are in a hurry, jump ahead to the 3-minute screencast to see what this is all about.

Not for the first time I’ve woken thinking that the invention of dirt-cheap, high quality multi-touch wallscreens would prove as epoch making as the printing press, a cure for cancer, or the web. Most people, of course, scoff. They can barely see the point of computer screens bigger than 15”. It is not my intention now to disabuse the heathen. Let’s just assume that we have such wondrous interfaces and see how far we can run with them in one particular direction.

Close your eyes and imagine that you somehow —digital contact lens, projectors, VR goggles, pixie dust— have access to a screen at least as big as a wall—a humongous HD screen that is not only a pleasure to look at but with which you can interact. Mouse and keyboard would suffice for our purposes here, but since we’re dreaming, feel free to indulge in Jeff-Han-style touch interaction.

Despite the mind-boggling immersive multimedia we can expect, text won’t go away. Not only will we still gulp it down, we’ll likely drown in it. Text has advantages all of its own and in a digital word there’s nothing cheaper or more malleable. Reading newspapers, books, magazines, blogs, emails, and tutorials will still be an everyday staple. It’ll just be by and far all digital now.

The question thus is how we’ll read all this text. How do you take advantage of a massive pixel landscape when your goal is reading? You could recreate books in all their physicality, down to the flashy turning of pages, the weight, the fixed dimensions, and the mahogany bookshelf. We would certainly be able to copy it all in breathtaking detail, but limiting ourselves to such molds wouldn’t only be wrong, it would be perverse. Let’s see if we can do better than that.

Faster translating 2
0
0
7
Oct
08

One painful thing about translating between two languages is that you usually have to specify a direction. That’s bollocks. Life’s already too complicated to worry about whether you’re translating from English to Spanish or the other way around.

In that spirit I created the str (“Super/Simple/Synchronous TRanslation”) YubNub command. You specify, in any order, 2-letter codes for the two languages you want to translate between and the text you want to translate. str avoids the direction decision by doing both at once, each one presented in an individual vertical frame. This is not only much faster in practice, it’s more unconscious and habit-friendly.

You can try it right here! (en stands for ENglish, es for ESpañol=Spanish)

You can see more instructions and the 2-letter codes at str’s man page.

YubNub, for the uninitiated, is “the (social) command line for the web”—a social webapp to use (and create!) handy commands that search your favorite websites and do a whole nother bunch of wonderful things. The simplest way to use it is from their homepage but there are a ton of ways to install it. Installing it in the location bar, as I once explained here, is in my opinion one of the coolest.

Online resizing 2
0
0
7
Jul
27

Had to resize a photo just now on my macbook and I still don’t know how. Decided it would be easier to find and finally use one of the many online photo editors now available. It was. Which speaks volumes about why the web is the next platform.

jQuery is the first truly great JS app 2
0
0
7
Jul
12

A JS library JS’s first great app? Indeed. jQuery is the shit. It makes JavaScript, and particularly the intersection between JS and HTML, more fun than you thought it could be. It is one big lump of syntactic sugar, sweet as only truly elegant thinking can be. It is crossbrowser, lightweight (~20kb, compressed), and it leverages your CSS knowledge. jQuery + FireBug is raw sex. You’ll find yourself traversing the DOM just to feel the wind on your face.

Star
HyperScript 2
0
0
7
Jul
06

A 16-line hack to make the JS DOM API a tad more humane.


...absolutely amazing. I’ve yet to find a smaller and yet more astounding example of how you can encapsulate functionality within JavaScript and create brand new APIs on the fly.


Web pages are written in HTMLWP but as they have become more and more complex, they now tend to be written, clientside, through JavascriptWP, which can manipulate and insert HTML. Google Images, for instance, uses Javascript to write the HTML that displays your image results.

Yes, it’s roundabout, but it’s due to the nature of the languages: Javascript does stuff, HTML displays stuff. When you want the browser to do things (instead of merely displaying dumbly what it receives) and when these things themselves involve a lot of displaying, you end up writing HTML through Javascript.

It’s a little like writing French through English (André went to Marie and said: ”Bonjour! Ça va, ma chérie?”) and just as frustrating, particularly because you sometimes have to narrate whole scenes in French (pidgin tends to be painfully verbose) and your English self is left completely in the dark—so you end up naming things in both French and English and it gets as ugly as you can imagine.

HyperScript is a bizarre and quixotic attempt to write French in English; that is, HTML in Javascript. Basically, you do what went on in the Norman conquest of EnglandWP: you anglicize as many French words as you can; that is, you turn into Javascript as many HTML words as you can.

The lark itself takes gratefully (and rather surpisingly) only 16 paltry lines of Javascript code (highlighting thanks to Mark “Tarquin” Wilton-Jones.):


function each(a, f) { for(var i=0, l=a.length; i<l; i++) f(a[i]) };
each('a big blockquote br b center code div em form h1 h2 h3 h4 h5 h6 hr img iframe input i li ol option pre p script select small span strong style sub sup table tbody td textarea tr ul u'.split(' '),
    function(label){
        window[label]=function(){
            var tag=document.createElement(label);
            each(arguments, function(arg){
                if(arg.nodeType) tag.appendChild(arg);
else if(typeof arg=='string' || typeof arg=='number') tag.innerHTML+=arg;
else for(var attr in arg){
if(attr=='style') for(var sty in arg[attr]) tag[attr][sty]=arg[attr][sty];
else tag[attr]=arg[attr];
};
            });
            return tag;
        };
    });


and you can play with it right here, right now:




Test Area:

The translation between HTML and Hyperscript is straightforward, where you would have written
<b>Hello world!</b>,
you now write,

b(‘Hello World!’).

Instead of

<em style=”background-color:yellow”>Hello world!</em>,

now it’s,

em({style:{backgroundColor:’yellow’}},’Hello World!’).

And so on.

HTML in a Javascript syntax. Enjoy!

Never Ending Flickr 2
0
0
7
Jun
20

Flickr AutoPagination has got to be the coolest Greasemonkey script I’ve seen yet, and, to judge by its code, a really intricate labor of love. It works flawlessly and does exactly what you’d guess: it makes every Flickr page (where it would make sense) “infinitely scrollable”. A cool, handy, and surprisingly stable script.

Spacing! 2
0
0
7
May
14

Remember that wacky koanELZR about reading processors (“what is to reading what a word-processor is to writing?”) and how it led to the idea of a text spacer (illustrated at length in this example)?

Well, I just found out about Live Ink by Walker Reading Technologies (via KurzweilAI.net’s newsletter, though it was slashdotted earlier) and realized people have been toying with the idea for over a decade now. Live Ink is clumsy marketese for what they also elegantly and precisely describe as visual-syntactic text formatting and these guys have not only coded it and are now marketing it, but they have already done some interesting homework, carrying on a year-long experiment where it allegedly improved reading proficiency. They offer a 30-day trial program implementing the technology called ClipRead (screencast) and though the interface is positively abysmal (why, god, why, must bad interfaces happen to good people?), it’s still very much worth downloading to play with.

Here below is a (fitting) paragraph from Charlie Stross’s Accelerando for comparison.

Amber scans the README quickly. Corporate instruments are strong magic, according to Daddy, and this one is exotic by any standards—a limited company established in Yemen, contorted by the intersection between shari’a and the global legislatosaurus. Understanding it isn’t easy, even with a personal net full of subsapient agents that have full access to whole libraries of international trade law – the bottleneck is comprehension. Amber finds the documents highly puzzling. It’s not the fact that half of them are written in Arabic that bothers her—that’s what her grammar engine is for – or even that they’re full of S-expressions and semidigestible chunks of LISP: But the company seems to assert that it exists for the sole purpose of owning chattel slaves.
Charles Stross, Accelerando

I like how they limited the spacing to linebreaks and indents; it’s a good starting constraint—it simplifies the task enormously and the results are still quite good. Highlighting the verb is also a clever touch—the nuance with the biggest syntactic payoff. Overall, while the simple flaws do stand out (because we’re such effortlessly gifted syntactic parsers), what surprises me is how decently it works, how the formatted text feels more accessible than the monolithic paragraph. At several points—interestingly, at some of the most usefully formatted parts—the algorithm at work seems oddly straightforward: nestedly indent and linebreak prepositions. Ahh… I’m itching to write some regex hack… Probably will write one in a couple of days, together with some handcrafted spacing of the above paragraph, just to see what we’re aiming at.

According to VentureBeat, meanwhile, the company is poised to taking the world any minute now. I doubt it. But they have given spacing (visual-syntactic text formatting) a broad hearing and there’s now a flurry of attention on it and, probably, on the broader idea of reading processors. There are bound to be some intriguing reinterpretations and extrapolations in the coming months.

Improv'd Daily! (domburi, notreality) 2
0
0
7
May
11

Encroachment is what makes Life interesting.
Daniel C. DennettWP, EDGE, Freedom Evolves AM

Can’t believe what a coward I’ve been. I guess it wasn’t until I read recently about how Jon Lech Johansen humilliated Hollywood by releasing a program to easily break DVD’s much vaunted DRM (when he was 15 years old), or about “the college droputs that run >youTVpc.com for millions of people on just two low-end desktop computers that I realized how big a wuss I am.

Take Imagery. In a way, I never wanted it to be very popular because I knew I was doing something maybe-legal by scraping Google. I wanted to scrape Flickr and Yahoo! but feared they would be even less likely to see my scraping in a good light. I wanted to create a picture cache to make Imagery much faster and reliable (and to lessen the leech on independent websites) but fretted about bandwidth costs and about whether people would get angry about my caching.

Or take the Spanish dictionary of the Spanish Language Academy. It’s a tremendously useful, gratis dictionary and yet it has a butt-ugly, nonhumane interface. I’ve been bitching about it for years. And I’ve been thinking about giving it a new interface for that long, but, again, what if they don’t like my scraping? (In all probability they won’t. They’re the quintessential staid, monolithic organization.)

A lot of what ifs. But most importantly, so what? So sue me. Well, actually, most important is that I think these scrapings are an overwhelmingly good thing. I see them as a lot of fun—for me, for the scrapees (who’ll get to see how it’s done, ehem), and for the people who will enjoy just how much they never imagined missing. I see them as criticism by example.

So here’s Domburi and here’s NotReality. The idea of Domburi has changed somewhat from its inception (oh, the shame, so many goals not accomplished), it shall now be a collection of search superpowers instead of limiting itself to imagesearching. I believe, with an arrogance that I can’t believe but that I’ve missed, that I have a thing or two to teach Google in its own turf, not just in forgotten backwaters like imagesearching (where Imagery still kicks Google’s ass easily). So I’m starting really tiny now with only a simple redesign of Google search results (there isn’t even imagesearching yet). I’ll be fleshing it out in the coming days, daily, with the daylog here below.

Not Reality, otoh, is still what I’ve always wanted it to be: my webfront for my interface experiments. It’s really simple now but I’ll be improving it daily too.

So please visit the websites, leave your feedback in this post’s comments, and come back often to check out the daylogs—there are loads of interesting things in the pipeline! Thanks for reading.

12-14/May/07

Endless fiddling on Domburi. Collapse of the incrementalism. Obsession with pipe dreams.

15/May/07

Not Reality

Still no attention…

Domburi

Big changes!

  1. Ajaxed requests. Loading icon. Everything happens on the same page. Title changes. Very lightweight script behind the scenes: the now deprecated but still unsurpassed moo.ajax.
  2. New one-column format with even results shaded. Results turn yellow on mouse over, which is silly interactivity, but surprisingly pleasant. Entire result is a link. No numbers anymore showing order.
  3. Displayed URL is now a link that shows results only within the website. This idea from SearchMash, of which I just found out yesterday, and which is a website run by Google where it tries out new interface ideas without the Google brand skewing perception. Very intriguing.
  4. Displayed URL is now cased smartly. So instead of greysanatomyinsider.com you get GreysAnatomyInsider.com. It extracts the case from the result’s title, uses some general heuristics (like upcasing after a ), and if all fails, it simply capitalizes.
  5. Results displayed in-page. This had been the idea ever since I decided to expand Domburi from image searching. I wanted to make the whole searching experience feel faster and more like what Ben Schneiderman calls direct manipulation. It has been much harder than I thought and it was this point where I spent most of my fiddling (I also played for hours with the two-columns layout…). Here’s what I ended up with.
    1. Results seem to open in the entire page, with only the result entry on top. They really open in a full-screen iframe but the effect is surprising. To return to the results you can simply scroll out of the iframe, click the result entry, or…
    2. Pixelside. This is a strange but crucial feature that even if invisible and initially nonintuitive I find very, very promising: it’s simply a 1px-wide, 100%-height leftmost line. Right now you can click on it when on a full-screen result and return to the resultlist (and from there you can click again on it to return to your full-screen result). It is incredibly fast (in Fitt’s lawWP terms, it has “infinite size”), handy, and habituating—and I imagine lots of cool ways to enhance the feature. The only problem is that crappy IE doesn’t allow leftmost pixels! So I’ll have to make up for it with JS. I cringe with only the thought.
    3. The title (but not the entire result, which is JS triggered) is a normal link so if you want to open results in a separate tab just middle-click or CTRL-click it.
  6. Strange cool script used. More details to follow. If you’re interested, check out $.
  7. Works in Firefox, IE, and Opera. Not tested yet on Safari. Some weird bugs on Safari but it broadly works.

16/May/07—20/Jun/07

10-day trip to the US (haven’t told you about that!) with days way too happily busy. Too many books afterwards (63!) to do anything but read for several wonderful, obsessed days until all the stress and overcrowding of the house finally bring me down. Languishment in captivity.

21/Jun/07

Not Reality

Complete Redesign!

I gotta say, I really, really like it. The new eye-candy screenshots are tremendous improvements but the crucial difference is the new text—sort of modeled on ancient book covers—and how it explains infinitely better what it is that I want to accomplish with Domburi and now PLBRS. Please do read it—it’s extremely short and heavily formatted—and tell me what you think.

Added a Not Reality link to Imagery, btw (and finally dropped publicly the promise of more browsers to come for it, it’s all Domburi from now on). Added Google Analytics tracking.


Domburi
Simple changes.

# Fixed logo to point correctly at home. Thanks volve!
# CSS fiddling for greater clarity, minor improvements, and cross-broswser compatibility.
# Added Google Analytics tracking.
# Height adjustment menu. A simple (though surprisingly troublesome) addition that makes Domburi much more useful, you can now adjust the height of the embedded windows and so can view  and compare two or three results at the same time! Imagine this with dragging and width-adjustment…

22 and 23/jun/07

Bad time management. Sorry. :)

24/jun/07

Domburi
Still nothing!

Not Reality # New Book Section! With great quotes and cool photocovers.

Remember to hard refresh (Ctrl-R) to see the most recent changes!