--- Log opened Wed Oct 18 00:00:03 2006 |
00:02 | <@ToxicFrog> | Epsilon? |
00:03 | < Janus> | The problem with testing by itself is that it's dependent of a lot of other things. (which, in this case, would be that it would have to have a way to receive input, draw it, create the actual 'attack' object, and send it to the stage to check it against other characters, and eventually interpret it.) It's a little more dependant than I'd like it, but there's very little I could do to split it up without sacrificing speed or convience.
|
00:03 | <@Vornicus> | http://chalain.livejournal.com/35404.html |
00:04 | <@Vornicus> | "epsilon" in mathematics means "vanishingly little" or "as little as possible" - for discrete things, like programming work or floating point numbers, it's "the smallest thing that you can talk about" |
00:07 | <@ToxicFrog> | YAGNI? |
00:07 | <@Vornicus> | You Ain't Gonna Need It - don't write code that you can't prove that you need for a feature you need /right now/ |
00:12 | <@Vornicus> | http://c2.com/cgi/wiki?YouArentGonnaNeedIt <--- |
00:14 | | Klaus is now known as Mischief |
00:15 | <@ToxicFrog> | Argh., |
00:15 | <@ToxicFrog> | I'm trying to figure out how Spellcast implements stuff like Shield without making two passes over the spell list. |
00:16 | <@ToxicFrog> | The answer appears to involve dark sacrifices to the blasphemous outer gods. |
00:16 | <@ToxicFrog> | Indeed, I'm no longer entirely sure it doesn't make two passes. |
00:16 | <@Vornicus> | Shield? |
00:16 | <@Vornicus> | er |
00:16 | <@ToxicFrog> | Protects the caster from physical attacks. |
00:16 | <@Vornicus> | why would that particular spell be problematic? |
00:16 | <@ToxicFrog> | The trick is, /all/ shield spells have to be processed before any physical attacks are made. |
00:17 | <@ToxicFrog> | Regardless of who cast them and how they were cast. |
00:17 | <@ToxicFrog> | Similarly stuff like Protection from Evil, etc. |
00:17 | <@ToxicFrog> | However, in principle, everything goes off simultaneously. |
00:18 | <@Vornicus> | Why not figure out the list of actions that are taken, and then figure out the order in which these happen, and then...? |
00:19 | <@ToxicFrog> | Right. That's two passes. One to build and sort the list, one to execute it. |
00:19 | <@ToxicFrog> | Which I didn't think it did. |
00:19 | <@Vornicus> | Considering the size of your list - eight casters at most, plus only a handful of summons per caster - I'd say that that would be the best option. |
00:19 | | * ToxicFrog is pondering a callback-oriented design for his spells when he finally goes ahead with Lspellcast. |
00:20 | <@ToxicFrog> | Eight is a totally arbitrary compile-time limit. |
00:20 | <@Vornicus> | well, okay. |
00:20 | <@ToxicFrog> | Lspellcast will be limited only by the size of your screen and the amount of available memory~ |
00:20 | <@Vornicus> | heh |
00:21 | | * Vornicus ponders Massively Multiplayer Spellcast. |
00:22 | <@ToxicFrog> | I've been pondering a sort of FPS-deathmatch-style playing mode where it's an ongoing game and people can join and leave at any time, with victory based on score rather than last man standing. |
00:22 | <@ToxicFrog> | Might be hard to balance, though. |
00:22 | <@Vornicus> | yes |
00:22 | <@ToxicFrog> | An MMO using Spellcast as the combat system would be interesting, but very slow-paced. |
00:22 | <@Vornicus> | what happens to summoned creatures when their controller - or their summoner - goes "Blarg! I am dead!" |
00:23 | <@ToxicFrog> | I don't remember. |
00:27 | <@ToxicFrog> | Hmm. I can't seem to find anything in the code for this. |
00:27 | <@Vornicus> | You're looking at the Plotkin code? |
00:27 | <@ToxicFrog> | Yes. |
00:27 | | Mischief [~34534@Nightstar-3282.ashbva.adelphia.net] has quit [Ping Timeout] |
00:28 | <@ToxicFrog> | Oh, hmm. |
00:28 | <@ToxicFrog> | If I remember the behaviour of the query subsystem correctly, it just stands around when it's controller is dead. |
00:29 | <@ToxicFrog> | My personal inclination would be to have it attack randomly if its controller is dead, and vanish if its summoner is dead. |
00:29 | <@ToxicFrog> | Well, maybe not the latter. It's not clear whether they're magical constructs, or teleported in from elsewhere. |
00:29 | <@Vornicus> | hmmm |
00:30 | <@ToxicFrog> | Anyways! Callback-based spells. |
00:30 | | * Vornicus obviously would need to see more design than he does to understand what's going on. |
00:31 | | The-Librarian [~user@ServicesAdmin.Nightstar.Net] has joined #code |
00:31 | < The-Librarian> | okay. |
00:31 | < The-Librarian> | this is nice. |
00:31 | < The-Librarian> | http://pastie.caboo.se/18229 |
00:31 | <@Vornicus> | WHat's nice? |
00:31 | <@ToxicFrog> | The idea is that a spell, when cast, registers callbacks to be called at certain times (start of turn, end of turn, spell execution, etc) with certain priorities, with the guarantee that a callback of priority P will be called before all callbacks with priority > P. |
00:31 | <@Vornicus> | mother of cheese |
00:31 | < The-Librarian> | that's a single line of ruby, and the SQL query it generates. |
00:31 | < The-Librarian> | it works perfectly. |
00:31 | <@ToxicFrog> | THERE IS NO GOD |
00:32 | | * Vornicus agrees with TF. |
00:32 | < Janus> | If you squint... you can see Jesus in it. |
00:32 | <@Vornicus> | The original rules seem to have gone missing. |
00:34 | <@ToxicFrog> | Anyways. Something like, say, Magic Missile, would register a callback in SpellExecution at low priority. When called, it inflicts damage and then destroys itself. |
00:35 | <@ToxicFrog> | Shield would register a callback at SpellExecution with high prority that sets the Shield flag, and one at TurnStart that unsets it, both of which remove themselves afterwards. |
00:35 | <@ToxicFrog> | Poison sets one at TurnStart that decrements the poison counter, killing the host when it hits 0. |
00:35 | <@ToxicFrog> | Etc. |
00:35 | <@ToxicFrog> | Sound reasonable? |
00:35 | <@Vornicus> | aha |
00:36 | < Janus> | ... that just gave me an idea. |
00:38 | <@ToxicFrog> | Hmm. Quandrary. |
00:39 | <@ToxicFrog> | Are spells responsible for checking flags that could interfere with themselves, or are interfering spells responsible for clearing or replacing the callbacks of spells they interfere with? |
00:39 | <@ToxicFrog> | They both have extensibility problems, so I'm leaning towards the former. |
00:40 | <@Vornicus> | ...I... don't know. |
00:40 | <@Vornicus> | I think that the former works better, sorta |
00:40 | <@ToxicFrog> | Yeah. |
00:40 | <@ToxicFrog> | The idea is, with the former it would be something like this: |
00:40 | <@ToxicFrog> | Shield |
00:41 | <@ToxicFrog> | OnSpellExecute: player.shielded = true; unlink |
00:41 | <@ToxicFrog> | OnTurnStart: player.shielded = false; unlink |
00:41 | <@ToxicFrog> | Missile |
00:42 | <@ToxicFrog> | OnSpellExecute: [if player.shielded]"The missile shatters on %s's shield!"[otherwise]"The missile strikes %s!"; %s->damage(1)[fi] unlink; |
00:42 | <@ToxicFrog> | Whereas the latter would have something like this in shield: |
00:43 | <@ToxicFrog> | ReplaceCallbacks(CB_MISSILE, function() display("The missile shatters on %s's shield!") unlink() end) |
00:43 | | * Vornicus ponders Spellcast in Inform 7. |
00:43 | <@ToxicFrog> | So, yeah, I think the former is superior. |
00:43 | <@ToxicFrog> | And doesn't have quite as many extensibility problems. |
00:43 | <@ToxicFrog> | ...an intruiging thought, but I7 doesn't have any multiplayer capabilities that I know of. |
00:44 | <@Vornicus> | sad but true. |
00:44 | <@ToxicFrog> | What we need is a MUD that supports extensions written in I7. |
00:44 | <@ToxicFrog> | ...SpellcastMUD. |
00:44 | <@ToxicFrog> | There's your Spellcast MMO, Vorn. |
00:44 | <@Vornicus> | heh |
00:44 | <@ToxicFrog> | And to avoid hangups, put, say, a 2-minute time limit on turns. |
00:45 | <@ToxicFrog> | Hmm. I'm going to have to play a few games of Spellcast to fix the behaviour in my mind. |
00:47 | <@ToxicFrog> | Augh! I must stop distracting myself and finish LuaSDL! |
00:47 | <@Vornicus> | heh |
00:51 | <@ToxicFrog> | Stuff that needs to be done: color and gamma related stuff, YUV overlays, events (barring mouse events, which are working fine), audio, timers. |
00:51 | <@Vornicus> | Arg. I feel like I've gotten little done today. |
00:52 | < Janus> | Alright, I've figured a simplier way to achieve this attack registration business, but I need to ask something first... would there be anyway to grant the initialization function of one class the ability to utilize the private members of another class? |
00:53 | <@Vornicus> | only through friend. |
00:53 | <@ToxicFrog> | Declare it a friend of that class and make them protected rather than private. |
00:53 | <@ToxicFrog> | But if you have to do this there's probably something wrong with your design. |
00:55 | <@Vornicus> | yeah |
00:55 | <@Vornicus> | Friends Smell. |
00:55 | < Janus> | Well... I'd want to simply have the character object create an attack object, giving it only that character's address, and the time when it was created, and send it to a linked list immediately. It will then see what input was made, what that input means to that character, and create the attack data from there. |
00:59 | < Janus> | It just seems like a waste to have to shove everything that would be needed through the initialization parameters, and I'd have to keep updating that parameter list everytime I decided to add some new facet or feature to that attack object. |
00:59 | <@Vornicus> | gnar. you wouldn't happen to ahve a sample combat sequence? |
00:59 | < Janus> | Um... code, or just an example? |
00:59 | <@Vornicus> | SHow me a sequence of events from a combat. |
01:00 | <@Vornicus> | Cloud jumps off the train, is charged by two Shin-ra guards. What happens then? |
01:04 | < Janus> | Well, Cloud would push the 'X' button, which would then create an attack object and send it into the Earth. Of course, since his sword weighs more than the state of Nebraska, the attack wouldn't have an effect immediately after the input was made. It would stay in the queue for a bit, until about a few seconds later. It would then be visible to the two soldiers, in that they could take the lovely gift if they were in range, and decid |
01:04 | < Janus> | e what to do with it, (in this case, die). The attack then destroys itself after a few milliseconds, rinse, repeat. |
01:04 | <@Vornicus> | Stop |
01:04 | | * Janus halts. |
01:04 | <@Vornicus> | YOu're thinking too deep. |
01:05 | <@Vornicus> | "Cloud attacks a guard. The guard takes damage." |
01:06 | <@McMartin> | Or, to abstract! |
01:06 | <@McMartin> | "Characters can attack one another. This causes damage to be inflicted." |
01:06 | <@Vornicus> | Yep. |
01:06 | <@Vornicus> | Okay. |
01:07 | < Janus> | Hmm... that's what it should look like. |
01:08 | | * Janus broke the character limit for nothin' |
01:08 | < Janus> | Alright... so I should be thinking simplier, right? |
01:09 | <@McMartin> | Don't think in implementation terms, at least. Your subconsciously-designed system may not be the best one. |
01:11 | < Janus> | So, the best path would be the one that resembles the end result the most, right? |
01:12 | <@McMartin> | That's not always true. |
01:12 | <@McMartin> | But never confuse what the code does for "what happens" |
01:12 | <@Vornicus> | The best path is to think at the topmost, most elementary level - what does the player see? |
01:13 | < Janus> | He hits a button, and his character swings. If that hits another character, that character get's hurt. |
01:13 | <@Vornicus> | And then instead of adding stuff to the list of things that happen, make it an outline. |
01:13 | <@Vornicus> | So 1. Cloud goes over and applies GBH to said guard. |
01:14 | <@Vornicus> | 2. guard recoils from the attack. |
01:14 | <@Vornicus> | and a number appears over the guard's head, etc. |
01:15 | < Janus> | And... just keep breaking that down, until it's at a level where it can be inplemented, right...? |
01:15 | <@Vornicus> | Yep. |
01:25 | < Janus> | ... Alright. I've broken it down. On the inplementation level, there wouldn't be an "attack" object created. The only thing the stage object (the Surroundings) should be doing, is deciding where things "are." |
01:25 | < Janus> | It shouldn't be doing anything more than that. |
01:26 | <@Vornicus> | ...you're either really, really fast, or you haven't really sat down and poked at it. |
01:26 | | ReivZzz is now known as Reiver |
01:27 | < Janus> | It's just musing, but I've backed everything up to retrofit it. |
01:27 | <@Vornicus> | Also |
01:27 | <@Vornicus> | Are you using source code control/ |
01:28 | < Janus> | Um... if I am, I don't know it-- |
01:28 | <@Vornicus> | Right. |
01:28 | <@ToxicFrog> | Quick, get him 3cc of Subversion! |
01:28 | <@Vornicus> | http://subversion.tigris.org/ |
01:29 | <@Vornicus> | Already on it, doctor. :P |
01:29 | < Janus> | I always wondered what that CVS thing was for. |
01:29 | <@Vornicus> | Install it. Make yourself a repository. Check all your stuff in to the repository. |
01:30 | <@Vornicus> | Before starting a task, do an svn update. |
01:30 | <@Vornicus> | after completing the task, do svn commit. |
01:31 | | The-Librarian is now known as The-Librarian-Away |
01:32 | < Janus> | Eheh... if there's one thing I have trouble with, it's installing new things~ |
01:33 | < Janus> | It's a miracle I managed to get SDL and Ming32 ready. |
01:38 | | * Janus notes how the readme file overestimates his knowledge of where things go. |
01:38 | <@ToxicFrog> | It's probably easier on Linux. |
01:40 | | * Janus questions this. |
01:41 | | The-Librarian-Away is now known as The-Librarian |
01:41 | <@ToxicFrog> | Well, on Linux: |
01:41 | <@ToxicFrog> | # yum install subversion |
01:42 | <@ToxicFrog> | # mkdir /var/svn |
01:42 | <@ToxicFrog> | # svnserve -r /var/svn -d |
01:42 | <@ToxicFrog> | And done. |
01:42 | < Janus> | Anything that requires the opening of Ming32's shell is typically a few kilometers above my head, if my failed attempts to install SDL's gfx library, or MPEG, or STL. |
01:42 | < Janus> | --say anything for themselves. |
01:42 | <@ToxicFrog> | The shell is made of love and kittens. |
01:43 | <@McMartin> | Well, that's specifically Fedora |
01:43 | <@McMartin> | That first command may vary by distro |
01:44 | <@ToxicFrog> | True. |
01:44 | <@ToxicFrog> | ...oh, and I left out configuring access to it. |
01:44 | <@ToxicFrog> | But it's still quite simple. |
01:44 | < Janus> | Before that though... where on earth do you plop this thing? |
01:45 | <@ToxicFrog> | On windows? No idea. |
01:45 | | * Janus should probably know this by now... but alas-- |
01:45 | < Janus> | I'm guessing... you just toss all those files in the same folder as Dev-C++ is, right? |
01:46 | <@ToxicFrog> | ...since Subversion is in a fact a completely seperate program I'm guessing not. |
01:48 | <@ToxicFrog> | But, I haven't used DevC++, nor have I ever used the windows build of svn, so maybe it'll work. |
01:48 | < Janus> | Sorry if I'm a bit dumb on the technical ... uh... things, but I'll see what I can poke out of it. |
01:50 | <@McMartin> | TW uses DevC++ at least on occasion, I believe. |
01:50 | < Janus> | DevC++ is a beta, so I probably shouldn't trust it's CVS too much, right..? |
01:51 | <@ToxicFrog> | (to be perfectly honest, I find it deeply irritating when programmers do not understand how to effectively use the system they're programming on, but I don't hold it against you.) |
01:52 | < Janus> | (Quite alright, I don't really consider myself a full-fledged programmer yet anyway~) |
01:53 | <@Vornicus> | qwuitting time,. |
01:54 | | Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has quit [Quit: ] |
01:59 | <@ToxicFrog> | For the Slwwp |
02:02 | <@McMartin> | CVS is a pretty well-established protocol, for the record |
02:18 | < Janus> | Well... it seems all it took was two MS-Dos commands to install it... |
02:19 | <@ToxicFrog> | (1) You aren't using DOS. Be grateful. |
02:19 | <@ToxicFrog> | (2) If you're in mingw, you aren't even using the DOS shell. Be extra grateful. |
02:21 | <@McMartin> | I tend to think of MinGW just being the .dll. |
02:21 | <@McMartin> | Does it have cygwin-alikes? |
02:22 | <@ToxicFrog> | Well, MSYS. |
02:22 | <@ToxicFrog> | MinGW is just the headers and libraries. |
02:22 | <@ToxicFrog> | MSYS is a port of bash, make, and some other basic tools (basically, what you need to run ./configure && make for programs with no special library or tool dependencies) linked against MinGW. |
02:23 | <@ToxicFrog> | Much more limited than Cygwin but generates windows native binaries all the time. |
02:23 | <@ToxicFrog> | ...no, I lie. MinGW includes some of the tools, like gcc. |
02:23 | <@ToxicFrog> | MSYS includes the rest of the tools, the shell, the environment variables, rxvt, and so forth. |
02:42 | | The-Librarian is now known as NSGuest-484 |
02:42 | < Janus> | Embarressing... |
02:42 | | NSGuest-484 is now known as The-Librarian |
02:56 | | Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: Jouets de Dieu, jouets de jouets, et les jouets de me, fait naƮtre Clair voire.] |
03:12 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Killed (NickServ (GHOST command used by Forjeh))] |
03:14 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code |
03:50 | | The-Librarian is now known as The-Librarian-Away |
04:04 | | Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #Code |
04:16 | | Vornicus-Latens is now known as Vornicus |
04:27 | | Chalcedon is now known as ChalcyWork |
04:32 | | ChalcyWork [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout] |
04:32 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code |
04:32 | | mode/#code [+o Chalcedon] by ChanServ |
04:55 | | The-Librarian-Away is now known as The-Librarian |
05:03 | | Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: huu-- huu-- huhee~ if mums the word, then you're a bird] |
05:50 | | Ev3 [~Shemhazai@Nightstar-8502.ds1-ba.adsl.cybercity.dk] has quit [Ping Timeout] |
05:50 | | Ev3 [~Shemhazai@Nightstar-8502.ds1-ba.adsl.cybercity.dk] has joined #Code |
05:55 | | The-Librarian is now known as The-Librarian-Away |
06:01 | | Thaqui is now known as ThaquiWorx |
06:03 | | Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code |
06:03 | | mode/#code [+o Chalcy] by ChanServ |
06:04 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout] |
06:05 | | Chalcy is now known as Chalcedon |
06:16 | | mode/#code [+oooooo Ev3 EvilDarkLord Mahal McMartin Myst Raif] by Reiver |
06:17 | | mode/#code [+oooooo Reiver Syloqs-AFH ThaquiWorx The-Librarian-Away TheWatcher[zZzZ] ToxicFrog] by Reiver |
06:37 | | The-Librarian-Away [~user@ServicesAdmin.Nightstar.Net] has quit [Quit: Client Exiting] |
06:49 | | You're now known as TheWatcher |
07:20 | | Vornicus is now known as Vornicus-Latens |
07:24 | | * Reiver gets on with the code fragments he has been assigned to write. |
07:25 | <@Reiver> | TW! |
07:25 | | * Reiver greets. |
07:33 | <@TheWatcher> | Reiver! hello |
07:34 | <@Reiver> | TW! I am trying to implement your code. |
07:34 | <@Reiver> | I am not meant to be doing so, but I wish to make life complicated for myself. |
07:34 | <@Reiver> | And my soul would cry piteously if I did not do so. |
07:35 | <@Reiver> | Your code is making me a bit puzzled, however. |
07:35 | <@Reiver> | Are you up for, um, advising on it? |
07:37 | <@TheWatcher> | Provided you don't mind longish responses |
07:37 | <@TheWatcher> | (response time that is, not lenght) |
07:41 | <@Reiver> | NP. |
07:57 | <@Reiver> | ...Remind me how one gets multiple Actionperformed events. I need inner classes or something, don't I? |
08:02 | <@TheWatcher> | uh, what do you mean 'multiple Actionperformed events'? Do something different for different actionlisteners? Then the easiest wya is anonymous inner classes, yes |
08:03 | <@Reiver> | Er. |
08:03 | <@Reiver> | ActionListener thingies. |
08:04 | <@Reiver> | Yeah. |
08:04 | <@Reiver> | Right, thanks. |
08:14 | <@Reiver> | ...Does anyone know if it's possible to hack a JList so it displays multiple lines? And if not, if there is another almost_as_easy solution other than handwriting ones own listbox? |
08:14 | <@Reiver> | (Putting /n into a listbox's text doesn't do it.) |
08:19 | <@McMartin> | Reiver: Is there a JListBox? |
08:19 | <@TheWatcher> | eugh, I have to go, i'm sorry. If you haven't solved it when I get to work, we can talk then |
08:20 | | You're now known as TheWatcher[afk] |
08:23 | <@Reiver> | McM: Not finding one... |
08:24 | <@McMartin> | Mmm |
08:26 | | * Reiver frowns, pokes at it. |
08:27 | | * Reiver tries an esperiment! Because he can. |
08:28 | <@McMartin> | It looks like the only way to do Weird Stuff with lists is to mess with ListCellRenderer classes, which is probably More Work Than It's Worth. |
08:28 | <@Reiver> | Hrm. |
08:28 | <@Reiver> | It is a shame, because I want a box, with a list inside it of appointments. |
08:28 | <@Reiver> | I was just sorta hoping to have the information for each Appointment displayed on two lines. |
08:29 | <@McMartin> | Does it have to be a List? Or can it be a scrollable Panel full of JLabels? |
08:30 | <@Reiver> | It can be the latter, so long as you can also select one of the Panels by clicking on it. |
08:30 | <@Reiver> | ...Which is basically a List, right there. >.> |
08:31 | <@McMartin> | Yeah. Hm. |
08:31 | <@Reiver> | I have been reccomended to favor the simplest solution possible, so |
08:31 | <@McMartin> | Yeah |
08:31 | <@McMartin> | If internal <br>s don't work, I'd say "screw it" |
08:31 | <@McMartin> | Listboxes typically *don't* have multiline implementations, after all |
08:32 | <@McMartin> | ... UNLESS |
08:32 | <@McMartin> | You made each line its own entry and force selecting/deselecting one to do the same to its neighbor |
08:32 | <@Reiver> | Hrm. |
08:34 | <@McMartin> | I'd say "start with single-line, though, until you get everything else working" |
08:34 | | * Reiver pauses, eyes something. |
08:34 | <@Reiver> | Heeey. |
08:34 | <@Reiver> | JList can store an Object, not strictly a String. |
08:34 | | * Reiver wonders if he can't try sticking JLabels into it. |
08:35 | <@McMartin> | I believe you have to be careful there, as that's where you run into the need for custom cell rendering... |
08:36 | | * Reiver giggles at the output. |
08:36 | <@Reiver> | Well, it rendered the cell, alright. |
08:36 | <@Reiver> | Just, uh |
08:36 | <@Reiver> | Not terribly usefully. ^.^ |
08:37 | <@Reiver> | maximumsize=;minimumsize=;defaulticon=;disabledicon=;etc |
08:37 | <@Reiver> | >.> |
08:38 | | * Reiver also pokes at his constructors for the Appointment. |
08:38 | <@McMartin> | Object.toString(). |
08:40 | <@Reiver> | Type mismatch. Interesting. |
08:41 | | * Reiver casts that crazed idea aside for the moment. |
08:46 | <@Reiver> | ...What. |
08:46 | | * Reiver tries to think. |
08:46 | <@Reiver> | I have an arrayList of ApptCalendars. |
08:47 | <@Reiver> | ApptCalendars require a string in their constructor to form their name. This is okay. |
08:47 | <@Reiver> | calendarList.add("Calendar name!"); is wrong, what is the dumb mistake I've managed? >.> |
08:48 | <@McMartin> | calendarList.add(new ApptCalendar("Calendar name!")); is what you want. |
08:48 | <@Reiver> | Ah! Of course. Thank you. |
08:48 | <@McMartin> | I'm surprised the compiler didn't catch that |
08:49 | <@Reiver> | Just said it was illegal. |
08:49 | <@Reiver> | Which is fair, but |
08:50 | <@McMartin> | Yes, I'd expect "Expected ApptCalendar, found String" or something |
08:51 | <@Reiver> | Ah. |
08:51 | | * Reiver wonders why he's being so dense about ArrayLists this evening. |
08:51 | | * Reiver looks them up in the textbook. |
08:51 | <@McMartin> | Look up Lists in general, I'd think |
08:52 | <@Reiver> | ArrayLists were covered early on, and dealt with specifically. |
08:53 | <@Reiver> | Later on in the course it was then noted that "These are just one kind of List, here are the others and these are their quirks compared to ArrayLists. Everything else is pretty much standard." |
08:58 | <@Reiver> | ...Okay. Er. I've hit a minor stupidity. |
08:58 | <@Reiver> | I have an .addAppointment() method for my ApptCalendar class. |
08:58 | <@Reiver> | It's purpose is, oddly enough, to create a new Appointment. |
08:59 | <@Reiver> | Appointment has eight different constructors, to deal with the variable nature of the information that may be added. |
08:59 | <@Reiver> | Um... how does one rig the Method to deal with this? |
08:59 | <@McMartin> | Have it take an Appointment as its argument? |
09:00 | <@McMartin> | Then .addAppointment(new Appointment(...)); |
09:00 | <@Reiver> | ...I had not thought of that. |
09:00 | <@Reiver> | (Also Appointment(...) is psuedocode?) |
09:00 | <@McMartin> | It's a handy technique. |
09:01 | <@McMartin> | "..." being whatever arguments you needed. |
09:01 | | * Reiver frowns. Right. |
09:02 | | * Reiver looks up how to deal with this, has a suspicion he didn't really need all those constructors because it'll be the method creating the appointment that will be defaulting all the variables. |
09:03 | <@McMartin> | That's one of the other reasons to start at the top and work down~ |
09:03 | <@Reiver> | You're probably right. |
09:03 | <@McMartin> | This way, though, you don't have to worry about it. Whatever you need, it's there already |
09:03 | <@Reiver> | Ah. Point. |
09:03 | | * Reiver ponders. |
09:04 | <@McMartin> | That's why there are competing schools of thought. |
09:04 | <@Reiver> | The all-constructors thing seemed a better OO way of doing things. |
09:05 | <@Reiver> | But it's not as practical when calling methods to create those Appointments, because unless you want 8 methods, you can't just tell it to accept whatever constructors were given... |
09:05 | <@Reiver> | (Unless I've missed a clever trick, of course, but.) |
09:06 | | * Reiver also belatedly realises the inherent ohshit of using GregorianCalendar objects to store time values. |
09:06 | | * Reiver thus goes searching the API for the formatting conversion thingies. |
09:16 | <@Reiver> | Oh, right. GregorianCalendar has them, I'm just... |
09:17 | <@Reiver> | GregorianCalendar time = new GregorianCalendar(); |
09:17 | <@Reiver> | return time + GregorianCalendar.MINUTE gives an error. As does time.MINUTE. |
09:18 | <@McMartin> | You can't use arithmetic on Objects, remember? |
09:18 | <@McMartin> | There's some kind of add or advanceTime method. |
09:18 | <@Reiver> | So... how does one add a minute to current time? |
09:18 | <@Reiver> | Oh. |
09:18 | | * Reiver looks harder, apologises for stupid question. >.> |
09:29 | <@McMartin> | It is 0130. I should probably shower and sleep. |
09:30 | | Mahal [~Mahal@Nightstar-11770.worldnet.co.nz] has quit [Quit: It's hard to be mad at someone who misses you while you're asleep. ] |
09:31 | <@Reiver> | Rest well, McM. |
09:33 | <@Reiver> | ...How the seven hells. |
09:33 | <@Reiver> | ...Oh, duh. |
09:33 | | * EvilDarkLord takes over as consultant? :) |
09:33 | <@Reiver> | Hehe. Whups. |
09:44 | | You're now known as TheWatcher[wr0k] |
09:54 | | M4Ry4w [~m4ry4w@Nightstar-26985.adsl.wanadoo.nl] has joined #Code |
09:58 | | M4Ry4w [~m4ry4w@Nightstar-26985.adsl.wanadoo.nl] has quit [Quit: error 21] |
10:00 | | Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code |
10:00 | | mode/#code [+o Chalcy] by ChanServ |
10:00 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Killed (NickServ (GHOST command used by Chalcy))] |
10:00 | | Chalcy is now known as Chalcedon |
10:05 | | Chalcedon is now known as ChalcyZzz |
10:47 | | EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout] |
10:59 | <@Reiver> | ...How would one take strings out of an ArrayList and put them into a simple Array? |
10:59 | | EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code |
10:59 | <@Reiver> | ...How would one take strings out of an ArrayList and put them into a simple Array? |
11:02 | <@TheWatcher[wr0k]> | does it still have the .toArray() method? |
11:02 | <@Reiver> | Ooh. No idea. |
11:02 | | * Reiver looks it up. |
11:03 | <@TheWatcher[wr0k]> | seems to |
11:03 | <@Reiver> | hrm |
11:03 | <@Reiver> | So... |
11:04 | | * Reiver tries Appointment.getShortDesc.ToArray()? |
11:04 | <@Reiver> | No, Appointment.getShortDesc().ToArray()... |
11:05 | <@Reiver> | Guess not. Hrm. |
11:06 | <@TheWatcher[wr0k]> | un, lowercase t |
11:06 | <@Reiver> | Still not. |
11:06 | <@Reiver> | ...Oh, /obviously/ not. |
11:06 | <@Reiver> | Trying to call... hrm... |
11:06 | <@TheWatcher[wr0k]> | and that only works if getShortDesc() gives you an ArrayList object..,. |
11:06 | <@Reiver> | It doesn't! |
11:06 | <@Reiver> | It gives a string. |
11:07 | <@Reiver> | Because I'm trying to construct an Array of strings /out/ of an ArrayList of objects that have a method that returns a string. >.> |
11:07 | <@TheWatcher[wr0k]> | Right, you can't directly |
11:07 | <@TheWatcher[wr0k]> | You'll need to loop over it and manually add items to the array then |
11:07 | <@TheWatcher[wr0k]> | so |
11:08 | <@TheWatcher[wr0k]> | allocate an array the same length as the arraylist |
11:08 | <@TheWatcher[wr0k]> | i = 0 |
11:08 | <@TheWatcher[wr0k]> | for(eahc item in the array list) { |
11:08 | <@TheWatcher[wr0k]> | array[i++] = item.getShortDesc() |
11:08 | <@TheWatcher[wr0k]> | } |
11:10 | <@Reiver> | ...Wouldn't that have a fencepost error? You have i++ inside the array referencing. |
11:10 | | * TheWatcher[wr0k] tries to remember if Java will let you do 'String[] foo = new String[itemcount]' |
11:10 | | * Reiver tries. |
11:11 | <@TheWatcher[wr0k]> | (where itemcount is your apparray.size()) |
11:11 | <@Reiver> | Does. |
11:12 | <@TheWatcher[wr0k]> | Right |
11:13 | <@Reiver> | You sure array[i++] is right? |
11:13 | <@Reiver> | It seems a bit odd to iterate /as/ you call it. |
11:14 | <@TheWatcher[wr0k]> | yup |
11:14 | <@TheWatcher[wr0k]> | that's equivalent to |
11:14 | | ThaquiWorx is now known as Thaqui |
11:14 | <@TheWatcher[wr0k]> | array[i] = ... ; i++; |
11:15 | <@TheWatcher[wr0k]> | the increment is done after i is used, so the first array[i++] puts whatever into array[0] and increments i to one, then the next one puts the item into array[1] and increments i to 2 and so on |
11:19 | <@TheWatcher[wr0k]> | (actually, that might be slightly inaccurate - I'm not sure how java does postincrements internally. Some languages will make a copy of the variable, increment the variable and use the copy for the operation, which is why ++i is more efficient that i++ in some languages) |
11:19 | <@Reiver> | Sneaky. |
11:19 | <@Reiver> | Um. |
11:19 | <@Reiver> | Hrm. |
11:19 | <@TheWatcher[wr0k]> | (but you are guaranteed that the number in the [] is the number before th eincrement, regardless of what happens behind the scenes) |
11:23 | | * Reiver nod. |
11:26 | | * Reiver gragr! |
11:26 | | * Reiver stab int main! |
11:26 | | * Reiver stab *static main! |
11:27 | | * Reiver makes a different bloody class off to one side with main in it, because whatever class has that in it, is bloody well useless. ¬¬ |
11:27 | <@TheWatcher[wr0k]> | running into the "can't call this method from a static?" |
11:27 | <@Reiver> | Yes. |
11:27 | | * TheWatcher[wr0k] nods |
11:27 | <@Reiver> | Because having a static method makes the whole class static, apparently. |
11:28 | <@Reiver> | Which is somewhat irritating. ¬¬ |
11:28 | <@TheWatcher[wr0k]> | Nope, but it does mean you can't use it how you expect |
11:28 | | * Reiver suddenly understands why so many Java programs have, um. |
11:28 | <@Reiver> | public static void main(string[] args) { |
11:28 | <@Reiver> | SomeOtherClass.go(); |
11:28 | <@Reiver> | } |
11:29 | <@Reiver> | As their main method. ¬¬ |
11:29 | <@Reiver> | (With a new and a thingy and a shut up you get the idea.) |
11:29 | <@TheWatcher[wr0k]> | Actually |
11:29 | <@TheWatcher[wr0k]> | you don't need it in another class |
11:29 | < EvilDarkLord> | Aye. You can just use a method from the same class. |
11:29 | <@Reiver> | Nein |
11:29 | <@TheWatcher[wr0k]> | For example, in that UserGui code you sent me? I just did |
11:30 | <@Reiver> | ...Hrm |
11:30 | <@TheWatcher[wr0k]> | public static void main(String[] args) { |
11:30 | <@TheWatcher[wr0k]> | javax.swing.SwingUtilities.invokeLater(new Runnable() { |
11:30 | <@TheWatcher[wr0k]> | public void run() { |
11:30 | <@TheWatcher[wr0k]> | UserGui mi = new UserGui(); |
11:30 | <@TheWatcher[wr0k]> | mi.go(); |
11:30 | <@TheWatcher[wr0k]> | } |
11:30 | <@TheWatcher[wr0k]> | }); |
11:30 | <@TheWatcher[wr0k]> | } |
11:31 | <@TheWatcher[wr0k]> | So you create an instance of the class the main is in, then call the method that does what you want on that. |
11:31 | <@Reiver> | ...Oh. |
11:31 | <@TheWatcher[wr0k]> | working in lovecraft references is optional |
11:31 | <@Reiver> | I need to create the instance first. |
11:31 | <@Reiver> | Um. |
11:31 | <@Reiver> | So the class itself hasn't actually been created yet, merely the main method is running anyway? >.> |
11:31 | <@TheWatcher[wr0k]> | Correct |
11:32 | <@TheWatcher[wr0k]> | Well, an instance of the class hasn't been created yet |
11:32 | <@Reiver> | ...Can the Main Method call a new object? Er. This seems somewhat madness. >.> |
11:33 | <@TheWatcher[wr0k]> | when java loads your class it looks for a static main method - that exists as part of the class, not as part of an instance of it, so as soon as it is loaded it is accessible. that static method can then create an instance of the class to call any instance methods |
11:34 | <@Reiver> | Madness. |
11:34 | <@TheWatcher[wr0k]> | It is somewhat counterintuitive |
11:35 | | * Reiver now tries to recall how the hell you get the reference to show up in a class. |
11:35 | <@Reiver> | I just created a CalanderManager object called cManager. Remind me how I reference it from other classes/objects? |
11:37 | <@TheWatcher[wr0k]> | Uh, it depends how you created it. If you created it as a static variable, then you can use NameOfClass.cMananger otherwise you'll need to pass the reference to the methods in other objects that use it |
11:40 | | * EvilDarkLord tries to get his silly mysql to start with logging on. |
11:41 | | * EvilDarkLord success. |
11:42 | <@Reiver> | A static variable is one of which there can be only one, yes? |
11:42 | <@Reiver> | But they can't reference other objects? Or is that final... |
11:53 | < EvilDarkLord> | To the second question, I think so. |
11:54 | < EvilDarkLord> | As I have had a lot of grief in the past with statics and non-statics butting heads. |
11:57 | <@Reiver> | Woe. |
11:57 | | * Reiver tries to think how to sort this. |
11:57 | < EvilDarkLord> | But uh, where are you using statics? |
11:58 | <@Reiver> | I'm not, other than the main. |
11:58 | <@Reiver> | I'd kind /like/ to |
11:58 | <@Reiver> | But it's not really very usable. |
11:58 | <@Reiver> | So, not doing so. |
11:58 | < EvilDarkLord> | Hokay. |
11:59 | | * EvilDarkLord fiddles. |
12:01 | <@TheWatcher[wr0k]> | Reiver: a static variable is shared between all instances of the class, and can be accesed from outside the class without going through an instance. a static final is similar except it also can not be changed |
12:02 | <@Reiver> | Right. Fair enough. |
12:02 | | * Reiver tries to think how he's going to get CalanderManager talking to the GUI. |
12:04 | < EvilDarkLord> | TW: If you have experience using SciTE, question. Can I get it to open all files in a new tab, not just the ones opened from inside the program? |
12:05 | <@TheWatcher[wr0k]> | alas, I have to experience with it - I use emacs for all my text wrangling |
12:05 | <@TheWatcher[wr0k]> | *no |
12:24 | | Thaqui [~Thaqui@Nightstar-8486.adsl.xtra.co.nz] has quit [Quit: Leaving] |
12:25 | | * Reiver wish to collapse. |
12:25 | | * Reiver is close, but cannot get his head around the OO side of things enough to get it to /work/, sigh. |
12:26 | | * Reiver tries to think. |
12:26 | <@Reiver> | To get it to work, we need... um... |
12:26 | | * Reiver finds it's not the OO, it's thta he really just needs to go to bed. >.> |
12:26 | <@Reiver> | Hrm. |
12:26 | <@Reiver> | How do you access a single whatsit out of an ArrayList again? |
12:26 | <@Reiver> | .get(0) is the first one, or .get(1)? |
12:27 | <@TheWatcher[wr0k]> | 0 |
12:27 | <@TheWatcher[wr0k]> | everything is zero-indexed |
12:27 | | * TheWatcher[wr0k] notes that this is, in his opinion, one of the failings of OO when it comes to GUIs - it makes sense to make the interface based on oo principles, it makes sense to make bits of program the same, but connecting the two up... eugh |
12:30 | | * Reiver nods. |
12:32 | | Thaqui [~Thaqui@Nightstar-8486.adsl.xtra.co.nz] has joined #code |
12:33 | < EvilDarkLord> | Did you get additional time for this, Reiv? |
12:37 | <@Reiver> | Yes. |
12:37 | <@Reiver> | I have until friday. |
12:37 | <@Reiver> | Which is not all that long. |
12:37 | <@Reiver> | But... |
12:37 | <@Reiver> | I'm going to go to bed anyway, I think, because I Have no idea where I've gone wrong. |
12:37 | <@Reiver> | It's a stupid error. |
12:37 | <@Reiver> | But I can't see it. |
12:38 | <@TheWatcher[wr0k]> | sleep is good. If you want, also feel free to send code to me and I can eyeball it |
12:41 | | * Reiver has sent it. |
12:41 | <@Reiver> | If you spot a glaring error in, like, the next 20 minutes, lemme know? >.> |
12:41 | <@Reiver> | (This is assuming you check in the next 20 minutes. This is optional.) |
12:41 | | * TheWatcher[wr0k] pokepokes his mailswerver |
12:46 | <@TheWatcher[wr0k]> | Yoou have't called file.loadCalendars() before calling file.getCalendar(), so calendarList.get is falling over because there are no calendars in the list |
12:53 | <@Reiver> | Whoops! |
12:53 | <@Reiver> | Hrm. |
12:53 | <@Reiver> | Wait. |
12:53 | <@Reiver> | I haven't? |
12:54 | < EvilDarkLord> | Um. Would you mind sending the code to me as well? |
12:54 | | * Reiver pokes at the code. |
12:54 | <@Reiver> | loadCalendars() runs before I execute the gui. |
12:54 | <@Reiver> | ...Right? |
12:55 | <@TheWatcher[wr0k]> | yes, on a different object |
12:55 | <@Reiver> | ... |
12:55 | <@Reiver> | Oh. |
12:55 | <@Reiver> | Bad thing. |
12:55 | <@TheWatcher[wr0k]> | the file object you create in CalendarManager is different from the one you create in UserGui |
12:55 | <@Reiver> | Hehehe. Yes. |
12:55 | <@Reiver> | Er. |
12:56 | <@Reiver> | But the GUI is trying to load the file.get, isn't it? |
12:56 | <@TheWatcher[wr0k]> | on a different file object |
12:56 | <@TheWatcher[wr0k]> | they have the same name, but they're different instances of the FileHandler class. |
12:56 | <@Reiver> | ...Right. |
12:56 | <@Reiver> | Hrm. Yes. I see your point. |
12:57 | <@TheWatcher[wr0k]> | one option is to pass the file object in CalendarManager into gui.go()~ |
12:57 | <@Reiver> | It runs! |
12:58 | <@Reiver> | Good lord, it's even almost vaugely readable! |
12:58 | | * Reiver makes a note to see if he can't find a smaller timestamp though. >.> |
12:59 | <@Reiver> | That's under... format class or something, innit. |
12:59 | <@TheWatcher[wr0k]> | DateFormat will give you different date strings |
13:00 | <@Reiver> | woo! |
13:02 | | * Reiver eyes it, actually. |
13:02 | <@Reiver> | Buh? |
13:03 | <@Reiver> | That seems a very messy way of doing things. |
13:03 | | * Reiver tries to get his head around the syntax. If he manages that, he'll be most of the way there... |
13:07 | | * EvilDarkLord poke Reiv. Would you send me the source as well for perusal before SLEP hits? |
13:07 | <@Reiver> | @? |
13:08 | < EvilDarkLord> | jonaslehtonen@gmail.com |
13:08 | <@TheWatcher[wr0k]> | Welcome to Java: Overcomplicating the most simple operations since 1996 |
13:09 | <@Reiver> | TW: ... I have no idea how you get this class to work. |
13:09 | | * EvilDarkLord goes to download the JDE. |
13:09 | <@Reiver> | I swear it's not working in the normal way. |
13:09 | <@Reiver> | No constructors or nothing. |
13:09 | | * Reiver shakes his head, is a bit mystified. Whatever happened to standards? |
13:10 | <@TheWatcher[wr0k]> | Erk, have a look at SimpleDateFormat |
13:10 | <@TheWatcher[wr0k]> | sorry, should have told you the subclass. |
13:10 | <@Reiver> | ...Irony... |
13:11 | <@TheWatcher[wr0k]> | (oh yes) |
13:12 | <@TheWatcher[wr0k]> | Java: two entire classes, couple of dozen methods. c: strftime() |
13:12 | | * TheWatcher[wr0k] eyerolls |
13:15 | <@Reiver> | SimpleDateFormat format = new SimpleDateFormat(hh:mma) ? |
13:15 | <@Reiver> | +; |
13:16 | <@Reiver> | Followed by, er. |
13:16 | <@TheWatcher[wr0k]> | ... new SimpleDateFormat("hh:mma"), yes |
13:16 | <@Reiver> | ('format' was a bad choice but I shall press on) |
13:16 | <@Reiver> | return format.format(startTime); or the like. |
13:17 | <@TheWatcher[wr0k]> | String textDate = format.format(apptDate); |
13:17 | <@Reiver> | Right! |
13:17 | <@Reiver> | Thank you. |
13:17 | <@TheWatcher[wr0k]> | where apptDate is the Date object for the appointment |
13:17 | | * Reiver jsut wanted to check. It was a bit odd. |
13:18 | <@TheWatcher[wr0k]> | yeah, format(Date date) is in DateFormat rather than SimpleDateFormat (which onyl shows format(Date date, StringBuffer toAppendTo, FieldPosition pos)), so it's a bit confusing |
13:18 | | * Reiver nods. |
13:18 | <@Reiver> | It is very odd, yes. |
13:29 | <@Reiver> | WOO! |
13:29 | <@Reiver> | I have half-handsome codes! |
13:30 | <@Reiver> | This makes me proud. |
13:30 | <@Reiver> | Or possibly insane. |
13:30 | <@Reiver> | We shall see! |
13:30 | | Reiver is now known as ReivZzz |
13:32 | < EvilDarkLord> | Nini. |
13:34 | <@ReivZzz> | ni! |
13:34 | | * ReivZzz collapse. |
13:46 | | ReivZzz is now known as ReivSLEP |
14:49 | | ChalcyZzz [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout] |
15:38 | | * ToxicFrog flails |
15:38 | | * EvilDarkLord maces. |
15:39 | | * TheWatcher[wr0k] morningstars |
15:39 | <@jerith> | So, Java. |
15:39 | <@jerith> | WTF is "NodeList" not iterable? |
15:39 | | * EvilDarkLord flees. |
15:39 | | * jerith ponders blogging his solution. |
15:40 | <@ToxicFrog> | I am having trouble with my lovely thread-based solution ;.; |
15:40 | <@jerith> | Heh. It's general enough and small enough that it shouldn't be a problem. |
15:40 | <@jerith> | TF: Such is the nature of threads. |
15:40 | <@TheWatcher[wr0k]> | jerith: because Java is full of spiders |
15:40 | <@ToxicFrog> | jerith: sockets, actually. |
15:41 | <@jerith> | Sockets should be fairly simple. |
15:41 | <@TheWatcher[wr0k]> | And now! Away. |
15:41 | | You're now known as TheWatcher[afk] |
15:41 | <@ToxicFrog> | The problem is coordinating between arbitrarily large numbers of sockets /and/ the controlling thread. |
15:42 | <@jerith> | Ah. |
15:42 | <@ToxicFrog> | Assigning two threads to each socket (a reader and a writer) handles this nicely without having to mess about with poll/select or O_NONBLOCK. |
15:42 | <@jerith> | So back to the threads. :-) |
15:42 | <@jerith> | That should be moderately simple, though. |
15:43 | <@ToxicFrog> | However, this means that when you get a PJOIN or SJOIN message, it has to actually create and place a client object with those threads before handling it, or there's no way to send a reply. |
15:43 | <@jerith> | Unless sockets don't like to be shared? |
15:43 | <@ToxicFrog> | That I'm not actually sure about! |
15:43 | <@jerith> | Which socket library? |
15:43 | <@jerith> | Which thread library? |
15:44 | <@ToxicFrog> | On Linux, Berkely sockets and pthreads. |
15:44 | <@ToxicFrog> | On windows, whatever the bsocket/pthread APIs in mingw map to under the hood. |
15:45 | <@jerith> | Hmm... |
15:45 | <@ToxicFrog> | The docs imply by omission that this should work. |
15:45 | <@jerith> | GIYF? |
15:45 | <@jerith> | I don't recall any problems. |
15:45 | <@ToxicFrog> | Ie, there's no error state listed for "some other operation is keeping the socket busy" |
15:45 | <@ToxicFrog> | GIYF? EAP. |
15:45 | <@jerith> | Although you might want only one thread per socket... |
15:45 | <@jerith> | Google Is Your Friend. EAP? |
15:45 | <@ToxicFrog> | I need two, one for read, one for write. |
15:46 | <@ToxicFrog> | Expand Acronym Please. |
15:46 | <@jerith> | Ah. |
15:46 | <@ToxicFrog> | The reader is normally recv()-blocked on the socket; when it gets a message it CK_Send()s it to its parent thread. |
15:46 | <@ToxicFrog> | The writer is normally reply-blocked on the parent thread; when it gets a message it send()s it through the socket. |
15:46 | <@jerith> | Ah. |
15:47 | <@jerith> | Anyways, I'd best get back to work. |
15:47 | <@jerith> | Enjoy! |
15:47 | <@jerith> | Good luck! |
15:47 | <@jerith> | Don't forget to compile with the --no-bugs option! |
15:49 | <@ToxicFrog> | Hmm. Google says that this two-threads approach works in /java/... |
15:49 | <@ToxicFrog> | It's not a compiled language. |
15:58 | | Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #Code |
15:59 | | Thaqui [~Thaqui@Nightstar-8486.adsl.xtra.co.nz] has quit [Quit: Leaving] |
16:01 | <@ToxicFrog> | Hmm., |
16:01 | <@ToxicFrog> | Ok, much googling later: |
16:01 | <@ToxicFrog> | - two threads, one using recv and one using send, will work (at least on POSIX) |
16:02 | <@ToxicFrog> | - however, if one thread close()es the socket, the socket won't actually FIN and shut down until both operations return |
16:05 | <@ToxicFrog> | - use of shutdown(2) instead of close(2) may get around this |
16:07 | | Janus is now known as Jan[JouantDieu] |
17:09 | | ReivSLEP [~reaverta@IRCop.Nightstar.Net] has quit [Ping Timeout] |
17:10 | | ReivZzz [~reaverta@Nightstar-894.ubs-dsl.xnet.co.nz] has joined #Code |
17:10 | | mode/#code [+o ReivZzz] by ChanServ |
17:23 | | Vornicus [~vorn@Nightstar-18307.slkc.qwest.net] has joined #code |
17:23 | | mode/#code [+o Vornicus] by ChanServ |
17:31 | | You're now known as TheWatcher |
17:41 | <@Vornicus> | ...gnah |
17:41 | <@Vornicus> | I need to add stuff to ldap but I no longer have the shiny web interface. |
17:48 | <@TheWatcher> | woe |
17:50 | <@Vornicus> | ..hey look, command line tools. |
17:50 | <@Vornicus> | Okay, now I'm starting to feel a little better |
18:12 | | You're now known as TheWatcher[afk] |
18:18 | | Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #code |
18:19 | < Janus> | "Insufficient contestual information to determine type" Can't say I've ever made the compiler complain about that yet~ |
18:21 | <@Vornicus> | /sweet/ |
18:21 | <@Vornicus> | using templates? |
18:23 | < Janus> | I don't think I am, and God help me if that's the case. I'm sure this is from newbishism more than it is from sweetness. |
18:25 | <@Vornicus> | Yeah, probably |
18:25 | <@Vornicus> | But that's an error I never saw. |
18:26 | < Janus> | Gee, thanks-- *weeps* |
18:28 | <@Vornicus> | I'm interested in how the heck you got that. |
18:29 | < Janus> | The solution is probably very simple and obvious; if you declare a variable inside a class declaration, and that variable has an initialization function, do you follow it with empty brackets? Because... when I do, I get that error if I try to use one of it's members, and if I don't, it's a "field with an incomplete type." |
18:29 | <@Vornicus> | I don't know what you just asked. |
18:33 | < Janus> | Well, let's say this is inside "class Balloon," and you declare "Helium air()", where Helium is another class, air is the name of the member, and the '()' is for the initialization function. Then, later in a function inside Balloon, you say: "air.stink_factor()" This is where the error occurs. |
18:34 | < Janus> | Well, technically, it's "Foo bar = air.stink_factor()" as it is returning a struct, if that means anything. |
18:36 | < Janus> | Or... even more technically, "bar" isn't declared "Foo", as it's already a member of Balloon... (this is harder to explain than I though) |
18:36 | <@jerith> | http://www.jerith.za.net/code/nodelistiterator.html <-- Look what Java has reduced me to. :-( |
18:40 | <@jerith> | Hmm... |
18:41 | <@jerith> | What language? |
18:41 | <@jerith> | Perhaps you want "Helium air = new Helium()"? |
18:45 | < Janus> | C++. I'd have to put that in the initialization function of Balloon if I were to do that, and air would have to be declared as a pointer as well... (I should have picked a better analogy than balloons~) |
18:46 | <@jerith> | Put "Helium air;" in the dec and "air = new Helium();" in the init? |
18:46 | <@jerith> | Been a long time since I did any C++. |
18:46 | <@jerith> | Not quite long enough, though. |
18:47 | <@ToxicFrog|Lab> | ...oh hell yes. |
18:48 | <@ToxicFrog|Lab> | I've found a program for windows that gives you proper X11-style mouse control. |
18:48 | < Jan[JouantDieu]> | "new Helium" returns a pointer to a spot of dynamic data, so it would just be "Helium * air = new Helium()" However, it wouldn't be too far out of my way to simply have "air" call a non-initialization function inside Balloon's init-function. |
18:49 | <@jerith> | Ah, yes. Pointers. |
18:49 | <@jerith> | I remember those. |
18:49 | | Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has quit [Quit: Two names are too hard to handle.] |
18:49 | | * jerith hugs Python, Ruby and Erlang. |
18:50 | <@ToxicFrog|Lab> | Hee. |
18:52 | < Jan[JouantDieu]> | Pointers are made of sugar and spice and everything nice~ |
19:02 | < Jan[JouantDieu]> | It works now! But... for the oddest reason... |
19:03 | <@jerith> | Shotgun debugging? |
19:05 | < Jan[JouantDieu]> | I did a random thing out of curiousity, and it worked. (this doesn't surprise me, but in this case, it was the act of moving the class declaration for "Helium" above the class declaration for "Balloon". |
19:05 | <@jerith> | Hmm. Perhaps C++ doesn't like nested classes? |
19:05 | <@jerith> | Or weren't they nested? |
19:06 | < Jan[JouantDieu]> | Shouldn't saying "class Helium;" in the beginning of the header file make it grave for other classes to use it? It does it just fine with countless other classes... |
19:06 | < Jan[JouantDieu]> | *gravy, not grave. |
19:06 | <@ToxicFrog|Lab> | C++ doesn't like nested classes, no. |
19:07 | <@ToxicFrog|Lab> | Janus: are you quite sure you have a ';' at the end of each class declaration? |
19:07 | < Jan[JouantDieu]> | You bet. |
19:08 | | * Jan[JouantDieu] places a semi-colon after every '}' just out of precaution, (except else-ifs, of course). |
19:10 | < Jan[JouantDieu]> | That was the last slot in the puzzle too~ Characters can throw punches now. |
19:10 | | You're now known as TheWatcher |
19:12 | <@jerith> | Hey TW. |
19:12 | | * jerith throws a punch. |
19:13 | | * jerith catches a punch. |
19:13 | | * jerith juggles punches. |
19:13 | <@TheWatcher> | Hi |
19:14 | | * Jan[JouantDieu] prepares a pitcher of punch, in celebration. |
19:14 | <@jerith> | Yay punch! |
19:14 | | Jan[JouantDieu] is now known as Janus |
19:20 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code |
19:20 | | mode/#code [+o Chalcedon] by ChanServ |
19:39 | | Mahal [~Mahal@Nightstar-11770.worldnet.co.nz] has joined #Code |
19:39 | | mode/#code [+o Mahal] by ChanServ |
19:52 | <@jerith> | Gah! Changing an MSN password is so incredibly convoluted. |
19:53 | <@jerith> | Why can't they put a bloody "change my password" option in the menu? |
19:53 | <@jerith> | Or in the options dialog? |
19:53 | <@jerith> | Or bloody *anywhere*? |
19:54 | <@jerith> | (My 11 year old cousin has a very weak password (his name) and some people have been using his account.) |
19:55 | | * Vornicus should start throwing around stronger passwords. |
19:55 | < Janus> | At least they probably couldn't figure out how to change it either. |
19:55 | <@jerith> | Indeed. |
19:55 | <@jerith> | I had to google the bloody thing eventually. |
19:55 | <@jerith> | Did you know there is a "msn.com for dummies" book? |
19:55 | <@Mahal> | ........ |
19:55 | | * Janus has a super weak password, which he uses across every forum, account, and whatzit he has. |
19:56 | <@Mahal> | I have a few passwords |
19:56 | <@Vornicus> | Not that the ones I have are /weak/, but they're not up to sysadmin snuff. |
19:56 | <@Mahal> | some strong ones for the stuff I /care/ about |
19:56 | <@jerith> | C'mon! If you need a manual for a *website* you know there are usability issues. |
19:56 | <@Mahal> | weak ones for the ones I don't. |
19:56 | <@TheWatcher> | The strongest one I have is 36 characters, including numbers and symbols. |
19:56 | < Janus> | Dear lord... |
19:57 | <@Vornicus> | mine is 12 characters, including numbers, but no symbols. |
19:57 | | * Janus should probably be going around to change his single digig long, all lower case passwords right now. |
19:57 | <@jerith> | I have a couple of fairly standard moderately strong passwords, a couple of better ones, and root. |
19:57 | <@TheWatcher> | Janus: no need! ¬¬ |
19:58 | <@jerith> | I've run into issues using symbols ("@" in particular) so |
19:58 | <@jerith> | I choose them carefully now. |
19:58 | < Janus> | But they're so hard to remember otherwise--! [/wbmc] |
19:58 | | EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has quit [Ping Timeout] |
20:01 | | EvilDarkLord [althalas@Nightstar-17046.a80-186-184-83.elisa-laajakaista.fi] has joined #code |
20:02 | | Mahal [~Mahal@Nightstar-11770.worldnet.co.nz] has quit [Quit: workleaving time.] |
20:13 | < Janus> | There, now they use caps, symbols, and numbers; It would take a hacker a few years to break in. |
20:23 | | * jerith breaks in in seconds. |
20:24 | <@jerith> | Give or take ten minutes or so... |
20:27 | | * Janus oh dears. |
20:29 | <@jerith> | Yay for telepathic keygrabbers! |
20:38 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout] |
20:38 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code |
20:38 | | mode/#code [+o Chalcedon] by ChanServ |
20:42 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Killed (NickServ (GHOST command used by Forjeh))] |
20:43 | | Chalcy [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code |
20:43 | | mode/#code [+o Chalcy] by ChanServ |
21:03 | | Chalcy is now known as Chalcedon |
21:11 | | EvilDarkLord is now known as Azadir |
21:15 | | aoanla [~sam@Nightstar-25162.range81-156.btcentralplus.com] has joined #code |
21:23 | | Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has quit [Quit: Going to Forj's Graduation!] |
21:58 | | ReivZzz [~reaverta@Nightstar-894.ubs-dsl.xnet.co.nz] has quit [Quit: I ATENT'T DEAD] |
21:58 | | ReivZzz [~reaverta@IRCop.Nightstar.Net] has joined #Code |
21:58 | | mode/#code [+o ReivZzz] by ChanServ |
22:08 | <@jerith> | Be that Reiver returning or Reiver autoconnecting? |
22:20 | <@ReivZzz> | Which would you prefer? |
22:24 | | * jerith grins. |
22:24 | <@jerith> | How goes the coding? |
22:24 | <@jerith> | Want me in the morning? |
22:25 | <@jerith> | I'm at my cousins, so I'm likely to be awake way too early anyway. |
22:26 | <@jerith> | Sharing a bedroom with $c16. :-/ |
22:29 | <@ReivZzz> | $c16? |
22:31 | <@jerith> | The cousin who is currently 16 years of age. |
22:32 | <@ReivZzz> | Ach! |
22:32 | <@ReivZzz> | 'kay. |
22:38 | <@jerith> | Shall I take lack of summoning to be a lack of need? |
22:40 | | * jerith pokes ReivZzz. |
22:41 | <@jerith> | Apparently so. *sleeps* |
22:43 | | * ReivZzz huggles jerith |
22:43 | <@ReivZzz> | Sorry! |
22:43 | <@ReivZzz> | Um |
22:43 | <@ReivZzz> | Yeah, don't get up on my account. Thank you anyway. |
23:16 | | Azadir is now known as EvilDarkLord |
23:32 | | aoanla is now known as caps[t-2] |
23:34 | | caps[t-2] [~sam@Nightstar-25162.range81-156.btcentralplus.com] has quit [Quit: Leaving] |
--- Log closed Thu Oct 19 00:00:03 2006 |