code logs -> 2012 -> Fri, 21 Dec 2012< code.20121220.log - code.20121222.log >
--- Log opened Fri Dec 21 00:00:03 2012
00:22 Xon [Xon@Nightstar-362effcc.highway1.net.au] has quit [[NS] Quit: ]
00:29 Xon [Xon@Nightstar-362effcc.highway1.net.au] has joined #code
00:34 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
00:36 shawn-p [Shawn@Nightstar-4db8c1df.mo.charter.com] has joined #code
00:40 You're now known as TheWatcher[T-2]
00:43 You're now known as TheWatcher[zZzZ]
00:50 thalass [thalass@Nightstar-724ec5eb.bigpond.net.au] has joined #code
01:01 gnolam [lenin@Nightstar-bb103c17.cust.bredbandsbolaget.se] has quit [[NS] Quit: No Ping reply in 180 seconds.]
01:03 AbuDhabi_ [annodomini@Nightstar-b954fa08.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
01:14 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
01:14 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
01:14 mode/#code [+o celticminstrel] by ChanServ
01:39
<@Tarinaky>
How to perform string manipulation in any programming language:
01:39
<@Tarinaky>
Step one:
01:39
<@Tarinaky>
Invoke Perl
01:39
<@Tarinaky>
There is not Step Two.
01:40 shawn-p [Shawn@Nightstar-4db8c1df.mo.charter.com] has quit [Ping timeout: 121 seconds]
01:43
< simon`_>
hmm...
01:45
< simon`_>
I've always used the compiler tools for Moscow ML rather than those for SML/NJ, and that's my fault. so before I really give this idea any thought, I should look at their tools. but here it is anyway: MosML's lexer tools suck. its Lexing library is inadequate, and its lexbuf state is hard to tinker with when exploring how a lexer generator works during a course. SML/NJ's might be slightly complicated, though.
02:25 Reiv_ [NSwebIRC@A3BDC3.5BE3EC.B8847E.5ADB9D] has quit [Ping timeout: 121 seconds]
02:32 harlow [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
02:35 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has quit [Ping timeout: 121 seconds]
03:16 Attilla [Obsolete@Nightstar-9e7fa2b2.range86-162.btcentralplus.com] has quit [[NS] Quit: ]
03:18 Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has joined #code
03:18 mode/#code [+qo Vornicus Vornicus] by ChanServ
03:21 Kindamoody[zZz] is now known as Kindamoody
03:22 Kindamoody [Kindamoody@Nightstar-05577424.tbcn.telia.com] has quit [Client closed the connection]
03:22 Kindamoody|afk [Kindamoody@Nightstar-05577424.tbcn.telia.com] has joined #code
03:22 mode/#code [+o Kindamoody|afk] by ChanServ
03:22 Kindamoody|afk is now known as Kindamoody
04:20 simon`_ [simon@Nightstar-fe311ff3.pronoia.dk] has quit [Client closed the connection]
04:21 froztbyte [froztbyte@Nightstar-dc394964.za.net] has quit [Ping timeout: 121 seconds]
04:21 Azash [ap@Nightstar-339920e6.net] has quit [Ping timeout: 121 seconds]
04:23 VirusJTG_ [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
04:23 VirusJTG_ [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Client closed the connection]
04:25 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds]
04:27 froztbyte [froztbyte@Nightstar-dc394964.za.net] has joined #code
04:27 mode/#code [+o froztbyte] by ChanServ
04:30 simon` [simon@Nightstar-fe311ff3.pronoia.dk] has joined #code
04:30 mode/#code [+o simon`] by ChanServ
04:40 thalass [thalass@Nightstar-724ec5eb.bigpond.net.au] has quit [Ping timeout: 121 seconds]
04:44 Azash [ap@Nightstar-339920e6.net] has joined #code
04:44 mode/#code [+o Azash] by ChanServ
05:35 harlow [mac@Nightstar-fe8a1f12.il.comcast.net] has quit [Connection closed]
07:04 syksleep is now known as Syk
07:45 Kindamoody is now known as Kindamoody|afk
08:06 AbuDhabi [annodomini@Nightstar-b3e58ae0.adsl.tpnet.pl] has joined #code
08:16 Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Client closed the connection]
08:43 AD[Tab] [yaaic@Nightstar-b3e58ae0.adsl.tpnet.pl] has joined #code
08:44
< AD[Tab]>
Question, you guys. Where do I find the conloe in this Androix?
08:44
< AD[Tab]>
*console
08:48
< AD[Tab]>
*andriod
08:48
< AD[Tab]>
*android
08:52
<~Vornicus>
Arg. The 12 Weights puzzle is full of confusion.
09:02
<~Vornicus>
Okay. putting 1,2,3,4 on one side and 5,6,7,8 on the other, I see that the 1,2,3,4 side is lighter. This gives 8 cases: 1L 2L 3L 4L 5H 6H 7H 8H. I now need to make a setup which will have each of the three outcomes appear in no more than three cases.
09:08 * Azash ponders for a moment
09:09
<@Azash>
What if you take that to find the abnormal set of four
09:09
<@Azash>
Then choose an arbitrary pair from that set and weigh it against two known-to-be-regular weights
09:09
<@Azash>
This will narrow down which is the abnormal pair in your abnormal four
09:10
<@Azash>
Then pick one of the two at random and weigh against a known-regular weight
09:10
<~Vornicus>
Only get three weighings.
09:11
<@Azash>
What I just proposed has three weighings
09:11
<@Azash>
Wait, you need to find out if it's lighter or heavier? Nevermind
09:12
<~Vornicus>
I got it.
09:13
<~Vornicus>
well no, I have to find out which one it is.
09:13
<~Vornicus>
But the thing is: Yours just required four weighings, because you forgot to count the one I already did.
09:15
<@Azash>
No it didn't
09:15
<@Azash>
Your is the first step in mine
09:15 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has quit [[NS] Quit: ]
09:18 Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has joined #code
09:18 mode/#code [+o Alek] by ChanServ
09:18 * Azash rolls out
09:18
<~Vornicus>
Thing is that is 1234 and 5678 are unequal then you don't know which of those two sets are abnormal.
09:18 AD[Tab] [yaaic@Nightstar-b3e58ae0.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
09:20
<~Vornicus>
Second weighing was 1 2 5 6 vs 3 7 9 10; this way 1L 2L and 7H will show right heavy, 3L 5H 6H will show left heavy, and 4L and 8H will show equal.
09:20
<~Vornicus>
And then those three you can handle by putting an L and an H on one side and 9 10 on the other.
09:21
<~Vornicus>
And now, having solved 12 Weights on my own, I can sleep victorious.
09:25 Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has quit [[NS] Quit: ]
09:31 Attilla [Obsolete@Nightstar-9e7fa2b2.range86-162.btcentralplus.com] has joined #code
09:33 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
09:39 ErikMesoy|sleep is now known as ErikMesoy
09:47
<@Tarinaky>
I think I'm going to have to add a size stat.
10:04 You're now known as TheWatcher
10:13 RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
10:41
< ErikMesoy>
I thought you had one already.
10:49 Kindamoody|afk is now known as Kindamoody|out
10:52
< ErikMesoy>
WTF. wxpython toolbars default to top-aligned and have styles for TB_BOTTOM and TB_RIGHT. But not left, according to these docs.
11:23 Attilla [Obsolete@Nightstar-9e7fa2b2.range86-162.btcentralplus.com] has quit [Ping timeout: 121 seconds]
11:41 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
11:43 Attilla [Obsolete@Nightstar-9e7fa2b2.range86-162.btcentralplus.com] has joined #code
12:19 gnolam [lenin@Nightstar-bb103c17.cust.bredbandsbolaget.se] has joined #code
12:19 mode/#code [+o gnolam] by ChanServ
13:00 Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
13:00 mode/#code [+o Pandemic] by ChanServ
13:15
<@gnolam>
https://www.youtube.com/watch?v=DkRo6im_5ig
13:51 RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has quit [Ping timeout: 121 seconds]
14:18 McMartin_ is now known as McMartin
14:18 mode/#code [+ao McMartin McMartin] by ChanServ
15:10 RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
15:19 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
15:20 mode/#code [+o celticminstrel] by ChanServ
15:24 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [Client closed the connection]
15:24 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
15:25 mode/#code [+o celticminstrel] by ChanServ
15:49 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
15:49 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
15:49 mode/#code [+o celticminstrel] by ChanServ
15:53
< ErikMesoy>
Python style question: When making a number of similar objects (wilderness areas with random encounter tables in an RPG), should I be giving lots of data to __init__, doing lots of setup outside of __init__, or making each object its own class? Or is there some better way I've missed to populate the Forest and the Hills with different monster lists?
15:57 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
16:00 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
16:03 Attilla [Obsolete@Nightstar-9e7fa2b2.range86-162.btcentralplus.com] has quit [Ping timeout: 121 seconds]
16:03 Attilla [Obsolete@Nightstar-9e7fa2b2.range86-162.btcentralplus.com] has joined #code
16:05 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
16:05 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
16:05 mode/#code [+o celticminstrel] by ChanServ
16:34 RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has quit [Ping timeout: 121 seconds]
17:44
<@rms>
ErikMesoy: use dict lookups, pass them to init?
17:45
< ErikMesoy>
And put the huge dict somewhere else?
17:47
<@rms>
Aye, depends on the rest of the design though
17:52 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
17:54
< mac>
hey does anyone know if its possible to accept 2 arguments and 3 arguments from a function? or to have a function check for how many arguments there are and send the correct inputs to the correct function?
17:54
<@rms>
language?
17:56
< mac>
php or javascript
17:56
< mac>
maybe even java
17:56
< ErikMesoy>
IIRC, Java requires different functions for different numbers of arguments.
17:57
<@rms>
js has an arguments variable, use it as an array
17:57
< mac>
so say I am sending? White_red;#FFFFFF;#FF0000
17:57
< ErikMesoy>
foo(x, y) and foo(x, y, z) will automatically match calls with the right number of functions to the function definitions with that many arguments.
17:57
< mac>
where ; is the separator for arguments.
17:57
<@rms>
PHP has functions to do the same
17:57
< mac>
oh neat
17:58
<@rms>
java has overloading
17:59
< mac>
because i might want to send White_red;#FFFFFF;#FF0000 or just White;#FFFFFF but i want my program to be able to discern bailed on the number of arguments passed.
18:00
< ErikMesoy>
In Java, I'd overload the function name by writing a two-argument function and a three-argument function. Not sure about the others.
18:00
<@rms>
PHP has argument defaulting IIRC
18:19
<@Azash>
18:56 < ErikMesoy> IIRC, Java requires different functions for different numbers of arguments.
18:19
<@Azash>
Also type-specific
18:20
< ErikMesoy>
Yeah. JavaFunction(int i, string s) and JavaFunction(int i, int j) will happily live alongside each other, and calls will be sent to the appropriate one.
18:21 * Azash ponders what will happen if you have Foo(String) and Foo(Integer) and call Foo(null)
18:23
< ErikMesoy>
Today is a good day to test it. :)
18:35
< mac>
oh let me know what happens if you try it
18:35
< ErikMesoy>
The world ends.
18:37
< ErikMesoy>
ooh, Python's str.partition() is neat. It lets me keep data in files as "Name: Description" and then partition(": ") to get out name and description easily.
18:39
< Syk>
owo
18:39
< Syk>
what if your description contains : in it
18:40
<@Tamber>
I would presume that you can split on only the first match in a line
18:41
<@Tarinaky>
ErikMesoy: I would suggest looking up json >.>
18:42
<@Azash>
Java approach: str = str.split("[^\\\\]: ");
18:44
<@Rhamphoryncus>
Syk: then you need a less daft file format ;)
18:45
<@Rhamphoryncus>
Well, if it's in the description and not the name it'd still work. Python's str.partition() only does a single match
18:46
< Syk>
ah
18:46
< Syk>
well that's good then
18:46
< ErikMesoy>
Rhamphoryncus: or a less daft naming convention
18:47 * ErikMesoy will have to avoid putting colons in his names now. This is hardly a great loss.
18:47
<@Rhamphoryncus>
Just make sure you'll never want a newline in a description :)
19:39
< Moltare>
1
19:52 Kindamoody|out is now known as Kindamoody
20:01 Kindamoody is now known as Kindamoody[zZz]
20:14
< ErikMesoy>
1?
20:33
<@TheWatcher>
2
20:42
< mac>
3
20:47 Syk is now known as syksleep
20:50
<@TheWatcher>
It's Count von Count, #code version.
20:53
< ErikMesoy>
Four, ahaha, four little metasyntactic variables?
21:11 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has left #code ["Leaving"]
21:20
< Moltare>
z\\''''''''''##
21:23
< ErikMesoy>
I suspect there may be a cat on Moltare's keyboard
21:31
<@Alek>
nah, keyboard+head
21:32
< ErikMesoy>
Maybe it's Perl?
21:36
< ErikMesoy>
Hmm. Game dialogue. I would like for the player to talk to NPCs about something repeatedly without having to end and restart conversation, so the conversation should be able to loop, sort of. This means that a conversation branch should /not/ be implemented as a function which calls the next one depending on answer choice.
21:36
< ErikMesoy>
That could lead to being arbitrarily deep inside a function stack, which is bad.
21:39
< ErikMesoy>
So. Hm. A conversation branch returns a dict matching player responses to conversation branch IDs. So call the NPC's converse(branchID) function, print text, get back dict. A while(choice != exit) loop around this repeatedly presents the dict to the player, gets a responds, calls the NPC. What can go wrong with this?
21:41
<@Alek>
add a counter for each choice. if they keep asking about the same thing constantly, get the NPC mad. or maybe they'll get scared, break down, and change their story.
21:42
<@Alek>
personalities = good.
21:42
< ErikMesoy>
That is a bell. :p
21:42
< ErikMesoy>
Now is not the time to add bells and whistles.
21:42
<@Alek>
lol
22:03
< ErikMesoy>
Okay, now I'm hitting serious confusion and I request the channel's help rather than just an ear for rants and monologues: Something with variable reference/declaration in Python seems inconsistent and magic. http://pastie.org/5563184
22:06
< ErikMesoy>
If I don't initialize a variable, a function with a conditional on the variable refuses to run. But after I initialize it, something in the function can still throw an error that the variable isn't initialized!
22:10
<@celticminstrel>
global done_before
22:10
<@celticminstrel>
On first line of function.
22:10
<@celticminstrel>
Should fix it, I think.
22:10
<@celticminstrel>
I guess the existence of an assignment forces it to be a local instead of a global variable or something?
22:11
<@celticminstrel>
I thought that was only if the assignment preceded a read-reference, but maybe not...
22:11
< ErikMesoy>
That needs to be a global? Why isn't it "global enough" for the function to see it?
22:12
<@celticminstrel>
I dunno?
22:13
< ErikMesoy>
Well, various attempts at globalization did not fix it. "global done_before" line at start by itself did not work. So I tried adding "global" in front of other references to done_before and none of them worked either.
22:15
< ErikMesoy>
Aha. I add to add a line reading "global done_before" both at the start of the file and in the start of the function.
22:15
<@celticminstrel>
...that's odd?
22:16
< ErikMesoy>
Lesson learned: Python really doesn't want me to use globals. (I had seen earlier that you can't assign a global at the same time as you declare it. But now I see that I can't use it inside a function without telling the function about the globalness, too!)
22:22
< ErikMesoy>
Hmm, this sounds like I will end up using "global" as mild boilerplate for each zone that I want to have introduction text on. Hopefully I will see a non-boilerplate method of doing this tomorrow.
22:22 ErikMesoy is now known as ErikMesoy|sleep
22:27
<@iospace>
... part of me does not want tos ee how big this file will be after i'm done with this...
22:29
< ErikMesoy|sleep>
For executing one of several functions: is random.choice([function1,function2])() a stupid way to do it?
22:33 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
23:06 shawn-p [Shawn@Nightstar-4db8c1df.mo.charter.com] has joined #code
--- Log closed Sat Dec 22 00:00:18 2012
code logs -> 2012 -> Fri, 21 Dec 2012< code.20121220.log - code.20121222.log >

[ Latest log file ]