code logs -> 2010 -> Mon, 18 Jan 2010< code.20100117.log - code.20100119.log >
--- Log opened Mon Jan 18 00:00:14 2010
00:08 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!]
00:34 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
00:38 You're now known as TheWatcher[T-2]
00:47 Derakon[DDR] is now known as Derakon
00:50 You're now known as TheWatcher[zZzZ]
00:53 Bobsentme [NSwebIRC@051596.69129A.C96753.910884] has joined #code
00:54
< Bobsentme>
Question: I'm making a PHP array of 20 posted variables (if possible.) Code should be:
00:55
< Bobsentme>
$array = array($_POST['variable1'],(repeat posted variables 19 more times) =>string) right?
00:55 Vornicus is now known as Finerty
00:56
<@Derakon>
I would suggest, instead, having a list of the variable names, and then iterating over that list and inserting the values into $array.
00:56
<@Derakon>
Or better, having a list of pairs of variable names and default values if the variable is not supplied, with an empty default value meaning "this variable must be supplied".
00:57 * Bobsentme nods
00:57
< Bobsentme>
Problem is, there are going to be fields were variables simply aren't supplied.
00:57
<@Derakon>
And that's when you use the sensible default.
00:57
< Bobsentme>
Webform has them either entering a new author that isn't in the database, or choosing an existing author from a drop down menu.
00:58
<@Derakon>
Ah, either/or situations.
00:58
< Bobsentme>
sadly, yes.
00:58
<@Derakon>
Mm.
00:58
<@Derakon>
You've presented a slightly nontrivial question and my brain is in cruise mode. I may get back to you with a solution, but don't count on it.
00:59
< Bobsentme>
I was thinking of creating two arrays. 1 that has new authors to be entered into the database, and another with author names already in the data base that they choose. It'll let me know when I need to put in new authors into the database, and when I won't.
00:59
< Bobsentme>
No worries. Sometimes just having someone to bounce off helps.
01:12
< PinkFreud>
hmmm. any of you lot familiar with php?
01:12
<@Derakon>
I've used it in the past; Bob appears to be coding it now.
01:13
<@Derakon>
Er, in it.
01:13
< PinkFreud>
ahh hah.
01:14
< PinkFreud>
I'm looking at a line of code which does the following:
01:14
< PinkFreud>
$result = db_query("SELECT name, info FROM {system} WHERE type = 'module' AND status = 1 ORDER BY filename ASC, weight ASC");
01:14
< PinkFreud>
What I'm trying to figure out is what {system} is supposed to be
01:15
< PinkFreud>
it doesn't look like a variable - is it taken literally?
01:15
<@Derakon>
Is "{system}" actually the string?
01:15
< PinkFreud>
yes.
01:15
<@Derakon>
Ordinarily it would be a table name.
01:15
< PinkFreud>
yes, it would.
01:16
< PinkFreud>
it doesn't look like any table name I've seen, though.
01:16
<@Derakon>
I don't know enough about SQL to say.
01:16
<@Derakon>
Hm. Google says http://www.webmasterworld.com/php/3164496.htm
01:16
<@Derakon>
"It's just another way to put variables inside a string in PHP."
01:17
< PinkFreud>
I've checked the db - no table by that name
01:17
< PinkFreud>
ahh, so there's a variable called system?
01:17 * Derakon shrugs.
01:18
< PinkFreud>
huh
01:18
< PinkFreud>
according to that post, it's {$value}
01:18
< PinkFreud>
oddly, there is no string identifier here.
01:18
<@Derakon>
But there's no $ in your sample.
01:19
< PinkFreud>
yes, that's what I meant
01:19
< PinkFreud>
odd.
01:26
< Bobsentme>
Yeah, I've no idea what the system is in that string. Sorry.
01:34
< Bobsentme>
hmmm, so apparently I can just add [] after the name of my html element, and it'll feed it into an array.
01:34
< Bobsentme>
ie: Lots easier than I was attempting. YAY!
01:35
<@Derakon>
Also if you have an array named foo, then "foo[] = 4" appends 4 onto the end of foo.
01:44
< Bobsentme>
So if I want to create an array where my new authors will go, and another array where the selected current authors will go, then create two arrays, and use the name elements to submit the new / existing authors into their respective arrays
01:44
< Bobsentme>
(yeah, that was more for me to work out the logic, sorry)
01:47 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
01:48 * Derakon points at the channel topic.
01:49
<@Derakon>
No need to apologize.
02:10 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?]
02:11
< PinkFreud>
weird. it appears it's just the literal string 'system'
02:11
< PinkFreud>
there is indeed a system table.
02:12
< PinkFreud>
why they enclosed it in {}, I've no clue
02:12
< Bobsentme>
Just to confuse you. And Job security for a programmer somewhere.
02:12
< PinkFreud>
probably.
02:13
< PinkFreud>
however, that's found in Drupal's used_modules module
02:38 Zedidiah [zag@Nightstar-d0088b95.or.comcast.net] has quit [Ping timeout: 121 seconds]
02:41
< Bobsentme>
interesting
02:41 * Bobsentme stops messing with javascript trying to hide elements and gets back to work on properly pulling php data from form
02:42
<@Derakon>
'display = "none"' vs. 'display = ""', IIRC.
02:43 Finerty is now known as Vornicus
02:51 Attilla [Attilla@FBC920.DDABA2.60661C.0EE0F8] has quit [[NS] Quit: ]
03:20
< Bobsentme>
anyone know if this is correct syntax in php:
03:20
< Bobsentme>
if ($_POST['new_author[1]'] == "") {
03:21
< Bobsentme>
Not sure if I can check a posted array like that.
03:21
< Bobsentme>
bah, I'll try
03:22 * Bobsentme hates having to code on a pc and then test on a netbook
03:22
<@Derakon>
No, you can't.
03:23
<@Derakon>
$_POST['new_author'] will be an array.
03:23
< Bobsentme>
because I'd have to feed the array into a new array and test?
03:23
< Bobsentme>
ok
03:23
<@Derakon>
If I understand you correctly, I think what you want is: if (len($_POST['new_author']) > 1)
03:23
<@Derakon>
Or whatever PHP's array length function is.
03:23
<@Derakon>
Might actually be array_length, now that I think about it.
03:24
< Bobsentme>
Well, it's more a test to see if Author # 1 is a new author, and if not, it'll set Author#1 to the existing author array.
03:25
<@Derakon>
Well, then you'd want to check [0], since arrays are 0-indexed.
03:25
< Bobsentme>
...dammit. You're right.
03:27
< Bobsentme>
Probably just easier to iterate through the array and pull actual authors into an Author array.
03:34
< Bobsentme>
foreach ($_POST['new_author'] != "") {$authors[] = $_POST['new_author'] ;} that look right?
03:34
< Bobsentme>
err...add another = in there.
03:35
<@Derakon>
Can you do boolean operators inside a foreach like that?
03:36
< Bobsentme>
should be able to
03:46
<@Derakon>
Because it's down.
03:46
<@Derakon>
Er, mischan.
04:06
< Bobsentme>
HA! (iterated, displayed.) *scrathes that off his list.*
04:29 Alek [omegaboot@A2BA3E.D9488C.D07174.2236AE] has quit [Ping timeout: 121 seconds]
04:36 Alek [omegaboot@Nightstar-3f3964f1.emhril.sbcglobal.net] has joined #code
04:57 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
04:59 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!]
05:20 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has joined #code
05:25 Alek [omegaboot@Nightstar-3f3964f1.emhril.sbcglobal.net] has quit [Ping timeout: 121 seconds]
05:25 Alek [omegaboot@Nightstar-3f3964f1.emhril.sbcglobal.net] has joined #code
06:25 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
06:28 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
06:29 Syloqs_AFH is now known as Syloqs-AFH
06:50 Derakon is now known as Derakon[AFK]
07:10 AnnoDomini [annodomini@Nightstar-a597d11d.adsl.tpnet.pl] has joined #code
07:10 mode/#code [+o AnnoDomini] by Reiver
07:20 McMartin [mcmartin@Nightstar-ec4e50af.pltn13.sbcglobal.net] has quit [[NS] Quit: Reboot]
07:33 McMartin [mcmartin@Nightstar-ec4e50af.pltn13.sbcglobal.net] has joined #code
07:33 mode/#code [+o McMartin] by Reiver
07:38
<@McMartin>
"Functional programmers get more tail calls."
07:46
< Bobsentme>
php isn't fun for arrays, is it?
07:46 * Bobsentme is trying to figure out if I can do a 3x20 array. So each "row" would have an authors name, affiliation, email.
07:56
< Vornicus>
You can but I don't remember how off the top of my head
07:56
< Vornicus>
I don't think you can populate them from POST variables though
08:06
< Bobsentme>
it's a bit hard. So screw it, I'm on a deadline.
08:15
< Vornicus>
mh, hang on, I did this...
08:16
< Vornicus>
{} is the array literal. I don't know how you'd pull it from a non-db, but...
08:35
< Bobsentme>
sadly, arrays are beyond my php capability, and I've got only a couple more days to deal with this particularly annoying form.
08:35
< Bobsentme>
So I'm shooting for "proof of concept" more than "Cool, eh?"
08:35
< Bobsentme>
Thanks, though
08:44 * Vornicus declares bedtime.
08:45 Vornicus is now known as Vornicus-Latens
08:46
<@AnnoDomini>
Syntax error: expected type before 'bedtime'.
08:49
< Vornicus-Latens>
nah, this is dynamically types
08:49
< Vornicus-Latens>
d
08:58 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has quit [Client exited]
09:02
< Bobsentme>
dammit, I think I backed myself into a corner.
09:03
< Bobsentme>
I have the form page done. On clicking submit, the form's variables are posted to "Show_Page.php", and it shows what the user entered.
09:03
< Bobsentme>
Now I'm trying to figure out how to move those variables into the database if the user clicks "Submit" from the Show page.
09:06
< Bobsentme>
Not sure if I should create "add_record.php" to the submit button's action, and insert the variables by "$_POST['variable']" in there or not.
09:50 You're now known as TheWatcher
09:59
< Bobsentme>
http://drawingboard.smackjeeves.com/comics/626704/weekend-will-wind/ entirely too accurate.
10:01
<@AnnoDomini>
Yep.
10:05
< Bobsentme>
Minus the actual connections and queries to the database, along with adding some addition fields and logic to sort them out, I'm pretty much done.
10:06 Zedidiah [zag@Nightstar-d0088b95.or.comcast.net] has joined #code
10:06
< Bobsentme>
So, in 3 days I'm 70% complete on a project that 2 graduate students couldn't do in a year. I better get a recommendation from the teacher for this.
10:26
<@AnnoDomini>
I ponder the advantages and drawbacks of having my gameMap store an array of Tiles, rather than ints indicating which tile it is.
10:28
< Tarinaky>
By tile I assume you mean a struct containing an enumeration and a colour?
10:28
< Tarinaky>
Or whatever other by-case attributes.
10:30
<@AnnoDomini>
It's a class. Structs failed to compile.
10:30
< Tarinaky>
I thought you were doing C?
10:31
< Bobsentme>
I'm guessing he changed after the structs failed.
10:32
<@AnnoDomini>
I was never doing pure C.
10:34
< Bobsentme>
ah
10:36
< Tarinaky>
Ah. I just assumed because your file names were '.h'
10:37
<@AnnoDomini>
main.cpp should have been a tip-off. :p
10:37
< Tarinaky>
I didn't see that one.
10:42
< Bobsentme>
heh
10:44
< Bobsentme>
there's a "misplaced pp" joke there, but I refuse to make it.
10:47
<@AnnoDomini>
14 colours man! Now we're cooking with plasma!
10:49
< Bobsentme>
he
10:49
< Bobsentme>
err...that was supposed to be "heh".
10:50
< Bobsentme>
You've got more colors than an original Atari, but a long way to go until you reach "acid trip".
10:50
<@AnnoDomini>
Well, 15 if I count black.
10:50
<@AnnoDomini>
It would be 16 if that could be bolded.
10:58 Attilla [Attilla@FBC920.A5C359.8847DB.64E2F1] has joined #code
10:58 mode/#code [+o Attilla] by Reiver
11:21 Tarinaky [Tarinaky@Nightstar-711a2847.adsl.virginmedia.net] has quit [Operation timed out]
11:24
<@AnnoDomini>
Damn these unhelpful errors.
11:24
<@AnnoDomini>
I changed You to be a child class of Creature, and it's telling me that MessageDevice does not name a type.
11:24
< Bobsentme>
"Something Broke. Please fix Something and try again" ?
11:26
<@AnnoDomini>
Anyway. If anyone has a clue what might be wrong in this general situation, please tell me. I need to go to Uni now, but I'll read the backscroll when I return.
11:35 Tarinaky [Tarinaky@Nightstar-9433e782.adsl.virginmedia.net] has joined #code
11:36 Bobsentme [NSwebIRC@051596.69129A.C96753.910884] has left #code [""]
13:32 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
14:15 AbuDhabi [annodomini@Nightstar-6b03468a.adsl.tpnet.pl] has joined #code
14:17 AnnoDomini [annodomini@Nightstar-a597d11d.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
14:32 Bobsentme [Bobsentme@Nightstar-79f8b1cd.livnmi.sbcglobal.net] has joined #code
14:32
< Bobsentme>
help?
14:32
< Bobsentme>
php logic problem, but might be easy for someone else.
14:33
< Bobsentme>
Index.php is where users insert values. They're posted from the form on index.php to Show_Article.php, where they're then displayed for the user to review before submission.
14:33
< Bobsentme>
My problem is figuring out how to get the variables from Show_Article.php into the submission page, "add_record.php"
14:34
< Bobsentme>
Anyone got any idea?
14:39
<@TheWatcher>
Before sending the values back to the user for review, write them to the database with a 'unconfirmed' flag or something, send some kind of id for the data in a hidden field as part of the review page, when the user confirms the changes flip the unconfirmed flag in the database?
14:40
< Bobsentme>
hmm
14:41
< Bobsentme>
that'd work. I was thinking session variables as well, but I've never played with those
15:00
< Bobsentme>
Ok, long way, Make hidden form on second page that posts the variables to the add_record.php page?
15:04
< gnolam>
AnnoDomini/AbuDhabi: that's a "post some code" problem unfortunately.
15:08
< gnolam>
But off the bat? I'm guessing a missing declaration.
15:22 Attilla [Attilla@FBC920.A5C359.8847DB.64E2F1] has quit [Ping timeout: 121 seconds]
15:44 crem [moo@Nightstar-8ca3eea7.adsl.mgts.by] has quit [Connection reset by peer]
15:44 Attilla [Attilla@FBC920.174237.5958A4.6E5FB8] has joined #code
15:45 mode/#code [+o Attilla] by Reiver
15:50 crem [moo@Nightstar-8ca3eea7.adsl.mgts.by] has joined #code
16:07
< AbuDhabi>
gnolam: The problem is that I'd have to send the entire fucking project.
16:08
< AbuDhabi>
Posting some code won't really work, when I don't know where the problem is.
16:22
< AbuDhabi>
http://pastie.org/783297
16:22
< AbuDhabi>
Here are the two classes.
16:30
< AbuDhabi>
Any obvious wrongdoings?
16:45
<@ToxicFrog>
AbuDhabi: no, but that also isn't the part that's breaking; there are no references to MessageDevice at all in that code.
16:46
< AbuDhabi>
That's what perplexes me.
16:47
<@ToxicFrog>
So where do you refer to MessageDevice? Where does it say the error is?
16:47
< AbuDhabi>
http://pastie.org/783354 <- this is globals.h
16:47
< AbuDhabi>
It complains that You and MessageDevice don't name types.
16:48
< AbuDhabi>
It also complains, from within one of MessageDevice's member functions, that the global you object isn't declared.
16:49
<@ToxicFrog>
MessageDevice.h.
16:51
< AbuDhabi>
http://pastie.org/783365
16:52
< AbuDhabi>
It complains about updateSidebar(), specifically.
16:55
<@ToxicFrog>
Well, if globals.h thinks that You is not a legal type, the declaration of global you is invalid which is why it would complain about that
16:55
<@ToxicFrog>
So the problem is to find out why it thinks You is invalid
16:58
< AbuDhabi>
That's what I thought. Creature compiled without syntax errors before I set to converting You into a subclass of it.
17:00 Derakon[AFK] is now known as Derakon
17:02
< AbuDhabi>
I think I'm going to try to make a test project and include the bare minimum of other things to see where the problem lies.
17:04
<@ToxicFrog>
What happens if you just build Creature and You without building anything else?
17:04
<@ToxicFrog>
Or are they too entangled?
17:06
< AbuDhabi>
I don't know how to build them separately - at least not in this IDE.
17:07
<@ToxicFrog>
Oh
17:07 You're now known as TheWatcher[afk]
17:12
< AbuDhabi>
Ha! I think I found it.
17:12
< AbuDhabi>
I was including globals.h in Creature.h for no reason.
17:12
< AbuDhabi>
Being that globals.h required Creature.h which required globals.h...
17:15
< AbuDhabi>
Now I'm getting different errors.
17:16
< AbuDhabi>
Namely, that member variables set in Creature.h are private in context of You.cpp.
17:17
< AbuDhabi>
I don't quite grok this.
17:20
< Namegduf>
"You" is inherited from "Creature"?
17:21
<@ToxicFrog>
AbuDhabi: "private" is accessible only to the defining class; if the subclass needs to access them as well, try "protected"
17:21
< AbuDhabi>
Like, You : protected Creature?
17:22
< Namegduf>
No, like declaring the private member variables you want subclasses to access as protected instead.
17:22
< AbuDhabi>
Oh.
17:22
< AbuDhabi>
What's that do, anyway? Just make them available to subclasses?
17:22
< Namegduf>
Yes.
17:23
< AbuDhabi>
Thanks.
17:32 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has joined #code
17:34
< AbuDhabi>
Damn it.
17:35
< AbuDhabi>
I need to call the curses function move(), but the compiler thinks I'm calling Creature::move().
17:35
< AbuDhabi>
Does anyone know what the namespace for curses is?
17:35
< Tarinaky>
It doesn't have one.
17:35
< Tarinaky>
Curses is a C library.
17:35
< Tarinaky>
Namespaces are a C++ feature.
17:36
< Tarinaky>
The two functions -shouldn't- collide anyway though.
17:36
< Tarinaky>
Curses is move(Window*,int,int).
17:36
< Tarinaky>
I can't see why creature::move would have that declaration. :x
17:38
< AbuDhabi>
I use move(int,int). I don't use curses windows.
17:39
< Tarinaky>
Oh!
17:40
< Tarinaky>
Yeah, that's gonna be a bastard :/
17:43
< Alek>
hahaa
17:43
< Alek>
been doing some reading on Nehalem.
17:44
< Alek>
Intel's been doing architecture overhauls already, so my idea's not that far-fetched after all.
17:44
< Alek>
it'd just need more cooperation on the part of the OSmakers.
17:44 * AbuDhabi puts the move() call into a moveCursor() function then uses that.
17:52
< AbuDhabi>
I am well-versed in the path of least resistance.
18:01
< Tarinaky>
Confucious say: "STUPID COMPILER! WHY NOT WORK!"
18:21 You're now known as TheWatcher
18:35 Vornicus-Latens is now known as Vornicus
19:56
< AbuDhabi>
TheWatcher: The save loading started working now.
19:57
< AbuDhabi>
I did some refactoring, which might have been the solution, but I also changed the endls into "\n"s.
20:04
< AbuDhabi>
Loading starting coordinates is a bit wonky for some raisin.
20:06
< AbuDhabi>
Fixed! :D
20:07 Netsplit *.net <-> *.split quits: Alek, Tarinaky, EvilDarkLord, SmithKurosaki, Rhamphoryncus, KazWork, @Reiver, PinkFreud
20:09 Reiver [reaverta@ServerAdministrator.Nightstar.Net] has joined #code
20:10 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has joined #code
20:13 SmithKurosaki [Smith@Nightstar-a68aafef.dsl.teksavvy.com] has joined #code
20:13 Tarinaky [Tarinaky@Nightstar-9433e782.adsl.virginmedia.net] has joined #code
20:32 * AbuDhabi ends working with this for the day, and starts work on something that is actually required to pass the semester.
20:34
< Tarinaky>
Thanks. You;ve been making me feel bad all day.
20:34
< Tarinaky>
With your typing and accelerating away from me q.q
20:37
< AbuDhabi>
No, I should be thanking YOU. I feel threatened and motivated by your progress.
20:38
< AbuDhabi>
Have I mentioned that nano has insane Copy/Paste syntax?
20:39
< AbuDhabi>
Alt+A! Alt+6! Ctrl+U! Cthulhu fhtagn!
20:40
< Tarinaky>
AbuDhabi: Sadly my goal was to over-take you. Given any attempt at progressing spurs you on.
20:40
< Tarinaky>
I am, as they say "Screwed"
20:40 * AbuDhabi laughs.
20:40
< AbuDhabi>
Hey, it's not impossible. I have several projects to complete.
20:41
< Tarinaky>
So do I!
20:44
< AbuDhabi>
Don't give up hope just yet. I am depending on you. ;_;
20:44
< AbuDhabi>
<insert TTGL joke>
20:45
< Tarinaky>
TTGL?
20:45
< AbuDhabi>
Tengen Toppa Gurren Lagann.
20:45
< Tarinaky>
I'm waiting till the weekend because I should have my work out the way again.
20:45
< Tarinaky>
Tengen what?
20:46
< AbuDhabi>
It's an animu.
21:43
< AbuDhabi>
Bobsentme: You awake?
21:44
< AbuDhabi>
Nevermind. Figured this out myself.
21:45
< AbuDhabi>
But another thing comes up - could I include a header() call?
21:45 KazWork [kazrikna@Nightstar-55f6a2b4.xen.prgmr.com] has joined #code
21:45 PinkFreu1 [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code
21:45 EvilDarkLord [jjlehto3@26ECB6.66DC17.F9E1B3.29F641] has joined #code
21:45 Alek [omegaboot@Nightstar-3f3964f1.emhril.sbcglobal.net] has joined #code
21:45 mode/#code [+qo Reiver Reiver] by ChanServ
21:45
< AbuDhabi>
I think I'm going to be using the 'is the user logged in? no? then redirect to the login page' a lot.
21:55
<@TheWatcher>
yeah, you will
21:57
< AbuDhabi>
I read that header() must be called before any output is pasted onto the page. I'm wondering if include() trips that up.
21:59
<@TheWatcher>
if the included file does any printing, yes. Otherwise no, you're fine
21:59
< AbuDhabi>
Cool. Thanks.
22:09 PinkFreu1 is now known as PinkFreud
22:20
<@McMartin>
I'm given to understand that include() does direct textual substitution?
22:27
< AbuDhabi>
I think so. It works, anyway.
22:27 * AbuDhabi completes the non-magical part of this project.
22:28
<@TheWatcher>
'non-magical part'?
22:29
< AbuDhabi>
I have this diagram, see, which I did to not get lost along the way. The content of several page-blocks I could only described as 'magic'.
22:30
<@TheWatcher>
Heh, fir enough
22:30
<@TheWatcher>
*fair
22:34
< AbuDhabi>
It has been implied that the teacher will pass me even without security, which is a boon, since I can't seem to get apache+openssl configured properly.
22:35
< Rhamphoryncus>
Anybody understand printer configuration? Just got a canon iP4600. Obviously needs better paper than most of what I have (to avoid bleeding), but that's not the issue. The issue is that it was printing a light grey area with a slight redish tint, as well as making yellow highlighting brown. I noticed that Color Model was set to RGB Color (5 other options available), while Ink Type was set to CMYK Color (no other options availab
22:35
< Rhamphoryncus>
le). Changing the first fixed the colours, except.. now all my grey areas are very dithered!
22:36
< Rhamphoryncus>
I'm wondering if it was accidentally using colour (or photo black) before, and now that I fixed that it's using a much lower resolution bulk black..
22:39
< Rhamphoryncus>
I could change Color Precision from Normal to Best.. or Color Correction from Default to various other things like High Accuracy or Bright Colors.. or change Image Type to Line Art (or Photograph).. or change the Dither Algorithm.. or change half a dozen GCR settings
22:41
<@McMartin>
It sounds like it's using CMY instead of CMYK.
22:42
< Rhamphoryncus>
nope
22:42
< Rhamphoryncus>
There is a CMY option
22:43
< Vornicus>
how's your black ink level?
22:43
< Rhamphoryncus>
new printer
22:43
< Vornicus>
call tech support
22:43
< Rhamphoryncus>
It WAS printing fine until I changed that option.. and I'm in linux
22:44
< gnolam>
Rhamphoryncus: http://theoatmeal.com/comics/printers
22:50
< Rhamphoryncus>
gnolam: pretty much
23:01 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
23:09
< AbuDhabi>
\o/
23:09
< AbuDhabi>
I have made a zombie that shambles around trying to chase me. :D
23:10
< AbuDhabi>
50% of shambling randomly or trying to go in my general direction.
23:11
< gnolam>
Yay. I suggest you also add the Last Night on Earth rule of it always going towards you if it's close enough (1 or 2 squares away, depending on your setup).
23:12
< Namegduf>
Then you just need to add Fast Zombies.
23:15
<@McMartin>
And pits to try to trick it into.
23:15
< gnolam>
Add Fast Breeders instead. Make the world's first roguelike reactor sim!
23:16
< AbuDhabi>
Implemented.
23:16
< AbuDhabi>
AAAAA! I can't shake it off!
23:16
< AbuDhabi>
It's in my tile! IT'S IN MY TILE!!!
23:16
<@McMartin>
Oh, you might want a collision detector too~
23:17
< Rhamphoryncus>
ugh, apparently firefox has a new special definition of "shrink to fit" that means "do nothing and cut off half of it". At least it didn't do multiple pages :P
23:20
< AbuDhabi>
Collision detection will have to wait until after the creature vectors and stuff.
23:21 * Rhamphoryncus wonders how much money on ink he's using just trying to get it configured correctly
23:22
< AbuDhabi>
On that topic, I want to keep track of critters using a vector/array/something of pointers to dynamically created objects. Given that my critters will be inherited from the Creature class, the pointer type will be Creature*, right?
23:24
< Rhamphoryncus>
heh, well I got one color mode to use shrink to fit. Other 3 failed miserably
23:37
< celticminstrel>
Yes.
23:37
< celticminstrel>
(To AbuDhabi.)
23:46
< AbuDhabi>
Damn.
23:46
< AbuDhabi>
It's not working right.
23:47
< AbuDhabi>
creatureVector = new Zombie [5]; // Compiles just find but later it complains that a member function of Zombie is not in Creature.
23:47
< celticminstrel>
Right.
23:47
< AbuDhabi>
Help?
23:48
< celticminstrel>
Because your vector is a vector of Creature*, right? So, you can only call member functions of Creature through it.
23:48
< AbuDhabi>
But that kind of defeats the purpose of this exercise, since I want a vector for unspecified critters.
23:50
< celticminstrel>
You need to give Creature a member function which returns the type of creature you're dealing with. It could be a virtual pure function, or it could be a function returning a private field. Or you could just have a const public field. Anyway, whatever method you choose, you have to query the Creature to see what type of creature it is. Once you know that it's a Zombie, you can apply a cast and call Zombie member functions.
23:50
< celticminstrel>
(I actually used typeid when I did it; that may not have been the best choice though.)
23:50
< Namegduf>
The alternative is to have a (pure) virtual function which does whatever the various non-virtual ones would do.
23:51
< AbuDhabi>
This is rocket surgery to me.
23:51
<@Derakon>
Types take some practice to get down.
23:51
< Namegduf>
So instead of having ->Shamble(), have ->MoveIfItShould()
23:51
<@Derakon>
I wouldn't recommend trying to programmatically figure out what type of creature you're dealing with.
23:51
<@Derakon>
What's the Zombie-specific function you want to call, anyway?
23:51
< Namegduf>
But if there's no clean way to do that, a const field or similar can be right.
23:51
<@Derakon>
You should genericize it so that all Creatures have the function, and then make a Zombie-specific version as needed.
23:51
< celticminstrel>
Namegduf: That only works if all the creatures have the same possible action fields.
23:52
< Namegduf>
celticminstrel: No it doesn't.
23:52
< celticminstrel>
^um, scratch out "fields".
23:52
< Namegduf>
celticminstrel: See "if it should".
23:52
< AbuDhabi>
I want to call ai().
23:52
< AbuDhabi>
Which does artificial stupidity.
23:52
< Namegduf>
AbuDhabi: Then have ai on things without AI be "do nothing".
23:52
< Namegduf>
Call AI on all creatures.
23:52
<@Derakon>
Declare a virtual ai() function in Creature.
23:52
<@Derakon>
Then implement it for Zombie.
23:52
< celticminstrel>
So, make Creature::ai() be a virtual function that does nothing.
23:52
< AbuDhabi>
Okay.
23:52
< Namegduf>
So long as the virtual ai() function's guarantee doesn't guarantee it doing anything at all
23:53
< Namegduf>
It's valid, as OO modeling goes
23:53
< Namegduf>
This *often* means its a bad function and is a bad idea, but this is one of the cases it makes sense.
23:53
< AbuDhabi>
Yay! Compilation took a very long time, compared to usual, but it works!
23:54
< AbuDhabi>
There are now five damn zombies chasing my poor avatar. ;_;
23:54
<@Derakon>
Save their souls; they'll still be zombies but they won't be damned zombies~
23:56 * AbuDhabi relaunches Chrome to post an update on the competition wave.
--- Log closed Tue Jan 19 00:00:15 2010
code logs -> 2010 -> Mon, 18 Jan 2010< code.20100117.log - code.20100119.log >