code logs -> 2012 -> Tue, 15 May 2012< code.20120514.log - code.20120516.log >
--- Log opened Tue May 15 00:00:12 2012
--- Day changed Tue May 15 2012
00:00
< RichyB>
It just happens to be a method which prints the current time, sat behind a copy of Varnish... :)
00:01
< Rhamphoryncus>
caching?
00:02
< RichyB>
Yes. Varnish is a really neat HTTP caching reverse-proxy.
00:02 * Rhamphoryncus nods
00:02
< RichyB>
Does like 8k rq/s off one core of a crummy laptop CPU... even before you start tuning it.
00:06
< froztbyte>
eventloops woo
00:06
< froztbyte>
but yeah
00:06
< froztbyte>
varnish and nginx are very good tools to know
00:06
< froztbyte>
interesting side fact which you may or may not know: nginx speaks a few more protocols natively than just http
00:09
< RichyB>
I didn't know that.
00:10
< RichyB>
IMAP? POP3? SMTP? What?
00:10
< froztbyte>
hehe
00:10
< froztbyte>
yup
00:10
< froztbyte>
(all of the above)
00:11
< RichyB>
Ugh, I would seriously have written those out.
00:11
< froztbyte>
my first encounter with nginx was in 2007
00:12
< froztbyte>
when only about 30% of the documentation wasn't russian
00:12
<&jerith>
Varnish is great.
00:12
< RichyB>
Or maybe it's not so bad. They're optional modules that aren't loaded by default, right? I guess they're "in" nginx so that they can benefit from its I/O framework.
00:12
< RichyB>
froztbyte, bloody Hell, that can't have been easy.
00:12 * jerith wrote a "config" that dlopen()ed a MySQL client library and looked up backend from a database.
00:13
< RichyB>
jerith, my "favourite" thing about Varnish is the fact that you can just drop C{ }C blocks in.
00:13
< froztbyte>
RichyB: it was certainly interesting :)
00:13
< RichyB>
"favourite" being "favourite thing to play with" rather than "favourite thing to put into production"
00:13
<&jerith>
RichyB: Yup, that's what I did.
00:13
<&jerith>
I'm not sure if this actually went into production, but it performed well in the load test.
00:14
< RichyB>
jerith, heh, guy I work with sometimes told me about how he'd used curl in the middle of vcl_hash in order to make authentication checks against his site's backend. :)
00:14
< froztbyte>
RichyB: more specifically, the need for investigating this application at the time was because the shared NFS box was deadlocking on files
00:14
< RichyB>
It was _really_ slow by Varnish's standards, but it still ended up being a win because the permissions checks were much quicker than rendering whole pages and it let them improve the hit rate enormously.
00:14
< froztbyte>
and there were just a variety of clusterbombs going on
00:14
< froztbyte>
also note that this was when I was *very* green
00:15
< RichyB>
You said "NFS" and "deadlock" in the same sentence.
00:15
< RichyB>
I'm glad I wasn't you at the time.
00:15
< froztbyte>
that was my first full-time job, as well as my first one getting paid money to do computer-y things
00:15
< froztbyte>
RichyB: haha
00:15
< froztbyte>
I cope really really well with stress like that, though
00:16
< froztbyte>
as far as I understand, most people start making mistakes and cracking
00:16
< froztbyte>
I go into hyperfocus mode
00:16
< RichyB>
I will admit to enjoying a certain amount of stress when I'm under it.
00:16
< froztbyte>
hehe
00:16
<&jerith>
RichyB: I was considering caching the db response, but it turned out not to be necessary.
00:17
< RichyB>
I find -knowing- what the time limit I'm under is to be a total bugbear, slows me down.
00:17
< froztbyte>
the usual time limits I deal with are "as fast as possible"
00:17
< froztbyte>
in those sort of conditions
00:17
< froztbyte>
in fact, earlier today is a good example
00:17
< RichyB>
Oh and after a big rush fix, I always just crash out and I'm useless for the next 24 hours or so. :P
00:17
< froztbyte>
AS37057 blew up all their things again (because they can't run power)
00:18
< froztbyte>
and I had to fix it all up, but basically a whole small african country's mobile internet was down while I was doing so
00:18
< froztbyte>
"15000 or more people are without internet until I make this work? cool."
00:19
< froztbyte>
now and then it strikes me that I'm probably certifiably mad in some ways :P
00:19
< RichyB>
jerith, did you do the dlopen() itself and the connection to the MySQLdb in vcl_init()? Or did you do it *all* per-request?
00:19
< RichyB>
heh
00:20
< RichyB>
I would assume that you'd do my_init() in vcl_init(), unless... you were working with a version of Varnish from before vcl_init was introduced.
00:20
<&jerith>
I dlopen()ed a .so that contained all the lookup code and called the setup in vcl_init() or wherever you do things that happen at startup.
00:20
<&jerith>
This was about a year or so ago.
00:20
<&jerith>
But it definitely wasn't setting everything up per-request.
00:20
< RichyB>
Ah, no worries then.
00:21
< RichyB>
Varnish 2.1 didn't have a vcl_init function, nor vmod support.
00:21
< RichyB>
They weren't expecting people to make so much use of C{ }C blocks at that point.
00:21
<&jerith>
This was before there was a proper way to load external code.
00:22
<&jerith>
But there was definitely a setup thing, even if it wasn't aimed at running arbitrary C code.
00:29 Derakon[AFK] is now known as Derakon
00:30
<&jerith>
Heya Derakon.
00:31
<&jerith>
Turns out the friend I'm staying with for the rest of the week lives just off Shoreline, so I'll be in the area still. :-)
00:32
<&jerith>
Have to head all the way into downtown SF on Wednesday or Thursday to meet Wikipedia, though.
00:41
<&Derakon>
Cool.
01:11
<&McMartin>
Man, clojure's hate-on for OO is heartwarming.
01:16
< RichyB>
Is it Java that you're contrasting that with? :)
01:17 Reiver [reiverta@5B433A.F67240.CC9FF0.A1A400] has joined #code
01:17
<&McMartin>
RichyB: No, I'm referring to lengthy digressions in the rationale and tutorial on clojure.org detailing the many sins of the OO design consensus.
01:18
< RichyB>
Cool!
01:18
<&McMartin>
"Encapsulation is folly"
01:18
<&McMartin>
Of course, he can say that because he has multimethods >_>
01:18
<&McMartin>
And dynamic rebinding, which gives you the equivalent of aspect-orientation for the places I'd quibble with that claim
01:19
<@Alek>
"You're mixing up C# and C." "Big deal, half a note of difference."
01:19
< RichyB>
Clojure has real macros, right?
01:20
<&McMartin>
RichyB: It looks like it, if by "real macros" you mean "Lisp-scale"
01:20
< RichyB>
I wonder if anyone ever tried writing a Clojure macro that tries to type-infer programs. :)
01:20
<&McMartin>
It's deliberately not fully compliant
01:20
<&McMartin>
With Lisp, that is
01:20
<&McMartin>
So I don't know exactly what the bounds of its macros are yet.
01:21
< RichyB>
( and ), probably. ;)
01:22
<&McMartin>
*rimshot*
01:42
<@ToxicFrog>
I really should try Clojure at some point
01:42
<@ToxicFrog>
I have yet to really get into any Lisp
01:43
<&McMartin>
Clojure strikes me as more Lisp-inspired than Lisp-proper, but that's honestly all to the good
01:43
<&McMartin>
Looking through its type system I'm not even comfortable calling it a Lisp dialect
02:04 Kindamoody[zZz] is now known as Kindamoody
02:16 * Vornicus arrives home
02:20
< RichyB>
McMartin, I'm pretty much sold on Clojure by the name of the tool "Leiningen".
02:20
< RichyB>
McMartin, https://github.com/technomancy/leiningen/ -> http://www.classicshorts.com/stories/lvta.html
02:20
< RichyB>
A handy tool for managing hundreds of ants. ^^
02:23 maoranma [maoranma@Nightstar-fc470d2b.pools.spcsdns.net] has quit [[NS] Quit: ]
02:27 Attilla [Obsolete@Nightstar-02604040.as43234.net] has quit [Ping timeout: 121 seconds]
02:34
< Reiver>
So I have a Math ponderance
02:35 Reiver [reiverta@5B433A.F67240.CC9FF0.A1A400] has left #code []
02:35 Reiver [reiverta@5B433A.F67240.CC9FF0.A1A400] has joined #code
02:35
< Reiver>
(I also have a touchy mouse pad)
02:37
< Reiver>
Let's say we have two sets of dice: Red and White. We will be rolling them together. Let us say we're counting successes as 4+ on either dice, but: Whites only count if you also score a Red.
02:37
< Reiver>
So Rw is a success, rW is nothing, rw is nothing, RW is an Awesome.
02:38
< Reiver>
Obviously the chance for successes at all is 50%, and the chance of an Awesome is 25%.
02:38
< Reiver>
But what happens if you're allowed to roll pools of each, and assign pairs after the fact?
02:40
< Reiver>
So you can roll 2 red, 2 white, and declare that oh look that R and that W were totally rolled as a pair, honest
02:45
<&McMartin>
RichyB: Ha ha, that's pretty great
02:47 Kindamoody is now known as Kindamoody|afk
02:49 * Reiver prods Vornicus, master of all things math
02:49
< Reiver>
McMartin: What's this then?
02:50
<&McMartin>
18:19 < RichyB> McMartin, I'm pretty much sold on Clojure by the name of the tool "Leiningen".
02:50
<&McMartin>
18:19 < RichyB> McMartin, https://github.com/technomancy/leiningen/ -> http://www.classicshorts.com/stories/lvta.html
02:50
<&McMartin>
18:20 < RichyB> A handy tool for managing hundreds of ants. ^^
02:50
< Reiver>
snrk
02:51
< Reiver>
Speaking of I need to investigate that not-IRSSI client this weekend
02:51
< Reiver>
(Not much point till then, given I need to rig Orthias machine as the server~)
03:12 eckse [eckse@Nightstar-3b021371.dsl.sentex.ca] has quit [Connection reset by peer]
03:15 eckse [eckse@Nightstar-3b021371.dsl.sentex.ca] has joined #code
03:15 mode/#code [+o eckse] by ChanServ
03:19 eckse_ [eckse@Nightstar-3b021371.dsl.sentex.ca] has joined #code
03:20 eckse [eckse@Nightstar-3b021371.dsl.sentex.ca] has quit [Ping timeout: 121 seconds]
03:21
< Reiver>
hiii vron
03:21
< Reiver>
So uh
03:21
<~Vornicus>
So uh
03:21
<&Derakon>
Uh so
03:21
< RichyB>
Is this the point in the conversation where the sexual tension kicks in?
03:22
< Reiver>
First: Question above!
03:22
< Reiver>
(While I set the background)
03:22
< RichyB>
Reiver, IRC client that isn't irssi? What, XChat? IrcII?
03:22
<&Derakon>
Richy: nah, we resolved all the sexual tension between us long ago.
03:22
<~Vornicus>
Reiver: okay, so are you always rolling the same number of whites and reds?
03:23
< RichyB>
Ah well. I guess the #code sitcom was never meant to be.
03:23 Reiver [reiverta@5B433A.F67240.CC9FF0.A1A400] has left #code []
03:23 Reiver [reiverta@5B433A.F67240.CC9FF0.A1A400] has joined #code
03:23
< Reiver>
Vorn: Yes
03:23
< Reiver>
(Note to self: Keep mouse pointer /off/ channel buttons~
03:23
<~Vornicus>
Okay, and is a white success worht the same as a red success?
03:24
< Reiver>
Preferably, they're a different success entirely.
03:24
<~Vornicus>
Oh I see.
03:24
<~Vornicus>
Okay, one moment
03:25
< Reiver>
Mostly interested in pools of 1, 2, 3 pairs
03:25
< Reiver>
... well actually let's ramp that all the way up to 6 as well.
03:25
<~Vornicus>
Was going to do that anyway.
03:26
< Reiver>
And then whether anything screwy happens re: 3+ or 5+.
03:26
< RichyB>
Your chances of completely failing red are 0.5**n, and your chances of completely failing white are 0.5**n.
03:27
< Reiver>
Yeah, that bit is easy.
03:27
< RichyB>
Er, are you after total expected value of successful pairs, rather than presence/absence?
03:27
< Reiver>
And given this isn't so much 'pass fail' as it is 'shots on target'...
03:27
<~Vornicus>
I usually do full strength graphs
03:28
< Reiver>
I do care about just how /many/ manage it on average :)
03:28
< Reiver>
(Vorn knows me well~)
03:29
< RichyB>
So, Rw is "shot on target" and RW is "critical hit", right?
03:29
< RichyB>
rW and rw are both "miss"?
03:32
< Reiver>
Correct.
03:32
< RichyB>
E(hit, at all) = 0.5*n, E(crit) = E(min(R, W))
03:34 * Vornicus gets a graph for 6. This is the kind of thing that's hard to do in a single graph for everything.
03:35 * Reiver understands!
03:36 Noah [maoranma@Nightstar-fc470d2b.pools.spcsdns.net] has joined #code
03:37
< Reiver>
Flames of War, aka FoW, is a truly excellent wargame system with solid rules and decent balance. It has rules that /actually work/ for everything from infantry to tanks to ambushes to bombardments to offscreen artillery to transports to the risk/reward of close quarter assaults... and it's a company-scale 15mm WWII game. It's worth noting there is a huge market of 15mm SF out there too. Thus,
03:37
< Reiver>
I was inspired to attempt SFoW. >_>
03:37
<&Derakon>
Call it Fusion of War instead~
03:37
< Reiver>
Hell, why not~
03:39
< Reiver>
Anyway: Power armor was trivial to the point of hilarity. There are /lots/ of neat little rules in or addable to the setup to give different forces their own quirks and flavours and technical limitataions, tradeoffs, etc. No sweat there. So anyway.
03:40
< Reiver>
The way you kill a tank: You roll to hit on a d6. On a success, the enemy rolls a d6, adds their Armor rating, and compares to your weapons Anti-tank rating. If they beat the AT, no effect. If they match, it's Glancing Hit. If they fail to match, it's Penetrating Hit.
03:42
< Reiver>
You then roll a Firepower test (eg, 5+, 4+, 3+ etc) (A semi-fixed value for the weapon, much like AT). Glance: On success, vehicle Disabled. On fail, Vehicle unharmed. Penerate: On success, Destroyed. On fail, Disabled.
03:43
< Reiver>
(Two disableds generally make a kill.)
03:43
< Reiver>
This is fast and nice, and works very well for gunz.
03:44
< Reiver>
But then I wanted to throw missiles into the system... annd given this is SFoW, where missiles, there is PDS.
03:44
< Reiver>
(Hell, we'll have that in the next /decade/ who are we kidding amirite)
03:44
<~Vornicus>
no, this is wrong so far...
03:45
< Reiver>
(Vorn: FWIW, the puzzle I gave was for something else)
03:45
<~Vornicus>
right
03:47
< Reiver>
My first instinct was simply "Add in an extra save!" - indeed, the origional FoW had rules for Schurzen the Germans used to protect the sides of a tank from american Bazookas, which allowed an extra 4+ save to negate the hit.
03:49
<~Vornicus>
Ah, there it goes.
03:49
< Reiver>
... but this basically means you automaticaly halve the effect of all missiles ever. Which means that for them to be worth a damn you get to boost lethality, or massively raise the shots being thrown about, which cause issues for a) scaling armor between light & heavy vehicles if lethality is crazy high to begin with, and b) issues when targeting shit that /doesn't/ have PDS, eg dug in infantry,
03:49
< Reiver>
+ the whole thing of missiles bebing big and heavy.
03:50 * Reiver then did a little more digging and realised a key little detail he missed: Schurzen, with their 4+ 'extra' save, was protecting tanks with side armor 3... from bazookas with AT 10.
03:50 * Vornicus corrected it so that it counts more white successes than red as having the same number of white successes as red, gets the probabilities to work out right.
03:51
< Reiver>
AKA: Without Schurzen, the tank was auto-failing the normal save to start with.
03:51
< Reiver>
So!
03:51
<~Vornicus>
now to crop and upload.
03:52
< Reiver>
PDS: Grants a vehicle a minimum of an X+ save vs missiles, regardless of underlying armor values.
03:52
< Reiver>
(Probably defaulting to 4+, but working out to 5+ against the heavy duty AT stuff much of the time)
03:53
< Reiver>
This is: a) One less roll on the table; b) granting anyone a chance to save against a missile without entirely negating the value of particuarly heavy armor vs the vulnerability of lighter stuff; c) massively easier to balance
03:54
<~Vornicus>
http://www.flickr.com/photos/7861878@N06/7200578086/in/photostream
03:55
< Reiver>
Heavy tanks shrug off most missiles, PDS be damned. Those little scout jeeps will be very thankful indeed of that 4/5+ save pretty much every day of the week; while midweight IFVs and their ilk get to straddle the middle ground of armor-shrugging light rockets, while relying on PDS to hide from the big stuff.
03:55
< Reiver>
^.^
03:58
< Reiver>
Vorn: So there's a 33% chance of landing 3 Crits in a pool of 6RW dice?
04:00
<~Vornicus>
31.25%, all told. One moment, I'll give you the exact values for getting exactly n Crits
04:00
<~Vornicus>
well, actual values
04:01
<~Vornicus>
3.10% 17.58% 36.25% 31.25% 10.62% 1.17% 0.02% for 0 to 6 crits.
04:02
<~Vornicus>
the height of the full bars is the chance of getting that many red hits
04:02
<~Vornicus>
the height of an individual color is the chance of getting that many white hits on that many red hits
04:03
<~Vornicus>
Those numbers I just dropped on you are the summed heights of all the bars of one color.
04:05
<~Vornicus>
So the 36.25% is the height of every single green bar, combined.
04:06
< Noah>
Vornicus
04:06
<~Vornicus>
Noahcus
04:06
< Noah>
There is lag about
04:06
<~Vornicus>
Is there.
04:06
< Noah>
It is my quest to slay it
04:06
<~Vornicus>
Then do, sir
04:06
<~Vornicus>
I get 1s ping from you and 0s ping from me.
04:07
< Noah>
yea, now
04:07
< Noah>
The entire time I was playing my last game of league of legends, I had 2000ms ping
04:07
<~Vornicus>
ow.
04:07
<~Vornicus>
though I don't know what you want me to do about it
04:08
< Noah>
The lag monster is toying with me tonight
04:08
< Noah>
Wait, you aren't the High Priest of Low Latency?
04:08
<~Vornicus>
No.
04:09
< Reiver>
He's the Elder God of Non-Euclidian Probabilities
04:09
< Reiver>
He weilds his terrible powers to warp the outcomes of dice and fate.
04:10
< Reiver>
(Which is to say, he cheats massively at Setters of Catan)
04:10
< Noah>
Oh
04:10
< Noah>
Obviously
04:10
< Noah>
wait, do we still play that?
04:12
< Reiver>
Sure, why not? Solid game.
04:12
< Reiver>
Hell, people play Monopoly...
04:14
< Noah>
Oh, I mean online
04:14
< Noah>
I thought all the clients stopped being developed
04:14
<~Vornicus>
I occasionally poke back at the one I was building
04:14
<~Vornicus>
Because all the other ones pissed me off for not having f'rinstance persistence
04:14
<&Derakon>
Mine never got further than a map generator.
04:14
<&Derakon>
Which was still pretty nifty.
04:16
<~Vornicus>
I never got a proper map generator off the ground, mostly because my base case had two different map layouts and I couldn't figure out how to get some of the basic options going
04:17
<&Derakon>
Mine could do arbitrary layouts and would also let you specify various resource weightings.
04:17
<~Vornicus>
and then I had to figure out how to make it entirely data-driven so I could let the thing work itself out.
04:17
<&Derakon>
So e.g. if you wanted a really stone-poor map, it'd generate a bunch of maps and end up selecting one where the only stone was on 2, 12 or similar.
04:17
<~Vornicus>
and then store it all in a db
04:17 eckse_ [eckse@Nightstar-3b021371.dsl.sentex.ca] has quit [Client closed the connection]
04:20 eckse [eckse@Nightstar-3b021371.dsl.sentex.ca] has joined #code
04:20 mode/#code [+o eckse] by ChanServ
04:29
<~Vornicus>
--never mind that I haven't got a webserver to put it all on and I really can't do anything without that.
04:31 * McMartin blinks at Clojure maps
04:31
<&McMartin>
I can't tell if that's awesome or terrifying
04:31
<~Vornicus>
?
04:32
<&McMartin>
Keys are callable, and they take a map as an argument, which is how you do lookup
04:33
<&McMartin>
user=> (def x {:a 1 :b 2})
04:33
<&McMartin>
#'user/x
04:33
<&McMartin>
user=> x
04:33
<&McMartin>
{:a 1, :b 2}
04:33
<&McMartin>
user=> (:a x)
04:33
<&McMartin>
1
04:33
<&McMartin>
user=> (:b x)
04:33
<&McMartin>
2
04:33
<&McMartin>
user=> (:c x 'undefined)
04:33
<&McMartin>
undefined
04:33
<~Vornicus>
what the nosehairs, that's crazy
04:33
<&Derakon>
Is the 'undefined supposed to be a default argument or something?
04:34
<&McMartin>
Yes, if I made that be 42 it would there return 42
04:34
<&Derakon>
Er, default lookup result.
04:34
<&McMartin>
Vornicus: Also, they're immutable!
04:34
<&McMartin>
You can use conjunctions to add to or update them but they're used as functional maps so you keep referential transparency
04:35
<&McMartin>
Also, it's crazy but it's used as prefix-notation object lookup
04:35
<&McMartin>
So while you would normally do, say
04:35
<&McMartin>
(println "Hello, world")
04:35
<&McMartin>
There's nothing stopping you from also doing
04:35
<&McMartin>
(.println System/out (.toString (System/getProperties)))
04:36
<&Derakon>
Man, I do not have the brain for this language right now.
04:36
<&Derakon>
Is that System.out.println(System.getProperties.toString())?
04:36
<&McMartin>
Close
04:36
<&McMartin>
It's System.out.println(System.getProperties().toString())
04:36
<&Derakon>
Er, right.
04:37 maoranma [maoranma@490720.C448F4.6334E9.5D6C06] has joined #code
04:37
<&Derakon>
How does it tell the difference between System.out, which is not callable, and System.getProperties, which is?
04:37
<&McMartin>
(Clojure does transparent interop with the VM it's running on. By default this is the JVM but there are .NET and JavaScript-in-browser dialects)
04:37 Noah is now known as NSGuest3850
04:37 NSGuest3850 [maoranma@Nightstar-fc470d2b.pools.spcsdns.net] has quit [Ping timeout: 121 seconds]
04:37 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [Operation timed out]
04:37
<&McMartin>
JVM classes are written in a typed assembly language so it knows from the binary that System.out is a field and System.getProperties is a method.
04:38
<&Derakon>
So there's no way to treat System.getProperties as a non-called thing then?
04:38
<&McMartin>
Sure
04:38
<&McMartin>
Just don't invoke it
04:38
<&McMartin>
I invoked it there.
04:38 maoranma is now known as Noah
04:38
<&Derakon>
Ah.
04:38
<&McMartin>
To remove the java cruft...
04:39
<&McMartin>
user=> (defn f [] 3)
04:39
<&McMartin>
#'user/f
04:39
<&McMartin>
user=> f
04:39
<&McMartin>
#<user$f user$f@6536d9d8>
04:39
<&McMartin>
user=> (f)
04:39
<&McMartin>
3
04:39
<&McMartin>
Function of zero arguments, returning 3.
04:39
<&Derakon>
Gotcha.
04:40
<&McMartin>
As a Lisp dialect, Clojure has an awful lot of concepts Lisps usually don't have, so I'm still kind of stumbling around in its concept of namespaces, etc.
04:40
<&McMartin>
Despite the fact that functions and variables share a namespace, apparently I need different "def" commands for them, unlike Scheme.
04:41
<&McMartin>
(In particular, it's got vector and map literals, which Lisp lacks, and it uses them in commands in ways the dialects I know never do)
04:46
<&McMartin>
Oof. I guess that's a price paid for the three host platforms, but still, that's rough.
04:46
<&McMartin>
No tail-call optimization. =(
04:46
<&McMartin>
It has extra syntax for making that happen.
04:53
<&McMartin>
Well, it has an equivalent to Scheme's named let.
05:57
< Noah>
Hey, any one a conny-sewer of old TV shows?
05:57
<~Vornicus>
somewhat, why
05:58 ErikMesoy|sleep is now known as ErikMesoy
06:00
< Noah>
Vornicus: Do you know if the '54 Shelock Holmes TV series was any good?
06:01
<~Vornicus>
dunno that.
06:01
< Noah>
Hrm
06:05 Kindamoody|afk is now known as Kindamoody
06:15 Kindamoody is now known as Kindamoody|out
06:26 * McMartin considers rewriting his backlog-processing code in Clojure, just for kicks.
06:33 Derakon is now known as Derakon[AFK]
06:45
<&jerith>
What kind of backlogs does it process?
06:48
<&McMartin>
It's the python tools I use to create the page of my game reviews from the XML spec I actually write it in
06:48
<&McMartin>
https://hkn.eecs.berkeley.edu/~mcmartin/stack.html
06:48
<&jerith>
Oh, right. That backlog.
07:27 Chi [omegaboot@Nightstar-efc8dc53.il.comcast.net] has joined #code
07:27 mode/#code [+o Chi] by ChanServ
07:28 Alek [omegaboot@Nightstar-efc8dc53.il.comcast.net] has quit [Ping timeout: 121 seconds]
07:42 himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds]
08:08 eckse [eckse@Nightstar-3b021371.dsl.sentex.ca] has quit [Client closed the connection]
08:09 maoranma [nbarr@490720.C448F4.6334E9.5D6C06] has joined #code
08:15 maoranma [nbarr@490720.C448F4.6334E9.5D6C06] has left #code ["Leaving"]
08:16 maoranma [nbarr@490720.C448F4.6334E9.5D6C06] has joined #code
08:19 You're now known as TheWatcher
08:23 maoranma [nbarr@490720.C448F4.6334E9.5D6C06] has quit [[NS] Quit: Leaving]
08:23 maoranma [nbarr@490720.C448F4.6334E9.5D6C06] has joined #code
08:29 * McMartin prods Clojure
08:30
<&McMartin>
If I want to replace "takes a file" with "takes a string" I really shouldn't have to cut out to Java >_<
08:30
<&McMartin>
(with-open [in (input-stream (.getBytes "whargbl" "UTF-8"))] (do-stuff-with in))
08:32
< maoranma>
Heh
08:33 Reiv [reiverta@5B433A.F67240.A95AA4.C3A3F9] has joined #code
08:34 Reiver [reiverta@5B433A.F67240.CC9FF0.A1A400] has quit [Ping timeout: 121 seconds]
08:41 Reiv [reiverta@5B433A.F67240.A95AA4.C3A3F9] has quit [Ping timeout: 121 seconds]
08:42 Reiver [reiverta@5B433A.3CF6C7.5E9634.A152A2] has joined #code
08:57 Noah [maoranma@490720.C448F4.6334E9.5D6C06] has quit [[NS] Quit: ]
08:57 maoranma is now known as Noah
09:06 * McMartin does it right.
09:10
< Reiver>
?
09:11
<&McMartin>
00:29 * McMartin prods Clojure
09:11
<&McMartin>
00:29 <&McMartin> If I want to replace "takes a file" with "takes a string" I really shouldn't have to cut out to Java >_<
09:11
<&McMartin>
Then I did some silly ad-hoc stuff
09:11
<&McMartin>
Here's the actual "make an input stream (which is transparently replacable with java.io.InputStream)" function:
09:12
<&McMartin>
(defn str-stream ([s] (str-stream s "UTF-8")) ([s e] (clojure.java.io/input-stream (.getBytes s e) :encoding e)))
09:18 Attilla [Obsolete@Nightstar-02604040.as43234.net] has joined #code
09:29 Reiv [reiverta@5B433A.3CF6C7.5B045D.67A284] has joined #code
09:30 Reiver [reiverta@5B433A.3CF6C7.5E9634.A152A2] has quit [Ping timeout: 121 seconds]
09:49
<@TheWatcher>
Damn you, Naming Things
09:50
<&McMartin>
?
09:50
<@TheWatcher>
Oh, trying to choose the best name for a variable.
09:55
< Noah>
aVarInThisMethodInThisClass
09:55
<&McMartin>
throatwobblerMangrove
09:56
<@TheWatcher>
Thank you, gentlemen. I knew I could rely on you.
09:56
<@TheWatcher>
;P
09:56
< Noah>
throatwobblerMangrove++
09:56
<@Tamber>
bob_bobsson
09:57
< Noah>
obviousExitDennis
09:58
< Noah>
likelyToBeRefactored
09:59
<@TheWatcher>
Remind me never to look at any of your code, Noah. You're too good at this ¬¬
09:59
<&McMartin>
To be fair we have Zero Context here.
09:59
< Noah>
My favorite is hasPizza, because if I call something, and it doesn't have pizza, something is wrong
10:00
<&McMartin>
Sadly, I have a non-toy, non-game, non-worldsim problem spec where hasPizza is an actual meaningful parameter
10:00
<&McMartin>
Since there's a Java extention named Pizza and you might want to track via reflection whether or not you had it in your classpath
10:00
< Noah>
Haha
10:01
< Noah>
likelyToBeRefactored.pizza.toppings
10:02
< Noah>
iShouldntHaveAskedOnIRCwhatIshouldCallThisVar
10:02
< Noah>
Hope you have good code completion
10:02
<@TheWatcher>
M-/ ftw ¬¬
10:04
< Noah>
camelCase4Life
10:04
< Noah>
No one lets me code with them, I don't understand why
10:05
<@Tamber>
At least you use vowels.
10:06
< Noah>
Vowelless variables make me angry
10:07
< Noah>
nmbrTtlSls
10:07
< Noah>
tpsRprts
10:07
< Noah>
TheWatcher: You went with throatwobblerMangrove, didn't you?
10:08
<@TheWatcher>
I admit to nothing
10:09
<&McMartin>
thrtwbblrMngrv
10:09
<@TheWatcher>
Damn, discovered!
10:09 * McMartin eyes the shit out of the Mono project home page
10:09
<@TheWatcher>
(actually, the far more prosaic '$retain_unused')
10:09
<&McMartin>
"Run your applications on ALL THE PLATFORMS"
10:09
<&McMartin>
_o/
10:10
<@TheWatcher>
...
10:10
<@TheWatcher>
ohgods
10:10
<&McMartin>
http://www.mono-project.com/Main_Page
10:10
<&McMartin>
The _o/ is my addition, but.
10:10
<@TheWatcher>
At least they didn't allcaps it
10:22 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
12:23 Chi is now known as Alek
13:53 Reiv [reiverta@5B433A.3CF6C7.5B045D.67A284] has quit [Client closed the connection]
15:20 Attilla [Obsolete@Nightstar-02604040.as43234.net] has quit [Ping timeout: 121 seconds]
15:47 jeroid [jerith@EB02D1.779B91.1482D5.FA0A9D] has joined #code
16:04 Attilla [Obsolete@Nightstar-02604040.as43234.net] has joined #code
16:11 jeroid_ [jerith@EB02D1.779B91.7C1BA3.E03A48] has joined #code
16:11 jeroid [jerith@EB02D1.779B91.1482D5.FA0A9D] has quit [Connection reset by peer]
16:14 jeroid_ is now known as jeroid
16:50 jeroid_ [jerith@EB02D1.779B91.7C1BA3.E03A48] has joined #code
16:50 jeroid [jerith@EB02D1.779B91.7C1BA3.E03A48] has quit [Client closed the connection]
16:54 ErikMesoy is now known as Harrower
17:08 EvilDarkLord is now known as Maze
17:19 jeroid_ [jerith@EB02D1.779B91.7C1BA3.E03A48] has quit [Ping timeout: 121 seconds]
17:54 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
18:14 Kindamoody|out is now known as Kindamoody
18:20
< celticminstrel>
So, I managed to get XCode 4 to use GCC 4.6, but I'm getting errors in the cmath header...
18:22
< gnolam>
And today's API bloat award goes to Ruby on Rails: http://as.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Numeric/Time.html #M000326
18:23
< celticminstrel>
Stuff like "llrint has not been declared".
18:23 eckse [eckse@Nightstar-3b021371.dsl.sentex.ca] has joined #code
18:23 mode/#code [+o eckse] by ChanServ
18:25
< celticminstrel>
Which I assume means it's including the wrong math.h.
18:25
<@rms>
Is this C++ or C?
18:25
<~Vornicus>
gnolam: yeah, rails's time module is really, really ridiculous.
18:25
< celticminstrel>
C++, of course...
18:25
<@rms>
Because C shouldn't care.
18:26
< celticminstrel>
<cmath> is a C++ header.
18:27 * rms read it as math header :p
18:27
<@rms>
Any luck if you make it use math.h instead?
18:27
< Rhamphoryncus>
C++-ified version of the C header?
18:27
<@rms>
Pretty much
18:28
<&jerith>
3.day.ago!
18:28
<&jerith>
*days
18:29
< Rhamphoryncus>
Hmm. llrint is posix. There's a C++ version only in C++11
18:30
< Rhamphoryncus>
Hrm. cmath uses C++ namespaces. I have no idea why it's call cmath
18:30
<@rms>
Like the entire cstdint header
18:31
< celticminstrel>
It's called cmath because that's the convention they chose for the C++-ified versions of C headers.
18:31
<@rms>
AFAIK all the c* C++ headers shove stuff in std
18:31
<@rms>
Rather than polute the global namespace
18:31
< Rhamphoryncus>
celticminstrel: try --std=c++0x
18:31
<@rms>
However most compilers I've used shoved it in the global namespace anyways
18:32
< Rhamphoryncus>
Or gnu++0x
18:32
< celticminstrel>
Rhamphoryncus: I'm probably having this issue because of that option.
18:33
< Rhamphoryncus>
Hrm. Maybe what rms said? Old versions dumped them into global namespace, new standard does not?
18:34
< Rhamphoryncus>
So.. using std::llrint;
18:36
< celticminstrel>
Well, the <cmath> header is the one MacPorts installed when I installed GCC 4.6; however, (U think) the <math.h> header is the one that comes with my computer.
18:36
< celticminstrel>
^I think
18:37
< celticminstrel>
Which is a likely cause of the problem.
18:37
< celticminstrel>
Because <cmath> includes <math.h>.
18:38
< celticminstrel>
I don't think it's an issue of whether it's in the global namespace.
18:38
<@rms>
Where does it include it though?
18:39
<@rms>
Inside namespace std { }?
18:40
< celticminstrel>
Um...
18:40
< celticminstrel>
No, the include is right at the top of the file.
18:40
< celticminstrel>
Before any namespaces.
18:44
< celticminstrel>
Hm, apparently it's defined if math.h only if you ask for C99...?
18:44
< celticminstrel>
Except...
18:44
< celticminstrel>
"__DARWIN_NO_LONG_LONG" doesn't seem like the right symbol to check for that.
18:49 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [[NS] Quit: Leaving]
18:52 Attilla_ [Obsolete@Nightstar-897e8710.as43234.net] has joined #code
18:53 Attilla [Obsolete@Nightstar-02604040.as43234.net] has quit [Ping timeout: 121 seconds]
18:53 Attilla_ is now known as Attilla
18:55
<@ToxicFrog>
celticminstrel: pastebin the cmath and math.h?
18:56
< celticminstrel>
...really?
18:56
< celticminstrel>
I guess I could...
18:56
<@ToxicFrog>
All of the l*rint functions are C99 only, incidentally, but that shouldn't be a problem if you're building as C++
18:57
< celticminstrel>
(Though I'm not entirely sure which math.h is being used.)
18:57
<@ToxicFrog>
At a guess, llrint* are -additionally- guarded with __DARWIN_NO_LONG_LONG, because if the system doesn't support long long int it doesn't make sense to declare functions returning it.
18:57
<@ToxicFrog>
Actually, before you do that
18:57
<@ToxicFrog>
Is lrint there?
18:58
< celticminstrel>
There's no error on that line, so I assume so.
18:58
<@ToxicFrog>
In that case, are you sure you actually have long long int support?
18:59
< Rhamphoryncus>
Hrm. Clang 3.1 is supposed to release.. yesterday :P
19:00
<@ToxicFrog>
Also, me half an hour ago: "Huh, someone wants an app that's basically just WebKit embedded in a window, no buttons or menus or anything. This could be a fun way to get my feet wet with Clojure."
19:00
<@ToxicFrog>
Me now: BLOOD FOR THE BLOOD GOD
19:00
< celticminstrel>
I've used long long before.
19:01
< celticminstrel>
So unless -std=c++0x were suppressing it, it should be available.
19:01
<@ToxicFrog>
Before as in in this code?
19:01
< celticminstrel>
I don't think I used them in this code, no.
19:02
<~Vornicus>
blood for the blood god?
19:03
<~Vornicus>
why is there only war in the grim future of TF's experience with clojure?
19:04
<@ToxicFrog>
Vornicus: actually the problem is not clojure but webkit
19:04
<@ToxicFrog>
Firstly, the documentation is unrelentingly terrible except in those places where it simply doesn't exist
19:05
<@ToxicFrog>
Secondly, every binding/build/whatever of webkit is specific a certain (OS, runtime, toolkit) combination.
19:06
< celticminstrel>
(Changing to std-gnu++0x didn't help, unsurprisingly.)
19:06
< celticminstrel>
^=
19:07
<@ToxicFrog>
What happens if you include something like
19:08
<@ToxicFrog>
#ifdef __DARWIN_NO_LONG_LONG
19:08
<@ToxicFrog>
#error long long int support required
19:08
<@ToxicFrog>
#endif
19:09
<@ToxicFrog>
Also there do not appear to be prebuilt webkit binaries for, well, anything
19:10
< celticminstrel>
Apparently it gets defined somewhere in the stream libraries...
19:11
< celticminstrel>
But long long support is there; I just tried declaring a long long variable.
19:12
< celticminstrel>
It's probably in that c++config.h file or something...
19:26
< celticminstrel>
Is it normal for gcc not to include the C libraries?
19:26 Kindamoody is now known as Kindamoody[zZz]
19:32
<@ToxicFrog>
If by "the C libraries" you mean libc and libm, yes, those come with the OS, as a rule
19:57
< celticminstrel>
Oh, I was looking at the wrong math.h apparently. They're guarded by a bunch of other defines instead, it seems.
20:06
< celticminstrel>
Which, according to my tests, should result in the functions being included.
20:21 Harrower is now known as ErikMesoy
20:22 Maze is now known as EvilDarkLord
20:22
<&McMartin>
11:05 <@ToxicFrog> Secondly, every binding/build/whatever of webkit is specific a certain (OS, runtime, toolkit) combination.
20:22
<&McMartin>
Wacky, because *something* is clearly tying to it - it seems to be what Light Table's prototype is.
20:22
<&McMartin>
I don't suppose there's one for Swing~
20:23
< Rhamphoryncus>
Woo, my perspective transform works.. except all my matrix transforms seem to combine backwards from what I expect
20:24
< Rhamphoryncus>
ie perspective * camera rather than camera * perspective
20:24
<&McMartin>
Order matters
20:25
<&McMartin>
IIRC, from the model's perspective, you're doing it "backwards", and from the camera's, it's forward.
20:25
< Rhamphoryncus>
yeah, I know, I just expected it to be the other way around
20:26
< Rhamphoryncus>
Take points in the model, translate them to where the camera wants them, then stretch a little for the perspective
20:27
<&McMartin>
Well, yes. That's exactly what you do. It's just that you do it with a left-multiply. >:D
20:27
<@ToxicFrog>
McMartin: as far as I can tell the answer to using it in a cross-platform manner is "use the bindings for a toolkit and language that's portable to all of your target OSes and then just package/build it once for each"
20:27
< Rhamphoryncus>
heh
20:28
< Rhamphoryncus>
So it's my expectation that's wrong, not my Matrix class
20:28
<&McMartin>
TF: woo c++ -_-
20:28
< Rhamphoryncus>
And swapping the order in the Matrix class would be confusing
20:29
<@ToxicFrog>
McMartin: yeah, I am not happy
20:29 * TheWatcher eyes this code, utters the cry of every coder who looks at 12 month old code
20:29
< Rhamphoryncus>
Hrm. But it'll do (a * b) * c rather than a * (b * c)
20:29
<&McMartin>
Matrix Multiply is associative - just not commutative.
20:29
<@ToxicFrog>
Also it turns out that this is exactly the wrong option to learn Clojure with, because the WebKit bindings to .NET are not API compatible with the WebKit bindings to Mono
20:30
<&McMartin>
Gevalt.
20:30
<@ToxicFrog>
Also the WebKit bindings to Mono are wholly undocumented beyond "they exist"
20:30
< Rhamphoryncus>
McMartin: *nod*
20:31 * Rhamphoryncus scrolls down a few more lines of wikipedia's matrix multiplication page, sees the associative vs commutative bit
20:31
<@ToxicFrog>
(basically, Mono has webkit support built in but undocumented, but this means your windows users have to have mono installed; there is a webkit binding to .NET as a WinForms widget, but it only works with a specific windows port of WebKit which is not actually available in binary form anywhere)
20:31
<&McMartin>
(gj)
20:32
<&McMartin>
(If there are C bindings that means it's easier to bind Haskell =P)
20:42 * Rhamphoryncus is now rendering a whopping 18 triangles
20:43
<@TheWatcher>
Whoo
20:43
< Rhamphoryncus>
I'm stalling because I haven't figured out how to make terrain that looks good. I can boost the triangle count way up with tessellation, but that just makes it smoother, not better
20:44 * TheWatcher decides that this thing doesn't need so much refactory, as mostly rewriting, sighs
20:44
<@TheWatcher>
*refactoring
20:45
<@TheWatcher>
Maybe I need more tea, first
20:47
< Rhamphoryncus>
Hmm. This is not so bad, other than the low-res texture. Shows how important just having a texture is. http://static.vizworld.com/wp-content/uploads/2010/10/mountains.png
20:48
< ErikMesoy>
I like it.
20:48
<@Alek>
seconded.
20:52
< Rhamphoryncus>
I need to spend some time looking at real mountains and figure out why I've got it in my head that a heightmap isn't sufficient (that there needs to be overhangs)
20:52
<@Alek>
caves.
20:52
<@Alek>
wind, glacier, and river valleys also carve out overhangs.
20:53
< Rhamphoryncus>
yeah
20:53
< Rhamphoryncus>
At an even smaller scale there's tons
20:53
< Rhamphoryncus>
And at a large scale there's plenty of near-vertical cliffs
20:56
< Rhamphoryncus>
overhang much? http://carlosbuhler.files.wordpress.com/2010/03/img_7722tbppillar.jpg
20:59
< Rhamphoryncus>
But.. I think I can compromise and not have overhangs except as added details at a later stage. What I do want right now is vertical cliffs
21:00
< Rhamphoryncus>
which.. means having both a high and a low for each point on the map?
21:44 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Connection reset by peer]
21:45 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
21:45 mode/#code [+o ToxicFrog] by ChanServ
21:50
< celticminstrel>
I suppose the other alternative is to use a makefile... but when making a packaged application that seems like it'd be a whole lot of extra work.
21:57
< celticminstrel>
...huh, changing to 1.7 SDK might fix it after all.
21:57
< celticminstrel>
^10.7
22:07 ErikMesoy is now known as ErikMesoy|sleep
22:20
< celticminstrel>
Now I have the issue of blocks...
22:24 * Noah ponders the user list
22:24
< Noah>
You know, I can just type /names, I don't really need it
22:55
< celticminstrel>
The sections of the Cocoa headers that require blocks seem to be framed by preprocessor conditionals, so it should be possible to disable them...
22:59
< celticminstrel>
Oh, I guess not all of them are.
23:16
< celticminstrel>
Ah, there we go. Just add a rule to compile .m files with the default compiler.
23:16
<&McMartin>
Oh, yeah, that -_-
23:16
<&McMartin>
Don't forget to do the same for .mm
23:19
< celticminstrel>
Sure.
23:19
< celticminstrel>
Um, Boost's filesystem::path.file_string seems to no longer exist...?
23:20
<&McMartin>
?
23:20
<&McMartin>
Wacky
23:20
<&McMartin>
That's kind of important
23:20
< celticminstrel>
Unless I'm misunderstanding this.
23:20
< celticminstrel>
This error, I mean.
23:21
< celticminstrel>
...no, I don't think that's a possibility: 'class boost::filesystem3::path' has no member named 'file_string'
23:22
< celticminstrel>
Hm... changed to "native_file_string"?
23:23
< celticminstrel>
Maybe I should use string() instead though... it's being passed to IMG_Load...
23:23
< celticminstrel>
I dunno.
23:24 Attilla [Obsolete@Nightstar-897e8710.as43234.net] has quit [[NS] Quit: ]
23:24
< celticminstrel>
I'll try native_
23:25
< celticminstrel>
Oh, I seem to be looking at the wrong documentation version...
23:26
< celticminstrel>
...there's a define system to select versions. I'll do that for now.
23:27
< celticminstrel>
Yay, it compiles, but now I have a vaguely ambiguous linker error...
23:28
<@TheWatcher>
The best sort!~
23:29
< celticminstrel>
It doesn't even seem to say what the error is...
23:32
<&McMartin>
Oh geeze, I'm four or five minor versions behind on Boost, not sure how that will affect this
23:32
<&McMartin>
ISTR that file_string and directory_string was because OS 9 used different formats for them.
23:33
< celticminstrel>
From what I remember when reading the docs, it wasn't OS9 that used different formats, but there was some obscure OS I'd never heard of that did...
23:34
< celticminstrel>
Is it normal to invoke the compiler at the linking stage?
23:34 Attilla [Obsolete@Nightstar-cf31f60f.threembb.co.uk] has joined #code
23:35
<&McMartin>
It's not unheard of - it's much more plausible if you're C++
23:35
<&McMartin>
It's legal to pass only .o files to g++ or gcc, and arguably even typical (it autoselects the language runtime libraries and configures them right, etc)
23:37
< celticminstrel>
Is -filelist an Apple extension?
23:38
<&McMartin>
It's part of my Linux gcc, but it's only listed as available on Darwin.
23:39
< celticminstrel>
I guess that could be why GCC exited with an error...
23:39
< celticminstrel>
That and -framework...
23:39
<&McMartin>
-framework is definitely Darwin-specific
23:41
< celticminstrel>
I know.
23:46 * TheWatcher eyes this page on running emacs standalone on a linux kernel, aside from `mount`
23:49
<@TheWatcher>
http://www.informatimago.com/linux/emacs-on-user-mode-linux.html - I'd be half tempted to try it, if I had less sanity
23:49
<&McMartin>
YOU FOOLS
23:49
<&McMartin>
YOU SAID THAT EMACS WAS A WEAK TEXT EDITOR BUT A FINE OS
23:49
<&McMartin>
YOU LAUGHE
23:49
<&McMartin>
LAUGHED
23:49
<&McMartin>
BUT WHO'S LAUGHING NOW
23:50
<&McMartin>
truly you have now been shown
23:59
<@TheWatcher>
Next task: work out how to run it bare on the metal~
--- Log closed Wed May 16 00:00:10 2012
code logs -> 2012 -> Tue, 15 May 2012< code.20120514.log - code.20120516.log >

[ Latest log file ]