« first day (845 days earlier)      last day (4101 days later) » 

6:00 PM
Hm.
I need an exception for when a null pointer is present.
throw NullPointerException <-- I like it.
 
not the lhs
this way
 
@ThePhD why not throw nullptr :3
 
@melak47 That's just mean. D:
@JohannesSchaub-litb That doesn't... make sense, does it?
I mean. the LHS is the object that's usually being modified, right?
Why return the RHS ?
I'm thinking of cases like += or =.
 
template<typename Rhs> const Rhs& Class::operator=(Rhs &&rhs) { convertAndAssign(rhs); return rhs; }
@ThePhD it effectively does
 
@ThePhD Java?
 
6:03 PM
so you can do a = b = c; and both a and b are set to c
and not: a is set to b
 
Ell
@ThePhD why?
 
@EtiennedeMartel C++.
 
@JohannesSchaub-litb OTOH, we're all used to the other way around.
 
@ThePhD Null pointers are programmer errors. You should assert for them, now throw exceptions
 
@melak47 Whatever your argument-parsing library does :v
 
6:04 PM
@CatPlusPlus which one would that be, remind me again :3
 
I don't know, what's yer language
 
C++
boost.something?
 
Boost.ProgramOptions is an option
 
@EtiennedeMartel Really? I thought it'd be better to throw in library code when you get a null that you're supposed to work with.
 
user784668
folks
 
user784668
6:05 PM
Is #include SOME_MACRO legal?
 
@ThePhD highly debated.
 
@Fanael Yes
 
user784668
Good.
 
@MooingDuck Well, what's your preference? /cc @EtiennedeMartel
 
@MooingDuck i prefer things that make sense over things that used to
 
6:06 PM
@ThePhD Well, I don't do library code, so there's that.
 
@ThePhD I also assert. In debug builds, helps the programmer find where he made the mistake, and in release builds, it's UB with no overhead whatsoever.
 
@EtiennedeMartel Well, if it was non-library code, what would you do?
 
@ThePhD Assert.
 
Hm. Guess I'll just assert then.
 
Assert for programmer errors, throw for user errors.
 
6:07 PM
Null pointers are not automatically programmer errors.
 
At the moment, I throw on most everything, except a few cases where returning silently is non-harmful to operation.
 
Because such errors are entirely avoidable and should never happen.
 
@ThePhD Actually, NULL pointer is an exception to me, I ignore NULL pointers altogether, since (my) debuggers already trap for those anyway as if there was an assert.
@EtiennedeMartel in release.
 
chat keeps failing to scroll
grr
 
@MartinJames I can't think of when they aren't.
 
6:08 PM
I guess I'm still too throw happy from the DirectX API.
 
Anyway, I don't use pointers in C++.
 
I throw if the DirectX api so much as coughs slightly.
 
Or at least I try not to use them.
 
I use pointers everywhere.
I can't really get away with it, I'm working with OpenGL and D3D. ._.
 
They are useful poison pills.
 
6:09 PM
@ThePhD Yeah, but D3D calls can fail for reasons outside your reach. Such as a borked driver, for instance.
 
desc.add_options()
    ("help", "produce help message")
    ("compression", po::value<int>(), "set compression level")
;
the hell is this
 
user784668
@melak47 Boost.ProgramOptions.
 
operator()()()()?
 
@melak47 operator() that returns something with an operator().
 
operator(), which returns the same type as add_options, which continues to stack on itself.
 
user784668
6:10 PM
@melak47 auto operator()(whatever) -> decltype(*this)?
 
Xeo
See ya tomorrow guys.
 
why ;_;
 
@Xeo Byyyyyyyeeeeee.
 
@melak47 Fluent interfaces are cool.
 
I read that as 'Flatulent'
 
6:11 PM
lol.
 
user784668
Fraudulent.
 
And real C++ programmers don't use methods if they can get away with operator overloading.
So, fluent operator calls.
 
user784668
@EtiennedeMartel Real C++ programmers don't use methods at all. They use member functions.
 
Ell
@EtiennedeMartel what are user errors?
@Fanael same thing, right?
 
@Ell Installing your apps :)
 
6:12 PM
@Ell Errors that are caused by the user.
 
Ell
as in, of your application?
 
(In this case, "user" means "anything outside your program")
 
Ell
as in, the end user?
 
@Ell errors caused by user actions. Attempting to open a file that doesn't exist, stuff that can't be detected in the lab.
@Ell yes
 
If you pass a wrong value to a function, and that value doesn't come from the user, then it's your fault. So you should assert to make sure that value is never wrong.
 
6:14 PM
@Ell "Hard drive full" is as well, since you can't prevent that from occuring.
@Ell I like that: "User errors" are things that cannot be prevented from occurring in code.
 
Ell
Right
 
@Ell A null pointer is always preventable.
 
Ell
yeah to me the null pointer exception doesn't make sense except in debug mode
 
@Ell exactly
 
6:17 PM
What is a 'null pointer exception' - one deliberately raised by a null check, or a memory violation when attempting to dereference one? The null check is sometimes useful.
 
Ell
either I think
but the latter usually
 
I would agree that an exception raised because of an attempted dereference is indeed a software error.
Char-by-char state machine?
 
Hmm, The Witcher 2 is only 10$ on Steam.
Should I buy it, despite the fact that I did not play the first one?
 
Heh..
 
damn you, Mooing Duck
I want to bin his stuff, but now I can't.
 
6:29 PM
@DeadMG :( habit
 
Alberto, try a C tutorial, or Stack Overflow, or some place that is not a C++ chatroom.
 
@DeadMG just bin my responses too, I fail to see the issue.
 
last time I did that you complained.
 
@DeadMG did I? oh. short memory.
 
The Bin awaits.
 
6:30 PM
Can't recall why I did
 
well
 
Greetings
 
in the future I shall bin without asking then
ohai chimera
 
@DeadMG Though I think in the future, it might be clearer if you left one of the bin messages unchanged so they can see what happened and have a link to verify.
 
Hi @DeadMG
 
6:31 PM
eh, I usually edit them away because they're fugly.
 
@DeadMG yeah, but then we get a bunch of reposts and "where did my message go"s.
Am I the only one here who hates XML? Is that normal?
 
it's quite normal.
 
@DeadMG k
 
it's the Java of text formats.
 
Yup, totally normal.
 
6:33 PM
my company uses XML everywhere for process interop :(
 
Oh - I'm so sorry...
 
my condolences
 
No flowers by request
 
That reminds me, I had a dream last night that @StackedCrooked turned out to be one of my dormmates from college and had been working at my company this whole time, and since the boss realized we knew each other he put us in the same cubicle, and Stacked kept reporting how much time I spent on StackOverflow. :(
2
 
rofl
 
6:35 PM
Please donate all your x GB of XML files to Children In Need
 
@MartinJames we can't turn on all logging at the same time because no (single) hard drive is fast enough to keep up.
 
yeah
something more along the lines of Lua or JSON is way more space efficient
 
Yup - sounds like XML. Massed brass bands of SSD's just for XML logging..
 
@DeadMG or, not logging EVERY FUNCTION ENTRY AND EXIT AND THE FULL PARAMETERS.
 
@MooingDuck Er, and that.
 
6:37 PM
What happens when I'm bored at school:

int is_divisible_3(uint32_t x) {
return (0x92492492 >> popcnt(x ^ 0xAAAAAAAA)) & 1;
 
@DeadMG otoh, client's problems are usually easy to find. :/
@nightcracker well that's impressive
you know, assuming it's right
@nightcracker heh, I like how you return an int.
 
@MooingDuck: well it's C :)
@MooingDuck: feel free to replace with bool for C++
 
@nightcracker I thought they added bool to C eventually.
 
@MooingDuck well, they added _Bool, but I find it so ugly I rather use int
 
_Bool
 
6:44 PM
@nightcracker bah. ok
 
they were too afraid of code breakage to add bool.
 
user142019
#ifndef __cplusplus
typedef _Bool bool;
#endif
 
user142019
:P
 
Most C developers have macros for bool, true, false, TRUE, FALSE etc.
 
#define retrun return
#define ture true
#define flase false
 
6:53 PM
@melak47 #define true (__LINE__%1000)
 
movl 4(%esp), %ecx
xorl $-1431655766, %ecx
popcntl %ecx, %ecx
movl $-1840700270, %eax
shrl %cl, %eax
andl $1, %eax
ret
damn
 
alright
instantiating a massive series of templates with a class where I forgot half the template requirements for the first time
who wants to bet on the number of resulting errors?
 
how many bets do I have?
 
@DeadMG good thing you have well documented code!
 
I'll start with 100000
 
6:57 PM
@DeadMG 450
@DeadMG Also, I have all my compilers stop reporting after the first 20 or so, and even that seems like overkill. I rarely look past the sixth or so.
 
oh, I meant, real errors, not compiler-reported errors.
anyone want to change their bet before I reveal the final score?
twas only 3, I am sehr disappoint
and it even executed correctly
 
what is this
 
why thank you flickr, that's very useful!
 
my cpu doesn't even have a popcnt instruction
dissapointed.
 
even has direct links to the respective images, what more could I want
 
7:09 PM
@melak47 does the API also offer OCR?
 
@nightcracker ...API?
 
@melak47 or does it just return images?
 
this is from the HTML/JS page source :p
 
@melak47 I was just joking - API is Application Programming Interface
An application programming interface (API) is a protocol intended to be used as an interface by software components to communicate with each other. An API may include specifications for routines, data structures, object classes, and variables. An API specification can take many forms, including an International Standard such as POSIX, vendor documentation such as the Microsoft Windows API, the libraries of a programming language, e.g. Standard Template Library in C++ or Java API. Gartner predicts that by 2014 75% of Fortune 500 enterprises will open an API. An API differs from an applic...
 
I aint using no stinking web API
 
7:11 PM
@melak47 stinking?
 
yes. it has terms and conditions and whatnot. and you need to apply for an API key. and blargh.
why would I do that when I can just..."view" the page :)
 
Vehicle handling in Far Cry is legendary level of bad
 
@melak47 because the API is meant exactly for your purpose, and was designed that way?
 
@nightcracker but an API using application may not use "excessive bandwidth". Downloading ALL the photos from someone might be considered excessive. :3
 
@melak47 and do you think the same limits are not imposed on automated user downloads?
@melak47 and are probably even lower?
 
7:14 PM
also, the API seems to be mainly geared towards other web services and crap.
@nightcracker they haven't banned my IP yet
 
@melak47 I don't think it's excessive if that's the function the user requested.
 
@DeadMG well, it's not a function available on the website. and lots of flickr downloaders have lost their API keys for some reason or another
 
right, but what I mean is
if you have a button that says "Download all my photos", then it's hard to argue that downloading all the user's photos is an excessive use of Flickr's bandwidth.
it's not like the user couldn't manually and slowly request all their photos anyway
 
@DeadMG nono, download anybody's photos
 
same point
 
7:20 PM
well, I'd like to think so, but it doesn't look like everyone at flickr agrees
 
the worst that can happen is you try and then you get your API key revoked
it won't be fatal.
 
if I don't ask, they can't say no :3
also, I don't really want to do the whole REST web request thing
 
@melak47 they can only simply filter you from the website
 
@nightcracker how? by issueing an IP range ban? :)
 
melak47: among other things, yes
 
7:27 PM
I doubt I could generate enough traffic for that to happen. and if it did, that'd stop me for a couple minutes? :)
 
@melak47 until they contact your ISP
 
@nightcracker it's not like I'm downloading ALL the photos from flickr
 
@EtiennedeMartel I can't see what happens.
 
@EtiennedeMartel got some mad flex on that stick
 
7:31 PM
@DeadMG He shoots him right in the balls.
 
@DeadMG Short some padding in certain places
 
owch
 
hey... does anybody know of a good general purpose algorithm book?
 
hmph
 
user142019
Dammit stupid fucking fuck fuckinternet.
 
user142019
7:41 PM
Y U SO FUCKING SLOW.
 
my semantic analysis so far consists of verifying that Main exists and it is, in fact, a function.
congratulations, NubbinsMG
2
 
hello folks
 
@Nathvi wikipedia
 
how can you verify main exists without resolving which tokens are variable names and which ones are function names?
 
I have done that step
 
7:49 PM
ok that's a big part of SA
 
user142019
Using a symbol table. :v
 
no, it isn't
it's just "Stick parse tree in hash table".
simple enough
 
spaghetti stack built?
 
user142019
How is dealt with scopes/blocks?
 
user142019
Stack of tables?
 
7:50 PM
hey guys
 
I don't have scopes/blocks yet.
 
build system question
 
user142019
Because I’ll also have to do this soon. :P
 
nvm
I got the Solution!
<Bang>
 
@rubenvb lol
 
7:52 PM
right now
I mostly have name lookup to do.
except it's partly Wide name lookup and partly C++ name lookup with Clang.
and then gluing together my own code generation and Clang's code generation.
 
@DeadMG that is going to be such a maintenance nightmare.
 
nah, what's going to be a maintenance nightmare is the source code changes I had to make to Clang.
 
user142019
I want dried apricots that aren’t as fucking damn sweet as dried apricots.
 
lol
 
@DeadMG upstream your patches?
 
7:55 PM
nah
it doesn't really work very well, and it's really a nasty hack.
they might implement it better themselves, but IDK.
 
user142019
I think I’ll use a stack of maps for the symbol table.
 
@DeadMG it's at least a reason to suggest your changes to the Clang devs.
 
yes, typically a singly linked list of scopes, where each scope points to its parent, is called a spaghetti stack
 
user142019
Also, good news to myself.
 
user142019
We won’t be using Access nor MySQL at school for the database project.
 
user142019
7:58 PM
Better they let us implement our own databases in Erlang but you know ain’t gonna happen.
 
lol
 

« first day (845 days earlier)      last day (4101 days later) »