« first day (374 days earlier)      last day (4566 days later) » 

12:00 AM
Still WTF-y.
I'm not sure the code that generated it is worth looking at.
 
It's probably one of those enterprisey ORMs.
I tried to see what's the fuss about Hibernation is about once.
It's like a void that stares into you, and laugh, while you cower and run away in fear.
 
> The worst part is I looked at that query and was like, oh hibernate probably generated that query. Then I looked again and from what I can see it doesn't look like it's aliasing tables/fields the way that hibernate would. This leads me to believe that someone probably wrote this...
It lacks Hibernate's signature move!
 
ALL HAIL HYPNOTOAD
 
12:15 AM
nailed it
 
yeah
I figured you would all want to share in that
 
12:32 AM
right
having utterly sickened myself and wasted the day, I'm for bed
goodnight!
 
 
2 hours later…
2:34 AM
If you write a text editor, no matter what side of the tab vs spaces war you are on, provide a fucking option to let the user pick his side. Oh, and fuck tabs.
4
 
 
3 hours later…
5:07 AM
@RMartinhoFernandes Tab > space. Which editor are you talking about, BTW?
 
I refuse to speak to infidels like you!
It's TeXnicCenter.
 
@RMartinhoFernandes All I did was state a fact. :)
 
Bjarne did to some extent put that ball dead, by starting to publishing code in proportional spaced font. Evidently he just uses a simple script to format it. But I can't think of any such script that would be simple.
 
62
Q: LaTeX Editors/IDEs

hayalciWhat editors/IDEs are available for easing the process of writing TeX/LaTeX documents? Please state some useful features like code completion, spell checking, building final DVI or PDF files, etc.

 
@muntoo It's not for me. I was helping out a friend.
I use vim.
foo x y = map f x
          where f a = a * y
 
5:10 AM
@RMartinhoFernandes Ah, OK. :)
 
Good luck getting that aligned with tabs.
 
@RMartinhoFernandes Well, you could use a combination of tabs and spaces.
 
That's the worst of all.
Tabs+spaces only work if you use the same tab-width.
 
No, it isn't! If someone prefers 4 spaces, would you have them switch to 3 spaces?
 
The purported advantage of tabs (that each one can use their preferred width) is a myth.
As soon as you need to add spaces, you can no longer change it.
 
5:14 AM
@RMartinhoFernandes I don't mean \s\t\s\s\t\s. :) I mean \t\t, then align the where using \s{8}
 
@muntoo And if I use a different tab width it won't be aligned anymore.
 
@RMartinhoFernandes Yes it would.
 
Try it.
There are 10 spaces before the where.
If you use 4-width tabs, you need two tabs and two spaces.
 
Well, use 10 spaces then.
 
If I use 8-width tabs, it will start on column 18.
@muntoo I thought you preferred tabs.
 
5:17 AM
By tabs+spaces, I meant that use tabs only to align your code in the 'blocks'. Augh, I can't explain it like this.
Like if(1) {\n\tabc =\n\t 1 + 2;\n}
 
Right, that's exactly why I use spaces.
Tabs only work in specific scenarios.
 
@RMartinhoFernandes Regexes work in specific scenarios. Does that mean you don't use them?
 
Sometimes you need special alignments inside blocks.
 
Use the right tool for the right job. Tabs to do the 'structural alignment', spaces to do the fine adjustments, like with the where.
 
That means mixing tabs with spaces.
And that's where it fucks up.
 
5:22 AM
@RMartinhoFernandes I don't see what's wrong with mixing things up...
 
Because mixing tabs with spaces doesn't work.
 
@RMartinhoFernandes Can you provide an example?
 
The example above is legitimate.
I have tons of code like that.
 
@RMartinhoFernandes sigh. I mean, something where spaces+tabs doesn't work, or isn't "right". At least, in C, I can't think of anywhere that tabs+spaces doesn't work.
 
5:27 AM
@RMartinhoFernandes Well, for that, my 'tabs+spaces method' would generate the same code.
 
No, it would misalign the let and the code after the do unless I use the same tab width as you.
 
@RMartinhoFernandes My method is ^\t*[^\t]*$ You can't have tabs after the first non-tab character.
 
The let is on column 7. If you use tab-width 4, the in will have one tab and three spaces before it, right?
 
@RMartinhoFernandes No, it would have 7 spaces.
 
So, no tabs?
 
5:31 AM
@RMartinhoFernandes Not in that particular case, no. :) No tabs in that whole document.
 
Then in Haskell you would always use spaces.
Ok.
 
@RMartinhoFernandes I don't know what Haskell looks like, so I can't comment on that.
 
Looks like that :)
All over the place :)
Either you have one-liners, or things that need to be neatly aligned or I freak out when looking at it.
 
@RMartinhoFernandes lol, just realized it after posting.
 
In any case, I don't mind C or C++ source files with tabs, as long as the author didn't do a crappy job and mixed tabs and spaces where it fucks up (like alignment of function parameters).
 
5:39 AM
@RMartinhoFernandes Yeah, as long as the tabs aren't used as a 'quick way to get somewhere' where the slower yet more humble spaces are appropriate.
Well, gtg.
(Past 'bedtime'.)
 
Good night.
 
G'night.
>:)
 
Morning.
 
6:19 AM
@StackedCrooked Poor sod.
 
I would sob if I found out that France != Bacon.
 
 
2 hours later…
8:29 AM
Has anyone ever had a positive experience with YAML?
 
Does "no experience" count as positive?
 
I got a question about "blitting" in SDL
What is the concept of blitting? I googled it, but I didn't find anything that helped me
 
Rendering a 2D sprite on a drawable surface.
It may have other meanings though.
 
8:40 AM
In english?
 
24 secs ago, by Luc Danton
Rendering a 2D sprite on a drawable surface.
 
As in, what is a sprite?
 
A 2D graphic.
 
like a box?
 
As opposed to vector stuff.
 
8:42 AM
or circle whatever?
 
No, not like that. An image, a texture, a bitmap.
 
@RMartinhoFernandes Yes.
 
Ah, okey
Pre-made graphic
 
@BPDeveloper It's a soft drink.
 
Or a kind of faerie!
 
8:44 AM
So blitting is the process of loading an image and render it on a drawable surface?
 
Or a ferret.
Or a bunch more things.
@BPDeveloper Blitting is the bit transfer process.
 
Loading would be a separate affair.
 
So you load it from disk etc to a memory-location first?
 
Well you could create an image on the fly, too. Or have it hardcoded in the program.
 
You have this sprite somewhere in memory. And you blit it into another image.
 
8:47 AM
yes
 
Blit operations commonly allow the application of some operator in the process so you can combine the two images somehow.
 
@RMartinhoFernandes Eh, I thought it was pure, raw bit blasting.
 
So first you load the image from somewhere or make it, then you "blit" the image to another one?
 
Sure, why not.
 
@LucDanton You can do that with op(a,b) = a.
 
8:50 AM
I see
Thank you
 
It's called SRCCOPY on Windows.
 
@RMartinhoFernandes What's a typical, non-trivial operator like? Blending?
At the pixel level?
 
Usually it's at the bit level, so it's never anything very complex.
Here's BitBlt, a silly Windows function that could have one more freaking character and not be an abbreviation of an abbreviation. The operations are a bit down on the page.
 
If I want to have a multidimensional array as a class member and I know the size I just write SomeType[10][10] right? But when I try to return it from a getter writing SomeType[10][10] it doesn't seem to work
 
You can't have C-array types as return values.
 
8:58 AM
Not?
Pointers then?
SomeType** ?
 
Ugh, no.
Return a reference if you really must.
Or just make it public.
 
Strictly speaking, and following a rigorous interpration of the standard, a pointer of type SomeType** cannot point to the first element of an array of type SomeType[10][10].
 
Okey, but I can have a multidimensioanl array as an instance variable?
 
Yes.
2
A: Converting std::function<void(string, string)> to a generic std::function<void()>

DaniIts possible using bind aswell: string arg1, arg2; function<void()> f(bind(f1, arg1, arg2)); f(); // calls f1(arg1, arg2) with their values at the time of bind

Someone's bent on being silly.
 
Okey, thank you. But if I want a function to change some data in it how would I pass the reference to the function, or how would the function protoype look like?
 
9:03 AM
T(&x)[10][10] declares x as a reference to an array of T of 10x10 elements.
 
Hi
 
It could also be a call to a constructor of T (or a function with that name) passing it the address of x, and then indexing the result. The marvels of context sensitive syntax.
 
So you don't make the functions prototype like you normally would? function test(int& value)
 
Yes you do it normally, you just use that fugly syntax for the parameter or the return type.
 
@BPDeveloper T (&get())[10][10];
We're doing a getter right?
 
9:06 AM
It's probably better to typedef it.
 
I have not seen those ( ) around the reference before
 
typedef T(&my_badass_array_reference)[10][10];
my_badass_array_reference f(int x);
void g(my_badass_array_reference x);
 
Thank you, I will try it now
 
FWIW Java allows a similarly cryptic syntax. int f()[10][10] { return null; } is a valid Java function.
int[10][10] f() { return null; } is also valid.
But the best of all is combining the two syntaxes.
int[10] f()[10] { return null; } is valid as well.
Now go forth and spread havoc.
 
In Java I wouldn't need the sizes:)
 
9:12 AM
Right. What I said, minus the sizes.
 
T[] in Java is equivalent to std::pair<std::size_t, T*>, is it?
 
So, now I should be able to just pass the name of the multidimensional array into the function right?
 
@LucDanton More like std::pair<std::size_t, T*>*, yeah.
 
sbi
@RMartinhoFernandes I'm impressed.
But I am very disappointed by you not daring to write out here - of all places - the name of the Language That Must Not Be Named In Jeff's Proximity. It's called BRAINFUCK.
 
@RMartinhoFernandes Hah! Good point.
 
sbi
9:18 AM
There, I said it. And God did not strike me. It's just the name of a language after all. And there never was a clear decision anyway over the question of whether it's allowed to be named here. (And do not fail to upvote my last comment to the question.)
 
@sbi I thought we had agreed to censor the "i".
 
Bra*n is a dirty word. We don't want anyone to start using those in public, do we?
 
You even called me a genius for coming up with the idea.
 
sbi
@RMartinhoFernandes Yeah, that's a nice enough joke to make when you need to censor it. But here, you needn't.
 
@RMartinhoFernandes If I am about to use a function that takes the reference of a multidim. array how would I do it?
 
9:20 AM
Jul 27 at 20:43, by sbi
@MartinhoFernandes Yeah! That's it! Henceforth I will refer to it as Bra*nfuck! You're a genius.
 
sbi
@RMartinhoFernandes You have way too good a memory for my taste.
 
@BPDeveloper If you typedef it, do I as did for g above: void g(my_badass_array_reference x);.
 
sbi
@RMartinhoFernandes Ah, don't play these citation games with me now. You never come up with a link when you are asked to, so doing it now reeks of spiting me.
 
So, arrested for having a dog, arrested for not having a dog?
(I'm not sure that proverb is international, or I may have failed translating it.)
 
sbi
@RMartinhoFernandes Damned if you do, damned if you don't.
@RMartinhoFernandes An editor with a fucking option? Isn't that what we call a secretary?
5
 
9:22 AM
@sbi Right, that.
@sbi lol
 
sbi
@RMartinhoFernandes (In this chat, LOLing is done by starring.)
 
There. You can edit your "begging" away now.
 
@RMartinhoFernandes void test(T(&t)[sizeX][sizeY]); I haven't typedef it yet, do I miss anything here? How would I pass a multi.dim array to this?
 
sbi
@RMartinhoFernandes Thank you.
 
@BPDeveloper Yes, that's it.
 
9:25 AM
@RMartinhoFernandes Then I have an instance variable named T[sizeX][sizeY] multiDim;
 
sbi
Woah! We have 33 users in the room! Why is that? Is it Friday already?!
 
@RMartinhoFernandes Then I should be able to pass test(multiDim); ?
 
@BPDeveloper T multiDim [sizeX][sizeY];
The name always comes between the type and the sizes.
 
Ah, man.... I am stuck with Java syntax
Thank you!
 
But that's Java syntax too!
It allows both.
 
9:26 AM
Yes
But I always use this T[][] name;
 
Like everyone, because the C syntax is silly.
 
So C++ doesn't allow it right?
 
Which one?
In C++ you only get the silly C syntax.
 
T[][] name;
 
:(
@BPDeveloper Nope, not valid C++.
 
9:28 AM
Okey, thank you
 
Is there a standard way to pass a tuple to function expecting multiple arguments whose types and order match the tuple?
Damn.
 
Mmmh didn't we discuss that before?
 
Maybe.
std::tuple<int,double> t; void f(int, double); f(t...); would be neat.
 
9
Q: "unpacking" a tuple to call a matching function pointer

awoodlandI've created a simplified example showing a problem I'm struggling to solve. I'm trying to store in a std::tuple a varying number of values, which will later be used as arguments for a call to a function pointer which matches the stored types. #include <iostream> #include <tuple> vo...

 
Tuples and parameter packs should be a bit more unified.
 
9:34 AM
Very recent.
 
Right, so not standard then.
I won't be putting all that in an answer to a totally unrelated question :)
In D you can foreach over a tuple. That's really neat.
 
hi!!!!! can anybody help me out in this
1
Q: Include Boost C++ library in android

N-JOYeveryone I have been trying to marry Boost and android on windows for long time and tried lot of approaches but still no luck. I want to make a sample program using Boost library in android. I am following this tutorial here. As this tutorial suggested i have kept my Boost lib in **(Android ND...

actually this is android related question more than C++
and i asked it in android room but dint get get any help
 
Do the boost libraries you plan on using need to be built?
Oh, you built them already. I assume you use the Android toolchain for that.
 
ya i have already compiled it
i have used android NDK to include it into my project
 
What compiler does it use?
Did you try specifying the boost folders by hand?
 
9:42 AM
@RMartinhoFernandes i compiled it using CYgwin
 
Wait, you mean you didn't compile it with the Android C++ compiler?
(Pardon me if I don't know a thing about the Android platform.)
 
yup:)
no not with Android C++ compiler
 
But there is a C++ compiler in the NDK, right?
You may have to use that one. C++ is not known for binary compatibility.
 
yes there is C++ compiler. but i follwed the tutorial
mentioned in my post
 
Anyway, try using the -I flag.
 
9:46 AM
I am probably doing something wrong somewhere because shouldn't I be able to reference private instance variables defined in the header directly in the implementation of the class?
 
no that compiler can not compile the lib
 
@BPDeveloper Yes...
 
If I have a variable Dog dog; in the header I should be able to reference it by dog in the implementation?
 
@BPDeveloper What do your function member definitions look like?
 
@NJOY Like I said, if you pass -Ipath/to/ndk/sources/boost_1_44_0 to the compiler, does it work?
 
9:48 AM
as it needs the functions to be written in JNI(Java native interface) standards/conventions
 
Dog getDog() {
return dog;
}
 
@RMartinhoFernandes yes i have specifiied the same thing while compilation
 
@BPDeveloper You're defining a function named getDog. You want to define T::gedDog.
 
@NJOY And what does the error look like?
 
Where T is the name of the class.
 
9:49 AM
Ah, again. Thank you!
 
@RMartinhoFernandes no errors it compiles succeessfuly
and i get .a files
i.e. static lib
 
Wait, you said "it does not recognize any boost headers or function. and i always get compilation error."
 
@RMartinhoFernandes i was talking abiut the compilation of lib
 
Ok, and what about next?
Do you pass -Ipath/to/ndk/sources/boost_1_44_0 to the compiler when you are compiling the code that fails?
 
and okk you were asking me to set path while cpp file copilation
 
9:53 AM
Right.
 
i havent done it. let me check it
@RMartinhoFernandes till then can you tell me what does this -I parameter do.
 
It tells the compiler where to look for the header files.
 
10:07 AM
If you have to images that you want to "blit" to the source (Not sure if I am saying it correctly) in SDL, can you do that?
Before you flip
 
What do you mean blit to the source?
 
*destination
 
Ah, right.
Not sure how you do that in SDL. But I'm sure it must be possible.
Just blit one at a time?
 
I don't know what I am doing
 
10:11 AM
blitting = load/process image
flip = apply that image to some destination?
 
No, blitting is just copying a block of bits from one place to another (with a possible raster operator involved).
"Flip" usually means some kind of mirroring.
Or a Filipino.
 
So it blends one image with another?
 
If by blend you mean some kind of transparency effect, I don't think you can do that by blitting.
 
No, just applying it
Like putting dog onto a lawn or something
 
Right, that can be done with blitting.
 
10:16 AM
If you want to remove the dog what do you do then?
 
Er, you can't.
 
Do you flip the lawn again without the dog?
 
You need the original image.
@BPDeveloper If you have the original image with the lawn, you can just blit it over.
Something like SDL_BlitSurface(lawn, lawnRect, lawn_with_dog, lawnRect); SDL_BlitSurface(dog, dogRect, lawn_with_dog, doglocationRect); would put the dog there.
And SDL_BlitSurface(lawn, lawnRect, lawn_with_dog, lawnRect); would restore the lawn.
 
Okey
Thank you
So you don't flip?
 
Ah, I see now. SDL uses "flip" to mean "swap the buffers".
 
10:23 AM
Because if I blit the lawn I need to flip too, and if I want the dog on the lawn I need to flip too
that is correct?
 
In a double buffered environment, you keep two buffers for the screen contents. The front buffer contains what is on screen, and the back buffer is where you draw. This prevents the displaying of stuff in the middle of drawing.
When you are done drawing, you just flip the buffers, and what you drew on the back buffer before is now the front buffer, and thus is on screen.
 
so if I have two dogs do I blit two times before flip then?
 
Yes, you only need to flip once you are done drawing.
If you flip after each dog, the user could see a single dog for an instant.
 
ah, so you draw on a hidden canvas then you just unveil your artwork once it is done. Smart!
2
 
10:26 AM
@RMartinhoFernandes Thank you for that explanation!
 
Thank you for the metaphor! It will come in handy :)
 
Who wants to add one more of the same explanation?
 
sbi
@RMartinhoFernandes I once had a meta function which you could pass a function pointer and a tuple, and which would call the function with the parameters taken from the tuple. This was long ago, though, with proprietary tuple types, and a severe lack of variadic templates.
 
@sbi Something similar to Alexandrescu's typelists?
(Except also holding values, of course.)
 
sbi
10:42 AM
@RMartinhoFernandes ISTR them being called "object lists". I think that was before "tuple" became a popular term.
 
@sbi - pre C++11 how did you do the dispatching? just write it out 100s of times?
 
sbi
@awoodland Um, I didn't do this, actually. But I used the code. What do you mean "dispatch"?
 
The part that looks like f(get<N>(t)...); in an implementation with variadic templates.
You just generate a pack of indices, and then ask the compiler to expand a get for each one.
 
@sbi - basically I was wondering if you had a "smart" solution to stackoverflow.com/questions/7858817/… in a pre C++11 world
the only pre C++11 solution I see involves writing a large number of partial specialisations
 
sbi
@awoodland You have an answer by @Johannes already. What do you now expect from me? :-/
@awoodland I remember a lot of partial specializations being involved.
<googling furiously>
Found it.
 
10:47 AM
(i.e. was there a better way than writing a perl script to generate all the partial specialisations you care about?)
 
sbi
It's a bit different from what I remember, though.
 
IM DOOMED!!!
 
We all are.
 
No seriously.
 
I'm serious. It's the damn cancer.
 
10:48 AM
My O Level is after 5 months
And I havent prepared a damn thing
 
sbi
@awoodland This one reads arguments from a sequence of strings, converts them to the appropriate type (as determined from the function's sig), and then calls the function. It's tedious, though, lots and lots of specializations repeated again and again.
 
If it weren't for cancer, we could just go nuts on telomerase and live forever.
Or something.
@IntermediateHacker So, you have five months. Get cracking.
 
@RMartinhoFernandes I don't want to study. :(.
Anyway I started this morning
 
sbi
It's here, and it's part of some article draft.
 
@IntermediateHacker Er, why are you on school then?
 
10:51 AM
@RMartinhoFernandes Bec. I want to go to university?
Ok. Enough talk.
Gotta study. Bye
:(
 
See, the point of going to university is to learn.
If you don't study, you don't learn.
 
sbi
Wow. Looking at that code unveiled some long lost memories. @awoodland, you there?
It's gruesome what we had to put up with without variadic templates.
 
hi
 
sbi
@DeadMG lo
 
@sbi - yeah it's one of the problems I'd mostly "just avoided" pre variadic templates
 
10:56 AM
And now that we have them, we have already started complaining. Well, at least I did.
 
and for a similar problem I wrote perl scripts to write the specialsations
 
sbi
@RMartinhoFernandes I haven't even had the chance to play with all that new and shiny C++11 stuff, and you are already complaining. How sad for me. :(
 
I'm the spoiled brat. Why should you be sad?
 
sbi
@awoodland I dunno whether that guy wrote those specializations manually or with some tool. They look very uniform to me, but he doesn't seem to provide some perl source or something to generate them from.
 
I haven't seen any "why the hell did they do that?" stuff in C++11 yet and there's a lot of things that I'm quite impressed managed to happen without breaking backwards compatability
 
11:00 AM
My complaints are mostly of the form "why the hell didn't they do that?".
 
sbi
@RMartinhoFernandes Yeah, like modules. :)
 
We all know of those questions that are tagged with C code, or tagged and . But what about those that are C++, but tagged everything but ?
-3
Q: c++ programming

kaalia1i have to import the data from outfile there is a question and answer. Write a program that reads from a file (with variable number of records) student names and the grades for 2 tests and 3 assignments (the points are between 0 and 100) and determines and outputs for each student the total p...

 
it's been re-tagged
and was about 30 seconds after the question went up
 
I noticed.
 
> the question is that i have to import data from output file.and display name score of test and assignment average it and display data kind of list.i did all these and cant get no where – kaalia1 12 mins ago
 
11:08 AM
I can't parse that.
I voted "too localized".
I'm getting tired of crap questions.
 
it's "PLZ HELP" in wordy stuff
yeah, me too
 
One thing is being a noob, another is not even bothering to ask a proper question.
 
agreed
there's a big difference between "AMAGAD ++i++ WTF" and "Hey guys, I noticed this curious construction, ++i++, and I observed that it had a strange output. I also tested this on three different compilers and studied their disassemblies and don't understand my strange output. Does anyone know how the output is computed"
 
sbi
In a single month, we lost Steve Jobs, father of i, then Dennis Ritchie, father of C, and now John McCarthy, father of LISP, the term artificial intelligence, automatic garbage collection, and time-sharing. And maybe some stuff I forgot about.
 
yeah
this is really the month of important people dropping dead
 
sbi
11:13 AM
> And here’s hoping we can take a break for a while from writing these memorials to our giants. - Herb Sutter
 
@sbi Lots of contributions to functional programming (other than LISP).
 
sbi
(I'm off for lunch.)
 
lovely story
 
11:27 AM
as if 20 million dollars is going to be anything more than pocket money in 2055
 
They probably re-defined the dollar.
 
lol
 
That's what they did in Zimbabwe.
Five times.
 
yeah, their inflation was rofl
Mugabe did a great job roflstomping over all their infrastructure and utterly wrecked their economy
not that they didn't deserve independence, but it was stupid of them to lynch all the farmers who knew how to farm and destroy all their useful (then)modern technology, etc
 
11:57 AM
the sad thing is that ritchie was way way more important for our world than jobs was, but almost nobody knows of ritchie.
 
people keep saying that, but I'm not convinced that it's actually true
the worlds most valued company is hardly an irrelevant thing
 
If you have a class with an instance variable to another class that has no default-constructor. Then it need to be made with new right?
 
@BPDeveloper No, why would you think that?
new, classes, and constructors have nothing to do with one another
 
Do you know of initialization lists?
 
11:59 AM
Because I am noob
Yes, it has three parameters
do I just put them in the header?
pass*
 

« first day (374 days earlier)      last day (4566 days later) »