« first day (1653 days earlier)      last day (3299 days later) » 

4:01 PM
@fredoverflow Absolutely nothing.
 
user1804599
@fredoverflow lol
 
user1804599
@Xeo Nice hands.
 
does rabies spread through contact with a rabbi?
 
is your keyboard heated or what
 
4:05 PM
Woah we almost have a majority 'yes' on Greenlight
 
gratz
 
Xeo
@LucDanton Dunno, but she certainly likes sleeping on it
 
@Xeo now i know why your code sucks :P
 
Xeo
she has taken a liking to sleeping next to me anyways
@Borgleader cats give +5 to coding
 
@Xeo im genuinely curious as to why a cat would like to sleep on a keyboard, it doesnt seem comfortable at all
 
Xeo
4:08 PM
they actually seem to like uneven surfaces
I mean, cats are liquids anyways - they just shape themselves around the unevenness.
 
user1804599
@Xeo me too!
 
Daisy loves surfaces that allow her to prop her head up.
@Xeo Do I observe a console controller in your background? I thought you were a member of the PC Master Race.
 
Xeo
I use the X360 controller on PC
 
that's an acceptable deviation I guess
 
I played Fable 3 on PC with the Xbox controller cuz the PC controls were shit
(actually no, ill admit i googled what the button for diving was and i couldnt find it for PC so I turned around and plugged my xbox controller and used that for the rest of the game)
 
4:13 PM
oh hey
Starbound stable update.
 
@Xeo What keyboard do you have?
 
Hi, does anyone knows the difference(if any) between those 2?
typedef struct element{ int id; }; / typedef struct element{ int id; } element;
 
Xeo
@Borgleader Logitech G15, "borrowed" years ago from a friend.
Been too lazy to get a new one yet
 
@wing the second one also declares a variable of the type that precedes it, goodbuy
 
> Removed the annoying levitation status from random status pods
yay
 
Xeo
4:15 PM
@Puppy yesh
 
user1804599
@Mariano: Can we call the practice of rebranding those processes Suárez-Alvarezization? — Zack Wolske Nov 21 '12 at 21:33
 
user1804599
lol
 
Xeo
I saw that in the preview of the update
 
@wing This is only relevant in C, not in C++.
 
@wing No, nobody knows the difference.
 
4:18 PM
@milleniumbug So they both create an alias, the second does not create a variable of the type right?
 
Xeo
the first shouldn't be valid (empty typedef name), and the second is redundant
unlearn them
 
@wing The first is equivalent to struct element { int id; };, and the second also declares the typedef name, which is relevant in C, as you can refer to the type as element and not as struct element.
@wing Both are bad style C++ though.
 
@milleniumbug got it, thanks a lot!
 
4:34 PM
@milleniumbug Does typedef struct element{ int id; }; even compile?
 
Ooops. I couldn't help myself stackoverflow.com/posts/29880014/revisions That's a pretty pedantic edit I suppose
 
@fredoverflow It does on g++ with -std=c++11 -pedantic and on gcc with -std=c11 -pedantic
 
And what does it mean; introduce an anonymous typedef?
 
@sehe that's the edit of the century. I love it
 
On the other hand, it issues a warning, so maybe on the other hand it isn't legal after all.
But -pedantic-errors doesn't make it an error.
@fredoverflow It doesn't declare anything (except the struct), the typedef is ignored.
aaaa.cpp:1:33: warning: 'typedef' was ignored in this declaration
aaaa.c:1:16: warning: useless storage class specifier in empty declaration
 
I'm not surprised it does compile in C. But the fact it does in C++ does.
 
i need an explanation here, i thought struct X { /* stuff */ } y; declared a variable y of type X
 
@Borgleader Yes, it does. But they mentioned typedef struct X { /* stuff */ } Y;
 
right ok, so in that case I'd have to do what? typedef struct X { /* stuff */ } Y z; ?
i.e. im introducing a name for the typedef and declaring a variable of it?
 
4:45 PM
@Borgleader It won't compile.
 
you cant do both?
 
huh, interesting
 
You can define multiple aliases though
 
Wow, this stuff with ranges is awesome
x : [0, 10] ∪ [15, 15]
y : [45, 52] ∪ [67, 90]
x * y : [0, 520] ∪ [675, 780] ∪ [0, 900] ∪ [1005, 1350]
where a : R means that the integer a has R as its domain.
 
4:53 PM
@Borgleader Why do you even want that weird typedef stuff? Are you writing C or C++?
 
user1804599
@Jefffrey Is that C++?
 
@rightfold I doubt it, which means @Columbo is gonna spank him
 
@fredoverflow I want to understand what I got wrong (see above). i never use typedef struct ... syntax
 
@rightfold I wish. I was writing a library that implements compile time domain checked integers (Here), but saw the limitations of the current simple "maximum 1 continuous range" system, when I was implementing %, because if we have x : [18, 23] and y : [16, 19], for example, then x % y : [0, 7] U [18, 18], which cannot currently be represented.
 
user1804599
I know what you need that for!
 
I'm thinking of writing a port in Agda
 
@Jefffrey jeffold
 
@rightfold Wait, are you the same rightfold from SO proper? What an amazing coincidence!
 
@fredoverflow Java Collections API is so bad at LSP I don't even
 
user1804599
5:00 PM
@Jefffrey In F* you can say type x_t = i:int { (i >= 0 /\ i <= 10) \/ i == 15 }; val x: x_t; let x = 5.
 
That's beautiful.
 
@Jefffrey In case you're looking for something that can be used, you may be interested in this library
 
user1804599
type x_t = i:int { (i >= 0 /\ i <= 10) \/ i == 15 }
val x: x_t
let x = 12 (* Subtyping check failed; expected type x_t; got type int *)
 
nice
 
user1804599
In Scala you can also do this, but it's much much uglier.
 
user1804599
5:02 PM
You would create a type union of 0.type, 1.type, 2.type10.type, 15.type.
 
@milleniumbug You literally can't even?
 
user1804599
Although you can automate that with macros.
 
user1804599
@fredoverflow Yes!
 
@Nooble Actually, he can. But he don't.
 
@AndyProwl I had the same interface, but I'm curious to see how he implemented % (which he seems to have), because it's not possible with that continuous range system. Unless you explicitly allow only specific sets of possible integers for that operation.
 
user1804599
5:03 PM
@milleniumbug How is it bad at LSP?
 
user1804599
Apart from this particular class, it seems fairly consistent.
 
user1804599
The base classes explicitly specify that some methods may throw OperationNotSupportedException, so it is up to the API consumer to check whether the operation is supported, and LSP is satisfied.
 
user1804599
It's just a horribly shitty thing to do, but doesn't violate LSP.
 
user1804599
Violating LSP would mean throwing OperationNotSupportedException where the superclass doesn't document a subclass is allowed to do that.
 
Let's just say it violates the CSP then (the common sense principle).
 
user1804599
5:08 PM
@fredoverflow don't use that broken Java class.
 
user1804599
See my comment on Stack Overflow.
 
@rightfold Well, you're right. It doesn't make it less horrible though.
 
user1804599
Nevermind.
 
user1804599
I'd just go with an ID class.
 
@fredoverflow He probably didn't think it be like it is, but it do.
 
user1804599
5:11 PM
That way you can still substitute AST nodes using copy.
 
@Nooble "even" is now a verb.
 
@milleniumbug :P
 
@milleniumbug Has been for quite a while (e.g., "Shortening this leg will even them up.")
 
@milleniumbug Good evening, then!
 
@fredoverflow +1
 
5:14 PM
@rightfold But then how can you know what's the correct type for x + x?
 
user1804599
x_t is a subtype of int, so the result will just be of type int if the compiler can't prove it fits in x_t.
 
b.atch.se - Non-constant constant-expressions in C++ (feedback is appreciated) /cc @Columbo @sehe
6
 
@FilipRoséen-refp It's starting, eh?
 
@Columbo yeah, the war has begun!
;)
 
@FilipRoséen-refp Darn, I was supposed to do some homework. :D
 
5:21 PM
@Griwes That explains your immature behavior
 
-2
Q: Any real world cases demonstrating reasonable performance improvement by using move semantics?

Hongxu ChenI've heard many words about the move semantics (essentially rvalue) introduced in C++11. In theory, it should bring much performance improvement due to the fact it avoids unnecessary copies. However, there have already been some optimizations for legacy code during compilation to deal with the i...

> I've heard many words about the move semantics (essentially rvalue) introduced in C++11.
Is he implying "move semantics" and "rvalue" are synonyms?
 
@rightfold It sure looks to me like it violates LSP. It supposedly implements the Map interface, but the Map interface is explicitly defined in terms of .equals(), which this explicitly violates (though I'll grant that this is a slightly different violation than Fred was citing).
 
@Columbo If what you are saying in the unconference chat is true, I'm quite older than you.
 
@Griwes How old are you, then
 
@Griwes haha, that can wait!
 
5:22 PM
@JerryCoffin I guess they're just hoping that you don't use it in contexts where .equals vs ref equivalence is required
 
@Columbo Turning 22 in August.
 
@Puppy They make it pretty clear that it's intended for use in situations where you care about equality of identity rather than just equality of values. It would certainly be possible to loosen the definition of Map to the point that it could accommodate both, but that's not how things are now.
 
dunno, it seems intuitive to me that there are users of interfaces who don't necessarily consume the entire interface and therefore could accept some subset.
so in some situations I could see that implementing an interface you don't implement could be of some limited value.
but I'd rather that that was done on a case-by-case basis rather than generically
 
I hate warnings so much.
 
@Nooble Because compilers aren't that smart.
 
user1804599
5:37 PM
What if it is neither true nor false???
 
Also horrible MSVC doesn't hide the warnings in such cases when you put assert(false); at the end.
 
@Nooble Because if you really want bool f(bool input) { return input; }, that's what you should write.
 
user1804599
@milleniumbug lol
 
user1804599
In C# you can have Booleans that are neither true nor false.
 
could be a null boolean
 
5:38 PM
@Nooble Solving that in the general case is the halting problem.
 
@JerryCoffin It was just code demonstrating it.
@milleniumbug :(
 
@deW1 erm, are you not aware of what app you are building?
 
@deW1 Why would you do it? It's doing the nice thing in one case, and the intrusive and annoying thing in the other.
 
5:41 PM
@AlexM. @milleniumbug because if I put it in a library I can't know before the whole point is to not rewrite it
 
@Columbo :D :D :D
That's wonderful, thanks!
 
@deW1 isn't it a dupe of this one?
 
@AndyProwl The _CONSOLE define could be used, but it doesn't appear automatically; you have to add it manually in to the project properties.
 
@deW1 Don't do it, it's horrible, and it has different semantics.
 
5:42 PM
@AndyProwl what would kill it
 
@deW1 The most-voted answer says otherwise though
 
I solved the NP vs P problem! At least for females: "No Problem" <=> "yes, there is a fucking Problem"
 
also proposes a second solution
@deW1 Kill what?
 
@Puppy The whole point of an interface is to say: "I support the following". If you don't want that, an interface is the wrong tool for the job. That said, you're entirely correct. This is part of why templates are fundamentally better than interfaces--with templates, the consumer defines the interface it needs. With Interfaces, the producer defines an interface it hopes will fulfill your needs.
 
@AndyProwl the problem is it's visual studio specific
 
5:44 PM
@JerryCoffin No. I mean C++11 introduced rvalue reference(sorry forgot reference previously), which makes move semantics possible
 
@JerryCoffin Yeah. You can't have infinite interface granularity, so it's easier for the consumer to define more than they need.
 
@HongxuChen You're responding to the wrong person, and not using arrows.
 
@deW1 Anyway it seems to me this is an XY problem
 
@milleniumbug sorry
Can somebody help deal with this question? I really hope to get an answer stackoverflow.com/questions/29879687/…
 
You should just let your function take another function to which the printing is delegated. Console apps would print to cout, Windows apps would call MessageBox
Or something similar
 
5:48 PM
do message boxes block the UI underneath when printing?
IIRC they do in windows forms
but not sure about the win32 stuff or w/e
you might want to consider that
(which is why you want to delegate output)
what I'm getting at is
printing to stdout is in no way equivalent functionally to showing a message box
 
Holy shit Yakk, can you be any more cryptic FFS
 
@HongxuChen Your question doesn't fit the SE criteria, so it's no good, but I'll bite - try using something more complex than std::vector<int> (for example, std::map<std::string, std::vector<std::pair<int, std::string>>>), and make it so it's actually used in your code (currently the entire program can be optimized out of existence, as the program has no side effects)
 
hmm
 
Pretty sure Yakk is trying to troll me.
 
­
13
I did it!
 
5:58 PM
wtf happened
 
Koala Magic™.
 
Unicode magic
 
holy shit nooble hacked so
god damnit jon skeet
 
Fairly well. Every week I'm earning the highest amount that is not taxable in italy.
Which should eventually sum up to something < €7.000/yr, which makes it non taxable.
 
@Nooble Nice.
 
6:00 PM
lol dat flag
 
How did it show?
I did
 
not me
 
Who got flagged?
 
jefffory did
 
what the fuck?
 
6:01 PM
jofffery
 
What happened.
 
I wanted to take a picture of the flag message.
 
@milleniumbug really it has no side effect. but I didn't use any optimizations (the elide constructors is turned on even with -O0 for both clang and gcc)
 
Did anyone take it?
 
user image
6
How the fuck did it end up between messages?
 
6:01 PM
Lol.
 
@Mysticial it's a hack
 
@HongxuChen rotfl benchmarking without optimization
 
@Mysticial Koala Magic™
 
How did it appear in the bottom left notification?
 
@milleniumbug i know that real benchmarking should use optimization. but i just cannot find a complex example. so only choose this case.
@milleniumbug you're right that std::pair might be helpful
 
6:03 PM
@HongxuChen Would you organize a competition where you tell people to run as slowly as possible and then you measure the time and then complain it's too slow? You wouldn't, would you?
 
@FilipRoséen-refp Cute.
 
forget that ever happened
 
@HongxuChen Write one.
@HongxuChen It's not the pair, it's nesting movable types with non-trivial copy construcotrs.
 
­
lmao
what is the explanation for that
 
:D
 
6:07 PM
@jalf I hope you don't mind my edit to your Design Patterns answer ;)
 
@milleniumbug could you please help write one since i'm not so familiar with c++ as you:-( thanks
 
@FilipRoséen-refp I really wish you’d put the code near the top though. Scrolling through the explanations is inconvenient.
 
@milleniumbug anyway, i'll think tomorrow since it's late in my time zone
 
user1804599
safePerformNoIO = id
 
@HongxuChen You can do it yourself easily. Just use std::map<std::string, std::vector<std::pair<int, std::string>>> fill it with lots of random data, measure the time it takes to fill it, and then output it all to std::cout. The last step is important - otherwise the entire filling could be optimized out. Also, don't measure the time for writing the data to std::cout.
 
user1804599
6:10 PM
grep '^import' | grep -v 'qualified' | grep -v '('
 
user1804599
Best Haskell linter ever.
 
Wait, there's ass cancer?
 
guys what is the equivalent for -l switch of GCC in CMake? I mean how can I do something like
gcc -o test main.cpp -lnewt
in CMakeLists.txt
 
@milleniumbug thanks, really appreciate it. will try later:-)
 
6:13 PM
@Columbo lol thansk for answer :D ((
 
@SaeidYazdani Ask on SO, goddamnit.
 
@Columbo dude its one line answer ....I already asked in SO :D
 
@SaeidYazdani Where?
 
1
Q: Adding library reference to NewT in CMake CMakeLists.txt

Saeid YazdaniI am trying to make a simple TUI using newt. I have installed the newt-dev package: apt-get install libnewt-dev and I beleive it is installed correctly since if I do build using gcc with following commands, it works just fine: gcc -o test main.cpp -lnewt But my simple code does not compile whe...

@milleniumbug it's one of those situations that for finding a simple answer, many hours should be spent on documentations
goddamit you guys down voted my question :(
ok bye
 
6:17 PM
> ~775k people reached
 
That whole "people reached" number is such bullshit.
 
daaaamn, I want such stats too.
I want to stroke my ego.
 
user1804599
Version 2.0: for f in src/**/*.hs; grep -Hn '^import' "$f" | grep -v 'qualified' | grep -v '('.
 
user1804599
I'm so awesome.
 
Post an answer to a popular question, get 5 upvotes and instantly "reach" a million people.
 
6:18 PM
I've reached ~2K people.
 
@Nooble Alienated/annoyed? Or what?
 
@wilx Both.
 
@Nooble My blithering idiocies have reached ~136k people
 
@Borgleader Nice.
 
Pfft submillion scrubs
 
6:23 PM
Pfft early adoption bonus tidal wave riding
 
@Nooble image not found, nub
 
I know :(
 
@LucDanton there is a link to skip the "newbie stuff" in the beginning of the document though, but maybe I should make a link that floats around the blog post to directly skip to the solution
 
user1804599
Imagine you could
 
6:35 PM
anyone familiar with reddit and/or hackernews? I want to post http://b.atch.se/posts/non-constant-constant-expressions/ but I'm not sure how one does it; do you need an account?
 
Yes on the former. I don’t know of a good place for it though.
 
@FilipRoséen-refp not for HN AFAIK
 
@LucDanton isn't there sub "subreddit" (or whatever they are called) related to C++?
@MarcoA. that's great news, thanks. I will finish my meal and then try to post it
 
user1804599
I need a new watch.
 
user1804599
My old one broke.
 
6:38 PM
@FilipRoséen-refp /r/cpp is a hive of scum and villainy
 
@LucDanton cool
 
known fact.
 
user1804599
 
the problem with that is that it assumes that there is a God sending punishments for such deeds.
 
user1804599
subsumption > assumption
 
6:48 PM
@wilx So Bach was a retard?
Also, flagged, since this is genuinely offensive.
 
user1804599
@Columbo Either yes, or indoctrinated, or didn't say otherwise in fear.
 
@wilx Look at you, all rational and shit.
 
user1804599
No, it's @thecoshman who's Rational, with his ClearCase.
 
user1804599
ClearCase is Rational and shit.
 
ClearCase is irrational.
 
user1804599
6:51 PM
So is π, but I like π.
 
I want a Opinion I code Anazro.com website what do you think of a video banner with sound go here anazro.com
 
@Tarson why the hell would you ask this here?
 
@Borgleader opinion
oh shit, i thought i was in the HTML chat my bad
 

« first day (1653 days earlier)      last day (3299 days later) »