code logs -> 2007 -> Tue, 09 Jan 2007< code.20070108.log - code.20070110.log >
--- Log opened Tue Jan 09 00:00:25 2007
00:18 Derakon[AFK] is now known as Derakon
00:31 Chalcy is now known as Chalcedon
00:34 Chalcedon is now known as ChalcyShopping
01:06 ChalcyShopping is now known as Chalcedon
01:13 Derakon is now known as Derakon[AFK]
01:39 Clairvoire [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #Code
01:40 Clairvoire is now known as Janus
02:32
< Janus>
Does anyone have experience with a tablet..?
02:33
<@Vornicus>
Enough to not stand it.
02:34
< Janus>
That bad, eh?
02:34
<@Vornicus>
it really doesn't work for the kind of work I do.
02:34
<@Vornicus>
If I were an artist, or something, I would be happier with it
02:35
< Janus>
Oh, I see. Artis-- ah.
02:35
<@Vornicus>
but I'm a programmer, and a gamer.
02:36
<@Vornicus>
The only genre that really works with tablets is RTS, and those generally don't have tablet support.
02:36
< Janus>
I can't see them coming in handy in either. (Gaming a little, but then again, who holds a pen during a who game anyway?)
02:37
< Janus>
*whole game too, though a who game would fit in too.
02:37
<@Vornicus>
On the other hand if you had a /really awesome/ editor, tablet input could be very interesting.
02:39
< Janus>
I haven't seen many awesome editors, but I suppose if there were bells and whistles to draw about...
02:40
< Janus>
*click on.
02:40
< ToxicFrog>
Vornicus: unsure on that point, since I can type considerably faster than I can write.
02:40
< ToxicFrog>
But perhaps if you had a lot of experience writing and relatively little typing.
02:40 * Janus concurs.
02:40
<@Vornicus>
The point isn't writing, though.
02:41
<@McMartin>
Re: tablet input, I have a two-letter answer
02:41
<@McMartin>
"DS"
02:42
<@Vornicus>
The point is that you have a lot more options with a pencil than with a keyboard - you can /draw/ logic flow, or gui things, or
02:44
< Janus>
How do you draw that..?
02:44
<@Vornicus>
what, logic flow? flowcharts, for instance.
02:47
< Janus>
Oh! For some reason, that had a sort of science fiction-y sound to it.
02:47
<@McMartin>
I'm now imagining a tablet-based IDE for Befunge.
02:47
<@Vornicus>
...pff
02:57
< MyCatVerbs>
Flight sims might work with tablets.
02:58
< MyCatVerbs>
I know that Thunder Bridage did, but that was a wierd-ass game anyway.
02:58 * Janus thinks he'll get a 6 x 11 Intios pad. But first, he will rob a Generic Bank.
03:00
<@Vornicus>
Isn't Intios the one that's also the screen?
03:01
< Janus>
No, I think that the "cintiq" thing
03:01
< ToxicFrog>
Vornicus: aah. That makes sense.
03:01
<@Vornicus>
ah, so
03:16 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Connection reset by peer]
03:17 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
03:17 mode/#code [+o Chalcedon] by ChanServ
03:17 Derakon[AFK] is now known as Derakon
03:27 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: Jouets de Dieu, jouets de jouets, les jouets de me, naĆ®tre Clair enfant voire.]
03:53 MyCatVerbs is now known as MyCatGames
03:59 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
03:59 mode/#code [+o Chalcy] by ChanServ
04:00 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Killed (NickServ (GHOST command used by Chalcy))]
04:00 Chalcy is now known as Chalcedon
04:27 MahalWork is now known as Mahal
04:43 ReivWork is now known as Reiver
04:45 Stephenie [Safyra@Nightstar-6407.ok.ok.cox.net] has quit [Quit: ]
05:06 Derakon is now known as Derakon[AFK]
06:04 Derakon[AFK] is now known as Derakon
06:10 AnnoDomini [~farkoff@Nightstar-29630.neoplus.adsl.tpnet.pl] has joined #Code
06:36 McMartin [~mcmartin@Nightstar-10827.dsl.pltn13.pacbell.net] has quit [Operation timed out]
06:53 Derakon is now known as Derakon[AFK]
08:08 Ev3 [~Shemhazai@Nightstar-28403.proxy2.balk.dk] has joined #Code
08:15 You're now known as TheWathcer[afk]
08:51 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Connection reset by peer]
08:51 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
08:51 mode/#code [+o Chalcedon] by ChanServ
09:01 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Quit: ]
09:08 McMartin [~mcmartin@Nightstar-10827.dsl.pltn13.pacbell.net] has joined #code
09:08 mode/#code [+o McMartin] by ChanServ
09:48 You're now known as TheWathcer[wr0k]
09:48 Reiver is now known as ReivZzz
10:02 You're now known as TheWatcher[wr0k]
11:46 Vornicus is now known as Vornicus-Latens
12:19 You're now known as TheWatcher[afk]
12:24 You're now known as TheWatcher[wr0k]
15:05 * ToxicFrog eyes his brain.
15:06
< ToxicFrog>
xcbash: a module for extending xchat with scripts written in bash.
15:06
< ToxicFrog>
Discuss.
15:08
< ToxicFrog>
This may be the most insane idea I've had since the IRC client written in postscript; I must implement it at once.
15:09
<@TheWatcher[wr0k]>
...
15:09
<@TheWatcher[wr0k]>
I am unsure whether it is genius or madness
15:09
<@TheWatcher[wr0k]>
Possibly both!
15:11
< ToxicFrog>
Windows users are kind of SOL, though.
15:12
< ToxicFrog>
Windows doesn't have named pipes or fork().
15:12
< ToxicFrog>
....hmm.
15:12
< ToxicFrog>
Or I could implement the IPC using netcat and UDP sockets.
15:14
< ToxicFrog>
(the idea here is that the script communicates with xchat over a named pipe, since the alternative is embedding bash into the module, which is painful. But you can't do that on windows.)
15:15
< ToxicFrog>
(so then I considered creating an anonymous pipe and then forking, but you can't do that on windows either...)
15:15
< ToxicFrog>
(except perhaps in Cygwin.)
15:18
< ToxicFrog>
Hrm. I can't seem to create an anonymous pipe in bash.
15:18
< ToxicFrog>
TW, any insight?
15:19
< ToxicFrog>
(what I'm after here is an fd, or a pair of fds, where I can fork and then communicate between the parent and child using them)
15:19
< ToxicFrog>
(normally I'd use mkfifo and standard file IO, but windows doesn't have that for obvious reasons)
15:20
< ToxicFrog>
Although I'm approaching the point where I decide to just make it Linux-only rather than trying to come up with something that works on windows as well.
15:36 * ToxicFrog ....
15:36
< ToxicFrog>
Bash doesn't appear to have explicit fork.
15:36
< ToxicFrog>
I could have sworn it did.
15:38 You're now known as TheWatcher[afk]
15:50
< ToxicFrog>
Hmm.
15:51
< ToxicFrog>
I was thinking something like:
15:51
< ToxicFrog>
forked_function <&3 >&4 &
15:51
< ToxicFrog>
And then talking to it on fd3 and fd4.
15:51
< ToxicFrog>
But that doesn't work.
15:56 * ToxicFrog also flails at his AI class, which is forcing him to use C++
15:56
< ToxicFrog>
(well, C++ or Java, but my opinion of Java is well known)
16:38 You're now known as TheWatcher
17:09 Serah [~-@87.72.36.ns-26407] has quit [Connection reset by peer]
17:10 Serah [~-@87.72.36.ns-26407] has joined #Code
17:24 AnnoDomini [~farkoff@Nightstar-29630.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
17:24 ReivZzz is now known as Reiver
17:29 AnnoDomini [~farkoff@Nightstar-28899.neoplus.adsl.tpnet.pl] has joined #Code
17:32 You're now known as TheWatcher[afk]
17:39 Reiver is now known as ReivWork
17:44 Ev3 [~Shemhazai@Nightstar-28403.proxy2.balk.dk] has quit [Quit: Don't try to read the quit message, that is impossible. Instead only realize the thruth; "there is no quit message" and you will see it is not you who read the quit message but the quit message who reads you.]
18:40 You're now known as TheWatcher
18:43
< ToxicFrog>
I think I have it!
18:43
< ToxicFrog>
...wait, shit.
18:43
< ToxicFrog>
No I don't.
18:44
< ToxicFrog>
I still need some way to get the return code from xchat.
18:45 * ToxicFrog foams
19:01
< ToxicFrog>
I have a way, but it's really messed up.
19:01
< ToxicFrog>
Should work on linux and windows, though.
19:01
< ToxicFrog>
read cmd;
19:01
< ToxicFrog>
Err.
19:01
< ToxicFrog>
read cmd argv;
19:02
< ToxicFrog>
debug "Got command $cmd with arguments ($argv)"
19:02
< ToxicFrog>
ret=`$cmd $argv`
19:02
< ToxicFrog>
echo ret > /tmp/$$
19:02
< ToxicFrog>
And then the other end reads the return value out of /tmp/$$...wait, no, then we get a race condition.
19:02
< ToxicFrog>
Dammit.
19:08
< ToxicFrog>
Maybe the parent sends SIGUSR1 to the child or something when it's ready.
19:09
< ToxicFrog>
And the child blocks until then.
19:10
< ToxicFrog>
Using wait, and another child that gets killed by the signal handler...
19:10
< ToxicFrog>
Icky, though.
19:12
< ToxicFrog>
What I'm really after here is a way to have process A spawn process B, and not only have B's stdout redirected to A's stdin (easy; use "B | (code goes here)"), but also have A's stdout (or some other fd) redirected to B's stdin (or some other fd).
19:12
< ToxicFrog>
Without using named pipes, because they DFW on windows.
19:15
< ToxicFrog>
Oh, hey.
19:15
< ToxicFrog>
<()
19:19
< ToxicFrog>
Or not.
19:19
< ToxicFrog>
Argh.
19:27 EvilDarkLord [althalas@Nightstar-15301.a88-115-211-62.elisa-laajakaista.fi] has quit [Ping Timeout]
19:53 MyCatGames [~mycatownz@Nightstar-379.dsl.in-addr.zen.co.uk] has quit [Ping Timeout]
19:54 MyCatGames [~mycatownz@Nightstar-379.dsl.in-addr.zen.co.uk] has joined #code
21:03
<@TheWatcher>
Hmm
21:04
<@TheWatcher>
Anyone know a simple way to select a random row from a table using sql?
21:04
<@Vornicus-Latens>
select * from table order by random() limit 1;
21:04
<@Vornicus-Latens>
or something like that.
21:05
<@Vornicus-Latens>
That should work on mysql, I don't know if it works on postgres or any others.
21:05 * ToxicFrog throttles bash and windows in turn
21:05
<@Vornicus-Latens>
what'd bash do?
21:06
<@TheWatcher>
'order by rand()' works. Thanks!
21:07
< ToxicFrog>
Well, bash doesn't seem to have any way to create a subprocess, and then get two-way communication with it, without using named pipes.
21:07
< ToxicFrog>
I can get one-way, but that's useless for my purposes.
21:07
<@Vornicus-Latens>
ah
21:07
< ToxicFrog>
This would be a nonissue were it not for the fact that windows lacks named pipes.
21:07
< ToxicFrog>
And I kind of need two-way communication between a bash script and a child process if I am to implement bash scripts for xchat.
21:08
< ToxicFrog>
(I would rather not resort to UDP over netcat)
21:11
< ToxicFrog>
I keep thinking there's got to be some way around this by using the output redirection or process substitution operators, but if so I haven't gotten it right yet.
21:15 Mahal [~Mahal@Nightstar-12066.worldnet.co.nz] has quit [Ping Timeout]
21:17
< ToxicFrog>
Vornicus-Latens: I take it you have no insight into this problem?
21:28
<@Vornicus-Latens>
No.
21:29 * Vornicus-Latens has never used named pipes.
21:30
< ToxicFrog>
Well, it's not named pipes that are the problem.
21:30
< ToxicFrog>
If were named pipes it's simple:
21:30
< ToxicFrog>
mkfifo /tmp/$$.fifo
21:30
< ToxicFrog>
child_func < /tmp/$$.fifo | parent_func
21:30
<@Vornicus-Latens>
nor have I used bash for that kind of madness, nor have I ever used popen3.
21:32
< ToxicFrog>
popen3() would do exactly what I need (as would popen2()) if bash had it.
21:43 Mahal [~Mahal@Nightstar-3392.worldnet.co.nz] has joined #Code
21:43 mode/#code [+o Mahal] by ChanServ
22:25 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
22:25 mode/#code [+o Chalcedon] by ChanServ
22:48 Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
22:48 mode/#code [+o Chalcy] by ChanServ
22:50 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
22:50 Chalcy is now known as Chalcedon
23:17 You're now known as TheWatcher[T-2]
23:24 Vornicus-Latens is now known as Vornicus
23:25 MyCatGames is now known as MyCatVerbs
23:29
<@McMartin>
Wow. The bug I reported to gcc in October of 2002 has now, finally, been closed.
23:30
<@Vornicus>
what bug is this?
23:31
<@McMartin>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8298
23:32
<@McMartin>
(It's actually been fixed for awhile, as long as you were using Eclipse and not gcj proper)
23:33 AnnoDomini [~farkoff@Nightstar-28899.neoplus.adsl.tpnet.pl] has quit [Quit: Changin' OSes.]
23:33
<@McMartin>
I'm assuming that accepts-invalid bugs are low priority for them.
23:35 AnnoDomini [~farkoff@Nightstar-28899.neoplus.adsl.tpnet.pl] has joined #Code
23:36
< ToxicFrog>
Aah, McM. Do you have bash-fu?
23:37
<@McMartin>
It is not as strong as yours.
23:38
< ToxicFrog>
Hmm.
23:38 * McMartin shall read backscroll
23:38
< ToxicFrog>
I'm starting to suspect that this is, if not impossible, at least much more difficult than just using netcat.
23:38
< ToxicFrog>
(short form: I need to create a child process and then have two-way communication with it without using named pipes)
23:40
<@McMartin>
When I need pipes I immediately switch over to Killer Rabbit Style.
23:40
< ToxicFrog>
...Killer Rabbit Style?
23:40
<@McMartin>
Python.
23:40
< ToxicFrog>
xchat already has python bindings.
23:40
<@McMartin>
It being named after the comedy troupe, not the animal.
23:40
< MyCatVerbs>
ToxicFrog: have netcat listen on localhost?
23:40
<@McMartin>
Yes, well.
23:41
< ToxicFrog>
MyCatVerbs: read up.
23:41
< ToxicFrog>
I have already considered this and variations on it.
23:41
< ToxicFrog>
I'd rather use something more elegant if possible.
23:41
< ToxicFrog>
One would think that bash's absurd list of output-redirection features would let me do this.
23:41
< MyCatVerbs>
ToxicFrog: why's it impossible? You didn't say.
23:41
< ToxicFrog>
Because:
23:42 * MyCatVerbs awaits.
23:42
< ToxicFrog>
- using |, you can't link both the output and the input of a single process to another single process
23:42
< ToxicFrog>
- using < and >, you can only redirect to/from files (which would normally be where mkfifo comes in, but I can't use that)
23:43
< MyCatVerbs>
Nununununu. I mean what's the specific reason for ruling netcat out?
23:43
< ToxicFrog>
- using <& and >&, you need something to create the file descriptor first; and bash doesn't 'pipe', 'popen', or similar commands
23:43
< ToxicFrog>
- and you can't use <& and >& to connect stdin to stdout or vice versa, as far as I can tell.
23:44
< ToxicFrog>
Oh.
23:44
< ToxicFrog>
Because, as I said, it's inelegant.
23:44
< MyCatVerbs>
Your reason sucks.
23:44
< ToxicFrog>
It involves spawning a new process - two new processes - and sending messages through the entire networking subsystem instead of through shared memory.
23:46
< MyCatVerbs>
Yesh, but the loopback interface is a lot more efficient than the rest of the networking subsystem - it's always designed with hordes of kludgy and dubious performance optimisations built in. I wouldn't be surprised if it already used shared memory on most operating systems.
23:47
< MyCatVerbs>
In addition to which, if you're sufficiently performance-worried to need to use shared memory, then for the love of kludging, why aren't you writing with pthreads? Oh and why are you writing chunks of bash at all?
23:48
< ToxicFrog>
...because I want to create bash bindings for xchat?
23:49
< MyCatVerbs>
...there are a couple of functions in POSIX for manipulating file descriptors directly. I'm not sure if any of those'll be implemented or helpful, let alone both, but they might be worth a look.
23:49
< ToxicFrog>
And it's more the "spawns two extra processes" (for every single function call, mind you) than the "uses sockets rather than shared memory" bit that gets me.
23:49
< ToxicFrog>
And, again, it's not so much performance as elegance. Two fork()-exec() sequences per function call == ugly.
23:50
< MyCatVerbs>
Errrr, function spawning is a frell of a lot more expensive than socket creation. :/
23:50
< ToxicFrog>
Isn't that what I just said?
23:51
< MyCatVerbs>
Yesh. So why worry about the socket? Its kludginess is practically nonexistent in comparison to the fact that you're already fork-exec()ing twice anyway.
23:51
< ToxicFrog>
...
23:51
< ToxicFrog>
You seem to be missing the point that the fork-exec is a side effect of using the socket instead of anonymous pipes/IO redirection in the first place.
23:52
< MyCatVerbs>
Whoopsy.
23:53
< ToxicFrog>
It needs to create two netcat processes to act as intermediaries between bash and the network.
23:53
< MyCatVerbs>
What's the child process? A copy of bash?
23:53
< ToxicFrog>
Yes.
23:54
< MyCatVerbs>
Can you just leave the sockets open to the first copy of bash you make up in between function calls?
23:54
< ToxicFrog>
Bash doesn't get sockets.
23:54
< ToxicFrog>
It gets an anonymous pipe to a copy of netcat.
23:54
< MyCatVerbs>
Ahhhhhh.
23:55
< ToxicFrog>
Or, rather, the child process gets an anonymous pipe, and the parent process gets "echo $MESSAGE | nc -u -p $PORT"
23:55
< MyCatVerbs>
Synopsis: this is all your fault for trying to use Xchat on Windows, you filthy philistine. ;)
23:55
< ToxicFrog>
Actually, I'm using it on linuix.
23:55
< ToxicFrog>
*linux.
23:55
< ToxicFrog>
You should try CTCP VERSION sometime.
23:55
< MyCatVerbs>
...
23:55
< ToxicFrog>
However, I want windows users to be able to use this as well.
23:56
< MyCatVerbs>
Alternatively, rather than forcing *both* into using one shitty implementation, you could write the elegant, simple FIFO implementation on the system that supports it and confine the horribly inelegant one to Windows, instead of making everybody suffer.
23:56
< ToxicFrog>
Well, yes.
23:56
< ToxicFrog>
But ideally I'd like an elegant implementation that works on both.
23:57
< MyCatVerbs>
Even better, you could just write the elegant implementation on *nix and tell all the Windows users where they can download a liveCD.
23:57 * MyCatVerbs runs for the LART shelter. ^_^
23:58
<@McMartin>
Bash on Windows is made of ;_; anyway.
23:58
<@McMartin>
All the things it can't do Python does.
23:58
<@McMartin>
I'm still not sure how Python does it, since Win32 doesn't have the appropriate system calls, but.
23:58
<@McMartin>
It does, and it Just Works (tm).
23:58
< ToxicFrog>
The only thing I can think of that bash can't do on windows and can on Linux is mkfifo.
23:58
< ToxicFrog>
And I think Python uses named sockets.
23:59
<@McMartin>
I meant for things like popen4.
23:59
< ToxicFrog>
Yes.
--- Log closed Wed Jan 10 00:00:09 2007
code logs -> 2007 -> Tue, 09 Jan 2007< code.20070108.log - code.20070110.log >