code logs -> 2010 -> Mon, 13 Dec 2010< code.20101212.log - code.20101214.log >
--- Log opened Mon Dec 13 00:00:49 2010
00:30 Kindamoody[out] is now known as Kindamoody
00:31 Attilla [Some.Dude@Nightstar-1738884b.threembb.co.uk] has quit [[NS] Quit: ]
00:32 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
00:53 You're now known as TheWatcher[T-2]
00:58 You're now known as TheWatcher[zZzZ]
01:04
< simon__>
a friend of mine plans to try to teach Scheme to 8th graders.
01:11
< gnolam>
8th graders in general, or motivated, interested 8th graders?
01:26
< simon__>
I don't know. something in between, I think.
01:26
< simon__>
they all opted in, but I find it hard to believe that there are 12 motivated 8th graders in the same class. :)
01:38
< gnolam>
As long as it's not foisted on /everyone/, it might work.
01:42 Kindamoody is now known as Kindamoody[zZz]
02:22 Stalker [Stalker@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
02:32 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?]
02:32 kwsn [chatzilla@Nightstar-fb2504b4.dyn.centurytel.net] has joined #code
02:37 Netsplit *.net <-> *.split quits: Alek, Kindamoody[zZz], Thaqui, PinkFreud
02:39 Netsplit over, joins: Thaqui, Alek
02:40 Netsplit over, joins: Kindamoody[zZz]
02:57 jerith [jerith@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
03:13 Finerty is now known as Vornicus
03:19 Alek is now known as NSGuest42655
03:22 PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code
03:28 jerith [jerith@Nightstar-bf52129d.slipgate.za.net] has joined #code
03:28 mode/#code [+o jerith] by Reiver
03:30 jerith [jerith@Nightstar-bf52129d.slipgate.za.net] has quit [Ping timeout: 121 seconds]
03:34 simon__ [simon@Nightstar-a12ff716.gjk.dk] has quit [Operation timed out]
03:36 simon_ [simon@Nightstar-a12ff716.gjk.dk] has joined #code
03:49 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
04:29 kwsn_ [chatzilla@31356A.5FD175.2259B6.F822B5] has joined #code
04:30 kwsn [chatzilla@Nightstar-fb2504b4.dyn.centurytel.net] has quit [NickServ (GHOST command used by kwsn_)]
04:30 kwsn_ is now known as kwsn
04:44 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
06:05 celticminstrel [celticminst@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
06:25 Anno[Laptop] [annodomini@Nightstar-84dba4e0.adsl.tpnet.pl] has joined #code
06:46 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
06:47 kwsn [chatzilla@31356A.5FD175.2259B6.F822B5] has quit [[NS] Quit: NO I'M NOT]
06:52 Rhamphoryncus [rhamph@Nightstar-473f8685.abhsia.telus.net] has joined #code
06:53 cpux is now known as shade_of_cpux
07:22 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Client closed the connection]
07:38 NSGuest42655 is now known as Alek
08:14 jerith [jerith@Nightstar-bf52129d.slipgate.za.net] has joined #code
08:14 mode/#code [+o jerith] by Reiver
09:08 Kindamoody[zZz] is now known as Kindamoody
09:14 You're now known as TheWatcher
09:14 Vornicus is now known as Vornicus-Latens
09:39 jerith [jerith@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
10:09 Anno[Laptop] [annodomini@Nightstar-84dba4e0.adsl.tpnet.pl] has quit [[NS] Quit: Need to go.]
10:17 * TheWatcher eyes git
10:18
< JBeshir>
* git bites TheWatcher
10:19
<@TheWatcher>
Sweet merciful Azathoth, I just renamed a directory and git didn't even miss a beat, and handled it sanely. Fuck you, CVS and SVN, this is how it should be.
10:19
< JBeshir>
Nice.
10:47
< Stalker>
What happened to your regular handle?
10:47
< Stalker>
Did it elope?
10:48
< JBeshir>
If I disconnect it happens.
10:48
< JBeshir>
Well, if I bounce and there's a ghost.
10:48 JBeshir is now known as Namegduf
10:51 Anno[Laptop] [annodomini@F67919.F326B3.98D923.BDA7B6] has joined #code
10:56
< Namegduf>
Ew.
10:56
< Namegduf>
Git depends on CVS in Cygwin
10:59
<@TheWatcher>
.... 'cos that makes perfect sense
11:14
< Namegduf>
I hate building on Windows
11:51
< simon_>
Namegduf, I guess they figured they might as well, now that they've made a pact with one elder daemon.
11:51
< simon_>
(Windowsoth)
11:53
< gnolam>
Eww, Cygwin.
11:54
< Namegduf>
This whole setup is awful
11:55
< Namegduf>
Building on Windows is the worst thing ever
11:55
< gnolam>
s/on Windows//
11:55
< Namegduf>
No, specifically on Windows.
11:55
< gnolam>
Most projects have godawful build setups.
11:56
< Namegduf>
No library search paths, runtime or build, so I need to either drop my library in system32 or copy it into the release directory by hand, no include search paths...
11:56
< gnolam>
No matter what platform it's on.
11:56
< Namegduf>
Linux can manage dependencies. Windows can't manage shit.
11:57
< Namegduf>
On Linux, the same project can be built with a single gcc command after a few apt-gets to install dependencies.
11:57
< gnolam>
Can manage dependencies iff the libraries are in your repositories. Otherwise, you're SOL.
11:57
< Namegduf>
Also my repository is git.
11:57
< gnolam>
On Windows, you can count on a binary being available.
11:57
< Namegduf>
But it having no ability to manage it.
11:58
< gnolam>
I've been to Linux dependency hell. It's not a pretty place.
11:59
< Namegduf>
Linux is still better.
11:59
< Namegduf>
You can at least install into /usr/local and things will find it automatically.
11:59
< Namegduf>
On Windows you have to install manually, AND need to explicitly configure search paths.
12:00
< gnolam>
Anyway. Most of the time people rant about how awful $foo is on Windows, it's because they're trying to do something just like they're doing it on platform $bar.
12:00
< Namegduf>
I can't do it just like platform $bar because the facilities don't exist to even approximate the same actions.
12:01
< Namegduf>
This project can build in a single gcc command and a few apt-gets on Linux. On Windows it requires over an hour of manually downloading binaries, dropping them somewhere, configuring VS to find them... copying the library into somewhere it can find it at runtime...
12:02
< gnolam>
> No library search paths, runtime or build
12:02
< gnolam>
*cough*vcvars*cough*
12:02
< Namegduf>
Not even vaguely familiar
12:03
< Namegduf>
That's aside the issues arising because the repo is a git repo, accessed over pubkey SSH; I'm willing to acknowledge that is not a Windows-friendly setup. But Linux comes with search paths and a sensible build infrastructure. Windows comes with nothing and has to be cobbled together on a per-project basis, and the lack of package management makes dependencies a complete PITA because this is the one case it isn't circumvented by bundling a sep
12:04
< Namegduf>
If there's a way to build on Windows which isn't a complete PITA, I've never seen it.
12:05
< Namegduf>
Also VS is a massive piece of shit in itself, with a needlessly labyrinthine and messy UI. "oops, I default to configuring only the Debug build, so you need to configure it again".
13:16 KM [NSwebIRC@Nightstar-4764665d.tbcn.telia.com] has joined #code
13:17 KM is now known as Kindamoody[work]
13:17 Anno[Laptop] [annodomini@F67919.F326B3.98D923.BDA7B6] has quit [[NS] Quit: DEATH.]
13:20 Kindamoody [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has quit [Client exited]
13:47 jerith [jerith@Nightstar-bf52129d.slipgate.za.net] has joined #code
13:47 mode/#code [+o jerith] by Reiver
14:02 Anno[Laptop] [annodomini@Nightstar-84dba4e0.adsl.tpnet.pl] has joined #code
14:04 celticminstrel [celticminst@Nightstar-f8b608eb.cable.rogers.com] has joined #code
14:19 Rhamphoryncus [rhamph@Nightstar-473f8685.abhsia.telus.net] has quit [Client exited]
15:07 Stalker [Stalker@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
16:04 Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code
16:11
<@jerith>
So. I now have ASTs for about 80 SQL queries.
16:12 * jerith tries to figure out how to analyse these to see what they're looking at.
16:57 Stalker [Stalker@26ECB6.A4B64C.298B52.D80DA0] has joined #code
17:29 Attilla [Some.Dude@Nightstar-8bf31deb.threembb.co.uk] has joined #code
17:29 mode/#code [+o Attilla] by Reiver
--- Log closed Mon Dec 13 18:49:55 2010
--- Log opened Mon Dec 13 18:50:12 2010
18:50 TheWatcher [chris@Nightstar-b4529b0c.zen.co.uk] has joined #code
18:50 Irssi: #code: Total of 25 nicks [6 ops, 0 halfops, 0 voices, 19 normal]
18:50 mode/#code [+o TheWatcher] by Reiver
18:51 Irssi: Join to #code was synced in 53 secs
18:53 RichardBarrell [mycatverbs@Nightstar-228a334c.plus.com] has joined #code
19:23 Kindamoody [Kindamoody@Nightstar-ad297e24.telia.com] has joined #code
19:24 Kindamoody [Kindamoody@Nightstar-ad297e24.telia.com] has quit [Client exited]
20:14
< simon_>
what's the ::= operator in BNF syntax called?
20:15
< simon_>
a professor mentioned it, and it was something that emphasised the repetitiveness of the colon.
20:17
<@McMartin>
... I'd call it the production operator
20:18
< simon_>
yes, that's what it is. it apparently also has a nickname.
20:19 * simon_ is on a long endeavour to have nice syntax highlighting in GEdit, which I don't even use.
20:20
< simon_>
basically, they have an XML format for their syntax highlighting files, and their method is tree-based. I don't want to code XML, so I'm trying to make a program that takes a BNF grammar and generates an XML skeleton for GtkSourceView (which is the library handling syntax highlighting and a bunch of other stuff)
20:21
< simon_>
the BNF shouldn't be a complete BNF of the language, just the parts that are meaningful for creating syntax highlighting groups.
20:25
< RichardBarrell>
Although having it be a complete BNF *would* be really nice. :)
20:26
< simon_>
you could probably get some very rich syntax highlighting, but it would probably not be that useful :)
20:26
< simon_>
hmmm
20:26
< simon_>
one thing I'm not sure about
20:27
< simon_>
I'd like for it to be more common that syntax highlighting files express impossible code with a red background
20:27
< simon_>
s/it/there/
20:28
< simon_>
e.g. if you type "def foo(]" in a python buffer, it should mark the right-bracket as red.
20:29
< celticminstrel>
If you don't use it, why are you doing this?
20:29
< simon_>
celticminstrel, my initial motivation is to replace Emacs in the introductory programming course at my dept.
20:30
< simon_>
celticminstrel, I think I can already do that with a very crude syntax highlight file for GEdit, which I've got.
20:30
< celticminstrel>
I see.
20:30
< celticminstrel>
Not using Emacs in general seems like a good idea. It's too obtuse for modern users.
20:31
< celticminstrel>
Well, most modern users.
20:31
< simon_>
celticminstrel, it basically has a "Compile" button that shows the output using the External Tools plugin. the sml-mode plugin for Emacs is a bit too advanced for a lot of people. e.g. there are different commands for loading different quantities of the current buffer into an active interpreter held in another buffer. very neat, but people mix things up in a large number of ways.
20:31
< celticminstrel>
Because all the key-bindings are different from what they're used to.
20:31
< simon_>
celticminstrel, well, I personally swing the other way, but I believe that people should choose to use an insane editor like Emacs/Vim and not be pressed to use them. :)
20:32
< celticminstrel>
Fair enough.
20:32
< simon_>
yes
20:32
< simon_>
the keybindings is another thing. ^C and ^V don't Just Work.
20:32
< celticminstrel>
I'm sure it's a very good editor. It's just not easily approachable like a native application would be.
20:33
< simon_>
GEdit is actually a quite nice basis for an editor. they haven't made any huge design flaws as far as I can tell. :P
20:33
< celticminstrel>
That's good, I guess.
20:34
< simon_>
the syntax highlighting features of emacs and vim are simply hacks. this one is pretty solid.
20:34
< celticminstrel>
Hehe.
20:34
< simon_>
so... BNF is the preferred way to specify CFGs, apparently.
20:34
< celticminstrel>
CFG?
20:35
< simon_>
context-free grammar
20:35
< celticminstrel>
Ah, right.
20:35
< simon_>
I don't really like it compared to the cleaner Nonterm -> Production syntax in my books (which also resembles ML-Yacc much more).
20:35
< celticminstrel>
Aren't some common languages not context-free, like C++?
20:35
< simon_>
yes
20:36
< celticminstrel>
I think I've heard that about Perl too.
20:36
< simon_>
oh, I didn't know that Perl wasn't.
20:37
< celticminstrel>
I dunno either, but I vaguely recall reading it somewhere.
20:37
< RichardBarrell>
IIRC, Perl5 parsing is Turing-complete because there's some arcane use of the / character which sometimes introduces a comment, sometimes acts like an operator.
20:37
< RichardBarrell>
Depending on values at runtime.
20:38
< RichardBarrell>
C++ parsing is also Turing-complete in theory because you have to do template resolution in order to work out whether certain words are identifiers or types.
20:38
< RichardBarrell>
(Not that you'd ever write code that tripped that edge case in practice for fear of having your guts ripped out by angry co-workers)
20:38
< celticminstrel>
Only in theory?
20:39
<@jerith>
C++ templates are verifiably Turing-complete.
20:39
< RichardBarrell>
Well, you wouldn't write code that actually tripped that syntactic edge case.
20:39
<@jerith>
And there are libraries that exploit that.
20:40
< RichardBarrell>
jerith: yes. I was just referring to the *parsing* stage.
20:40
< celticminstrel>
I'm missing the difference... :|
20:45
<@McMartin>
Perl5 parsing is trivially Turing complete because you can, in effect, dynamically modify the parser as you go
20:46
<@McMartin>
I believe but am not positive that in the absence of templates, parsing C++ is merely "not context free", which means in practice you'd use a Turing machine to do it, but it can't do everything a Turing machine can.
20:50 Kindamoody [Kindamoody@Nightstar-4764665d.tbcn.telia.com] has joined #code
20:50
<@McMartin>
Well, OK. You'd use a linear bounded automaton.
20:50
<@McMartin>
But that's because that's what you actually use for everything.
20:51 * jerith has two separate lexers in his SQL parser.
20:51
<@jerith>
It made sense at the time!
20:51 Kindamoody[work] [NSwebIRC@Nightstar-4764665d.tbcn.telia.com] has quit [[NS] Quit: ]
20:51
<@McMartin>
C and C++ do that!
20:51
<@McMartin>
There's precedent!
20:52
<@McMartin>
(The preprocessor is totally a lexer)
20:52
<@McMartin>
Band name alert: MERCILESS LEXICAL CYBORG
20:52
< celticminstrel>
Doesn't C/C++ go lexer-->preprocessor-->compiler, without a second lexer?
20:52
<@jerith>
I use the first one (which I copied from the lexer in the MySQL source code that MySQL doesn't actually use) to see if I'm looking at a SELECT query.
20:53
< celticminstrel>
...why is it there if it doesn't use it? o.O
20:53
<@jerith>
Who knows?
20:53
<@jerith>
I was very confused when it thoroughly failed to lex a simple query.
20:53
<@McMartin>
celticminstrel: I was under the impression that cpp was source-to-source and invoked standalone, but this seems like an implementation detail
20:53
<@jerith>
Then I found the real one.
20:54
<@McMartin>
I mean, that said, lexers are super cheap.
20:54
<@jerith>
The other lexer is one I pulled from the list of ANTLR grammars, and I had to install a neolithic ANTLR to use it.
20:54
<@McMartin>
If you want to get sleazy and nitpicky, you're building a lexer every time you precompile a regex.
20:54
< celticminstrel>
Okay, it's true that cpp can do that, but in practice I believe it feeds the transformed token stream directly to the compiler.
20:55
<@jerith>
Turns out the parser part of the ANTLR grammar builds an AST that is a stream of tokens.
20:55
< celticminstrel>
^ usually
20:55
<@jerith>
Which is somehwat less than useful.
20:55
<@jerith>
So I ended up writing my own parser anyway, but the ANTLR grammar's lexer was much better than mine.
20:56
<@McMartin>
Heh
20:56
<@McMartin>
Java was similar, though it was more two-part.
20:56
<@McMartin>
The language spec is written entirely as a BNF setup, but its ultimate substrate is characters, not tokens.
20:57
<@McMartin>
While you *can* split it, in the spec they don't.
20:57
<@jerith>
The lexer MySQL /actually/ uses is a handwritten C++ monstrosity that has tendrils all over the codebase and fakes a bunch of lex/yacc stuff.
21:42 Rhamphoryncus [rhamph@Nightstar-473f8685.abhsia.telus.net] has joined #code
21:53
< simon_>
if I've got a number N and I want a number N' that varies from N such that small changes are more likely than large changes, how do I do that?
21:54
< simon_>
how about (1 - sum(small random changes))?
21:55
< simon_>
sorry, K - ... where K is the maximum that the sum could generate.
21:56
< Tarinaky>
simon_: You mean you want a PRNG that produces a bell curve?
21:56
< simon_>
yes.
21:56
< Tarinaky>
The easiest way is to add together a series of consecutive numbers from the PRNG.
21:57
< Tarinaky>
It'll reduce your period but it works.
21:57
< Tarinaky>
(ie: add together 3 six sided dice instead of multiply 1d6 by 3)
21:57
< Tarinaky>
*multiplying
21:58
< Tarinaky>
(Both produce the same average but have totally different distributions)
22:00
< simon_>
right :) thanks.
22:00
< simon_>
and by period you mean the interval of the outcome, right?
22:00
< Tarinaky>
By period I mean the time it takes for the PRNG to run out of unique random numbers and go back to the start.
22:01
< simon_>
oh!
22:01
< simon_>
yeah, that seems like a concern that is practical enough for me to neglect. :)
22:03
< Tarinaky>
Indeed.
22:20
< Rhamphoryncus>
Do you know what PRNG you're using?
22:21
< simon_>
Rhamphoryncus, not yet. it was for a game I was thinking about, so probably one of python's.
22:21
< Tarinaky>
Probably be a Mersenne Twister then?
22:22
< celticminstrel>
I think Python uses Mersenne, yes.
22:22
< celticminstrel>
By default, at least.
22:22
< Rhamphoryncus>
yeah
22:22
< Tarinaky>
Isn't a MT one of the best ones to use for a game anyway?
22:22
< Rhamphoryncus>
rng = random.Random() will get you MT
22:23
< Rhamphoryncus>
Best I've been exposed to. Not that I've explored the field extensively
22:23
< Tarinaky>
Although, iirc, it's a small pain to save/load seeds.
22:23
< Tarinaky>
Err s/seeds/states
22:24
< RichardBarrell>
Python's random module includes functions to sample Gaussians.
22:26
< RichardBarrell>
import random; print random.normalvariate(mean, standard_deviation) # :)
22:27
< Tarinaky>
RichardBarrell: Does that wrap the Mersenne Twister?
22:27
< Tarinaky>
Or does it maintain its own, seperate, state?
22:27 Stalker [Stalker@26ECB6.A4B64C.298B52.D80DA0] has quit [Ping timeout: 121 seconds]
22:27
< RichardBarrell>
I think the whole random module uses the same underlying PRNG.
22:28
< Tarinaky>
What's the difference between a gaussian distribution and a normal distribution?
22:28
< Tarinaky>
I thought they were the same thing?
22:29
< RichardBarrell>
They are.
22:29
< Tarinaky>
http://docs.python.org/library/random.html#random.gauss http://docs.python.org/library/random.html#random.normalvariate
22:29
< Tarinaky>
Why is random.gauss faster than random.normalvariate?
22:29 Stalker [Stalker@26ECB6.A4B64C.298B52.D80DA0] has joined #code
22:29
< Tarinaky>
Or am I missing something?
22:29
< RichardBarrell>
I do not know. I *thought* they were.
22:32
< Rhamphoryncus>
huh, I didn't realize how lame random.getstate() was. A nested collection of python objects. Why couldn't it just be a string?
22:32
< RichardBarrell>
Tarinaky: according to the comments in random.py, the difference is that random.gauss isn't thread-safe.
22:33
< Tarinaky>
Ah, thank you! :D
22:33
< Tarinaky>
Bit of a documentation oversight there >.>
22:33
< RichardBarrell>
Tarinaky: the underlying random generator that's used throughout random.py is a Mersenne Twister, unless I'm mis-understanding the C module that it calls. :)
22:33 Stalker [Stalker@26ECB6.A4B64C.298B52.D80DA0] has quit [Ping timeout: 121 seconds]
22:34
< RichardBarrell>
Yeah. The comment says that if two threads call random.gauss(m,s) simultaneously then they might both get the result that one of the threads was meant to get.
22:35
< Rhamphoryncus>
RichardBarrell: that's.. bizarre
22:35
< Rhamphoryncus>
even buggy IMO
22:35
< RichardBarrell>
I do not disagree. CPython's implementation is distinctly less wonderful than the language that it implements, IMO.
22:36
<@ToxicFrog>
No kidding.
22:36
< RichardBarrell>
Anyway. Gotta go. Have a good night, humans.
22:36
<@ToxicFrog>
'night
22:36 RichardBarrell [mycatverbs@Nightstar-228a334c.plus.com] has quit [[NS] Quit: Zzzzzz]
23:11 * ToxicFrog pokes froztbyte
23:20 RichardBarrell [mycatverbs@Nightstar-689c9c54.cable.virginmedia.com] has joined #code
23:26 Stalker [Stalker@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
23:51 Attilla [Some.Dude@Nightstar-8bf31deb.threembb.co.uk] has quit [Ping timeout: 121 seconds]
23:52 shade_of_cpux is now known as cpux
--- Log closed Tue Dec 14 00:00:59 2010
code logs -> 2010 -> Mon, 13 Dec 2010< code.20101212.log - code.20101214.log >