« first day (1566 days earlier)      last day (3376 days later) » 

4:00 PM
also purity
as a possiblity, that is
 
@MartinJames dat Engli^Wgibberish, tho
 
@BartekBanachewicz No, they don't. They just have to not matter.
 
because if we consider OOP as fundamentally built upon mutability, then I don't think it's orthogonal
@R.MartinhoFernandes exactly
 
@BartekBanachewicz CLUE STICK. You keep coming back to "the thing that annoys me". Perhaps this is the problem in getting a clear view.
 
Exactly what.
 
4:01 PM
@BartekBanachewicz why is immutability not a possibility in OOP?
 
@rubenvb nope. meta-whoosh :)
 
@AndyProwl I didn't say it isn't.
I said I am not sure if it is.
 
@sehe you're too meta for me today.
 
Why is mutability not a possibility in FP?
 
@sehe Easy: 1. I look myself in the mirror. 2. Oh... I'm so handsome
 
4:02 PM
Good job
 
@R.MartinhoFernandes argh
 
@BartekBanachewicz OK, when you wrote "immutability in OOP should be a thing", I implied you thought it is not.
 
it's all too complicated.
 
Nah. It's simple. It's only complicated if you try to simplify it.
 
@Rerito 3. All right this time with open eyes...
 
4:03 PM
(That was written as intended.)
 
After this crappy pun... Time to commute (under the rain and the awesome strike of train drivers weeeee)
@AndyProwl Or less alcohol in blood
 
@BartekBanachewicz Good! Project it on them Orcs. They won't object.
Ba-dum-tss
 
maybe I'm just brainwashed by the OOP concepts taught at uni and what I was reading in high school
 
@Rerito that too :P
 
stuff like "encapsulation means private members"
and whatever other dumb statement appears there
 
4:03 PM
@AndyProwl Yeaaaah
 
@BartekBanachewicz It sounds a lot like you're trying to feel brainwashed. But you cannot. Because you see yo have ample choice.
@BartekBanachewicz Rest assured, had you not had "educators" help you get dubious guidelines, you would certainly have made them up yourself (this we can tell)
Like everyone else, for that matter. Some are just better than others evolving their "map of real things that matter"
 
Choice. The thing that makes you nervous
5
 
So you're saying that the reason for my doubts is the fact I can't understand I can have more than one way to solve a problem?
 
Should you choose to accept this, you will be able to pick at least one solution out of all possible kinds of solutions.
 
4:10 PM
if I ever write a book about (game) design, I'll put orcs there
 
@BartekBanachewicz Certainly. (Look at Alex :) <evil-grin/>)
@BartekBanachewicz sounds like a plan
@ashishg works for me. Anyhoops, imbueing a specific locale does the job: coliru.stacked-crooked.com/a/393e7bd6069b3ce5sehe 9 secs ago
 
> PERFORMANCE TRICKS
● When using float numbers, always remember to add .0f at the end. If not, it will be
treated as double and this will harm performance.
 
Time to go home
@BartekBanachewicz funny wording
 
@sehe this was (sadly) the only "trick" in that section
oh man
> Note: for 99.99% of the cases, you will be better using std::vector
this is the first thing there that makes sense
> Don’t spam a class with setters and getters for every single member.
 
user1804599
4:16 PM
Oh neat.
 
@sehe I didn't do nothing!
I was just sitting here
 
unless you're building some insane high performance real time engine forcing all your values to be float seems like some horrible microoptimization
 
thinking about the great burger I'll get in an hour or so
yum
 
user1804599
> sub f(Int $x) { }; sub g { f("42") }
===SORRY!=== Error while compiling <unknown file>
Calling 'f' will never work with argument types (str)
    Expected: :(Int $x)
at <unknown file>:1
 
@AlexM. you aren't a part of the unified Bartekmind
 
user1804599
4:17 PM
Static type checks are so cooooool.
 
@Pris correct observation.
maybe I should create this C++/OpenGL course and test it on animals someone here first
 
In fact I'd go so far as to call it a bad idea because if you want double precision for certain calculations it would be a total chore to go back and change everything. Games that deal with planetary scale values use doubles
 
@Pris that being said, on GPUs it matters
highp units are slower than lowp or mediump ones
 
Unless you're doing professional CAD stuff, you never pass doubles to the card.
 
@Pris not really.
 
4:20 PM
highp doesn't support 64-bit either
 
@Pris implementation-dependent
 
Given that precision specifiers are ES, you'd be hard pressed to find something that gives you 64-bit precision
 
mobile GPUs have gone a long way, remember
those aren't punny calculators anymore
 
highp is minimum 32-bit iirc
you never code for implementation defined precisions, you use guaranteed minimums
 
@Pris correct.
and you should of course work on magnitudes that fit in floats comfortably
 
4:23 PM
i'm a moron, thanks, simple things should be simple indeed
i tried std::make_tuple, but it didn't do the right thing, then I tried std::forward_as_tuple, but it didn't do the right thing either, so i just gave up and fixed it with a cannon, std::forward to tuple constructor is easy enough :)
 
people do bit twiddling tricks for higher precision calculations on gpus when they dont mandate support for doubles (like on ES). The CesiumJS project does something like that I think, to give you higher precision in WebGL than floats
 
yo, in vs there's a small lock next to a variable in the watch window
in this case, it's a member (non-const) anyone know what that is?
 
@LuchianGrigore Could it be related to Changing the variable during debugging?
 
@rubenvb don't see how that's related
 
4:33 PM
@LuchianGrigore OK, then I give up.
 
I'm hitting command-line length limits.
FUCK WINDOWS
2
 
@R.MartinhoFernandes 32k?
 
No idea.
It's a build with makefiles.
(3rd party)
 
oh.
That's why qmake uses response files. Probably because mingw32-make's createprocess usage sucks..
 
@R.MartinhoFernandes I feel your pain
 
4:35 PM
But I get LINK complaining that it cannot find a <truncated file name>
How do I go around this?
Link the things together in parts?
 
What program is truncating the command?
 
Try getting verbose make output and running the command manually
Otherwise, yeah, either shorten paths somehow or link in steps (static libs as inbetween would make the most sense, even if they're not really static libs)
 
Here I go diving into shitty makefiles.
 
try make -v
or make VERBOSE=1
or whatever.
 
4:39 PM
@rubenvb That's version :P
 
@R.MartinhoFernandes aha. GCC overloads that option.
Much confusion.
make -n
 
oh no.
prepare for a shitload of stuff
make -n is what you want.
 
Was how I figured out it was truncated.
 
then it's make, not link.exe that's truncating it.
But I'm outta here.
Cheerios!
 
4:41 PM
@rubenvb No, it passes the full thing to CreateProcess.
 
ah misunderstood.
commandline limit should be 32k though, if called correctly.
 
@R.MartinhoFernandes Response files
 
@rubenvb That's terribad.
Have they not heard about dynamic allocation?
 
@CatPlusPlus Isn't that an msbuild thing?
 
No
The program has to support it otherwise it wouldn't make much sense
Put all arguments into a file and do link @whatever
 
user1804599
4:49 PM
Gekko is a great song.
 
@Cat did you guys start using Scala?
 
I made so that the files have a shorter path by moving them to a folder named x.
Dammit, not enough.
Response files it is.
 
Was xxx already used?
 
Too long.
> LINK : fatal error LNK1104: cannot open file 'ffs.rsp'
Hmm.
 
5:00 PM
@R.MartinhoFernandes Try running subst X: my_long_path and build on that pseudo-drive.
 
Adding echo $^ > ffs.rsp to the makefile resulted in... output to the screen.
WTF
 
lol make
 
@Deduplicator They're all relative paths of the form folder/file.o
Just the filenames are too long on their own.
 
well, ouch.
 
I think it might have worked
Now I get regular linker errors.
:(
 
5:05 PM
Hello!
@R.MartinhoFernandes Hey--I seem to recall your knowing templates quite well. Could you glance over my answer and make sure I haven't written complete nonsense?
 
It's complete nonsense.
clicks link
@JerryCoffin Now seriously. I think he meant just foo<&bar>(1, 2) should work.
So while your answer seems factually correct (at least after skimming), I think it's not useful.
i.e., he wants template <void (*fn)(Type1, Type2), typename Type1, typename Type2>
 
5:28 PM
Nice question. As a child I used to eat the entire Orange, peel 'n' all. (So the peel is definitely edible, although I would wash it and buy organo-local if possible) — Grantly 2 days ago
wtf
 
3
A: Why 2 static libs can't call to each other's function

Lightness Races in OrbitWhen you build: g++ liba.a libb.a myCode.o -o myExe This is wrong, because the order of the arguments matters. If myCode uses symbols from liba and libb, those libraries must be specified after it on the command line: g++ myCode.o liba.a libb.a -o myExe Alternatively, you can request that t...

It's called a down_vote_. If you can't even get this site's basic site terminology right, despite being confronted with it absolutely everywhere, I don't have much faith in your ability to rigorously specify problems. And what prevented you from using capital letters at the beginning of sentences?! — Lightness Races in Orbit 30 secs ago
 
@LightnessRacesinOrbit Broken shift key.
 
@R.MartinhoFernandes I wish I could down rate your message.
 
> I have my stuff more than you and i spreading my stuff to every one
ew
I hope he won't spread his stuff on me
 
5:45 PM
@R.MartinhoFernandes ..to go with his broken logic.
@AndyProwl I know. I had to shower twice.
 
0
Q: How can private member variables in C++ be simulated in C?

UrlerCan private member variables (as in C++) be implemented in C and how can this can be achieved? I thought about static global variables limiting the scope of the variable just to the file where it is defined, but then how would one access it from other files? Is there a way to implement private m...

The urge to reply: "no because C sucks" is very strong
 
@R.MartinhoFernandes They come with redundancy.
 
Yes you can. C++ is written in C. Search for "Object oriented programming with C". — haccks 42 secs ago
 
-24
A: Why they down rate?

HariharanThanks to every one...at last a big good bye to Stack Overflow and specially EXPERTS .... totally last ... Sorry to say this... Stack Overflow your are awesome but the same time you are making some one to go hell....and its my turn now... totally frustrated ... I think in future it would change ...

holy ellipses batman
 
user1804599
Hi.
 
5:47 PM
hi
 
@Pris Yeah - it's already had some 'attention':(
 
<3
@MartinJames Hahahahaha xD
 
23 hours ago, by FredOverflow
@BartekBanachewicz Today, I raped my Java students with 20 minutes of Haskell.
YAQSIH (Yet Another QuickSort In Haskell), starting @ 0:55:27
 
user1804599
Nice.
 
@FredOverflow I'm sure he meant 'rapped'. Some sort of hip-hop teaching aid.
 
user1804599
5:50 PM
Rappers gonna rape.
 
its snoooooowiiiinnng
 
@Pris Yeah, already suffering that here.
 
user1804599
@FredOverflow The algorithm fails for the empty list.
 
@рытфолд That's actually my first complaint about that slide in the lecture :)
 
user1804599
Oh. :P
 
user1804599
5:52 PM
@FredOverflow It's easy to solve, though. Just make S of this type: docs.typelevel.org/api/scalaz/nightly/…
 
I can use Scalaz in Haskell?
 
@Pris lol
 
user1804599
@FredOverflow No, but you may be able to use it in Frege!
 
user1804599
It's also trivial to implement that type in Haskell.
 
@R.MartinhoFernandes Hmm...could well be.
 
5:55 PM
Or I could simply specialize quicksort for the empty list :)
 
user1804599
I thought Int was too long, so I decided to go with Z.
 
user1804599
Similar for Uint, Rational and Complex.
 
How long is Int?
 
@FredOverflow Now that's just crazy talk!
 
user1804599
Three characters.
 
5:56 PM
Oh, I thought you meant the range.
 
user1804599
No.
 
@FredOverflow this long: [ ............................................. ]
 
Does Haskell define how large an Int is?
 
user1804599
Bit it's an alias for Int32.
 
user1804599
@FredOverflow I think so, yes.
 
5:56 PM
It's native word
 
user1804599
It's a weird value.
 
user1804599
Something like 53 bits IIRC.
 
user1804599
No wait.
 
user1804599
> A fixed-precision integer type with at least the range [-2^29 .. 2^29-1].
 
Why 53? So it can be stored in a double? :)
Are there systems that have floating point units but no integer units? :)
 
user1804599
5:57 PM
What's a unit?
 
user1804599
JavaScript has only floats.
 
@FredOverflow That's how integers were done on the first big machine I ever programmed (Control Data mainframe). Integer was 40 bits. Single precision floating point was 60 bits (40 bit mantissa, 20 bit exponent). Double precision floating point just used the mantissa part of the second word, so it was effectively 100 bits total.
 
Control Data mainframe reminds me of Haskell imports :)
 
user1804599
Lua has only floats unless you build it differently.
 
Lua is not a system. It's a language.
 
user1804599
6:00 PM
Is the Lua VM a system?
 
@FredOverflow You're only seeing the tip of the iceberg.
 
@рытфолд hmm...
 
user1804599
> quicksort :: [a] -> [a]
 
user1804599
Epic fail.
 
I made that error by design!
 
user1804599
6:04 PM
Oh, I see. :P
 
The more interesting fail is @ 1:08:13
 
user1804599
Also you can use partition instead of two filter applications.
 
I had no idea what was going on.
 
user1804599
@FredOverflow Almost there.
 
@рытфолд You'll be pleasantly surprised ;)
 
user1804599
6:04 PM
OK!
 
user1804599
Similar for head and tail, with splitAt!
 
lol multiple let workaround :D
 
user1804599
Or pattern match. :V
 
@рытфолд I just end up splitting the input. Is that considered pattern matching as well?
 
user1804599
(x : xs) is a pattern.
 
user1804599
6:06 PM
Because : is a data constructor.
 
lol infinite recursion @ 1:10:17
 
@рытфолд Not anymore. The newest version of Lua has floats and integers.
 
user1804599
WHAT
 
user1804599
@FredOverflow What went wrong?
 
The fact that you anticipated multiple optimizations in my code gives me confidence that I am not a total Haskell jackass.
 
user1804599
6:09 PM
Using let that way always worked for me.
 
@рытфолд If you look at the column number, I suppose it has to do with the fact that pivot and rest were indented differently.
 
user1804599
Weird.
 
But I'm still not 100% sure, because it looks just fine, doesn't it?
 
user1804599
You could use do. :)
 
user1804599
quicksort = do
    let pivot = head list
    let rest = tail list
    …
 
6:11 PM
mmm if i have a class, and make another class friend, can i access its private stuff from the other class when dealing with objects of the first class?
thats the whole point of friends right?
 
user1804599
You could use do when [] wasn't a monad!
 
user1804599
Because there is no monadic bind anywhere in the do expression!
 
user1804599
Prelude> do ()
()
 
@gnzlbg Yes, class X { friend class Y; }; allows Y to access X's private members.
 
user1804599
Also, I understand quicksort now. Thanks!
 
6:13 PM
@JerryCoffin i can even make a class friend with itself
 
user1804599
@FredOverflow Maybe you fucked up tabs vs spaces.
 
i need to take a break i think, clang doesnt understand me
 
@gnzlbg I suppose there's nothing in the grammar to prevent that, but it's utterly pointless (and I'd have to look, but it wouldn't surprise me if it's prohibited somewhere).
 
is there some special rule for nested template classes?

template <class is_const> struct iterator_impl {
friend struct iterator_impl < std::conditional_t < is_const{}, std::false_type, std::true_type >> ;
friend struct iterator_impl<is_const>;
...
};

error: 'it_' is a private member of
'hom3::range::reversed_range<hom3::range::storage<std::__1::vector<int, std::__1::allocator<int> > &> >::iterator_impl<std::__1::integral_constant<bool, true> >'
return it_ != b.it_;
^
/Users/gnzlbg/projects/hom3_v2/test/core/range/view/test_iterators.hpp:7:13: note: in instantiation of function template sp
 
@gnzlbg coliru it, please :/
 
user1804599
6:17 PM
@FredOverflow Sorting in JavaScript is fun:
 
user1804599
> function range(n) { var result = Array(n); for (var i = 0; i < n; ++i) { result[i] = i; } return result; }
> range(20).sort()
[0, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 3, 4, 5, 6, 7, 8, 9]
 
so basically B<T> is only instantiated as B<true_type> and B<false_type>
 
user1804599
That's not Coliru.
 
coliru says gcc 4.8, c++11, and renders wrong in my chrome :/
 
Your chrome is borked.
It renders completely fine in chrome.
 
6:25 PM
yep :/
in mine the numbers on the left appear over the text, the line numbers
 
Get a better chrome.
 
Chrome version? OS?
 
it was a chrome plugin screwing it up
emacs buffer for chrome
now it looks good
 
user377628
Does anyone know of a way to use an integer variable that wraps at a predefined value?
 
user377628
Like if it's set to 20 and I do x++, it sets to 0
 
user1804599
6:30 PM
@Hassan No.
 
user377628
For example
 
user1804599
Implement a data type that does that.
 
@Hassan make a custom int
 
user377628
Okay
 
user377628
So there's no way to use data types to do that at all?
 
6:32 PM
@Hassan yes, if you write one that does that, then you can use it
 
user377628
Well I mean built-in data types
 
user377628
But okay
 
user377628
I was just wondering if there was a way
 
@Hassan bitfields will let you do that for powers of two as the limit. Otherwise, you have to implement it yourself (but that's pretty trivial).
 
user377628
Thanks
 
6:32 PM
@Hassan no, there is no built in data type that allows you to do that, and there is no type for that in the standard library
 
user1804599
There is unsigned.
 
@Hassan x = (x+1) % 20;
 
user1804599
But you cannot set the value at which it will wrap around.
 
you can set two values
 
I wonder if mod is faster or slower than a conditional
 
6:33 PM
or maybe 3
 
@Pris benchmark
 
user1804599
@Pris Then benchmark it.
 
user1804599
Hint it will be equally fast.
 
user377628
Thanks everyone for the replies
 
@Pris Depends on the processor. On older processors, conditional is almost always faster (Unless mod by 2^N-1). On newer ones, it usually depends on how often your value is in/out of range (and therefore, how well branch prediction works).
 
6:34 PM
i'll bother benchmarking curiosities when there's a std::benchmark_start(); .... std::benchmark_end(); or something as easy :p
 
x = x + 1 + (-20 & -(x == 19));   // yay obfuscated code
 
if you need 2^8, 2^16, 2^32, 2^64 as a wrap around value, you can use fixed width integer types
 
user377628
Yeah that's what I was thinking, but I wanted to know if there was a way for arbitrary maximum values
 
@Hassan If it's a power of two, it's super simple and efficient: x = (x+1) & 127 for 7 bits, for example.
 
user1804599
> my $x = 6 Mod 10; my $y = 7 Mod 10; say $x + $y;
3 「mod 10」
 
6:35 PM
ive been looking at my coliru example for 5 min already, what the fxxx is wrong with my eyes?
 
@рытфолд language?
 
user1804599
Perl 6.
 
user1804599
With this library: github.com/grondilu/p6-modular.
 
user1804599
Yes Perl 6 uses and for lots of things. :v
 
@gnzlbg ew TMP
 
6:36 PM
@gnzlbg If you need any power of two (up to the number of bits in unsigned long long) you can get it. For example, in: class X { unsigned ranged : 5; };, the ranged member is now a total of 5 bits, so it will wrap at 2^5.
 
yay bitfields
 
@FredOverflow yep :/
B<true> is friend with B<false>, and B<false> is friend with B<true>, but g++ complains that they are trying to access private fields from each other :/
still B<true> friends with B<true> makes no sense, g++4.9 catches that, clang 3.6 doesn't
 
user1804599
I want |> to have higher precedence on the right than on the left.
 
the right and left of what?
 
user377628
@JerryCoffin was not aware of that
 
6:39 PM
@рытфолд Yeah, good luck with that.
 
user1804599
So 1 / 2 |> f() / 4 is equivalent to ((1 / 2) |> f()) / 4.
 
user377628
Is that in the standard, I can't seem to find anything on it
 
@Hassan Not surprising--a lot of people aren't.
 
user1804599
Actually very easy.
 
user1804599
|> requires a call on the right-hand side.
 
6:39 PM
@Hassan Yes, it's called bitfields.
 
@Hassan Yes. [class.bit] in the C++ standard (§9.6, as of N4140).
 
user1804599
So I can just make it a postfix operator.
 
user1804599
Similar for @> and >>.
 
now it works, crap
 
What did you do?
 
user1804599
6:42 PM
That way you can write very nice code.
 
user1804599
Like sub mean(xs) = xs @> +() / #xs.
 
user377628
Hey does anyone know of a way to do that unsigned x:5 thing in plain C?
 
user1804599
struct a { unsigned x: 5; } a; a.x = 42;
 
user1804599
I don't know whether you can have structs in functions in C. I don't really give a shit about C.
 
user1804599
6:47 PM
@FredOverflow That's C++, not C.
 
user377628
Is there any reason you can only do this for a struct/class property?
 
user1804599
Yes: C is shit.
 
user1804599
An inconsistent piece of shit.
 
user377628
Well it's the same for C++
 
user377628
Just tried it
 
user377628
6:48 PM
haha
 
user1804599
Same reason in C++.
 
user377628
hahaha
 
@Hassan Exactly the same way.
 
@рытфолд Legacy C++ shit comes down to Bjarne sucking K&R's cocks.
 
6:49 PM
@Hassan Because that's how it's defined. There's really no more or less to it than that.
 
user1804599
@LightnessRacesinOrbit bonus points if you use -pedantic and if C allows anonymous structs.
 
@Hassan Have you told us yet why you think you need this?
@рытфолд Why did you name type the same as the variable?
 
user image
8
 
user1804599
@FredOverflow Because I don't know whether you can have anonymous structs in C.
 
user377628
I needed to do something like this a while ago in java, and I was wondering if there was a way to do it in C/C++
 
user377628
6:50 PM
So I don't really need ti
 
user1804599
@Columbo Jambon is neither jam nor bon.
 
user1804599
Silly French.
 
> I want to write a string in C, compile it with C++, printing it in Python and finally deleting it in Java.
 
WHY DOES THE PICTURE NOT LOAD WHEN I CLICK ON IT
ARRRGGGHHH
Damn you, imgur
 
> Please help me I want to be a hacker XD
 
6:52 PM
@рытфолд I did use -pedantic.
 
user1804599
@LightnessRacesinOrbit Then kudos for C.
 
user1804599
tep kok
 
@Columbo That's a lot of tags.
 
user1804599
Nice.
 
user1804599
6:54 PM
> multi sub postfix:<!>(Int $x) { [*] 2..$x }
sub postfix:<!> (Int $x) { #`(Sub+{Precedence}|140267071879520) ... }
> say 8!
40320
 
nvm I'm blind
Hey, that rhymes!
 
user377628
You're a poet and you didn't even realize
 
@LightnessRacesinOrbit Eclipse has been doing that for 15 years.
...Is Eclipse even that old? :)
 
@Borgleader My implementation of your 'No because C sucks' comment-suggestion got deleted:(
 
user1804599
> Need Swift developer with 5 years experience.
 
6:56 PM
I have 5 years experience with C++. I can haz Swift job?
 
user1804599
lol
 
What is your opinion of Swift? Worth looking into?
 
user377628
If you've been using scala for five years, you could tell them you've been using swift for five years
 
user377628
They seem similar enough
 
user1804599
@FredOverflow I never used it, so I don't know.
 
6:58 PM
@Hassan However, it's pretty easy to create a template for something that acts that way: coliru.stacked-crooked.com/a/923ac698ba5346ad
 
@Hassan I have been writing Quicksorts in Haskell since 2008. Swift job, here I come!
 
user377628
lol
 
@FredOverflow Haskell doesn't qualify--it doesn't have nearly enough quirks and oddities to qualify as a path to Swift.
 

« first day (1566 days earlier)      last day (3376 days later) »