« first day (390 days earlier)      last day (4558 days later) » 

7:00 AM
ok
the bug is definitely in the next function
I found the rollback values on the stack
 
Isn't it protected as well?
 
yeah
the problem seems to be that the copies aren't being updated when they should be
 
Can I see it?
 
so when it comes to finish consuming input if the parse function succeeded, it actually doesn't
 
Forget what I said.
 
7:06 AM
I will.
 
rule updates the iterators, right?
 
you know, in theory, it shouldn't even need protecting
 
It's got to, it would fail before, otherwise.
 
the only function that actually increments anything is rule, and it's safe
yeah
template<typename Iterator, typename Context> bool operator()(Iterator& begin, Iterator& end, Context&& c) {
    if (begin == end)
        return false;
    if (*begin == t) {
        begin++;
        return true;
    }
    return false;
}
 
Not the issue: ++begin;.
:P
 
7:07 AM
lol
 
I don't get it. next is returning true but not updating the arguments.
That's not possible.
 
yeah, I know what you mean
sitting here looking at it myself, and the value isn't being backpropagated like it should be
 
This is why I prefer non-mutable interfaces :)
 
lol
would be slow as hell
 
In a purely functional programming language a function should always return the same value given the same arguments. So this would make a current_time() function impossible to implement.
 
7:09 AM
and I'm not very familiar or comfortable with that kind of interface anyway
 
You could return the new iterator, instead of changing an existing one. You're making copies anyway. But that's not relevant now.
Did you step through the a = begin; lines in next?
@StackedCrooked Stop time!
 
yeah
they all function just fine
 
@RMartinhoFernandes Or pass the current state of the world as an 'implicit' argument?
 
@StackedCrooked That's how Haskell cheats.
 
@RMartinhoFernandes Interesting.
 
7:12 AM
There's a RealWorld type :)
Fixed link.
 
> RealWorld is deeply magical.
 
@OmeidHerat I have something against std::cout and std::vector too. See:
 
ok
 
7:14 AM
31
A: Why is 'using namespace std;' considered a bad practice in C++?

sbiI agree with everything Greg wrote, but I'd like to add: It can even get worse than this! Foo 2.0 could introduce a function Quux() that is an unambiguously better match for some of your calls too Quux() than the bar::Quux() your code called for years. Then your code still compiles, but silently ...

 
the comparison is on line 20, column 5, and it's looking for another nested namespace and then doesn't find one
 
That's my opinion on it.
 
and then the next time it jumps back to next(), the iterator's jumped back three lines
 
@DeadMG That returns true, right?
 
no, it'll return false, because it's looking for a namespace but doesn't find one
 
7:17 AM
And then the star exits the loop and returns true?
 
yeah
the star always returns true
 
It always jumps back to the top-level namespace?
 
it jumps back to the previous namespace
 
Oh, so only one level.
 
but that namespace runs into the same problem and jumps back again
 
7:20 AM
Ah.
 
@CatPlusPlus Apple allows you to roam freely within the confines of their fancy courtyard :)
 
Courtyard... closet with a view... One of them.
 
you know
nobody is going to modify the end vector, so I should simplify that part of the code
 
Yeah, I don't really think that's useful.
 
@muntoo Even though I used std::string everywhere I do feel that it violates the DRY principle somewhat. I think adding a using std::string at the top of a cpp file could be better practice. But in the end it's more convient to write always std::string. And it's always correct.
 
7:25 AM
With std::string you can write std::string string;!
 
I have done that on occassion
 
@StackedCrooked Yes, but for some reason, I find it easier to parse through std::. You can see where it comes from without thinking about it.
 
Indeed.
 
ok, this is seriously beginning to annoy me
there is nothing wrong with my code, goddamnit
fixed it
lol
 
@DeadMG The old "it's not me, it's you" programmer curse.
 
7:29 AM
@DeadMG Ok, I seriously want to know!
 
@DeadMG Yes there is. Or at least, something's happening that you don't expect to happen and expect to happen at the same time.
 
there was nothing wrong with any of my function objects
 
Congrats.
 
so there was no wonder that I didn't find anything there
std::function<bool(decltype(tokens.begin()), decltype(tokens.end()))> namespace_rule;
passed by value
 
7:30 AM
yep
I added the ref qualifier and now it works like a charm
 
@muntoo So you have something against std::cout but you like the @sbi answer ? huh.
 
all this time I spent debugging and breaking, and the answer was staring me in the face the whole time
 
Passing argument by value instead of by reference in a recursive tree algorithm implements back-tracking automatically. It's a little costly though...
 
I also posted the code for you to see and you didn't spot it either :P
 
7:31 AM
@StackedCrooked I already implemented backtracking :P
 
In my defense, I've been awake longer.
 
true, I did get up at 1am
 
I just think it's a neat thing.
 
lol
so
it may have taken me a few hours, but I did in fact implement my own parsing framework that sucks less than Spirit by a considerable margin
 
Do I get a spot on the credits?
 
7:34 AM
uh, the credits for helping me with a small part of a project nobody's ever going to see? :P
sure
I'll just add a little comment here
std::unique_ptr<Wide::Parser::NamespaceAST> Wide::Parser::operator()() {
    // Tiny bits of credit go to @RMartinhoFernandes.
 
hey ppl.
 
@OmeidHerat I have something against cout.
 
guys im new to Threads in C++ (Visual C++)
having bugs when the “same function” converted into a Threaded function in OpenCV.
is there anything extra I hav to do when converting?
 
7:41 AM
What does it mean "converted into a threaded function"? That's a very vague description.
 
@coder9 Yo, dawg. We're all ganstas here.
 
@muntoo hehe
 
we is like, all gangstas, innit bruv
 
urbandictionary.com/define.php?term=bruv You're British. (Just saying. :))
 
so... ?
im a gangasta+noob
*gangsta
 
7:43 AM
@coder9 You can edit it, you know.
 
@muntoo That's not really a secret.
 
@RMartinhoFernandes :) Just saying, I had to look up 'bruv'. Although I thought I knew what it meant.
 
I've posted the Q. No reply yet :( stackoverflow.com/questions/8071845/…
 
there's way too much code there for me to read
but here's a protip: threads are extremely dangerous and you probably fucked up sync to some variable
 
@coder9 You really should strip the code of the parts that are not relevant, and describe what kind of things you're running on which thread. Otherwise people will have a hard time trying to help.
 
7:50 AM
so here's a question
what kind of parser did I just write?
 
No idea. One that works.
 
lol
 
hmm.. ok. I thought it wud b easy for ppl to just copy + paste n debug :) anyway i'll modify it now and tell u guys. thnx
 
@DeadMG Trick question: You didn't write it.
 
nobody will ever copy and paste your code and debug it for you
@muntoo Technically, I wrote a parser generator and then used that to generate the result
 
7:51 AM
@coder9 Well, copy-paste would probably not work. For starters, I'd have to install OpenCV and set up OpenGL libs to be linked.
 
@DeadMG Ooh, sounds 1337.
 
will strip it off now.... :)
 
I'm so skilled, I'm 1338
 
anyway is there any way to avoid using Threads?
 
I don't understand the question.
What do you want to do without threads?
 
7:53 AM
In my case, I have to simulataneously detect markers using OpenCV functions and use OpenGL to draw stuff on top of detected markers.
 
simultaneously won't necessarily actually mean asynchronously.
 
Do you have any form of synchronization in your code?
 
running OpenCV and then OpenGL would probably be close enough, unless your vision is pretty slow
 
Do you know about OpenGL rendering contexts? I could be wrong, but I believe each thread gets its own context, so you would probably need to take care of that too.
Today is the anniversary of the Lunokhod.
And of this too.
 
8:25 AM
it haf pthreads, so since im on Win, i had to use Win threads (CreateThread function)
 
> Explicitly prefixing everything doesn't do any harm, takes very little getting used to, and has objective advantages. In particular, it makes the code easier to interpret by the compiler and by human readers - and that should probably be the main goal when writing code.
nice @sbi !
 
8:54 AM
@FredOverflow i don't agree. does one use much explicit prefixing of everything in natural language? if not why
OT I know, but can any one help?
0
Q: Norwegian keyboard keys don't work with Ubuntu in VirtualBox

Alf P. SteinbachI just installed VirtualBox (from Oracle) in Windows 7, and created a virtual machine with latest Ubuntu. Here in Firefox I can use the left Ctrl key, while the right one doesn't have any effect. However, I can't use the AltGr key (also known as Right Alt) to produce e.g. curly braces like {} (I...

 
@AlfPSteinbach C++ is a programming language, not a natural language.
 
hrr
Why does std::vector require value_type::operator=()? Wouldn't it be sufficient to have a move constructor?
 
A move assignment operator suffices.
 
@FredOverflow well from my pov it just makes things unreadable and verbose. also you don't want to qualify e.g. swap. you want to not qualify it, both for readability and for correct operation.
 
@AlfPSteinbach That's a corner case.
 
9:03 AM
bah
 
hrr
@R. Ah, I forgot the move-assignment; I only had the move-constructor... Thanks!
 
@FredOverflow I think that according to this reasoning one should always use ::std.
 
In case someone has a std namespace inside their own namespace? :)
 
Yep.
I believe I've experimented with that. I don't remember for what exactly..
 
@StackedCrooked diseases::std?
 
9:15 AM
lol
 
9:35 AM
waves
 
 
1 hour later…
10:42 AM
Good day all
 
morning
 
11:50 AM
not much
spent this morning writing a parser generator
 
@DeadMG Is it general purpose or DeadMG++ only?
 
well, ATM, it's not finished enough to be anything
but it's most assuredly general-purpose
 
oh sounds like fun
though I have no idea about parser generators
 
ah, it's pretty simple
you get some expression templates and that kind of good stuff, and you mix it together, and you get a parser
 
cpx
hmm
 
12:00 PM
expression templates?
 
it's where you overload operators that return types
 
hmmm, so ordinary operator overloading really?
but using templates?
 
no
each operator returns a new type
so effectively, the type of the final expression encodes the expression
it's used to create lazy evaluation, especially for heavy mathematical libraries
also to create DSLs and such things
I'll show you an example in a sec
 
hmmm yea was just reading about it
looks interesting, but seems a complicated affair
 
12:14 PM
it's not that hard, the trick is to make each individual operator work
then they chain together nicely
you can construct very complex programs very simply with expression templates, if you know how to use them
that's a pretty easy way to build a grammar if you ask me
 
12:30 PM
yea but is all built on top of expression templates
with the correct operator overlaods?
 
yeah
not complex though- less than the hardcode it took me to parse a simple namespace
 
so your operator>> that you're using there, has some special definition?
 
yes
 
right
 
12:32 PM
How would someone go about writing the Towers of Hanoi algorithm?
 
Wikipedia almost certainly has pseudo-code for it, so I'd just steal that
 
wow, that's rather impressive I must say
 
I just have no idea how to abstract the pegs
 
ah, it's a simple expression template and CRTP mixin
 
I assume some kind of data structure like stacks or queue
 
12:42 PM
@TonyTheLion eh, he shows that it costs ~6 ns to create an exception frame, and then he concludes that "it's almost free". Even though he also points out that it takes 24 times as long as a function call. 6 ns can be an eternity if it's added to a tight loop
 
sbi
The problem with self-nomination is that those who would nominate themselves are rarely ever the kind that would be a service to the public to have in power. (stackoverflow.com/election)
2
 
man, my new grammar won't compile, even though I'm pretty sure that it's right and Intellisense thinks it's fine :(
 
um.. any guidance on how to abstract the win32 gdi?
wrap up HDC etc. into C++ classes?
 
nobody uses GDI anymore
 
know of any other good graphics library that can be used with the winapi?
 
12:54 PM
most people use Direct2D
 
should I use cairo?
 
or OpenGL
but GDI is pretty directly superseded by GDI+, which is already exposed as a C++ interface
and that's been superseded by Direct2D
 
ok then. guess I'll try GDI+, is it available for free?
is Direct2D available for free?
 
it's part of the Windows API
yes
they're all shipped with Windows
 
is Direct2D available for free?
 
12:56 PM
it's part of the DirectX SDK
Direct2D isn't the most pleasant thing to use ever, it's based on COM
but better than HDCs, and the results are very fast and very powerful
 
Are the lines in the diagram here broken for you too? stackoverflow.com/questions/3601602/…
 
no
 
no? they don't line up here and I'm tempted to edit
 
they're fine here
 
fine here too. Which browser are you using?
 
1:03 PM
firefox 7
thanks for checking
(on linux without any ms fonts installed) the first version of those unicode lines did line up fine here
ascii wins again
 
sbi
@kaizerse I, too, have FF (although it's FF8 since yesterday). Are you per chance not using a proportional font instead of a non-proportional?
 
the text is not proportional, it's a monospace sans
but it could be that the unicode lines are pulled from a serif font right
I wouldn't see the difference
 
sbi
@kaizerse Serifs or not shouldn't make a difference. A monospaced font is a monospaced font, whether it has serifs or not.
 
right
you probably know what I meant
 
sbi
The only thin that I can think of that would destroy the diagram would be space characters (and/or others, too) to have different widths.
@kaizerse No, I don't.
 
1:13 PM
aw :-( programmers are so literal-minded (I am too)
If I only have that line ╱ in a proportional font, maybe that destroys the formatting
 
sbi
@kaizerse I am not sure what that means, but the whole diagram needs to be in a non-proportional font, or it will be broken.
 
Not all fonts have full unicode coverage
 
Nearly no fonts have full Unicode coverage.
Especially monospaced fonts.
 
it should be possible to draw ASCII-art diagrams without full Unicode coverage
 
they wouldn't be ASCII art if you needed Unicode
 
1:26 PM
is there any way to convert a pointer into a reference?
 
@jalf right, so is he wrong then about the fact that "exceptions aren't expensive"?
 
say I do: mywin* w = ::GetWindowLongPtr()
and then want to use it for myfunc(mywin&)
 
will myfunc(*w); work fine?
 
@TonyTheLion well, depends on what we mean by "expensive"
I just disagree with making a measurement, and then deciding arbitrarily that "this is a small number, therefore it is not expensive"
in most cases, no, exceptions aren't expensive
 
1:28 PM
@jalf I guess that's a valid point, and I guess it depends entirely on context
 
@RMartinhoFernandes *w to get the value of mywin* w
 
he's right that just assuming "someone told me exceptions are expensive, so I'd better not use them" is garbage, though
 
yea I can see that
 
also, annoying that there are some things he just skips over
like observing that exception handling gets more expensive in release builds, and then he just goes "well, we can see it generates a few more instructions, so that makes sense", without explaining/wondering why it suddenly generates those extra instructions
 
Oh, great, 32-bit TortoiseSVN now refuses to install completely.
What a piece of crap.
HOW ABOUT MY FILE MANAGER IS 32-BIT AND I WANT DAMN OVERLAY ICONS.
 
1:35 PM
@jalf hmmm
 
@TonyTheLion that's just annoying because it puzzles me, and I wanna know the explanation ;)
 
sbi
@CatPlusPlus I have overlays in 32bit TC with 64bit TSVN.
 
@jalf oh I see
 
Yeah, it's supposed to be there, but it's not really working.
 
anyway, interesting post. I think I'll have to poke around with this a bit when I get home
 
1:36 PM
Windows x64 can use x86 shell extensions
 
32-bit programs use 32-bit shell extensions. 64-bit programs use 64-bit shell extensions.
 
@jalf To be completely fair, the SEH documentation is really kind of slim.
 
sbi
@IntermediateHacker See this FAQ entry:
2
Q: What's the meaning of * and & when applied to variable names?

jaminatorIn C++, what is the difference between: void func(MyType&); // declaration //... MyType * ptr; func(*ptr); // compiler doesnt give error func(ptr); // compiler gives error i thought & represents memory address so // this statement should correct as ptr is only a poin...

 
I remember studying the SEH documentation for doing SEH exploits
 
Fine, I'll reboot.
 
sbi
1:38 PM
@CatPlusPlus Since when do cats need reboots? :)
 
@DeadMG yep, but I still want to understand why he gets that behavior ;)
 
lol
well, it's worth noting that a few instructions more could be something simple like an inlined function
 
"Upgrading working copy"
OMG! They got rid of .svn folders being everywhere!
 
1:58 PM
Given a function with signature std::string ConvertToString(T);. How can you create a std::vector<std::string> from a std::vector<T> using std algorithms instead of manual loop?
 
std::transform, I'm pretty sure
 
With a back_inserter as output iterator?
 
yeah
 
@CatPlusPlus So SVN now has a feature that isn't broken!
that's crazy
 
@CatPlusPlus What?
 
2:03 PM
@jalf No kidding. Also "New feature: svn patch (client)"
@StackedCrooked They've centralised the working copy metadata storage.
It now uses only one .svn folder in the wc root, like sane VCSes do.
 
Cool.
Hopefully it's also faster.
 
Test cleanup took 5 seconds instead of 20 minutes, so it looks good.
 
2:30 PM
ok
I'm pretty sure that this is a GLR parser
 
sbi
@CatPlusPlus That was the point of 1.7, wasn't it?
 
I don't follow SVN development.
 
sbi
@CatPlusPlus Neither do I (anymore), but I do read the release notes before I upgrade. :)
@StackedCrooked It is. Here, a svn up over four checked-out copies of a project takes 20secs instead of 120.
 
I read them while I upgrade.
 
@CatPlusPlus AWESOME!
 
2:36 PM
The new Python launcher is awesome. Finally keeping more than one version is not a problem.
 
3:07 PM
0
A: Are variadic template a potential code bloat?

awoodlandThe short answer is: the "you only pay for what you use" principle still applies exactly as before, e.g. #include <iostream> template <typename T> void func1(T& v) { v = -10; } template <typename T1, typename T2> void func1(T1& v1, T2& v2) { func1(v1); func1(v...

Is that a reasonable argument for a "don't stress about template bloat"?
 
yes, absolutely
apart from anything else, the size of the binary is almost always utterly irrelevant
 
yeah
and if it doesn't get inlined like that it's possibly because your compiler knows more about instruction cache sizes than you do
 
almost all template functions get inlined
it helps stop the linker bitching
 
3:28 PM
I made a deal with my compiler long ago - "I'll write well defined code if you worry about all the little details like should this be unrolled/inlined etc." it's working pretty well so far.
almost like Dijkstra's dream (or invoke any other famous person of your choosing here to back up your cause)
 
3:45 PM
hi
 
Oh, lookit that, 25k rep.
 
Hey wtf.. some dude edited my question!!
Completely different from its original meaning
 
which question?
 
@LewsTherin I was about to say you should ask a better question... but that's just not cool!
 
1
Q: What is the difference between the Android constructor and onCreate()?

Lews TherinI'm a little confused by the difference between Java and Android Java. Let's say I have an Activity class AndroidX. There is no main function and there is no AndroidX() constructor as we know it. I realize that onCreate() most probably initializes the AndroidX Activity, but why is there no main? ...

I don't even know what AndroidX is
 
3:49 PM
People edit posts here, get used to it.
 
@CatPlusPlus Ugh, I wouldn't mind if I knew what AndroidX is.. that wasn't the question I was asking.. but whatever
 
you wrote androidx in the first revision from what I can see
 
No I didn't.. probably someone else.. how do you see the revision?
 
Yes, you did.
 
3:52 PM
I must have been abducted by aliens. I totally don't remember asking anything about AndroidX!
Scary...
I can't believe "Fuck Java" got 9 stars.. wtf
You bloody haters!
 
I didn't vote for "Fuck Java" because it reeks of blind fanboyism.
8
 
@StackedCrooked have a star for that
 
@StackedCrooked +1 as well.
 
Good to know that I'm not the only one who thinks so :)
 
4:18 PM
I can't use -Wold-style-cast combination with -Werror because my code depends on boost which uses old-style casts. Dammit!
s/my code/company code/
 
@StackedCrooked Is -isystem /path/to/boost a possibility?
 
I'm not familiar with that flag.
It ignores warnings coming sources in a certain path?
 
Treat the headers included through that flag as system headers, which means no warning yes.
 
Interesting. I'll see if I can wring it somewhere in our automake based build system.
 
@LewsTherin I know, I forgot to star it. But thanks for reminding me.
 
4:24 PM
@DeadMG lol. :D
 
@DeadMG grrr. Facepalm
 
4:45 PM
Afternoon
 

« first day (390 days earlier)      last day (4558 days later) »