« first day (1312 days earlier)      last day (3529 days later) » 

10:01 PM
Or you could go all flashy and use ActionScript
 
I'd rather do C# than Java. I don't know any other JVM languages either. And I haven't used ActionScript in ages, so it would probably degrade to a bad JS port.
I used to know Pascal and Smalltalk but that was ages ago...
 
I'd do something in a BASIC flavor just for kicks, but I doubt I could beat TI in any others, and something tells me they'd be considered the same language.
 
I guess I'll have to look into C#... I never golfed anything in it though, so this going to be horrible :D
 
golfing C# is so much fun
but seeing as it's the only language I use (or golf) with any frequency I can't really compare
 
10:21 PM
@PeterTaylor: No non-string literals. ;)

I figured the exception would be clear by the bounty of string literals in the example.
 
10:48 PM
@VisualMelon Added the C# version... let me know if you have any golfing advice for it ;)
I should probably count the necessary usings
 
aye
well, seeing as you're from a Ruby (functional?) background, you're probably better suited to golf LINQ than myself, I much prefer working with imperative methods ;)
 
C#'s LINQ and Enumerable-related methods are the best thing about the language :D
 
if you are including usings, (Which I think you should) then you need to check if aliasing them is profitable (e.g. using M=System.Math)
I do like iterators, but nothing feels more natural than a for loop, I don't care how abused.
also strictly that method has to be in a class, which I would count as well, unless the rules explicitly say you don't need to
 
(btw I knew C# long before Ruby or before I knew how to use JavaScript or any other language functionally)
@VisualMelon in that case I don't need to make it static though, right?
do I need a namespace?
 
no namespace needed, but sometimes it's cheaper to namespace System, reducing the size of your usings (I think, never done this)
(that would probably apply to yours, as you have a more than 2 usings)
@MartinBüttner you should be able to replace the new double[] with new[]
and I can't see why you can't define n as a double also
I'd probably better read the question fully
yeah, all the ints appear to be casting to doubles anyway
 
11:08 PM
thanks a lot... saved a few characters, despite adding a class :)
 
swaping n for a double would remove the need for the .0 in the reciprocal
 
ah good point
 
also, because you are only using List<T'> once, you can just fully qualify it when you use it
and, with the namespace System, I think you don't need the System. for the usings inside it
 
wait I thought I removed those
oh damn forgot to copy-paste those
 
at that point I think (not checked) that it's cheaper to just do using System.LINQ along with using M=System.Math and replace Math. with M. in the rest of the code
 
11:15 PM
@VisualMelon no that's 4 longer
 
thanks a lot!
I'm off to bed
 
ciao
 
Not sure where to ask this question, so I guess I'll try here first: In C, write() normally takes 3 parameters, but in this example at codegolf.stackexchange.com/a/2265/16955 the code gets away with passing only 1 param (and not even the 1st param, but only the 2nd param, the buffer, is specified as far as I can tell). Can anyone tell me what exactly is going on here?
 
11:33 PM
I keep getting a tock sound in my earphones. Is that this site?
 
Can anyone tell me what venue would be most suitable for asking the above question? stackoverflow or codegolf?
 
@COTO There's a little speaker icon in the top right, to the left of "all rooms"
 
@MartinBüttner you're missing a couple of }} at the end of the C# code, and you should be able to save 2 bytes by swapping l.Average() for a=l.Sum()/n
 
@Will: Stack overflow will have your answer.
 
@COTO great! You mean, if I ask that question there, right? Or, do you mean to say that it's been asked there before?
 
11:38 PM
@Will: Either. Do an earnest search for it, and if nothing comes up, ask it. You'll have an answer within minutes is my guess.
 
Let's find out... thanks!
 
np
 
Only one way to find out, I suppose.
 
@PhiNotPi: I have it set to "when mentioned". When I'm mentioned, the sound is more of a *thunk* and a little notification icon pops up next to my avatar.

The *tock* sound is lighter and isn't accompanied by any notifications. But it can't be a coincidence that I'm getting it on the only professional website in existence that uses sound effects.
There. Just happened again.
And again.
 
how about now?
 
11:57 PM
@MartinBüttner one more thing before I go to sleep, I think you need another argument for l.Aggregate((p,x)=>p*Math.Pow(x,1/n)) as it currently doesn't perform the Math.Pow on the first item in the list, l.Aggregate(1,(p,x)=>p*Math.Pow(x,1/n)) I think would be proper (1, being new)
 
@PhiNotPi: Nothing for a long time now.
 

« first day (1312 days earlier)      last day (3529 days later) »