code logs -> 2011 -> Sat, 12 Nov 2011< code.20111111.log - code.20111113.log >
--- Log opened Sat Nov 12 00:00:31 2011
--- Day changed Sat Nov 12 2011
00:00 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
00:25
< celticminstrel>
....whoooa...
00:25
<@McMartin>
* Fixed a bug where trying to play the game caused some users to hear dark whispers from beyond space and time never meant for mortal ears
00:26 * celticminstrel just saw the magic square Derakon linked this morning.
00:43<~Vornicus> What game was that?
00:44
<@McMartin>
Jamestown.
00:44 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [[NS] Quit: Well, most things get better when I kick them!]
00:45
< celticminstrel>
I have no idea what it means.
00:45<~Vornicus> Nor I, but there you go.
00:46
<@McMartin>
It's with a bunch of other "fixed audio glitch in certain configurations" bugs
00:46
<@McMartin>
I'm guessing one of them opened a portal to the Crawling Chaos
00:49 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
01:04 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Z?]
02:03 Derakon is now known as Derakon[AFK]
02:26 * McMartin ...s at this abstraact
02:26
<@McMartin>
http://www.iro.umontreal.ca/~boucherd/mslug/meetings/20041020/minutes-en.html
02:26 Attilla [Obsolete@Nightstar-f29f718d.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
02:33<~Vornicus> That is a worrying abstract.
02:34 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
02:44
<@Alek>
why, Vorn?
02:45
<@Tamber>
...oh dear.
02:45
<@McMartin>
I'm hoping this will teach me how the Hell call/cc actually works~
02:47
<@Tamber>
ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
02:47
<@Alek>
do I have to know Scheme to get it? >_>
02:47
<@Tamber>
...er. No, don't do that alias here, y'bugger.
02:47 * Tamber menaces irssi with a pointy stick
02:48
<@McMartin>
Tamber: You have an alias to respond to That Primitive with that?
02:49
<@Tamber>
No, I'm just suffering "fingers spazzing at the keyboard and apparently setting off aliases"
02:49
<@McMartin>
Oh
02:49
<@Tamber>
But, yes; I have an alias for that. It saves /so much typing time/.
02:49
<@McMartin>
Well, I was thinking that you had an alias that automatically intoned it upon encountering "call/cc", as it is in fact the name of an Elder God that lies sleeping
02:49
<@Tamber>
...you mean it /isn't/?
02:50
<@McMartin>
I never said it wasn't
02:50
<@Alek>
ahahaha
02:50
<@McMartin>
That's why the idae that you had a script to autoreact with that was so plausible~
02:50
<@McMartin>
*idea
02:50
<@Tamber>
hehe
02:54
<@McMartin>
Yargh
02:55
<@McMartin>
OK, here they give call/cc in us
02:55
<@McMartin>
*use
02:55
<@McMartin>
The "nonlocal escape" one is easy enough
02:55
<@McMartin>
The second example looks distressingly like monads
02:55
<@ToxicFrog>
<3 call/cc
02:55
<@McMartin>
wg'anagl
02:56
<@McMartin>
Oh, right, duh, that's how you do tail calls in C
02:56
<@McMartin>
(Rewrite your program so that it looks like a CPS compiler had a go at it, basically)
02:57
<@McMartin>
(CPS being "continuation-passing style", a much less mystical construct than call/cc)
03:00 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [[NS] Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
03:00
<@McMartin>
This backtraacking example on page 10-11 is making my brain melt
03:00
<@McMartin>
(let ((save fail)) (set! fail (lambda () (set! fail save) ...
03:03 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
03:09 Kindamoody[zZz] is now known as Kindamoody
03:18 * McMartin writes out 20 lines of Scheme, longhand
03:18
<@McMartin>
My puzzle for tonight is to figure out how it does what it does.
03:28 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
03:28
<@Tamber>
Without using the word "Magic"?
03:29
<@McMartin>
Right. I need to simulate it.
03:29
<@McMartin>
*what it does* is actually pretty easy to work out
03:30
<@McMartin>
http://pastebin.starforge.co.uk/491
03:30
<@McMartin>
It's hunting for a Pythagorean triple
03:30
<@McMartin>
It's the mechanics behind in-range that are kinking my mind.
03:33 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
03:34 Syloqs_AFH is now known as Syloqs-AFH
03:38
<@ToxicFrog>
I can follow until the (set! fail) stuff starts up.
03:38 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
03:43 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
03:44 Syloqs_AFH is now known as Syloqs-AFH
03:54
<@McMartin>
Yeah, the thing is, if I lose that, I lose the continuation
03:55
<@McMartin>
That's modifying a global in something that is almost but not quite a sta ck discipline
03:55
<@McMartin>
So I quite literally lose the plot
03:56
<@McMartin>
It works, though, and Gambit understands shebangs, so you can make scripts in Scheme. >:)
04:14
<@McMartin>
OK, so, I can tell where my first intuitive misconception is
04:14
<@McMartin>
To wit, Scheme is in fact imperative, and as such, when you re-invoke a continuation, this does not restore the original state.
05:07
< sshine>
huh.
06:12 Vornicus is now known as Vornicus-Latens
06:30 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [[NS] Quit: Well, most things get better when I kick them!]
06:35 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
06:51 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
07:03
<@kazrikna>
Ok, this guake terminal is pretty cool...
07:03
<@Tamber>
"guake"?
07:05
<@ToxicFrog>
Quake-style dropdown terminal, except it's a tabbed bash shell rather than game console.
07:05
<@ToxicFrog>
Yakuake is the KDE equivalent.
07:05
<@ToxicFrog>
(there's also Tilda, which doesn't actually work)
07:05
<@Tamber>
Ahhhh.
07:06
<@ToxicFrog>
It's damn useful.
07:06
<@Tamber>
That sounds rather handy.
07:06
<@Tamber>
Rather useless to me, though; since I spent most of my time /in/ a terminal... XD
07:10 ErikMesoy|sleep is now known as ErikMesoy
07:11 Kindamoody is now known as Kindamoody|out
07:16 Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [Ping timeout: 121 seconds]
07:18 Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code
07:39 You're now known as TheWatcher
07:50
<@kazrikna>
I spend a lot of time in terminals too, but having another one on the f11 key is nice.
07:52
<@jerith>
CMD+CTRL+t gives me a fresh terminal :-)
07:53
<@kazrikna>
That's too many hotkeys, and sometimes I want the same terminal. :)
07:53
<@kazrikna>
er, f12. f11 is full screen. :)
07:54
<@jerith>
I usually have several terminals scattered about.
07:54 * kazrikna needs to setup NIS at some point.
07:54 Derakon[AFK] is now known as Derakon
07:54
<@kazrikna>
I have 3 up not counting that one... one for yosuke. one for axel, and one for asagi.
07:54 * Tamber has tmux.
07:54
<@jerith>
Three on this workspace, and it's just my flash-games-and-IRC space.
07:54
<@Tamber>
:p
07:55
<@jerith>
Another three on the next workspace, which is work-work. (And one of theose has a pair of tabs in it -- the only place I ever use tabbed terminals.)
07:55
<@kazrikna>
This E350 desktop system is working out pretty well.
07:56
<@kazrikna>
I get to sleep-mode the power sucking behemoth more now.
08:02 Derakon is now known as Derakon[AFK]
08:04
<@McMartin>
By Jove, I think I've got it
08:05 * McMartin makes the connection between call/cc and the resulting continuation, and setjmp/lngjmp.
08:05
<@Tamber>
The little light comes on?
08:05 * McMartin is not sure
08:05 * McMartin must TEST
08:05
<@McMartin>
With horrible repl abuse!
08:06
<@McMartin>
... I think I *do* got it.
08:07
<@Tamber>
:)
08:07
<@McMartin>
(define c #f)
08:07
<@McMartin>
(+ (call/cc (lambda (f) (set! c f) (f 3))) 10)
08:07
<@McMartin>
Evaluates to 13.
08:07
<@McMartin>
And now c is a function that adds 10 to its argument and dumps you back to the repl.
08:08
<@McMartin>
That doesn't mean I get the code I pastebinned earlier, which does horrible things with globals to mutate the continuations themselves
08:12
<@McMartin>
The other thing I hadn't really internalized?
08:12
<@McMartin>
continuations aren't really functions. Calling them doesn't put them next on the stack, it replaces the stack entirely.
08:12
<@McMartin>
As a side effect of this, continuation calls never return.
08:13
<@McMartin>
But this is also why calling it multiple times makes sense; they're a super-GOTO. A lngjmp, with a value to drop in as the result of the call/cc form itself.
08:17
<@McMartin>
And I *think* I see how one could make coroutines work, except for the part where I've never managed to give a shit about coroutines.
08:17
<@jerith>
But coroutines are /awesome/!
08:17
<@jerith>
They're the /best/!
08:17
<@McMartin>
The problem is, the only thing I can think of to do with them is reimplement generators
08:18
<@McMartin>
And there are at least three better ways to implement generators in Scheme.
08:18
<@jerith>
And as soon as I figute out why, I'll let you know...~
08:18 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
08:18
<@jerith>
In Python, there are people who want to implement coroutines with generators.
08:18
<@TheWatcher>
jerith: they make your code even harder to follow, and madness inducing? Got to be awesome, right?
08:19
<@jerith>
... says the Perl hackr. :-P
08:19
<@McMartin>
TheWatcher: Perhaps the same could be said of all multithreaded processes
08:19
<@McMartin>
</Dracula>
08:20
<@TheWatcher>
jerith: :P
08:20
<@McMartin>
More seriously, I had this thought process
08:20
<@McMartin>
"I bet I could prove my mastery of call/cc by doing a coroutine algorithm using continuations instead"
08:21
<@McMartin>
"A coroutine algorithm like..."
08:21
<@McMartin>
"..."
08:21
<@McMartin>
"..."
08:21
<@jerith>
A parser's state machine?
08:22 * McMartin was hoping for a smaller example.
08:22 * McMartin laughs at this sequence, from the point of view of a PC.
08:22
<@McMartin>
" Jason Watts' computer is known as Morgoth. "Morgoth, Lord of Darkness," is strictly speaking, your full title, though when you can get away with it, you introduce yourself to other computers only by your I.P. Address (72.36.475.789). This has given you, among the PCs on the local networks, a reputation for being distant and aloof."
08:23
<@McMartin>
"This is unfortunate, but necessary. After all, it is better to be known as distant and aloof than to be known as Morgoth."
08:23 * jerith grins.
08:24
<@jerith>
Coroutines are handy for non-blocking event-driven code.
08:24
<@McMartin>
"You are in Jason's desktop. This is where you spend most of your time, when you're not sent off to gather cute videos of cats or photos of scantily clad alien princesses."
08:24
<@jerith>
Like Twisted.
08:24
<@McMartin>
Hrm
08:25
<@McMartin>
So, part of the trick here is that I don't really have access to real multithreading
08:25
<@McMartin>
So I can hand off control between different stacks, but everyone's always doing something.
08:25
<@jerith>
Do you have a select() loop or the equivalent?
08:26
<@McMartin>
If I want one, I guess I could write one.
08:26
<@McMartin>
(call/cc is absurdly general)
08:26
<@jerith>
I've been writing a lot of Twisted code using @inlineCallbacks recently.
08:26
<@McMartin>
Mmm.
08:26 * McMartin will have to think on this.
08:27
<@McMartin>
Part of the problem is that I'm still thinking very functionally
08:27
<@jerith>
That uses a wrapper around a generator as a hack to let you write your code as a single imperative flow rather than a long series of callback functions.
08:27
<@McMartin>
And I'm not convinced that this is a good idea if I'm doing continuation-passing anything, since continuations are excruciatingly imperative as soon as you violate stack discipline.
08:27 * TheWatcher adds portals to McM's code
08:28
<@jerith>
(The long series of callbacks has its place, but not when you have a ten line function that needs to wait for I/O six times.)
08:31
<@jerith>
(This is partly Python's fault -- there's a lot of syntactic overhead in a function definition.)
08:31
<@McMartin>
(Fuck callback code)
08:31
<@McMartin>
(I've had to write programs that use pulseaudio's API)
08:31
<@McMartin>
(It's the worst thing ever; you have to define it top down in reverse order, more or less)
08:31
<@jerith>
(That's pulseaudio, though.)
08:32
<@McMartin>
(It's as well designed as a callback system can be for that)
08:32
<@McMartin>
("Do X; this is your callback function to call when X is done")
08:32
<@McMartin>
(Combine that with the requirement of declaration before use and you're declaring the sequence in reverse order.)
08:32 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code
08:32
<@jerith>
I like Twisted's approach better.
08:33 * kazrikna thinks he did something once where he used event objects and had the callbacks just clear the events to allow the main thread to proceed...
08:33
<@jerith>
The function you're calling returns a deferred and you add callbacks to that.
08:36 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
08:37
<@McMartin>
jerith: Hm. I think the issue here is that the idea is that, in straight-line synchronous code, you'd be writing a(); b(); c();
08:38
<@jerith>
a().addcallback(b).addcallback(c)
08:39
<@McMartin>
Hm
08:39
<@McMartin>
That sounds based on your answer of this, that addcallback() doesn't work the way I'd guess~
08:39 * McMartin would first read that as calling b *and* c when a completed.
08:39
<@jerith>
Correct.
08:39
<@McMartin>
But that is not what we want
08:40
<@jerith>
Except the deferred does a nifty little trick when something in the callback chain returns a deferred.
08:40
<@jerith>
Err, wait. I misunderstood.
08:40
<@jerith>
The callbacks are chained, not concurrent.
08:40
<@McMartin>
Basically, the idea here is "I want you to set the volume to X, then play this WAV file, then play this other WAV file"
08:41
<@jerith>
A callback function gets the result of the previous step as its parameter.
08:41
<@McMartin>
main calls setVolume with a() as the completion callback, which plays the first WAV file with b() as the completion callback, which plays the final wave file with c() as the completion callback.
08:42
<@jerith>
In Twisted-land, setVolume(), a(), b(), etc. all return deferreds.
08:42
<@McMartin>
Well
08:42
<@McMartin>
setVolume() and playWav()
08:42
<@jerith>
Ah, right.
08:42
<@McMartin>
a(), b(), and c() are just because we need to place the calls in something.
08:43 * kazrikna sticks the beast in sleep mode, then goes to sleep himself...
08:43
<@jerith>
You'd probably need a wrapper around playWav() to make it a suitable callback.
08:44
<@McMartin>
Yeah. The nature of audio playback makes it intrinsically full of spiders, unless you're making it *very* restricted.
08:44
<@jerith>
so setVolume().addCallback(lambda _: playWav("foo.wav")).addCallback(lambda _: playWav("bar.wav"))
08:45
<@jerith>
You could move the parens to tack the final callback onto the end of the playWav() call instead. In this case, it makes not difference, but sometimes it does.
08:45
<@jerith>
*no
08:47
<@jerith>
A deferred is a very simple beast.
08:47
<@McMartin>
getting to have lambdas helps a lot.
08:47
<@jerith>
Python's lambdas are restrictive enough that they aren't all that useful here.
08:47
<@jerith>
You typically see something more like:
08:47
<@jerith>
d = doSomething()
08:48
<@jerith>
def _cb(result):
08:48
<@jerith>
foo(result)
08:48
<@jerith>
return bar(result)
08:48
<@jerith>
d.addCallbakc(_cb)
08:48
<@jerith>
Or whatever.
08:49
<@jerith>
.addCallback() just adds the callable to the callback queue.
08:50
<@jerith>
when something calls .callback(result) (typically the thing that's delivering your result), each callback in the queue is called in turn with the result of the previous one.
08:51
<@jerith>
If you add a callback to a deferred that has already fired, it gets called immediately.
08:52
<@McMartin>
Those aren't callbacks in my book; they're futures
08:52
<@McMartin>
THough "deferred" sounds like that too
08:52
<@jerith>
The deferred is the future.
08:58
<@McMartin>
Yeah, they sound identical
09:16 You're now known as TheWatcher[afk]
09:51 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
10:03 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Moo]
11:13 Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has quit [Client exited]
11:25 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
11:33 Attilla [Obsolete@Nightstar-f29f718d.cable.virginmedia.com] has joined #code
12:58 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
13:32
<@McMartin>
Yay
13:32
<@McMartin>
So, the Object Management Group may not have a Web Task Force
13:33
<@McMartin>
But WebKit - the renderer behind Safari and Chrome - does have a Web Template Framework.
13:35
<@AD[Shell]>
Anyone know how to add something to the PATH on FreeBSD? Possibly permanently for a user.
13:40
<@McMartin>
extending the lines that do it in .login or .bash_profile isn't working for you?
13:41
<@AD[Shell]>
I was trying "PATH = $PATH:~" and similar but that error'd out.
13:41
<@McMartin>
Er
13:41
<@McMartin>
What's their shell?
13:41
<@McMartin>
Oh, but
13:41
<@McMartin>
Don't use ~
13:41
<@McMartin>
Use $HOME
13:41
<@AD[Shell]>
How do I tell?
13:42
<@McMartin>
"w" should reply with various things running on the machine
13:42
<@McMartin>
Your user should have at least one marked "bash" or "tcsh" or something.
13:42
<@McMartin>
Anyway
13:42
<@McMartin>
The last two lines of my ~/.bash_profile are
13:42
<@McMartin>
PATH=$PATH:$HOME/bin
13:42
<@McMartin>
export PATH
13:43
<@McMartin>
That's for bash, the default shell these days.
13:43
<@AD[Shell]>
"w | grep abudhabi" reports only irssi.
13:44
<@AD[Shell]>
This is a shell account, BTW. Shellmix.com, specifically.
13:45
<@McMartin>
So, you shouldn't have spaces in your assignment statements
13:45
<@McMartin>
It should be PATH=$PATH:$HOME
13:45
<@McMartin>
And you'll need to export it or it won't stick
13:45
<@McMartin>
Do you have a file ~/.bash_profile? It won't show up in ls.
13:46
<@AD[Shell]>
I get this error specifically: "Bad : modifier in $ ($)."
13:46
<@AD[Shell]>
I did not have this file, but I created it.
13:46
<@AD[Shell]>
. .cshrc .login_conf .profile .rhosts irc public_html
13:46
<@AD[Shell]>
.. .irssi .mail_aliases .profile.save .shrc keep tmp_php_session
13:46
<@AD[Shell]>
.bash_profile .login .mailrc .profile.save.1 PLEASE_CLICK_ON_ADVERTISEMENT_AT_Shellmix.com maildir tmp_php_upload
13:46
<@AD[Shell]>
That's my ls.
13:52 * AD[Shell] solves the issue by finding out that ~/bin is already in PATH, puts script he was using in there.
14:01 Stalker [Z@Nightstar-5aa18eaf.balk.dk] has joined #code
14:16 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
15:03 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
15:46 Kindamoody|out is now known as Kindamoody
16:13 AnnoDomini [annodomini@Nightstar-f7eedefa.80-203-17.nextgentel.com] has joined #code
16:37 Kindamoody is now known as Kindamoody|DVD
17:38 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
17:41 Lingerance is now known as Shoat
17:59 ErikMesoy is now known as Crowns
18:05 AnnoDomini is now known as Birds
18:17 Kindamoody|DVD is now known as Kindamoody
18:31 Kindamoody is now known as Kindamoody[zZz]
18:59
<@ToxicFrog>
God my C is rusty
19:25
< Eri>
It's all that salt in the C
19:25
< Eri>
Corrodes everything
19:29
< celticminstrel>
Heh
21:07 Crowns is now known as ErikMesoy
21:07 Birds is now known as AnnoDomini
22:32 ErikMesoy is now known as ErikMesoy|sleep
22:38 Derakon[AFK] is now known as Derakon
22:51
<@McMartin>
OK, I think I finally understand that code I pastebinned
23:05 You're now known as TheWatcher
23:10 * ToxicFrog gets around to finally writing Enceladus
23:28
<@TheWatcher>
?
23:32
<@McMartin>
A half-finished project I wrote ages ago to teach myself Lua
23:32
<@McMartin>
Basically a static linker for Lua bytecode.
23:33<~Vornicus-Latens> You decided to teach yourself Lua, by writing a linker for it.
23:33
< Eri>
Heh
23:34<~Vornicus-Latens> McM, you are a twisted creature.
23:34
<@Tamber>
XD
23:34 Vornicus-Latens is now known as Vornicus
23:34
<@ToxicFrog>
McMartin: I hope you don't mind me using the name
23:36
<@McMartin>
Not at all
23:36
<@McMartin>
It is the most appropriate name for "freeze for Lua"~
23:37
<@McMartin>
Vornicus: It was more "I want to write something" -> "I want to write something I can post and that people will be able to use without installing Lua in their own right, on Windows" -> "And it'd be nice if it were all one file, so we can do the 'header files full of bytes' trick to link it into the data segment" -> "This is work" -> "I guess this is my first project, then"
23:38
<@McMartin>
I don't even remember what the original project was going to *be*.
23:38<~Vornicus> heh
23:44 kwsn is now known as kw-drag-show
--- Log closed Sun Nov 13 00:00:02 2011
code logs -> 2011 -> Sat, 12 Nov 2011< code.20111111.log - code.20111113.log >

[ Latest log file ]