code logs -> 2012 -> Tue, 01 May 2012< code.20120430.log - code.20120502.log >
--- Log opened Tue May 01 00:00:38 2012
00:33 Derakon[AFK] is now known as Derakon
00:53 You're now known as TheWatcher[T-2]
00:57 You're now known as TheWatcher[zZzZ]
01:22 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Z?]
01:58 Noah [maoranma@Nightstar-93e1b6e0.pools.spcsdns.net] has quit [[NS] Quit: ]
02:04 Attilla [Obsolete@Nightstar-4d709978.as43234.net] has quit [Ping timeout: 121 seconds]
03:57 Noah [maoranma@Nightstar-93e1b6e0.pools.spcsdns.net] has joined #code
04:42
< Noah>
Hmm, that was clever
04:43
< Noah>
Instead of storing the cards of a deck I've popped off, I instead have a method that makes two sets, one with a full normal deck of cards, and one with the current classes card list, then return the diff to know what's missing
04:44
< celticminstrel>
Huh?
04:45
< Noah>
def missing(self):
04:45
< Noah>
return list(set([rank + suit for suit in "cdhs" for rank in "A23456789TJQK"])
04:45
< Noah>
- set(self.deck))
04:46
< celticminstrel>
That'll return any cards not in self.deck...
04:49
< Noah>
Right
04:53 celticminstrel is now known as celmin|zZz
04:55 celmin|zZz [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
05:03
< Noah>
Help me out here, what's a good naming convention for methods in a class
05:03
< Noah>
I know isSomething or hasSomething are good for things that return true or false
05:04
< Noah>
I'm thinking doSomething for things that do stuff without returning anything
05:05
< Noah>
I'm getting getSomething for things that return lists and stuff?
05:05
< Noah>
guessing(
05:10
< Noah>
But it does break down when I have something that both does something and returns a value
05:17
<&Derakon>
Generally speaking, my functions that exist solely to check the instance's state are "getFoo", so e.g. "getIsPrime", "getMembers", etc.
05:18
<&Derakon>
Functions that return stuff while also doing stuff should indicate that if possible, so e.g. "generateCollisions", "makeMergedEffect".
05:18
<&Derakon>
Straight-up mutator functions can then use the remaining verbs.
05:52 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has quit [Client exited]
06:18
<~Vornicus>
How to tell your server overloads poorly
06:18
<~Vornicus>
You get linked on fark, and when i click that link I get an "install drupal!" page.
06:18
<~Vornicus>
I wasn't aware it was possible to configure a server so that happens.
06:18
< Noah>
lol
06:18
< Noah>
Maybe someone found a hole and broke it
06:24 Derakon is now known as Derakon[AFK]
06:30
< Noah>
Post-modern Exceptionally Rickety Language
07:07 ErikMesoy|sleep is now known as ErikMesoy
07:22 Netsplit *.net <-> *.split quits: ErikMesoy, ShellNinja, McMartin, @rms, Reiver|AFK, jerith
07:23 Netsplit over, joins: &jerith, &McMartin, Reiver|AFK, ErikMesoy, @rms, ShellNinja
07:36 himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds]
07:39 Netsplit *.net <-> *.split quits: @McMartin, ShellNinja, ErikMesoy, Reiver|AFK, @jerith, @rms
07:40 Netsplit over, joins: &jerith, &McMartin, Reiver|AFK, ErikMesoy, @rms, ShellNinja
07:46 * McMartin finishes reading the OpenGL "New Testament"
07:46
<&McMartin>
That was fairly brief, actually.
07:47
<&McMartin>
There are very few places I could meaningfully plug that into Sable.
07:47
<&McMartin>
Replacing the old-style fog and texture/height color mapping, I guess, and making specular reflections be done as a fragment shader instead of as vertex lighting.
07:47 * Noah head-bobbles cluelessly
07:48 eckse [eckse@Nightstar-1c1741ed.dsl.sentex.ca] has quit [Client closed the connection]
07:49
<&McMartin>
"My old OpenGL game doesn't have a lot of room for improvement by shifting to programmable, modern graphics hardware over the old-school stuff, because it was designed to hew very closely to the old-school hardware limitations. I'd just be carefully simulating those."
07:49
< Noah>
I head
07:49
< Noah>
Ahem
07:49
<&McMartin>
"But I could make everything look a little more like plastic toys, and a couple of the hacks I did would no longer be necessary."
07:49
< Noah>
I heard
07:49
< Noah>
"Something something game something"
07:50
<&McMartin>
Not much good would come from rewriting the graphics engine for my game.
07:51
< Noah>
Demix it
07:51
< Noah>
Go from opengl to 8bit tiles
07:51
<&McMartin>
Heh
07:51
<&McMartin>
Not really plausible, though it would have been in days of yore.
07:52
< Noah>
I think about 90% of modern games would be better this way
07:52
<&McMartin>
That was the original plan
07:52
<&McMartin>
However, Sable - despite being named as a weak pun on "Gradius" - is way closer to After Burner
07:52
<&McMartin>
And let's be honest here, Space Harrier and After Burner itself both prove that trying to 8-bit trench-run gameplay is a bad idea.
07:52
< Noah>
Space Harrier
07:52
< Noah>
I used to have the Sega 32X version
07:53
<&McMartin>
Yeah, so
07:53
<&McMartin>
The Sega Master System version?
07:53
<&McMartin>
Not So Much (tm)
07:53
< Noah>
It was kind of lame, I mostly played Doom 32X instead
07:53
<&McMartin>
Heh
07:53
<&McMartin>
That said
07:53
<&McMartin>
Those kids appear to be mowing the lawn, so I guess I shouldn't shake my cane at them so much
07:53
<&McMartin>
A lot of the stuff that I focused on back in the day turns out to still be relevant
07:54
< Noah>
Heh
07:54
<&McMartin>
(And gets handed to the Vertex Shader as gl_ModelViewProjectionMatrix)
08:01 Attilla [Obsolete@Nightstar-4d709978.as43234.net] has joined #code
08:03 Eri [Eri@Nightstar-3e5deec3.gv.shawcable.net] has joined #code
08:05 Attilla [Obsolete@Nightstar-4d709978.as43234.net] has quit [Ping timeout: 121 seconds]
08:49 Netsplit *.net <-> *.split quits: @McMartin, ShellNinja, ErikMesoy, Eri, Reiver|AFK, @jerith, @rms
08:50 Netsplit over, joins: &jerith, &McMartin, Reiver|AFK, ErikMesoy, @rms, ShellNinja, Eri
09:13 Attilla [Obsolete@Nightstar-4d709978.as43234.net] has joined #code
09:31 You're now known as TheWatcher
11:32 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
11:32 mode/#code [+o himi] by ChanServ
13:22
<@ToxicFrog>
McMartin: oh, god. Sabre, right?
13:33 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code
13:35 * Tamber wonders what the difference is between "x86_64" and "x86. with CONFIG_64BIT"
13:35
<@Tamber>
Aside from a few more letters~
13:37
<@Tamber>
(Presumably x86 with CONFIG_64BIT is a 64-bit kernel, expecting the rest of the system to be 32-bit.)
14:01
<@ToxicFrog>
No.
14:01
<@ToxicFrog>
x86_64 as a kernel config option is deprecated; it (and all other 64bit options like sparc64) have been merged into a common CONFIG_64BIT flag
14:02
<@ToxicFrog>
This means that the same option will toggle 64-bit support regardless of what architecture you are building for.
14:02
<@Tamber>
Well, that makes things a lot clearer.
14:04 * Tamber now feels rather silly.
15:31 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has joined #code
15:44 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
15:58 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
16:00 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
16:00 mode/#code [+o ToxicFrog] by ChanServ
16:50 Noah [maoranma@Nightstar-93e1b6e0.pools.spcsdns.net] has quit [Client closed the connection]
16:50 Noah [maoranma@Nightstar-93e1b6e0.pools.spcsdns.net] has joined #code
16:57 ErikMesoy is now known as Harrower
17:23 Attilla [Obsolete@Nightstar-4d709978.as43234.net] has quit [[NS] Quit: ]
17:25 Attilla [Obsolete@Nightstar-4d709978.as43234.net] has joined #code
17:26 eckse [eckse@Nightstar-1c1741ed.dsl.sentex.ca] has joined #code
17:26 mode/#code [+o eckse] by ChanServ
17:50 Attilla [Obsolete@Nightstar-4d709978.as43234.net] has quit [Ping timeout: 121 seconds]
18:01 Attilla [Obsolete@Nightstar-5589485e.as43234.net] has joined #code
19:01
< Noah>
Hmm, so, I'm thinking I should implement a players hand as an object
19:02
< Noah>
And the player too, obviously
19:02
< Noah>
s/object/class
19:02
< Noah>
Everything is an object
19:07
<&jerith>
Noah: What is it you're building?
19:08
< Noah>
Ultimately, an IRC bot that does Texas Hold'em
19:08
<&jerith>
Then you probably want something like a CardSet that represent a deck or a hand.
19:08
< Noah>
I have a deck class
19:09
<&jerith>
There are a few different ways to structure this.
19:09
< Noah>
And I can draw X cards off of it and count them as missing form the deck
19:09
< Noah>
Oh, there are tons of ways to structure everything
19:09
< Noah>
I'm trying to think more object oriented though
19:09
<&jerith>
Yes, but there are a few different /sane/ ways to do this one. ;-)
19:09
< Noah>
Yes, sane, that does narrow it down a bit
19:10
<&jerith>
One way is to have separate Deck and Hand classes, and move cards between the two.
19:10
< Noah>
that was my idea
19:10
<&jerith>
Another way is to have a single CardSet class that can represent either a hand or a dekc.
19:10
<&jerith>
*deck
19:10
< Noah>
Classes and ... contain?... other classes, right?
19:11
< Noah>
can*
19:11
<&jerith>
Another way is to have Deck class that always holds all the cards, but tracks where they are.
19:11
< Noah>
That sounds less sane
19:11
<&jerith>
Depends what you mean by "contain".
19:11
< Noah>
Say I do a hand class
19:11
<&jerith>
It has useful properties.
19:11
< Noah>
Players could have hands
19:12
<&jerith>
For example, you're guaranteed never to have duplicate or missing cards, because moving a card from the deck to a hand means changing its location attribute instead of removing it from one thing and putting it in another.
19:13
<&jerith>
An instance of an object is just a value.
19:13
<&jerith>
Err, what language is this?
19:13
< Noah>
Yea, that makes since
19:13
< Noah>
Python
19:13
<&jerith>
Ah, cool.
19:14
<&jerith>
So you can have a PlayerHand class that is given a Deck instance when it's constructed.
19:14
<&jerith>
Then hand.draw(5) could take the top 5 cards off the deck and hold onto them.
19:15
< Noah>
True, but keeping the deck the same for each player?
19:15
< Noah>
Each player having their own deck makes since for say, Magic or some other CCG
19:15
<&jerith>
Do you have your code on the webnets anywhere?
19:15
< Noah>
Webnets? No?
19:16
< Noah>
Lemme get a paste bin up
19:16
<&jerith>
Something like deck = Deck(); hand1 = PlayerHand(deck); hand2 = PlayerHand(deck)
19:16
<&jerith>
That way both hands share the same deck.
19:17
< Noah>
Hmm, true
19:17
<&jerith>
But it would probably make more sense to have the deck separate and say hand.draw(deck, 5) or hand.add(deck.draw(5)) or something.
19:19
< Noah>
Yea, I was thinking the latter
19:19
<&jerith>
Now, since this is Python, you /could/ just make each hand a set().
19:20
< Noah>
http://pastebin.starforge.co.uk/516
19:20
<&jerith>
But you probably want a class that has scoring methods on it.
19:20
< Noah>
Yea
19:21
<&jerith>
Which is a good reason not to use the single PileOfCards class for both.
19:21
<&jerith>
(Although is there's enough duplicate functionality, you might want a common base class.)
19:22
< Noah>
I figured it would be a method of the gameplay class say, gameplay.checkWinningHand(listofplayersandtheirhandsinasaneway)
19:23
<&jerith>
What revision control system are you using?
19:23
< Noah>
Uh...my brain
19:23
< Noah>
I really should upgrade to something better
19:23
<@ToxicFrog>
:gonk:
19:24
<@ToxicFrog>
Go. Now. Install mercurial or git.
19:24
< Noah>
Anything that I should consider, using PyDev?
19:25
<&jerith>
I don't know PyDev.
19:25
< Noah>
I heard that in Lilu's voice from 5th Element
19:27
< Rhamphoryncus>
argh. I know there's at least vertex arrays, display lists, and VBOs, as well as ARB and non-ARB functions, and that at least some of VBO is depreciated
19:27
<&jerith>
Oh, it's an Eclipse thing.
19:27 * jerith dislikes Eclipse.
19:28
< Rhamphoryncus>
I have no idea what I should be using. Some indication that vertex arrays and display lists are old/depreciated/discouraged too..
19:28
<&jerith>
Anyways, I'd go with git or hg. The Eclipse bzr plugin makes me sad.
19:28
<&jerith>
But get one and install it now.
19:29
< Noah>
On it
19:29
< Noah>
Well
19:29
< Noah>
I would be
19:29
< Noah>
But hg or git...
19:29
< Noah>
Why is there never an obvious choice T_T
19:29
<&jerith>
Once that's done, I'll show you how you should structure your project into lib, script and test bits. :-P
19:29
<&jerith>
If you use git, you can use github and make it easier for me to look at your code.
19:30
< Noah>
that's obvious enough for me
19:30
<&jerith>
(If you use hg, you can use bitbucket and make it slightly less easier for me to look at your code.)
19:30
<&McMartin>
That reminds me
19:30
<&McMartin>
Now is not a good time
19:30
< Noah>
Shh, you're complicating it
19:31
<&McMartin>
But jerith, I want to pick your brain later re: the current state of what used to be distutils (and may still be).
19:31
<&jerith>
McMartin: The quick answer is "horrible".
19:31
<@ToxicFrog>
Noah: it looks like you're on windows, so you may prefer hg, which has better windows integration
19:31
<&jerith>
The long answer is that you can do a bunch of nifty things, but you sometimes have to be careful.
19:32
< Noah>
Uhg
19:32
< Noah>
Damnit you two, git or hg!?
19:32
<&jerith>
Oh, Windows.
19:33
< Noah>
This is why I've never picked one yet, lol
19:34
<&jerith>
http://help.github.com/win-set-up-git/
19:34
<&jerith>
No idea how useful that is.
19:35
<&jerith>
But if you live in Eclipse, all you really care about is Eclipse integration and the existence of a functioning implementation.
19:35
< Noah>
I don't
19:35
<@ToxicFrog>
Noah: like I said, if you're on windows, you probably want hg, unless you have a pre-existing preference for github or bitbucket as a hosting site
19:36
< Noah>
The hell
19:36
<@ToxicFrog>
Since hg has an actual windows port, whereas git has a windows build of the linux tools (which is to say it is heavily command line driven)
19:36
< Noah>
hg downloaded the 64bit version
19:37
< Noah>
I'm not too bothered by command line
19:38
<&jerith>
Good point. hg it is.
19:38
< Noah>
Okay, so we've come to a concensus? Hg is it?
19:38
<&jerith>
Yes.
19:39
< Noah>
because if I download this, and McMartin says some shit about git, all of you are flamable
19:39
<&jerith>
McMartin: Say some shit about git. :-P
19:39
<@ToxicFrog>
(I am a hardcore git user, but I also do all of my development on linux, and my attempts to teach my advisor how to use it on windows have been fraught with suffering)
19:39
<&jerith>
Noah: It really doesn't matter all that much in the grand scheme of things.
19:39
<&McMartin>
Yeah, that
19:39
<@ToxicFrog>
(granted this is about 50/50 "git behaving oddly on windows" vs "he is damaged from years of svn"~)
19:39
<&McMartin>
git on Windows still involves installing MSYS and opening a Bash shell.
19:40
<&jerith>
I like git mostly because (a) it's what I'm more familiar with and (b) github.
19:40
<@ToxicFrog>
And yeah, if it really becomes an issue at some point I'm pretty sure git and hg can import/export from each other anyways, so
19:41
<&jerith>
I have some specific reasons to dislike hg, but there are at least as many comparable (but different) quirks in git that I don't dislike as much simply because I'm used to them.
19:41
< celticminstrel>
Is bitbucket not as good as github, then?
19:41
<&jerith>
celticminstrel: I don't think so.
19:41
<@ToxicFrog>
McMartin: in its defence, this worked flawlessly for me, also, command line supremacy
19:41
<&jerith>
But then I don't really use bitbucket much.
19:41
< celticminstrel>
Though, there are other hosting options for hg.
19:41
<@ToxicFrog>
On the flip side it didn't work for my advisor (none of the context menu entries are showing up) and neither of can figure out why >.<
19:42
<@ToxicFrog>
(on the gripping hand he is running a decade-old OS so who the fuck knows)
19:42
<&McMartin>
TF: I have MSYS installed three times on my system, and I think they're all different versions, it's beginning to make me wish they wouldn't be so allergic to just linking against Win32 =P
19:42
< celticminstrel>
Which OS is that?
19:42
<@ToxicFrog>
XP.
19:42
< Noah>
*headdesks* I just used ls in windows command prompt
19:42
< celticminstrel>
I have an XP too.
19:42
<@ToxicFrog>
McMartin: er, msys tools do link against the win32 libraries
19:43
<&McMartin>
git is the only one with an excuse here, being written in Shell
19:43
<@ToxicFrog>
The reason git4win uses it is that git is heavily dependent on bash and perl and a decent terminal emulator, and MSYS is the most convenient way to get all three at once on windows.
19:43
< Noah>
Okay, hg installed, teach me oh sensei
19:43 * jerith receives a failing test from his boss, begins to do the big chunk of work required to make it pass.
19:44
<@ToxicFrog>
epsilon holy shit, do not test gravity with glass tableware, demon cat
19:44
<&jerith>
Noah: Install whatever Eclipse hg magic you want.
19:44
<@ToxicFrog>
...he's using Eclipse?
19:44
<&jerith>
ToxicFrog: This is the one who has been installing updates and deleting your desktop, right?
19:44
<&jerith>
ToxicFrog: PyDev, which is Eclipse.
19:44
<@ToxicFrog>
jerith: actually no, that was Suzie
19:45
<@ToxicFrog>
Epsilon is less about lying on the keyboard and more about chewing on the monitor.
19:45
< Noah>
yes, PyDev
19:45
<&jerith>
I decided against introducing him to Emacs at this point. :-P
19:45
< Noah>
I've met Emacs, I found him rather obtuse
19:45 Harrower is now known as ErikMesoy
19:45
<@ToxicFrog>
Neither emacs nor vi has ever clicked for me.
19:45
< Noah>
I like vim though, but setting up vim crap in windows is some kind of nightmare
19:46
<&jerith>
Noah: I never found it to be so, but then it's been about a decade since I last tried.
19:46
< Noah>
Anyway, PyDev is up and running and it seems to work well enough
19:47
< Noah>
So, apparently, I'm doing something with Eclipse for hg
19:47
<@ToxicFrog>
Emacs kind of strikes me as the Elder Scrolls of editors, which is to say, it's terrible out of the box but becomes excellent after weeks of modding and fine-tuning
19:47
<&jerith>
Do you have a suitable hg plugin?
19:47
< Noah>
Not yet
19:47
< Noah>
http://javaforge.com/project/HGE
19:47
< Noah>
I'm seeing this
19:47
<&jerith>
ToxicFrog: Emacs is less an editor than a toolkit with which to build an editor.
19:47
<@ToxicFrog>
Honestly I'd just use the hg interface outside of Eclipse; I've never used an IDE-integrated versioning system that I liked
19:47
<&jerith>
Noah: I can't really help you there, I'm afraid.
19:48
< Noah>
Emacs is less an editor and more of an operating system, complete with preinstalled games
19:48
<&jerith>
But using hg outside Eclipse is doable.
19:48
<@ToxicFrog>
Then again, I haven't used Eclipse plus any of them because I dislike Eclipse to begin with~
19:48
<&jerith>
Noah: It doesn't technically meet the requirements of an OS, since it can't run on bare metal.~
19:49
<&jerith>
Eclipse has some pretty decent VCS integration.
19:49
< Noah>
Win9x needed DOS, so did it not count as an OS?
19:49
<&jerith>
Noah: DOS counts as "dare metal".~
19:49
<&jerith>
*bare
19:50
< Noah>
okay, so emacs needs linux, otherwise known as the emacs-loading-station for you guys
19:50
<&jerith>
Although when I last seriously used it (about 5 years ago), the VCS integration was biased toward svn-alikes.
19:51
<&jerith>
Noah: Maybe you should set up a bitbucket repo now.
19:51
< Noah>
Okay, and I just do that at bitbuckets site?
19:51
<&jerith>
Yup.
19:51
<&jerith>
There should be instructions.
19:52
< Noah>
On it
19:53
< Noah>
Great, ToxicFrog, you made my Eclipse angry
19:53
< Noah>
Woah
19:54
< Noah>
I...apparently...already have a bitbucket?
19:54
<&jerith>
Noah: Can you log in?
19:54
< Noah>
About to find out
19:55
<&jerith>
It's possible someone else has your username.
19:55
< Noah>
And email? Unlikely
19:55
<&jerith>
(Unless it uses an email address. I forget.)
19:55
< Noah>
I think I just made one and forgot all about it
19:55
<&jerith>
Possible.
19:56
<&jerith>
Maybe last time we had this conversation. ;-)
19:56
< Noah>
no, I think it had something to do with minecraft, but I'll never remember why
19:56
< Noah>
Okay, in bitbucket, looking into ide integration with eclipse
19:59
< Noah>
I do like how eclipse handles plugin stuff
20:00
< Noah>
What the fuck am I watching? Some assholes are looking for Hilter's ghost
20:00
<&jerith>
Noah: ...
20:01
<&jerith>
I find the plugin management to be the least likeable bit of Eclipse.
20:01
< Noah>
They're taunting him too "You're a war criminal. You know what you did, it's in the history books"
20:01
<&jerith>
(For starters, it's bloody impossible to figure out how to update or uninstall anything.)
20:02 * Noah points at the update button?
20:02
<&jerith>
It may have improved in the past few years.
20:02
<&jerith>
I know they were madly working on it.
20:03
< Noah>
Probably for people like you, you ungrateful heathen
20:03
<&jerith>
(I know this because they apparently reimplemented the entire frontend with every release.)
20:03
<&jerith>
Anyways, enough rant. :-)
20:11
<&jerith>
My boss' 8 week old daughter keeps finding bugs in our software.
20:11
< Noah>
HgE installing
20:11
<&McMartin>
jerith: \o/
20:11
< Noah>
haha
20:11
<&jerith>
Her name is "Zo?".
20:11
< Noah>
Oh crap! Gotta change the channel, hot english bitch is cooking and I don't want to drown in saliva
20:12
<&jerith>
And he uses that as test input a lot.
20:12
< Noah>
How do you pronounce Zo... .e.? e:?
20:13
< ErikMesoy>
I would figure that it's "Zo-e" and the dots are to make sure "oe" doesn't become a single sound.
20:13
<&McMartin>
Yeah
20:13
<&McMartin>
Rhymes with "glowy"
20:13
< Noah>
Ah, Zoey
20:13
<&McMartin>
Dieresis!
20:13
<&McMartin>
\m/
20:14
<&jerith>
Same as https://en.wikipedia.org/wiki/List_of_Firefly_characters#Zoe_Washburne
20:15
<&jerith>
McMartin: His second son also has r?ckd?ts.
20:16
<&jerith>
The eldest shares a more normal name with someone in-channel.
20:16
< Noah>
Oh! is it me?
20:16
< Noah>
Is it Noah?!
20:16
<&jerith>
Noah: Well, you're a bit older than any of his kids. ;-)
20:17
< Noah>
I meant his name
20:18
<&jerith>
I'll concede that it is a biblical name and leave it at that.
20:18
<&jerith>
I've probably already talked about his kids more than I really should.
20:19
< Rhamphoryncus>
Clearly named Rhamphorhynchus
20:19
<&jerith>
Rhamphoryncus: You do actually have a biblical name.
20:19
< Rhamphoryncus>
I know :P
20:21
< Rhamphoryncus>
but Rhamphorhynchus would be cooler
20:21
<&jerith>
Noah: Are you all set up with your code in bitbucket yet?
20:22
< Rhamphoryncus>
although Tyrannus would be more mainstream
20:22
< Noah>
No
20:23
< Noah>
Figuring out how to get my exsisting code into a repo through HgE
20:23
<&jerith>
When a Mister Brown I worked with had a baby on the way, we all tried to convince him that the best name for her would be "Octothorpe".
20:24
<&jerith>
Noah: "hg init" in the working directory.
20:24
<&jerith>
Then tell Eclipse that you have an existing repo.
20:24
< Noah>
Yea, guess I'll do that instead
20:24
<&jerith>
Or ignore Eclipse for now and do whatever bitbucket says you should do to get the project up there.
20:25
<&jerith>
Then point Eclipse at your repo.
20:25
<&jerith>
Or point it at bitbucket, if that looks like an easier path to victory.
20:30
< Noah>
Hmm, tried pushing and it says no changes
20:31
<&jerith>
What's the bitbucket URL?
20:31
< Noah>
https://bitbucket.org/mao42ranma/pyholdem-irc/
20:32 * Rhamphoryncus thwacks whoever did the naming in opengl
20:32
<&jerith>
Noah: Would you like to either make it public or add me to it?
20:33
< Noah>
And public
20:34
<&jerith>
No commits.
20:34
<&jerith>
Have you set up the link to the remote repo properly?
20:35 * jerith doesn't remember how to do that in hg.
20:38
<&McMartin>
Rham: VBOs, it turns out, are Old Testament, but I think they have some use still
20:38
<&McMartin>
It's glDrawElements that's deprecated, if I'm reading it right
20:38
< Rhamphoryncus>
McMartin: it seems like they're still the preferred way, they've just been gutted
20:41 * McMartin nods
20:41
<&McMartin>
Yeah, so
20:41
<&McMartin>
Not counting the introductions
20:41
<&McMartin>
The Old Testament is 14 chapters long
20:41
<&McMartin>
The New Testament is... 3
20:42
<&jerith>
Are we talking about OpenGL here still?
20:42
<&McMartin>
But a whole bunch of stuff (notably: transformation matrices and all that surround them) are shared
20:42
< Rhamphoryncus>
jerith: yes
20:42
<&McMartin>
Yeah
20:43
< Noah>
Sucess
20:43
<&McMartin>
Also, much belated:
20:43
<&McMartin>
TF: Yes, by analogy with "Gladius"
20:44
<&jerith>
Noah: Cool. Now for the next bit.
20:44
<&jerith>
Create a directory called "pyholdem", move "deck.py" into it, create an empty "__init__.py" in it.
20:45
< Noah>
okay, sec
20:45
<&jerith>
You now have a package called pyholdem, which contains a module called deck.
20:45
<&jerith>
(A package is just a module made out of a directory containing other modules.)
20:49
< Rhamphoryncus>
If I understand correctly a vertex array object is.. not a vertex array. It is a group of buffers (often but not always used to store vertexes), a parent buffer (often (always?) used to index the child buffers), and a bunch of associated attributes
20:50
< Rhamphoryncus>
it should really be called VertexBufferObjectArrayObject :P
20:50
< Rhamphoryncus>
+ObjectObject
20:51
<&jerith>
Rhamphoryncus: +ProxyFactoryFactory?
20:51
< Rhamphoryncus>
there ya go! :D
20:52
<&jerith>
And now we're in Java! \o/
20:52
<&McMartin>
Yeah, it does seem things are generalized
20:52
<&McMartin>
I haven't worked out how this translates to shaders, and if you can keep some stuff persistent between runs
20:53 * McMartin is *particularly* wondering if you can generate an infinite-extent plasma fractal in a shader and use it as a height map
20:53
< Rhamphoryncus>
jerith: well these are all handles. As integers even
20:53
< Rhamphoryncus>
Except for ones stored as void *.. which are also just integers now
20:53
<&McMartin>
Woo, C interfaces
20:54
< Rhamphoryncus>
Yeah, this pretty much defines a "C interface"
20:55
< Noah>
Add, commit, push
20:55
< Noah>
This is complicated
20:55
< Noah>
When do I code?
20:56
< Noah>
Anyway, folder and __init__ made
20:56
<@ToxicFrog>
Noah: now that it's all set up, you can just get into an add/commit cycle and that's all you need to do
20:57
<&jerith>
Noah: Sorry, juggling work work at the moment.
20:57
<&jerith>
Be with you again in a bit.
20:57
< Noah>
that's fine
20:58
< Noah>
between two kids while doing this anyway
20:59
< Noah>
All the smallest isn't much of an issue, she's happily gumming on her plush hippo
21:00
<&McMartin>
Yay
21:00
< Noah>
The boy is a brat though
21:00 * McMartin would suggest lego jet fighters but the little one is probably little enough that this would be a hazard
21:00
< Noah>
Yea, I try not giving her anything that isn't at least as big as her head
21:00
< Noah>
Because she likes to TRY to eat everything
21:01
< Noah>
Elizabeth and Watts btw
21:01
< Noah>
But I hate that name, so I call her "Z"
21:04
<&McMartin>
Heh
21:04
<&McMartin>
Yeah, though, I've been breaking out LEGO again for a silly wargame coming out this month
21:05
<&McMartin>
THe new kits are actually really quite slick while not being 'this piece is 50% of the final model'
21:05
<&McMartin>
https://hkn.eecs.berkeley.edu/~mcmartin/01/jet_front.JPG
21:07
< Noah>
What game?
21:08
<&McMartin>
"Mobile Frame Zero: Rapid Attack"
21:08
< Noah>
I've never heard of that
21:08
<&McMartin>
As noted, it hasn't actually come out yet
21:08
< Noah>
Oh
21:08
< Noah>
Cool jet anyway
21:09
<&McMartin>
Way bigger than stuff I'll need to design for the game (the resulting robots need to be only about the size of normal wargame minis)
21:09
<&jerith>
Noah: So, you now have your code in a package.
21:10
< Noah>
So it's wargaming, but is uses legos? that's ingenous
21:10
<&jerith>
There are two things you can do, and you should probably do both of them.
21:10
<@ToxicFrog>
McMartin: this has been my main complaint about recent lego kits - so many of the pieces are special forms useful only in that model.
21:14
<&jerith>
Noah: First, create run.py in your project root (next to pyholdem) and put your whole main() and if __name__ thing in there.
21:14
<&jerith>
At the top, "from pyholdem.deck import DeckOfCards".
21:15
<&jerith>
Also, rename your class to DeckOfCards. The initial capital is convention, but it's a very strong convention.
21:15
< Noah>
Hm, okay
21:16
<&jerith>
Then "python run.py" should do what "python deck.py" did before, only with neater code organisation.
21:16
< Rhamphoryncus>
Define array as GLshort, tell opengl it's GL_UNSIGNED_SHORT. *twitch*
21:20
< Noah>
jerith: sure enough
21:22
< Noah>
Add, commit, push
21:22
< Noah>
Sounds like something I'm going to be saying a lot
21:27
< Noah>
McMartin: This game sounds pretty fun, I want to play! :P
21:34 Vash [Vash@Nightstar-fb5b40e5.wlfrct.sbcglobal.net] has joined #code
21:34 mode/#code [+o Vash] by ChanServ
21:37
< Rhamphoryncus>
yay, indexed drawing of a triangle
21:37
<&McMartin>
ToxicFrog: I'm having good luck with kits in the "Creator" line. It's got slick results, but the subcomponents are pretty generic.
21:37
<&McMartin>
The most specialized piece in that jet model was the 1x10 curved slope piece
21:37
<&McMartin>
And, well, "1x10 curved slope piece" is still pretty generic.
21:40
<&jerith>
Noah: Go look up unit testing in Python while I'm busy. :-)
21:41
< Rhamphoryncus>
Two! Two triangles!
21:41
< Rhamphoryncus>
Using shared vertexes, so I could now expand on that
21:48 * Noah googles unit testing in python~
21:54 ErikMesoy is now known as ErikMesoy|sleep
22:00 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
22:15
< Noah>
mmm
22:15
< Noah>
I don't get it
22:22
<&jerith>
Hmm?
22:24
< Noah>
Unit testing
22:25
<@TheWatcher>
What don't you get about it?
22:25
< Noah>
It
22:25
<@TheWatcher>
Why it's needed, how it works...?
22:26
< Noah>
yes
22:26
<@TheWatcher>
Because the former is easy: if you don't have unit tests, you have no way to ensure that your code behaves as it should in all situations.
22:29
<&jerith>
Noah: Have you read http://docs.python.org/library/unittest.html#basic-example ?
22:29
< Noah>
Okay, but creating test code for every little situation seems, tedious?
22:30
<@TheWatcher>
Yes, and?
22:30
<@TheWatcher>
You're welcome to break out VDM++ instead~
22:31
<&jerith>
Noah: Less tedious than manually testing ALL THE THINGS.
22:33
< Noah>
Perhaps
22:33
<&jerith>
Once you write a test asserting that deck.draw(5) returns five cards and that those five cards are no longer in the deck, you never have to worry about breaking that again.
22:33
<&jerith>
If you tweak something that results in the cards not actually being removed or whatever, the test will fail and let you know.
22:34
< Noah>
I see
22:34
< Noah>
Do I just make a test package? or just a test file?
22:34
<&jerith>
That way you don't spend the next hour trying to figure out why there are five aces floating around later.
22:35
< Noah>
I don't just ban the guy with 5 aces?
22:35
<&jerith>
I generally have foo/tests/test_blah.py for each foo/blah.py
22:35
<&jerith>
I also use a smarter test runner than the default one.
22:36
<&jerith>
Like http://pypi.python.org/pypi/nose/1.1.2
22:39
<&jerith>
Noah: VCS gives you the freedom to change your code without worrying that you'll break it and not be able to get back to a working state.
22:40
<&jerith>
Noah: Unit tests give you the freedom to change your code without worrying that you'll break it and not know that you've broken it.
22:40
< Noah>
Hmm, well, I suppose I'll have to try it
22:40
<&jerith>
It's more complicated than that for both, but those two things are at the core.
22:41
<&jerith>
Also, there's a reason I'm telling you to test stuff now rather than later.
22:41
<&jerith>
It's *much* easier to add tests when you're writing the code than it is to go back and add them later.
22:42
<&jerith>
A good set of tests influences your architecture and design. You end up with stuff that's more modular, because it's easier to write tests around that stuff.
22:44
< Eri>
But, how do you know what makes a good test?
22:44
< Eri>
Like, lets take something like the quadratic equation as an example
22:45
<&jerith>
Eri: How do you know what makes good code?
22:45
< Eri>
Say we were solving for x. There's four cases. Linear, two identical real roots, two real roots, and complex roots
22:45
<&jerith>
A test is just a piece of code.
22:45
< Eri>
Experience, I guess
22:45
<&jerith>
You generally want more small tests rather than fewer big ones.
22:45
< Noah>
Well, PyDev gives me a unittest template
22:45
<&jerith>
But it depends.
22:46
< Eri>
Like, would it be sufficient to throw in a test for each case, and maybe one on the boundaries?
22:46
<&jerith>
Noah: Actually, PyDev might have a thing that will run them for you. If so, you might not need nose or whatever.
22:46
<&jerith>
Eri: Maybe. It depends.
22:47 * TheWatcher does admit to being pretty bad with unit tests
22:47
<&jerith>
I generally start with a few simple tests, including whatever pathological cases I can come up with.
22:47
<@TheWatcher>
(then, 90% of my code also happens to need databases, CGI, sessions and stuff, so it gets really nasty to set up really quick ;.;)
22:48
< Noah>
So, should I do all my tests in one file?
22:48
<&jerith>
Almost invariably, I find new edge cases (and often bugs) that aren't covered by my tests when I use my code in the next bit.
22:48
<&jerith>
So then I go back and add more tests for that stuff.
22:49
<&jerith>
Noah: I tend to have a test module for each non-test module.
22:49
<&jerith>
But different people do it differently.
22:51
<&jerith>
Noah: Writing tests can be a bit painful, but it's invariably worth it.
23:20
< Noah>
Kay, made a unit test and pushed it
23:20
< Noah>
Also, what's the point of that __init__.py file?
23:34
< Noah>
Ah, Adventure Time, so silly
23:37
<&McMartin>
Noah: __init__.py is a signal to python that this is a package, basically
23:37
<&McMartin>
When the whole package is imported, it runs any code in there as a global initializer, more or less.
23:37
<&McMartin>
You usually don't need that, so it's usually empty
23:38
< Noah>
Ah
23:40
<&jerith>
Actually, __init__.py is the content of the module.
23:41
<&jerith>
If you "import foo" where foo is a package, you get the contents of foo/__init__.py.
23:42 himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code
23:42 mode/#code [+o himi] by ChanServ
23:42
<&jerith>
You can also "import foo.bar", which imports foo/__init__.py and then imports foo/bar.py.
23:43
<~Vornicus>
note that generally it doesn't add the non-bar components of foo to the namespace
23:44
<&jerith>
It doesn't add them to your namespace, but it does add them to sys.modules.
23:44
<&jerith>
(But you don't have to worry about sys.modules unless you're doing really horrible import mangling, in which case you'd already know all about it.)
23:44
< gnolam>
One hard drive down, two to go...
23:45
<~Vornicus>
At that point though, import foo is pretty much free
23:45
<&jerith>
Yes, because it's just a sys.modules lookup under the hood.
23:46
<&jerith>
Also, mucking about with sys.path can lead to some excitement.
23:46
<~Vornicus>
EXCITEMENT
23:46
<~Vornicus>
but what about excitebike? can it lead to that?
23:46
< gnolam>
Man. I should've bought one of these external HDD enclosures years ago.
23:46
<&jerith>
I once had 'foo' and 'foo/bar' in there for reasons that I won't go into now, but which were even horribler than you might imagine.
23:47
<~Vornicus>
That's horrible
23:47
<&jerith>
Because of this, I managed to import foo/bar/baz.py as both foo.bar.baz and bar.baz.
23:48
<&jerith>
foo.bar.baz.SomeClass and bar.baz.SomeClass are different things, despite both having come from the same source file.
23:49
<&jerith>
Which led to lots of exciting debugging.
23:50
<&jerith>
(This whole thing was Django's fault, by the way. With its yucky path mangling (fixed in 1.4, thank Eris) and some implicit-relative imports in code I'd inherited...)
23:55
< Noah>
Heh
23:56 Vash [Vash@Nightstar-fb5b40e5.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
--- Log closed Wed May 02 00:00:19 2012
code logs -> 2012 -> Tue, 01 May 2012< code.20120430.log - code.20120502.log >

[ Latest log file ]