« first day (683 days earlier)      last day (4258 days later) » 

5:00 PM
How can you not like gaming.
You're not playing the right games.
 
@MooingDuck It's not much better really. It was there because "that class will need to send stuff, but I don't know what yet".
 
@CatPlusPlus Gaming is just no fun compared to programming, inventing your own languages and stuff.
 
I loved Dragon Age. I tried Diablo II but didn't last long. I also played Starcraft II, well only finished the campaign.
 
@FredOverflow You're crazy.
I need to reclaim some HDD space.
 
@FredOverflow Yeah, I don't get as much satisfaction from achievements in games than I get from programming.
 
5:02 PM
@CatPlusPlus Delete some games.
@CatPlusPlus List one game that is more fun than learning Haskell.
 
It means this : while(you_ask_such_question) { chance_of_NOT_getting_hired++; } Nawaz 1 min ago
 
If I need to pass a function pointer to a library function, and I have a function object that needs to go where the function pointer is, what do?
 
I might consider playing Go.
 
GW2 might be.
 
@Ell not.
 
5:03 PM
@Tocs cry
 
@Mysticial That was a fun ride.
 
You can join every time with a different username if you want.
 
@MooingDuck, good plan
 
@Tocs what is the type of the pointer?
 
As long as it is not already in use.
 
5:03 PM
@StackedCrooked You mean Go, the programming language? :)
 
@Tocs Jam it in.
 
@Mysticial Nice
 
@FredOverflow The board game!
I think it might suit me. It's fairly forgiving of stupid moves.
Chess isn't.
 
@Tocs std::function<*decltype(your_function_pointer)>(your_function_pointer)
 
Well its the Angelscript library, and I need to use a lambda function to capture an important value that can't be passed in as an argument, but lambda's wont cast to function pointers in VS2010
 
5:04 PM
Capturing lambdas cannot be cast to function pointers at all.
 
@Tocs VS2010 is your problem
 
@FredOverflow I need to go the other way FunctionObj -> FunctionPointer
 
can't be done unless stateless
 
@Tocs what is the type of the function pointer? Is it std::function<void()>? or void(*)()?
 
@Tocs bad luck.
 
5:05 PM
Well the obvious workaround is to write a helper function and pass that.
 
@FredOverflow Won't work.
@Tocs Not feasible in general.
 
This plan wont work at all then. Back to the drawing board
 
Is there a data parameter?
 
@R.MartinhoFernandes Better? :)
 
Without more information, there's zero choice.
 
5:05 PM
like, a void *?
 
@FredOverflow std::function expect a function type, not a function reference type (assuming you meant decltype(*your_function_pointer))
 
I'm pretty sure it will work. Let me try it out.
 
You can't dereference a pointer type, silly.
*decltype() thing.
 
Metatype.
Nah.
 
It's nasty.
 
5:07 PM
Guys why does this program print the letter a?
 
@Tocs ptorotype
 
char c=97;
cout<< c<<endl;
 
Won't work.
 
 
Use a scripting engine that's not shitty.
 
5:08 PM
@Drise lol, well I have to add code to generate something there but I haven't. Quick typo.
 
Angelscript is the shit.
 
@CatPlusPlus Of course, silly me :(
std::function<std::remove_pointer<decltype(your_fun_ptr)>::type>(your_fun_ptr)
 
Angelscript is shit.
Both in terms of language and API.
 
unsurprisingly
 
5:09 PM
What's wrong with angelscript?
 
@MohamedAhmedNabil why do you keep asking these questions?
 
I want embeddable implementation of Haskell. :<
 
@MohamedAhmedNabil Because the ASCII code of the letter a is 97?
 
@CatPlusPlus create one :P
 
I thought about implementing Haskell-to-Java compiler today.
 
5:10 PM
@MohamedAhmedNabil because for your compiler and target architecture, a char with value 97 is considered to represent the letter a (Probably using ASCII as Fred says)
 
@CatPlusPlus Have you gone insane?
 
@MooingDuck binary files chapter rot by brain
 
I could do Android without touching Java!
 
@MohamedAhmedNabil didn't we already answer this question two or three times here?
 
There's Scala, but meh, I'd rather use Haskell.
 
5:11 PM
@MooingDuck is it stored in the memory as 97 or as The ASCII code for 9 and The ASCII codee for 7 (This is what i really wanted to know)
 
Most JVM Haskell-likes are just Haskell-likes, not Haskell per se.
@MohamedAhmedNabil Reread this and then imagine a universe where it makes sense. Hint: there isn't one.
 
3 mins ago, by Mooing Duck
@MohamedAhmedNabil because for your compiler and target architecture, a char with value 97 is considered to represent the letter a (Probably using ASCII as Fred says)
"a char with the value 97"
 
Sorry guys i sound a bit stupid , Its that im still trying to understand how chars are stored in binary files :/
 
@MohamedAhmedNabil Do you know the size of char?
 
@MohamedAhmedNabil a char is simply stored as an 8 bit integer on most machines. It's only different from int in size, and how we interpret it. (And a few other technical irrelevant details about aliasing)
 
5:15 PM
It normally has very little to do with the compiler or target architecture. It has to do with the font you're using. A font is basically a collection of shapes for characters arranged in some order. In the font you're using, the 97th character is shaped like a lower-case letter a. Quite a few character sets expect that, so it's pretty common, but if you switch to a different font (e.g., a "symbols" font) you're likely to get a different result.
 
@MooingDuck because i understand there is no ASCII translation in binary files, I send 255 and the value 255 gets stored not the ASCII code for 2,5,5
 
@CatPlusPlus Scala is a nice language. You can even do type classes with implicit parameters.
 
@FredOverflow I find the syntax heavy and strange.
 
@MohamedAhmedNabil right. Just like an integer.
 
@MooingDuck You said the a char is stored as an integer, Shouldnt it get stored just as it is?
 
5:17 PM
@MohamedAhmedNabil It is stored as low, high, high, low, low, low, low, high in memory. But we usually prefer saying 01100001 or even 97.
@MohamedAhmedNabil char is a numeric type in C++. The fact that you see a letter on your screen is the result of multiple conversions.
 
@FredOverflow So a char gets stored in the binary file as a numeric value?
 
@MohamedAhmedNabil yes, and "as it is" is the bit representation that hold the value 97.
@MohamedAhmedNabil a char is a numberic value. It's programmers who treat it special. To the computer it's a number like any other.
 
@MohamedAhmedNabil Depends on how you write into the file, of course. But assuming some naive code, yes.
 
And ostream is smart enough to display some character on the screen when you display a char
 
@FredOverflow so if i store 'a' in a binary file, then 97 gets stored. Isnt that ASCII translation?
 
5:20 PM
'a' and 97 are identical. Always.
 
@MohamedAhmedNabil No, 'a' is 97. They're the same thing.
 
@MohamedAhmedNabil the ASCII translation happens when you do cin >> mychar, not when you save it to the file
 
(Assuming that the implementation character set is ASCII)
 
1 min ago, by Mooing Duck
@MohamedAhmedNabil a char is a numberic value. It's programmers who treat it special. To the computer it's a number like any other.
 
(And no, fuck EBCDIC)
 
5:21 PM
@MohamedAhmedNabil No, because all computers can store in memory are numbers, anyway. Again, the fact that you see a letter on your screen is the result of a conversion from the number to a pixel pattern that is not at all trivial. Storing "the letter a" (as opposed to a numeric representation of it) in memory doesn't make any sense at all.
 
@MooingDuck or when i store 'a' in a "TEXT" file?
 
I just found a worst bug I have ever commited
 
18 hours ago, by Drise
Fill your head with useful furniture, not random garbage of miniscule details. Life is too short, and you can only recall so much.
 
@MohamedAhmedNabil you're actually storing a number that represents the letter a into a file that knows to represent the values as letters.
 
Never ever trust dynamic_cast<> to crash your program.
 
5:22 PM
@MohamedAhmedNabil Text files are just a very thin layer on binary files.
 
You don't need to care why char c = 97; works. It just works. Just like you don't need to ask why int a = 1, b = 2, c; c = a + b; works either.
Information hiding.
 
Gotta go shopping.
 
All you need to know is that c will reliably be 3.
 
oh so that is why i have to use strict format when using binary files
So the 97 gets read as a letter not a number?
 
I'm sorry, I have to do this. Please forgive me.
 
5:28 PM
Lets take these questions to chat.stackoverflow.com/rooms/15768/…
 
Here to ask a serious question/not intending to start a flame war/legitimate question, here
but what is so good about linux/vim?
 
Guys, lets all go to meta and tell them something is broken!
 
I use Windows and seem to be able to do everything linux can (even in terms of coding) so I am not sure why people prefer, say, the terminal for everything vs. a simple GUI
 
@IAmBatman Linux is not restricted to VS as a compiler. Terminal has it's place. Vim is obnoxious, ignore those users. Linux people use IDE's too, but those IDE's allow us to use a compiler of our choice.
 
I tried using Vim and hated it, didn't see what the big fuss was about
 
5:32 PM
And also, windows is slow, especially since windows almost requires an antivirus, which is just a resource whore.
 
@Drise You can use ICC in VS. + Linux IDEs work on windows
 
@BartekBanachewicz Intel compiler?
 
@Drise That's untrue, again. I don't have an antivirus and I don't think I should.
@Drise yup
 
@BartekBanachewicz almost
 
While linux internally might be faster, it's GUI (gnome/kde) is much slower and less responsive than, say, Aero
 
5:34 PM
@Drise Clearly someone borked the server side badly...
 
@BartekBanachewicz Faster boot times, less bloatware, etc etc. I also notice no issue with GUI lagginess. I've completely moved from Windows to Linux, both at work and at home, and am not regretting it at all.
 
Using the darkblue colorscheme in Vim makes me feel like I'm an old-school hacker.
 
@Mysticial Possibly related to yesterday's chat crash?
 
@Drise Faster boot times? When I boot my PC I use it for at least 3-5-8 hrs, so it doesn't matter for me at all. Bloatware? what the?
 
See how many people are complaining.
 
5:36 PM
Well, if it feels good for you, cool. I have 3 linux VMs, and they work perfectly for me too. (when they DO work, of course)
 
so a WIndows vs Linux war eh?
 
@Drise yep
 
Talk about duplicate flag hell
@BartekBanachewicz My windows laptop would consistently hang when coming out of sleep mode, forcing me to reboot, taking about 10-15 minutes to become usable. It's only 2 years old.
@BartekBanachewicz Bloatware, like all the silly audio driver control panels, mouse control panels, beats audio, etc etc.
 
@Drise Oh, I have production ready machine. I feel sorry for you.
 
@BartekBanachewicz That's why I dropped 1.5K on a new desktop, and put linux on it.
 
5:39 PM
@Drise Beats audio? Who the f*ck uses that? Audio driver control? Gosh, I use ac3filter, they're disabled for me.
 
@BartekBanachewicz HP laptops
 
@Drise You know, just a hint - you can turn a program off.
 
They require that you have it, otherwise you have to sit in silence.
 
@Drise that's complete bullshit.
 
@BartekBanachewicz Thanks! I'll keep that in mind!
 
5:40 PM
okay... Firefox 15 did not fix their shitty 100% CPU garbage collector problem... Back to Firefox 13... :(
 
@Mysticial ... Firefox? Let me help: google.com/intl/en/chrome/browser
 
what now? browser wars?
 
If he starts advocating Chromium, I'm outta here
 
@BartekBanachewicz Fuck chromium. Chrome.
And if you choose so to leave, have a nice day!
@netcoder At least I'm not saying "erhmegerd guys macz r sooo awesom! i luv givn all my moniez to applz"
 
5:45 PM
@Drise: same difference
tbh, I don't give a f*** about what OS you use.
 
@netcoder Not quite. I don't give all my money to Ubuntu. It's free.
 
I don't mind Windows or Linux or even Mac, as long as they let me do my work. All of them are mature enough for all sorts of task. And browsers too, both firefox and chromium let me do my work. I wonder why people fight over them?
 
@netcoder y u censor
This isn’t the congress.
 
@netcoder y u no have gonads to say fuck? This is not the PHP room.
 
@Drise calm down, this is the internet, don't get worked up
 
5:47 PM
I can say whatever I please can't I?
here *******************************
yay
 
@MooingDuck damn clown
 
@daknøk radek->continueTrollEfforts();
 
delete radek;
daknøk = new troll; // I haz compilerzzzzz with ø in charsetzz.
 
@daknøk error: ~troll() is a private member.
 
I am immortal!
 
5:49 PM
2 hours ago, by Drise
std::auto_ptr<troll> radek = troll::getInstance();
 
Is it possible to call the dtor in the ctor?
Foo::Foo() {
    this->~Foo();
}
Not that it isn’t a bad idea to do it…
 
You probably can.
I think destructor is just a function in the end.
 
@Drise I cast to private base with public virtual dtor with C-style casts.
 
@daknøk syntactically yes, but otherwise no
 
@StackedCrooked calling delete thing; is equivalent to calling ~thing();?
 
5:51 PM
@Drise no.
 
@StackedCrooked it's UB, because it's effectively a double-delete
 
@Drise delete = ~thing() + free
 
@Drise no, it's ~thing followed by deallocate(thingptr)
 
It is like if (thing != nullptr) {thing->~decltype(thing)(); free(thing);} depending on the implementation.
Not that I expect thing->~decltype(thing) to work. :P
 
@daknøk So you can call delete on a nullptr, and life is happy?
 
5:52 PM
Yes.
 
@Drise yes
 
Well not on nullptr.
 
cool
 
But you can do this:
int* a = nullptr;
delete a;
 
@daknøk a not the
 
5:52 PM
No, it is not “cool”. It is overhead which is not needed.
What if you are already sure the pointer is not nullptr? It will still do the check at runtime.
 
@daknøk trivial overhead
 
@daknøk I'd rather it be there, for safety
 
Doesn’t matter.
@MooingDuck Safe code doesn’t use delete directly, unless it is an implementation of some low-level stuff (in which case you already have to watch out).
 
static vtkSmartPointer<vtkActor> actor = nullptr;
GetRenderer->RemoveActor(actor);
actor = vtkSmartPointer<vtkActor>::New();
That's why it's cool.
 
In fact, the only things that need, in theory, delete directly are the dtors of std::unique_ptr and std::shared_ptr.
 
5:55 PM
@daknøk Good luck writing a usable smart pointer without a null state.
@daknøk And both have a null state. delete in their destructors has no overhead.
 
@R.MartinhoFernandes That is low-level in my opinion. And you can check for null explicitly in the dtor.
 
Also, your theory is wrong.
@daknøk You're claiming it's overhead, and then say delete only ever needed in two situations. Yet it's not overhead in either of them.
 
If boost is really a high quality codebase then running: find boost -name "*\.hpp" | xargs grep -w delete should reveal no deletes. Right?
 
False.
That's true for non-library code.
 
You never said that!
 
5:57 PM
@StackedCrooked Libraries should do the low level for you.
 
@StackedCrooked also it was for C++03 which made it harder to do the rule of zero/no deletes/etc
 
Why doesn't it use its own smart pointers?
 
@R.MartinhoFernandes The overhead and the smart pointers were separate things.
 
Hey folks. Do you have any recommended articles regarding the ABI compatibility problems that can ensue when using C++?
 
I was not talking about overhead when sending that message.
 
@daknøk You brought them together.
@daknøk Yet you contradicted your previous assertion.
 

« first day (683 days earlier)      last day (4258 days later) »