« first day (840 days earlier)      last day (4094 days later) » 

2:00 AM
@ŠimeVidas: you don't use [l, u] for closed ranges and (l, u) for open ranges?
 
I think he's using set builder notation
it just looks weird without TeX
 
@AndyProwl The standard notation is for open ranges in Croatia is <l,u>
 
@ŠimeVidas: interesting
 
but I've seen (u,l) too
 
@AndyProwl In Portugal we use ]l, u[ for open ranges.
 
2:01 AM
Ok, Chinese is next :-)
 
( is open [ is closed for us
 
Or [l, u[ and so on.
 
there's also set builder notation which is ugly
In set theory and its applications to logic, mathematics, and computer science, set-builder notation is a mathematical notation for describing a set by stating the properties that its members must satisfy. Forming sets in this manner is also known as set comprehension, set abstraction or as defining a set's intension. Although some simply refer to it as set notation, that label may be better reserved for the broader class of means of denoting sets. Building sets Let Φ(x) be a formula in which x appears free. Set builder notation has the form {x : Φ(x)} (or {x | Φ(x)} according to the ...
 
Dammit, why do I keep swapping the ends.
 
Why all these different notations? What were they thinking? :-)
 
2:02 AM
@R.MartinhoFernandes: hm, we do use the same notation in fact. don't know why I mentioned (l, u)
 
I have seen () notation in several places. I assume it comes from some Anglophone country.
 
oh, I know. Too much reading of the C++ standard probably
they use that notation
 
'ello again guys
Anyone good with SQLite here?
 
main.cpp:9:43: error: 'put_time' is not a member of 'std'
main.cpp:12:43: error: 'put_time' is not a member of 'std'
lol
 
What's funny?
 
2:11 AM
put_money and get_money work fine
arguably more useless
>_>
well I shouldn't say works fine
it doesn't work at all but it compiles
 
lol
I'm -1ing this just because putting untested code into production is just... WTF. — R. Martinho Fernandes 11 secs ago
 
Damn. I can't remember what I wanted to test right before I fell asleep.
 
2:28 AM
Something you might find interesting: currenty in MSVC, enum: bool is completely equivalent to enum: signed char. I opened a bug on MS Connect and got the answer that they decided not to fix the issue at this time.
 
Odd, I was under the impression that when you had a template class, say S<T>, and you were defining members, you had to provide template arguments all the time, but apparently S<T>::S(const S &){} works (as in the plain S in the parameter list). TIL
 
@chris S is the injected class name in that scope.
 
Are there any other cases like that besides delegating constructors that work? It's sometimes a nice saver for time/space.
 
The name is always available in class scope.
 
@chris Assignment operators?
 
2:33 AM
Though those arguments are a bit pointless when defining outside of the class.
 
That's always in class scope.
 
@AndreiTita, Got that one ;) I guess it makes sense when it's for defining members of the class. That's what you mean, right?
 
@chris I... think so.
Is there a way to use template argument deduction for non-type arguments?
 
No.
 
Thought so.
 
2:40 AM
This seems like something I would have learned from reading some good templates material.
 
I actually learned that by just writing code in the most natural way and observing that it compiled.
 
What I need to do is watch STL's video on name lookup.
And the others in that series that I haven't watched.
 
I fucking love you guys
 
@Crowz ++number_of_times_@Crowz_appears_to_be_either_drunk_or_high
 
printf(number_of_times_@Crowz_appears_to_be_either_drunk_or_high)
ERROR type out of range
printf("%d", number_of_times_@Crowz_appears_to_be_either_drunk_or_high) actually
 
2:50 AM
There are only so many values you can fit in an int.
 
Well over 2^54
 
>18,014,398,509,481,984
 
Yeah what that guy said
 
@sehe I mean the bewilderment regarding the defectiveness, yes. Like looking in the mirror, pulling your lips away from your mouth, and realizing I HAVE A SKULL IN MY HEAD. — fluffy 2 hours ago
 
I'm like addicted to the review now
even though I can only see two categories.
 
2:59 AM
@sehe Amazing how many people seem to find that mesmerizing (the skull thing).
 
It's the first time I've ever heard it said
 
I've encountered that before.
 
Would this be better as a comment?
0
A: Check if string doesn't contain another string

androidWorkerTheEighthcan this be done without having to using a LIKE or CHARINDEX(N'Apples', someColumn) = 0? Just seems like unnecessary overhead for such a simple (and common) necessity?

 
-1
A: Can not get array in while loop to work

Volkan İlbeyliI once used a similar structure for that purpose, reading line by line until i get to the end of the file. I used something like this, and worked perfectly, try using this: ifstream in; string line; in.open("filename.txt"); //open file if(in.is_open()){ while(in.good()){ ...

:(
@CCInc Yeah, or not posted at all.
Flagged it.
 
Can't you use fread and strtok to do that? C++ has the C libraries, right?
 
3:06 AM
Is while(getline(fstream_object)()) do_stuff() the correct way to read from a text file?
Er, assuming I want to read a line at a time ofc.
 
@AndreiTita, Kerrek has his overly complicated, perfect solution, but I find while (readSomething()) to be sufficient in most cases.
Maybe not overly complicated. You can't complain about something that's right.
 
I noticed that my code currently reads until eof() which is not technically correct and I wanted to replace it with something better.
Well actually I remembered I had that code because of the linked question.
 
@Crowz Yeh but you better not use them
@AndreiTita Yes
 
@LightnessRacesinOrbit why not use them?
 
@LightnessRacesinOrbit Why does it work? does basic_istream have an operator bool() ?
 
3:12 AM
@AndreiTita, An explicit one, yes.
At least in C++11.
 
Right, ok.
 
Poor 03 was an operator void *().
And because of that, as I saw someone point out, this was possible:
std::cout << std::cout;
 
causing cout to implode on itself j/k
 
@AndreiTita Basically.
 
Why does that still work in C++11?
Oh, look what I found in MSVS's code.
__CLR_OR_THIS_CALL operator void *() const
	{	// test if any stream operation has failed
	return (fail() ? 0 : (void *)this);
	}
Nothing I can see about operator bool(). Guess they haven't gotten around to it, and I bet GCC as well.
 
3:28 AM
0
Q: Why do streams still convert to pointers in C++11?

Lightness Races in OrbitThe canonical way to read lines from a text file is: std::fstream fs("/tmp/myfile.txt"); std::string line; while (std::getline(line, fs)) { doThingsWith(line); } (no, it is not while (!fs.eof()) { getline(line, fs); doThingsWith(line) }!) This works beacuse std::getline returns the stream ...

:)
I shall now look up all the code
 
@LightnessRacesinOrbit, I was pondering as to whether I should ask. No need to any more :)
I think it's just the implementations not updating it yet.
I tried it with Clang 3.2, GCC 4.7.2, GCC 4.8.0, and Intel 13. All do it.
And MS November 2012 CTP and GCC 4.7.2 using my own tools, not LWS.
 
@chris: Fancy adding that in as an answer? :D
 
I wouldn't know for sure until I find it in GCC and Clang's code, though the MS one is a bit compelling.
 
The robot is going to be interested in this:
> Boost.Locale security notice - Boost.Locale library in Boost 1.48 to 1.52 including has a security flaw. boost::locale::utf::utf_traits accepted some invalid UTF-8 sequences.
 
Oh, found the same thing in GCC.
 
3:33 AM
@chris beat you to that one
 
Doing D3D stuff makes me feel weird.
 
@sehe Someone has to be, I suppose.
 
My code is always yelling at me.
 
@LightnessRacesinOrbit, Oh, fun. I was looking through my files :p
 
@EtiennedeMartel Haha.
 
3:36 AM
@chris, how did you test that in clang?
 
@EtiennedeMartel I may stick around later tonight, you can try and ping me if you want to do some MCing.
 
@rici, Liveworkspace has it as an option.
And llvm.org/demo.
 
@chris, or more specifically, do you mean clang + gnu lib or clang + clang lib
 
@LucDanton Alright. In the meantime, I'm dealing with some angry structs.
 
@rici, I honestly don't know which LWS uses.
 
3:37 AM
me neither, but it is surely a library issue
 
Yeah, I'm not sure how much of that is shared or what goes on to tie it with the compiler.
 
i think its 100% library
 
I've never quite known where MinGW fits in with GCC compared to an implementation found on Linux.
 
i've never used mingw
 
And how they can map library features to compiler C++ updates support.
 
3:40 AM
i think i've compiled three programs on windows in my life
 
Anyone here do anything in C/C++ and CGI? I'm interested in what problems you are using it for.
 
a default clang install on linux uses the system library
you need to separately download libcxx and point clang at it to use it.
 
@LeviMorrison, I was going to get around to it lightly sometime. There was a chapter in the book my class used on it, but I had no idea about how to set it all up at that time.
 
and on deb/ubuntu, the standard library and the compiler are independent packages, so they can be upgraded independently.
 
@LightnessRacesinOrbit, The funny thing about your question is that it's somewhat equivalent to I have the latest version of MSVC, which has C++11, but UDLs aren't working.
The difference is that this is such a small thing that I expected them all to have it done, so it confused me a lot.
 
3:45 AM
A quick look at libc++ indicates that it is up to date -- it has an operator unspecified-bool-type (which looks like it's really operator bool) and an operator!, but I don't see an operator void *.
 
@JerryCoffin, I guess that answers which version LWS uses then, because it still works on there.
 
@chris Probably -- though I suppose there could be an older version of libc++ that had it, and they could still be using that. libc++ is new enough, however, that I'm not at all sure it's ever had it.
 
@chris, libcxx gives me an error on that. It has an explicit operator bool, no operator void*
chris, they probably use libstdc++
actually, it's easy to test.
 
User-defined literal.
 
3:57 AM
right
@JerryCoffin Why would that which looks like a header not have the actual definitions for things?
 
someone downvoted my question :(
 
libc++ puts tuples in order; stdlibc++ puts them in reverse order
i mean, libstdc++. it's late. i should go to be.
 
@rici, Oh, I see.
 
so they're using libstdc++ for both
 
4:00 AM
@LightnessRacesinOrbit I think it does -- it just uses a lot of macros for compiler compatibility.
 
Is it just me noticing this... or does bootstrap often come off looking almost exactly like twitter whenever implemented?
 
@JerryCoffin Can unspecified-bool-type be macro'd?
The question of why something is this way or that way in a language make for the worst threads on SO. Very few people, if any, will know why. Bad question. — Nocturno 1 min ago
What's he on about?
 
Nobody here does SQLite?
 
@LightnessRacesinOrbit, I interpreted it as something like Why did they decide on not adding an int ctor to std::string for length, but I could be wrong.
Most of those ones do turn out being bad questions, including my one about why string multiplication isn't defined to repeat the string that many times, if anyone remembers that.
 
My answer got downvoted too
I think people just get jealous, or something
That or they're too fucking stupid to understand what's going on
 
4:06 AM
The combination of the change being so small and all of the tests I ran doing the same thing is what did this one in for me as being different from my previous UDL example.
And a downvote on this, too! What's going on? What's wrong with this answer, pray tell? I know that it answers the question, because I wrote the question. — Lightness Races in Orbit 1 min ago
That last sentence is priceless.
The only way it could be wrong is if someone posts a correct answer.
I think there's very low likelihood of anything different seeing as how we looked through implementations.
 
they must preprocess those include files.
 
Just newbies not understanding the question, getting high and mighty because a high-rep user posted it and they think that they can "get one back"
 
lol, another downvote.
 
4:10 AM
I just wish they'd be better explained.
 
Or explained at all...
 
Well, the first sounded like a misinterpretation. If it isn't, I'd need a better look or a better explanation.
 
Yeah, Nocturno misinterpreted, mainly by not reading properly. Then didn't come back when called on it.
This is why SO really gets my goat sometimes.
 
Sometimes I feel like the attitude you'll get is random.
 
"view my repositories" sounds kinda dirty
 
4:12 AM
I've seen the same question asked approximately the same way and have one get quite a few ups and the other a few downs.
 
All the obvious shit tends to get a lot of upvotes
 
I guess it's a skill figuring out when the best time to post it is.
 
Because "you're helping"
 
The one that annoys me most is getline skipping.
 
I'd say 90% of SO's users nowadays don't understand the concept of compartmentalisation, and of personal responsibility.
 
4:14 AM
Every time, it has tons of duplicates in the related questions.
And searching "getline skipping" retrieves tons more.
 
Yeah
I think it might be time to give up on the dream of a clean and organised SO Q&A backlog, and just let the shite do its thing.
 
I have to admit, it feels kind of weird addressing the OP as "the OP" to a third person when the OP is active in the discussion.
 
@chris I always do it just to maintain the semantics. If you need a practical reason, nicknames can change.
 
@LightnessRacesinOrbit A compiler can (but isn't obliged to) accept it. The key is "other implementation defined characters" in 2.11.
 
@JerryCoffin heh, okay
I can't find its definition anywhere, though
 
4:19 AM
@JerryCoffin, are you talking about unspecified-bool-type? a compiler can't accept '-' as part of an identifier.
it could accept &emdash;
 
I can use letters that look exactly like other letters in Java right?
I have plans if I can do that. I found it harder to obfuscate than C++, what with its lambdas and digraphs.
 
yeah, "look like"
but not the same letter
 
It's always good for a "how can this possibly work" question to someone, if they enjoy that type of thing when you go a bit further than normal.
 
Do you guys think this looks half decent as far as a basic layout?
 
Sorry, I can't find the .layout file anywhere.
 
4:23 AM
@Crowz I want to click in the logo area because it looks like a big textbox. And it's taking up too much space. Otherwise, sure....
 
@LightnessRacesinOrbit I am planning to make that whole area a 3D rendered type of scene or a flash animation
 
I agree that it takes up a whole lot of the page, and I like the top to be what I want to read first, maybe with a small bar above it.
Generally, I like the section I'm reading to be near the top of my screen at all times. It might be silly, but that's me.
I'm no expert on visual design or anything.
 
@chris Neither am I haha... I don't know what to write though
"hi. I'm crowz. I annoy people in Lounge<C++>"
 
@JerryCoffin, there's actually a lot to be said for syntax colouring. That would have made it clear that "unspecified-bool-type" is part of a comment.
 
@Crowz that's my job
 
4:28 AM
A challenger appears
 
The actual code is further down, where it's `_LIBCPP_ALWAYS_INLINE
_LIBCPP_EXPLICIT
operator bool() const {return !fail();}`
 
Lol, nice find. @LightnessRacesinOrbit, want to see for yourself and update the answer?
 
@rici Yes there is -- I missed that completely (though there is also a place that it gives it as operator bool, which I'd guess is not a comment). But yes, browsing files online like that is horrendous in many ways.
 
@JerryCoffin, yes, that's the actual definition which i c&p'd up there a bit.
 
Which Boost libraries do you guys find you use most often with C++11?
 
4:32 AM
it's a very long comment.
@chris, regex
 
I really need to get to know and love Boost better, but there are so many libraries that it's hard to start recognizing when they'd be helpful to my code.
 
@chris Far fewer. With MinGW, I still use Boost regex, because their own regex is completely broken. With VC++, have used Boost very little for a while now.
 
@rici, Ah, yes. That's good for GCC.
 
@Crowz image on this page is massive, 1MB image is waste when it's scaling it down
 
As is the thread one when you have Windows, though there is a GCC 4.7.1 that has <thread> working.
 
4:34 AM
@doug65536 oh yeah hah I forgot that existed
 
nice looking site though
 
I found the most annoying site today.
 
I'd almost be tempted to write a conforming implementation of regex for gcc, except that there's flat-out no way I'm ever going to release code under GPL, and I'm pretty sure they won't accept it as "free" unless I use a much more restrictive license than I'm willing to consider.
 
You found geocities?
 
It had dropdown menus, but tooltips over those menus when you went to hover over the drop down header.
 
4:36 AM
@JerryCoffin they wouldn't fork and adopt a PD implementation? imposing their licence "on top"
 
@chris, i also use boost::variant quite a bit, and boost::optional
 
Ah, I found it in my history. jeopardy.com
 
@doug65536 Hard to guess -- but if there were going to accept something with a decent license, they could just use Boost regex and be done with it.
 
@rici, Oh yeah, optional is useful a fair bit, and what do you use variant for specifically?
 
boost regex is not 100% implemented though
 
4:38 AM
@chris, tagged unions
 
I don't know how much is required for compliance
 
@doug65536, yeah but that's about 95% more implemented than libstdc++
boost regex doesn't need to be compliant. it's not in std::
 
@doug65536 Maybe not 100%, but definitely a lot closer than what they have now. It's entirely usable, where gcc's current implementation is a joke.
 
@rici, Ah, I haven't found the need to have any yet. My problem is my such limited range of what I use C++ for, so all of the common uses of things don't apply very well to me.
 
yes, then you're probably right Jerry, gcc probably won't adopt any implementation
 
4:40 AM
And it's not like I use other languages for what I don't use C++ for regularly/at all. It's just taking time to try new things and get acquainted with them and I haven't been programming for so long. I look forward to working on that.
 
@JerryCoffin, I scraped together a partial implementation based on re2, but there's lots of stuff i don't care about, and it was just for me.
 
This any better or just stupid?
 
but it only took a few hours to implement what i needed.
 
gisthub?
(looks nice)
 
@rici Yeah -- at least if memory serves, RE2 would be a pretty poor foundation for the standard library. I don't recall it implementing ECMAScript REs, which the standard library requires.
 
4:47 AM
@JerryCoffin: correct.
 
@Crowz, I definitely like the bar better up there.
 
@chris Certainly seems to be a more popular style
 
I'd probably have to see a further version of the more noticeable areas of your site to comment on them.
 
@JerryCoffin: it's probably not that difficult to add ecma features to the ones re2 does support, though. And it's got a reasonable license and contributor policy
 
Honestly I have no idea what to put on a professional website.
 
4:50 AM
Normally, I can visualize things in my head and move them around pretty easily, but I'm finding it harder to do so after an exam week with no exams.
By the way, is SO a fair addition to a programming job interview package? I was wondering how people on that end valued SO, whether a waste of space, or a small benefit.
 
I dare you to find any non-programmer who's actually heard of it
 
in C#, 1 min ago, by CC Inc
hu hu hu thats cool win++, win--, ctrl+alt+i
try that ^
 

« first day (840 days earlier)      last day (4094 days later) »