code logs -> 2013 -> Sat, 07 Sep 2013< code.20130906.log - code.20130908.log >
--- Log opened Sat Sep 07 00:00:02 2013
00:00 You're now known as TheWatcher[T-2]
00:01
< Xon>
McMartin, I like that a lot of C# uses zero-length array rather than returning null. limitations of the foreach & built in iterators make dealing with nulls anoying =p
00:01
<&McMartin>
Yeah
00:02
<&McMartin>
This is one of the few language stumbles I blame LISP for inflicting on the rest of the universe
00:02
<&McMartin>
Since NIL and '() were mostly the same thing
00:02 You're now known as TheWatcher[zZzZ]
00:06 ErikMesoy is now known as ErikMesoy|sleep
00:09
<@Namegduf>
I really should remind myself of how C# managed to get a foreach that was significantly slower than a for look with iterator.
00:09
<@Namegduf>
I vaguely recall it had to do with generics and something making them hard to optimise.
00:09
<&McMartin>
Hrm
00:10
<&McMartin>
I'm talking through my hat here, but maybe the foreach has to do the downcast each time and the for loop can know the object layout in advance?
00:11 Azash [ap@Nightstar-339920e6.net] has joined #code
00:11 mode/#code [+o Azash] by ChanServ
00:11
<@Namegduf>
Could be something like that. Apparently it is supposed to detect where it is iterating over an array statically, but for lists it doesn't seem to be able to.
00:11
<@Namegduf>
Presumably because lists can be inherited from.
00:11
<@Namegduf>
http://blogs.msdn.com/b/kevin_ransom/archive/2004/04/19/116072.aspx <- This is someone talking about how with arrays it is fast.
00:12
<@Namegduf>
By lists I mean, their list type.
00:12
<@Namegduf>
Which is array-backed.
00:12 * McMartin nods
00:13
<&McMartin>
Isn't there a LinkedList, too?
00:13
<@Namegduf>
Probably, but there's also a List
00:13
<@Namegduf>
Which is *not* an interface, that's IList
00:13
<@Namegduf>
There may be an ArrayList like Java, but I don't recall.
00:13
<&McMartin>
Oh right
00:14
<@Azash>
01:09 -!- Irssi: Join to #channelname was synced in 329 secs
00:14
<@Azash>
Hetzneeeeeer
00:16 Derakon[AFK] is now known as Derakon
00:16
<@Namegduf>
It was particularly obnoxious because I was coming from Go, where for k, v := range slice { ... } is a somewhat faster version of the for loop because it doesn't need to do bounds checking on getting the k.
00:17
<@Namegduf>
Er, the v.
00:17
<@Namegduf>
The k should be an i there.
00:17 * McMartin nods
00:17
<@Namegduf>
So... "This is your built-in iteration syntax. You can optimise it. Why is it *slower*?"
00:17
<&McMartin>
I haven't used Go since shortly after its initial release.
00:17
<@Namegduf>
But then I found use of LINQ and I had far more salient criticisms.
00:17
<&McMartin>
Linq has its moments~
00:17 * Namegduf ended up purging at least almost all the LINQ for performance reasons
00:18
<&McMartin>
Yeah, Linq's moments are restricted to points where you need to break the type system to make the implementation a tenth the size it would otherwise be.
00:19
<@Namegduf>
I can understand that.
00:19 * McMartin files Linq (and the "var" type in general) with "reasons that C# is better than Java", but I freely admit there's a "with great power comes great responsibility" in there.
00:19 Azash [ap@Nightstar-339920e6.net] has quit [Ping timeout: 121 seconds]
00:20
<&McMartin>
If you've phrased it *just so* then *in theory* a powerful type analysis could optimize it down to equivalent code
00:20 ToxicFrog_ [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
00:20
<@Namegduf>
I've never observed it to happen.
00:20 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
00:20
<&McMartin>
Yeah, I'm not sure if the compiler does it
00:20
<@Namegduf>
Maybe that works if you're using arrays.
00:20
<&McMartin>
Also, this is one of those cases where you might as well think through your Linq query "out loud" by which I mean "write out what it would be, optimized"
00:20
<@Namegduf>
Yeah.
00:21
<@Namegduf>
I'm not a huge fan of the C# approach to exceptions.
00:21
<&McMartin>
Compared to...?
00:21
<@Namegduf>
Java.
00:21
<&McMartin>
...what are the salient differences?
00:21
<@Namegduf>
Java tells you what exceptions things are going to throw.
00:21
<&McMartin>
Oh
00:21
<@Namegduf>
C# not only doesn't mandate it in the language, it doesn't in documentation for .NET, either.
00:22
<&McMartin>
Er, wat?
00:22
<&McMartin>
There's a throws clause in the msdn docs at least.
00:22
<&McMartin>
Or do you mean "people are allowed to not give a full list when they doc stuff"
00:22
<@Namegduf>
The MSDN docs are pretty incomplete.
00:22
<&McMartin>
I think that does follow consensus, though; checked exceptions ended up being on the "more trouble than it's worth" list.
00:23
<&McMartin>
(Java only sort of tells you this)
00:23
<@Namegduf>
Did you know, by the way, that UDP sockets in .NET sometimes throw exceptions on read if a write recently failed?
00:24
<@Namegduf>
Because if you're using a shared socket between multiple endpoints, you need to know about that so you don't, say, close the whole socket because one write failed.
00:24
<&McMartin>
Heh
00:24
<&McMartin>
Yeah, C#'s async stuff is wacky
00:24
<&McMartin>
It's *consistent*, but it's kind of wacky
00:25
<@Namegduf>
This isn't so much async as MS deciding to "helpfully" provide you with notification of the write errors it can detect.
00:25
<@Namegduf>
I forget the rationale for using read to do it, there was some reason write wouldn't work.
00:25
<@Namegduf>
I think.
00:25
<&McMartin>
Yeah, I think "using read" is like the async case.
00:25
<&McMartin>
Where the exception is thrown by Join() or things equivalent to it.
00:26
<@Namegduf>
Both use a pair of Begin* and End* calls for async, but maybe the implementation's details cause this.
00:26
<&McMartin>
It makes sense if you look at it sideways - "I want the result of this!" "Uh, it terminated with an exception. Here's your exception!"
00:26
<@Namegduf>
That's what EndWrite is for.
00:26
<@Namegduf>
And where everything else raises its write exceptions.
00:27 * McMartin nods
00:27
<@Namegduf>
Except these UDP sockets do it on EndRead- or as I discovered later, *sometimes* BeginRead.
00:27
<@Namegduf>
I think maybe BeginRead starting in only recent versions of .NET.
00:27
<@Namegduf>
It's not like any of this shit is documented.
00:28
<@Namegduf>
Aside by people who figured it out answering questions to other people.
00:29
<@Namegduf>
It might be BeginRecv or something like that for UDP. Read/Write are the stream ones and the ones I've worked with most.
00:29
<@Namegduf>
But there's definitely the pair of pairs.
00:30 * McMartin nods
00:30
<&McMartin>
I haven't done a lot of C# work, really, mostly just WinForms wrapping P/Invoke
00:30
<@Namegduf>
Ug, WinForms.
00:31
<@Namegduf>
My favourite delightful WinForms feature is one they baked into the synchronisation stuff at a low level.
00:31
<&McMartin>
I've used worse >_>
00:31
<@Namegduf>
It is that if your UI thread blocks on a mutex, it will *re-enter the message queue*.
00:32
<@Namegduf>
What parts of the stdlib use mutexes? Undocumented! What other synchronisation primitives do it, I don't recall, but there are some.
00:32
<@Namegduf>
You don't want it blocking long, but that particular piece of madness means if it blocks at all your program can break if the message handlers aren't reentrant.
00:32
<@Namegduf>
You can, thankfully, turn it off, in addition to avoiding all blocking that you know about.
00:34
< Xon>
McMartin, C# var is just syntax sugar
00:35
<&McMartin>
Xon: Well, the part I'm unclear on is whether it sugars a type analysis (like C++11's auto) or if it sugars reflective access to objects
00:35
<&McMartin>
The latter is super-slow, the former is as fast as anything else
00:35
< Xon>
it's compile time syntax sugar
00:35
<@Namegduf>
It's just inference from the initialiser, I think.
00:35
<@Namegduf>
var foo = bar; gives foo the type of bar.
00:36
< Xon>
it tells the compiler to infer the type from the right-hand side
00:36
<&McMartin>
OK, that's fine then
00:36
< Xon>
if you decompile the resulting code, it's indistingusable to writing it out normally
00:36
<&McMartin>
I think I'm thinking of "dynamic"
00:36
< Xon>
yeah
00:36 celticminstrel is now known as celmin|away
00:37
< Xon>
also, the anonymous types linq spits ou are also compile-time syntax sugar.
00:37
<@Namegduf>
http://stackoverflow.com/questions/4540244/how-is-this-possible-onpaint-processe d-while-in-waitone
00:37
<@Namegduf>
^ Here we go.
00:37
<@Namegduf>
It took a little determined googling to find this most excellently documented attribute of C#.
00:37
< Xon>
> Namegduf ended up purging at least almost all the LINQ for performance reasons
00:37
< Xon>
what type of performance issues where you having?
00:38
< Xon>
besides the fact it is really really easy to iterate over arrays in a very expensive fashion without realising
00:39
< Xon>
Namegduf, it's actually documented somewhere that the built-in threading blocking will pump messages
00:39
<@Namegduf>
The type where it takes too long to run and the profiler says "well here's your problem, the actual loop where you loop over the huge list of objects with a where clause, possibly joining it to itself for pairs, to process them is actually slowass in itself"
00:39 Azash [ap@Nightstar-339920e6.net] has joined #code
00:39 mode/#code [+o Azash] by ChanServ
00:39
<@Namegduf>
Xon: Yes, "somewhere".
00:39
<@Azash>
Public service announcement: Fucking Hetzner
00:39
<@Namegduf>
It's certainly written on the MSDN website.
00:39
<@Namegduf>
However I couldn't find it with Google.
00:39
< Xon>
haha
00:39
<@Namegduf>
I remember reading it sometime after I learned about it.
00:39
<@Namegduf>
"The CLR ensures blocking can't cause deadlock by pumping a message loop when you use the lock statement or call the Wait method of the synchronization classes. Or Thread.Join(). That message loop dispatches the WM_PAINT message, causing the Paint event to run."
00:39
<@Azash>
All my autojoins and layout are from circa 2012
00:40
<@Namegduf>
It's so you can paint while you paint
00:40 * Azash postpones fixing this out of annoyance
00:40
<@Namegduf>
You can turn it off
00:41
<@Namegduf>
I have like a 20 line comment about it describing it at length and calling the people responsible names for making it "impossible to make good code out of a desire to make bad code fail less often", above a line turning it off
00:47 Turaiel is now known as Turaiel[Offline]
00:50 Derakon is now known as Derakon[AFK]
00:51 Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has quit [[NS] Quit: ]
01:29 VirusJTG_ [VirusJTG@BAD19E.09A45B.582A63.5AE998] has joined #code
01:32 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds]
01:43 ToxicFrog_ is now known as ToxicFrog
01:43 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
01:45
< simon_>
I'm trying to find a syntax error in the following code: https://gist.github.com/sshine/0c7c3bcc1560279530da
01:45
< simon_>
I'm getting the following typical error:
01:45
< simon_>
File "/tmp/emacs-region23537_xo", line 149, characters 0-1:
01:45
< simon_>
! <EOF>
01:45
< simon_>
! ^^^^^
01:45
< simon_>
! Syntax error.
01:46
< simon_>
it suggests that I'm missing a parenthesis or "end" tag, I suppose... except when I place any at the bottom, it just says mismatched parens.
01:46
<&McMartin>
Probably failing to close a here document, string, or comment?
01:46
< Syka_>
check your brackets
01:46
< Syka_>
yes you are missing parens
01:46
< simon_>
yeah! exactly my thought. can't find it.
01:46
< Syka_>
time for parens counting
01:47 * simon_ does some binary searching by commenting out half the document.
01:47
<&McMartin>
drawcircle looks wrong to me.
01:47
<&McMartin>
But I have never written SML code.
01:47
<&McMartin>
But your let-clause has no in-clause.
01:48 Thalasleep is now known as Thalass
01:48
< simon_>
ahhh
01:48
< simon_>
thanks.
01:48
< simon_>
I'd just found it when you said so.
01:48 * simon_ shouldn't be coding this late.
01:48
< simon_>
it's just left unfinished.
01:48
< simon_>
amazing the parser doesn't give me a more precise error message.
01:49
<&McMartin>
... oh shit -_-
01:49
<&McMartin>
How much of that is because the rest of the code is definitions
01:49
<&McMartin>
viz., stuff that goes in a let clause
01:50
< simon_>
ahhh
01:50
< simon_>
yeah, right...
01:50
<&McMartin>
Still, one would expect at least "expected: definition or IN"
01:50
< simon_>
but it could at least have said "let-expression never finished, started on line X"
01:50 Derakon[AFK] is now known as Derakon
01:50
< simon_>
yeah. at least that.
01:52 VirusJTG__ [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
01:53 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: ZNC - http://znc.in]
01:53 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
01:54 * simon_ is working on a small adventure game using SDL in Standard ML.
01:54
<&McMartin>
So I gathered from the title
01:55
< simon_>
a friend made some SDL bindings for Moscow ML. they're pretty C-ish, so they do need some higher-level library.
01:55
<&McMartin>
Graphical adventure, I assume
01:55
< simon_>
I haven't really figured it out yet... just trying to impress the students I TA for... it seems starting out university life using SML can be kind of dull, and then suddenly you get to Java with its wonderful access to drawing functions.
01:56 VirusJTG_ [VirusJTG@BAD19E.09A45B.582A63.5AE998] has quit [Ping timeout: 121 seconds]
01:56
<&McMartin>
Heh
01:56
<&McMartin>
One of the big things that the BASICS of old had going for them were the drawing functions
01:56
<&McMartin>
And if it wasn't BASIC it was LOGO
01:56
<&McMartin>
This really should be a core part of REPLs -_-
01:56 VirusJTG__ [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds]
01:56
< simon_>
so... I made a blackjack game with someone yesterday, and today I've made this. I plan to make a space shooter like asteroids/platform thing
01:57
<&McMartin>
Because it's The Part People Like Doing.
01:57
<&McMartin>
Oooh
01:57
<&McMartin>
Platform mechanics are tricky.
01:57
< simon_>
a side-scroller, I meant
01:57
<&McMartin>
You may want to run that past me if you go into it to get the controls properly
01:57
<&McMartin>
Yeah.
01:57
<&McMartin>
There's a bunch of things that make things a bit unpleasant if you aren't looking for it
01:57
< simon_>
you mean if I want the background to move as well?
01:58
< simon_>
(and not just spawn space ships at the edge once in a while)
01:58
<&McMartin>
No, I mean like "if you want the character to feel right when they do things like jump with low ceilings"
01:58
< simon_>
ahhh
01:59
<&McMartin>
Because it's surprisingly tricky to get right; otherwise the dude can get stuck or have his path hitch
01:59
<&McMartin>
Monocle will have a similar set of demonstrations >_>
02:00
<&McMartin>
But Monocle is based much more heavily on animation and collisions &c
02:00
< simon_>
oh, okay.
02:00
< simon_>
I haven't even thought about that.
02:00
<&McMartin>
Anyway
02:00
<&McMartin>
On that end, I did a bunch of homework for it last year~
02:00
<&McMartin>
So that means I still have the notes, but have to dig it up
02:01
< simon_>
right now I'm pretty intent on making my seen-from-the-top adventure game feature scrolling maps and field-of-view.
02:01 * McMartin nods
02:01
< simon_>
ok :)
02:01
<&McMartin>
Ah, Zelda-like?
02:01
< simon_>
yes!
02:01
<&McMartin>
Yeah, that's much easier to spec out.
02:01
< simon_>
(I never played Zelda, but people told me it was a Zelda-like when they saw the demo today)
02:01 * McMartin nods
02:01
<&McMartin>
There's a f2p MMO-ish thing called Spiral Knights with similar gameplay, though 3D rendered.
02:02
<&McMartin>
The SNES Zelda - "A Link to the Past" - is widely considered to be one of the classics.
02:02
<&McMartin>
The NES predecessors are both viewed with some skepticism at this point
02:05
< simon_>
https://github.com/sshine/sml-games/blob/master/sdl-adventure/sdl-adventure.png -- still quite silly :)
02:06
<&McMartin>
http://media.moddb.com/images/groups/1/10/9727/Zelda-NES.jpg
02:06
< simon_>
I've made these things once before, only now about to add features I haven't implemented before. I'm still curious if functional programming will make me happy here.
02:07
<&McMartin>
I'll be interested to see how it goes - this is one of the very few places I consider OO to have a large advantage
02:07
<&McMartin>
And since Monocle is designed to be a C-y as possible I've been trying to design around that~
02:07
< simon_>
got a screenshot?
02:10 celmin|away is now known as celticminstrel
02:12 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
02:12 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
02:14
< simon_>
McMartin, are you behind the game at http://www.monoclegame.com/ ?
02:18 Derakon is now known as Derakon[AFK]
02:20
<&ToxicFrog>
simon_: doubt it. Project Monocle is something completely different.
02:22
< simon_>
oh.
02:22
< simon_>
here's a funny hack that only works in Moscow ML:
02:23
< simon_>
fun safe_hd [] = NONE | safe_hd (x::xs) = SOME x (* this is quite legal *)
02:24
< simon_>
fun safe_hd (x : 'a list) : 'a option = Obj.magic x (* Obj.magic : 'a -> 'b. it abuses internals *)
02:26 Kindamoody[zZz] is now known as Kindamoody
02:27 * simon_ thought of adjusting game mechanics based on the computer's time, i.e. low FOV during night, some monsters available at night, sort of like Minecraft, but with "real" time.
02:43 Vorntastic [Vorn@Nightstar-70ca46e4.sub-70-211-9.myvzw.com] has joined #code
03:06
<&ToxicFrog>
nethack does a bit of that
03:07
<&McMartin>
simon_: https://github.com/michaelcmartin/monocle
03:08
<&McMartin>
And no, Monocle the game isn't me
03:08
<&McMartin>
The game Monocle was designed for is tentatively named "Dapper Delver"
03:10
< simon_>
ToxicFrog, someone told me that once today already ;)
03:49 ktemkin[awol] is now known as ktemkin
03:53 Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has joined #code
03:53 mode/#code [+qo Vornicus Vornicus] by ChanServ
03:53 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
04:16 Orthia is now known as Reiv
04:19 Vorntastic [Vorn@Nightstar-70ca46e4.sub-70-211-9.myvzw.com] has quit [[NS] Quit: Bye]
05:00 Thalass [thalass@Nightstar-ecf59cc1.bigpond.net.au] has quit [Client closed the connection]
05:25 RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has quit [[NS] Quit: Gone.]
05:28 RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has joined #code
05:38 Derakon[AFK] is now known as Derakon
06:01 Derakon is now known as Derakon[AFK]
06:58 Kindamoody is now known as Kindamoody|afk
07:14 Turaiel[Offline] is now known as Turaiel
07:15 ErikMesoy|sleep is now known as ErikMesoy
07:21 celticminstrel [celticminst@Nightstar-ae361035.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
07:24 Turaiel is now known as Turaiel[Offline]
07:58 Kindamoody|afk is now known as Kindamoody
08:09 Kindamoody is now known as Kindamoody|out
08:13
< jeroud>
McMartin: Wrapped monocle doesn't work on OSX (and maybe other systems) because you can't necessarily have SDL replace main().
08:21
<&McMartin>
jeroud: This is a problem the eventual shift to SDL2 will fix
08:21
<&McMartin>
(It's basically only OSX)
08:21
<&McMartin>
There are ways to get around it with Gambit Scheme, at least
08:22
<&McMartin>
And, I mean, there are ways around it elsewhere too; pygame managed it
08:25
< jeroud>
I looked at pygame's solution. It's a horrible mess of Objective-C.
08:27
< jeroud>
Anyway, that's the kind of thing that should probably live in monocle rather than the wrapper.
08:29
<&McMartin>
Yeah, and in practice it ends up living in SDL itself.
08:30
<&McMartin>
SDL2 changes the requirements on this so that it can handle that
08:30
<&McMartin>
I haven't yet decided what I'm doing about taht.
08:30
<&McMartin>
I don't have a strong reason at present to just do SDL forwarding
08:31
< jeroud>
Anyway, I'm going to stop wrapping monocle for now.
08:32
< jeroud>
(I actually only spent a couple of hours on it a week or so ago.)
08:32
<&McMartin>
Yeah, uh, the API isn't very stable yet
08:33
<&McMartin>
I'm being design-stymied by the fact that there are kind of two event loops that aren't necessarily related.
08:33
<&McMartin>
(What's your target language here?)
08:42
< jeroud>
Python.
08:43
< jeroud>
I don't mind an unstable API. I'm mostly doing this to play with things.
09:11
<&jerith>
McMartin: Are you going to ship bindings for another language with monocle?
09:12
<&jerith>
(It might be a good idea, if only to have tests for all the things.)
09:18 thalass [thalass@Nightstar-ecf59cc1.bigpond.net.au] has joined #code
09:48
<&McMartin>
Yeah, that's the plan
09:48
<&McMartin>
But not until I'm happy with the bindings to, well, C
09:50 Reiv is now known as Orthia
09:59 You're now known as TheWatcher
10:10 AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has joined #code
10:31 * TheWatcher readsup, intends to try a perl binding for it, when he isn't hammering out insane amounts of code a day for work ;.;
11:25 AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has quit [[NS] Quit: Leaving]
12:53 Kindamoody|out is now known as Kindamoody
12:56 Kindamoody [Kindamoody@Nightstar-05577424.tbcn.telia.com] has quit [Connection reset by peer]
12:57 Kindamoody|autojoin [Kindamoody@Nightstar-05577424.tbcn.telia.com] has joined #code
12:58 Kindamoody|autojoin is now known as Kindamoody
12:58 mode/#code [+o Kindamoody] by ChanServ
13:02
< AnnoDomini>
Hmm. Is there some sort of multi-platform reminder software? I'm looking for something like kAlarm or Kazaa Reminder, only if it could run on both Linux and Windows and could use the same settings/data files.
13:19
< xybre>
AnnoDomini: Just look for something that can sync with Google Calendar
13:20 Kindamoody is now known as Kindamoody|out
13:20 VirusJTG [VirusJTG@2B12AA.572255.206A2A.901581] has joined #code
13:32 ErikMesoy [Erik@Nightstar-404c8d4f.80-203-17.nextgentel.com] has quit [Ping timeout: 121 seconds]
13:33 ErikMesoy [Erik@A08927.B4421D.FE7332.0AD079] has joined #code
13:39 ErikMesoy1 [Erik@A08927.B4421D.FE7332.0AD079] has joined #code
13:41 ErikMesoy [Erik@A08927.B4421D.FE7332.0AD079] has quit [Ping timeout: 121 seconds]
13:55
<@gnolam>
Kazaa. Now there's a word I haven't read in a while.
14:02
<~Vornicus>
So you know it?
14:32
< AnnoDomini>
Er, *Kanaa.
14:32 Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has quit [[NS] Quit: ]
14:50 thalass [thalass@Nightstar-ecf59cc1.bigpond.net.au] has quit [[NS] Quit: Stupid meatbags. ]
15:37 celticminstrel [celticminst@Nightstar-ae361035.dsl.bell.ca] has joined #code
15:37 mode/#code [+o celticminstrel] by ChanServ
15:47 ErikMesoy1 is now known as ErikMesoy
16:19 Turaiel[Offline] is now known as Turaiel
16:49 Turaiel is now known as Turaiel[Offline]
17:17 Turaiel[Offline] is now known as Turaiel
18:05
<@Azash>
<noscript> Your browser does not have <a href="help/help_javascript.asp" target="popuphelp" onclick="wopen('help/help_javascript.asp', 400, 460); return false;" onkeypress="wopen('help/help_javascript.asp', 400, 460); return false;" title ="JavaScript info (launches new window)">JavaScript</a> enabled. </noscript>
18:12 Turaiel is now known as Turaiel[Offline]
18:13
<@Tamber>
...
18:13 * Azash eyes this part of JS code: "Math.sqrt(Math.random(seed)*Math.random(seed))"
18:17
< ErikMesoy>
Don't do that.
18:19
<@Azash>
ErikMesoy: Not my code
18:19
<@Azash>
My hands are washed with bleach
18:19
< ErikMesoy>
I feel obliged to say it anyway.
18:24
< Moltare>
Couldn't do that if I wanted to
18:24
< Moltare>
well, not in that manner
18:24
< Moltare>
Runescript doesn't have sqrt
18:24
< Moltare>
>_>
18:25
<@Azash>
Haha
18:30
< ErikMesoy>
Does it have **0.5 ?
18:31
< Moltare>
Doesn't have any means of raising to a power.
18:31
< Moltare>
Also doesn't have "0.5"
18:32
< ErikMesoy>
Haha
18:35
<@Azash>
Oh lordy
18:35
<@Azash>
Binary search
18:43
< [R]>
What's that do for the randomness/range and why should on not do that?
18:44
<@Azash>
[R]: Because of the seed param it always returns the same thing
18:44
<@Azash>
Essentially making it sqrt(x^2)
18:44
< [R]>
Uhh
18:44
< [R]>
Oh right
18:45
< ErikMesoy>
Even with different seeds, you still shouldn't do that. Imagine the linear version: (Math.random()+Math.random())/2
18:46
< [R]>
That's a bellcurve though, sometimes you want that.
18:47
< ErikMesoy>
Yeah, but seeing the equivalent of (2d6/2) makes me suspicious as to what the writer was thinking.
18:48
< ErikMesoy>
I'm picking on code smell now, rather than the sheer do-nothingness of the original. *shrug*
18:48
< ktemkin>
No to mention that Math.random isn't supposed to take an argument. >.>
18:50
< [R]>
Yeah, V8 ignores it AFAICT, as does spidermonkey.
18:59 Kindamoody|out is now known as Kindamoody
19:09 Turaiel[Offline] is now known as Turaiel
19:49 Derakon[AFK] is now known as Derakon
20:18 Kindamoody is now known as Kindamoody[zZz]
21:01 celticminstrel is now known as celmin|away
21:15
<@Azash>
http://i.imgur.com/F9GLCJd.png
21:59 celmin|away is now known as celticminstrel
22:40 Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has joined #code
22:40 mode/#code [+qo Vornicus Vornicus] by ChanServ
22:55 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
23:08 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
23:17 ErikMesoy is now known as ErikMesoy|sleep
23:53 ktemkin is now known as ktemkin[awol]
--- Log closed Sun Sep 08 00:00:18 2013
code logs -> 2013 -> Sat, 07 Sep 2013< code.20130906.log - code.20130908.log >

[ Latest log file ]