code logs -> 2009 -> Wed, 07 Oct 2009< code.20091006.log - code.20091008.log >
--- Log opened Wed Oct 07 00:00:42 2009
00:03
<@Vornicus>
Rham: I wrote a post describing several different ways of doing division.
00:06
< Namegduf>
Switching between Python and C++ rapidly makes my head feel weird.
00:12
< Rhamphoryncus>
Vornicus: oh? Got a link?
00:28 You're now known as TheWatcher[T-2]
00:31 Finale [c0cb88fe@Nightstar-14e5d099.mibbit.com] has quit [[NS] Quit: http://www.mibbit.com ajax IRC Client]
00:35 You're now known as TheWatcher[zZzZ]
00:56
<@Vornicus>
http://community.livejournal.com/cs_lectures/4959.html
02:11 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?]
02:11 Derakon[AFK] is now known as Derakon
02:14
< Rhamphoryncus>
Vornicus: ahh thanks. Is that in the context of C?
02:16
<@Vornicus>
This is in... no particular context.
02:16
<@Vornicus>
I don't know which ones are used where.
02:16
< Rhamphoryncus>
Well, it is language dependant. You implied it's hardware dependant
02:17
<@Vornicus>
It may be! I don't actually know.
02:20
< Rhamphoryncus>
doh, I was confusing python's negative dividend handling with that of negative divisors
02:22
< Rhamphoryncus>
It does follow your second example
02:25 * Rhamphoryncus notes that ceiling division doesn't have a good matching modulo definition
02:25
<@Vornicus>
Indeed not.
02:27
< Rhamphoryncus>
hrm. It does have a modulo, but it's not a remainder
02:38
< Rhamphoryncus>
amusingly, wikipedia uses an example of a clock, but with 0 instead of 12
02:39
< Rhamphoryncus>
modular arithmetic was introduced in 1801 o.O
02:42
<@McMartin>
We didn't really Get finite algebra until shockingly recently.
02:43
<@McMartin>
Group theory and such was still getting pretty ridiculously basic, important results well into the 20th century
02:44 * Rhamphoryncus nods
02:44
< Rhamphoryncus>
yet we undoubtably used it, just not in a formal sense
02:45
<@McMartin>
A lot of it isn't useful until you get digital computers.
02:46
<@McMartin>
The group consisting of the set Z256 x Z256 x Z256 under addition, for instance, is basically a curiosity until it becomes the formal specification for 24-bit color mixing.
02:46
< Rhamphoryncus>
heh
02:46
<@McMartin>
(And is one of a vast number of groups with 2^24 elements, each with subtly different arithmetic behavior)
02:47
<@McMartin>
(But there are many more that look different but behave identically)
02:47
< Rhamphoryncus>
what's Z256 mean?
02:47
<@McMartin>
The integers, modulo 256.
02:47 * Rhamphoryncus 's real knowledge is far too limited :(
02:47
< Rhamphoryncus>
oh THAT Z, heh
02:47
<@McMartin>
The Z should be all fancy and the 256 should be a subscript
02:47
<@McMartin>
The x there is "Cartesian Product"
02:48
<@McMartin>
There are two 4-element addition groups.
02:48
<@McMartin>
Z4, and Z2 x Z2.
02:48
<@McMartin>
Which is basically "two bits, added with carry" and "two bits, added independently"
02:48
<@McMartin>
One very fun result is that given the usual definitions of addition and multiplication for modular integer arithmetic...
02:49
<@McMartin>
Z_n is a properly formed field (that is, +, -, *, / all work, are all always defined except for division by zero, + is commutative, and the associative and distributive laws work) whenever n is prime.
02:49
<@McMartin>
Furthermore, every field with a finite number of elements in it ends up being exactly equivalent to Z_n (n prime).
02:49
<@McMartin>
Just with different names, basically.
02:51
< Rhamphoryncus>
aha, there it is! U+2124. Z???
02:52
< Rhamphoryncus>
Interestingly, unicode now has a-z of that typeface. Most are outside the BMP though
02:54
< Rhamphoryncus>
heh. 52 entries, capital and lowercase, but 7 blanks because they were previously assigned elsewhere :)
03:00
< Rhamphoryncus>
ahh unicode. Now I can use x instead of x, even when I don't have an italic typeface available
03:01 * Rhamphoryncus wonders if we might one day replace unicode with something integrating some style instructions
03:04 * simon` is trying to install DrScheme
03:06
<@Vornicus>
<3 abstract algebra.
03:08
<@ToxicFrog>
<3 drscheme
03:08
<@ToxicFrog>
Prof today was extolling the virtues of APL
03:09
<@Vornicus>
....
03:10
<@Vornicus>
Rhamphoryncus: "integrating some style instructions" usually says "HTML" nowadays.
03:10
<@ToxicFrog>
(APL is actually pretty sweet...if you have a keyboard that can emit heiroglyphics)
03:11 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: ]
03:12
< simon`>
ToxicFrog, irssi
03:12 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
03:12 mode/#Code [+o Vornicus] by Reiver
03:15
<@ToxicFrog>
simon`: more wondering what os
03:16
< simon`>
ToxicFrog, I'm at my dept. terminal system running Gentoo through SunRay 270s.
03:18
< simon`>
my own laptop, which of its charger is broken these days, runs ubuntu.
03:20
< simon`>
meh
03:20
< simon`>
still segfaults.
03:23 AnnoDomini [farkoff@Nightstar-ea7cf236.adsl.tpnet.pl] has quit [[NS] Quit: No one can think without magic... though there are probably 2 mages for every thousand people, and one of them is most assuredly just a twit with a hat and a rabbit trying to score chicks with his magic missiles.]
03:43 Attilla [The.Attilla@FBC920.58502B.745E20.B29ABB] has quit [[NS] Quit: ]
04:26
<@Derakon>
I will never understand why bc catches ctrl-C and prints a little message telling you to type "quit" to exit.
04:26
<@Derakon>
Why not just exit when you do ctrl-C?
04:35
<@Vornicus>
Okay, infix rules. Start in operand mode. If you see a unary operator or an lparen, push to operators and remain in operand mode. If you see an operand, push to the operand stack and switch to operator mode. Otherwise fail.
04:36
<@Vornicus>
When in operator mode, if you see an operator, pop-process all operators of /equal or lower/ priority from the operator stack before pushing.
04:36
<@Derakon>
What is this for?
04:37
<@Vornicus>
If you see an rparen, pop-process until you see an lparen (if you don't, fail).
04:37
<@Vornicus>
Writing a calculator.
04:38
<@Vornicus>
For postfix ops and parens, remain in operator mode. Otherwise switch to operand mode.
04:38
<@Vornicus>
At the end of the string, pop-process /everything/ - if you see an lparen, fail.
04:41
<@Vornicus>
hm, but exponentiation is associative in the other direction.
05:02 Syloqs-AFH [Syloq@is.an.awesome.Network.Administrator.on.Nightstar.Net] has quit [Connection reset by peer]
06:26 * Rhamphoryncus kicks xchat for somehow losing that nick highlight
06:27
< Rhamphoryncus>
Vornicus: HTML-ish, yeah. I don't know if I'd want to be limited to what HTML provides. I'd definitely not want to support even a significant amount of it
06:29
< Rhamphoryncus>
and hrm.. extensibility.. I don't want random shit payloaded in my text.
07:09 Derakon is now known as Derakon[AFK]
08:28 Vornicus is now known as Vornicus-Latens
08:59 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has quit [Client exited]
09:06 You're now known as TheWatcher
09:53 gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code
10:47 AnnoDomini [farkoff@Nightstar-c01d3977.adsl.tpnet.pl] has joined #code
10:47 mode/#Code [+o AnnoDomini] by Reiver
10:51 AnnoDomini [farkoff@Nightstar-c01d3977.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
10:54 AnnoDomini [farkoff@Nightstar-c01d3977.adsl.tpnet.pl] has joined #code
10:54 mode/#Code [+o AnnoDomini] by Reiver
11:01 Attilla [The.Attilla@FBC920.58502B.745E20.B29ABB] has joined #code
11:01 mode/#Code [+o Attilla] by Reiver
11:22 dmlandrum [dmlandrum__@Nightstar-4a1a4f19.sfldmi.ameritech.net] has quit [Ping timeout: 121 seconds]
13:50<~Reiver> Quick math problem. This should be easy, but my brain is fail.
13:51<~Reiver> You have a number sequence of x = x+4, so it goes 1,5,9,13,17,21,etc, up to 200.
13:51<~Reiver> How many steps are needed to hit the cap?
13:51<~Reiver> And what would the cumulative total be when they do?
13:53
< simon`>
1) 25
14:04
< simon`>
err, 50!
14:05
< simon`>
Prelude> sum (take 50 [x*4+1 | x <- [0..]])
14:05
< simon`>
4950
14:06
< simon`>
err, so that'd be 51 steps to hit the cap.
15:40 Reiver [reaverta@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: I ATENT'T DEAD]
15:52 dmlandrum [dmlandrum__@Nightstar-fab1cd53.sfldmi.ameritech.net] has joined #code
16:05 Syloqs_AFH [Syloq@is.an.awesome.Network.Administrator.on.Nightstar.Net] has joined #code
16:06 Syloqs_AFH is now known as Syloqs-AFH
16:22 Derakon[work] [Derakon@Nightstar-d44d635e.ucsf.edu] has joined #code
16:59
<@Vornicus-Latens>
a_k = a_{k-1} + n up to N is N // n if a_0 > N % n, and N // (n + 1) if a_0 <= N % n.
17:01 Rhamphoryncus [rhamph@Nightstar-a62bd960.abhsia.telus.net] has joined #code
17:02
<@Vornicus-Latens>
That's if you include N in your list. if it's not included, use >= and < instead.
17:02
<@Vornicus-Latens>
And Reiver isn't here.
17:02
<@Vornicus-Latens>
Bastard.
17:50 Derakon[work] [Derakon@Nightstar-d44d635e.ucsf.edu] has quit [[NS] Quit: Leaving]
18:05 * SmithKurosaki confused
18:07
<@TheWatcher>
about 4 hours, 15 minutes ago Reiv asked a maths question. Vorn was just answering it, but Reiv quit 2 hours, 25mins ago
18:08
<@TheWatcher>
http://www.starforge.co.uk/irclogs/code/code.20091007.log.html#m1350-0 as a matteroffact
18:09
<@TheWatcher>
(also, I really need to fix up my log display code to handle ~ and & users ;.;)
18:12
< SmithKurosaki>
http://www.cracked.com/blog/using-windows-7-may-lead-to-murder/
18:24 Derakon[work] [Derakon@Nightstar-d44d635e.ucsf.edu] has joined #code
19:35 * Derakon[work] finds a bug in the microscope code that looks roughly like this:
19:35
< Derakon[work]>
for i, item in enumerate(listOfItems):
19:35
< Derakon[work]>
for i, j in range(someNumber):
19:35
< Derakon[work]>
doSomething()
19:35
< Derakon[work]>
doSomethingElse()
19:36
< Derakon[work]>
The bug of course is that the value of the main loop's "i" gets changed in the inner loop.
19:36
< Derakon[work]>
What I find interesting, though, is that the right number of outer-loop iterations are still performed.
19:36
< Derakon[work]>
In other words, changing the value of i cannot cause you to skip (or repeat) loop iterations.
19:45
< gnolam>
Rargh. Virus warning chain letter. :P
19:46 * gnolam sends it to Davy Jones's locker.
19:48
< gnolam>
Of course, telling Mailman to send it to the great grey void is the easy part. Sending a nastygram to the originator is the hard part. :P
19:56 crem [moo@Nightstar-8ca3eea7.adsl.mgts.by] has quit [Client closed the connection]
20:03 crem [moo@Nightstar-8ca3eea7.adsl.mgts.by] has joined #code
20:06
< gnolam>
(Especially since I have to be /nice/ to her)
20:11 Derakon[AFK] [Derakon@Nightstar-5abd3ac9.ca.comcast.net] has quit [Operation timed out]
20:17
< dmlandrum>
Just keep in mind, she really believes she's just trying to be helpful. :-)
20:20
< gnolam>
That's what I had to tell my self, over and over again. Through gritted teeth. :P
20:25
< gnolam>
In other news, Lagrangian mechanics and food poisoning don't really mix...
21:03 Derakon[work] [Derakon@Nightstar-d44d635e.ucsf.edu] has quit [[NS] Quit: Leaving]
21:03 AnnoDomini [farkoff@Nightstar-c01d3977.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
21:07 AnnoDomini [farkoff@Nightstar-c01d3977.adsl.tpnet.pl] has joined #code
21:35
< SmithKurosaki>
Oh?
21:35
< SmithKurosaki>
Also. You have succesfully found something you can't stab. Congrats!
21:41 * gnolam stabs bacteria, Lagrangian mechanics and bicycle manufacturers with a rusty shiv.
21:48 papabaer [NSJChat@Nightstar-31171e1d.ewetel.net] has joined #code
21:50 papabaer [NSJChat@Nightstar-31171e1d.ewetel.net] has quit [[NS] Quit: Nightstar's Java Chat http://www.nightstar.net]
21:54
< SmithKurosaki>
Ouch. That's pretty harsh
21:57
< AnnoDomini>
Even beneficial bacteria?
23:04 Finale [c0cb88fe@Nightstar-14e5d099.mibbit.com] has joined #code
23:08 AnnoDomini [farkoff@Nightstar-c01d3977.adsl.tpnet.pl] has quit [[NS] Quit: "Hello, old friend." "Why did you wake me?" "It's time for war." "It's always time for war."]
23:13 Kazriko [kaz@teela.arkaic.com] has quit [Ping timeout: 121 seconds]
23:24 Kazriko [kaz@teela.arkaic.com] has joined #code
23:44 You're now known as TheWatcher[T-2]
23:49 You're now known as TheWatcher[zZzZ]
23:50
< gnolam>
Hmm. I seem to have found a decent TFT screen at last.
23:51
< gnolam>
It's rather pricey, but it actually seems to do good colors together with good response times and input lag.
--- Log closed Thu Oct 08 00:00:57 2009
code logs -> 2009 -> Wed, 07 Oct 2009< code.20091006.log - code.20091008.log >