« first day (1435 days earlier)      last day (3515 days later) » 

3:00 PM
this is a stupid question but...
how do I make it so it doesn't output scientific notation?
 
@Chantola judging by your SO question ban...
3
 
I want it to output in digits..
 
Tell it you're no scientist
 
something is terribly wrong with my code.
is there a pattern to the prime numbers?
 
Yes, they're all prime
Ugh logging in to Origin always takes forever
Get better mail servers already jesus
 
3:14 PM
Oh..
My...
God..
The key line is the one that performs the modulus operation: "num % 2 == 0". A number is even if and only if it is divisible by two, and a number is divisible by another only if there is no remainder.
I think I figured exactley how I can do Project 2
*Project 3
And I found a much faster way to finish Project 2 than what I did.
 
rain stopped
brb stuffing my face
 
Ell
hmm.
HTTP is kind of a stupid protocol really
 
@rightfold Stupid feminism: poisoning every serious discussion with gender issues since 1998.
 
Bejeweled 3 is free on Origin
 
3:23 PM
I opened PuTTy expecting to have to fix paths to SSH keys but apparently my past self already thought of that
What a guy
 
Does anyone know why this
if (d % (e++) == 0)
doesn't work
c++ error expression must have integral or unscoped enum type
anyone?
 
part of learning programming is to learn to figure shit out yourself, dont give up the second the compiler gives you an error
3
 
rude
 
hahaha wat
that was rude?
 
It was honest and helpful advice @Chantola
 
3:34 PM
alt: Nobody cares, figure it out
 
What kind of bull is it that I can't use modulo on doubles...
 
What would you expect it to do?
 
> Internal error, yaws code crashed
good start!
 
28
Q: Why does modulus division (`%`) only work with integers?

Brendan LongI recently ran into an issue that could easily be solved using modulus division, but the input was a float: Given a function which repeats (ex: sin), and a computer function that can only compute it when the range is within one segment of that range (ex: -pi to pi), make a function th...

@Chantola
 
@Borgleader ooooh, that's where I've been goinf wrong
@CatPlusPlus nah, past you was a dick
 
3:44 PM
Cat's pretty cool nowadays
 
(Seemingly a homework smelly question but actually not. I use below working solution to print out vector content. Just want to check whether this is the most simplified form. )
bool ishead = true;
for(auto &s: vec) {

if(ishead) cout << s, ishead = false;
else cout << " " << s;

}
 
std::ostringstream imploded;
std::copy(vec.begin(), vec.end(), std::ostream_iterator<std::string>(imploded, " "));
std::cout << imploded.c_str();
 
thanks.
 
I find your abuse of the comma operator disturbing.
 
But whether there is a idom for loop version?
I agree
I was trying to save brace
 
3:46 PM
Why?
 
still beginner and find it nostalgia with loops
 
@LightnessRacesinOrbit this /cc @modeller
 
Anyway your version is basically good enough, though you should const-ify, and this won't be particularly performant so if you need it to be, try getting rid of that check for ishead in each iteration by outputting the first element, then incrementing your iterator past begin then looping.
@modeller No, I mean, why were you trying to "save brace"?
 
bool ishead = true;
for(auto &s: vec) {

if(ishead) {cout << s; ishead = false; }
else cout << " " << s;

}
is it ugly to write like this
Or maybe I didn't know a more consise way
 
@modeller just use indentation properly like a normal person =/
 
3:49 PM
@FredOverflow What he's proposing is really much more fundamental than is immediately obvious. It's not just "using SHA-1", but shifting from location-based to content-based addressing. At least to me, it looks fairly broken though. For an obvious example, it would mean every time somebody posted a message here, the URL would change. Somebody coming in the first time wouldn't know what URL to use, and when you typed a message, I'd need to know what the message was to figure out the URL to get it.
 
@JerryCoffin Yeah, it seemed pretty limited and kinda stupid to me, too.
 
That's not to say these problems can't be worked around, but it does tend to indicate that it would take a lot of work to achieve much.
 
Thanks
 
@Borgleader i see
bool ishead = true;
for(auto &s: vec) {

if(ishead)
{
cout << s;
ishead = false;
}
else cout << " " << s;

}
 
Xeo
psst: there's a "fixed font" button
 
3:51 PM
auto delimiter = "";
for (auto&& s : vec)
{
    std::cout << delimiter << s;
    delimiter = " ";
}
 
why const char * and not std::string?
 
purrformance
 
Purrformance - the rate of purrs per second
 
@FredOverflow Cool. I was just looking for such idioms.
Thanks for all
 
3:53 PM
Ah, that looks much better!
 
@LightnessRacesinOrbit cc / @Borgleader, thanks for the alternative ways and adivce
 
Another satisfied Lounge customer. That brings the total up to, what, one?
 
@FredOverflow I have no issue with points, I just have an aversion to const char * xD
 
@modeller or...
cout << vec[0];
std::for_each(vec.begin() + 1, vec.end(), [](std::string& s) { cout << " " << s; });
 
@Borgleader Yuck.
 
3:56 PM
@Borgleader noted.
 
@JerryCoffin Whats wrong with it? D:
 
@Borgleader Nearly everything.
std::copy(vec.begin(), vec.end(), infix_ostream_iterator<T>(std::cout, " "));
 
@LightnessRacesinOrbit lol. now I usually put (homework) disclaimers in front of trivial questions.
 
@Borgleader You need a couple of checks.
Anyway, I already wrote the [almost] correct solution: (s/c_//)
13 mins ago, by Lightness Races in Orbit
std::ostringstream imploded;
std::copy(vec.begin(), vec.end(), std::ostream_iterator<std::string>(imploded, " "));
std::cout << imploded.c_str();
 
@JerryCoffin o.o would that add a space before the first element?
 
3:59 PM
@Borgleader No...
 
oh, well o.o nice
 
@Borgleader No. That's why it's called in infix_iterator.
 
Mine adds one at the end though :(
infix_ostream_iterator is not in the standard and must be extracted from Jerry's library of code, btw. So it's not the lean solution he makes it out to be (shocker)
 
@JerryCoffin xcept thats not standard
 
@Borgleader There's a link to it just above, and it's been proposed for addition to the standard. In any case, none of the (working) alternatives is in the standard either.
 
4:03 PM
LRIOs solution is clean enough and uses standard iterators
 
@Borgleader ...and as even he noted, doesn't work correctly.
 
dang, forgot to buy sour cream
at least I got cornflour and cheese
 
@Borgleader Believe me: I'm well aware of std::ostream_iterator<T>. stackoverflow.com/search?q=user%3Ame+ostream_iterator
 
8 mins ago, by Lightness Races in Orbit
Mine adds one at the end though :(
You have to remove it
I forgot about that
 
@LightnessRacesinOrbit Why the call to c_str()?
 
Ell
4:09 PM
@FredOverflow you can't put a stream into another stream can you?
 
10 mins ago, by Lightness Races in Orbit
Anyway, I already wrote the [almost] correct solution: (s/c_//)
Jesus why can nobody read today
 
@LightnessRacesinOrbit It's Read-Like-A-Pirate Day.
 
@FredOverflow Better question: why use the ostringstream at all?
 
@JerryCoffin Search 0 results
yet another one of your jokes that flew right over my head
 
@Borgleader No, just a mistake. I accidentally searched for "user:me" instead of stating the user number explicitly, so it was searching in your posts instead of mine.
@LightnessRacesinOrbit Some people seem to think it's all right.
 
Xeo
4:22 PM
Dear Diary,
today I found three villages, a desert temple, a mesa biome and conquered an underwater temple. Still no fucking swamp.
 
dafuq are you playing
 
Minecraft.
Noooob
 
rude
:P :P :P
 
@Xeo is that singleplayer?
 
Xeo
No
 
4:23 PM
Thank god
 
Xeo
Ugh. Only got arid biomes around. I need a friggin swamp for slime balls
 
what do you need slimeballs for?
Automatic piston door?
 
Xeo
Sticky pistons for an auto-brewing station
 
Guys
I love you
A lot
 
Great.
 
4:25 PM
youre drunk arent you?
 
probably.
or high.
 
@Xeo You can find slimes underground newb.
 
I had 255 unread messages
thank god I clicked in time
 
@Soffia raarely.
@Sofffia these days I don't worry about ever getting slimeballs because I just play the post-apocalyptic MineZ.
 
Xeo
k. underwater temple #2...
 
4:26 PM
Seriously alot funner than anything else...
 
they bought out all of the valkirias :/
fuckers
 
Ell
I just make slime farms
 
Xeo
@Sofffia In slime chunks.
I haven't found a slime chunk so far
 
God damn, all the new updates?
I can't handle them
going back 4 years before redstone existed
when life was simple
and fun.
 
Slime blocks are awesome, btw.
 
Xeo
4:29 PM
Desert temple #2...
 
Also why are we not playing all together?
 
You want to play MineZ with me?
be my guest..
but don't rage if you die 20 times...
wait, can I get unbanned from asking questions if I edit a gazillion posts that get accepted
 
nope
 
1
A: Remove repeating characters from string

Mohammad Ali BaydounTry having a 256-sized array and use a copy_if algorithm call: std::string str = "pooaatat"; // Prints "poat" short count[256] = {0}; std::copy_if(str.begin(), str.end(), std::ostream_iterator<char>(std::cout), [&](unsigned char c) { return count[c]++ == 0; }); This is assuming t...

I'm not satisfied
I want to find the one-size-fits-all method for this
Why am I wasting my time on this deteriorating Q&A queue
 
How does one Rosalind
does anyone have a great free C++ online book I can use?
or maybe some pdf file?
idk...
 
4:37 PM
@MohammadAliBaydoun Create an unordered_set of characters. As you get to a character, add it to the output of it's not yet in the set, then insert it into the set. Each insertion is (expected) O(1), so overall O(N).
O(N) is about the best you can ever hope for, so it's pretty close to optimal. If you expect huge inputs that contain all possible characters, you could check the current size of the set and stop when all characters have been inserted.
 
Heh. I completely forget about unordered_set.
Today, I was thinking, "I should use a set for this. That'll take care of uniqueness, but oh wait! Sets are ordered! Well, that's sets thrown out of the equation"
 
@Chantola there's a book list on SO, some of them are free online pdfs
 
@OMGtechy thanks.
Does anybody know how I can talk to a moderator
You have reached your question limit
Sorry, we are no longer accepting questions from this account. See the Help Center to learn more.
:(
 
@robert
 
I don't even know how to talk to girls, you're asking me to help you talk to a moderator?!
 
4:42 PM
@Chantola That's a bit like talking to a dragon. You just talk. The question is whether he'll listen, or just eat you for breakfast.
 
@Chantola Well, 7 questions in 12 days is quite a lot.
I don't think talking to a moderator would change anything.
 
I would tell him
I'm a changed man
we all deserve a second chance
 
lol
 
I'm better now
 
You make it sound like you were banned from the royal club or something.
 
4:43 PM
@FredOverflow I'm pretty close to that rate. Well, sort of. I think I'm about on track to ask 7 questions in 12 years.
 
@MohammadAliBaydoun Imagine if its a girl moderator D: oh the humanity
 
that's exactley what happened to me @FredOverflow
 
This is just stackoverflow. Give it a few days rest, and I'm sure you may ask questions again.
@JerryCoffin But yours don't get downvoted a lot, do they?
 
Does anyone want to be a kind soul and upvote my posts for the sake of everything righteous and good and nice?
 
I have this
Gingerbread is a sweet food-product flavored with ginger and typically using honey or molasses (treacle) rather than just sugar. Gingerbread foods vary, ranging from a soft, moist loaf cake to something close to a ginger biscuit. The different types likely share a common origin. == Etymology == Originally, the term gingerbread (from Latin zingiber via Old French gingebras) referred to preserved ginger. It then referred to a confection made with honey and spices. Gingerbread is often used to translate the French term pain d'épices (literally "spice bread") or the German term Lebkuchen or ...
and it's good
 
4:44 PM
Alex.M
please
just edit one post right now
so very simple
My ocd can't handle your 998, make it 1k.
 
Xeo
@AlexM. Noooo! Gingerbread Man!
 
@AlexM. It looks really delicious!
 
¬_¬ yeah... things tend to be easier to find when you use the correct name
 
actually I think it's more like this: en.wikipedia.org/wiki/Toru%C5%84_gingerbread
they're essentially gingerbread balls covered in honey
@Chantola I'll think about it
 
nooooo
 
4:47 PM
@FredOverflow Hmm...they get downvoted a lot more than I think they deserve. Many downvotes appear mysteriously every time I clash with Vlad though, so I don't spend much time worrying about it.
 
here are some traditional Romanian gingerbreads
 
But in the end, yes: they do all have postive scores.
 
Ell
I wonder if it's possible to use an android phone as a UVC device
 
the white thing is some sort of sugar-based glaze
 
@JerryCoffin stackoverflow.com/a/25947118/1520907 Are you proud, my dear Mr. Coffin?
 
4:50 PM
@MohammadAliBaydoun It's not quite correct, so I guess I can at least try to act like I'm humble for a few minutes.
 
@JerryCoffin I'm scared now
 
As you iterate the string, you need to print a letter out if it's not in the set. Then add it to the set. Repeat for all letters.
 
@MohammadAliBaydoun It's so much easier in Haskell:
λ nub "pooaatat"
"poat"
:: [Char]
 
-_-
 
4:54 PM
nub is even the first Hoogle result for Eq a => [a] -> [a]
 
#_#
I am Calvin Harris
 
MAIL SERVERS SUCK
 
Why isn't gained reputation displayed on the topbar anymore?
 
they wanted to nerf mysticial's awesomeness
 
Fuck this shit
@JerryCoffin ideone.com/WkqSBq This is about as close as I can get
 
Xeo
5:00 PM
@FredOverflow I think that's O(N^2) though
@MohammadAliBaydoun Erm, why not just, same as before, return container[c]++ == 0?
> because the unordered_set will have them in reverse.
The unordered_set will, as the name suggests, not have them in any specific order.
 
So it's not guaranteed to be the insertion order?
 
Xeo
no?
 
user1804599
Yay I implemented constant folding.
 
Well, okay, now I see why the initial solution was incorrect.
 
5:12 PM
I'm never returning to that question ever again
I solved it 4 times and this is just starting to disgust me
 
good call
 
Ell
> Constructs a new invalid FileDescriptor.
3
Android is just terrible
 
TIL unordered_set is serious about the unordered part.
 
@MohammadAliBaydoun ... why wouldn't it be
 
@MohammadAliBaydoun tomorrow you'll learn it's also serious about the set part
 
user1804599
5:15 PM
And about the _ part as well.
 
that's for two days from now
 
Xeo
14 mins ago, by Xeo
@MohammadAliBaydoun Erm, why not just, same as before, return container[c]++ == 0?
(You suck!)
 
@Xeo std::unordered_set implements operator[]? ;-;
 
@rightfold Congratulations on duplicating functionality LLVM already offers
 
5:16 PM
I looked at the cppreference pages
 
Xeo
oh wait
use std::unordered_map<char, int> then :P
 
@MohammadAliBaydoun You may want to work on that. It's pretty common to iterate over a solution a few times (often more than 4) before it's really clean and polished.
 
user1804599
@Puppy I am sorry for not realizing I am not allowed to not use LLVM which doesn't support my target platform, as well as having fun implementing things.
 
user1804599
I will never do it again.
 
what is your target platform?
 
user1804599
5:17 PM
Styx VM.
 
Xeo
Also, checking find(char) == end before the insert is redundant
 
Email notifications on Nomic forum enaaaaaabled
 
Xeo
so, std::copy_if(first, last, destination, [&](char c){ return container.insert(c).second; }); should be fine on its own
 
Oh, you're right.
 
@Xeo It seems to be lacking a destination.
 
5:19 PM
Also you have to rebuild the container to change SMTP settings
thanks jeff
 
Xeo
@R.MartinhoFernandes meh
I'm distracted.
 
Look at this answer. LOOK AT IT. This is a trainwreck.
 
user1804599
Even if I chose a platform LLVM supports as target, it would probably be much more effort to write a JVM binding for LLVM and getting all the horrible low-level shit to work.
 
It used to be 5 lines worth. Now it's rolling into a big ball of mud answer
 
5:20 PM
@MohammadAliBaydoun it would look better if you didn't insist on telling the world you **EDIT**ed it a million times
 
user1804599
Whereas VMs are superior anyway.
 
When will this unordered_madness cease!?
 
@MohammadAliBaydoun Not soon.
 
Xeo
Well, ordered madness would be redonkulous!
 
@rightfold It seems pretty likely (to me anyway) that somebody has already targeted JVM with LLVM.
 
user1804599
5:23 PM
Binding, not target. AFAIK the latest binding supports only LLVM 2.7.
 
> The staff and cast of the Haiyore! Nyaruko-san W (Nyaruko: Crawling with Love! Second Season) sequel anime announced at the "Saraba Nyaruko Final Countdown" (Farewell Nyaruko: Final Countdown) event on Sunday that production on an original video animation (OVA) titled Haiyore! Nyaruko-san F has been green-lit.
whoa
it's something
 
user1804599
I'm not gonna write my compiler in C fucking ++.
 
@rightfold I guess I've lost track of what you're trying to do.
 
The ultimate goal is to get some poon
 
user1804599
I'm writing a compiler in Scala and somebody suggested I use LLVM to generate code.
 
5:26 PM
@MohammadAliBaydoun Yes, so you can do my_map[key] = value and stuff.
 
Xeo
@FredOverflow _set doesn't, _map does
 
@rightfold You're not allowed to have fun until Monday, when Puppy's job begins. Hang in there!
@Xeo oh right
 
I love making C++ errors in this room. It's one of the few things that allowed me to grow over the last year ;~;
Recall that saying that advises you to surround yourself with people who are better than you
 
@rightfold Oh, in that case...
 
@MohammadAliBaydoun if only there was a room where you could make life errors and grow
 
5:30 PM
@Borgleader C++ is life
 
No need for a room, you can do that outside :))
 
I love this language so much, no matter how it hits me in the face!
 
@MohammadAliBaydoun So they're easier to shoot.
 
@MohammadAliBaydoun you masochist
 
Ell
> This constructor does nothing.
 
5:32 PM
@R.MartinhoFernandes "We are not surrounded. We are merely in a target-rich environment."
 
Ell
They should just scrap the whole thing and start again
 
@R.MartinhoFernandes I would never do that to you Robot. Would you like a glass of water?
 
Question about iterator / reverse_iterator: Is the conversion path between the two Bi-directional? i.e. After I convert a reverse_iterator to iterator (using .base()), can I use some function to convert iterator to reverse_iterator?
 
The constructor.
Or make_reverse_iterator.
 
hi
 
user1804599
5:33 PM
@FredOverflow Rules are there to break them.
 
@Rapptz 'lo.
 
@R.MartinhoFernandes let me dig that out.
 
Where's @Puppy, btw?
Don't remember seeing him today.
 
woofing at a bird
18 mins ago, by Puppy
@rightfold Congratulations on duplicating functionality LLVM already offers
 
5:35 PM
but I haven't really been around that much.
recovering from yesterday
 
Too much celebration?
 
@R.MartinhoFernandes Ok. So I guess it is correct to say:
// evaluates to true
r_iter == make_reverse_iter(r_iter.base())
 
not really.
but a whole bunch of travel
 
// evaluates to true
r_iter == std::make_reverse_iter(r_iter.base())
 
today I slept in, I played some games, looked for some places
and I finally finished watching 3RFTS.
 
5:39 PM
I just slept in.
I think I'm still not awake.
 
@R.MartinhoFernandes You're not. This is all a dream.
 
I got downvoted a lot on reddit
:<
Just like I predicted but still.
 
@R.MartinhoFernandes I recommend that you get to work on higher-quality dreams--ones that beautiful women would be a good start.
 
Ell
@Rapptz was his reply incorrect?
 
5:48 PM
His examples were misconstrued to fit the argument
 
No. Just full of elitist snobbery.
@Rapptz Er, no, he's right.
 
> 3.0+ was when the uT devs decided to cash in the popularity of their product, effectively turning uT into an ad-ridden bloatware (compare client sizes).
 
@R.MartinhoFernandes The original function returned a non-cv qualified value but he added cv-qualifiers and changed the function signature.
I'm not saying he's wrong
 
COMPARE CLIENT SIZES
 
@CatPlusPlus rofl, more like compare the amount of ads
 
Ell
5:51 PM
@Rapptz why don't you reply and tell him that your thing doesn't apply to his altered signature?
 
Cause I don't care anymore
 
@Rapptz I don't see that.
 
lol arguing on reddit
 
@R.MartinhoFernandes Original function signature was std::string stuff(...) but he changed it to const char* stuff(...) effectively returning a type with cv-qualifiers
 
@Rapptz const char* is just poor man's string_view.
 
5:53 PM
I know
 
The cv qualifiers are irrelevant because they're not top-level, and not for references.
 
oh I misread the example
 
It doesn't change a thing. The code has the same issues with string_view instead of const char*.
 
man I just woke up
I'm such an idiot
forget I said anything
 
@Rapptz If it was that easy... i still wouldn't do it :p
@R.MartinhoFernandes Could you please link to the code you're talking about?
 
Cheers
 
np
 
@Rapptz <s>get_scheme_from_url is so broken </s>
Wait, it's not!
 
don't see it
 
@Rapptz I didn't see the deleted overload - immediately went back to chat to complain instead :D
 
5:59 PM
@R.MartinhoFernandes Yeah. I just misread the functions.
Also, it still hurts to blink.
Sleeping be damned. It didn't help
 

« first day (1435 days earlier)      last day (3515 days later) »