code logs -> 2013 -> Tue, 10 Dec 2013< code.20131209.log - code.20131211.log >
--- Log opened Tue Dec 10 00:00:44 2013
00:01
< McMartin>
If you're starting from total ground zero, I would recommend working through the "Writing With Inform" book (the "white pages" manual)
00:06
< logicmoo>
i am almost ground zero.. but I could write an inform7 interpreter quicker that probably learning it
00:06
< logicmoo>
than*
00:07
< logicmoo>
( gads that sounded too bold of me.. but I like converting Natlang to prolog ;P .. i have written a few muds that are programmed in NL)
00:08
< logicmoo>
but my current team wants to use soemting that already has wide acceptance
00:09
< logicmoo>
i7 is confusing to me still since i am still learning what is/inst a keyword
00:12
<@Tarinaky>
iirc Inform7 can have bits of Inform6 embedded in it. I forget whether this is because Inform7 is sub-turing or it's just a pain to express certain things.
00:13
< logicmoo>
ah.. oh yeah actualyl btw.. teh i6 miz-ins that is why i hadnt starting impl i7
00:14
< logicmoo>
i6 inlines is why i never started the i7 interpretor !
00:27
<@Tarinaky>
Dumb question. Is there an rc file that vim will look for that can be changed based on cwd?
00:28
<@Tarinaky>
So if I'm in a folder for a particular project it'll load an rc file with macros for running unittests or something.
00:28
<@Tarinaky>
Or failing that, based on the language of the file under edit.
00:29
< McMartin>
I7 is fully turing complete; it's just that it compiles via I6 code generation
00:29
< McMartin>
But the language itself is mostly Algol-descended with an unusual way of organizing functions.
00:30
< McMartin>
I7 has a decent set of list map/filter capabilities as of the latest release, even.
00:32
< McMartin>
A list of all the phrases it looks for is at http://inform7.com/learn/documents/I7_syntax.txt
00:33
< McMartin>
http://inform7.com/learn/learn/ also includes links to teaching resources.
00:34
< McMartin>
I don't know much about vim, I'm afraid
00:37
<@Tarinaky>
It /seems/ what I want is: autocmd filetype python map <F5> <ESC>:!python2 -m unittest discover<ENTER>
00:42 * McMartin prepares a weekly status report, opens with two links to The Codeless Code
00:46
<@Tarinaky>
Perplexing strings found in documentation: ":nunmap can also be used outside of a monastery."
00:46
<@Tarinaky>
As far as i can tell, it's a joke.
00:46
< McMartin>
Yup.
00:46
< McMartin>
n-unmap vs. nun-map.
00:48
<@Tarinaky>
There's a well-shared phrase about documentation and axe-murderers hunting its writers down.
00:48
<@Tarinaky>
I feel that this qualifies both for being a bad joke and for obsfucating the documentation :/
00:49 himi [fow035@Nightstar-q9amk4.ffp.csiro.au] has joined #code
00:49 mode/#code [+o himi] by ChanServ
00:49
<@Tarinaky>
But given the age of most POSIX utilities and their documentation it's probably someone dead I'm not allowed to bad-mouth...
00:49
<@Tarinaky>
Like Jesus...
00:51
<@Tarinaky>
At least vim is probably new-testament. If it were vi I'd be making jokes about Moses and Issac.
00:51
<@Tarinaky>
*Abraham
00:52
<@Tarinaky>
I'm thinking of Abraham... Issac was the son wasn't it...
00:52
< McMartin>
Isaac was the one as in The Binding Of, yes.
00:53
<@Tarinaky>
I meant as in the Bible.
00:54
<@Tarinaky>
You know, the best-selling fantasy novel after Harry Potter.
00:54
< McMartin>
Right
00:54
< McMartin>
The game "The Binding of Isaac" is a direct reference to the incident known as "The Binding of Isaac" in the Old Testament.
00:54
<@Tarinaky>
Ah.
00:54
<@Tarinaky>
I did not know that.
00:55
<@Tarinaky>
I have just realised that python -m unittest discover isn't... atually... discovering these unittests.
00:55
< McMartin>
http://en.wikipedia.org/wiki/Binding_of_Isaac
01:06
<&ToxicFrog>
logicmoo: welcome.
01:11
< logicmoo>
hi
01:11
< logicmoo>
(thank you)
01:18 * TheWatcher readswayup
01:26
<@TheWatcher>
I do note that there's nothing "quietly" about the crunches I've had to do. TPTB know exactly the level of work I've had to put in.
01:30 redwire [redwire@Nightstar-27dppb.nl.bellaliant.net] has quit [Connection closed]
01:32 redwire [redwire@Nightstar-27dppb.nl.bellaliant.net] has joined #code
01:40 You're now known as TheWatcher[T-2]
01:42 You're now known as TheWatcher[zZzZ]
02:24 Vorntastic [Vorn@Nightstar-f7rc29.sub-70-211-12.myvzw.com] has joined #code
03:10 Vorntastic [Vorn@Nightstar-f7rc29.sub-70-211-12.myvzw.com] has quit [Ping timeout: 121 seconds]
03:20 Vornicus [vorn@Nightstar-sn7kve.sd.cox.net] has joined #code
03:20 mode/#code [+qo Vornicus Vornicus] by ChanServ
03:24 Xon [Xon@Nightstar-q4s.ku7.252.119.IP] has quit [[NS] Quit: ]
03:29 redwire [redwire@Nightstar-27dppb.nl.bellaliant.net] has quit [[NS] Quit: Textual IRC Client: www.textualapp.com]
03:30 Xon [Xon@Nightstar-q4s.ku7.252.119.IP] has joined #code
03:36 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
04:29 celticminstrel [celticminst@Nightstar-gj43l1.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
04:30 * McMartin gets home from marathon debugging session
04:31
<@Azash>
What've you been debugging?
04:51 Kindamoody[zZz] is now known as Kindamoody
04:53
<&ToxicFrog>
Memo to self for tomorrow: override love.errhand() in main.lua to set a new xpcall() error handler for the mainloop. This can handle logging and then display an error screen that works better with a controller.
04:55
< Shiz>
[Memo noted.]
04:59 Harlow [Harlow@Nightstar-2dbe3d64.il.comcast.net] has joined #code
05:02 Stalker [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
05:03
< McMartin>
Azash: Trying to get a number of third-party libraries to play well together, mostly
05:03
<@Azash>
Ah, good luck
05:04 Turaiel is now known as Turaiel[Offline]
05:08 Derakon is now known as Derakon[AFK]
05:09
< Harlow>
Could someone make a recommendation of a good code theory book (pertaining to c++ practices if possible, or just mathematics and coding)
05:09
< Harlow>
>.>
05:12
<@Azash>
Uh, do you have a certain area of theory in mind?
05:12
<@Azash>
If you want to go deeper into C++, then Bruce Eckel's Thinking in C++ book
05:12
<@Azash>
For general algorithms and data structures, Cormen et al
05:22
< McMartin>
For a general tour of computation, Structure and Interpretation of Computer Programs
06:02
<@Alek>
http://www.smbc-comics.com/?id=3186#comic
06:06 ErikMesoy [Erik@Nightstar-3kot9q.80-203-17.nextgentel.com] has joined #code
06:08 Netsplit *.net <-> *.split quits: @Orthia, @Namegduf, Reiver, @himi, McMartin, ErikMesoy|sleep, logicmoo, ^Xires, jeroud, dmiles_afk, (+1 more, use /NETSPLIT to show all of them)
06:09 Netsplit over, joins: Reiver, @Orthia, McMartin, @himi, @Namegduf, AnnoDomini
06:09 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds]
06:10 Netsplit over, joins: jeroud
06:11 dmiles_afk [dmiles@Nightstar-hdcn1r.or.comcast.net] has joined #code
06:12 ^Xires [xires@Nightstar-bir6q3.feedthetrolls.net] has joined #code
06:12
< Harlow>
Alex thanks for making me laugh, that was a good link
06:13
< Harlow>
Alek*
06:14 dmiles_akf [dmiles@Nightstar-hdcn1r.or.comcast.net] has joined #code
06:19 dmiles_afk [dmiles@Nightstar-hdcn1r.or.comcast.net] has quit [Connection closed]
06:19 dmiles_akf [dmiles@Nightstar-hdcn1r.or.comcast.net] has quit [Connection reset by peer]
06:19 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code
06:19 mode/#code [+ao McMartin McMartin] by ChanServ
06:21 dmiles_afk [dmiles@Nightstar-hdcn1r.or.comcast.net] has joined #code
06:21 dmiles_akf [dmiles@Nightstar-hdcn1r.or.comcast.net] has joined #code
06:23 dmiles_afk [dmiles@Nightstar-hdcn1r.or.comcast.net] has quit [Connection closed]
06:23 dmiles_akf [dmiles@Nightstar-hdcn1r.or.comcast.net] has quit [Connection reset by peer]
06:24 dmiles_afk [dmiles@Nightstar-hdcn1r.or.comcast.net] has joined #code
06:25
< jeroud>
Tarinaky: py.test is <3.
06:25 dmiles_afk [dmiles@Nightstar-hdcn1r.or.comcast.net] has quit [Connection closed]
06:26
< jeroud>
Or their test finder/runner is, at least.
06:26 dmiles_afk [dmiles@Nightstar-hdcn1r.or.comcast.net] has joined #code
06:26
< jeroud>
The rest of their stuff has too much magic for my taste.
06:26 * Vornicus pokes vaguely at Twisted, trying to figure out what the hell he even wants.
06:27
< jeroud>
Vornicus: What are you trying to do?
06:28
<~Vornicus>
The goal is an IRC bot that serves a board game like Power Grid.
06:29
< jeroud>
Are you having trouble with the IRC bot bit or the game bit?
06:29
<~Vornicus>
The IRC bot bit.
06:30
<@Alek>
http://www.smbc-comics.com/comics/20130922after.gif
06:31
<&jerith>
Vornicus: https://github.com/praekelt/vumi/blob/develop/vumi/transports/irc/irc.py might be helpful to look at.
06:31
<~Vornicus>
Well, the game bit also depends a lot on how to build the beginnings of the IRC bot; I need to build it so the IRC bot knows what state the game is in and thus what, um, inputs it accepts.
06:33
<&jerith>
Vornicus: Rather build two separate things.
06:33
<~Vornicus>
Of course.
06:33
<~Vornicus>
But then -- well, for power grid -- if you try to buy a city when, for instance, it's not your turn, or it is your turn but you're in the plant bidding phase, or
06:34
<&jerith>
https://github.com/praekelt/vumi/blob/develop/vumi/demos/tictactoe.py is a tic-tac-toe game that runs over USSD.
06:35
<&jerith>
Vastly less complicated, but it's the kind of design I'd use.
06:37
<~Vornicus>
damn. my hero
06:38
<&jerith>
There might be more useful things in the demos directory there.
06:39
<&jerith>
I wrote rock-paper-scissors because the round-trip time for each player's turn in tic-tac-toe was causing too many USSD timeouts.
06:39
<&jerith>
RPS has both players take their turn simultaneously.
06:44
<@Alek>
http://www.smbc-comics.com/?id=3080#comic
06:45 RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.]
06:48 RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has joined #code
06:54 himi [fow035@Nightstar-q9amk4.ffp.csiro.au] has quit [Ping timeout: 121 seconds]
06:57
< Syka>
jerith: ugh, USSD
06:57
< Syka>
jerith: I have no idea why smartphones don't handle USSD better
06:57
< Syka>
Android handles it with a popup box :(
06:58
< Syka>
or is that MMI
06:58
< Syka>
...regardless, it's all pretty shit
06:58
<&jerith>
Syka: USSD is kind of supposed to be a modal overlay thing.
06:59
<&jerith>
But I suspect it's because USSD isn't used very much at all in the kind of markets smartphones target.
06:59
< Syka>
yeah
06:59
< Syka>
I have to use that for recharging my phone
06:59
<&jerith>
(Which is high income groups in US and EU.)
06:59
< Syka>
"misunderstood input LOL" is common :(
07:00
< Syka>
it also is slightly too long for the keyboard
07:00
<&jerith>
I think that's the service you're hitting, though.
07:00
<&jerith>
Because I've never seen that/
07:00
< Syka>
so like, to enter text, i have to close the keyboard, click on the text input (which isnt automatically highlighted), then enter ti
07:01
< Syka>
yeah it is USSD
07:07
<@Alek>
var you = new Child({papa:papa_id, mama: mama_id});
07:15 * Alek laughs muchly.
07:17
<@Alek>
Guy at a factory. So-called "Rationalizator". Takes a puck of barium titanate ceramic, which needs to be cut. Instead, he decides to split it with a sledgehammer and chisel.
07:17
<&jerith>
We're working on a project called MAMA.
07:17
<&jerith>
http://www.askmama.co.za/
07:17 * Alek thumbs up.
07:21
< Harlow>
Nice
07:26
<@Alek>
what, nobody gets mine? >_>
08:22 Kindamoody is now known as Kindamoody|out
08:31 * Vornicus tries to figure out what the model looks like...
08:31
<@Alek>
heh.
08:31
<&McMartin>
1.6 seconds for the Scheme Klotski solver
08:32
<&McMartin>
That is now the fastest solver I have
08:32
<@Alek>
there's one webstore I occasionally "buy" something from. now, most webforms allow you to save your username and password, or just the username, or none.
08:32
<@Alek>
this one? lets you save just the password. asterisked, of course. the username you have to re-enter every time you check out.
08:33
<@Alek>
but the password is already filled out.
08:37
<~Vornicus>
weirdass
08:59 Harlow [Harlow@Nightstar-2dbe3d64.il.comcast.net] has quit [[NS] Quit: BED]
09:08 Orthia [orthianz@Nightstar-avg.1ee.224.119.IP] has quit [Ping timeout: 121 seconds]
09:11 Orthia [orthianz@Nightstar-avg.1ee.224.119.IP] has joined #code
09:12 mode/#code [+o Orthia] by ChanServ
09:27 You're now known as TheWatcher
09:39 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code
09:42 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
09:42 mode/#code [+o himi] by ChanServ
09:57 AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [[NS] Quit: Leaving]
11:02 * TheWatcher sighs at students
11:03
<@Tarinaky>
public static methods all over a single God class?
11:04
<@TheWatcher>
No, this is C.
11:04
<@Tarinaky>
Terribad pointer semantics?
11:04
<@Tarinaky>
Returning pointers to objects on the stack up the stack?
11:05
<@Tarinaky>
Single God procedure representing an FSM controlled by switch statement?
11:05
<@TheWatcher>
I tell them, right at the beginning, that 25% of the marks go on commenting, layout, and readability. There are documents where I cover the practices they should be following.
11:06
<@TheWatcher>
I give them warnings, I go into detail about the things they did right and wrong, I explain it over again.
11:07
<@Tarinaky>
"You can lead a horse to wisdom but you can't make it think"
11:09
<@Tarinaky>
I dunno. Maybe Python is a good choice of language for teaching code layout.
11:09
<@Tarinaky>
In the same way that Java makes it impossible to do pointers 'wrong'.
11:09
<@Tarinaky>
(*'impossible')
11:10
<@TheWatcher>
It's not just layout. It's documentation
11:10
<@Tarinaky>
Documentation is hard. Layout, at least, is inexcusable.
11:10
<@TheWatcher>
Layout is generally not to bad, aside from one of the students who takes the blunderbuss approach to indentation
11:11
<@TheWatcher>
*too
11:11
<@Tarinaky>
Heh.
11:11
<@Tarinaky>
I'm terrible about documentation :/
11:11
<@TheWatcher>
Whereas I'm psychotic~
11:11
<@Tarinaky>
Particularly when I don't have a plan/am hacking.
11:11
<@Tarinaky>
I'm better about it when I have a design.
11:12
<@TheWatcher>
Which I guess is one thing, but /clean it up and document it/ before submitting it for marking.
11:13 * TheWatcher eyes this student, gets The Globals Twitch under his left eye
11:13
<@Tarinaky>
Globals are just mis-understood.
11:14
<@TheWatcher>
In this case "Oh, these two functions use a temporary pointer with the same type? I'll just make a single global!"
11:15
<~Vornicus>
:(
11:28
<@Tarinaky>
I can honestly say that, having completed the Agile Methodologies series of lectures this semester...
11:28
<@Tarinaky>
I am not a fan of XP :/
11:33 Vornotron [vorn@Nightstar-sn7kve.sd.cox.net] has joined #code
11:34
< Syka>
what is XP again
11:34
< Syka>
pair programming and sprints and shit?
11:34
< RichyB>
Syka, the Windows edition, or "eXtreme Programming"?
11:34
< Syka>
the one that was just mentioned by Tarinaky
11:34
< RichyB>
Yeah, but XP is a specific thing. You're supposed to do sprints, pairs, TDD, â¦
11:34
< Syka>
I know what the Windows edition is ;D
11:34
< RichyB>
A few other things that I forget.
11:34
< Syka>
TDD isn't so bad
11:34
< Syka>
I can't do it, though
11:35
<@TheWatcher>
Whoa, deja-vu.
11:35
< Syka>
I can't write tests first, since I have no idea what my code is going to do
11:35
< Syka>
because I don't plan anything :D
11:35
< RichyB>
I write tests-first sometimes.
11:35
< Syka>
tests after writing is flawed though
11:35
< RichyB>
Given a really good brief, it's quite nice.
11:35
< Syka>
because then you're testing the behaviour of your implementation
11:36
< Syka>
not the behaviour of the abstract class which just so happens to be your implementation
11:36
< RichyB>
Eh. Tests after writing isn't inevitably doomed if you make sure that you break your implementation on purpose and verify that the tests no longer pass.
11:36
< Syka>
I just don't have any projects with clearly defined in-out
11:36
< Syka>
because I write webapps, which end up being giant classes that do shitloads of things
11:37 Vornicus [vorn@Nightstar-sn7kve.sd.cox.net] has quit [Ping timeout: 121 seconds]
11:37
<@TheWatcher>
It is possible to test them.
11:38
< Syka>
it is, but then you're not testing a class, so much as your app
11:38
< Syka>
which is sort of hard to do
11:38
<@TheWatcher>
I do note that the barrier to doing so is pretty high, as they usually require a shitton more environment than normal
11:38
< Syka>
and yes
11:38
< Syka>
I am coming into that right now
11:38
< Syka>
testing twisted.web is a fucking bitch
11:38
< Syka>
I have a half-written implementation of a mock Request :/
11:39
< Syka>
literally 200 lines of environment
11:43
< Vornotron>
pair programming is awesome.
11:44
< Vornotron>
Occasionally I'll pair program with Vash, and she knows nothing at all about code, and it is amazing how much better my code comes out when I do that.
11:46
<@TheWatcher>
https://twitter.com/mikedoel/status/271314113177735170
11:46
<@TheWatcher>
That's how to do it properly~
11:46
<@Tarinaky>
TDD and XP are two different things, surely?
11:46 * Tarinaky is distracted by lecture.
11:47
< Vornotron>
tdd is something that shows up as part of XP
11:51 * TheWatcher eyes
11:51
<@TheWatcher>
... what do some of these students have against the space bar?
11:51
<@TheWatcher>
HAs someone convinced them that touching it causes some embarrassing skin disease or something?
11:52
< Vornotron>
I occasionally find myself not spacing more tightly bound operators.
11:53
<@TheWatcher>
`if((new_element=malloc(sizeof(struct node)))==NULL){` for example
11:53
< Vornotron>
Like I'll write a + 3*b + 4*c or a**2 * b**3
11:53
< Vornotron>
ewk
11:53
< Vornotron>
though to be fair there are only, um, six places I'd typically put a space in that.
11:54
<@TheWatcher>
Rest of the code is like that, though: that was just a random line
11:54
<@TheWatcher>
I guess I should be thankful there are lines.
11:56
< Vornotron>
yeah, you can get away with surprisingly little whitespace and still have it compile.
11:56
<@Tarinaky>
Vornotron: it's not one of the enabling practices... and you can certainly do TDD without XP.
11:56
<@Tarinaky>
Anyway. TDD is fine.
11:56
<@Tarinaky>
Pair Programming... not so much.
11:59
< Vornotron>
pair programming gets me better results consistently.
11:59
<@Tarinaky>
TheWatcher: Maybe they're trying to rigidly adhear to a fixed limit on the characters per row?
11:59
<@TheWatcher>
Nope
12:00
<@TheWatcher>
Plenty of lines sticking out to the right of the above
12:02 Vornotron is now known as Vornicus
12:02 mode/#code [+qo Vornicus Vornicus] by ChanServ
12:09 Netsplit *.net <-> *.split quits: @Orthia, @Vornicus, @Namegduf, AnnoDomini, Reiver
12:10 Netsplit over, joins: Reiver, @Orthia, ~Vornicus, @Namegduf, AnnoDomini
12:16
<@Tarinaky>
Vornicus: I found the whole experience stressful and incredibly distracting.
12:16
<@Tarinaky>
I much prefer rubber-ducking :/
12:17
< Syka>
i use the state of the art TAE technique
12:17
<@Tarinaky>
TAE?
12:18
< Syka>
trial and error :D
12:18
< Syka>
mostly error
12:20 Vornicus [vorn@Nightstar-sn7kve.sd.cox.net] has quit [[NS] Quit: ]
12:20
<@TheWatcher>
That's Experiment Directed Programming~
12:21
< Syka>
heee
12:21
< Syka>
i am stealing that term
12:24 * TheWatcher finishes grading \o/
12:24 * TheWatcher has to go get back to writing documentation >.<
12:27
< RichyB>
I suggest changing it to "Experiment-Driven Development" to fit the pattern with other *DD names. :)
12:38
<@Tarinaky>
It's worth noting that unittests are one of the few things that still provide value even if they're half-assed.
12:38
<@Tarinaky>
Even if you don't test the code thoroughly/add new test-cases for new bugs... some test coverage is better than none.
12:39
<@Tarinaky>
As opposed to say documentation: out of date/misleading documentation is worse than no-documentation.
12:43
<@Azash>
RichyB: Just rebrand it as optimistic agile
12:46
<@Tarinaky>
I need redbull or something.
12:46
<@Tarinaky>
*yawn*
12:48 * Syka is now an Experiment Driven Development guru rockstar evangelist
12:48
<@Azash>
You forgot serial entrepreneur
12:49
< Syka>
actually, that would be straight lying
12:49
< Syka>
since my first business is still afloat
12:49
<@Azash>
You have to keep your eyes on the future!
12:50
< Syka>
rofl
12:52
<@Tarinaky>
CEO? Business Owner?
12:52
<@Tarinaky>
Managing Director?
12:52
< Syka>
none!
12:52
< Syka>
i am self-employed
12:52
< Syka>
but what we call a sole trader in australia
12:52
< Syka>
essentially i'm like a LLC without the limited liability :D
12:52
<@Tarinaky>
Over-here I think that's just a small business with less than 20 individuals.
12:53
< Syka>
sole traders are special
12:53
< Syka>
business and personal assets are one and the same
12:53
< Syka>
business losses can offset personal income tax
12:53
< Syka>
etc
12:53
<@Tarinaky>
And creditors can fuck you up.
12:53
< Syka>
they *can*, but I don't have any creditors
12:53
<@Tarinaky>
Yet.
12:53
< Syka>
well, none that aren't cash before delivery anyway
12:54
<@Tarinaky>
Only takes one liability lawsuit to change that :p
12:54
< Syka>
insurance! :D
12:54
< Syka>
(which I have)
12:54
< Syka>
(I have like $5M public liability insurance or something)
12:55
<@Tarinaky>
If it's anything like other kinds of insurance you'll still have plenty of time before the insurance company finished foot-dragging to go bankrupt :V
12:55
<@Tarinaky>
*finishes
12:55
<@Tarinaky>
idk, ianal.
12:55
<@Tarinaky>
Just limited liability would seem to me to be a good thing.
12:56
< Syka>
Tarinaky: yeah, it would
12:56
< Syka>
but that has its own problems
12:56
< Syka>
a) you need directors (which I don't have)
12:56
< Syka>
b) it's expeeeeensive
12:56
< Syka>
c) it's not actually limited liability
12:57
< Syka>
if you fuck up badly enough, I am fairly sure they get to pierce the corporate veil
12:59
<@Tarinaky>
I doubt your insurance covers criminal liability either.
12:59
<@Tarinaky>
There isn't really any insurance against getting 'banged up'.
12:59
< Syka>
well
12:59
< Syka>
being small time ;D
12:59 * Syka is most decidedly small time
13:00
< Syka>
my biggest contract has been ~$7K total
13:00
< Syka>
and that was moostly hardware
13:04
<@Tarinaky>
I'm sure everyone thinks I am crazy for paranoidly sniffing my jumper.
13:04
<@Tarinaky>
I think my sleeves smell funny :/
13:04 * Syka gets a blacklight
13:04
< Syka>
also, unrelatedly, this is possibly my favourite XKCD of all time http://xkcd.com/1293/
13:05
<@Tarinaky>
Syka: A blacklight doesn't actually show how dirty something is though.
13:05
<@Tarinaky>
It just looks disgusting.
13:05
<@Tarinaky>
But it doesn't actually mean there's any bacteria, philes, etc... present :/
13:05
< Syka>
(the joke was slightly dirty)
13:19
<@Tarinaky>
I worry about some of the people from the cohort when I started uni...
13:19
<@Tarinaky>
"Chris Savill A lot of people forget about the original documentation once the project is done. The thing is the documentation is useless to everyone else and yourself unless you keep it up to date with changes. It seems like a chore, but you will be thankful later on and others will be to. Take pride in your documentation, as well as your code commenting and coding standards."
13:20
<@Tarinaky>
Mostly it's the last sentence I worry about.
13:22
<@Tarinaky>
"Eventually they came to the Hall of Wasted Hours, where the abbots held their morning meetings."
13:30
<@Azash>
Tarinaky: I think the joke was that blacklights show semen stains
13:30
<@Tarinaky>
Azash: I am aware.
13:37
< Syka>
haha
13:46
< Shiz>
Syka â i use the state of the art TAE technique
13:47
< Shiz>
that's what I used for figuring out which IRC extensions are relevant
13:47
< Shiz>
: D
13:47
< Syka>
heh
13:48
< Shiz>
'connect bot to irc'
13:48
< Shiz>
'does it crash'?
13:48
< Shiz>
if yes, i need to implement more
13:48
< Shiz>
if no, next server
13:48
<@Tarinaky>
I think that's Feature Driven Development.
13:55 redwire [redwire@Nightstar-27dppb.nl.bellaliant.net] has joined #code
14:18
<&ToxicFrog>
Tarinaky: why des the last sentence worry you?
14:19
<@Tarinaky>
It... It's really hard not to imagine him saying that with pointed hair.
14:29 celticminstrel [celticminst@Nightstar-gj43l1.dsl.bell.ca] has joined #code
14:29 mode/#code [+o celticminstrel] by ChanServ
14:37
<@Tarinaky>
ToxicFrog: I'm perhaps over-sensitive to these things >.<;
14:50
<&ToxicFrog>
I think he's entirely right. Good documentation is fantastic. Bad documentation is worse than useless.
14:50
<&ToxicFrog>
Writing documentation is a necessary skill to develop, and if you don't document your stuff, someone is going to hate you and want you to die.
14:50
<&ToxicFrog>
Possibly you, a year from now.
14:50
<@Tarinaky>
Oh sure.
14:50
<&ToxicFrog>
Also, heh. "It's not a memory leak. It's an unbounded cache."
14:51
<@Tarinaky>
But the 'take pride in your documentation' comes off a little...
14:51
<@Tarinaky>
Over-eager.
14:52
<@TheWatcher>
Nah, that's just 'cos you're English
14:52
< Syka>
i am literally http://xkcd.com/1296/
14:52
< Syka>
( see: https://github.com/hawkowl/haddock/commits/master )
14:52
<@Tarinaky>
TheWatcher: So's he.
14:52
<@TheWatcher>
It trips our "Importance of Not Being Earnest" alarms.
14:53
< RichyB>
Syka, that's you? :D
14:53
< Syka>
RichyB: maybe :P
14:54
< RichyB>
Cute.
14:54
< Syka>
haha
14:56
<@Tarinaky>
The problem I have with commit messages is forgetting to commit and accidentally two features in one.
14:56
<@Tarinaky>
Or forgetting to add a file.
14:56
<@Tarinaky>
Or other stuff.
14:56
< Syka>
i just give up on that until i have an actual project
14:57
< Syka>
until it's somewhere near feature complete, fuck it
14:57
<@Tarinaky>
I should add a macro to vi to remind me to commit more often :V
14:57
<@Tarinaky>
And by remind I mean, apply cluebat.
14:57
< Syka>
while true: do git add -A; git commit -m "hagauahuehhagh"; done
14:58
<@Tarinaky>
Not what I meant :/
14:58
<@TheWatcher>
And by apply cluebat you mean refuse to let you edit anything until either you've committed, or you are?
14:58
< Syka>
Tarinaky: i know, but :P
14:58
< Syka>
then you ~never need to remember to commit~
14:59
<@Tarinaky>
That's like never needing to check for a null pointer by always assigning a default object.
15:00
< Syka>
haha
15:01
<&ToxicFrog>
Tarinaky: that's what commit --amend is for!
15:01
<@Tarinaky>
ToxicFrog: Only in a timely manner though.
15:01
<&ToxicFrog>
Well
15:02
<&ToxicFrog>
If in a non-timely manner, and history cleanliness is important to you, that's why you check the relative history and rebase -i before pushing
15:07
<@Tarinaky>
I don't know what you just said.
15:09
<&ToxicFrog>
Tarinaky: so, git commit --amend lets you rewrite the last commit you made. git rebase -i lets you arbitrarily modify history.
15:09
<&ToxicFrog>
So, before you publish your changes, you look at the set of commits you're about to publish, and if they need cleaning, you rebase -i and tidy them up.
15:10
<@Tarinaky>
Oh sure.
15:10
<@Tarinaky>
I already check git status before I commit though.
15:10
<@Tarinaky>
Sometimes it doesn';t work though.
15:16
<&ToxicFrog>
TBH I highly recommend using git gui; being able to easily see the diffs and selectively stage is huge.
15:16
<&ToxicFrog>
(git add -p does the same but is a lot more cumbersome)
15:17
<@Tarinaky>
I don't really have any need to selectively stage.
15:17
<@Tarinaky>
I just want everything backed up.
15:20
<&ToxicFrog>
...but just a moment ago you were complaining about accidentally putting two features in one commit
15:21
<@Tarinaky>
Yeah, commit. I don't mind pushing them as two seperate commits at the same time.
15:21
<@Tarinaky>
I just fix bug A. Implement feature B. Fix bug C. Realise I forgot to commit between those three sentences/make seperate patches and because they probably involve editing the same file can't easily tease them out.
15:22
<@Tarinaky>
So end up making a monolithic commit.
15:22
<&ToxicFrog>
Er
15:22
<&ToxicFrog>
This is exactly what I'm talking about fixing with selective staging
15:22
<&ToxicFrog>
It is selective at line, not file, resolution
15:22
<@Tarinaky>
Oh.
15:22
<&ToxicFrog>
So you can say "this file, this file, and these lines from this file are bugfix A. Commit. This file and these other lines are feature B. Commit. Everything else is bugfix C. Commit."
15:23
<&ToxicFrog>
I do this all the time because I have a tendency to do 3-4 commits worth of stuff at once.
15:24
<@Tarinaky>
I see.
15:25
<@Tarinaky>
Truth be told though it probably isn't actually worth the effort.
15:26
<@Tarinaky>
I don't ever do any really heavy lifting with git.
15:39
<@celticminstrel>
I do the selective staging thing a lot.
15:40
<@celticminstrel>
I use a GUI program for it, usually.
15:40
<@celticminstrel>
Though git add -i is quite functional.
15:41
<@celticminstrel>
I think that's the right command.
15:41
<&ToxicFrog>
celticminstrel: -i or -p.
15:42
<&ToxicFrog>
(-p being "-i but go directly into patch mode, skipping the top level menu")
15:47
< RichyB>
IMHO super-tidy history is overrated.
15:47
< RichyB>
s/IMHO/IME/
15:48
< RichyB>
Oh, not what you're discussing.
15:48
< RichyB>
Rebasing to get rid of merge commits is, IME, a poor idea.
15:49
< RichyB>
Rebasing to get clean atomic patches is often worth it.
15:50
< simon_>
can I unproblematically resolve dangling elses through setting the precedence of 'if', 'then' and 'else' tokens, or should I always aim at using %prec or (hypothetically) rewrite the grammar?
16:04 Derakon[AFK] is now known as Derakon
16:23
<&ToxicFrog>
RichyB: yeah, it's the latter that's under discussion.
16:23
<&ToxicFrog>
If nothing else it makes bisect more useful.
16:23
< simon_>
RichyB, those two interests sound somewhat conflicting, but I could be wrong? I've never used rebase.
16:24
<&ToxicFrog>
simon_: they aren't, at all.
16:24
<&ToxicFrog>
The latter is about rewriting history so that each logical change occupies exactly one commit - you don't get commits that check in half-finished, broken features, nor commits that check in multiple features or bugfixes at once.
16:25
<&ToxicFrog>
This is mostly about squashing some runs of commits into single commits and detangling others into multiple commits.
16:25
< simon_>
ToxicFrog, ah... like "oops, forgot to add X"
16:25
<&ToxicFrog>
The former is about grafting a feature branch so that merging it into master is a fast-forward rather than a merge.
16:25
<&ToxicFrog>
Kiiind of, but that's more where amend comes in
16:26
< simon_>
right... that's where you undo one commit and then re-commit, right?
16:26
<&ToxicFrog>
This is more "oops, I want to push these changes, but it's 8 commits to implement 2 bugfixes and four of those commits don't actually build"
16:26
< simon_>
I should just RTFM and soon find use of rebase.
16:26
<&ToxicFrog>
"which means the continuous build system and future developers using bisect to find regressions will hate me"
16:26
< simon_>
ok :)
16:27
<&ToxicFrog>
So you whip out rebase -i and now you have two commits, one for each bugfix, each one complete and working.
16:27
<&ToxicFrog>
"rebase" is probably a bad choice of name here, because in general "rebase" is about moving branches around - it changes what commit a branch is "based on", hence the name.
16:28
<&ToxicFrog>
It just also happens to have a -i option that says "also, open an editor that lets me arbitrarily edit the history of this branch as it's moved"
16:28
<&ToxicFrog>
So the use cases in which you'll use "rebase" are mostly disjoint from where you'll use "rebase -i"
16:30
< RichyB>
Yeup. "git rebase -i ${COMMIT}" is more or less "interactively edit the history between now and ${COMMIT}"
16:33
< simon_>
does this cause the commits in the closed interval back to ${COMMIT} to collapse?
16:35
< simon_>
never mind.
16:35
<&ToxicFrog>
simon_: only if you want them to.
16:35
< simon_>
git's man-pages are extremely good compared to all other man-pages I've read.
16:35
< simon_>
it almost feels like... documentation!
16:35
<&ToxicFrog>
"rebase -i", as I said, opens an editor showing you the branch history. You can choose what to do on a per-commit basis. The default is "pick" i.e. apply this commit unmodified.
16:40
< RichyB>
My most common use of "rebase -i" is to take the last two commits and "squash" them into one commit.
16:46 Turaiel[Offline] is now known as Turaiel
16:56 ErikMesoy is now known as Harrower
16:57
< Syka>
i dislike squashing
16:57
< Syka>
and fast forward merging
17:25
<@Tarinaky>
RichyB: Why would you do that?
17:26
< RichyB>
If I spot a small mistake in a commit, I might commit again and then squish rather than git reset --soft HEAD^ and re-commit.
17:26
<@Tarinaky>
Ah.
17:31
<&ToxicFrog>
Easier to commit --amend than either of those, in that case.
17:34 Stalker is now known as Young_Lookshayan_woman55
17:37
< simon_>
yeah, I've used --amend in that situation.
17:38
< RichyB>
commit --amend doesn't let me add more file edits, only message changes, though?
17:39
< RichyB>
or does commit --amend add everything that's staged, too?
17:39
<&ToxicFrog>
Yes, that's kind of the point.
17:40
<&ToxicFrog>
Per the man page: "It is a rough equivalent for $ git reset --soft HEAD^ && do something to come up with the right index && git commit -c ORIG_HEAD, except that it can be used to amend a merge commit"
17:40
<&ToxicFrog>
So, stage the changes you wished were in the last commit first, then run commit --amend.
17:43
< RichyB>
Haha, I had assumed it was just for changing the value of "-m" on the last commit. :P
18:36
<@Tarinaky>
Reasons I like writing Python: self.assertTrue(len(self.room.exits) in [1,2,3])
18:38
< AnnoDomini>
I read that "assert that the room exists".
18:39
<@Tamber>
'false' ...Hm. Well, that's awkw*pop*
18:40 Turaiel is now known as Turaiel[Offline]
18:40
< Harrower>
Tamber: It has 0 or 4+ exits?
18:43
<@Tamber>
Yes.
18:54
<&ToxicFrog>
Isn't it the other way around?
18:58
< AnnoDomini>
ToxicFrog: You'd think so! But the room has 0 or 4+ exits.
19:00
<@celticminstrel>
What is this "bisect"?
19:02
<&ToxicFrog>
AnnoDomini: er. len(self.room.exits) in [1,2,3] will be true if there are 1, 2, or 3 exits.
19:03
<&ToxicFrog>
celticminstrel: 'git bisect' - binary search for the commit that introduced a behaviour.
19:03
< AnnoDomini>
ToxicFrog: But it is 'false' as Tamber stated, therefore 0 or 4+ as Harrower stated.
19:04 * Tamber idly notes that Tamber is not Tarinaky.
19:04
<@Tamber>
Because that would be confusing.
19:04
<@celticminstrel>
I don't get it...
19:04
<@celticminstrel>
The Python thing, that is.
19:06
<&ToxicFrog>
celticminstrel: in python, [v in s] is true if v is contained in the set s, or is one of the values in the list s
19:06
<&ToxicFrog>
len() is the length-of function.
19:06
<&ToxicFrog>
So that expression is true if len(self.room.exits) is any of the values 1, 2, or 3.
19:07
<@celticminstrel>
So what's Tamber and Harrower saying?
19:07
<@celticminstrel>
And AnnoDomini.
19:08
<&ToxicFrog>
Harrower thought that Tamber == Tarinaky thanks to a tab completion fail and the rest has been confusion engendered by that.
19:08
< Harrower>
No, I didn't.
19:08
<@celticminstrel>
Oh, okay.
19:08
<@celticminstrel>
That could explain why I was confused.
19:09
< Harrower>
But now the confusion is recursive so I suggest we drop the subject.
19:09 * Tamber wonders if it's tail-confuse recursion
19:10
<&McMartin>
I don't think so; trying to follow this is consuming ever more of my stack space
19:10
<@Tarinaky>
Harrower: The assertion asserts that the number of exits is 1, 2 or 3.
19:10
<@Tarinaky>
It's nice, because if I were to write this in Java I'd need an || operator.
19:11
<@celticminstrel>
I think you could use the same logic, actually.
19:11
<@celticminstrel>
Though it would look far uglier.
19:11
<&McMartin>
You could, but it would suck, because Java doesn't have a decent object literal notation.
19:12
<@celticminstrel>
Something a bit like Arrays.asList(1,2,3).contains(self.room.exits.length())
19:12
< Harrower>
IIRC Java gets it the other way around and says list.contains(doors).
19:12
<@celticminstrel>
I think length() is the wrong method name.
19:12
<@Tarinaky>
Anyway, I have just been distracted adding mappings to my vimrc.
19:12
<@Tarinaky>
Because my life doesn't have enough to bite me in the arse right now.
19:12
<@celticminstrel>
Yeah, it's list.contains(value) in Java.
19:13
<@celticminstrel>
Wasn't it Java 7 that finally introduced list/map literal notation? Or was that slated for Java 8 or something?
19:13
<@Tarinaky>
celticminstrel: I will bare that in mind next time I want to fuck with someone's head.
19:13
<@celticminstrel>
...okay?
19:13
<&McMartin>
celticminstrel: I haven't seen it in Java 7 code.
19:13
<@Tarinaky>
celticminstrel: I meant the Arrays.asList... thing.
19:13
<@Tarinaky>
By forcing them to read 'clever' code.
19:14
<@celticminstrel>
I remember at least reading a proposal for it to go into Java 7.
19:15
<&McMartin>
cm: Hmm. I thought array initializers were older than that, but that's not the same thing as being Basically JSON
19:28
<@Tarinaky>
What I really need though is a command for vim to take the token under the cursor and add an import statement for it to the top of the source file.
19:28
<@Tarinaky>
(and, obviously, return to the start point)
19:28
<@Tarinaky>
But I have no idea where to even start for that.
19:37 * ToxicFrog gives git filter-branch a cookie
19:42
<&McMartin>
The only editor I've every used that did that was Eclipse, which is even more of an anti-vim than Emacs is
19:46
<@Tarinaky>
I... actually liked using Eclipse for Python. My main complaints about it were ones of system requirements.
19:47
<@Tarinaky>
My laptop doesn't have enough RAM or Processor weight to run Eclipse and Chrome at the same time.
19:48 Kindamoody|out is now known as Kindamoody
19:49
<@Tarinaky>
I recently saw the wizard of the university cohort making lecture notes in latex using what I think was a pimped out emacs setup.
19:49
<@Tarinaky>
**magic**
19:51
<&ToxicFrog>
~* LaTeX *~
19:51
<&ToxicFrog>
I'm pretty sure you can do what you ask in vim. I have no idea how.
19:52
<@Tarinaky>
Oh I'm almost certain that someone has proven turing completeness for vim.
19:52
<&McMartin>
Well, I mean, yes
19:52
<&McMartin>
One of the things you can do is shell out, yes~
19:53
<@Tarinaky>
I meant without the shell, just manipulating vim buffers.
19:53
<@Tarinaky>
But tthinking about it, there's a perl plugin mechanism.
19:53
<@Tarinaky>
So...
19:55 Vornicus [vorn@Nightstar-sn7kve.sd.cox.net] has joined #code
19:56 mode/#code [+qo Vornicus Vornicus] by ChanServ
20:18
<@Tarinaky>
Found a script to do it!
20:18
<@Tarinaky>
http://vim.sourceforge.net/scripts/script.php?script_id=4007
20:32
< Shiz>
@Tarinaky â Reasons I like writing Python: self.assertTrue(len(self.room.exits) in [1,2,3])
20:32
< Shiz>
pleb tier
20:32
< Shiz>
self.assertTrue(len(self.room.exits) in range(1, 3))
20:32
< Shiz>
:P
20:33
< Shiz>
or 1, 4 i guess
20:33
<@celticminstrel>
Yeah, (1,4)
20:33
< AnnoDomini>
FizzBuzz fail tier.
20:33
<&McMartin>
Yeah, "1, 4" is also less clear
20:33
<&McMartin>
[1, 4)
20:33
<@celticminstrel>
You see why Tarinaky's is better. :P
20:34
<&McMartin>
(Also, no, that isn't FizzBuzz fail tier; such a person clearly knows that ranges, like, exist, and tests, and elsewhere, loops)
20:34
<@celticminstrel>
I'm having difficulty parsing your parenthetical.
20:35
< AnnoDomini>
McMartin: You're a recruiter, right?
20:35
<&McMartin>
No; I get called in to do interviews past the initial two phases of screening
20:35
< AnnoDomini>
Close enough.
20:36
< Shiz>
the part where they've proven the candidate knows what a variable is?
20:36
< Shiz>
:P
20:36
<&McMartin>
Yes
20:36
<&McMartin>
That is not actually the same as "proving the candidate has memorized the same parts of the API you have"
20:36
<@celticminstrel>
People apply without knowing what a variable is?
20:36
<&McMartin>
Of course, people selling interview prep don't like to admit that, because memorizing a bunch of shit is easy to charge for teaching
20:36
<&McMartin>
Yes.
20:36
< AnnoDomini>
I'm not quite clear about what passes or fails FizzBuzz. McMartin, is it a pass/fail or is there some gradation like "no errors"/"made stupid errors in haste"/"can't program"?
20:37
<&McMartin>
It's "is this person applying to this job simply because they have to do so to maintain eligibility for unemployment insurance"
20:37
< Shiz>
pretty sure you don't have to write a fizzbuzz that can work through server reboots, no
20:37
<&McMartin>
It's to weed out "literally has never written a program in their lives"
20:37
<&McMartin>
For anything more interesting than that you need a more interesting problem.
20:38
<&McMartin>
And we all program here, right? (Right?)
20:38
< Shiz>
plot twist: nobody here actually programs
20:38
<&McMartin>
We all know that you don't dictate programs over a telephone or write them out in indelible text and have it work the first time.
20:38
< AnnoDomini>
Shiz: Lies!
20:38
<&McMartin>
This is not how the discipline of programming works, but it is kind of how interviews work.
20:38
<@celticminstrel>
Lies indeed!
20:38
< Shiz>
McMartin: aah
20:38
< Shiz>
our algorithms exams
20:39
< Shiz>
consisted of writing java implementations on physical paper
20:39
< Shiz>
good times
20:39
<@celticminstrel>
Heh.
20:39
< Shiz>
(not really, it was terrible)
20:39
<&McMartin>
Yes, but you could also cross things out~
20:39
<@celticminstrel>
I think my exams generally asked for pseudo-code rather than Python or Java.
20:39
<&McMartin>
FizzBuzz and similar questions are generally given during a phone screen, though, which means the program is being dictated
20:39
<&McMartin>
Which is even worse
20:39
<@Tarinaky>
celticminstrel: I quite like python as pseudocode.
20:39
< Shiz>
'if x module 3 is 0'
20:39
< Shiz>
it's almost python!
20:39
< Shiz>
modulo*
20:40
<@celticminstrel>
I tend to do my pseudo-code in Python style, yes. That doesn't mean it's valid Python code though.
20:40
<@celticminstrel>
.
20:41
<@Tarinaky>
Mine tends to work out as a valid fragment at least...
20:41
<&McMartin>
Anyway, people that deal with this more directyl at the low end have written better things than me
20:41
<@Tarinaky>
But then my problems tend to be trivial and uninteresting.
20:41
<&McMartin>
http://raganwald.com/2007/01/dont-overthink-fizzbuzz.html
20:41
< Shiz>
now
20:41
< Shiz>
implement red-black trees over the phone
20:41
< Shiz>
time for some fun
20:41
<&McMartin>
Of particular note here are the two links under "UPDATE" in the second paragraph
20:41
<@celticminstrel>
Hah.
20:41
<@Tarinaky>
I don't think they do red-black tress at undergrad level any more.
20:42
<@Tarinaky>
We did AVL instead... not that I can remember them...
20:42
<&McMartin>
Shiz: The correct answer to that is "This job application said we will be working in C++. That's a std::map."
20:42
<&ToxicFrog>
McMartin: re program being dictated: augh, no
20:42
<@celticminstrel>
I think I did both red-black and AVL...
20:42
<&ToxicFrog>
The correct answer is to use a googledoc, pastebin, or similar
20:42
< Shiz>
McMartin: do I get extra points if I give you my obfuscated python oneliner over the phone :P
20:42
< Shiz>
re:fizzbuzz
20:42
<&McMartin>
ToxicFrog: That's for once you give a shit at all~
20:42
<@Tarinaky>
celticminstrel: I believe the lecturer's exact words were: "It's on this hand-out you can download off blackboard but I'm not going to memorise all that just so I can set a question on it."
20:43
<&McMartin>
We did red-black in, uh, '98
20:43
< Shiz>
I never did red-black, actually
20:43
< Shiz>
... or AVL
20:43
<@celticminstrel>
I can't remember clearly since this was a first-year course, but I think we went over both of them in some detail. I think I remember a third type of balancing too, though...
20:44 Kindamoody is now known as Kindamoody[zZz]
20:44
<@Tarinaky>
Anyway. I'm supposed to be doing stuff.
20:44
<@celticminstrel>
Me too!
20:44 * Tarinaky shuts out the distraction.
20:44
<@celticminstrel>
<_<
20:44
< Shiz>
bwug
20:44
< Shiz>
'stuff' is overrated
20:44
< Shiz>
tbh
20:45
<@Tarinaky>
I can see I'm going to have to spend my 3 weeks of revision avoiding this channel :/
20:45
<@Tarinaky>
But right now I'm still working on that L-System dungeon generator that's going at a rate of mollasses.
20:46
<&ToxicFrog>
McMartin: I don't follow.
20:47
<&ToxicFrog>
If you're doing a phone screen, it's much easier for both the candidate and the interviewer to have them type up the answer to a screening question and then send it to you rather than try to read code unambiguously over the phone.
20:47
<&McMartin>
ToxicFrog: Right, and looking into this I see that some people use it to answer the question "can you operate a compiler"
20:48
<&McMartin>
In which case, yes, you do need to do something like that.
20:49
<&ToxicFrog>
I am confused.
20:49
<@Tarinaky>
If you can get the compiler to tell you you're an idiot for forgetting a semi-colon on line 8, and misspelling iostream on line 3, you can probably work a compiler.
20:50
<&McMartin>
ToxicFrog: It's possible - again, I don't operate at this level when called in, so I can't say I do this, but I know it is done - to get someone to solve a simple problem and tell you in conversation how they would solve it with sufficient lack of ambiguity to prove that they can create programs.
20:51
<&McMartin>
It's a single question with like three sentences of answer and you do that before setting up document shares because if they're floored by that it's gonna be a waste of time
20:52
<&ToxicFrog>
Aah.
20:52
<&McMartin>
(The solution to fizbuzz is one loop with a single set of if/elseif clauses in it. Even spending ten minutes on this problem is too much, IMO~)
20:54
<@Tarinaky>
McMartin: What about the smart-alec that suggests tail recursion?
20:55
< Harrower>
There is no recursion.
20:55
< Harrower>
There is a loop.
20:55
<@celticminstrel>
I'm pretty sure you can implement any loop with tail recursion...
20:55
<@Tarinaky>
celticminstrel: That's the joke.
20:56
<&McMartin>
Tarinaky: Smart-alec answers are part of the things they have to work with.
20:56
<&McMartin>
Tarinaky: That said, the Don't Overthing Fizzbuzz link I gave covers that case exactly
20:56
<&McMartin>
Answer: "The smart alec succeeds in wasting everyone's time"
20:57
<@Tarinaky>
I missed the link but I'm prepared to accept that statement without proof.
20:57
<&McMartin>
One of the answers is funny, so: http://raganwald.com/2007/01/dont-overthink-fizzbuzz.html
20:58
<&McMartin>
The correct thing for the interviewer to do is move on and ignore it
20:58
<&McMartin>
If they know what tail-recursion is, they can organize a program.
20:58
<&McMartin>
That's *all you're testing for here*
20:59
<&McMartin>
The *real* interview is where they put you in a room with the senior engineers and they challenge you to design something.
20:59
<&McMartin>
Or to begin to attack a medium-sized problem.
21:02
<@Reiv>
I have heard of fizzbuzz tests being passed when they hand you the sheet of paper in the interview with the challenge on it, give you a whiteboard pen... and the moment you start writing "public static int main([]) { int counter;" they go "Yep, that'll do, sit back down and we'll continue"
21:04
<@Reiv>
Though apparently this actually rattled the interviewee enough that the after-interview feedback was "Yeah, uh, if it's OK with you guys /let me finish the problem it bugged me all day/"
21:04
<@Tarinaky>
McMartin: I know. I'm just messing with you,
21:05
<@Tarinaky>
McMartin: I didn't know anyone needed to write /that/ blog-post.
21:19 Harrower is now known as ErikMesoy
21:20
<&McMartin>
Tarinaky: One of the Rules seems to be "it's always worse than you think, in both directions"~
21:21
< ErikMesoy>
int main? :V
21:22 * ErikMesoy is very, very used to void main.
21:24
<&McMartin>
C/C++ use int main; the return code is the exit code of the process.
21:25
<@celticminstrel>
Java needs void main, though.
21:25
<&McMartin>
yup
21:32
<@Tarinaky>
Although most C/C++ compilers will accept void.
21:33
<@Tarinaky>
So you'll see it quite a lot in other people's code - particularly older Windows code where void /used/ to be preferred.
21:34
< AnnoDomini>
Hmmm. C++. Can I do something like "function({1,2})" where the argument is a two-int struct?
21:34
<@celticminstrel>
Sometimes.
21:34
<@Tarinaky>
std::pair<int,int>
21:34
<@celticminstrel>
I think it's valid in C++11 actually.
21:34 Vornicus [vorn@Nightstar-sn7kve.sd.cox.net] has quit [[NS] Quit: Leaving]
21:34
<@celticminstrel>
Provided there's only one overload of function that takes a two-int struct as an argument.
21:35
<@celticminstrel>
Also, C/C++ doesn't consider the function return type to be part of the signature, unlike Java.
21:35
<@Tarinaky>
Or "struct TwoInts { int x,y; } a = {1,3};"
21:37
<@Tarinaky>
The 'dumb' (and therefor superior until proven otherwise) solution is to define a struct with two components and have that as the type the function expects...
21:38
<@celticminstrel>
Um, I think that was already the situation, Tarinaky...
21:39
<@celticminstrel>
But maybe I misunderstood. AnnoDomini?
21:39
<@Tarinaky>
I think Anno wants something like the python-ism 'def function((x,y)):'
21:39
< AnnoDomini>
I just wanted to know if I can shorthand the initialization of the argument.
21:40
<@celticminstrel>
My impression was that he already had a function that takes a two-int struct and he wanted to know if that syntax was a valid way to call it.
21:40
<@celticminstrel>
Which in C++11 I'm fairly sure it is.
21:40
<@Tarinaky>
You can assign the components of a struct by shorthand /provided/ the components are of the same type iirc.
21:40
<@Tarinaky>
I think that only applies to assignment. I am not sure on the C++11 situation.
21:41
<@Tarinaky>
I would suggest giving your compiler a test-case and reporting the results.
21:43
< AnnoDomini>
Later. I've gotten an idea on how to implement a really inefficient but possibly implementable way to do pathfinding.
21:44
<@Tarinaky>
Is it bogon pathfinding?
21:44
< AnnoDomini>
It will take a bajillion cycles to find an answer. But hopefully it will be capable of finding it.
21:45
< ErikMesoy>
Reverse-pathfinding from character?
21:45
<@Tarinaky>
I think you're just suggesting a random walk.
21:46
<@Reiv>
Fuck, I dunno, I haven't written Java in ~6 years
21:46
<@Tarinaky>
Which would only be guarenteed to find an answer if you had hardware entropy/true randomness.
21:46
<@Reiv>
This is part of my problem of "I no longer know how to program", so thankfully it was not me in that particular question~
21:46
<@celticminstrel>
Huh?
21:47
<@Tarinaky>
But with the obvious advantage that your pathfinding algorithm would, as a side-effect, generate Hamlet in Dutch.
21:47
<@Reiv>
celticminstrel: Everyone pounced on the fact I used int main for a purportedly java code snippet :p
21:47
<@celticminstrel>
Oh.
21:48
<@Reiv>
(I was making it up as I go along, to fill an anecdote.)
21:48
<@celticminstrel>
I had already forgotten that you were the one who said it.
21:48
<@Reiv>
Ya
21:52 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
21:53
<@Tarinaky>
... `I have just been made aware of the "ALTER X TO PROCEED TO Y" statement in old-school COBOL. Following this, any GOTO X statement will now GOTO Y instead.'
21:53
<@Tarinaky>
o.o
21:53
<@Tamber>
Fun! :D
21:54
<@Tarinaky>
I think I'd rather wrestle 12 Zombie Badgermen while on fire.
21:54
<@celticminstrel>
...
21:54
< ErikMesoy>
Tarinaky: But which do you prefer of COMEFROM and wrestling 24 Zombie Badgermen while on fire?
21:55
<@Tarinaky>
Comefrom... unfortunately...
21:55
<@celticminstrel>
What's COMEFROM do?
21:55
<@Tarinaky>
iirc the same as goto/jump.
21:55 Young_Lookshayan_woman55 is now known as Stalker
21:55
<@Tarinaky>
The difference I leave to the imagination.
21:57
< AnnoDomini>
COMEFROM is just an invisible GOTO.
21:57
< ErikMesoy>
celticminstrel: Same as GOTO, except located at the other end.
21:57
< ErikMesoy>
30 GOTO 200 is identical with 200 COMEFROM 30.
21:57
<@celticminstrel>
Why would you ever do that.
21:58
< ErikMesoy>
Good question.
21:59
<@gnolam>
https://en.wikipedia.org/wiki/COMEFROM
21:59
<@gnolam>
(Which in ALLCAPS sounds a bit like an obscure Cold War-era communist organization)
22:00
<@Tamber>
Really, the only reason to use COMEFROM would be to screw with people's heads. :p
22:00
<&McMartin>
Well
22:01
<&McMartin>
I would direct you to AspectJ or, indeed, aspect-oriented software development in general
22:02 Stalker [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
22:02
<@Tarinaky>
Tamber: The wikipage lists debuggers as a useful implementation.
22:02
<@Tarinaky>
Specifically debugger break points.
22:03
<@Tamber>
Pah
22:05
< ErikMesoy>
Come From is a great way of screwing with people's expectations when they think the program will transition smoothly from line 30 to line 31, but somewhere far away is a "Come from 30" instruction. Never use Come From in code that anyone else will have to maintain.
22:05
< ErikMesoy>
If you do, they may just hunt you down and beat you with a stick for creating utterly unpredictable code where every single other part of the code must first be checked for Come From statements to verify that any one part of the code progresses normally.
22:06
< ErikMesoy>
Alternatively: Do use Come From in code that other people will have to maintain. It gives them job security. :D
22:07
<&McMartin>
"Around advice" (which is basically come from) is also useful for centralizing logging code.
22:07
<&McMartin>
Ladies and Gentlemen, Java: http://discuss.joelonsoftware.com/default.asp?joel.3.219431.12
22:07
<&ToxicFrog>
"around advice"?
22:08
<@Tarinaky>
Aspect-oriented-programming.
22:08 Vornicus [Vorn@Nightstar-28h42k.sd.cox.net] has joined #code
22:08 mode/#code [+qo Vornicus Vornicus] by ChanServ
22:09
< ErikMesoy>
mmm, FactoryFactory
22:09
<&McMartin>
Before, around, and after. Intercepts all method calls matching the pattern and runs this code before, instead of, or after the method itself.
22:09
< ErikMesoy>
But is it really fair to blame Java for that?
22:09
<&McMartin>
Only sort of.
22:09
<&McMartin>
Making it recursive it is OK to blame the Java community.
22:10
<&McMartin>
The problem factories solve - that is, that constructors cannot be made virtual - is basically universal in any OO language that doesn't have duck typing, and factories (possibly by a different name) are how you solve this.
22:10
<&McMartin>
The, uh, pythonic solution to this that does not involve duck typing is kind of horrible and you shouldn't do that either
22:11
<&McMartin>
(It involves reassiging the class of self in the constructor depending on its arguments)
22:13
< ErikMesoy>
>_<
22:14
< ErikMesoy>
"Well then don't do that then" ?
22:14
<@celticminstrel>
Why can't constructors be made virtual?
22:15
<@Tarinaky>
Because the concept of an Object() that can;'t be initialised is wholly alien to Python.
22:15
<@Tarinaky>
Oh wait.
22:15
<@Tarinaky>
Misread.
22:15
<&McMartin>
celticminstrel: They never are
22:15
<@Tarinaky>
Aren't all Python __init__s virtual by default?
22:15
<&McMartin>
No
22:15
<&McMartin>
When you say A(), you're getting an A back
22:16
< ErikMesoy>
I suspect there may also be some trouble where a constructor has to exist, but a virtual method doesn't have to exist "yet" before you get to some specific instance
22:16
<@celticminstrel>
I don't see how that answers the question...
22:17
<&McMartin>
celticminstrel: Basically every language that has a new operator or equivalent, if you say new Whatever(), you get exactly a Whatever.
22:17
<&McMartin>
Factories loosen that restriction to "you get something castable to a Whatever".
22:18
<@celticminstrel>
Is this restriction needed for a new operator?
22:18
< ErikMesoy>
ehh, crashing.
22:18 ErikMesoy is now known as ErikMesoy|sleep
22:19
<&McMartin>
celticminstrel: "sort of"
22:19
<&McMartin>
I literally know of no exceptions to it.
22:19
<@Namegduf>
The thing you can do with a factory is that multiple returning different things castable to Whatever, or the same thing with different initial state
22:19
<@Namegduf>
*have multiple
22:20
<@Namegduf>
And pass it into some other stuff which calls the factor to generate Whatevers on demand with it.
22:20
<@Namegduf>
It's hard to see how you could pass around "different versions" of a new operator in a more effective manner.
22:22
<@celticminstrel>
Doesn't Python let you override the new operator?
22:22
<@celticminstrel>
(C++ does too, but that doesn't count because it only handles memory allocation, not construction.)
22:26
<@Namegduf>
That doesn't do this.
22:26
<@Namegduf>
You write a function. It calls "new Whatever()". When it calls that, it always invokes the same thing.
22:26
<@Namegduf>
You write a function, taking a WhateverFactory as a parameter.
22:27
<@Namegduf>
It calls whateverFactory.new(). Where and how its Whatever is created is now controllable by the calling code.
22:27
<@Namegduf>
Well, not where but what exactly the Whatever is.
22:27
<@celticminstrel>
In Python you can write a class function (__new__, I think) which is called before __init__.
22:27
<@Namegduf>
Continue?
22:29
<@celticminstrel>
It's a static method which takes the arguments passed to the constructor and returns a new object instance.
22:29
<@Namegduf>
SOunds like you might be able to pass it around as a factory function, then.
22:29
<@celticminstrel>
http://docs.python.org/2/reference/datamodel.html#object.__new__
22:29
<@Namegduf>
Assuming you can call it directly.
22:30
<@celticminstrel>
When you write MyClass(a,b,c), it's called automatically.
22:30
<@Namegduf>
Okay, so how does this allow code calling a function to specify what subclass of Whatever is instantiated when that function wants to get a new one?
22:31
<~Vornicus>
you can name the class, and add that's class's dict or something.
22:31
<@celticminstrel>
Based on the arguments?
22:31
<@Namegduf>
celticminstrel: Without having it preprogrammed in as a special case...
22:33
<@celticminstrel>
Not sure, then. I think all the times I've used static factories was in situations where I knew all the possible subclasses.
22:33
<@Namegduf>
It's just the same as any other use of a first class function.
22:33
<@Namegduf>
Or, well, any use of passing a function as a parameter.
22:34
<@Namegduf>
Yes, if you can preprogram everything it might need to call you could just pass an int and switch on it or something.
22:34
<@Namegduf>
But 1) Ew. 2) You sometimes can't.
22:35
<@celticminstrel>
I dunno. Pass in a string, look it up in a dictionary of known subclasses?
22:36
<@Namegduf>
Yes, you can do the same thing to avoid needing first class functions sometimes.
22:36
<@Namegduf>
The "ew" holds.
22:37
<@Namegduf>
It's also not just about subclasses, it can be about the parameters the thing is created with.
22:37
<@Namegduf>
You could for example have code taking a ConnectionFactory which had a method for getting a new connection, and an implementation which you instantiated passing authentication information and connection information, and then passed to that code.
22:38
<@celticminstrel>
Passing around a WhateverFactory seems kinda odd to me, actually...
22:40
<@Namegduf>
It's just an object which gives you another object of a certain type on request.
22:43
<@Namegduf>
It lets you write algorithms reasoning over such without concern for the operational details of where a Whatever or where a Connection comes from or what information is needed to make one.
22:43
<@Namegduf>
I'm no fan of pattern overuse, but it has its uses.
22:47
<~Vornicus>
y'know, I used to hate that some languages had a separate operator for string concatenation. Now I miss it.
22:57
< AnnoDomini>
This pathing sometimes works and at other times doesn't.
23:09
< AnnoDomini>
Hmm. Whether the zombies can path or not seems determined largely on where they are in relation to me.
23:32 You're now known as TheWatcher[T-2]
23:34 * RichyB snickers
23:34
< RichyB>
"Hammock Driven Development"
23:34
< RichyB>
turns out that this is Rich Hickey's name for his style of development
23:35
<~Vornicus>
optimizing for developer time, i see
23:35
< RichyB>
optimising for snoozing on a hammock while thinking hard
23:36 Derakon is now known as Derakon[AF]
23:36 Derakon[AF] is now known as Derakon[AFK]
23:39 You're now known as TheWatcher[zZzZ]
23:45
<@Tarinaky>
RichyB: Sounds like a manifesto I can get behind :V
23:46
<&McMartin>
14:29 <@Namegduf> Yes, if you can preprogram everything it might need to call you could just pass an int and switch on it or something.
23:46
<&McMartin>
14:30 <@Namegduf> But 1) Ew. 2) You sometimes can't.
23:46
<&McMartin>
14:31 <@celticminstrel> I dunno. Pass in a string, look it up in a dictionary of known subclasses?
23:47
<&McMartin>
This is the 'morphing' technique I was saying was the pythonic way that was terrible and that you shouldn't do
23:48
<&McMartin>
And even *then* the regress has to end somewhere, and since a simple constructor method is like three lines of code it is not a huge stretch to do "the allocator is the thing that sets the type" just like everyone else
23:48
< RichyB>
oh gods this is excellent
23:48
< RichyB>
http://bodil.org/coffeescript/#the-secret-slide
23:49
< RichyB>
^- succinct explanation of why JavaScript sucks more than Lisp, C, C++, Java and Python.
23:49
< RichyB>
Bottom-right photo is Brendan Eich, the person who originally designed JS.
23:49
<@celticminstrel>
I get nothing.
23:50
<@celticminstrel>
ie, it's not loading for me.
23:50
<&McMartin>
He is the only man on the list without a beard
23:50
<&McMartin>
Also, argh
23:51
<@celticminstrel>
Why do people code sites that don't function when cookies are disabled?
23:51
<&McMartin>
Why do people get so bent out of shape about typeof(NaN) == number?
23:51
<&McMartin>
NaN is part of IEEE 754
23:51
<~Vornicus>
Yeah that I don't get.
23:51
<@celticminstrel>
More specifically, sites that don't need cookies that don't function when cookies are disabled.
23:51
< RichyB>
McMartin, because it is "not" a number! But seriously, let's chalk that one up as an amusing mistake on the part of the author.
23:52
<@celticminstrel>
Anyway, I don't think JavaScript is all that bad.
23:52
<&McMartin>
RichyB: It's not just the author
23:52
<&McMartin>
This is a consistent rant from people who should really know better.
23:52
<&McMartin>
Crockford calls it out as one of the irredeemably terrible bits of JavaScript
23:53
<@celticminstrel>
On an unrelated note, is there some way to prevent Firefox tabs from stealing focus when a script in them produces an alert/confirm box?
23:53
<&McMartin>
Though to be fair he also calls out "+ will also concatenate strings" as one too, which is kind of entertaining tunnel vision
23:54
<~Vornicus>
Like I mentioned earlier, having recently worked in a language with an explicit string concatenation operator I kind of wish more languages did it that wayt
23:54
< AnnoDomini>
pastie.org/8543400 <- It paths! Has some issues (creatures in the way) and the path is not exactly a straight one, but it paths.
23:54
<&McMartin>
Vornicus: Well, the actual reason this is terrible is because JS has hilarious ideas of legal coercions
23:55
<~Vornicus>
yeah, that's no fun
23:56
<&McMartin>
Saying that the flaw here is that + is overloaded is rather dramatically missing the point
23:58
< RichyB>
no, really
23:58
< RichyB>
the flaw here is that Brendan Eich attempted to design a programming language without growing fa⦠er, never mind.
23:58 * Vornicus patpats richyb
23:59
< RichyB>
It is definitely the coercions thing.
23:59
<~Vornicus>
Even Matz tried, and he's japanese.
23:59
<&McMartin>
Java's designer has facial hair, C#'s does not.
23:59
<&McMartin>
Myth busted~
--- Log closed Wed Dec 11 00:00:00 2013
code logs -> 2013 -> Tue, 10 Dec 2013< code.20131209.log - code.20131211.log >

[ Latest log file ]