code logs -> 2009 -> Wed, 18 Nov 2009< code.20091117.log - code.20091119.log >
--- Log opened Wed Nov 18 00:00:40 2009
00:46 Tarinaky [Tarinaky@Nightstar-36cc341d.adsl.virginmedia.net] has quit [Ping timeout: 121 seconds]
00:47 Tarinaky [Tarinaky@Nightstar-36cc341d.adsl.virginmedia.net] has joined #code
00:53 Derakon[AFK] is now known as Derakon
01:38 Orthia [Orthianz@Nightstar-434d5305.xnet.co.nz] has quit [Client closed the connection]
01:40
<@McMartin>
Whoops
01:40
<@McMartin>
So, testing out a new program, which I deliver on USB.
01:40
<@McMartin>
It's not accepting input!
01:40
<@McMartin>
Protip: When unplugging USB stuff to make room for the thumb drive, don't unplug your keyboard.
01:41 * Derakon snerks.
01:42
< Finale>
lawl
01:43
<@Vornicus-Latens>
Pffffffffffff
01:46 Orthia [Orthianz@Nightstar-434d5305.xnet.co.nz] has joined #code
02:08 Attilla [The.Attilla@FBC920.173C5E.100391.EDA60F] has quit [[NS] Quit: ]
03:06 Alek [omegaboot@Nightstar-e248a1ff.emhril.sbcglobal.net] has quit [Ping timeout: 121 seconds]
03:11 Alek [omegaboot@Nightstar-43b26dbc.emhril.sbcglobal.net] has joined #code
03:15 * McMartin finishes dinner, settles in for a hopefully-not-too-long night of coding
03:17
< SmithKurosaki>
Cheater
03:22
<@ToxicFrog>
...heeeeey
03:22
<@ToxicFrog>
malloc(0) doesn't necessarily return a valid pointer
03:22
<@ToxicFrog>
Oops.
03:22
<@ToxicFrog>
...hmm.
03:23
<@ToxicFrog>
I think this means I need to special-case zero-length strings.
03:23
<@ToxicFrog>
Bollocks.
03:26
< SmithKurosaki>
o.0
03:27
< Namegduf>
You're not using C strings, then?
03:28
<@ToxicFrog>
I'm bridging between C and Lua.
03:28
<@ToxicFrog>
The issue here is:
03:29
<@ToxicFrog>
- sender puts a zero-length string on the wire as LUA_TSTRING,0,;
03:29
<@ToxicFrog>
- reciever asks for int int char*
03:29
<@ToxicFrog>
- however, the char* is gotten by calling malloc(size)
03:29
<@ToxicFrog>
So the reciever ends up asking for NULL to be filled in with a zero-length string by the IO function, which complains
03:35
< simon`>
a hack would be to just allocate an extra byte per string :P
03:35
< simon`>
(even though you don't NUL-terminate. okay, this is a bad solution.)
03:43
< Rhamphoryncus>
Standard behaviour is to wrap malloc with a check that replaces size 0 with size 1
03:44
< Rhamphoryncus>
I've seen at least a few codebases with a macro for that
03:54
< simon`>
hmm
03:56
< simon`>
on left-recursive CFGs: can't it be said that it's there, directly or indirectly, if a non-terminal can lead to itself without having eaten any terminals from the left?
04:00 Finale [c0cb88fe@Nightstar-14e5d099.mibbit.com] has quit [[NS] Quit: http://www.mibbit.com ajax IRC Client]
04:09
<@ToxicFrog>
Rhamphoryncus: annoying, but that may be the easiest fix
04:09
<@ToxicFrog>
Allocate and then free a one-length buffer on the reciever
04:09
< Rhamphoryncus>
free?
04:10
<@ToxicFrog>
The contents get copied elsewhere.
04:10
< Rhamphoryncus>
So this is just a temporary buffer that's never touched?
04:10
<@ToxicFrog>
Correct.
04:10
< Rhamphoryncus>
And freed almost immediately after it's created..
04:10
< Rhamphoryncus>
You could use a constant
04:12
< Rhamphoryncus>
Probably not worth it though
05:05 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Connection reset by peer]
05:13
<@McMartin>
simon: Absolutely.
05:13
<@McMartin>
There's More Detail Than You Really Want in the Dragon Book, as well as a systematic algorithm for removing it.
05:16
<@ToxicFrog>
<3 the Dragon Book
05:16
<@ToxicFrog>
Rhamphoryncus: I ended up special-casing it, in a manner that has the added advantage of not sending two messages for zero-length strings.
05:18
< Rhamphoryncus>
oh, performance is an issue then :)
05:21
< Tarinaky>
I've managed to grasp accepters but I'm struggling with parsers now in the Dragon Book :/
05:21
< Tarinaky>
Which is impressive because I've only had the book for months now >.>
05:21
<@McMartin>
The short form is that a parser is an acceptor that does something with the components, or, to flip it around, an acceptor is a parser that turns a string into a boolean
05:22
<@McMartin>
Usually you have it turn the string into some kind of recursive data structure, typically a tree (Abstract Syntax Tree).
05:23
< Tarinaky>
Yeah. I got that.
05:23
< Tarinaky>
It's the specifics that're a pain.
05:23
< Tarinaky>
aka actually making it happen and work.
05:31
<@ToxicFrog>
Rhamphoryncus: indeed; the binding is for Pilot, which is a cluster computing library.
05:32
<@ToxicFrog>
Tarinaky: I recommend starting with a simple input language (say, arithmetic expressions) and a comfortable implementation language.
05:38 * Vornicus-Latens is writing a simple dice calculator in Javascript. It's not too horrible but wishes he could use more up-to-date js constructs.
05:47 Vornicus-Latens is now known as Vornicus
06:08 Orthia is now known as Reivthia
06:16 Alek [omegaboot@Nightstar-43b26dbc.emhril.sbcglobal.net] has quit [Ping timeout: 121 seconds]
06:16 Alek [omegaboot@Nightstar-43b26dbc.emhril.sbcglobal.net] has joined #code
06:22 AnnoDomini [farkoff@Nightstar-664ef57c.adsl.tpnet.pl] has joined #code
06:22 mode/#code [+o AnnoDomini] by Reiver
07:43
< Reivthia>
Unity, a mid-level game engine went from $200 to freeware. http://www.gamasutra.com/php-bin/news_index.php?story=25840
07:45
<@McMartin>
That's the engine that Off-Road Velociraptor Safari was written in, IIRC.
07:47
< Namegduf>
"We get the most incredible emails. One of the most recent was, "I've been using Unity for four days now, and I've regained my faith in humanity.""
07:48
< Namegduf>
That's some engine.
08:07
< Alek>
http://www.thinkgeek.com/homeoffice/gear/69e3/
08:09
<@AnnoDomini>
http://i49.tinypic.com/2hi5bmw.jpg
08:10
< Namegduf>
It's beautiful.
08:10
< Alek>
*drool*
08:13
<@Vornicus>
...want.
08:27 Vornicus is now known as Vornicus-Latens
08:49 You're now known as TheWatcher
08:54
< Rhamphoryncus>
I want too :(
08:54
< Rhamphoryncus>
too damn many d20s though
08:59 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has quit [Client exited]
09:21 []KSM[] [sabocx1@4F2848.C13050.A99B35.082CF3] has joined #code
09:22 []KSM[] [sabocx1@4F2848.C13050.A99B35.082CF3] has quit [[NS] Quit: Allaha emanet olunuz]
10:09 Kazriko [kaz@Nightstar-e09690fa.client.bresnan.net] has quit [Ping timeout: 121 seconds]
10:11 Kazriko [kaz@Nightstar-e09690fa.client.bresnan.net] has joined #code
10:11 mode/#code [+o Kazriko] by Reiver
10:23 Kazriko [kaz@Nightstar-e09690fa.client.bresnan.net] has quit [Ping timeout: 121 seconds]
10:26 Kazriko [kaz@Nightstar-e09690fa.client.bresnan.net] has joined #code
10:26 mode/#code [+o Kazriko] by Reiver
10:30 Attilla [The.Attilla@FBC920.173C5E.100391.EDA60F] has joined #code
10:30 mode/#code [+o Attilla] by Reiver
11:11 Tarinaky [Tarinaky@Nightstar-36cc341d.adsl.virginmedia.net] has quit [Operation timed out]
11:26 Tarinaky [Tarinaky@Nightstar-4581f9e3.adsl.virginmedia.net] has joined #code
11:41 You're now known as TheWatcher[afk]
13:15 You're now known as TheWatcher
13:22 Reivthia [Orthianz@Nightstar-434d5305.xnet.co.nz] has quit [Client closed the connection]
13:26 Tarinaky [Tarinaky@Nightstar-4581f9e3.adsl.virginmedia.net] has quit [Ping timeout: 121 seconds]
13:28 Orthia [Orthianz@Nightstar-434d5305.xnet.co.nz] has joined #code
13:49 Tarinaky [Tarinaky@Nightstar-c9ef4d19.adsl.virginmedia.net] has joined #code
14:06 Tarinaky_ [jes55@Nightstar-203b3f66.le.ac.uk] has joined #code
14:35 AnnoDomini [farkoff@Nightstar-664ef57c.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
14:41 AnnoDomini [farkoff@Nightstar-90078c48.adsl.tpnet.pl] has joined #code
14:41 mode/#code [+o AnnoDomini] by Reiver
15:05 SmithKurosaki [Smith@Nightstar-6450f657.dsl.teksavvy.com] has quit [Connection closed]
15:05 SmithKurosaki [Smith@Nightstar-6450f657.dsl.teksavvy.com] has joined #code
15:11 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
15:23 Tarinaky_ [jes55@Nightstar-203b3f66.le.ac.uk] has quit [Connection closed]
15:25
< EvilDarkLord>
Hmm. I need a probability distribution. I am tossing a coin with heads-probability p. I do this N times. I need the distribution for number of heads.
15:29
<@ToxicFrog>
Binomial
15:30
< EvilDarkLord>
Heh, was just gonna say I found it.
15:31
<@ToxicFrog>
p(X==k) == (N choose k)(p^k)(1-p)^(N-k); mean == Np; variance == Np(1-p)
15:32
< EvilDarkLord>
Yeah, variance was what I was looking for, specifically to get the standard deviation.
15:32 * EvilDarkLord is making a machine to prove that BPP is closed under union, whoo.
15:55
<@MyCatVerbs>
You can approximate it as Poisson if p is really small and N is really huge.
16:09 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
16:10 Syloqs_AFH is now known as Syloqs-AFH
16:42 Orthia [Orthianz@Nightstar-434d5305.xnet.co.nz] has quit [Ping timeout: 121 seconds]
17:01 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has joined #code
18:03 Tarinaky [Tarinaky@Nightstar-c9ef4d19.adsl.virginmedia.net] has quit [Ping timeout: 121 seconds]
18:05 Tarinaky [Tarinaky@Nightstar-c9ef4d19.adsl.virginmedia.net] has joined #code
18:12 Tarinaky [Tarinaky@Nightstar-c9ef4d19.adsl.virginmedia.net] has quit [Ping timeout: 121 seconds]
18:20 Alek [omegaboot@Nightstar-43b26dbc.emhril.sbcglobal.net] has quit [Ping timeout: 121 seconds]
18:25 Alek [omegaboot@A2BA3E.D9488C.F9D513.75250A] has joined #code
18:28 Tarinaky [Tarinaky@Nightstar-2c697041.adsl.virginmedia.net] has joined #code
18:39 Finale [c0cb88fe@Nightstar-14e5d099.mibbit.com] has joined #code
18:41 Alek [omegaboot@A2BA3E.D9488C.F9D513.75250A] has quit [Ping timeout: 121 seconds]
18:41 Alek [omegaboot@Nightstar-fe3154d1.emhril.sbcglobal.net] has joined #code
18:48 Derakon[work] [Derakon@Nightstar-d44d635e.ucsf.edu] has joined #code
18:54 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Connection reset by peer]
18:54 Tarinaky [Tarinaky@Nightstar-2c697041.adsl.virginmedia.net] has quit [Ping timeout: 121 seconds]
18:54 Tarinaky [Tarinaky@Nightstar-2c697041.adsl.virginmedia.net] has joined #code
19:09 Derakon[work] [Derakon@Nightstar-d44d635e.ucsf.edu] has quit [[NS] Quit: Leaving]
19:11 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
19:11 mode/#code [+o ToxicFrog] by Reiver
19:42 Attilla [The.Attilla@FBC920.173C5E.100391.EDA60F] has quit [Ping timeout: 121 seconds]
20:39 Derakon[work] [Derakon@Nightstar-d44d635e.ucsf.edu] has joined #code
20:58 aoanla [aoanla@Nightstar-7ecf71dc.range81-152.btcentralplus.com] has joined #code
21:00
< Finale>
http://mibbit.com/pb/KHob3B
21:00 Derakon[work] [Derakon@Nightstar-d44d635e.ucsf.edu] has quit [[NS] Quit: Leaving]
21:19 crem [moo@Nightstar-8ca3eea7.adsl.mgts.by] has quit [Client closed the connection]
21:24 crem [moo@Nightstar-8ca3eea7.adsl.mgts.by] has joined #code
22:00 AnnoDomini [farkoff@Nightstar-90078c48.adsl.tpnet.pl] has quit [[NS] Quit: To Annwn with you!]
22:03 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Client closed the connection]
22:07
<@McMartin>
Man, what the Hell, Windows.
22:08
<@McMartin>
Introduced in Windows 2000: API calls that let you get thread IDs of stuff happening in other processes.
22:08
<@McMartin>
API calls that let you get the process id a thread id is running in: added in Windows Vista
22:25
<@Vornicus-Latens>
Pfffff
22:33 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
22:33 mode/#code [+o ToxicFrog] by Reiver
22:52 Attilla [The.Attilla@FBC920.58502B.4333E1.7847A1] has joined #code
22:52 mode/#code [+o Attilla] by Reiver
23:01 aoanla [aoanla@Nightstar-7ecf71dc.range81-152.btcentralplus.com] has quit [[NS] Quit: Leaving.]
23:15 Vornicus-Latens is now known as Vornicus
23:41 Orthia [Orthianz@Nightstar-4a7ee6d5.xnet.co.nz] has joined #code
23:47 User [User@Nightstar-de39499c.mc.videotron.ca] has joined #code
23:48 User [User@Nightstar-de39499c.mc.videotron.ca] has left #code []
--- Log closed Thu Nov 19 00:00:55 2009
code logs -> 2009 -> Wed, 18 Nov 2009< code.20091117.log - code.20091119.log >