« first day (458 days earlier)      last day (4491 days later) » 

8:00 PM
:(
 
@DzekTrek Why would you want to? The whole point of Project Euler is to solve the problems yourself.
 
That said, you can probably find working solutions for a lot of them in answers to SO questions.
 
It's easy. I want to see how other people approach to specific solving matter.
 
@DzekTrek How many Project Euler problems have you solved yet?
 
8:04 PM
Around 80 so far, but I don't hang around there a lot.
 
Congratulations, I have solved 3 and then gave up :)
 
user142019
I solved problem 1 and got bored.
 
Nowadays I more often go to troll, however I am loosing attraction to that too.
 
How do you troll on Project Euler?
4
 
8:06 PM
Not on Project Euler, but on chat rooms, like this one :troll:
It was very funny in the beginning, however it is not anymore after seeing that I don't achieve anything by doing that, except tiny and short living boost of happiness.
 
user142019
 
Wow, according to Hugo Chavez, the US have a cancer gun.
 
Anyone got 2 minutes to look over the email I'm about to send to the SE team?
 
I can see a missing apostrophe.
What should I be looking for?
 
I have just finished my 83( actually 83, just saw it ) task for Euler. It took me 4 mins. I pasted a code from my VS to pastebin.com/nUgHEWbc
 
8:22 PM
is SO shutting down tomorrow in SOPA protest?
 
Why not?
 
@DzekTrek What's that ONLINE_JUDGE thing?
 
@RMartinhoFernandes does it make sense? Is there anything in it that should be rephrased?
 
@jalf I think it's ok.
 
8:25 PM
I need someone to troll, so I made things ONLINE JUDGE, ONLINE TROLL or ONLINE MARIO.
 
Also, that's C code.
#includeing C++ header does not magically change that.
 
It's C++ 4.0.0-8. :)
 
I think it's fine. You may what to clarify why you think that resetting your rep and badges would help the situation (vs. simply walking away from the site and leaving your account as is).
 
I've seen some pretty fugly code in my time, and that certainly ranks pretty low
 
#define rep(i,n) for(int i=0;i<(n);++i) is probably the ugliest line in that snippet.
 
8:27 PM
As I said, I have done it in 3 mins :D
I couldn't write it faster. :P
 
You said four.
 
I didn't count my time, but lets say I did it around 5 mins.
 
That rep macro is not even used.
 
sbi
@jalf I trust you have read stacksbi.wordpress.com/2011/03/20/sbi-is-leaving? I'm out of the game, too. Last year, I haven't made half the rep I used to make. That doesn't mean I can't enjoy the company here, though. And having 50k rep does have its advantages.
 
lol, just saw it.
well, I used func solve() instread ;)
 
8:31 PM
Instead of what? Instead of loops?
 
nah, instead of many things
I implemented it using just one func instead of many defs and simple funcs()
I guess I forgot to remove it in a hurrty
hurry
 
There are four functions in that code.
Why the messing around with clock()?
Are you sure we're talking about the same Project Euler here?
 
yep, len("..."),generate("..."), solve("...") and main("...")
 
There are no time constraints on Project Euler.
You just solve the problem however you want (pen & paper, computer, whatever) and type in the solution in the box, whenever you want to.
 
It is PE.
 
8:39 PM
What problem is this one?
 
clock is here a simple int
based on the calculation fon time
 
What time?
Why care about time?
 
Based on 67, it's some kind of mutation.
 
So, this is problem 67?
 
You can tell it that way, however my implementation of that problem .:)
much more complex.
 
8:45 PM
Hmm. Problem 67 is about finding a maximum. The program seems to be computing a minimum.
 
well yes, kinda of implementation it
 
What do you mean? How can you find a maximum using min_element and min?
 
I have made my programm to calculate shortest distance between two vectors, however that distance must not be 0.
 
yes.
 
8:48 PM
> Find the maximum total from top to bottom in triangle.txt (right click and 'Save Link/Target As...'), a 15K text file containing a triangle with one-hundred rows.
How is this related to vectors?
 
You see
this function
contains vectors
and for instanec
 
That makes no sense.
 
it has to find min distance between two vecs[ one dot presents x, another y and together they form XY triangle like computational object] which is almost identical to finding max
for the given issue
 
That still makes no sense.
 
@sbi yeah, I read it back when you wrote it. :)
 
8:53 PM
can you troll on project euler?
@RMartinhoFernandes i put some silly comment onto your q
 
@Martinho just follow the logic, and you will see it's completely identical to what is needed.
 
@DzekTrek No, it's not.
 
if you are einstein perhaps you can troll on project euler xD
 
It's completely unrelated, and it looks like something for the UVA online judge, not for Project Euler.
 
OK, build app with your vision of solution and build my app, input whatever you like and you will see outcome is the same.
 
8:55 PM
I has all the telltale signs: silly macros, massive pile of #includes at the start. Then there's a loop that loops only for a certain time, and there's checks for ONLINE_JUDGE which the UVA online judge defines.
@JohannesSchaublitb What did you mean about the Madrid meeting?
Can I do struct foo { decltype(this) f(); };?
 
@RMartinhoFernandes that it is possible to say auto f() -> decltype(this);
 
@JohannesSchaublitb Outside a function body?
 
guys question, if I get a seg fault on something and then I gdb backtrace it and then there tons of entries, is that a sign for a stackoverflow ?
 
including implicit this, like in auto begin() -> decltype(m.begin());. it was necessary to support "this" here, since we a 'const' member function "begin" would need to access "m" over a const access path
 
@bamboon If there's a repeating pattern in the backtrace, it's certainly a stackoverflow.
 
8:57 PM
@RMartinhoFernandes just like i declared it. yes, that is not part of a function body. it is part of the function declarator
 
@JohannesSchaublitb Oh, that's cool. Does clang support that?
@JohannesSchaublitb Yes, but it could be in a function body :P void f() { auto f() -> decltype(this); }
 
yes
that's true
@RMartinhoFernandes dunno whether clang supports it
 
GCC and MSVC don't like it.
You have to std::declval<ThisType>() everything :(
@DzekTrek I'm going to conclude that your nonsense is not worth listening to. Consider yourself plonked.
 
that's not equivalent at all
 
It's the best one can do.
 
9:02 PM
auto f() const -> decltype(this); is not equivalent to auto f() const -> decltype(declval<ThisType>());
then why not ThisType f() const;
 
You may want to access members.
Or pass as a parameter.
 
you can say auto f() const -> decltype(member.foo());
 
Hey do structs get passed as pointers?
 
even with older gcc
you just cannot have the constness of the member function be transferred to the member select expression. because basically the "member" itself is not part of any member select expression as the right operand of it.
 
By this i mean if i were to attempt to print out the data of a struct would i just have printf("%x", structure);
 
9:05 PM
@JohannesSchaublitb Hmm. Now I can't remember what it was that caused me grief.
Damn.
 
@RMartinhoFernandes the "member" in this case is just found using ordinary unqualified name lookup, and since in declarators the class is not considered complete, "member" must be declared before used there (this also applies with the new rules where you can use "this", btw. not the complete class scope is accessible).
 
I remember @DeadMG going through the same issue on MSVC, but I can't recall exactly what it was.
I thought this was it.
@oorosco No, that won't work.
 
I used:
int x = sizeof(Structure);
for(int a=0; a < x; a++)
printf(" %x ", Structure + x);
@RMartinhoFernandes so that wouldn't work?
 
user142019
The type of sizeof is size_t, not int. <— just a side note
 
IIRC %x specifies printing hexadecimal, no?
That expects an integer.
What's Structure? A pointer?
 
9:08 PM
Structure is the name of a struct
 
Than what is Structure + x supposed to be?
 
oops it's supposted to be "Structure + a"
but i thought i could iterate through the allocated memory grabbing byte by byte
 
For that you need a pointer to char.
@Johannes, well, I'll fix my answer.
 
so create a char pointer?
 
Why do you want to print the memory byte by byte?
 
9:12 PM
It's to mess around with how to iterate through memory
I just have no idea how to go about it
 
Hello
 
user142019
hi
 
l0lz0r5z
 
@oorosco But why do you need that? Why not just print the structure normally?
 
Are there any people playing modern warfare 3?
Here ofcourse.
 
9:14 PM
@JohannesSchaublitb FTR, GCC 4.7 supports it. Awesome, I have old code to improve.
 
Well the struct is a object and i'm trying to learn how to iterate through the memory it's saved in. :|
It's something that was mentioned in class the other day and i'm toying with it now.
 
Well, you reinterpret_cast to a char* and then go through that.
It's a ticket to UB-land, so beware.
 
@RMartinhoFernandes What's going on?
 
UB?
 
@DeadMG Remember how decltype sucks on function declarations because you can't use this?
 
user142019
9:17 PM
UB = undefined behavior. That means that anything can happen.
 
yes, I well remember
 
@oorosco Utter bollocks Undefined behaviour.
@DeadMG Well, apparently you can. It's just that compilers still suck.
 
it is a significant irritant and hindrance
 
My fresh GCC 4.7 snapshot (less than a day old) supports it already.
 
hum
 
9:48 PM
0
Q: Can any modern OO language compete with C++'s array store performance?

FredOverflowI just noticed that every modern OO programming language that I am at least somewhat familiar with (which is basically just Java, C# and D) allows covariant arrays. That is, a string array is an object array: Object[] arr = new String[2]; // Java, C# and D allow this Array covariance are a h...

something I just wondered
 
Covariant arrays are so sucky.
It's certainly a design mistake in D.
And probably on the other two as well.
 
We certainly don't need covariant arrays in C# since 2.0
 
Exactly. But it's hard to call it a design mistake when it was designed before that :)
 
So all we have to do is design a perfect language from scratch and then never evolve it :)
 
Or reserve the ability to remove or completely reshape functionality.
 
9:53 PM
There was D1, and then came D2. Why didn't they abandon covariant arrays in D2?
 
No idea. They should have.
 
Time for D3. Now in 3D and with invariant arrays!
 
The term for lack of variance is "invariant".
 
Cool, F# forbids this.
 
9:57 PM
Do you agree that the question should be moved to programmers? I certainly wouldn't mind...
 
It does look like the kind of thing people post there. It seems SO is for questions with specific problems, while PSE is for more general stuff.
 
@RMartinhoFernandes [| "st" |] is a funny array syntax :)
 
It's from OCaml. Made by French...
 
OCaml reminds me of CamelCase. Is there an OCamlCase? :)
 
10:00 PM
oh, 10 upvotes already
According to a comment, Scala seems to disallow it statically, but it's the JVM, so it's probably still gonna do the test :(
 
Hi
 
@Mahesh What can we do for you today?
 
@FredOverflow - Here you go. I was going through Registering Control Handlers tutorial on windows. ( msdn.microsoft.com/en-us/library/ms685049(v=vs.85).aspx). When I hit Ctrl+C, I get a first chance exception. Why ?
 
I don't know what a Control Handler is, and I don't know what a "first chance" exception is. Sorry :)
 
> If a console process is being debugged and CTRL+C signals have not been disabled, the system generates a DBG_CONTROL_C exception. This exception is raised only for the benefit of the debugger, and an application should never use an exception handler to deal with it.
> If the debugger handles the exception, an application will not notice the CTRL+C, with one exception: alertable waits will terminate. If the debugger passes the exception on unhandled, CTRL+C is passed to the console process and treated as a signal, as previously discussed.
 
10:08 PM
I always forget this: how do I trigger a rep recalc?
 
Go to the hidden reputation audit page.
 
Damn, I lost 12 with the recalc. No more 42 :(
 
Today was an annoying day. After I hit the repcap, I got a sudden surge of (so far) 20 votes on an answer.
 
I "lost" 53 points, not a big deal :)
I just felt I needed to repost that :)
 
10:12 PM
But I'm going to get my C++ gold badge when the next check is run, so it's all good :)
 
@RMartinhoFernandes Can one get multiple C++ gold badges or just one? I have one.
 
Lol, I have a bronze C++0x badge. Guess that won't turn golden anytime soon :)
 
Could someone reopen this? stackoverflow.com/questions/8902055/…
Should probably be closed again, but the guy did edit+improve his original post
 
done
 
10:15 PM
@FredOverflow I was the first to get a bronze C++11.
Multidimensional arrays. Ugh.
And not with compile-time sizes, so I can't just link-drop my "2d array template for SO questions about 2d arrays".
 
-2
Q: Multi-dimensional array in C++

user1154926I need to create a function that has one parameter which is a multi-dimensional array with two dimensions being user-specified, e.g. int function(int a, int b, int array[a][b]) { ... } How would I do that in C++ ?

0
Q: Multidimentional Array c++

user1154926I need to create a function that has one parameter which is a multi-dimensional array with two dimensions being user-specified, e.g. int function(int a, int b, int array[a][b]) { ... } How would I do that in C++ ?

lol?
0
A: Can any modern OO language compete with C++'s array store performance?

Jonathan M DavisD doesn't have covariant arrays. It allowed them prior to the most recent release (dmd 2.057), but that bug has been fixed.

awesome!
 
Bug! See, I was right.
 
:D
 
Can questions be closed as duplicates of one another? :)
 
@Martinho, did you solve the 67 ? :)
@FredOverflow , of course they can
moreover it is on the user first to see whether the question he is going to post was already posted. ;)
 
10:24 PM
int[10][10] decays to int*[10], right? And then to int**? No?
Wait, not that.
It's to int(*)[10] first.
And then it can't decay anymore.
 
Right, there is no decay from int[10][10] to int**, see my FAQ.
 
@FredOverflow Yeah, I knew that didn't make sense, but my wrong middle step was casting doubts.
 
> there is no implicit conversion from T[h][w] to T**. If such an implicit conversion did exist, the result would be a pointer to the first element of an array of h pointers to T (each pointing to the first element of a line in the original 2D array), but that pointer array does not exist anywhere in memory yet.
 
int[10][10] - > int(*) [ 10 ]
 
Stupid C declarator syntax.
Y U PREFIX, DEREFERENCE OPERATOR?
 
10:28 PM
int** is a pointer to pointer
which in this case is the same as (p2)
actually it is (p2), lol
 
Oh well, I'm linkdropping my 2d array template anyway.
 
What troubles you, @Martinho?
post a code before I go to sleep
 
@DzekTrek Heresy, you said goto!
;)
 
I know, it must be my shauma. :D
 
Oh, people are talking to ghosts again.
 
10:33 PM
@DzekTrek Schauma the shampoo? Are you German?
 
Naturlich, ich bin Deutch. :)
 
You don't sound very German :)
 
It's because I am Slavic German. :)
it's too complicated to be understood reading just one line of text :D
I was Pole, Russian, Bulgarian, German, French and finally American. :)
 
-4
Q: "Say" function speaking c++

user1136457I'm just wondering if there was a function that allowed the program to actually speak. I think there is a similar function in vb. so for example, say<<"I can speak"; Or something similar. Thanks!

lol
 
evening
 
10:42 PM
evening @TonyTheLion
 
what was like your day?
 
my day was good
 
:)
nice to hear it
 
10:43 PM
sorry, couldn't resist
 
I know :) all is forgiven to you.
 
@DzekTrek My day was like my day!
 
:)
 
I was wondering about the atomicity guarantuees of an int in C++
 
@TonyTheLion You want atomic<int>.
 
10:47 PM
about what?
 
@FredOverflow and what if I don't have atomic<T> available to me?
 
@DzekTrek If thread A writes an int, can thread B view it in a "partially upated" state? Then it wouldn't be atomic.
 
cause I"m not using C++11
 
You're doomed.
 
10:47 PM
@TonyTheLion Then you don't have C++11, and prior to C++11, the language made no guarantees about thread-safety, anyway.
 
I didn't come here to hear that I"m doomed. Damnit!
 
You're not doomed per se. Only if you want to write concurrent code in C++03.
 
is there something in Win API to do what atomic<T> does?
 
@RMartinhoFernandes Why so many downvotes?!?
 
InterlockedXXX
@FredOverflow No idea. Seems like a fair question to me.
 
10:49 PM
@RMartinhoFernandes yea I guessed as much
 
ok thanks
 
InterlockedXXX sounds way nastier than I intended it to.
 
@TonyTheLion: You could try boost.atomic (well not officialy boost yet) as an alternative
 
right
 
10:59 PM
I'm going to take this chance and finally shift phase to daylight. Good night everyone.
 
11:13 PM
night
 
hi
what's up?
 
hi
 
you just got up?
 
no
been here all day
 
11:23 PM
pwnzored :P
 
11:48 PM
evening
 
hi
 
I'm finally back to C++ programming, out from all that java insanity that was 2011
 

« first day (458 days earlier)      last day (4491 days later) »