« first day (615 days earlier)      last day (4351 days later) » 

8:03 PM
@RMartinhoFernandes you're creepy
2
 
The robot's not creepy, he's just a little more shiny than us
 
how should ofs write this to the file ofs << "BLAH" << " " << buff; first "BLAH" and then after, in the same line, the contents of buff right?
ofs is std::ofstream
not "BLAH'' somehow magically mixed into buff
which is what it's doing now
which is very very worrying. for 3 lines of code
 
Yeah, should be "BLAH <buff contents>"
 
ok, thnks for verifying I haven't completely lost my mind
 
8:14 PM
Sounds like UB is going on.
What's buff?
 
@StackedCrooked, I think @DeadMG's trying to talk to us on IRC.
@DeadMG Uncanny valley!
 
one of you should be enough, I think
@TonyTheLion Might be screwy if buff contains ASCII backspaces and you're writing to a text stream.
 
@RMartinhoFernandes a stream of numbers and character gotten from a hardware device
@DeadMG like a txt file?
 
Like the puppy said, if it has ASCII control characters in it, it can fuck up text streams.
 
8:21 PM
@TonyTheLion No idea.
 
@RMartinhoFernandes can you visibly see them with your eye, as in "\r\n", wouldn't be in there like that, would it?
 
Can you view the stream in HEX?
 
Open the stream in binary mode and look at the result with a hex editor.
 
I was first.. I win lol
 
@RMartinhoFernandes If the backspace characters are being parsed, they won't show up in the output
 
8:24 PM
@DeadMG On a binary stream?
 
@RMartinhoFernandes Oh, thought he said it was a text stream.
 
@DeadMG he said it was a text file
 
right
 
@DeadMG Yes, and I suggested making it binary to check.
 
gotcha
 
8:30 PM
0
Q: Is this code elegant or hack?

NoSenseEtAlrecently me and colleague had a discussion about the following piece of code(simple bool function that checks if string is a number, +1000 not allowed, -1000, 1234... allowed). He felt that it was hackish, while I thought it was nice, clean and elegant(since it uses STL, not hand made loops). So ...

 
Hmm, boss proposed we might need a tool. I wrote most of it, but then since he didn't mention it again, I abandoned it. Now he says I should work on it, and I can't find my old code. I really hope I didn't delete/overwrite it.
 
I think you guys are perfect to answer this
@MooingDuck More clock time?
 
I can't even recall what I would have called the fool thing, so I can't search my computer
 
@MooingDuck You didn't version control it?
 
@Drise I made it about a month ago, but I'm trying to use that to narrow it down :/
 
8:33 PM
@MooingDuck Do you know what file extensions to look for? That might help you find it...
 
@RMartinhoFernandes I wasn't sure if it was going to be a real thing, and then.... no. No I didn't. Or maybe I did, but I can't remember what it was called.
 
I tried to write the same buffer to file with some C functions, this is the output:
3265038 $ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÌÌÌÌÌÌÌÌÌÌÌÌ
after the dollar sign should be some numbers etc
 
Oh! There it is! (What a stupid name!) And it's in the version controlled folder and everything. Wonder if it's checked in
 
but just garbage
 
@JimNorton I did a search for .sln, found 207 results in our source tree.
 
8:35 PM
@MooingDuck Lots of projects...
 
@TonyTheLion That looks like binary output.
 
@JimNorton no, those are soluitions, theres' many more projects.
 
@MooingDuck And solutions are like components correct?
 
Ell
solutions contain projects
 
@RMartinhoFernandes I wish, it's garbage
 
8:36 PM
@JimNorton 678 projects (components)
 
In VS terms, one project == one output.
 
guess I"ll also have to remove std::stringstream and go back to char arrays
and hope to god it can deal with that
 
@TonyTheLion What numbers were you expecting?
Are you sure the numbers come in their textual representation?
 
Ell
argh boost::serialization still making me sad
 
Protocol buffers <3. Somewhat. There's hate mixed in there somewhere too. But <3.
 
8:39 PM
@TonyTheLion Is that data coming from another device? And if so can you put a "sniffer" in between to see the raw data as it's being sent out to your program?
 
The default C++ code generator sucks.
 
@TonyTheLion Are you sure that the device sending the data is sending it correctly?
 
Hmm, assuming you're on a latin-1 codepage, that's a bunch of 0xDCs and then a bunch of 0xCCs. I think that's some buffer boundary or uninitialized storage marker things.
 
@JimNorton Yes, I can look at it in the buffer, and the data is perfectly fine
just when written to a file, it goes fucked up
 
Ell
how do I get a stacktrace from an exception?
 
8:44 PM
With a debugger.
 
@Ell easily? You can't. With effort: ideone.com/wkcTL
 
Ell
aww snap
 
The duck has some hacky code to build a stack trace by hand in code.
 
note: it does slow down function calls where tracing is enabled.
 
@Ell Would strace help at all? Or even applicable?
 
Ell
8:45 PM
@MooingDuck thank you :) but I think I'll just make do with cout << "yay! it worked!"
I don't even know - I pretty much can't debug at all
 
@Ell that's the logical and correct thing to do
@Ell that is a skill you need
 
Ell
I know :/
 
@Ell No debugger?
 
Ell
running the debugger just doesn't seem that useful to me - I get a list of exceptions that are thrown, but only one filename/function
I just don't know what to do with it
@Drise I have it, I just don't know how to use it
 
Grow a pair and learn it, dammit.
(You can learn it before growing a pair, as that may take some time)
 
Ell
8:48 PM
haha hilarious :L
 
0
Q: Edit an address in a .exe file

BlastcoreHow it's possible to edit an executable (.exe) file and change the HEX code at some specified address? Let's think i have this address: 0x0 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

 
@Ell glibc has backtrace(), and you can use it with abi::__demangle().
You must do the backtrace in the ctor of the exception though (or at least somewhere before you throw it).
 
@Ell Why not use soemthing like Qt Creator? GDB is all set up and good to go...
 
@RadekSlupik It's something nice to put on a base exception class.
 
Ell
I'm using code::blocks, but its not that I don't know how to use it (as in step into, next instruction etc.) its just I don't know what to do with it - how to use the information etc.
 
8:51 PM
If you can debug with injected output, you already have the skills.
 
@RMartinhoFernandes I had cases when injecting debug code makes the bug go away... almost always an indication of invalid memory accesses. At least on an embedded device with no OS.
 
Yeah, but my point is that the skills are the same: the ability to reason about the correct state of the program.
 
@RMartinhoFernandes Oh yeah, I understand. Just sharing a small story of what has happened to me on occasion.
 
Ell
I can't for the life of my figure out why I'm getting unregistered class exception, I've done everything. Maybe it is my project setup, I have a client/server build target
 
C has the capability of driving a man insane
 
9:01 PM
@TonyTheLion Much like most other languages.
 
even _itoa converts the number given wrong
I think I must have UB
 
@RMartinhoFernandes I put that in there to be sure people don't think of distilled or deionized water. I really mean the pure pure stuff with (near to) no solutes present.
 
47 mins ago, by R. Martinho Fernandes
Sounds like UB is going on.
@TonyTheLion I win!
 
Great. Me gots the virus. 5 and scanning.
If only I could game decently on Linux...
 
Ell
you can :D
 
9:03 PM
@rubenvb I think you should have put it somewhere else in the sentence. "scientific %" makes you sound silly, I think.
 
Ell
minecraft is all you need :)
 
@RMartinhoFernandes You're right. Let's edit that out :)
 
Ell
anyone willing to have a quick check on pastie.org/4134413 and pastie.org/4134414 say, @EtiennedeMartel who helped me solve it last time but now I can't get it to work again? (also, using BOOST_SERIALIZATION_BASE_OBJECT_NVP doesn't change anything)
 
There.
 
MINECRAFT!
 
9:04 PM
0
Q: Is pure (100% H20, (near to no) solutes) water toxic to living organisms?

rubenvbI know about the effects and myths about drinking distilled and/or deionized water. I'm not asking about such substances. I wonder if a semi-immediate effect of drinking, say 1L pure 100% H2O is deadly or harmful. My intuition says yes: either the reverse osmosis effect also present in distille...

 
See also: Undercraft.org
 
That's better :)
Back to Tron Legacy.
 
@Ell Pretty sure I never saw that.
 
Ell
@EtiennedeMartel No you didn't - you saw my playing about version just to learn it, now I'm actually applying it :)
I don't understand why it doesn't work, I've tried everything!!!!
 
@Ell ... except the thing that works :P
 
Ell
9:06 PM
I get "derived class not registered or exported"
 
I don't know how people get viruses...
 
Ell
@RMartinhoFernandes haha yes :L
@Drise torrenting movies/games etc. :L and not using linux :D
 
@Drise Through the air, cutting themselves with infected knives, using infected syringes, sex...
 
Like seriously, I get bored and purposefully give myself a virus just to see if I can get rid of it. I haven't legitimately gotten one in about 5 years.
 
Ell
I tried to infect a windows xp machine but couldn't do it
I donwloaded loads of torrents, free toolbars etc. but the damn thing still worked fine. I have no idea how!
 
9:07 PM
@Ell Have done and have done, and I need to game, fuck linux for that.
I hate toolbars..
 
Ell
@Drise what do you play?
 
@Ell Everything.
 
Ell
haha okay :)
Not supertuxkart though :L
 
@Ell Currently, DayZ
@Ell Recently, Amnesia, starcraft, etc
 
The WTFPL (Do What The Fuck You Want To Public License) is an infrequently used, extremely permissive free software license. It is essentially no different from dedication to the public domain. was written by Banlu Kemiyatorn who used it for Window Maker artwork. Sam Hocevar, a French programmer who was the Debian project leader from 17 April 2007 to 16 April 2008, wrote version 2.0. It allows for redistribution and modification of the software under any terms—licensees are encouraged to "do what the fuck [they] want to". The license was approved as a GPL-compatible free software license b...
 
9:09 PM
Most any humble bundle
 
Amnesia looks awesome.
 
Ell
haha I've seen that before, the wtfpl
 
@RMartinhoFernandes Its scary...
 
@Drise That's why it looks awesome.
 
9:12 PM
@TonyTheLion seems like a bad idea, people could charge for your stuff
 
yea, I'm not going to publish under that license, I just never heard of it before
 
@MooingDuck Which is apparently also fine by the author. "Charge for my stuff" is covered under "Whatever the fuck you want to do".
 
so thought I'd share my new found knowledge
 
@MooingDuck Just like public domain.
@TonyTheLion The cat has mentioned it several times before.
 
is there any UB in here: ideone.com/hLLcD
 
9:15 PM
0
Q: behavior of memset

Vinicius HortaDoes this function has the same behavior that 'memset'? (Oops! Your question couldn't be submitted because: Your post does not have much context to explain the code sections; please explain your scenario more clearly. ) inline void SetZeroArray( void *vArray[], unsigned int uArraySize ) { ...

 
@RMartinhoFernandes oh, I missed that
 
Ell
lol
 
int lensyst = strlen(systick);
systick[lensyst] = '\0';
@Tony what's the second line for?
strlen only works if the string is null-terminated.
More specifically, strlen guarantees the following: s[strlen(s)] == '\0'.
So, either the second line is redundant, or the first one UBs.
 
Same happens with buff later.
Perhaps you should consider not using strlen at all, at least not for the buffers you populate yourself.
 
9:19 PM
@RMartinhoFernandes get the len of systick
if that's the line you're referencing
 
@rubenvb I found a few links that might be useful. Added comment to the question.
 
@TonyTheLion I mean, the systick[lensyst] = '\0' one.
 
However not able to find any peer reviewed data.
 
Cool, I just noticed that I can use the override specifier :)
 
@RMartinhoFernandes yea, it's pointless, shouldn't be there, I realized now
 
9:21 PM
Oh, beer time.
 
Ok, I didn't know if itoa would put a terminator, so I had to ask.
 
@CatPlusPlus Now you don't :p
 
yea it does, I looked
 
Screw this, I'm going home.
 
@JohnDibling ?
 
9:25 PM
Every time I see a system("pause") on a question I get an urge to mindlessly downvote without reading anything else.
 
@JimNorton: It's beer o'clock. Consider the following psudocode:

this = !home;
this.screw();
go_home();
3
 
@JohnDibling It's always beer o'clock.
 
You screwed your anti-house?
 
@EtiennedeMartel: while( true ) drink().drink().drink();
 
@JohnDibling Until an "exception" gets thrown :)
 
9:29 PM
Until an "exception" gets thrown up :) FTFY
 
@StackedCrooked You can always keep drinking after that.
 
Other possibilities include: PassOutException, ComaException ...
 
It depends on how exception safe your system is.
 
@EtiennedeMartel Yeah, but it does cause a slight interruption..
 
while(true) { try { while(true) drink(); } catch(...) { barf(); } }
 
9:31 PM
The worst is OutOfDrinksException
I'm seeing stars now and I didn't even drink..
 
bye all
 
@JohnDibling Bye
 
My god! It's full of stars!
My god! It's not full of stars!
Who was playing around with stars?
 
Who the fuck.
 
@RMartinhoFernandes I'm sorry Dave. I can not tell you.
@Drise ?
 
9:35 PM
:)
 
Fuck!
That conversation was definitely star worthy.
 
@JimNorton Another robot?
 
@StackedCrooked Yes exactly.
 
@Drise So, it was you?
 
@RMartinhoFernandes Of course it was me! I star everything.
 
9:38 PM
That's spammy. If you want to "mark" a whole conversation, use the bookmarking feature of the chat.
 
@Drise It startled me.
 
STAR ALL THE THINGS! CHALLENGE ACCEPTED!
 
Many regulars use the starboard to catch up on the important bits they missed. Having it flooded with a star per message from a conversation reduces its usefulness.
 
@ScottW Ush ush. Here's a bone.
Lol.
 
9:50 PM
No
 
my trusty old seagate drive sure is getting hot :/
 
@ScottW Ok!
 
@melak47 Bang it before it finds someone else then.
 
@DeadMG I think it's just doing it because I'm wiping it, and it might be afraight I'll give it away though :(
 

« first day (615 days earlier)      last day (4351 days later) »