code logs -> 2013 -> Wed, 30 Jan 2013< code.20130129.log - code.20130131.log >
--- Log opened Wed Jan 30 00:00:11 2013
00:06 syksleep is now known as Syk
00:17 himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds]
00:27 Thalasleep is now known as Thalass
00:30 You're now known as TheWatcher[T-2]
00:33 You're now known as TheWatcher[zZzZ]
00:35 himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code
00:35 mode/#code [+o himi] by ChanServ
00:38
< Thalass>
augh for some reason my FTDI usb-serial picaxe programming cable no longer mounts. At all. bah
01:41 Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has quit [NickServ (GHOST command used by Derakon[AFK])]
01:41 Derakon[AFK] is now known as Derakon
02:13 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
02:13 mode/#code [+qo Vornicus Vornicus] by ChanServ
02:25 Attilla [Attilla@Nightstar-9e7fa2b2.range86-162.btcentralplus.com] has quit [Ping timeout: 121 seconds]
02:30
<~Vornicus>
TF: you could just keep track of the binds that have been made for pad stuff
02:32
<@simon`>
Derakon, recommended cluster analysis in order to group integers that are close to each other. the wikipedia article on cluster analysis mentions quite a lot of methods for different objects, distribution-based cluster analysis, graph-based, for higher-dimension points, etc., but I can't determine what the easiest approach is for just one-dimensional numbers.
02:32
<@simon`>
can anyone recommend a method for that?
02:33
<@simon`>
a quick google search gives me a linear programming approach. I was hoping for something slightly simpler.
02:34
<&Derakon>
Honestly about all I know about the topic is its name; I've never had to do it myself.
02:47 Kindamoody[zZz] is now known as Kindamoody
02:49 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
02:51 * Vornicus pokes at skill selection restrictios
02:59
<@Reiv>
skill selection restrictions what
03:03
<&Derakon>
If you take the tanky reduce-damage skills then you can't be an agile acrobat, that kind of thing?
03:16
<@simon`>
k-means. I've asked this before. :(
03:19
<~Vornicus>
Reiver: okay so, 4e
03:19
<~Vornicus>
Your class gives you a skill list; you pick some number of skills from it and those are your trained skills. Most classes also have forced skills that you must take.
03:20
<~Vornicus>
(Wizards for instance must take Arcana)
03:20
<~Vornicus>
Your race also sometimes gives you additional skills to train for: humans get an extra skill from their class skill list, eladrin get an additional skill that they can pick from the entire list.
03:21
<&Derakon>
Are rogues still skill bitches in 4e?
03:22
<@RobinStamer>
No
03:22
<@RobinStamer>
Everyone gets the same amount of skill points
03:22
<~Vornicus>
And then you have the skill training feat, which gives you the ability to pick one skill from the entire list. And fginally there's the multiclass feats, which give you another additional skill, which is either forced (multiclassing to Wizard gives you Arcana) or a selection from that class's skill list (rangers let you pick any skill from the list)
03:22
<~Vornicus>
RobinStamer: not true!
03:22
<@RobinStamer>
Except a few cases where it's +/-1
03:22
<@RobinStamer>
Derakon: I assume you're fairly familiar with 3.5?
03:23
<~Vornicus>
Rogues are actually quite skilly - they get 6 skill selections (two forced), which is the most.
03:23
<&Derakon>
Robin: it's the last system I played in, so more or less, yeah.
03:24
<~Vornicus>
They are not, however, the best choice if you wish to be good at skills: Bards are, because their class list contains all but three skills, and they get bonuses to skills they aren't trained in.
03:24
<~Vornicus>
(Fighters and Barbarians are the worst; they get just three skill selections apiece)
03:25
<@RobinStamer>
Skill selections are basically just a flat +3 to that skill IIRC.
03:25
<~Vornicus>
+5
03:25
<@RobinStamer>
You can't ever raise that amount except by going up a level or increasing the trait or buying a feat just for that.
03:26
<~Vornicus>
You become more generally skilled as you level (you get +1 to all attacks, defenses, and skills at each even level)
03:26
<~Vornicus>
YOu can get skill focus and skill mastery feats for an additional +3 and +2 respectively
03:28
<~Vornicus>
This helps, somewhat, to reduce the amount of ridiculous unevenness in skill levels: it's no longer as simple to come up with something one character can do trivially that another finds totally impossible.
03:28
<~Vornicus>
Anyway
03:30
<~Vornicus>
My difficulty here is that I need to figure out, given a list of skill selections, 1. whether it's a valid selection, 2. what the smallest change is that can make an invalid selection valid, and 3. given an already-valid selection, what one-selection changes will give another valid selection.
03:30
<@RobinStamer>
What makes invalid selections?
03:31
<@RobinStamer>
Because IIRC, if you're doing it like 4e, there really isn't much that makes it invalid.
03:31
<~Vornicus>
RobinStamer: in the simplest case (a fighter who is neither human nor eladrin), a skill that isn't on the class skill list would make it invalid.
03:32
<@RobinStamer>
Oh right, 4e fucked that up too
03:32
<~Vornicus>
In the most complicated case, it's, well, more complicated: an eladrin rogue multiclassing to ranger must have stealth and thievery, plus four from the rogue's skill list, plus one more from the ranger's skill list, plus one more from all skills.
03:32
< Xires>
...no more cross-class skills??
03:32
<@RobinStamer>
Eitherway, that's a simple problem.
03:33
<@RobinStamer>
Xires: no more multi-classing except for two watered down alternatives.
03:33
<~Vornicus>
Xires: in 4e, you can train in skills not on your list by spending a feat, at which point you may choose any of the skills in the game (there's only 17)
03:33
<~Vornicus>
you don't get ranks.
03:33
< Xires>
....sounds limiting
03:34
<~Vornicus>
Xires: I always hated hated hated 3e's skill system.
03:34
<@RobinStamer>
Just compare list A (skills they chose) to list B (skills they're allowed) if A contains any that B doesn't it's invalid
03:34
< Xires>
Vornicus; I only played 3.5e & now '3.75'
03:34
< Xires>
at least in that system
03:34
<@RobinStamer>
Xires: All of 4e is about limiting choices so that the game is balanced.
03:35
<~Vornicus>
RobinStamer: not necessarily that easy; see the complicated case.
03:37
<@RobinStamer>
Vornicus: Then make sure that you have 4 checks that take profile data, do them seperately: meetRacialSkills(), meetPrimarySkills(), meetSecondarySkills() [return true if there's no second class], allSkillsAllowed() [this is the check I explained above). Then any mandatory skills are just forced in.
03:39 * Vornicus tries to describe the situation where it doesn't feel like it would work: what if one of the primary skills is also a secondary skill? in the rogue-ranger case, this is already true: stealth is required of rogues, but is on the ranger's class list.
03:40
<@RobinStamer>
Right, so the mandatory skill makes the secondary skill check pass. I see no issue there.
03:40
<~Vornicus>
then the secondary skills check would "pass" because there indeed is a secondary skill on the list, but it's also certainly not the secondary skill "selected".
03:41
<~Vornicus>
You gain one from the ranger's list - this is /after/ you get Stealth from being a rogue in the first place.
03:41
<@RobinStamer>
... or if that's a rules violation, just disallow selection of mandatory skills, but don't add said skills to the list of skills to check off.
03:42 * Vornicus thinks he might be better off having the computer come up with the complete list of all possible skill selections and just checking to see if the suggested skill selection is on there!
03:43
<@RobinStamer>
Uhh
03:43 * ToxicFrog determines that adding networked remote control capability to emufun would be trivial
03:43
<&ToxicFrog>
It may in fact end up being smaller, in total, than the joystick handling code~
03:45
<@RobinStamer>
Alternatively, you could use a fun game's skill system, as those tend to be simpler.
03:46
<~Vornicus>
I still don't know how 3e's skill system interacts with multiclassing.
03:46
<&Derakon>
I'd assume that when you gain a level in a given class, you get to pick skills from that class, or else pay the crossclassing penalty.
03:47
<@RobinStamer>
IIRC it's just "any skill you have as either class' class skill is a class skill to you, any remaining skills that are cross-class for either are cross-class for you."
03:47
<&Derakon>
Ah.
03:47
<@RobinStamer>
Otherwise extreme multiclassing quickly out-grows that otherwise fairly well-designed character sheet.
03:49 simon` is now known as sshine
03:50
<~Vornicus>
The way I sort-of understood it, ranks you pick up at a particular level can be applied as in-class /for only the class that you have picked that level for/
03:52
<~Vornicus>
(I don't have a 3e or 3.5e manual on me, or I'd quote you chapter&verse on how I came to that conclusion)
03:54
<&ToxicFrog>
I do! hang on
03:55
<@RobinStamer>
If a skill is a class skill for any of a multiclass character's classes, then character level determines a skill's maximum rank. (The maximum rank for a class skill is 3 + character level.)
03:55
<@RobinStamer>
If a skill is not a class skill for any of a multiclass character's classes, the maximum rank for that skill is one-half the maximum for a class skill.
03:55
<&ToxicFrog>
Wait. Balls. I could have sworn I had 3e sourcebooks around here somewhere.
03:55
<&ToxicFrog>
RobinStamer: it's not max rank that's at issue but how many points you need to spend to advance the skill.
03:57
<&ToxicFrog>
Specifically, can you gain a level in one class but spend points in the class skills of other classes you have at a 1:1 ratio.
03:57
<&ToxicFrog>
ISTR the answer is yes but am not entirely confident in that.
03:59
< Xires>
fiancee has a calculus test tomorrow that she's having difficulty studying for...someone teach me calculus real quick so I can help?
03:59
<@RobinStamer>
Also Vornicus is correct. You buy them as skills as if the class you raised was your only class.
03:59
<@RobinStamer>
Which raises the character sheet issue :/
04:00
<&ToxicFrog>
I am looking at the PHB right now and it is hella ambiguous about this.
04:00
<~Vornicus>
Xires: bring her on here and I will calculus her until she can be calculus'd no more.
04:01
<~Vornicus>
( #math )
04:01
< Xires>
Vornicus; ...that sounds dirty...
04:01
< Xires>
I'll see if I can convince her
04:01
<~Vornicus>
Xires: well, okay fine. But still!
04:01
<&ToxicFrog>
The section on multiclassing says that skills that are class skills for any of your classes count as class skills full stop for the purpose of calculating maximum skill rank, but says nothing regarding improvement costs.
04:02
<&ToxicFrog>
(or that they are now considered class skills in all regards)
04:02
<@RobinStamer>
ToxicFrog: look at the multiclass example
04:02
<@RobinStamer>
Also there might be errata, I didn't check for that.
04:03
<&ToxicFrog>
Oh, there it is
04:03
<&ToxicFrog>
"advancing a level" on p60
04:03
<@RobinStamer>
Reading errata now
04:03
<~Vornicus>
(but yes: I am an actual honesttopete math tutor)
04:03
<&ToxicFrog>
Not to be confused with "advancing a level" on p58, or any of the like four other places one might plausibly look for information on how multiclass skills are handled
04:04
<&ToxicFrog>
I swiftly recall how much I dislike this ruleset
04:05
< Xires>
Vornicus; perhaps later
04:06
<~Vornicus>
righto. I'm here for 7 more hours tonight.
04:06
< Xires>
it's about limits and she's convinced that her head may explode
04:06
<~Vornicus>
Limits are a little bit headexplodey until they click together.
04:06
< Xires>
well, it's 2200 here so she'll probably be heading to bed in like 30 minutes to get some sleep before her morning class
04:07
<~Vornicus>
k. well, whenever
04:07
< Xires>
yeah..I don't quite understand it, myself...I mean, I didn't even really attend highschool so I missed out on a lot of math..but it still makes sense to me
04:07
< Xires>
calculus is unfortunately one of those things that requires prior knowledge of several other things that I've yet to learn but I can still step through the logic
04:08
< Xires>
I learned basic trig in a couple hours for some game dev stuff that was needed but calculus seems it might be a bit more demanding
04:09
<&ToxicFrog>
Calculus took a while to click for me, but once it did, it was delicious
04:09
<&ToxicFrog>
I haven't found a single use for it in my domain outside basic high-school derivatives/integrals, though~
04:09
< Xires>
I think she's having issues 'cause she's more a sadist than a masochist
04:10
< Xires>
and she can't handle the role-reversal
04:10
<~Vornicus>
I always say that calculus is easier to actually learn than basic algebra, mostly because when you hit calculus you have all the tools.
04:10
<~Vornicus>
04:10
<&ToxicFrog>
Vornicus: that was not at all my experience, have to say
04:11
<&ToxicFrog>
Algebra I took to immediately, high school calculus took me nearly half the semester to get a handle on and I still don't feel like I ever achieved competency at Calc II in university
04:11
<~Vornicus>
Calc 2... integrals, applied integrals, integration techniques?
04:12
< Xires>
http://imgur.com/jShA8dL
04:12
<~Vornicus>
Xires: :(
04:13
< Xires>
why with the sad face? too off-topic?
04:14
<~Vornicus>
no, it's just terrible
04:16
<&ToxicFrog>
Vornicus: basic integrals/integration techniques were Calc I. Calc II I vaguely recall involved infinite sequences and functions to define 3d volumes and whatnot.
04:16
< Xires>
<fiftysixer> http://i.imgur.com/hjFyz1a.jpg
04:16
< Xires>
<fiftysixer> that's me on the right
04:16
< Xires>
better?
04:17
<~Vornicus>
Your friend is an elk now.
04:17
<~Vornicus>
oh, right, infinite sequences.
04:17
< Xires>
"There are only 10 types of people in the world...and 1 of them is wrong."?
04:17
<~Vornicus>
I forgot that was in there.
04:18 * Xires goes away to study on the secrets of humor
04:19
<~Vornicus>
"there are 10 types of people in this world: those who understand ternary, those who don't, and those who think this joke is about binary"
04:20
< Syk>
snrk
04:20
<@sshine>
I like that one.
04:21
<@sshine>
I usually tell it like: those who understand binary, those who don't, and those who mistake binary for ternary."
04:22 * himi adds a fourth class: those who understand that "10" is just a pair of letters if you don't know what base it's in
04:25
<@Rhamphoryncus>
What about those who only thought it was funny the very first time they heard it?
04:26
<@himi>
So that's five classes now . . .
04:26
<~Vornicus>
good lord
04:27
<@sshine>
somehow the symbols "10" seem to manage an expansion of cases. I'm amazed!
04:28
<@himi>
Sorry, I shouldn't have brought classes into it - you know how they have a habit of breeding like rabbits
04:29
<&ToxicFrog>
I miss macros so much
04:50
<~Vornicus>
why do you miss macros today?
04:51
<&Derakon>
He ate a poison mushroom.
05:00
<@sshine>
I miss never having abused macros.
05:03
< Xires>
macro abuse is pretty awesome..confuses the fsck out of instructors
05:04
< Xires>
especially if you use 'em to intermix C coroutines & a poor excuse for templates
05:05
<&Derakon>
Y'know, if I confused my instructors, they'd generally mark down my program rather substantially.
05:05
<&Derakon>
Only maybe 30% of the grade was for producing a working program.
05:08
<&ToxicFrog>
Vornicus: because I'm abusing HOFs in a way that would be so much prettier if I could splice in arbitrary ASTs
05:08
<&ToxicFrog>
And I feel like there's got to be a better way to do this that doesn't require macros, but I'm having trouble getting my head out of macrospace
05:09
<@Reiv>
what are you *doing*
05:11
<&ToxicFrog>
Implementing a configuration language for emufun, part of which involves generating lots of quite similar functions for doing easy testing against various node properties
05:12
<&ToxicFrog>
Nothing particularly weird, really.
05:15
< Xires>
Derakon; it was some basic C course and I was tired of bowing to the instructor when I spent 2 hours every day 'teaching' the other students 'cause the instructor didn't have time for the class
05:16
< Xires>
far too interested in his own shit to be bothered
05:18
<@sshine>
Xires, I was thinking of Lisp macros.
05:18
<&Derakon>
I had suffered a momentary failure of memory and was thinking of Angband macros (wherein you bind a series of inputs to a single key to e.g. cast Firebolt at the nearest enemy)
05:19
< Xires>
sshine; ah, K
05:20 * sshine is going to do an interesting project: I've got a functional language with map, reduce, scan, etc. for arrays rather than lists, and I have to come up with some kind of intermediate representation of how the composition of array combinators affect the array indices (if regarding the combinators as synonymous to some imperative loop construct that indexes them directly)
05:22
<@Alek>
hee.
05:23
<&ToxicFrog>
Yeah, whenever I say "macro" I mean "lisp macro"
05:23
<@Alek>
I know it decreases readability, but I love condensing 6 or more commands into 1.
05:23
<&ToxicFrog>
cpp macros hardly count
05:23
<&ToxicFrog>
sshine: it's not too late to start!
05:23
<&ToxicFrog>
Abusing macros, I mean
05:24
<@sshine>
ToxicFrog, I started learning scheme, but all I ended up doing was dynamic programming in Project Euler (which, come to think of it, was the reason I found this channel to begin with)
05:24
<@Alek>
and actually. it's not done yet.
05:24
<&ToxicFrog>
I've been rockin' the Clojure lately
05:25
<@Alek>
aha. there we go.
05:26
<@Alek>
got rid of 2 unnecessary variables and 2 unnecessary closes. XD
05:26
<@Alek>
open(to_file, 'w').write(open(from_file).read())
05:26
<@sshine>
e.g. if x = {1,2,3,4} and y = map(f, x), I would compile y into some lazily evaluated representation of {f(x[0]), f(x[1]), f(x[2]), f(x[3])}, and if I have z = reduce(sum, 0, y), then z should be compiled into something like... hmm, I don't know yet.
05:27
<&Derakon>
Alek: shutil.copyfile(from_file, to_file)
05:27
<@Alek>
this.. is the beginning of what bids fair to be an interesting and wonderful journey.
05:27
<@Alek>
Dera: I'm just starting.
05:28
<@Alek>
I don't know shutil or .copyfile() yet.
05:28
<@sshine>
but at least, q = map(g, y) becomes {g(f(x[0])), ...} so eventually when producing GPU code (which is the aim), several compositions of combinators can avoid unnecessary copying. writing optimizing GPU compilers is going to be fun.
05:28
<&Derakon>
"The shutil module offers a number of high-level operations on files and collections of files. In particular, functions are provided which support file copying and removal. For operations on individual files, see also the os module."
05:28
<&Derakon>
http://docs.python.org/2/library/shutil.html
05:28
<@Alek>
I just assembled the above line out of 6 individual commands.
05:28
<&Derakon>
Fairynuff.
05:30
<@Alek>
it ends up a 3-command script.
05:31
<@Alek>
import argv, extract the filenames, and copy.
05:31
<@Alek>
notbad.jpg
05:31
<@Alek>
so simple, compared to, say, C.
05:32
<@Alek>
much like BASIC, only with less default OS integration, and bigger memory footprint. XD
05:32
<&Derakon>
There's a significant difference between Basic and VisualBasic, note.
05:33
<&Derakon>
I'm pretty sure the former still has line numbers, for example.
05:33
<@Alek>
haven't even touched VB.
05:34
<@Alek>
and nooo... Basic hasn't had line numbers since the 70s.
05:34
<&Derakon>
Ah, I thought that was what you were referring to with the "default OS integration".
05:34
<&Derakon>
My dad's C64 had Basic with line numbers; that was the 80's.
05:34
<@Alek>
well, Basic WAS integral in DOS. XD
05:34
<@Alek>
batch files were basic scripts, basically. heh.
05:35
<@Alek>
ok, ok, 80s. so did my Trash-80 model 3, for that matter.
05:35
<@Alek>
but my 286 with 6.22 didn't.
05:35 * Alek misses it. XD
05:36
<@Alek>
well, somewhat. >_>
05:36
<&ToxicFrog>
QBASIC had line numbers in the 90s
05:36
<&ToxicFrog>
And batch files are not remotely BASIC scripts
05:37
<&ToxicFrog>
They are vastly less capable~
05:37
<@Alek>
err. I don't think I touched Qbasic.
05:38
<@Alek>
less capable, but using the same commands where they overlap, pretty much. iirc.
05:38
<@Alek>
I mean.
05:38
<@Alek>
in my experience, Batch was pretty much a subset of Basic.
05:38
<@Alek>
just more OS-oriented.
05:39
<@Alek>
on the 6.22, at least.
05:40
<@Alek>
it may have been Qbasic actually, I don't recall, but there definitely were no line numbers. custom labels (for GOTO, as well as just labeling) COULD be set, including arbitrary numbers.
05:40
<@Alek>
I just used EDIT for writing either. >_>
05:40
<@Alek>
the pre-windows Notepad. :P
05:41
< Xon>
they only superficially look similar
05:41
< Xon>
batch script shell expansion rules are craaaazzzy
05:43
< Xon>
and variable naming is even more insane than VB
05:47
<@Alek>
like I said. never touched VB.
05:47
<@Alek>
only old-school Basic.
05:49
<@Alek>
man, it's been too long. I haven't written any basic or batch in over 10 years. doubt I could without a refresher course, any more.
06:11
<@Alek>
"Once upon a time, I had a work laptop with the password 'seventyfivemillimeterdiameter'. Which I typed in, blindly, in under 3 seconds, every time. One time my manager needed to borrow the laptop, while I was on vacation. He later told me 'You're a paranoid psycho; three different people couldn't enter it properly.'"
06:12
<&ToxicFrog>
That speaks more to their typing skills (or lack thereof) than anything else~
06:13
<&Derakon>
Yeah, if you can't touch-type replicate a 30-character string without errors then you have a problem.
06:15
<~Vornicus>
seventyfivemillimeterdiameter
06:15
<~Vornicus>
okay I can
06:15
<~Vornicus>
but it's really hard to avoid hitting space
06:15
<@Alek>
that's a translation, the original is slightly more twisty, albeit about the same length.
06:16
<&Derakon>
I'm not saying I'd get it on the first try every time, especially if I can't see what characters are coming out, but it shouldn't take more than two or three tries.
06:16
<@Alek>
mmm. yes. I agree. it was kinda funny nonetheless.
06:17 * Alek shrugs.
06:17 ErikMesoy|sleep is now known as ErikMesoy
06:17
<@Alek>
I'd link the original if there was anyone else who knew Russian. >_>
06:20
<@Alek>
"A cow-orker, by no means knowledgeable in technology, examines a plank of memory from all sides, then suddenly asks, 'I don't get it. Is it really that old, to have been made in the Deutsche Demokratische Republik?'"
06:20 Kindamoody is now known as Kindamoody|afk
06:23 Derakon is now known as Derakon[AFK]
06:24
< ErikMesoy>
they may have been inputting "millimetre"
06:26
<@Azash>
Alek: That's silly
06:26
<@Azash>
But more importantly, why are you playing Dance Dance Revolution at work?
06:27
<@Alek>
Erik: it was in Russian, not English.
06:27
<@Alek>
so, slightly different.
06:28
<@Alek>
there's no meter/metre difference.
06:31
<@Alek>
hm.
06:31
<@Alek>
idly, anyone here tangled with winlocker-type stuff?
06:32
<@Alek>
and hopefully with removing it, probably via a linux bootcd?
06:32 * Alek thinks it's something he should put in his mind, just in case.
06:33
<@Alek>
cause I'm reading about it being doable within 5 minutes, so I'm really not liking the thought of hunting around for hours. >_>
06:37
<@Alek>
ahaha "this is the hub that Jack built", full Russian filk
06:39 himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds]
06:41
<&ToxicFrog>
Oh windows
06:42
<&ToxicFrog>
Fuck your shell expansion rules, in hell, forever
06:42
<&ToxicFrog>
With a thousand barbed phalluses made of magma and sulfuric acid
06:43
<@Alek>
eh. why not hexafluoric acid?
06:44 Kaura [thoughtscre@Nightstar-1e7be2ad.dynamic.hinet.net] has joined #code
06:44
<@Reiv>
oh man
06:44
<@Reiv>
Vorn teaching a newbie how to code Python in #Code
06:44
< Kaura>
Vorn: I was a bit concerned given how... simple... it's supposed to be to do in Python. >_>
06:44 * Reiv dies of nostalgia.
06:44
<&ToxicFrog>
Brings back memories
06:45
< Kaura>
Not my first rodeo in here! ...except I've forgotten almost literally everything.
06:45
<&ToxicFrog>
It's still simple, just not simple in the same way it is in python2
06:45
<~Vornicus>
and you're learning on a half-new language
06:45
<&ToxicFrog>
(thank god)
06:45
< Kaura>
So it's like riding a bike after having amnesia!
06:45
<@Reiv>
TF: Thank god?
06:46
<~Vornicus>
Reiv: in python2, print is a statement
06:46
<~Vornicus>
which means that if you want to use it in a callback you need to custom-build a function around it
06:46
<&ToxicFrog>
^ that
06:46
<~Vornicus>
in python3, print is a function. Which means you can use it in a callback you can use it straight.
06:46
<@Reiv>
Aha.
06:46
<@Reiv>
And there's nowhere that /suffers/ from it being a function, either.
06:47
<@Reiv>
Beyond needing slightly more brackets.
06:47
<~Vornicus>
well except that you need parens now.
06:47
<~Vornicus>
Oh Fuckin' no
06:47
<~Vornicus>
Anyway!
06:47
< Kaura>
Eh, brackets can be dealt with.
06:48
<~Vornicus>
Okay let's get a couple of simple concepts out of the way first. Hm... how about we start with input and output.
06:48
<&ToxicFrog>
death to system(), up with execve()
06:49
<~Vornicus>
Make yourself a text file. put "#!/usr/bin/env python3" as the first line.
06:50
< Kaura>
Done.
06:52
<~Vornicus>
Okay. And let's put a constant up there: QUESTION = "Hi! What's your name?"
06:53
< Kaura>
Ah, right. So if print(question), it'll return "Hi! What's your name?"
06:54
<~Vornicus>
generally it's a good idea to put things like strings and magic numbers in constants, so they're easier to hand to your copy editor. More advanced stuff will actually put stuff like that in files, so you can swap them out without too much effort if you ever want to change the language your program is released in.
06:54
<~Vornicus>
right. next up, let's have the program ask you what your name is.
06:55
<~Vornicus>
in python3, we use the input function for this. input(prompt) will print the prompt string, and return the string that the user types in. So: user_name = input(QUESTION)
06:55
< Kaura>
...it never occurred to me you could put the definition of constants as a file, but it makes sense in retrospect.
06:55
<~Vornicus>
actually, we should change QUESTION slightly - put a space after the ?
06:56
<~Vornicus>
Once you've got that going, run the program -- if you remember, you should do this from within your console, which you can get to in Windows by running "cmd"
06:57
<&ToxicFrog>
ahahahahahaha awesome
06:57
<~Vornicus>
uhoh
06:57
<&ToxicFrog>
the behaviour of system() on windows doesn't actually match up with the behaviour of the same commands entered at the command line
06:57
<~Vornicus>
oh cool
06:59
<&ToxicFrog>
brb strangling the entire windows dev team with their own optic nerves
06:59
<~Vornicus>
yay
07:00
< Kaura>
Given the usual consensus on Windows, those nerves must be well-frayed by now.
07:01
< Kaura>
...hrn. Odd stumbling block to hit. You said to run from cmd.exe, right? The DOS prompt?
07:02
<~Vornicus>
yeah.
07:03
<~Vornicus>
You might have to do something like "C:\python33\python.exe kauracode.py" or something
07:03
< Kaura>
...interestingly, it also works if I just drag the file into it.
07:03
< Kaura>
But, yes, that's how I should've done it. >_>
07:03
< Kaura>
Runs fine!
07:04
<~Vornicus>
Yay!
07:04
<~Vornicus>
So you told it your name and it did nothing with it.
07:04
< Kaura>
Aye.
07:05 Kindamoody|afk is now known as Kindamoody
07:06
<~Vornicus>
Okay, now let's make it do something with it. RESPONSE = "{name}, eh? {name}. Hm. That's a toughie. Can I call you Bob instead?"
07:06
<&ToxicFrog>
Oh hey
07:06
<&ToxicFrog>
This part seems to be a VLC problem, not a windows problem
07:06
<~Vornicus>
Put that at the top next toe QUESTION
07:07
<&ToxicFrog>
To wit, the windows version of VLC does not accept filenames with forward slashes
07:07
<~Vornicus>
07:08
<~Vornicus>
and then let's do print(RESPONSE.format(name=user_name)) on the line after our input thingy
07:09
< Kaura>
Okay, so fruit.format(apple=oranges) tells it to hunt up all iterations of {apple} within fruit's output and replace with oranges, right?
07:10
<~Vornicus>
Kaura: right.
07:10
< Kaura>
Got it.
07:10
< Kaura>
Works!
07:11
<~Vornicus>
Later when there's math to be done there are more things you can do with it to make python print out numbers in specific ways, and some other toys.
07:11
<~Vornicus>
Yay!
07:11
< Kaura>
(...there needs to be an "Oh, god, no" response option to "Can I call you Bob instead?")
07:11
<~Vornicus>
(hee)
07:14 * Vornicus thinkthinkthinks
07:14
<~Vornicus>
Okay so that's pretty decent so far, let's think of another thing that we can jump to that's pretty easy.
07:17 * JustBob is everywhere. Watching. Staring.
07:18
<~Vornicus>
Well, heck, why not. let's do a simple math, uh, thinger. We'll give it two numbers, the program will multiply them together, it will tell us the answer.
07:19
<~Vornicus>
This is also a good time to learn to make functions.
07:19
< Kaura>
Yay, functions. Hardly a functional language without them.
07:19
<~Vornicus>
(using them we've already done; there are three calls to functions made in the first thing)
07:20
<~Vornicus>
you may think that's a good pun but it goes deeper: there are actually languages -- and python's not one of them -- that are called functional languages.
07:20
< Kaura>
...programming takes puns and dumps you through the rabbit hole with them, huh? I seem to recall this.
07:20
<~Vornicus>
(that said, my python often smells ridiculously functional, because I abuse list comprehensions like there's no tomorrow)
07:22
<~Vornicus>
Okay, so. we need to write, first off, some strings for prompts: we need to ask for two numbers, one at a time.
07:23
<&ToxicFrog>
What in god's name is going on here
07:23
<&ToxicFrog>
os.execute [["c:/program files/vlc/vlc.exe" foo bar baz]] -- works
07:24
<&ToxicFrog>
os.execute [["c:/program files/vlc/vlc.exe" foo "bar baz"]] -- error "c:/program" is not an executable
07:24
<&ToxicFrog>
Adding quotes later in the command line causes the quotes earlier in the command line to stop working.
07:24
<~Vornicus>
I'll let you write those. tell me when you're done and what you've called them.
07:24
<~Vornicus>
ToxicFrog: I don't even
07:26
< Kaura>
Vorn: If I understand this correctly, it's just a matter of X = A and Y = B, right?
07:26
<&ToxicFrog>
But if you start it with a double double quote, it works!
07:26
<&ToxicFrog>
os.execute [[""c:/program files/vlc/vlc.exe" foo "bar baz"]] -- works
07:27
<&ToxicFrog>
Of course, this causes it to shit itself:
07:27
<&ToxicFrog>
os.execute [[""c:/program files/vlc/vlc.exe" foo file://"bar baz"]] -- no quotes in the middle of arguments, apparently
07:27
<~Vornicus>
Kaura: no, we're writing the prompt strings first. "What's the first number? "
07:27
<~Vornicus>
or whatever
07:27
<&ToxicFrog>
FUCK. WINDOWS.
07:27
< Kaura>
Oh, hurr.
07:29
< Kaura>
Okay, so. For clarity's sake, I've had it written as N1 = "What's the first number? " and N2 = "What's the second number? "
07:30
<~Vornicus>
works for me.
07:30
<~Vornicus>
Okay, now we need to write a function.
07:30
<~Vornicus>
So, thing about input() is that the thing it gives you is a string.
07:31
<~Vornicus>
You can't multiply strings by each other, that would be silly.
07:31
<~Vornicus>
we need to turn what we get into numbers.
07:32
< Kaura>
To turn N1 and N2 into actual numbers, right?
07:32
<~Vornicus>
Not quite.
07:33
<~Vornicus>
Remember how we did it a moment ago, we made QUESTION and then called input(QUESTION) and it printed out what QUESTION was and then you typed something in and that thing you typed in was what it used later?
07:33
<~Vornicus>
What our function is going to do is call input on a prompt we gave it, and then turn what comes out into a float.
07:34
<~Vornicus>
This goes approximately like this:
07:34
<~Vornicus>
def float_input(prompt):
07:34
<~Vornicus>
result = float(input(prompt))
07:34
<~Vornicus>
return result
07:35
<~Vornicus>
This as it is is quite fragile: if you type something that python doesn't recognize as a number, it will give you an error and scream and die. We'll be coming back to this later and fixing it so it doesn't do that.
07:37
<~Vornicus>
(generally, you put 4 spaces in to indent things in Python. A decent text editor,properly configured, knows that and also knows when it should indent.
07:37
< Kaura>
IDLE does it automatically.
07:37
<~Vornicus>
Good on it.
07:40
<~Vornicus>
So! That's your function there; now we'll use it. a = float_input(N1)
07:40
<~Vornicus>
and similarly for b.
07:42
< Kaura>
Ah, I see. So it'll keep track of A and B as whatever the numerical responses were.
07:42
<~Vornicus>
(use lower_case for things you expect to create or change as the program runs, and ALL_CAPS for "constants")
07:42
<~Vornicus>
Right
07:42
< Kaura>
er, right, "a" and "b"
07:44
<~Vornicus>
okay, now, let's have our thingy: RESPONSE = "{} * {} = {}"
07:44
<~Vornicus>
print (RESPONSE.format(a, b, a*b))
07:44
< Kaura>
Interesting. so if {} is blank, it'll replace in sequence?
07:45
<~Vornicus>
Right.
07:45
<~Vornicus>
You can also try "{2} / {1} = {0}", "{2} / {0} = {1}", or "{0} * {1} = {1} * {0} = {2}"
07:46
<~Vornicus>
If you don't name things you can talk about them by number.
07:48
< Kaura>
So now we need to figure out a way to make it ask for a and b.
07:48
<~Vornicus>
well, I showed you the one for a
07:49
< Kaura>
I have it written for b as well.
07:49
<~Vornicus>
It is, I presume, asking the questions then?
07:50
< Kaura>
Oh, hurr. I missed a parenthesis.
07:50
<~Vornicus>
heh
07:50
< Kaura>
There. Working properly now. I forgot to close the print command, so it spat out an error.
07:50
<~Vornicus>
that'd do it.
07:51
<~Vornicus>
yeah, make sure your parentheses are closed. Most decent text editors will, if you put the cursor in the right place, show you what parenthesis or bracket the one you're pointing at matches with.
07:51
< Kaura>
Interesting that it'd automatically assume I'd want to answer one at a time. I was expecting the input process to be more involved.
07:51
<~Vornicus>
What do you mean?
07:53
< Kaura>
I was half-dreading that it'd spit out both questions at the same time and expect me to answer coherently somehow. >_>
07:54
<~Vornicus>
We didn't tell it to do that.
07:54
<~Vornicus>
We can though! maybe we'll hit that one in a bit.
07:54
<~Vornicus>
Okay let's make a stupid quiz.
07:55
<~Vornicus>
This time, we're going to ask the user a question that has a right answer.
07:56
<~Vornicus>
And then if the user gets it right, we'll say "yay!" and if not, we'll say "boo!"
07:56
<~Vornicus>
or whatever
07:57
<~Vornicus>
So. Question we want to ask is this: "is {number} even?"
07:58
<~Vornicus>
So far I've mentioned three strings that should be constants.
07:58
< Kaura>
The question, the positive response, the negative response.
07:58
<~Vornicus>
Right. So make 'em constants, give 'em names.
08:00
<~Vornicus>
(and of course tell me the names)
08:00
< Kaura>
QUESTION, YES, NO
08:01
<~Vornicus>
Woot.
08:02
<~Vornicus>
okay, so next up we need to generate a random number, say between 1 and 10 inclusive.
08:03
<~Vornicus>
This means that we need to go get a function that isn't already there.
08:03
< Kaura>
If I recall correctly, we need to import an RNG
08:04
<~Vornicus>
You do!
08:04
<~Vornicus>
up before our string constants (in general you import things first in any script), put "import random"
08:07
<~Vornicus>
and the function we'll be using is called random.randint
08:08
< Kaura>
Right, for random integer. So now we need to limit it from 1 to 10 inclusive.
08:08
<~Vornicus>
http://docs.python.org/3/library/random.html#random.randint
08:08
<~Vornicus>
here's your documentation for that function. Now tell me how it's done.
08:08
< Kaura>
Ah-hah. random.randint(1, 10)
08:09
<~Vornicus>
Cool. And what are you going to call what it comes up with?
08:09
< Kaura>
Replace {number} with the result, yes?
08:10
<~Vornicus>
not quite what we want here.
08:11
<~Vornicus>
earlier when we got a thing from the user, we gave it a name: a, for instance, or user_name
08:11
<~Vornicus>
need to do the same thing here.
08:11
< Kaura>
Oh, first name the result of the randomizer?
08:11
<~Vornicus>
right
08:12
<~Vornicus>
we need it to stick around, because we're going to be doing some math on it.
08:13
< Kaura>
So like with earlier, make it a float?
08:13
<~Vornicus>
Nope. the thing that comes out of the randomizer is already a number.
08:14
<~Vornicus>
The reason we needed to do that with the stuff coming from the user earlier is because the things that come from the user are always going to start out as strings.
08:14
<~Vornicus>
If we need something other than a string from the user, we have to turn it into that something else.
08:15
< Kaura>
Ah. Earlier, we were converting it. But this time, it already starts as a usable number.
08:15
<~Vornicus>
Right.
08:16
<~Vornicus>
Okay, so. Having generated our number, we have to ask the user what he thinks.
08:17
<~Vornicus>
So remember that we made QUESTION with a {} thingy in it. What's your QUESTION look like?
08:17
< Kaura>
"Is {number} even? "
08:18
<~Vornicus>
Cool. Okay, now, we need to use .format on that to make the actual number we generated show up. how do we do this?
08:21
< Kaura>
Ah, I think I see. So, similar to the first exercise, it's num_var = input(QUESTION.format(number=random.randint(1, 10)))
08:21
< Kaura>
...I think.
08:21
<~Vornicus>
Well, that "works" but there's something wrong: outside of that line we don't know what number we made in randing
08:21 Thalass [thalass@Nightstar-b95c25b4.bigpond.net.au] has quit [[NS] Quit: brb]
08:21
<~Vornicus>
we have to generate it and give it a name beforehand.
08:22
< Kaura>
Oh, so first NUM = random.randint(1, 10), then .format(number=NUM)?
08:22
<~Vornicus>
just num; this has been generated, so we shouldn't pretend it's a constant.
08:22
< Kaura>
Ah.
08:22
<~Vornicus>
(or rather, num as opposed to NUM)
08:23
<~Vornicus>
but yes.
08:23
< Kaura>
Right, I got that. Should be lower-case, so I don't confuse myself as to the property.
08:23
<~Vornicus>
The second problem is this: "num_var" is the wrong name, because what we're really getting isn't a number at all.
08:24
<~Vornicus>
it's an answer to the question. call it "answer"
08:24
< Kaura>
"answer" it is.
08:25
<~Vornicus>
Okay. Now this is the hard part, and it's properly hard, so just go with it for a moment.
08:26
<~Vornicus>
There are two things we care about here: 1. whether the user answered yes or no; 2. whether the number is in fact even or not.
08:26
< Kaura>
I can imagine how the first is handled, but I admit a blank on the second.
08:27
<~Vornicus>
I want you to play around with the operator "%"
08:28
<~Vornicus>
What this operator does is, a % b will give the remainder that you get when you divide a by b. 14 % 3 gives 2, because 14 = 4 * 3 + 2
08:28
< Kaura>
Ahh, right. I vaguely recall this.
08:29 ReivDriod [Reiver@Nightstar-92fce6db.vf.net.nz] has joined #code
08:29
<~Vornicus>
So, for our purposes: num % *something* will give you an answer that tells you whether num is even or odd. What's that something, and what answer tells you that it's even?
08:31
< Kaura>
something being the output of answer, and 0 being even.
08:32
< Kaura>
er, wait, output of the randomizer.
08:32
<~Vornicus>
no, num is the output of the randomizer
08:32
<~Vornicus>
the "something" should be a particular number.
08:33
< Kaura>
Oh, duh. 2.
08:33
<~Vornicus>
2 indeed.
08:34
<~Vornicus>
Okay, so to tell if num is even: num % 2 == 0
08:34
<~Vornicus>
(we're building this slowly, so don't type this into the thing yet)
08:35
<~Vornicus>
For now, actually, try putting these two things into the interactive interpreter, sans quotes: "5 % 2 == 0", and "8 % 2 == 0"
08:36
< Kaura>
Returns "False" and "True" respectively
08:36
<~Vornicus>
Woot.
08:37
<~Vornicus>
Okay, so now we have a thing that will tell us whether the number is even.
08:37
<~Vornicus>
Now, the one about what the user entered is harder.
08:37
<~Vornicus>
Mostly because humans are morons.
08:38
<~Vornicus>
The classic way of dealing with this -- the simple way I learned way back on the commodore 64 -- is to treat anything that starts with "y" as yes, and anything else as no.
08:39
<~Vornicus>
We're going to use two functions for this: http://docs.python.org/3/library/stdtypes.html#str.lower and http://docs.python.org/3/library/stdtypes.html#str.startswith
08:39
< Kaura>
...boy, that can cause all sorts of interesting inputs. Thus why most prompts asks [Y/N]
08:40
<~Vornicus>
So what we're going to do is turn whatever the user gives us to lowercase, and then we're going to check whether it starts with 'y'
08:44
<~Vornicus>
should go something like answer.lower().startswith('y')
08:45
<~Vornicus>
try it out in the terp first: "yes".lower().startswith('y')
08:45
<~Vornicus>
and then replace "yes" with stuff like "YES" and "monkeys!" and "no"
08:46
< Kaura>
Ah, I see. Works. MONKEYS = false, YGGDRASIL = true.
08:48
<~Vornicus>
Yes indeed.
08:49
< Kaura>
So next is to check for true and false.
08:49 thalass [thalass@Nightstar-b95c25b4.bigpond.net.au] has joined #code
08:49
<~Vornicus>
Okay so now we have two things: a thing that checks what the user's answer is, and a thing that checks what the correct answer is.
08:49
< Kaura>
Evening, Thal.
08:49
< thalass>
allo
08:49
<~Vornicus>
And if those two answers are the same, then yay!
08:49 * thalass stabs pulseaudio and/or creative labs
08:49
<~Vornicus>
and if they're different then boo!
08:50
<~Vornicus>
Now, something I did up above will tell you whether two things are the same. what is it?
08:50
< thalass>
You're designing a politician-checker program, Vorn?
08:50
<~Vornicus>
har
08:51
<~Vornicus>
no, a bloody stupid quiz program with kaura, which will eventually get around to using "if" which is what the actual point is but I figure we've seen a lot of other cool stuff on the way.
08:52
< Kaura>
"yes".lower().startswith('y') compared the first letter of "yes" with "y," right? The str.startswith() type?
08:53
<~Vornicus>
That's what it did.
08:53
<~Vornicus>
But the thing that we're looking for will compare two things, and give you True if they're the same.
08:53
< Kaura>
hrn.
08:54
<~Vornicus>
I used it up above.
08:54
< Kaura>
==
08:54
< Kaura>
Wait, no. That's... hm.
08:55
<~Vornicus>
it's ==
08:55
< Kaura>
Okay, so I overthought that one. >_>
08:55
<~Vornicus>
if (answer.lower().startswith("y")) == (num % 2 == 0):
08:56
<~Vornicus>
and then indent 4 spaces, and type print(YES)
08:56
<~Vornicus>
else:
08:56
<~Vornicus>
print(NO)
08:56
<~Vornicus>
else and if should be indented the same amount
08:57 thalass is now known as Thalass|afk
08:58
< Kaura>
Works!
08:59
<~Vornicus>
Yaaaay!
08:59
< Kaura>
And now we need to pause here for me to grab dinner. orz
09:00
<~Vornicus>
you've done well
09:00
< Kaura>
Only 5 PM, but I'm feeling voracious.
09:00
<~Vornicus>
Brains need food
09:00
< Kaura>
I've been writing notes frantically on a separate word document to make sure I remember the details this time.
09:01
< Kaura>
...and then I realize I could've just used # to comment.
09:01
<~Vornicus>
Oh, right
09:01
<~Vornicus>
comments~
09:01
<~Vornicus>
Putting comments in the code is a good idea
09:02
<~Vornicus>
But if you're working on general principles and stuff, a separate document is probably easier to find things in!
09:07 Kindamoody is now known as Kindamoody|out
09:08
< Kaura>
There, everything saved. Foooooood.
09:10 * Vornicus thinks: next up a 10-question multiplication quiz, I think.
09:11
<@froztbyte>
http://people.canonical.com/~ubuntu-security/cve/2013/CVE-2013-0170.html https://security-tracker.debian.org/tracker/CVE-2013-0170
09:11
<@froztbyte>
for ubuntu and debian
09:11
<@froztbyte>
if anyone uses a newish version
09:13
<~Vornicus>
oh fun
09:28 Attilla [Attilla@Nightstar-9e7fa2b2.range86-162.btcentralplus.com] has joined #code
09:29 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
09:29 mode/#code [+o himi] by ChanServ
09:41 froztbyte [froztbyte@Nightstar-dc394964.za.net] has quit [Operation timed out]
09:44 froztbyte [froztbyte@Nightstar-dc394964.za.net] has joined #code
09:44 mode/#code [+o froztbyte] by ChanServ
09:49 froztbyte [froztbyte@Nightstar-dc394964.za.net] has quit [Ping timeout: 121 seconds]
09:49 froztbyte [froztbyte@Nightstar-dc394964.za.net] has joined #code
09:49 mode/#code [+o froztbyte] by ChanServ
09:57 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
10:01 * Vornicus checks to see if kaura has returned
10:10 You're now known as TheWatcher
10:10 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
10:10 mode/#code [+o himi] by ChanServ
10:29 Syk [the@A6D346.0419D1.5781E3.D098A4] has quit [Operation timed out]
10:32 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
10:40
<~Vornicus>
Kaura: unfortunately, bed calls soon. So we won't be able to continue tonight.
10:41
< Kaura>
Vorn: Apologies. I just came back. We'll continue some other time - possibly next week, as I have tutoring tomorrow, then need to prep for Seoul.
10:42
<~Vornicus>
Works
10:42
< Kaura>
In the 'tween time, I'll do more basic drills off what we've covered today. >_>
10:43
<~Vornicus>
Yay
10:43
<~Vornicus>
when you do that, zip up what you make and email it to me: vorn@nightstar.net
10:43
< Kaura>
Alright.
10:44
<~Vornicus>
(also if you could do that with the code you've already made I'd like to see that)
10:49
< Kaura>
Sent!
10:49
<~Vornicus>
woot
10:59 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
10:59 mode/#code [+o himi] by ChanServ
11:13
<~Vornicus>
Kaura: looks good. I should tell you: if you put a triplequote string as the first item inside a function, Python turns that into documentation for that function.
11:22
< Kaura>
I'll keep that in mind.
11:24
<~Vornicus>
When you start writing functions that aren't throwaway... well, okay, you already wrote a function that I'd call pretty general use, float_input... you should make documentation for them.
11:31 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
12:10 Syka [the@A6D346.40FE1F.ADE1B0.792D55] has joined #code
12:15 Syka [the@A6D346.40FE1F.ADE1B0.792D55] has quit [Ping timeout: 121 seconds]
12:34 Syka [the@Nightstar-32c23e04.iinet.net.au] has joined #code
12:37
<@froztbyte>
https://github.com/fpletz/kernelroll
12:51
<@iospace>
DO A KERNEL ROLL
13:02 * TheWatcher eyes his password policy code
13:02
< Syka>
ugh this power outages
13:03
<@iospace>
yessssss?
13:05
< Syka>
no not yes
13:05
< Syka>
it's wrecked my night because now i cbf doing anything
13:05
< Syka>
fearint it'll go off again
13:06
<@TheWatcher>
So, there's configuration settings for: min length, forced mix case, minimum number of digits, number of non-alphanumerics, call cracklib to check the password... now I need to work out how to do policy_require_haiku and policy_require_twistatend
13:07 * Rhamphoryncus fights with youtube to put a large series in a playlist
13:07
< Syka>
if (username != "m_night_shammlylammginagdingdong") {reject_login();}
13:07
< Syka>
theres the latter done TheWatcher
13:08
<@froztbyte>
hahaha
13:11 Syka is now known as syksleep
13:12
<@Rhamphoryncus>
Oh cute. On my phone it formats my playlist completely differently than the one from the original author
13:12
<@Rhamphoryncus>
Which is actually good as now I'll get to see the episode titles x_x
13:18
<@Rhamphoryncus>
Word of the day: themnar eminence. (okay, that's two words)
13:47
<@Pandemic>
Any DBAs or SQL gurus around?
14:03
<@froztbyte>
...kinda
14:03
<@froztbyte>
whassa question?
14:28
<@froztbyte>
http://windytan.blogspot.com/2012/11/the-sound-of-dialup-pictured.html
14:30 Nemu_ [NeophoxProd@Nightstar-e8251dbe.asahi-net.or.jp] has joined #code
14:30 Nemu [NeophoxProd@Nightstar-4060a4fe.asahi-net.or.jp] has quit [Ping timeout: 121 seconds]
14:57
<@Pandemic>
We are having stored procedure issues
14:58
<@Pandemic>
specificly some of them are taking a damned long time to exicute
14:58
<@Pandemic>
The server in question is running 48 CPU cores, 512GB of RAM, SQL is set to consume 400GB of that, and the DB is off a san with a 200GB front cache of SSD
14:59
<@Pandemic>
when I run a normal query I get a record return rate of 43 records per micro second
14:59
<@froztbyte>
what database?
14:59
<@Pandemic>
so, what ever this is it relates specificly to stored procedures
14:59
<@froztbyte>
and what does the query planner say happens if you point it at the stored proc?
14:59
<@Pandemic>
the DBMS is SQL server 2008 R2 SP 2 roll up 4
14:59
<@froztbyte>
okay
14:59
<@froztbyte>
glhf :D
15:00 * froztbyte knows *nothing* about the innards of MSSQL
15:00
<@TheWatcher>
Have you waved a dead chicken over it?~
15:00
<@Pandemic>
my appologies, I'm not a BDA, I'm just a sysadmin, how do I access the query planner?
15:00
<@Pandemic>
DBA*
15:00
<@Rhamphoryncus>
Arguing with people would be so much easier if they'd just accept that I'm right >.>
15:00
<@Pandemic>
lol
15:00
<@froztbyte>
fire off a quick google query :)
15:00
<@TheWatcher>
Rhamphoryncus: Most inconsiderate of them, indeed.
15:01
<@froztbyte>
okay, in SQL Server land it's called the Query Optimizer, apparently
15:01
<@froztbyte>
and it's in the Management Studio
15:01
<@Rhamphoryncus>
On the plus side we did have a polite discussion in PM for over an hour
15:01
<@froztbyte>
http://www.simple-talk.com/sql/sql-training/the-sql-server-query-optimizer/
15:02 * Pandemic must be reading the same msdn artical
15:02
<@froztbyte>
and http://stackoverflow.com/questions/5110258/sql-stored-procedure-debugging-in-vs2 010 seems potentially relevant
15:02
<@Pandemic>
thanks!
15:02
<@TheWatcher>
(I still think you'll get better luck with the chicken waving...)
15:02
<@Pandemic>
more places to look!
15:03
<@froztbyte>
okay no, that latter post just says "use the optimizer"
15:03
<@Pandemic>
and TW probably, but I used the last one getting sql 2000, sql 2005, sql 2008 and sql 2008 http://stackoverflow.com/questions/5110258/sql-stored-procedure-debugging-in-vs2 010laying nicely with each other as linked servers....
15:03
<@froztbyte>
TheWatcher: I agree
15:04
<@Pandemic>
and sql 2008 R2... playing nicely...
15:04
<@TheWatcher>
you poor sod
15:05
<@TheWatcher>
I hope you have a good supply of mature whiskey to hand
15:05
<@Pandemic>
I do have copious amounts of German beer...
15:05
<@Pandemic>
and I do like German beer
15:05
<@froztbyte>
might be good enough
15:07
<@Pandemic>
the truely madening thing. is these stored procedures where copied from a server in austrialia and they work just fine
15:07
<@Pandemic>
slap'em here and they can take over 10 minutes to exicute
15:07
<@Pandemic>
all system telimitry bearly raises off of 0%
15:07
<@Pandemic>
so what ever this is
15:08
<@Pandemic>
it is inside of sql....
15:11
<@TheWatcher>
probably one obscure server setting
15:11
<@Pandemic>
that is my guess. But there are thousands of them
15:11
<@TheWatcher>
Or it only works when the server is upside down
15:11
<@Pandemic>
which one?!
15:13
<@froztbyte>
the other is turned upside down, obviously.
15:13
<@froztbyte>
you could probably powershell some crazy shit up, dump textual config representations, do a diff on that
15:13
<@froztbyte>
but yeah...
15:14
<@froztbyte>
there's a reason I stopped my windows-power-userness where I did
15:15
<@Pandemic>
I see
15:15
<@Pandemic>
you have too much of your sanity left to continue :-P
16:04 Thalass|afk [thalass@Nightstar-b95c25b4.bigpond.net.au] has quit [[NS] Quit: sleep time]
17:15 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
17:16 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has quit [[NS] Quit: .]
17:16 Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has joined #code
17:16 mode/#code [+ao Derakon Derakon] by ChanServ
17:17
<&Derakon>
Any suggestions for optimizing my linearizator? http://pastebin.com/mwaxWHGy
17:18
<&Derakon>
Recognizing that this is a moderately complicated algorithm.
17:18
<&Derakon>
The idea is that we have incompletely sampled a curve, and generated an approximation by linearly interpolating between our datapoints.
17:18
<&Derakon>
We also have a linear fit of the entire curve.
17:19
<&Derakon>
We want to take in data, find where it is on the approximation of the curve we have, and then map that to the linear fit.
17:20
<&Derakon>
So in other words, we have f(x) = the original curve. g(x) = an approximation of f(x) using line segments. And l(x) = a linear fit of g(x).
17:20
<&Derakon>
We start with a value y, and want to find the corresponding x in g(x).
17:20
<&Derakon>
Then we feed that x into l() and store the result.
17:25 * TheWatcher tries to decide whether to include a `policy_min_entropy` setting, and throw passwords at Data::Password::Entropy
17:28 Syloq [Syloq@B4EC54.59F324.016BDA.8CB0A3] has joined #code
17:30 mode/#code [+o Syloq] by ChanServ
18:13
< JustBob>
I feel like a terrible human being.
18:13
< JustBob>
i = i + 1; % Iterates the iteration counter. This enables tracking of iterations as well as providing an incrementer function that increments up to 1000 and enables breaking the while loop if 1000 iterations of the root-guessing function are attempted without finding an estimated root that's less than the specified error value of the root-checking function, thereby preventing the consumption of
18:13
< JustBob>
excess system resources by permitting an excessive number of loops through the root-checking function loop.
18:14
<&McMartin>
That will teach them.
18:15
<&McMartin>
For the record, the best practice here is to describe the root guessing algorithm (and its 1000-cycle limit) at the top of the function and then leave the function itself completely uncommented because knowing what you put at the top you can see it immediately from the code~
18:15
<@Pandemic>
I think I have narrowed the situation down to one stored procedure
18:15
<@Pandemic>
who's exicution time started at 10:50:14am
18:15
<@Pandemic>
it is currently 1:15:50 pm
18:16 * Pandemic flips of siad stored proedure
18:16
< JustBob>
McM - Nah. I like the three-or-more lines of comments per line of code thing I'm doing now, because it pleases me to troll my professor.
18:17
< JustBob>
What can I say? It's not like I'm being graded on the elegance of the code, just on functionality.
18:18
<@TheWatcher>
Pandemic: ... ouch
18:18
<&McMartin>
JustBob: Indeed, I had gathered this; however, much as a civil engineer is obliged to comment on unsafe working conditions if he walks past a construction site, I feel compelled to observe that you aren't following best practices~
18:19
<@Pandemic>
yup
18:19 * Pandemic spins his wheels as he is going no where at light speed
18:20
< JustBob>
So, more formally, the best practice is to have a comment block defining the purpose of the function, rather than describing each step?
18:20
< JustBob>
Because I've always been told the other way around - you put a summary at the top of what you're doing, then comment vigorously on each line to ensure that if all the code were to suddenly vanish, leaving only the comments, someone familiar with the language would be able to reproduce your code exactly.
18:20
<@Namegduf>
Comment purpose of the function and semantics up top in one block, comment individual bits of code when the way they work, given the reader knows that block, is non-obvious.
18:21
<@Namegduf>
Yeah, what you've been told is wrong.
18:21
<@Namegduf>
You aren't supposed to comment redundantly.
18:21
<@Namegduf>
At the individual line level.
18:21
<&McMartin>
That guarantees that when you edit the code the comments will describe code that no longer exists.
18:21
<@Namegduf>
Yes.
18:21
<@Namegduf>
It's specifically a bad idea for that reason.
18:21
<&McMartin>
At least, if you're using a reasonable modern language.
18:22
<&McMartin>
If you're hand-writing machine code, you kind of have to do that but it's more "each comment is one line of high-level source code".
18:22
<&McMartin>
Which is every 7 or 8 lines of assembler.
18:23
< JustBob>
This is matlab scripting, so.
18:23
< JustBob>
http://pastebin.com/UyWPGDGL
18:23
<&Derakon>
I should note that comment practices vary depending on the skill level of your collaborators.
18:23
<&Derakon>
If you expect your code to be read often by amateurs, then it can be a big help to them to comment every line.
18:24
<@Namegduf>
I could see some more extensive code being useful for this, but stuff like the while comment is just counterproductive
18:24
<&Derakon>
Because what's obvious to you isn't necessarily obvious to them.
18:24
<@Namegduf>
People are expected to *read* comments.
18:24
<&Derakon>
(But in turn, you have to work to help them keep their comments accurate)
18:24
<&McMartin>
There is that, I suppose, Derakon, but at that point you should consider literate programming. >_>
18:24
<&Derakon>
I'm not rewriting Pyrel in Inform. :p
18:24 * McMartin has only ever managed this with Haskell though he's tried to do it with Clojure and Marginalia.
18:24
<&McMartin>
That's not what literate programming means~
18:24
<&McMartin>
Though what it does mean is admittedly somewhat slippery.
18:25
<&ToxicFrog>
Marginalia is so pretty <3
18:25
<&McMartin>
Inweb is hilarious and kind of neat but also kind of unusable for much
18:25
<&McMartin>
Literate Haskell just uses code markers instead of comment markers.
18:25
< JustBob>
For the record... I do note that I /am/ partially trolling my professor with the commentary in my code, because my previous homework assignment was commented about half as much and it was noted as 'insufficiently commented' in a sarcastic manner.
18:25
<&McMartin>
Sure, and this is a homework assignment, so whatever
18:26
<&McMartin>
And the prof is reading it not some poor shlub of a TA
18:26
< JustBob>
Well, if it's a poor schlub of a TA... Kris can suffer.
18:26
<&McMartin>
Hee
18:27
< JustBob>
(He's the one who /taught/ me matlab. :p )
18:27
<&McMartin>
Heh
18:27
<&McMartin>
Anyway, inweb, kind of nuts
18:27
<&McMartin>
http://inform7.com/sources/src/cBlorb/Woven/index.html
18:27
<&McMartin>
This is one of the two outputs, the other being a single gigantic blob of C code that you are then supposed to compile.
18:29
<&ToxicFrog>
Marginalia isn't really "literate programming" in the usual sense, but more an unusually non-terrible documentation generator/extractor.
18:29
<&McMartin>
Right
18:29
<&Derakon>
So it's basically self-documenting code, taken further.
18:29
<&McMartin>
But it's designed with a specific comment discipline in mind -- one where the documentation "tells a story" that the code is a more precise version of - that fits into the general literate paradigm.
18:30
<&McMartin>
This is more true of Marginalia than of Docco, the system that inspired it.
18:30
< JustBob>
http://pastebin.com/WuHDyLYB <- I mean, honestly, that's what I'd normally comment my code as.
18:30
<&Derakon>
Looks fine to me.
18:31
<&McMartin>
Yeah, the only thing I'd add is the 1000-loop limit in the top
18:31
<&McMartin>
But that's beyond fine and into good, otherwise
18:33
< JustBob>
M'kay. I'll keep that in mind (and I think I stripped out the 1000-loop comment when I was clearing things up.)
18:34
<&McMartin>
Generally though, if that's your instinct, then you can trust your instincts when in non-troll mode.
18:35
<@Namegduf>
I would use more spaces.
18:35
<@Namegduf>
I find blank lines between blocks of 3-6 lines improves readability.
18:35
< JustBob>
There was more whitespacing. I was pretty heavy-handed in nuking the commentary, and that took most of the whitepsace with it.
18:36
<@Namegduf>
But that's my taste.
18:36
<@Namegduf>
(Very roughly 3-6, I just go by eye)
18:36
<&Derakon>
I'd put a blank line between 10 and 11, and 14 and 15.
18:36
<&Derakon>
That'd be plenty though.
18:36
<&Derakon>
You have the indentation to guide the eye otherwise.
18:37
<@Namegduf>
That'd be to my taste, yeah.
18:38
<@Namegduf>
I'd probably add one between 17 and 18 as well, but I'm fond of isolating break conditions in an if.
18:38 * McMartin doesn't comment as much these days as he should, but his programs log so much that the logging ends up serving as commentary.
18:38
<@Namegduf>
I mean, isolating an if which breaks a loop.
18:38
<@Namegduf>
But I could read it fine without.
18:39
<&Derakon>
I have so many one-off programs scattered around that I invariably end up returning to months later that I have to comment to save my own hide.
18:39
< JustBob>
http://pastebin.com/25Q2xNbS <- This is about how I'd /actually/ do it, spacing and commentingwise.
18:40
<@Namegduf>
The added fprintf's in this version will result in many lines of spew, and dramatically slow down the loop
18:40
<@Namegduf>
Because IO is expensive
18:40
<@Namegduf>
There's also some indent issues. :P
18:40
<&Derakon>
The question is, is the IO slower than Matlab itself~
18:40
< JustBob>
I screwed up my original copypasta. They were supposed to be in there to start with. :p
18:41
< JustBob>
And I think the copypasta on this version is also screwy.
18:41
< JustBob>
Trust me, it's indented right. :p
18:41
<@Namegduf>
Are you sure you're not mixing tabs and spaces? :P
18:41
< JustBob>
Bah, do I need to pull up the damned editor?
18:41
<@Namegduf>
That's a common cause of things suddenly becoming unaligned when copied and pasted
18:42
< JustBob>
That's probably it.
18:42
<@Namegduf>
But anyways, I'm done being pedantic. :P
18:42
< JustBob>
I copied it from matlab to word, and from word to pastebin. :p
18:42
<&Derakon>
Ew.
18:42
< JustBob>
And somehow, I doubt that fprintf is going to slow it down compared to how molasses-like matlab is to start with.
18:43
< JustBob>
(It's also a requirement to display iteration and guess, per the homework spec.)
18:43
< JustBob>
(Otherwise they wouldn't be there.)
18:47
<&McMartin>
Oh hey
18:47
<&McMartin>
git is getting MSVS integration
18:47
< JustBob>
(By the way, I anticipate that in two-ish years, you're going to hear me bitching a lot more in here.)
18:47
<&McMartin>
So much for git being a second class citizen on Windows
18:47
<&McMartin>
JustBob: See the topic; it's in a large sense what we're here for~
18:48
<&Derakon>
Oh man, you should have seen me two years ago here...
18:48
<&Derakon>
Driving the refactor tractor through the worst jungle I've ever seen.
18:48
<&McMartin>
lolseb
18:48
<&Derakon>
Everyone else brought popcorn~
18:49
< JustBob>
Heh.
18:49
< JustBob>
Well, I blame it on this: http://ecampus.oregonstate.edu/online-degrees/undergraduate/computer-science/
18:49
< JustBob>
Once I finish my BS in nuke eng and actually get /employment/, I'm doubling back to snag the BS in CS.
18:50
<&McMartin>
Heh
18:50
<&McMartin>
Well, good luck
18:50
<&McMartin>
It's like a philosophy degree that people pay you for >_>
18:50
<&Derakon>
Well, good luck!
18:50
<&McMartin>
In other news, AHAHAHAHA
18:50 * McMartin gestures mightily as lightning crashes
18:50
<&McMartin>
Sadly I can't go into great detail as to what I just got to work, but it did involve injecting threads into other Windows processes to rework their widget layout on the fly.
18:51
< JustBob>
Heh. It's masochism on my part, to be honest.
18:51
<@TheWatcher>
McM: ... you sir are both awesome and insane.
18:51
<&McMartin>
Hence the lightning
18:51
< JustBob>
That, and (to my abject surprise), there is /no coding requirement/ in a nuke eng degree beyond knowing matlab.
18:51
< JustBob>
We don't even take an intro to compsci - this is how Java works course.
18:52
< JustBob>
I figure that it's something I ought to know.
18:53
<&McMartin>
TheWatcher: The core Windowing APIs don't seem *that* much worse than raw X11 calls.
18:53
<&McMartin>
>_>
18:53 * ToxicFrog pushes emufun 2.0 alpha 1 to github, bounces off the walls for a while
18:53
<&Derakon>
I kinda feel like everyone should know how to code.
18:53
<&Derakon>
Though not everyone necessarily should know how to engineer software.
18:53
<&McMartin>
TF: woo
18:53
<&McMartin>
Derakon: Me too but I have to wonder how much of that was being born in the late 1970s.
18:54
<&ToxicFrog>
Still a bunch of features to add before I can consider it beta
18:54
<&ToxicFrog>
Still, feels good to release something again
18:54 * ToxicFrog vibrates at 80Hz briefly
18:54
<&Derakon>
McM: what's that got to do with it?
18:54
<&Derakon>
It's not like programming is somehow less relevant now.
18:55 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Client closed the connection]
18:55
<&McMartin>
With all due respect, it is; the computers of our youth booted into systems that *required* you to write small programs or do CLI-based interaction of some sophistication just to load our games and run them.
18:55
< JustBob>
Eh... Speaking as someone who was born in the mid-80's, I find that the ability to program is useful, but not essential, to a career in technical fields. There are enough coders 'on the market' that it's not an essential skill to possess, especially since we use a lot more standardized programs these days than we used to.
18:55
< JustBob>
And yes, I remember the DOS days. :p
18:55
<&McMartin>
But yes, I consider it an important skill to be able to command a computer to do something on-the-fly for you.
18:55
<&Derakon>
Mm, I just memorized the incantations for the C64 without understanding them, and I didn't have a DOS/Windows computer as a kid so I never experienced that particular mess.
18:55
<&McMartin>
But this is also because I consider spreadsheets a waste of time~
18:56
<&McMartin>
Lots of people use spreadsheets for things that I would say "you need to be a programmer so you can do this stuff"
18:56
<&McMartin>
Arguments that Excel is secretly a programming language will be accepted as technically true and summarily ignored~
18:56
< JustBob>
I wrote a hell of a lot of batch files to run my games, but once windows was more commonplace - I started in DOS 5.0 before we got Windows 3.1 - I started forgetting all the DOS stuff.
18:56 Syloq [Syloq@B4EC54.59F324.016BDA.8CB0A3] has joined #code
18:57
<&McMartin>
Derakon: Ah, yeah. I spent a lot of time prodding C64's hardware chips via BASIC
18:57
<&Derakon>
I'm younger than you, remember.
18:57
<&Derakon>
About as far as I got with BASIC was simple input and if/else statements.
18:57
<@Tarinaky>
Argh.
18:58
<@Tarinaky>
Eclipse, from the latin for "Completely fucking useless"
18:58
< JustBob>
Correct me if I'm wrong, McM, but didn't you also used to play on supercomputers when the rest of us were figuring out our fancy new graphing calculators?
18:58 mode/#code [+o Syloq] by ChanServ
18:58
<&Derakon>
LOAD"*",8,1 -> MENU -> select a game was about as far as I ever really needed.
18:59
< JustBob>
Hrm...
18:59
< JustBob>
You know, McM has a point.
18:59
< JustBob>
There's definitely a generational gap on 'coding knowledge prerequisite.'
19:00
< JustBob>
Just thinking on conversations with my sister - she's ten years older than me - and comparing what she does and what I do.
19:00 * ToxicFrog upreads
19:01
< JustBob>
She bitches about writing her own code to run calculations that I just shove into Matlab and run using predefined functions and libraries.
19:01
<&ToxicFrog>
Context: born mid-80s, skipped both the C64 era and DOS and grew up on UNIX.
19:01
<&Derakon>
Part of that is not using the tools that exist, perhaps because they are Matlab~
19:01
<&ToxicFrog>
I think programming is less vital today but a great deal more useful.
19:01
< JustBob>
Insofar as we're both in math-heavy technical fields, I mean - she's an astrophysicist/works for JPL, I'm in nuclear engineering.
19:02
< JustBob>
Dera - Eh, MatLab and EES are something of an industry standard for us, though.
19:02
<&ToxicFrog>
Everything and its dog has some kind of scripting interface, windows has a shell that doesn't completely suck now, there's a lot of places where it is damn useful to be able to write a simple macro or shell scrip.
19:02 * Tarinaky sighs.
19:03
< JustBob>
I can go crosscheck with the professors, but I don't think that many of them write their own code-code these days. They just script it in MatLab and call it good, or use predefined code supplied by the NRC.
19:03
<@Tarinaky>
What is the point of having a wizard to automatically install a Web Server connector if it can't automatically pull in whatever dependancies it needs from the normal package manager in the program?
19:03
<&ToxicFrog>
JustBob: how is writing a matlab script to do it not writing their own code?
19:03
<@Tarinaky>
Particularly when it doesn't give any indication what package I need for whatever class it is you need.
19:03 * Tarinaky throttles Eclipse.
19:04
<&Derakon>
I suspect Bob is differentiating between varying levels of do-it-yourself.
19:04
<@Tarinaky>
I shouldn't have to install all the things on the off chance one of them is the right package.
19:04
< JustBob>
Yes, I am.
19:04
<&Derakon>
At one extreme you go naked into the wilderness and make your own tools out of sticks and stones~
19:04
<@Tarinaky>
This defeats the point of you being modular in the first place.
19:05
< JustBob>
TF - To me, using MatLab and its predefined functions, etc. isn't really coding. It's assembling something out of prebuilt modules.
19:05
< JustBob>
ANd yes, I know, 'real programmers' do the same thing.
19:05
<&Derakon>
The entire business of language development is to create more prebuilt modules for people to assemble programs out of~
19:05
<&Derakon>
(Or to create new ways to assemble those modules)
19:05
< JustBob>
But they're doing it with libraries they've written, rather than within the confines of using a giant mound of predefined ones.
19:05
<&Derakon>
Man, if I need to multiply two arrays together fuck doing it myself.
19:05
<&ToxicFrog>
Not necessarily true.
19:06
<&Derakon>
Anything I build will be slower and buggier than what's in Numpy.
19:06
<&ToxicFrog>
I use libraries I haven't written myself all the time.
19:06
<@Tarinaky>
No, they're doing it with modules the guy in the cubicle over there wrote.
19:06
<&Derakon>
(Numerical Python library)
19:06
<@Tarinaky>
In the best case.
19:06
<&ToxicFrog>
I have loads of python scripts kicking around that are like six lines because they invoke thousands of lines of pre-existing library to do the hard work.
19:06
< JustBob>
I think I see it as the engineering vs. science debate - engineers build on what's known. Scientists find out new stuff.
19:07
<&ToxicFrog>
Hell, emufun is <1000 lines.
19:08
<@Tarinaky>
Yeah, but are you an engineer or a scientist if you implement an algorithm someone else proposed?
19:08
< JustBob>
Or, more simplistically... I'm building my 'code' with an Erector set. You're building it with a welding torch and an angle grinder. You might have prefabbed /pieces/, but you can make your own when you need them. Me? I can bend the pre-existing shapes and assemble them in new ways, but the pieces aren't fundamentally new until someone releases a new selection of metal bits.
19:08
<@Tarinaky>
Surely thaty's the engineer/scientist difference rather than whether you used a standard library implementation of a Linked List?
19:09
<&ToxicFrog>
JustBob: there's actually a whole software engineering vs. computer science discussion in there somewhere, with the added complication that most "computer science" is not actually science but applied philosophy~
19:09
<&Derakon>
The thing about code is that it's all varying levels of Tool.
19:09
<&Derakon>
You use tools to make tools, and you also use tools as components in other tools.
19:09
<&Derakon>
At all levels, you are making tools.
19:09
<&Derakon>
Programming is making tools.
19:10
<@Tarinaky>
Even people who use the erector set know where they can get an industrial lathe if they feel they need one.
19:10
<@Tarinaky>
Or drill a couple of extra holes in their prefab pieces.
19:10
< JustBob>
That's still using the pre-existing pieces. There's no 'new' pieces until someone else makes them.
19:11
< JustBob>
Modifications are not creations. :p
19:11
<&Derakon>
The "new" piece is the arrangement of existing pieces in a new way.
19:11
<@Tarinaky>
Doesn't that equally apply to hewing your tools out of blocks of marble?
19:11
<@Tarinaky>
There are no new blocks of marble.
19:11
< JustBob>
Not...really?
19:12
< JustBob>
Because you're still creating new tools.
19:12
<@Tarinaky>
All software is tools.
19:12
< JustBob>
I, personally, have a rather arbitrary dividing line in there.
19:13
<&ToxicFrog>
JustBob: those "new pieces" are just new combinations of existing pieces. Exactly the same thing you're doing.
19:13
<&ToxicFrog>
At least until you get down into the gate design level.
19:13
<@Tarinaky>
If your software isn't a tool, this means it can be replaced by the line return 133/335; without changing the result.
19:13
<@Tarinaky>
Replace the ratio with whatever result you're 'calculating'.
19:13
<&McMartin>
return 17/0
19:13
<&McMartin>
return 17/0
19:13
<&McMartin>
return 17/0
19:13
<&McMartin>
Just in case the first two didn't stick!
19:13
<@Tarinaky>
a/0 isn't a rational :/
19:14
<&Derakon>
Maybe his goal is to raise an exception.
19:14
<&McMartin>
It throws an exception!
19:14
<&McMartin>
And then, um
19:14
<&McMartin>
Throws it harder, I guess.
19:14
<&McMartin>
(This is from one particularly infamous programmer from Inktomi)
19:14 * Derakon imagines a movie title: "Thrown Exceptions 2: Throw Harder".
19:14
<&McMartin>
("This code is a stopped clock we check twice a day")
19:14
< JustBob>
Which is what this is about, I guess - my dividing line is the user vs. creator level. The intelligent user can modify the tools to be convenient, but doesn't actually create anything 'new,' toolwise. For example, I call on various derivation functions all the time. I modify some of them to be more verbose, others to be less. The creator has the know-how to go in and write a new derivation
19:14
< JustBob>
function from scratch that suits their needs perfectly.
19:15
< JustBob>
I suppose it could be considered an optimization or better-usage ability that marks the difference - and it's a blurry difference, I admit.
19:15
<@Tarinaky>
My understanding is Matlab and similar is turing complete. Which is pretty much my distinction for programming vs non-programming.
19:16
<&McMartin>
That's a pretty low bar
19:16
< JustBob>
It is Turing-complete, yes.
19:16
< ErikMesoy>
Magic:the Gathering is turing complete. :p
19:16
<@Tarinaky>
McMartin: Are there any better?
19:16
<@Tarinaky>
ErikMesoy: Only if you augment the game with a couple of extra rules.
19:17
< ErikMesoy>
Tarinaky: You only need the rule that when a card says "you may do X", players do X.
19:17
<@Tarinaky>
But it's not like people haven't suggested that you could theoretically have a program comprised of a suitable arrangement of grains of sand and a daemon to iterate over them.
19:19 Courage [Moltare@583787.FF2A18.190FE2.4D81A1] has quit [Ping timeout: 121 seconds]
19:19
<@Tarinaky>
It doesn't /really/ matter as long as someone releases a JVM that supports your chosen brand of beercan.
19:19 Courage [Moltare@583787.FF2A18.190FE2.4D81A1] has joined #code
19:19
<@Tarinaky>
:p
19:19 mode/#code [+o Courage] by ChanServ
19:20
< JustBob>
Hrm. Alternatively, the Mechanic vs. Engineer example. The mechanic can order from a category of parts, build an engine. He can modify the parts to some degree to suit the specific needs of the engine, but in the end, they're modifications and fine-tuning. The engineer just designs the entire engine from scratch, possibly calling on pre-existing parts and designing new ones when the existing
19:20
< JustBob>
ones won't suit the need.
19:20
< JustBob>
Perhaps that's a better analogy to use.
19:20
< JustBob>
And yes, I am aware that you can have mechanic-engineers who do both.
19:21
<&Derakon>
The main difference here I feel is that even "mechanics" in the CS world are making new things, not maintaining old things.
19:21
<@Tarinaky>
It's a good thing we don't live in a universe where fundamentally all discrete catagorisation is arbitrary and fundamentally futile.
19:21
<@Tarinaky>
*discrete philasophical
19:21
<@Tarinaky>
*philisiphical ?
19:21
<@Tarinaky>
I can't spell.
19:21
< JustBob>
Philosophical.
19:21
<@Tarinaky>
Thank you.
19:23
< JustBob>
Anyway, this just goes back to the previous conversation, about relative utility of programmint skill. In an environment where there are many existing 'parts' to utilize, the ability to design 'new' parts is of less utility than it was when the parts supply didn't exist.
19:23
< JustBob>
Which, conversely, makes the ability to design new parts more important.
19:24
<&ToxicFrog>
That said, programming skill is necessary to use those parts at all.
19:25
< JustBob>
Well, yes, but using is different than creating. I can 'use' a computer. I'd stare at you in abject confusion if you told me to design one.
19:27
< JustBob>
bah, it's all just philosophy, I guess.
19:30
<@Tarinaky>
And now for something completely different: http://7.asset.soup.io/asset/4049/7559_e892.jpeg
19:30
<@Tarinaky>
http://www.youtube.com/watch?v=AgqEIp2YmtE
19:30
<&ToxicFrog>
My point is that the difference between "using the existing parts" and "creating new parts", in this context, is entirely one of degree, not kind.
19:31
<&ToxicFrog>
If you can use the parts - beyond just rote memorization of rituals you don't understand, I mean - you have the skills needed to create new ones (and are doing so by combining the existing parts, even)
19:34
<@Tarinaky>
Doesn't that fall foul of a disconnect between understanding theoretical models of computation and knowing exactly how to arrange transistors on a die to build one?
19:34
<@Tarinaky>
Particularly given computer science and programming is older than the digital computer.
19:35
<&ToxicFrog>
...no? I'm not sure that's even relevant.
19:35
<&ToxicFrog>
In this context, "designing new parts" is "writing new libraries", not "designing new processors"
19:36
<@Tarinaky>
If I go and write a new library in C am I using C by rote memorisation of rituals or or do I have the skills to design a machine that can execute a C program?
19:37
<@Tarinaky>
(C being the lowest level language I know)
19:38
<&McMartin>
Depends on how good someone else's compiler is, since one could in theory compile C to a collection of ropes, pulleys, and cogs.
19:38
<&ToxicFrog>
Tarinaky: what are you even trying to argue at this point?
19:38
<&ToxicFrog>
Seriously, I do not understand.
19:39
<@Tarinaky>
I do not understand what you do not understand.
19:39
<&ToxicFrog>
What your position is. You're asking questions that seem to be almost total non sequiturs.
19:40
<@Tarinaky>
My position is this is a silly discussion.
19:40
<&ToxicFrog>
Unless I've completely misread Bob and his position is "the distinction between programmers and users is that programmers know how to design computer hardware", but I don't think that's actually the case.
19:41
< JustBob>
...err, that's not the case.
19:42
<&ToxicFrog>
Ok. That's what I thought.
19:43
< JustBob>
My distinction is 'users assemble pre-existing components supplied from an outside source into functional code,' and 'programmers create those components.' With the caveat that it's a blurry line once you start talking about modifying the pre-existing parts - e.g. at the moment, I'm still waving my hands and muttering ritual incantations a lot when I write my MatLab scripting. Eventually, I
19:43
< JustBob>
hope to achieve the ability to generate entirely self-contained MatLab scripts where 1.) I'm not relying on pre-defined functions, and 2.) I understand wtf is going on when I hit the run command.
19:43
<&ToxicFrog>
Right, what I
19:43
<&ToxicFrog>
m arguing is that this distinction isn
19:43
<&ToxicFrog>
t just arbitrary, it's nonsensical.
19:44
<&ToxicFrog>
Programmers "create components" by "assembling pre-existing components supplied from an outside source".
19:45
< JustBob>
Hrm.
19:45
<@RobinStamer>
In the same way, engineers do the same thing
19:45
<&ToxicFrog>
My current project is a relatively small amount of glue combining libraries for graphics, input, program execution, and file access from disparate sources, running in an interpreter written by yet another team, on an OS I have not contributed to the development of in any way, on hardware I have not designed.
19:45
<@RobinStamer>
Except their standard libraries or opt-codes are replaced with the laws of physics and such.
19:47
< JustBob>
Eh. I think that the line I'm tossing in there is that you have the capability to go and write those libraries, TF, as opposed to someone who can glue them together, but doesn't have the ability to go and write them independently. Which is a rather arbitrary line, I admit.
19:47
<&Derakon>
But we don't have the capability to rewrite the Linux kernel.
19:48
<&Derakon>
For example.
19:48
<&ToxicFrog>
It's a line that doesn't even exist, IMO. That program you're writing that glues the libraries together is a bit of configuration away from being a library itself.
19:48
<&Derakon>
Even if I did have the skills required, it's way too big a task for one guy, at this point.
19:48
< JustBob>
Hrm.
19:49
<@Tarinaky>
Argh. Why does all help for Eclipse always helpfully suggest panes and pages that aren't there.
19:49
<&Derakon>
I think the problem you run into here is that CS is a continual process of rendering the tools of the prior generation obsolete by incorporating them into better tools.
19:49
< JustBob>
That might be it.
19:49
<@Tarinaky>
It's like trying to read the manual for a different brand of VCR.
19:49
<&Derakon>
You can't say "People who program at this level are Real Engineers" because "this level" keeps changing depending on when you make the statement.
19:50
< JustBob>
I think my tendency to divide things like this is from the hard-engineering tradition, where you have techs who assemble pieces and modify them now and again, and engineers who create entirely new pieces.
19:50
< JustBob>
Going back to the mechanic vs. engineer analogy, I mean.
19:51
<&Derakon>
At one point, Real Engineers had to be bit-twiddling machine code; nowadays they're expected to know C but assembly is optional and machine code is nuts.
19:51
<&Derakon>
So that's at least two levels removed from the "old" Real Engineers.
19:51
<&Derakon>
And in practice the vast majority of serious programming work is done in even higher-level languages.
19:52
<&ToxicFrog>
JustBob: I think the closest analogy here is that everyone writing code is a "mechanic", and the "engineers" are the theoreticians who come up with new algorithms and data structures and formalisms for the "mechanics" to implement.
19:52
<&ToxicFrog>
(and the people who design the hardware are basically defining the "laws of physics" in this analogy, and are thus a cruel and uncaring God)
19:52
<&Derakon>
Except that algorithms tend to be underspecified and have lots of niggling little details that have to be sorted out by the "mechanics"~
19:53
< JustBob>
A given technician isn't going to give a damn that the Rankine cycle dictates that maximum efficiency in a differential heat system is 87.23%, they're going to want to slap pump, boiler, turbine, condensor, and pump together and get power output in some form. They might fiddle with the specifics to maximize their efficiency, but it's not their worry. The engineer is the one staring at the
19:53
< JustBob>
Ranking cycle maximums and going, "Huh, I wonder how I can exceed thermodynamic potential here..."
19:54
< JustBob>
TF - Hrm. I think that works, for fitting things into the way my head works.
19:54
<&Derakon>
In other news, the program I started running ~3 hours ago is now halfway done~
19:57
<&ToxicFrog>
Derakon: and in the real world, half the time the mechanics have to modify the stuff the engineers gave them anyways because no-one considered that without a coverplate *here*, it'll vent gravel into the operator's face when running
19:57
<&ToxicFrog>
etc
19:59
< JustBob>
Snerk.
19:59
< JustBob>
Don't get me started on that. :p
20:00
< JustBob>
My favorite is still the elegantly-designed, practically-engineered hydraulic system for raising and lowering a platform...that the designer forgot to check clearances on. So at maximum depression, it cut its own hydraulic hoses.
20:01
<&ToxicFrog>
snrk
20:01
<&ToxicFrog>
And now, croutons
20:01 * ToxicFrog departs
20:01
< JustBob>
Or the counterpart to that one, the feedwater and condensate pumping system that was designed very well, close-fitting, etc. Except that they couldn't install the pumps because the pipes were in the way, warranting an entirely new piping setup. :p
20:02
< JustBob>
(These being actual US Navy adventures in naval engineerin.)
20:02 Kindamoody|out is now known as Kindamoody
20:03
<@Tamber>
You'd think they'd have the hang of that sort of thing by now.
20:06
<@Tarinaky>
Argh. I set my project's targetted runtime to Glassfish.
20:06
<@Tarinaky>
It's /still/ tellling me it can't resolve javax.servlet.
20:06
<@Tarinaky>
Fuck fuck fuckity fuck.
20:09
<@RobinStamer>
Use an IDE, they're supposed to abstract that all away so you don't have to care.
20:09
<@Tarinaky>
I /am/ using an IDE.
20:09
<@RobinStamer>
Then use a Makefile like a sane person
20:10
<@Tarinaky>
I would if I knew what magic invocation it wanted.
20:10
<@Tarinaky>
But I don't.
20:10
<@Tarinaky>
I suspect if I did I'd know what the fuck to google for.
20:10
<@RobinStamer>
Want my Java project's Makefile?
20:10
<@RobinStamer>
It's pretty sweet, just feed it a directory and it's all good to go.
20:10
<&McMartin>
IIRC, make and javac don't mix too well
20:11
<@RobinStamer>
IME they work great.
20:11
<&McMartin>
Javac wants to do its own dependency analysis, etc.
20:11
<&McMartin>
So you get javac invoked several thousand times redundantly
20:11
<@RobinStamer>
Oh wait, javac, yeah. I've been using gcj.
20:11
<&McMartin>
(ant apparently gets around this)
20:12
<@Tarinaky>
Still doesn't tell me how to get my compiles class files into glass fish
20:12
<@Tarinaky>
Or whatever it is I'm meant to be doing.
20:12
<@Tarinaky>
This is why I didn't want to do the fucking servlets for this fucking project.
20:17
<@Alek>
hey um.
20:17
<@Alek>
what's the name for those programming tricks where the output of the program is itself?
20:17
< ErikMesoy>
Quine
20:17
<@Alek>
hah. in python it's easy.
20:17
<@Alek>
from sys import argv
20:18
<@Alek>
print open(argv).read()
20:18
<@Tarinaky>
In C it's easier.
20:18
<@Tarinaky>
\n
20:19
<@Tarinaky>
Or did it have to be \0 ?
20:19
<@Tarinaky>
I forget.
20:19
<&Derakon>
It's generally considered cheating to do it by opening your source file and printing it.
20:19
<@RobinStamer>
That'll only work on Windows
20:19
<@RobinStamer>
As UNIXes don't auto-print a new-line after programs
20:19
< ErikMesoy>
Yeah, opening the source is cheating.
20:20
< ErikMesoy>
The interesting bit of a quine is when you somehow make a program that has an unpacker bit and a packed bit that unpacks into being the whole program.
20:21
<@Alek>
:P
20:22
<@Alek>
holographic, huh?
20:24
< ErikMesoy>
It may help to use % a couple of times.
20:30 Kindamoody is now known as Kindamoody[zZz]
20:36 Courage [Moltare@583787.FF2A18.190FE2.4D81A1] has quit [Ping timeout: 121 seconds]
20:37 Courage [Moltare@583787.FF2A18.190FE2.4D81A1] has joined #code
20:37 mode/#code [+o Courage] by ChanServ
20:50 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
20:50 mode/#code [+qo Vornicus Vornicus] by ChanServ
21:40
<&Derakon>
Well, I think this is working, more or less. http://derakon.dyndns.org/~chriswei/temp2/firstAttemptLinearization.png
21:40
<&Derakon>
The low end has something weird going on but that should probably be fixable with better source data.
22:14
<&ToxicFrog>
Hmm. Tracking which files have and have not been viewed.
22:14
<&ToxicFrog>
Append info to local configuration file? Store it in the cache? Or generate a new file?
22:15
<&ToxicFrog>
I'm leaning towards "generate a new file" as then it persists even if you move parts of the library around.
22:15
<&ToxicFrog>
(also, the cache hasn't been updated yet)
22:26 * Derakon eyes his results, wonders why they aren't perfectly linear.
22:27
<&Derakon>
We have a response curve f(x). Then we sample that curve to create g(x). Invert g(x), feed reported values in, get absolute intensity out.
22:27
<&Derakon>
So I'm testing it by feeding the samples used to generate g(x) into the linearizator.
22:27
<&Derakon>
Or whatever you call it.
22:27
<&Derakon>
This should result in getting a perfectly straight line, I would think.
22:27
<&Derakon>
But instead we get minor jitter.
22:28
<&Derakon>
Too big to be floating-point error.
22:51 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
23:01 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has quit [[NS] Quit: Leaving]
23:08 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
23:08 mode/#code [+o celticminstrel] by ChanServ
23:23
<&ToxicFrog>
Ok. Configuration propagation.
23:24
<&ToxicFrog>
The fundamental issue here is that I don't want ordering to affect things as much as it does, while still being significant.
23:24
<&ToxicFrog>
Or maybe that's not the fundamental issue. Fuck.
23:24
<&ToxicFrog>
Ok, so.
23:25
<&ToxicFrog>
The configuration system associates a configuration function (which may be a no-op) with every node in the library tree.
23:25
<&ToxicFrog>
When a node is realized, all parent configuration functions are executed on it, followed by the node's own configuration function.
23:26
<&ToxicFrog>
So, the master configuration file library.cfg is applied first, then /.emufun, then /foo/.emufun, and so on, with the last configuration file being the one associated directly with the file or directory being realized.
23:26
<&ToxicFrog>
Thus, the more specific override the more general.
23:26
<&ToxicFrog>
Configuration functions can also have conditions. These are checked when the function is called. And this is where the problem arises.
23:27
<&ToxicFrog>
library.cfg:
23:27
<&ToxicFrog>
extension (".avi", ".ogm") { type = "movie" }
23:27
<&ToxicFrog>
type ("movie") { icon = icons.movie; execute = "vlc ${path}"; }
23:28 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has quit [[NS] Quit: brb]
23:28
<&ToxicFrog>
So far so good. Then we get into a directory full of DVD images, and its configuration file contains:
23:28
<&ToxicFrog>
extension (".iso", ".bin", ".raw") { type = "movie" }
23:28 syksleep [the@Nightstar-32c23e04.iinet.net.au] has quit [Ping timeout: 121 seconds]
23:29
<&ToxicFrog>
But they don't have the movie icon or the vlc command, because the type("movie") check has already been executed (and failed), as it was in a less specific configuration file.
23:30
<&ToxicFrog>
One possibility I thought of was to execute the configuration files from most to least specific, but disallow overwriting of settings, so the most specific settings would still override the least.
23:30
<&ToxicFrog>
But this just reverses the problem; say library.cfg contains all the file extension information and /.emufun contains the actual commands used to load those files. Oops, now nothing works.
23:31 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has joined #code
23:31 mode/#code [+o Alek] by ChanServ
23:31
<&ToxicFrog>
At the moment, the solution I'm toying with is this
23:31
<&ToxicFrog>
execute top to bottm
23:32
<&ToxicFrog>
When a configuration file is executed, conditions that pass are resolved immediately
23:32
<&ToxicFrog>
Conditions that do not pass are deferred, and put in a list, least to most specific.
23:32
<&ToxicFrog>
When all configuration files have been executed, that list is processed. Conditions that pass are resolved immediately and removed from the list.
23:33
<&ToxicFrog>
List processing repeats until either no conditions pass or the list is empty.
23:33
<&ToxicFrog>
So, in the first example, when loading a .iso, the first and second conditions would be deferred. The third would succeed immediately.
23:33 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
23:33
<&ToxicFrog>
The first and second conditions would then be reprocessed, the first would fail (and be deferred again), the second would succeed and be removed from the list.
23:34
<&ToxicFrog>
Then there would be another reprocessing, the first condition would fail again and the list would be discarded.
23:34
<&ToxicFrog>
Does this sound at all sensible?
23:34
<&ToxicFrog>
I think it will work, but I have a nagging feeling that there's some horrible edge case where it will all go to shit that I haven't thought of.
23:49 * Vornicus tries to think of exercises for kaura, because yes
23:50 * Derakon points Vorn to Project Euler~
23:54
< JustBob>
Project Euler is the work of the devil.
23:54
<@Alek>
well, you should have a special insight into it then, shouldn't you? :)
23:55 Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has quit [[NS] Quit: leaving]
23:56
<~Vornicus>
Project Euler requires loops, which have not yet been taught~
23:59
<&ToxicFrog>
Loops are isomorphic to recursion~
23:59
< JustBob>
Not all of euler requires loops.
23:59
< JustBob>
It's an incremental growing process.
--- Log closed Thu Jan 31 00:00:25 2013
code logs -> 2013 -> Wed, 30 Jan 2013< code.20130129.log - code.20130131.log >

[ Latest log file ]