Emacs JavaScript mode
Here's my update to an old javascript-mode (authors Steven Champeon and Ville Skyttä). In essence, I was unhappy with indentation, but I also removed some stuff that I don't need and fixed various small things, such as highlighting literal regexps.
The indentation is based on CC Mode, which is almost Good Enough for JavaScript; the original javascript-mode.el (note that I'm talking about the version I had back in 2004; they might have fixed it in between, but I don't think so) had some indentation problems, for examples in cases like this:
DynarchLIB release
I finally released probably the biggest projects that I've independently worked on. DynarchLIB is a fully-fledged user interface toolkit for development of Web applications. It contains a rich set of widgets, a consistent object/event system, browser-server communication helpers, various JavaScript extensions, etc. Worths checking it out. ;-)
Also see the Dynarch online chess, currently the first public application based on this toolkit.
PS: the administration frontend of this very site is based on DynarchLIB as well. ;-)
A movie Subtitle Editor
A few days ago I wanted to create Romanian subtitles for a movie that I want to watch with my friends. After Googling around I found 4 projects that claim to do this in Linux. These are:
- gnome-subtitles
- ksubtile
- subtitleeditor
- gaupol
All of them seemed very disappointing.
Firefox slowness identified
I talked previously about the Firefox problems on Linux, however, I now identified a case that can reproduce the slowdowns. It happens when you have a lot of text in some element. Even if that element is displayed with overflow: auto, or overflow: hidden, it'll be slow as hell to drag'n'drop it. Additionally, all operations seem to be a lot slower in the whole page (that is, even if they don't directly affect that element).
Here is a demo that shows the problems. If you're running Firefox on Linux the poor performance should be easy to see; if you're on Windows, use more lorem ipsum. ;-)
If you have any idea how to work around this issue, I would love to know it—please share your thoughts by commenting in this page.
The fastest browser on Earth
I never thought I'd say this, but here I go: Safari is the damn fastest (modern) browser on the planet. Nope, it's not Opera, not Firefox and definitely not IE.
I'm playing with Safari 3.0.4 on Windows and it simply rocks. The rendering engine is quite good as well—I'm doing pretty heavy AJAX stuff and there was no special hack I had to do for Safari. So let me congratulate the WebKit team for this fine product! (I still can't forgive Apple for using KHTML instead of Gecko; Gecko is better, it just needs to catch up with performance and it looks like this is going to happen in the next release).
Dynamic Firewall for PPPoE
Until a few days ago, I had a TV cable-based network connection. I had a fixed IP so it was easy to configure firewall in various machines that I can access to allow access only from my home IP. And I was happy.
My ISP has recently moved me to a more robust, Ethernet connection, which is done via PPPoE. All great, but the IP is changing every time I connect. That wouldn't be a problem if I never had any downtimes, but in practice this is not possible. Every once in a while, my router will reconnect and will get me a brand new IP and machines where I configured a firewall won't let me in.
( read more... )
Close last XML tag (Emacs)
I'm using Emacs for almost 10 years, but still I never wrote too much about it. Partly, the reason is that I'm not an Emacs guru (although I'm using it for 10 years, imagine that). Emacs is so functional in itself that you don't have to become a “guru” to like it (by “guru” here I mean someone who can bring substantial improvements by writing Lisp code, such as writing a major mode).
I'm using Emacs for most my editing needs. These include, sometimes, typing text in a <textarea> in Firefox (there is a nifty extension called “it's all text” which allows you to use a decent editor to type in those rough boxes). I also frequently use Emacs for typing email (check Wanderlust if you haven't already, one of the best email clients I ever used). And obviously for writing source code of any kind—XML, JavaScript, Java, C, Perl, Python, Ruby—you name it, we have it. I remember a great saying by Paul Graham: “all other things being equal, it's a bad decision not to chose the best programming language for your problem” (that's not ad literam what he said, but you get the point).
( read more... )
ExternalInterface is unreliable
“What are you supposed to do if you're the chef at Les Halles
and your fishmonger is giving you smelly fish?”
So while playing with ExternalInterface I found quite a big problem with it. It's serious enough to call it “unreliable” because it mangles your data in strange and undocumented ways. Here's a quick Flash applet to demonstrate that:
( read more... )
What a lousy day
[ feel free not to read this ]
Initially I wanted to write about ATI, but then you'd say “come on dude, again?!”. Yeah I fucked up my day trying to install, for the zillionth time, this lousy driver. All day.
Flash's ExternalInterface and IE
Grr, I lost the whole day yesterday fighting this up. Flash (starting from version 8 I think?) has this magic ExternalInterface API, which is quite useful. With it, you can define an API for your SWF that external JavaScript will be able to access (almost) as if your flash object was a JS object. Also, using ExternalInterface you can call JavaScript functions from Flash.
Ati spits a new driver for Linux
Heard the news? ATI AMD finally releases a new driver for Linux which brings the long awaited AIGLX support. AIGLX is cool stuff. Great work, although it's kind of late—since most other producers had it long ago.
Unfortunately, the suspend/resume problems seem to be still in place so I think I'll just stick to VESA for now... But hey, there is hope—since they brought us AIGLX by the end of 2007, I think we'll have suspend/resume working some time next year. Grrr.
Update.
Couldn't resist so I spent half a day trying this driver. For one thing, it didn't work because my hardware is unsupported. Applied the patch, messed with the ChipID option, finally got it to work. It was damn slow for 2D, so slow actually that I'd be happy to revert to VESA any time.
But let's keep trying. After these new hacks in xorg.conf it was about as fast as VESA. What can I say—cool, they finally match the performance of a general, unoptimized driver. I expected better, but I can live with it.
Let's try AIGLX now. apt-get install compiz 'n shit, finally killing sawfish (still my preferred window manager) and trying to start compiz results in an error (err... forgot what was it. I'd love to paste, but I can't since I upgraded to VESA since). OK, they claim to support AIGLX, but compiz doesn't really work—no problem, maybe it will later. LATER. I mean, in a few years or so. No problem.
Let's try suspend. Oh, it WORKS. How cool is that? My machine suspended. Now let's RESUME IT! And... you don't wanna hear the rest of the story...
So I switched back to VESA. I'm happy. I can suspend/resume. Compiz doesn't work (but Sawfish is so cool and so.... Emacs-like.). I bet that moments after I'll have bought a new laptop, which definitely won't have any AMD label on it, their crap driver will work just fine. I bet. But I won't be giving them any more cents...