code logs -> 2009 -> Sat, 20 Jun 2009< code.20090619.log - code.20090621.log >
--- Log opened Sat Jun 20 00:00:29 2009
00:14 Rhamphoryncus [~rhamph@Nightstar-7168.ed.shawcable.net] has quit [Quit: Rhamphoryncus]
00:20 Rhamphoryncus [~rhamph@Nightstar-7168.ed.shawcable.net] has joined #code
00:25 ASCII [~none@Nightstar-27052.dyn.optonline.net] has joined #code
00:27 AbuDhabi [AnnoDomini@Nightstar-29168.neoplus.adsl.tpnet.pl] has quit [Quit: The body is alive, but the eyes are dead.]
01:51
<@Derakon>
Argh, I really, really wish that Python descoped variables.
01:51
<@Derakon>
...actually, this is more Python not treating every instance of a given string as a reference to a variable.
01:51
<@Derakon>
Is it too much to ask that I be allowed to have a module "seed.py" and a variable name "seed" and not have them conflict? :(
01:58
<@SmithKurosaki>
Wow, that message from Nighstar just now was special
01:59
< Alek>
it's a special-ty. :P
02:26 Derakon is now known as Derakon[AFK]
02:29 Thaqui [~Thaqui@121.98.166.ns-22683] has joined #code
02:29 mode/#code [+o Thaqui] by ChanServ
02:57 SmithKurosaki [~Smith@Nightstar-7213.cpe.net.cable.rogers.com] has quit [Quit: I'm out, there's something else to do]
03:00 SK is now known as SmithKurosaki
03:57 ASCII [~none@Nightstar-27052.dyn.optonline.net] has quit [Connection reset by peer]
04:25 SmithKurosaki [~Smith@Nightstar-5728.dsl.teksavvy.com] has quit [Quit: Leaving]
04:25 SmithKurosaki [~Smith@Nightstar-7213.cpe.net.cable.rogers.com] has joined #code
04:25 mode/#code [+o SmithKurosaki] by ChanServ
06:24 Syloqs-AFH [Syloq@ServicesAdmin.Nightstar.Net] has quit [Connection reset by peer]
07:36 UndeadAnno [AnnoDomini@Nightstar-29168.neoplus.adsl.tpnet.pl] has joined #Code
07:36 mode/#code [+o UndeadAnno] by ChanServ
08:21 Derakon[AFK] is now known as Derakon
08:43 Derakon is now known as Derakon[AFK]
08:47 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
08:47 mode/#code [+o gnolam] by ChanServ
09:01 You're now known as TheWatcher
09:09 Rhamphoryncus [~rhamph@Nightstar-7168.ed.shawcable.net] has quit [Quit: Rhamphoryncus]
09:46 MyCatVerbs [~mycatverb@Nightstar-13709.lurkingfox.co.uk] has joined #code
09:46 mode/#code [+o MyCatVerbs] by ChanServ
10:37 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
10:37 mode/#code [+o Attilla] by ChanServ
11:25 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
11:25 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
11:25 mode/#code [+o Attilla] by ChanServ
11:39 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
11:39 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
11:39 mode/#code [+o Attilla] by ChanServ
11:40 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
11:41 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
11:41 mode/#code [+o Attilla] by ChanServ
12:18 * UndeadAnno mutters. What's the amplitude value of the border frequency in a chebyshev filter?
12:22 You're now known as TheWatcher[afk]
12:32
<@EvilDarkLord>
Google.
12:36 * UndeadAnno throws a rock at EvilDarkLord.
12:36
<@UndeadAnno>
Don't you think I've tried that?
12:43
<@EvilDarkLord>
Mmhmm. What kind of filter is it?
12:44
<@EvilDarkLord>
Low-, band-, highpass, something else?
12:49
<@UndeadAnno>
The basic lowpass.
13:04 UndeadAnno is now known as SocietyForSaneCapitalization
13:05 SocietyForSaneCapitalization is now known as UndeadAnno
13:29 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Ping Timeout]
13:51
< Tarinaky>
I have a string that contains "+". At some point which I've yet to locate it's getting mangled into "-0.226439". Does anyone have any insight to offer?
13:51
< Tarinaky>
If it helps I know that it corresponds to 43 as an int.
13:52
< Tarinaky>
*know '+' corresponds to 43.
13:55
< Tarinaky>
Ahah! Found the culprit.
13:56
<@Namegduf>
What was it?
13:56
< Tarinaky>
There was an '=' instead of an '=='.
13:57
< Tarinaky>
On the line my cursor was on. Blinking at me. For the past god knows how long.
13:57
<@Namegduf>
XD
13:58
< Tarinaky>
This resulted in an initialised address of memory being written into the variable -just- before printing it.
13:59
< Tarinaky>
Not that that matters.
14:17 You're now known as TheWatcher
14:20 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
14:20 mode/#code [+o Attilla] by ChanServ
14:48 UndeadAnno [AnnoDomini@Nightstar-29168.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
14:54 UndeadAnno [AnnoDomini@Nightstar-29070.neoplus.adsl.tpnet.pl] has joined #Code
14:55 mode/#code [+o UndeadAnno] by ChanServ
15:26 Thaqui [~Thaqui@121.98.166.ns-22683] has quit [Ping Timeout]
15:34 NSGuest-1043 [~Thaqui@121.98.166.ns-22683] has joined #code
15:40 NSGuest-1043 [~Thaqui@121.98.166.ns-22683] has quit [Connection reset by peer]
16:01 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
16:02 Syloqs_AFH is now known as Syloqs-AFH
16:36 GeekSoldier_ [~Rob@Nightstar-8573.midstate.ip.cablemo.net] has joined #code
16:37 GeekSoldier [~Rob@Nightstar-8573.midstate.ip.cablemo.net] has quit [Ping Timeout]
16:42 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Ping Timeout]
17:09 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
17:09 mode/#code [+o Attilla] by ChanServ
17:28
<@SmithKurosaki>
UndeadAnno: I have a stats book beside me, what is it you need to know about chebyshev?
17:31 Rhamphoryncus [~rhamph@Nightstar-7168.ed.shawcable.net] has joined #code
17:32
<@UndeadAnno>
SmithKurosaki: What is the amplitude value (or the 1s complement of it) at the boundary frequency?
17:36
<@SmithKurosaki>
Would getting the formaula help?
17:37
<@UndeadAnno>
Only if the formula could give me the answer shortly.
17:39
<@SmithKurosaki>
Formula: 100(1-1/k^2)
17:40
<@SmithKurosaki>
I'm sorry I couldn't find what you were exactly looking for. Good luck
17:45 Derakon[AFK] is now known as Derakon
18:24
< Tarinaky>
I'm trying to write a math parser in C++. I've got a problem with negative numbers. I can't work out how to distinguish between a '-' as in subtraction and '-' as in negative.
18:24
< Tarinaky>
Specifically an expression like 20*(-1) trips me up.
18:25
<@Namegduf>
I think the answer is 'position', or that it will:
18:25
<@Namegduf>
1) Be followed by a valid number thing.
18:26
<@Namegduf>
(Meaning a number, constant, bracketed expression, etc)
18:26
<@Namegduf>
2) NOT be preceded by a "valid number thing", but by nothing or another operator.
18:27
<@Namegduf>
I'm not familiar with the proper terminology, but I hacked on the inside of a crappy C expression parser/evaluator to add implicit multiplication support and similar once.
18:40
< Tarinaky>
Thanks. I think that got it.
19:02
< simontwo>
Tarinaky, how do you write the parser; using flex?
19:02
< Tarinaky>
No. By hand.
19:03
< Tarinaky>
I couldn't find any decent documentation for flex/bison so I gave up on that.
19:05
< simontwo>
Tarinaky, and do you divide the problem into first tokenizing your expressions and then constructing an AST based on the tokens?
19:06
< Tarinaky>
I don't know what an AST is.
19:06
< Tarinaky>
I tokenise the expression then re-arrenge it into RPN.
19:06
< Tarinaky>
Also, namegduf's solution seems to have worked.
19:06
< simontwo>
abstract syntax tree. basically a tree structure that contains your expression
19:07
< simontwo>
ok
19:08
< simontwo>
Tarinaky, I'm a little influenced by having recently read in a compiler book.
19:08
< Tarinaky>
Heh. 's'okay.
19:09
< Tarinaky>
Flex/Bison sound like very nice tools but if I can't find out how to use them they aren't terribly useful >.>
19:09
< simontwo>
hehe
19:14
< simontwo>
Tarinaky, as long as you define the syntax unambiguously, it is just a matter of technique.
19:17
< simontwo>
e.g. "-" is unary when either not preceeded by a token within a parenthesis or when preceded by a binary operator token and followed by a number token. that way even 5 + -5 (without parenthesis, which you'd usually prefer in math) is unambiguous.
19:17
< simontwo>
(or 5+ - 5, for that matter)
19:19
< Tarinaky>
I'm sure but like I said. I couldn't find any resources explaining how you use them. As in, the input that the programs take.
19:20
< simontwo>
oh, well, you can make tokenizers without a lex-like tool.
19:21
< simontwo>
but yeah, I suspect you'd need a book that demonstrates flex/bison to get properly started.
19:23
<@ToxicFrog>
Tarinaky: flex: http://flex.sourceforge.net/manual/
19:24
<@ToxicFrog>
I also highly recommend the Dragon Book, "Compilers: Principles, Techniques & Tools", for a bottom-up coverage of this sort of thing.
19:24
< simontwo>
ToxicFrog, do you know the tiger book?
19:25
< simontwo>
("Modern Compiler Implementation in Standard ML")
19:25
< simontwo>
(by Andrew W. Appel)
19:25
<@ToxicFrog>
I don't, and indeed I don't know ML full stop.
19:25
< simontwo>
ah, hehe.
19:25
<@ToxicFrog>
I need my goddamn overloaded operators~
19:26
<@ToxicFrog>
Tarinaky: as for bison, http://www.gnu.org/software/bison/manual/bison.html is the manual, and includes as an example how to make a calculator that does the calculations at parse time.
20:03 * ToxicFrog does some performance tests
20:03
<@ToxicFrog>
Hand-memoized: 0.04s
20:03
<@ToxicFrog>
util.memoize()ed: 0.09 seconds
20:03
<@ToxicFrog>
No memoization: it's still running.
20:04
<@McMartin>
There are three tiger books. ML, C (which is in fact ML), and Java (which is actually a different design methodology)
20:06
<@McMartin>
The Dragon Book's treatment of flex and bison is kind of out of date, and the Tiger book - at least, Java's, which is the one I have - basically just goes "read the web page lol".
20:25
<@ToxicFrog>
I recommend the Dragon Book more for the "this is what lexing and parsing is, this is how a compiler works" stuff
20:25
<@ToxicFrog>
For specific apps, yeah, read the app's manual.
20:30
<@McMartin>
Yeah.
20:31
<@McMartin>
IME the Tiger book is better for "here are a graduated series of programming projects that end in a toy compiler"
20:34
<@SmithKurosaki>
Nice
20:39
<@McMartin>
Third edition of the Dragon Book adds a bunch of material regarding program analysis and other uses of parsers and such
20:56 Rhamphoryncus [~rhamph@Nightstar-7168.ed.shawcable.net] has quit [Quit: Rhamphoryncus]
23:03 UndeadAnno [AnnoDomini@Nightstar-29070.neoplus.adsl.tpnet.pl] has quit [Quit: Black, the colour of despair.]
23:39
<@gnolam>
Gah. I need to do a rebuild.
23:39
<@gnolam>
Oh well. Better find something interesting to do the next 15 minutes or so.
23:44
<@gnolam>
But at least I got out of the dreaded diamond.
23:51 You're now known as TheWatcher[T-2]
23:55 You're now known as TheWatcher[zZzZ]
--- Log closed Sun Jun 21 00:00:43 2009
code logs -> 2009 -> Sat, 20 Jun 2009< code.20090619.log - code.20090621.log >