code logs -> 2007 -> Fri, 26 Oct 2007< code.20071025.log - code.20071027.log >
--- Log opened Fri Oct 26 00:00:06 2007
00:06 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
00:06 DiceBot [~Reiver@Nightstar-3001.ubs-dsl.xnet.co.nz] has quit [Ping Timeout]
00:07 Mischief [~Genesis@Nightstar-7565.hsd1.md.comcast.net] has quit [Ping Timeout]
00:10 Mischief [~Genesis@Nightstar-6325.hsd1.md.comcast.net] has joined #code
00:38 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
00:38 mode/#code [+o Reiver] by ChanServ
00:46 DiceBot [~Reiver@Nightstar-1690.ubs-dsl.xnet.co.nz] has joined #Code
00:46 mode/#code [+v DiceBot] by ChanServ
01:04 You're now known as TheWatcher[T-2]
01:09 You're now known as TheWatcher[zZzZ]
01:10 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Ping Timeout]
01:11 DiceBot [~Reiver@Nightstar-1690.ubs-dsl.xnet.co.nz] has quit [Ping Timeout]
01:28 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Quit: Z?]
01:30 Eva_Lowell [~Genesis@Nightstar-7565.hsd1.md.comcast.net] has joined #code
01:32 Mischief [~Genesis@Nightstar-6325.hsd1.md.comcast.net] has quit [Ping Timeout]
01:33 Eva_Lowell is now known as Mischief
01:55 Thaqui [~Thaqui@Nightstar-13312.jetstream.xtra.co.nz] has joined #code
01:55 mode/#code [+o Thaqui] by ChanServ
02:42 Kibibit is now known as Kibibed
03:12 Chalcedon [~Chalcedon@Nightstar-2310.ue.woosh.co.nz] has joined #code
03:12 mode/#code [+o Chalcedon] by ChanServ
03:29 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
03:29 mode/#code [+o Reiver] by ChanServ
03:38
<@Reiver>
!10000/25
03:39 DiceBot [~Reiver@Nightstar-3074.ubs-dsl.xnet.co.nz] has joined #Code
03:39 mode/#code [+v DiceBot] by ChanServ
03:39
<@Reiver>
!10000/25
03:39
<+DiceBot>
[Reiver] 10000/25 = 400.
03:43 Chalcedon [~Chalcedon@Nightstar-2310.ue.woosh.co.nz] has quit [Quit: Gone]
03:54
<@ToxicFrog>
We need a postscript interpreter in here.
03:55
<@McMartin>
We do?
04:33
<@Reiver>
TF: This could... possibly be done...
04:33
<@Reiver>
I'd need to know just what level of syntactical nightmare we're looking at, though. The interpreter for mere dice is scary enough. ¬¬
04:33
<@ToxicFrog>
Oh, I was figuring we could just hijack ghostscript!
04:34
<@Reiver>
...whut?
04:34
<@ToxicFrog>
The syntax is actually very simple:
04:34
<@ToxicFrog>
S := TOKENS
04:34
<@ToxicFrog>
TOKENS := TOKEN TOKENS | epsilon
04:34
<@ToxicFrog>
There's the complete grammar~
04:34 * Reiver eyes that.
04:35
<@McMartin>
That's, um, not hugely useful in specifying semantics.
04:35
<@ToxicFrog>
I know.
04:35
<@ToxicFrog>
And those are, after all, the tricky bit.
04:35
<@ToxicFrog>
I think it has four stacks.
04:35
<@Reiver>
Ah...hah.
04:35
<@ToxicFrog>
Possibly more, but I can only think of four offhand.
04:35
<@Reiver>
Probably beyond my realm of expertise. If you explain it well enough Anno might get drunk enough to agree, though~
04:35
<@McMartin>
Also, you can write that S := TOKEN*
04:36
<@McMartin>
Which is also, idly, a grammar for C, Pascal, SQL, and English.
04:36
<@ToxicFrog>
Well, what I was thinking is, we already have a perfectly serviceable postscript terp in the form of Ghostscript; it's just a matter of making something that can popen() it.
04:36
<@ToxicFrog>
Well, yes, but my point here is that ps doesn't really have a grammar beyond "token stream"
04:37
<@Reiver>
ghostscript being a linux trickerymabob?
04:37
<@McMartin>
GS being the PostScript engine for pretty much every computer and OS ever.
04:38
<@McMartin>
But not printer.
04:38
<@Reiver>
Right then.
04:38
<@McMartin>
It's one of the engines that renders PS to screen.
04:38
<@McMartin>
Augh
04:38
<@Reiver>
Aah.
04:39
<@McMartin>
Oh hey, OCaml has man pages!
04:39 Forj [~Forj@Nightstar-2310.ue.woosh.co.nz] has joined #code
04:39 mode/#code [+o Forj] by ChanServ
04:53
<@ToxicFrog>
And to images.
04:53
<@ToxicFrog>
And it makes a handy desk calculator.
05:00
<@McMartin>
w00t!
05:00
<@McMartin>
# get_methods "../filetest/FileTest.class";;
05:00
<@McMartin>
- : (string * Instructions.opcode list) list =
05:00
<@McMartin>
[("<init>()V", [Aload 0; Invokespecial 1; Return]); ...]
05:03
<@ToxicFrog>
Java disassembler worky?
05:03
<@McMartin>
Looks like
05:03
<@McMartin>
But only in Interactive mode.
05:04
<@ToxicFrog>
Once you have a version that works in batch mode, I could use a copy~
05:04
<@McMartin>
Noted~
05:04
<@McMartin>
I need to do the constant pool consultation, though.
05:04 Chalcedon [~Chalcedon@Nightstar-2310.ue.woosh.co.nz] has joined #code
05:04 mode/#code [+o Chalcedon] by ChanServ
05:05
<@McMartin>
So that it will be INVOKESPECIAL java.lang.Object.<init>()V instead of "Invokespecial 1".
05:06
<@ToxicFrog>
What with having to disassemble class files in order to complete the assignments for this course >.<
05:07
<@McMartin>
In the meantime, javap -c {classname}.
05:07
<@McMartin>
You may need other flags to hit private methods and the like
05:07
<@ToxicFrog>
Aah. I've just been using less.
05:07
<@McMartin>
It's just slow, and fails if it refers to classes that aren't in the classpath.
05:07
<@ToxicFrog>
But that's kind of tedious.
05:07
<@McMartin>
yes.
05:08
<@McMartin>
And it's not as systematic about the Constant Pool.
05:08
<@ToxicFrog>
(if I need to know about private methods I'm right fucked anyways)
05:21
<@McMartin>
Oh, you just need the defined members?
05:22
<@McMartin>
Commands like javap -protected java.lang.String will do
05:23
<@McMartin>
I haven't found any zlib bindings for OCaml, so no Jarfile support~
05:26
<@McMartin>
Aha. OK, found zlib bindings, but only for .gz, not .zip.
05:27
<@McMartin>
Which would be easy enough to fix up, especially given the Awesome that is BinStruct.
05:29
<@ToxicFrog>
What does BinStruct do?
05:29
<@ToxicFrog>
I take it that it's something along the lines of struct()
05:29
<@McMartin>
Yeah.
05:29
<@McMartin>
It's a functor I wrote to do binary packing and unpacking.
05:30
<@McMartin>
Can be combined with files or strings.
05:30
<@ToxicFrog>
Aah.
05:30
<@McMartin>
Though the disassembler is only using strings for it, because it has to do recursive resolution, so I decided to just have to instantiate the decoder once.
05:31
<@McMartin>
So it gobbles an entire classfile into memory as a string and then picks it apart.
05:31
<@McMartin>
But BinStruct itself doesn't demand this.
05:55
<@ToxicFrog>
wtf
05:55
<@ToxicFrog>
[ben@leela ~]$ dig orias | grep IN | grep -v '^;'; ping orias
05:55
<@ToxicFrog>
orias. 0 IN A 192.168.1.202
05:55
<@ToxicFrog>
ping: unknown host orias
05:57
<@McMartin>
Yay!
05:58 * McMartin gets gzip support working in OCaml. Sort of.
05:59
<@ToxicFrog>
...oh, goddamnit
05:59
<@ToxicFrog>
Since my hostname is "leela.ancilla.ca", it asks for "orias.ancilla.ca" rather than "orias"
06:37
<@McMartin>
Is caml.inria.fr down for anyone else?
06:37
<@AnnoDomini>
Reiver: I rewrote the dice parser. It's now about half the size and doesn't leave trash, but it did nothing for its readability. <_<
06:39
<@AnnoDomini>
It isn't loading for me.
06:42 GeekSoldier is now known as GeekSoldier|work
06:50 GeekSoldier|work [~Rob@Nightstar-4847.pools.arcor-ip.net] has quit [Ping Timeout]
07:00
<@McMartin>
There is an OCaml library for reading Jarfiles, but it's on inria's site, so I can't reach it.
07:09 Chalcedon is now known as ChalcyAFK
08:54 You're now known as TheWatcher
08:56 Thaqui [~Thaqui@Nightstar-13312.jetstream.xtra.co.nz] has left #code [Leaving]
09:01 ChalcyAFK [~Chalcedon@Nightstar-2310.ue.woosh.co.nz] has quit [Quit: Gone]
09:01 Forj [~Forj@Nightstar-2310.ue.woosh.co.nz] has quit [Quit: Gone]
10:08 MyCatSchemes [~rb6822@Nightstar-23642.cs.bris.ac.uk] has joined #code
10:38 GeekSoldier|work [~Rob@Nightstar-4947.pools.arcor-ip.net] has joined #code
11:06 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has joined #Code
11:06 mode/#code [+o gnolam] by ChanServ
11:56 MyCatSchemes [~rb6822@Nightstar-23642.cs.bris.ac.uk] has quit [Client exited]
13:17 MyCatSchemes [~rb6822@Nightstar-18281.cs.bris.ac.uk] has joined #code
15:29
<@jerith>
I call for wisdom!
15:30
<@jerith>
In debugging a set of RPC calls I have written, it turns out the caller expects an array of pairs and the callee actually returns a map.
15:30
<@jerith>
Now, the calls are essentially lookups of some values in a table of associations.
15:31
<@Vornicus>
an array of pairs and a map are very similar.
15:31
<@jerith>
One call looks up b given a and the other looks up a given b.
15:31
<@jerith>
Ordinarily, a map would be the natural data structure in this case.
15:32
<@Vornicus>
You should be able to drop in a passthrough function that does it, and probably one that already exist.
15:32
<@jerith>
However, assuming I was getting back a list, I have written a bunch of common manipulations on the caller's side.
15:33
<@Vornicus>
hell, in python: dict.items()
15:33
<@jerith>
The more natural data structure in this case is the map, but then I'd have to duplicate a bunch of stuff to differentiate between a=>b and b=>a.
15:34
<@jerith>
The list of pairs means a bunch of changes on the callee side.
15:35
<@Vornicus>
You could just make it a bipartate graph and have done with it.
15:35
<@Vornicus>
:P
15:35
<@McMartin>
In Java, Map.entries().
15:35
<@jerith>
At least one of these calls is going to be pretty high volume, so I would rather build the data structure I want in the first place than have to translate it on the border.
15:36
<@Vornicus>
You can... fake a map. Write the methods you're calling to place into an array of pairs instead of a map.
15:36
<@Vornicus>
But the things we've mentioned are pretty damn cheap.
15:37
<@jerith>
There's also a clarity issue.
15:37
<@jerith>
Debugging gets painful if you're bouncing between data structures a lot.
15:37
<@Vornicus>
Man, when you seek wisdom, you don't kid around, do you.
15:37
<@jerith>
My quandry is more philosophical than practical.
15:38
<@jerith>
The map is more natural, but requires more code paths.
15:38
<@Vornicus>
Personally "more natural" beats "less code paths" any day of the week.
15:38
<@ToxicFrog>
What are you writing this in, anyways?
15:38
<@jerith>
The list allows more reuse.
15:38
<@jerith>
Java.
15:38
<@McMartin>
List of Map.Entry<>s, imo.
15:40
<@jerith>
I'm inclined to agree with McM here, I think.
15:40
<@jerith>
A single AToBAssociation structure is a bit nicer than having a BToAAssociation as well.
15:41 MyCatSchemes [~rb6822@Nightstar-18281.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!]
15:41
<@jerith>
Also, that apparently suits the RPC abstraction a little better.
15:42
<@jerith>
Thanks for your input, guys.
15:47 Kibibed is now known as Kibibit
16:14 MyCatSchemes [~rb6822@Nightstar-23832.cs.bris.ac.uk] has joined #code
16:22 MyCatSchemes [~rb6822@Nightstar-23832.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!]
16:26 MyCatSchemes [~rb6822@Nightstar-23588.cs.bris.ac.uk] has joined #code
16:57 Vornicus is now known as Vornicus-Latens
17:05 You're now known as TheWatcher[afk]
17:33 MyCatSchemes [~rb6822@Nightstar-23588.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!]
17:55 MyCatSchemes [~rb6822@Nightstar-23588.cs.bris.ac.uk] has joined #code
18:13 AD [AnnoDomini@Nightstar-28976.neoplus.adsl.tpnet.pl] has joined #Code
18:13 AnnoDomini [AnnoDomini@Nightstar-28832.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
18:14 AD is now known as Lerhir
19:08
<@McMartin>
TF: Do you still want that Java Classfile dumper?
19:09 * McMartin nickpings ToxicFrog
19:09
<@ToxicFrog>
Yes please.
19:09
<@McMartin>
OK
19:10
<@McMartin>
It's v. preliminary -- it's not converting JVM representation to Java on types, for instance -- but it will dump access flags, inheritance, and member lists.
19:10
<@ToxicFrog>
(If I do not respond, it is not because I haven't noticed, it's because the wireless in MacKinnon is kind of...wobbly)
19:11 * ToxicFrog nods
19:12 MyCatSchemes [~rb6822@Nightstar-23588.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!]
19:15
<@McMartin>
http://www.stanford.edu/~mcmartin/javadump-0.1.tgz
19:17
<@McMartin>
"make" will produce the bytecode-file "javadump", while "make native" will produce "javadump.opt".
19:17
<@McMartin>
Oh, and it's http://www.stanford.edu/~mcmartin/misc/javadump-0.1.tgz
19:20
<@ToxicFrog>
Got, thanks you
19:20
<@McMartin>
And it can be find|xargs'd.
19:23
<@jerith>
http://newyork.craigslist.org/mnh/cpg/460249817.html <-- Senior LOLCode Developer (Midtown)
19:23
<@McMartin>
awesome
20:19
<@McMartin>
Hum. Well, that was easy enough.
20:20 * McMartin whips up 30 more lines of code, parses JVM types to Java types.
20:28
<@McMartin>
http://www.stanford.edu/~mcmartin/misc/javadump-0.2.tgz
21:39 Forj [~Forj@Nightstar-2310.ue.woosh.co.nz] has joined #code
21:39 mode/#code [+o Forj] by ChanServ
22:01 You're now known as TheWatcher
22:29 GeekSoldier|work is now known as GeekSoldier
22:50 Mischief is now known as SkyNet
22:52 SkyNet is now known as Mischief
22:58 Thaqui [~Thaqui@Nightstar-13312.jetstream.xtra.co.nz] has joined #code
22:58 mode/#code [+o Thaqui] by ChanServ
--- Log closed Sat Oct 27 00:00:13 2007
code logs -> 2007 -> Fri, 26 Oct 2007< code.20071025.log - code.20071027.log >