2011-01-30

Does JavaScript have a bytecode, like Java?

Update 2012-01-22:JavaScript myth: JavaScript needs a standard bytecode” is an updated version of this blog post.

The web and thus JavaScript is slowly turning into a great platform. Part of the allure of the (partially) competing Java platform is that it has a core that goes beyond “Java the language”: The Java Virtual Machine (JVM). There are now many languages that target the JVM, for example: Groovy, JRuby, Fantom, Jython, Scala, ABCL, Clojure, and Gosu. Java class files store JVM programs as Java bytecode, a compact binary format that source code is compiled to. Does JavaScript have something similar?

2011-01-29

Wrapping long lines in <pre> tags

To get long lines in pre tags to wrap, insert the following in the head:
    <style type="text/css">
        .wrapit {
            white-space: pre-wrap;
        }
    </style>
Then use as follows.
    <pre class="wrapit">
        ...
    </pre>
If you write “pre” instead of “.wrapit”, all pre tags will be wrapped and no CSS class needs to be specified. You can also directly insert the style information:
    <pre style="white-space: pre-wrap">
        ...
    </pre>
Flattr

jQuery Templates: quick start and tips

In this post, I present a short example that should explain the basics of jQuery Templates and quickly get you started. It also demonstrates a technique to cleanly handle separators between array elements. This technique applies to many other templating engines, so read on even if you don’t plan on using jQuery Templates.

2011-01-28

Meet the company that helped start Dropbox, Reddit, Diqus and others

In 2005, Y Combinator (YC) began a very smart and small-scale way of startup funding. In their own words:

Let a big company host your JavaScript libraries

Big companies often use Content Delivery Networks (CDNs). Such a network consists of servers spread all over the world that all host the same content which ensures fast delivery. Some CDNs also host popular JavaScript libraries for the public, for free. Dave Ward gives three reasons why you might want to use such hosted libraries instead of storing them next to your own code:

JavaScript HTML templating: overview and solutions

In this post, I give an overview over JavaScript HTML templating and list a few elegant solutions. I’ll also say which one I ended up choosing for a project of mine.

2011-01-26

My Twitter pet peeve: URL shortening (and a fix)

I love that Twitter enforces brevity, it only breaks down for one thing: URLs. In order to not waste precious characters, people turn to URL shorteners. Twitter even provides one by default. Shortened URLs such as http://goo.gl/ZeNmF are evil for several reasons:

What if Apple made MobileMe social and gave everyone an account?

Source: The Oatmeal
We all know that Apple’s Ping is quite ... underwhelming. Its existence seems unmotivated, a tepid me-too effort from Apple. And what’s with the name? If they wanted it to sound like a search engine, “Bong” or “Bang” would have been nicer.

What could Apple do to land a true hit? How about the following?

JavaScript hack: send the current web page to another server

Marco Arment explains how InstaPaper works its magic. In case you don’t know: InstaPaper has a bookmarklet that, when clicked on, uploads the current web page to the InstaPaper server. Afterwards, the page can be downloaded by one of the InstaPaper apps for offline reading. Naively, you would expect the bookmarklet to send the URL of the current page to the InstaPaper server which would then crawl the contents of the page. But that would not work with sites where you need to log in. Thus, Arment implemented the following hack.

2011-01-25

Rate of web deployment of microformats, RDFa, and eRDF (Sep 2008 - Oct 2010)

Spoiler: RDFa grew more than exponentially. The microformats hatom and hreview grew linearly. The remainder had negative growth. Chart after the break.

Scrolling: to proceed, move fingers up on touch devices, but down on trackpads. Why?

Category  “intriguing useless facts”: On Macs, you can use two fingers to scroll an area. But then you move your fingers in the opposite direction that you would on a touch device. Attempt at an explanation:

2011-01-24

If you know the answer to this question, you are old

Do you know the answer to the following question on Super User [via Terminally Incoherent]? If so, consider yourself old.

New device moves your eyelids for 3D without glasses

I am not sure that this is an improvement over glasses, but it is certainly intriguing: You attach a pair of patches to your temples and they move your eyelids so that you see pictures on a monitor in 3D. Picture and video after the break.

2011-01-22

Why you shouldn’t ad-block and ideas for better ads

Non-ad from reddit. Note the link for ranking underneath it (that is also used for real ads).
I really do get it: Many ads are atrocious and there are often too many many of them. But currently ads are the only way that free content on the web can be financed. So if you like free content, you probably should not block ads. An alternative to ads are voluntary micro-payments for content [1, 2], but they are not yet a viable source of income and never may be.
Instead of ad-blocking everything by default, I suggest the following approach:

Humor: Little girl answers the phone

Cute. The answer to “May I talk to the lady of this residence?” makes a lot of sense, after you have read everything.

2011-01-21

Christopher Lloyd (Doc from Back to the Future) is coming to Fringe

He’ll star in the Fringe episode “Firefly” (which airs to tonight, for those of you in the US). Spinoff Online has details, an interview, and a trailer. It seems that Fringe has hit its stride this season, all episodes have been received very positively by critics.

Update: Reviews:
[1] In some countries, the link only works if you first go to eonline.com and switch to “USA” at the bottom of the page.

Update 2: Fringe Flourishes On Friday Nights

HTML5 parsing

John Resig has written a post on HTML5 (most people seem to write it without a space before the “5”) parsing. Before HTML5, parsing was ad-hoc. Netscape was the first popular web browser and its lenient parsing lead to many web pages containing all kinds of syntactical errors (the HTML “tag soup”). Afterwards, other web browsers mainly tried to replicate the bugs and features of the Netscape parser. Bad news: HTML5 did not opt for a much cleaner syntax. Good news: There is now a specification about how to parse HTML. It makes the tag soup the de facto standard. While it is scarily technical (you didn’t expect a grammar, did you?), it does bring stability for browser implementers.

Guess what programming language grew most in popularity in 2010?

TIOBE Software published its annual TIOBE Programming Community Index. The ranks are led by the usual suspects Java, C, C++, and PHP. But the language that grew most in popularity in 2010 was a bit of a surprise:

Give me something to read

Great idea: This website is...
A hand-picked selection of the finest articles and essays saved with Instapaper.

You wanted cute dog pictures?

Here you are. Preview:

Mac OS X Preview wastes space with bitmap PDFs – a work-around

This happened to me recently: I had an 11MB bitmap PDF and wanted to rotate all pages. After I did that and saved it, its size had grown to 31MB. I did some searching and found a way to do this with a command line tool: pdftk. With pdftk, the file stayed the same size after rotation.

2011-01-20

JavaScript’s strict mode: a summary

Update 2011-10-28: JavaScript: Why the hatred for strict mode?

Douglas Crockford has written a nice post on the strict mode (source: Matthias Hölzl). The following is a summary of it.

Wish: manual rotation for the iPad

Right now, we have the following two options on the iPad:
  1. Auto-rotation, triggered by the gyroscope (gravity sensor): is fickle, but quick and easy to understand.
  2. Screen rotation lock: If you want to change the orientation, you have to unlock, ensure that the gyroscope notices the new orientation and then lock again.
How about a third option: Manually tell the iPad to change its orientation. This could be added to (2), e.g. via a gesture. The gyroscope-less iPod nano already works like this. Benefits:
  • Newcomers are often intimidated by auto-rotation. Manual orientation setting might help them.
  • It would make the iPad ready for zero gravity. How else are you going to change the iPad’s orientation if you are an astronaut in outer space?
This post has been partly inspired by Marco Arment’s post on “hot zones”.

Wi-Fi Direct: use Wi-Fi like Bluetooth

Interesting technology. Wi-Fi Direct allows devices to talk to each other in a manner similar to Bluetooth (Engadget has details). I see a lot of overlap with Zeroconf (Apple’s Bonjour, Microsoft’s Universal Plug & Play): You need to see what services are available in your environment and you need to be able to connect to them. For Zeroconf, the environment is the LAN you are currently in. For Wi-Fi Direct, the environment includes any supported device within close range. I wonder how much Wi-Fi Direct is compatible with other protocols. It would be a shame to have yet another protocol for service discovery.

Wi-Fi Direct probably supports pairing and that is also useful for Zeroconf. For example, by locking your printer away, you can prevent people on your LAN to print on it.

The three contexts of device interaction

The iPad game “The Incident” controlled via an iPhone [source: CNET].
The history of computing has seen many different ways of interacting with devices and new ones are invented frequently. This post groups these interactions into three contexts and then discusses what they mean for the future of device interaction.

2011-01-19

Brendan Eich’s dream for the next version of JavaScript

Harmony is the code name of the next version of JavaScript that is currently being worked on. Brendan Eich (the creator of JavaScript) outlines what his ideal Harmony would look like.

Computers beat humans at Jeopardy

The supercomputer “Watson” plays jeopardy. The box at the bottom shows three possible answers Watson came up with and its confidence (in percent) in each one of them.
Quite an impressive feat: An IBM-built supercomputer won against two humans playing Jeopardy. Note that the questions were not typed into the computer, it had to understand them when spoken. This shows that much progress has been made in natural language processing, but it still has to be a limited domain, where, I assume, questions follow certain patterns. Engadget has details and a video.
There is a HAL-like animation on the screen of the computer (which is even mentioned in the Wikipedia article on HAL). As an aside, what acronym do you get if you advance each letter of HAL one position in the alphabet? This has been rumored to be the source of the name, which has since been denied by the author.

Dealing with demanding people

I see it every day: The more popularity, responsibility or power someone has, the more others want from them. Thus, what one needs is a way to manage these demands without appearing unfriendly. The following points can help.

2011-01-18

Branding web technologies and the new HTML5 logo

The branding of HTML5 continues: It now has a logo and t-shirts.

CSS3 Grid Layout is perfect for webapp GUIs

Prior solutions

Previously in the realm of webapp GUI layouting:
  • There were a number of interesting proposals to adapt CSS layouting to the needs of GUI application developers. None of them really took off.
  • Some JavaScript framework authors took matters into their own hands and implemented surprisingly capable layout on top of traditional CSS. Others (such as Qooxdoo) perform layout calculations in JavaScript and recompute the layout every time they receive a resize event. That is not as smooth as relying on CSS, but leads to more capable solutions.
  • Palm presented Enyo, a framework that allows one to dynamically change layout depending on the size of the screen (think cell phone versus tablet).

Grid Layout

Now there is a new proposal out, by Microsoft. It is called Grid Layout. It has got everything one could wish for: Define a grid with flexible and fixed columns and rows, place your HTML elements on that grid, etc. It has the hitherto unavailable option to let content occupy the minimal space possible (e.g. vertically, in a horizontal toolbar at the top of a view). In current CSS-driven and JavaScript-driven solutions, you need to specify pixels as a work-around and that is a very fragile solution.

Satarii Star Accessory: a stand that lets your iPhone video camera follow your moves

The Satarii Star Accessory is a stand that swivels so that the iPhone’s video camera is always focused on you. “You” in this case means whoever carries a clip-on remote with them, so this has many applications. One example that comes to mind is capturing a video of someone who holds a presentation or lecture. It can be especially useful while practicing, because you get a good look at yourself without having to involve other people. The project is crowd-financed and currently still shy of its goal of $20,000. Check out their web site and introductory video. More details:

Kijjaa: a webapp remotely controlled by an iPhone

When you buy the iOS game Kijjaa, you are actually buying the remote control. The real game is Flash-based and started via a web browser, usually on a desktop or notebook computer with a large screen. I like the idea. Clearly, they are managing everything via their web server and this makes sense, because it is convenient and allows them to easily upgrade the game. I can also imagine the iPhone itself serving this kind of game (mirroring some of the ideas in my post on cloud computing).

[Source: Engadget]

2011-01-17

Schwarzenegger might return to acting

The Austrian newspaper “krone.at” has a three part interview with Schwarzenegger (part 1, part 2, part 3). A few tidbits:

Will iTunes and Safari be merged?

Interesting article on MacRumors: “Questionable Rumor Claims Safari and iTunes to Merge Into Single Application”. A complete merge does not seem like a good idea, iTunes is already much too bloated and I don’t see how browsing the web fits with browsing your media. What does make sense, though, is to move the iTunes store, and possibly other means of acquiring media, to the web. Amazon lights the way with its Kindle bookstore: Its combination of website for purchase and app for consumption is perfect. A web-based iTunes store would have the following advantages.

Measure your body temperature from 30cm away

The above mirror is able to measure your body temperature from 30cm (ca. 1ft) away, via infrared sensors. This should solve many hygiene hassles. [Source: Engadget]

Dealing with hostile people

Dealing with hostile people is difficult, because they often expect to be loved for hating you, much like a child communicates with a parent. But you are not their parent and thus should not have to put up with their hostility. Here are a few tips that make things easier for everyone involved.

2011-01-16

Flattr or how to finance web content

One of the greatest challenges of the web has been how to pay the people who produce (freely accessible) content for it. For example, you find an article you like and would love to support the author, but don’t know how. Or, it’s paid content that usually costs too much and does not allow you to see in advance if it is worth its money. Until recently, there was no middle ground between free and too expensive. And it hurts publishers. Ideally, a publisher would write a free article that, thanks to it costing nothing, is read by, say, one million people. If each of those people paid one cent, the author would earn $10,000. To make small donations viable, there has to be a company that aggregates the money that is spent and the money that is earned. But it is not easy to get such a company going, because you need both publishers and consumers on board. Flattr, a Swedish company, is currently giving micro-financing web content (text, software, music, etc.) a shot.

Faking bookmark separators in Chrome

Chrome does not have bookmark separators like Firefox’s. This post gives you an approximation.

2011-01-15

Blogger: show ads inside posts (not between)

This post explains how to show Google’s Adsense ads directly after the content of each post, before the comments. Currently, one can only show them after a complete post, which means that they will be pushed back to the very end on single-post pages.

Kevin Spacey on keeping Keyser Söze’s identity secret

Kevin Spacey tells a fun anecdote from the shooting of “The Usual Suspects” [itunes.com, itunes.de]:
Bryan Singer, who directed that film, had managed to convince every one of the major actors in that movie that they were in fact Keyser Söze. I remember when we screened it for the company of actors, Gabriel Byrne was stunned that he wasn’t Keyser Söze. Went out into the parking lot and had an argument with Bryan Singer. For a half an hour. [Source: Spinoff Online]

More blogger annoyances and suggestions

Much has happened since my last “wish list” for blogger: The new editor is great and fixed many of my complaints. Some of it still stands, and I have a few more things that I would like to see improved. This post may come across as bitchy, but I’m very happy with Blogger, in general. It gives you a lot of freedom (ads...) and its styles look good (much better than what Wordpress offers).

A computer game that can actually scare you?

Amnesia: The Dark Descent” seems to be such a game:
How many games have you played that were so spooky you actually had to stop playing them at one point to catch a breather? Usually when the game tells you “hey, you have to go back to the scary area™” you go “bring it on – I know where the monsters are now, so I’m no longer afraid”. When Amnesia told me I had to go back to the Choir area I said fuck that shit, and went to browse reddit for a bit, because I was totally not ready to re-experience it after the first time. [Terminal Incoherency]
Great idea: it’s a monster game, but you are just Joe Normal running away from them – no heavy guns or magic shields. That means you will relate to your game persona, which seems to make the game scary.

2011-01-14

CoffeeScript versus paren-free JavaScript

CoffeeScript is a new syntax for JavaScript. The idea is to fix some of JavaScript’s deficiencies while staying so close to it that one can handle the “compiled version” in an emergency. I like the idea, but not all of it is an improvement. This post will first critique CoffeeScript and then present Brendan Eich’s simplified “paren-free JavaScript”.

2011-01-13

Reading modes: iPad versus Kindle

  • iPad: Skim content, go back and forth quickly. I’m in this mode when I read technical books that teach me something. Then the Kindle’s display is too slow.
  • Kindle: Calm sequential reading, no distraction. I’m in this mode when I read fiction or more narrative non-fiction. Then I don’t want to be tempted by web and email and don’t want the slightly eye-straining backlighting.
Related posts:

Gimp on Mac OS X

Gimp is a free drawing program with a slightly quirky user interface. The Mac version runs on X11 which is a window environment that is used on most non-Mac Unixes and results in it not being a “true” Mac application. It is still very useful, though. Tips:
  • Snow Leopard has X11 installed by default, no need to do anything but download Gimp.app.
  • Gimp shows its tool palette in a separate window where one always needs two clicks to make something happen (one to activate the window, one to do something). To fix: go to “X11 → Preferences → Windows”. You have two options:
    • Click-through Inactive Windows: Performs window activation and an action with a single click.
    • Focus Follows Mouse: Automatically activates the window under your mouse cursor.

Two useful Gimp features

I frequently use the following two Gimp features:
  • Remove empty space around an image: There are two ways to do this.
    • With the possibility of manual adjustment: Go to the “Rectangle select tool”, select something, click on “Auto Shrink” in the toolbar. Next invoke “Crop to Selection” in the “Image” menu.
    • Automatic: Invoke “Autocrop Image” in the “Image” menu.
  • Finding out the best compression ratio: If you save a lossless image format such as PNG to a more compact format such as JPG, you can get a live preview of how the compression affects image quality. Very useful for trying out different settings.

Displaying sheet music in html


From the VexFlow website (via munichjs):
VexFlow is an open-source web-based music notation rendering API. It is written completely in JavaScript, and runs right in the browser. VexFlow supports HTML5 Canvas and SVG.
Looks great, try zooming in.

Apple might remove the home button on iPhones and iPads

Apple seems to be testing iPhones and iPads that don’t have home buttons, any more. Fascinating that we have heard about button-less designs from Android, first.
Making the use of the button optional is a good idea, because it changes (relative) position if one rotates the device. But eliminating the button completely does not make sense, because it is useful for beginners. Gruber has more arguments in favor of keeping the button:
How in the world would you get home on an iPhone using a five-finger pinch while holding it one hand? The iPad seems like a “maybe”, but I find it really hard to imagine a Home-button-less iPhone. And even with the iPad, what about people who don’t have five fingers on one hand? No iPad for them? The iPad is very popular with impaired users. What about taking screenshots?

2011-01-12

Survey: Google drops native H.264 video support in Chrome

The news, as announced on Google’s Chromium blog:
  • Google will no longer support H.264 as an option for native HTML5 video.
  • They push WebM (VP8) and Theora as alternatives.

Web game: type words to shoot

In Z-Type you type words to shoot. It all works without Flash, even the sound. [Source: munichjs]

Project Denver: NVIDIA builds a desktop microprocessor

This is big news (announced 2011-01-05):
  • NVIDIA partners with ARM to build a high-performance processor code-named “Project Denver”. Read as: fast enough for desktops and laptops.
  • ARM is already completely dominating the cell phone and tablet space (chips based on its architecture are in all Android and iOS devices). This will make it a serious contender for desktops and laptops.
    • Case in point: Microsoft will port Windows to ARM.
  • It’s great that Intel will get some competition. AMD has not really been up to that task in recent years. Power consumption is becoming an increasingly bigger issue for servers (electric bill) and for consumer machines (compact, fan-less designs), so Project Denver could be very attractive.
  • Apple is already making many of its desktop machines as small as possible and uses mobile processors in iMacs and Mac minis. Maybe they will use the chip in Macs. This migration would require quite a bit of work (and thus might not be worth it), but Apple has the technology to do so, as poven by its migration from POWERPC to Intel. iOS can already be considered a port of Mac OS to ARM.
As if that wasn’t enough for NVIDIA, Ars reports on “Intel/NVIDIA bombshell: two rivals team up”:

2011-01-11

2011-01-10

Lego robot santa

Looks really cool. Below you can see the original version from Futurama.
[Source: Terminally Incoherent]

Humor: Greenspun’s Tenth Rule of Programming

This post is nerd humor, so beware. The following rule was written around 1993:
Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.
One of the follow-ups is hilarious:
…including Common Lisp.
If you are looking for the other nine rules, you are out of luck, as Greenspun himself explains:
Sorry, Han-Wen, but there aren’t 9 preceding laws. I was just trying to give the rule a memorable name.

The Light Peak saga continues: now “ready for implementation”

Update 2011-02-25: Thunderbolt (code-named Light Peak): an overview

The Light Peak saga [1] continues [Computerworld via Engadget]:
  • Light Peak is now “ready for implementation”.
  • The initial version of Light Peak will not be optical. Quoting Intel:
    “The copper came out very good, surprisingly better than what we thought. [...] Optical is always a new technology which is more expensive.”
    How easy will it be to upgrade later on? Future Light Peak ports would have to handle both copper and optical cables.
That means that the next Macs or MacBooks will probably have Light Peak. But Apple’s mobile devices will not (yet), because as far as I know, the mobile version of Light Peak is still being developed.

2011-01-09

Movie: My sister’s keeper (2009)

My sister’s keeper” [amazon.com, itunes.de] is one of the saddest movies I have ever seen, without being depressing. Amazing performances by all actors, especially by the kids. The mother’s drivenness is the main cause of conflict in the movie, but thankfully the script (and Diaz) refrain from vilifying her. I wonder if the book the movie is based on is as good as the movie. [Source of movie cover: Amazon]

Google’s Duarte on Android Honeycomb

Engadget has a great interview with Matias Duarte on Honeycomb. Honeycomb is the newest version of Android and currently in development (guided tour at Engadget). About Duarte:
  • His position is “Director of Android User Experience”
  • His main credentials are that he was the designer of WebOS. Google hired him away from HP.
  • The design vision he brings to the table is one of the greatest threats to Apple. So far, Android has mainly had a great development team, but lacked a coherent design.
Most important points of the interview:

Alternatives to the Mac app store for developers

Michel Fortin argues that a Mac developer should maintain two versions of his/her app: one in the app store, another one sold separately.

2011-01-08

VLC: gone from the iOS app store

Sad. VLC on the iPad was a killer app, because to watch a video, you just copied the file to the iPad and were done. No transcoding, no importing into iTunes. Here is some background on why it happened:

New device APIs for web browsers

The “Device APIs and Policy Working Group” (DAP) is working on several interesting APIs:

2011-01-07

Browser keywords: using the address bar as a command line

Keywords are commands you can enter in the browser address bar to quickly go to a website and perform, say, a search.

Bookmarklets: quickly link to a website

Copying links to web pages is tedious, because you have to go to them twice in order to copy both URL and title. The following three bookmarklets help speed up that process by letting you copy everything in one go. Click on a link to try it out or move it to the bookmarks bar to use it later, on any page.

Bookmarklets: simple plugins for your browser

A bookmarklet is a bookmark whose URL (web address) contains a small program that does something useful with the currently displayed web page. To execute the program, you click on the bookmark.

Going completely prototypal in JavaScript

Update 2011-06-25:Prototypes as classes” is an improved version of this blog post.

In this post we present the Proto API which implements inheritance in JavaScript in a purely prototypal fashion. This contrasts it with all other JavaScript inheritance APIs that the author is aware of.

Future-proofing surround sound

Home theater surround sound is currently transitioning from 7.1 to 9.1 which has the drawback of needing to re-encode all 7.1 content. The following idea would make audio content independent of the number of speakers:
[...] record where the audio is supposed to come from, instead of which speaker it should be played on. This way a movie would never need its audio remastered again, because the fact that the plane coming in at 2 O'Clock wouldn't change no matter how many speakers you had, it wouldn't even matter if you had a speaker placed precisely at 2 O'Clock. So basically your AVR [audio/video receiver] would render the audio on the fly based on the number of speakers, and where you placed those speakers by using the recorded sounds and the data about those sounds.

2011-01-06

More Mac app store news: user experience, prices, etc.

Related post:

What is the best way to combine a cell phone and a laptop?

The Motorola Atrix cell phone in its laptop-like “docking station” [source].
Motorola is taking another shot at the idea that a cell phone is mainly a computing core and only needs a full-sized keyboard and a larger screen to become a laptop. It’s been done before and I think it mainly appeals to engineers who, because they are trained to see patterns, tend to abstract too much. Is there a better solution for integrating the myriad of devices we own? How about the following?

2011-01-05

Reflection and meta-programming in JavaScript

JavaScript is relatively weak when it comes to reflection and metaprogramming. Let us see what you can and cannot do. This post uses some of the standard methods of ECMAScript 5 (ES5).

2011-01-04

Expectations of iOS developers moving the the Mac App Store

Nice piece at Mac Rumors. Prices largely stay the same, expected sales range from 10% to 200% of the iOS version.
I’m surprised that so many iOS developers seem to make the jump to Mac OS. This might well be one of Apple’s most clever moves. They leverage that all of their devices (with the exception of the smallest iPods) run the same operating system. The app store has the potential immensely increase the Mac’s appeal, especially for casual gaming. I wonder how much the iOS origin will show (negatively) in the user interface of the ports.

Related post:

Three JavaScript shells

A JavaScript shell (interactive command line) is great for trying out stuff. This post shows three ways of getting such a shell.

Tip: get all Unix console programs to support arrow keys

It is a major nuisance: You run a Unix program on the console, it wants text input from you, but all you can do is type and remove the most recent character. No arrow keys and no input history. Java console programs are notorious for this. A work-around is to use the Emacs shell mode as follows:
  • Start Emacs. Use the -nw (no window) option if you want to start it inside the console.
  • Type Esc-X “shell” Return
    • Now text input is much more comfortable. 
  • History: Esc-P goes to previous text input, Esc-N moves forward in time. You can also just move around the screen with the arrow keys, edit and hit Return.
  • Leave Emacs via Ctrl-X Ctrl-C.

NASA names most and least realistic sci-fi movies of all time

One realistic movie that immediately came to my mind was “2001” [itunes.com, itunes.de],  which was largely hard sci-fi. Another one is “Minority Report” [amazon.com, amazon.de] for whose technology Spielberg consulted researchers. Both movies contain fantastic elements that probably turned NASA off and show how difficult such lists are to make. Also amusing that NASA files “What the bleep” under sci-fi. See their choices below.

2011-01-03

3D music video rendered live in a web browser

The music video “Flight Of The Navigator” is rendered live in a web browser and includes 3D graphics (thanks to the new 3D graphics support in browsers via WebGL) and embedded videos. You need the latest Firefox or Chrome betas to watch it (in theory, at least; Chrome did not work for me).

2011-01-01

Two cogent analyses of the state of mobile computing

The following are two nice analyses of the state of smartphone computing. I like reading anything that does not make the assertions that “Android is open” (what does that actually mean in practice?) or that “Android is Windows” (a flawed analogy).

Sencha’s Top Ten HTML5 Wishes for 2011

Sencha (creators of ExtJS) has published their wishes for HTML5 in 2011. I would love to see more operating systems make web applications first-class citizens. Currently, the only ones that do, that I am aware of, are Chrome OS and Web OS.

97 Things Every Programmer Should Know

I usually hate lists that say “x things that y” whenever x is larger than 7 (or if I think that y is boring). But “97 Things Every Programmer Should Know” [uk, de] is a great, if completely unorganized, collection of software engineering ideas. The complete content is available online for free. It should be read more like a software engineering calendar with the idea of the day than a systematic introduction to a topic. As an example, I liked “The Golden Rule of API Design” which says that if you want your API to be truly useful, you have to make sure that programs that use it can be tested. That is, you have to test programs that use the API, in addition to the API itself.
[Source: Raja Kannappan]

Programming languages based on JavaScript VMs

I’m still getting used to the idea that one delivers programs for JavaScript virtual machines (VMs) as JavaScript source code and not in some kind of binary format. With parsers being fast, there is just one more intermediate step that is only performed once, when loading a program. Once the feeling of weirdness wears off, it seems logical that people would implement programming languages on top of JavaScript, especially with recent speed advancements that happened for JavaScript VMs. This website is a comprehensive listing of all programming languages that have been “ported to” JavaScript.

Related post: