code logs -> 2013 -> Tue, 12 Feb 2013< code.20130211.log - code.20130213.log >
--- Log opened Tue Feb 12 00:00:26 2013
00:21 Attilla [Attilla@Nightstar-aced750e.range86-184.btcentralplus.com] has quit [Ping timeout: 121 seconds]
00:36 Derakon[AFK] is now known as Derakon
01:00
<~Vornicus>
hm. apparently I misunderstand some parts of the automation process.
01:01
<@celticminstrel>
I think I may have gotten to the point where I can save to JSON.
01:01
<@celticminstrel>
And restore without loss.
01:02
<@celticminstrel>
It's slightly fiddly (I have to do a little preprocessing due to cycles), but I think it will work. I guess that means it's time to try it.
01:03
<@celticminstrel>
I imagine restoring will be somewhat harder though, since I need to reconstruct most of the classes (since JSON doesn't store any information about prototypes).
01:03
<@celticminstrel>
s/classes/objects/
01:03
<@celticminstrel>
$.extend should help.
01:11
<~Vornicus>
Inserters don't seem to like putting things onto conveyor belts.
01:12
<@celticminstrel>
Or I suppose I could just assign obj.__proto__...
01:13
<~Vornicus>
nor taking things off of conveyor belts except at terminuses.
01:14
<~Vornicus>
Which means, at least in the demo, every time I have a place I want to send coal I need a coal miner, because splitting it doesn't seem to work.
01:17
<&ToxicFrog>
Factorio?
01:17
<&ToxicFrog>
Oh this looks relevant to my interests
01:18
<&McMartin>
Is this like Manufactoria?
01:18
<~Vornicus>
Um, not really
01:19
<@celticminstrel>
Speaking of Manufactorwhatsit, does it exist as a downloadable thing?
01:21
<&ToxicFrog>
Not as such, but I think if you download http://pleasingfungus.com/Manufactoria/Manufactoria.swf it'll run standalone in flashplayer or a browser.
01:22
<~Vornicus>
Factorio: topdown mine/build game, emphasis apparently on automation, though as yet I haven't gotten the automation to work quite the way I want.
01:23 * celticminstrel downloads, discovers that for some reason it works in the browser but not in flash player.
01:24
<@celticminstrel>
For a cursory definition of "works".
01:25
<~Vornicus>
many flash games load more files to get anything going.
01:35
<~Vornicus>
oh there it goes. Now I feel silly.
01:37 You're now known as TheWatcher[T-2]
01:40 * Vornicus figures out what he's supposed to do.
01:41 You're now known as TheWatcher[zZzZ]
01:50
<~Vornicus>
okay, problem 1 that I was having: I forgot to actually use the inserter to get stuff into the chest, so of course stuff wasn't being pulled out. problem 2: boilers will only automatically pull coal into themselves up to a maximum of 5, so my already-loaded boilers didn't need it.
01:56 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
02:00
<~Vornicus>
so it looks like what i need to do, approximately, is load coal onto a conveyor belt that goes past all of my boilers and furnaces. Not too bad.
02:02 syksleep is now known as Syk
02:09 VirusJTG_ [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
02:12 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds]
02:12 * Vornicus sets up a conveyor belt sushi bar.
02:14 * Syk sits on the conveyor
02:16
<@celticminstrel>
Hm, I have run into a minor problem. Disabling cookies means local storage is disabled, and I can't find a way to whitelist local files in the way websites can be whitelisted.
02:16
<@celticminstrel>
Meaning that I may not be able to test saving without uploading to a server...
02:20
<@celticminstrel>
(Or enabling cookies globally.)
02:25
<@celticminstrel>
The path of a local cookie seems to be the empty string (as seen if I globally enable cookies and execute "document.cookie='test=5'").
02:26
<@celticminstrel>
So maybe if I can hack that into the exceptions list somehow...
02:35
<@celticminstrel>
...I think I must've accidentally deleted all my cookies somehow. Oh well.
02:36 Reiv [NSwebIRC@A3BDC3.5BE3EC.B8847E.5ADB9D] has left #code [""]
02:48
<~Vornicus>
conveyor belt sushi bar: not that efficient. if you don't have enough consumers for everything being placed on the conveyor, it clogs up.
02:48
<~Vornicus>
In particular this means that I need a lot more coal consumers.
02:49
<&ToxicFrog>
...coal sushi
02:49
<&ToxicFrog>
no, do not want
02:49
<@celticminstrel>
XD
02:50
<~Vornicus>
ToxicFrog: it's what it reminded me of. Stuff goes by, if the consuming devices want it they'll eat it.
02:50 McMartin [mcmartin@Nightstar-dd154052.pltn13.sbcglobal.net] has quit [[NS] Quit: Kernel upgrade]
02:51
<~Vornicus>
But one coal mine is currently more than sufficient for my needs, so the coal gets onto the conveyor and never leaves.
02:53
<~Vornicus>
and then if the conveyor is full the stuff stops, so occasionally i need to take coal off it.
02:56 Xon [Xon@Nightstar-362effcc.highway1.net.au] has quit [Connection closed]
02:56 Xon [Xon@Nightstar-362effcc.highway1.net.au] has joined #code
02:58 McMartin [mcmartin@Nightstar-dd154052.pltn13.sbcglobal.net] has joined #code
02:58 mode/#code [+ao McMartin McMartin] by ChanServ
03:01 Kindamoody[zZz] is now known as Kindamoody
03:03
<@celticminstrel>
...I just restarted Firefox and lost all my tabs. Is there anything I can do to restore them?
03:07
<&Derakon>
History -> Restore Previous Session.
03:08
<@celticminstrel>
It's greyed out.
03:08
<@celticminstrel>
So is "Show my windows and tabs from last time" in the preferences.
03:10
<@celticminstrel>
I found a sessionstore.bak that appears to possibly contain the data, but it's ignored if I rename a copy to .js
03:12
<&Derakon>
Sorry, got me then.
03:12
<@celticminstrel>
Hm. I may have accidentally told it not to save history...
03:13
<@celticminstrel>
It seems to be fixed now, roughly.
03:13
<@celticminstrel>
Well, maybe not roughly.
03:13
<@celticminstrel>
Different tab is selected from before, but it looks like the same ones exist.
03:14
<@celticminstrel>
I'm not sure what I did, but I guess I undid it, so yay?
03:16
<@celticminstrel>
Also, my attempt to hack in a cookie exception for an empty host appears to be a failure. That is, it has no effect.
03:17
<@celticminstrel>
Does anyone have any idea how to make Firefox accept cookies in local files when they're disabled globally?
03:17
<@celticminstrel>
It seems the only way is to temporarily enable them.
03:17
<@celticminstrel>
Globally.
03:19
<@celticminstrel>
This is probably related: https://bugzilla.mozilla.org/show_bug.cgi?id=440973
03:20
<@celticminstrel>
Of course, that doesn't help me, since it's not even confirmed.
03:22
<@celticminstrel>
Well, I suppose I could always just put the thing on localhost.
03:22
<@celticminstrel>
Still, it's kinda annoying that there's no way to whitelist local file cookies.
03:23
<@celticminstrel>
Oh, I found another bug report that's probably related. https://bugzilla.mozilla.org/show_bug.cgi?id=507361
03:23
<@celticminstrel>
Though it's marked as fixed, so maybe not. I dunno.
03:33
<@celticminstrel>
Oh, that bug was about local storage not working at all, so it's somewhat related but not quite what I want.
03:54
<@celticminstrel>
Now I'm trying to figure out why it 403s. I have an Alias directive and a <Directory> block.
03:55
<@celticminstrel>
Oh hey, a google result.
03:55
<@celticminstrel>
...logs. I should check them.
03:56 * Azash greets celticminstrel
03:56
<@celticminstrel>
Hello.
03:56 * celticminstrel determines the logs to be utterly useless.
03:56
<@celticminstrel>
Well, unless that 13 has a magic meaning.
03:57
<&ToxicFrog>
It might.
03:57
<&ToxicFrog>
But probably doesn't.
03:59
<@celticminstrel>
Incidentally, permissions are 644.
04:00
<@celticminstrel>
Which seems slightly odd, considering the files aren't in any folder that's normally public, but that's beside the point.
04:10 VirusJTG_ [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
04:11 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has quit [[NS] Quit: Leaving]
04:14 * Vornicus fiddles with it some more.
04:23
<~Vornicus>
Looks like a lot of the problems I ran into get fixed after the demo finishes.
04:40
<@celticminstrel>
Apparently the issue was that execute permission is needed on parent folders.
04:41
<@celticminstrel>
This seems vaguely odd, but whatever.
04:43
<~Vornicus>
folder execute permission is needed to list them
04:43
<&ToxicFrog>
On directories, execute permission is "traverse", i.e. the ability to cd into the director or access its contents
04:44
<&ToxicFrog>
(read permission is for listing, IIRC - read but not execute lets you list the contents but not access them, execute but not read lets you access the contents but only if you know their names ahead of time)
04:44 * Vornicus had it backwards
04:44 * Vornicus hasn't really futzed with permissions in a while
04:44
<@celticminstrel>
But, it doesn't need to list the parent directory of the aliased directory, does it?
04:45 JustBob [justbob@ServerAdministrator.Nightstar.Net] has quit [Connection reset by peer]
04:45
<@celticminstrel>
Oh wait. I see.
04:45
<@celticminstrel>
Setting execute to true doesn't allow the files to be listed, then.
04:47 JustLurk [justbob@ServerAdministrator.Nightstar.Net] has joined #code
04:53 JustLurk is now known as JustBob
04:56
<@celticminstrel>
So now all I have to do is figure out how to restore the data.
05:00
<@celticminstrel>
The options seem to boil down to assigning __proto__ or using $.extend.
05:00
<@celticminstrel>
Either way it seems I'll need do it recursively to deal with the nested objects.
05:40 * celticminstrel settles on a mixture of the two.
05:58 ErikMesoy|sleep is now known as ErikMesoy
05:59 himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds]
06:17 Kindamoody is now known as Kindamoody|out
06:19
<@celticminstrel>
...okay, somehow, JSON.parse seems to be returning two different values for the same input string.
06:20
<@celticminstrel>
Or console.log can't be relied on.
06:25 Derakon is now known as Derakon[AFK]
06:30
<@celticminstrel>
And restoration appears to work. Good enough for me. Committing and sleeping now.
06:30
<@celticminstrel>
Oh and pushing. Might as well throw that in too since I have twenty-something commits to push.
06:30
<@celticminstrel>
Oh, thirty-something now.
06:41 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!]
06:47 Attilla [Attilla@Nightstar-aced750e.range86-184.btcentralplus.com] has joined #code
07:10 You're now known as TheWatcher
07:49 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
07:49 mode/#code [+o himi] by ChanServ
08:08 You're now known as TheWatcher[afk]
08:16 Attilla [Attilla@Nightstar-aced750e.range86-184.btcentralplus.com] has quit [Ping timeout: 121 seconds]
09:30 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has quit [Ping timeout: 121 seconds]
09:30 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has joined #code
09:30 mode/#code [+o Alek] by ChanServ
10:10 You're now known as TheWatcher
10:32 RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
--- Log closed Tue Feb 12 10:54:39 2013
--- Log opened Tue Feb 12 10:55:39 2013
10:55 TheWatcher [chris@Nightstar-3762b576.co.uk] has joined #code
10:55 Irssi: #code: Total of 37 nicks [20 ops, 0 halfops, 0 voices, 17 normal]
10:55 mode/#code [+o TheWatcher] by ChanServ
10:56 Irssi: Join to #code was synced in 38 secs
11:14 Attilla [Attilla@Nightstar-aced750e.range86-184.btcentralplus.com] has joined #code
11:27 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
12:10 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
13:31 VirusHome [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
13:33 VirusHome is now known as VirusWork
13:33 VirusJTG_ [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
13:34 Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds]
13:35 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds]
13:39 VirusWork is now known as Pandemic
13:39 mode/#code [+o Pandemic] by ChanServ
13:56
< ErikMesoy>
Blah. Ran into "unbound method methodname() must be called with parentclass instance as first argument (got nothing instead)". Google suggested this was due to calling a class method instead of an object method. Declared an instance of the class, called its method, got the same. What am I missing? self?
13:57
< Syk>
sanity
13:57
< ErikMesoy>
I don't get it
13:57
<@froztbyte>
your context excludes what you're using, and example code showing the problem
13:57
< Syk>
it reads like it wants thing.method(thing_instance)
13:57
<@froztbyte>
but Syk's more general point is "you were dumb enough to deal with computers, and are thus insane"
13:57
<@froztbyte>
I think
13:58
< Syk>
no
13:58
<@froztbyte>
aww :(
13:58
< Syk>
you're insane enough to use a language capable of that level of wtf
13:58
<@froztbyte>
oh
13:59
< ErikMesoy>
class Town has a method Starter(self). Elsewhere, I tried calling Town.Starter() and got the above. So I said CurrentArea = Town and then CurrentArea.Starter() with the same result.
14:00
< ErikMesoy>
Syk: python?
14:00
< Syk>
yes
14:00
< Syk>
you're insane for using python
14:00 * Syk pokes at her own pile of insanity that she's working on
14:01
<@froztbyte>
does Town derive from object?
14:01
< ErikMesoy>
froztbyte: CurrentArea.Starter(CurrentArea) says that it got a classobj instance instead
14:01
<@froztbyte>
Class Town(object):
14:01
<@froztbyte>
def Starter(self):
14:01
<@froztbyte>
stuffhere
14:01
< ErikMesoy>
Town presumably derives from object since I didn't declare it to derive from anything else
14:02
<@froztbyte>
err, lowercase C there
14:02
<@froztbyte>
also why so many capitalised things?
14:02
< ErikMesoy>
class Town:
14:02
< ErikMesoy>
def Starter(self):
14:02
< ErikMesoy>
stuffhere
14:02
<@froztbyte>
try my thing quickly
14:02
<@froztbyte>
I don't recall if it'll work
14:02
<@froztbyte>
I very rarely write classes
14:02
< ErikMesoy>
Nope, same deal.
14:03
< ErikMesoy>
Oh, I see it. CurrentArea=Town didn't create an object. it created a pointer-like-thing (dunno what the technical term is) to the Town class.
14:04
< ErikMesoy>
CurrentArea=Town(), there we go
14:06
<@froztbyte>
eh, yeah, that too
14:06
<@froztbyte>
but I assumed you knew that
14:06
<@froztbyte>
() calls, = links/references
14:06
<@froztbyte>
if you want to duplicate, import deepcopy
14:06
<@froztbyte>
(why so many capitals? :( )
14:06
< ErikMesoy>
Because my capitalization in this program is rather ad hoc so far
14:07
< Syk>
because we are now suddenly in europe
14:07
< Syk>
capitals, as far as the eye can see
14:07
< ErikMesoy>
*snort*
14:07
< Syk>
moscow, london, that German one
14:07
<@froztbyte>
berlin? strassburg? cologne?
14:08
<@froztbyte>
(if there are any germans here, they'll now be pissed at me)
14:08
< Syk>
berlin, that sounds about right
14:08
< Syk>
that weird turkish one
14:08
< ErikMesoy>
Adrianople?
14:08
< Syk>
france, if anyone cares to include france
14:08
<@TheWatcher>
Istanbul (not Constantinople)
14:08
< ErikMesoy>
I prefer Miklagard for that one
14:09
< Syk>
the only good thing about France is that it was in the way of the Germans
14:10
< ErikMesoy>
Anyway, I will decapitate some methods.
14:10
< ErikMesoy>
Those are the bits I should be decapitating, right?
14:40 You're now known as TheWatcher[afk]
15:45 RobinStamer [rstamer@genoce.org] has quit [Ping timeout: 121 seconds]
15:57 d4de [olorin@4B91FF.00BEE6.0E8CE5.FC0BFE] has quit [Ping timeout: 121 seconds]
16:56 ErikMesoy is now known as Harrower
17:06 d4de [olorin@687AAB.418D22.A66DA1.CC1B39] has joined #code
17:44 Silver_Adept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has joined #code
17:46 EvilDarkLord is now known as Maze
17:46
< Silver_Adept>
Is there a coder in the house that can help me with why a <video> tag doesn't work in Firefox and an <iframe> spawns multiple instances of a program that eventually consumes all available ram (also Firefox)?
17:48
<@Tamber>
Because developing anything for the web is a box of spiders.
17:50
< Silver_Adept>
Quite. Also, large amounts of Woe.
17:50
< Syk>
Silver_Adept: <video> is a pile of fuck
17:50
< Syk>
Silver_Adept: FF doesn't support h264
17:50
< Silver_Adept>
Tried it with a WebM. Still full of fail.
17:50
< Syk>
Silver_Adept: http://diveintohtml5.info/video.html
17:51
< Syk>
:> have fun
17:51
<@Tarinaky>
Is anyone here knowledgeable in Fuzzy Logic/Fuzzy Sets?
17:52
<@Tarinaky>
I might have missed some lectures, and am now completely fucked width-wise wrt an assignment. I'm struggling to read the notes on Fuzzy Inference provided by the lecturer (struggling to read as in - the text is illegible)
17:53 * Syk takes off Tarinaky's glasses
17:53
< Syk>
there, your logic is now fuzzy
17:53
<@Tarinaky>
Okay, Syk is no longer allowed to help.
17:53
< Syk>
:P
17:53
<@Tarinaky>
Pretty sure the distinction between you being beaten with a stick and not being beaten with a stick is a crisp value.
17:54
< Syk>
sticks and stones may break my bones, and of that I'm bloody terrified
17:55
<@Tarinaky>
Sticks and stones may break your bones, but strangulation will finish you off :p
17:55
< Syk>
stranglulation is so old hat
17:56
< Syk>
I prefer a good crushing, or a fashionable immolation
17:56 * Tamber defenestrates Syk.
17:57 * Syk lands in the flower garden
17:57
<@Tarinaky>
The flowers are poisonous.
17:57
<@Tarinaky>
And on fire.
17:57
<@Tarinaky>
And the garden is, in fact, a concealed pit trap.
17:58
<@Tarinaky>
Filled with spikes.
17:58
<@Tarinaky>
Covered in snakes.
17:58
<@Tarinaky>
And the snakes are covered in poison.
17:58
< Syk>
I'm Australian
17:58 * Pandemic pushes Tarinaky into said "garden"
17:58
<@Tarinaky>
So what? That doesn't make you immune.
17:58
< Syk>
you're going to have to try a bit harder than that
17:58
<@Tamber>
That's about a standard day for Aussies.
17:59 * Tamber pelts Syk with cricket balls.
17:59
< Syk>
ow
17:59 * Pandemic infects Syk
17:59
<@Pandemic>
I'll solve this
17:59
< Syk>
cricket: an australian's mortal weakness :<
17:59
<@Tarinaky>
Anyway. I'm going to walk home.
17:59 * Pandemic sets to work
17:59
<@Tarinaky>
If anyone knows anything about fuzzy inference, please reply >.<
17:59
<@Tarinaky>
Later.
18:00 * Syk sets fire to the cricket balls, throws the ash at Tamber. Ashes! A Briton's mortal weakness
18:00
< Syk>
which you bastards still get to keep even if we win it
18:00
< Syk>
>:C
18:00
<@Tamber>
xD
18:00 * Pandemic weakens Syk by 10% every hour.
18:00
< Syk>
you're like "Oh, congratulations Australia. ... oh you wanted the ashes?"
18:00
<@Pandemic>
I got this tamber
18:01 * Syk also starts throwing up everywhere
18:01
<@Tamber>
http://www.dadhacker.com/blog/?p=1914 :D
18:01 * Syk gets it in the coleslaw, makes no change to its composition
18:01
<@Azash>
Pandemic: How many evolution points have you racked up?
18:01
<@Pandemic>
several million, I'm a sentient plague
18:02
<&ToxicFrog>
Tarinaky: it's been a while since I did fuzzy stuff, but I still have my notes. Somewhere.
18:04
<@Azash>
Pandemic: http://www.addictinggames.com/strategy-games/pandemic2.jsp
18:04
< Syk>
madagascarrrrrrrrrr
18:05
<@Azash>
Syk: I know right
18:05
< Harrower>
madagascar is overrated
18:05
< Syk>
i once started on madagascar
18:05
< Syk>
they closed their ports before i escaped
18:05
<@Azash>
wat
18:06
< Syk>
i was like 'you /bastards/'
18:06
< Syk>
'you goddamn two timing horsehumping /bastards/'
18:09
<@Pandemic>
I'll have to play that gmaes
18:09
<@Pandemic>
game*
18:10
<@Pandemic>
in the real world you want a long incubation time, medium to low lethality, a high easy of spread
18:10
< Syk>
in pandemic II, you want FUCKING MADAGASCAR
18:10
< Syk>
everything else is cake if you have that
18:10
< Syk>
because you kill all the scientists :D
18:10 * Pandemic nods
18:11
<@Pandemic>
thats /awesome/
18:11
< Syk>
okay
18:11
< Syk>
time for slep
18:11 Syk is now known as syksleep
18:22
<@Azash>
Pandemic: The thing is that countries in pandemic 2 get suspicious fairly easily
18:22
<@Azash>
And madagascar can only be reached via ship/flight, meaning that when they shut down, they really do shut down, and you're not getting in anymore
18:24
< ShellNinja>
Ship only.
18:24
< syksleep>
yeah only ship
18:24
< syksleep>
which is why it's such a BASTARD
18:24
< ShellNinja>
"President Madagascar! A man in Brazil is coughing!" "SHUT. DOWN. EVERYTHING."
18:24
< syksleep>
i love when all the ports close
18:24
< syksleep>
and the ship is just wandering the seas
18:25
< syksleep>
because nobody will take it
18:25
< syksleep>
but yeah slep
18:25
<@Azash>
Night sykslepp
18:36
<@Pandemic>
If I can tear myself away form my warrior this evening I'll give it a go. Thanks for the link.
18:36
<@Tarinaky>
ToxicFrog: I'd appreciate it. The the subscript in the matrix notatio is too hard to read, I can't tell what domain I'm taking the min over :/
18:55 celmin [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
18:55 mode/#code [+o celmin] by ChanServ
18:56 Kindamoody|out is now known as Kindamoody
19:08 * celmin is having assignment troubles.
19:08
<@celmin>
I'm supposed to be writing a CGI script to upload a file, process it, and show the results, but the upload part doesn't seem to work.
19:09
<@celmin>
(This is in Perl.)
19:12
<&ToxicFrog>
hooray
19:13
<@celmin>
???
19:17
<&ToxicFrog>
Sarcasm.
19:17
<&ToxicFrog>
Doesn't work how?
19:17
<@celmin>
$q->upload(fieldname) returns undef
19:18
<@celmin>
But $q->param(fieldname) returns the filename.
19:21
<@celmin>
Whatever that means.
19:21
<@celmin>
($q is an instance of CGI.)
19:24
<&ToxicFrog>
There's nothing special you have to do to get the data out of POST?
19:24
<&ToxicFrog>
You've used wireshark and confirmed that the data is actually getting uploaded by the browser?
19:25
<@celmin>
1. Not according to what I've been reading. 2. I have no idea what wireshark is.
19:26
<@gnolam>
Wireshark is a tool for sniffing network traffic.
19:26
<@gnolam>
Quite user friendly and very useful for debugging anything network-related.
19:27
<@celmin>
Does the fact that I'm testing on localhost make a difference to it?
19:27
<@gnolam>
It has built-in support for decoding many common protocols, like HTTP.
19:29
<@gnolam>
No difference either to HTTP or Wireshark.
19:38
<@celmin>
It seems unwilling to launch.
19:39
<@celmin>
Oh. There it goes.
19:41 * celmin assumes the interface labelled "loopback" is likely to be the one I want to look at.
19:43
<@celmin>
(Which turns out to be correct.)
19:45
<@celmin>
So the file is not being uploaded.
19:47
<@celmin>
Because I had the right encoding in the wrong attribute.
19:49
<@celmin>
Now nearly everything works... just need to show only the top five entries in the hash (by value) instead of all entries...
19:58 You're now known as TheWatcher
19:58 Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has joined #code
19:58 mode/#code [+ao Derakon Derakon] by ChanServ
19:59
<&Derakon>
Man, <3 Python sets and other "smart" containers.
19:59
<@celmin>
Smart?
19:59
<&Derakon>
Code gets so much more clean when you don't have to do your own manual filtration iterators.
19:59
<&Derakon>
CM: being able to do things like "usedCameras = activeCameras.intersection(inputCameras)".
20:01
<&Derakon>
As opposed to writing a nested for loop to manually check each item in inputCameras against the contents of activeCameras.
20:01
<&Derakon>
Doing this in plain C would be considerably uglier, is all I'm getting at. Language progress: we haz it.
20:02
<&Derakon>
(And I know, Scheme and Lisp and so on have had similar constructs for decades)
20:11
<@celmin>
I need to find the max value in the hash, but I also need the key that corresponds to that value...
20:15
<@Rhamphoryncus>
celmin: you mean a hash table? You'd need to iterate over the whole thing. The language would provide either a way to iterate over keys and values simultaneously or you just iterate over the keys and get the value each time
20:15
<&Derakon>
It may be you can write a filter function to pass to max() that would get you both.
20:16
<@celmin>
Unfortunately, Perl does not appear to have max().
20:16
<&Derakon>
Ah.
20:16
<&Derakon>
My Perl's a bit rusty, sorry.
20:19 * celmin manages to make it work.
20:27 Kindamoody is now known as Kindamoody[zZz]
20:28 * Alek gives Derakon some Perl polish.
20:38 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has joined #code
20:38 Silver_Adept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has quit [Connection reset by peer]
20:43 Reiv [NSwebIRC@A3BDC3.5BE3EC.B8847E.5ADB9D] has joined #code
20:43 mode/#code [+o Reiv] by ChanServ
20:44 Rhamphoryncus [rhamph@Nightstar-cc6253d6.abhsia.telus.net] has quit [Operation timed out]
20:46 Silver_Adept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has joined #code
20:46 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has quit [Client closed the connection]
20:47 * TheWatcher readsup
20:48
<@TheWatcher>
List::Util
20:48
<@TheWatcher>
contains a whole bunch of array-related ops, including max and min
20:48
<@celmin>
I found references to that.
20:49
<@celmin>
But they seemed to imply it was an extension library, which might be a problem.
20:49
<@celmin>
Besides which, I have a hash, not an array.
20:49
<@TheWatcher>
It's part of perl core, so it should be installed on any system with a vaguely sane perl install
20:49
<@celmin>
Okay.
20:49
<@TheWatcher>
use List::Util qw(max); my $maxkey = max(keys(%hash)); my $maxval = $hash{$maxkey};
20:50
<@celmin>
Um, but.
20:50
<@celmin>
Wouldn't that return the value of the max key, rather than the key of the max value?
20:50
<@TheWatcher>
Oh, I read it backwards
20:50 * celmin has moved onto the next problem now in any case.
20:50
<@TheWatcher>
yeah, that would
20:52 Silver_Adept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has quit [Client closed the connection]
20:52 Silver_Adept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has joined #code
20:54
<@TheWatcher>
In that case, you're probably best using a custom sort operator, eg
20:55
<@TheWatcher>
my $key = (sort {$foo{$a} <=> $foo{$b}} keys $foo)[0]; my $val = $foo{$key}; I think
20:56
<@celmin>
I recall trying something like that without success.
20:56
<@celmin>
Though I dunno whether it was identical.
20:56
<@celmin>
I copy-pasted it from somewhere.
20:57 * TheWatcher tries it
20:57
<@TheWatcher>
Yeah, I got the sort backwards
20:58 * celmin ended up using a function that does a search for the max value and returns the key.
20:58
<@TheWatcher>
http://pastebin.starforge.co.uk/550 - there
20:59
<@TheWatcher>
that'll print out Key: valb\nValue: 20\n
21:00 * celmin wonders what - means in a function call, eg f(-x=>6)
21:01
<&Derakon>
Negate the value?
21:01
<@TheWatcher>
It's just a convention some people use '-x' is a hash key
21:01 Rhamphoryncus [rhamph@Nightstar-cc6253d6.abhsia.telus.net] has joined #code
21:01 mode/#code [+o Rhamphoryncus] by ChanServ
21:01
<&Derakon>
...okay.
21:01
<@celmin>
So it's not required?
21:01
<@TheWatcher>
If the function says it expects -x, es!
21:01
<@TheWatcher>
*yes
21:02
<&Derakon>
So this is basically passing arguments by name.
21:02
<@TheWatcher>
Yep
21:02
<&Derakon>
Equivalent of, in Python, doing foo(arg1 = 5, arg2 = 'alpha')
21:02
<@TheWatcher>
Exactly
21:02
<@celmin>
Whyyy...
21:02
<&Derakon>
Arg-by-name is a very useful concept.
21:02
<&Derakon>
First, it makes invoking complex functions easier.
21:02
<@celmin>
No, I mean why the - prefix.
21:02
<&Derakon>
Oh.
21:03
<&Derakon>
Yeah, that I can't explain.
21:03
<@TheWatcher>
My guess? bleedover from shell command arguments
21:04
<@celmin>
Perl borrows way too much syntax from the shells... :/
21:04
<&Derakon>
Well, the vast majority of Perl in the world exists as temporary one-liners anyway.
21:04
<&Derakon>
That's a big part of why it has e.g. so many implicit variables.
21:04
<@celmin>
The vast majority of Perl written by me will almost certainly be today's work.
21:24
<@TheWatcher>
I note that my opinion of the vast majority of perl in the world is unprintable, as is much of my opinion of the people who perpetrated it
21:24 Harrower is now known as ErikMesoy
21:24
<&McMartin>
13:01 <&Derakon> Arg-by-name is a very useful concept.
21:24
<@celmin>
I'm almost finished with the perl stuff, but I think I need a break.
21:25
<&McMartin>
"keyword arguments" - it's important to not get a hash collision with the execrable "call-by-name"
21:25 Maze is now known as EvilDarkLord
21:25 celmin [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: And lo! The minstrel departs, to spread the music to the masses!]
21:26 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
21:26 mode/#code [+o celticminstrel] by ChanServ
21:26
<&Derakon>
McM: right, fair point.
21:26 * McMartin did of course have to actually look up what that was really called though >_>
21:39
<&ToxicFrog>
"call by name" is the one where you're passing expressions rather than evaluation results which then get evaluated as many times as they appear in the function body, right?
21:40
<&McMartin>
I'd have to go digging to make sure.
21:40
<&McMartin>
It's used to mean that (that is, what the C preprocessor does), but IIRC it's really "what ALGOL does" and it's some chimera of that with dynamic scope (which, while alien and usually wrong, is not completely bugfuck)
21:41 * McMartin goes to check
21:41
<&McMartin>
Aha
21:41
<&McMartin>
OK, it's what the C preprocessor does, but with a safeguard to ensure that there are no namespace collisions.
21:42 * TheWatcher eyes this code, has one of the "What in Azathoth's name was I thinking?!" moments
21:42
<&McMartin>
Also, unlike the C preprocessor, it happens at run-time.
21:43
<&McMartin>
Hmm.
21:43 * McMartin flips through the wiki article on evaluation strategies
21:43
<&McMartin>
OK, if that's accurate, that gives me a way to very succinctly put it
21:43
<&McMartin>
"It's non-memoized lazy evaluation".
21:43
<&McMartin>
Call by name explicitly lets you do the lazy-evaluation tricks that cpp does not, like infinite streams
21:44 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has joined #code
21:44 Silver_Adept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has quit [Client closed the connection]
21:45
<&ToxicFrog>
And the non-memoized bit means that if you have (defn triple [x] (+ x x x)) (triple (foo)) under CBN, foo gets called three times, yes?
21:47
<&McMartin>
Correct.
21:48 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has quit [Client closed the connection]
21:48
<&McMartin>
In practice, one normally only encounters lazy evaluation in pure functional languages, though, so it's kinda moot.
21:48 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has joined #code
21:48
<&McMartin>
And in Scheme, IIRC, you do lazy evaluation by handing it a closure, so I guess it's kind of this
21:48
<&McMartin>
(Or memoized, since your closure could modify its own state to just return a value after the first time~)
21:49 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
21:49 mode/#code [+qo Vornicus Vornicus] by ChanServ
21:49 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has quit [Connection reset by peer]
21:50 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has joined #code
21:51 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has quit [Connection reset by peer]
21:52 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has joined #code
21:53 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has quit [Connection reset by peer]
21:53 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has joined #code
22:10 Silver_Adept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has joined #code
22:10 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has quit [Connection reset by peer]
22:12 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has joined #code
22:12 Silver_Adept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has quit [Connection reset by peer]
22:13 SilverAdept [androirc@Nightstar-47f4eac3.hfc.comcastbusiness.net] has quit [[NS] Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
22:36 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
23:04 ErikMesoy is now known as ErikMesoy|sleep
23:24 You're now known as TheWatcher[T-2]
23:26 You're now known as TheWatcher[zZzZ]
23:55 himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code
23:55 mode/#code [+o himi] by ChanServ
23:57 Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has quit [[NS] Quit: leaving]
23:58
< RichyB>
McMartin: "memoized closure" is how everyone compiles Haskell under the hood.
23:59
< RichyB>
IIRC, what GHC uses is something like represent values with pointers to closures at first. If/when called, the closure overwrites the pointer to itself with a pointer to the allocated return value.
--- Log closed Wed Feb 13 00:00:40 2013
code logs -> 2013 -> Tue, 12 Feb 2013< code.20130211.log - code.20130213.log >

[ Latest log file ]