code logs -> 2013 -> Wed, 06 Mar 2013< code.20130305.log - code.20130307.log >
--- Log opened Wed Mar 06 00:00:43 2013
--- Day changed Wed Mar 06 2013
00:00
<&ToxicFrog>
"lshw" or its variants (lshw -X, lshw-gtk, lshw-gui, etc) tries to list all hardware of any kind. You need to be root.
00:00
<&ToxicFrog>
"lsusb" and "lspci" list USB and PCI/PCIe devices respectively.
00:01
< SmithKurosaki>
I will try the first one, but it's one I had to use with hobbit all the time
00:02
< SmithKurosaki>
I am looking for the one that spits out the /dev/sd** and tells me the size of each device
00:02
<&ToxicFrog>
Oh
00:02
<&ToxicFrog>
Not devices, DISKS
00:03
< SmithKurosaki>
Sorry
00:03
< syksleep>
df -h?
00:03
<&McMartin>
Yeah, that
00:03
< SmithKurosaki>
It's been a while since I've tinkered. I've forgotten most things
00:03
< SmithKurosaki>
That sounds right
00:03
<&ToxicFrog>
"mount" lists all mounted filesystems. "df -h" lists the sizes and fullness of all mounted filesystems. "cat /proc/partitions" lists all known drives and partitions and their sizes.
00:03
<&McMartin>
df is "disk free"
00:03
< SmithKurosaki>
Thank ys sirs
00:03
< SmithKurosaki>
I also used cat before
00:04
<&ToxicFrog>
"df -h" is the most pleasant, but "mount" gives you different information and /proc/partitions includes stuff that's connected but not mounted, which the other two don't.
00:04
< SmithKurosaki>
I'm trying to diagnose why one of my netbook's sd readers won't function
00:06 * Alek peers around.
00:06
<&McMartin>
"In addition to the above rules, you should always use composite numbers when writing new code. Prime numbers are reserved for use by other parts of the code to fall back on when they run out of numbers in their designated block."
00:06 * Alek eyes.
00:06
<@Alek>
wat
00:06
<&McMartin>
INTERCAL is a troll language
00:07
<&McMartin>
So is its styleguide made of trollface.jpg
00:07
<@Reiv>
composite numbers what.
00:08
< SmithKurosaki>
IN all seriousness though, I have this odd issue with one of my sd card readers not recognizing cards
00:10 SmithKurosaki [smith@Nightstar-9b37ea39.dsl.bell.ca] has quit [[NS] Quit: Leaving]
00:10
<&McMartin>
Ahahaha
00:10
<&McMartin>
Using gerund abstention
00:10
<&McMartin>
Con: The effects of gerund abstention cannot be contained: it is necessarily global, potentially affecting all code in the main program and any libraries in use. It also interferes with line abstention, which is not always obvious to the programmer if line abstention is being used in one or more libraries.
00:10
<&McMartin>
Pro: Watching someone else try to track down a bug caused by gerund abstention is hilarious.
00:12 ToxicDroid2 [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
00:12 ToxicDroid2 [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Client closed the connection]
00:12 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Connection reset by peer]
00:15 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
00:16 ToxicDroid2 [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
00:16 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Client closed the connection]
00:20 ToxicDroid2 [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Client closed the connection]
00:21
<@Reiv>
McM: The fug.
00:23
<&McMartin>
16:05 <&McMartin> INTERCAL is a troll language
00:23
<&McMartin>
16:05 <&McMartin> So is its styleguide made of trollface.jpg
00:25
<@Reiv>
As in, it really is just to mess with you?
00:25
<&McMartin>
Yes
00:25
<~Vornicus>
Yeah. Nobody works in intercal
00:25
<&McMartin>
Again from the style guide (pastebomb inc:)
00:25
<&McMartin>
Here is an illustrative example.
00:25
<&McMartin>
Bad:
00:25
<&McMartin>
DO :3 <- '"'"'"'".1$':1~#32768'"~"#1109$#1"'$':1~#128'"~#2735'$':1~"
00:25
<&McMartin>
#546$#0"'"~"#43679"'$':1~"#1365$#0"'"~"#1023$#63"'$'"'"'".1$#0
00:25
<&McMartin>
"~#34959'$':1~"#0$#1170"'"~#11007'$':1~"#0$#2925"'"~"#2005$#255"'
00:25
<&McMartin>
00:25
<&McMartin>
Good:
00:26
<&McMartin>
DO :3 <- '"'"'"'".1$':1~#32768'"~"#1109$#1"'$':1~#128'"~#2735'$':1~
00:26
<~Vornicus>
it's like working in befunge or brainfuck or malbolge on purpose.
00:26
<&McMartin>
"#546$#0"'"~"#43679"'$':1~"#1365$#0"'"~"#1023$#63"'$'"'"'".1$#0"~
00:26
<&McMartin>
#34959'$':1~"#0$#1170"'"~#11007'$':1~"#0$#2925"'"~"#2005$#255"'
00:26
<&McMartin>
00:26
<&McMartin>
Better:
00:26
<&McMartin>
DO :3 <- '"'"'"'".1$':1~#32768'"~"#1109$#1"'$':1~#128'"~#2735'$
00:26
<&McMartin>
':1~"#546$#0"'"~"#43679"'$':1~"#1365$#0"'"~"#1023$#63"'$
00:26
<&McMartin>
'"'"'".1$#0"~#34959'$':1~"#0$#1170"'"~#11007'$':1~"#0$#2925"'"~
00:26
<&McMartin>
"#2005$#255"'
00:26
<&McMartin>
No
00:26
<&McMartin>
Befunge and brainfuck have actual interesting properties
00:26
<&McMartin>
And brainfuck in particular was devised because someone wanted to write in it and that was the best language he could interpret given his resource constraints.
00:27 * McMartin relinks http://cadie.googlecode.com/svn/trunk/INTERCAL-style-guide.html
00:29 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.A39092] has joined #code
00:29
<@Reiv>
Brainfuck has redeeming properties?
00:30
<&McMartin>
Brainfuck was, IIRC, written because someone needed a scripting language that would fit inside an Amiga tape loader.
00:34
<@Namegduf>
I unno.
00:34 * Reiv eyes.
00:34
<@Namegduf>
Wikipedia suggests otherwise and links to http://aminet.net/dev/lang/brainfuck-2.readme
00:34
<@Reiv>
I guess Amigas didn't use scripting languages prior to that, huh.
00:34
<@Namegduf>
Which is all "Who can program anything useful with it?"
00:35
<&McMartin>
IMNRC, then
00:35
<&McMartin>
BF is theoretically interesting, in that it is Turing Complete but not obviously so.
00:35
<&McMartin>
It looks weaker than a Turing Machine's operations, but you can build a Turing Machine in it.
00:36
<&McMartin>
The Funge class is interesting because spacial program coutners.
00:36
<&McMartin>
I'm unfamiliar with Malbolge.
00:36
<@Namegduf>
Malbolge is horrifying.
00:36
<@Namegduf>
It takes the cake.
00:36
<@Reiv>
Funge?
00:36
<&McMartin>
"The peculiarity of Malbolge is that it was specifically designed to be impossible to write useful programs in. However, weaknesses in this design have been found that make it possible (though still very difficult) to write Malbolge programs in an organized fashion."
00:36
<@Namegduf>
Yes.
00:36
<&McMartin>
That's not peculiar, as INTERCAL did that as well.
00:36 * Reiv eyes.
00:37
<@Namegduf>
I don't think you appreciate how impossible they tried to make it.
00:37
<@Reiv>
How do they do this (short, idiots version preferable)
00:37 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.A39092] has quit [Ping timeout: 121 seconds]
00:37
<@Namegduf>
It too *cryptanalysis* to get ueful stuff out of it
00:37
<@Namegduf>
*took
00:37
<@Namegduf>
"Malbolge was so difficult to understand when it arrived that it took two years for the first Malbolge program to appear. The first Malbolge program was not written by a human being, it was generated by a beam search algorithm designed by Andrew Cooke and implemented in Lisp.[1]"
00:37
<&McMartin>
INTERCAL's goal was instead to share nothing in common with all prior programming languages without giving up on notions like I/O and having source code.
00:38
<&McMartin>
Reiv: The Funge class of languages are the general case of Befunge (Befunge is, specifically, a 2-funge.).
00:38
<@Reiv>
O-K
00:38
<&McMartin>
Funge languages are IIRC recognizable by the fact that the program counter moves consistently through a Euclidean space instead of going forward and occasionally teleporting.
00:38
<~Vornicus>
would that make Cefunge a 3-funge?
00:38
<&McMartin>
Think SpaceChem.
00:38
<&McMartin>
Vornicus: I would name a 3-funge Trifunge, myself.
00:39
<&McMartin>
(And when I say "Think SpaceChem" I mean "I characterized SpaceChem as being a kind of parallel Funge language")
00:39
<@Namegduf>
I'm just impressed when they need to do cryptanalysis to get a program that copies its input to its output
00:40
<&McMartin>
Malbolge is pretty hilarious.
00:41
<&McMartin>
See also: Intercal
00:41
<&McMartin>
I have to object to the claim Malbolge is a language, though.
00:41
<&McMartin>
Malbolge is a VM spec.
00:42
<@Namegduf>
It's a language like Brainfuck is a language.
00:42
<@Namegduf>
Also assembly should qualify as a language, and it has an assembly language.
00:43 Tango [Tango@Nightstar-e1d1797c.wi.charter.com] has joined #code
00:43
<&McMartin>
It has an assembly language but one which is variably modifiable.
00:43
<&McMartin>
The assembly language and the target format (machine code) are not the same thing.
00:44
< Tango>
hello
00:46 Tango [Tango@Nightstar-e1d1797c.wi.charter.com] has quit [[NS] Quit: ]
00:48
<@Namegduf>
I don't really feel that disqualifying Malbolge as a language because Malbolge itself is technically machine code for a VM is really in the spirit of esoteric languages.
00:48
<@Reiv>
... interesting.
00:48
<&McMartin>
Namegduf: It is a language in the formal sense, just as the results of hexdump -C are.
00:49
<&McMartin>
Or entering a .COM file in EDLIN.
00:49
<@Namegduf>
Good enough for esoteric languaes!
00:49
<@Reiv>
Is Funge actually practical, or was it just a novelty puzzle?
00:49
<&McMartin>
I feel a need to nitpick it, though I do not have an easily formalizable criterion to hand.
00:49
<&McMartin>
However!
00:49
<@Reiv>
It sounds like it could have some intriguing effects.
00:50
<&McMartin>
Reiv: The funges are interesting in that there are questions involving computability they raise, but other than that, giving up the ability to teleport hurts a lot.
00:50
<&McMartin>
Namegduf: There is a noted difference in "feel" between a language spec - even assemblers - and a VM or machine code spec.
00:50
<&McMartin>
Malbolge's definition is firmly in the latter for me.
00:51
<&McMartin>
It is Glulx, not Inform; a classfile, not Java.
00:58 Derakon[AFK] is now known as Derakon
01:04 ToxicDroid [ToxicFrog@Nightstar-ad1d1ce1.sntcca.sbcglobal.net] has joined #code
01:04
<@Haeroe>
http://wiki.rizon.net/images/f/ff/Ircblog.png
01:06
<@gnolam>
And that's why you block colors.
01:07
<@celticminstrel>
Wow.
01:07 * celticminstrel doesn't. They're fun on occasion.
01:08
<@Haeroe>
But without colours, how can you greentext?
01:09 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
01:13
<@Reiv>
That's remarkably cunning.
01:13 ToxicDroid [ToxicFrog@Nightstar-ad1d1ce1.sntcca.sbcglobal.net] has quit [Client closed the connection]
01:13
<@Reiv>
Also, horrifying.
01:14 ToxicDroid [ToxicFrog@Nightstar-ad1d1ce1.sntcca.sbcglobal.net] has joined #code
01:22 ToxicDroid2 [ToxicFrog@Nightstar-ad1d1ce1.sntcca.sbcglobal.net] has joined #code
01:22 ToxicDroid [ToxicFrog@Nightstar-ad1d1ce1.sntcca.sbcglobal.net] has quit [Client closed the connection]
01:30 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has left #code ["Leaving"]
01:30 syksleep is now known as Syk
01:40
<@Alek>
how meta.
01:41
<@Haeroe>
Syk o/
01:42
<@Alek>
Syk! \o|
01:44
< Syk>
wut
02:24 Attilla [chatzilla@Nightstar-87646183.range86-143.btcentralplus.com] has quit [Ping timeout: 121 seconds]
02:37
<@celticminstrel>
Hm.
02:37 * celticminstrel wonders if it is possible to build a regular expression to detect things of the form "x if y" that are not followed by "else z"...
02:38
<@celticminstrel>
The trouble of course being that y could be arbitrarily complex, even to the point of containing something of the form "x if y else z".
02:43 Kindamoody[zZz] is now known as Kindamoody
02:43
<@[R]>
Would it still be regular if it did?
02:43
<@celticminstrel>
No idea!
02:45 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
02:45 mode/#code [+qo Vornicus Vornicus] by ChanServ
02:53
<&ToxicFrog>
celticminstrel: /yx/, /(yx|z)/ ?
02:53
<@celticminstrel>
Hm?
02:56
<@celticminstrel>
I'm not sure how to interpret that...
02:58
<&ToxicFrog>
"x if y" in regex is just /yx/, i.e. y followed by x.
02:58
<@celticminstrel>
Oh. Um. I think you misunderstood.
02:58
<&ToxicFrog>
<McMartin> Reiv: The funges are interesting in that there are questions involving computability they raise, but other than that, giving up the ability to teleport hurts a lot.
02:59
<&ToxicFrog>
I'm pretty sure that you can implement an N-funge with teleporting in an (N+1)-funge.
02:59
<~Vornicus>
Note that you can fake teleportation by just moving down into a particular, um, yes
02:59 * celticminstrel was contemplating using regex to add an else clause to Python conditional statements that are missing it, but I think it'll be too much work; I've gone down a different path.
03:00
<&ToxicFrog>
celticminstrel: oh
03:00
<@celticminstrel>
Though I'm starting to think it would be better to just create and parse a brand-new language rather than pre-parsing Python and evaluating it. >_>
03:00
<&ToxicFrog>
I was interpreting the "if" as part of the regex specification, not part of the pattern you want to match.
03:01
<@celticminstrel>
Considering how much of the pre-parsing amounts to syntax extensions.
03:01
<&ToxicFrog>
What you want here is a macro system~
03:01
<@celticminstrel>
Oh?
03:01
<@celticminstrel>
That sounds overly complex.
03:02
<@celticminstrel>
This is mainly just a calculator / dice engine.
03:03
<&ToxicFrog>
...that involves doing pre-execution source transforms on python code.
03:03
<&ToxicFrog>
You are already well into "overly complex"
03:03
<@celticminstrel>
XD
03:03
<@celticminstrel>
Yeah.
03:04
<@celticminstrel>
Which is why I'm starting to think it would be better to invent a language specifically for the purpose of calculations and dice.
03:05 * celticminstrel is also parsing to a syntax tree and doing transforms on that, so yeah.
03:05
<@Reiv>
celticminstrel: Be sure to give it a solid and robust I/O interface, so that you can plug in IRC vs Web vs Forum vs Etc plugins
03:05
<@celticminstrel>
Reiv: Huh?
03:05
<@Reiv>
If designing a new language to handle dice
03:06
<@celticminstrel>
I'm not sure what you mean.
03:06
<@Reiv>
Make sure it can handle the way people will want to ask for a dice.
03:06 * celticminstrel is still a little confused.
03:06
< Syk>
make it reusable
03:07
<@celticminstrel>
Reusable, sure.
03:08 * celticminstrel thinks the current one is technically reusable, but as previously mentioned, it is rather complicated.
03:08 * celticminstrel is still a little uncertain on Reiv's meaning though.
03:08
<@celticminstrel>
Do you mean eg making it handle d4 type syntax?
03:08
<~Vornicus>
Schlockian was terrible but it managed to allow you to roll any number of dice.
03:09
<~Vornicus>
of any size.
03:09
<@Namegduf>
Any size?
03:10 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
03:12
<~Vornicus>
Like you could do 1000000d1000000
03:12
<~Vornicus>
if you really wanted to.
03:12
<~Vornicus>
actually I think I might have put a guard on that, but
03:12
<@Namegduf>
That's not really what I was thinking about any size.
03:12
<@Namegduf>
XD
03:12 * Vornicus buries Namegduf in 16-ton d20s.
03:13
<@Namegduf>
I was thinking more like Graham's Number.
03:13
<~Vornicus>
well okay, any practical size.
03:14
<@celticminstrel>
I've got 3d6 type syntax (with the 3 optional).
03:14
<~Vornicus>
what language?
03:14
<@celticminstrel>
I've got word? syntax, which flips a coin and returns either "word" or "not word".
03:15
<@celticminstrel>
And unknown identifiers are interpreted as strings.
03:15
<~Vornicus>
oh god barewords
03:15
<@celticminstrel>
So are space-separated sequences of unknown identifiers.
03:15
<~Vornicus>
no, bad celmin, bad
03:15 Syk is now known as syk[dentists]
03:15
<@celticminstrel>
No, good, because then people can write choose(one,two,three).
03:15
<@celticminstrel>
Presumably with more abstract things, but still.
03:16
<@celticminstrel>
Because quotes are ugly.
03:16
<@celticminstrel>
And, perhaps, unexpected.
03:16
<@celticminstrel>
This isn't something that's meant to be used by programmers. >_>
03:20
<&ToxicFrog>
celticminstrel: I think what Reiv was saying is that you should implement this language as a library that can then be used by command line programs or web services or IRC bots etc.
03:21
<@celticminstrel>
Ah.
03:22
<@Namegduf>
I just used regular math with a d binary operator.
03:24
<~Vornicus>
Schlockian put d as higher priority than multiplication.
03:25
<@Namegduf>
I did the same, I think it had higher precedence than everything but brackets.
03:26
<@Reiv>
Don't forget avg
03:26
<@Reiv>
Same priority as d!
03:26
<@Reiv>
Merely exclusive.
03:26
<@Reiv>
But man is it helpful.
03:27!Deepthought.NY.US.Nightstar.Net *** Reiv invited KarmaBot into the channel
03:27 KarmaBot [karma.bot@Nightstar-be32adc8.80-203-17.nextgentel.com] has joined #code
03:27
<@Reiv>
!avg 1d10+4d6+7+3+3+6+2d6
03:27
< KarmaBot>
[Reiv] rolled 1*((1+10)/2)+4*((1+6)/2)+7+3+3+6+2*((1+6)/2): 1*((1+10)/2)+4*((1+6)/2)+7+3+3+6+2*((1+6)/2) = 45.5.
03:28
<@Namegduf>
Useful.
03:28
<@Namegduf>
Not all that hard, either.
03:28
<@Namegduf>
You just make the d operator mean something different.
03:29
<@Namegduf>
Now all it needs is information on distribution.
03:29
<@Namegduf>
Percentiles or something.
03:30
<~Vornicus>
no, avg would actually use a different function for d
03:30
<&ToxicFrog>
Isn't that what he just said?
03:31
<&ToxicFrog>
<Namegduf> You just make the d operator mean something different.
03:32
<@Namegduf>
That's what I meant, yeah
03:32
<~Vornicus>
I cannot read this week, that's all there is to it
03:33
<@Namegduf>
There are far too many words and grammars
03:33
<@Reiv>
(By the way, Vorn: That's the average damage one of my dudes does. With 14 strength. At level 12.)
03:34
<~Vornicus>
sheesh.
03:34
<@Reiv>
This is, admittedly, cheating slightly
03:34
<@Reiv>
They might possibly be a Paladin who casts buff spells as a swift action.
03:34
<@Namegduf>
I wonder how hard distribution information would be to generate.
03:35
<@Reiv>
And has quite a few buffs.
03:35
<@Reiv>
Namegduf: Beyond min & max, I'm not sure what you'd care about tbh
03:36
<&ToxicFrog>
Histogram of value distribution.
03:36
<@Namegduf>
Reiv: Consistency vs possibility of high/low rolls, mostly.
03:36
<@Reiv>
Ehh, I guess
03:36
<~Vornicus>
I'm actually reminded of the one from, uh, Problem Sleuth
03:36
<@Reiv>
Definitely as an expansion to the base setup, though
03:36
<@Reiv>
... though you could do it pretty cunning.
03:36 * Reiv muses.
03:36
<@Namegduf>
Vornicus: I loved that.
03:37
<@Reiv>
!avg is the average, as usual. !hist gives you a two-row output.
03:37
< KarmaBot>
[Reiv] rolled is the average, as usual. !hist gives you a two-row output.: isth2.71828182845904523536av2.71828182845904523536rag2.71828182845904523536 = 0.
03:37
<@Reiv>
snrk
03:37
<@Reiv>
Silly KarmaBot, you should never have had mathematical functions implemented!
03:37
<&ToxicFrog>
...how did it interpret that?
03:38
<@Namegduf>
It read "e" as the constant
03:38
<@Namegduf>
I got that far
03:38
<@Namegduf>
Looks like it did that, left the rest alone, stopped at the comma, and failed to evaluate it at all
03:39
<@Reiv>
Pretty much, yep
03:39
<@Reiv>
Oh, right. Commas are "Roll it X times"
03:39
<@Reiv>
!5d6,3
03:39
< KarmaBot>
[Reiv] rolled 5d6,3: (2+2+5+5+2) (5+4+5+6+3) (5+3+3+3+6). Partial totals: 16 23 20. Total: 59.
03:39
<@Reiv>
It's a little, ahem, agressive in trying to be helpful.
03:53 * celticminstrel doesn't get the point of !avg
03:54
<~Vornicus>
!avg 2d20
03:54
< KarmaBot>
[Vornicus] rolled 2*((1+20)/2): 2*((1+20)/2) = 21.
03:54
<@celticminstrel>
Or wait...
03:54
<@celticminstrel>
...
03:54
<~Vornicus>
Avg produces the average result of the chosen, uh, thingy
03:55
<~Vornicus>
Or, uh, the median, I guess
03:55
<~Vornicus>
well, sort-of median.
03:55
<@celticminstrel>
Mean.
03:55
<~Vornicus>
!avg (1d6)^2
03:55
< KarmaBot>
[Vornicus] rolled 8(1*((1+6)/2))^2: 8(1*((1+6)/2))^2 = 8.
03:55
<~Vornicus>
8?
03:55
<@celticminstrel>
But um...
03:55
<~Vornicus>
8?
03:55
<~Vornicus>
wtf 8?
03:56
<@Namegduf>
Hmm.
03:56
<@Namegduf>
That's not just averaging the 1d6s individually.
03:56
<@Namegduf>
That's smarter.
03:56
<@celticminstrel>
Is "!avg 3d4" equivalent to "roll three four-sided dice and compute the average of the results", or "compute the expected value of rolling three four-sided dice"?
03:56
<~Vornicus>
it does the latter
03:56
<~Vornicus>
or tries to.
03:57
<@Namegduf>
AS the square example shows.
03:57
<~Vornicus>
In some situations it fails, or, um, should
03:57
<~Vornicus>
!avg 1d6^2
03:57
< KarmaBot>
[Vornicus] rolled 1*((1+6)/2)^2: 1*((1+6)/2)^2 = 12.25.
03:57
<@Namegduf>
Which is pretty cool, if... still dubious.
03:57
<@Namegduf>
THat looks right.
03:57
<@Reiv>
!3.5^2
03:57
< KarmaBot>
[Reiv] rolled 3.5^2: 3.5^2 = 12.25.
03:57
<@celticminstrel>
So then, I could probably implement it using syntax like "3d6.expected".
03:57
<@Namegduf>
Huh.
03:57
<@Namegduf>
Hmm.
03:58
<@Reiv>
celticminstrel: The standard question is "What is the average roll I would expect from this set of dice?"
03:58
<@celticminstrel>
As I recall, I based my dice syntax on invisible castle.
03:58
<@Reiv>
Shortening the syntax to 'avg' was reasonable.
03:58
<@celticminstrel>
And "3d6" merely constructs a Dice object.
03:58
<@Reiv>
"What would average hitpoints be for my level" is likewise similar.
03:58
<~Vornicus>
where the true mean is actually 15.166, and the true median is actually 12.5
03:59
<@celticminstrel>
It doesn't actually roll the dice until some method is called on it that does so.
03:59
<@celticminstrel>
If a Dice object is the result of the expression, the sum method is automatically called on it.
04:00
<@Reiv>
!avg 3d6
04:00
< KarmaBot>
[Reiv] rolled 3*((1+6)/2): 3*((1+6)/2) = 10.5.
04:00
<@celticminstrel>
So...
04:00
<@Reiv>
Why on earth would the true median be different etc?
04:00
<~Vornicus>
Reiv: on (1d6)^2?
04:00
<@Reiv>
Oh
04:00
<@Reiv>
Yeah the poor thing gets confused with Math.
04:00
<@Namegduf>
!avg 1d6*1d6
04:00
< KarmaBot>
[Namegduf] rolled 1*((1+6)/2)*1*((1+6)/2): 1*((1+6)/2)*1*((1+6)/2) = 12.25.
04:01
<@Reiv>
I understand there were attempts to implement a Math function but then it got complicated~
04:01 * celticminstrel would probably retain at least the Dice class even if a new language parser were implemented/
04:02
<~Vornicus>
The true median of that is apparently 10.
04:02
<@celticminstrel>
So, the formula for the expected value of (n)d(s) is n((1+s)/2)?
04:02
<~Vornicus>
celmin: that's correct.
04:03
<~Vornicus>
...on the other hand the average is 12.25
04:03
<@Reiv>
Mostly, I'd leave the poor dicebot alone when it comes to exponents, but it works fine for normal stuff~
04:03
<@Reiv>
Vornicus: Not suprising, the curve is uneven
04:05 * celticminstrel should probably also import division from __future__
04:05
<~Vornicus>
ah, py2
04:26
<@Zemyla>
!avg 1d6/1d6
04:26
< KarmaBot>
[Zemyla] rolled 1*((1+6)/2)/1*((1+6)/2): 1*((1+6)/2)/1*((1+6)/2) = 12.25.
04:27
<~Vornicus>
...wow.
04:27
<~Vornicus>
yeah kb iirc uses text-replacement and really shouldn't.
04:35 syk[dentists] is now known as Syk
05:01 Kindamoody [Kindamoody@Nightstar-05577424.tbcn.telia.com] has quit [Ping timeout: 121 seconds]
05:01
<&ToxicFrog>
Yeah, given that this happens
05:02
<&ToxicFrog>
!avg memememememememe
05:02
< KarmaBot>
[ToxicFrog] rolled memememememememe: m2.71828182845904523536m2.71828182845904523536m2.71828182845904523536m2.71828182 845904523536m2.71828182845904523536m2.71828182845904523536m2.7182818284590452353 6m2.71828182845904523536 = 0.
05:04
<@Reiv>
Let's be fair, though
05:04
<@Reiv>
!avg : memememe
05:04
<@Reiv>
!avg d6: memememe
05:04
< KarmaBot>
[Reiv] rolled "memememe)/2)": 1*((1+6 = 0.
05:04
<@Reiv>
snrk
05:05
<@Reiv>
!d6: This DOES work right
05:05
< KarmaBot>
[Reiv] rolled "This DOES work right": (5) = 5.
05:05
<@Reiv>
OK.
05:05
<@Reiv>
It fails to assume that an average would be commented.
05:07 Kindamoody [Kindamoody@Nightstar-05577424.tbcn.telia.com] has joined #code
05:07 mode/#code [+o Kindamoody] by ChanServ
05:14
<~Vornicus>
!pie
05:14
<~Vornicus>
! oue
05:14
<~Vornicus>
! pie
05:15
<~Vornicus>
bah, silly thing
05:15
<~Vornicus>
!avg pie
05:15
< KarmaBot>
[Vornicus] rolled pie: 3.141592653589793238462.71828182845904523536 = 3.141593.
05:19
<@Reiv>
!avg pi
05:19
< KarmaBot>
[Reiv] rolled pi: 3.14159265358979323846 = 3.141593.
05:23 Rhamphoryncus [rhamph@Nightstar-f8b1f87b.abhsia.telus.net] has quit [Ping timeout: 121 seconds]
05:26
< Syk>
why is there another decimal point in Vornicus' pi
05:27
< Syk>
oh
05:27
< Syk>
!avg e
05:27
< KarmaBot>
[Syk] rolled e: 2.71828182845904523536 = 2.718282.
05:27
< Syk>
oh so its pi with e tacked on the end
05:27
< Syk>
haha
05:28
<~Vornicus>
precisely
05:29 Rhamphoryncus [rhamph@Nightstar-f8b1f87b.abhsia.telus.net] has joined #code
05:29 mode/#code [+o Rhamphoryncus] by ChanServ
05:33 Rhamphoryncus [rhamph@Nightstar-f8b1f87b.abhsia.telus.net] has quit [Ping timeout: 121 seconds]
05:38 Rhamphoryncus [rhamph@Nightstar-f8b1f87b.abhsia.telus.net] has joined #code
05:38 mode/#code [+o Rhamphoryncus] by ChanServ
05:55 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
05:57 Kindamoody is now known as Kindamoody|movie
06:04
< Syk>
more like
06:04 * Syk sunglasses
06:04
< Syk>
kindamovie
06:04 * Syk escapes
06:04 * Tamber trips Syk
06:04
<@Kindamoody|movie>
:|
06:05
<@Kindamoody|movie>
Interesting. That actually dinged me.
06:06 * Syk falls flat on her face. If only it weren't for that meddling Tamber!
06:08
< Syk>
man newegg
06:08
< Syk>
'save up to $15 when you purchase these items together!"
06:08
< Syk>
it's 4GB of RAM, a 3.5"->5.25" drive adapter and two different computer cases
06:09
< Syk>
10/10 algorithms guys
06:17
<&Derakon>
"We have a glut of these products, so please, take them off our hands!"
06:24 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has quit [Client closed the connection]
06:24 Derakon is now known as Derakon[AFK]
06:51 Rhamphoryncus [rhamph@Nightstar-f8b1f87b.abhsia.telus.net] has quit [Ping timeout: 121 seconds]
06:55 Rhamphoryncus [rhamph@Nightstar-f8b1f87b.abhsia.telus.net] has joined #code
06:55 mode/#code [+o Rhamphoryncus] by ChanServ
07:07 Rhamphoryncus [rhamph@Nightstar-f8b1f87b.abhsia.telus.net] has quit [Ping timeout: 121 seconds]
07:08 Rhamphoryncus [rhamph@Nightstar-f8b1f87b.abhsia.telus.net] has joined #code
07:08 mode/#code [+o Rhamphoryncus] by ChanServ
07:47 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has joined #code
07:47 mode/#code [+o Alek] by ChanServ
07:49 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has quit [Connection reset by peer]
07:56 * Vornicus pokes at love2d, tries to remember what he wanted to do with it.
08:04 ToxicDroid2 [ToxicFrog@Nightstar-ad1d1ce1.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds]
08:14 ToxicDroid [ToxicFrog@Nightstar-ad1d1ce1.sntcca.sbcglobal.net] has joined #code
08:42 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has joined #code
08:42 mode/#code [+o Alek] by ChanServ
09:32 Attilla [chatzilla@Nightstar-87646183.range86-143.btcentralplus.com] has joined #code
10:00 You're now known as TheWatcher
10:15 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
10:42 RichyB [richardb@Nightstar-228a334c.plus.com] has joined #code
11:03 Courage [Moltare@583787.FF2A18.190FE2.4D81A1] has quit [Ping timeout: 121 seconds]
11:04 Courage [Moltare@583787.FF2A18.190FE2.4D81A1] has joined #code
11:04 mode/#code [+o Courage] by ChanServ
11:47 Kindamoody|movie is now known as Kindamoody
11:56 Kindamoody is now known as Kindamoody|out
12:11 Reiv [NSwebIRC@A3BDC3.5BE3EC.B8847E.5ADB9D] has quit [Ping timeout: 121 seconds]
12:12 RichyB [richardb@Nightstar-228a334c.plus.com] has quit [[NS] Quit: >:3 This is BunThulhu. Copy him into your quit message to help him take over the Internet.]
12:18 ToxicDroid [ToxicFrog@Nightstar-ad1d1ce1.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds]
12:18 ToxicDroid [ToxicFrog@Nightstar-ad1d1ce1.sntcca.sbcglobal.net] has joined #code
12:42 Kyte|Work [c80e6b02@Nightstar-4fab16c5.mibbit.com] has joined #code
13:09 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
13:09 mode/#code [+o celticminstrel] by ChanServ
13:18 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
13:18 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
13:18 mode/#code [+o celticminstrel] by ChanServ
15:41 Syk is now known as syksleep
15:52 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
16:12 ^Xires is now known as Xires
16:51 ToxicDroid [ToxicFrog@Nightstar-ad1d1ce1.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds]
17:44 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
18:14 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Client closed the connection]
18:15 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
18:22 Kindamoody|out is now known as Kindamoody
18:27 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Operation timed out]
18:37 Syloq [Syloq@B4EC54.59F324.016BDA.8CB0A3] has joined #code
18:37 mode/#code [+o Syloq] by ChanServ
18:39 Courage [Moltare@583787.FF2A18.190FE2.4D81A1] has quit [Ping timeout: 121 seconds]
18:39 Courage [Moltare@583787.FF2A18.190FE2.4D81A1] has joined #code
18:39 mode/#code [+o Courage] by ChanServ
18:48 * ToxicFrog gets a bug report against vstruct! \o/
19:11
<@Rhamphoryncus>
wazzat?
19:15
<&ToxicFrog>
A binary (de)serialization library I wrote.
19:23
<@Rhamphoryncus>
fairly obscure I assume?
19:25
<@Namegduf>
What's it's "thing"?
19:25
<@Namegduf>
*its
19:26
<&ToxicFrog>
Rhamphoryncus: yeah, it's well known among the set of Lua users who need binary handling and can't get away with using a simpler library like lpack, which is a pretty small user base.
19:26
<@Rhamphoryncus>
ahh
19:26
<@Rhamphoryncus>
So larger than the userbase of my dicebot, but that's not saying much :)
19:27
<&ToxicFrog>
Namegduf: pure lua implementation (and thus usable in places where loading binaries is disallowed or you don't have a cross compiler), support for types of arbitrary width (e.g. 24 or 56 byte ints) and types not directly supported by C (e.g. fixed point fractions).
19:27
<@Namegduf>
Ah, okay; suitability for easy use with Lua.
19:27
<@Namegduf>
Interesting.
19:28
<&ToxicFrog>
Also, the format declaration also declares the mapping to lua data structures, so you run unpack() and get an actual record back rather than list of values, and pack() takes a record with the same structure and gives you back a buffer.
19:28
<@Namegduf>
Very closely fit to smooth use with Lua, then.
19:28
<&ToxicFrog>
Yes.
19:29
<@Namegduf>
Like Go's gob, or like C# or Java serialisation but not awful.
19:30
<&ToxicFrog>
There are still three Big Features I want to add - including multiple implementations it can intelligently pick between (e.g. if loaded by 5.2, use the bitwise operations library; if loaded in luaJIT, use the FFI to call out to C builtins where possible); backreferences (so you can refer to previously read values in the format declaration itself); and combinators (which I probably won't use but which there has been some interest in in
19:30
<&ToxicFrog>
the IRC channel)
19:31
<&ToxicFrog>
Anyways, the bug report isn't very interesting, it's a crash in a vstruct->vstruct call during float unpacking, but looking at the stack trace and internals it looks like it's actually caused by some other part of his program breaking module loading so vstruct can't find all of its components.
19:31
<&ToxicFrog>
But it does mean people are using my library \o/
19:32 * iospace hugs ToxicFrog
19:33
<&ToxicFrog>
meep
19:33 * ToxicFrog hugs
19:34 Kindamoody is now known as Kindamoody[zZz]
19:42
<&ToxicFrog>
Anyways, my 20% time will probably be spent on improving vstruct for the first little while.
20:02 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Client closed the connection]
20:02 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
20:05 ToxicDroid2 [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
20:06 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Ping timeout: 121 seconds]
20:06 ToxicDroid2 [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Connection reset by peer]
20:08 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
20:09 ToxicDroid2 [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
20:09 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Client closed the connection]
20:42
<@froztbyte>
ToxicFrog: that actually sounds like a hell of a useful piece of software
20:42
<@froztbyte>
ToxicFrog: I want to learn lua just to poke at it :P
20:43
<@froztbyte>
it seems like a useful language to know
20:46
<&McMartin>
Woo, vstruct
20:49 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
20:52
<&ToxicFrog>
The bug turned out to be user error, although that at least hints that the documentation could be clearer (he had read the documentation but misunderstood part of it).
20:53
<&McMartin>
Yeah, it's more "vstruct and things like it are my answer to loose/weak typing"
20:56
<&ToxicFrog>
I'll ask you to expand on that later when I'm not running to a class
20:58 ToxicDroid2 [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Client closed the connection]
21:02 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
21:03 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Client closed the connection]
21:04 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
21:10 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Client closed the connection]
21:10 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
21:12 Reiv [NSwebIRC@A3BDC3.5BE3EC.B8847E.5ADB9D] has joined #code
21:12 mode/#code [+o Reiv] by ChanServ
21:12 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has quit [Client closed the connection]
21:13 ToxicDroid [ToxicFrog@1AB00B.00D4F0.621482.896A0B] has joined #code
21:26 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
21:26 mode/#code [+o celticminstrel] by ChanServ
21:35 Rhamphoryncus [rhamph@Nightstar-f8b1f87b.abhsia.telus.net] has quit [Ping timeout: 121 seconds]
21:48 Rhamphoryncus [rhamph@Nightstar-f8b1f87b.abhsia.telus.net] has joined #code
21:48 mode/#code [+o Rhamphoryncus] by ChanServ
22:05 Kyte|Work [c80e6b02@Nightstar-4fab16c5.mibbit.com] has quit [[NS] Quit: http://www.mibbit.com ajax IRC Client]
22:14
<&ToxicFrog>
McMartin: ok, what did you mean?
22:15
<&McMartin>
"There is no longer even bad excuses for doing structure dumps in C"
22:15
<&ToxicFrog>
Aah.
22:16
<&ToxicFrog>
vstruct is even endianness-aware!
22:17
<&McMartin>
So is pystruct
22:18
<&McMartin>
And Go's wacky hybrid of struct and type inference, a place where these things normally don't mesh
22:18
<&McMartin>
But I remember doing some crazy hackery in Go to hack U4 save files
22:19
<&ToxicFrog>
(specifically it has markers for big-, little-, host-, and net-endian. Middle-endian is not supported and never will be~)
22:19
<&McMartin>
(Middle-endian 32-bit values are multiple 16-bit values combined later. =P)
22:20
<&McMartin>
What's the difference between net- and big-?
22:24
<@TheWatcher>
... does anything anywhere actually use middle-endian?
22:25
<@TheWatcher>
Or do I not want the answer to that?
22:25
<&McMartin>
IIRC, it was certain 32-bit versions of UNIX running on 16-bit hardware.
22:25
<&ToxicFrog>
McMartin: there isn't one, but if you don't remember which one it is you can ask for "net endian" and get big-endian.
22:25
<&ToxicFrog>
TheWatcher: PDP-11.
22:25
<&ToxicFrog>
Also ARM in some modes, IIRC.
22:26
<@TheWatcher>
Yeah, well, arm is full of spiders anyway~
22:26
<&McMartin>
A google for "NUXI" should find stuff.
22:26
<@TheWatcher>
(I say this as someone who wrote a course on ARM system design >.>)
22:27
<@TheWatcher>
(*shudder*)
22:27
<&McMartin>
MIPS is also full of spiders.
22:27
<&McMartin>
The question is
22:27
<&McMartin>
Is either actually worse than x86~
22:27
<@TheWatcher>
Point
22:28
<&McMartin>
MIPS is not worse than x86.
22:29
<&McMartin>
I've only worked with one breed of ARM and it was very restricted.
22:29
<&McMartin>
I actually don't know the answer for it, so it should perhaps be considered an honest question.
22:29
<&McMartin>
(I'm guessing THUMB is the one that goes NUXI)
22:34 himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code
22:34 mode/#code [+o himi] by ChanServ
22:37
<@Reiv>
Huh. I thought that x86 was actually pretty good.
22:37
<@Reiv>
no, wait, I'm thinking of x64 aren't I
22:37
<@TheWatcher>
Nah, THUMB is just a 16 bit instruction set cut-down version of ARM for code density. ARM uses middle endian for doubles and other >32bit data types
22:38
<&McMartin>
x86 has a usable subset and x64 only extends that subset
22:38
<&ToxicFrog>
Reiv: x86 is godawful. AMD64 maintains backwards compatibility with x86, AIUI, and is thus also godawful.
22:38
<&ToxicFrog>
But at least you get more registers, I think.
22:39
<&ToxicFrog>
I have no idea on IA64.
22:39
<@Reiv>
AMD64 having backwards compat was, however, genius in its own way.
22:41
<&ToxicFrog>
Well, yes, business-wise it was the only sensible thing to do.
22:41
<&ToxicFrog>
But, much like windows backwards compatibility, on the technical side it is full of regret and spiders.
22:42 You're now known as TheWatcher[T-2]
22:42
<&McMartin>
16-bit x86 is full of regret and spiders.
22:42
<&McMartin>
32-bit is Not As Bad and a subset of it is Actually Kind Of OK
22:42
<&McMartin>
64-bit takes that part and makes it have more registers, more or less.
22:44 You're now known as TheWatcher[zZzZ]
23:05
<&ToxicFrog>
Java: also full of regret and spiders
23:06 * McMartin opens up his JVM spec book, finds a footnote.
23:06
<&McMartin>
"[4] The fact that end_pc is sxclusive is a historical mistake in the design of the Java virtual machine..."
23:06
<@Reiv>
... snrk wut
23:07
<&McMartin>
"[2] In retrospect [setting up this thing] was a poor choice."
23:10
<&ToxicFrog>
Snrk. "You have a problem, and decide to use Guice. Now you have a com.google.inject.Provider<Problem>."
23:12
<@celticminstrel>
Spiders!
23:15
<&McMartin>
Reiv: The official Sun book detailing the JVM is full of footnotes that may be summarized as "Sorry guys, our bad"
23:17
<@Reiv>
To be fair
23:17
<@Reiv>
When they first rigged the thing, was there much in the way of Prior Art in the space?
23:18
<@celticminstrel>
Prior Art?
23:18
<&McMartin>
Reiv: VMs?
23:18
<&McMartin>
Well, yes
23:18
<&ToxicFrog>
Reiv: Java is, what, early 90s?
23:18
<&ToxicFrog>
So, yes, rather a lot.
23:19
<&McMartin>
Guy L Steele was at MIT at the same time the folks who became the Infocom guys were
23:19
<&McMartin>
The Z-Machine was the JVM trick applied to Write Once, Run On Apple IIe, MS-DOS, PDP-11, Commodore 64, and Amiga.
23:19
<@Reiv>
So... they really don't have much of an excuse for making the wrong calls, then?
23:19
<&McMartin>
Some of them absolutely not
23:19
<&McMartin>
Some of them were just fuckups people didn't notice
23:19
<&McMartin>
The [2] was inexcusable, for serious
23:20
<@Reiv>
What was it?
23:20
<&McMartin>
The end_pc one is "this has a really obvious stupid corner case we should have caught but that nothing will ever hit"
23:20
<&McMartin>
Java binaries have a chunk called the "constant pool" where, well, constants live.
23:20
<&McMartin>
Everything from method names to string constants to the raw numbers used in big computations.
23:20
<&McMartin>
Instructions aren't, say, "load this constant integer into register X"
23:21
<&McMartin>
They're "Load the integer at constant pool entry X into register Y"
23:21
<&McMartin>
or "Load the field named by constant pool entry X, using Y as 'this', into Z"
23:21
<&McMartin>
64-bit integers and floating point constants take up two constant pool index entries.
23:22
<&McMartin>
Strings, which can take up as many bits as they want, take up only one, because constant pool entries are variable length, you idiots
23:23
<&ToxicFrog>
wiat
23:23
<&ToxicFrog>
what
23:24
<&McMartin>
They admit it's stupid in the spec!
23:24
<&ToxicFrog>
Did they document why they did it this way?
23:24
<&McMartin>
No, just that "in retrospect this was a poor choice"
23:25
<&McMartin>
Registers and stack entries work like that, because Strings are references and Long/Double values are actual values, and registers and stack entries are in fact 32 bits wide
23:25
<&McMartin>
So that's fine
23:25
<&McMartin>
But the Constant Pool is not 32 bits wide, and this is not fine
--- Log closed Thu Mar 07 00:00:07 2013
code logs -> 2013 -> Wed, 06 Mar 2013< code.20130305.log - code.20130307.log >

[ Latest log file ]