« first day (731 days earlier)      last day (4234 days later) » 

12:00 PM
@Cheersandhth.-Alf try to use FASM, at least you can write the import directory by yourself with it
 
@Abyx oh, i hadn't heard of that. I did find jasm and masm32 when i googled
 
I've never heard of jasm)
 
Ok, there are a lot of nice things to be said for Git, but wow, I don't think I have ever seen a piece of software which failed at handling different line endings quite so badly
in a world full of software which fails to handle LF vs CRLF, Git nevertheless puts itself in a whole other league of #fail
 
hmm, in Python what would be the easiest way to take a substring out of a string and replace it with something?
 
@Cheersandhth.-Alf here is an example - pastebin.com/8YMpUqT3
 
12:09 PM
he he, "needed for win32s" :-)
but thanks
it's nice to have such examples around
 
@TonyTheLion probably str[:x] + newStr + str[y:]
 
@Abyx does that result in a new string?
 
@TonyTheLion sure, it does
 
what's the colon mean again in [:index] ?
 
12:19 PM
@TonyTheLion it's short form of [0:index]
 
@TonyTheLion slice from 0 to index
 
@Cheersandhth.-Alf That's oooooold. I remember having to install it :)
@jalf hmmm. missed the related config settings? (safecrlf, autocrlf, ignorecase are interesting for windows, IIRC)
 
github is the only good thing in git. hg ftw
 
> I am extending this class into an audio book:
 
@Abyx how would that work. Github wouldn't be here without git
@kbok something a teacher might say
 
12:29 PM
-1
Q: Overriding classes and operators in C++

KnitexI am extending this class into an audio book: #include "Book.h" using namespace std; Book::Book():year(0), title(NULL), authors(NULL){} Book::Book(vector<string>* bookauthors,string booktitle, int bookyear ){ authors = bookauthors; title = booktitle; year = bookyear; } Book::Bo...

 
@sehe now, we did not. :) And I think the sheer number of related config settings proves my point
 
@Abyx thanks :) Just saved me manually replacing text in a 100 line file by writing a Python script to do it.
 
@jalf You. Have. Clearly. Never. Seen. Subversion.
What VCS-es have you used in the past?
 
@sehe What do you mean? Yes, I have seen subversion, and I hate and despise it, but I honestly don't remember having this kind of line ending-related problems with it
I don't remember svn ever putting me in a situation where it reported that a file had been changed as soon as you checked it out, and which you could not commit because at the same time, it claimed the file was unchanged
 
@jalf Do you remember using Subversion across Windows/UNIX gaps then?
 
12:36 PM
@sehe Yes
 
Yay testing class.
Most boring subject ever.
 
Disclaimer: I have, but I treat all my files as 'binary' since looooong. Only editors touch lineends and editors just keep it as it was
@jalf I remember having to set svn metadata (keywords?) just to get it right. This was per-file
 
@sehe so you're saying that with svn it was possible to get it right?
That alone seems a major improvement over this shitty situation
@sehe funnily enough, we tried that too. Tell Git to treat all the files in question as binary. You wanna guess at how much of a difference that made?
 
@jalf Ok, time to stop ranting :)
@jalf I cannot guess at the nature of your actual problems (as you don't describe them) but I guess you could go to Stack Overflow with a tangible question.
 
Git tracks content, not files.
 
12:40 PM
@daknøk Thank you, Oracle. That is true. And irrelevant
 
@daknøk but you can still tell it how to treat the content (as text or as binary data) based on attributes such as the filename :)
 
Ah yeah, I read that wrong.
 
@sehe I might do that later. It's not a huge deal right now, just annoying that it keeps showing one file as "modified". Or maybe I'll just write up some proper test cases when I get home, and see if I can pinpoint exactly which scenarios it blows up on. Then probably write a ranty blog post or something. :)
 
@jalf If it does that without you loading the file in any editor (e.g. opening .sln with VS), this looks like a bug in your git software. What are you using? Just git CLI, or something with that? I've had issues with Unicode filenames on Windows before, with older versions of tortoise-git e.g.
 
2
A: Code Style. If statement

Luchian GrigoreFirst, if (ptr) doesn't check whether a pointer is intialised or not, it checks if it isn't NULL. You can initialize a pointer to NULL and the condition wouldn't hold. Second, there are two cases to be treated: 1) the pointers are allowed by the code logic to be NULL In this case, you most cer...

shameless publicity
 
12:45 PM
@TonyTheLion 'manually replacing text in a 100 line file' - could you not just use an editor macro?
 
@sehe Just the CLI. On both Linux and Windows
and no fancy filenames either. Just plain ASCII
 
user1174868
I hate programming tests, just failed a quiz in my intro to programming class but all I do is program and study that shit
 
Of course, it is theoretically possible that we just messed up our configuration, but I doubt it. We spent quite a bit of time reading up on exactly how Git handles this issue (and how they handled it before then, and before then -- each time adding new configuration options superseding the old ones) to try and get it right
 
Debugger for programmers is like wrench for plumbers
 
@VinayakGarg more like the plunger - it helps clean the shit up....
 
12:51 PM
@LuchianGrigore You use debugger to clean shit?
Hmm... a phpBB forum is trending here
 
@Jordan lisp
@VinayakGarg not trending. It is pinned. So it doesn't fall over
 
@sehe I don't know, is there some option to pin it. I said trending because it has 6 stars and is at top.
I need to use "operator<" of base class inside "operator<" of derived class, so is it safe to
return static_cast<Base>(*this) < static_cast<Base>(rhs);?
 
@VinayakGarg sure. Or you can use BaseClass::operator<(rhs)
 
@TonyTheLion s.replace('foo', 'bar') maybe
 
1:00 PM
^ Nice for person trying to learn to play bass (knowing nothing about it)
 
@kbok oh, thanks :D
 
@thecoshman HTH
 
@jalf That's a good option! Thanks
 
oh, I think I found that my self, that's a run time error is it not? I am having build time errors
 
@VinayakGarg It's what you'd do with non-operator functions, at least. With an operator it is kind of ugly, so your version might be preferable there. :)
 
1:03 PM
@jalf Yeah, and I have used such a cast second time in life, so I will let it be there.
 
@CatPlusPlus foo and bar were different on every line. So I had to go by index in the line. The sizes of foo and bar were the only constant
 
@Cheersandhth.-Alf "knowing nothing about it" is not a handicap as it comes to certain arts / crafts
 
@MartinJames I may have been able, but I'm not familiar enough. Anyways it's done now. I've learnt something as well. :)
 
@LuchianGrigore That's a good answer. Except that I prefer 0 to NULL since it's C++.
Nota also that the smalltalk convention is to do nothing when passing a message to nil
I think it's stupid, but some people do that
 
I've seen that type of code a lot in codebases and always cringe...
 
1:06 PM
@kbok I thought nullptr was C++
 
I think it's a style widely regarded as good, when in fact it's terrible, so people just adopted it without asking why...
 
@TonyTheLion Yeah - a bit of Python. You now officially know infinitely more about it than I do:)
 
Having been using Python for a bit now, I must say that C++ is quite a nuisance to get anything done in. Python is just the awesums.
 
@melak47 nullptr is C++11, 0 is C++98/03, NULL is C
 
It's simplicity is just elegant and beautiful.
 
1:08 PM
@LuchianGrigore People do that a lot :) But it's the default behaviour for Objective-C methods
 
@kbok yay, so I can mix all three! :D
 
@TonyTheLion C++'s paranoiac type system is useful in larger projects and in teams
 
Xeo
@TonyTheLion You're just using the wrong libraries. :P
 
Python is cool as long as you keep the codesize small
 
@Xeo lol. For small tasks like the one's I just did in Python, C++ is just not worth it.
 
1:10 PM
@TonyTheLion I still like C++ better than windows batch script
 
I'd say that under 10kLOC, use python.
 
@melak47 oh me too. I hate batch. Urgh
 
@TonyTheLion I don't follow, C++ is always worth it :P
 
yes
@kbok 10LOC
 
1:11 PM
Past that, some stronger compile-time checks become really helpful
 
yes, the static typing of C++ is good for lots of reasons
 
Also performance.
Python should really be named pyyyyyythhhhoooooonnnnnn.
 
oh is that slow than?
 
-1
Q: The * in C++ Initialisations

user1013512 Possible Duplicate: The Definitive C++ Book Guide and List I'm new to C++ and have been playing around witha few examples, I was just wondering what the * meant when initialising a class. Normally in AS3 I would do this: MyClass myClass = new MyClass But I have seen this in c++ M...

 
Compared to C++, yes. But they're working on it and making great progress.
 
1:13 PM
@TonyTheLion Trying solving problems in python on codechef :) You will know
 
@TonyTheLion just verbose :P
 
@TonyTheLion interpreter is slow, C libraries aren't
 
@VinayakGarg hehh
 
@VinayakGarg oh sorry, just looked closer. What you're doing now would cause slicing. Either cast it to Base* and dereference those, or cast it to Base&
 
quick squib question, ephemeral ports, used for accepting inbound connections right?
 
1:15 PM
Seriously, this is "Frequently Asked". Jeez !
 
@melak47 Without braces it has hard to follow code
 
@VinayakGarg yeah I like braces and brackets
 
also, more generally, if the function is virtual, then you have to use the approach I showed instead of casting
 
@Feeds (╯°□°)╯︵ ┻━┻
 
@thecoshman haha, well..now you get to close vote :)
 
1:17 PM
Someone bin that please
 
@jalf What's slicing?
 
@thecoshman euh, C++ doesn't have much to compete against it
 
@VinayakGarg class Derived : public Base { int a; } Derived d; d.a = 5; Base b = d : d.a is lost
 
@melak47 no I don't :(
 
@thecoshman aw. well, me either :)
 
1:19 PM
@melak47 "me neither" FTFY - </Grammar Communist>
 
@kbok Thanks!! Nice explanation
 
(leaving of the Nazis, they've had a raw deal, I am sure they had rather good Grammar)
 
@jalf From what I have understood, of slicing, I think it is not a problem because I don't need derived class's data for comparison.
 
@kbok wait... how does that work :S
oooh I see...
that's not legal C++ is it?
 
It's called slicing, and it's legal
 
1:23 PM
I think @kbok missed the static_cast
 
the copy constructor and assignment operators take const references so the source object can be used polymorphically
in such a way that a Derived can be used as a const Base&
 
but how can you construct a Base from a Derived?
are they autofuckingily generated?
 
Slicing :)
 
@kbok (╯°□°)╯︵ ┻━┻
 
Of course constructors are autofuckingmagically generated
 
1:26 PM
I didn't think a copy constructor of that style would be though :(
that just looks so very wrong
 
You can write the copy constructors in the way they would be generated, and the issue becomes obvious
 
I can understand how you can make a 'copy' constructor that can make a 'copy' of any other class, but I wouldn't think it would make where the type you are copying is not the exact same
 
@VinayakGarg It is a problem because it is undefined behavior (afaik) :)
 
@jalf Now I am worried.
 
1:29 PM
@thecoshman The derived instance d binds to const Base& other
 
@VinayakGarg why? Just make the small change I suggested, then your code is fine.
 
It's purrfectly normal
 
@kbok yeah, I get how you would write one your self, I am just stunned that it will be automatically generated for you
 
@jalf I am using BaseClass::operator<(rhs) then
 
@thecoshman You're surprised that the constructors are generated ?
Well actually they are "ODR-used" which is a bit different
 
1:32 PM
@kbok ¬_¬ I am surprised it will generated constructors for this case, but I can sort of see how these can be deduced
 
default-constructors, value-constructors, copy-constructors and destructors are ODR-used AFAIR
and assignment operators
hence the rule of three
 
yeah, I just didn't think that a copy-constructor would be generated that will 'copy' a derived class
 
This is merely a side-effect
 
I thought it would only copy the same class
 
But yeah, it's suprising
 
1:34 PM
something to watch out for
 
Yeah. But you can also turn slicing to your advantage if you customize the base class' copy methods
 
yeah... so you code you base class can be instantiated from a copy of a derived class, a bit like CRTP but with out the T
 
Yes. Never seen a use for it though :p
Let me know if you think of one, that could make a fun blog post
I'm tired of people talking about slicing as if it was the worst evil
 
if I do, I'll be sure to write it my self :P
 
As you wish, lol
 
1:38 PM
actually... I am sure I have done stuff where a base class has a constructor taking a derived class... but It might have just been manually slicing :S
oh, @Kbok, have you looked into setting up some chat system?
 
Possible. One thing to watch out is that when you copy, the state of the source class is not necessarily a valid state for a base class instance even if it's valid for a derived class instance
@thecoshman I've setup Victory Chat 2 on my machine yesterday
 
@kbok o_0 let me read this a few hundred times - oh I see what you are saying, the derived class may 'loosen' the limits of certain values
@kbok put link in forum plz
 
It's nice enough, but a few changes may be necessary before we really use it
I'll put one on one of my servars, and share the link
 
is this the FOSS one?
 
in the meantime IRC and hipchat are the only stuff available I'm afraid
yeah, but it's BSD like so that's kewl
 
1:42 PM
what happens when you pass malloc a value larger than the type of it's size argument? Is that UB?
 
has any one been on IRC recently? I've given up restarting the client every time this crap-top dies
 
@TonyTheLion unsigned overflow I guess
 
@TonyTheLion what do you mean? You don't pass malloc anything other than its size argument, do you?
 
@thecoshman same here
 
@jalf I mean you pass in a value that is larger than the size of size_t type
 
1:43 PM
@TonyTheLion you mean, int* stuff = malloc(sizeof(int) +1);?
 
@TonyTheLion malloc doesn't care about that, or see it. The size_t overflows, and the result of the overflow is passed to malloc
 
@thecoshman yes, but it's size_t for malloc
@jalf ah.
 
@TonyTheLion malloc(numeric_limits<size_t>::max() + 32) allocates 31 bytes
 
@TonyTheLion meh, malloc is the sign of shit code(er)
 
so malloc really has nothing to do with it. The question is simply what happens when you try to assign a really really big value to a size_t object
 
1:44 PM
uh, 31
 
?? is 'sizeof(int) +1' a particularly big value on your system/s?
 
@kbok I was about to say you can look at the code in the repo and use the to base you windows impl' of, but it is so out of date compared to what I have now :P
@MartinJames would normally be five, no?
 
@thecoshman I'll be too busy with the chat tonight anyway
 
@kbok so I can slack of that little bit harder :P
 
lol
 
1:47 PM
@thecoshman: if you mean the C++11 thing then it's called nullptr rather than null_ptr, which suggests you aren't using it much either ;-p — Steve Jessop 33 secs ago
 
SlackOverflow.
 
@thecoshman BUSTED!
@kbok it's Stack Overflow
 
@LuchianGrigore I know :(
!_!
@SteveJessop I use which ever one highlights to pleasing colour :P — thecoshman 1 min ago
¬_¬ I hate chat sometimes
 
@sbi I just finished reading... wow.
 
1:54 PM
I was just reading up on Heap overflows.
 
@DeadCicada oh god, don't kick that up again!
@TonyTheLion at work, stackoverflows and heap dumps are a common thing to have to deal with
 
@thecoshman that doesn't sound very good.
 
seriously! how does modern software stackoverflow?
 
@thecoshman bad code
 
@thecoshman Infinite loops / C arrays of 10k elements :p
We have indeed automatic C arrays of 10k+ elements
 
1:57 PM
Java
 
@TonyTheLion I wrote an article in my school's journal about buffer overflows
Nobody gave a fuck.
 
Prolog.
Professional, Modern, Entreprise-Style Prolog.
 
@kbok they're obviously ignorant
 
because if you look at the sheer number of discovered exploits in software, then you realize that knowing about BoF's or Heap overflows or any other exploitable bug is necessary
 
1:59 PM
Use bounds-checking, never worry about overflow.
 
@thecoshman why? you afraid?
 
naptime kbye
 
@thecoshman small stacks
@DeadCicada Ok, you really are 54 then :)
 
@sehe don't want to have to sit thought it all over again
@sehe or just a whipper snapper
 
2:01 PM
Shut your eyes and be done with it. The ape hasn't said a foul word. One or three slight jabs about it in the week after. That's hardly misbehaving, right
Anyways, time to pick up my book: swimming lessons :0
 
Hi all. How's everybody today?
 
Shitty
Like usual
 
chronical diarrhoea?
poor thing...
 
Chronic assignments
 
@CatPlusPlus That does suck -- worse, you find out that when you've "recovered", it just gets worse!
 
2:14 PM
@sehe i recommend, just jump right into it
@DeadCicada u still doing things for european whatsitsname?
 
I've never really understood the various overflows anyway. You know how big the buffer/scruct/whatever is - you've just allocated it. Read in that much data. I've never really tried reading in any more than that - I'm pretty sure that it's a bad idea <g>
 
What
 
@MartinJames Normally when you do overflows, you write in more than you've allocated for.
 
Terrible low-level languages with terrible low-level APIs, that's why.
 
like if you allocate 5 bytes in a char* and then with strcpy write 10 bytes to that buffer
boom!
 
2:19 PM
BoOOm ! hinhinhin
 
And that whole "who needs boundary checking, better have more PERFORMANCE"
 
@CatPlusPlus Terrible ALL THE THINGS.
 
@TonyTheLion ..but there it is! The buffer size - right there in the code.
 
@MartinJames yes, but unsafe functions like strcpy exist. They don't do boundary checking.
 
There are APIs that require you to be psychic (like libc).
 
2:20 PM
@MartinJames it's like, using [i+1] to check a next element, so on
 
or strcat or whatever the fuck
 
Pick high-level safe languages erry day
 
there is "gets" too.
 
@TonyTheLion You'd rather have strlion you
 
@kbok yes, strlion is better for me.
for the Cat it's strcat
cause he's a cat. :|
 
2:21 PM
Like I'd ever use anything from libc.
 
Like you're ever gonna be positive?
 
@CatPlusPlus welcome to the real life.
 
Yup, real life sucks.
 
Not EVAR. Mr. I'm-always-negative-cause-I-can.
 
I'm negative because there's no reason to be positive.
 
2:22 PM
Meh
That's a bitter view of life.
 
There are lots of reason to be positive.
 
Haskell is a reason to be positive :)
think flodl
 
If only every software was written in a safe language.
 
yes, but then... we'd be out of a job.
 
then it would be boring. Perfect world is boring
 
2:24 PM
Yes, bugs are so fun.
 
I think you focus too much on the negative Cat.
 
Security exploits are even more fun.
 
of course they are. :P
 
Yes SIGSEGV, my favourite.
 
you can break things.
Woo :)
Take out the sledge hammers!
 
2:24 PM
Wonderful.
And then you get malware that steals your bank password through a security bug in a piece of shit software that you've used only once.
This industry is shit.
 
ITT Depression.
 
I hate it when my values explode into infinite loops... — Luchian Grigore 4 secs ago
 
I'd rather play games all day.
 
@CatPlusPlus go find another industry to work in. Go fill shelves in your local supermarket. :P
 
Physical :effort:
 
2:28 PM
oh gawd.
the cat has to extend a paw
 
@CatPlusPlus ..and they can overflow too:(
 
@LuchianGrigore I have the feeling that you're trolling people more than you help them. Don't browse questions if you don't feel like being nice to noobs. Just sayin'.
 
If I have to work, I'd rather not move while doing it.
 
My DNS is dead again:(
 
@TonyTheLion Sometimes I almost miss working fast food, just for it's simplicity
 
2:29 PM
8.8.8.8
8.8.4.4
 
user image
12
@CatPlusPlus ^ negative cat.
 
@kbok oh come on.
 
That reminds me that I haven't eaten anything yet today.
Need to order something.
 
@CatPlusPlus call std::sort()
2
 
@CatPlusPlus That's why you are negative.
 
2:32 PM
I've tried all the 'ipconfig/renew' stuff. It's reboot all time:( Bye for a bit..
 
@Abyx you mean positive cat?
 
@thecoshman uhm... dunno, actually both of them doesn't look positive
 
@Abyx well, cat is negative normally, so a negative photo of him must be positive, and it does being a smile to my face
 
@Collin Yes, I know that feeling.
 
I love my job, but sometimes I feel like doing something that I can just do without thinking.. Wendy's grill was kind of therapeutic that way
 
2:40 PM
Mind needs break; too
 
yep
That's why I like watching a movie at night, perfect break from thinking.
 
@thecoshman That cat looks happy in fact
 
@Collin I know what you mean, working in the pub, was never stressful. Well, I don't get stressed out now...
 
@Cheersandhth.-Alf you mean... constistency ? :o)
 
He must do the opposite of Cat, which is to come in here and say rational and helpful advice to those who need it, then leaves.
 
2:43 PM
ritgh
 
to be fair, @cat does offer good advice, you just have to be able to shake off the bitter coating it comes in
 
@thecoshman oh I'm not saying cat doesn't give good advice, I was merely commenting on his extreme negativity.
 
When I'm old, I want to be a CS teacher and never be tired ever in my life.
 
@TonyTheLion oh for sure, though not sure if the puppy is worse or not
@tony are you going to join back in with the Kyrostat stuff at some stage?
 
@Abyx is it Lame Pun Friday already?
 
2:54 PM
@tony we have imaginary cookies
 
@thecoshman I may do. I'm just a bit lazy at the moment. I don't want to commit to it, if I don't know that I can actually get something done with it.
@thecoshman I think the cat is more negative.
but that is my personal observation.
 
The cat was not that negative before! I am not crazy.
 
@TonyTheLion I know what you mean, I think that was the main problem, trying to assign tasks to rigidly. Really, we just need to keep a job list of small tasks that people can pick up an sat "I'm working on this for a bit" then hand over some code, either bored or finished
 
@R.MartinhoFernandes He may not have been, but he has been recently.
 
is he still in uni?
 
2:56 PM
yep
 
@TonyTheLion Since we are all programmers, it's very likely that people will pick up and drop tasks as quickly as they change socks. The idea is that you get some shit done, document, and move on - no commitment, no responsibility, because it kills the fun /cc @thecoshman
 
How often do programmers change socks?
 

« first day (731 days earlier)      last day (4234 days later) »