2006-02-16

Xming + Xlaunch

Xming is a tiny (<13MB with all the optional components), free implementation of an X server for Windows, many times smaller than an alternative, Cygwin, my install of which is currently 344MB.

Until recently, Xming has been hard to use.. prompting someone to write Xlaunch; a wizard-like tool to make Xming work. Previous builds of it have had really stupid bugs (like, for instance, limiting the length of the machine name you were connecting to to 8 characters), but the latest version is better.

It's bundled with Xming, so all you have to do is download and install Xming, and run Xlaunch.. irritatingly, the 20060209 release didn't create a shortcut to Xlaunch, only Xming, you have to find and run it manually. It'll probably be at c:\Program Files\xming\Xlaunch.exe.

Simplest way to get it working: Multiple Windows, next. Start a program, next. Start program: xterm, Using putty. Here you need to fill in the machine you want to connect to, your username and password (unless you have ssh keys setup). Ignore the next screen, just hit next.

The next screen prompts you to 'Save configuration' which sensibly (yet irritatingly) doesn't save the password. This is ideal if you have ssh keys setup properly, but less so if you don't. It'd be fine if Xlaunch would prompt you for the password when running .xlaunch files, but it doesn't. So, if you don't have sshkeys, just click finish.

In theory, you'll get an xterm, running from the remote machine. If somehting goes wrong, you'll get nothing (no error, no warning, etc.), and you have to guess what went wrong, good luck.

If it does work, it's far faster and much more secure than vnc, and it doesn't kill the remote machine anywhere near as much, and the "multiple windows" feature makes it far more useful.


2006-02-07

Outlook 2003 + iCal.

I was trying today to get Outlook 2003 to accept an iCal feed (which turned out to be horribly out-of-date), but never mind. Dropping the file onto Outlook imported the first item in it, importing it using the Import wizard seemed to work, but this still wasn't quite what I wanted, the idea was to "subscribe" to the calendar feed.

The trick is to use Remote Calendars, worked straight away.

Thanks Alex, and 'Matt'.


2006-02-06

Windows XP SP2 + DEP

Since DoctorO removed AggressiveOptimize.h's broken optimisations from his Winamp plugins, I've been running Windows fine with NoExecute on "OptOut", ie. applications can choose not to have DEP applied to them.

Earlier, because I was bored, I decided to switch DEP from OptOut to AlwaysOn. More information on MSDN. This removes the option for applications to opt-out.

So far (ie. in about 10 minutes) the following things have broken:

  • Opera, closed on startup with a DEP error.
  • Firefox, dies on startup: 'XPCOM:EventReceiver' attempts to write to memory that it isn't allowed to.
  • Acrobat Reader, crashes after a few seconds of displaying the page with a DEP error.
  • Internet Explorer 6 has DEP errored once or twice, I'm guessing this is a plugin.

Other things (such as Java6, apache2.2, mysql5, all of the drivers I have installed, etc.) were suprisingly fine.

If I can get a working build of Opera, there's nothing else on that list that I particularily need.. Acrobat Reader is convenient, but it'll be nice to have something substantial to complain to them about...

Followup:

  1. Opera's issue appears to be that it's packed with ASPack, which just Doesn't Work, meaning their sales are going to drop off a bit at some point..
  2. Firefox's issue is, ironically, with the feedback agent. Deleting that fixes the problem.

The other two remain unstable, but IE is unnecessary now I have a non-IE browser working; and Acrobat Reader is now uninstalled.


2006-01-31

Instant Bot

I was bored, result: Low-byte-count lua-bot, to meet the specs on http://www.we11er.co.uk/ircbots/.

This could be made shorter by removing quite a lot of the whitespace, including, possibly the \rs. It could be made even shorter by shortening the variables names. It could be made faster by nesting the if-end blocks. It could (quickly) be made more flexible by not hardcoding the command and it's response.

Possibly the easiest way to make it shorter would be to export some of the code to a library (such as perl's MNet::IRC), which is, imho, cheating.

Etc.

Anyway, the code:

socket=require("socket")
tcp=socket.tcp()
tcp:connect("irc.uwcs.co.uk", 6667)
tcp:send("USER luabot 8 * :Faux's LuaBOT\r\nNICK LuaBOT\r\nPRIVMSG NickServ IDENTIFY password")

while true do line = tcp:receive() if line == nil then break end

,, pongkey = line:find("^PING(.*)$") if pongkey ~= nil then tcp:send("PONG" .. pongkey .. "\r\n") end

,, code = line:find("^[^ ]+ ([0-9]+) ") if code == "376" then tcp:send("JOIN #luabot\r\n") end

,, channel, args = line:find("^:[^ ]+ [A-Z0-9]+( [^ ]+ ):?!say (.*)$") if (args ~= nil) then tcp:send("PRIVMSG" .. channel .. ":" .. args .. "\r\n") end end

Have fun.


2006-01-31

Jjtree, Javacc and Javac.

I created a new branch of Choob today, so we could start work on implementing some form of loopback.

Anyway, Choob's build script includes calling jjtree and javacc to generate some of the ObjectDB parser. Just for fun, I decided to check if a new version had been released, it turns out one was released on the 2nd of January this year; version 4.0.

I upgraded, and ran it. JJTree runs through fine, but there's a problem with the files it generates: they all have the path at the top, like:

/* Generated By:JJTree: Do not edit this line. uk\co\uwcs\choob\support\ObjectDBClauseParserTreeConstants.java */

Note the \u in the above fragment of code.. also notice the / ... /, marking it as a comment.

This \u in a comment is, according to javac, a syntax error, which strikes me as very, very wrong. Some examples:

>sha1sum Test.java
fef20ace9697444325456db03715f4628449ae3c *Test.java

>cat Test.java
// \uwcs

>c:\java\jdk1.6.0\bin\javac.exe Test.java
Test.java:1: illegal unicode escape
// \uwcs
     ^
1 error

>c:\java\jdk1.5.0_06\bin\javac.exe Test.java
Test.java:1: illegal unicode escape
// \uwcs
   ^
1 error


>cp Test.java Test.cpp

>echo int main() { return 0; } >> Test.cpp

>sha1sum Test.cpp
cd994f7c35b84acdb882f5ddc738aeadc1511396 *Test.cpp

>gcc -v 2>&1 | grep version
gcc version 3.4.2 (mingw-special)

>gcc Test.cpp

>cl Test.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

Test.cpp
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:Test.exe
Test.obj

Both c++ compilers are perfectly happy with this code, neither of Sun's javac's are.

Hmm..

Update:

My patch of JavaCC/JJTree 4.0 to make it not break the java compiler on Windows platforms: diff of src/org/javacc/parser/JavaCCGlobals.java, binary (sig).


2006-01-25

OpenTTDIRC

I updated my patch for OpenTTD to add a simplistic IRC client today, it now builds fine against r3426, assuming you can add a single c file to your build scripts (I've only got it for Visual Studio 2005 (for which there isn't a project file in svn yet), so no matter what build system/os you're using it will need updating).

I belive it's cross platform, although I'm yet to check that as yet.

The current one is written in a MUD-style, with all the channels going into one window. For low-traffic channels this is equally, if not more effective than having multiple windows (especially with the cunning context-logging, so you don't have to /msg the same channel/person more than once in a row).

Mutliple windows really isn't practical, as far as I know no pure-IRC clients do non-MDI multi-windowing. A tabstrip could work, it'd also be resonably effective in other areas of OpenTTD (load/scenario/create-game dialog is effectively the same thing anyway, it just has a few different views, etc.), definitely worth looking into at some point.


« Prev - Next »