] Kragen Sitaker http://www.pobox.com/~kragen/
I don't do .INI, .BAT, .DLL or .SYS files. I don't assign apps to files. I
don't configure peripherals or networks before using them. I have a computer
to do all that. I have a Macintosh, not a hobby. -- Fritz Anderson
I was participating in a discussion on another mailing list about how
to make it more expensive, and thus less attractive, to commit spam.
I needed to do a fair bit of calculation for this, so I had the
opportunity to reflect on current technology.
I find the traditional REPL extremely annoying
/* I wrote this program to test how feasible it was to fake a slow
* network connection by twiddling SO_RCVBUF. The idea is to read
* data from the socket relatively slowly, but keep SO_RCVBUF small
* from the beginning of the connection to make sure that the remote
* side's TCP is aware
PROTECTED] Kragen Sitaker http://www.pobox.com/~kragen/
When the battle between us and them is equated with the battle between
good and evil -- then we have placed ourselves above all evil. This is to
make gods of ourselves. -- Steve Talbot, NETFUTURE #129, via SMART Letter
. */
if (!canonicalize(word, modword, len)) continue;
canonicalize(word + len, modword + len, len);
if (!memcmp(modword, modword + len, len)) fputs(word, stdout);
}
return 0;
}
--
[EMAIL PROTECTED] Kragen Sitaker http://www.pobox.com/~kragen/
The Internet stock bubble didn't burst
:initial-value '())
--
/* By Kragen Sitaker, http://pobox.com/~kragen/puzzle2.html */
char a[99]= KJ,d[999][16];main(){int s=socket(2,1,0),n=0,z,l,i;*(short*)a=2;
if(!bind(s,a,16))for(;;){z=16;if((l=recvfrom(s,a,99,0,d[n],z))0){for(i=0;in;
i++){z=(memcmp(d[i],d[n],8))?z:0;while(sendto(s,a,l,0,d
on misspelled indexdir name
--
/* By Kragen Sitaker, http://pobox.com/~kragen/puzzle2.html */
char a[99]= KJ,d[999][16];main(){int s=socket(2,1,0),n=0,z,l,i;*(short*)a=2;
if(!bind(s,a,16))for(;;){z=16;if((l=recvfrom(s,a,99,0,d[n],z))0){for(i=0;in;
i++){z=(memcmp(d[i],d[n],8))?z:0;while(sendto(s,a,l,0,d[i
the
distribution of the values in the mask. Instead of multiplying half
of the image pixels by 1 and the other half by -1, you can multiply
one fourth of them by 1 and three fourths of them by -(1/3). I
haven't tried this, so I don't know if it helps.
--
[EMAIL PROTECTED] Kragen Sitaker http
a ':' after 'else'
# - forgot to return rv from locations()
# - the following incompatibilities with 1.5.2:
# - used string methods .replace and .rfind
# - used zip()
# - didn't handle the case where no messages are renamed
# - didn't use compression (oops!)
--
[EMAIL PROTECTED] Kragen Sitaker
Some years ago, I had this idea for a computer game based on driving a
car. So I learned Xlib so I'd be able to write the game, but in the
process, I got distracted. Yesterday morning, I wrote a primitive
version of this game, which is included below.
begin 644 derivgam-1.tar.gz
sunify('a(b($c d) $e)', 'a(b(b d) a)') == {
'c': atom('b'),
'e': atom('a')}
assert sunify('hi($x)', 'hi(kragen(sitaker))') == {
'x': dparse('kragen(sitaker)')}
assert sunify('a($a $a)', 'a(b b)') == {'a': atom('b')}
assert sunify('a($a $a)', 'a(b c)') == None
() + ' ')
finally:
sys.stdout.write(exiting...)
sys.stdout.flush()
os.system('stty -cbreak echo')
wordlist.write()
if __name__ == '__main__': main()
--
[EMAIL PROTECTED] Kragen Sitaker http://www.pobox.com/~kragen/
Edsger Wybe Dijkstra died in August
(increment_circuit(cp));
if (done) return 0; /* no need to try more complex circuits... */
}
assert(0); /* should never happen */
}
--
[EMAIL PROTECTED] Kragen Sitaker http://www.pobox.com/~kragen/
Edsger Wybe Dijkstra died in August of 2002. The world has lost a great
man. See http
'])
thelist.append(['[EMAIL PROTECTED]', 'How are you?'])
thelist.columns_autosize()
vbox.pack_start(thelist)
window.show_all()
thelist.append(['ZODB says', str(dbroot['hello'].hellocount())])
get_transaction().commit()
gtk.mainloop()
--
[EMAIL PROTECTED] Kragen Sitaker http://www.pobox.com
So I wanted to do my taxes. I wrote a 'tax2003' Python module containing
a bunch of stuff like this:
class employer1:
earnings = 12345.67
federal_wh = 1234.56
class employer2:
earnings = 123456.78
federal_wh = 12345.67
class form1040:
# income
wages = employer1.earnings
Like other things posted here without notices to the contrary, this
code is in the public domain.
You can find partial hash collisions by sorting the hashes and then
walking through the sorted lists looking for successive entries with
long common prefixes. I was going to write a program to do
Like other things posted here without notices to the contrary, this
code is in the public domain.
I wrote about this before, using nested S-expressions and stuff. I
got very similar performance results this time around, with a slightly
simpler data format, and a slightly different set of
I've tried this on my most recent 200MB of email, and it seems to work
OK. Future directions include:
- result ranking: most recent is not always best!
- handling bigger corpuses
- word-prefix search (krag*)
- field search (krag* in To)
- incremental search and display
Indexing 200MB of email,
.
The Change Set
--
'From Squeak3.6 of ''6 October 2003'' [latest update: #5429] on 16 June 2004 at
3:06:44 am'!
Change Set:IRC Dialog Resizing
Date: 16 June 2004
Author: Kragen Sitaker
I noticed that the IRC connection dialog box
The good news is that on an Athlon 850 with half a gigabyte of RAM, I
can index my 989-megabyte mailbox in 491 megabytes and 9 minutes, 27
seconds, which is relatively fast as full-text indexing goes, and its
working set is customizable and pretty small (set to 64MB for this
test). The bad news
This is pretty lame to call a hack, but I wanted to share the
knowledge I couldn't easily find on the Net about how to do this.
I'm using iptables at home for IP masquerading, and my wife Beatrice
wanted her Mac's iSight video chat to work through the firewall.
Here's the incantation I eventually
Here are some bookmarklets I've recently created.
The outline-lists bookmarklet: this guy turns HTML unordered lists
into collapsible outlines. Definitely too long, has PNG comments,
doesn't use PNG alpha (and should), certainly won't work in MSIE, but
does work in my Galeon 1.3.17. (Which is
#!/usr/bin/python
# Inspired by Mark S. Miller's whenUpdated and reactToUpdate protocol
# described in
# http://www.erights.org/javadoc/org/erights/e/elib/slot/EverReporter.html
# and
# http://www.erights.org/javadoc/org/erights/e/elib/slot/EverReactor.html
# with the following differences: no
#!/usr/bin/python
# POE has a FollowTail wheel that works like tail -F --- if log
# rotation renames the file, creates a new one under the original
# name, and starts appending to it, it switches to watching the new
# file.
# This followtail module provides a way to do the same thing in
#
/)[Archive's index page]],
T.li[T.a(href=thumbnails/)[Raw thumbnails dir]],
],
T.address[T.a(href=mailto:[EMAIL PROTECTED])[
Kragen Sitaker]],
],
]
)
def ok(a, b): assert a == b, (a, b)
def test():
assert dict_precedes
25 matches
Mail list logo