←2007-05-22 2007-05-23 2007-05-24→ ↑2007 ↑all
01:34:16 <oklopol> i've never quite understood how it can be so quiet here at this hour
01:34:24 <oklopol> 3:33 here
01:34:33 <oklopol> so in america, it's prime time right?
01:34:42 <oklopol> am i right, folks?
01:34:51 <oklopol> but, seriously, sp ---->
01:40:10 <oklopol> actually
01:40:24 <oklopol> might be the time when people go to school and shit
01:49:48 <Pikhq> In theory.
01:50:04 <Pikhq> I'm just busy doing other things, like trying to get a PS2 emulator working.
01:59:07 <oklopol> well i should sleep.... hope you get it working
01:59:10 <oklopol> playstation?
01:59:23 <oklopol> i've heard of those.
01:59:25 <oklopol> ----------->
01:59:31 <Pikhq> Mmkay. . .
01:59:42 <Pikhq> I've got myself a working PS2 emulator. . . Which runs damned slowly.
02:00:25 <oklopol> i've actually played the playstation 1 demo cd games... and prolly something else
02:00:28 <oklopol> but i'm not proud of it
02:00:39 -!- calamari has joined.
02:01:20 <oklopol> my eyes hurt like hell ------>
02:01:47 <calamari> too much masturbation... sad
02:02:48 <Pikhq> . . . Ah. The x86_64 build currently has an unoptimized recompiler, but the x86 build is fairly optimized.
02:06:18 -!- calamari has quit ("Leaving").
02:14:53 <bsmntbombdood> 355/113
02:29:10 <oklopol> masturbation causes eye pain?
02:30:04 <bsmntbombdood> what's a good function to score rational approximations to pi?
02:30:25 <bsmntbombdood> i'm thinking score(a, b) = (log(b, 10) + log(a, 10) + 2) * -1./log(abs(a/b - pi), 10)
02:31:18 <bsmntbombdood> where a/b is the approximation
02:31:38 <oklopol> calculate it and use the fact doubles are easily converted to rationals... ta-daa
02:32:29 <oklopol> sleep, perhaps ------->
02:35:53 <bsmntbombdood> 355/113 turns out to be a very good approximation using that metric
02:36:58 <bsmntbombdood> the best with a denomiator under 10**7, in fact
02:41:23 <SimonRC> yes
02:41:30 -!- SuperAussieEvll has joined.
02:41:35 <SimonRC> the next one is humongous
02:41:48 <bsmntbombdood> i need to rewrite this code
02:41:54 <bsmntbombdood> python is not a good language for this
02:42:16 <SuperAussieEvll> Hi all
02:43:52 <SimonRC> bsmntbombdood: pastebin?
02:44:41 <bsmntbombdood> http://pastebin.ca/503834
02:44:52 <bsmntbombdood> i'm redoing it in c right now
02:47:16 * SimonRC re-does it in Haskell
02:50:33 <bsmntbombdood> mine will be faster :P
02:55:05 <SimonRC> Argh! Haskell numeric libraries == pain.
02:59:35 <SimonRC> pain pain pain
03:05:09 <bsmntbombdood> done
03:08:01 * SuperAussieEvll falls over
03:08:52 <bsmntbombdood> jeez
03:08:57 <bsmntbombdood> none under 10**8
03:12:04 <SimonRC> I have results too
03:15:20 <bsmntbombdood> there needs to be a better than brute force algorithm to do this
03:19:46 <SimonRC> what about 312689/99532 ?
03:20:57 <SimonRC> that seems to be closer
03:21:02 <bsmntbombdood> that has a score of 14.7
03:21:10 <bsmntbombdood> 355/113 has a score of 7.7
03:21:34 <SimonRC> according to Haskell's Doubles and the window calculator, it is closer
03:21:46 <bsmntbombdood> closer to pi, yes
03:21:47 <SimonRC> what is your scoring syste,?
03:22:00 <bsmntbombdood> but you have to take into account the lengths of the numbers
03:22:12 <bsmntbombdood> (log(b) + log(a) + 2) / -log(abs(a/b - pi))
03:23:17 <SimonRC> in that case there may not be anything better than 355/113, ever
03:25:16 <bsmntbombdood> possible
03:35:16 <bsmntbombdood> wtf?
03:35:31 <bsmntbombdood> -O2 hurts the performance
03:38:01 <bsmntbombdood> if you use (log(b) + log(a) + 2) * abs(a/b - pi), there are lots
03:45:13 <bsmntbombdood> i'll find some approximations for e now
03:45:54 <bsmntbombdood> 193/71
03:46:01 <bsmntbombdood> 2721/1001
03:46:13 <bsmntbombdood> 49171/18089
03:46:16 <bsmntbombdood> that's interesting
03:46:42 <bsmntbombdood> 1084483/398959
03:49:31 <bsmntbombdood> 28245729/10391023
03:49:37 <bsmntbombdood> i wonder why there's so many more
04:12:13 <Pikhq> How does -O2 *hurt* performance (in comparison to what)?
04:16:26 <bsmntbombdood> in comparison to -O0
04:16:59 <bsmntbombdood> i'm running it with denominators up to 10**11, get back to you in 15 hours on that
04:23:59 <Pikhq> . . . *How*?!?
04:24:38 <Pikhq> #ifdef O 2
04:24:38 <Pikhq> run_slow();
04:24:38 <Pikhq> #endif
04:24:39 <Pikhq> ?
04:29:09 <bsmntbombdood> i dunno, it just happens
04:35:29 <Pikhq> I think your C compiler's broken.
04:36:30 <bsmntbombdood> gcc (GCC) 4.1.2 20061115
04:37:20 -!- Pikhq has quit ("Leaving.").
04:38:09 -!- Pikhq has joined.
05:00:58 <bsmntbombdood> ah ha!
05:01:04 <bsmntbombdood> 9978066541/3176117225
05:04:00 <bsmntbombdood> after this the floating point errors will make it worthless
05:04:08 * bsmntbombdood pulls out the GMP manual
05:05:19 <Pikhq> What language are you using? C, C++?
05:05:23 <bsmntbombdood> C
05:05:28 * Pikhq really prefers C++ for GMP stuff. . .
05:05:44 <bsmntbombdood> yeah, operator overloading is good sometimes
05:05:57 <Pikhq> If used right, it's wonderful.
05:06:25 <Pikhq> If you do something weird like make operator+ do multiplication, though, I will have to hunt someone down and kill that someone.
05:09:54 <bsmntbombdood> hrm
05:10:28 <bsmntbombdood> should i use mpz_ts for the rational
05:10:43 <bsmntbombdood> that is, allow numbers greater than 2**64?
05:11:20 <bsmntbombdood> naw, no way i'm going to do that many iterations
05:11:28 <Pikhq> Uh. . . Why would you use an integer for a non-integer?
05:11:47 <bsmntbombdood> ?
05:12:45 <Pikhq> mpz_t is the GMP integer type. . .
05:12:49 <bsmntbombdood> yeah
05:12:58 <Pikhq> And I assume by rational, you mean "non-integer rational".
05:13:11 <Pikhq> (otherwise, why not just say integer?)
05:13:17 <bsmntbombdood> a rational is two integers
05:13:26 <Pikhq> Um, yeah.
05:13:35 <Pikhq> I paid attention that day of middle school.
05:14:17 <Pikhq> Why not use, say, mpq_t?
05:15:08 <bsmntbombdood> because i don't actually do anything with the rational
05:15:27 <bsmntbombdood> i just do stuff with its numerator, denominator
05:17:05 <Pikhq> typedef struct {mpz_t numerator,denominator} mpq_t; is, I believe, the mpq_t definition.
05:18:31 <Pikhq> Of course, you could use the macros mpq_numref and mpq_denref. . .
05:19:41 <Pikhq> Or just do it your own way, and wait as I wonder why you need the numerator and denominator of a rational, but not the rational itself.
05:21:37 <bsmntbombdood> a = round(b*pi); error = (log(b) + log(a) + 2) / -log(abs(a/b - pi)); if(error < min_error) {min_error = error; min_denom = b;}
05:21:40 <bsmntbombdood> that's what i d
05:21:41 <bsmntbombdood> o
05:21:45 <bsmntbombdood> where a/b is the rational
05:23:02 <Pikhq> int main(){mpz_class a,b;/* your code*/}
05:23:13 <Pikhq> And that's what I do.
05:23:27 <bsmntbombdood> c++ = suck
05:24:15 <bsmntbombdood> real men use mpz_add(tmp, a, b) instead of a+b
05:25:37 <Pikhq> Realise that c++ = suck *really* means that c sucks, and c then gets incremented.
05:29:23 <bsmntbombdood> tmp = c++; tmp == suck
05:30:20 <Pikhq> And you've not changed the meaning at all. . . You've just managed to pour some more memory into it.
05:30:50 <Pikhq> tmp = c++; means that tmp is set to c, and c is then incremented. Then you say that tmp == suck.
05:30:55 <bsmntbombdood> oops
05:30:58 <Pikhq> Since tmp==c, c==suck.
05:31:41 <bsmntbombdood> c++ won't let itself be insulted!
05:32:09 <bsmntbombdood> which actually means c won't let itself be insulted
05:32:15 <bsmntbombdood> it never stops!
05:32:15 <Pikhq> Yup.
05:32:27 <Pikhq> That's what you get for failing at C semantics.
05:32:45 <Pikhq> (and thereby failing at C++ semantics)
05:33:38 <bsmntbombdood> why be redundant?
05:33:46 <bsmntbombdood> C++ == C, remember
05:33:55 <Pikhq> Nope.
05:34:19 <Pikhq> The second "c" has an incremented value.
05:34:39 <bsmntbombdood> i think it's not legal
05:34:40 <Pikhq> However, (C == C++) *does* return true.
05:34:48 <Pikhq> It's perfectly legal.
05:37:31 <Pikhq> Hrm. Something's wrong with my compiler. . .
05:37:38 <Pikhq> I've got it saying (2 == 3).
05:38:33 <bsmntbombdood> ?
05:39:16 * Pikhq kicks C in the shins for a bit
05:39:44 <Pikhq> It's also saying:
05:39:48 <Pikhq> int c = 0;
05:40:19 <Pikhq> (c++ == 1) is true, then (c == 1) is true, and finally (c++ == c).
05:40:38 <Pikhq> And, after that, it says c == 2.
05:40:41 <bsmntbombdood> gcc says that c++==c
05:40:43 <Pikhq> Just to make things more confusing.
05:41:27 <bsmntbombdood> with -Wall it also says warning: operation on ‘c’ may be undefined
05:42:16 <Pikhq> Which would explain why the hell something weird is happening.
05:43:46 <bsmntbombdood> apparently GMP doesn't support operations with long longs
05:44:03 <bsmntbombdood> i'll have to use mpz_t after all
05:44:34 <Pikhq> Well, yeah. . . GMP is a bignum library, not a native datatype library.
06:06:49 -!- SuperAussieEvll has quit ("Leaving").
06:59:02 -!- oerjan has joined.
07:04:50 -!- h|barbobot has joined.
07:12:45 <oerjan> bsmntbombdood: you need to read up on continued fractions.
07:13:00 <bsmntbombdood> oerjan: i tried that
07:13:34 <oerjan> those give you the best approximations.
07:13:54 <bsmntbombdood> "the best" according to what?
07:14:39 <lament> closeness?
07:15:19 <oerjan> closeness given size of denominator, i think
07:17:06 <oerjan> not quite sure
07:18:19 <oerjan> found it: http://en.wikipedia.org/wiki/Continued_fraction#Best_rational_approximations
07:20:07 -!- Pikhq has quit (Read error: 113 (No route to host)).
07:24:55 <oerjan> the last paragraph of that section gives another "best" sense, too.
07:25:43 -!- Arrogant has joined.
07:35:31 <oerjan> i thought we had a discussion the other day of why things like c == c++ are undefined.
07:37:47 <Arrogant> c == c++ is false
07:37:49 <Arrogant> c > c++
07:42:22 <bsmntbombdood> hrm
07:42:34 <bsmntbombdood> 9978066541/3176117225 isn't one of the convergents of pi
07:59:59 -!- clog has quit (ended).
08:00:00 -!- clog has joined.
08:11:19 -!- h|barbobot has quit (Remote closed the connection).
08:29:51 -!- oerjan has quit ("leaving").
10:01:34 -!- Arrogant has quit ("Leaving").
10:58:41 -!- oklopol has quit (pratchett.freenode.net irc.freenode.net).
10:59:22 -!- oklopol has joined.
11:11:11 -!- Pikhq has joined.
11:32:11 <oklopol> <Pikhq> However, (C == C++) *does* return true. <<<<< undefinatorized.
11:32:18 <oklopol> i thin k.
11:33:04 <oklopol> oh
11:33:16 <oklopol> oerjan saved the day already :<
11:40:15 <oklopol> but, java compensates for it's non-operator-overloadingy boringness by defining evaluation order accurately
11:41:35 <fizzie> I don't think a well-defined evaluation order is all that interesting.
11:41:47 <fizzie> Quite the contrary: undefined operations add a little spice to the life.
11:44:26 <oklopol> i only find intrest determinicity
11:44:30 <oklopol> *in
15:17:25 -!- ais523 has joined.
15:30:39 * ais523 is in the wrong timezone to log on to IRC at a time they have access to a computer and come across a conversation
15:30:50 <ais523> * a computer with an IRC client
15:45:42 -!- jix__ has joined.
15:46:50 <ais523> I'm busy working on Underload's parent language
15:47:19 <ais523> it's complicated, because I've changed the language I've written the interpreter in twice
15:47:33 <ais523> and have both an old imprecise spec and a new unfinished one to try to work from
15:47:42 <ais523> as well as the fact that I keep on coming up with new features it needs
15:54:12 <oklopol> overload?
16:04:01 <ais523> Yep, that's what it's called
16:04:20 <ais523> It extends it with features like variables and pointers
16:04:49 <ais523> (Imagine Scheme with goto, and you'll have some idea of what I've got myself into)
16:05:35 -!- jix__ has changed nick to jix.
16:19:24 <ais523> What I've done so far can be seen at http://pastebin.ca/505403 for the next 24 hours or so
16:19:32 <ais523> I've set it to expire because it's very much a work in progress.
16:20:03 <ais523> The Perl program is the current interpreter-in-progress (but it needs reworking so it can handle programs with reasonable efficiency, with some sort of internal compression)
16:20:19 <ais523> The C++ interpreter can do more at the moment, but is an older version of the interpreter
16:20:56 <ais523> The text files are the spec; neither is complete, and the less complete one is a newer version (I was working through the alphabet, but haven't finished making the end of it rigorous yet)
16:22:54 <ais523> (By the way, does anyone else create archives using more?)
16:53:12 -!- sebbu has joined.
17:00:27 -!- ais523 has quit (Remote closed the connection).
17:16:53 -!- jix__ has joined.
17:25:07 -!- jix has quit (Read error: 113 (No route to host)).
17:31:31 -!- sebbu2 has joined.
17:33:15 -!- sebbu3 has joined.
17:41:08 -!- sebbu4 has joined.
17:42:06 -!- sebbu4 has quit (Excess Flood).
17:42:33 -!- sebbu4 has joined.
17:42:55 -!- sebbu3 has quit (Read error: 145 (Connection timed out)).
17:53:13 -!- sebbu has quit (Connection timed out).
17:53:13 -!- sebbu2 has quit (Connection timed out).
17:55:20 -!- sebbu has joined.
18:08:37 -!- sebbu4 has quit (Read error: 110 (Connection timed out)).
18:12:12 -!- sebbu2 has joined.
18:31:41 -!- sebbu has quit (Connection timed out).
18:40:59 -!- sebbu has joined.
18:52:43 -!- sebbu2 has quit (Connection timed out).
19:01:35 -!- sebbu2 has joined.
19:20:52 -!- sebbu has quit (Connection timed out).
19:40:26 -!- oerjan has joined.
20:59:53 -!- oerjan has quit ("Reboot").
21:05:39 -!- oerjan has joined.
21:32:08 -!- oerjan has quit ("leaving").
21:33:18 -!- jix__ has quit ("Bitte waehlen Sie eine Beerdigungnachricht").
22:32:34 -!- cmeme has quit (Remote closed the connection).
22:32:50 -!- cmeme has joined.
22:54:33 -!- sebbu2 has quit ("@+").
23:21:02 <SimonRC> Oh wow!
23:21:04 <SimonRC> http://blog.modernmechanix.com/2006/08/31/your-telephone-of-tomorrow/
23:21:19 <SimonRC> Modern mobile phones, predicted in ... 1956!
23:44:48 <oklopol> spooky.
23:45:27 <Pikhq> Reading the article attached. . .
23:45:37 <Pikhq> The "in 3-D" part hasn't happened yet. ;)
23:46:04 <Pikhq> And cell phones aren't normally used for duplex audio/video. ;)
23:47:00 <Pikhq> But it's a hell of a lot closer to the mark than most predictions. . .
23:47:09 <Pikhq> Hell, it's actually a reasonable thought.
23:48:56 <Pikhq> Additionally, the discuss power sources. . .
23:49:23 <Pikhq> The "solar battery" takes advantage of the photovoltaic effect to charge a battery, which is used for power. . .
23:54:29 <Pikhq> Wow. Jack Thompson is suing Microsoft.
←2007-05-22 2007-05-23 2007-05-24→ ↑2007 ↑all