code logs -> 2006 -> Fri, 17 Nov 2006< code.20061116.log - code.20061118.log >
--- Log opened Fri Nov 17 00:00:12 2006
00:05
<@Vornicus>
I don't know
00:05
<@Vornicus>
but he's not the king of bedside manor.
00:07
<@ToxicFrog>
He was quite a a singer, quite an actor, quite some time ago!
00:15
<@ToxicFrog>
Curse Postscript's lack of function closures.
00:17 * Vornicus updates a script some
00:17
<@Vornicus>
okay, so
00:17
<@Vornicus>
I have to say $( date +%k%M%S ) a lot
00:18
<@ToxicFrog>
This is Bash?
00:18
<@Vornicus>
is there a way to make that, like, a function, without throwing it into a script in $PATH
00:18
<@Vornicus>
yes
00:18
<@ToxicFrog>
function mydate() {
00:18
<@Vornicus>
well, +%k:%M:%S, but
00:18
<@ToxicFrog>
date +%k:%M:%S;
00:18
<@ToxicFrog>
return 0;
00:18
<@ToxicFrog>
}
00:18
<@ToxicFrog>
Invoke as `mydate`
00:18
<@ToxicFrog>
Which expands to the output of the function.
00:19
<@Vornicus>
ok
00:19
<@ToxicFrog>
Actually, wait.
00:19
<@ToxicFrog>
Remind me what $() does?
00:19
<@ToxicFrog>
Execute in subshell and expand to output?
00:19
<@Vornicus>
Same as ` `, as far as I can tell, but it also nests properly
00:19
<@ToxicFrog>
Aah.
00:19
<@ToxicFrog>
$(mydate) should also work, I think.
00:20 * Vornicus tries it.
00:21 * ToxicFrog has never been entirely sure how Bash function scoping rules apply to subshells
00:21
<@ToxicFrog>
I note that you can also use alias mydate='date +%k:%M:%S'
00:22
<@ToxicFrog>
Which I think is a string expansion on the command rather than a function call.
00:22
<@Vornicus>
ok
00:22
<@Vornicus>
It appears to work
00:23 * MyCatOwnz hates shell scripting languages.
00:23
< MyCatOwnz>
Yes, they always *appear* to work. Until suddenly and entirely without warning, they don't
00:23
<@Vornicus>
heh
00:23 * ToxicFrog eyebrows
00:23
<@ToxicFrog>
Never has Bash served me with anything but absolute faithfulness.
00:23
<@ToxicFrog>
Even that time when I had quotes and backslash-escapes nested fifteen deep.
00:24
< MyCatOwnz>
That's pretty impressive.
00:25
<@Vornicus>
TF is also the guy with the IRC client made of regex.
00:25
< MyCatOwnz>
Okay, what *really* ticks me off about scripting is the difficulty of getting fancy scripts to behave nicely when used with filenames with spaces in them.
00:26
<@ToxicFrog>
"$@"
00:26
<@ToxicFrog>
Problem solved.
00:26
<@ToxicFrog>
code=`cat <<-__EOF__
00:26
<@ToxicFrog>
BEGIN { ARGC = 0 }
00:26
<@ToxicFrog>
{
00:26
<@ToxicFrog>
L = "<td>" \\\$3 "<td>" \\\$4 "<td><pre>" \\\$1 "</pre>";
00:26
<@ToxicFrog>
sub(/^.[-rwx]+[ \t]+[0-9]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[.0-9]+[KMGT]?[ \t]+[A-Z][a-z][a-z][ \t]+[0-9]+[ \t]+[0-9:]+[ \t]+/,"");
00:26
<@ToxicFrog>
print("<tr><td><a href=\"sol_file.cgi?mode=$4&node=" ARGV[4] \\\$0 "$5\">" \\\$0 "$5</a><td>");
00:26
<@ToxicFrog>
system("du -sh \"" ARGV[3] ARGV[4] \\\$0 "\" | awk \\\"{ print \\\\\\\\\\$1 }\\\"");
00:26
<@Vornicus>
:(
00:26
<@ToxicFrog>
print(L);
00:26
<@ToxicFrog>
}
00:26
<@ToxicFrog>
__EOF__`
00:26
<@Vornicus>
:(
00:26
<@ToxicFrog>
ls -lh "$1$2" | egrep "$3" | awk "$code" -- - "$1" "$2" 2>&1
00:26
< MyCatOwnz>
ToxicFrog: WHAT THE HELL WAS THAT?
00:26
<@ToxicFrog>
Ok, so it was only ten deep.
00:26
<@Vornicus>
I don't know, but it's got a here document in it.
00:27
< MyCatOwnz>
sol_file.cgi = Shit Outta Luck, guess what, this bash script is also just as complicated as the last one was?
00:27
<@McMartin>
That it assigns to a variable via backquoting cat.
00:28
<@Vornicus>
McM: even /better/
00:28
<@ToxicFrog>
It calls awk with a script, that is stored in a variable, that is generated from a here document, that does variable expansion to translate an awk script template into an actual awk script.
00:28
< MyCatOwnz>
ToxicFrog: hey, didja hear that noise?
00:28
<@Vornicus>
with extra :(
00:29
< MyCatOwnz>
ToxicFrog: that was my f@@@ing brain exploding.
00:29
<@ToxicFrog>
Halfway through writing that I found myself unable to remember what sucked so much about Perl~
00:29
<@Vornicus>
now, what the hell does it actually /do/
00:29
< MyCatOwnz>
ToxicFrog: LEARN RUBY, FOR THE LOVE OF PETE!
00:29
<@ToxicFrog>
It generates a directory listing with pretty HTML links for file manipulation.
00:30
<@Vornicus>
...aha
00:30
<@ToxicFrog>
MCO: Ruby, AFAIK, does not allow wacky tricks with IO redirection between multiple system() calls.
00:30
<@ToxicFrog>
Neither does Lua or I would have used that.
00:30
< MyCatOwnz>
ToxicFrog: y'know what?
00:30
<@ToxicFrog>
I think Python does via pipe2(), but I Don't Use Python.
00:30
< MyCatOwnz>
C does.
00:31
< MyCatOwnz>
And it'd have been more readable than that lunacy.
00:31
<@ToxicFrog>
C doesn't have string manipulation worth a damn.
00:31
<@ToxicFrog>
And at least a third of this script is heavy string processing.
00:31
< MyCatOwnz>
a) another third of it again is bloody evil redirection, which C does quite easily
00:32
<@ToxicFrog>
And another third of it is callouts to shell builtins and stuff in /bin
00:32
< MyCatOwnz>
b) import a library of some kind to do the hard bit for you? Iono.
00:32
< MyCatOwnz>
You can certainly code regexps in C, quite easily. FSA aren't challenging.
00:32
<@ToxicFrog>
FSA?
00:33
<@ToxicFrog>
And you can do regex /matching/, but not awk-style input-dependent replacement.
00:33
< MyCatOwnz>
Finite state automata.
00:33
<@ToxicFrog>
Oh, FSM.
00:33
<@ToxicFrog>
Or DFA.
00:33 * MyCatOwnz shrugs.
00:33
<@ToxicFrog>
Yes. You can. You can also use the builtin regcomp() and regexec().
00:33
< MyCatOwnz>
Apologies for the terminology, I was sticking to the term the Turing Omnibus people used.
00:34
< MyCatOwnz>
Oh and yes you can. Store a pointer at the first state and another at the end of the accepting state.
00:34
<@ToxicFrog>
That doesn't change the fact that cstrings are in fact byte arrays - which are in turn raw pointers - and the vast amounts of template-to-page expansion that this script has to do would be more than ugly enough in C to make up for the clearer redirection.
00:34
< MyCatOwnz>
You then have two pointers into a char[] which you can use as boundaries for the start and end of the section to be replaced.
00:35 timelady [~romana@Nightstar-13706.lns3.adl2.internode.on.net] has joined #Code
00:35
<@ToxicFrog>
MCO: and then you have memmove() wackiness to actually get everything into place.
00:36
<@ToxicFrog>
Not really seeing the readability improvements here and it's more dangerous besides.
00:36
<@ToxicFrog>
Now, if I'd thought of it at the time, I would have used Lua with cunning mkfifo() tricks to implement pipe2, but I didn't.
00:36
< MyCatOwnz>
ToxicFrog: s/cunning/beautiful =)
00:37
< MyCatOwnz>
ToxicFrog: and don't take me too seriously, I'm a major fanboy for C.
00:37
<@ToxicFrog>
No, I don't think you can call it beautiful when it leaves named pipes lying around in /tmp if it gets interrupted during execution.
00:37
< MyCatOwnz>
I'll probably grow out of it as soon as I start having to get things done in a hurry, and have them work.
00:37
<@ToxicFrog>
And C is great for device drivers and kernels, which is what I use it for.
00:37
< MyCatOwnz>
ToxicFrog: surely Lua has an equivalent to mkstmp?
00:38
< MyCatOwnz>
ToxicFrog: yes, but I'm a fanboy. This means I automatically want to use it for everything else, too. =)
00:38
<@ToxicFrog>
(and writing Lua extensions in)
00:38
<@ToxicFrog>
However, I have only written one CGI in C, and that was one too many. It is /terribly/ suited for them.
00:38 * MyCatOwnz nods. True dat.
00:38
< MyCatOwnz>
I'm really more of a Unix fanboy than anything else.
00:39
<@ToxicFrog>
Especially when you start talking about QUERY_STRING parsing, which is a few lines in either bash or Lua and either a hideous function or even more hideous strtok() evils in C.
00:39
<@McMartin>
Python 4tw
00:39
< timelady>
python
00:39
<@McMartin>
A popen3 that not only works, but works in windows
00:39
< timelady>
though i still have a sneaking fondness for ada
00:39
< timelady>
i do love php, but that isnt in thi context
00:40
<@ToxicFrog>
McMartin: remind me what the third fd is?
00:40
< MyCatOwnz>
I take the position that everything in /bin should be written in C (or a symlink to something else, naturally) and everything in /usr/bin should be written in whatever's expedient. And everything else should be written using shell scripts and lightish languages (Python, Ruby, Perl, PHP) using the stuff in /bin and /usr/bin.
00:40
<@ToxicFrog>
stderr?
00:40 * Vornicus used Python for years. THen he tried ruby for a month, and suddenly his fscking pseudocode changed.
00:41
<@ToxicFrog>
MCO: as for mkstemp - it does have os.tmpname(). But that generates a temporary file name.
00:41
<@McMartin>
TF: stderr.
00:41
< MyCatOwnz>
ToxicFrog: 0 is stdin, 1 is stdout and 2 is stderr.
00:41
<@ToxicFrog>
It does nothing to, say, clean up a temporary file created with that name if the program SIGINTs while using it.
00:41
<@McMartin>
Python also has a popen4 which returns stdin and stdout-and-stderr-merged.
00:41
<@ToxicFrog>
MCO: I know what the standard fds are, I was asking what the popen3() fds are.
00:41
<@ToxicFrog>
McMartin: spicy.
00:41
<@McMartin>
It returns three file objects, one for each.
00:42
<@ToxicFrog>
I can see how to implement all of those in Lua, but only on POSIX.
00:42
<@McMartin>
Python being down with the multiple return values.
00:42
< MyCatOwnz>
ToxicFrog: well, that's everything, isn't it?
00:42
<@McMartin>
And yeah. The clincher for Python for me was that its POSIX compatibility layer Actually Worked Flawlessly on Win32 native.
00:42
<@ToxicFrog>
MCO: I would kind of like people with windows machines to be able to play Spellcast.
00:42
<@Vornicus>
Windows isn't POSIX
00:42
<@ToxicFrog>
(which doesn't need popen*(), but~)
00:42
< MyCatOwnz>
Cygwin.
00:42
<@ToxicFrog>
Which doesn't have named pipes.
00:43
< MyCatOwnz>
Also VMWare and Colinux (which is a really scary project).
00:43
<@ToxicFrog>
Or rather, it does, but they Don't Fucking Work.
00:43
< MyCatOwnz>
ToxicFrog: fake 'em using the socket layer, if neccessary.
00:43
<@McMartin>
Cygwin is only (a) half-functional, and (b) not universally installed.
00:43
<@McMartin>
MyCatOwnz: Or, he could use a language that has a proper native library for it.
00:43
<@ToxicFrog>
MCO: fake them how?
00:43
<@ToxicFrog>
Windows has two mechanisms for output redirection:
00:43
<@ToxicFrog>
(1) Jack
00:43
<@ToxicFrog>
(2) Shit
00:44
<@ToxicFrog>
It doesn't even have fork-exec, so you can't rely on modifying your own fds.
00:44
<@McMartin>
(fork-exec appears in exactly one line of OS design, ever)
00:44
<@ToxicFrog>
If I run a program in windows, and I want it to write to a named pipe or to a socket or to /anything/ other than stdout, I'm screwed.
00:44
<@ToxicFrog>
...well, ok, I can write it to a file.
00:45
< MyCatOwnz>
McMartin: what's that, the orignal K&R academic paper?
00:45
<@ToxicFrog>
And in Cygwin I can pipe it to another program.
00:45
<@McMartin>
MyCatOwnz: Unix, in particular, and specifically.
00:45
<@McMartin>
Its immediate predecessor, Multics, didn't have it.
00:45
<@McMartin>
VMS-descended OSes don't have it
00:45
< MyCatOwnz>
ToxicFrog: I was thinking of Winsock, aimed at localhost.
00:45
<@ToxicFrog>
MCO: which helps me get output from random_other_program I just invoked with system()...how?
00:45
<@McMartin>
There aren't any ITS or TOPS-10 based OSes left, but they wouldn't have it either.
00:46
< MyCatOwnz>
ToxicFrog: well, unless you wrote random_other_program yourself and put a TCP socket mechanism on it, it really doesn't.
00:46
<@ToxicFrog>
On POSIX, I either use popen*() or combine output redirection with mkfifo, but Windows doesn't have mkfifo because it doesn't have named pipes.
00:46
<@ToxicFrog>
Yes, that is /exactly my point/.
00:46 * McMartin wonders how Win32 Python does it.
00:47
< MyCatOwnz>
ToxicFrog: easy (crude) solution: http://www.colinux.org/
00:47
<@Vornicus>
...which doesn't work for people who don't feel like installing /another OS/ on their machine just to play a game.
00:47
<@McMartin>
Which is, basically, everyone.
00:48
<@McMartin>
The whole point of writing in a portable language is so that you can ignore the underlying OS.
00:48
< MyCatOwnz>
Ummm, in case you didn't know this offhand, a Linux kernel weighs about three megabytes with shitloads of drivers in it.
00:49
<@McMartin>
You're trying to tell him that he should use deliberately OS-dependent calls because that OS can be cheaply embedded in other ones.
00:49
< MyCatOwnz>
Extend that to maybe twenty megs, if we're assuming a *big* shitload of files in /bin and so on.
00:49
<@Vornicus>
...no, wait, the resident kernel hacker isn't here. But.
00:49
<@McMartin>
The alternative here is to link against libraries that already have native implementations on all target OSes.
00:49
< MyCatOwnz>
McMartin: hey, I didn't claim it was an elegant solution. :P
00:50
<@Vornicus>
Right, stop it.
00:50
<@Vornicus>
THis conversation's gone silly.
00:50
< MyCatOwnz>
I said easy. As in, somebody else already did the hard work.
00:50
<@McMartin>
Well, except for the bit where he changes his code to be less compatible.
00:50
<@ToxicFrog>
MCO: easy for /me/. The end user is kind of fucked.
00:50
< MyCatOwnz>
ToxicFrog: package it with an installer. Why does the end user even need to know that colinux is being used?
00:51
<@ToxicFrog>
McMartin: I don't know how they do it.
00:51
<@ToxicFrog>
For that matter, I don't know how Cygwin does fork-exec.
00:51
<@ToxicFrog>
Apart from "with unbelievably terrifying low-level memory manipulation"
00:52
<@Vornicus>
...whee
00:52
<@ToxicFrog>
I would suspect that Python does it with output redirection + named sockets, but, again, lack of output redirection facilities.
00:52
< MyCatOwnz>
ToxicFrog: perhaps it simulates exec by killing the calling process and starting the program it was pointed at...
00:53
<@McMartin>
I think Win32 has "exec" or an equivalent.
00:53
<@McMartin>
"chain" or something
00:53
<@ToxicFrog>
MCO: exec() keeps program environment and file descriptors intact.
00:53
<@ToxicFrog>
As does fork().
00:53
< MyCatOwnz>
ToxicFrog: ...with the state (fd's and so on) being maintained by means of funny hooks in all the syscalls to manipulate syscalls.
00:53
<@ToxicFrog>
I think it preserves PID, too.
00:54
< MyCatOwnz>
ToxicFrog: I'll check the man page on that point.
00:54
<@ToxicFrog>
And, AFAIK, Cygwin doesn't do any wacky syscall tricks, although it does provide its own version of stdio which supports symlinks.
00:54
<@ToxicFrog>
Because the Windows one kind of totally fails to.
00:54
<@ToxicFrog>
Although I think that's actually the filesystem driver's job, not stdio's.
00:55
< MyCatOwnz>
Yep, filesystem, very definately.
00:56
< MyCatOwnz>
If you try to write a FUSE filesystem, you have to implement all the symlink handling yourself. Unless, of course, you don't want to support symlinks. ^_^
00:56
< timelady>
fuse rocks
00:56 * timelady is installing mediawikifuse
00:56
<@ToxicFrog>
In which case, what I meant to say is, "Cygwin provides an implementation of stdio that fakes a filesystem driver that supports symlinks, because the windows filesystem drivers completely fail to"
00:57
<@ToxicFrog>
"despite the fact that windows provides things that look, at first glance, like symlinks"
00:57
< MyCatOwnz>
ToxicFrog: you know what I *really* can't bend my head around?
00:57
<@Vornicus>
A metal pole.
00:58
<@TheWatcher>
Vorn: that's easy - stick it through the head
00:58
< MyCatOwnz>
ToxicFrog: CIFS/SMB/whatever they're calling it today has FIFOs, but NTFS doesn't.
00:58
< MyCatOwnz>
Vornicus: that's easy. All I need is a little speed-boost to start with.
00:58
<@ToxicFrog>
Ummm.
00:58
<@ToxicFrog>
CIFS hosted on what system?
00:58
<@ToxicFrog>
If it's CIFS on a POSIX system, well /of course/ it supports FIFOs.
00:59
<@ToxicFrog>
If it's being hosted on a windows system, this would seem to involve some kind of buggery in the CIFS server presenting files that behave like pipes and do not actually exist on the server's filesystem.
00:59
< MyCatOwnz>
ToxicFrog: heheh. I think it was the Samba docs I was reading, apparently SMB uses FIFOs for various things, esp. to do with discovery and naming.
01:00
<@ToxicFrog>
MCO: if this is the POSIX version of smbd, this is unsurprising.
01:00
< MyCatOwnz>
Yes, that's precisely it. They do not actually exist on the server's filesystem. But they are presented as pipes.
01:00
<@ToxicFrog>
If this is the windows version, windows supports named sockets, which are (1) called "named pipes" in the documentation and (2) named with the CIFS-oid //system/filename convention.
01:00
<@ToxicFrog>
But they are not in fact pipes, nor are they actually part of CIFS.
01:01
< MyCatOwnz>
ToxicFrog: oh? Ah, confusion on my part.
01:01 Jan[JouantDieu] is now known as Janus
01:01
< MyCatOwnz>
ToxicFrog: I thought they were real FIFOs as "named pipes" is exactly the same term as *nix manpages use to describe real FIFOs.
01:02
<@ToxicFrog>
Yes, but they don't actually work the same way.
01:03
<@ToxicFrog>
They work like sockets with attached names. You can access them only with special syscalls and they cannot be mapped into the filesystem.
01:03
<@ToxicFrog>
Even if you know the name, you can't get at them with open().
01:03
< MyCatOwnz>
Hmmm. Question, please: is my C-foo in need of brushing up, or does "char * const argv[]" wind down to exactly the same meaning as "const char ** argv"?
01:03
<@McMartin>
Almost
01:04
<@McMartin>
Hmm, wait.
01:04
<@McMartin>
Well, first.
01:04
< MyCatOwnz>
McMartin: (aside from the array-versus-pointer distinction. I don't actually care about that)
01:04
<@McMartin>
Right
01:04
<@ToxicFrog>
The only interesting bit is that they span system boundaries, so you can talk to a process on another machine by machine NetBIOS name and socket name rather than by IP address and port number.
01:04 * McMartin has actually gotten pwnt by the array-vs-pointer distinction
01:05
<@McMartin>
I don't have a handy copy of the C99 standard, so I"m not sure
01:05
< MyCatOwnz>
McMartin: I ought to get around to grokking it properly, but for the moment, I still think in assembler (well, kinda, except that I don't have any of the skills that most people pick up by doing that for a few years). Hence the distinction is way over my head, laughing at me and dropping chunks of ham with parachutes tied to them on my head.
01:05
<@ToxicFrog>
But windows does not actually have pipes in the filesystem-mappable POSIX sense; the closest it comes is Cygwin's so-far-nonworking attempt, which uses files with special metadata, a customized version of open(), and a background service that does all the redirection with sockets.
01:06
<@McMartin>
MyCatOwnz: Oh, in that case, the distinction is easy.
01:06
< MyCatOwnz>
McMartin: yeah?
01:06
<@McMartin>
Say you have a header declaration "extern char *str;"
01:06
<@McMartin>
And then you try to define it in a file as "char str[256];"
01:07
<@McMartin>
And then some other file tries to find str[4]
01:07
<@McMartin>
For the static array, this is one load instruction: load_byte str+4, basically.
01:07
<@McMartin>
However, it will instead go:
01:08
<@McMartin>
MOV AX, [str]; ADD AX, 4; MOV AL, [AX]
01:08
<@McMartin>
Which is, um, Not What You Want.
01:08
<@McMartin>
char str[256] is "256 character bytes go in the data area here."
01:08
<@McMartin>
char *str is "4 bytes constituting an address to character go here."
01:08
<@McMartin>
At the global scope.
01:09
<@McMartin>
Inside a routine they're all actually pointers.
01:09
< MyCatOwnz>
Oh, cool.
01:10 * MyCatOwnz had been quite careful (hah! Actually, just lucky) to avoid waving anything around at global scope other than the odd extern int here and there, for things like verbosity flags.
01:10
<@McMartin>
As you can imagine, if the compiler gets confused on this point, Fiery Doom Ensues.
01:10 * McMartin was coding something up for the GBA at the time, so.
01:10
< MyCatOwnz>
Yeah, I can see why the compiler would murder you and bury you in a small trench.
01:11
< MyCatOwnz>
Does it generate pages of evil error messages, or does it just let it through silently and generate incorrect code?
01:12
< MyCatOwnz>
(and a segfault, unless you're on, say, a GBA. In which case you can look forward to a full system lockup, instead ^_^)
01:12
<@McMartin>
No, actually, the compiler has no idea anything is amiss
01:12
<@McMartin>
So, yeah, silently generates incorrect code.
01:13
<@McMartin>
C's data model is:
01:13
<@McMartin>
unsigned char memory[MAX_INT];
01:13
< MyCatOwnz>
UINT_MAX, surely?
01:13
<@McMartin>
You just kind of cast it to things occasionally.
01:13
< MyCatOwnz>
Heheh. True dat. ^_^
01:13
< MyCatOwnz>
Does the strong typing in a C++ compiler catch it, though?
01:13
<@Vornicus>
unsigned void, I thought. :)
01:14
<@McMartin>
That was what I meant, but come to think of it, unless you fiddle with your kernel, 2 GB is really the max addressable.
01:14
<@McMartin>
Vornicus: Can't have an array of void
01:14
<@Vornicus>
bah
01:14
<@McMartin>
MyCatOwnz: C++ is no more strongly typed than C is.
01:14
<@McMartin>
And it can't catch this one because it would have to look at a compilation unit that isn't defined.
01:14
<@McMartin>
Er, that isn't named
01:14
< MyCatOwnz>
Ah. Yes.
01:15
< MyCatOwnz>
Doesn't the C++ compiler decorate variable and function names with their types, so that the linker would catch it?
01:15
<@McMartin>
Strongly typed means you actually can't force casts.
01:15
<@McMartin>
The linker might catch it.
01:15
<@McMartin>
And the compiler theoretically should catch it at least as a warning when you compile the file in which the extern is actually defined.
01:16
<@McMartin>
Although really, come to think of it
01:16
<@McMartin>
I don't know the standard
01:16
<@McMartin>
But there's no reason to not compile "char str[256]" at the global level to 260 bytes.
01:16
<@McMartin>
And bind the external to the pointer value, and then treat them both identically
01:16
< MyCatOwnz>
No, I think the only name decoration C++ does is for objects and for overloaded functions.
01:16
< MyCatOwnz>
But, oh wait, silly me. Good coding practice will catch that anyway.
01:17
< MyCatOwnz>
I mean, there's a coding practice that does catch that bug.
01:18
< MyCatOwnz>
You put the line "extern char* str;" in a file "something.h", you put the "char str[256];" in a file "something.c" and then you make sure that something.c #includes its own header file.
01:18
<@McMartin>
At which point it's detectable, yeah.
01:18
<@McMartin>
The question then is whether or not C89 demands you accept this or soemthing heinous like that
01:18
< MyCatOwnz>
That way, if you accidentally get definitions and declarations that conflict, the compiler will swear at you.
01:18
< MyCatOwnz>
McMartin: well, C89 kinda requires it for sanity's sake, don'tcha think?
01:19
<@McMartin>
Expecting sanity from a standard?
01:19
<@McMartin>
Dangerous assumption, sir~
01:19
< MyCatOwnz>
When writing a library to fit some API, I'd consider it crazy to not have the library code #include the API header, so that I can never get (say) a mismatch between the API and the implementations' return types.
01:20
<@McMartin>
No no.
01:20
< MyCatOwnz>
I don't mean that the standard is sane, I mean that if you're using that standard and you are sane, you'd want to do that.
01:20
<@McMartin>
I was talking about compiler swearing.
01:20
<@McMartin>
As in, the standard demands that the compiler accept the declarations we describe for legacy purposes or whatever.
01:21
< MyCatOwnz>
McMartin: no, the compiler is required to throw an error message if you give conflicing types.
01:22
<@McMartin>
Yes, but Pointers And Arrays Are The Same Type ZOMG.
01:22
< MyCatOwnz>
Er, I mean, yes, the compiler is required to throw an error message if you give conflicting types.
01:22
< MyCatOwnz>
Not in that context, as you've pointed out. And a non-braindead compiler already knows the distinction.
01:23 * McMartin checks gcc
01:23
< MyCatOwnz>
Dude, no. Please don't ruin my faith =)
01:23
<@McMartin>
gcc catches it as a conflicting type~
01:24
< MyCatOwnz>
faith.c:4: error: conflicting types for âstrâ
01:24
< MyCatOwnz>
faith.c:3: error: previous declaration of âstrâ was here
01:24
< MyCatOwnz>
Okay, thank goodness. Faith intact. ^_^
01:25
<@McMartin>
gcc refuses, however, to compile to K&R standards~
01:25
< MyCatOwnz>
K&R was kinda ad-hoc-ish.
01:25
< MyCatOwnz>
Besides, there's probably an option for it. ;)
01:25
< MyCatOwnz>
Where's the discrepancy?
01:26
<@McMartin>
The option was -traditional
01:26
<@McMartin>
And this is now only permitted if you also do -E, which is "only run the preprocessor"
01:26
< MyCatOwnz>
Hahahahahah. So anyway, whassa discrepancy, please? I'm quite curious.
01:26
<@McMartin>
There's all kinds of discrepancies.
01:27
<@McMartin>
Here's the biggest one.
01:27
<@McMartin>
This is not valid K&R C:
01:27
<@McMartin>
int fn (int a, int b) { return a + b; }
01:27
<@McMartin>
K&R demands:
01:27
<@McMartin>
int fn () int a; int b; { return a + b; }
01:27
<@Vornicus>
;_;
01:27
<@McMartin>
K&R also didn't have function prototypes.
01:27
<@McMartin>
This made linking interesting.
01:28
<@McMartin>
It also gave us the, ahem, glory of varargs.
01:28
<@McMartin>
Which made compiling to register-based architectures entertaining.
01:30 * ToxicFrog pokes Chalcedon.
01:30
<@Chalcedon>
yes?
01:30
<@ToxicFrog>
http://www.funkyhorror.net/toxicfrog/projects/StoatsSFE.png
01:32
<@Chalcedon>
can we stick it on the opposite side?
01:32
<@Chalcedon>
(otherwise tis excellent)
01:33
<@ToxicFrog>
Umm. You mean increase the amount of whitespace on the right side of the image and put it there?
01:33
< MyCatOwnz>
McMartin: frankly, I see all of those as good version to prefer the C89 ANSI spec. oO
01:33
<@McMartin>
Yes, yes indeed.
01:33
<@McMartin>
It wasn't widely adopted until the mid-90s, I note.
01:33
< MyCatOwnz>
I wonder how long it'll take C99 to get wide adoption? ;)
01:34
<@McMartin>
Which means, among other things, that the code we inherited for UQM was written with a ton of macros to try to make it compile on both ANSI *and* K&R.
01:34
<@McMartin>
This stuff is all toast now, thank God.
01:34
< MyCatOwnz>
McMartin: oh, ick.
01:34
<@McMartin>
And the only bit of C99 people use is widely supported.
01:34
<@McMartin>
That being // comments.
01:34
<@ToxicFrog>
And for loop initial declarations.
01:34
<@Chalcedon>
is that problematic? (other than creating a whole lot of whitespace)
01:34
<@ToxicFrog>
Which are supported in gcc and in VS7.
01:34
< MyCatOwnz>
Question: does gcc tend to lead or to lag the commercial compilers when it comes to supporting new language standards? C99 and all that jazz?
01:35
<@ToxicFrog>
MCO: don't know about icc or Borland, but it's definitely ahead of MSDev.
01:35
< MyCatOwnz>
ToxicFrog: so's the Arizona Statewide Bumfuck Corporation. Think harder ;)
01:35
<@McMartin>
gcc supports C99, but not by default.
01:36
< MyCatOwnz>
McMartin: jah. Apparently they're planning to make it default once they've completed support for it. Which seems to mean "not yet" :)
01:36
< MyCatOwnz>
Missing all the complex number stuff, fer starters.
01:36
<@McMartin>
Yeah
01:36
<@ToxicFrog>
Chalcedon: it's very easy, it just vastly offends my sense of aesthetics~
01:36
<@McMartin>
Also, the bits from C++ are tricky
01:37
<@Chalcedon>
fair enough.
01:37
<@McMartin>
Because for a long while, the standard required something annoying, and MSDev did it anyway, and gcc didn't.
01:37
<@McMartin>
The standard later changed to match gcc behavior
01:37
< MyCatOwnz>
McMartin: well yeah. C++ managed to break the complexity barrier unto the point where it's no longer compilable with a LALR parser =D
01:37
<@Chalcedon>
its just, um. Key's go on the right. Its another one of those 'cos that's how we do this' type things.
01:37
<@ToxicFrog>
...
01:37
<@McMartin>
And people bitch about MSdev for "failing to follow the standard" at that point.
01:37
<@McMartin>
(This isn't one of those bits.)
01:37 * ToxicFrog eyes Chalcy's entire discipline
01:38 * Chalcedon hides
01:38
<@McMartin>
This is the semantics of "for (int i = 0; i < n, i++)"
01:38
<@McMartin>
In gcc, i goes out of scope when the for loop ends.
01:38
<@McMartin>
In MSDev, for quite a while, i lasted until the end of the block.
01:38
<@McMartin>
At the time, MSDev was standards-compliant and gcc wasn't.
01:38
< MyCatOwnz>
But the MSDev approach is silly.
01:38
<@Chalcedon>
if you like, I'll double check with my stats supervisor, but I'm fairly sure I'm correct.
01:38
< Janus>
I've noticed that too... and with disasterous results as well.
01:38
< MyCatOwnz>
Why would you want a loop counter to stay in scope after the loop's ended?
01:39
<@McMartin>
Because it means that it's identical to "int i; for (i = 0; " etc., and it's easier to write that in a standards document.
01:39
< MyCatOwnz>
...what?
01:39
< MyCatOwnz>
Is that it?
01:39
<@McMartin>
The standard was eventually changed, I note.
01:40
<@ToxicFrog>
Chalcedon: it particularly offends me because then we have "no data" being solely responsible for this massive whack of whitespace.
01:40
<@McMartin>
But crying about how evil standards compliance is except in cases where a company you don't like is complying, in which case, the standard is bad is kind of screaming hypocrisy.
01:40
<@ToxicFrog>
Hmm. Is it acceptable to put the labels on the left side of the key rather than the right?
01:40 * Chalcedon hmm
01:41
<@Chalcedon>
it would be unusual, but I'm not aware of any reason not to.
01:41
< MyCatOwnz>
It's also vastly worse. If you want to keep the data in the index around, just copy it to an outer-variable. Making the loop index last through th'entire outer scope means you can't use a second for loop with the same syntax & same index variable name in teh same block.
01:42 * Chalcedon gives McMartin the thwappy stick of thwappiness?
01:42
<@McMartin>
MyCatOwnz: There is no a priori reason to believe this.
01:42
<@ToxicFrog>
Chalcedon: awesome. Stand by.
01:42
< MyCatOwnz>
It sounds like a wonderful way to get yourself a nice ugly scoping issue on your doorstep.
01:42
<@McMartin>
And, in fact, ducking issues like this was one of the reasons Algol and its ilk said "You may only declare variables at the beginning of blocks, plzkthx"
01:42 Thaqui [~Thaqui@Nightstar-23226.jetbuster.co.nz] has quit [Ping Timeout]
01:43
<@ToxicFrog>
And K&R, as I recall.
01:43
<@McMartin>
Yup.
01:43
<@McMartin>
And C89.
01:43
<@McMartin>
And C90.
01:43
<@McMartin>
You can, incidentally, force the two equivalent with a #define.
01:44
<@McMartin>
Well.
01:44
< MyCatOwnz>
Yes, but that's a pain in the butt and everyone allows the alternative (ie C99) because it makes life much easier to have your variables defined next to where you're about to use them, rather than far off at the top of a long function.
01:44
<@McMartin>
Force new-standard out of old-standard with a define.
01:44 Thaqui [~Thaqui@Nightstar-23226.jetbuster.co.nz] has joined #code
01:44
<@McMartin>
MyCatOwnz: You do realize that { block } is a statement, right~
01:45
< MyCatOwnz>
McMartin: ...good point. But that messes with my indentation style. ;)
01:45
< MyCatOwnz>
Okay, you have a convert. Go, C89!
01:45
<@McMartin>
The new standard makes "for (int i = ...)" equivalent to "{ int i; for (i = ...) }".
01:45
<@McMartin>
And the evil #define, idly.
01:45
<@McMartin>
#define for if (0); else for
01:46
< MyCatOwnz>
WHAT THE HELL WAS THAT?
01:47
< MyCatOwnz>
Okay, I can see how that works. The goggles still don't do anything though.
01:47
< MyCatOwnz>
Admittedly, ten out of ten for sheer cojones.
01:47
<@ToxicFrog>
Chalain: refresh
01:47
<@Vornicus>
...I think you meant chalcedon
01:48 * Chalcedon grin
01:48
<@ToxicFrog>
...yes.
01:48
<@Chalcedon>
yes, I nearly tried to ghost him the other day by accident.
01:48
<@Chalcedon>
brilliant
01:48 * Chalcedon hug TF
01:48
<@Vornicus>
I would say something about the likelihood of two nicks having the same four letters at the start, but
01:48
<@Vornicus>
Vornicus Vornicus-Latens
01:49
<@ToxicFrog>
Two nicks not owned by the same person, though?
01:49
<@Vornicus>
well, yes
01:49
<@ToxicFrog>
Chalcedon: the .bash and .ps have been updated
01:49 * Chalcedon nods
01:49
<@McMartin>
MyCatOwnz: Admittedly, the reason I'm Equipped with all these C89 Tricks is because my main C project (UQM) is C89-with-C++-comments.
01:49
<@McMartin>
And so one learns.
01:49
<@ToxicFrog>
Sorry, false alarm, /now/ they have.
01:49
< MyCatOwnz>
McMartin: that sounds purty delicious.
01:50
<@McMartin>
There is a continuing low-level struggle between people who want to get rid of the // comments and people who want to write backend libraries in C++.
01:51 * Vornicus ponders that right now if you want to do a TC mod of UQM, you have to know C.
01:51
< MyCatOwnz>
What's UQM?
01:52
<@McMartin>
http://sc2.sf.net/
01:52
<@McMartin>
Vornicus: TC implies a generic engine of some kind.
01:52
<@McMartin>
Need I remind you this was written in 1991~
01:53
<@Vornicus>
Yes.
01:55 * Chalcedon hug TF
01:55 Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has quit [Quit: ]
01:56
< MyCatOwnz>
McMartin: oh, sweet! Shiny!
01:57
<@Chalcedon>
TF: out of curiosity, which bit draws the key?
02:02
<@Chalcedon>
-er- that version doesn't draw a key?
02:04
< MyCatOwnz>
Perhaps you offended his aesthetic sensibilities a little *too* much?
02:08
<@ToxicFrog>
...um.
02:08
<@ToxicFrog>
The one on the server is the same as the one on my hard drive, it has to draw a key.
02:09
<@ToxicFrog>
It's the bit between % add a key and showpage
02:10 * Chalcedon pokes it
02:10
<@Chalcedon>
what is %add a key below?
02:11
<@ToxicFrog>
% label the image
02:13 * Chalcedon eyes it
02:13
<@Chalcedon>
its not on this
02:13
<@Chalcedon>
I'll download again to be sure
02:15 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: Jouets de Dieu, jouets de jouets, et les jouets de me, fait naître Clairvoire.]
02:15 * Chalcedon beats her computer
02:17 * Stephenie takes Chacedon's computer away
02:17
<@Stephenie>
That should be against the law :O
02:18
<@ToxicFrog>
Steph: tell that to anyone who has used a Dell or eMachines prefab box~
02:18 * Stephenie coughs
02:18
<@Stephenie>
I have emachine
02:18
<@Chalcedon>
no, its not on the version I'm able to access
02:18
<@McMartin>
Hey, Spiff and Zinglon are both prefab~
02:18
<@McMartin>
Albeit HP prefabs.
02:19
<@Chalcedon>
Steph: my machine is nearly 5 years old running a 5 year old install of XP home. It is desparately in need of a reformat.
02:19
<@Stephenie>
Chalcedon I bet and wow
02:19
<@Chalcedon>
(note that I am also running 12 windows at the moment)
02:20
<@ToxicFrog>
Chalcedon: I just reloaded it. The one on the server /is/ the right one.
02:20
<@McMartin>
Ctrl-refresh
02:20
<@ToxicFrog>
(hell, anything running XP Home is in need of a reformat from day 1, being five years old just makes it worse)
02:20 Stephenie [Safyra@Nightstar-4370.ok.ok.cox.net] has quit [Quit: ]
02:22
<@Chalcedon>
TF: I am aware of that now....
02:22
<@Chalcedon>
but I wasn't when I bought it.
02:22
<@Chalcedon>
any suggestions on how to persuade firefox to download the correct file?
02:23
<@ToxicFrog>
None. FF's download manager is terminally braindead.
02:23
<@ToxicFrog>
However, if you have a Cygwin window up in the dir where you want it downloaded to:
02:23 timelady [~romana@Nightstar-13706.lns3.adl2.internode.on.net] has quit [Quit: run away! run away!]
02:23 * Chalcedon is counting the days til her thesis is finished and she can install ubuntu
02:23
<@ToxicFrog>
$ rm stoatburgers.ps (to get rid of the old version)
02:24
<@ToxicFrog>
$ wget http://www.funkyhorror.net/toxicfrog/projects/stoatburgers.ps
02:24
<@ToxicFrog>
And repeat for stoatburgers.bash
02:26
<@Chalcedon>
yay
02:26
<@Chalcedon>
it worked
02:26 * Chalcedon beats firefox
02:28
<@ToxicFrog>
Firefox is, in my experience, full of spiders.
02:28
<@Chalcedon>
I can /kindof/ see what is going on.
02:28
<@Chalcedon>
hmm, what do you use then?
02:28
<@ToxicFrog>
Opera.
02:29 * Chalcedon nod
02:29
<@Chalcedon>
I am becoming increasingly tempted to try opera
02:30
<@ToxicFrog>
Tabbed browsing, session saving, mouse gestures, popup blocking, highly configurable everything, scales to large numbers of tabs /far/ better than FF, decent builtin download manager with resume and Bittorrent support, cross-platform.
02:30 * Chalcedon adds this to the list of things to do once her thesis is completed
02:30
<@ToxicFrog>
Drawbacks: closed-source, higher base memory usage (ie with very few tabs open) than FF.
02:30 * Chalcedon hmm
02:31 * ToxicFrog routinely runs with over 200 tabs, which kind of causes FF to choke and die but which Opera handles in ~200MB of memory.
02:31 Stephenie [Safyra@Nightstar-4370.ok.ok.cox.net] has joined #code
02:31
<@Chalcedon>
which on my computer would choke and die, considering I only have 256
02:31
<@ToxicFrog>
Yeah.
02:32
<@ToxicFrog>
Hang on, let me check something.
02:32
<@Chalcedon>
however, lots of tabs would be handy because I tend to read the newspapers online and end up with lots of tabs open.
02:33
<@ToxicFrog>
Ok. Opera, with nothing but the download manager open, allocates about 45MB of memory and uses about 25MB of that (ie, the rest goes to swap and stays there, at least on Linux)
02:34
<@ToxicFrog>
This is how I read news and forums, yes.
02:34 * Chalcedon nods
02:34
<@ToxicFrog>
Ctrl+shift+click ("open link in background tab") everything interesting, then go down the tab list closing them behind me.
02:35
<@ToxicFrog>
(Oh. Did I mention scrollable tab pane as an option?)
02:35
<@Chalcedon>
thats what I do too :)
02:35
<@Chalcedon>
scrollable tab pane sounds handy, though I'm not sure I'd use it.
02:35 [0]ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
02:36 [0]ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Connection reset by peer]
02:37
<@Chalcedon>
I don't like session saving, except for the rare occasions when I want to close it down for the night so that it doesn't hog my memory and make the computer chug, but I suspect opera wouldn't really do that.
02:37
<@ToxicFrog>
It's not really useful unless you have enough tabs that either (a) they shrink down into unreadability or (b) even when shrunk down, it can't fit them all on screen.
02:37
<@Chalcedon>
Hell, firefox probably wouldn't on a clean install.
02:37
<@ToxicFrog>
I hit (a) after about five minutes in FF and (b) less than an hour thereafter.
02:37
<@Chalcedon>
o.O
02:37
<@ToxicFrog>
Session saving I am addicted to. I can no longer use a browser without it.
02:38
<@Chalcedon>
I don't think I've ever opened that many, probably because it chugs insanely
02:38
<@ToxicFrog>
It has four startup modes: start with no tabs, start with homepage, load saved session, and load the session that it autosaves when it quits or crashes.
02:38
<@ToxicFrog>
I have it forever set on the last one.
02:38 * Chalcedon nods
02:38
<@Chalcedon>
what do mouse gestures do?
02:39
<@ToxicFrog>
Hold down the right mouse button, drag the mouse, release; and it does something.
02:39
<@ToxicFrog>
For example, left is back, right is forward, up-down is reload, down-left is hide tab and down-right is close tab.
02:39
<@ToxicFrog>
They are like sweet sweet crack.
02:40 * Chalcedon considers
02:40
<@Chalcedon>
that sounds handy, but I can see it aggravating my OOs
02:40
<@Chalcedon>
*OOS
02:41
<@ToxicFrog>
OOS?
02:41
<@Chalcedon>
Occupational Overuse Syndrome
02:42
<@Chalcedon>
basically I get pains in my forearms
02:42
<@Chalcedon>
sometimes tis fine, sometimes I actually can't use a computer (rarely that bad)
02:42
<@ToxicFrog>
Aah.
02:42
<@ToxicFrog>
Well, it's less mouse movement than actually clicking the buttons.
02:43 * Chalcedon nods
02:43
<@Chalcedon>
problem is it was constant clicking that caused the problem (on a program that didn't have proper keyboard shortcuts)
02:43
<@ToxicFrog>
I find that since browsing is mouse-driven /anyways/, it's basically the mouse equivalent of keyboard shortcuts.
02:44 * Chalcedon nods
02:44
<@Chalcedon>
thats a good point
02:45
<@Chalcedon>
you know, I'm going to reformat my computer and play with all this linuxy-non-microsoft goodness at the same time I start work which will in all probablility confine me to ie.
02:47 * Chalcedon sigh
02:48
<@ToxicFrog>
;.;
02:48
<@ToxicFrog>
Why would it confine you to IE?
02:50
<@ToxicFrog>
Oh, screenshot of my (very heavily customized) Opera: http://www.funkyhorror.net/toxicfrog/shinies/opera.png
02:50
<@ToxicFrog>
I've kind of minimized the UI a lot.
02:51
<@Chalcedon>
most workplaces, particularly large ones use IE and refuse to let you install another browser
02:51
<@ToxicFrog>
...
02:51
<@ToxicFrog>
Err, wtf.
02:52
<@Chalcedon>
I'm pretty sure the uni only allows IE, and I know AgResearch does.
02:53
<@Chalcedon>
I'd /ask/ but I'd expect to get a no.
02:53
<@ToxicFrog>
...
02:53 * Chalcedon shrugs
02:54
<@Chalcedon>
perhaps I am overgeneralising, but that's the impression I've got.
02:54
<@ToxicFrog>
Ok, while I know the breadth of my work experience is severely limited...at Bluecoat, at least, we can install whatever browser we wish and are in fact encouraged to use IE only for testing (either page rendering, or the anti-virus/anti-spyware systems).
02:54
< MyCatOwnz>
I take it their IT department enjoys cleaning up after driveby-installed malware exploiting remote root exploits in IE?
02:54
<@ToxicFrog>
While the IE department at the university permits IE, they install Firefox as standard on all computers and make sure that it's much, much easier to get at than IE.
02:55
<@ToxicFrog>
Err. IT department.
02:55
< MyCatOwnz>
My uni is pretty sweet. The people in the offices use Seamonkey/Mozilla suite.
02:55
< MyCatOwnz>
Firefox on all machines, Winblows or otherwise.
02:55
<@ToxicFrog>
(they also make sure that the PuTTY suite is installed on all windows machines; most of the engineering machines have Cygwin; all the comp sci machines are dual boot Linux/windows and the Linux half has firefox and opera)
02:55
< MyCatOwnz>
The Windows users get handed an email program called "Mulberry" which isn't very user friendly but has the advantage of being quite quick and not being OE.
02:56
<@Chalcedon>
I don't think I've ever seen a firefox install at uni, though when I was having issues with webmail they advised me to use firefox to access it (from home)
02:56
< MyCatOwnz>
Oh and Loonix users get told to use whatever, y'know? But mostly that means Thunderbird.
02:56
< MyCatOwnz>
Since they don't feel like teaching anyone to use mutt ^_^
02:57
<@Chalcedon>
students don't have access to any kind of outlook other than webmail.
02:57
<@ToxicFrog>
The last time I saw IE as /default/, let alone mandatory, was in high school, where the IT admin department was run by a single overworked math teacher with no computer experience and the IT purchasing department was corrupt as an uncleanly unmounted FAT16 filesystem.
02:57
<@Chalcedon>
I know CompSci has Linux machines somewhere, but I don't know where or in what quantities. Obviously they won't have IE. Actually I seem to recall they can't access the net only CS's intranet.
02:58
<@ToxicFrog>
...
02:59
<@ToxicFrog>
Your IT department has some serious issues.
02:59 * Chalcedon nods
02:59
<@Chalcedon>
I've never been impressed with ITS
02:59
<@Chalcedon>
To give them /some/ credit it was probably a management decision to go with Windows etc.
03:00
<@ToxicFrog>
Yeah, but still. They could at least install software on them that won't /rape the entire network as soon as they turn their backs/.
03:00
<@Chalcedon>
actually, there's a point, it could be that our licencing agreement with microsoft has a must-use-ie clause, but I've really no idea.
03:00
<@ToxicFrog>
...
03:01
<@Chalcedon>
mind you, these are the people who thought they could run a microsoft webmail program from a linux server without issues.
03:02
<@Chalcedon>
I'm quite sure the server was better and more stable, but you can bet the webmail program sure as hell didn't like it.
03:02 MyCatOwnz [~mycatownz@Nightstar-379.dsl.in-addr.zen.co.uk] has quit [Quit: Sleeping.]
03:02
<@Chalcedon>
now the whole thing is running off a windows server.
03:02 * Chalcedon doesn't much like her uni webmail
03:04 * Chalcedon really ought to become more informed on server security and compatibility issues
03:04
<@ToxicFrog>
You can't talk to your uni's mail servers with IMAP or POP?
03:04
<@Chalcedon>
I don't think so.
03:04
<@ToxicFrog>
You know, more and more, as I hear about what other uni's networks are like, I'm thinking I dodged a bullet coming to Guelph.
03:04
<@Chalcedon>
actually, we had this discussion once before, and I meant to email and ask. I forgot
03:05
<@Chalcedon>
:)
03:05
<@ToxicFrog>
BSD accounts for all students, Linux accounts (both in-lab and SSH access) for all comp sci students, POP-accessible mail server (and, if you're on campus, an SMTP relay for student use)...
03:05
<@ToxicFrog>
Firefox and a full set of PuTTY tools on every windows machine on campus....
03:05
<@McMartin>
TF: That matches pretty closely to both Berkeley and Stanford.
03:06
<@McMartin>
Though you're hard-pressed to find Windows machines in labs at either
03:06
<@McMartin>
Except for insanely specialized stuff.
03:06 ReivZzz is now known as Reiver
03:06
<@Chalcedon>
morning Reiver
03:06 * Chalcedon pokes Reiver
03:06
<@McMartin>
Stanford is mostly Macs, with a batch of Solaris machines shifting to Linux.
03:06
<@Chalcedon>
you know more about the CS system and stuff in general than I do
03:06
<@McMartin>
Berkeley was mostly HP-UX while I was there, but Linux was Not Exactly Ready For Prime Time in 1996.
03:07
<@Reiver>
?
03:07
<@McMartin>
By which I mean, most of Cal-LUG's time was spent actually installing Linux
03:07
<@ToxicFrog>
The comp sci labs are Linux/Windows dual (or Linux/BSD/Windows triple), but I hardly ever see them in Windows.
03:07
<@McMartin>
in "Installfests", where you had three experts looking over your shoulder the whole time, becuase one wasn't enough
03:07
<@Reiver>
Waikato is primarily windows or linux.
03:07
<@ToxicFrog>
The engineering labs are windows, because a lot of engineering stuff requires a shitload of software that appears to be windows only.
03:08
<@ToxicFrog>
However, thye all have Cygwin installed.
03:08
<@Chalcedon>
linux isn't for general use though, I've never seen it.
03:08
<@Reiver>
Windows is for the 1st year students and the remedial papers.
03:08
<@McMartin>
Yeah, the Digital Design lab at Berkeley is the only Windows retrenchment I recall from there.
03:08
<@Reiver>
Linux is for all actual CS students.
03:08
<@Reiver>
Mac is all the graphic design students.
03:09
<@Reiver>
Rest of the university is Windows, but.
03:09
<@McMartin>
My graphics class was full of GeForce-equipped Linux boxes.
03:09
<@ToxicFrog>
I've never seen a Mac on campus, but Steve (who's in art) assures me they exist somewhere.
03:09
<@Reiver>
Yeah. There's a whole floor of them in one of our buildings.
03:09
<@Reiver>
And that's pretty much it.
03:09
<@Chalcedon>
I recall seeing macs in the bottom of R-block
03:09
<@McMartin>
Interestingly, I think I saw one BSD machine my entire time at Berkeley.
03:09
<@McMartin>
And it was part of a student organization.
03:10
<@Reiver>
Most of CS is in Linux, and the machines that aren't have that terminal/SSH thingy on them.
03:10
<@McMartin>
Probably PuTTY
03:10
<@Reiver>
The Linux boxes are all Fedora.
03:10
<@McMartin>
But I remember back when F-Secure's implementation was the best of breed.
03:10
<@Reiver>
Or at least, All the boxes I /saw/ were Fedora, so.
03:10
<@Chalcedon>
Reiver, have you ever seen any sign of competence out of ITS? or am I being cynical?
03:11
<@Reiver>
Bear in mind the NZ government signed a deal with Microsoft so academic institutions get $$cheap$$ Microsoft stuff.
03:11
<@Reiver>
And no, ITS is pretty much an incompetent bunch of contracted buffoons.
03:11
<@Chalcedon>
ah, I missed that one.
03:12
<@Reiver>
If you want anything *useful* you go to the different schools IT departments.
03:12
<@Reiver>
They can usually hook you up with something actually competent.
03:12 Vornicus-Latens is now known as Vornicus
03:12
<@Chalcedon>
hi Vorn
03:12
<@McMartin>
Something?
03:12
<@McMartin>
Your department IT guys are robots?
03:12
<@Chalcedon>
occasionally someone
03:12 Stephenie [Safyra@Nightstar-4370.ok.ok.cox.net] has left #code []
03:12
<@McMartin>
I like my theory better
03:13
<@Reiver>
Well I'm not sure I'd call them people McM, some of them look kinda scary~
03:13
<@McMartin>
ROBOBOFH
03:13
<@Chalcedon>
the only time I ever approached the Sci dept ones, they were quite rude.
03:13
<@Reiver>
(Remember that ITS only runs the internet proxy/logins and the public access labs at the uni, Chalcedon. All the department labs have their own IT support.)
03:13
<@Chalcedon>
it wasn't /my/ fault the R-block lab didn't specify the colour printer was in F-block!
03:14
<@Reiver>
Ah
03:14
<@Chalcedon>
apparently ITS runs the info commons
03:14
<@Reiver>
"Well that was stupid then wasn't it?"
03:14
<@Reiver>
Chalcedon: Aye. Public access machines.
03:14
<@Reiver>
The CS department actually runs their own seperate network
03:14
<@McMartin>
Heh. PSL doesn't have a policy, ANAICT.
03:14
<@Chalcedon>
well no it actually didn't say and last time I checked I wasn't psychic
03:15
<@McMartin>
That was how someone started a full-out attack on the University's President's server when he thought he was just running a local test.
03:15
<@Reiver>
Which is sort of a pain but also sort of good.
03:15
<@Reiver>
...But mostly sort of a pain.
03:15
<@Chalcedon>
o.O
03:15
<@Reiver>
>.>
03:15
<@McMartin>
(If the o.O was at me, the president was part of the lab before he left, and he kept the IP address.)
03:16
<@McMartin>
(We have to be careful not to do things to our entire subnet)
03:16
<@Chalcedon>
is a Uni president the same as a VC or different?
03:17 * ToxicFrog did that to work once
03:17
<@McMartin>
Uh, VC to me means either "Venture Capitalist" or "Vice Chancellor", so expand acronym please?
03:17
<@Chalcedon>
Vice Chancellor
03:17
<@McMartin>
More Arch-Chancellor.
03:17
<@ToxicFrog>
"Oh, hey, the loopback cable isn't hooked up. I think I just DoS'd the entire division network."
03:18
<@ToxicFrog>
"...which would explain why I can't access the internet."
03:18
<@McMartin>
Hee
03:18
<@McMartin>
Oh, wait. CSL.
03:18
<@McMartin>
PSL is my subdivision.
03:18
<@Chalcedon>
oops
03:18
<@McMartin>
(Computer Systems Lab, Programming Systems and Languages)
03:19
<@Vornicus>
...you work in PSL.
03:19
<@McMartin>
That latter one was funnier five years ago.
03:19
<@ToxicFrog>
(you run network tests on an SG by connecting it to itself - physically - and then it UDP broadcast-floods as fast as it can call sendto(). This has tragic side effects if you forget to recable it.)
03:19
<@McMartin>
Vornicus: It was where I applied under, anyway. I got my office in the middle of scientific computation for reasons I now suspect have to do with the recommendation letters I got.
03:19 * Chalcedon stifles giggles at TF
03:20
<@McMartin>
Hmm
03:20
<@McMartin>
I have an HTML question.
03:20 * Vornicus has some HTML knowledge.
03:21
<@McMartin>
Is there a combination of frames/CSS/whatever that will let you superimpose a (mostly transparent) image over the browser window?
03:21
<@McMartin>
Like background, but, well, foreground.
03:21 * McMartin is tired of the javascript::alert way of demonstrating XSS vulnerabilities, and putting a huge PWN3D stamp over the page looks like more fun.
03:21
<@Chalcedon>
so that it slightly shades out whatever else is on the page?
03:21
<@McMartin>
Indeed.
03:21 * Chalcedon frown
03:22
<@McMartin>
Or, specifically, is a giant PWN3D stamp over the text, as if someone has taken a rubber stamp to your monitor.
03:22
<@McMartin>
The idea being that defacement is more dramatic.
03:22
<@Chalcedon>
hehe
03:22
<@Vornicus>
position: fixed allows you to place objects relative to the coordinates of the /window/ as opposed to that of the page.
03:22
<@Chalcedon>
I don't think my knowledge of HTML/CSS is that advanced sorry, but it sounds like the sort of thing you /should/ be able to do.
03:22
<@Vornicus>
However, note that as of IE6, PNG transparency is still broken in it.
03:23
<@McMartin>
Well, I'd be using Firefox, anyway
03:23
<@Vornicus>
Bungie.com I know used to have a position: fixed thing on it
03:24
<@Vornicus>
...still does
03:24
<@McMartin>
Quite so!
03:25
<@McMartin>
Hee. notIE.css
03:25
<@Vornicus>
hee
03:26
<@McMartin>
In fact, it's got, like 20. Because inheritance is all about code reuse and not duplicating code.
03:26
<@McMartin>
http://www.bungie.net/css/notIE.css
03:27
<@Vornicus>
...piss and biscuits
03:28
<@McMartin>
In any event, thank you.
03:28
<@Vornicus>
So yeah. Make a big picture that says "PWN3D" on it, put it in a div with position: fixed on it, and you have yourself a stamp.
03:31 * McMartin nods
03:31
<@McMartin>
Google Image Search has failed me here.
03:31
<@McMartin>
(Also, what's the difference between position: fixed and position: absolute?)
03:32
<@Vornicus>
...off the top of my head, I'm not sure
03:32
<@Vornicus>
I believe absolute may give you /page/ coordinates as opposed to coordinates in the enclosing block.
03:33 * McMartin consults with the great sage O'RLY
03:33 * Vornicus consults with the great sage W#
03:33
<@Vornicus>
W3 rather
03:34
<@McMartin>
Absolute is wrt enclosing block; Fixed is wrt viewport.
03:34
<@Vornicus>
huh
03:44 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
03:45 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
03:45 mode/#code [+o Chalcedon] by ChanServ
03:45
<@Chalcedon>
damn...
03:45
<@Chalcedon>
that was both weird and inconvenient
04:08 Reiver [~reaverta@IRCop.Nightstar.Net] has quit [Ping Timeout]
04:09 Reiver [~reaverta@IRCop.Nightstar.Net] has joined #Code
04:09 mode/#code [+o Reiver] by ChanServ
04:29 You're now known as TheWatcher[zZzZ]
05:27 Thaqui [~Thaqui@Nightstar-23226.jetbuster.co.nz] has quit [Client exited]
06:01 AnnoDomini [~fark.off@Nightstar-29739.neoplus.adsl.tpnet.pl] has joined #Code
07:54 Vornicus is now known as Vornicus-Latens
08:17 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout]
08:26 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code
08:32 Ev3 [~-@87.72.36.ns-26407] has joined #Code
08:41 Chalcedon is now known as ChalcyZzz
10:02 You're now known as TheWatcher[wr0k]
10:32 timelady [~romana@Nightstar-13706.lns3.adl2.internode.on.net] has joined #Code
11:08 timelady [~romana@Nightstar-13706.lns3.adl2.internode.on.net] has quit [Quit: run away! run away!]
11:25 Ev3 [~-@87.72.36.ns-26407] has quit [Ping Timeout]
12:21 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout]
12:28 ChalcyZzz [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
12:33 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code
12:34 Reiver is now known as ReivZzz
12:38 AnnoDomini [~fark.off@Nightstar-29739.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
12:38 KarmaBot [~fark.off@Nightstar-29739.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
13:15 Stephenie [Safyra@Nightstar-4370.ok.ok.cox.net] has joined #code
14:14 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout]
14:23 EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code
15:14 jerith_ [~jerith@IRCop.Nightstar.Net] has joined #code
15:15 jerith_ [~jerith@IRCop.Nightstar.Net] has quit [Quit: leaving]
15:15 ReivZzz is now known as ReivSLEP
15:59 MyCatOwnz [~rb6822@Nightstar-18280.cs.bris.ac.uk] has joined #code
16:00
< MyCatOwnz>
Mental note: never let your lecturers see your .bashrc
16:01
<@jerith>
Why?
16:01
<@ToxicFrog>
...why?
16:02
<@jerith>
I used to try to get my lecturer to *use* my .bashrc because his was crap.
16:02
< MyCatOwnz>
Because mine had "cat ~/TODO" in it somewhere.
16:03
< MyCatOwnz>
~/TODO's contents were "Finish bloody coursework already!"
16:03
< MyCatOwnz>
And guess who's late with his coursework... ><
16:03
<@jerith>
Ah.
16:03
<@ToxicFrog>
Hee.
16:03
<@ToxicFrog>
Cat ~/TODO is a good idea, though.
16:03
<@ToxicFrog>
I think I'll steal it.
16:03
< MyCatOwnz>
ToxicFrog: yay! Open source! =D
16:03 * MyCatOwnz slaps a 2-clause BSDL on his .bashrc and starts waving it at the internet.
16:17
<@ToxicFrog>
Hmm.
16:17
<@ToxicFrog>
There's nothing for it, I'm going to have to make Durandal dual-boot.
16:19
< MyCatOwnz>
VMWare! As a last resort, VMWare!
16:20
< MyCatOwnz>
Or, come to think of it, hasn't XenSource hit the point where it can now run Windoze?
16:20
<@ToxicFrog>
Durandal is already running windows, it's my gaming machine.
16:21
<@ToxicFrog>
However, I'm going to have to make it a 2k/XP dual rather than the pure 2k it is now in order to play Supreme Commander.
16:23
< MyCatOwnz>
Interesting.
16:23
< MyCatOwnz>
Why 2k over XP?
16:24
<@jerith>
Xen will run Windoze on virt hardware.
16:24
<@jerith>
Which is still rare and expensive.
16:24
<@ToxicFrog>
Less bloated, trusts me - insofar as windows ever does - to know what I'm doing (which XP very much does not without lots of beatings), fewer vulnerabilities, and no hardware-tied activation key wackiness.
16:25
<@ToxicFrog>
Also more stable.
17:32 Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has joined #code
17:33 mode/#code [+o Vornicus] by ChanServ
17:34 You're now known as TheWatcher[afk]
17:46 AnnoDomini [~fark.off@Nightstar-29875.neoplus.adsl.tpnet.pl] has joined #Code
18:05 ChalcyZzz [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
18:18 ReivSLEP is now known as Reiver
18:35 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
18:35 mode/#code [+o Chalcy] by ChanServ
18:37 ChalcyZzz [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
18:43 You're now known as TheWatcher
18:45 Chalcy is now known as Chalcedon
18:53 Reiver is now known as ReivOut
18:57
<@Vornicus>
gnar. how can I get the current time as seconds from epoch?
18:58
<@Vornicus>
in bash, that is
18:58
<@jerith>
Hmm...
18:58
<@jerith>
Will "date" not do it?
18:59
<@Vornicus>
I don't see a format piece that does it.
18:59
<@jerith>
[jerith@jerith-lap0 ~]$ man -k epoch
18:59
<@jerith>
mktime (3p) - convert broken-down time into time since the Epoch
18:59
< MyCatOwnz>
That's C.
18:59
<@jerith>
But that's a C library call.
19:00
<@jerith>
It's the only one man has, apparently.
19:00
< MyCatOwnz>
But then you could just write a C program to use mktime and then dump it. Like, five lines.
19:01
<@ToxicFrog>
Vornicus: date %s
19:01
<@ToxicFrog>
%s seconds since 1970-01-01 00:00:00 UTC
19:01
<@ToxicFrog>
+%s, rather
19:01
<@Vornicus>
...how did I miss that the first time?
19:02
<@Vornicus>
...probably because I was looking for the word "epoch"
19:02
<@ToxicFrog>
Because you were looking for...yes.
19:02
<@jerith>
Hmm, 170 pages of ZFS manual.
19:02
<@jerith>
Indeed.
19:17 MyCatOwnz [~rb6822@Nightstar-18280.cs.bris.ac.uk] has quit [Quit: Going home, cooking dinner.]
20:14 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #Code
20:48 Thaqui [~Thaqui@Nightstar-23226.jetbuster.co.nz] has joined #code
21:59
<@Vornicus>
...you know, if this bash scripting guide weren't 700 pages long, I would print it out.
21:59
<@jerith>
It *is* good.
21:59
<@Vornicus>
It is /awesome/
21:59
<@jerith>
ABS?
21:59
<@Vornicus>
Yes
22:00
<@jerith>
I printed it on campus once, 2 pages per page.
22:00
<@jerith>
Bound it, too.
22:00 * ToxicFrog has transcended the need for hardcopies~
22:01 * Vornicus personally prefers hardcopies of stuff like this.
22:01
<@jerith>
My hardcopy was mostly because the campus network was unusable during the day
22:01
<@jerith>
.
22:02
<@ToxicFrog>
That's what PDAs are for.
22:02
<@ToxicFrog>
Or the laptop, but unlike the PDA I don't always have it with me.
22:02
<@Vornicus>
Also. Here documents?
22:02
<@Vornicus>
/own/
22:02 * jerith nods.
22:03
<@ToxicFrog>
That wasn't what you said yesterday, but yes, they do.
22:03
<@jerith>
Look at my website in the dvd burning script for my most recent use. :-)
22:05
<@Vornicus>
...what did I say yesterday?
22:05
<@ToxicFrog>
:( mostly.
22:06 * ToxicFrog refers to the awk script inside a here document inside a variable
22:06
<@Vornicus>
Oh, yes
22:06
<@Vornicus>
/that/
22:09
<@McMartin>
I prefer here documents surrounded by sextuple quotes and assigned to strings in the first place.
22:09
<@McMartin>
My static analysis script has about five here documents that are actually complete datalog programs fed to our solver.
22:10 * Vornicus is using a here document to throw a single chunk of multiline data at an ldap server.
22:28 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: ~ ]
22:49 Stephenie [Safyra@Nightstar-4370.ok.ok.cox.net] has quit [Quit: ]
22:53
<@McMartin>
Yum, list comprehensions.
22:53
<@McMartin>
x = [int(f) for f in file(fname) if not f.startswith("#")]
22:55
<@ToxicFrog>
...x is a list consisting of the integer interpretations of those lines in fname that do not begin with #?
22:55
<@Vornicus>
Yep
22:55
<@McMartin>
Yup.
22:57
<@ToxicFrog>
Hmm. for l in lines(fname) do if string.sub(l,1,1) ~= "#" then table.insert(x, tonumber(l)) end end
22:58
<@McMartin>
Actually, I need to make this worse
22:58 Stephenie [Safyra@Nightstar-4370.ok.ok.cox.net] has joined #code
22:59
<@McMartin>
In that I need to do that with strings first on a different file, then use those integers to index the other file.
22:59
<@Vornicus>
x = File(fname).reject { |line| line =~ /^#/ }.map { |line| line.to_i }
22:59
<@McMartin>
(converting a numerical set specification to a human-readable list)
23:19 You're now known as TheWatcher[T-2]
23:21 You're now known as TheWatcher[zZzZ]
23:26 ReivOut is now known as Reiver
23:30 AnnoDomini [~fark.off@Nightstar-29875.neoplus.adsl.tpnet.pl] has quit [Quit: Some people find sanity a little confining.]
23:57 MyCatOwnz [~mycatownz@Nightstar-379.dsl.in-addr.zen.co.uk] has joined #code
--- Log closed Sat Nov 18 00:00:12 2006
code logs -> 2006 -> Fri, 17 Nov 2006< code.20061116.log - code.20061118.log >