notes.husk.org. scribblings by Paul Mison.

2013-07-10

post/55114344464

photo 22:17:31
The transverse mercator projection drawn using the d3 JavaScript imaging library, based on a projection centred on the 0° and 180° lines of longitude by Mike Bostock.

The transverse mercator projection drawn using the d3 JavaScript imaging library, based on a projection centred on the 0° and 180° lines of longitude by Mike Bostock.

2012-03-20

Liquid ASCII and sharing code

text 09:54:05

Aaron Cohen, posting at jkottke:

It’s difficult to describe nkwiatek.com, but I will try to use my words. When you mouse over Nick Kwiatek’s site, red ASCII characters explode across your screen like those cheesy Javascript mouse followers with an effect that is as far away from those cheesy Javascript mouse followers as can be. It’s really pretty, and it makes me think of a murmuration of starlings.

What’s really nice about this is the discussion on Hacker News, including a back and forth between Kwiatek and Oliver Hunt, who originally wrote a Javascript implementation of a C paper about some similar effects in Alias|Wavefront. Hurrah for collaboration and shared algorithms.

2011-02-08

post/3187360730

quote 22:35:28
“ While 2% of U.S. visitors may not seem like a lot, keep in mind that over 300 million users visit the Yahoo! homepage each month. That means 6 million users visit each month without the benefit of JavaScript. ”
Nicholas C. Zakas on the YDN Blog, asking how many users have JavaScript disabled?

post/3187271181

photo 22:30:00
Apparently, the future is a vast blank whiteness, unless you enable JavaScript.

Apparently, the future is a vast blank whiteness, unless you enable JavaScript.

2010-10-16

post/1325204142

quote 05:14:54
“ I’m still bummed that I failed to talk you in to making #!/usr/bin/javascript work back then, because I think that we were still in the window where we had a shot at smothering Perl in the crib… ”
jwz in a comment on his post about JavaScript and numbers, - Every day I learn something new… and stupid.

2010-03-22

post/466148691

quote 19:34:09
“ The press will of course report this mainly as the site being “Hacked” rather than a very simple (and important) cocking up of pretty basic web security. ”

2009-07-26

Heroku, App Engine, and AppJet

text 11:04:00
When AppJet was still around, we had an edit button, a single page of a few dozen lines and a cross-domain AJAX API. This, surprisingly enough, was all you needed to apply some programmatic patching to a bunch of different use-cases

Jonathan Lister, from Joyent Smart Platform – a replacement for AppJet?

In it, he compares Joyent (nee Reasonably) Smart’s model, where you develop locally then deploy with git, to that of AppJet, where you edited online via a web form.

For a long time, I thought that the online-editing model was the right one, and I thought Heroku and App Engine suffered for not supporting it. However, when I was seriously working on my AppJet sites, I found that I ended up developing locally (with their .jar download), then wishing for an easier deployment method than copying and pasting between text files.

For any serious project (and most developers), I’m sure that pattern would be repeated. So why bother with the complex work required to put an editor into the browser (even if Bespin promises to be a drop-in component)? Better to concentrate on the deployment side, either building on a (D)VCS like git or using custom hooks, like GAE’s “appcfg.py update”.

He goes on to say:

I’ve said it before and I’ll say it again – I will pay for what AppJet were providing. People will pay for what AppJet were providing.

Unfortunately, this has a classic problem of having to build a market. Heroku can build on Rails programmers; GAE on Python and now Java developers. Smart has the harder job of getting people to write server-side JS, but at least there are people who think that way, and they can usually pick up git.

AppJet, on the other hand, was trying to persuade people who don’t think they can program that it’s really not that hard. This is a huge problem, and I can see why it’s far easier for their developers to sell real-time web based collaboration, since everyone knows how to write words.

I suppose this is a long winded way of saying that web-based server-side programming is still a way off.

2009-06-24

post/129589239

photo 22:55:00
At first, I didn’t really care about fixoutlook.org. Then I was slightly annoyed by Dave Cross tilting at the old windmills. Then I actually read Joe Clark’s evisceration of the campaign (via), and I realised I’m an old-timer who can be persuade to tilt at windmills too.
I mean, is it really coincidence that the time that email stopped being useful is the same as the time that hordes of users via Outlook (and Outlook Express, or whatever the cut-down consumer version that Microsoft deign to include in some Windows versions is branded as this year) started using it? Maybe. But it’s fun to think it’s not.
Meanwhile, I looked at the site itself, and as well as noticing that what seemed like half the usericons haven’t got off the last bandwagon yet, it was impossible to miss that it’s JavaScript is written badly enough to make Safari cry (see screenshot). Oh, and any campaign that tries to communicate with Microsoft via the medium of, er, Twitter? Right. OK. Well, I post privately there, so I suppose I’m not allowed to be part of your club. Never mind. Didn’t fancy joining.
(This post was brought to you by the ghost of 2lmc spool past.)

At first, I didn’t really care about fixoutlook.org. Then I was slightly annoyed by Dave Cross tilting at the old windmills. Then I actually read Joe Clark’s evisceration of the campaign (via), and I realised I’m an old-timer who can be persuade to tilt at windmills too.

I mean, is it really coincidence that the time that email stopped being useful is the same as the time that hordes of users via Outlook (and Outlook Express, or whatever the cut-down consumer version that Microsoft deign to include in some Windows versions is branded as this year) started using it? Maybe. But it’s fun to think it’s not.

Meanwhile, I looked at the site itself, and as well as noticing that what seemed like half the usericons haven’t got off the last bandwagon yet, it was impossible to miss that it’s JavaScript is written badly enough to make Safari cry (see screenshot). Oh, and any campaign that tries to communicate with Microsoft via the medium of, er, Twitter? Right. OK. Well, I post privately there, so I suppose I’m not allowed to be part of your club. Never mind. Didn’t fancy joining.

(This post was brought to you by the ghost of 2lmc spool past.)

2009-03-10

Keyboard Navigation In Tumblr

text 17:23:00

For a while, I’ve had a small bit of JavaScript into the templates of notes.husk.org that enables vi/ffffound/Google Reader style navigation with the j and k keys. Hit ‘j’ and the page will scroll to the next entry; ‘k’ and it will move to the previous one. It even handles paging (well, paging with j, anyway).

It’s not very complicated code, and (unlike the code at ffffound) it doesn’t handle scrolling by the user (as opposed to itself) nicely; nor does it handle going backwards very well. Nonetheless, it’s better than nothing, and it’s surprisingly easy to add. So, here’s the code. (Note that you’ll want each of your divs to have the ‘tumblr’ class, or you’ll want to change the code to match your HTML.)

        var posts = $("div.tumblr"), idx = -1;
        $(document).keypress(function (e) {
          if (e.which != 106 && e.which != 107) {
            return;
          }
          if (e.which == 106) {
            if (idx < posts.length - 1) {
              idx++;
            } else {
              // find link to older page
              link = $('ul.nav li a:contains(older)').attr('href')
              if (link) {
                if (!link.match(/^http:/)) {
                  link = 'http://'+window.location.host+link;
                }
                location.href = link;
              }
            }
          }
          if (e.which == 107) {
            if (idx > 0) {
              idx--;
            } else {
              // find link to older page
              link = $('ul.nav li a:contains(newer)').attr('href')
              if (link) {
                if (!link.match(/^http:/)) {
                  link = 'http://'+window.location.host+link;
                }
                location.href = link;
              }
            }
          }
          var top = $(posts[idx]).offset().top+1;
          window.scrollTo(0, top);        

(This was posted somewhat as a response to Aza Raskin’s post about keyboard navigation and implementing it with Greasemonkey. However, I agree with the commenters: ffffound sets the bar for this (and my code is, as I’ve said, nowhere near as good), and I find the scrolling jarring. I think I also prefer the use of j/k not the arrow keys, because users have expectations of the latter.)

2008-09-19

JavaScript Engines and the IE Hegemony

text 12:30:00

Another day, another JavaScript performance increase. This time, it’s the WebKit team, with the somewhat ludicrously named SquirrelFish Extreme, which manages a tenfold speed increase on Safari 3’s JSKit engine, apparently.

Oddly, it seems as if most of the work involved has been done under the auspices of the Summer of Code, Google’s programme to get college students involved in open source projects. Of course, the other newcomer on the JS engine block is their own V8.

However, good as all the competition between these two (and Mozilla’s TraceMonkey, due to be released in Firefox 3.1 and, like the others, available in pre-release form) is, it ignores the elephant in the room. As I commented on a PC Pro blog post about Chrome and Firefox (after the V8 talk at Google Developer Day), this progress is pretty much passing IE by.

John Resig’s recent benchmarks of JavaScript engines show that Internet Explorer 7 is awful, and IE8, although better, is nowhere near the performance of the released competing browsers, let alone the improved versions currently under development. Indeed, after one chart he has to note:

No results for IE were provided as the browser crashes when running the tests, unfortunately.

(To be fair, he does go on to say that Safari nightlies also failed on Windows.)

So, what’s the outlook? Clearly JS-intensive applications are here to stay, and I think we’ll increasingly see interfaces to them on the server side and possibly the desktop too. However, the developers of the most cutting-edge of these apps will either be held back by, or have to explicitly exclude, the most common browser in the world. Maybe that’ll be enough to keep Microsoft focussed on improving, and from the notes to a recent interview, it looks like they know it. Here’s hoping it works out.

what

more