code logs -> 2012 -> Sun, 24 Jun 2012< code.20120623.log - code.20120625.log >
--- Log opened Sun Jun 24 00:00:49 2012
00:02
< Tarinaky>
I swear Eclipse is designed to make it as difficult as possible to install plugins.
00:08
< celticminstrel>
Heh.
00:08
< celticminstrel>
Eclipse is a bit like emacs in the sense of providing lots of power with a mediocre interface.
00:11
<@rms>
Eclipse is Eight Gigabyes and Constantly Swapping?
00:19 You're now known as TheWatcher[T-2]
00:21
< celticminstrel>
Okay, thinking of how to do Java-like stuff with enums in such a way that adding a new enumerator will cause an error if I forget to add the associated data...
00:22 You're now known as TheWatcher[zZzZ]
00:25 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [[NS] Quit: Well, most things get better when I kick them!]
00:34 Attilla_ is now known as Attilla
00:38
< celticminstrel>
Argh suddenly it's generating warnings for Boost code... seemingly for Boost code that isn't even enabled by the preprocessor...
00:41
< celticminstrel>
And why do I have to explicitly tell it to search in /Library/Frameworks and /usr/local/{include,lib}?
00:54 iospace is now known as io|fooding
01:49 io|fooding is now known as iospace
02:04
<@ToxicFrog>
Because those aren't part of the default search path?
02:40 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
02:42 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
02:42 mode/#code [+o ToxicFrog] by ChanServ
03:23
<&McMartin>
Heh
03:23 * McMartin writes up his NES macro file, notices after the fact that this has been 8.3'd to "Bromines"
03:23 Kindamoody[zZz] is now known as Kindamoody
03:34
< celticminstrel>
But um, normally they are...?
03:53 Attilla [Obsolete@Nightstar-835f7a04.as43234.net] has quit [Ping timeout: 121 seconds]
04:28 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.]
04:39 Vash [Vash@Nightstar-e8057de2.wlfrct.sbcglobal.net] has joined #code
04:39 mode/#code [+o Vash] by ChanServ
04:39 Noah [nbarr@Nightstar-9368be0f.pools.spcsdns.net] has quit [Client closed the connection]
04:40 Noah [nbarr@Nightstar-9368be0f.pools.spcsdns.net] has joined #code
04:43 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
04:56 iospace is now known as iospacedout
04:57
< celticminstrel>
I was wondering why it was taking so long to compile one file. I had an array with 256 elements using C99 initializers, but didn't specify the size in the declaration, so I just put that in and boom. Suddenly it compiles quickly.
05:30
< Rhamphoryncus>
heh
05:30
< Rhamphoryncus>
sounds like a compiler bug
05:44 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has quit [Client exited]
05:47 * McMartin runs afoul of hardware quirks on the NES, faithfully put into emulators as an assert()
05:48 Kindamoody is now known as Kindamoody|shower
06:12 Derakon is now known as Derakon[AFK]
06:38 Kindamoody|shower is now known as Kindamoody
06:42
< celticminstrel>
It takes about five seconds after pressing page up/down to display the next page of my help... that doesn't seem good...
06:43
< celticminstrel>
I wonder whether the time is more in the parsing or the rendering...
06:58
< celticminstrel>
If it's in the parsing I could probably pre-parse it into some kind of intermediate format...
07:01
<~Vornicus>
Only one way to know.
07:01
<~Vornicus>
Profile, profile, profile.
07:04
< celticminstrel>
Yeah. :/
07:04
<~Vornicus>
At the very least you can send a render event saying "parsing" and another saying "rendering" while it does the work.
07:05
<~Vornicus>
What format is your help page in?
07:06
< celticminstrel>
Plain text with embedded formatting codes.
07:06
<~Vornicus>
So we're looking at, basically, IRC-shaped text?
07:07
< celticminstrel>
Um... I guess that's a reasonably accurate description.
07:07
<~Vornicus>
That shouldn't be too hard to parse and render, obviously; how are you doing the rendering? Is your chosen font monospace or proportional?
07:07
< celticminstrel>
Proportional (Arial).
07:08
<~Vornicus>
Okay, I presume you're using a prerolled renderer.
07:08
< celticminstrel>
What do you mean?
07:09
<~Vornicus>
Like, you have a library that all it does is draw (probably individual) lines of text.
07:09
< celticminstrel>
Ah, yes.
07:09
< celticminstrel>
Well, I have a library that does it, yes.
07:10
<~Vornicus>
All right. How are you deciding where to wrap lines?
07:10
< celticminstrel>
I have a function that I wrote which does this.
07:11
<~Vornicus>
Okay, what's the function do to do this?
07:12
<~Vornicus>
Does it trial render (bad) or are you adding up glyph strides from the font?
07:12
< celticminstrel>
It starts searching for spaces from the start of the string and composes the line one word at a time. Um. It might be trial rendering?
07:13
< celticminstrel>
The library didn't provide a function to measure a string.
07:13
<~Vornicus>
Oh I see.
07:13
< celticminstrel>
Adding glyph strides is something I can do within the library...
07:14
<~Vornicus>
Might work better - fewer render steps that way.
07:20
< celticminstrel>
My debug output insists that measuring the text takes 0ms for nearly any string...
07:20
< celticminstrel>
Can that be right?
07:21
<~Vornicus>
This is using the render-measure, or glyph strides?
07:21
< celticminstrel>
I haven't changed it yet.
07:21
< celticminstrel>
I'm not actually sure whether it's rendering.
07:24
< celticminstrel>
Text wrapping however has really variable times even though the measuring still says 0 each time.
07:43 Vash [Vash@Nightstar-e8057de2.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
08:05 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
11:21 You're now known as TheWatcher
12:34 Attilla [Obsolete@Nightstar-fdbc4a68.as43234.net] has joined #code
12:59 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Client closed the connection]
12:59 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
14:00 Attilla [Obsolete@Nightstar-fdbc4a68.as43234.net] has quit [Ping timeout: 121 seconds]
14:00 Attilla [Obsolete@Nightstar-fdbc4a68.as43234.net] has joined #code
14:25 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
15:14 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
15:27 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
15:28 iospacedout is now known as iospace
15:48 RichyB [MyCatVerbs@Nightstar-d5ab3a1d.bb.sky.com] has joined #code
16:01 Syloq_Home [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Connection reset by peer]
16:03
< celticminstrel>
I wonder if there's anything I can do to improve my text wrapping other than the measuring part...
16:17 Kindamoody [Kindamoody@Nightstar-6154a72a.tbcn.telia.com] has quit [Connection reset by peer]
16:18 Kindamoody [Kindamoody@Nightstar-6154a72a.tbcn.telia.com] has joined #code
16:18 mode/#code [+o Kindamoody] by ChanServ
16:19
<@ToxicFrog>
The Clojure repl could use some improvement :/
16:20 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has joined #code
16:56
< froztbyte>
http://dank.qemfd.net/tabpower/gradexam.pdf
17:18 RichyB [MyCatVerbs@Nightstar-d5ab3a1d.bb.sky.com] has quit [[NS] Quit: Leaving]
17:40 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
17:54 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
17:59 rms is now known as Vasi
18:22
< Noah>
''.join([num for num in str(datetime.datetime.now())[:-3] if num.isdigit()])
18:22
< Noah>
Should give me a sufficient timestamp to use as an id, yar?
18:24
< Noah>
I could probably drop the first 2 as well, since that would give me 15 digits
18:25
< froztbyte>
why a timestamp as ID?
18:26
< Noah>
To be sure there's no conflict, while still giving useful info, instead of being just a completely arbitrary number
18:26
<@Vasi>
Why not use something standardized, like UUIDs?
18:26
< froztbyte>
yeah, I'd suggest doing that instead
18:26
< froztbyte>
timestamps aren't guaranteed to be unique
18:26
< froztbyte>
formatting could confuse people, etc
18:27
<@ToxicFrog>
What the hell is this
18:27
<@Vasi>
MongoIDs are similar, except they have known ways of getting the timestamp out.
18:27
< froztbyte>
UUIDs are what you need and then you're done/done
18:27
<@ToxicFrog>
find ../.. | wc -l => 30508
18:27
< Noah>
It'll be generated by the program solely
18:27
<@ToxicFrog>
(count (file-seq "../..")) => 36098
18:27
<@Vasi>
find will give the directories
18:27
<@ToxicFrog>
So does file-seq.
18:28
< froztbyte>
Noah: what happens if your program runs fast enough to have multiple entities per second?
18:28
<@TheWatcher>
Shambolic links?
18:28
<@ToxicFrog>
And if file-seq didn't, I'd expect its count to be lower, not higher, than find's.
18:28
< Noah>
froztbyte: It shouldn't, the ids will be used on human input
18:28
< froztbyte>
ToxicFrog: build a list of both, do big-small, display output :)
18:28
<@ToxicFrog>
"big-small"?
18:28
< Noah>
I would hope that in milli (micro?) seconds, that should be safe
18:28
< froztbyte>
err, read that mathematically
18:29
<@Vasi>
L2comm
18:29
< froztbyte>
subtract the small set from the large set
18:29
<@ToxicFrog>
Oh
18:29
<@Vasi>
That's what comm does.
18:29
< froztbyte>
yup
18:29
<@Vasi>
Outputs need to be two files though
18:29
< froztbyte>
easy enough to do with some > action
18:31
< Noah>
froztbyte: The input will go into a bot from IRC, and from different people
18:31
<@ToxicFrog>
Yeah, I may end up having to do that :/
18:32
< froztbyte>
Noah: then I guess it might be fine
19:02 Derakon[AFK] is now known as Derakon
19:11 Kindamoody is now known as Kindamoody[zZz]
19:14
< Noah>
<3 easy_install
19:35 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
19:36 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
19:36 mode/#code [+qo Vornicus Vornicus] by ChanServ
19:55 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
19:57 Derakon is now known as Derakon[AFK]
20:56 * celticminstrel finds a review of Xcode 4 and discovers one or two previously unnoticed features. \o/
21:05
<@TheWatcher>
.... if you need a review to find them...
21:13
< celticminstrel>
?
22:13
<@ToxicFrog>
McMartin: ok, so, something that kind of bugs me about Clojure (and Lisps in general) compared to more OO languages is that it reads back-to-front
22:14
<@ToxicFrog>
Eg, (show-dupes (dupes (same-size (list-files (...))))) rather than (...).list-files.same-size.dupes.show
22:14
<@ToxicFrog>
I could write a construct to fix this, but I'm wondering if there's something built in
22:22
<@ToxicFrog>
(defn pipe [val & fns]
22:22
<@ToxicFrog>
(reduce #(%2 %1) val fns))
22:22
<@ToxicFrog>
(pipe *command-line-args*
22:22
<@ToxicFrog>
first files same-size vals flatten dupes show-dupes)
22:23
<@ToxicFrog>
\o/
22:49
<@ToxicFrog>
Seriously, Java? SERIOUSLY?
22:49
<@ToxicFrog>
isSymbolicLink() isn't available until Java 7?
22:57
<@ToxicFrog>
safkjs;lkgjwaighaiurdhgasiuhfsaojfasf
22:59
<&McMartin>
TF: There's a -> and a .. operator in Clojure that do this interleaving thing as well.
23:07
<@ToxicFrog>
Aha
23:24
<&McMartin>
Also doto, for when you want to do this to objects that don't support chained calls like that \o/
23:25 Vasi is now known as rms
23:33
<@ToxicFrog>
Oh god whyyyyyyy
23:33
<@ToxicFrog>
Found the problem
23:33
<@ToxicFrog>
(file-seq) follows symlinks
23:34
<&McMartin>
Hm. if isSymbolicLink() is a late add, file-seq is probably just blindly forwarding to FileInputStream/FileReader
23:36
<@ToxicFrog>
file-seq is ftw(), it doesn't actually read file content
23:37
<@ToxicFrog>
Problem is that, since it follows symlinks, it will happily return the same file multiple times, or just get caught in a loop if there's a cycle in the filesystem.
23:39
<@ToxicFrog>
The obvious solution here is "tell it not to follow symlinks", but there's no API to do that, and I'm not sure the underlying implementation can do that in any case since, well, there's no way of telling if something is or is not a symlink until Java 7.
23:39
<@ToxicFrog>
This simple learning project has gotten surprisingly ugly :/
23:41
<@ToxicFrog>
McMartin: is there an equivalent to "forall" in clojure, for applying a side-effectual function like println to a seq and discarding the results?
23:43
<&McMartin>
I believe that "doall" function we found before is the one that does it.
23:43
<&McMartin>
There's also doseq but that's closer to "for"
23:45
<@ToxicFrog>
"doall" forces the seq
23:45
<@ToxicFrog>
So you go (doall (map f seq))
23:45
<@ToxicFrog>
I'm looking for (forall f seq), which doesn't bother building a result-sequence that will just be thrown away anyways.
23:45
<@ToxicFrog>
And makes it clear to the reader that it's the side effects I care about, not the return values.
23:46
<&McMartin>
To the cheat sheet
23:46
<&McMartin>
dorun.
23:47
<&McMartin>
http://clojuredocs.org/clojure_core/clojure.core/dorun
23:48
<@ToxicFrog>
woot
23:48
<@ToxicFrog>
Still needs to wrap a map, though
23:51 Derakon[AFK] is now known as Derakon
23:51
<&McMartin>
Well, yeah, but that's because map is the primitive "do this function to each element of this thing"
23:51
<&McMartin>
If you just want to save typing that's what macros are for >_>
23:51
<&McMartin>
dorun is what you want here, though, not doall because dorun doesn't do the seq of return values.
23:54 * ToxicFrog nods
23:59
<@ToxicFrog>
I'm still not thinking lazily, I guess
--- Log closed Mon Jun 25 00:00:04 2012
code logs -> 2012 -> Sun, 24 Jun 2012< code.20120623.log - code.20120625.log >

[ Latest log file ]