« first day (773 days earlier)      last day (4176 days later) » 

2:00 PM
either way, if A includes B includes C, with A being the only source file, include guards shouldn't mess things up should they?
 
@thecoshman kyrostat or something else
 
Hmm.. free beer in Berlin on SO?
 
@melak47 kyrostat indeed :P
 
@thecoshman No
 
who's including whom
 
2:01 PM
@DeadMG is that a No they shouldn't mess things up, or No don't do that?
 
no, it shouldn't be a problem
 
Are you sure the thing is not being included?
 
there's a reason why every header in the history of ever has been guarded
and it's because guards don't create problems.
 
Maybe you have a typo instead?
 
2:02 PM
@thecoshman That error has nothing to do with headers.
 
@R.MartinhoFernandes the key function I am wanting to use is undefined
@DeadMG oh?
 
That's a linker error, ffs.
 
@thecoshman Undefined reference means the linker could not find a function.
 
@R.MartinhoFernandes was about to say..
 
yeah, but I thought that steamed from the includes being messed up :S
 
2:04 PM
What is the rincewind folder?
 
@R.MartinhoFernandes it's the root folder cat set up for the builds to work in
hmm... it could be that what ever way scons is set up, it is not building the vendor lib correctly
 
From the newest what-if
 
@thecoshman it was last time I tried it, and it's linking the glload stuff fine for windows :/
 
@melak47 yeah, but I was getting that error at run time for creating the gl context on linux
problem is, at work, so no compiler to test against :P
 
you don't have compilers at work? D:
 
2:07 PM
@melak47 we don't do C++, nor we have linux desktops :P
 
@thecoshman You are working on kyrostat at work?
 
@R.MartinhoFernandes ...
I might have got distracted
 
Better than doing nothing.
 
@CatPlusPlus exactly!
an depending on who you ask, better then actually working
 
2:12 PM
oh gawd.
I thought I was a slacker
 
you are
 
but turns I do get some work done
on occasion
and I don't work on my hobby projects at work
I'm either working or on here chatting
 
sbi
What's the opposite of "tail recursion"?
 
dude, you can't do work. wtf's wrong with you?
 
@thecoshman what use?
 
2:13 PM
@sbi non-tail recursion
 
@sbi head iteration
 
@sbi head recursion
 
@sbi No idea what you mean.
 
@Cheersandhth.-Alf pardon?
 
@DeadMG I know, I'm probably sick or something :P
 
2:13 PM
@thecoshman What do you use.
 
@thecoshman i mean, what do you use at work if not C++ and linux?
 
@sbi Doesn't seem like something that would have an opposite... I predict a knee-slapping programmer pun
 
If I met Alf IRL first time, I'd be tempted to say "Hello Mr. Cheersandhth, How are you?"
4
 
@Cheersandhth.-Alf windows laptops, Java dev work, running on linux servers
 
@thecoshman sounds fun :o
 
sbi
2:15 PM
@R.MartinhoFernandes If I remember this right, "tail recursion" is if you first do whatever you want to do, and then recurse. I want to do the opposite.
 
@TonyTheLion sucks balls
 
sarcasm
 
@sbi That's just "recursion", or if you want to be super explicit, "non-tail recursion".
 
sbi
@TonyTheLion That is exactly what I thought. Did you come up with this for yourself, too, or is that a well-known term.
 
oh, I forget to mention, we use windows laptops to RD to linux desktops to do the dev work
 
2:16 PM
@sbi It is not.
 
head recursion would imply head/tail, but there is nothing stopping you from having as many "heads" as you want
 
jeez, now firefox adblock wanted to correct my spelling of a (correctly spelled) URL
 
Kerberos recursion.
 
or, indeed, simply not tail recursing
 
Tail recursion is just special case of recursion.
 
2:16 PM
@CatPlusPlus Precisely
 
@sbi I came up with that myself
 
sbi
@DeadMG Well, "recursion" is used if you recurse generally. FWIW, you could recurse in the middle of whatever you want to do to each item, so there cannot only be tail recursion and "the other one".
 
@sbi Why do you need a name for is?
 
non-tail recursion is general recursion
 
sbi
@CatPlusPlus And I want that other special case, where you recurse first, and then apply your operation to the item.
 
2:18 PM
there is only recursion and tail recursion, nothing else
 
@sbi I don't know of any special name beside tail recursion
 
@sbi It is not a special case.
 
It has no special name.
Because it's not really special
 
8
A: What is tail-recursion?

FlySwatUsing regular recursion, each recursive call pushes another entry onto the call stack. When the recursion is completed, the app then has to pop each entry off all the way back down. With tail recursion, the compiler is able to collapse the stack down to one entry, so you save stack space...A lar...

 
sbi
@R.MartinhoFernandes Because I need to explain something in the documentation.
 
2:18 PM
maybe this helps
I don't know
 
It has no useful properties.
 
@DeadMG except that tail recursion is also recursion. So there is only recursion ;)
 
it's just called recursion normally, and tail recursion when you recurse at the end of each call
 
(Other than what recursion already has)
 
to understand tail recursion, you must understand tail in a recursive fashion
wait wut.
 
2:19 PM
Tail recursion is special cased because it can be directly transformed into a loop
 
there is depth first and breadt first visiting, but that's not limited to recursion (could be iterative)
 
@sbi If this is some kind of tree, you can say it's a depth first search. Other than that, there is no name for it.
 
if you have a tail (like me, I'm a Lion) and you recurse, then you have tail recursion.
logical, no?
 
@TonyTheLion Only if you recurse from the tail. Any other place could amount to tree recursion !
 
Is Tony really a lion?
 
2:21 PM
(I think that's reserved to christmas is reserved to christmas is reserved to...)
 
@StackedCrooked Is Robot really a Robot?
my cat chases it's own tail, that could be tail-recursion, no?
 
sbi
Well, thank you guys, you have been helpful.
 
Is C++ really C++?
 
sbi
@TonyTheLion It did, thanks!
 
@sbi :)
 
sbi
2:23 PM
@TonyTheLion I am an ape, not some five-legged monkey.
 
♡ Boost.Containers
 
@sbi you mean, is Lounge<C++> really about C++? :p
 
@KonradRudolph What for?
 
sbi
@KonradRudolph Have you tried girls?
 
2:24 PM
struct node {
    boost::container::vector<node> children;
};
@sbi Yes, they don’t nest as well
(they’re great for other stuff though)
 
sbi
@KonradRudolph Strange. My problem with girls was precisely their nesting habits.
 
@ScottW array
 
@KonradRudolph Other kinds of nesting.
 
@KonradRudolph Ah yeah. Does that work out of the box? I thought you had to declare it specially for that
 
@sbi Wow, that was a reddit-worthy pun. Chapeau
@ScottW In fact, just assume that everything in PHP is an array and you won’t be too far off the truth
 
2:25 PM
@sbi nesting or not nesting the problem?
 
@sehe Not as far as I understand the documentation, and I don’t see a reason for that …
 
sbi
@KonradRudolph Well, we're much better than reddit, didn't you know?
(Also, considering the number of kids I have, I should know about their nesting habits, shouldn't I?)
@thecoshman ^
Anyway, back to work...
 
@sbi HA
 
Number of kids sbi has is Ï„, as in Ï„oo many.
 
@sbi doesn't really answer the question, but what ever
 
2:29 PM
@R.MartinhoFernandes Big O -- approaching infinity.
 
sbi
@thecoshman Is my problem having nested with girls to often or too seldom?
 
@sbi I get the feeling you mean nesting to be more then just 'sleeping over regularly'
 
@thecoshman Nesting usually involves raising offspring, no?
 
sbi
@thecoshman I think of birds, when I hear the word "nesting". Might be a problem with the German usage of the word vs. the English one, but that's what I think.
 
Except @sbi does not lay eggs, AFAIK.
 
2:34 PM
meh
 
Where can I read about multithreading in general?
 
the internet
:p
 
I have a very simple use case but I'm afraid I could make simple mistakes that would make everything go wrong
@melak47 Given how 99.9% of C++ related internet resources are shit, I'm not too confident about concurrency as well
 
you said multi threading in general, not C++ :)
 
@kbok Hey.
 
2:37 PM
@DeadMG Better? :)
 
if you have a simple concurrent use case
get one of the high-level concurrency libraries
like TBB or PPL
they will make it fairly quick and painless
 
Painless
 
I just want to spawn N worker threads with their own data and collect the results once everything is done.
 
maybe std::async would be enough for that? idk
 
@kbok Ah, you're definitely doing it wrong.
 
2:39 PM
lol
He hasn't even started.
 
well, it's a question of approach
there's a very big difference between "I want to spawn N threads" and "I want to concurrently operate on N data items"
 
@kbok what's the data and what's the work
 
and the difference is "Let some other poor fucker who has to write the library deal with the threads"
 
I once implemented sync between threads in C++11, that was painful. Don't remember now why, but for some reason i had to use atomic variable to sync two threads.
 
@kbok Touchstone - if the site mentions 'join', or anything like it, on the first page, move on...
 
2:41 PM
@DeadMG That is why I want to read more about concurrency
 
@kbok Or, be a smart man and let some poor fuck from Microsoft or Intel worry about it :P
 
I still need some info about how to use the library
 
@kbok You just do the right thing and it works.
 
@kbok What do they do?
 
Process chunks of an image.
 
2:43 PM
@kbok Concurrency::parallel_for_each(begin, end, lambda);
 
If they can work independently, then just spawning threads will do. Just chunkify first.
 
anyone have any clue about weird NT paths like \\.\Display0? In particular, how to see whether a certain such object exists
 
from the command line or similar
 
Open it with CreateFile
 
2:44 PM
@CatPlusPlus That's what I thought too.
I'd like to have portability also. At least msvc+linux-gcc
 
OK, how long do you expect that each thread will take to process a chunk? If this is of the same order as it takes to create a thread, you're stuffed with simply spawning threads - takes too long.
 
Right now the processing of an image takes ~1s
 
@CatPlusPlus Yeah, I guess... I'd prefer if I didn't have to write any custom tools for this though :(
 
@jalf What the heck is that thing?
 
Sysinternals had some tools to browse the kernel objects.
 
2:48 PM
Since I have a 8-core processor, I thought I could speed up the processing by using multiple threads. Am I right ?
 
depends. are they real cores or imaginary cores? :3
 
@R.MartinhoFernandes OS/kernel objects (hardware devices and various other resources) live in odd filesystem paths like that on Windows
 
Not if spawning all threads take as long as processing the damn thing.
 
bit like how on a unix filesystem, you can get all sorts of fun non-file stuff from /dev or /proc
 
2:49 PM
Come on, will spawning the threads take half a second ?
 
no
 
Also I can still spawn the threads at startup if it helps or something i.e. I have a bunch of images to process
 
@kbok But now you need a queue to give them work.
 
A second - OK, amybe you could get away with just creating some threads for one image. Nevertheless, I'm very wary of continually creating/terminating/destroying threads - it's far too prone to ... 'incidents'. The pool approach, as posted by others, is hugely preferable.
 
@R.MartinhoFernandes I'll do what it takes :)
 
2:51 PM
' I have a bunch of images to process' - please, please don't create/terminate/destroy threads for this and try to manage them yourself.
 
I've never worked with threads before, so I will basically do what you guys tell me
 
Kill yourself. SCNR.
 
ok, there's got to be a way to simplify this?
 
@TonyTheLion Seriously, !eof in loop conditions?
 
@R.MartinhoFernandes I knew that was iffy.
just couldn't think of other way
 
2:54 PM
@TonyTheLion line 24 can be simplified by use ofproper operator
 
@Cheersandhth.-Alf how do you mean?
@R.MartinhoFernandes now what should I use instead?
good() ?
 
instead of !(a == b), just write a != b
the loop condition is also suspect, in two ways
 
Aren't the close() superfluous ?
 
i would just break from the loop when difference foudn
and instead of checking eof i would check fail
 
Don't ever trust iostreams to do the reasonable thing.
 
2:57 PM
also, instead of assert that the files exist and can be opened, i would use exception throwing here
but i would use assert for detection of bug in program logic
 
@TonyTheLion The reads?
 
anyhow, my little function seems to continue past eof no matter what
 
Also, std::equal sucks because it requires that the first range be bigger, otherwise UB.
 
@TonyTheLion make the loop condition
 
@R.MartinhoFernandes you mean the function read()?
 
2:59 PM
@TonyTheLion No, getline.
 
while( std::getline(ifsA, lineA) && std::getline(ifsB, lineB) )
 
@Cheersandhth.-Alf If I have a loop, how do I make it condition?
 
@StackedCrooked it is the continuation condition of the loop
 
Encourage it to lift weights
 
I would also use is_equal for the bool instead of isDifferent + nots everywhere.
It also makes the loop invariant more obvious.
 
3:01 PM
Get rid of the bool and just return false if it differs.
 
Also bool return type sucks if the function is called CompareFiles
 
But std::fixed::equal would be so much better.
 
@CatPlusPlus but if I return from within the loop, the files don't get closed
 
Right, iostreams. Don't use iostreams.
 
3:07 PM
hm, i checked the C++11 std, and the destructor of basic_filebuf calls close
which as i read it means that it should be okay to just return
 
@TonyTheLion They do.
 
also std::equal doesn't go well with std::string it seems
 
RAII, remember?
 
ah
didn't realize that iostreams used RAII
lol
 
@TonyTheLion std::equal was for using istream iterators, but you get UB if the first range is bigger than the second, so it is worthless.
@TonyTheLion There are very few things on the standard library that don't.
 
3:12 PM
ah that's good to know.
 
Those temporary buffers things, and... I don't remember anything else.
Would be cool if new returned unique_ptr, but too late.
 
holy fucking shit, it's cold outside
 
HN seems to be offline?!
 
How do I view the stack trace in ddd?
 
wtf is "ddd"?
 
3:21 PM
probably one of the infinity shitty Linux debugging tools
 
It is
I wish there were better debugging tools in linux
In ollydbg, all the information I need is default there and easily accessible...
 
Why do you work with horse shit?!
 
I do not work with horse shit...
Or what do you mean?
 
@TonyTheLion A gdb frontend.
 
@R.MartinhoFernandes oh right
@HorseSMith it was a pun on your username :P
lol
 
3:25 PM
Ah, ok :)
 
He's not working with horseshit, he's working with ddd. He just told you.
 
@kbok oh you!
 
So none of you develop in linux?
 
I debug in windows.
 
I rather use Qt Creator or cgdb for debugging in Linux.
 
3:27 PM
@TonyTheLion It has probably been hacked
ba dum tss.
 
The few times I fire up a debugger, I debug with gdb.
Well, and VS at work, but I am not too happy with it.
 
@StackedCrooked Thanks, I will give them a try
 
@R.MartinhoFernandes Do you use a GUI ?
 
Not being able to watch expressions using overloaded operator-> is still annoying me.
@kbok No.
 
Must be painful.
 
3:29 PM
What do you use to debug in windows?
 
Visual Studio.
 
eclipse is a shit IDE
 
@HorseSMith a debugger. Visual Studio comes with one, and with the Windows SDK you get WinDBG
 
@kbok :P
 
3:30 PM
I believe there's also a port of gdb, if you're feeling masochistic
 
My experience with GDB has not been any more painful than with the VS debugger.
 
@jalf What is it called?
 
@R.MartinhoFernandes if you know how to use GDB well, but if you're fairly new to it, it's a pain to use
 
So call a spade a spade.
 
cause I don't know all the commands
 
3:31 PM
If you want to say GDB is not neophyte-friendly, say it.
 
GDB sucks for noobs
there you go.
 
DDD is dead anyway, right? Or is there still active development?
the last release was in 2009
 
@KonradRudolph That is my impression too.
@TonyTheLion And the VS debugger sucks for smart pointers.
 
pity, actually. It had some quite powerful visualisation techniques
 
To cushion the blow, I gave out a cookie when I fired someone. It made them smile...until they realized it was stale...just like them.
 
3:35 PM
> So I'm getting this weird compile error. I'm trying to make my one shader manager.
A manager!
 
That is one of the things I like about ddd
 
@R.MartinhoFernandes really? in which way?
 
8 mins ago, by R. Martinho Fernandes
Not being able to watch expressions using overloaded operator-> is still annoying me.
 
@R.MartinhoFernandes so is that the reason you wanted me to say what I said, so you'd have an excuse to say that?
 
really can't be arsed today
 
3:38 PM
0
Q: use of undeclared identifier vertex

Dennis ToufexisSo I'm getting this weird compile error. I'm trying to make my one shader manager. void ShaderManager::CreateShaderSource(GLuint _vertex, GLuint _fragment) { _vertex = glCreateShader(GL_VERTEX_SHADER); if( 0 == _vertex ) { fprintf(stderr, "Error creating vertex sha...

WTF.
 
@thecoshman I know the feel.
 
in one of those moods where even the thought of going home is dull
 
the thought of breathing is quite dull too
oh wait...
 
yeah... not to far off
 
I don't have think about breathing, that happens automagically
the thought of giving a fuck is quite disturbing
lol
 
3:46 PM
Sex disturbs you?
 
no
wrong definition of giving a fuck
 
3:57 PM
I hate programs that use the locale to pick language instead of GetSystemDefaultUILanguage.
 
That's so horrible.
 
@R.MartinhoFernandes My windows is in English, I even set my locale to UK, keyboard layout pretends to be UK...but some programs still manage to annoy me with a German interface
 

« first day (773 days earlier)      last day (4176 days later) »