« first day (744 days earlier)      last day (4202 days later) » 

5:00 PM
haha
 
Psy <3
 
@NeelBasu you can't use template metamagic at runtime, it can't be done. It also makes no sense. Maybe you need to be using virtual member functions?
 
He's about to breach the 600M views mark if he hasn't already
 
@MooingDuck or some switch case
 
@NeelBasu the information you have provided makes it sound like a switch case won't work. What do you do with ancestor<N>::Type in the switch?
@NeelBasu What this keeps coming down to is I don't know what you're trying to do in this function. Sorry :(
 
5:03 PM
for(i = 0;i< n ; ++i){
switch(i){
case 1:
ancestor<1>::Type;

case 2:
}
}
 
user142019
Dat whitespace.
 
user142019
/* FTFY */
for (i = 0; i < n; ++i) {
    switch (i) {
    case 1:
        ancestor<1>::Type
    }
}
 
I don't like { at the end of lines :(
 
Yeah, I prefer it on new line.
 
user142019
for (;;)
{

}
 
user142019
5:06 PM
@Borgleader ^ { is still at the end of the line.
 
Its also at the beginning
 
user142019
You didn’t say anything about that. :<
 
You know what I meant, you're just being a smartass
 
user142019
:)
 
user142019
I prefer indentation over braces.
 
user142019
5:07 PM
for i in range(n):
    if i == 1:
        do_this()
    elif i == 2:
        do_that()
 
I prefer indentation + braces
 
@VinayakGarg Sorry to hear that you don't like the electronics part. I rather enjoy that part.
 
I prefer single lines for i in range(n): if i == 1: do_this() elif i == 2: do_that()
 
I prefer no formatting what so ever.
 
user142019
@LuchianGrigore die.
 
user142019
5:09 PM
I prefer if-expressions rather than if-statements.
 
@Chimera And yet I am currently making a Digital Integrated Circuit prototyping GUI for fun :)
 
user142019
Looks more like a punchcard.
 
user142019
I want edible punchcards.
 
I dislike analog electronics, not the digital.
 
analog electronics? like your hair?
 
user142019
5:11 PM
I like software.
 
Ell
I like software and hardware
 
user142019
I like hot babes.
 
You like sleep next to them you mean
2
 
@VinayakGarg lol
 
user142019
5:13 PM
@CatPlusPlus lol
 
@VinayakGarg Looks good.
 
@Chimera I am looking for some one to join! Would you or anyone like to work on project? :) It is on github. Started few days ago.
 
@VinayakGarg It sounds like a great project, but right now I'm pretty busy.... but I know some people that might be interested... I'll ask some friends.
 
sure!
 
I've forgotten how fucking good naan was.
 
5:19 PM
posted on October 29, 2012 by Herb Sutter

In my talk on Friday, there will be announcements of broad interest to C++ developers on all compilers and platforms. Please help spread the word. The Future of C++ Friday, November 2, 2012 12:45pm (U.S. Pacific Time) This talk will give an update on recent progress and near-future directions for C++, both at Microsoft and [...]

 
user142019
Is it possible to have race conditions with only one thread with signals?
 
I wonder if Herb Sutter is gonna participate in Movember. After all, he can really get a badass mustache.
 
Does anyone know server admin stuff here ?
 
Depends
 
@kbok Yup. What kind of?
 
5:22 PM
@Zoidberg'-- Sure, they interrupt the process afterall
 
@sehe I need a few pointers for how to write an init script. In particular, my app runs with nodejs so I'm not confortable using pidof
Also, it's unstable so I'd like it to respawn when it crashes
ALSO, the URL rewriting of my apache reverse proxying doesn't work in all cases and I can't figure out why.
 
@EtiennedeMartel Yeah, I've started getting some pretty good winds and rain here at home, but I'm quite a ways from the worst of it
 
Xeo
If anyone disagrees with the pinning, feel free to remove it. :)
I just think it should be a bit more visible than just a message from the Feeds guy
 
@Xeo can't pin the feeds guy?
 
5:26 PM
@Collin From what I've seen, we're gonna get the rest of it here in Montreal. So, lots of rain in the coming days.
 
This is always good to remind people that, after all, this room should be more or less about C++.
 
Xeo
@MooingDuck Looks ugly on the starboard.
 
I think Vinayak beat you to it.
 
@Xeo it was already on the star board
 
Xeo
@TonyTheLion Oh damn!
Well, so much for that. :)
Pinned Vinayak's message
 
5:27 PM
@EtiennedeMartel Yeah, I'm not too worried, but there's one particular tree that sorta hangs over my house I'm keeping an eye on. Other than that, we're on a bit of a hill, so I'm not concerned with flooding
 
@NeelBasu sorry, browser closed itself. That works fine. I finally figured out how you're intending to use it I think
I wish when my computer was going to restart it would start with Visual Studio, since that takes like 15 minutes.
 
@MooingDuck Thanks
 
Can someone help me change a recursive algorithm to something iterative/stackbased
 
@JohnSmith I generally just use a queue for that.
 
well whatever structure works
it is a simple alg but i'd like to see how it's done
 
5:36 PM
while(queue is not empty)
    pop element
    do something with element
    push children of element in queue
^ pseudocode
 
Wasn't he here yesterday asking the same exact thing?
I'm having quite the déja vu here
 
Dunno. I wasn't really here yesterday.
 
yes, Borgleader, but nobody was able to help me at the time
function f(a,b)
   if b==-1: return 1
   if a==1: return 0
   if a==2: return 2
   r=f(a-2, arr[a-1])
   l=f(a-1, arr[a-2])
   return (l+r)
is my algorithm
 
That's fibonacci
 
it's similar
 
5:38 PM
afaik
 
it's not fibonacci
 
well its close as hell
and the sane way of doing fibonacci is the non-recursive way
 
i just dont know what to do when there is two recursive calls
 
If I were you I'd think about what the code does (at a high level), then forget about the recursive code you already have and think of a loop based way of doing it
 
Don't ever do Fibonacci this way.
 
5:44 PM
@kbok sounds like three questions on Super User. Can you use upstart instead of SYSV init scripts? Usually, I just copy/paste an existing item
@CatPlusPlus Closed form? /cc @Borgleader
 
Ell
I want to try and use yui with jsfiddle
 
@JohnSmith Christmas tree recursion, yay
 
For monitoring services I usually use supervisord.
 
1
A: Writing a recursive function iteratively

Mooing DuckFirst, here's your code compressed (I do this for answering, don't do this in real code.) double function(int j, int i) { if(i == 0 || j == 1) return 1; if(i == 1 || j == 0) return j; if(i > 0) return j * function(j, --i); return 1 / (function(j, -i)); //changed this to -i ...

 
argh
 
5:46 PM
@JohnSmith ah, that's more complicated than the code I answered :/
 
thanks anyway guys
 
Ell
@Borgleader I find fibonacci much easier to define with a recurrence relationship
 
@JohnSmith I think that code is wrong, since if b is not -1, it is completely ignored.
 
@JohnSmith Can it be represented as recurrence?
 
Stop doing silly CS exercises with no meaning behind them.
 
5:48 PM
@Borgleader it's fibonacci with a starting sequence of 0, 2, instead of 0, 1
 
Mooing: The code's right
and it's not Fibonacci
 
@JohnSmith you say it's not, but the code says it is
 
Vinayak: If it could I would have used a matrix instead
 
@Ell Computationally speaking the recursive way is retarded. Unless you make it complicated and add a structure to save intermediate results, but even then.
 
@JohnSmith what is arr and why is it completely ignored in your code?
 
5:49 PM
No, it doesn't. Where does it say it's Fibonacci?
f doesn't mean Fibonacci, usually, you know.
 
I decided to fool around a bit with the #plugin and the picture to attract your attention :) http://www.viva64.com/en/b/0174/ #dev http://t.co/R5xThUKb
 
because arr is a precomputed set of values
 
^ Looks like Andrey made a little PR mistake here
 
@JohnSmith Yeah, I was going to suggest that only.
 
it's just used for reference pulling
 
5:49 PM
function f(a)
if a==1: return 0
if a==2: return 2
return (f(a-1)+f(a-2))
//exactly the same results as your code
@JohnSmith no, it's not actually. It's completely ignored.
 
I use my ass for reference-pulling, mostly
 
it's not ignored because it becomes the new argument for the next iteration
 
It's not used anywhere.
 
did you see the line "if b==-1"
it's not ignored, dude
 
Yup. So you've got an array that has -1 somewhere, great.
 
5:51 PM
How could that ^ masterpiece of starbait have failed. Ever
 
Makes sense.
That entire function is still exponentially bad, so it doesn't make much of a difference.
 
it's only bad because it;s recursive
i am trying to make it iterative
 
@sehe Nope, arch linux still uses SYSV init
 
It's bad, because it's not memoised.
 
@kbok Poor thing.
@CatPlusPlus memoized* FTFY
 
5:53 PM
it is memoized, i just didn't list the decorator here
 
Also if it requires asking a question I think it belongs on serverfault
 
@memoized occurs atop the function
 
Then there's no problem.
 
it is a problem
recursion = slow
and python doesn't optimize tail recursion or whatever
stackoverflow problems
the function is written correctly and works. I just want to learn to make it better
translating recursive to iterative is a huge weakness of mine
 
Hm, Fallout: New Vegas, with all the DLCs, is on sale at 15$ on Steam. I wonder if I should get it.
 
5:55 PM
Start by understanding what you're doing, instead of cargo culting bullshit like "recursion = slow"
 
@JohnSmith That line will never ever be executed. Because if a is either 2 or 1 you return right away. It starts recursing at 3, which will call itself with values of b that are 2 and 1, and higher value of a will imply that b is also higher. Hence b will never b == -1.
 
@EtiennedeMartel No
@EtiennedeMartel Except if you want to kiss your social life goodbye
 
Oh, right.
So that means yes?
 
@Borgleader b is taken from the array, which is there for some inexplicable reason, and it probably has some -1 in it, for another reason
 
correct
 
5:56 PM
@Borgleader I misread, he's right, it can trigger, depending on the preexisting contents of arr
 
Of course it's all meaningless, because why not.
 
I'm telling you, the function's correct, lol.
 
@JohnSmith Recursion isn't slow per se. For example, it's perfectly fine to use recursion in Scala (with the @tailrec annotation) or Haskell.
 
@EtiennedeMartel If you're looking for a deal, yes. Fallout is a great game and is worth way more than $15 by itself.
 
Oh good lord... this is quite possibly the worst abomination of all times...
 
5:57 PM
@JohnSmith the reason we can't help is because the function depends fundamentally on what that array holds, which you haven't described to us. Ergo, we can't change the fucntion for you (much)
 
@FredOverflow Well, for some reason it seems to be much slower for me in both Python and C++ to use recursion over iterative approach
 
The biggest appeal of recursion is that in some cases while it may be slower, it makes the code a hell of a lot simpler and shorter.
 
Did you compile the C++ version in release mode?
 
> First revoke any setuid or setgid privileges that daemon may have been installed with (by system administrators who laugh in the face of danger).
 
@MooingDuck Why does the contents of arr matter? arr contains a bunch of xor'd values minus one, and there's no rhyme or reason to it in terms of loop pattern, which is why the recursion ends early given the conditional
 
5:58 PM
If you're spending more than 5 minutes on a function that adds two values and halts based on an array then I don't know what to tell you.
 
> system administrators who laugh in the face of danger
lol
 
@FredOverflow Yes
 
@JohnSmith because it's fundamental to how the algorithm works. If the array is all zeros, you have the Fibonacci sequence (except different starting numbers)
 
Ell
@CatPlusPlus don't discourage :L
you gotta start somewhere
 
> The Steam Store is experiencing some heavy load right now. Please try again later.
I wonder if that has anything to do with the Halloween sale going on right now.
 
5:59 PM
Oh shit halloween sale
gotta check
(even though i have like 160 games on steam already)
 
@JohnSmith if the array is merely part of memoization, then that's another thing altogeather.
 
@sehe Oh, right, daemon does everything I need. Thanks :)
 
@Ell It's a waste of time.
 
@MooingDuck The array is precomputed before f() is even called for the first time
it's the result of a rolling xor loop
 
Especially if the function is not very useful, and already memoised, so you can precompute whatever you need and have it just sit there.
 
6:03 PM
the f() function is a dynamic pruning function that stops when the target (b) is -1
the details are themselves not vital but rather the looping structure in place of the recursion
i've done this a thousand times before
i just suck at the translation
doesn't depend specifically on arr in terms of arranging the loop structure
 
Well it's hard to test a solution without the contents of the array
 
Candy Week at Ludia. Time to get fat.
 
Hallo!
 
6:06 PM
Halo!
 
Sup Robot?
 
I just arrived in Berlin.
 
@EtiennedeMartel good to know
 
6:11 PM
@R.MartinhoFernandes So, how is it there?
 
It's whooping 1 degree here.
And it was snowing during weekend. Fucking snow, in October!
 
10 degrees here
 
From other annoying things, fuck GameUX forever.
 
The Internets say 0 degrees. I win.
 
user142019
6:13 PM
temperature ⩵ 9
 
Roughly 15 here. Pretty warm for late October.
 
Seriously, who thought it would be a good idea to inject this shit to every game.
 
HN is so lame sometimes
 
@R.MartinhoFernandes Meh, that's nothing. No pun intended.
 
6:13 PM
Always hover before you click? Wrong. http://www.frameloss.org/2012/10/28/hover-fail/ (http://bit.ly/Ua1lOK) #trending #guru
 
Now it stops and doing nothing for 2 or 3 minutes before the game actually starts.
 
@CatPlusPlus What's this ?
 
Fuck you Microsoft and your half-assed innovations that nobody needs.
Game Explorer.
 
Never heard of
 
Almost every game runs GameUXShim on start to do something
 
6:14 PM
You mean Games for Windows Live?
 
I have no idea what the cat is ranting about.
 
Start > Games.
 
Me neither.
Why can't you just ./nethack like everyone else.
 
he just goes off on a tangent rant on a occasion
 
6:15 PM
He's completely crazy.
Well, he's always been kind of crazy.
 
@CatPlusPlus Shows me a window with a bunch of white. What about it?
 
@R.MartinhoFernandes slow to load
I guess that's what @Cat is on about
 
Fuck Game Explorer itself, who uses that.
 
@TonyTheLion Nope, I'm pretty sure it's fully loaded already.
 
The problem is injected code that updates shit in Game Explorer.
 
6:16 PM
yea what is the point of that anyways?
seems pointless to me
 
MS and their infinite wisdom
 
"many of the killed were women and children", as if it is better to kill men
 
@JohnSmith ideone.com/FRto5R I couldn't get it completely non-recursive, but this should be slightly faster and limit the call depth to a/2 calls.
 
@KnowItAllWannabe VC++ 2012 does not support any cool nor breaking (vs C++03) features of the language. The fact that it is not the default, nor that all features are implemented are the reasons "C++" != "C++11" (well, maybe in PHP that would return true...) — rubenvb 41 secs ago
it says false, I swear.
And my opinion is probably not shared with 90% of the room's inhabitants.
 
It's very long comment, can you post abridged version.
 
6:29 PM
How?
It's only the last part that's in any form relevant to daily Lounge<C++> business
 
I see PHP mentioned there, and don't feel like reading the rest
 
You really are a cat. You're so lazy.
 
He's not just a cat. He's a cat whose abilities are a superset of those of a regular cat, those additional abilities include speech and sarcasm.
 
freaking GCC error messages
does std::pair<int, int> have a hash in the stdlib?
 
@Borgleader And the assumed ability to use a toilet.
 
user142019
6:34 PM
GCC sucks. Use GHC.
 
/home/EZkliA/ccEOAKHE.o: In function `std::_Hashtable<std::pair<int, int>, std::pair<std::pair<int, int> const, int>, std::allocator<std::pair<std::pair<int, int> const, int> >, std::_Select1st<std::pair<std::pair<int, int> const, int> >, std::equal_to<std::pair<int, int> >, std::hash<std::pair<int, int> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, false, false, true>::find(std::pair<int, int> const&)':
prog.cpp:(.text._ZNSt10_HashtableISt4pairIiiES0_IKS1_iESaIS3_ESt10_Select1stIS3_ESt8equal_toIS1_ESt4hashIS1_ENSt8__detail18
 
@rubenvb I thought VC++ 2012 supported lambdas and moves. Both of these are cool, and the later is a breaking change (it only manifests in pathological cases, though).
 
oh there it is at the end. undefined reference to std::hash<std::pair<int, int> >::operator()(std::pair<int, int>) const'
 
@MooingDuck Probably not.
 
I think that means your computers flux capacitor needs to be recharged.
 
6:35 PM
@R.MartinhoFernandes It does.
 
I think only std::hash<std::string> is defined in standard.
Because it's C++
 
also supports decltype, nullptr, auto, static_assert, trailing returns, and a few other things like >> for templates and variadic macros that it had prior to C++11.
 
And it apparently makes sense.
 
variadic templates are the only major feature it doesn't have.
 
0
Q: cannot convert `char (*)[((unsigned int)((int)Tlength))]' to `char**

Ahmet Melih BaşbuğI have a question in my codes. Can anyone help me? #include<iostream> #include<string> #define maxn 100100 using namespace std; void print(char S[],char **path, int i, int j){ if(i==0 || j==0) return; if(path[i][j]=='c'){ print(S,path,i-1,j-1); cout<...

^^ Fine example of C declaration gibberish. :)
 
6:39 PM
Oh, ffs.
 
ffs?
 
FFS = For Fuck's Sake
 
For Finagle's sake.
 
Can we help you? NO! Take out the using namespace std;
And OMG! Is that a printf()!
 
I'm not sure why that is even tagged c++
 
6:41 PM
@DeadMG do you really need to tell everyone every time you downvote a question?
 
> convinience
 
Xeo
@DeadMG constexpr?
 
@Rapptz because int Slength = strlen(S);
 
@Rapptz Doesn't compile as C. Though, OTOH, it doesn't compile as C++ either.
@Xeo You think VC++ supports constexpr?
lol
 
@Xeo Not really a major feature. It's just sugar over regular templates.
 
Xeo
6:41 PM
No, I meant that as a response to "the only major feature"
@DeadMG Ah, no, not really.
 
@R.MartinhoFernandes No. But I usually do. I mean, anonymous downvotes suck.
 
Xeo
Also, it's the feature that took the longest to implement in Clang, IIRC
7 month or something.
 
probably because they have an awful codebase ^^
 
@DeadMG They suck because you don't know why it was downvoted. Not because you don't know who downvoted. Your comment only outs you as the perpetrator; it doesn't give a motive.
 
user142019
@Xeo yeah the fat guy from the GN presentation said that.
 
6:43 PM
@DeadMG Nah, it's really messy as a feature. Mostly because it's not just sugar over templates.
 
Xeo
@Zoidberg'-- Chandler Carruth
And wtf "fat guy"
 
@R.MartinhoFernandes In what way? Maybe I just wasn't paying enough attention.
 
@JohnSmith Also, as the cat said: MEMOIZE! your version runs in 3.3s, memoized runs in 0.0s.
 
but constexpr isn't a feature I miss in VC, unlike variadic templates
 
No variadic templates in MSVC?
 
6:45 PM
@Borgleader nope
 
That sucks :(
 
@DeadMG It can work with literal types, for example.
 
I can upvote.
:-)
 
It can handle strings.
 
strings is nice
but what's a literal type?
 
6:46 PM
It puts the lotion on it's skin!
 
@DeadMG A type with a constexpr ctor. More or less.
Though TBH I see no reason templates can't handle them.
 
right, but fundamentally, it's only useful if you need to do a whole bunch of compile-time computation
and having no dynamic compile-time allocation pretty much limits what you can do anyway
 
@DeadMG it's nice to be able to use boost::units at compile time
 
@DeadMG Haha! But you can do dynamic compile-time allocation :P
 
Xeo
@DeadMG Fixed constexpr is Turning-complete, with temporaries and recursion.
 
6:49 PM
you can have constexpr std::string?
 
(There are some examples somewhere in the transcript)
@DeadMG Ah, no, not with new.
 
@R.MartinhoFernandes I was talking about init lists, which AFAIR are also breaking.
 
You can do it simply with temporaries because in constexpr they are magical and live forever or some such.
@rubenvb What do they break, exactly?
 
@R.MartinhoFernandes int arr[1] = {0.0};
 
Xeo
@R.MartinhoFernandes Why would they need to be magical?
@rubenvb list-initialization != init-lists. :>
 
6:53 PM
@Pete No, the example in 8.5.4/3 has two initializers. If you want a more definitive proof, the rules for aggregate initialization in §8.5.1/2 read "(...) If the initializer-clause is an expression and a narrowing conversion (8.5.4) is required to convert the expression, the program is ill-formed." — R. Martinho Fernandes Oct 13 at 15:13
Check me out quoting the robot quoting the standard.
 
> At the February 2012 WG21 meeting, we decided that this was a defect in the standard, and the chosen resolution included the ability to create values of class types with pointer or reference members which designate temporaries. This allows an unbounded quantity of information to be accumulated and processed by a constexpr function, and is sufficient to make constexpr evaluation Turing-complete (assuming that the implementation supports recursion to an unbounded depth).
11
A: Is constexpr-based computation Turing complete?

Richard SmithTLDR: constexpr in C++11 was not Turing-complete, due to a bug in the specification of the language, but that bug is in the process of being addressed, and clang already implements the fix. constexpr, as specified in the ISO C++11 international standard, is not Turing-complete. Sketch proof: E...

Temporaries in constexpr are not temporary.
 
Xeo
@R.MartinhoFernandes Oh, I kinda overlooked the member stuff part.
 
that's not part of C++11
 
@DeadMG Yes, it is. It was a defect.
 
and still is, if it was only corrected in 2012
as in, the published finalized version still contains said defect
 
Ell
6:56 PM
wow, litb is really a clever guy
 
@DeadMG So? C++11 is the published version plus defect resolutions.
 
Xeo
0
A: How does the STL mix with self move assignment?

Howard Hinnant17.6.4.9 Function arguments [res.on.arguments] 1 Each of the following applies to all arguments to functions defined in the C++ standard library, unless explicitly stated otherwise. ... If a function argument binds to an rvalue reference parameter, the implementation may assume...

Ew.
 
I didn't realize that resolved DRs actually counted as part of this Standard.
I thought they were "resolved" by changing the wording of the next Standard.
 
Quite a long period.
 
Ell
speaking of periods
 
6:58 PM
uh oh
 
@Xeo Oh, shit.
 

« first day (744 days earlier)      last day (4202 days later) »