« first day (638 days earlier)      last day (4310 days later) » 

7:02 PM
I thought that was pretty clear
Where the sun don't shine :)
 
@sehe Oracle?
 
Are you saying I shouldn't use it at all? If so, why? What should I be using instead?
 
7:16 PM
@FredOverflow Don't speak of oracle. Tomorrow, I'll be doing 'the extra mile' with that unfortunate customer of mine (lemme scan back)
Jun 11 at 12:54, by sehe
OMIGAD - I just received a request to help out at another client. They still use CA:Gen and COBOL. Now they want me to _hack_ an 'external program' of theirs, so that it no longer appears to depend on the Oracle OCI dlls (part of the Oracle Client), but instead by hiding the actual DLLs inside the program image and loading from there.
Are they fucking kidding me?!
Jul 5 at 19:05, by sehe
And... to top it all off I convinced them to turn their external app (complete with buggy command line parsing) into a CA:Gen external procedure.
So, tomorrow is the big day. I got presented with a skeleton in C to fill in. Do you want to marvel at it's immeasurable beauty? See here: gist.github.com/2f828c1d17f303712f55
void XAMK0060(in_runtime_parm1,
              in_runtime_parm2,
              in_globdata,
              im_v_000, im_v_001, im_v_002, im_v_003,
              ex_v_000)
char  *in_runtime_parm1;
char  *in_runtime_parm2;
struct ief_globdata  *in_globdata;
struct w_ioa_000  *im_v_000;
struct w_ioa_001  *im_v_001;
struct w_ioa_002  *im_v_002;
struct w_ioa_003  *im_v_003;
struct w_ioa_004  *ex_v_000;
{
    ief_runtime_parm1 = in_runtime_parm1;
    ief_runtime_parm2 = in_runtime_parm2;
    globdata = in_globdata;
 
uhwhut
 
That's pretty bad ain't it. So, dearest puppy, this is what happens when you get a real job :)
(*disclaimer: this happens twice in 15 years, taking all of 3 days, total)
Still bad, of course
 
as if I don't already have an extremely low opinion of other people, in general
 
@sehe Why a struct inside a struct? Is it to create namespaces in C?
 
template<typename T>
i like c++!
 
7:23 PM
You like C++? You must be new to C++ then.
4
 
Yes, I'm new!
i learned about template programming today
 
wait, I can't vote to close questions with a bounty? That's stupid
 
i'm very excited
 
@ManofOneWay This is code generated by Cool:Gen, which is (IIRC) a 4GL generating (originally cobol) C code that creates extremely ugly GUIs (a-la SAP R/2 but oldfashioned). The skeleton is generated to create a externally defined function. Mainframe style!
@bodacydo Welcome to the family
 
Thanks @sehe!
 
7:24 PM
@ManofOneWay Also note the K&R param declarations
 
@sehe Awful are those. :P
 
@RadekSlupik Yeah this code is some serious WTF. The only consolation is that I actually know that the whole thing ought to be rather simple. I've seen a console app that uses getopt to get the same input and writes output to a file instead.
It uses Oracle with Pro*C, though. Anyone up to speed with that?
 
you can even get C compilers that still compile those parameters?
 
@DeadMG All of them. It's required
 
It uses Oracle. That's enough reason for it to suck.
 
7:27 PM
@RadekSlupik That's what prompted this rant. Well that, and the fact that I was preparing for tomorrow by looking at this code :)
So, Slupik, ready to swap jobs for a day?
 
Nein.
Orakel.
Flask y u no know mime type of SVG.
 
Flask?
 
@sehe What, they're still part of the C Standard?
 
@sehe That's a framework.
 
@DeadMG Pretty sure they are
 
7:30 PM
nah
if they were in C89 they'd be in C++, I reckon.
 
Why wouldn't they? Hell, even trigraphs are in c++11 still
 
DID SOMEBODY SAY TRIGRAPHS??!
 
??! nice
 
the WTF operator ??!??!
 
lol !ErrorHasOccured() ??!??! HandleError();
That actually works.
 
7:33 PM
@DeadMG I just compiled with C99:
void foo(a) char  *a;
{ }

int main(int argc, const char *argv[]) {
    foo(argv[0]);
    return 0;
}
No problem at all
 
There is a problem.
You are repeating things.
 
Where, what?
 
You say a twice while it's not needed.
It makes teh codez unmaintainabru.
:P
 
Well, it's need for K&R style argument declaration
 
here's another problem
it's C
 
7:34 PM
Yeah, but you don't need the K&R-style argument declaration.
 
Well, are you dead? How did you miss that
 
C is fucked-up. Use Python. :P
 
@RadekSlupik I need to read it. Also, I'd best leave it all untouched, since this code could be regenerated any second, and I damn well prefer if source control will list me all the differences, instead of me wasting brain cycles on this awful contraption
 
@sehe Write a tool that parses the C code into an AST (or use libclang) and then outputs it nicely in the coding style you prefer.
 
have you guys seen that school test on failblog?
 
7:37 PM
no.
 
Oh yeah that was on Facebook two days ago.
 
@RadekSlupik i think I'll do that. No I've actual work to do. I could show you the Oracle facing code, that I somehow get to saw up with this skeleton and test for production, tomorrow.
 
I was just spending 10 minutes trying to figure out why my factory function wasn't invoking the move constructor only to find out that I never actually called the factory function...
 
lol
 
7:40 PM
@FredOverflow 10 minutes isn't quite 2 days the Duck had spent wondering why he didn't get the results he anticipated. Turned out he was debugging the wrong binary
 
I can call functions too.
And I can call functions too.
void too();
 
Here's a pro tip for your endeavors on ebay: If you want one item, do not bid on four, just in case. You might get them all... *sigh*
Ouch
 
lol
 
Adobe Illustrator's SVG source code is so ugly.
 
Does it come with source code? Or you mean the generated xml
 
7:53 PM
The generated XML.
Oh, Google, you suck so hard…
I asked that this hour.
 
Oh it slurps hard :)
Usually within 15 minutes, IME
 
How the fuck does Google index that so quickly?
Does Googlebot subscribe to RSS feeds or something?
But that's not the worst feature of Google.
 
:)
 
Searching for “Flask” without quotes includes results about Flash. >.>
 
Calling a member function on a "null" auto_ptr causes UB, right?
 
7:58 PM
Google seriously needs to stop assuming things.
Assumption is the mother of all fuck-ups.
Isn't there a search engine for programmers?
One that also allows me to enter punctuation.
I know Hoogle, but that's limited to Haskell.
 
@FredOverflow no.
 
@DeadMG Okay, so what does the spec say what should happen?
 
no idea
 
But you're certain it's not UB? Because I get a memory access error or something like that.
 
but it's pretty dumb to allow get() to exhibit ub if content is null, don't you think?
 
8:02 PM
@DeadMG unknown behavior.
 
@FredOverflow Do you mean member function on the object pointed to by a null auto_ptr?
 
@DeadMG But UB is the most efficient choice. Do you want to null-check every call of get?
 
rather than the actual auto_ptr itself?
 
Oh yeah, I meant p->whatever().
 
@FredOverflow Uh, you could just return the internal pointer regardless of if it's null.
@FredOverflow Right. Then almost certainly UB.
 
8:04 PM
It's called auto_ptr not checked_ptr or safe_ptr...
Can't decide whether I like the font (font-family: "Cardo", serif; ?) or it is tiring anyway. On first glance, it was a pleasant surprise.
 
Xeo
@sbi old :P
 
sbi
@Xeo I dunno. I am missing routine in checking on the age of camels.
 
8:21 PM
You look at the teeth.
That's how Xeo knew
 
Is there any operation on std::list that allows me to add an element before or after another given element?
 
You need to pass an iterator afaik.
 
The right way to do this really does invole writing a custom streambuf. This really isn't a complicated task; really the only difficulty is finding references that describe what needs to be done. — Hurkyl 2 hours ago
^ do you reckon he'll be blowing hot air like that often?
 
sbi
@ManofOneWay std::list::insert() is your friend.
 
8:33 PM
@Cicada Having a lot of fun. +1 for them
 
Ah I noticed insert and the use of iterators, thanks
 
@ManofOneWay hmm. thinking... nah they probably forgot
 
@sehe Nah.
all kernel code has a billion lines of kernel-specific stuff in it.
not to mention that C is a shitty language for teaching data structures.
 
@DeadMG wut? I was talking about the font
 
oh
 
8:37 PM
How is C shitty for teaching data structures?
 
@DeadMG Well, TBH the language is really rather irrelevant. Which is a good reason to stick with C depending on exactly what about the datastructures you want to highlight
 
@Cicada Because it's got no decent generics.
 
If you want to just teach kids "When X, use Y", use another language. If you want to show: don't use X because of Y and Z implementation implication, use C
@DeadMG Very good point. However, you can still do datastructures comparatively really well, just by fixing element type : int
 
sure, but data structures should be generic.
when you write an RB tree in C++, then you can really see that it works for any type with operator<.
harder to get that lesson out of C
 
step 1. open the lid 2. ??? 3. profit — sehe 5 secs ago
@DeadMG Another good point. I think I'll grant you this one. I'm convinced
 
8:42 PM
You don't need generics to teach basic data structures.
 
@Cicada True. But the two 'circumstantial' arguments are convincing enough. You'd have to go berserk with a lot of bool pred(void*, void*) style callbacks in C
 
@DeadMG Are you saying you wouldn't understand how I basic data structure works just because it can only contain a certain type?
 
No. You would stick to 1 type that clearly makes the intent of your structure obvious.
You're teaching data structures, not reusability.
Anyway, off to bed. Night'
 
@ManofOneWay I think the winning point was, that 'just using int' doesn't make all the operations transparent, at all.
 
@ManofOneWay No, I'm saying that you can't show that it can also work for some other type without having to roll the whole thing again.
 
8:44 PM
Using a 'real UDT' has the benefit of making all those dependencies and 'Concept Requirements' explicit
 
I'm also saying that using C will give you endless memory management headaches which are quite unrelated to the actual operation of the structure
 
@Cicada Another good point. I guess there is 30-40 years of middle ground in college curricula by now :)
 
@DeadMG there are still macros in C, not quite of the elegance templates got, but still can be used with uncomplicated structures..
 
@DeadMG Here, I'd argue (as I did) the contrary: C++ hides the memory management perhaps a little too well. As you argue with operator <, it's probably a good thing to let pupils learn about the implications of memory management...
... it is rather important to understand when (and why) reallocation occurs. Cf. invalidation of iterators, concurrency and stuff
 
naw
the difference between generics in C and memory management in C++ is that actual C++ code does not have to deal with memory management.
whereas actual data structures do have to deal with generics
well, I mean, iterator invalidation, yes. It's not that I don't think that people need to learn about locality and invalidation and all that other stuff.
it's more that I think that having to deal with malloc and free and endless return codes and at the end you still don't have generic algorithms is definitely missing the forest for a lump of dog shit
 
8:49 PM
@DeadMG I disagree here. If you are making the effort of writing a reusable datastructure, then you have to pay attention to allocation. There is little use to build it all on top of standard containers, except for the one-offs where it doesn't need to be generic in the first place.
I guess the middle ground would be to use smart pointers and perhaps tuple, but no standard containers
@DeadMG The goal is to learn about datastructures. The goal is not to author a useful and complete container library
 
@sehe, is your username an inflected form of the german word for "see"(sehen)?
 
@Specksynder Nope
 
@sehe No, I didn't mean "Build it on top of the Standard containers", but I sure meant "Help yourself to unique_ptr and shared_ptr and exceptions".
 
Jan 12 at 23:51, by sehe
That happened to be the naming convention for users at my first job, and it kind of stuck. I'm still employed at the same company, though I'm now proudly known as She12345 (digits fictitious)
@DeadMG Ok, fair middle ground. I'm almost surprised to say, today, I can totally agree to the outcome
 
For iterators to standard containers, what is the expected behaviour if they "fall off", ie, point prior to the begin(), or one past the end()?
 
8:53 PM
UB
 
@Specksynder They can't, legally. That would be UB to begin with. you mean invalidation?
 
@sehe Not being able to build generic algorithms is a complete failure of any data structure education.
 
I wonder why doesn't the standard specify that they throw an exception when such operation is attempted...
 
In computer programming, undefined behavior is a feature of some programming languages—most famously C. In these languages, to simplify the specification and allow some flexibility in implementation, the specification leaves the results of certain operations specifically undefined. For example, in C the use of any automatic variable before it has been initialized yields undefined behavior, as would division by zero or indexing an array outside of its defined bounds (see buffer overflow). This specifically frees the compiler to do whatever is easiest or most efficient, should such a...
 
@Specksynder Efficiency.
 
8:54 PM
@Specksynder Well, in C++ the adage is: pay only for what you need.
MSVC takes the liberty of having checked iterators in debug builds (explaining the slowdown)
 
that's not really bending the rules
after all, "Throws an exception" is a perfectly legal version of "Undefined behaviour"
 
@DeadMG I meant the 'pay only for what you need' pseudo-rule, of course
@Specksynder If you want, you can usually find members like v.at(12) instead of v[12] that do range checking
 
@sehe, thanks.
 
@sehe my adage is: don't pay.
Paying is a waste of money. :P
 
@RadekSlupik :) Sadly, there is a free version of MSVC and it compiles with checked iterators in DEBUG builds too
 
8:57 PM
Meh I still pay for physical items.
I wish I could download bacon.
 
I read that something's tricky about the implementation of reverse_iterator - the iterator points to a different 'current' value_type than a normal iterator - what is the reason for that?
 
@RadekSlupik Really. Surprise
My adage is: "Braking is a waste of velocity". Which is why I use the horn instead
@Specksynder So you can always convert to a normal iterator. Basically
 
Wasting velocity is like sleeping; it is a waste of time.
 
Think of how you represent v.rend()
Don't fall asleep now
that would be a waste of time
 
I don't.
 
8:58 PM
*p--, with p pointing to the first element?
 
@Specksynder You can't, because of UB. Also, when doing the (legal and standard) conversion to normal iterator, you'd have no defined way to get back into 'valid land'
 
I was writing a bug tracker, but I felt the need to go to bed.
 
@sehe - isn't *p-- a valid operation?
 

« first day (638 days earlier)      last day (4310 days later) »