History meme

April 15th, 2008 by Leons Petrazickis

Substantial content is in the pipes, but in the meantime here’s Arve Bersvendsen’s history meme:

history | awk ‘{a[$2]++ } END{for(i in a){print a[i] " " i}}’|sort -rn|head
 

In my cygwin:

52 python
44 ssh
33 exit
33 cd
18 ls
7 java
5 diff
4 nano
2 ping
1 svn
 

And on a Linux machine I administrate:

211 sudo
92 ls
80 cd
34 locate
14 nano
6 rm
6 exit
6 cp
3 tar
3 python2.4
 

I can survive in vi if pressed, but nano is my text-mode editor of choice. I do serious Linux development in Eclipse, Kate, or Kdevelop.

Posted in Uncategorized | No Comments »

An IDE for TeX

March 4th, 2008 by Leons Petrazickis

TeXnicCenter is an excellent IDE for developing TeX documents on Windows. It follows the usual interface conventions and is quite helpful in getting started and debugging. TeX is the standard page layout language for writing mathematical and scientific papers.

Here are some excellent tutorials for getting started with TeX.

The IDE requires MikTeX for actually compiling TeX files into PDF, PS, and so on.

Posted in unix, tex | No Comments »

Unknown root password in Suse Linux

March 3rd, 2008 by Leons Petrazickis

After I installed Suse Linux Enterprise Desktop 10, I tried to update it. It prompted me for a root password even though the install hadn’t asked for one — it had only created a regular user. Sudo didn’t help.

I tried booting in single-user mode, but that also prompted me for the root password.

Finally, I appended init=/bin/bash to the Linux boot command in GRUB. That booted me in a passwordless command line, letting me run passwd and fix things.

Posted in unix | No Comments »

Repair Table failed. Please run Repair Table.

March 2nd, 2008 by Leons Petrazickis

One of the tables of my MediaWiki installation crashed. When I tried to repair it, I got this less-than-helpful error message. So did the mysqlcheck utility when I SSHed to the server. However, the command has extra options that can be used to repair high levels of corruptions, such as when the MYI is missing.

REPAIR TABLE tablename USE_FRM;
 

Posted in mysql | No Comments »

Jaxer; Ameliorating IE8

January 23rd, 2008 by Leons Petrazickis

John Resig writes very positively about Jaxer. It runs Javascript on the server while serving documents to the client, with seamless communication between JS on the client and JS on the server.

Jaxer provides:

  1. Full DOM on the server
  2. Shared code between client and server
  3. Database, file, and socket access from JavaScript
  4. Familiar APIs
  5. Integration with PHP, Java, Rails, etc. apps

In other news, IE8 will use the latest rendering mode by default for documents with the HTML5 doctype:

<!DOCTYPE html>
 

Finally, Good Math has a published a good defense of Google’s MapReduce algorithm.

Posted in javascript, ajax, html | No Comments »

HTML5 now a Working Draft

January 22nd, 2008 by Leons Petrazickis

Woot!

Posted in html | No Comments »

One step forward, two steps back

January 22nd, 2008 by Leons Petrazickis

After an internal build of Internet Explorer 8 passed the Acid2 test, they’ve announced that the new engine will only be used for sites with a special, opt-in meta tag:

<!– IE8 engine –>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<!– latest engine –>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 

It can also be triggered from the server via an HTTP header:

X-UA-Compatible: IE=8;
 

Firefox is unlikely to follow suit.

In other news, John Resig has done some testing on sub-pixel rounding across browsers.

Posted in javascript, css, html | No Comments »

Dean Edwards releases beta of base2

December 20th, 2007 by Leons Petrazickis

Base2 has just come out in beta on Google Code. It’s hosted there and can be included straight off the Google Code server.

I think it’s a really neat library because it basically fixes all browsers so that the built-in DOM, events, etc work the same way. Instead of providing an API of its own, it makes the existing API work consistently and reliably.

Base2 Features:
- A fast implementation of the Selectors API
- Fixes broken browser implementations of the DOM events module including document.createEvent(), dispatchEvent(), addEventListener(), etc
- Supports DOMContentLoaded
- Fixes getAttribute()/hasAttribute()/setAttribute() (Internet Explorer)
- Implements a few other useful DOM methods like getComputedStyle() and compareDocumentPosition()
- Supports a variety of browsers including ancient browsers like IE5.0 (Windows and Mac)

Dean Edwards has also done the excellent Packer Javascript minifier. It has probably the most in-depth support for obscure language features that simpler minifiers tend to mangle.

Posted in javascript, ajax, base2 | No Comments »

How to enable logging in python-ldap

December 18th, 2007 by Leons Petrazickis

When writing Python scripts which rely on python-ldap and openLDAP, it is often useful to turn on debug messages as follows:

import ldap;

# enable python-ldap logging
ldap.set_option(ldap.OPT_DEBUG_LEVEL, 4095)

# enable openLDAP logging
l = ldap.initialize(‘ldap://yourserver:port’, trace_level=2)
 

This is also useful when debugging the LDAP Plugin for Trac.

Posted in python, ldap, trac | No Comments »

ECMAScript 4

November 8th, 2007 by Leons Petrazickis

John Resig has posted a whitepaper outlining the new features in ECMAScript4 (aka the Javascript standard), how it differs from ECMAScript3, and the rationale for any incompatibilities.

Many of the features have already made their way into Opera and Firefox, which is at Javascript 1.7 level. ES3 is equivalent to JS1.3, and ES4 is the basis for forthcoming JS2.

I look forward to optional strict typing, multiline strings, comprehensions, and generators making their way into browsers. A lot of the new features make Javascript more like Python without losing all the nice things tabout Javascript.

Posted in javascript | No Comments »

« Previous Entries