code logs -> 2007 -> Wed, 04 Jul 2007< code.20070703.log - code.20070705.log >
--- Log opened Wed Jul 04 00:00:55 2007
01:21 Thaqui [~Thaqui@Nightstar-26828.jetstream.xtra.co.nz] has joined #code
01:21 mode/#code [+o Thaqui] by ChanServ
01:41 Vornicus [~vorn@69.0.80.ns-21162] has joined #code
01:41 mode/#code [+o Vornicus] by ChanServ
01:56 Vornicus [~vorn@69.0.80.ns-21162] has quit [Quit: Leaving]
01:58 Vornicus [~vorn@69.0.80.ns-21162] has joined #code
01:58 mode/#code [+o Vornicus] by ChanServ
02:03 ReivZzz is now known as Reiver
02:44 gnolam [lenin@Nightstar-13557.8.5.253.se.wasadata.net] has quit [Quit: Z?]
04:17 Vornicus [~vorn@ServicesOp.Nightstar.Net] has left #code [Leaving]
04:23 Vornicus [~vorn@69.0.80.ns-21162] has joined #code
04:23 mode/#code [+o Vornicus] by ChanServ
04:34 Vornicus [~vorn@69.0.80.ns-21162] has quit [Quit: Leaving]
04:36 Vornicus [~vorn@ServicesOp.Nightstar.Net] has joined #code
04:36 mode/#code [+o Vornicus] by ChanServ
05:12 You're now known as TheWatcher
05:43 Vornicus is now known as Vornicus-Latens
06:47 GeekSoldier|Bed is now known as GeekSoldier
07:04 Serah [~Z@87.72.35.ns-26506] has quit [Ping Timeout]
07:08 Pi [~sysop@Nightstar-6875.hsd1.wa.comcast.net] has quit [Connection reset by peer]
07:17 Pi [~sysop@Nightstar-6875.hsd1.wa.comcast.net] has joined #code
07:17 mode/#code [+o Pi] by ChanServ
07:51 Forj [~Forj@Nightstar-15747.ue.woosh.co.nz] has joined #code
08:07 Serah [~Z@87.72.35.ns-26506] has joined #Code
08:07 mode/#code [+o Serah] by ChanServ
08:39 McMartin [~mcmartin@Nightstar-9497.dsl.pltn13.sbcglobal.net] has joined #code
08:39 mode/#code [+o McMartin] by ChanServ
08:51 Forjadon [~Forjadon@Nightstar-15747.ue.woosh.co.nz] has joined #code
08:51 mode/#code [+o Forjadon] by ChanServ
08:51 Forjadon is now known as ChalcyLaptop
09:07 Forj [~Forj@Nightstar-15747.ue.woosh.co.nz] has quit [Quit: Gone]
09:10 * ChalcyLaptop eyes Python
09:10
<@ChalcyLaptop>
new is not a key word?
09:10 Forj [~Forj@Nightstar-15747.ue.woosh.co.nz] has joined #code
09:10
<@ChalcyLaptop>
how do I create objects then?
09:11
< GeekSoldier>
newObj = class()
09:11
< GeekSoldier>
jsut assign it.
09:11
< GeekSoldier>
just, I meant.
09:11 * ChalcyLaptop attempts to grok this
09:12
<@ChalcyLaptop>
I think I see what you mean. I just haven't done proper objects in Python before
09:12
< GeekSoldier>
the class acts just like a new datatype.
09:12 * ChalcyLaptop tries to remember how to define an object class as opposed to a static one.
09:12
< GeekSoldier>
it's the same as would be for integer or any other.
09:12
<@ChalcyLaptop>
I got that bit :)
09:13
<@ChalcyLaptop>
thanks GS :)
09:13
< GeekSoldier>
no prob.
09:14
< GeekSoldier>
glad to actually be able to help someone in here, finally!
09:14
<@ChalcyLaptop>
:)
09:14
<@ChalcyLaptop>
can you help me with classes?
09:14
<@ChalcyLaptop>
I just got it in C# and now I have to figure out how it works in Python
09:14
< GeekSoldier>
I could try.
09:14
< GeekSoldier>
class Classname(inherit):
09:15
< GeekSoldier>
the inherit would be if the class inherits any others... therefore, optional.
09:16
<@ChalcyLaptop>
ah!! it has to be defined as a class. this helps
09:16
< GeekSoldier>
the important thing to remember with Python classes as opposed to other languages, is that you should always pass 'self' to it.
09:16
< GeekSoldier>
therefore: def method(self, arg1, arg2):
09:16
< GeekSoldier>
then self would contain class variables and methods.
09:17
<@ChalcyLaptop>
ah, so the class itself has to be passed around when the object is used.
09:17
<@ChalcyLaptop>
ok. I think I am seeing this picture now
09:17
< GeekSoldier>
no, only when it is defined.
09:17
< GeekSoldier>
so, if you were calling that method, you would only need to pass arg1 and arg2
09:18
< GeekSoldier>
class methods get the class passed to them so that they can work with the data.
09:18
< GeekSoldier>
(took me a while to get my mind around that :))
09:18
<@ChalcyLaptop>
so I'd have class Bob(): [methods etc] and when I created an object, I'd need to use def name(bob, arguments):?
09:19
<@ChalcyLaptop>
or does it need to be Bob(): \n method1(Bob, arguments):
09:20
<@ChalcyLaptop>
(or am I totally muddled)
09:21
<@ChalcyLaptop>
gah! I want to put ; on the end of all my lines now :(
09:53 gnolam [lenin@Nightstar-13557.8.5.253.se.wasadata.net] has joined #Code
09:53 mode/#code [+o gnolam] by ChanServ
10:03
<@McMartin>
IIRC, Python allows that
10:03
<@McMartin>
IMNRC
10:04
<@McMartin>
Also, just as a minor warning, Python's OO model is noticably different from the C++/Java/C# model.
10:04
<@McMartin>
Though it's basically possible to do just that model's stuff in it, Python allows some additional tricks that may surprise you if you're dealing with other people's code.
10:04
<@McMartin>
But if this is just code you're writing yourself, you don't have to worry about it.
10:06
<@ChalcyLaptop>
it's code I'm writing myself
10:07
<@ChalcyLaptop>
I am finding that it is substantially different.
10:07
<@ChalcyLaptop>
Which is causing some issues
10:07
<@McMartin>
Well, what I meant by "additional tricks" is that Python's ideas of "class" and even "object" are a lot looser.
10:07
<@ChalcyLaptop>
I had noticed that
10:07
<@McMartin>
And so things that can't even be expressed in the C# model are possible in Python.
10:08
<@ChalcyLaptop>
I noticed that while I was doing that paper. I kept going... "but I know how to do this in Python!" (not for OO stuff obviously)
10:08
<@McMartin>
(In particular, different instances of the same class in Python don't necessarily have to have the same members.)
10:08
<@ChalcyLaptop>
currently it's objecting to my syntax. All I have done is attempt to define a class. I've no idea what I've done wrong
10:09
<@McMartin>
Mmm. Can you paste the the code up somewhere?
10:09
<@ChalcyLaptop>
class Human():
10:09
<@ChalcyLaptop>
it's objecting to the second bracket
10:09
<@McMartin>
Ah.
10:09
<@McMartin>
Try just:
10:10
<@McMartin>
class Human:
10:10 * ChalcyLaptop thwap self
10:10
<@ChalcyLaptop>
I learnt that one.
10:10
<@McMartin>
(I usually keep the language and library references open in my web browser when coding)
10:11
<@ChalcyLaptop>
I have the library reference open
10:11
<@ChalcyLaptop>
Its useful for finding modules (particularly when I don't know what half of them are)
10:11
<@McMartin>
God, yes. Python has a semi-ridiculous number of modules.
10:11
<@McMartin>
But only semi-ridiculous because it means you don't usually have to ship with a million libraries.
10:13
<@McMartin>
That said, <3 Python. It's one of my three main languages.
10:13
<@McMartin>
(C and Java being the other two)
10:13
<@ChalcyLaptop>
I can't really comment too much given I only know Python and C#, but of those two, I definitely prefer Python by a long margin
10:14
<@McMartin>
Java and C# are very, very similar
10:15
<@McMartin>
C is primarily only useful for coding as close to the metal as you can get without having to worry (much) about portability.
10:15 * ChalcyLaptop nods
10:15
<@ChalcyLaptop>
thanks for your help :) it's working now.
10:16
<@McMartin>
np
10:18 * GeekSoldier loves Python.
10:19
< GeekSoldier>
that, coupled with perl make me a happy camper.
10:22 MyCatSchemes [~rb6822@Nightstar-13271.cs.bris.ac.uk] has joined #code
10:31 GeekSoldier is now known as GeekSoldier|BeerWorld
10:58
< MyCatSchemes>
ToxicFrog: you use ghostscript as a desktop RPN calculator, right? What's the command to pop something off the stack and print it, please?
11:02
<@Chalcedon>
I think TF's in bed, MCO
11:04 Chalcedon [~Chalcedon@Nightstar-15747.ue.woosh.co.nz] has quit [Quit: Gone]
11:04
< MyCatSchemes>
Ah, tha... bollocks.
11:06 GeekSoldier|BeerWorld is now known as GeekSoldier
11:14 Forj [~Forj@Nightstar-15747.ue.woosh.co.nz] has quit [Quit: Gone]
11:20 ChalcyLaptop [~Forjadon@Nightstar-15747.ue.woosh.co.nz] has quit [Ping Timeout]
11:21
<@McMartin>
Ah, I7.
11:21
<@McMartin>
I6 code:
11:21
<@McMartin>
Verb 'talk'
11:21
<@McMartin>
* 'to' creature -> TalkTo
11:21
<@McMartin>
* 'to' noun -> TalkTo
11:21
<@McMartin>
;
11:21
<@McMartin>
I7 code:
11:21
<@McMartin>
Does the player mean talking to a person: it is likely.
11:55
< Reiver>
12:01
<@jerith>
I would imagine that makes more sense in context...
12:15 MyCatSchemes [~rb6822@Nightstar-13271.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!]
12:19
<@McMartin>
In each case, the effect is when > TALK TO JANITOR needs disambiguation between > TALK TO JANITOR (the guy) and > TALK TO JANITOR CLOSET KEY, it will resolve in favor of the animate object.
12:19
<@McMartin>
But yes.
12:20 * McMartin has just finished writing a new I7 extension.
12:20
< GeekSoldier>
oh, it's an input parser... makes much more sense now.
12:20
<@McMartin>
Yeah. And I7 is designed to have an English-like syntax.
12:20
<@McMartin>
And, rather astonishingly, manages to Not Suck while doing so, for two reasons.
12:20
<@McMartin>
(1) It's a special purpose language for text adventures, so most of the text is inside strings *anyway*
12:21
< GeekSoldier>
good.
12:21
<@McMartin>
(2) It's mostly a rule-based, declarative language, and "The Kitchen is north of the Living Room" isn't much more verbose than "northOf (Kitchen, L_Room)."
12:21 Serah [~Z@87.72.35.ns-26506] has quit [Killed (NickServ (GHOST command used by Ev3))]
12:21 Serah [~Z@87.72.35.ns-26506] has joined #Code
12:21 mode/#code [+o Serah] by ChanServ
12:22
<@McMartin>
In fact, given the implicit declarations of the printed names of Kitchen and Living Room, and the fact that it allows you to chain lists of conditions, assertions, etc. in series, the English-like text can actually be denser.
12:23
<@McMartin>
When you're doing more standard procedural stuff in it, it does turn into a rather flabbier version of ALGOL, but that's why you put those bits in extensions and then just let the normal developers set assertions about how the processing will be done, or (in my particular case) arrange tables of strings.
12:23
<@McMartin>
http://www.stanford.edu/~mcmartin/if/science/source.html is a humble example of I7 code.
12:24
<@McMartin>
http://www.stanford.edu/~mcmartin/if/ is my main IF page, which needs a bit of updating.
12:26
<@McMartin>
"After showing a component (called their doom) to those fools from the Institute: now their doom is sealed; continue the action."
12:26
< GeekSoldier>
interesting syntax. quite readable and understandable, even for an IF plebe like myself.
12:26
<@McMartin>
Definitely vastly easier to return to after an absence.
12:27
<@McMartin>
On the other hand, the gunk you hide in extensions is noticably uglier: http://www.inform-fiction.org/I7Downloads/Extensions/Michael%20Martin/Reactable% 20Quips
12:27
< GeekSoldier>
so, you feed this source to the interpreter and get a playable IF game?
12:27
<@McMartin>
To the compiler, and then get a playable version.
12:27
<@McMartin>
Z-Code, normally, so it runs on a Frotz variant or on Zoom.
12:28
<@McMartin>
For Unix machines, I recommend nfrotz (which is another project I run); for Mac, Zoom is apparently the best; for Windows, WinFrotz is best of breed.
12:29
<@McMartin>
Games that need more than 64KB of RAM, or which include graphics and sound, tend to use a different virtual machine called Glulx; I'm less up to speed on what interpreters are good for it.
12:29
<@McMartin>
The IF authoring community has an... interestingly variant attitude towards Open Source, which is inherited in part from the way the resulting works are part literature and thus unreusable.
12:30
<@McMartin>
Extensions tend to be even more freely available than normal for software, but complete games tend to keep the source locked down.
12:30
<@McMartin>
Which is the *other* reason the interesting stuff tends to go in extensions.
12:31
<@McMartin>
In any event, my new extension builds on the Reactable Quips extension (which I linked) to make it much easier to do LucasArts-style conversation menus.
12:31
<@McMartin>
Because you can kind of do them as it is, but it really, really sucks to do so.
12:36
<@McMartin>
(The language is still in beta; lots of "standard" stuff isn't really available yet.)
12:38 MyCatSchemes [~rb6822@Nightstar-13271.cs.bris.ac.uk] has joined #code
12:47
<@ToxicFrog>
MyCatSchemes: "=" or "==" depending on how you want it displayed
12:47
<@ToxicFrog>
Also "pop" to pop without printing or "stack" to display the entire stack
12:47
< MyCatSchemes>
ToxicFrog: ahhh, thank you! That's much nicer than abusing pstack
12:47
<@ToxicFrog>
(and "dup ==" to display the top stack element without popping it)
12:47
<@ToxicFrog>
(I usually /peek { dup == } def)
12:48
<@ToxicFrog>
http://atrey.karlin.mff.cuni.cz/~milanek/PostScript/Reference/ -- this will help
12:48
<@ToxicFrog>
= and == and similar are under "symbols", language builtin functions are under "operators"
12:55 * MyCatSchemes wgets that for offline reading.
13:03 * McMartin does a quick bugfix on his new extension before submission.
13:16 You're now known as TheWatcher[afk]
13:22
<@ToxicFrog>
Aah, McM. You saw my comments on the Lua 5.1 manual?
13:42
<@McMartin>
Actually, no
13:46 Serah [~Z@87.72.35.ns-26506] has quit [Killed (NickServ (GHOST command used by Ev3))]
13:46 Serah [~Z@87.72.35.ns-26506] has joined #Code
13:47 mode/#code [+o Serah] by ChanServ
14:15
<@ToxicFrog>
McMartin: in short: it's been heavily rewritten from 5.0, and is noticeably better, both in general and as a reference manual (as opposed to a tutorial).
14:15
<@ToxicFrog>
That said, I thought the 5.0 manual was pretty good to begin with.
14:17
<@McMartin>
I spent a lot of time trying to find what I needed in it when writing Enceladus.
14:18 * McMartin also casually beats Sonic R.
14:18
<@McMartin>
Not Recommended (tm).
14:19
<@ToxicFrog>
I think it's better organized now, but I had no trouble finding what I needed in either version, so I could be wrong.
14:27 * McMartin will maybe take a look later.
14:27
<@McMartin>
I7 is still Pile of Cats, so I don't feel angered by the torrent of n00b questions on raif.
14:28
<@ToxicFrog>
Pile Of Cats?
14:28
<@ToxicFrog>
But, yeah, I'm talking about things like "can you use ^ to anchor a pattern at the start of the string like in grep"
14:30
<@McMartin>
"Room descriptions and item descriptions don't work identically and I can't figure out why not", for instance
14:30
<@McMartin>
Which requires you to read, I think, four widely-spaced sections of the I7 docs to get all the data you need.
14:30
<@ToxicFrog>
"What's the right function for X" doesn't bother me as much, although "what does function Y do" does.
14:32
<@McMartin>
Yeah, most of my issues in Lua 5 were "what's the right function for X", which tended to involve pawing through every single module every single time.
14:33
<@ToxicFrog>
Yeah. Easier in 5.1, but still not immediately obvious unless you've already read (or at least skimmed) 2 and 5.
14:33
<@ToxicFrog>
(which I have, and think everyone else should to, but I realize that no everyone will)
14:33
<@ToxicFrog>
However, if you already know what you're looking for but are too lazy to use your browser's search function, out comes the death ray.
14:34
<@McMartin>
Oh, that's a change.
14:34
<@McMartin>
5.0's manual I only ever had accessible in PDF format.
14:34
<@ToxicFrog>
..er?
14:34
<@ToxicFrog>
5.0 was available in HTML from day one.
14:34
<@ToxicFrog>
I didn't even realize there was a PDF version.
14:34 * McMartin never found it on the site, then.
14:35 * McMartin shrugs
14:35
<@ToxicFrog>
http://www.lua.org/manual/
14:35
<@McMartin>
But, uh, yeah. Poor organization + "I only seem to have a PDF" made me sad.
14:35
<@ToxicFrog>
Yeah, having it in HTML is Inherently Superior.
14:35
<@ToxicFrog>
At some point I want to convert it into man pages, too.
14:35
<@McMartin>
Ah, I see, the names themselves are also links.
14:35 * McMartin was only looking at the "[ps | pdf]" and figured those were the only options.
14:36
<@McMartin>
Or else I got it from the main download page or something.
14:36
<@McMartin>
But yeah, I still have a stapled printout of the 5.0 manual around here somewhere.
14:38
<@ToxicFrog>
;.
14:39
<@ToxicFrog>
;
14:49 Thaqui [~Thaqui@Nightstar-26828.jetstream.xtra.co.nz] has left #code [Leaving]
15:05 GeekSoldier_ [~Rob@Nightstar-5216.pools.arcor-ip.net] has joined #code
15:06 GeekSoldier [~Rob@Nightstar-5001.pools.arcor-ip.net] has quit [Ping Timeout]
15:12 GeekSoldier_ is now known as GeekSoldier|BBQ
15:12
< Reiver>
*snerk*
15:12 Serah [~Z@87.72.35.ns-26506] has quit [Killed (NickServ (GHOST command used by Ev3))]
15:12 Serah [~Z@87.72.35.ns-26506] has joined #Code
15:12 mode/#code [+o Serah] by ChanServ
15:16 You're now known as TheWatcher
16:01 Vornicus-Latens is now known as Vornicus
16:10 MyCatSchemes [~rb6822@Nightstar-13271.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!]
17:05 You're now known as TheWatcher[afk]
18:14 You're now known as TheWatcher
19:25 Forj [~Forj@Nightstar-15747.ue.woosh.co.nz] has joined #code
19:29 Serah [~Z@87.72.35.ns-26506] has quit [Killed (NickServ (GHOST command used by Ev3))]
19:29 Serah [~Z@87.72.35.ns-26506] has joined #Code
19:29 mode/#code [+o Serah] by ChanServ
19:49 Forj [~Forj@Nightstar-15747.ue.woosh.co.nz] has quit [Connection reset by peer]
20:32
< Raif>
Torrent of n00b questions?
20:34
<@Vornicus>
n00btorrent!
20:40
<@ToxicFrog>
Where?
20:41
<@Vornicus>
Hell if I know.
20:41
<@Vornicus>
Possibly while I was gone.
20:43 Chalcedon [~Chalcedon@Nightstar-15747.ue.woosh.co.nz] has joined #code
20:43 mode/#code [+o Chalcedon] by ChanServ
20:48 Chalcedon is now known as ChalcyAFK
20:53 Forjadon [~Forjadon@Nightstar-15747.ue.woosh.co.nz] has joined #code
20:53 mode/#code [+o Forjadon] by ChanServ
20:53 Forjadon is now known as ChalcyLaptop
20:54 Serah [~Z@87.72.35.ns-26506] has quit [Killed (NickServ (GHOST command used by Ev3))]
20:54 Serah [~Z@87.72.35.ns-26506] has joined #Code
20:54 mode/#code [+o Serah] by ChanServ
20:58 Forjehdon [~Forjadon@Nightstar-15747.ue.woosh.co.nz] has joined #code
20:59 ChalcyLaptop [~Forjadon@Nightstar-15747.ue.woosh.co.nz] has quit [Ping Timeout]
20:59 Forjehdon is now known as ChalcyLaptop
21:01 McMartin [~mcmartin@Nightstar-9497.dsl.pltn13.sbcglobal.net] has quit [Quit: brb]
21:08 McMartin [~mcmartin@Nightstar-9497.dsl.pltn13.sbcglobal.net] has joined #code
21:08 mode/#code [+o McMartin] by ChanServ
21:10 ChAfk is now known as Chalain
21:33 Chalain is now known as ChAfk
21:39
< ChalcyLaptop>
can somebody remind me how I add a string to a list in python without it adding each character of the string individually?
21:39
< ChalcyLaptop>
also, how do I trim out new line characters?
21:40
<@McMartin>
For the first, use "append", not "extend"; for the latter, strip() *probably* does what you want.
21:40
<@McMartin>
Unless you want to strip out newlines from the *middle* of a string, in which case you'll have to break out the regexps
21:40
< ChalcyLaptop>
no, its the end.
21:40
< ChalcyLaptop>
thanks :)
21:49 ChalcyLaptop [~Forjadon@Nightstar-15747.ue.woosh.co.nz] has quit [Ping Timeout]
21:58 Forjadon [~Forjadon@Nightstar-15747.ue.woosh.co.nz] has joined #code
21:58 mode/#code [+o Forjadon] by ChanServ
21:59 Forjadon is now known as ChalcyLaptop
22:13 Forjehdon [~Forjadon@Nightstar-15747.ue.woosh.co.nz] has joined #code
22:14 ChalcyLaptop [~Forjadon@Nightstar-15747.ue.woosh.co.nz] has quit [Ping Timeout]
22:19 Serah [~Z@87.72.35.ns-26506] has quit [Killed (NickServ (GHOST command used by Ev3))]
22:19 GeekSoldier|BBQ is now known as GeekSoldier
22:19 Serah [~Z@87.72.35.ns-26506] has joined #Code
22:19 mode/#code [+o Serah] by ChanServ
22:57 GeekSoldier is now known as GeekSoldier|Bed
23:21 Chorj [~Forjadon@Nightstar-15747.ue.woosh.co.nz] has joined #code
23:22 Forjehdon [~Forjadon@Nightstar-15747.ue.woosh.co.nz] has quit [Ping Timeout]
23:38 ChalcyAFK is now known as Chalcedon
23:44 Serah [~Z@87.72.35.ns-26506] has quit [Killed (NickServ (GHOST command used by Ev3))]
23:44 Serah [~Z@87.72.35.ns-26506] has joined #Code
23:44 mode/#code [+o Serah] by ChanServ
23:45 Thaqui [~Thaqui@Nightstar-26828.jetstream.xtra.co.nz] has joined #code
23:45 mode/#code [+o Thaqui] by ChanServ
23:56 Chalcedon is now known as ChalcyPhone
23:59 Netsplit DeepThought.NY.US.Nightstar.Net <-> Blargh.CA.US.Nightstar.Net quits: MyCatVerbs, @ChalcyPhone, @Serah, Reiver
--- Log closed Thu Jul 05 00:00:01 2007
code logs -> 2007 -> Wed, 04 Jul 2007< code.20070703.log - code.20070705.log >