« first day (1580 days earlier)      last day (3371 days later) » 

7:02 PM
@LucDanton Not deserving of -8.
 
@LucDanton It should not be left out in public for developers to just trip over like that.
 
@Rapptz Why? What usefulness can you extract out of the question?
 
I don't fully agree with that answer @Columbo, but I'll have to get back to you later (don't have time right now). stay tuned
 
I'm having a top kek
 
user1804599
@Rapptz bullshit
 
7:06 PM
 
user1804599
 
@Rapptz Oh, maybe we have different perspectives on scores.
 
@LucDanton I don't think questions asked by noobs in asking for something due to a misunderstanding would be deserving of a -8 either.
 
user1804599
Varnish is so terrible.
 
Sends a bad message to the OP I think.
 
user1804599
7:07 PM
It doesn't support TLS.
 
Would you be fine if the question was -2?
 
@LucDanton It's all about perception!
 
user1804599
@Rapptz Good. He won't ask more terrible questions.
 
@Rapptz Can you remove my message with the link? There’s some awful lounging going on.
 
1 message moved to bin
I don't think it's us but if you wish.
 
7:09 PM
doesn’t have that kind of traffic. It’s fairly obvious.
 
He has too. If it's not obvious, I didn't downvote it.
 
@райтфолд that's just advertised as top
 
user1804599
kek
 
Alright, take 2. @R.MartinhoFernandes Look who’s found .
 
He seems to have a lot of Haskell questions.
 
7:11 PM
@Rapptz My beef is that it’s not even clear that there is a misunderstanding, as it’s not clear at all what the OP wants. So there is no understanding to begin with that could be mis-. (This kind of stuff is not OP’s first offense.)
@Rapptz I’m surprised I didn’t notice earlier.
 
The Haskell website has horrible syntax highlighting.
 
user1804599
lol one of the arguments of varnish for not supporting TLS is because enabling TLS would slow down the cache
 
user1804599
So it says that because it's a little slower it's instantly completely useless to cache anything.
 
@райтфолд Two 4-way-swaps:
void rotate(int m[9])
{
    int t;

    t = m[0];
    m[0] = m[6];
    m[6] = m[8];
    m[8] = m[2];
    m[2] = t;

    t = m[1];
    m[1] = m[3];
    m[3] = m[7];
    m[7] = m[5];
    m[5] = t;
}
 
@LucDanton You're right. I might be assuming too much.
 
7:14 PM
@райтфолд And before you ask how I would solve C:
0
Q: Convert C header names to C++ header names

FredOverflowIn the C standard library, header names end with a .h suffix: stdio.h In C++, those header names are available in an alternative form, with a c prefix instead: cstdio Write a function that converts the first form into the second. You can do the conversion in-place, or leave the original str...

 
user1804599
Meh. I prefer #include <matrix> and then matrix m(…); rotateClockwise(m);
 
Of course you would probably do that in the real world.
But I think 4-way-swap is a nice exercise.
If you used a temporary matrix, you would get 9/10 points.
 
user1804599
@FredOverflow OK lemme try.
 
@Rapptz ideone has the same problem.
 
>>> s = 'stdio.h'
>>> 'c' + s[:-2]
'cstdio'
donutsteal
 
user1804599
7:17 PM
@FredOverflow answered.
 
@FredOverflow I recommend removing the sentence that says 'compiler like gcc'.
 
Oh, you already saw.
 
user1804599
Do I have to name the function?
 
Hm, good question... you want a lambda instead?
 
user1804599
That'd still be a function!
 
user1804599
7:22 PM
But it wouldn't make a difference.
 
user1804599
Since I'd have to parenthesise it.
 
user1804599
@FredOverflow your solution fails for foo.hbar.h which must translate to cfoo.hbar. :)
 
Someone stole my answer!
 
Does ('c':).drop 2 do the job? I can’t check. Hah, it doesn’t drop from the end.
 
user1804599
I shortened mine by using a bareword instead of a quoted string literal. :)
 
7:27 PM
@райтфолд I didn't know there were header names with multiple dots in the C standard library? :)
 
Is anyone here on Windows?
 
init.init is an option but that’s not in the Prelude I believe.
 
@райтфолд What's a bareword?
@Rapptz You make it sound like Windows is a drug.
 
user1804599
It's an identifier that is treated as a string literal.
 
getaddrinfo isn't working for me on Windows
but it works fine on Linux
I have a SSCCE.
:v
 
7:30 PM
@райтфолд And how does the compiler recognize barewords?
 
@FredOverflow It's like a DWORD, but with fewer clothes.
 
user1804599
If there is no subrouting with the name it treats it as a bareword.
 
user1804599
Any sane Perl programmer uses use strict; or use Modern::Perl; which disable this.
 
user1804599
But it's nice for oneliners and codegolfs.
 
user1804599
I shortened it even further!
 
7:38 PM
regex?
 
user1804599
Yeah.
 
user1804599
s/// substitutes. r modifier returns instead of doing it in-place.
 
user1804599
Doing it in-place requires an lvalue but shift is an rvalue.
 
You can save two characters by removing the x=. According to this meta post, if the challenge doesn't ask for a named function, you can make it anonymous. And since the post has 13 upvotes and zero downvotes, I assume that everyone agrees with that ruling. — Rainbolt 4 mins ago
hmm...
 
Too late to add it now!
 
user1804599
7:39 PM
OK.
 
@Rapptz Well, that makes for some exciting Java 8 and Haskell solutions :)
0
A: Convert C header names to C++ header names

FredOverflowHaskell — 23 characters ('c':).takeWhile(/='.')

 
@StackedCrooked I wouldn't be surprised if it's not even UB.
 
Hm.. I don't see a reason why.
 
0
A: Convert C header names to C++ header names

isaacgPyth, 8 characters L+\c<b_2

WTF is Pyth? Some codegolf variant of Python?
 
7:47 PM
Maybe line 17 is iffy.
 
Ah. You have a point.
It's definitely UB if the new type exceeds the space allocated for the original object.
That should be statically asserted somehow.
 
> Pyth is a procedural programming language which is designed to be compiled into Python. Its primary purpose is conciseness, without sacrificing clarity. It is primarily used for code-golfing.
 
@StackedCrooked I think there may be something wrong in case of multiple/virtual inheritance. I can't say more because normally I don't dive in these dark areas of C++
 
@FredOverflow By the creator himself it seems.
 
@Rapptz lol
 
7:52 PM
There's a reference there.
Cool stuff.
 
You can do do { x <- id; return $ … } instead of \x -> … :v Surprised I never run into that one before.
 
@StackedCrooked If the constructor throws, you're pretty much screwed.
 
@milleniumbug Yep.
There are restrictions.
But it might be a useful technique for implementing a state machine or something.
 
@StackedCrooked Interesting yes, useful myaehh.
 
Dropping the last 2 characters with init.init instead of taking all up to the first . saves a few bytes. — nimi 2 mins ago
awesome!
 
8:02 PM
35 mins ago, by Luc Danton
init.init is an option but that’s not in the Prelude I believe.
 
According to Hoogle, it is in the Prelude.
And it works in ghci without any imports.
 
That should tell how useful that function is.
 
76
Q: J and GolfScript suck all the enjoyment out of Code Golf

TimwiI have found code-golf a fascinating pastime for several weeks now. However, I’m already losing interest because the contests allow any language, and because of that it is pretty much impossible for anything other than J or GolfScript to get anywhere close to winning. As soon as I see a less-tha...

 
I really wanted to make take (length x - 2) x work even though there are no Standard headers with an embedded dot but the Prelude is too fickle—and I’m not sure it would compete anyway.
Maybe in 7.10 :v
 
I wrote a template specialisation for negative numbers on template <int N> today. I just got infatuated with the compiler.
 
8:11 PM
> I hate that people upvote Golfscript answers just because they are short. I can't help but imagine some very excited people with their mouth half open exclaiming "omg i cant believe thats a real program upvote lolz!!1!" These people will do so so for every piece of Golfscript code they see.
Wait, I think I finally understand the term code golfing :)
Like, when you make your solution 2 characters shorter, you take 2 "strokes" off your game?
 
What's your handicap?
 
My Java handicap is 25. I don't play real golf :)
My put put golf handicap is somewhere around 50 for 18 holes.
 
The handicap is what you add to your actual score to compete. Do you really need 50 extra strokes in put put?
 
no
I guess I don't understand how to calculate the handicap then.
extra strokes compared to what?
 
The other guys. So the elite might use 30 strokes on a putput course, with a handicap of 50 you can do 50 + 29 and beat them.
 
8:20 PM
And who determines my handicap?
 
The local putput club usually.
 
I thought GCC wouldn't warn if you did my_pod_t x = { 0 };
But it keeps giving me a million warnings for missing field initialisers.
 
In real Tiger Woods golf, there are plenty of rules I think.
 
@Rapptz I used to have the particular warning squelched, but not anymore it looks like. I think it varies a lot by version—I know I can never remember which set of flags will lead to what behaviour.
 
This warning is very annoying.
GCC please :(
I don't want to use memset like a barbarian.
 
8:25 PM
For your particular case you can go {} though. Maybe it helps.
 
It doesn't.
I tried x = {}, x{}, x = my_pod_t{}.
it's a headache.
I'll just use a pragma to shut it up
doing x = my_pod_t(); works though.
Thanks GCC
 
my_pod rhymes with iPod.
 
auto t = T(); is my preferred syntax for value-initialized pods
I have a little distrust in {} .
Because I might not be aware of all gotchas.
 
Only one.
 
I also don't like {}
 
8:31 PM
Has to do with initializer_list being a greedy constructor.
 
user1804599
@FredOverflow I shortened it even further!
 
user1804599
shift and pop are the same if only one argument is given. :)
 
@StackedCrooked Buy Scott's next book: Effective POD initialization. The topic is so complicated it deserves its own volume!
4
 
@Rapptz GCC is quite silly when it comes to warnings about member initializers. And as of GCC 4.9 they still had some C++14 stuff related missing.
I just end up compiling with GCC without -Wextra these days. :D
 
This is the only warning that has annoyed me.
I have at least 6 annoying warnings with Clang.
 
8:37 PM
@FredOverflow Item 1: Use T()
T{} looks like a weirdo
 
user1804599
> o - pretend to optimize your code, but actually introduce bugs
 
user1804599
lol that documentation
 
Thats just the -o4 option. experimental, but quick as hell.
 
@райтфолд Wait a minute. Who gave you that? That's from my new book: "Game Development for Dummies".
 
Lost 2 rep on an old answer, checked Vlad's profile, he's not back. I guess his previous revenge downvotes scarred me =/
 
8:47 PM
He's still not back?
Did he... actually quit? :D
 
rip modulo 5 rep T_T
 
You can always cast some downvotes.
 
9:00 PM
Is omitting the return type of a function legal in C89? — FredOverflow 1 min ago
 
user1804599
I wish if statements used the iff keyword. I'd be less ambiguous.
 
Why?
 
user1804599
if (x) l:; // if but not iff!
goto l;
 
iff (a < b)
    x = 0;
iff (c < d)
    x = 0;   // should this be a compile-time error?
 
user1804599
@FredOverflow in a language without unconditional jumps the body is executed if and only if the condition is true.
 
9:02 PM
Very nice.
 
user1804599
That's not nice.
 
user1804599
It's unreadable crap.
 
You seem to be in a contradictory mood lately.
 
lately?
 
user1804599
9:05 PM
Tomorrow I'll bring home my Perl book and start reading.
 
user1804599
I will learn even more about Perl this weekend!
 
@райтфолд What a stunning weekend you have planned. I'm so jealous.
 
user1804599
My new code review metric: ∉ {C, Java, PHP}.
 
@райтфолд Where is it now?
 
user1804599
@FredOverflow at work.
 
user1804599
9:11 PM
I can't bring it on a bicycle without a backpack without risking damaging it.
 
user1804599
Tomorrow I will bring my backpack.
 
TIL about RdRand.
 
user1804599
@FredOverflow Linux kernel uses that! github.com/torvalds/linux/blob/…
 
@райтфолд You could put it in a hard plastic folder thingy.
 
@райтфолд Well, it's been nice knowing you (but it's probably better for me to say goodbye now, before your ability to read English has been too badly impaired).
 
9:19 PM
One line of Perl says a thousand words.
 
user1804599
@StackedCrooked say "word" for 1..1000;
 
@StackedCrooked so, even one line of perl is too much?
 
user1804599
I had this wonderful idea.
 
user1804599
Roof tiles made out of white phosphorous with an alkali metal coating.
 
@райтфолд So acid rain would set your house on fire? Sounds like a quick way to warm up a rainy night...
 
9:29 PM
lol gaming chairs
looks cool though
I want one
 
user1804599
Terrible.
 
user1804599
Skippy ball master race.
 
you're terrible
on a more serious note, I really need to upgrade my chair
I'm using a tiny chair that was here when I moved in
it's also broken now because it was tiny
and I'm not
I wish firefox stopped unloading big pictures when I leave their tabs
FIREFOX STOP TRYING TO SAVE ONE MEGABYTE OF RAM OKAY THANK YOU
 
user1804599
In Perl 6 you can define popeye like in C++!
 
user1804599
sub infix:«<:??)<%??>»($a, $b) { sub {} }
 
9:37 PM
I don't like trac.
I never find my way.
 
trac looked like something the special kind of people would use
it's overly complicated
mark my words
if 0 A.D. dies
it will be because they use trac
@StackedCrooked try the bug genie
 
user1804599
so high-res: nasa.gov/content/…
 
user1804599
@StackedCrooked use YouTrack.
 
Ell
Hmm.
 
Oh, the naivety:
0
Q: JVM seems to stop context switching very quickly

StuartHaI'm implementing the naive version of the Producer-Consumer concurrency problem. And it the threads are switched between at first very quickly but then stop around i = 50. Adding additional print statements for some reason allows the JVM to context switch the threads and complete the program. Wh...

 
9:41 PM
> There are seven year olds in America who have never had a white president
 
user1804599
I'm hungry.
 
Ell
If a woman is on her own walking down the street, and one of 4 men approaches her and asks if she is okay in a flirtatious manner, would you consider that harassment ?
 
user1804599
> There's probably way more than 7 of them.
 
user1804599
@Ell No.
 
Ell
if it was at night also
 
user1804599
9:43 PM
Still no.
 
@Ell No. Unless he starts being creepy and insisting, etc.
 
@райтфолд o u
 
Possibly. Is there a reason to believe she would not be okay?
 
lel going out at night
ALONE
 
user1804599
Asking people whether they are fine is totally OK.
 
Ell
9:43 PM
Well, girls are brought up to not go out alone at night
 
yeah she's not okay
not okay IN THE HEAD
 
user1804599
If she shows she doesn't like it and he continues then it's bad.
 
Ell
@райтфолд it's more like "hi sexy, are you okay?" type of thing
or something equally flirtatious
 
not even I go alone at night
and I'm a fat fuck
 
user1804599
@Ell That's not nice.
 
9:44 PM
@Ell Were you that man?
 
user1804599
Unless she slaps the guy on the butt first!
 
Ell
@FredOverflow No :P
 
no, I'm not blaming those men
for assuming that she's into stuff like that
considering she's alone at night
 
user1804599
Also, if the men are drunk just smile and slap them in the face.
 
@FredOverflow he was the woman
stay at home people, call a cab otherwise
 
user1804599
9:45 PM
No.
 
it's easy to avoid trouble when you actually try to avoid it
 
user1804599
You should be safe anywhere at anytime.
 
user1804599
There are no excuses to that.
 
yes, well
let me know when that happens
until then I'll keep on adapting to the lack of safety
 
user1804599
It's never your own fault for being harassed for no reason.
 
9:46 PM
that is the reality
 
user1804599
Anyway
 
user1804599
it depends on the kind of lady and kind of guy.
 
user1804599
It's not about what we consider harassment, it's about what they consider harassment.
 
@Ell be sure to let yer lady know not to go around those parts again that late at night
you'll be fine
 
user1804599
Different people have different criteria on this topic and those who aren't involved have nothing to say.
 
Ell
9:48 PM
@райтфолд it can become problematic
if someone considers being looked at harassment
 
@райтфолд Unless Pacman eats a pill and you leave the prison, anyway.
 
user1804599
> for no reason
 
@Ell you can trade a little bit of freedom and avoid those problems
 
i cant believe google consistently gives back those SO clone sites as top results now
 
@Nooble I preordered Witcher 3
I swear it was a smart move tho
the game will kick ass
 
user1804599
9:54 PM
New idea: remapping {} to [] and vice versa.
 
@Mgetz nice.
@Pris why not? it's gameable, so it's gonna be gamed
Of course, SE and Google have experience dealing with that by now
 
@райтфолд {Good idea}(www.maybe-not.com)
 
Google explicitly deals with blogspam results usually
 
user1804599
Or even better.
 
user1804599
Remapping [] to () and vice versa.
 
user1804599
9:56 PM
() are incredibly often used.
 
user1804599
Making them easier to type is a blessing.
 
@райтфолд (Even better)[still%20no.com]
 
subtle
 
@райтфолд Decades ago, Dr. Dobbs had an article (or maybe more than one) about a programming language designed to be easier to type than (most) others. If memory serves, the author pushed it as basically as whole new paradigm of programming language design. Changed programming so much...that even I don't remember the name of his language.
 
9:59 PM
Cersei Lannister in the Colonial fleet
 

« first day (1580 days earlier)      last day (3371 days later) »