code logs -> 2010 -> Fri, 05 Mar 2010< code.20100304.log - code.20100306.log >
--- Log opened Fri Mar 05 00:00:13 2010
00:05 You're now known as TheWatcher[T-2]
00:08 You're now known as TheWatcher[zZzZ]
01:07 Attilla [Attilla@FBC920.0A905B.55C6A3.AD1094] has quit [Connection reset by peer]
01:22 Rhamphoryncus [rhamph@Nightstar-8931f88f.abhsia.telus.net] has joined #code
01:40 GeekSoldier [Rob@Nightstar-e86e3e0d.ip.cablemo.net] has joined #code
01:40
< celticminstrel>
But do all 20 of those require special attention?
01:41
< Vornicus>
celticminstrel: they generally already have specific accelerator keys, live in specific menus, and do well-defined things.
01:42
< celticminstrel>
But the ID chosen doesn't affect the accelerator key (as far as I know). Some of the predefined ones do get moved to different menus depending on the platform though.
01:43
< Vornicus>
By defining only what you need to, you avoid having to deal with setting up the accelerators, menu locations, and other stuff like that.
01:45
< Vornicus>
In addition, other programs - especially stuff for special-needs users - can use ids to use menus, and having common ids for common items helps.
04:21 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [Ping timeout: 121 seconds]
05:47 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code
05:54 AnnoDomini [annodomini@Nightstar-53f8af16.adsl.tpnet.pl] has joined #code
05:55 mode/#code [+o AnnoDomini] by Reiver
06:14 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!]
06:39 Vornicus is now known as Vornicus-Latens
07:41 AbuDhabi [annodomini@Nightstar-53f8af16.adsl.tpnet.pl] has joined #code
07:43 AnnoDomini [annodomini@Nightstar-53f8af16.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
08:22 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
09:01 Attilla [Attilla@FBC920.0A905B.55C6A3.AD1094] has joined #code
09:01 mode/#code [+o Attilla] by Reiver
09:27 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
09:36 You're now known as TheWatcher
09:58 Attilla [Attilla@FBC920.0A905B.55C6A3.AD1094] has quit [Client closed the connection]
10:03 Zed_ [Zed@Nightstar-d0088b95.or.comcast.net] has quit [Ping timeout: 121 seconds]
--- Log closed Fri Mar 05 10:26:18 2010
--- Log opened Fri Mar 05 10:30:21 2010
10:30 TheWatcher [chris@Nightstar-b4529b0c.zen.co.uk] has joined #code
10:30 Irssi: #code: Total of 22 nicks [3 ops, 0 halfops, 0 voices, 19 normal]
10:30 mode/#code [+o TheWatcher] by Reiver
10:31 Irssi: Join to #code was synced in 51 secs
12:26 Orthia [orthianz@Nightstar-5a14a2e2.xnet.co.nz] has joined #code
12:29 Orth [orthianz@Nightstar-fa51ecc1.xnet.co.nz] has quit [Ping timeout: 121 seconds]
13:59 * Bobsentme bangs his head against his desk
14:00
< Bobsentme>
Just realized why my JavaServer page kept giving me a "resultset cannot be resolved" error. I wasn't declaring the resultset as a resultset.
14:07 * TheWatcher patpats Bob
14:17 * Bobsentme arrrghs
14:18
< Bobsentme>
Right back to square one. !@#$#!@$ authors not only don't show up, but page completely stops processing once the Author's resultSet is created.
14:20 Rhamphoryncus [rhamph@Nightstar-8931f88f.abhsia.telus.net] has quit [Client exited]
14:21
< Bobsentme>
http://pastebin.starforge.co.uk/136
14:21
< Bobsentme>
Also, I choose the code type as "Java", just as a warning to everyone.
14:21
< Bobsentme>
chose*
14:23
< Bobsentme>
Lines 88 - 96 are my problem. I'm trying to pull authors for each publication. Code compiles without error, but page stops processing once new resultset is created.
14:24
<@TheWatcher>
huh, aren't the 'dbo.'s redundant?
14:25
< Bobsentme>
probably. I just copied and pasted the code from SQL server.
14:33 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed]
14:59 celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code
15:15
< celticminstrel>
Okay, why doesn't this program receive a SIGALRM?
15:15
< Bobsentme>
?
15:16
< celticminstrel>
...
15:16
< celticminstrel>
Never mind.
15:16
< celticminstrel>
The problem is elsewhere.
15:17
< Bobsentme>
ah.
15:17
< celticminstrel>
I added a beep() to the signal function. XD
15:17
< Bobsentme>
don't mind me. I'm slowly being driven crazy by JSP.
15:17
< Bobsentme>
LOL
15:18
<@TheWatcher>
Only slowly?
15:18
<@TheWatcher>
That's quite impressive, really.
15:21
< Bobsentme>
heh
15:22
< Bobsentme>
Well, I'm trying to find the proper tomcat log file. So far, nothing.
15:23 * TheWatcher would attempt to assist, but has deliberately avoided tomcat for the last 3 years, does not intend to change that if possible >.>
15:24 * Bobsentme understands
15:25
< celticminstrel>
Well! Clearly there's the problem. The offset to be added to the position is 0.
15:26
< celticminstrel>
Boom! Works.
15:26
< celticminstrel>
Too fast, though.
15:28
< Bobsentme>
it works...too fast?
15:28
<@TheWatcher>
Always a good start >.>
15:28
< celticminstrel>
The ball was moving too fast. (I have to implement a curses pong game as my assignment.)
15:45
< celticminstrel>
What's this? Combining alternate charset with A_BOLD has no effect?
15:54 * Bobsentme beats his head against a wall
15:55
< Bobsentme>
Log file isn't showing a single error.
15:56
< celticminstrel>
Ooh! Yay for volatile!
16:01
< Bobsentme>
I don't get it. I really just don't !@#$!#@$ get it. No errors, compiles just fine. But new ResultSet !@#$!@#'s the whole thing up.
16:01 * Bobsentme is ready to go set the server on fire and call it a day.
16:04
< celticminstrel>
Okay, why won't getch() return the enter key?+
16:06
< Bobsentme>
C/c++?
16:06
< celticminstrel>
Yeah.
16:06 * Bobsentme remembers something his teacher said about that.
16:06
<@TheWatcher>
Bob: does execution halt there, or?
16:06
< Bobsentme>
TW: Yep.
16:07
< celticminstrel>
I called keypad(stdscr,TRUE) in the setup...
16:07
< Bobsentme>
Celticminstrel: Something about having to do the getch() for enter twice, and even then it's only "sometimes it works, sometimes it doesn't" thing.
16:07
< celticminstrel>
...which is supposed to fix the need to do it twice.
16:08
< Bobsentme>
been a while since I took C/C++, so..I'm not the best source. Sorry.
16:08
< celticminstrel>
According to the manual page, at least.
16:09
< celticminstrel>
It's also possible that you're thinking of a different getch(). There's the Windows conio.h version, and there's the curses version. They both do basically the same thing, but there may be slight differences.
16:10 * Bobsentme nods.
16:10
< celticminstrel>
And, not being on Windows, I'm using curses.
16:22
< Bobsentme>
ok, used a "try...catch". Error? "Connection is closed"
16:25 * Bobsentme sighs. Connection fixed. Problem appears to be an incorrect syntax in the SQL
16:26
< celticminstrel>
Is it normal for it to print a # when I ask it to print ACS_BLOCK?
16:26
< celticminstrel>
(That is, it prints the # character.)
16:31
<@ToxicFrog>
What's ACS_BLOCK meant to be? That is to say, what's its meaning?
16:31
< celticminstrel>
It's the block character - that is, the character cell is completely filled.
16:31
< celticminstrel>
I suppose I could instead just use inverse.
16:32
<@ToxicFrog>
Aah.
16:32
<@ToxicFrog>
I suspect it will pick a terminal/characterset specific one as appropriate
16:32
<@ToxicFrog>
So if it knows that, say, you have the line drawing characters, it'll use that
16:33
<@ToxicFrog>
If not it'll fall back on #
16:33
<@ToxicFrog>
See also: nethack
16:33
< celticminstrel>
I do have the line drawing character, but I guess I don't have that particular one.
16:34 * Bobsentme happy dances.
16:34
< Bobsentme>
SUCCESS!!!
16:35
<@ToxicFrog>
(there may also be something special you need to do to tell it what you ahve available in your character set, I don't know, I haven't used curses in years)
16:35
< Bobsentme>
(I still hate JSP. But try...catch is friggin useful.)
16:39
< celticminstrel>
Speaking of which, why does it init all colour pairs to be the same?
16:40 Vornicus-Latens is now known as Vornicus
16:40
<@ToxicFrog>
I don't know.
16:41
< Serah>
Goodnight Dr. Vorn.
16:41
<@ToxicFrog>
Gnar. I should finish my djangoproject.
16:52 * Vornicus just got up.
16:53 * Vornicus also isn't a doctor.
16:53 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Client closed the connection]
16:53 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
16:53 mode/#code [+o ToxicFrog] by Reiver
16:54
< celticminstrel>
Um, how do I get actual white? COLOR_WHITE seems to be a light grey.
16:55
<@ToxicFrog>
Reconfigure your terminal so that white is white.
16:55
< celticminstrel>
Well, the background actually was white.
16:56
< celticminstrel>
But specifically setting the background to white resulted in a grey background.
16:56
<@ToxicFrog>
Most terminal colour schemes define white as actually being light grey; this is not the fault of curses.
16:57
< celticminstrel>
However, I found something that works and is probably even better - getting the background colour of colour pair 0, which is white, and using that. It would also have the advantage of using the default background colour if it happened to be something other than white. I assume.
16:57
<@ToxicFrog>
Most likely, yes.
16:57
<@ToxicFrog>
(also white backgrounds are the spawn of the devil~)
16:58
< celticminstrel>
I prefer the white background, personally.
16:59
<@ToxicFrog>
I'm all about the light grey on black.
17:00
< Serah>
I'm with TF on this one.
17:00
<@ToxicFrog>
I also find it easier to distinguish bright colours than dark ones, so this works well for colour-coded text.
17:01
< celticminstrel>
Oh, wait. Maybe it's use_default_colors() that reset all the pairs to black-on-black.
17:02
< celticminstrel>
Well, anyway, everything works now.
17:03
< celticminstrel>
Maybe I can port that other game from conio sometime...
17:03 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: ]
17:05 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
17:05 mode/#code [+o Vornicus] by Reiver
17:14
< celticminstrel>
Aw, the terminal doesn't support the arrow characters either?
17:52 Tarinaky [Tarinaky@Nightstar-1a2efb86.adsl.virginmedia.net] has joined #code
17:58 Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds]
18:51 Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code
18:59 Orthia [orthianz@Nightstar-5a14a2e2.xnet.co.nz] has quit [Connection reset by peer]
19:15 Orthia [orthianz@Nightstar-5a14a2e2.xnet.co.nz] has joined #code
19:18
<@Vornicus>
Okay. Streamable prime number generator. Looks like the only sensible one is Eratosthenes.
19:18
<@Vornicus>
Which will be fun.
19:26 * Vornicus fights with the Seive of Atkin to see if he can improve it.
19:26
<@Vornicus>
er, streamify it.
19:34
< celticminstrel>
... \" is a pretty unusual comment sequence...
19:37
<@Vornicus>
Yes, it is. Where are you seeing that?
19:39
< celticminstrel>
Man pages.
19:56
<@Vornicus>
No, I can't see a way to stream it.
20:09 * Tarinaky is bored and decides to try playing around a little with Markov Chains.
20:11 Orthia [orthianz@Nightstar-5a14a2e2.xnet.co.nz] has quit [Ping timeout: 121 seconds]
20:13
<@Vornicus>
Oh. Duh, it is streamed already. But I need to do some filtering too, afterwards. And the heard part is getting the solutions.
20:26
< Tarinaky>
Grr. I can't remember what the function is to get the current system time :/ GNU C on Linux.
20:26
< Tarinaky>
I've tried looking in the man pages but of course, all I can find are the time and date commands >.<
20:31
< Tarinaky>
Nm. Found it.
20:36
<@Vornicus>
good god. Okay, how the hell do I do this.
20:37
< Tarinaky>
Goat sacrifice?
20:38
<@Vornicus>
Apparently.
20:39
< Tarinaky>
Well. I appear to have a very basic system that generates random strings using markov chains.
20:39
< Tarinaky>
Unfortunately I have no clue how to make decent looking rules :/
20:40
<@Vornicus>
I have 450M prime numbers to generate. Right now in order to do 1M it takes 40 seconds, which means that it will take 40*450 = 18000 seconds or five hours.
20:40
< Tarinaky>
Ouch.
20:41
< Tarinaky>
It might not be possible without a lookup-list.
20:41
< Tarinaky>
That or a Quantum CPU.
20:41
<@Vornicus>
Well, this is "possible" but it's Project Euler, where problems are supposed to be doable in under a minute.
20:42
< Tarinaky>
Maybe they're assuming your language has a list of primes built in?
20:42
< Tarinaky>
Since a lot of solutions to early problems involve using those.
20:43
< Tarinaky>
*can involve using those.
20:44
<@Vornicus>
In this case I need 3.5GB of 64-bit integers.
20:44
<@Vornicus>
And I need all of them - I need to count the repeated digits in each one.
20:52
<@Vornicus>
actually 5 hours is an underestimate.
20:54
<@Vornicus>
it took 40 seconds for the first million - but primes get less common as you go up. 20M -> 21M took 50 seconds.
20:54
<@Vornicus>
hng.
20:57
<@Vornicus>
If, on the other hand, the repetition count I'm seeking is high, that makes it so I don't need to find all the primes -- but I'll have to do primality /testing/ instead.
21:05
< Tarinaky>
Does anyone know if there's an 'easy' way in C/C++ to convert a string to all lower-case?
21:05
< Tarinaky>
I should note it's an ASCII string. No 'funny business'.
21:06
< Tarinaky>
Only thing I can think of is iterating through with if (within certain range) { c -= SOMETHING };
21:06
< Tarinaky>
Or += something >.< I can't remember.
21:08
<@Vornicus>
I think there's "tolower" or something in the string library
21:09
<@Vornicus>
Ah
21:09
< Tarinaky>
I've opted for "if (tmp >= 'A' && tmp < 'a') {tmp += 'a' - 'A';}"
21:09
<@Vornicus>
http://cplusplus.com/reference/clibrary/cctype/tolower/ <--- it's in the cctype
21:09
< Tarinaky>
As I iterate through :/
21:09
<@Vornicus>
for (k = 0; k++; k < s.length()) s[k] = tolower(s[k]);
21:10
<@Vornicus>
or however you get the length of the string
21:10
< Tarinaky>
Thanks.
21:11
<@Vornicus>
That mangles; if you want a copy you're probably best using strcpy or whatever and then mangling.
21:13
<@Vornicus>
There's also one in locale if you need locale-specific funny business.
21:13
< Tarinaky>
I'll have to keep that in mind - I may need it in future.
21:14 * Tarinaky is just playing with something so he doesn't need any robustness.
21:16
<@Vornicus>
(by the way yours would turn "[\\]^_`" to "{|}~\x7f\x80")
21:17
< Tarinaky>
tmp >= 'A' && tmp <= 'Z'?
21:17
< Tarinaky>
Thanks for catching that for me.
21:17
<@Vornicus>
Better
21:17
< Tarinaky>
I thought a proceeded Z. :/
21:19
<@Vornicus>
Nope. A and a are exactly 32 apart; this makes certain things convenient.
21:36 * Tarinaky blinks.
21:38
< Tarinaky>
random() % RAND_MAX * i << Why is this not working. :/
21:38
< Tarinaky>
For an i of 4 it's giving me values like 904771022
21:39
< Tarinaky>
*i of 3
21:39
< Namegduf>
Because... you have it backwards.
21:39
< Namegduf>
Or... broken.
21:39
< Namegduf>
Said in words:
21:39
< Tarinaky>
I thought % was left associative with the same precedence as *?
21:39
< Namegduf>
"Get a random number, modulo RAND_MAX, and multiply it by i"
21:39
< Namegduf>
I don't really understand what you're trying to do.
21:40 * Tarinaky facepalms.
21:40
< Tarinaky>
No. Wait.
21:40
< Tarinaky>
Gah >.<
21:40
< Tarinaky>
I'm trying to generate numbers between 0 and i.
21:40
< Namegduf>
"random() % i" is typical for a random number up to i, there's also "* (i / RAND_MAX)"
21:41
< Tarinaky>
Hunh.
21:41
< Tarinaky>
Curiously for i = 10 it worked :p
21:52
<@Vornicus>
note that you get a small bias when you do it this way
21:53
< Namegduf>
Yeah, "* (i / RAND_MAX)" (roughly) sort of improves it.
21:53
< Namegduf>
% i dumps bias toward the upper end being less likely.
21:53
<@Vornicus>
if RAND_MAX is, for instance, 16, i = 10 will make numbers 0..5 show up twice as often as 7..9. It gets less daramatic the larger rand_max is, but
21:54
< Namegduf>
"* (i / RAND_MAX)" distributes the "less likely" numbers throughout the range.
21:54
< Namegduf>
Only real answer I know is to reject numbers greater than RAND_MAX - RAND_MAX % i
21:54
<@Vornicus>
Java overcomes this by dropping ... that
21:55
< Namegduf>
That also means you can take infinity rolls to get a result, in theory.
21:55
< Namegduf>
Unless Java has a solution for that?
21:55
<@Vornicus>
It doesn't.
21:55
< Namegduf>
Okay.
21:56 * Namegduf was wondering.
21:56
< Namegduf>
Of course, the odds of taking infinity rolls is, er, infinitesimal
21:56
< Namegduf>
So whether you care or not might not matter.
21:56
< Namegduf>
Er, I mean, whether you care or not is up to you.
21:59
< Tarinaky>
So I've just spent the past god knows how long mutilating my code to realise my error was because I used '=' instead of '=='.
21:59
< Tarinaky>
MLIA.
22:00
< Alek>
Taky: = vs == is a SO COMMON error. -_-
22:00
< Alek>
so yeah, YLIA.
22:00
< Tarinaky>
Alek: Exactly why I said MLIA xD
22:00
< Namegduf>
What language?
22:00
< Tarinaky>
C++
22:00
< Namegduf>
Most languages outlaw, or have compilers which warn, against that.
22:01
< Namegduf>
Ah.
22:01
< Namegduf>
Increase yer warnings.
22:01
< Tarinaky>
Trouble is then I end up spending an equal amount of time wondering wtf the one time I actually mean what I write :p
22:01
< celticminstrel>
For Tarinaky's string-to-lower problem, would something like transform(str.begin(),str.end(),tolower) work? I'm pretty sure the STL library has such a function somewhere, though I might have the name wrong.
22:02
< Namegduf>
Tarinaky: You shouldn't.
22:02
< Namegduf>
The thing you need to do is just work out what the warning means.
22:02
< Namegduf>
If you understand "of what worrisome sign it speaks" then it can be perfectly safe to ignore.
22:02
< Tarinaky>
Namegduf: I tend to forget how to write makefiles and just end up copy+pasting the same monolithic beast from the last project.
22:02
< Namegduf>
(Although usually there's a slightly-cleaner way to do it that shuts it up)
22:03
< Tarinaky>
I do a similar thing with Latex and lab reports actually :/
22:16
<@ToxicFrog>
Tarinaky: yeah, I do the same thing with pmfiles
22:17
<@ToxicFrog>
As far as = vs == goes, -Wall will cause that to report "suggest parens around assignment used as truth value"
22:17
<@ToxicFrog>
You can get it to shut up by using if ((x = y)) and it'll catch the case where you meant (x == y)
22:17
< Namegduf>
Yes.
23:03
< Namegduf>
23:02 <CJ> (A TLS packet with unexpected length was received.)
23:03
< Namegduf>
23:02 <CJ> what's that in idiot speak?
23:03
< Namegduf>
23:03 <@Namegduf> CJ: Your SSL go breaky
23:53 AnnoDomini [annodomini@Nightstar-a71cf81d.adsl.tpnet.pl] has joined #code
23:53 mode/#code [+o AnnoDomini] by Reiver
23:55 AbuDhabi [annodomini@Nightstar-53f8af16.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
--- Log closed Sat Mar 06 00:00:04 2010
code logs -> 2010 -> Fri, 05 Mar 2010< code.20100304.log - code.20100306.log >