« first day (1532 days earlier)      last day (3409 days later) » 

12:21 AM
Just Cause 2 was the best $2.99 I ever spent
 
Ell
I mean just wtf
These people have to be high
 
they are on tumblr
 
1:12 AM
I paid for music today
Google play opened the music store in romania
 
user1646075
@Griwes I like to read these things so I have more comedy material at bbq's with friends and other get-togethers
 
user1646075
That TumblrTXT never fails to deliver.
 
user1646075
what's xyr - biological male retard?
 
1:38 AM
user image
4
 
2:22 AM
@EtiennedeMartel Looks perfectly normal.
 
 
1 hour later…
3:51 AM
@GuruAdrian Biologically retarded male
 
4:34 AM
Half way to seal rocks @ maccas
 
5:00 AM
 
 
2 hours later…
7:28 AM
If I define a lambda as a local variable then is there any benefit in declaring it static? E.g in order to avoid re-creating the same object every time?
58
Q: Why are my games slower on battery power, even with the power plan set to High Performance?

Egghead99My laptop is capable of running most games on high settings at a decent frame rate. However, if the power cable gets unplugged while I'm playing, the game immediately starts slowing down, even if I'm using the High Performance power plan. Why is that? Is the battery not able to keep up with the ...

Well, unless when I think about it..
 
7:51 AM
Thinking about it: solving problems since 100000 BC
3
 
why do schools teach java instead of c++?
 
@nsij22 There's a question about it on Programmer.SE. Look it up
73
A: Why do we study Java at university?

Jerry CoffinA few Universities have somebody who's sufficiently well known that many (if not most) decisions revolve around that person's likes, dislikes, opinions, taste, etc. Just for example, Texas A&M has Bjarne Stroustrup on staff; it probably comes as little surprise to anybody that their curriculum te...

 
that is depressing
 
meh
what's depressing is that my uni teaches "C with iostreams"
 
Fuck C++, it's a terrible language for beginners
 
8:05 AM
Don't have high expectations from formal education. Just do the required work and self-educate in the stuff you are interesting in.
 
Don't have high expectations about anything and you'll be rarely disappointed
 
@StackedCrooked Yeah, it seems it does what is expected. :)
@CatPlusPlus But your life will be depressing and sad.
 
That's the definition of life
 
9:05 AM
@CatPlusPlus Why only rarely? Why so positive?
 
@JohanLarsson That is just the grumpy cat, as per usual. :)
 
But it is like he expects the strategy to work no?
 
9:21 AM
@StackedCrooked: Could you add "format this piece of junk code into something nice" functionality into your Coliru editor? Please. :)
 
9:32 AM
OK, when reviewing questions, etc., is there a difference between "Skip it" and "Leave Open" choices?
 
> Remember that an abstraction is always a form of selective ignorance: We are ignoring certain parts of whatever it is we're thinking about in order to be able to reduce what's left to a form about which we can reason clearly. Every time we form an abstraction, we run the risk of ignoring something important.
3
> Perhaps the most important part of creating abstractions, therefore, is to understand what we are abstracting well enough that we can be sure that the abstraction that results is one that captures the parts of the whole that we actually care about at the moment.
^ End of Koenig's final post on dr dobbs.
It rings very true.
 
9:50 AM
@StackedCrooked where is that from?
 
nnice, i'll start from the beginning tomorrow, in the meatime i.imgur.com/qyRrBNf.gif
 
Apparently I have posted 711 "+1" comments data.stackexchange.com/stackoverflow/query/261063/…
@TonyTheLion no no no no no no
 
10:23 AM
Hahahaha. This suggested edit was good comedy stackoverflow.com/review/suggested-edits/6579974
 
10:42 AM
@Rapptz, So without much effort, I got my 5960X to run at 4.0 GHz - stable AFAICT. Cooling isn't much of a problem. The real problem is that it pulls 240W under prime95. And searching around, people say it will pull upwards of 400W if you go 4.4 GHz+. I'm not going any higher than 4 GHz.
 
user1804599
10:57 AM
@StackedCrooked that's why abstractions should neither be the only choice nor the only thing taught.
 
user1804599
(fuck you, quickstart guides)
 
Ell
There are alternatives to abstractions? O.o
 
just use the thing directly
 
Ell
Meh I guess
 
user1804599
@Ell I mean the specific abstractions.
 
Ell
10:59 AM
Oh right
 
user1804599
> Passenger eating tuna fish and a boiled egg
 
user1804599
eww!
 
@nsij22 Probably because C++ is too complicated, and it's very hard to teach well.
 
Ell
11:14 AM
Man boxing day is just christmas cleanup day
 
as in, you gotta clean up all the tasty foods.
 
user1804599
> Hair color: Bald
 
Ell
11:32 AM
And the wrapping paper and thousands of glasses and bits of crap everywhere
 
user1804599
lol boxing day
 
user1804599
Just give each other money (so you all end up with the same amount you started with) and buy what you want yourself.
 
@rightføld or amazon coupons
 
user1804599
 
Ell
I feel like that's NSFW :P
 
user1804599
11:38 AM
Maybe you should be working instead of chatting then.
 
user1804599
Tomorrow snow probably.
 
Ell
I don't have a job anymore
Trypophobia is weird
 
user1804599
@FredOverflow how does Scala compile this?
 
user1804599
var x = 1
trait A {
    def g = x += 1
}
 
Google/Bing translators are nice, until you have to read full Amazon reviews and I now know where these Chinese bootleg DVD cover text came from.
3
 
user1804599
11:42 AM
It has to box x some way, since you cannot store references in the JVM.
 
sigh
 
user1804599
Assuming x is a local variable within a method.
 
user1804599
Ah, it boxes it.
 
user1804599
public interface Main$A$1 {
  public abstract scala.runtime.IntRef x$1();
  public abstract void Main$A$1$_setter_$x$1_$eq(scala.runtime.IntRef);
  public abstract void g();
}
 
12:07 PM
@rightføld IntRef is like java.lang.Integer but mutable?
 
user1804599
Yeah.
 
I believe C# does something similar.
But I believe C# is more efficient if you close over multiple variables.
Does Scala use one IntRef per closed-over variable?
 
user1804599
@FredOverflow I think so.
 
user1804599
Well only if the variable is mutable.
 
I think C# uses only one "closure object".
 
user1804599
12:08 PM
I think C# has different semantics.
 
user1804599
More like [=] in C++.
 
user1804599
But I'm not 100% sure.
 
Yeah, C# closures work differently from Scala closures I learned that the hard way
 
I'm pretty sure C# has reference closure semantics.
 
They also changed it between 3.5 and 4 (or was it 4 and 4.5?) to avoid closure-loop issue.
 
12:09 PM
But that was only related to loop variables.
 
C# passes value types by value to lambdas and reference types by reference
 
Do you have any references to back that up?
 
I thought you could mutate locals in C# lambdas
 
user1804599
 
in fact I know that you can.
 
12:10 PM
I thought so, too.
 
user1804599
I don't know how the code is generated.
 
Wait, yeah, you can, I do it with loops all the time
 
@rightføld There you go.
 
user1804599
C# has ref but that's only for parameters.
 
user1804599
Maybe with pointers! :P
 
Closed-over locals are hoisted to the heap.
 
user1804599
@BenjaminGruenbaum Ah, same as in Scala.
 
Yeah, now I have to figure out what language I was thinking of that this this by-value.
 
> if it captures any variables (including "this", which may be implicit) then those variables are actually implemented as fields on a compiler-generated type
@rightføld Scala doesn't generate types like this, does it?
 
user1804599
@FredOverflow They're in the standard library.
 
user1804599
12:13 PM
TRef for all primitive types T as well as one for AnyRef.
 
Again, if you mutate two locals, then Scala will use two IntRef objects, whereas C# will only use one object of a special type.
 
user1804599
Ah, I see.
 
user1804599
Mutation isn't as abundant in Scala though.
 
right
 
Ell
Scala is so ace
 
user1804599
And C# is so joker?
 
@FredOverflow You have two values either way, who cares how many references are on the top level
 
I wonder how C# handles closures in expressions. That sounds harder.
 
user1804599
@FredOverflow Maybe Scala uses an array when you have multiple integers.
 
@rightføld Does scala have anything akin to expressions? I never checked but I always assumed there is a scala counterpart.
 
user1804599
12:16 PM
:p
 
@CatPlusPlus Two objects need more space on the heap than one object ;)
 
user1804599
@BenjaminGruenbaum Macros.
 
@BenjaminGruenbaum You mean expression trees?
 
@rightføld Oh, so you break up and build expression trees with macros?
 
user1804599
I think you can just make a macro that returns the input.
 
user1804599
12:16 PM
Not sure.
 
@FredOverflow yeah
 
Macros aren't canon yet, are they?
 
user1804599
But I'm pretty sure they can be used to achieve the same thing, perhaps sans conversion to delegates.
 
Typical of Odersky. Instead of implementing an expression tree facility, he provides a mechanism that is way more general, which can be used for expression trees, among other things :)
 
Ell
Scala has macros? :P
 
12:17 PM
Just like implicit parameters can be used for type classes.
@Ell I think they're still experimental, but yes. They're fundamentally different from C macros, though.
 
Ell
Implicit parameters are cool
 
Hmm, so apparently they do the same thing - an Expression gets compiled into a class too just as well with a Closure object.
 
Ell
I wonder what the tradeoffs between concepts and type classes are
 
user1804599
@FredOverflow And with macros, you can even have this: @TypeClass trait MyTypeClass[T] { def f: T } foo(f[T]) instead of trait MyTypeClass[T] { def f: T } foo(implicitly[MyTypeClass[T]].f)!
 
Ell
As I understand it they can be used in a similar manner
 
12:20 PM
@rightføld Can you explain that in plain English? My Scala is a little rusty ;)
 
I like how C# has advanced concepts that are dumbed down, Expressions (rather than arbitrary data as code) is not the only place it does this trick - although it frustrates me it keeps a lot of people in check.
 
user1804599
In Haskell type classes create top-level functions.
 
user1804599
In Scala they don't, but you can have them generated with macros.
 
@rightføld That'll just splice the input in like the macro wasn't there
 
As a programmer I find it frustrating but as a project manager I like that idea, to a point.
 
user1804599
12:21 PM
@CatPlusPlus Right, you have to quote it.
 
user1804599
I can't wait till macros aren't experimental anymore and I can use lenses without boilerplate.
 
Oh cool, the people who built LINQ like in scala used for comprehensions and the facts monads abstract chaining - that's pretty cute cs.uwm.edu/~dspiewak/papers/scalaql.pdf
 
@rightføld Aren't lenses just fancy getters and setters? ;)
 
user1804599
@BenjaminGruenbaum I like Slick.
 
user1804599
@FredOverflow I don't want to write them myself.
 
user1804599
12:23 PM
There's a library with macros that generates them from case classes.
 
Can't you just use mutable case classes?
 
user1804599
No.
 
user1804599
The whole point of lenses is that nested immutable data structures are more manageable.
 
got it
 
The fact I have to .view() sometimes but sometimes not is rather annoying and makes me have to think too much in certain scenarios.
 
12:24 PM
Can you chain lense operations, so you don't generate indermediate temporary trees?
 
user1804599
If I have case class A(b: B) val x: A and I want to set x.b.y to 1 I currently have to do x.copy(b = x.b.copy(y = 1)).
 
I bet this problem comes up a lot when decorating syntax trees.
lol almost wrote "decorating Christmas trees"
 
user1804599
With lenses I can just say (b |-> y ~= 1)(x) assuming |-> is lens composition and ~= is "set".
 
user1804599
And you can create functions that return lenses from array indices etc.
 
Maybe you had an easier job selling lenses to people if you told them they were a Design Pattern.
 
user1804599
12:27 PM
Lens composition constructs a path, so to say.
 
Ell
I don't know what a lens is
 
user1804599
Then you can get or set the end of the path immutably.
 
3 mins ago, by rightføld
The whole point of lenses is that nested immutable data structures are more manageable.
^ The guy who invented lenses
 
user1804599
@Ell Imagine this set of structures: case class Zoo(areas: List[Area]); case class Area(cages: List[Cage]); case class Cage(animals: List[Animal]); case class Animal(name: String, species: String)
 
Ell
Right
 
12:30 PM
9
A: Why lambda/closures expressions came so late to C++?

Bjarne StroustrupC++ had function objects from 1983 onwards; they took/takes care of many examples where people now use lambdas (and use lambdas in other languages). In fact, a C++ lambda is probably best understood as a simplified notation for defining and immediately using a function object.

impostor?
 
user1804599
@Ell Now I have a variable val x: Zoo and I want to get a new Zoo (since it's immutable) with a new lion in the second cage in the fifth area.
 
user1804599
Without lenses that'd be a nested hell of calls to copy and List#update.
 
@rightføld Write them out to see how complicated it really is.
 
user1804599
You sadist.
 
user1804599
Something like this:
 
user1804599
12:34 PM
x.copy(areas = x.areas.update(4, x.areas(4).copy(cages = x.areas(4).cages.update(1, x.areas(4).cages(1).copy(animals = Animal("Tony", "Lion") :: x.areas(4).cages(1).animals)))))
 
Ell
@rightføld ahh I see the problem now
 
user1804599
With lenses it would be (index(4, areas) |-> index(1, cages) |-> animals %= (Animal("Tony", "Lion") :: _))(x).
 
user1804599
A lens is a pair of functions def getter(x: T): U and def setter(x: T, y: U): T. You can compose them to access/update nested structures.
 
Meh Scala
 
12:52 PM
@FredOverflow woah, he does have a SO account, I doubt it's him there because of the picture
 
Holy shit, the compile speeds are godly on my new rig. Anyways, time to sleep.
 
Classic LRiO :D
Shame this doesn't answer the question. — Lightness Races in Orbit Feb 8 at 13:12
 
@BenjaminGruenbaum lol it was . Answers had different standards back then in that tag.
 
user1804599
24
Q: What's the easiest way to use reify (get an AST of) an expression in Scala?

Daniel C. SobralI'm looking at alternatives to -print or javap as a way of figuring out what the compiler is doing in Scala. With the new reflection/macros library, reify seems a good candidate for that, as shown in retronym's macrocosm's desugar. It even shows how one used to do that, pre-M4. So the question i...

 
operator T(); // where can I put enable_if?
 
12:56 PM
@BenjaminGruenbaum @Rapptz Bjarne was here...
TIL
 
@StackedCrooked template<typename U = T, typename ...>
 
user1804599
@StackedCrooked operator typename std::enable_if<..., T>::type()
 
@rightføld yeah I already read that - thank you :)
 
user1804599
@BenjaminGruenbaum I stumbled upon it in the related questions list of some unrelated question. :v
 
@rightføld I think that is a conversion operator to std::enable_if<...>...
 
user1804599
12:58 PM
> ::type
 
@rightføld Cool that seems to work.
 
ugly
 
user1804599
Your mother is ugly.
 
@Rapptz I don't understand...
What is U?
 
him
 
12:59 PM
A dummy type parameter.
Then you use std::enable_if using U instead of T.
 
But where is T defined?
 
user1804599
Come to think of it
 
user1804599
If you can do shit like this how complicated implicit conversions in C++ must be.
 
@StackedCrooked lol you're the one who provided T.
 
user1804599
@StackedCrooked std::T
 
1:01 PM
If it's template<typename T> operator T()
then just stick enable_if up there without U.
I thought it was operator T() with template<typename T> being above the class.
 
struct Byte {
    template<typename T>
    operator T() { return value_; }
    char value_;
};
 
yeah just stick it.. in the template parameter
like usual
 
Owkey.
 
user1804599
@StackedCrooked eww.
 
Thanks for helping me write horrible code :P
 
user1804599
1:02 PM
Implicit cancertions.
 
gonna go now
hope you guys had a cool Christmas yesterday.
 
user1804599
In Scala you can create implicit conversions between types you don't have control over. :P
 
user1804599
At least they're scoped.
 
Scala probably doesn't have much of the shit going around
like C++ does
 
@milleniumbug lol it's worse
 
1:05 PM
@Rapptz Merry Christmas.
 
1:19 PM
Boredom
 
Byte() = Byte(); // ok
char() = char(); // error: expression is not assignable
Weird.
 
@StackedCrooked You can call member functions on rvalues
operator= is one
if you want to make first line compiler error
use rvalue ref-qualifiers for *this
 
-6
Q: Count the no. of a particular subsequence in the given text

Aditya LunawatProf. X teaches algorithms at IIITB. In one his classes, he asks the students "How many of you love IIITB ?" . All hands go up. Then he continues "how many of you love Dynamic programming ?". All hands go up again. Prof. X smiles and displays some random text on the screen. He says "Count the num...

WTF? The reason for closing this question is IMHO invalid.
I hate close-happy people. :(
 
@VáclavZeman That's the reason you're sad! Why not be close-happy yourself? :P
 
@milleniumbug you mean something like this?
Byte& operator=(Byte&&) && = delete;
Byte& operator=(Byte&&) &  = default;
 
1:30 PM
yeah, something like this
 
@MarkGarcia Well, I think there is a lot to teach and learn. The reason given simply does not fit. I do not think that SO should be just about answering given questions instead of giving guidance and thus solving user's XY problem.
 
and also for lvalues
 
@VáclavZeman People are trying to draw lines, that's why. But if we don't, then I don't know if it would be better or worse.
 
@MarkGarcia The dude added the code upon request, so that problem has been fixed. His code IMHO does not do/compute what he is tasked to do. This second problem can be fixed given appropriate answer, as long as we allow answering people by not closing the question. I suspect at least half of the people who closed it have no idea how to solve it.
It pisses me off.
 
'International Space Station flies over Coventry on Christmas Eve'; presumably, all attempts to change its orbit failed:(
 
1:35 PM
I would rather err on the side of the caution and kept a question open and potentially unanswered than closing.
 
Waarghhh! @VáclavZeman hates me!
 
@MarkGarcia Also, lines against what?
@MartinJames As if you cared. :)
 
@VáclavZeman True:)
 
@VáclavZeman Whether to close or not, whether the question is answerable or not, whether the question is good or not, etc... So Stack Overflow chose to draw some and some people either enforce it valiantly, some misunderstand and does sad things.
 
1:42 PM
Good answer puppy
 
Typing "@Va" still shows @VáclavZeman even without that thing above the 'a'. Something either SO chat has done right or something wrong that turned out to be useful.
 
@VáclavZeman I beg to differ, it was at best a homework question or challenge question which is off topic
 
@Mgetz Some homework questions are answerable by giving algorithmic answers instead of just working code. Especially, since the dude has tried something of his own first and was not coming for just easy handout.
 
@VáclavZeman then they belong on programmers, not on SO
 
@MarkGarcia Unicode second level collation? :)
 
1:50 PM
probably normalize to NFKC or something like that
 
@VáclavZeman Yeah or something more "lenient". Good thing they cared. :)
 
user1804599
Byte& operator=(T t)
 
user1804599
@StackedCrooked rrerr.net
 
user1804599
@StackedCrooked twice Byte& operator=(T t)
 
Nah.
First one calls Byte& operator=(Byte&); (non-const copy assignment is also auto-generated it seems)
 
user1804599
I'd donate all my money to waffle factories. — rightføld just now
 
Overloading on universal-ref is truly a surprise monster.
 
yep that's a bad plan
you can only beat universal ref with an exact match.
 
2:04 PM
Forward references are very forward.
 
since it exactly matches everything.
 
I thought templates reduced the overload score.
 
they do, but not by enough.
 
user1804599
I like how you can turn type intersections into type unions with De Morgan's laws and the Curry–Howard isomorphism.
 
template being less-preferred is lower priority than getting the best match.
if a template presents an exact match, it can only be beaten by an exact non-template match.
 
2:06 PM
I see.
 
which is why universal refs are so dangerous to try to overload with.
 
I've only recently realized that adding const reduces the score.
I would never have realized if I hadn't been messing with T&&s.
 
it doesn't reduce the score.
it's just that T& (the universal ref after collapse) is a better match to a mutable variable than const T&.
 
Oh, at least, it's a lesser match then.
 
still no.
adding const is only a worse match if the source variable is non-const and the other thing is a suitable mutable reference.
 
2:08 PM
Ah.
 
which is the situation you get with universal refs, of course.
but see what happens if you have const T& vs T.
 
I tried that one too.
It seems as if const T& and T are equally matched.
 
for const, mutable, or both?
 
You mean constness of the passed argument?
 
yes.
 
2:12 PM
Hm, seems to work this time...
Funny thing is that this does not prevent creation of the compiler-generated operator=.
Nothing is printed. So none of both overloads were triggered.
 
lol, wth?
Downloading the latest package list from hackage.haskell.org
cabal: <socket: 7>: resource vanished
Resource vanished?
 
@VáclavZeman finally! someone realized that haskell is useless and dropped it
7
 
@Abyx I didn't. I just find this funny. :)
 
// these are overloadable, yet I cannot find any way to make a non-ambiguous call
operator=(T t);
operator=(const T& t);
 
2:30 PM
@StackedCrooked I do not think there is any non-ambiguous call, except maybe if volatile is involved on the argument?
 
hm..
Ah well.
 
Hmm, something must be wrong with Cabal servers or my connection because Cabal installs fail randomly.
 
user1804599
2:46 PM
lol Cabal
 
user1804599
Pretty much a synonym for "failed installation."
 
sbi
Great Presentation by Hartmut Kaisers via @meetingcpp: Plain Threads are the GOTO of todays computing #cpp https://www.youtube.com/watch?v=4OCUEgSNIAY
Hey, @FredOverflow, have you seen ^this already? I was there and I think it was a very good closing keynote!
Good afternoon, BTW.
 
sbi
Oh, the cat is here. And I thought the room is dead.
Oh well, it seems the cat can't make this room less boring than when it's empty.
Bye!
 
3:13 PM
@sbi Heh, nice. I love the picture of the jammed crossroad.
 
Ell
3:36 PM
@sbi bye!
 
In a producer-consumer scenario messages are created by a producer and disposed by the consumer (after processing them they go out of scope). This means the allocator for the message type must be thread-safe. Unless there is another way..
I'm on a quest to find that way.
 
Xeo
make it two-way, and put consumed messages in a queue for the producer, so they're back on the correct thread
 
Ell
@Xeo I was about to suggest this
 
3:57 PM
@Xeo I actually implemented that yesterday. Suddenly the segfaults stopped.
I stored them in a vector. Once the vector size becomes equal to its capacity I move it inside a message object back to the sender.
But this two-way approach may not always be possible.
 

« first day (1532 days earlier)      last day (3409 days later) »