« first day (761 days earlier)      last day (4191 days later) » 

user1357851
12:00 PM
you can also set conditional break point if you don't ready know
 
@Aardvark no?
 
it covers a shitbunch of pointer manipulations for 155 pages and then goes about the Standard library.
 
Oh, and the book uses old Dev.
 
@DeadMG He meant code that actually compiles, in contrast to what the OP posted.
 
Heh.
 
user1804599
12:00 PM
1 min ago, by Griwes
// declare a variable and set it to 1
long lVariable;
lVariable = 1;
// declare a variable of type double and set it to 1.0
double dVariable;
dVariable = 1.0;
 
argh the Hungarian Notation
 
I think it's fine to explain it like that
 
@Aardvark I was after Hungarian Notation more than stupidity of using two lines to initialize variable :D
(It's from teh book.)
 
Hungarian notation seems helpful in this example
Same as foo and bar
If the rest of the book uses it then that's stupid though
 
Xeo
@LucDanton Yeah, that's similar to what I had in mind.
 
12:03 PM
hmm
 
@Pubby ...it seems helpful only thanks to stupid variable names.
 
why are there no map iterators as Standard?
 
as in *it = 5; calls f(5) for some f.
 
12:04 PM
I think the first thing I'm gonna do is figure out how to kill this 'Cannot call fucntion, possibly due to compiler optomizations' nonsense.
 
Because there is std::transform :(
And the stdlib is not really built around lazy ranges.
@ThePhD But the VS debugger is great, they told me.
Lunch.
 
@R.MartinhoFernandes Most of the time. Right now, It's kicking me in the face. =l
 
Is it possible to get a "correct" std::vector<bool> instead of using std::vector<char>?
I need the iterator type to be bool.
 
@Pubby No.
not unless you were to re-write std::vector, anyway.
 
Xeo
@Pubby Do you need to have *it return bool&?
 
user1804599
12:08 PM
You could box bool.
 
@ThePhD Linker optimizations rather than compiler ones, I'd guess.
 
@Xeo And have the type members be bool too
 
user1804599
struct foo {};
#define bool foo
#include <vector>
#undef bool
// xD
 
Xeo
@Pubby I was more interested whether or not you need a refernece. :)
 
@DeadMG The Linker can optomize a DLL that's explicitly referenced in the current project?
 
12:09 PM
opt i mize
 
Xeo
@Aardvark And .empty() now returns foo... :P
 
and no
 
user1804599
@Xeo oops :P and UB
 
what are you even trying to do?
 
Right now I want to step-through my code to determine the exact place where Stream*'s vfptr goes AWOL and walks into ?? no-man's-land.
 
user1804599
12:11 PM
@Pubby subclass std::vector<char>?
 
I have a before and after point, where I know the stream pointer can still call functions, and then one where I know it blows up.
 
the debugger has step-through functions
 
So I want to step-through and all call functions from the debugger window, to force-check validity.
 
@Aardvark References won't be bool& though
 
why not just observe the value of the vptr in the locals window?
 
user1357851
12:12 PM
Is here any mod who can delete post for me?
 
I'll probably have to subclass std::unique_ptr, yuk
 
user1804599
Hmm. I think you just got fucked by the Standard.
 
Xeo
struct bool_{ bool value; }
std::vector<bool_> v_;
auto v = v_ | transformed([](bool_& b){ return b.value; };
for(auto& b : v)
  // ...
 
user1357851
Anyone?
 
For some reason I can't get at the Stream* 's vfptr in the debugger locals window
 
user1357851
12:13 PM
I need two threads to be deleted
 
fucking hell, Telkitty
 
You can delete your own stuff
 
does this place look like the moderator's lounge?
 
user1357851
I can't
 
and if they were here
 
user1357851
12:13 PM
whole question
 
Flag it?
 
they would have responded the first time you asked.
so flag it and walk away
and don't spam the place up
 
user1804599
Plonkkitty
 
@ThePhD This, I feel, to be counterproductive.
even if, eventually, you find and fix this one source of corruption, you'll just have another soon enough.
 
template<typename T>
bool lessThan(T t1, T t2) {
bool result = false;
if (t1 < t2) {
    result = !result;
}
return result;
}
 
12:15 PM
if you don't want to spend your life dealing with corruption, the only choice is to write actually safe code.
@Pubby loldafuq
 
user1804599
@Pubby lolwat
 
temp-var?
 
user1804599
return t1 < t2; (or return t2 < t1;?)
 
@Pubby lol
 
12:16 PM
The thing is I have no idea how I reached this point in the first place, @DeadMG . My hope is I'll learn something from all this and figure out what I did wrong in the first place.
 
@ThePhD Can you show me some code?
 
Erm. It's pretty long and complicated...
 
meh
I can live with that
 
I mean I have the thing narrowed down to what's wrong, but there's like 4 classes involved and they're not really short, but uh. I'll give it a try....
Would you mind a zip file? >.>
 
no
 
12:18 PM
i've just rewrited my project from scratch actually, just recently. wtf/h rate was around 20 or 30...
 
user1804599
20 wtfs/h is nothing.
 
... Huh. I think I'd need like a readme too..
 
When i'm really not sure wtf is going on, i'm just disabling all functionality and start adding it step by step. And when i find some doubtfull part i either try to fix it right away, or just create a prototype and test it there, then code goes to main project.
 
@DeadMG dl.dropbox.com/u/17644642/The%20Problem.rar I'm not sure what you'll be able to make of it. I'll keep trying though. I've put obnoxious /*********** comments where the problem starts and where the code fails (PNGLoader.h)
Uh. Yeah. That's about it.
 
Xeo
0
Q: How to return this in method

Mariusz ChwI have a class Image, and I need to return instance of this class. What's the simplies way to do it? I'm a java programmer and "return this" giving me an error. #include <string> #include "AEEImage.h" using namespace std; IImage *image; Image *img; Image::Image() { image = new IImag...

...
 
12:27 PM
@DeadMG "optomize" reminds me of "lobotomize", which in the case of code removal, seems appropriate ;)
 
OH SHIT
I SEE THE ERROR
WAIT @DeadMG Waaaait MY EYES ARE NOW OPEN
@R.MartinhoFernandes Was right (if I'm correct): I was accessing memory that wasn't mine in a completely off-filter way, due to an error I was having from doing some checking with my PNGLoader: my

int filtercounts[5]; was being accsed by byte positions far past the index of 4, because I wasn't properly reading past the 32nd row of the PNG
 
room topic changed to Lounge<C++>: Please form a line to get your epiphany. [beep] [c++] [c++11] [c++-faq]
 
wow... that question just blowup my brain :)
 
@Xeo It got 2 upvotes, really?
 
@Xeo To be fair, not even in Java would that make sense...
 
12:31 PM
So it was doing dumb shit like filtercount[234] and generally fucking everything up.
So if I fix that....
 
@R.MartinhoFernandes It would have to be either a constructor or a static function to make sense even in Java.
 
this->return_this()->return_this()->return_this()->return_this()->return_this() // oh god make it stop
 
Oh god I feel so ashamed now
 
@Mysticial But a static function does not have this.
 
Xeo
I still think it's valid advice to tell him to forget Java. :(
 
12:32 PM
I've given DeadMG all that code and I just figure out why it wasn't working. ;~;
 
@R.MartinhoFernandes Right, overlooked that.
 
Xeo
@ThePhD Happens.
 
@ThePhD Mwahahaha, I knew it. One extra point for me in the crusade against primitive iteration mechanisms.
 
@R.MartinhoFernandes Technically, it wasn't the iterator's fault. It was the fact that I was reading in bytes properly, and then for debug purposes after the 32nd line, I had put a 'skip the data here' if statement without actually telling it to read more data. Not even an iterator would've saved me from my own foolishness. =[
 
meh, solving one error, leads to a new one
the endless chain of errors
 
12:36 PM
Business as usual, heh?
 
yes
basically...
luckily I have a driving lesson in half hour
so I can escape this for an hour
mwuahahahah
 
user1357851
Don't ... make me ... hurt you!
 
I've also now got a copy of the Standard open at all times
so I can refer to it more often
I'm hoping in that way, I'll get used to the standardese and also learn something
 
user1357851
remove the negative vote dammit
 
@TonyTheLion Good news: it runs without crashing. Bad news, my PNGLoader still sucks all kinds of dick.
One day, though. One day, there will be no errors, though.
 
12:39 PM
er mah gerd
 
@TonyTheLion break a leg!
0
A: How to combine boost::spirit::lex & boost::spirit::qi?

seheYou parser isn't failing, but no it isn't 'silently' skipping the whitespace either (it parses only one non-whitespace token, anyway). In fact, a property of *phrase_parse family of Spirit APIs is that it may not match the full input. In fact, this is why it takes the first iterator by reference...

^ also, fixed :)
 
GraphicsDevice* graphicsdevice = FurrovineServices::Services.GetService<GraphicsDevice>();
there is something so, so, so wrong with you
 
user1357851
back to 20
 
user1357851
$
 
@DeadMG It was either a global function, or that. <.<
 
user1357851
12:40 PM
not even trying
 
variable*
 
@ThePhD Or just don't use a shitty global variable.
as in, pass it in to Load
that usually works for people
 
Not every Loader needs GraphicsDevice, though.
 
@sehe thx
 
then pass it as a constructor argument to PNGLoader.
 
12:41 PM
heh
 
or just don't use a thoroughly pointless interface for what is actually a function
 
you got the Puppy to scrutinize your code :P
 
@TonyTheLion An unexpected consequence of my failure. ;~;
 
user1357851
Oh got a badge
 
@Telkitty remember, you are important to us! Tell us when you sneeze
 
user1357851
12:42 PM
lol
 
Um. The problem is that eventually those Loaders get super-duper abstracted away, and so the only thing that'll be happening is AssetLoader.Load( ResourceIdentifier, T*& value), where 'T' can be anything in the whole wide world that I'll need to be loading.
 
user1357851
You tend to forget as an elite troll I have 3 layers of thick hides
 
if ( !pngalive )
    goto theend;
 
user1357851
I tend to not die or disappear
 
oh gawd.
 
12:43 PM
Oh god. ;~;
 
@ThePhD Then clearly the problem is that you have an AssetLoader.
there's no need for that
GraphicsDevice::LoadPNG()- done.
 
As for that goto,
I swear it's necessary.
 
I don't
all you have there is two actions which should be RAIIified because your current code is completely exception unsafe
and then return, which you could just do in place.
 
@Telkitty "thick hides"?
 
There was a few cleanup things I had to do before I returned, though... so I moved it to the end of the function, where the return happens....
 
12:46 PM
@ThePhD think cleanup -> think RAII
 
so make them RAII objects.
your goto cleanup is horrifically exception unsafe
 
user1357851
thick skin
 
and also aids the function in being utterly unreadable
 
Sorry. :c
 
also, why the hell do you have a heap-allocated function for endianness?
what's wrong with enum class Endian { Big, Little };?
and since you are using it then why no smart pointer?
 
user1357851
12:47 PM
lol
 
Middle/Mixed/PDP can go in that Endian class too...
 
I thought we agreed those don't exist
 
Also, um. I should unique_ptr it?
 
@Telkitty is that english then?
 
@sehe Help me, this scrutiny. It burns. ;~;
 
user1357851
12:49 PM
A hide is an animal skin treated for human use. Hides include leather from cattle and other livestock animals, alligator skins, snake skins for shoes and fashion accessories and furs from wild cats, mink and bears. In some areas, leather is produced on a domestic or small industrial scale, but most leather making is done on a large scale. Various tannins are used for this purpose. Leather from processed hides has a variety of uses, including shoes, clothing, horse tack, horse harness, upholstery and even wall or other surface coverings. History Archaeologists believe that animal hides ...
 
@ThePhD Or just make it a value- there's really no need for it to be a heap-allocated anything. Ever.
 
@sehe Wait, you haven't crafted hide armors in Skyrim ? They're the simplest to make. :)
 
Maybe my design just sucks (Most likely the case), but Endian is a class that has a bunch of Virtual Functions for getting various standard integer types of varying byte sizes. I... can't use a not-pointer and invoke MixedEndian<1,0,2,3>from a stack-allocated Endian
Which is why I have it as Endian*
 
wtf
 
@ThePhD why do you need virtual functions for handling endianness? It's not like it's going to change at runtime, is it?
 
12:52 PM
@jalf No, but ti changes from Compiled On My Computer vs. Running on Someone's PowerPC vs. Running on the XBox 360
 
@ThePhD so it could be done at compile-time with a template or two
 
@ThePhD I could give you more scrutiny :)
 
@sehe ... Um. One part of me craves to learn from all of you, while the other is withering from DeadMG having to even see my code Dx
Probably why I was so adamant when I figured out the error for him to not bother with it anymore >___>
 
To clarify I'm not surprised by what you did but by your rationale.
 
also
really, nobody, ever, uses MixedEndian.
 
user1804599
12:57 PM
RuneScape uses middle endian.
 
there's only big and little, and secondly, the only need to handle endianness at run-time is when reading from a file- there's no point not encapsulating the endianness entirely in the file class
and thirdly, I was about to criticise you for reinventing std::fstream but then I realized, well, it's std::fstream
 
Why do you need binary formats anyway
 
that crazy creepy feeling when some code you call into some code you wrote a month or two ago, and it just works
 
user1804599
Wouldn't surprise me if the code consists of only pure functions.
 

« first day (761 days earlier)      last day (4191 days later) »