code logs -> 2013 -> Thu, 21 Feb 2013< code.20130220.log - code.20130222.log >
--- Log opened Thu Feb 21 00:00:49 2013
00:09
<@Reiv>
Haeroe: Is that a generalised bubble sort?
00:10
<@Haeroe>
Reiv: Well, not really, I mean, you need some extra trickery, like let's say slot 0,0 has 1 in it as it should be
00:10
<@Haeroe>
And you're trying to put 2 and 3 into 1,0 and 2,0
00:10
<@Haeroe>
Then you still need to put 3 and 2 into 1,1 and 2,1 respectively before twisting twice
00:11
<@Haeroe>
It's not an impossible problem by any means but it's more than there was in my iteration
00:12
<@Haeroe>
If I was actually making this I would probably just do a rainbow table-like solution as cacheing the next move for any board situation should only take a couple of megabytes in total, but the tests do have time limits that do not allow for preparation
00:20
<@Reiv>
Geez, this is a test?
00:20
<@Reiv>
I could probably answer this eventually, but the hard part would be solving the thing at all, never mind the algorathm
00:23
<@Haeroe>
Nah
00:23
<@Haeroe>
It's one of 6 questions in the weekly practical assignment
00:23
<@Haeroe>
:b
00:23
<@Haeroe>
Nevermind the theoretical ones
00:25
<@Reiv>
Jeebus. This is 1st year programming?
00:26
<&McMartin>
I'd say Sudoku-solver is feasible for a 1st year if it's later in the course, orm aybe the middle, depending.
00:26
<&McMartin>
I mean, SICP's final project is an interpreted language. =P
00:28 ErikMesoy|sleep [Erik@A08927.B4421D.FE7332.A86588] has quit [Connection reset by peer]
00:28 AD [NSflashIRC@A08927.B4421D.FE7332.A86588] has quit [Connection reset by peer]
00:29 ErikMesoy [Erik@A08927.B4421D.FE7332.A86588] has joined #code
00:29 AD [NSflashIRC@A08927.B4421D.FE7332.A86588] has joined #code
00:30
<@Reiv>
Hm, yeah, if it was in the later part of the year that's fairly legit
00:30
<@Reiv>
When I think 'freshman' I think 'utter newbie'
00:30
<@Reiv>
Because we don't have the term here~
00:32 You're now known as TheWatcher[T-2]
00:34 You're now known as TheWatcher[zZzZ]
00:37
<@Haeroe>
Reiv: First spring data structures and algos
00:38
<@Haeroe>
Cormen 101
00:40
<&McMartin>
First spring is second semester, right?
00:41
<@Haeroe>
Yeah
00:42
<&McMartin>
Yeah, that's well in-scope for a CS-major program
00:44
<@Haeroe>
Hmm, must've been a bad year I started
00:44
<&McMartin>
Well, when was that~
00:44 * McMartin 's 1st-year class was in '96
00:45
<@Haeroe>
Spring '10 here
00:46
<&McMartin>
Note also that there is a difference between an intro *programming* class and an intro *CS* class
00:46
<@Haeroe>
Sure
00:46
<@Haeroe>
This is CS
00:46
<&McMartin>
The former is going to involve corner cases in how to express weird things, the latter is going to involve staying in the grounds of stuff that's easy to express *once you can organize and characterize the problem*
00:46
<&McMartin>
There is not a consistent strategy within universities of which one you teach first.
00:48
<@celticminstrel>
I seem to recall writing a very basic shellscript interpreter in second year...
00:48
<@celticminstrel>
Well. In a second year course. >_>
00:48
<&McMartin>
SICP ends with Scheme-in-Scheme, which is about the easiest thing in the universe to parse
00:49 * celticminstrel 's course order is all over the map.
00:49
<@celticminstrel>
This was the C/POSIX course.
00:49
<&McMartin>
My lecturer was one of the people largely responsible for Berkeley Logo, though, so the final project was to take the Scheme-in-Scheme from the book and turn it into a LOGO terp.
00:50
<@celticminstrel>
I think that was my introduction to programming.
00:50
<@celticminstrel>
It might've been Hypertalk, but more likely UCBLogo.
00:51
<@celticminstrel>
At one point I contemplated writing interactive fiction with it. That never really went anywhere.
00:51
<&McMartin>
It's pretty good at it; I remember a little adventure game in Terrapin logo that we had at school
00:54
< RichyB>
http://www.youtube.com/watch?v=OkG82oKlg8k there are a shocking number of Turing award winners whom I know practically nothing about. Here's one mostly at random.
00:58
<@Reiv>
Turing award?
01:08 Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds]
01:08 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds]
01:16 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
01:16 Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
01:16 mode/#code [+o Pandemic] by ChanServ
01:42 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
01:42 mode/#code [+qo Vornicus Vornicus] by ChanServ
01:43
<@Haeroe>
Reiv: The Nobel of computing, basically
01:44
<@Reiv>
I see.
01:53 AD [NSflashIRC@A08927.B4421D.FE7332.A86588] has quit [Ping timeout: 121 seconds]
02:12 JustLurk is now known as JustBob
02:19 Attilla [chatzilla@Nightstar-aced750e.range86-184.btcentralplus.com] has quit [Ping timeout: 121 seconds]
02:23
< RichyB>
I love it when one unit test leaves crud behind in the environment that breaks every test coming after it.
02:25
<@Reiv>
Did you have a unit test for testing if there was crud left behind?
02:31
< RichyB>
No. Kind of the whole point is to not have to worry about shit like that.
02:32
< RichyB>
I'm not going to write unit-tests for the unit-tests except in that some of them have self-tests. That's a rabbit-hole of madness. ;P
02:32
< RichyB>
https://twitter.com/jkottke/status/304356070132957184 This is such a genius idea.
02:32
< RichyB>
<@jkottke> Will you be able to sidle up next to a Google Glass wearer and say "ok glass, show me midget porn" or are they tied to wearer's voice?
02:39
< Shiz>
moq
02:56
<@Reiv>
I'm a little troubled by the Google Glass stuff
02:57
<@Reiv>
Their voice recognition is good, but not /that/ good
02:57
<&McMartin>
"Assuming you meant to search for 'midget porn'"
02:57
<@Reiv>
And RichyB: If they've half a brain they've done the same trick as high-end bluetooth headsets
02:57
<@Reiv>
That read vibration in the skull to differentiate/amplify the speakers voice.
02:57
<@Reiv>
From background noise, I mean.
02:58
<@Reiv>
If the skull ain't humming to the tune, it ain't no speakin'.
02:58
<&McMartin>
Mmm, subvocalization mics
02:59
<@Reiv>
Similar tech, yes
02:59
<@Reiv>
It's pretty handy, and I suspect near de facto required for 'voice recognition, always on'
02:59
<@Reiv>
What I wonder is just how much hardware those glasses pack.
03:02 Nemu_ [NeophoxProd@Nightstar-887ff271.asahi-net.or.jp] has quit [Connection reset by peer]
03:03 Nemu [NeophoxProd@Nightstar-92a3fb09.asahi-net.or.jp] has joined #code
03:04
< RichyB>
so
03:04
< RichyB>
Press a vibrator into the side of someone's head while shouting "GLASS! DISPLAY MIDGET PORN, NOW!"
03:05
<@Reiv>
RichyB: A voice activated vibrator
03:05
<@Reiv>
That pulses according to the timbre of your voice.
03:05
<@Reiv>
It's not just "Is the head vibrating", oh no
03:06
<@Reiv>
It's "We're picking up half the audio feed through your /skull/"
03:06
<@Reiv>
"This is how we tell it apart from the loudmouth beside you on the train."
03:07
< RichyB>
Damn.
03:08
< RichyB>
Meh, making a Hitachi Magic Wand play into a speaker is just a question of amplitude modulation.
03:08
< RichyB>
Solution becomes "press humorously-shaped loudspeaker against side of prank victim's head"? :)
03:10
<@Reiv>
And now we're bordering on Assault, as opposed to Prank~
03:11 syksleep is now known as Syk
03:16
< RichyB>
No, I think I passed "assault" a while back.
03:16
< RichyB>
"Prank" is not a subset of "legal".
03:18 Kindamoody[zZz] is now known as Kindamoody
03:28 Nemu_ [NeophoxProd@Nightstar-af6fbd0e.asahi-net.or.jp] has joined #code
03:30 Nemu [NeophoxProd@Nightstar-92a3fb09.asahi-net.or.jp] has quit [Ping timeout: 121 seconds]
03:33 Nemu [NeophoxProd@Nightstar-d0e419d9.asahi-net.or.jp] has joined #code
03:34 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
03:34 Nemu_ [NeophoxProd@Nightstar-af6fbd0e.asahi-net.or.jp] has quit [Ping timeout: 121 seconds]
03:35
< mac>
Does anyone know if you can add drives to a raid array after the array has been created?
03:35
< RichyB>
Generally, no.
03:36
< mac>
What raid setup would support such an idea
03:36 Nemu [NeophoxProd@Nightstar-d0e419d9.asahi-net.or.jp] has quit [Client closed the connection]
03:38
< RichyB>
Oh, I'm wrong. "RAID migration" is a common feature.
03:38
< Syk>
mac: it's uh
03:38 Nemu [NeophoxProd@Nightstar-edb1d355.asahi-net.or.jp] has joined #code
03:38
< Syk>
mac: not so much the RAID, but the FS
03:38
< mac>
oh
03:39
< Syk>
it doesn't matter if the RAID can expand if the filesystem running on top is a pile of crap
03:39
< RichyB>
You're going to have to involve renumber all of the blocks on the existing disks, which is fun|slow.
03:39
< Syk>
yes
03:39
< Syk>
it's much easier just to cry and wait until you need to migrate a lot
03:39
< RichyB>
Some filesystems support online re-sizing. I think ext4 does.
03:39
< RichyB>
resize2fs :)
03:40
< mac>
do you recommend a raid controller if I'm thinking about doing that, or just using built in raid on my machine
03:41
< RichyB>
Oh! Apparently mdadm does do on-line RAID migrations under Linux. Nice.
03:42
< RichyB>
Neither, I'd use a really well-tested software RAID setup like mdadm+LVM on Linux.
03:42
< RichyB>
The "built-in RAID" on your machine is probably a shitty fake-RAID controller. I would not use that as anything but a dumb disk controller.
03:43
< mac>
k
03:43
< RichyB>
Real hardware RAID cards might be able to do live migrations but I have no idea which.
03:43
< mac>
I'm thinking about going raid 10, because we need speed an redundancy, but we want to start with 2 disks? so i don't know if thats possible, ill have to check
03:44
< RichyB>
http://www.tomshardware.com/reviews/RAID-MIGRATION-ADVENTURE,1640-2.html Tom's Hardware tried a survey of this a while back?
03:44
< RichyB>
No, you can't have RAID 10 on two disks.
03:45
< mac>
crap so ill need to run raid 1 and then later migrate to raid 10
03:45
< mac>
if thats even possible.
03:45
< RichyB>
RAID "10" means RAID 1+0, i.e. a RAID-0 where the child devices are RAID-1s.
03:46
< RichyB>
What are you trying to achieve and on what kind of budget?
03:46 Nemu [NeophoxProd@Nightstar-edb1d355.asahi-net.or.jp] has quit [Client closed the connection]
03:47 Nemu [NeophoxProd@Nightstar-07fd422d.asahi-net.or.jp] has joined #code
03:48
< mac>
well i could just go buy all the drives outright
03:48
< mac>
kinda, we don't want to have to spend more money than we have to
03:49
< mac>
redundancy and speed are both important, so that points towards raid 10
03:51
<@Reiv>
Which is the one with the "I have seven drives containing five drives data, with any two able to fail"?
03:51 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
03:51
< RichyB>
Reiv: RAID 6.
03:51
<@Reiv>
Remind me, does that one enjoy speed too?
03:52
< RichyB>
RAID 5 is the one with "I have seven drives containing six drives data. I think I'm safe because I can survive any one drive failure, but because I have so many drives the failure probability of my whole array is actually higher than the failure probability for any one drive in it. Also, my disk performance is not great."
03:52
<@Reiv>
Raid 5 and Raid 6 are distinguished only by the number of spare drives?
03:53
< RichyB>
AIUI RAID 5 and RAID 6 are both slow as balls for writing (fine for reading) because every time you write one block on one drive, you have to read the blocks at the same index on all the other drives in order to calculate what the parity/Reed-Solomon blocks should contain.
03:53 d4de [olorin@687AAB.E04ECC.D09C3D.5FB5B2] has joined #code
03:54
< mac>
can i do raid 10 with 6 drives 2 by 2 by 2?
03:54
< RichyB>
Pretty much. RAID 5 uses one parity drive. RAID 6 uses a slightly cleverer scheme called "Reed-Solomon codes".
03:54
< RichyB>
mac: yeah, either way around. You can have a 3-mirror of stripe-pairs, a 3-stripe of mirror-pairs, or vice-versa.
03:55
< RichyB>
(or a 2-mirror of 3-stripes, or a 2-stripe of 3-mirrors)
03:55 Nemu [NeophoxProd@Nightstar-07fd422d.asahi-net.or.jp] has quit [Connection reset by peer]
03:55
< mac>
ok so 10 can be pretty secure
03:55
< mac>
is it easy to add more mirrors?
03:55
< RichyB>
Both RAID 1 and RAID 0 schemes admit arbitrary numbers of drives. RAID 1 admits adding as many drives as you want at runtime without any disruption.
03:56
<@Reiv>
Those would be better than RAID 6? Or is the write speed the key?
03:56
< RichyB>
Those should be much quicker than RAID6 at writing.
03:57 Nemu [NeophoxProd@Nightstar-4ab41aff.asahi-net.or.jp] has joined #code
03:57
< RichyB>
Please be aware that RAID is actually for high-availability, not data-integrity.
03:58
< RichyB>
The actual purpose of mirror sets is to let you continue using the machine after a disk has died without having to stop and wait for a backup to restore onto it.
03:58
< RichyB>
Only separate backups can get you data-integrity. A mirror will quite happily replicate software errors such as an accidental "rm -r".
03:59
<@Reiv>
Ha, truth.
03:59
< RichyB>
Are you sure you really need high-availability and your task wouldn't be accomplished more cheaply with a big disk and an SSD cache, possibly an SSD journal?
04:00
< RichyB>
+spend the money left over on removable media to do *real* backups onto. :)
04:00
<@Reiv>
SSD journal?
04:01
< RichyB>
Journalling is where a filesystem writes its intentions into a small circular buffer, called the "journal", before writing to the main trees/tables on disk.
04:02
< RichyB>
If you turn full block journalling on then every byte you write gets written to the journal before being applied to the main body of the filesystem.
04:04
< RichyB>
Adding a journal has surprisingly low cost on spinning disks because it's always physically small and in the same place, and writes to it are always contiguous. It makes some operations much faster, because you can consider them to be "completed" as soon as they're written to the journal rather than waiting for them to finish being written to the many locations that they might touch all over disk.
04:04
< RichyB>
(the actual writes still need to be done, but that can be done in the background by the filesystem later, just as a matter of reclaiming journal space)
04:05
< RichyB>
Anyway, reason I brought that up is that you can sometimes make filesystems go Hell of faster by moving the journal to a separate device.
04:07 Nemu [NeophoxProd@Nightstar-4ab41aff.asahi-net.or.jp] has quit [Client closed the connection]
04:09 Nemu [NeophoxProd@Nightstar-436a9c9b.asahi-net.or.jp] has joined #code
04:18 Nemu_ [NeophoxProd@Nightstar-5603ecbb.asahi-net.or.jp] has joined #code
04:19 Nemu [NeophoxProd@Nightstar-436a9c9b.asahi-net.or.jp] has quit [Ping timeout: 121 seconds]
04:20 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!]
04:26 AD [NSflashIRC@A08927.B4421D.FE7332.A86588] has joined #code
04:29 Nemu_ [NeophoxProd@Nightstar-5603ecbb.asahi-net.or.jp] has quit [Client closed the connection]
04:31 Nemu [NeophoxProd@Nightstar-5603ecbb.asahi-net.or.jp] has joined #code
04:32 Nemu [NeophoxProd@Nightstar-5603ecbb.asahi-net.or.jp] has quit [Connection reset by peer]
04:33 Nemu [NeophoxProd@Nightstar-d161aa7e.asahi-net.or.jp] has joined #code
04:38
<@Rhamphoryncus>
Strictly speaking a journal is only to maintain data integrity against power failure
04:40
<@Rhamphoryncus>
But in practice it's a matter of degrees. Not having to restore from backup after a power failure is a huge boost to availability
04:55 Janus [NSwebIRC@Nightstar-193c8645.res.rr.com] has joined #code
04:57 * Janus is doing a thing that doesn't seem right, again. Also Hi!
05:07
< Janus>
I was typing the question, and then I seen the solution as I typed it. Thanks!
05:15 himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Operation timed out]
05:36
< Xon>
<RichyB> No, you can't have RAID 10 on two disks.
05:36
< Xon>
Technically true, but in practice wrong. Most systems which do RAID10 actually implement it mirrored stripes *not* a true layered RAID setup. This allows them to distribute the strips across the two drives ensuring a mirror is maintained. This even works down to 1 drive, but obviously you lose any device redundancy
05:38
< RichyB>
What the fuck would be the point of that?
05:39
< Xon>
flexibility in disk numbering?
05:40
< RichyB>
Makes sense.
05:40
< Xon>
you can actually have an odd-number of disks and still ensure you have sufficient number of copies of the stripes to recover from a drive failure
05:40
< RichyB>
No, the "WTF?" was why you'd ever try a single-disk RAID or 2-disk supposedly-nested setup.
05:42
< Xon>
I use single-disk raid0 on a few servers due to raid controller limitations
05:45
< Xon>
also, breaking the nesting layering for RAID10 lets you do layout optimizations based on the distance of the chunks. Sure it has the same write performance as 1 disk, but you can still scale up the read formance by letting the raid device select the least-used disk to read from
05:45
< Xon>
read performance*
05:45
< RichyB>
That makes sense. What kit does that?
05:46
< Xon>
Windows Storage spaces, Linux MD driver actually do that
05:46
< RichyB>
Cool.
05:46
< Xon>
(Storage spaces isn't actually very /good/ at it)
05:49
< Xon>
(Storage spaces by default turns of disk-write cache and requires opt-in powershell to turn it back on so it kinda makes write performance shit)
05:49
< RichyB>
Traditionally one guesses that from it having the word "Windows" in front of it. ;P
05:49
< Xon>
at least for some types the storages spaces
05:50 RichyB [richardb@Nightstar-228a334c.plus.com] has quit [[NS] Quit: >:3 This is BunThulhu. Copy him into your quit message to help him take over the Internet.]
06:04 guest92 [Guest73@Nightstar-d39f391b.wi.charter.com] has joined #code
06:04 guest92 is now known as [_-S1L3NC3-_]
06:06 [_-S1L3NC3-_] [Guest73@Nightstar-d39f391b.wi.charter.com] has quit [[NS] Quit: ]
06:06 harlow [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
06:08 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has quit [Ping timeout: 121 seconds]
06:13 VirusHome [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
06:14 Netsplit *.net <-> *.split quits: ErikMesoy, Typherix, JustBob, @Tamber, d4de, @Haeroe, @Pandemic, Syk, @Courage, jeroud, (+2 more, use /NETSPLIT to show all of them)
06:15 JustLurk [justbob@ServerAdministrator.Nightstar.Net] has joined #code
06:15 Netsplit over, joins: Courage
06:15 mode/#code [+o Courage] by ChanServ
06:16 PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
06:18 ErikMesoy [Erik@Nightstar-be32adc8.80-203-17.nextgentel.com] has joined #code
06:19 Tamber [tamber@furryhelix.co.uk] has joined #code
06:19 mode/#code [+o Tamber] by ChanServ
06:21 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
06:21 mode/#code [+o Syloq] by ChanServ
06:24 Haeroe [ap@297948.F70DAA.120876.F7563D] has joined #code
06:24 mode/#code [+o Haeroe] by ChanServ
06:24 Syk [the@Nightstar-59eeca2c.iinet.net.au] has joined #code
06:25 Typherix [Typherix@Nightstar-7dc8031d.mi.comcast.net] has joined #code
06:29 JustLurk is now known as JustBob
06:30 d4de [olorin@687AAB.E04ECC.D09C3D.5FB5B2] has joined #code
06:30 Shiz [mark@42F7BC.C2C1CC.B64DF6.88F7A5] has joined #code
06:32 harlow [mac@Nightstar-fe8a1f12.il.comcast.net] has quit [Ping timeout: 121 seconds]
06:35 JustBob [justbob@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: ]
06:36 harlow [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
06:37 JustBob [justbob@ServerAdministrator.Nightstar.Net] has joined #code
07:05 Kindamoody is now known as Kindamoody|out
07:11
<@froztbyte>
<git rant/>
07:11
<@froztbyte>
(just read last night's scrollback)
07:12
<@froztbyte>
-*- Janus is doing a thing that doesn't seem right, again. Also Hi!
07:12
<@froztbyte>
<Janus> I was typing the question, and then I seen the solution as I typed it. Thanks!
07:12
<@froztbyte>
#code == rubberduck
07:18 harlow [mac@Nightstar-fe8a1f12.il.comcast.net] has quit [Ping timeout: 121 seconds]
07:41 Janus [NSwebIRC@Nightstar-193c8645.res.rr.com] has quit [[NS] Quit: Page closed]
08:11 jeroud [uid10043@Nightstar-7fd75919.irccloud.com] has joined #code
08:28
<&McMartin>
"I don't want you to pray to #code. I want you to ASK #code YOUR QUESTION."
08:34 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
08:34 mode/#code [+o himi] by ChanServ
08:34
<@Tarinaky>
So. How come nobody has ever packaged vim with plugins and configs?
08:35
<@Tarinaky>
You see cool screenshots of other people's vim generally being better than my own.
08:35
<&McMartin>
Because (a) BOO HISS THAT WOULD BE LIKE THE HATED EMACS and (b) vim is not remotely as modular as emacs and attempting to do this would prove emacs's superiority in this department, another thing which cannot be borne
08:36
<@Tarinaky>
I see.
08:36
<&McMartin>
But, uh, really? Is there not some site like the various emacs wikis where people post awesome config snippets?
08:37
<@Tarinaky>
No idea.
08:37
<@Tarinaky>
But I spotted this on reddit: http://statico.github.com/vim.html?utm_source=feedburner&utm_medium=twitter&utm_ campaign=Feed%3A+hnycombinator+(HN+-+hnycombinator)
08:37
< Xon>
rm -f /usr/bin/vim sounds like a great idea to me
08:37
< Xon>
s/vim/emacs/ as required
08:38
<&McMartin>
mv /usr/bin/pico $TARGET if you're in a really bad mood
08:38
<@Tarinaky>
You're all awful people.
08:38
<@Tarinaky>
I hope you realise that.
08:39
<@Tarinaky>
In other news: I think I'm going to have to refactor my program to use json to specify gui layouts, if only so my code isn't so damn cluttered with literals :/
08:39
<&McMartin>
=(
08:39
< Xon>
magic numbers are bad for you =p
08:39
<~Vornicus>
When I had to choose between them, I preferred vim, though that might be because i had a cheat sheet.
08:40
<@Tarinaky>
Sometimes magic numbers are magic.
08:40
<&McMartin>
Magic numbers are how you recognize file types
08:41
<@Tarinaky>
Yeah, but if you're doing that you'll have some list of #define directives.
08:41
<@Tarinaky>
Or an enum or something.
08:41 * McMartin is making a weak joke, as those too are "magic numbers"
08:41
<@Tarinaky>
I think they're magic numbers in the same sense.
08:41
<&McMartin>
That said, hardcoding dialog-box widget layouts is not necessarily bad
08:42
<@Tarinaky>
McMartin: It does make the code look ugly. And these aren't, strictly, dialog boxes - they're drawn in OpenGL.
08:42
<@Tarinaky>
Well, an OpenGL framework.
08:43
<&McMartin>
Mmm
08:43
<@Tarinaky>
There's a couple more refactors to do first.
08:43
<@Tarinaky>
I'm currently working on the "Do it." then "Do it right." then "Do it better."
08:44
<&McMartin>
Yeah
08:44
<&McMartin>
If this were a full desktop app I'd say "consider breaking out Glade or Qt Designer, both of which use XML to this end *already*"
08:45
<@Tarinaky>
This then has the issue that there's no nice way to create those XML files.
08:45
<&McMartin>
Er
08:46
<&McMartin>
That nice way would be Glade itself, and Qt Designer itself, which are graphical form designers.
08:46
<&McMartin>
XML is just how they save it out.
08:46
<&McMartin>
(And, for Glade, read it in later; QtD generally feeds a code generator as an automated build step)
08:46
<@Tarinaky>
I really don't like these programs.
08:46
<&McMartin>
The point being that specifying UIs by hand is *intrinsically* full of spider.
08:47
<@Tarinaky>
And Qt Designer is bloody hard to find on the website last time I tried it.
08:47
<@Tarinaky>
I ended up downloading the wrong thing last time.
08:47
< Syk>
you know what's fun
08:47
< Syk>
microsoft forms
08:47
< Syk>
visual studio 2010 had this great habit of choking on penii and throwing up all over your forms
08:48
<&McMartin>
"penes". The singular is "penis", not "penius".
08:48
< Syk>
once it got big enough, my app would take a minute to load in the designer, and it would be a coin flip if it didn't deem the top bar invalid and remove it
08:48
< Syk>
McMartin: this is a plural of penes, it's that bad
08:49
<@Tarinaky>
Or would be if we weren't speaking English where the plural is Penises.
08:49
<&McMartin>
That too, but even if we weren't it still isn't that
08:49
< Syk>
whatever, penises, penii
08:49
<&McMartin>
The phrase you actually want is "chokes on a bag of salted dicks", but this is a thing you traditionally wish on your enemies
08:50
< Syk>
needless to say there was a lot of man-on-compiler action
08:50 * Tarinaky chokes on his bag of salted dicks.
08:50
<@Tarinaky>
Really?
08:50
< Syk>
oh dear not again
08:50
<&McMartin>
Or you're in Seattle and are eating hamburgers.
08:50 * Syk revives Tarinaky, wonders why they still sell these things
08:50
<@Tarinaky>
Nose-cola is the worst thing ever.
08:51
< Syk>
eeeehhh
08:51
< Syk>
i think nose-iced-water is worse
08:51
<&McMartin>
(There is, in fact, a burger place in Seattle named Dick's, with a big sign that says "enjoy a bag of Dick's today!")
08:52
<&McMartin>
(I am told that this is where the phrase comes from but do not have independent confirmation)
08:53
<@Tarinaky>
I think it comes from being 1 worse than chocking on a singular dick.
08:53
< Syk>
are we discussing the origin of cock-choking
08:53
<@Tarinaky>
Apparently.
08:53
<@Tarinaky>
import cock
08:53
<@Tarinaky>
cock.choke(self)
08:54
< Syk>
cock not found; try instantiating the self class with the 'male' parameter
08:54
<&McMartin>
Syk: We're in "where does this sentence come from" now, and it's not my fault someone decided "Dick" makes a good short form of "Richard"
08:54
<&McMartin>
... OR IS IT?
08:54 * McMartin hides the TIME MACHINE
08:55
< Syk>
well aren't you a bit of a richard
08:55
<~Vornicus>
there's a restaurant on the columbia river named Tad's Chick Dump
08:55
<~Vornicus>
it used to say Tad's Chicken & Dumplings but half of the neon lights went out.
08:56
< Syk>
theres a place here called the pumphouse
08:56
< Syk>
ironically, there's no pumps in it, and it's not a house
08:58
<~Vornicus>
in new haven there's a pizza restaurant and brewery named "bar"
09:06
< Syk>
Vornicus: is there a 'foo' nearby
09:07
<~Vornicus>
Syk: not that I'm aware of
09:07
< Syk>
well
09:08
< Syk>
i suppose you could get foo at bar?
09:08
< Syk>
foo-d, that is
09:08
<~Vornicus>
They're renowned for their pizza.
09:08
<~Vornicus>
There's Ruby Foo's in NYC apparently
09:14
< JustBob>
http://tailhunter.mx/fubarcantina.htm <- I cite the Fubar Cantina.
09:16 Attilla [chatzilla@Nightstar-aced750e.range86-184.btcentralplus.com] has joined #code
09:18
<~Vornicus>
There's a FooBar in Nashville
09:18
< JustBob>
And we have a Crow Bar here in Corvallis.
09:19
< JustBob>
Sorry, Crowbar.
09:20
< JustBob>
Which, while relatively geeky, is not a foobar.
09:23
< JustBob>
...
09:23
< JustBob>
Okay.
09:23
< JustBob>
I need to bite the bullet and just make that a function to call or something.
09:23
< JustBob>
I keep having to rewrite a linear interpolator because I always forget to actually /save/ it.
09:27
<@froztbyte>
so what you guys are saying is that if I ever open a club, it should be called Baz or Quux?
09:29 gnolam_ [lenin@Nightstar-fe1ac75d.cust.bredbandsbolaget.se] has joined #code
09:29 gnolam is now known as NSGuest19290
09:29 gnolam_ is now known as gnolam
09:29 mode/#code [+o gnolam] by ChanServ
09:32 NSGuest19290 [lenin@Nightstar-fe1ac75d.cust.bredbandsbolaget.se] has quit [Ping timeout: 121 seconds]
09:58 You're now known as TheWatcher
09:59 AD [NSflashIRC@A08927.B4421D.FE7332.A86588] has quit [Client closed the connection]
10:29
<@Tarinaky>
Ummm... any vim wizards?
10:29
<@Tarinaky>
I'm trying to steal that gentleman's .vim directory.
10:29
<@Tarinaky>
But I'm not seeing any change in vim. :/
10:33
<@froztbyte>
who's vim dir?
10:33
<@Tarinaky>
http://statico.github.com/vim.html?utm_source=feedburner&utm_medium=twitter&utm_ campaign=Feed%3A+hnycombinator+(HN+-+hnycombinator)
10:34
<@Tarinaky>
He has his dotfiles in a git repo.
10:34
<@Tarinaky>
So I cloned them and copied out the .vim directory...
10:34
<@Tarinaky>
But apparently man vim doesn't list ~/.vim/vimrc as one of its files.
10:34
<@Tarinaky>
So I'm confused how his vimrc gets invoked.
10:34
<@Tarinaky>
>.<
10:34
<@froztbyte>
~/.vimrc
10:35
<@froztbyte>
also start with this post, and then read the series: http://jonathan.jsphere.com/post/9227739351/taming-vim-1-introduction
10:36
<@Tarinaky>
I think he's symlinking .vimrc to point to .vim/vimrc...
10:36
<@Tarinaky>
Would I be right or am I leaping into madness?
10:37
<@froztbyte>
"Customizing Vim is two parts: editing rc files and installing plugins. You should already have a .vim/ directory with a vimrc and possibly a gvimrc"
10:37
<@froztbyte>
the way he writes it is a bit funny
10:37
<@Tarinaky>
I had a .vimrc
10:37
<@froztbyte>
but yeah, he probably symlinks it
10:37
<@Tarinaky>
As I said, man vim lists ~/.vimrc but not ~/.vim/vimrc
10:38
<@froztbyte>
yes, the ~/.vim/vimrc is probably just so that he can run the whole ~/.vim as a single SCM-controlled directory
10:38
<@froztbyte>
and split it off by itself
10:38
<@Tarinaky>
Makes sense.
10:38
<@froztbyte>
anyway, make .vimrc appear in ~ and your problem is solved
10:39
<@froztbyte>
urgh, DNS tickets
10:39
<@Tarinaky>
I will probably throw out most of it and start again though. I don't really want most of this :/
10:39
<@froztbyte>
killmenao
10:39
<@froztbyte>
Tarinaky: yeah, usually that's best
10:39
<@froztbyte>
it's nice to see what someone else has done, to take ideas and adapt for your own environment
10:40
<@Tarinaky>
Fun fact: copying a file onto a link copies said file onto the actual file and not the link/name/alias >.>
10:40
<@Tarinaky>
TIL!
10:40
<@Tarinaky>
Minor whoops.
10:41
<@froztbyte>
depends how you copy ;)
10:41
<@froztbyte>
vandali% cp --help | wc -l
10:41
<@froztbyte>
76
10:42
<@Tarinaky>
>.<
10:42
<@froztbyte>
fun idea: how many `ls` parameters do you know? :)
10:42
<@Tarinaky>
ls -a... --color...
10:42
<@Tarinaky>
There are others?
10:42
<@Tarinaky>
:p
10:42
<@froztbyte>
vandali% ls --help | wc -l
10:42
<@froztbyte>
117
10:42
<@Tarinaky>
So much for the UNIX philosophy of do one thing well~
10:43
<@froztbyte>
oh, it does one thing excellently
10:43
<@Tarinaky>
Then why does it have 117 functions :p
10:43
<@Tarinaky>
(To say nothing of the permutations)
10:43
<@froztbyte>
lines, not functions
10:44
<@froztbyte>
because you have different ways of interacting with a complex system
10:45
<@froztbyte>
do you want to see file sizes? only directories? do you want to see the last modification time? do you want to see those in human-friendly values? do you want to recurse the tree? do you want to recurse only a few levels? do you want to only match files with starting with zxoogabooga?
10:45
<@froztbyte>
etc
10:45
<@Tarinaky>
It was a joke.
10:45
<@froztbyte>
that said
10:45
<@froztbyte>
I highly recommend looking into /bin one day, and finding out what each binary does
10:46
<@Tarinaky>
I know enough to use it.
10:46
<@Tarinaky>
Honestly... I don't really need to know all 117 ls options.
10:46
<@Tarinaky>
-a and --color cover three 9s of my useage.
10:46
<@Tarinaky>
If I need anything else I'll use google or man as and when it happens >.>
11:04 * Tarinaky what the fucks.
11:07 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
11:08 * TheWatcher readsup
11:08
<@TheWatcher>
"Customising Vim is two parts: utter madness and screaming drooling madness"~
11:13
<@Tarinaky>
Trying to make vim replace eclipse on my laptop due to eclipse running poorly on anything ever.
11:18
<@Tarinaky>
The documentation /says/ that this plugin should be showing my my current branch.
11:18
<@Tarinaky>
It is not.
11:20 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
11:21 mode/#code [+o himi] by ChanServ
11:23
<@Tarinaky>
Ahah!
11:28
<@froztbyte>
which?
11:28
<@Tarinaky>
Apparently there was a dependancy that wasn't mentioned.
11:29
<@Tarinaky>
But Powerline + Fugitive.
11:29
<@Tarinaky>
Fugitive being git integration in vim.
11:29
<@froztbyte>
ah
11:29
<@froztbyte>
it's pretty unfortunate that the whole world is going git-mad
11:29
<@Tarinaky>
Powerline is a pretty status line, and if Fugitive is installed first it'll configure itself to use it.
11:29
<@Tarinaky>
Git was the first vcs I learned.
11:29
<@Tarinaky>
And it meets most my needs.
11:30
<@froztbyte>
yes, that's fine
11:30
<@froztbyte>
but it's a separate rant and I need to figure out this NM config syntax first
12:06
<@Tarinaky>
Am I doing something really stupid here?
12:07
<@Tarinaky>
If I perform :nmap <F8> :TagbarToggle<CR> inside a running vim then F8 opens and closes the Tagbar correctly.
12:07
<@Tarinaky>
If, however, I put nmap <F8> :TagbarToggle<CR> as a line in my .vimrc...
12:07
<@Tarinaky>
Nothing happens when I hit F8.
12:07
<@Tarinaky>
W.T.F?
12:07
<@Tarinaky>
Is there some whitespace I'm missing or what?
12:08
<@Tarinaky>
Oh yeah, obviously, I'm restarting vim after editing vimrc.
12:08
<@froztbyte>
hehe
12:13
<@Tarinaky>
Found the...
12:13
<@Tarinaky>
What?
12:18
<@Tarinaky>
ls -l shows what file a link points to right?
12:18
<@Tarinaky>
Apparently not.
12:19
<@Tarinaky>
Anyway, lectures.
12:31 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
12:42
<@froztbyte>
yes, it does
12:42
<@froztbyte>
also stat
12:47
<@Tarinaky>
Git checkout breaks hard links.
12:47
<@Tarinaky>
Which is surprising.
12:48
<@RStamer>
Also readlink.
12:52
< ErikMesoy>
How strict should I be about other objects going via an object's __call__() method (with appropriate parameteres about what is to be done) as opposed to other objects directly calling the methods of the object in question?
12:52
< ErikMesoy>
I'm pretty sure I can do it both ways, but there may be pitfalls I'm not seeing.
12:53
<@Tarinaky>
Call can be ugly and it may not be entirely clear what __call__()'s purpose is.
12:54
<@Tarinaky>
As opposed to do_that_thing() which self-comments that it does that thing.
12:54
<@Tarinaky>
It's just a sugar though so it's no big deal either way.
12:59
< JustBob>
And for my current moment of fun... Trying to reconcile MatLab and RefProp. Because god hates me.
13:02
<@gnolam>
RefProp?
13:03
<@gnolam>
Also, have you ever had to use MCNP?
13:06 Kindamoody|out is now known as Kindamoody
13:35 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
13:35 mode/#code [+qo Vornicus Vornicus] by ChanServ
13:42 Nemu [NeophoxProd@Nightstar-d161aa7e.asahi-net.or.jp] has quit [Ping timeout: 121 seconds]
13:47
<@RStamer>
http://www.theverge.com/2013/2/21/4012138/playstation-4-wont-block-used-games-sa ys-sony <-- totally looking forward to that feature lasting the entire lifespan of the PS4.
13:48
<@TheWatcher>
What, like PS2 backwards compatibility did for the PS3?
14:08
<@Tarinaky>
PS4 won't block used games. Capcom on the other hand~
14:36
<@Tarinaky>
Help.
14:36
<@Tarinaky>
Vim seems to have frozen.
14:36
<@Tarinaky>
I accidentally pressed Ctrl+S instead of escape,:w out of habit...
14:36
<@Tarinaky>
What did I do >.,
14:37
<@TheWatcher>
Ctrl+Q
14:37
<@TheWatcher>
you'd turned off output on the terminal
14:38
<@Tarinaky>
I figured I'd done something like that.
14:41
<@TheWatcher>
(Ctrl+S is XOFF, Ctrl+Q is XON. Can be useful if you need to stop scrolling for some reason, otherwise it's a pain in the arse~)
14:45
<@TheWatcher>
I would really love to work out why VirtualBox starts off nice and responsive and sane-CPU-usage, and by 20 hours of uptime it is lagging like a bitch, using 100% processor time on both host cores for no sane and tracable reason.
14:47
< Syk>
because virtualbox got comfy
14:48
<@Namegduf>
TheWatcher: That is very weird.
14:48
<@TheWatcher>
Yeah, yeah it is.
14:49
< ErikMesoy>
Python appears to be behaving as though None can have attributes. o_O
14:51
< ErikMesoy>
I have a function that's supposed to clear and set my current target by going "Target = None; Target = RelevantClass(); Target.labels.append("foo"), Target.labels.append("bar"). Calling this function [with semicolon -> newline, naturally] twice results in a Target object with 4 labels.
14:52
<&ToxicFrog>
...why bother setting it to None first in the first place?
14:53
< ErikMesoy>
Because it wasn't resetting properly and this was one of the measures I tried
14:54
<@Tarinaky>
What version of Python is this?
14:54
< ErikMesoy>
I'm not sure exactly what is going on, but it acts like Target's sub-attributes are persisting regardless of what the target itself is
14:54
<@Tarinaky>
Because I'm pretty sure None isn't an object in Python2.
14:54
< ErikMesoy>
2.7
14:56
< ErikMesoy>
I suppose setting it to None may be a dead chicken, but the issue remains that creating a new object for Target to point to doesn't clear out Target.labels. >_>
14:58
< ErikMesoy>
Well, if there are no obvious common mistakes that you see, I guess I'll work on reducing it to a minimal case and hopefully discovering the issue along the way.
15:01
<&ToxicFrog>
Are you sure RelevantClass() is returning a different object each time?
15:01
<@RStamer>
TheWatcher: that was my point
15:01
<&ToxicFrog>
Alternately, are you sure that target.labels is different for each instance of that class rather than all of them referencing the same value?
15:03
<~Vornicus>
None is an object
15:03
< ErikMesoy>
ToxicFrog: I expect RelevantClass.__init__ to return a new object each time. Is this wrong?
15:04 VirusHome is now known as Pandemic
15:04 mode/#code [+o Pandemic] by ChanServ
15:08
<&ToxicFrog>
I don't think so, but clearly there is something weird going on here
15:12
<@Tarinaky>
ErikMesoy: Write a test case?
15:13
<~Vornicus>
ErikMesoy: Show Me Your Code
15:25 * TheWatcher eyes this code, has one of those What Was I Thinking moments
15:25
<~Vornicus>
I get those a lot.
15:34
< JustBob>
gnolam - Belatedly, RefProp is the NIST reference properties database code, and it fucking sucks to integrate into anything unless you know exactly what you're doing.
15:34
< JustBob>
And I've used MCNP before. Once. By watching over someone's shoulder as they used it.
15:34
<@gnolam>
Everything in your previous sentence is true for it as well. >_>
15:35
<@gnolam>
Dammit
15:35
< JustBob>
There is, in theory, a recompiled matlab .m file that calls the refprop.dll for data.
15:35
< JustBob>
It does not seem to work well.
15:35
<@gnolam>
*Everything after the comma
15:35
< JustBob>
(By that, I mean, "at all.")
15:35
< JustBob>
Anyway, as I said...
15:35
< JustBob>
Run screaming to class trailing printouts.
15:35
< JustBob>
Only 356 pages today!
15:36
<@TheWatcher>
...
15:36
<@TheWatcher>
Those poor trees
15:38
< JustBob>
We get 1k pages free printing a term.
15:38
< JustBob>
I use about 2k.
15:38
< JustBob>
Now, claaaassssss
15:39
<@gnolam>
And "know exactly what you're doing" in its case means "you're one of its developers".
15:39
<@gnolam>
Mmm, lying documentation...
15:39
<@TheWatcher>
At least we now know the name of the Death of Trees.
15:40
<@TheWatcher>
He is Bob, and he walks amongst us.
15:51
<&ToxicFrog>
Tarinaky: you never use ls -h, -tr, or -l? o.O
15:51
<@Tarinaky>
ToxicFrog: He asked me how many I knew. And I forgot -l at the time.
15:51
<~Vornicus>
Erik: when you get around showing me your code, the most important thing is RelevantClass.__init__
15:52 Nemu [NeophoxProd@Nightstar-d161aa7e.asahi-net.or.jp] has joined #code
15:56
< ErikMesoy>
Vornicus: http://pastebin.com/jz2NXwae
15:57
< ErikMesoy>
That last print statement results in "Sidelist has ['left', 'right', 'left', 'right']" for me.
15:59 Kindamoody is now known as Kindamoody|out
16:02
<&ToxicFrog>
Woop woop woop
16:02
<&ToxicFrog>
Danger will robinson
16:02
<&ToxicFrog>
def __init__(self, labels=[]):
16:02
<&ToxicFrog>
That default value expression is evaluated when the function is closed, not when it's called.
16:02
<&ToxicFrog>
Every call to SideList.__init__ gets the same list for labels.
16:03
< ErikMesoy>
Oooooh. Interesting.
16:03
< ErikMesoy>
Now, my first response is to change "self.labels = labels" by adding "[:]" on the end, but that's an ad hoc hack.
16:03 Nemu_ [NeophoxProd@Nightstar-19c092df.asahi-net.or.jp] has joined #code
16:04
< ErikMesoy>
Hmmmm. When is init closed, anyway?
16:04
< ErikMesoy>
When the object is no longer in use?
16:04
<&ToxicFrog>
Er
16:04 Nemu [NeophoxProd@Nightstar-d161aa7e.asahi-net.or.jp] has quit [Ping timeout: 121 seconds]
16:04
<&ToxicFrog>
By "closed" I mean "when the function is fully instantiated as something you can call"
16:04
< ErikMesoy>
oh
16:04
<&ToxicFrog>
I'm not sure exactly when this happens but it'll be sometime around when the class definition is processed by the interpreter
16:05
<&ToxicFrog>
The default value is computed when that definition is processed and baked into the function, rather than being re-evaluated on each call.
16:05 * TheWatcher eyes
16:05
< ErikMesoy>
And the default value is editable?
16:06
<@TheWatcher>
... I'm just going to be over here, with my "madness inducing" perl~
16:06
<&ToxicFrog>
ErikMesoy: er. Python lists are mutable, yes.
16:07
< ErikMesoy>
and tuples aren't, right, but I didn't expect default parameters to be editable (as a function of use/position, not type)
16:07
<&ToxicFrog>
Default parameters are not magical in any way. If you have a mutable value as a default parameter it's still mutable.
16:08
<&ToxicFrog>
And since they're evaluated once at function creation time, each call that uses the default value gets the same default value.
16:08
<&ToxicFrog>
Including any mutations made to it.
16:09
< ErikMesoy>
And it isn't so much a value as a point
16:09
< ErikMesoy>
*pointer
16:09
<&ToxicFrog>
Off the top of my head, the way around this would be something like:
16:09
<&ToxicFrog>
def __init__(self, labels=None): self.labels = labels or []
16:09
<&ToxicFrog>
Unless you want to copy labels if they pass their own in
16:09
<&ToxicFrog>
That's kind of lua-y and may not be idiomatic Python, though; consult the Vornicus
16:10
< ErikMesoy>
So, basically, Python is even more reference-passing and not-copying than I thought?
16:10
<~Vornicus>
oh oh god
16:10
<&ToxicFrog>
...maybe? Personally the bit that surprises me about this behaviour is the only-evaluated-once part, nothing to do with copy/reference semantics.
16:11
<&jerith>
Python passes everything by reference.
16:11
<~Vornicus>
yeah, the only-evaluated-once part is the surprise to me as well. It's often cited as the worst part of Python
16:12 Nemu_ [NeophoxProd@Nightstar-19c092df.asahi-net.or.jp] has quit [Ping timeout: 121 seconds]
16:12
<&jerith>
It's just that you don't really notice it with immutable types.
16:13
<&jerith>
I've never heard of only-evaluated-once being the worst part of Python, though.
16:13
< ErikMesoy>
And most default parameters (strings, numbers) are immutable. I see.
16:14
<&jerith>
You can quite safely use [] and {} as default args if you make sure you never mutate them.
16:14
< Syk>
i very much enjoy python's reference passing
16:14
<&jerith>
Same as class attributes.
16:14
< Syk>
because it lets me pass a twisted request down functions
16:15
< Syk>
i dunno if it's Best Practice, but I like having functions that can call request.write() directly
16:15
<&jerith>
Syk: Is this for twisted.web?
16:15
< Syk>
yes
16:16
< Syk>
I've not a chance to do much with other protocols in twisted
16:16
< ErikMesoy>
I like the reference passing too, such as when I can store a bunch of functions in a dictionary and then call something like dictionary[element]()
16:16
<&jerith>
You have to do it that way unless you can get your entire response body in one go without any I/O.
16:17
<&jerith>
Anyway, you're not actually passing "references". You're passing objects.
16:17
<&ToxicFrog>
ErikMesoy: what does that have to do with reference passing?
16:17
< Syk>
well you're passing an object by reference, right?
16:17
< ErikMesoy>
fine, object passing.
16:17
< ErikMesoy>
being able to pass anything and everything around
16:17
<&ToxicFrog>
jerith: well, you're passing objects by reference rather than by value; x = Object(); y = x; results in two references to the same object, not two identical but distinct objects.
16:18
< ErikMesoy>
ToxicFrog: I couldn't store functions like that in other languages I've worked in
16:18
<&jerith>
ToxicFrog: "reference" doesn't really have any meaning in Python.
16:18
<&ToxicFrog>
Vornicus: it may be the most surprising, but personally there's a bunch of stuff I'd class as "worse"
16:18
< ErikMesoy>
functions in Python are well-behaved objects that I can store and pass
16:18
<&ToxicFrog>
jerith: this is "reference" in the computer science sense, not the C++ language feature sense
16:18
< ErikMesoy>
So. Am I likely to get myself in trouble if I use self.labels = labels[:] for cheap copying?
16:18
<&ToxicFrog>
ErikMesoy: yeah, that has nothing do with pass-by-reference vs. pass-by-value and everything to do with functions being first class values in the first place, which is a common feature of HLLs
16:19
<&ToxicFrog>
Although in practice I don't know of anything that does first-class pass-by-value functions~
16:21
<&jerith>
ToxicFrog: "reference" in the computer science sense is only really meaningful at low levels.
16:21
<&ToxicFrog>
jerith: erwhat
16:22
<&ToxicFrog>
Unless Everything Is Immutable, "assignment copies the value" and "assignment creates a new reference to the same value" is in fact a meaningful distinction even at high levels of abstraction
16:22
<&ToxicFrog>
replace "assignment" with argument/RV passing as needed
16:23
<&jerith>
In that case, everything in Python is references.
16:23
<&jerith>
Since assignment never copies.
16:24
<&ToxicFrog>
Yes.
16:27
<~Vornicus>
ErikMesoy: beeter might be to use self.labels = list(labels)
16:27
<~Vornicus>
(to say nothing about what is turniper.)
16:29
<&jerith>
somelist[:] is the idiomatic way to copy a list in Python.
16:29
<&jerith>
somedict.copy() does the same dicts.
16:29
<~Vornicus>
I always hated that, actually
16:30
<&jerith>
I'm not a huge fan of it myself.
16:30
<@Tarinaky>
Doesn't list have a copy method as well?
16:30
<@Tarinaky>
If not, that's silly.
16:30
<&jerith>
Nope.
16:30
<~Vornicus>
It means if I'm pulling in things that for some reason are tuples or otherwise not a list, but I need a thing that acts like a list, I'm stuck
16:30
<@Tarinaky>
That's silly.
16:31
<&jerith>
Vornicus: sometuple[:] works as well.
16:31
<&jerith>
Although it's basically a NOP, since tuples are immutable.
16:32
<~Vornicus>
"works" in that it creates another tuple. If I need it to act like a list that doesn't help me.
16:33
<&jerith>
Actually, list(somelist) does copy the list.
16:33
<@Tarinaky>
Umm... Tuples aren't lists? Asking one to behave like a list is silly?
16:33
<&jerith>
Shallow copy, of course.
16:33
<&ToxicFrog>
Tarinaky: tuples are immutable, for starters
16:33
<~Vornicus>
jerith: that's what I'm aiming at
16:34
<@Tarinaky>
ToxicFrog: Well, yeah... That's like the main difference between a tuple and a list in Python.
16:34
<@Tarinaky>
A mutable tuple is a list. >.>
16:34
<&jerith>
Vornicus: list(not-a-list-or-tuple) can do strange things, though.
16:35
<&jerith>
list(somedict) returns a list of the dict's keys.
16:36
<&jerith>
If you want a straight copy, foo[:] is guaranteed to return a shallow copy of anything that supports slicing and throw an exception on anything else.
16:38
<&ToxicFrog>
Tarinaky: yeah, that was my point - no, tuples aren't lists, and whether asking one to behave like a list is silly depends on what parts of "behave like a list" you need.
16:38
<@Tarinaky>
As far as I am aware, the only differences in the language is mutability and indexing.
16:39
<@Tarinaky>
You can pack and unpack lists in later versions of python2.
16:39
<&jerith>
Indexing's the same for both.
16:39
<&jerith>
Mutability and hashability are the only real differences.
16:40
<&jerith>
The only time I've ever had a problem with the difference was trying to concatenate lists and tuples.
16:56
<@Tarinaky>
There's something wrong when intro to probability lectures don't cover anything you haven't picked up from playing Dungeons and Dragons (or other RPGs of choice)
16:57
< ErikMesoy>
No there's not.
16:58
< ErikMesoy>
Intro to probability lectures are, I presume, also supposed to explain the material for the benefit of jocks.
16:58
<@Tarinaky>
CS students.
16:58
<@Tarinaky>
It's part of the second AI module.
16:59
<@Tarinaky>
I mean, what kind of a CS student are you if you can't calculate DPS in your favourite game :/
16:59
< ErikMesoy>
Oh.
17:21
<@Haeroe>
No true computer scientist
17:27 * Vornicus has secretly replaces Haeroe with a scotsman. Let's see if anyone notices.
17:41 Attilla [chatzilla@Nightstar-aced750e.range86-184.btcentralplus.com] has quit [Ping timeout: 121 seconds]
17:42 Attilla [chatzilla@Nightstar-8c2dcf13.range86-177.btcentralplus.com] has joined #code
17:45 Attilla [chatzilla@Nightstar-8c2dcf13.range86-177.btcentralplus.com] has quit [NickServ (GHOST command used by Attilla_)]
17:46 Attilla [chatzilla@Nightstar-14bf3d91.range109-151.btcentralplus.com] has joined #code
17:48 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
17:48 mode/#code [+o celticminstrel] by ChanServ
17:48 Kindamoody|out is now known as Kindamoody
17:54
<@Tarinaky>
http://www.codecrap.com/content/best/
17:57 Syk is now known as syksleep
17:57
<~Vornicus>
I like the "dear maintainer" one
17:58
<~Vornicus>
I'm not even sure what the try/finally thing there does, that looks, um
17:58
<@Tarinaky>
# define true (rand() > 10)
17:58
<~Vornicus>
I've got nothing.
18:03
<&jerith>
I quite like the implications of $hash = sha1(crc32(md5($_POST['password'])));
18:04
<~Vornicus>
that's really, really hashed.
18:04
<&jerith>
There is absolutely nothing right about that line.
18:05
<@Haeroe>
What language is that?
18:06
<&jerith>
PHP.
18:06
<@Haeroe>
Wait, doesn't crc32 return.. an int?
18:07
<&jerith>
In PHP, I'd expect it to return spiders.
18:07
<&jerith>
Or maybe a giraffe, but only on alternate Thursdays.
18:07
<@Haeroe>
Which means that there are 2^32 different hashes
18:08
<&jerith>
Firtly, any normal hash function is a really poor fit for password storage.
18:09
<&jerith>
Secondly, multiple hashes like that actually increase the chance of collisions.
18:10
<&jerith>
Thirdly, the password has obviously just been sent over the intertubes in plaintext.
18:10
<@Tarinaky>
Lets be fair, maybe it hasn't and he's hasing it some more?
18:11
<@Tarinaky>
I mean, that'd probably manage to be worse.
18:11
<&jerith>
(It's *possible* that they're using SSL. Given that line of code, I doubt it.)
18:11
<@Tarinaky>
Also: you could say he's... Making a hash of it.
18:11 * jerith stabs Tarinaky in the face with a pair of sunglasses.
18:11
<@Tarinaky>
jerith: The code snippit came to light, that implies there was someone capable of inflicting violence on him for it.
18:19
<~Vornicus>
wat http://www.codecrap.com/content/219/
18:20
<@Tarinaky>
Heh.
18:28
<@Tarinaky>
What would you call a point on a graph that doesn't have a derivative, but is defined?
18:29
<@Tarinaky>
Or rather, is finite at least.
18:29
<~Vornicus>
like (0,0) in |x|?
18:30
<@Tarinaky>
Actually... Never mind, I'm being thick.
18:31
<@Tarinaky>
I have a graph/plot of a shape on a graph, but one of the x-coordinates has two y-coordinates.
18:31
<@Tarinaky>
s/shape/polygon/
18:31
<@Tarinaky>
Obviously this means it's not a function at all.
18:32
<~Vornicus>
depending on how it acts: that's a "corner"; the floor function has a "jump"; the kronecker delta has a "misplacement", and the cube root function has a "vertical"
18:39 Attilla [chatzilla@Nightstar-14bf3d91.range109-151.btcentralplus.com] has quit [Ping timeout: 121 seconds]
18:40
<@Tarinaky>
Weapons grade muppetry.
18:42 Attilla [chatzilla@Nightstar-87646183.range86-143.btcentralplus.com] has joined #code
19:40
<@Tarinaky>
http://www.dadhacker.com/blog/?p=1911
19:41 Kindamoody is now known as Kindamoody[zZz]
19:46
<&ToxicFrog>
"2. When you do that, get management buy-in at the right time. Like, when you have things largely working and you've dealt with (or at least can enumerate) most of the risk."
19:47
<&ToxicFrog>
That sounds like a really great way to get things largely working and then have it all thrown out and be bitched out for working on that rather than what you've been assigned.
19:50
<@Tamber>
And then bitched at *again* when the project flies like a Pb balloon due to the stupidity you were trying to replace. :p
19:50 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
19:52
<@Tarinaky>
Never said it was good advice.
19:53
<@Tarinaky>
It is, however, a good story.
20:08
<@Tarinaky>
http://i.imgur.com/S9arY2q.png Nearly finished the visual mock-up of the first screen.
20:09
<@Tamber>
:o
20:09
< ErikMesoy>
Nice.
20:10
<@Tarinaky>
Need to refactor some of those elements to be... well... reuseable 'groups'.
20:10
<@Tarinaky>
Well, need to get the Corporation Name entering thing working first.
20:10
<@Tarinaky>
That's going to be the real nightmare.
20:10 Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has joined #code
20:10 mode/#code [+ao Derakon Derakon] by ChanServ
20:10 * Derakon winces quietly at the problem his boss wants him to work on.
20:11
<@TheWatcher>
uhoh
20:11
<&Derakon>
I wrote a program awhile back that does 5D data visualization.
20:11
<&Derakon>
The wavelengths are color, time, Z, Y, and X.
20:11
<@Tarinaky>
If I can get away with it, without it being too much work for the sake of it, I might see if I can do the actual game rendering (when I get to it), in C.
20:11
<@Tarinaky>
Just so I have some C in my Github account :/
20:11
<@TheWatcher>
Let me guess, he wants you to add an extra dimension: spicyness?
20:11
<&Derakon>
Obviously you can only display three of these dimensions at a time on a computer display.
20:12
<@TheWatcher>
Well, unless you want to fuck with people's brains by projecting 5 dimensional space into 2D
20:12
<&Derakon>
So I added a system to let you do a max-intensity projection through one of the orthogonal axes, which basically gives you the highlights of one of the other axes.
20:12
<&Derakon>
But that leaves one axis hidden.
20:12
<&Derakon>
This is apparently Not Good Enough.
20:13
<&Derakon>
Where we get into trouble is that the program is primarily not so much for visualization as it is for transformation.
20:13
<&Derakon>
That is, the different wavelengths (colors) of a dataset tend to be misaligned, so the program can do the necessary transformations to align them properly.
20:14
<&Derakon>
This is pretty hairy math to do efficiently.
20:14
< JustBob>
Let's see here... I have 24:55 before homework is due and 25:55 before midterm is due. Time to start drinking.
20:14
<&Derakon>
It gets a lot worse when you do one projection.
20:14
<&Derakon>
But when you want to do two projections, you are automatically considering the entire dataset.
20:14
<&Derakon>
It is functionally impossible to double-project a transformed dataset with any kind of efficiency.
20:15
<&Derakon>
So either I have a horribly slow system or I don't allow projecting of transformed data; either way the program sucks.
20:15
<&Derakon>
(Also double-projecting transformed data is a bear to program)
20:15
<@Tarinaky>
I'd go with the suckiness that's less work.
20:16
<&Derakon>
You assume I have a choice in the matter.
20:16 celticminstrel is now known as celmin|busy
20:16
<@Tarinaky>
You did imply you had one, yes.
20:20
<@TheWatcher>
This has to be done in realtime, you can't cache the transformed data and then visualise that?
20:20
<@TheWatcher>
(to me, it sounds like it should be two separate tools, in fact)
20:20
<&Derakon>
It's an interactive program. You can drag wavelengths around to change their transformations.
20:21
<@TheWatcher>
Wait
20:21
<&Derakon>
And yeah, the main problem here is that my boss is way more interested in the visualization aspect than the transformation aspect.
20:21
<&Derakon>
(And the only thing the program is actually used for is transformation, since somehow all other existing tools get this important task very, very wrong)
20:21
<@TheWatcher>
Interactively transforming in 5D space, great fun
20:22
<&Derakon>
Well, two of the axes are never transformed.
20:22
<&Derakon>
Those being color (wavelength of light) and time.
20:22
<&Derakon>
The transformation is an XYZ translation, a rotation, and an XY scaling.
20:23
<@TheWatcher>
hm. How much data is this, anyway?
20:24
<&Derakon>
Highly variable, but for the stuff my boss is interested in we're talking hundreds of MB.
20:24
<@TheWatcher>
I kinda guessed you were going to say that
20:29
<&Derakon>
Ehh, I think I'll just disable multi-projections on transformed data.
20:29
<&Derakon>
In all likelihood nobody will even notice.
20:29
<&jerith>
Derakon: I know a couple of companies in your area that are hiring... *hides*
20:29
<@TheWatcher>
I'd also suggest trying to find places it can be massively parallelised if possible.
20:30
<&Derakon>
TW: most of the heavy lifting is being done by single Numpy operations.
20:30
<@TheWatcher>
Then tell him you need a 64/128 core rig~
20:30
<@TheWatcher>
Ah, egh
20:30
<&Derakon>
...hm, but there is a piecewise bit in transformArray. I could parallelize that.
20:31
<&Derakon>
Good call~
20:31
<&jerith>
Derakon: Just use numpypy.
20:31
<&jerith>
And shout at fijal if it doesn't work for your code.
20:31
<@TheWatcher>
... do pything people try to make things better just by adding more 'py's to the end or something~
20:31
<@TheWatcher>
*python
20:32
<&ToxicFrog>
Apprently
20:32 * TheWatcher needs more tea, damnit. Why is my mug not refilling?
20:32 * Derakon AFKs for a bit.
20:32
<&jerith>
TheWatcher: numpypy is a rewrite of certain core bits of numpy in a combination of pure Python and RPython.
20:33
<&jerith>
This means pypy's JIT can make it fast.
22:02 celmin|busy is now known as celticminstrel
22:05 ErikMesoy is now known as ErikMesoy|sleep
22:09
<&McMartin>
[MacOS] zarf says, "oo, textwrangler update"
22:09
<&McMartin>
[MacOS] zarf | (Side note: "If you don't, I'll poison your dinner" is a compelling argument for a feature request, but can typically only be used once.)
22:19
<&Derakon>
ISTR you said that earlier...
22:20
<&Derakon>
Maybe not in this channel though.
22:21
<&McMartin>
... yes, but you aren't logged into that network.
22:22
<&Derakon>
Hm, my logs only show it once. How curious. I'm positive I saw it before, somewhere.
22:23
<&McMartin>
You also aren't logged in to the place where zarf typed it, like ten minutes ago
22:23
<&McMartin>
Either a hash collision or you yourself were reading textwrangler update notes?
22:23
<&Derakon>
Well, then he must have gotten it from somewhere else.
22:24
<&Derakon>
Either that or I'm suffering unusually coherent deja vu.
22:27
<&ToxicFrog>
It shows up in the wild last year, if not earlier
23:05 Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has quit [[NS] Quit: leaving]
23:33 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
--- Log closed Fri Feb 22 00:00:03 2013
code logs -> 2013 -> Thu, 21 Feb 2013< code.20130220.log - code.20130222.log >

[ Latest log file ]