All Entries for 2003

Weblog Entries for September 2003

Friday, September 19, 2003

Post-Hurricane Link Roundup

Saved Friday, September 19, 2003 at 09:23 AM

Monday, September 01, 2003

Things to Check Out

DocSync plugin, 1.0 beta, for jEdit is available here. Users Guide can be found here.

Article on Gentoo + BSD here.

A portupgrade article.

The Burning Edge, a Mozilla Firebird build blog.

A usenet troll detector: http://online.effbot.org/2003_08_01_archive.htm#troll

jEdit has a wiki.

Saved Friday, September 12, 2003 at 11:04 PM

Weblog Entries for July 2003

Wednesday, July 23, 2003

Docutil DocBook XML Writer Updated

I finally got around to making some updates to the DocBook XML writer for Docutils this past weekend. The code and minimal docs can be found in the Docutils Sandbox here:

http://docutils.sourceforge.net/sandbox/oliverr/docbook/

Docinfo elements are the major missing/messed up piece, but most of it should work. I've used it to generate DocBook for the documentation for a couple of the jEdit plugins I maintain, and it worked just fine. Please give it a whirl and let me know what works or doesn't work for you.

Saved Friday, September 12, 2003 at 11:04 PM

Wednesday, July 16, 2003

vb2py

This looks interesting: http://vb2py.sourceforge.net/.

Saved Friday, September 12, 2003 at 11:04 PM

Thursday, July 10, 2003

rst2chm 0.1 released

rst2chm generates Microsoft (TM) HTML Help files from one or more reStructuredText source files. rst2chm requires Docutils and the Microsoft (TM) HTML Help Workshop

Saved Friday, September 12, 2003 at 11:04 PM

Wednesday, July 09, 2003

Browsing Revisions of a Subversion Repository

Below is an excerpt from a post [1] by Ben Collins-Sussman on how to view a specific revision of a Subversion repository.

...for the *moment* you can browse old revs with this form:

        http://svn.collab.net/repos/svn/!svn/bc/2000/trunk

..but don't count on this always working.

For example, to view revision 5 of the following repository:

https://newtonsplace.net/svn/rst2chm/trunk

use the following URL:

https://newtonsplace.net/svn/rst2chm/!svn/bc/5/trunk
[1]http://codespeak.net/pipermail/pypy-dev/attachments/3ee02216/attachment.eml

Saved Friday, September 12, 2003 at 11:04 PM

Weblog Entries for June 2003

Friday, June 27, 2003

Using Twisted for Port Forwarding

Earlier this afternoon, I blundered across a post [2] by Paul Moore, on python-list [3] which showed how to use Twisted [4] for port forwarding. Here's the relavent snippet:

$ mktap portforward -p 8000 -h remote -d 20
$ twistd -f portforward.tap
[2]http://mail.python.org/pipermail/python-list/2003-June/170606.html
[3]http://mail.python.org/mailman/listinfo/python-list
[4]http://www.twistedmatrix.com/

Saved Friday, September 12, 2003 at 11:03 PM

Thursday, June 26, 2003

Using jEdit as %EDITOR% on Windows

With jEdit 4.2 (currently in development), jEdit can be used by other applications as an external editor. Using the -wait command line argument, jEdit can open a view and wait for the view or buffer to be closed before the process exits. Note that this works whether or not jEdit is already running.

With the following in my "AUTOEXEC.BAT" file, I can use jEdit to edit commit messages when using CVS or Subversion:

SET EDITOR=c:\j2sdk1.4.2b2\bin\java -jar c:\jEdit\jedit.jar -wait -newplainview

Note that this will NOT work using the jEdit Launcher for Windows, as that doesn't handle all command line arguments that jEdit supports.

Saved Friday, September 12, 2003 at 11:03 PM

Monday, June 23, 2003

Dealing with SF.net's Anonymous CVS Access Timeouts

These days, most of my attempts to do anonymous checkouts or updates from SF.net's CVS repositories result in timeouts. For projects I'm a member of, I can use my account, but for others I just have to keep trying until an attempt doesn't timeout. After getting sick of doing that, I wrote a little script to do it for me.

The script below keeps trying to update until it's successful. After each failed attempt, it pauses for 5 seconds before trying again.

#!/usr/bin/env python

import os, sys, time

DEFAULT_CVS_ARGS = '-z9 -q up -dP'
SLEEP = 5   # seconds

def main(args=None):
        if args is None:
                args = sys.argv
        cvs_args = ' '.join(args[1:])
        if not cvs_args:
                cvs_args = DEFAULT_CVS_ARGS
        cmd = 'cvs %s' % cvs_args
        print 'running %s...' % cmd
        while 1:
                r = os.system(cmd)
                if not r:
                        break
                for i in range(SLEEP):
                        time.sleep(1)

if __name__ == '__main__':
        try:
                main()
        except KeyboardInterrupt:
                pass

# :indentSize=4:lineSeparator=\n:noTabs=true:tabSize=4:

Here's what it looks like running:

C:\sandbox\ctypes>cvsup
running cvs -z9 -q up -dP...
cvs [update aborted]: Error reading from server cvs.sourceforge.net: -1
cvs [update aborted]: Error reading from server cvs.sourceforge.net: 0
cvs [update aborted]: Error reading from server cvs.sourceforge.net: 0
cvs [update aborted]: Error reading from server cvs.sourceforge.net: 0
cvs [update aborted]: Error reading from server cvs.sourceforge.net: -1
cvs [update aborted]: Error reading from server cvs.sourceforge.net: 0
cvs [update aborted]: Error reading from server cvs.sourceforge.net: 0
cvs [update aborted]: Error reading from server cvs.sourceforge.net: 0
cvs [update aborted]: Error reading from server cvs.sourceforge.net: -1
cvs [update aborted]: Error reading from server cvs.sourceforge.net: 0
P setup.py
M samples/Windows/FindFile.py
M samples/Windows/wtl/readme.txt
P source/_ctypes.c
P source/callproc.c
P source/ctypes.h
P win32/com/register.py
P win32/com/server.py
P win32/com/samples/server/test_w32.py
P win32/com/tools/readtlb.py

C:\sandbox\ctypes>

Saved Friday, September 12, 2003 at 11:03 PM

Friday, June 20, 2003

Changing Keyword Expansion for a File in CVS

A co-worker of mine, Tim Perry, sent me a useful link [5] today.

If you've ever used cvs, at some point you've probably added an image or some other binary file to the repository, w/o using cvs add -kb <filename>. Here's an example of using cvs admin to fix the problem:

$ echo '$Id$' > kotest
$ cvs add -m"A test file" kotest
$ cvs ci -m"First checkin; contains a keyword" kotest
$ cvs admin -kb kotest
$ cvs update -A kotest
# For non-unix systems:
# Copy in a good copy of the file from outside CVS
$ cvs commit -m "make it binary" kotest
[5]http://www-es.fernuni-hagen.de/cgi-bin/info2html?(cvs)Binary%20howto

Saved Friday, September 12, 2003 at 11:02 PM

Tuesday, June 17, 2003

Folding VB Code in jEdit using Configurable Fold Handler Plugin

Earlier today, version 0.4 of the Configurable Fold Handler Plugin was announced [6] on jedit-devel. Using the following regexps, one can fold VB code. Improvements or suggestions welcome.

Fold start string:
^(?:Public|Private)?\s*\b(?:Sub|Function|Property|Type)\b
Fold end string:
^End\s+(?:Sub|Function|Property|Type)\b
[6]http://marc.theaimsgroup.com/?l=jedit-devel&m=105584623401830&w=2

Saved Friday, September 12, 2003 at 11:03 PM

Monday, June 16, 2003

HOWTO: Central Gentoo Mirror for Internal Network

In this week's Gentoo Weekly Newsletter [7], there's a link to an article [8] on Gentoo Forums [9] on setting up a local rsync mirror for portage.

[7]http://www.gentoo.org/news/en/gwn/20030616-newsletter.xml
[8]http://forums.gentoo.org/viewtopic.php?t=59134
[9]http://forums.gentoo.org/

Saved Friday, September 12, 2003 at 11:03 PM

Sunday, June 15, 2003

First Release of SendKeys Module for Python

I've just released SendKeys [10] module 0.3 for Python. SendKeys is a Python module for Windows (R) which can be used to send one or more keystrokes or keystroke combinations to the active window.

It's been a little while in coming, as I started it roughly 6 or 7 weeks ago, but it's already been through a few iterations. First, I wrote the low-level win32 code, using ctypes [11]. Second, I wrote a Python extension module using Pyrex [12], instead of ctypes . Lastly, I re-wrote the extension module in c.

[10]http://www.rutherfurd.net/python/sendkeys/
[11]http://starship.python.net/crew/theller/ctypes.html
[12]http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/

Saved Friday, September 12, 2003 at 11:03 PM

Monday, June 02, 2003

A Subversion plugin for jEdit would be nice

I came across an announcment [13] of a Subversion plugin for Eclipse [14]. I'd love to see one for jEdit. It's written using svnup [15], so a jEdit plugin should be possible - maybe as a VFS?

[13]http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=38418
[14]http://subclipse.sourceforge.net
[15]http://svnup.tigris.org/

Saved Friday, September 12, 2003 at 11:03 PM

Exporting an X Session

Taken from this week's Gentoo Linux Newsletter [16].

[16]http://www.gentoo.org/news/en/gwn/20030602-newsletter.xml

Code listing 9.1: Local machine:

// This command allows the machine with the IP 192.168.1.3 to connect
# xhost +192.168.1.3

On the remote machine, you need to export the $DISPLAY variable to your local machine. After that, you should be ready to run GUI programs remotely.

Code listing 9.2: Remote machine:

# export DISPLAY="192.168.1.2:0.0"
# gvim /etc/passwd
// You should see gvim open on your local machine with the contents
// of the remote machine's /etc/passwd file.

Note

This is very unsecure and not recommended since everything you type including passwords will be transmitted over the network unencrypted.

To tunnel the connection over SSH and thus encrypt the traffic edit your /etc/sshd2_config file.

Code listing 9.3: /etc/sshd2_config:

// Add or edit the following line
ForwardX11     yes

Now connect from the local machine to the remote machine via ssh and start your X application.

Code listing 9.4: Remote machine:

# gvim /etc/passwd
// You should see gvim open on your local machine with the contents
// of the remote machine's /etc/passwd file.

Notice that you don't have to set the DISPLAY variable, ssh automagically does that for you. You do however have to allow access to your local machine's X server (see above).

Saved Friday, September 12, 2003 at 11:03 PM

Weblog Entries for April 2003

Thursday, April 17, 2003

Adding Support for Visual Basic to Exuberent Ctags

jEdit has a great source code navigation plugin called Tags which uses Exuberant Ctags. By default Ctags doesn't support VB, which I'm seeing a lot of lately, but it does allow one to add support for laguages using regular expressions.

I added the following to c:\ctags.cnf:

--langdef=vb
--langmap=vb:.bas.cls.ctl.frm.vbs
--regex-vb=/^(Public|Private|\b)[ \t]*Sub[ \t]+([a-zA-Z0-9_]+)/\2/s,subroutine/i
--regex-vb=/^(Public|Private|\b)[ \t]*Function[ \t]+([a-zA-Z0-9_]+)/\2/f,function/i
--regex-vb=/^(Public|Private)[ \t]+([a-zA-Z0-9_]+)[ \t]+As[ \t]+/\2/v,variable/i
--regex-vb=/^(Public|Private|\b)[ \t]*Const[ \t]+([a-zA-Z0-9_]+)[ \t]+(As|=)[ \t]+/\2/c,const/i
--regex-vb=/^(Public|\b)[ \t]*Property[ \t]*(Get|Let|Set)[ \t]+([a-zA-Z0-9_]+)/\3/n,name/i
--regex-vb=/^(Public|Private|\b)[ \t]*Enum[ \t]+([a-zA-Z0-9_]+)/\2/e,enum/i
--regex-vb=/^([a-zA-Z_]+):/\1/l,label/i

These expressions probably aren't perfect, but I've found them to work pretty well. If you've got suggestions or improvements, please send them along.

Example output:

C:\Code\CASS\SMSSource>ctags -RV
RECURSING into directory "."
ignoring .\.cvsignore (unknown language)
ignoring .\360.ico (unknown language)
OPENING .\Advertiser.cls as vb language file
OPENING .\Advertisers.cls as vb language file
OPENING .\Affidavit.cls as vb language file
^C
C:\Code\CASS\SMSSource>

Here's a screen shot of the plugin in action:

[screen shot of Ctags w/VB in jEdit]

Saved Friday, September 12, 2003 at 11:02 PM

Blog Macro Needs More Work

Last week (or maybe the week before) I saw that AMK had written some scripts to keep his diary in reST. I was reminded of my weblog, which is also contructed with reST, but which I never update. I wrote a nice little macro which takes care of saving an entry and creating indexes for that entry. The one hitch is that I have to run my site generation scripts and then upload the entry for it to appear on my site. It's been on my todo list to update this so it can take care of generating the pages and doing the upload. Then all I'll need to do is open jEdit, type away, and execute the macro.

Saved Friday, September 12, 2003 at 11:02 PM

Weblog Entries for February 2003

Monday, February 24, 2003

EditorScheme Plugin 0.4.2

A new release of EditorScheme plugin for jEdit is available. It should be available on plugin central shortly, but in the meantime you can get it here: http://www.rutherfurd.net/jEdit/plugins/editorscheme/.

Saved Friday, September 12, 2003 at 11:01 PM

Friday, February 21, 2003

List of User-Agents

http://www.psychedelix.com/agents.html

Saved Friday, September 12, 2003 at 11:01 PM

TaskList 0.4.1

A new release of TaskList Plugin for jEdit is available. This release includes performance improvements.

Saved Friday, September 12, 2003 at 11:01 PM

Tuesday, February 18, 2003

Bash Key Combinations

Below are useful Bash key combinations from this week's Gentoo (http://www.gentoo.org/) Weekly News (http://www.gentoo.org/news/en/gwn/20030217-newsletter.xml):

Alt+B   // Go back one word
Alt+F   // Go forth one word
Ctrl+K  // Delete everything from the cursor to the end of the line
Ctrl+U  // Delete everything from the cursor to the beginning of the line
Ctrl+Y  // Paste deleted characters at the current position
Ctrl+H  // Delete one character
Ctrl+L  // Clean screen
Ctrl+P  // Go to the previous history entry
Ctrl+N  // Go to the next history entry

Saved Friday, September 12, 2003 at 11:02 PM

Monday, February 17, 2003

WebDAV Plugin for jEdit

A WebDAV plugin for jEdit is under development. More information and downloads available here: http://www.webdav.us/

Saved Friday, September 12, 2003 at 11:02 PM

Thursday, February 13, 2003

PyWiew Image Viewer

A wxPython-based image viewer: http://members.fortunecity.com/anandpillai/

Saved Friday, September 12, 2003 at 11:01 PM

Tuesday, February 11, 2003

Sun Compares Java and Python

Python recieves a favorable review from Sun in an internal memo, where Java and Python are compared.

Saved Friday, September 12, 2003 at 11:01 PM

Guido Discusses Strong vs Weak Typing

In Part V, of A Conversation with Guido van Rossum, Guido discusses Strong versus Weak Typing.

Saved Friday, September 12, 2003 at 11:01 PM

Saturday, February 08, 2003

The Quotations Page

Looking for interesting RSS feeds to use with jEdit's Headlines plugin, I stumbled across a Quotes of the Day feed, which can be found here: http://www.quotationspage.com/data/qotd.rss

Saved Friday, September 12, 2003 at 11:02 PM

Friday, February 07, 2003

Cool Python Trick

While skimming through Python-Dev Archives I came across an interesting post by Chad Netzer on a Python equivlent for a common use of the ternary operator in C.

On Thu, 2003-02-06 at 17:38, Ka-Ping Yee wrote:

> For example, here's a common idiom i use in C:
>
>     printf("Read %d file%s.", count, count == 1 ? "" : "s");

Just for giggles, here is a python version:

        print "Read %d file%s." % (count, {1:""}.get(count,"s"))

The whole post can be found here: http://mail.python.org/pipermail/python-dev/2003-February/033147.html

Saved Friday, September 12, 2003 at 11:02 PM

Monday, February 03, 2003

SFTP for jEdit

FTP plugin version 0.5 for jEdit was released today. With it, one can connect to a machine running OpenSSH and edit files as it they were local. This is really cool!

Saved Friday, September 12, 2003 at 11:01 PM

Weblog Entries for January 2003

Friday, January 31, 2003

Train Good for Coding

Another observation, mainly for testing purposes: train rides are a good time for coding -- especially if one has good tunes.

Saved Friday, September 12, 2003 at 11:01 PM

Q: How Much Does jEdit Rock?

A: Very Much

Saved Friday, September 12, 2003 at 11:00 PM

Tip for Writing Macros for jEdit with Jython

Don't use the following idiom:

data = open('foo.txt').read()
...

Instead, do:

f = open('foo.txt')
data = f.read()
f.close()

This is important if you're working with files that jEdit has open, as Jython may still have the file open when you attempt to save it with jEdit. If this happens, you may be unable to save your file in jEdit. I learned this the hard way.

Saved Friday, September 12, 2003 at 11:00 PM

Python DB-API module for ADO

I haven't used it yet, but I'm looking forward to playing with it. It can be found here: http://adodbapi.sourceforge.net/

Saved Friday, September 12, 2003 at 11:00 PM

DataSource Connection String Reference

http://www.connectionstrings.com/ is a great reference on DB connection strings.

Saved Friday, September 12, 2003 at 11:01 PM

View latest entries or archive <../archive.html>