code logs -> 2011 -> Thu, 21 Jul 2011< code.20110720.log - code.20110722.log >
--- Log opened Thu Jul 21 00:00:46 2011
00:02 shade_of_cpux is now known as cpux
00:09
< TheWatcher>
Walking of UIs and lightwave, WTB 'Reset perspective view' option for modeller. They have it in layout, ffs, so why not modeller?!
00:09
< TheWatcher>
*talking
00:10 Vornicus [vorn@Nightstar-366fd9eb.ct.comcast.net] has quit [Ping timeout: 121 seconds]
00:13 cpux_ [chatzilla@Nightstar-c5874a39.dyn.optonline.net] has joined #code
00:13 AbuDhabi [annodomini@Nightstar-868cccbf.adsl.tpnet.pl] has quit [[NS] Quit: Zzz.]
00:13 cpux [chatzilla@Nightstar-c5874a39.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
00:13 cpux_ is now known as cpux
00:14 Vornicus [vorn@Nightstar-366fd9eb.ct.comcast.net] has joined #code
00:18 You're now known as TheWatcher[T-2]
00:20 You're now known as TheWatcher[zZzZ]
00:21 Kindamoody|out [Kindamoody@Nightstar-bf821597.tbcn.telia.com] has joined #code
00:23 Kindamoody|out is now known as Kindamoody
00:27 kwsn [t1gg@31356A.5FD175.3E1307.550A93] has joined #code
00:29 * kwsn waves
00:32 Kindamoody [Kindamoody@Nightstar-bf821597.tbcn.telia.com] has quit [Ping timeout: 121 seconds]
00:34 Kindamoody [Kindamoody@Nightstar-cb7a615d.cust.tele2.se] has joined #code
00:48 Derakon [Derakon@Nightstar-c826c088.ca.comcast.net] has quit [Client exited]
00:51 Derakon [Derakon@Nightstar-c826c088.ca.comcast.net] has joined #code
01:18 Derakon [Derakon@Nightstar-c826c088.ca.comcast.net] has quit [Client exited]
01:18
< McMartin>
Blargh
01:18 * McMartin breaks out the Refactor Tractor.
01:20 Derakon [Derakon@Nightstar-c826c088.ca.comcast.net] has joined #code
01:25 Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [[NS] Quit: If the world didn't suck, we'd all fall off.]
01:39 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
01:40 * Vornicus should get around to learning haskell.
01:40 Omega [omegaboot@Nightstar-853936c8.il.comcast.net] has joined #code
01:42 Alek [omegaboot@Nightstar-853936c8.il.comcast.net] has quit [Ping timeout: 121 seconds]
01:44 Kindamoody [Kindamoody@Nightstar-cb7a615d.cust.tele2.se] has quit [[NS] Quit: See you in an hour or so, I hope! :)]
01:50
< McMartin>
Man, I've forgotten a lot of my Haskell, especially the program-organization parts.
02:02
< McMartin>
Ugh, but the GM8 sim is going to be a mess. I'd better not take it on first.
02:02
< McMartin>
Since I've never actually tried to interweave two sets of state monads before, and I'd need to do that for this.
02:03
< McMartin>
(At minimum, I need I/O and a source of randomness for the object AIs.)
02:06 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
02:09 * McMartin eyebrows. "Haskell's FFI is a lot cleaner than I remember it being."
02:14
< McMartin>
Also, ha ha, I found my (redundant, IIRC) UTF-8 module I wrote back in the day
02:14
< McMartin>
This is one enormous pile of whitespace abuse
02:15
< McMartin>
http://pastebin.starforge.co.uk/477
02:20
< Vornicus>
That's pretty abusey.
02:22
< McMartin>
Everything important lines up with its parallels on the other match clauses, though!
02:22
< McMartin>
I also do a terrifying number of zero-point definitions.
02:23
< McMartin>
Seriously, check out the definitions of "inRange" and "innerChar" there.
02:24
< Vornicus>
lines 30 and 31?
02:24
< McMartin>
Yeah
02:25
< Vornicus>
I don't get what you mean.
02:26
< McMartin>
31 can be improved, actually: foldr (&&) True has the much more convenient alias "all" in the prelude.
02:26
< McMartin>
inRange is a function of three arguments, presented as an incompletely specified function of two arguments.
02:26
< McMartin>
inRange returns the composition of ord with a lambda that does a "between these two values" evaluation.
02:27
< McMartin>
The actual argument - you know, the character you're checking the range of - appears nowhere in the definition.
02:27
< McMartin>
(This is called 'zero-point' because the 'point' - the thing you're really operating on - never appears)
02:28
< McMartin>
(Unfortunately, the point - that is, the . operator, which is function composition - is all over the place *in* said definitions.)
02:28
< McMartin>
But yeah, to do it properly
02:29
< McMartin>
Line 31 should be the much more readable
02:29
< McMartin>
innerChar = all (inRange 0x80 0xC0)
02:30
< McMartin>
(It's a test that its argument - a list of characters - are all characters from the middle or end of a multibyte UTF-8 character)
02:30
< Vornicus>
why don't you use inRange in utf8_chr
02:31
< McMartin>
inRange is Int -> Int -> [Char] -> Bool
02:31
< McMartin>
utf8_chr is Int -> [Char]
02:32
< McMartin>
Er
02:32
< McMartin>
inRange is Int -> Int -> Char -> Bool
02:32
< McMartin>
That is, it tells you if a character is between two code points
02:32
< McMartin>
utf8_chr takes a code point, but not a character.
02:33
< McMartin>
(This whole module is kind of misguided, as there is a TextEncoding module already in the stdlib, which is how you are supposed to do these conversions.)
02:33
< Vornicus>
So in python, inrange would be def inRange(min, max, c): return min <= ord(c) < max ?
02:34
< McMartin>
Yeah.
02:34
< McMartin>
That ord(c) there is the " . ord" at the end
02:34
< McMartin>
It's composing the double range compare with the ord function so that I don't have to type it as much. =P
02:35 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Z?]
02:36
< McMartin>
Though looking at it more deeply, it looks like the TextEncoding stuff is actually a GHC-specific thing, and so it isn't the stdlib after all.
02:43
< McMartin>
That said, I'm also Totally Doing It Wrong in the functions.
02:44
< McMartin>
toUtf8 shouldn't end with a string, it should end with [Int8]
02:50
< McMartin>
Hm, or not, because the IO functions seem to all be on Chars.
02:52
< McMartin>
Aha, now I remember. OK then!
02:52
< McMartin>
System.IO is standard, I guess?
02:59
< Vornicus>
I freaking hope so.
03:01
< McMartin>
Well
03:01
< McMartin>
IO is standard.
03:01
< McMartin>
GHC.IO.Encoding.UTF8 is pretty obviously nonstandard
03:01
< McMartin>
System.IO might be standard?
03:01
< McMartin>
GHC supports it, at any rate~
03:21
< kwsn>
friend wants to know
03:22
< kwsn>
best laptop company and no not apple
03:22
< kwsn>
(she specifically said that)
03:31
< Vornicus>
Not Dell
03:31
< Vornicus>
Lenovo took over IBM's thinkpad line, that might be good.
03:33 Kindamoody [Kindamoody@Nightstar-5507a6b5.tbcn.telia.com] has joined #code
03:49
< McMartin>
I preferred the old IBM ones, but Thinkpads are still Seriously Good.
03:50 celmin|away is now known as celticminstrel
04:03 Kindamoody is now known as Kindamoody[zZz]
04:05 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [[NS] Quit: If the world didn't suck, we'd all fall off.]
04:22 * McMartin gets a basic SDL program working in Haskell.
04:22
< McMartin>
That one was Monads All The Way Down, though, so I can do better than that, I think.
04:23 cpux is now known as shade_of_cpux
04:26 Vash [Vash@Nightstar-f03c5637.sd.cox.net] has joined #code
05:12 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code
05:35 Vash [Vash@Nightstar-f03c5637.sd.cox.net] has quit [Ping timeout: 121 seconds]
05:40 Vash [Vash@Nightstar-f03c5637.sd.cox.net] has joined #code
06:01 Vash [Vash@Nightstar-f03c5637.sd.cox.net] has quit [Ping timeout: 121 seconds]
06:11
< Phox>
So, is there a better alternative to scanf for bringing in numbers? It keeps leaving carriage returns floating around, messing up my inputs, and I don't really like prefacing every getchar with a while loop to clean the buffer.
06:14
< Derakon>
Write a utility function that wraps scanf~?
06:15
< Phox>
Ehhhhhh... too much work for a throwaway class.
06:16
< Phox>
I got dumped back into introductory programming for people who don't know how to find the on button, courtesy of a university transfer
06:22
< McMartin>
Phox: In a real program? "don't use C for your input library".
06:22
< McMartin>
C++ includes boost::lexical_cast<>, and a *serious* C program that's reading structured numerical input will probably have a flex-based parser in it.
06:22
< McMartin>
That will then let you turn numeric tokens into integers or floats via atoi or atof.
06:23 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
06:24
< Phox>
Flex-based? I'm using a finite state machine, which seems to work pretty alright. What's a flex-based parser?
06:25
< McMartin>
Flex is a program for automatically generating finite state machines for exactly this purpose~
06:25
< McMartin>
And really, it's a lexer, not a parser, but.
06:25
< McMartin>
(fair warning: I was a compiler geek. "Build a parser for it" is my answer to entirely too many things.)
06:25
< Phox>
Ah. I should look into that, then, because writing these parsers are so boring
06:26
< Phox>
*is
06:26
< McMartin>
For full-scale parsers in C, flex makes the lexer, and bison makes the parser.
06:29
< McMartin>
Also, regarding cleaning the buffer, it's been awhile, but can't you call fflush() on stdin?
06:30
< Phox>
Yeah, most likely. I think it has more overhead, though.
06:30
< McMartin>
By definition you are I/O bound here, you do not give a shit about overhead unless it's going to increase response time to a user gesture to 700ms or more
06:31
< Phox>
I suppose so, yeah. I hadn't thought of it that way.
06:31
< Phox>
Ah. But, this isn't in the middle of a string. The usage here is for the user to input a single character.
06:31
< McMartin>
Oh.
06:31
< McMartin>
Yeah, flex is not for that.
06:32
< Phox>
Yeah. I was asking about it in regards to a different part of the program
06:37
< Phox>
Hmm, that's weird.
06:38
< Phox>
I need to sit and actually look at what's going on in the OI buffer, some day.
06:38 kwsn is now known as kw\t-2
06:39
< Phox>
Using a while loop to clear the buffer makes getchar require two carriage retures, if you clear it first
06:39
< Phox>
That's not what I had expected
06:40 kw\t-2 [t1gg@31356A.5FD175.3E1307.550A93] has quit [[NS] Quit: moo]
06:41 Derakon is now known as Derakon[AFK]
06:49 Vornicus [vorn@Nightstar-366fd9eb.ct.comcast.net] has quit [Ping timeout: 121 seconds]
07:02
< McMartin>
Phox: Traditionally when doing character-based interfaces, you don't use the stdlib to do it.
07:02
< McMartin>
On UNIX you'd either go into raw mode or wrap it in a library like curses - in Windows you'd use the relevant Console calls.
07:33 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
--- Log closed Thu Jul 21 07:43:03 2011
--- Log opened Thu Jul 21 07:43:17 2011
07:43 TheWatcher[zZzZ] [chris@Nightstar-3762b576.co.uk] has joined #code
07:43 Irssi: #code: Total of 21 nicks [0 ops, 0 halfops, 0 voices, 21 normal]
07:44 Irssi: Join to #code was synced in 49 secs
07:51 Janus [Clairvoire@Nightstar-b1ac186a.res.rr.com] has joined #code
08:32 Kindamoody[zZz] is now known as Kindamoody
08:54 Janus [Clairvoire@Nightstar-b1ac186a.res.rr.com] has quit [[NS] Quit: Seeya!]
09:29 You're now known as TheWatcher
10:13 AnnoDomini [annodomini@Nightstar-868cccbf.adsl.tpnet.pl] has joined #code
10:40 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has joined #code
10:57 Rhamphoryncus [rhamph@FFAAA3.3FB6E7.B88411.E1B9CD] has quit [Ping timeout: 121 seconds]
10:58 Rhamphoryncus [rhamph@Nightstar-7be32fa4.abhsia.telus.net] has joined #code
11:28 AbuDhabi [annodomini@Nightstar-01e6e158.adsl.tpnet.pl] has joined #code
11:31 AnnoDomini [annodomini@Nightstar-868cccbf.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
11:49 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code
12:06
< TheWatcher>
Sanity check, please. This should count how many inodes a given directory and all its files occupy: `find $dir -printf "%i\n" | sort -u | wc -l`
12:12 * TheWatcher also stabs rsync for being inconsistent
12:13
< TheWatcher>
I'm not sure there's any way for me to work out exactly how many inodes are going to be used by rsynced filesystem objects based on --stats --dry-run - "number of files transferred" seems to be just that, not including directories, symlinks, etc
12:16
< TheWatcher>
I guess I'm just going to have to enforce "Always have at least this many inodes free" during the code that deletes old backups
12:47
< gnolam>
It works!
12:47
< gnolam>
I can't believe it!
12:47
< gnolam>
And they said imitation diamond wasn't good enough...
12:56 Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection reset by peer]
13:08 sam89 [sam89@Nightstar-79d6ee85.bredband.comhem.se] has joined #code
13:08 sam89 [sam89@Nightstar-79d6ee85.bredband.comhem.se] has quit [[NS] Quit: http://irc2go.com/]
13:29 Kindamoody is now known as Kindamoody|out
14:33 Kindamoody|out is now known as Kindamoody
14:45 Kindamoody is now known as Kindamoody|shower
14:59 Kindamoody|shower is now known as Kindamoody
15:24 Kindamoody [Kindamoody@Nightstar-5507a6b5.tbcn.telia.com] has quit [[NS] Quit: See you in a few hours, or tomorrow. :)]
16:05 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
17:26 Reiver [orthianz@9C034E.E649EA.3194C7.8381A3] has quit [Client closed the connection]
17:28 Reiver [orthianz@9C034E.E649EA.3194C7.8381A3] has joined #code
18:11 Tarinaky is now known as Decker
18:20 Vornicus [vorn@Nightstar-366fd9eb.ct.comcast.net] has joined #code
18:47
< gnolam>
Re: the new OS X:
18:47
< gnolam>
"It's gray. Everything is gray. Gray, gray, gray, gray. Ugly gray scrollbars, ugly gray toolbars, it's like the entire OS was designed by a Communist-era Soviet committee four years behind on the next five-year plan."
19:07 cpux [chatzilla@Nightstar-c5874a39.dyn.optonline.net] has joined #code
19:07 shade_of_cpux [chatzilla@Nightstar-c5874a39.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
19:07 cpux is now known as shade_of_cpux
20:13 Vornicus [vorn@Nightstar-366fd9eb.ct.comcast.net] has quit [Ping timeout: 121 seconds]
20:23
< McMartin>
gnolam: I've heard it was more "it's an iPad! Just without the touchscreen or easy ways to do things that you wanted a computer for instead of an iPad. Why do you hate innovation so much?"
20:34 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
21:14 Vornicus [vorn@Nightstar-366fd9eb.ct.comcast.net] has joined #code
21:22
< celticminstrel>
Isn't OSX already grey?
21:24
< jerith>
celticminstrel: It's only mostly grey, not entirely grey.
21:24
< jerith>
For example, scrollbars are blue when your window has focus.
21:25
< celticminstrel>
Ah, they changed that?
21:27
< jerith>
Dunno. I tend not to use any major OS revision until it's had at least a month in the wild for other people to find the teething woes.
21:28
< McMartin>
My understanding was that 10.7 didn't have scrollbars.
21:28
< McMartin>
Did they fix that since the dev preview?
21:29
< jerith>
McMartin: From what I've seen on twitter, they made scrolling work backwards.
21:29
< McMartin>
Well, see my quote above.
21:29
< McMartin>
Look carefully at what you do when you throw a window with a touchscreen.
21:29
< jerith>
Which *really* sucks if you have to use any othe OS as well.
21:30
< McMartin>
Yes, mice and touchscreens are *different*
21:30
< celticminstrel>
Well, I know I'm not going to update for quite awhile.
21:30
< McMartin>
(It is counterintuitive but actually true that direct vs. indirect pointer input have opposite gestures for scrolling.)
21:31
< McMartin>
When I said "didn't have scrollbars" I mean 'there is no visible way to tell that there is more content in this pane than what is currently visible.'
21:47
< jerith>
That is unusably bad.
21:47
< jerith>
And is enough to get me over my laziness and back onto Linux.
23:05 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has joined #code
23:10
< McMartin>
Throwing windows with mice totally sucks =(
23:12 Vornicus [vorn@Nightstar-366fd9eb.ct.comcast.net] has quit [Ping timeout: 121 seconds]
23:16 * McMartin reads the Ars article about 10.7
23:16
< McMartin>
I do like the new look, though. Buttons are larger and squarer. =P
23:18
< McMartin>
Aha, the "scrolling is fucking backwards" thing is configurable via a setting.
23:24 Decker is now known as Tarinaky
23:25 Vornicus [vorn@Nightstar-366fd9eb.ct.comcast.net] has joined #code
23:33 Kindamoody [Kindamoody@Nightstar-2c65e204.cust.tele2.se] has joined #code
23:50 shade_of_cpux is now known as cpux
--- Log closed Fri Jul 22 00:00:14 2011
code logs -> 2011 -> Thu, 21 Jul 2011< code.20110720.log - code.20110722.log >

[ Latest log file ]