code logs -> 2012 -> Fri, 10 Aug 2012< code.20120809.log - code.20120811.log >
--- Log opened Fri Aug 10 00:00:13 2012
00:00
<~Vornicus>
heh, and now I'm remembering how I often solved the mission in diablo 1 with the little demon and the sign: wall of fire in the walled-in zones, because you didn't need line of effect.
00:00
< gnolam>
Vornicus: see: Covert Action
00:01
<~Vornicus>
that a game?
00:02
< gnolam>
Yup
00:02
< gnolam>
A Sid Meier one, even.
00:02
<~Vornicus>
Oh I see.
00:03
< gnolam>
Spy-themed game. If you don't get the mastermind in the current mission, he'll be behind the next one.
00:09 Nemu [NeophoxProd@Nightstar-6a7027c0.asahi-net.or.jp] has quit [Ping timeout: 121 seconds]
00:32 You're now known as TheWatcher[T-2]
00:40 You're now known as TheWatcher[zZzZ]
01:30 Derakon[AFK] is now known as Derakon
02:12 Attilla [Obsolete@Nightstar-adb52c1e.as43234.net] has quit [Ping timeout: 121 seconds]
02:35 Atreus is now known as Tarinaky
02:45
<&Derakon>
So, getting back to that whole Prompt business from the other day.
02:46
<&Derakon>
I have a "gui" package in Pyrel. Currently this just contains the wxWidgets-based, ASCII-style display mode.
02:46
<&Derakon>
What I'm thinking I could do would be to add a "UI mode" selector to the gui package.
02:46
<&Derakon>
So you'd do "import gui; gui.use(gui.WX)" or something.
02:46
<&Derakon>
And that would do two things.
02:47
<&Derakon>
First, it would do the necessary initialization to use the desired UI -- creating windows and so on.
02:47
<&Derakon>
Second, it would import that UI's version of whatever objects the main game needs to know about.
02:47
<&Derakon>
Thus giving the engine access to Prompts without needing to know anything about the display layer.
02:48
<&Derakon>
This implies that e.g. every UI implementation needs to implement a YesNoPrompt.
02:48
<&McMartin>
That seems entirely reasonably, tbqh.
02:49
<&Derakon>
I've experienced so much pain at work from previous coders using "import foo as bar" and "from foo import *" that I've sort of erected a mental block against doing anything besides "import foo" in my coding. ?.?
02:49
<&Derakon>
But I guess I can bring myself to do "import wx.prompt as prompt".
02:54
<&Derakon>
...mental note: don't name the wxWidgets-UI package "wx".
02:55
<&McMartin>
/me ; ; at this code
02:56 * McMartin is programming hitler
03:00
<&Derakon>
Well, could you program him to be a better artist?
03:00
<&McMartin>
working on it
03:01
<&McMartin>
Step 1: make it work at all without subjugating europe^W^Wbreaking the client-server state machine
03:01
<&McMartin>
That step 1 is necessary at all given that AIUI we're using a REST-like API is kind of "impressive"
03:01
<&McMartin>
Step 2: Make the code changes for that minimal.
03:48
<&Derakon>
Okay, so I need each UI to implement the various Prompt subclasses.
03:48
<&McMartin>
Step 1 looks like it has been done
03:48
<&McMartin>
\o/
03:48 * McMartin commits it to a branch with an apology
03:48
<&Derakon>
Usually the way I'd do this would be to have a "core" definition for each subclass, that the UI then subclasses.
03:49
<&Derakon>
This isn't necessary but at least means that I can throw a custom exception saying "Implement this function stub, you idiot!" instead of just having the function not be there, for example.
03:49
<&Derakon>
But I want to extend the core Prompt class for this UI layer, to add handleKeyboardInput().
03:50
<&Derakon>
And then get that function for all of the subclasses.
03:50
<&Derakon>
Which sounds like an obvious situation for multiple inheritance...
03:50
<&Derakon>
Or I could just give up on making the UI Prompts be subclasses of some UI-independent Prompt.
04:16 * Derakon goes with that last option for now.
04:23 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
04:41 iospace is now known as io\t-2
04:47 io\t-2 is now known as iospacedout
04:50
< Tarinaky>
Man. Python's documentation is so much nicer than Lua's :/
04:53
<~Vornicus>
Python's documentation /literally taught me to program/
04:55
< Tarinaky>
I don't understand what a static function is though.
04:55
< Tarinaky>
(in C)
04:56 Kindamoody[zZz] is now known as Kindamoody
04:59
<&McMartin>
file-scoped.
04:59
< Tarinaky>
Part of me wants to use Python on C++ just to provide a wrapper for file io.
04:59
< Tarinaky>
*in C++
04:59
< Tarinaky>
the rest of me is convinced this is a bad idea or redundant.
05:00
<~Vornicus>
I'm so unfamiliar with C's scoping rules that I don't know what file-scoped means.
05:01
<~Vornicus>
You could just write in Python and replace stuff with pyrex and eventually C as you need it.
05:02
<&Derakon>
Yeah, Python makes it easy to replace the bits that actually need to be fast with reimplementations in C/C++.
05:02
<&Derakon>
And the way I interpret "static" is as "independent of any specific context".
05:03
<&Derakon>
So your normal class functions are executed in the context of a specific instance of that class.
05:03
<&Derakon>
A static class function has no such context.
05:03
< Tarinaky>
The dynamic typing does my head in some times and distributing python is.,.. tricky.
05:03
<&Derakon>
py2app, py2exe
05:03
<&Derakon>
They aren't trivial to use but they're still pretty easy.
05:03
< Tarinaky>
That's Mac and Windows covered,
05:04
<&Derakon>
If you want to cover Linux, let some Linux fanatic help you write your installer there.
05:04
<~Vornicus>
Linux is Fucking Easy
05:05 * Derakon ponders his Prompts.
05:05
<~Vornicus>
You just put a shebang in there and make sure your program can be found.
05:05
< Tarinaky>
What if you don't want to give away your source code?
05:05
<&Derakon>
The receiveKeyInput function needs to be able to say one of these three things: 1) "I'm done", 2) "I need more information (i.e. another prompt)", 3) "I'm not done".
05:06
<~Vornicus>
Then you're stuck. If someone cares enough they can decompile your code anyway.
05:06
<&Derakon>
I guess that means a three-state return value.
05:06
<~Vornicus>
And if you don't feel like throwing around uncompiled code, I am pretty sure .pycs are also executable.
05:07
<&Derakon>
Yep.
05:07
<&Derakon>
I've wasted time debugging because I left a .pyc in place after moving a .py and the code still referred to the old file.
05:08
< Tarinaky>
Anyway. I think we've established that Python isn't what I really want to be using.
05:08
<~Vornicus>
You too, ah?
05:08
<&Derakon>
I've been working with Python long enough to have made most of the stupid mistakes~
05:11 * Derakon mutters, tries to think of an elegant way to have a three-state return value.
05:11
< Tarinaky>
Derakon: What language?
05:11
<~Vornicus>
True, False, FileNotFound
05:11
<&Derakon>
Vorn: >.<
05:11
<&Derakon>
I think I have it.
05:11
< Tarinaky>
int (with constants defined)
05:11
<&Derakon>
If the Prompt is completed, return None.
05:11
<~Vornicus>
I started typing "None" for the last one but then the WTF hit me.
05:12
<&Derakon>
Otherwise if the Prompt still needs more input, return itself.
05:12
<&Derakon>
Otherwise if a new Prompt is needed, return the new Prompt.
05:12
<&Derakon>
In any case, the caller (which is the input handler) sets the return value as the current Prompt to direct input to.
05:25
<&Derakon>
Hm, this didn't work. http://pastebin.com/EKLknNYU
05:25
<&Derakon>
This is in gui/__init__.py
05:25
<&Derakon>
The idea was you'd do "import gui; gui.setUIMode(gui.WX)" and then later you could do "import gui.prompt".
05:25
<&Derakon>
But it doesn't seem to actually work.
05:26
<&Derakon>
And the problem would appear to be that imports are function-scoped.
05:27 Vash [Vash@Nightstar-e8057de2.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
05:29
<&Derakon>
...well, that and "import gui.prompt" doesn't actually check to see if you've assigned anything to the gui package, I guess.
05:34
<&Derakon>
Ugh, I hate playing with namespaces this way. >.<
05:36
< rms>
I hate how Python makes you chose between: hackish namespace tricks, having really huge files and having files of decent sizes putting things in namespaces without having billions of really small/nested namespaces.
05:36
<&Derakon>
Billions of really small / nested namespaces is the way to go, honestly.
05:36
<&Derakon>
The problem I have here is I'm trying to alias one namespace on top of another.
05:44
<&McMartin>
A nasty trick I picked up from Java is to use classes *as* namespaces.
05:44
<&McMartin>
In Python, they're more or less semantically identical anyway~
05:44
<&McMartin>
that said: clojure \o/
05:46
< rms>
Heh, in JS namespaces don't exist
05:46
< rms>
So people will use functions/objects as psuedo namespaces
05:47
<&McMartin>
(Clojure lets you set the current namespace with a command)
05:47
< rms>
Then again, JS is the only language I know of that lets you add members to a function
05:47
<&McMartin>
Python lets you make objects callable, which results in equivalent semantics.
05:48
<&McMartin>
... and lets you add members to objects at runtime.
05:48
< Tarinaky>
C++ lets you overload operator() which results in equivalent semantics. :p
05:48
<&McMartin>
No; in C++ you cannot add members to an instance.
05:48
< Tarinaky>
Oh, point.
05:49
< Tarinaky>
But the instance cna -have- members.
05:49
<&McMartin>
I'm reading "add" here has "monkeypatch"
05:49
<&McMartin>
*as
05:49
< Tarinaky>
Well,, if you're desperate you could overload operator[] and use a datastructure.
05:50
< Tarinaky>
But then you're just being silly.
05:50
<&McMartin>
The "problem" is that you can't overload operator.
05:50
<&McMartin>
That is, "operator.", not "operator".
05:51
< Tarinaky>
You can, however, ovberload operator ->
05:51 * Derakon goes to #python on Freenode, is told to return a tuple representing the type of Prompt he wants to make and let the UI layer do the appropriate dispatch.
05:51
<&Derakon>
Which would be inelegant from the engine's perspective, and add a layer of indirection...but it'd work. Bleh.
05:51
<&McMartin>
Oh hey, it's my favored form of data-direction~
05:52
<&McMartin>
(Have you done any work with the ML family, or Haskell?)
05:52
<&Derakon>
I did a little SML back in college.
05:53
<&McMartin>
This sounds like Prompt should be a data type, ML-style
05:53
<&McMartin>
type prompt = Confirm of bool | Text of string | ...
05:54
<&Derakon>
Prompts also need to be able to draw themselves.
05:54
<&Derakon>
And process input.
05:54
<&McMartin>
Yeah.
05:55
<&McMartin>
I'd think that for all practical purposes Prompts would be their own event loop, that never calls into/notifies the model.
05:55
<&McMartin>
Until Confirm is hit.
05:55
<&Derakon>
They intercept input until they're cancelled, yeah.
06:00 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
06:00 mode/#code [+o himi] by ChanServ
06:00 * Derakon finally gets possibly-useful answers from #python
06:00
<&Derakon>
#1: use a class, as McM suggested.
06:01 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Client closed the connection]
06:01
<&Derakon>
#2: modify sys.modules.
06:01
<&Derakon>
(Up until now, I was getting the classic geek answer to "How do I do X?", namely, "Why would you want to do X? Do Y instead.")
06:07
<&Derakon>
#3: pass the UI around as an object whenever invoking engine functions that might need it; let the engine invoke appropriate Prompt-creating functions on the UI as it needs to.
06:09
<&McMartin>
No do not thread the IO monad through your entire program dear god
06:09
< Tarinaky>
Hmm :/ Can't get SDL-2 to compile.
06:09
<&Derakon>
Heh.
06:09
<&Derakon>
That just maps back to "UI, please do the appropriate dispatching yourself" anyway.
06:09
<&Derakon>
I'm inclined to go with #1 at the moment, but I'm going to leave the decision for a time when I'm less tired.
06:11
<&McMartin>
Before you crash
06:11
<&McMartin>
How enterprisey are you planning on making this?
06:11
<&McMartin>
If you want it to be able to import UIs based on a config string, #2 is I believe the only one that will work without also needing evail()
06:11
<&McMartin>
eval(), rather
06:12
<&Derakon>
Well, Angband currently can be run in windowed mode, in a console, and on Android.
06:12
<&Derakon>
There's a separate UI layer for each, plus different ones for every operating system.
06:12
<&Derakon>
But the different OS ones could be unified by using Qt or wx or the like.
06:12
<&McMartin>
right
06:12
<&Derakon>
That still leaves "exotic" platforms, which is why I'm bothering with all this in the first place.
06:12
<&McMartin>
The thing is, different OSes also have different binaries so you can just hardcode the class.
06:13
<&Derakon>
Otherwise I'd just say "Maintain a good separation between engine and UI and have done with it."
06:13
<&McMartin>
If you're envisioning hardcoded classes per distribution unit then #1 is simplest
06:13
<&McMartin>
If you're envisioning people sticking alternate UI code in the python path and then sending in an argument for the new UI to use, that's a very very strong pointer towards method #2.
06:13
<&Derakon>
The idea is that you run e.g. "pyrel --use-console", and then Pyrel's init routine does "import gui; gui.setUIMode(gui.CONSOLE)".
06:14
<&Derakon>
Then whenever you interact with the gui package/module after that, it's automatically in a "console" context.
06:14
<&McMartin>
OK, so, hardcoded. #1 is probably the easiest.
06:14
<&Derakon>
Seemed like it to me, yeah.
06:14
<&Derakon>
And has minimal magic for people who don't understand the innards of Python.
06:15
<&Derakon>
Funny...all of my major game projects have had as a secondary goal "be non-threatening to people who want to get into programming by modifying this game."
06:15
<&Derakon>
Very likely that saves me a bunch of time in the process.
06:15
<&Derakon>
Or would, if I ever finished anything.
06:15
<&McMartin>
heh
06:24 Kindamoody is now known as Kindamoody|shower
06:31 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has joined #code
06:34 Derakon is now known as Derakon[AFK]
06:57 Kindamoody|shower is now known as Kindamoody|breakfast
07:02 celticminstrel [celticminst@Nightstar-05d23b97.cable.rogers.com] has quit [Client closed the connection]
07:03 celticminstrel [celticminst@Nightstar-05d23b97.cable.rogers.com] has joined #code
07:30 Kindamoody|breakfast is now known as Kindamoody
07:59 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
07:59 mode/#code [+o himi] by ChanServ
08:02 Kindamoody [Kindamoody@Nightstar-33f76d00.cust.tele2.se] has quit [[NS] Quit: See you lot later.]
08:31 celticminstrel [celticminst@Nightstar-05d23b97.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
09:16 Attilla [Obsolete@Nightstar-5fc5437d.as43234.net] has joined #code
09:45 You're now known as TheWatcher
10:31 RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
11:58 iospacedout is now known as iospace
12:16 Thalass [Thalass@C2A270.1179B7.313116.E4C444] has joined #code
12:17
< Thalass>
hello all.
12:17
< Thalass>
I have a question (run while you can) regarding motherboard drivers and linux.
12:18
<@TheWatcher>
Yis?
12:19
< Thalass>
I assumed thay the kernel would be able to handle all that, but the guy assembling my computer was worried, being a windows guy. I couldn't answer very well as i've never built a new computer for linux
12:19
< ShellNinja>
I've never had problems with Linux not recognizing motherboards.
12:19 Kindamoody|afk [Kindamoody@Nightstar-6cc1c5e7.cust.tele2.se] has joined #code
12:19 mode/#code [+o Kindamoody|afk] by ChanServ
12:20 Kindamoody|afk is now known as Kindamoody
12:20
< ShellNinja>
Hell, I've never had problems with Windows not recognizing motherboards.
12:20
< Thalass>
it's a newish mobo, and ubuntu 12.04 so i was just going to see what happens :p
12:20
< ShellNinja>
It'll probably work just fine. Ubuntu is one of the frequently updated distributions.
12:20
< Thalass>
good. I thought that would be the case. I guess this is a chance to show him the powah of linux haha
12:20 * Thalass nods
12:21
< Thalass>
Always good to get confirmation from those who know more
12:21
< ShellNinja>
No bets on ancillary things like wifi adapters.
12:21
<@TheWatcher>
Thal: do you know what the motherboard is?
12:21 * ShellNinja goes biking.
12:27
< Thalass>
Asus striker 2 extreme.
12:27
< Thalass>
I failed at google-fu when i had a look.
12:28
<@TheWatcher>
http://uk.asus.com/Motherboards/Intel_Socket_775/Striker_II_Extreme/ - that?
12:29
< Thalass>
i belive that's it
12:37
<@TheWatcher>
Near as I can tell, it should work - the kernel certainly has drivers for it all, although I'd be surprised if some of it worked (like the frequency led, vold led, possibly a few other minor things)
12:37
<@TheWatcher>
The major stuff should all be there, though
12:46
< rms>
What drivers does a motherboard /need/?
12:46 * rms assumed that mobos didn't need drivers
12:47
< rms>
In general though, only issue I have with drivers and modern Linux are the video drivers.
12:47
< rms>
Oh, and sound through HDMI
12:48
<@TheWatcher>
rms: you need to be able to talk to the northbridge to set up a bunch of things
12:51
<@TheWatcher>
But really, that stuff's pretty standard now - I was more checking that his PATA/SATA, audio, and network chipsets are supported.
12:53
< Thalass>
Ah champion. Thanks guys. :)
12:54
< RichyB>
Maybe I?C stuff for things like fan controllers? I don't think that there's a really well standardised "plug and pray" way of interacting with I?C devices on motherboards.
13:00
<@TheWatcher>
It's nforce based, and there's stuff for the MCP79s.
13:05 * TheWatcher vaguely stabs the person who decided bind_params() is 1-indexed
13:06
<@TheWatcher>
-s
13:13 Thalass|phone [Thalass@C2A270.1179B7.313116.E4C444] has joined #code
13:16
< Rhamphoryncus>
hmm I experimented with 1-based indexing at some point. It was just too jarring
13:16 Thalass [Thalass@C2A270.1179B7.313116.E4C444] has quit [Ping timeout: 121 seconds]
13:16
< Rhamphoryncus>
And modulo does work better with 0-based
13:16
< Rhamphoryncus>
otoh, I will often adjust to 1-based when printing
13:24 Kindamoody is now known as Kindamoody|afk
13:40
< Tarinaky>
F-me it's hot in here :/
13:44 celticminstrel [celticminst@Nightstar-05d23b97.cable.rogers.com] has joined #code
13:48
< Thalass|phone>
In this irc channel?
13:48
< Tarinaky>
This physical space.
13:48
< Tarinaky>
Also children outside are loud and I want to shoot them with a rifle.
13:48
< Thalass|phone>
i was going to say.
13:48
< Tarinaky>
I cannot close my window because otherwise I will catch fire.
13:55
< Thalass|phone>
Ah. It's even worse when they live with you haha
13:56
< Tarinaky>
I have two younger brothers to annoy me full time/
14:00
< Tarinaky>
There's someone outside trying to play some bloody brass instrument.
14:00
< Tarinaky>
Except all they can do is make a horrible sound.
14:00
< Tarinaky>
I wish they'd go somewhere else :/ There's a river nearby - maybe they could practice beneath its surface.
14:28 Thalass|phone [Thalass@C2A270.1179B7.313116.E4C444] has quit [[NS] Quit: homeward bound huzzah]
14:45 Kindamoody|afk [Kindamoody@Nightstar-6cc1c5e7.cust.tele2.se] has quit [[NS] Quit: Time to go home! Yay! :D ]
15:14 * TheWatcher hairpulls at this query generator
16:08 RichardB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
16:09 RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has quit [Ping timeout: 121 seconds]
17:14 RichardB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has quit [Connection reset by peer]
17:16 RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
18:07 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Hardware install]
18:18 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code
18:38 RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has quit [Connection closed]
18:39 RichyB [richardb@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
20:07 Kindamoody [Kindamoody@Nightstar-05577424.tbcn.telia.com] has joined #code
20:07 mode/#code [+o Kindamoody] by ChanServ
20:30 Kindamoody is now known as Kindamoody|gaming
20:50 Moltare [Moltare@583787.FF2A18.190FE2.4D81A1] has quit [Ping timeout: 121 seconds]
20:51 Moltare [Moltare@583787.FF2A18.190FE2.4D81A1] has joined #code
20:51 ShellNinja is now known as AnnoDomini
20:55 AnnoDomini is now known as AbuDhabi
21:01 AbuDhabi is now known as ShellNinja
21:25 Kindamoody|gaming is now known as Kindamoody[zZz]
21:27
< ShellNinja>
http://img.thedailywtf.com/images/12/q3/e24/Pic-5.jpg
23:04 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has quit [Client exited]
23:05 You're now known as TheWatcher[T-2]
23:08 You're now known as TheWatcher[zZzZ]
--- Log closed Sat Aug 11 00:00:28 2012
code logs -> 2012 -> Fri, 10 Aug 2012< code.20120809.log - code.20120811.log >

[ Latest log file ]