« first day (629 days earlier)      last day (4333 days later) » 

6:00 PM
I need to work with her again.. and then preferably sleep with her, marry her, move to the country side with her, then move back to the city cause the country side is boring.. pretty much spend my rest of my life with her.
 
did I say that out loud?
time for a smoke.
 
@MooingDuck Sorry, I meant to write std::unique_ptr<A> a = {...}
 
Wankin'.
 
@ManofOneWay If you're not using new, why don't you just write A a = { ... }?
Values > unique_ptr > shared_ptr > owning raw pointers.
 
6:02 PM
Because I also forgot the make_unique()-part
:P
 
0
Q: post increment and pre-increment

akashI m trying some output questions.One thing strange i noticed is int z = x++ + ++y; works absolutely fine while int z = x+++++y; doesn't works. it gives an error lvalue required as increment operand can anyone explain what is wrong in the second definition?

I swear this is a duplicate of another question.
 
I basically want to work with some objects of a type A. And pass the pointers of those objects in different sized arrays to different places
 
@Insilico Voted.
 
The UB duplicate isn't correct. The code is using different variables - and it doesn't compile.
 
@RMartinhoFernandes ideone.com/JbPn9 , This is what I want to do
 
6:07 PM
@Mysticial ?
Ah, I see now.
I voted for the max munch one.
And removed the sequence point one from the dupes.
 
I took it out once, and somebody rolled it back.
 
@ManofOneWay And who owns the items?
 
@ManofOneWay How about a std::vector<A>? Or do you need polymorphism? How about std::vector<std::unique_ptr<A>> then?
 
@RMartinhoFernandes A a1; A a2; A a3; A a4; should all live by themselves, they will be dynamically allocated. At the same time they will have a list/array/vector of pointers to each of other
 
@0A0D this has nothing to do with sequence points: no variable is used more than once in any expression. Please don't add that again to the list of dupes. — R. Martinho Fernandes 13 secs ago
 
6:11 PM
(In the example they are not dynamically allocated of course)
A bit more specific example maybe
 
@Mysticial Oh that Pi conversation yesterday, I started to look at some of the formalism and it is indeed extremely interesting.
Srinivasa Ramanujan FRS () (22 December 1887 – 26 April 1920) was an Indian mathematician and autodidact who, with almost no formal training in pure mathematics, made extraordinary contributions to mathematical analysis, number theory, infinite series and continued fractions. Ramanujan was said to be a natural genius by the English mathematician G.H. Hardy, in the same league as mathematicians like Euler and Gauss. Born in a poor Brahmin family, Ramanujan's introduction to formal mathematics began at age 10. He demonstrated a natural ability, and was given books on advanced trigo...
 
@ManofOneWay Sorry, I still don't understand the issue.
 
@Nils Yeah, the formula is pretty crazy.
 
If you want the A to own their "children", you're on shared ownership => shared_ptr. If you don't want them to own the "children", they're irrelevant to the issue of initializing the unique_ptrs.
 
just got the pictures from todays shoot.. damn it, never been this excited about a shoot in a really really long time
 
6:14 PM
Today, my room mate reorganized some of my stuff in the kitchen. I feel so garbage collected!
 
@RMartinhoFernandes I'm passing an initializer list so it should be unique_ptrs then?
 
tmp.glork.org/refp_smoking.png speaking of smoking
 
@ManofOneWay No.
 
(just a tiny thumb of the quick preview sent to my bookers)
 
If the As don't own the children use non-owning pointers (i.e., A*).
 
6:15 PM
A should own the array of pointers
 
no one should own arrays, they should run free!
 
vector<A*>
 
back to reading "professional c++" and laugh about the wording of sentences..
 
@refp How bad are the sentence wording?
 
@Insilico they imply certain things which aren't true, a good example is something about std::cout being a type, just as std::vector (can't remember the exact wording)
 
6:18 PM
@MooingDuck There is no guarantee whatsoever that std::array<thing, 14>::iterator is a thing*. Especially in debug mode, it might be some type that does range checks and stuff. How about auto data = cont.data(); instead?
 
@refp I thought std::cout was an object?
 
> they imply certain things which aren't true
 
@Insilico exactly, it's an instance of a type - not a type itself
 
That's terrible. :-/
 
it's a book about a programming language, mostly they are terrible
 
6:19 PM
Especially in case of C++.
 
You'd think they get actual C++ programmers to copy-edit the book, no?
 
If "Professional C++" is any indication of the skills of professional C++ programmers, I hope I never get a C++ job.
 
@refp The Addison-Wesley books are usually very good though.
I think most (all?) the good C++ books on the Definitive Guide are published by Addison-Wesley
 
@Insilico I don't read books about programming language that often, just because they most often cannot be trusted with their content (and therefore I often say; "books are bad, generally")
 
@FredOverflow I... but... That's exactly what I just said....
 
6:20 PM
I'm more of a "trial and error" kinda guy, learning by doing.. and reading about others questions on sites such as SO
the reason for reading this book is because it's one of the first to cover c++11, and I'm interested how the features provided will be described
 
@refp Trial and error does not mix well with C++ because of all the UB.
 
Yeah most of the books listed in the Definite Guide are published by Addison-Wesley Professional.
 
@Mysticial I don't understand this discussion around us fixing the dupe list.
 
@FredOverflow that was basically my way of learning c++, until I started hanging out in ##c++ @ freenode (where a lot of Standard Lovers hang out, which in turn made me a standard lover myself)
 
It's clear to anyone with half a brain that the site is better with the edit than without it.
 
6:23 PM
@RMartinhoFernandes me neither... blown a bit out of proportion
 
Why people want to follow non-existent rules blindly surprises me.
Anyway, I'm off now.
Later.
 
@RMartinhoFernandes What site? What edit? What are you talking about?
 
@RMartinhoFernandes Later.
 
Your answer was perfectly fine Martinho. Thanks it was easy to understand in a matter of minutes. — SamHLec 4 mins ago
I'm smiling :)
 
"in a matter of minutes"? I hope it was a rather long post then..
 
6:26 PM
How can I pass pointers that are const? ideone.com/WBbbh
 
pretty much 20% of "Professional C++" consists of "if your compiler doesn't support auto you will have to write the snippet as:"
... I think people will get that auto is in C++11 after the first 20 examples written with that exact thing
 
sbi
@RMartinho, you here?
I have the same problem again.
 
@ManofOneWay the const should be outside of the std::vector template
 
@refp no, that's not right
 
@MooingDuck no? then I must have read the snippet wrong, let me check again
 
6:29 PM
@refp he currently has a mutable vector of mutable pointers to const data. That would give him a constant vector of constant pointers to mutable data.
 
@sbi How do you mean?
 
sbi
@ManofOneWay Start reading here.
 
That's a serious problem.
Perhaps you should see a doctor.
 
sbi
Damn. Anyone of you know some PS?
 
@sbi I was talking about the const outside of the std::vector template. Do you mean const std::vector<A*>?
 
6:31 PM
@ManofOneWay I'm not sure why that doesn't compile, let me play with it for a moment
 
sbi
@ManofOneWay I was talking about my problem. Sorry for the confusion.
 
@MooingDuck yeah, I saw it now.. if he really wanna do that (he = @ManofOneWay) he should just make the function const and the member vector mutable..
though that isn't really recommended.. of course
 
@ManofOneWay a0 is const, and your are trying to call a non-const method on it. That would violate const-correctness and hence is forbidden.
 
@FredOverflow I just want to have a pointer to it in my object :(
I haven't said I'm gonna change it in any way
I just way a pointer to it so that I can have a look at it
 
@ManofOneWay: OH! It has nothing to do with passing the vector. You're calling a mutating method (setPredecessors) on a constant object (a0)
 
6:34 PM
@ManofOneWay setPredecessors changes the member predecessors and hence cannot be called on a constant object.
 
the "const outside vector parameter" was my fault for reading the snippet wrong, sorry about that @ManofOneWay.
 
@ManofOneWay no, you're changing a0, by setting predecessors.
@ManofOneWay if you want an array of const data, you'll have to set all of the members 100% completely in the constructors.
 
Ah.. thanks @FredOverflow @MooingDuck @refp ....
 
@ManofOneWay wait a sec, I know how to fix this easy...
 
I just ate warm and now I sweat like crazy.
 
6:36 PM
you just ate.. "warm"?
 
The C++ syntax is killing me slowly.
 
@ManofOneWay just don't modifiy constant objects. ideone.com/Io5wg
 
hmm.. maybe I should head home
 
mannnnnnnnnnnnnn i am so bored
 
@ManofOneWay wait, why vector rather than array?
 
6:38 PM
I only took a walk to the office after todays shoot so that I could shower, I haven't done that yet and it's now 08:38 pm.. and it's fucking friday
I should head home and then get to a club, drink way too much and pass out on somebodies couch
 
Because @FredOverflow and @RMartinhoFernandes said so
I want to own a pointer-array
array/vector/something
 
0
Q: Can any finite bit string be found in pi within a reasonable amount of time?

cstaikosSo, a while back I read a joke that went something like this: "Never compute pi in binary - because it is goes on infinitely and is random, it theoretically contains every finite bit string. So, you will then possess all copyrighted material in existence and be liable for some serious fines." T...

er....
 
sbi
@refp A Germanism. He ate food that had been warmed. Hot food, I think it's called in English.
 
wtf...
 
vector is way better than a raw array, but you should be using a standard array. Very different. ideone.com/Io5wg
 
6:39 PM
@sbi yeah, probably - thanks for clearing that up!
 
wait, curses, that code is wrong
 
"vector is way better than a raw array".. in C++11 a std::array is better than a raw array, std::vector is a raw array on steriods, does the same thing.. AND MOAR.
 
@MooingDuck Will that code not copy the whole vector once?
 
@ManofOneWay yes it will
 
sbi
Damn, nobody even in meta's tavern. <yelling> Is anybody here who knows any Powershell? </yelling>
 
6:41 PM
@Mysticial haha, I was thinking in the same terms as that guy a few days back
 
@MooingDuck Is it possible to prevent?
 
@ManofOneWay yes, got it: ideone.com/Io5wg
 
@Mysticial if CPU's will grow more powerful faster than the speed of THE INTERNET using something as what he described would serve as the best compressionthingie, ever. though instead every computer could be shipped with a very very very large disk containing lookup for.. well, making a 3 byte string be equivalent to data of.. some large magnitude
it could be wickedly sweet to be honest
finding a whole image in binary instead the representation of pi sounds a little too spaced out though
 
@refp He doesn't understand the concept of information entropy. Even if you had infinite digits of Pi. The address containing XXX data will be at least as long as XXX itself.
 
@Mysticial even so, it's a fun question to ask
 
6:45 PM
@MooingDuck Why are you checking the size? =)
 
@MooingDuck because arrays suck
 
sbi
in The Comms Room on The Stack Exchange Network Chat, 17 mins ago, by SpacemanSpiff
Catching up on weeks of starred comments is fantastic
Nice.
 
@ManofOneWay in case you call the function again. It will always give you the same exact array, but by checking the size, we only initialize it the first time it's called. It's just paranoia in this case.
 
I wanna put a bot in here, with a purpose.. just because I'm bored as fuck (and people are tired of me talking SO chat <-> IRCd proxy <-> me
 
@FredOverflow std array not naked array
 
6:46 PM
@MooingDuck Ah okey. Thanks a lot!
 
@refp sbi nailed it
@MooingDuck Ah, you're talking about decent arrays with clothes on.
 
@FredOverflow what are you referring to now?
 
@FredOverflow right
 
7 mins ago, by sbi
@refp A Germanism. He ate food that had been warmed. Hot food, I think it's called in English.
 
@FredOverflow ah, I guess he did!
 
6:47 PM
0
Q: Why is unique_ptr<T>(T*) explicit?

FredOverflowThe following functions do not compile: std::unique_ptr<int> foo() { int* answer = new int(42); return answer; } std::unique_ptr<int> bar() { return new int(42); } I find this a bit inconvenient. What was the rationale for making std::unique_ptr<T>(T*) explicit?

 
@refp Oh heck, I'll make it a full-fledged answer...
 
@Mysticial you should, and you should also explain the theory behind it (unless you already thought of doing exactly that)
@FredOverflow David's answer is just pure BS to be honest.. someone could just change the body of the function to grab ownership, the caller wouldn't have a slightest idea about it
I don't like that answer.. at all, and now it's another one
I get their theory behind it, and sure it serves as some sort of protection but still.. well, maybe I'm the only one who thinks this way.
 
0
A: Can any finite bit string be found in pi within a reasonable amount of time?

MysticialExpanding on my comments. There's a very important concept here that's called information entropy. Even if you had infinite digits of Pi (which theoretically holds all possible information), the address that holds data XXX will (with extreme probability) be as large as XXX large. In other words...

 
@DomagojPandža @DeadMG @CatPlusPlus Take a look at this.
 
Not sure if anyone will buy my information entropy argument. It's an obscure topic unknown outside of cryptography...
 
7:00 PM
@EtiennedeMartel I'm going to take a look even though you didn't include my nick.
@Mysticial when using fancy words people will accept the answer even if they don't fully understand it's meaning.
 
I can only hope they will buy my last argument about having everyone's SSN.
 
how big of a deal is it to give someone else your SSN in the states?
 
@refp Big... supposedly.
 
our personal identification number here in sweden is public domain
or maybe "public domain" is the wrong choice of words, but anyone can go and get that information about anybody
(given some time to contact the proper authorities, of course.. you can't just look it up in a phonebook)
 
@Mysticial Worry not, the user is there to quote Wikipedia!
 
7:05 PM
@Mysticial I understand both halves of your answer, but I feel like the first half doesn't get the message across. It might help if you gave an example, like the offset of the first instance of the number 255. Show that since it's (hopefully) larger than 255, you're exchanging more data by exchanging the offset, not less.
 
@MooingDuck I suppose I could invert my answer and put the SSN example first.
 
@Mysticial no, I mean, show an actual offset. The SSN thing doesn't really show that sizeof(offset) > sizeof(data)
 
@Mysticial I agree with @MooingDuck (about the offset example)
 
@refp Good idea
 
the first offset of 255 is located at 1401, btw..
if you count the characters before, including the .
 
7:08 PM
@refp perfect
 
I'm gonna do it backwards, I'm gonna pick a random location in Pi and pull out a 9 digit number.
It's too expensive to find it the other way.
 
by trusting this hack;

http://www.math.utah.edu/~pa/math/pi.html + `search for 255, copy everything before the first occurence` + run this: javascript:alert("3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510 58209 74944 59230 78164 06286 20899 86280 34825 34211 70679 82148 08651 32823 06647 09384 46095 50582 23172 53594 08128 48111 74502 84102 70193 85211 05559 64462 29489 54930 38196 44288 10975 66593 34461 28475 64823 37867 83165 27120 19091 45648 56692 34603 48610 45432 66482 13393 60726 02491 41273 72458 70066 06315 58817 48815 20920 96282 92540 91715 36436 78925 90360 0113
 
Every location in pi is equally delicious.
 
@Mysticial not really? just take a 9 digit number which is located further back in pi then offset 9..
 
so by sending the offset rather than the full data, you've sent 20% more bits
@refp finding an arbitrary sequence is nontrivial
@refp his way is easier
 
7:10 PM
@CatPlusPlus I especially like the symmetric parts though
 
what? no.. what am I misunderstanding?
 
Pfft, if you're picking an arbitrary number, you can pick one at offset 0.
 
@Mysticial you just have to be sure it's the first instance of that sequence, else it's not a good example. Or just claim it is
@CatPlusPlus .... that works too.
 
@MooingDuck It's too hard to search. So I'll just say that's the first one I found.
 
It's about finding an offset of specific number.
 
7:11 PM
@CatPlusPlus yeah, but you can also pick a 9 digit sequence at offset N just to prove your point
 
@CatPlusPlus no wait, we want one where the index is greater than the number
 
it's not that hard to find..
 
Then pick one at offset 10.
Examples here are counterintuitive at best.
 
@Mysticial why is it so hard to search? can't you just grep through say, the first couple hundred megabytes of your 10 trillion digits?
 
though at offset 10 the data sent for a 9 digit sequence will be far less than the sequence itself
@melak47 my thought exactly
 
7:12 PM
@melak47 It's not in an easily readable format.
 
Well, okay.
 
@melak47 he has it compressed
 
@MooingDuck that makes sense I suppose
search there then
 
angio.net/pi/piquery too bad this side only had 200 million digits
we need at least 1 000 000 000
 
1 million, 200, either should work to demonstrate the isse :p
 
7:14 PM
@melak47 not to really prove the 9 digit sequence thingie, though he should be satisfied with a example using a 3 digit sequence
as 255 for example, the first occurence is at 1401, isn't that good enough?
 
@refp did you find that in binary or base 10?
 
base10, but it doesn't really matter
the theory is the same.. (kind of)
 
looking for say, the number 8472
 
@refp true enough
 
first occurance at digit 4860 :/
hm
that was unexpected
damn you, pi
 
7:16 PM
@melak47 unexpected, but not really that odd.. just pick another number
 
@melak47 it's probability. Try a different number
 
@melak47 you'd actually need to give stats on the /average/ offsets of any 4-digit number to make any sense. If you pick 1415, the offset will be '1', e.g.
 
@Mysticial the info in your current post, is it accurate or made up?
 
1337. index 4904
 
Not like I gained any rep from that answer anyways... I answered it just because I wanted to.
@refp It's accurate.
 
7:17 PM
someone help me pick a better number
 
@Mysticial cool
 
I'm just not sure if it's the first occurrence of the number though.
 
@melak47 why is that unexpected? The offset doesn't necessarily have to be high
 
@melak47 a better number than?
 
41 secs ago, by sehe
@melak47 you'd actually need to give stats on the /average/ offsets of any 4-digit number to make any sense. If you pick 1415, the offset will be '1', e.g.
 
7:17 PM
okay, here we go
9999 at index 18319 :)
 
@melak47 whats wrong with that one?
 
the index is smaller than the number..wasn't that the point of someone?
 
"pick me a better number" reminds me so much of
 
@sehe that's true, but since ip isn't following any pattern we could only do that for smaller sequences - and it loses it's purpose
 
lol, I didn't get the tick...
 
7:18 PM
or wait.. does it
 
@melak47 No. The point is that on average the offset will be larger
 
not really, but still..
 
@melak47 oh, I thought you found 1337 at index 4904
 
@refp Is the point
 
@Mysticial low rep askers.. it's not often they give the best answer the accepted mark
 
7:19 PM
right
 
@sehe average is hard to calculate
 
unless you are talking peniz size, that average is all over the net
btw a friend of mine told me about an interesting tweet (a week back or something); "if every spam mail was true the world would be filled with millionaires with 19 inch cocks", or something like that.. cannot recall the wording exactly
which is.. kinda funny
killthenoise wrote it, let me look it up
Imagine if all of your junk mail was legit... a world full of millionaires with 19 inch cocks... aka the apocalypse.
there we go
 
maybe I'm the only who thinks that's funny
 
Probably.
 
7:22 PM
@CatPlusPlus you are a cat and therefore shouldn't be on the internet by yourself.
 
@MooingDuck No it isn't. It's dead easy. Do it for al two digit base-10 sequences (there are only 100 of those).
 
Internet is made of me.
 
sbi
 
@CatPlusPlus the Internet is made of porn, and if porn's made of you.. well; I salute you, mother of porn.
 
@sehe good idea. You do that.
 
7:24 PM
@sbi I stopped working (with whats related to by job at the office) at 11 am, and it's 9:23 pm now and I'm still here
though I went away to do some whore work between 11 am and 06 pm, but heck
 
@MooingDuck There are four lights! teehee
 
I should head home..
 
@EdHeal LOL, you downvoted because the template was too hard to read. Job security indeed. :D — Potatoswatter 46 secs ago
 
but I know that the only reason for me to go home is to put on another set of clothes, take a shower (not in that order but I'm too lazy rewriting what I wrote, or move back to before the thing about clothes.. (this isn't vim)) and head out on a quest to party too hard and get drunk
 
sbi
Well, not quite, but soon.
 
7:28 PM
Soon.
 
very soon.
 
a new day doesn't start until you have gone to bed, slept and woke up.. then it's a new day. Most of y'all will claim today to be friday, though I'm at wednesday mentally
 
@sbi it's still lunchtime Friday here :(
 
@refp my English is soo bad... is "retarded" a right term here?
 
@Abyx the correct term would be "a guy who suffers from quite a severe case of insomnia, who cannot sleep without pills (which he doesn't like to take)"
 
7:31 PM
ah, right
 
Eh, a flag in a room between two persons?
 
One-on-one flag football?
 
Maybe I should link that Pi entropy question at some point. I might get a populist badge from it... lol :)
 
@Mysticial Maybe then you could explain a thing or two to this guy
0
Q: binary relation among prime numbers

facebook-1800001831Do we have any theory stating a relation between primes in binary system. I mean, in decimal system we have a pattern stating that "a number which is divided by 1 and itself is a prime". This was learned in my school when i was kid. But modern computation is performed on bits, in sense they are...

 
Sometimes, I kinda hate being repcapped...
 
7:41 PM
@Mysticial It's a cruel world…
 
Your answer is probably as good as it gets. +1
@Potatoswatter But that repcap is from the branch-predictor question... yeah 10 days later and it's still capping me.
I've answered 2 questions since then. I got the tick for the first one. :)
 
@Mysticial Yeah, you still get +15 for each tick. I think the most I ever got in one day was 290. But, it's better to have a job :vP
 
@Potatoswatter The OP in that doesn't seems to be helpable... lol
 
You don't see many users coming from Facebook.
 
I was bored so I just tested the first million digits of pi for the indices of 4 digit numbers
 
7:45 PM
My point is poor or easy program would make computer hard to compute the given input. that makes some sense if we go other way. I mean, very much computable instructions makes cpu job easy. THERE MUST BE A WAY!..THERE MUST BE A WAY!.. — facebook-1800001831 yesterday
 
Were they all there?
 
I dunno :p
I should probably check that, too
 
Well, at least it proves you were bored.
(Mathematically, no less.)
 
yep, all there
 
Even 1337?
 
7:48 PM
I checked that one earlier.
 
@MooingDuck Has anyone really been far even as decided to use even go want to do look more like?
 
index 4904
 
That's the ticket!
 
anyways, for 6300 of them their starting index in pi is bigger than the number itself
 
@MooingDuck Hence: "Unhelpable"
 
sbi
7:50 PM
This is the set of tags the fine folks at SF use for The Comms Room: How come this feels familiar? :)
 
@melak47 6300/9999?
 
@MooingDuck well 6300/10000. if 0 is a 4 digit number :)
 
Do you guys prefer to have an initial Capital letter on your methods in C++?
 
@ManofOneWay You mean PascalCase?
 
A::MethodName() or A::methodName or A::method_name()
 
7:52 PM
i_write_my_programs_all_in_lower_case
 
I follow the "default" convention of whatever language I'm currently using. So, PascalCase in C#, camelCase in Java and whatever_the_hell_stl_and_boost_use in C++.
 
theres_no_need_to_shout_but_the_underscores_mean_im_gritting_my_teeth
 
@ManofOneWay i_use_all_underscores_to_match_the_standard_library
 
@Potatoswatter well...still better than some of the D3D constants...
 
but most people use PascalCase
 
7:54 PM
D3D11_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST comes to mind
 
@MooingDuck On Windows, sure, because that's what Microsoft uses.
 
@melak47 Microsoft programmers just hate each other, and developers even more.
 
I'm acquiring more pies now
 
stupid freaking... why do our error reporting functions take mutable char pointers?
 
PascalCase looks nicer
 
7:56 PM
@ManofOneWay to you
 
To me :)
You don't think so?
 
@MooingDuck if there's already been an error that needs reporting, it's broken anyway :p
 
With love, from me, to you.
 
Underscores space things out horizontally. It's visually harder to divide words at capital letters.
 
I guess the same goes for variables then..
 
7:58 PM
_private_StaticINT_voidPointer_member_name ?
 
@MooingDuck Might be worth looking if anyone ever catches, modifies the string, and then rethrows the same object…
 

« first day (629 days earlier)      last day (4333 days later) »