←2012-08-23 2012-08-24 2012-08-25→ ↑2012 ↑all
00:00:20 <kmc> one is that v qvqa'g erpbtavmr gur dhrel fgevat ohvyqvat nf hafnsr vzzrqvngryl
00:01:00 <kmc> and also v unq gb cbxr nebhaq va fdyvgr qbpf gb svaq bhg ubj gb rssrpgviryl nqq ebjf gb n fryrpg, pbagebyyvat bayl gur cneg bs gur dhrel v qvq
00:01:08 <shachaf> Maybe I should switch back to urxvt, which has built-in rot13.
00:01:13 <kmc> it does??
00:01:21 <shachaf> Ctrl-right-click
00:01:28 <shachaf> At least my installation does. Maybe it's a script that comes with it.
00:01:40 <kmc> jesus
00:01:42 <kmc> that's ridiculous
00:02:30 <oerjan> `run echo urxvt | tr a-z n-za-m
00:02:33 <HackEgo> hekig
00:02:51 <oerjan> vad hekigt
00:02:53 <shachaf> ^rot13 shachaf@carbon
00:02:53 <fungot> funpuns@pneoba
00:03:18 <oerjan> ^rot13 hydrogen helium lithium beryllium boron
00:03:18 <fungot> ulqebtra uryvhz yvguvhz orelyyvhz obeba
00:03:51 <kmc> shachaf: your name rot13s to funpuns? seriously?
00:04:02 <oerjan> ^rot13 nitrogen oxygen fluorine neon
00:04:02 <fungot> avgebtra bkltra syhbevar arba
00:04:10 <kmc> shachaf: that is amazing
00:04:24 <oerjan> ^rot13 kmc oerjan
00:04:24 <fungot> xzp brewna
00:04:32 <kmc> ^rot13 keegan
00:04:32 <fungot> xrrtna
00:04:51 <oerjan> furrfu
00:04:55 <kmc> ^rot13 ørjan
00:04:55 <fungot> øewna
00:05:01 <shachaf> kmc: Oh, you didn't know?
00:05:07 <kmc> no
00:05:15 <kmc> is this why you like puns so much
00:05:33 <shachaf> Maybe it's my name because my mother likes puns so much.
00:05:40 <Sgeo> Apparently I suck at understanding hints
00:06:00 <shachaf> (She was very pleased when I pointed it out, maybe 13 years later.)
00:06:11 <shachaf> Sgeo: What was your hint?
00:06:50 <FreeFull> ^rot13 Filip
00:06:50 <fungot> Svyvc
00:10:54 <shachaf> kmc: A lot of these puzzles are tricky to exploit, but things that would've never come up when writing the code in the first place, or reviewing someone else's code.
00:11:48 <shachaf> Mostly because the whole thing is flawed in a lot of ways -- just most of them happen not to be exploitable.
00:12:46 <Sgeo> I'm scared that I may end up writing that sort of code
00:12:53 <shachaf> I guess that doesn't apply to all of them.
00:15:09 <kmc> shachaf: I don't really agree
00:15:26 <kmc> well, i agree that the examples are a bit contrived
00:15:49 <kmc> but they are holes you see in real programs, and things you would want to look for in review
00:16:08 <shachaf> Right.
00:16:33 <shachaf> I guess what annoys me is the idea of reviewing exclusively for security holes, rather than other design issues.
00:16:43 <shachaf> But of course the latter can be a much bigger change.
00:17:02 <kmc> well, other design issues are outside the scope of this challenge :)
00:17:08 <kmc> maybe i'm missing the context of your complaint
00:17:49 <kmc> having lots of other issues makes it a more realistic challenge
00:18:31 <shachaf> That's true.
00:19:01 <kmc> and i think there is value in reviewing just for security holes
00:19:07 <kmc> having a separate person thinking about that all the time
00:19:24 <shachaf> Sure.
00:19:29 <kmc> with the caveat that they should be allowed to say "i don't see a hole in your code, but it's so poorly designed that i deem it insecure anyway'
00:19:44 <kmc> but this should be a higher bar than merely ugly code
00:20:19 <kmc> it's difficult as a reviewer to find that middle ground of "i would do this a different way, and i find your way gross, but i won't make you redo it"
00:21:29 <shachaf> Maybe I just mean that I'd rather have a challenge where there's some security hole but the puzzles still seem like "good code".
00:21:42 <kmc> yeah
00:21:47 <shachaf> Even though that might be less realistic. :-)
00:21:53 <kmc> well i don't think the code in this set is too bad
00:22:20 <kmc> except for the PHP levels, because they are written in PHP
00:22:34 <shachaf> Can anyone write good code in PHP, kmc?
00:22:52 <FreeFull> http://underhanded.xcott.com/ Related
00:22:55 <kmc> """Do not tell me that “good developers can write good code in any language”, or bad developers blah blah. That doesn’t mean anything. A good carpenter can drive in a nail with either a rock or a hammer, but how many carpenters do you see bashing stuff with rocks? Part of what makes a good developer is the ability to choose the tools that work best."""
00:23:01 <kmc> FreeFull: yeah, i like that thing
00:23:11 <kmc> i have plans to run an updated and more free-form version of it
00:23:45 <shachaf> Can God create a programming language so terrible that even God can't write good code in it?
00:23:51 <shachaf> (And is Rasmus Lerdorf God?)
00:24:02 * Sgeo wants eve and mallory's secrets
00:24:13 <shachaf> Sgeo: They are available.
00:24:19 <shachaf> If you can get bob's secret you can get them.
00:24:20 <kmc> shachaf: that would explain a lot
00:24:23 <kmc> dinner, bbl
00:24:30 <Sgeo> shachaf, working on it
00:25:13 <FreeFull> shachaf: A programming language that doesn't allow you to write any code would fulfill that purpose
00:25:43 <shachaf> FreeFull: You don't think there's such a thing as "code so bad it doesn't even compile"?
00:26:44 <FreeFull> shachaf: With this language, no code compiles
00:27:06 <shachaf> Exactly.
00:27:10 <shachaf> Oh.
00:27:23 * shachaf got it backwards.
00:28:23 <FreeFull> Well, brainfuck will compile anything
00:28:33 -!- oerjan has quit (Quit: Ok]).
00:30:53 <zzo38> I would think that yes God can create a programming language so terrible that even God can't write good code in it.
00:33:02 <zzo38> And yes one way is one that no code is valid.
00:42:29 -!- kinoSi has quit (Read error: Connection reset by peer).
00:42:31 -!- TeruFSX has joined.
00:42:57 -!- kinoSi has joined.
00:46:27 <ion> PHP
00:47:15 <Sgeo> Argh
00:51:00 <Sgeo> Ok, kmc went afk
00:51:04 <Sgeo> no wonder he's not helping me
00:51:58 <Sgeo> There's one blatantly obvious flaw in this code, and it's taunting me with my inability to abuse it
00:53:25 <Sgeo> Just realized I have other things I really need to do
01:14:49 -!- DHeadshot has joined.
01:22:50 -!- DHeadshot has quit (Read error: Connection reset by peer).
01:57:22 -!- pikhq has joined.
01:57:59 -!- pikhq_ has quit (Ping timeout: 260 seconds).
01:58:07 <shachaf> Sgeo: Why are you unable to abuse it?
01:58:39 <Sgeo> shachaf, well, it only allows one SQL statement, but kmc gave me a hint about that, but right now working on something more important
01:59:01 <shachaf> Surely you mean FDY statement!
02:00:59 <kmc> -_-
02:07:25 <shachaf> Is a monad always covariant in its argument?
02:07:49 <shachaf> Oh, I guess it would have to be since you can write fmap.
02:11:13 -!- Tod-Autojoined has joined.
02:12:09 -!- vxhex has joined.
02:13:15 <kmc> i think that's more correctly stated as "Is Monad covariant in its argument?"
02:13:41 <shachaf> Is it? I mean "are instances of Monad covariant in their argument".
02:13:46 -!- TodPunk has quit (Ping timeout: 244 seconds).
02:13:48 <shachaf> For example, Reader is covariant in its argument.
02:13:57 -!- TodPunk has joined.
02:14:08 <kmc> what do you mean?
02:14:31 <kmc> do you mean (Reader t)?
02:14:42 <shachaf> Er, yes.
02:14:53 <shachaf> Sorry. (Reader t) is the instance of Monad, though.
02:14:56 <kmc> i don't know what "covariant" means in Haskell in general
02:15:03 <kmc> the usual meaning relates to subtyping, which Haskell lacks
02:15:11 <kmc> but a "covariant functor" is a particular kind of thing
02:15:22 <kmc> and every Monad is a covariant functor, yes
02:15:30 <kmc> it's the usual sort of functor captured by the Functor class
02:15:36 <shachaf> Right.
02:15:42 <kmc> and yeah, i think your phrasing is more correct
02:15:50 -!- Tod-Autojoined has quit (Ping timeout: 256 seconds).
02:15:50 <kmc> don't know what mine would mean -_-
02:16:08 <shachaf> I think saying that a type is covariant in a means that a only appears only to the left of an even number of ->s
02:16:48 <shachaf> If you look at -> as the branch of a tree, that is.
02:17:03 <shachaf> So "a" is covariant in "a", and so is ((a -> r) -> r)
02:17:24 -!- copumpkin has changed nick to dishonestbob.
02:17:25 <shachaf> But not (a -> r)
02:17:45 <kmc> oh, so you're asking whether the implementation of every monad (the RHS of data Foo t = ...) must satisfy this?
02:18:04 -!- Tod-Autojoined has joined.
02:18:18 -!- dishonestbob has changed nick to copumpkin.
02:18:46 <shachaf> Right.
02:19:07 -!- TodPunk has quit (Ping timeout: 240 seconds).
02:19:17 <shachaf> And I think it does, and any covariant functor (i.e. Functor) must satisfy it in general.
02:19:28 -!- Tod-Autojoined has quit (Client Quit).
02:19:44 <shachaf> Whereas a contravariant functor (i.e. Contravariant) must satisfy the reverse.
02:27:10 <shachaf> edwardk says that for newtype Search f a = Search { optimum :: f a -> a }, instance Contravariant f => Monad (Search f)
02:27:39 <shachaf> And that this is a fun exercise to prove, or something.
02:27:58 <copumpkin> it's not too hard to write, iirc
02:28:01 <copumpkin> djinn can probably do it
02:28:17 <shachaf> @djinn-add newtype Search f a = Search (f a -> a)
02:28:17 <lambdabot> Cannot parse command
02:28:21 <shachaf> @djinn-add data Search f a = Search (f a -> a)
02:29:00 <shachaf> @djinn ((a -> b) -> f b -> f a) -> (c -> d) -> Search f c -> Search f d
02:29:00 <lambdabot> Error: kind error: (KVar 5,KVar 2)
02:29:19 <shachaf> @djinn ((a -> b) -> f b -> f a) -> (c -> d) -> (f c -> c) -> f d -> d
02:29:19 <lambdabot> -- f cannot be realized.
02:29:36 <shachaf> Oh, I already wrote this, actually.
02:30:07 <shachaf> @djinn ((a -> b) -> f b -> f a) -> a -> (f a -> a) -> a
02:30:07 <lambdabot> f _ a _ = a
02:30:25 <shachaf> @djinn ((a -> b) -> f b -> f a) -> a -> f a -> a
02:30:25 <lambdabot> f _ a _ = a
02:30:32 <shachaf> Hmm.
02:30:48 <shachaf> @djinn ((a -> b) -> f b -> f a) -> (f (f a -> a) -> a) -> f a -> a
02:30:48 <lambdabot> -- f cannot be realized.
02:30:56 <shachaf> Oops, c and d.
02:31:03 <shachaf> @djinn ((a -> b) -> f b -> f a) -> (f (f c -> c) -> c) -> f c -> c
02:31:03 <lambdabot> -- f cannot be realized.
02:31:42 <shachaf> @djinn-add class Covariant f where contramap :: (a -> b) -> f b -> f a
02:31:47 <shachaf> Ah, djinn supports classes.
02:31:59 <shachaf> @djinn Contravariant f => (f (f c -> c) -> c) -> f c -> c
02:31:59 <lambdabot> Error: Class not found: Contravariant
02:32:04 * shachaf sighs.
02:32:08 <shachaf> @djinn Covariant f => (f (f c -> c) -> c) -> f c -> c
02:32:09 <lambdabot> -- f cannot be realized.
02:32:15 * shachaf stops djinnspamming.
02:35:55 -!- TodPunk has joined.
02:37:56 <kmc> we found a level where shachaf and i have completely different solutions :)
02:38:01 -!- vxhex has left.
02:38:06 <kmc> and probably mine is an unintended hole :)
02:46:11 <shachaf> kmc: They were talking in the CTF channel earlier about fixing some unintended holes. Maybe yours was one of them.
02:46:25 <zzo38> The Functor class is only for endofunctors of (->) category.
02:46:39 <shachaf> I would try to find out but I think I got my level 6 into an unusable state.
02:47:25 <kmc> do you know which unintended holes?
02:48:26 <shachaf> No -- the channel was mostly (a) people asking for spoilers, (b) people giving spoilers, and (c) people talking about when the servers that went down will be back up.
02:48:47 <shachaf> I only cared about (c) so I tried to avoid reading spoilers about other levels.
02:48:53 <zzo38> That newtype Search f a = Search { optimum :: f a -> a } I have also called Algebra (as a F-algebra is). I also think that if f is Predicate you get the "infinite search" monad that someone else described, and I think also (CodensityAsk Predicate) is also the same, too!
02:52:14 <shachaf> zzo38: No, it's not an algebra when f is contravariant.
02:52:35 <zzo38> shachaf: Well, yes, you are correct; nevertheless it is what I called that type.
02:53:05 <shachaf> "infinite search" is where it gets its name, though, yes.
02:53:08 <zzo38> Contravariant functor would be a functor from (->) category to its opposite, or vice versa. Therefore it is a functor and follows the same laws as a functor because it is a functor. Actually, there are other things can you can simply say, this must be a functor, etc
02:53:23 <shachaf> I don't know whether (CodensityAsk Predicate) is also the same, too as well. But it's possible.
02:53:42 <zzo38> shachaf: I think I have once proven that it is the same, by the Yoneda lemma.
02:53:55 <shachaf> I don't know what CodensityAsk is.
02:54:33 <zzo38> newtype CodensityAsk f x = CodensityAsk { runCodensityAsk :: forall z. f z -> (x -> z) -> z };
02:54:57 <zzo38> It is always a Monad. If f is Comonad then (CodensityAsk) is also a MonadPlus.
02:55:09 <zzo38> It is always a Monad. If f is Comonad then (CodensityAsk f) is also a MonadPlus.
02:55:54 <zzo38> There is also CodensityAskT which every "z" in that definition would be "m z" instead
02:56:41 <Sgeo> OH GOD I HATE MYSELF THIS CODE WHICH IS GOING TO BE IN PRODUCTION USE HAS SEVERAL FUNCTIONS THAT ARE IDENTICAL EXCEPT FOR THE NAME I SHOULD REFACTOR IT BUT I PROBABLY WON'T
02:57:21 <zzo38> Sgeo: Yes you should refactor it, and then if it need multiple name, then depending on the programming language you can do something about that (such as, in C, you can define a macro)
02:58:02 <shachaf> You can define macros in C/C++!
02:59:41 -!- centrinia has joined.
03:01:25 <zzo38> I sometimes make those kind of mistake too, but then usually try to fix it
03:01:41 <Sgeo> I'm basically abusing function names to act as a dispatch mechanism
03:01:50 <Sgeo> Since I thought these functions might greatly vary
03:01:55 <Sgeo> And one or two do
03:01:58 <Sgeo> But the rest are the same
03:02:17 <zzo38> How would they act as a dispatch mechanism, and what programming language is it?
03:04:07 <Sgeo> Tcl
03:04:29 <Sgeo> I call a function named partially by a variable
03:04:34 <Sgeo> As in, checkfeed-$method
03:04:45 <Sgeo> And then checkfeed-etag, for example, is one function
03:05:23 <zzo38> Does Tcl have first-class functions? If so, can you assign them as same using an assignment?
03:09:29 <Sgeo> I wouldn't call them first-class as such
03:10:05 <Sgeo> But you can call a function whose name you only know at runtime quite comfortably, and you do have anonymous functions, although require a funcall-like command to use them
03:17:26 <Sgeo> I can't help wondering if CLOS functionality would come in very useful here
03:22:30 <kmc> "recreational substances" is a great category if you take it to mean more than just drugs
03:23:01 <kmc> drugs, propane, helium, pudding, spray paint, lube
03:24:16 <shachaf> Those are even recreational chemicals!
03:24:37 <Sgeo> The big problem with refactoring is I don't get to touch the code that often
03:24:50 <Sgeo> I mean I do, but there's not often reason to work on it unless I'm adding a feature
03:25:04 <Sgeo> And deployment is annoying, becuase it consists of giving the code to the person actually running it
03:26:11 <kmc> i don't think pudding is a chemical
03:26:34 -!- Nisstyre has quit (Quit: Leaving).
03:26:54 <shachaf> True.
03:27:15 -!- Nisstyre_ has joined.
03:27:22 <kmc> spray paint is pretty complicated too
03:27:31 <Sgeo> Easiest thing to do would be to make the dispatcher check for the existence of the function it would call, and if it doesn't exist, call a default one
03:27:55 <shachaf> "dispatcher"? I just call that program "diff".
03:28:10 <shachaf> (Or maybe that's patch -R.)
03:28:20 <shachaf> whoa, dude, I haven't used patch in years!
03:28:31 <shachaf> Version control has taken over the world.
03:28:41 <kmc> i still use patch a lot
03:29:07 <shachaf> For what?
03:29:09 <kmc> like when i'm preparing a markdown document, but i want some custom tweaks to the generated html
03:29:31 <shachaf> That sounds like an unreliable system.
03:29:51 <kmc> yeah but it doesn't have to work 100% automatically every time
03:30:36 <shachaf> I was thinking in particular of "applying other people's patches to things".
03:30:43 <shachaf> Or "releasing patches".
03:31:38 <zzo38> WEB can automatically apply changes from an external file.
03:34:36 <Sgeo> shachaf, I did that once or twice
03:34:47 <Sgeo> Or, well, used diff
03:37:23 <Sgeo> I'm in AceHack http://patch-tag.com/r/ais523/acehack/snapshot/current/content/raw/doc/fixes36.0
03:37:44 <shachaf> Hmm, http://blog.sigfpe.com/2006/10/monads-field-guide.html are nice pictures.
03:39:20 <shachaf> monochrom says: seq is a suggestion. pseq is an order.
03:49:26 <TeruFSX> random question: what does Muller brainfuck do if you go past the cell limit?
03:55:34 <kmc> i miss monochrom's puns :/
03:55:47 <shachaf> @quote monochrom
03:55:47 <lambdabot> monochrom says: most people tend to deny the usefulness of useful alternative perspectives --- their entrenched vested interests demand it. as they grow older they also have more influence and power
03:55:48 <lambdabot> over "the state of the art" to preserve their self-fulfilling prophecy that "the alternative is useless" --- by controlling what practice looks like, they can control what looks useless.
03:56:38 * shachaf suspects that's not a pun.
03:56:40 <shachaf> @quote monochrom
03:56:41 <lambdabot> monochrom says: isTrue = (unsafeCoerce :: Either a b -> Bool) . (unsafeCoerce :: Maybe c -> Either a b) . (unsafeCoerce :: Bool -> Maybe c)
03:57:32 <shachaf> @quote monochrom
03:57:33 <lambdabot> monochrom says: All pointless debates can be settled by going polymorphic.
03:57:40 <Sgeo> Would that work for any types in place of Either a b and Maybe c?
03:58:03 <shachaf> Presumably.
03:58:04 <shachaf> @quote monochrom
03:58:05 <lambdabot> monochrom says: Welcome to #haskell, where @remember's are in majestic stereo!
03:58:36 <Sgeo> And does it actually have to maybe type with type? As in, it becomes a Maybe c and then the thing accepts a Maybe c, do those have to match?
03:58:53 <Sgeo> Or can it just be Bool in one end and out the other, regardless of whether the types in between fit?
03:59:13 <shachaf> The types definitely have to match.
03:59:39 <shachaf> unsafeCoerce :: A -> B is a real function that only accepts a value of type A and only returns a value of type B
04:00:03 <shachaf> It just happens to have a dubious implementation.
04:03:06 -!- Phantom_Hoover has quit (Read error: Connection reset by peer).
04:05:36 <centrinia> unsafeCoerce :: a -> b
04:06:07 <centrinia> Type variables start with lower case letters.
04:06:10 <shachaf> Yes, but once you explicitly give its signature as (Int -> Char), it'll be :: Int -> Char
04:06:18 <shachaf> Which is what I meant by A and B.
04:06:43 <centrinia> unsafeCoerce :: IO a -> a
04:15:08 -!- MoALTz has joined.
04:23:49 <zzo38> Are Canadian $1 coins made of plastic?
04:24:19 <pikhq> You tell me.
04:40:37 <zzo38> I don't know. That is why I ask.
04:44:13 <pikhq> But you're in Canada!
04:44:16 <pikhq> You can check!
04:44:30 <Sgeo> Light Table looks interesting
04:45:47 <zzo38> I cannot tell if it is plastic or just a different kind of metal. I do not currently have one of the new $1 coins, and when I did, I did not know. Someone told me it is plastic although I am unsure, and he told me later, he is also unsure.
04:48:24 -!- MoALTz has quit (Ping timeout: 276 seconds).
04:51:57 <shachaf> lem_lemma :: (Not a -> b) -> (a -> b) -> b
04:54:24 <quintopia> did you do that shachaf
04:54:30 <shachaf> Do what?
04:54:38 <shachaf> It's just the church encoding of lem.
04:54:49 <quintopia> invite lambda into lw
04:55:10 <shachaf> In a manner of speaking.
04:55:35 <zzo38> Law of excluded middle does not apply in intuitionistic logic, though.
05:02:07 -!- SimonRC has quit (*.net *.split).
05:18:51 <zzo38> I said I proved that (CodensityAsk Predicate) is actually the same as the infinite search monad; actually, I have only proven that the type is equivalent, not that the monad is equivalent. However, it seems to be equivalent monad from testing it.
05:20:09 <shachaf> kmc: You should make a CTF!
05:21:11 -!- quintopia has quit (Ping timeout: 252 seconds).
05:21:49 -!- quintopia has joined.
05:25:24 <zzo38> Maybe that church encoding of lem can be made using (Kleisli (Cont r)) instead of (->) category? You will already have Peirce's law (callCC).
05:26:05 <shachaf> Yes, in Haskell you would use Cont.
05:26:17 <shachaf> I just want to avoid all the syntactic nonsense that comes with it.
05:34:17 -!- impomatic has joined.
05:38:38 -!- copumpkin has changed nick to yeasayer.
05:39:03 -!- yeasayer has changed nick to copumpkin.
05:58:56 -!- asiekierka has joined.
06:05:18 -!- copumpkin has changed nick to AgentOfChaos.
06:07:52 -!- AgentOfChaos has changed nick to copumpkin.
06:31:24 -!- Tod-Autojoined has joined.
06:31:41 -!- TodPunk has quit (Read error: Connection reset by peer).
06:32:45 -!- epicmonkey has joined.
06:41:03 -!- Phantom_Hoover has joined.
06:41:07 <Sgeo> I don't like Clojure's ->, especially since there's a nice reader macro for lambda
06:41:29 <Sgeo> It should be easy to write an actual function -> that threads a value through the rest of the arguments as functions
07:04:35 <centrinia> > map ($2) [(+) 1, (*) 3]
07:04:36 <lambdabot> [3,6]
07:08:55 <Sgeo> <Sgeo> &(map #(% 2) [(partial + 1) (partial * 3)])
07:08:55 <Sgeo> <lazybot> ⇒ (3 6)
07:09:32 -!- zzo38 has quit (Remote host closed the connection).
07:13:21 -!- epicmonkey has quit (Ping timeout: 245 seconds).
07:14:15 -!- SimonRC has joined.
07:31:59 -!- asiekierka has quit (Remote host closed the connection).
07:40:07 -!- nooga has joined.
08:04:38 -!- nooga has quit (Ping timeout: 240 seconds).
08:15:53 -!- copumpkin has quit (Ping timeout: 260 seconds).
08:16:27 -!- copumpkin has joined.
08:19:18 -!- AnotherTest has joined.
08:28:17 -!- epicmonkey has joined.
08:34:18 -!- atriq has joined.
08:40:43 <atriq> Can anyone link me that XKCD with the guy talking to the guy on the phone
08:40:50 <atriq> The first guy isn't on the phone
08:41:03 <shachaf> TWIST: The second guy isn't on the phone either
08:41:11 <shachaf> Then who was phone?
08:41:13 <shachaf> (As they say.)
08:42:09 <Lumpio-> hello yes this is dog
08:43:36 <itidus20> hello dog, are you after human rights?
08:43:57 <centrinia> phon
08:45:29 <fizzie> Phone me a phoneme.
08:46:29 <Phantom_Hoover> I
08:46:31 <Phantom_Hoover> wow
08:46:43 <Phantom_Hoover> TV Tropes now has an interstitial on all outbound links.
08:47:06 <Lumpio-> Warning people of the dangers of the internet?
08:47:09 <Lumpio-> They're the moral police afterall
08:47:36 <atriq> I think they just want people like me to stay trapped
08:47:46 <atriq> Outbound links are my way out of there
08:55:04 -!- oerjan has joined.
08:58:17 -!- DHeadshot has joined.
09:03:57 <atriq> I just realised that the only reason I'm smiling is because the alternative is crying
09:04:01 <atriq> :)
09:04:12 * oerjan grins madly
09:04:37 * oerjan fails
09:04:54 * oerjan chews another piece of bread
09:08:12 -!- sirdancealot has quit (Read error: Connection reset by peer).
09:09:50 <atriq> I...
09:10:14 <oerjan> You...
09:10:14 <atriq> I think the best thing to do right now is try to get 100% on Avalancha on Medium on Guitar Hero 3
09:12:39 -!- sivoais has quit (Ping timeout: 265 seconds).
09:13:56 -!- heroux has joined.
09:21:41 -!- knott_rays has joined.
09:21:51 -!- knott_rays has left.
09:28:40 -!- nooga has joined.
09:37:40 -!- sivoais has joined.
09:43:47 <atriq> Well, I'm feeling a bit better now
09:47:01 <atriq> A bit shaky, though
09:55:56 -!- atriq has quit (Ping timeout: 252 seconds).
10:25:16 -!- ineiros has quit (Remote host closed the connection).
10:25:37 -!- ineiros has joined.
10:28:48 -!- derdon has joined.
10:28:53 -!- itidus20 has left ("Leaving").
10:36:22 -!- nooga has quit (Read error: Connection reset by peer).
10:42:05 -!- atriq has joined.
10:45:48 -!- impomatic has quit (Quit: http://RetroProgramming.com).
10:56:51 <shachaf> ion: Why is your nick "ion"?
10:57:05 <ion> shachaf: Why not?
10:57:25 <shachaf> Opportunity cost.
11:34:36 -!- MoALTz has joined.
11:50:34 <oerjan> "These are no _ordinary_ subterranean mecha-narwhals!"
11:51:20 -!- AnotherTest has quit (Read error: Connection reset by peer).
11:53:14 -!- AnotherTest has joined.
11:55:44 <atriq> oerjan, :)
11:56:16 <atriq> I'm going to think outloud here for a bit, if that's okay with everyone?
11:56:35 <atriq> The intellectual and cultural ancestors of Homestuck:
11:57:04 <Sgeo> " The let special form is used here for efficiency in the event that the first parameter, number, is passed as an expression instead of a simple value."
11:57:35 <Sgeo> Yes. Efficiency is totally the reason you want something to evaluate only once in an impure language.
11:57:35 <atriq> The most obvious is Problem Sleuth, Andrew Hussie's previous work, which had elements of choose-your-own-adventure/interactive fiction and film noir.
11:58:08 <atriq> Problem Sleuth also has many references to Jail Break, another of Andrew Hussie's works. Jail Break is just silly.
11:58:14 <atriq> (to be expanded upon)
11:58:55 <atriq> While there are few if any Bard Quest references in Problem Sleuth, there are a handful in Homestuck, for instance Gamzee's god tier outfit.
12:00:00 <atriq> Within Homestuck, there are references to Arthurian mythology, especially that Dave Strider encountered Caledfwlch, the Welsh name for Excalibur
12:00:31 <atriq> There are also Lord of the Rings references, such as Strider possessing a broken sword
12:01:09 <atriq> Lord of the Rings was influenced by Norse mythology
12:01:47 <atriq> And Old English (Anglo-Saxon) stories
12:02:37 <atriq> There are references to the Gospels, such as Jake kissing the head of Dirk, and "Being the Salome to [his] John the Baptist"
12:03:09 <atriq> Other elements of Abrahamic mythology are touched upon
12:03:12 -!- mig22 has joined.
12:03:47 <atriq> Such as the Angels being feared creatures, as they were throughout the Bible
12:04:00 <atriq> Graeco-Roman mythology is referenced especially with the Denizens
12:04:18 <atriq> For instance, Dave's denizen is Hephaestus, who was a Greek god
12:04:54 <atriq> The works of Oscar Wilde, Mark Twain, Shakespeare, Snoop Dogg, and many others are referenced
12:13:29 <oerjan> :t (0$0<$>)
12:13:30 <lambdabot> The operator `<$>' [infixl 4] of a section
12:13:30 <lambdabot> must have lower precedence than that of the operand,
12:13:30 <lambdabot> namely `$' [infixr 0]
12:16:27 <oerjan> :t print <$> readInt <$> getLine
12:16:28 <lambdabot> Overlapping instances for Show
12:16:28 <lambdabot> ((Char -> Bool) -> (Char -> Int) -> ReadS String)
12:16:28 <lambdabot> arising from a use of `print' at <interactive>:1:0-4
12:16:45 * oerjan swats lambdabot -----###
12:17:13 <shachaf> Why would you print <$> readInt <$> getLine?
12:17:26 <oerjan> beats me http://www.reddit.com/r/haskell/comments/ypyx4/why_does_print_readint_getline_return_an_ioio/
12:18:13 <shachaf> Hmm, so if my program compiles but doesn't work, I just need to put join $ in front of it?
12:18:39 <oerjan> i can see why it is _wrong_, but my housemate is playing music so loudly i cannot get my brain to infer why it _does_ type
12:19:15 <shachaf> @ty readInt
12:19:15 <oerjan> (and it looks to me like the comments use the wrong associativity for <$>)
12:19:16 <lambdabot> forall a. (Num a) => a -> (Char -> Bool) -> (Char -> Int) -> String -> [(a, String)]
12:19:27 <shachaf> I don't think that's the readInt you're thinking of.
12:19:37 <oerjan> oh duh
12:19:41 <oerjan> grmbl
12:19:44 <shachaf> @ty read <$> getLine
12:19:45 <lambdabot> forall a. (Read a) => IO a
12:19:45 <Sgeo> Oh god I've hit that issue before
12:19:48 <shachaf> @ty print <$> read <$> getLine
12:19:49 <lambdabot> IO (IO ())
12:19:52 <shachaf> See?
12:20:05 <oerjan> :t let readInt = read :: String -> Int in print <$> readInt <$> getLine
12:20:06 <lambdabot> IO (IO ())
12:20:13 <shachaf> (print :: a -> IO () in this case.)
12:20:15 <Sgeo> Therefore, Haskell's type system should be taken out and shot.
12:20:17 <shachaf> So you get iO (IO ())
12:20:39 <shachaf> Of course, join (print <$> x) == x >>= print
12:20:53 <oerjan> ok that makes sense, the first <$> just becomes .
12:20:57 <Sgeo> It lets through wrong programs! This is a travesty!
12:21:05 <shachaf> oerjan: No, it doesn't need to.
12:21:16 <oerjan> YES IT DOES
12:21:18 <shachaf> <$> is infixr
12:21:28 <oerjan> shachaf: um i just checked it's not
12:21:36 <shachaf> Oh, right.
12:21:40 <shachaf> But if it was it would still work!
12:21:50 <oerjan> quite possibly
12:21:51 <shachaf> <$> IS SO ASSOCIATIVE, IT ASSOCIATES ACROSS DIFFERENT TYPES!
12:21:53 <shachaf> (It's true.)
12:22:09 <oerjan> oh it does tend to do that
12:22:14 <shachaf> (x <$> y) <$> z == x <$> (y <$> z), when both type-check.
12:22:19 <shachaf> Even if it's different instances of <$>
12:22:23 <shachaf> Of Functor
12:26:13 -!- oerjan has quit (Quit: MUST... ESCAPE).
12:37:41 -!- kmc_ has joined.
12:42:32 -!- centrinia has quit (*.net *.split).
12:42:32 -!- ion has quit (*.net *.split).
12:42:32 -!- kmc has quit (*.net *.split).
12:48:19 -!- ion has joined.
12:49:12 -!- centrinia has joined.
12:52:52 -!- mtve has quit (*.net *.split).
12:52:59 -!- mtve has joined.
13:07:18 -!- boily has joined.
13:31:38 -!- epicmonkey has quit (Ping timeout: 244 seconds).
13:43:58 -!- mig22 has quit (Quit: mig22).
13:47:31 <atriq> Dear god Leeds is far south
13:50:52 <fizzie> Far out, man.
13:52:55 <atriq> Halifax is about halfway between me and ais523
13:56:51 -!- monqy has quit (Quit: hello).
13:58:19 -!- copumpkin has quit (Quit: Computer has gone to sleep.).
14:00:53 <boily> halifax, as in nova scotia's halifax?
14:03:15 <atriq> As in the Halifax that's about halfway between Birmingham and Hexham
14:03:31 <atriq> Yorkshire, I think
14:04:33 <atriq> :/
14:05:53 -!- Tod-Autojoined has quit (Quit: This is me, signing off. Probably rebooting or something.).
14:06:03 <atriq> That Halifax is about halfway between me and somewhere off the west coast of Mexico
14:06:04 -!- TodPunk has joined.
14:06:07 <atriq> God, I'm far north
14:06:26 <atriq> Actually, I'm not that far North, it's just California
14:08:07 <boily> if someone was double the distance that separates me from halifax, in the same direction, he'd be a little bit on the damp side.
14:20:34 -!- copumpkin has joined.
14:26:11 -!- nortti has changed nick to []{}\|-_`^.
14:26:20 -!- []{}\|-_`^ has changed nick to []{}|\-_`^.
14:26:42 -!- []{}|\-_`^ has changed nick to nortti.
14:35:42 <atriq> Why is my num lock button flashing
14:35:45 <atriq> WHAT COULD THIS MEAN
14:36:33 <nortti> kernel panic
14:37:32 <atriq> Wouldn't a kernel panic stop IRC from working?
14:37:53 <nortti> yes
14:38:04 <atriq> Probably not a kernel panic, then?
14:38:12 <nortti> yeah
14:38:17 <nortti> what os?
14:38:57 <kmc_> pernel kanic
14:39:00 -!- kmc_ has changed nick to kmc.
14:39:11 <atriq> Ubuntu
14:39:17 <nortti> ok.
14:39:28 <nortti> there is your problem
14:40:04 <atriq> I think my problem is the cable that snapped when the right hinge for the screen broke
14:40:58 <Sgeo> :t (>>=) :: [a] -> (a -> [a]) -> [a]
14:40:59 <lambdabot> forall a. [a] -> (a -> [a]) -> [a]
14:41:10 <atriq> :t concatMap
14:41:11 <lambdabot> forall a b. (a -> [b]) -> [a] -> [b]
14:41:26 <atriq> :t concatMap `asTypeOf` (=<<)
14:41:27 <lambdabot> forall a b. (a -> [b]) -> [a] -> [b]
14:41:41 <atriq> Wait
14:41:46 <Sgeo> Long story short, I'm having trouble explaining mapcat to someone in #clojure
14:41:51 <Sgeo> Although they're now saying they get it
14:42:05 <atriq> It maps then squishes?
14:42:16 -!- cheater has joined.
14:42:21 <atriq> I don't know Clojure, though, so I couldn't say
14:42:54 -!- kinoSi has quit (Read error: Connection reset by peer).
14:43:20 <Sgeo> mapcat is concatMap
14:43:21 -!- kinoSi has joined.
14:44:08 <atriq> Okay, it turns out Numlock is actually switching on and off again repeatedly
14:45:12 <atriq> 644444464646464646464646464464646464646464664
14:45:23 <nortti> why?
14:45:30 <atriq> I don't know!
14:45:39 -!- boily has quit (Quit: Poulet!).
14:48:16 -!- Zuu has joined.
14:58:51 -!- soundnfury has quit (Quit: quIRC).
14:59:15 -!- soundnfury has joined.
15:01:08 <Sgeo> :t (<*>)
15:01:09 <lambdabot> forall (f :: * -> *) a b. (Applicative f) => f (a -> b) -> f a -> f b
15:01:14 -!- Gregor has quit (Excess Flood).
15:01:21 -!- Gregor has joined.
15:02:00 -!- DHeadshot has quit (Ping timeout: 276 seconds).
15:04:27 <Gregor> I present the most spurious patch ever: http://pcc.ludd.ltu.se/jira/browse/PCC-401
15:29:57 -!- atriq has quit (Ping timeout: 276 seconds).
15:30:13 -!- heroux has quit (Ping timeout: 252 seconds).
15:37:53 -!- heroux has joined.
15:56:27 -!- ogrom has joined.
16:15:06 -!- copumpkin has changed nick to ThreeFixt.
16:15:44 <pikhq> Gregor: :)
16:16:21 -!- ThreeFixt has changed nick to copumpkin.
16:22:46 -!- atriq has joined.
16:43:03 <Sgeo> Rich Hickey appears to be convinced that allowing uncoordinated reads is a good idea. For some reason, that bothers me.
16:43:25 <atriq> Uncoordinated read?
16:44:04 -!- ogrom has quit (Quit: begone).
16:44:05 <Sgeo> Reading STM refs outside of a transaction, for instance.
16:45:26 <atriq> Okay
16:45:38 <atriq> I've never done any STMy type things
16:47:06 <kmc> how does that differ from reading a STM ref in a transaction which consists only of that operation?
16:49:23 <Sgeo> kmc, I guess it doesn't particularly, except that requiring the transaction might... discourage idiots from doing it that way?
16:49:29 <Sgeo> I guess you're right
16:49:29 <Gregor> The fact that requiring it to be in an STM makes you think.
16:49:31 -!- ogrom has joined.
16:49:58 <Gregor> Also in principle there could be architectures where transactional memory is distinct from general memory, but that's unlikely.
16:58:41 <Sgeo> In Clojure, println is available in dosync
16:58:50 <Sgeo> "that would be a lot of overhead when it's generally not needed"
16:58:58 <Sgeo> (about defining println with io!)
16:59:18 -!- atriq has quit (Ping timeout: 244 seconds).
17:12:51 -!- atriq has joined.
17:43:58 -!- variable has quit (Read error: Connection reset by peer).
18:00:43 -!- variable has joined.
18:03:33 -!- Vorpal has joined.
18:04:23 -!- atriq has quit (Read error: Connection reset by peer).
18:11:53 <coppro> blargh
18:16:05 <Vorpal> hi
18:20:19 -!- atriq has joined.
18:22:09 -!- ais523 has joined.
18:25:58 <olsner> appelsiinit kerkiän
18:27:37 <fizzie> That's good.
18:28:38 <olsner> what does appelsiinit päähän mean?
18:29:00 -!- zzo38 has joined.
18:29:05 <fizzie> "Oranges to the head".
18:29:19 <fizzie> Head being the body part.
18:29:55 <fizzie> Like, "hatut päähän" could be "put on your hats".
18:30:10 <fizzie> It sounds like the same thing except for oranges.
18:30:32 <olsner> google translate translates päähän as "from the"
18:30:59 <olsner> I suppose it would be appelsiini X päähän or something, to mean oranges from the X?
18:32:36 <fizzie> "päähän" is the illative ("into", in most cases) case of pää 'head'.
18:33:25 -!- ogrom has quit (Quit: begone).
18:37:02 <fizzie> At least primarily. There's a different -han/-hän suffix (illative is -an/-en/etc., just changes a bit to work with "pää") it could also be, but I'm not exactly sure how that'd translate. It wouldn't fit in after the oranges, anyway.
18:37:03 <ion> Pää can also mean “side”, as in “this side of the room”.
18:37:26 <fizzie> http://en.wiktionary.org/wiki/-han that one.
18:37:54 <fizzie> Yes, I guess. Or I'd say more like "end" as in "this end of the room".
18:38:26 <ion> Indeed
18:39:40 <FreeFull> :0g,:93+`#@_1+
18:41:13 <Vorpal> does anyone know what difference there is between properly ejecting and just yanking out an usb stick with write cache disabled, and no open files, under windows 7? I know there is one (long story, can tell it if you want), but I don't know what it is.
18:42:07 <olsner> the universe implodes if you remove usb devices without completing the wizard
18:42:18 <Vorpal> olsner, what wizard?
18:42:27 <olsner> the eject devices wizard?
18:42:47 <Vorpal> olsner, eh, no need for that thing on windows 7, you can just right click the device in explorer and select eject
18:43:51 <Vorpal> olsner, anyway there is a difference, in one case the embedded controller we use at work accepts it to load the code from, in the other it doesn't.
18:43:52 <fizzie> FreeFull: "Output character on row 0, column corresponding to top of stack; if TOS > 12, stop; otherwise increment by 1 and continue"?
18:44:16 <fizzie> Quine, then?
18:45:24 <FreeFull> A random quine from the web
18:45:57 <fizzie> It's very reasonable, though I suppose a purist would say a g-quine is just boring.
18:46:17 <Vorpal> fizzie, huh?
18:46:28 <fizzie> FreeFull: Huh?
18:46:39 <fizzie> Uh, I mean, Vorpal: Huh?
18:46:49 <fizzie> (Huh.)
18:46:55 <FreeFull> g?
18:47:05 <FreeFull> Goedel?
18:47:06 <fizzie> FreeFull: One that uses 'g'.
18:47:09 <Vorpal> fizzie, why would a g-quine be boring?
18:47:10 <FreeFull> Oh
18:47:35 <fizzie> Vorpal: "Too easy," I believe is the reasoning.
18:47:45 <fizzie> Since it can just read the source.
18:47:59 -!- AnotherTest has quit (Quit: Leaving.).
18:48:21 <Vorpal> fizzie, ah
18:48:29 <fizzie> Not that the "-based ones are really any unboringer, I suppose.
18:48:52 <FreeFull> I have to yet write a quine
18:49:44 <olsner> hmm, I had an interesting idea related to quines a while ago, but I can't remember what it was
18:50:59 <fizzie> olsner: If you still have a binary of your idea, and it's related to quines enough, maybe running it will recover the original idea.
18:51:11 <olsner> no, the idea was only in my head
18:51:32 <FreeFull> olsner: Was it a program that prints a program in another language, that prints the original program?
18:51:53 <olsner> it shouldn't have been because I've read about programs like that before
18:52:07 <FreeFull> Yeah, they're pretty cool
18:52:49 <FreeFull> Ruby → Python → Perl → Lua → OCaml → Haskell → C → Java → Brainfuck → Whitespace → Unlambda
18:52:53 <FreeFull> And then back to Ruby
18:54:32 <olsner> once the program has managed to get out of ruby, why would it want to get back?
18:54:52 <FreeFull> I don't know
18:55:22 <FreeFull> To escape Unlambda?
18:56:04 <Vorpal> FreeFull, do you have a link to that quine?
18:59:06 <FreeFull> http://d.hatena.ne.jp/ku-ma-me/20090916/p1
18:59:52 <Vorpal> heh
19:01:29 <FreeFull> It's surprisingly short
19:03:55 <FreeFull> wc -c says 1945 bytes
19:05:09 <Vorpal> I don't have ruby, ocaml or lua installed, so meh
19:05:24 <Vorpal> nor do I have a whitespace interpreter
19:06:10 <FreeFull> Ruby 1.9 seems to error on it
19:06:24 <Vorpal> ouch
19:23:30 -!- Slereah has joined.
19:24:04 -!- oerjan has joined.
19:24:49 <kmc> butts
19:24:53 <kmc> butts
19:25:23 <oerjan> we all empathize with your tourette's, kmc
19:25:34 <olsner> I don't
19:25:46 <oerjan> except olsner
19:26:00 <oerjan> that's because he's swedish
19:26:10 <kmc> is that code supposed to have yen symbols all over
19:26:15 <kmc> or is this some character encoding fuckery
19:26:22 <olsner> oh, that could be backslashes
19:26:34 <kmc> yeah they are actually backslashes
19:26:41 <kmc> in fact when i copy-paste one it's a backslash, wtf
19:26:50 -!- Slereah_ has quit (Ping timeout: 252 seconds).
19:27:03 <oerjan> i've heard about that japanese encoding quirk before
19:27:05 -!- Slereah_ has joined.
19:27:20 <olsner> I think they assigned characters just before backslash became the second most useful character in ascii
19:27:22 <olsner> or something like that
19:27:53 <oerjan> well backslash _is_ one of characters that was commonly nationalized
19:27:56 -!- Slereah has quit (Ping timeout: 245 seconds).
19:28:03 <oerjan> [|]{\} afair
19:28:22 <oerjan> i think \ was used for Ø in norway
19:28:28 <kmc> us stages coup in iran in response to nationalizing backslash
19:28:52 <olsner> the infamous backslash backlash
19:29:04 <oerjan> kmc: i see you've nationalized backslash to mean oil
19:29:35 <kmc> $ echo '[|]{\}' | iconv -f iso646-no
19:29:35 <kmc> ÆøÅæØå
19:30:29 <kmc> int main() æ printf("Hei, verden!Øn"); å
19:30:37 <oerjan> XD
19:30:39 <olsner> interesting! iso646-se gives ÄöÅäÖå
19:31:11 <oerjan> olsner: which means they used consistent encodings rather than going by each alphabet's order
19:31:20 <olsner> so that's like from the 7-bit days?
19:31:23 <oerjan> yeah
19:31:37 <kmc> yep, ISO 646 is the international standard for ASCII and its variants
19:32:05 <olsner> UTF-.875
19:32:33 <shachaf> kmc: Are there any interesting theorems in plain typed-lambda-calculus Curry-Howard?
19:32:49 <shachaf> callcc not included.
19:33:15 <kmc> this is also why [\] are considered to be upper-case versions of {|} by some IRCds
19:33:32 <kmc> because they are ÄÖÅ and äöå respectively in iso646-fi
19:33:51 <kmc> olsner: :)
19:35:06 <oerjan> shachaf: simply typed lambda calculus is equivalent to intuitionistic propositional logic restricted to -> afaik.
19:35:20 <shachaf> oerjan: Right.
19:35:40 <oerjan> a theorem _about_ it is that it is PSPACE-complete to check propositions for theoremhood
19:36:04 <oerjan> (unlike NP-completeness for boolean logic)
19:36:59 -!- derdon has quit (Remote host closed the connection).
19:38:41 <shachaf> I was wondering if it would make a good puzzle game on its own if expressed in the right way.
19:38:47 <shachaf> But then I couldn't think of many interesting puzzles.
19:39:01 <oerjan> it should be on the level of sokoban, by complexity alone
19:39:32 <kmc> shachaf: did you see http://logitext.mit.edu/main
19:39:41 <shachaf> You can make puzzles that are a lot of work to solve, but I'm wondering if you can make ones that are interesting.
19:40:09 <shachaf> Polymorphism and rank-n types and so on can be permitted if they make it more interesting.
19:40:13 <shachaf> kmc: Nope.
19:41:25 <oerjan> polymorphism means at least hindley-milner, so doubly exponential time iirc
19:41:35 <shachaf> Oh, that's ezyang's thing.
19:41:45 <shachaf> He may have mentioned it before.
19:41:52 <oerjan> it was reddited
19:42:01 <shachaf> I missed that.
19:55:30 <shachaf> I find that sort of proof with turnstiles and \frac{...}{...} pretty hard to read.
19:56:27 -!- Phantom_Hoover has quit (Ping timeout: 276 seconds).
19:59:57 -!- Vorpal has quit (Ping timeout: 240 seconds).
20:00:59 <oerjan> shachaf: made a comment out of our earlier discussion http://www.reddit.com/r/haskell/comments/ypyx4/why_does_print_readint_getline_return_an_ioio/c5y85z4?context=1
20:01:26 <shachaf> We had a discussion?
20:01:34 <oerjan> a brief one :P
20:01:38 <shachaf> Oh, yes.
20:01:55 <tswett> Something tells me that in C++, allocating sizeof(SomeClass) bytes and then casting the result to SomeClass* is a bad way of creating an object.
20:02:24 <kmc> it doesn't create an object; the constructor doesn't get called
20:02:28 <kmc> but you can use placement new for that
20:03:16 <tswett> I like it.
20:04:08 <kmc> SomeClass *x = malloc(sizeof(SomeClass)); new (x) SomeClass();
20:04:21 <olsner> allocating and casting is a bad way, but it's not illegal or anything
20:04:41 <ion> Huh, i don’t think i’ve ever seen that syntax.
20:04:54 <kmc> i think it's undefined behavior, unless the object is Plain Old Data
20:05:11 <shachaf> Placement new is undefined behavior?
20:05:19 <kmc> using an object without calling the constructor
20:05:27 <shachaf> Oh.
20:05:29 <shachaf> Makes sense.
20:05:44 <kmc> even if there's no explicit constructor code, there might be other stuff that needs to happen behind the scenes
20:05:53 <kmc> for example an object with virtual methods will likely need a vtable pointer
20:06:04 <olsner> right, I meant with placement-new to call the constructor, otherwise you're obviously getting uninitialized bytes anyway
20:06:42 <kmc> even if you're okay with all the explicitly named data fields being uninitialized, it's still undefined behavior
20:06:49 <shachaf> Is it valid to cast it in one place and then use placement new in another place?
20:07:14 <kmc> probably, but not 100% sure
20:07:31 <shachaf> SomeClass *x = malloc(...); doesn't compile, by the way (I think).
20:07:40 <kmc> oh, right, not in C++
20:08:06 <shachaf> ion: Do you know the syntax "foo.template bar()"?
20:08:25 <kmc> ion: http://www.parashift.com/c++-faq/placement-new.html
20:09:25 <kmc> void Foo::reset() { this->~Foo(); new (this) Foo(); }
20:10:04 <olsner> eww, destroying this and then constructing a new object in the same place
20:10:21 -!- Phantom_Hoover has joined.
20:10:51 <tswett> I'm beginning to wonder why, exactly, I'm using malloc() for objects at all...
20:11:56 <olsner> it's not a thing to do for no particular reason
20:12:10 <ion> shachaf: Nope
20:12:15 <olsner> if you want to do that safely you can implement new to call malloc instead
20:12:26 <olsner> otoh, most likely that's exactly the implementation you already have
20:12:56 <tswett> I'm declaring a class representing a header. I'm then allocating enough memory to hold the header and some additional data, then creating the header, and putting a pointer to the additional data in the header.
20:12:59 <kmc> what's even more fun is that you can overload "operator new"
20:13:13 <tswett> The only benefit to this is that the header and the data are next to each other.
20:13:18 <kmc> so that within "new (x) SomeClass()", x could be an object rather than a raw pointer
20:13:23 <kmc> such an object can implement a memory pool
20:13:26 <kmc> http://www.parashift.com/c++-faq/memory-pools.html
20:13:44 <olsner> I think you can also overload new in SomeClass such that new SomeClass does that
20:13:52 <tswett> And I don't think it's at al important that the header and the data be next to each other. The computer doesn't care too much.
20:14:09 <olsner> since there is no placement delete, overriding placement new is limitedly useful
20:14:47 <tswett> Placement delete...
20:14:58 <tswett> Remove a specific object from a specific location?
20:15:39 <olsner> well, delete-with-custom-arguments is more what I meant
20:15:40 <kmc> olsner: no, it lets you implement memory pools, and overloading "operator delete" plays an important role in that
20:15:53 <kmc> the link i just gave explains how
20:16:06 <olsner> you can define a delete operator with arguments, but afaik it's impossible to call it
20:16:42 <shachaf> olsner: Presumably you can use the regular delete operator, since you know where the pool is.
20:19:13 <olsner> sure, if you're willing to waste a pointer for each allocation you can store the Pool* there and override global delete
20:20:45 <olsner> the thing is, you can define and use a hundred news each with different frobs and wobnickles, but you don't really know which of them are known by delete foo
20:22:40 <shachaf> kmc: Did you see http://byorgey.wordpress.com/2012/08/24/unordered-tuples-and-type-algebra/ ?
20:22:52 <shachaf> (I don't remember if you were involved in the discussion about that a while ago.)
20:23:02 <tswett> There. Now I'm doing this the non-stupid way instead of the stupid way.
20:23:21 <tswett> Instead of allocating the whole thing at once and using placement new, I'm just using malloc() on the individual pieces individually.
20:23:25 <olsner> overrides of "placement delete" *look* like they'll do the right thing, but they only actually get called when constructors throw
20:24:38 <kmc> shachaf: no
20:28:27 -!- Nisstyre has joined.
20:40:41 -!- copumpkin has quit (Quit: Computer has gone to sleep.).
20:55:13 <tswett> So, now we've got a simple object system.
20:55:23 <tswett> There is one object, called Class, of type Class.
20:56:36 <oerjan> a very classy system
20:57:10 <tswett> I guess classes ought to have superclasses. Class's superclass will probably be Object. Object's class can also be Class, and Object's superclass can also be Object.
20:57:31 <oerjan> will there be a method?
20:57:44 <tswett> Then again, metaclasses are pretty much mandatory.
20:57:50 <tswett> There will be methods at some point.
20:58:29 <kmc> we need a classless society
21:02:49 <ion> we need an assless society
21:03:58 <oerjan> we need a lassless society
21:06:45 <tswett> We need a lossless society.
21:07:01 <tswett> The extra bandwidth and disk space required would be worth the increase in reliability.
21:16:07 <tswett> JathObject*& JathClassObject::superclass() {return strongPtrs[SUPERCLASS];}
21:16:20 <tswett> I can't shake the feeling that I'm doing something horribly wrong.
21:19:30 <tswett> j_Class_class->_class = j_Class;
21:19:33 <tswett> "Class" is no longer a word.
21:19:42 <kmc> i wrote a program to figure out when the wait at the Registry of Motor Vehicles will be shortest
21:21:40 <oerjan> kmc: now investigate what will happen if _everyone_ uses such a program.
21:22:25 -!- atriq has quit (Remote host closed the connection).
21:28:52 <tswett> Presumably, it would not increase or decrease the speed at which people are served, so it would probably make everyone's wait time the same.
21:29:22 <tswett> Except that it would eliminate times at which there are no customers.
21:29:40 <tswett> Okay, so we've got objects, which have classes; and classes, which are objects and have superclasses.
21:30:13 <kmc> well most people have constraints on when they can go
21:30:36 <tswett> True.
21:31:20 <shachaf> kmc: How does it figure that out?
21:36:00 <kmc> the RMV lists wait times on their website
21:36:15 <kmc> updated every minute or so
21:36:29 <kmc> and indeed it's available in an extremely scrapeable AJAXy format at http://www.massdot.state.ma.us/DesktopModules/BranchMapDNN/GetWaitTimes.aspx?Town=Boston
21:41:10 <kmc> there is bike share all over Cambridge now
21:44:43 <shachaf> How does that work?
21:45:15 <kmc> which?
21:45:43 <shachaf> Bike share.
21:45:55 <kmc> http://www.thehubway.com/
21:46:01 <kmc> same as most city bike share programs
21:46:11 <kmc> they have stations around the city with electronically-locking bike racks
21:46:46 <kmc> you pay for a subscription (1 day, 3 days, or 1 year), which gives you the right to check out a bike for 30 minutes for free
21:46:49 <shachaf> Hmm, they had something similar in Tel Aviv when I was most recently there.
21:46:53 <kmc> (you can return it to a different station than the one where you got it)
21:47:00 <kmc> you pay more if you want more than 30 min
21:47:19 <kmc> the bikes are kinda crap though
21:47:28 <kmc> also they have no solution for helmets
21:47:36 <shachaf> Yep.
21:48:30 <shachaf> (I ended up using the thing in Tel Aviv.)
21:48:53 <kmc> i could actually use this, since my bike is broken at the moment
21:48:53 <shachaf> That was my experience.
21:49:20 <kmc> what was your experience?
21:49:26 <shachaf> Also once they didn't have enough bicycles at a station, so we had to manage with two bicycles for three people.
21:49:34 <shachaf> The bicycles weren't very good and we didn't use helmets. :-)
21:49:38 <kmc> that sounds inconvenient
21:50:40 <kmc> the amount of tourist-gouging in the pricing is always entertaining
21:51:05 <kmc> a yearly pass costs the same as 17 day passes
21:51:26 <shachaf> That doesn't seem unreasonable.
21:51:44 * shachaf ought to get a bicycle.
21:51:49 <shachaf> Well, I have a bicycle. But it's in WA.
21:52:52 <oerjan> west antarctica
21:54:40 <shachaf> Code like "cmpq $36,%rax; jl .Lc1jq; cmpq $36,%rax; jne .Lc1jo" is redundant, right?
21:55:26 <shachaf> I mean the second cmpq
21:55:49 <zzo38> At least to me it seem it is but I don't know exactly how the instructions operate.
21:55:50 <pikhq> For no good reason I've been contemplating Brainfuck stuff again.
21:55:59 <Phantom_Hoover> down that path lies only pain
21:56:06 <zzo38> Another possibility is if the second cmpq is a jump target
21:56:23 <zzo38> pikhq: What kind of Brainfuck stuff?
21:56:28 <pikhq> Namely, how to get a really damned compact threaded code compilation of it.
21:56:28 <shachaf> zzo38: That's true, but I assume it would have a label in that case.
21:57:03 <zzo38> shachaf: Yes I would think so. But without seeing the rest of the program I wouldn't know for sure.
21:57:16 <shachaf> zzo38: This is code being generated by GHC.
21:57:45 <kmc> which backend?
21:58:10 <shachaf> The default one.
21:58:14 <shachaf> -fasm, I guess.
21:58:20 <shachaf> Maybe this is one of the optimizations that -fllvm would do.
21:58:30 <zzo38> Does GHC ever compile a code where jump target addresses are computed from arithmetic?
21:58:48 <zzo38> If not, then you should complain about such a code like you wrote
22:00:12 <shachaf> Hmm, it looks like -fllvm generates similar code.
22:01:18 <zzo38> Will it generate a LLVM code or a native code, though?
22:01:36 <shachaf> I mean the x86 code generated by LLVM.
22:01:42 <shachaf> I'm just looking at the output of ghc-core here.
22:02:28 <zzo38> Then improve LLVM. LLVM seem to be missing many optimizations as far as I know.
22:02:34 <pikhq> First, I've got a single byte *ludicrously* packed. Next, I'm trying to figure out how I can get loops more compactly expressed...
22:02:58 <shachaf> I bet pikhq can fit a byte into 7 bits.
22:03:01 <shachaf> 6 on a good day.
22:03:06 <zzo38> pikhq: Explain more specifically?
22:03:14 <kmc> it all comes down to how hard you shove
22:03:21 <pikhq> What I'm thinking is that each loop can get expressed as a function, and any loops with identical bodies are the same function...
22:04:09 <zzo38> Are you trying to make program to compile a brainfuck code into another program?
22:05:20 <pikhq> zzo38: Two bits indicate whether you've got a tape add, a movement, or something else. If it's something else, then we've got the rest of the bits to express that. Otherwise, the rest of the bits indicate how much you add to the tape cell, or how far you need to move.
22:05:42 <pikhq> zzo38: Trying to get it to a ludicrously compact expression for no good reason *at all*.
22:06:01 <pikhq> zzo38: For, like, an interpreter or something.
22:06:03 <zzo38> pikhq: OK. Yes that makes sense and I have thought of similar things too, and possibly some other people have also done something similar.
22:06:25 <pikhq> It's silly, but it's Friday and I don't have much else going on. So. :P
22:07:09 <pikhq> Anyways, with just compacting the opcodes like that I've got LostKng.b in 216k.
22:07:52 <zzo38> I have been told that LLVM will not optimize brainfuck programs very good compared to other programs, perhaps optimization of pointer arithmetic and so on?
22:08:09 <pikhq> And I think making it so loop bodies only ever get expressed once could do better still...
22:09:57 -!- pikhq_ has joined.
22:10:11 <zzo38> Other ideas I have thought of for optimization in LLVM would be constraint analysis, BCD optimization (for target architectures which support it), analysis of representation of enumerations, etc
22:10:21 <pikhq_> As well as shoving references to particularly common ones inside of the byte, so e.g. [-] could be a single byte per instance as well as 2 more bytes per program.
22:10:28 <zzo38> And self-modifying code, too.
22:10:59 <zzo38> pikhq_: You could also make [-] a special case if it would seem to help
22:11:19 <pikhq_> About the only benefit this would have, of course, is letting you run LostKng.b from L1. :P
22:11:36 <zzo38> pikhq_: Another optimization is that sequences -+ +- <> >< +, -, should never occur.
22:11:47 <pikhq_> zzo38: I already handle those.
22:12:04 <oerjan> <>< is very fishy brainfuck
22:12:09 <zzo38> Therefore the packed representation should become unable to represent such sequences.
22:12:25 <pikhq_> I think the packed representation is theoretically capable of it.
22:12:47 <pikhq_> But it's never actually expressed.
22:13:08 -!- pikhq has quit (Ping timeout: 248 seconds).
22:13:37 <pikhq_> Once I'm done with this I'll probably make a simple interpreter, and have a LostKng binary in $tiny.
22:15:47 <fizzie> Phew, Stripe stroped.
22:17:06 <zzo38> Another thing I was thinking of is to make a Famicom-based software synthesizer in .NSF, possibly using FDS and MMC5 expansions so that you can use the 8-bit PCM, hardware multiplication, and extra RAM (using FDS expansion makes most of the ROM area into RAM, so combining it with PCM reading from the ROM area you might be able to make RAM PCM too).
22:21:21 <pikhq_> Hah. And gzip'd, LostKng is 40k after this...
22:21:21 <kmc> fizzie: ?
22:21:35 <pikhq_> (vs. 88k otherwise)
22:23:53 <fizzie> kmc: As in, "done".
22:26:23 <kmc> congrats
22:26:44 <Phantom_Hoover> fizzie, what stripe
22:26:55 <shachaf> Oh, I need to get back to that.
22:28:53 -!- oerjan has set topic: May contain strawberries | Just a remote control and some old gum | atriq is Taneb, just so you know | any topic history can be faked | except this | http://codu.org/logs/_esoteric/.
22:28:59 <kmc> Phantom_Hoover: stripe-ctf.com i assume
22:31:47 <fizzie> The above, yes.
22:48:35 <kmc> they had some fun levels
22:48:41 <kmc> i think i learned more than in the previous ctf
22:49:23 <fizzie> Ditto, due to the different topic.
22:49:34 <shachaf> fizzie: Which solution did you have for level 6?
22:50:25 -!- ion has set topic: May contain strawberries | Soy strawberries are more ethical | Just a remote control and some old gum | atriq is Taneb, just so you know | any topic history can be faked | except this | http://codu.org/logs/_esoteric/.
22:50:36 <fizzie> shachaf: A script-embedderistic one.
22:51:07 <shachaf> OK, so the same as mine, I assume.
22:51:10 <shachaf> kmc did something else.
22:51:57 <fizzie> shachaf: I saw a mention in the interwebs that there was a cookie-mungling-with-secrets-from-error-message solution that the Stripe folks patched out (by disabling the error messages in question).
22:52:11 <shachaf> Yep, that.
22:52:30 <shachaf> kmc: ☝
22:52:53 <kmc> yeah, that's what i did
22:56:19 -!- zzo38 has set topic: May contain: soy strawberries, people, computer programming, esoteric, THX deep note, ecliptic longitude, some CPU bugs, nonsensical analogies and theories, constructible with compass and ruler, matrix of solidity, lovecraftian horrors, and no tea. | http://codu.org/logs/_esoteric/ | http://esolangs.org/wiki/Special:RecentChanges.
22:59:37 <oerjan> no tea? how naughty.
23:00:07 <fizzie> May contain tea, and no tea.
23:00:38 <zzo38> If you want tea you have to make tea.
23:01:01 <zzo38> fizzie: O, yes, I forgot that now you have to fix it
23:02:40 -!- fizzie has set topic: May contain: soy strawberries, people, computer programming, esoteric, THX deep note, ecliptic longitude, tea, some CPU bugs, nonsensical analogies and theories, constructible with compass and ruler, matrix of solidity, lovecraftian horrors, and no tea. | http://codu.org/logs/_esoteric/ | http://esolangs.org/wiki/Special:RecentChanges.
23:02:53 <fizzie> I put it in the middle in order to not be as obvious.
23:02:57 <zzo38> OK
23:03:02 <zzo38> Yes that is good put it middle
23:03:13 -!- ion has set topic: May contain: soy strawberries, people, computer programming, esoteric, THX deep note, ecliptic longitude, tea, some CPU bugs, nonsensical analogies and theories, constructible with compass and ruler, matrices of solidity, lovecraftian horrors, and no Ice-T. | http://codu.org/logs/_esoteric/ | http://esolangs.org/wiki/Special:RecentChanges.
23:04:01 <ion> or Mr. T
23:05:38 <kmc> Mr. ⊤
23:05:53 <kmc> but what about Mr. F?
23:05:59 -!- monqy has joined.
23:06:18 <shachaf> Mr. ⊤ and Mr. ⊥
23:12:23 <centrinia> Mister Bottom?
23:12:25 <Phantom_Hoover> i just got asked if monoid is pronounced "monowid".
23:12:54 <shachaf> Phantom_Hoover: When I first read the word, I pronounced it "mono'ID"
23:12:57 <shachaf> With a glottal stop.
23:13:05 <shachaf> That's probably because I was talking in Hebrew at the time.
23:17:53 <ion> Mono id or mono eye dee?
23:18:12 <shachaf> The former (I think).
23:18:21 <shachaf> The capitalization was for emphasis.
23:18:29 <ion> ok
23:20:18 <centrinia> Mon Oyd.
23:25:50 <kmc> i guess i should do the script embedding attack for level 6
23:25:52 <kmc> for completeness
23:26:17 <kmc> in the last CTF i used a timing attack on the last level, which was also not what they were looking for :)
23:26:41 <shachaf> kmc: It was, I think.
23:27:29 <shachaf> Actually I gather that they decided that the "impressive" solutions were the ones that used timing attacks and the "unimpressive" ones were the ones that were deterministic.
23:27:57 <shachaf> At least everyone I talked to who did a timing attack got a responds within a few hours, whereas it took them several days to get back to me.
23:28:28 <shachaf> Which is kind of backwards because the timing attack is the "obvious" thing to do -- it's what I started out by doing -- and the deterministic solution is much more situation-specific.
23:30:18 <kmc> but the timing attack is harder to actually get working, i think
23:30:40 <kmc> it was relatively easy for me, only because i had already spent days banging my head against a similar level in IO
23:31:29 <shachaf> kmc: It probably was. But that means I allocated my time better!
23:31:30 <kmc> also i'm entertained by the list of programming challenges on https://stripe.com/jobs
23:31:38 <shachaf> In particular the MBR demo?
23:32:00 -!- MoALTz has quit (Ping timeout: 244 seconds).
23:32:11 <kmc> yes
23:32:18 <shachaf> I spent a while on the timing attack, it turned out to be trickier than I thought, so I thought about the problem again and came up with the pipe solution.
23:32:21 <kmc> also the code search one, which is probably inspired by nelhage doing that exactly
23:32:22 * shachaf might just be bitter.
23:34:09 <kmc> i had like four tricks for making the timing attack more effective
23:34:17 <shachaf> That sounds interesting.
23:34:18 <kmc> which i thought of over days, and asked nelhage for one of them
23:34:29 <kmc> should i list them?
23:34:36 <shachaf> I should do io.sts. :-(
23:34:36 <kmc> i might write a blog post about this eventually
23:34:44 <shachaf> Which level has the timing attack?
23:34:51 <shachaf> (Which level was I at?)
23:34:57 <kmc> 12.
23:35:07 <shachaf> Man, I'm no good at coming back to CTFs.
23:35:24 <kmc> 11 is also really fun
23:35:31 <kmc> i didn't finish IO yet
23:35:51 <kmc> though i beat the last level, in beta test
23:36:54 <shachaf> kmc: You should run the underhanded code contest and then turn the solutions into CTF levels!
23:40:47 <kmc> also amused because i think the answer to the first question is given in _The Social Network_
23:41:49 <shachaf> "Given a corpus of voting data, how would you compute a total ordering?"
23:42:00 <shachaf> s/$/?/
23:43:30 <kmc> voting data being pairwise comparisons
23:43:46 <shachaf> I haven't seen the film.
23:48:01 <kmc> Zuckerberg made a website where it shows you two Harvard women and you click on which one is hotter
23:48:14 <kmc> and (in the film anyway) they calculated Elo ratings from this
23:57:17 -!- pikhq_ has quit (Ping timeout: 240 seconds).
23:57:24 -!- pikhq has joined.
←2012-08-23 2012-08-24 2012-08-25→ ↑2012 ↑all