« first day (826 days earlier)      last day (4125 days later) » 

8:00 PM
@R.MartinhoFernandes that can't be real
 
That I would draw two arrows in opposite directions? I swear it is real.
@sbi I can't tell 1 kilogram from 2 kilograms.
Only heavy from heavier.
 
you can't do lots of things you never bothered to learn
 
I think 1 kilogram is somewhere around normal.
"normal" should have been "medium".
 
sbi
@R.MartinhoFernandes Well, in that case let me tell you: One kilogram weighs exactly 1Kg. There you go. Please try to remember.
 
8:03 PM
1 kg = 1 L of water @ 4°C. they didnt just pick a random number :)
 
sbi
@R.MartinhoFernandes Well, I was talking about the precision needed to weigh popcorn.
 
@sbi erm, shouldn't that be a small 'k'? :P
 
sbi
@Griwes No, look closely. It's a capital one. I'm not sure if that's right in English, but that's what I wrote.
 
K = degrees kelvin. k = kilo
 
8:06 PM
@Zoidberg secretly lives in Washington
 
...fixed to show what I meant more transparently.
@doug65536 If it is the same in English as in Polish, those are just kelvins. Not degrees.
 
almost crash in a washington cloverleaf lately? I always hated their onramps
 
Yes, I was right! :P
 
can someone please help me out here
i got two iterators
 
It's snowing out there.
 
8:08 PM
@RyanFung pastebin it
 
first and last.....i am going do first ++ but i do i know when it passes last without the std:: distance
 
Anyway, @sbi, one kilogram cannot weigh 1 Kg (kelvingram or how-to-call-it), and it looks like quite abstract unit, with no sane physical interpretation.
 
i tried if(first>= last)
but it gives me error
 
eh? last points PAST the end of the range, so you increment until the iterator is EQUAL TO last
 
@Griwes Actually, it "Kelvingrams" occur in some physical concepts. Sec (need to translate this crap from Portuguese).
 
8:09 PM
@R.MartinhoFernandes ...do they? o.O
 
see i might increment by two everytime
so it might go pass last
how do i check that?
 
I can hardly think of anything they could represent.
 
before you increment, make sure +1 is != end
you'd need to check if iter+1 == end || iter+2 == end
if you allow odd numbers of items
 
look at this case: 1 2 3
 
@Griwes Specific heat capacity is expressed in J/(kg⁢K). (<- look there is an U+2062 ɪɴᴠɪsɪʙʟᴇ ᴛɪᴍᴇs there!)
 
8:11 PM
if first loop i do first ++
which is at 2 pos
so if i do first = first + 2
now i am pass last but not == to it
so therefore it is >= last...but this line won't work
 
@R.MartinhoFernandes erm, J/(kg*K).
 
for (auto i = x.begin(), e = x.end(); i != e && i + 1 != e; i += 2) {...}
 
@Griwes Yes, and AFAIK, that's written "Joule per kilogram-Kelvin".
 
Non-capital 'k' for "kilo". That's what I started this whole kelvingram thing - misuse of capital 'k'.
 
@Griwes Oh sorry.
ɪɴᴠɪsɪʙʟᴇ ᴛɪᴍᴇs > *
 
8:14 PM
Yay. Without that, we could get into recurrence.
Because it would become gK^2 and we would start looking for physical interpretation of that unit.
 
@Griwes hehe, can't help there.
 
i can't do += 2
 
@RyanFung std::next
 
it says binary '+=' list doesn't define
 
8:16 PM
Still, J/(kgK) is more like (J/K)*(1/kg) than J*(1/kgK).
 
@RyanFung Only random access iterators support that.
 
omg
so i can't do first + 1 in my list
what can i do?
 
correct
 
2 mins ago, by R. Martinho Fernandes
@RyanFung std::next
 
but i want first + 2
 
8:19 PM
Sigh
 
so i need to do std::next two times?
 
3 mins ago, by R. Martinho Fernandes
http://en.cppreference.com/w/cpp/iterator/next
 
...
 
anyone ever write like, a 50 line program, then end up extending it to 500+ lines to make it cooler?
 
There is even an example of that in that page.
 
@RyanFung std::next(it, 2)
 
@RyanFung Do you seriously had to ask that question?
 
i am sorry
 
Reading is not enough?
 
in their example next(it,2) gives me 3 ,4
how come?? they sort it for me?
since the list is 3 1 4
shouldn't it return only 1 4
 
8:21 PM
Ooops, the example is wrong :/
I'll fix it.
No, it's correct.
 
@R.MartinhoFernandes No, it's correct.
 
The example prints the original iterator and the nexted one.
 
let me give it a try... sorry for my dumb question
 
@JerryCoffin neither! you can't compare a relative with an absolute
e.g. "very" vs "more"
it's just nonsensical
 
OMG, the secret of my weight scale is out.
 
8:25 PM
@LightnessRacesinOrbit I have a relative that's an absolute jerk.
 
@StackedCrooked :)
and I'm relatively fond of Absolute [sic]
 
@LightnessRacesinOrbit The point I was trying to make in my own inimitable way.
 
@RyanFung why can't you do += 2
 
u can't
they just said
it doesn't support in the list iterator
 
Anyway, you guys cannot understand my weight scale because that's how it is designed: it is designed so I am never wrong when I use it.
 
8:26 PM
@doug65536 we've been over this
the container doesn't support random access
you have to ++ twice
 
is there a way to check does it go back last
 
he didn't specify any information about the iterator type
 
instead of right one last
 
the += syntax is disallowed in order to discourage such an operation which is inappropriate for non-random access containers in the general case
@doug65536 He did
 
std::advance is the generic way to advance iterators
 
8:27 PM
> it says binary '+=' list doesn't define
 
is there a way to do this? (first >= last) in containers?
i need the greater than last
 
for random-access you can.
 
then I would just take the iterator advancement out of the for loop condition and make it an infinite loop that breaks out when it runs out, and checks after every increment
 
@sehe Used to know a girl that turned to psalm 119 in times of restlessness. :)
 
"Blessed are the undefined in the way, who walk in the law of the Standard"?
 
8:30 PM
repying to 5 hour old msgs
 
anyone
?
 
@R.MartinhoFernandes Shouldn't that be "defined in the way"
1 min ago, by DeadMG
for random-access you can.
 
@LightnessRacesinOrbit lol, 5 hour old. Welcome to the lounge, where we sometimes reply to month old messages... :/
 
@RyanFung stop rapid-firing barely-comprehensible questions and put in some thought when you have a question
@R.MartinhoFernandes nothing wrong with that but it kinda came outta the blue
 
@@
 
8:31 PM
for (auto i = x.begin(), e = x.end(); i != e; ) { auto firstthing = *i++; if (i == e) { error = true; break;} auto secondthing = *i++; ...you have your pair... }
 
@DeadMG Maybe. I just looks Psalm 119 up and it read "Blessed are the undefiled in the way, who walk in the law of the Lord" so I could not resist s/l/n/ and s/Lord/Standard/ felt appropriate too.
 
@R.MartinhoFernandes verse 29 is for Lance Armstrong
 
ah
well, it should really be "defined in the way, who follow the law of the Standard".
 
Yeah makes more sense.
Maybe Psalm 119 is intended for optimizer writers.
 
it's intended for religious nuts
 
8:34 PM
wait
 
Come on, can't we joke without going there?
 
damn
I was about to launch some sarcasm, but I realized it would be really quite undeserved.
 
whoa. the puppy is growing mellow
 
@sehe s/mellow/up/
 
@R.MartinhoFernandes lol
 
8:35 PM
...
 
My brain farted.
I'm just realizing how fucking complex Civ5 is.
 
@R.MartinhoFernandes I'm quite sure you are aware of the fact that Psalm 119 is also (by far) the longest of the psalms /cc @StackedCrooked
 
mehehehe
@R.MartinhoFernandes there's nothing funny about religious nuts? I quite enjoyed the image of a pecan kneeling down to pray to the holy standard
 
@EtiennedeMartel Would you recommend it? I kind of liked Civ 4.
 
@StackedCrooked Do you want to sleep? Because that becomes optional once you get the game.
 
8:37 PM
@LightnessRacesinOrbit I can kick you someone in the nuts. Religious or not
 
@sehe I ate all my nuts
2
 
What a perv.
 
@LightnessRacesinOrbit that's completely
 
@EtiennedeMartel I see what you mean.
 
I completely all my nuts
 
8:38 PM
ONE MORE TURN
 
@EtiennedeMartel Hey, I am about to fight Handsome Jack (or whatever the final boss is). Wanna join?
 
@R.MartinhoFernandes Sure.
 
@R.MartinhoFernandes with s/l/n, that would come out as "... who wank in the way of the Standard." (which doesn't sound all that far off either).
 
@JerryCoffin I am so awesome I make jokes even when I make mistakes.
 
one more qustion
i can error when i try to cout<< *lists.begin()
it says it is not dereferencable
 
don't do that then
 
get*
 
if its empty you cant dereference it
 
What is lists.begin() in this context?
 
8:41 PM
std::list<std::string> lists;
 
@LightnessRacesinOrbit I predate these puny rules, and still follow those I helped establish before placing the so-called Gods on Mount Olympus.
 
And how many elements are in this list called lists?
 
@RyanFung std::cout << (lists.empty() ? std::string("NOTHING!!!") : *lists.begin());
 
one
 
@RyanFung This cannot be so
 
8:43 PM
@R.MartinhoFernandes Well, it also changes "Blessed" to "Bnessed", which kind of ruins the effect.
 
@RyanFung and don't do *collection.begin(). That is what front() is for.
 
i thought they are the same thing
lol
 
don't "think" things like that. It is possible for a container implementation to do front() better.
but they both work yes
front() says almost directly, "gimme a reference to the first thing". begin() means set up an iterator because I might go iterating through it. then take that return value and dereference the iterator into a reference. It's obvious that front() is better
 
@RyanFung Yes, they are essentially functionally equivalent.
@RyanFung Your code should work in this case, so there's something you're not telling/showing us.
Make a testcase that reproduces the issue
 
8:49 PM
@R.MartinhoFernandes You want us to help jack your nuts... I think I'm misreading stuff now
 
omg
i use the end() as well
which i think end gives you last element + 1
 
i think i should use something before end
 
end() is the "one past the end" iterator, such that a pair it1, it2 gives you a range that's inclusive at the start and exclusive at the end
@RyanFung Your example did not say end. It said begin.
 
i know
so i want to shoot myself now
sorry
 
8:53 PM
Does that mean your example is not the same as the code that actually caused the problem?
 
instead of end what should i use?
 
That makes me kinda mad, @Ryan.
 
i am sorry Lightness
please forgive me. I am a noob
 
You're a noob at not lying? :(
You don't have to be good at programming to present accurate evidence
 
should i do end than previous?
*then
 
8:54 PM
Since we haven't seen your code with end, we can't say what it is that you're trying to accomplish, and therefore cannot suggest a solution.
 
@doug65536 also, *(lists.begin()) -> lists.front() (or, having read more of the thread, lists.back() :))
 
Browse this:
2033
Q: The Definitive C++ Book Guide and List

grepsedawkThis question attempts to collect the few pearls among the dozens of bad C++ books that are released every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a good C++ book...

 
yes please
 
i am trying to get the "real end element" of my list
but i can't use end()
alternatives plz?
 
8:56 PM
@LightnessRacesinOrbit Important messages deserve attention
And welcome back, loyal rightness
2
 
@sehe whut
@sehe oh, that
@sehe yes it was crucial
@sehe and thanks :)
 
@LightnessRacesinOrbit I concur
 
@sehe I have that effect
hey, you decoded my name!
 
Seemed apt. (Although, laces...?)
@StackedCrooked You know, makes me wonder. Does the definition of 'relative' include one's self? You know, like ./ is a relative path
 
Not necessarily self.
 
8:59 PM
Rightness Laces Me Morbidly
 
user142019
C# do-while y u weird scoping.
 
@sehe It neither includes nor excludes it. By definition a relative step is from self, so if you make a relative step size zero...
(FSVO "self")
 
Why the hell does SO keep logging me out T_T
 
@StackedCrooked Yeah yeah
 
Because we don't want you here
 
9:01 PM
@Borgleader Because it knows what's best for you
 
There was a Winter Bash competition to hack the network to kick you out every 12 minutes
That's one minute for each day of Christmas.
 
lolll
Well played well played
 
It's time to fly
 
9:12 PM
Hi kids
 
user142019
Hurray my async web server in C# works.
 
user142019
9:29 PM
C# y u no async ctor.
 
@Borgleader it never logs me out
 
@doug65536 It used to not log me out either, that's why I don't understand why it keeps doing so nowadays
 
but then my machine goes weeks without reboots and I have a ton of browsers piled up after a few hours :)
 
Hmm. C++11 doesn’t seem to allow the syntax namespace foo::bar { … } – why? Oversight?
 
having to go namespace foo { namespace bar { you mean?
yeah that sucks
 
9:31 PM
yes
 
it almost ruins namespaces to the point where people don't use them (when they should be)
 
There seems to be no point in forbidding this shortcut, and (all?) other languages with similar concepts of nested name spaces allow it
And they didn’t leave namespace syntax untouched in C++11, they added the inline namespace feature whose importance eludes me at the moment, to be honest
 
the oversight of the century was not allowing templated typedefs from day 1 of templates
 
AAAAAAAANNNNNNDDDDDDDD Open!
Hi.
@KonradRudolph It's for versioning, and something about ADL.
 
meaning, imagine I could say: template<typename T> typedef std::vector<T, SuperFastAllocator<T>> FastVector;
 
9:35 PM
hmm
 
@R.MartinhoFernandes Hullo
 
@doug65536 I'm not sure why they didn't allow this from the start either.
 
U
 
@ThePhD They did not.
 
9:36 PM
I know. That's what makes it sad. =[
Still, you can always
Struct your way to victory, I guess.
 
yes, one of the things I think is a downside of C++ is all the places where you say "oh just type out 16 lines of code that look similar to the last 30 times you did it" to do common things like that
 
Any recommendations for documentation systems for C++?
 
What baffles me is why they introduced a new keyword entirely to do it.
 
(this might be the wrong place to ask this …)
 
using ?
 
9:39 PM
@ThePhD They didn’t, they more or less logically extended using’s meaning
 
Really? We couldn't do template < /* stuff */ > typedef /* stuff ? */ ?
 
@ThePhD That's less powerful.
 
@KonradRudolph u mean like doxygen?
 
@kfmfe04 Yes, except ANYTHING BUT Doxygen
 
@R.MartinhoFernandes It is? o_O
 
9:40 PM
template <typename T>
using alias = T;
// do that with typedef, sucka
 
@ThePhD you could "pull in" the operator= (with using) and make wrapper constructors that forward everything. but that's the point, why not automate it with typedef'd template.
 
@ThePhD Meh. typedef syntax sucks anyway, I never use it now
 
@R.MartinhoFernandes Uh. What does that do, exactly?
 
@R.MartinhoFernandes template <typename T> typedef T alias;
 
Ooh
alias<T> ?
Is it just alias ?
I'm confused. :c
And at that point, why would you want an alias to... itself
 
9:41 PM
alias<int> becomes int
 
You're just adding alias<> to a simple 'T` declaration
It's a nice thought, but really just a nice thought you'd have a wank about while doing template metawankery.
 
you would actually use it to provide different default parameters (for example) like my FastVector example
a more meaningful example would be if you made a special allocator that allocates memory in DMA-capable memory, and you wanted to make a DMAVector that allocates memory appropriately
 
@ThePhD If you cannot see the point of an identity function, you need to study more young padawan.
 
Yeah, but... I just don't understand why. :c
 
you might actually do that with opencl
 
9:44 PM
alias<T> <--- What does this buy you over 'T', if it just replaces alias<T> with T ?
I'd understand the purpose if you could do some pruning, like
 
it could be a way to put a no-op I suppose
 
template <typename T>
using std::remove_ref<T>::value; ?
Or is it ::type ? I forget.
 
@R.MartinhoFernandes Brilliant. So much explained... Yesterdays paper here, on the other hand, showed some more shockingly real statistics: 926 deaths by firearms in the US since "Newton". (Quoting from memory: 64 kids...)
That's about 1000 killed in about a month?
 
@sehe > 30 people a day, yep
 
9:47 PM
@KonradRudolph Crazyness. I seriously doubt they need armed guards at every school
They need brained politicians in every state
 
I'm just not sure how you would go about making sure these deaths happen less.
 
@ThePhD Kill more people.
 
I mean, you could just ban the firearms. That makes the nutjobs attempts less successfully fatal.
 
You cannot kill anyone twice.
QED.
 
@KonradRudolph That's just sensationalist.
 
9:50 PM
@R.MartinhoFernandes You do know there is a identity trait, right? common_type<T, T> :D
 
the only figure that makes useful sense is deaths per capita, or more often for population, deaths per 100k population.
 
@DeadMG No matter how you dice it this number is horribly high
 
oh yeah, I'm not saying that it's not very high in the US.
 
yes, in a per capita number is more relevant
 
all I'm saying is, they have 300,000,000 people
 
9:51 PM
I wonder why it's so high in the U.S.
 
@Griwes std::common_type is the one trait that can be specialised by the user. So, not, that is not an identity trait. I'd rather play it safe.
 
Maybe because the U.S. is filled with very disgruntled individuals.
 
@R.MartinhoFernandes mhm
 
It could maybe have something to do with our culture?
 
US
10.2 deaths per 100k population per year by firearms
UK, 0.25 deaths per 100k pop per year
 
9:52 PM
@DeadMG Collectively?
Including non-assault-based-type-dealies?
Like getting sick and dying in the hospital?
 
just says "total firearm-related death rate".
 
@ThePhD He's talking about firearms.
 
unless you think we respawn (reincarnate)
 
@doug65536 I can't manage to say reincarnation as an idea makes sense.
The planet is far more populated than it ever was.
Where do the new souls come from?
 
of course, its as ridiculous as respawn in a shooter
 
9:55 PM
@ThePhD They have very effective access to firearms, and very poor mental health controls.
 
Ah, true. Mental Health in the U.S. is fairly shitty. Most of it revolves around pharmaceutical distribution of drugs.
"Feeling this way? JUST TAKE THIS."
I remember that one commercial for an anti-depressant.
 
what they should do is a'la Switzerland.
you want a gun -> you have to go through military training.
 
what were you expecting them to do though?
 
... Who's side effect was you becoming MORE depressed.
^ Genius Pharmaceuticals.
 
but what about actually crazy people. people who really believe they are some historic figure
 
9:57 PM
Just like that one asthma commerical, where a side effect was asthma.
It was like
"... What?"
"Why are you even trying to sell your pill?"
 
its easy to say what not to do
whats your alternative
 
@DeadMG not really. 926 people is a lot. And it never made any news like Newton did. Yet, it happened since Newton
@R.MartinhoFernandes Good point. Perhaps send that to McNellis in reply to his tweet (IIRC) /cc @Griwes
 

« first day (826 days earlier)      last day (4125 days later) »