« first day (422 days earlier)      last day (4518 days later) » 

cpx
10:00 AM
May I allocate memory using function pointers!?
 
@cpx What do you mean?
 
@IntermediateHacker sorry, seems I forgot </sarcasm>
 
@cpx r u asking for permission???
@thecoshman lol. and I forgot </perception> . :D
 
@FredOverflow malloc(function)?
 
cpx
int(*p)() = new int(*)()
 
10:02 AM
void* (*pointer_to_malloc)(size_t) = malloc;
void* p = (*pointer_to_malloc)(100);
free(p);
 
@cpx There you go, allocating memory using function pointers :)
 
cpx
@IntermediateHacker Yes
 
@cpx ok then. Permission granted. You may allocate memory using function pointers
 
@cpx then no, no you can not do this
 
cpx
10:04 AM
@FredOverflow good to know!
 
@cpx I'm still not clear on what it is you actually want.
 
@IntermediateHacker jpg comics aren't cool, too many artifacts, especially around text
 
¬_¬ random pictures aren't funny either
 
@FredOverflow I know. I wonder why so many people prefer them. png is way better
 
10:07 AM
erm... is it just me... or are there no stared messages?
 
it's just you.
and your internet connection
 
@thecoshman Where, on the right, in the usual place? There are definitely starred messages. That's #1 at the moment:
11 hours ago, by Cat Plus Plus
I think I need to take a break from newbies.
 
¦(
 
What is that, a sad Chinese man?
 
@FredOverflow I wonder what that is about...
 
10:09 AM
@thecoshman I recommend u to read the newbie hints
 
@FredOverflow well... I was going for angry
 
@thecoshman Someone was using a std::string* (note the pointer) :)
0
Q: assigning a heap allocated reference to a stack allocated variable

HollandIs this possible? According to what I'm trying to accomplish, it appears not so. The function static std::string str_repeat(std::string * str, int num_times) { std::string * str_rep = new std::string; for (int n = 1; n <= num_times; n++) { str_rep = str_rep + str; } ...

 
right now... this room is making me feel like this... stickerish.com/wp-content/uploads/2011/04/JackiechanBlackSS.png ... for so many reasons
 
Why?
 
@thecoshman did they disappear? That happened to me the other day, Martinho started something in meta about it I think
 
10:13 AM
@FredOverflow a few things...
 
@thecoshman such as?
 
@keithlayne not sure if disappear is the word, they simple where not here when I logged in
 
bugs everywhere
 
@FredOverflow never mind ¬_¬
@FredOverflow actually... it seems to be more one of those days
 
2
A: C++ Exercises for Beginner to Intermediate Programmers

karthikI will give you the suggestions of areas you have to be strong if you want to be a c++ developer. The areas you have to improve is Garbage Collection - Freeing the memory is done by us.So we have to take care of this part. Multithreading - Creating multi threaded program and try to use mute...

> Garbage Collection - Freeing the memory is done by us.So we have to take care of this part.
ouch
> I back! Who want to buy bags discount handbags? Come on! Long time no see, but I have being busy with my work these days. Today, I want to say something that greatly upset me. I do sales in a import & export discount handbags sales company, as I know, I had thought that we can get a year-end bonus, several days ago, I was told that due to the tight finance, we are likely to be given a small amount of bonus, how ridiculous! Do you miss my bags for cheap mentioned before?
LOL
 
10:20 AM
@FredOverflow Further to my case
 
Can anyone help me understanding this : "The heap is a block allocator that reduces the amount of calls to the system. It will request a large block of memory and slice it to your needs. It will try to make your memory request fit in one of its available slots."
what does it means by slicing?
 
room topic changed to Lounge<C++>: We don't need GC, we have RAII [c++] [c++11] [c++-faq]
@FreakEnum Get 1MB from the operating system. If the user calls malloc(1000) a thousand times, one 1MB block is sufficient, so we don't need to bother the OS a lot.
 
@FredOverflow I wish I could remember what RAII means :(
 
Resource Acquisition Is Initialization (RAII, sometimes RIIA) is a programming idiom used in several object-oriented languages like C++, D and Ada. The technique was invented by Bjarne Stroustrup to deal with resource deallocation in C++. In this language, the only code that can be guaranteed to be executed after an exception is thrown are the destructors of objects residing on the stack. Resources therefore need to be tied to the lifespan of suitable objects in order to gain automatic reclamation. They are acquired during initialization, when there is no chance of them being used before ...
> To learn Garbage Collection is good for a developers.
What?
 
@FredOverflow well... I guess your man means that deallocating... wait.. what?!
 
10:25 AM
@FredOverflow but how we're bothering OS?
 
@FreakEnum "Dear operating system, please give me 1MB of memory!"
 
@FredOverflow but we needed that 1MB
 
@FreakEnum its easier to request 1MB once, then 1KB 1000 times. it takes the OS time to sort out allocating memory. if the program just takes one chunk and says it has this chunk to use for it self, it is a lot easier
 
@FreakEnum Yes, but it's better to ask the operating system for 1MB once than to ask for 1KB a thousand times.
 
10:28 AM
Aah , now got it , Thanks a lot to you both :)
 
You won't really get it until you implement your own version of malloc and free.
 
@FredOverflow snap
 
"Fragmentation generally results in huge blocks of memory going away for no reason. Typically you'll suddenly lose 200 MiB of memory after allocating 20 bytes. First time it happens to you, believe me, you're going to get a bottle of rum and a cigar, and pray for Baron Samedi to help you on this case."
How we suddenly loosing that 200 MB ?
@FredOverflow I am not going to do research in that , I already have to learn a lot lot..in C++ :D
 
@FredOverflow if you where doing this in C++ would it just be malloc and free that you need to re-implement... or am I wrong in think that new effectively wraps malloc
 
it can do, and that's the easiest implementation
but it's definitely not guaranteed
 
10:35 AM
new can do whatever it wants regarding memory, that's why it's undefined behavior to free something that was newed.
Of course you can overload operator new and operator new[] so they use your own malloc.
 
and of course, new and delete can do con/de structors, whereas malloc/free won't
 
I see now...
 
Right, but operator new doesn't call any constructors. Just clarifying for the other readers.
 
yeah... 'other' readers :(
 
ah, the operator new does indeed not call any constructors
but new itself does
 
10:40 AM
projecteuler isn't working for anyone also?
 
so RAII... is that kind of the opposite to lazy instantiation?
 
no
it's basically a system by which resources are automatically cleaned up for you
the lazyness, or not, of their original instantiation is irrelevant
 
does boost not have something for arbitrarily large integers?
 
@keithlayne - I've always used gmp for that gmplib.org
 
oh... (reading le wiki) so it's relying on destructor being called to do things like close a file. Avoiding the need to manual call clean up functions... right
 
10:43 AM
@awoodland yeah, I know about gmp, but that seems to be a perfect fit for Boost
 
and also, it's much more generic and deterministic than GC
 
It is really something that needs to make its way into the standard library IMO
 
I guess it is also another reason to not like GC
 
well, in my opinion/experience, RAII is just fine for virtually every purpose
and it's certainly not appropriate for a vastly smaller subset than GC is not appropriate for
 
@DeadMG o_0 you lost me...
 
10:50 AM
there are some places, e.g., reference cycles, where RAII is not appropriate
but they're much, much rarer than, say, opening a file, where GC is not appropriate
 
@DeadMG We have std::weak_ptr to break those cycles.
 
well, personally, I find any design that requires them to be questionable
but hey
 
there's a fair few pointery related standard classes aint there
 
Off the top of my head, we have std::unique_ptr, std::shared_ptr and std::weak_ptr. There may be more.
 
scoped_ptr? Isn't that in the standard too?
 
10:54 AM
no
 
unique_ptr is a better scoped_ptr
 
there's no reason to have a separate class for it with unique_ptr
 
true enough
 
damn, y my internets so slow
 
@DeadMG what if it is not just your internets, but all of the internets :O
 
11:01 AM
lol
 
It would be interesting to try to roll out my own internet... but sadly I lack the funds to start laying super high bandwidth cables al over the place
well... Is say all over the place...
 
you really mean "just your place" :P
 
would be a very lazy internet if I just connected my self to my self...
 
well, you'd find it hard to play games or download porn films
 
yeah... but I would have to upload all the ... films ... in the first place
 
11:08 AM
yeah
 
personally, I would just settle for a pipe direct to one of the main routers on t'internet
I'm not even sure how you would about finding out how much it would cost for such a set up
 
In Belgium we have Belnet, which universities use for their ultra-speed connection
100Mbit/s to 10 Gbit/s
 
yeah, a lot of universities have there own internets to connect to each other. But I wonder how much it would cost to set one up... say between my house and... youtube ¬_¬ yes *you*tube
 
lol
send an email to Google, maybe they'd be willing to host a server farm in your basement
 
@rubenvb hmmm... I do have some attic space... and could use the water storage tank as a water cooling... which stop it from being deathly cold in winter...
 
12:02 PM
sooo any one have to work with clear case...?
it sucks ¬_¬
 
what is std::alignment_of ?
 
gives the alignment of a type T
 
@DeadMG in simple words please?
 
that is the simple words
 
are you asking what alignment is?
 
12:12 PM
if you don't know what alignment is, then look it up
 
@fred thanks i apprexiate your praise
 
@DeadMG I know but it looks like sizeof to me
 
if the problem is that you don't know what alignment is, then asking "what does the alignment of a type mean" might give better results than asking "what is `std::alignment_of´.
@FreakEnum what do you mean?
It's not sizeof because it has a different name and it does something different
 
Sizeof and alignment is like gender and pride.
Lol
 
12:28 PM
?
 
12:43 PM
any tex experts/gurus here?
 
what do you need? I'm nowhere near an expert, but if you ask, one of us might know
 
They also have a chat room too:
 
hello, I need to save in notepad a matrix that I created in C++, can anyone tell me how it could be possible? thanks
 
@jalf yeah, answers came a lot faster than last time
woohoo
 
what?
 
12:48 PM
@mona, save it to file, then open in notepad
 
Notepad, matrix, C++, where's the connection?
 
hehe
i have created a matrix in c++ that contains infromatin and i want to transfer this information to someone so i need to save it in notepad
its not a matrix its list of things
 
print this thing to cout
 
hello all
0
Q: QImage from unsigned char buffer (jpg format)

Tony The LionI have buffer of type unsigned char* which I fill with JPG image. I want to use this buffer to draw the image to my application screen in a QLabel. I've done this, but the image is incorrect. Can anyone tell me what the best way to do this is? QPixmap pix = QPixmap::fromImage( ...

anybody any ideas?
 
@Abyx its a huge list
I need it in a file
 
12:51 PM
@TonyTheLion I often use(d) Google Codesearch when I'm not clear on how to use an API. Pity that it is shutting down..
 
@mona, OK, do you know how to print it to cout ? if so, replace cout with ofstream instance
 
do any of you guys watch Dexter?
 
what's it?
 
ok thank you :)
 
a tv show
 
12:55 PM
dexter is outstanding
 
dexter is a psychp
 
yeah
it's rather gruesome at parts
there's this scene that I so badly want to watch, and at the same time, I really don't want to watch it
 
tell him I said stop being a puss
 
Hi.
I got a damn cold.
 
hi
 
1:09 PM
hmmm
hi
> Chuck Norris implements “Indestructible”. All the other creatures implement “Killable”.
 
Chuck Norris jokes?
 
I just taught my five-year-old to say "like a baus"
 
I respected you
 
Dexter makes a serial killer look like a nice agreeable person.
 
he is
he's just also a nasty serial killer
 
1:23 PM
Hello
 
hello friend
 
1:45 PM
 
I wish I could play the new Zelda
 
also, todays XKCD is pretty funny
 
> Welcome to the future! Nothing's changed.
 
spelling fail
 
1:48 PM
@DeadMG oh
you did?
 
I have to admit
 
@DeadMG Dunno what you're talking about.
 
cpx
lawlz
 
the idea of respecting someone that wasn't me was a difficult one for me to process
I had to think on it for a long time
 
lulz :P
 
1:48 PM
but eventually, I made it work
 
wow
amazing
 
yeah
I'll never make that mistake again, thanks to you :D
 
Also, the fucked up TDWTF article of last week is now up.
 
hahah, I'm glad to have been of service :D
 
1:49 PM
@DeadMG I really should subscribe to there RSS feed
 
@RMartinhoFernandes It was on Saturday, at least, if not late Friday
damn
I changed something and I forgot why
 
@DeadMG :O but but but, commit messages
 
I stopped committing a while ago
I had to change computer and never got around to setting it up again
 
1:53 PM
besides
the commit message isn't long enough for the detail I'd need
 
The commit message can be pretty long if you wish so.
 
@DeadMG how can that be? surely you are performing lots of small concise changes
 
haha, no
 
ಠ_ಠ
 
1:56 PM
the fundamental problem is that I'm doing too much at once
and the other fundamental problem is that my syntax is a tiny bit broken :P
 
then stop it!
 
there's too much to be done to not make huge changes
 
then break it down into small steps. it will help in so many ways
 
I did
then I forgot them when I had to panic about university :P
plus, I never quite finished defining this little bit
 
You know how to write, don't you?
 
1:58 PM
that ^
 
still am
 

« first day (422 days earlier)      last day (4518 days later) »