« first day (844 days earlier)      last day (4089 days later) » 

6:00 PM
@CatPlusPlus typedef blahblah std::string is a concrete implementation.
 
@CatPlusPlus In the case of std::vector<bool>, I thought it actually was a specialization, since it changed the internal structure of std::vector<>...
 
@ShotgunNinja that one is specialiation
 
@ShotgunNinja This is an entirely different situation. vector<bool> is a specialization, that's intended to improve efficiency. Templates in general support specialization, so I can say "here's how to handle arbitrary types -- but if it's this special type, here's some special code just for that". You can also (with non-type template parameters) do the same for specific values.
 
@MooingDuck It's a concrete class, it's not a separate implementation.
 
@DeadMG he never claimed it was. I did (accidentally)
 
6:00 PM
The problem is with term "concrete"
 
indeed
 
@MooingDuck No, I did, but it was a while back.
Good catch.
 
yay - people like my question
 
Clicky?
 
6:02 PM
if I can persuade Bill to reddit it then I might actually get some real points out of it :P
-1
Q: Facebook skd 3.1 and iOs6 : error domain = com.facebook.sdk code = 5

a3116bI tried to send post from my iOs app, with app connected to Facebook i got this message could someone help me. Thanks Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x1cdf21e0 {com.facebook.sdk:ParsedJSONResponseKey={ body = ...

yuk
 
@LightnessRacesinOrbit I doubt that it'll do all that well on reddit (though I could be wrong). It might do a bit better on hacker news. The entry point to understanding what you're talking about (at all) is just to high to get a flood of votes from reddit though.
 
@LightnessRacesinOrbit It won't do well on r/programming because nobody who doesn't know C++ will understand it. (heck, I don't even really understand it myself)
But it might work on r/cpp.
 
user1125394
@LightnessRacesinOrbit ok, seems like c++ templates are the equivalent of java parametrized stuff
 
@JerryCoffin true
@Mysticial true
 
user784668
@cab No.
 
6:04 PM
I guess I'm just too damn clever to be popular *sniff*
 
user1125394
@Fanael ok :(
 
user784668
@cab Java templates are thin wrappers around (Object) casts.
 
@cab They initially look similar, but that's largely misleading.
 
@Fanael still. functionally....
 
user1125394
@Fanael and functions
 
6:06 PM
@LightnessRacesinOrbit functionally there is no way to stick a std::string into a std::vector<bool>. You can easily do the equivalent in Java.
 
@Mysticial r/cpp is basically this chatroom.
 
@cab Java's parameterised stuff is far weaker in basically every respect.
 
user1125394
yes that's what I guessed thx
 
@cab std::conditional<__LINE__%2, int, double>::type myvar = 0; //Java parameters can't do this.
 
6:07 PM
@DeadMG I still miss my templateclass<typename T, int I = 1> stuff when I do Java crap...
 
@MooingDuck okay
 
@LightnessRacesinOrbit Wish you luck. :)
 
@ShotgunNinja Oh yeah.
 
@MooingDuck ::type?
 
user784668
@LightnessRacesinOrbit You want everybody to downvote it?
 
6:08 PM
@Mysticial :D
 
that non-template shit sucks donkey balls.
 
@LightnessRacesinOrbit oops
 
user1125394
@MooingDuck what does it do on myvar?
 
@MooingDuck yay - good guess tomalak
 
6:09 PM
@cab It changes the type of myvar depending on whether the line on which it was declared was even or odd.
 
user784668
@cab It makes myvar an int on odd lines and a double on even lines.
 
@cab if it's on an odd numbered line, myvar is an int. If it's on an even numbered line, myvar is a double.
 
lol
 
user1125394
o man I prefer type inferrence,in that case
 
you two got opposite way arounds
 
6:09 PM
@DeadMG yeah, I realized I was wrong about what my code does.
@cab well sure, but the number of things templates can do is HUGE compared to generics. This was just a simple one-liner.
 
user1125394
std::conditional<__MY_SHIRT_COLOR__=='blue', int, double>::type myvar = 0;
 
user1125394
@MooingDuck ok thx for the example
 
Ell
@cab no strings in templates :P
 
@Ell eh, ish
 
user784668
@MooingDuck The number of things templates can do is equal to the number of things a Turing machine can do, to be specific.
 
Ell
6:12 PM
I wish turing machines had io :P
 
@Ell well, there's sortof an "o". Not much in the way of "I"
 
user784668
@Ell Real world implementations have I/O.
 
user1125394
thing I dislike the most is the need of those .hpp
 
ahaha my mum just found this
:D
 
@cab yeah, it can be irritating. They're addressing that soon.
 
user1125394
6:13 PM
but I guess IDEs can fill hpp for you
 
@cab not really, I don't know any that do that. (though they should IMO)
 
user1125394
template <typename T> T Fonction(){ return T(); // return the type }
 
user1125394
what is the type of T() ?
4
 
user1125394
it's weird
 
user1125394
int x = Fonction<int>();
 
user784668
6:16 PM
@cab T
 
@cab T() creates an instance of whatever class T is. If it's Fonction<int>() then T is int, and it creates an instance of int.
 
user1125394
an empty instance?
 
best approach?

string image = "(*@&";

vector<char> tokens_vector;
tokens_vector(image.begin, image.end());
 
@cab think of Fonction being a template function, and Fonction<int> as calling that template function, and it "returns" a regular function: int Fonction() {return int();}
 
@cab A value-initialized instance.
 
user1125394
6:18 PM
ok thx
 
@MooingDuck No, it value-initializes an int.
int() has a value of 0, but int i; does not.
 
@DeadMG I was trying to avoid being technical, but yeah, I was wrong.
 
aw you deleted your wrongness. now I can't see how wrong you were.
 
@LightnessRacesinOrbit The history is still available.
But if you can't see it, here it is:
> yeah, it constructs an int.
 
@EtiennedeMartel Only if you're an owner, IIRC.
 
6:20 PM
@EtiennedeMartel no it's not
maybe only owners can see deleted messages
 
Would you find it useful to have a tuple-like type that identifies element by their type instead of index? I think it should look something like this. (*fix)
 
@EtiennedeMartel Fail.
> yeah, it default constructs an int.
 
@EtiennedeMartel oh, boring
 
default-construct being the key wrong here.
 
aha
okay still boring though
 
6:21 PM
@StackedCrooked prevents tuples with multiples of the same types.
 
@MooingDuck: Be wronger next time, please.
 
never promised it would give you a blowjob
 
@MooingDuck See the sample code :D
 
@MooingDuck do you have a second?
 
Fuck me I'm so confused and frustrated by this PHP vs Ruby vs Python war...
 
6:22 PM
@StackedCrooked not bad
 
@Jeffrey When, where, with what?
 
@StackedCrooked your code is nice at least
 
@StackedCrooked oh hey, strong typedefs. retort: struct book {unsigned long ID; std::string Title; std::string Description;};
@user1690130 I still don't know perl, so I probably can't help you
 
still only viewed 40 times :( 9 upvotes and 2 favs out of that, though.
come on internet
 
@ShotgunNinja, bad people from this chat made me hate PHP, then made me think about Python, then allowed me to think about Ruby and now every hour I think I've decided which one to pick.
 
6:23 PM
@MooingDuck yeah pretty much at this point
 
@MooingDuck i know but you are also much better at reading technical things than me an dfiguring hout technical things thn me
 
@LightnessRacesinOrbit You can create a struct which can be iterated, introspected or serialized automagically. (cc @MooingDuck)
 
Ell
@StackedCrooked that's pretty cool
 
isn't there some kind of implicit synchronization on kernel-mode calls?
 
@MooingDuck i have some upates
 
6:24 PM
@ShotgunNinja, and then obviously I retract my opinion. Over and over again in while (true) loop that seems to never end.
 
@Jeffrey that's UB
 
user1125394
templates parametrization works only with types?
 
That's so sweet
 
@cab values as well, but only at compile time
 
6:25 PM
@LightnessRacesinOrbit, UB...?
 
@cab integer value also works (if they are compile-time constants)
 
user1125394
@MooingDuck so it's like pattern matching?
 
@StackedCrooked I think it's been extended to any compile-time-types, but I'm not sure
 
Dunno.
 
@cab what? I can't think of any way it's like pattern matching.
 
user1125394
6:26 PM
sort of
 
@user1690130 is like a support character, to @MooingDuck, @CatPlusPlus, and others' carries and bruisers. goes back to playing LoL
 
int data = factorial<13>::result; is valid C++, results in a compile time constant value.
 
@ShotgunNinja, and then I say: let's use a framework like Rails. Then when I start to learn a framework I think: "Where the fuck does all this magic comes from?" and switch back to thinking about CGI and then I realize is a bad Idea, and the switch back to CGI with FastCGI in mind, and then I realize its a bad idea and so on...
 
@LightnessRacesinOrbit that's not helpful.
 
6:27 PM
@ShotgunNinja wait, what's wrong?
 
@user1690130 Nothing, hush.
 
Also, did I mention I probably failed algorithms exam again?
 
@LightnessRacesinOrbit, what does UB stands for?
 
@Jeffrey "Undefined Behavior" It might have appeared to work, but it might not work next time.
 
@MooingDuck There's a proposal about that for C++14, I think, but not sure.
 
6:27 PM
@MooingDuck I'm aware
 
@user1690130 Also, this.
 
Ell
@MooingDuck what is a compile time type?
 
@BartekBanachewicz Dude... I failed my Algorithms course because of an incomplete I never bothered finishing, and now I have to stay another year to finish it.
 
@MooingDuck, I think you have explained that to me few weeks ago. Where's is my mind?
 
6:28 PM
@ShotgunNinja you're lame
 
@MooingDuck int data is never a compile-time constant value.
 
Ell
I mean, will the user be able to write their own compile time types?
 
@Ell You can now. Give a UDT a constexpr constructor and it's all good.
 
@ShotgunNinja LoL?!
 
@BartekBanachewicz I had 6 courses (18 credits), a girlfriend, a job, and an apartment to pay for. I got 4 A's, a C, and an F*.
 
6:29 PM
@ShotgunNinja doesn't matter. you suck
 
Oh, I ended up getting shingles that trimester.
 
@DeadMG ooh good point
 
I know I suck.
 
@Jeffrey Where is my mind?
 
I suck too
 
6:29 PM
@LightnessRacesinOrbit Aren't you going to congratulate me on the supreme quality of my UB tutorial?
 
@Ell types with constexpr constructors or something, not real sure
 
You don't have to remind me; I have the extra year at MSOE that I can't seem to get away from.
 
@DeadMG Did you upvote my const question?
 
@EtiennedeMartel je veux apprendre tes avis
@LightnessRacesinOrbit NO
 
@LightnessRacesinOrbit Yes.
 
6:30 PM
@DeadMG no
 
@DeadMG Then, congratulations.
 
lol
 
@user1690130 DIAF
 
I lied :P
 
@DeadMG So did I!
 
6:30 PM
@LightnessRacesinOrbit Seriously, plonk that fucker.
 
@LightnessRacesinOrbit he is so great
 
@LightnessRacesinOrbit is that like DILF ?
 
Nah it is good
 
He was annoying only the first day
 
i r the WinRAR™
 
6:31 PM
Perhaps it doesn't make it immediately clear that UB is generally responsible for what novices call "my code is crashing"
 
now he's more like a minion
 
user1125394
template <int n>
class Fact {
public:
  static const int val = Fact<n-1>::val * n;
};
class Fact<0> { public: static const int val = 1; };
 
And leaving the exercise undefined seems dangerous; a valid outcome is that some reader replaces the tutorial with nasal demons
 
user1125394
was meaning that ^ by pattern matching
 
Which leads me to my final point - "commonly referred to as"? really?
 
6:32 PM
@LightnessRacesinOrbit As far as I know, it is. Bjarne used that description long ago and it's kinda stuck.
I think it was Bjarne, anyway.
 
Sounds right
> Recognized shorthand on the Usenet group comp.std.c for any unexpected behavior of a C compiler on encountering an undefined construct. During a discussion on that group in early 1992, a regular remarked “When the compiler encounters [a given undefined construct] it is legal for it to make demons fly out of your nose” (the implication is that the compiler may choose any arbitrarily bizarre way to interpret the code without violating the ANSI C standard).
> Someone else followed up with a reference to “nasal demons”, which quickly became established. The original post is web-accessible at groups.google.com/groups?hl=en&selm=10195%40ksr.com.
"John F. Woods" did it.
Also, fuck you Google for intercepting '/' when I want to search for text within your page. FUCK YOU.
 
I can't live anymore. This PHP vs Ruby vs Python war is growing inside of me, like a fucking unstoppable beast rolling in my mind womb. It's taking its power by my weakness. It's growing so fast that I don't even know what's going on. I keep earing bombs exploding in my mind "You don't even have to install or configure PHP, it's ready to use", "Python is the language Google adopted, I mean it must be something!", "Ruby is so sexy and pure and utopistic... aww god" and then the enemies attacks:
 
@DeadMG anyway, my point is, I dislike the expression :P
 
lol
@Jeffrey Well, really, it's pretty clear.
 
Ell
@Jeffrey well obviously php is out of the question
 
6:35 PM
PHP is the worst language ever (and Java is the worst language ever designed)
and then Ruby is just not very good
Python's fine, though
therefore Python is clearly the winner.
 
Ell
what makes python better than ruby?
I know python is better for namespace alias
 
@Ell everything
Ruby sucks
 
@Jeffrey Well, you can start by removing PHP.
 
Ell
@BartekBanachewicz why?
 
@Ell Because I said so, duh.
 
6:36 PM
@Ell it tries to be good at everything
 
also, YAY, finally, it's new Community tomorrow.
those fucks are so late :(
 
user142019
@BartekBanachewicz you suck.
 
Ell
@BartekBanachewicz what is it bad at?
 
@Ell everything
 
user142019
@Ell sucking cock.
 
user1125394
6:37 PM
@cab printf("fact 4 = %d\n", Fact<4>::val); actually it's computed at compile time not run time
 
"PHP sucks, there are thousands of different and contradictory conventions", "Ruby is so hard to configure and you little bitch are not that sure how to do it, right?", "What? I have to install a MySql connector? The fuck is that?"
 
user142019
MySQL is terribru.
 
I'm undecided about Ruby. There are parts I like and parts I don't like. Currently I don't have enough knowledge and/or experience with the language to make a verdict.
 
DIAF = DILF
 
user142019
I like Haskell and Erlang.
 
user1125394
6:37 PM
same
 
user142019
I might write a porn site in Erlang.
 
@Zoidberg We probably need that. There does seem to be a serious shortage of porn sites in the world.
 
user1125394
@Zoidberg use cowboy for that
 
user142019
@ScottW If one hundred six-minute calls are received then the total traffic in that hour is six hundred minutes or 10 Erlangs.
 
user142019
The erlang (symbol E) is a dimensionless unit that is used in telephony as a measure of offered load or carried load on service-providing elements such as telephone circuits or telephone switching equipment. For example, a single cord circuit has the capacity to be used for 60 minutes in one hour. If one hundred six-minute calls are received then the total traffic in that hour is six hundred minutes or 10 Erlangs. In 1946 the CCITT named the international unit of telephone traffic Erlangs in honor of Agner Krarup Erlang. Traffic measurements of a telephone circuit When used to represent c...
 
6:38 PM
@DeadMG, fuck yes! Community airs tomorrow...
 
Ell
@BartekBanachewicz so... nothing? ;)
 
user142019
@cab of course what else.
 
user142019
I always use Cowboy.
 
@Jeffrey Make it simple: ignore all of those.
 
Use basic.
 
6:39 PM
@JerryCoffin, and then code the website in static HTML?
 
user1125394
this video youtube.com/watch?v=uKfKtXYLG78 is the best promotional vid for erlang jk
 
@Jeffrey Don't code a web site. There are too many already.
 
user142019
@ScottW a billion.
 
@JerryCoffin, or better: learn Objective C, the Win API and the linux API and make a great web (but on desktop) app that connects to the database?
 
@Jeffrey NOooooooo .... not Objective C. Anything but that!
 
user142019
6:41 PM
s/Objective C/Objective-C/
 
user142019
@JerryCoffin nah.
 
user142019
Objective-C > PHP > Java.
 
If you want an app that connects to a database, then write that. Awful as it is, C++ will work perfectly well to do that on any OS worthy of attention.
 
user142019
Or just be sane and use Haskell or another high-level language that doesn't suck balls.
 
user142019
Such as Erlang or Python or C#.
 
6:43 PM
@Zoidberg You've failed to prove your point. Instead, just you've shown that PHP and Java are really nothing.
 
user142019
They are really nothing.
 
@JerryCoffin, and NO PHP and NO Objective-C and NO Ruby and NO C and NO everything except for Assembly and maybe C++. This chat taught to always say "NO"... that's why now I've mental problems and can't sleep. You should all feel bad.
 
Ell
aghh I suck at basic stuff!
(and advanced stuff)
 
user1125394
template <int n>
void Fact { return n*Fact<n-1>();};
void Fact<0> { return 1; };
 
user1125394
is this possible?
 
6:46 PM
@Jeffrey I can't imagine where you get that idea. We say yes to Haskell, a grudging "okay" to C++, and only pick on things that really suck. If anybody is to feel bad, it should be the people who release such monstrosities on the world.
 
user142019
C++ is also bad.
 
user142019
I agree.
 
Ell
Most things are good
 
@ScottW Python is not bad. C# is not quite horrible, but definitely not great either.
 
user142019
Nah. Most things are bad if you have high standards.
 
user142019
6:47 PM
One huge plus of C# is LINQ.
 
user142019
It's the main reason I love it.
 
Ell
Good.
 
user142019
And I think C# code looks nice.
 
By suggesting me Haskell (Haskell (/ˈhæskəl/)[17] is a standardized, general-purpose purely functional programming language) I guess I should learn to say No to OOP too,right?
 
user142019
@cab no; that's a syntax error.
 
user142019
6:50 PM
@Jeffrey use OOP when it's the best tool for the job and don't when it isn't.
 
user142019
Simple as that.
 
user142019
OOP in Haskell! :D
 
Ell
Aghh gawd I'm suck a doofus. How would you represent a puzzle where peices fall from the top - sort of like tetris. But when 4 of the same colour are in a row they can be popped and the peices on top fall down. A 2d array of Colour enum isn't good enough, because peices fall down in pairs which are attached - a 2d array wouldn't let me know which cell belongs to which pair. (see puzzlepirates.com/content/images/Sailing.jpg) (sorry for wall of text - if it is?)
 
@Zoidberg, and when exactly OOP is not the best tool for the job?
 
user142019
Well, when there are better tools for the job.
 
6:53 PM
@Zoidberg, that answer is like cheating. "Why do you like the red color? Because I don't like all the others that much"-type of answer...
 
user142019
:P
 
@Jeffrey It's also entirely correct.
 
user1125394
@Zoidberg can I ask you how to make it work?
 
user142019
@cab Yes, you can.
 
Am I the only one that hate all the magic that comes with a framework, in general? And that feels that programming with a framework is like trying to create an artistic painting by taking a picture of something and print it? (I couldn't find a better metaphor)
 
6:57 PM
@cab someone already posted the correct version
 
user1125394
how to make it work?
 
user142019
I don't know.
 
user142019
But at least add () before the opening braces.
 
wait.. it was you!
 
user1125394
@LightnessRacesinOrbit it was with class
 
6:58 PM
oh, but a function version. well start from your class version and go from there
 
When did programming stopped being "Art" and became a "Tool"?
 
@Jeffrey It is both.
 
and refer to your C++ book on how to write functions
 
user142019
And use a correct return type.
 
user142019
And constexpr.
 
6:59 PM
@Jeffrey the same time YOUR MUM did
 
user1125394
@LightnessRacesinOrbit with class it's a sort of compile time stuff, where I'd like something run time
 
user142019
Then don't use TMP.
 

« first day (844 days earlier)      last day (4089 days later) »