« first day (442 days earlier)      last day (4497 days later) » 

Xeo
9:00 AM
Wait, what?
Or rather.. how?
 
Also, it's good at DSLs.
 
why use it over lisp?
 
No parentheses.
 
is it easy to parse?
 
Xeo
Damn, my linked list is buggy. I got a self-referencing node in there somehow oO
Hey, atleast I already know where the bug is!
 
9:06 AM
Also nicer function composition.
42 a b c d e vs (e (d (c (b (a 42))))).
 
Xeo
Wait a second... is it even legal C++ code to initialize a static local variable with a parameter of the function?
 
Xeo
9:19 AM
Hm. It's accepted by MSVC, GCC and Comeau.. seems to be legal C++. Weird.
 
why shouldn't it be legal?
 
Xeo
Dunno, it seemed weird somehow. It makes sense though, since the variable is initialized the first time the function is run.
 
yeah
 
Xeo
Ugh, damn. My loader registry is filled at startup through static initialization. I build a linked list from those nodes. However, if at runtime a loader gets registered again, I get a cycle.
 
Why do you have your own linked list again?
 
Xeo
9:28 AM
static nodes
My loader register themselves in a linked list containing the init and deinit code. That list gets walked at one point at runtime.
GAAAAAAAAH fucking Visual Studio crash again
 
Xeo
And again, for whatever impossible reasons, are my vertical tab groups converted to horizontal tab groups again. FUCK IT.
 
LolIDEs.
 
9:48 AM
In my experience Ubuntu 11.10+ (in a VBox) which comes with GCC 4.6.2 is the best option for C++11 development. Perhaps OS X Lion is good too (I'm still on Snow Leopard). Don't know about Windows.
 
Debian-based + gcc-snapshot. Bleeding edge C++11 is where it's at.
 
VM is too slow.
 
Well, or compile from source I guess.
 
I also have native GCC 4.6.2 compiled on my Mac. It compiles fine but for some reason GDB doesn't cooperate well. It shows nothing useful. Stack traces consisting of "????" etc.
 
Stop using Japanese identifiers.
 
9:53 AM
I'm not using Japanese characters.
ほんとう!
 
@Xeo: I am getting crazy errors like 'error C2091: function returns function' This is my slightly modified code typedef std::function<void(State *)> fnPt; fnPt Block::blocks[100] = {
std::bind(&Block::and2, std::placeholders::_1),
std::bind(&Block::and3, std::placeholders::_1),
};
 
I have a timer that triggers a callback every 10ms. Valgrind detects something wrong there. My Valgrind output file is gigantic with repetitions of the same warning. Man.
 
With that signature, you need to pass an object to bind.
 
What is Block? Is it a Tetris block by any chance?
 
No a logic gate or a combination of them
and2 is a hint
 
9:59 AM
I suck at getting hints. Ask any female.
 
What's the difference between and2 and and3?
 
2 input and gate & 3 input and gate
 
Xeo
Y'know @Cat, sometimes I just love your answers.
 
Why not use templates?
 
Xeo
10:01 AM
@Pubby Just sometimes, it's easier without them
consider member functions that differ. Like x(), y() for 2, and x(), y(), z() for three
that reminds me
 
@Pubby:I am still not comfortable with templates
 
The better question would be "what's the Block if it has different things as member functions".
 
@Xeo:basically i am trying to build a index of around 40-50 logic blocks
x(), y() won't help
 
Xeo
@VinayakGarg That was just an example of when templates won't be as good as handwritten code
 
oh
@CatPlusPlus: i didn't get you, in the first reply
With that signature, you need to pass an object to bind.
 
10:05 AM
It'll be easier if you show the whole thing.
 
ok wait
this is block.h
class Block;


typedef std::function<void(State *)> fnPt;


class Block
{
public:
Block(BlockID _blockID);
~Block();
void process(State args[]);
void and2(State args[]);
void and3(State args[]);
private:
static fnPt blocks[100];
BlockID blockID;
};
 
Xeo
My extrem over-engineered vec template :)
 
this is part of block.cpp
fnPt Block::blocks[100] = {
std::bind(&Block::and2, std::placeholders::_1),
std::bind(&Block::and3, std::placeholders::_1),
};


void Block::process(State args[])
{
blocks[blockID](args);
}
 
Xeo
@VinayakGarg You're missing a placeholder
 
where?
 
10:08 AM
@Xeo No swizzling!
 
Xeo
using namespace std::placeholders;
fnPt Block::blocks[100] = {
    std::bind(&Block::and2, _1, _2),
    std::bind(&Block::and3, _1, _2),
};

void Block::process(State args[])
{
    blocks[blockID](this, args);
}
That's how it should look like
 
This is awfully bad design.
 
ohh
@CatPlusPlus: i know
 
Xeo
bind changes a member function pointer to take an additional this parameter. That's the _1 (_N is the argument passed at the final function call). Then, you have a second parameter. That's what _2 is for, the args
 
what are you trying to create again?
 
10:10 AM
Also, can you use std::bind in a global level initialiser?
 
Xeo
sure
Atleast you should be able to.
 
@Xeo:That was very helpful of you! thanks
 
Xeo
@VinayakGarg After seeing the whole class, it will indeed be easier to forget all that function and bind stuff. :D It'll also get more efficient:
 
room topic changed to Lounge<C++>: The old topic was so 2011. [c++] [c++11] [c++-faq]
 
Xeo
typedef void (Block::*fnPt)(State*);

class Block{
    // ...
    static fnPt blocks[100];
};

fnPt Block::blocks[100] = {
    &Block::and2,
    &Block::and3,
};

void Block::process(State args[])
{
    (this->*blocks[blockID])(args);
}
 
10:13 AM
Or forget all the class and static array stuff.
 
Xeo
There, improved version
 
Call me dumbo
 
back to member fun pointers?
 
@Xeo: I promise if this works out, i will add your name in credits
 
Xeo
@Pubby Yes, it's way better for this situation
 
10:15 AM
what's your name BTW?
 
Xeo
Xeo. :)
 
void and2(State*);
void and3(State*);

void somewhere_else() {
    std::map<BlockID, std::function<void(State*)>> blocks;
    blocks[0] = and2;
    blocks[1] = and3;

    blocks[something](args);
}
map or array depending on whether it's densely populated or not.
Or vector or whatever.
 
Xeo
@CatPlusPlus No need for std::function. Unnecessary overhead for just this.
 
Fuck overhead.
 
Xeo
And I'd still pass this, maybe Block contains state we don't know of
 
10:17 AM
There was no state.
 
ah i am confused!
 
Other than superfluous block ID.
 
Xeo
@CatPlusPlus Like I said, "that we don't know of" :P
 
Still, it's not a good class, what'd be the invariant.
 
Xeo
@Vinayak, is there any other private data inside Block besides the blockID?
 
10:18 AM
I still am confused, what's the purpose of that class?
 
nope
 
That's what I'm saying for the last 3 minutes!
 
Xeo
@CatPlusPlus Well, I didn't say it was good. We might even throw out the map and blockID and just give each block its own function pointer if the blockID never changes after initialization
 
It depends on the dispatch mechanism, I guess.
 
@Xeo yeah blockID never changes after initialization
 
Xeo
10:19 AM
Cool, then lets totally shred that class! :)
 
didn't i tell u, to call me dumbo!
 
But yeah, you could scrap blockID and just throw function pointers around.
 
yeah, yeah
 
Xeo
woops
Damn shift-enter
 
No class. Just pointers to and2/and3/whatever.
 
10:20 AM
@VinayakGarg What is purpose of class??
 
I don't know
lol
 
We already established that there is none. Pay attention.
 
although i am writing it myself
ha ha
 
Xeo
@CatPlusPlus Right
 
I am very confused
 
10:21 AM
We've reduced the 50 LOC snippet to 0.
Yay!
 
@Pubby: don't worry i am as confused as u
yay! yay! yay!
 
Xeo
void and2(State* s);
void and3(State* s);

typedef void (*process_func)(State* s);

std::array<process_func,100> blocks = {
  &add2,
  &add3,
  // ...
}

void process(int blockID, State* s){
  blocks[blockID](s);
}
Might just be one version
If you want, you can do away the std::array and use something else
Depends entirely on how you use those "blocks"
 
void process(process_func block, State* s) { block(s); }
 
doctor prescribed against STL
 
Xeo
10:24 AM
Well, maybe he gets the function to be called from a byte dispatch
Who knows
 
Maybe.
 
Xeo
That's as far as we can guess I guess
 
@Xeo Then the caller of process fetches the process_func from the container.
 
Xeo
10:24 AM
@LucDanton That thing is an implementation detail (imho, anyways)
 
does the array only contain and stuff?
 
@Pubby: stuff like
bNand2,
bNand3,
bNand4,
bNor2,
bNor3,
bNor4,
bNot,
bAnd2,
band3,
bAnd4,
bOr2,
bOr3,
bOr4,
bXor2,
bMux2x1,
bMux4x1,
bMux8x1,
bMux16x1,
bFA4,
bSh4
 
Xeo
@VinayakGarg Burn him for being a witch.
 
with b removed
 
@Xeo I'm just rebuking your rebuttal! Or something.
 
Xeo
10:26 AM
Are you implementing an emulator or something?
 
I thought he said he didn't know :S
 
@Xeo: u got it right
 
Xeo
Or simulating a processor?
YaY
Where is my cookie?
Omg, I don't believe it. MY RESOURCE MANAGEMENT CODE WORKS!!!
No errors, no leaks.
I'm so happy right now.
 
When all you needed to do is put the initialization in main instead of relying on dynamic initialization.
 
Xeo
Now, anyone willing to build a small unit test to shred this delusion of mine?
 
10:28 AM
It'll barf later.
 
Xeo
@LucDanton Huh?
 
@Xeo IIRC you're solving automatic registration?
 
Xeo
No, that is already solved
It was solved long ago
I wanted to add allocator support though, for memory pools n stuff.
And that was totally contradictory to the earlier design
 
This chat is moving too fast.
 
damn viruses.... :(
 
10:30 AM
Ludicrous speed!
 
@VinayakGarg is that ur app?
 
yeah
 
No, that's IC app.
 
10:31 AM
fancy gui before logic gates?
 
where'd u get those toolbar icons?
 
@Pubby: that's far from fancy
 
Because there is shortage of stock icons on the Internet.
 
@IntermediateHacker:it was some link on first page of google
 
they are nice icons
 
10:33 AM
Also, I had that board in real life last semester. I hate it with passion.
 
Xeo
Ugh, including all non-resource stuff into compilation again sure sucks... syntax error over syntax error after I completely rewrote the management
 
@VinayakGarg but u know, those icons are only free for non-commercial use.
 
it is a open source soft
at least it will be
 
You don't even know where they're from, but you know their license? Neat.
 
open source doesn't mean copy left
 
10:34 AM
partial code available on sourceforge
 
Xeo
Oh, wait. That isn't a slew of syntax errors
 
they are free
 
Xeo
That was just a still-commented-out #include
 
site says that
 
Xeo
IT COMPILES!!! PRAISE ME!
 
10:34 AM
good work!
 
by the way, things are getting out of my hands, anyone care to contribute to this ?
 
Xeo
♪~
 
a programming lang?
 
Xeo
@IntermediateHacker Dynamic or static typing?
 
@Xeo it compiles to C# code.
 
10:36 AM
> The variable type is determined by the compiler either at compile-time or at run-time, depending on the situation.
 
can you fill out that checklist?
 
Xeo
@CatPlusPlus Wait, what?
 
Sounds great.
 
Xeo
C# doesn't allow that IIRC
 
10:37 AM
@IntermediateHacker fill this out
 
Xeo
var is just type inference
@Pubby That is awesome.
 
@Pubby lol.
 
Xeo
Save that for @DeadMG later today
 
yeah, WideC. :D
 
he's seen it, but wouldn't fill it out
 
Xeo
10:38 AM
Unfortunately, your language (has/lacks):
[...] [ ] semicolons [...]
Now I'm offended, what's so bad about semicolons? :(
 
Everything.
 
everyone hates them when they're there, but miss them when they aren't
 
Who misses them?
 
well, that's no problem. all I have to do to include semicolons, is to remove + ";" from the preprocessor class.
 
Must be some crazies.
 
10:39 AM
but I figure no semicolons is better.
 
Xeo
I don't know, I like my semicolons
 
they're troublesome.
 
generated code is much easier with them
more ways to format too
 
Only bad ways to format.
Generated code couldn't care less whether it's newline or semicolon.
 
Xeo
> [ ] You have reinvented PHP better, but that's still no justification
LOL
 
10:41 AM
@IntermediateHacker: this is the link aha-soft.com/free-icons
 
@Xeo Not that it's very difficult.
 
digged in my history
 
Xeo
@CatPlusPlus Try splitting statements into multiple lines without some kind of seperator
 
What statements?
 
C macros
 
10:45 AM
hey, do people plan syntax and features before implementing a language, or while they are implementing it?
 
Macros require explicit line continuations.
@IntermediateHacker The former when they're serious, the latter when they're creating Perl or PHP.
 
which looks more readable?
function << parx , pary
/* code */
end

or:

function(parx, pary)
/* code.... */
end
 
Take a guess.
 
intermediate hacker is making a language now?
 
I'm more used to the latter. What advantages does the first one have?
 
10:49 AM
Everyone is making a language.
 
Xeo
None, and it has multiple function calls possibly
 
It has advantages of introducing funny ambiguities later on.
Oh, wait.
 
Xeo
No wait, I'm thinking C++ here
 
I'm so snarky when sleep deprived.
I feel so proud of myself.
 
ok then. I'll try to implement the second alternative.
 
Xeo
10:52 AM
AAAAAARGH. Crash again. Something is wrong here.
And it's not my code
 
which one do you prefer camalCase or under_score
 
Xeo
Yay, hocus focus. Now I pressed some option at the bug report window without even knowing what I pressed because visual studio suddenly decided to grap focus
Seriously, this Visual Studio installation here is downright broken
 
camel. fewer characters for the same amount of shift key usage.
 
me too for same reason
 
@VinayakGarg camel, no extra underscores.
 
10:54 AM
Whichever is idiomatic.
 
Xeo
under_score please.
 
ThisSyntaxIsMyFavourite()
thisOneIsNotBad()
 
underscore code looks nicer in c++
 
this_one_looks_horrible()
 
@Xeo: i asked this question because i knew you would say the later
 
Xeo
10:55 AM
this_one_is_a_lot_easier_to_read();
DoYouReallyThinkThisIsEasyToRead();
 
It's the same as far as readability goes.
 
@Xeo youAreRight butDontWriteSoLongNames
 
Fitting the rest of the code is more important.
 
With apologies to Alan Perlis — if your procedure has ten underscores, you probably missed some.
 
Switch between several languages on a regular basis and you stop caring.
 
10:56 AM
write::short::names::by::abusing::scope::resolution
 
Xeo
Well, the C++ community must be the one with the most diverse coding styles / conventions
Really, everything goes in C++
 
the nice thing about underscore is that it is all one case
 
both are fine, as long as you don't take turns with them in your code base.
If u use underscores, use underscores till then end, same for camelcase.
 
Still, Boost tries to be consistent with standard library, so that's the de facto standard convention.
 
Xeo
@Pubby Do that in my codebase and I slap you. I have enough double colons in my template code already.
 
10:57 AM
fooBar foobar FooBar Foobar vs foo_bar
 
Foo_bar foo_Bar
 
make_menubar or make_menu_bar
 
nobody does that
 
fooBar if variable/function
FooBar if class
 
Xeo
WHAT_ABOUT_THIS?
 
10:59 AM
kCrap
 
THIS_GIVES_ME_A_HEADACHE
 
Foo_bar is used for constructors in OCaml.
 
THIS_IS_EXPANDED_TO_AN_ANGRY_RANT
 
DECENT_FOR_CONSTANTS
 
Xeo
I literally read such code as if someone really screams them.
 
10:59 AM
kCalmDown
 
And I've seen a language which uses __ as namespace separator.
 
hey, someone told me to do that yesterday
 
which language?
 
anybody following Google C++ style guide?
 
Xeo
11:00 AM
No thanks.
 
@IntermediateHacker Mercury, AFAIR.
 
anyway, bye.
 
then Xeo_style_guide
 
Really, after a while, you stop caring about irrelevant crap like this.
 
I've got to study now. :'( :'( :'(
:""""(
 
11:01 AM
It's Sunday.
 
which subject?
 
And apparently noon at that. Funny how fast 12h can go when doing nothing.
Anyway, C++ is really limited when it comes to identifiers.
 
how so?
 
Just letters, numbers and underscore.
 
Xeo
Isn't that enough?
 
11:03 AM
ids-like-this-are-easier-to-write
No shiftin'.
Also, predicate?.
 
you can remap _ you know
 
Basic source character set gives me shivers.
 
wish I lived in dubai.
 
t and f?
 
11:06 AM
temp = 43deg C in Dubai
 
What's wrong with true and false?
 
Xeo
@Pubby too long, apparently
 
I like to use t for temp :(
 
if ( iam not using class )
should i package functions in namespace?
 
You typically don't use named variables in stack languages.
Only when it makes the code clearer.
I.e. there would be a lot of explicit stack shuffling otherwise.
 
11:11 AM
then perhpse i should leave it
 
@VinayakGarg Yes. In general very little code goes into the global namespace.
 
but these functions are used in very small region, so from @CatPlusPlus suggestion, i shouldn't
 
ohh you were not telling me
 
Xeo
Seriously. That fucking thing just crashed again oO
 
11:17 AM
then i know the answer YES
 
I'm cold, the heating is acting stupid, and the blanket is trying to electrocute me.
This day sucks balls.
And people celebrate. Pfft.
 
Atlantic winters are nice. Doesn't get too cold, and sometimes you get snow.
 
Cats inside a blanket look cute
don't they
ah don't bark at me now
 
You got me until "snow".
 
"Sometimes".
I.e. not this year I predict.
 
11:20 AM
Still.
Here it only fell once some time ago, and public transportation nearly collapsed. Thankfully it's been only rain lately.
 
Xeo
Anyways, it's noon, I'm going to sleep. G'day.
 
Makes sense.
 
Makes sense.
 
Makes sense.
 
Xeo
Sense makes.
 
11:28 AM
Makes sense.
 
Xeo
And I'll just use this chance to actually restart windows and finish my visual studio 11 installation
See ya later.
 
11:41 AM
morning
 
evening
 
12:32 PM
noon
 
I think I've finally successfully tweaked heating into actually working.
Boiler says internal temperature is 51 degrees, which shows some promise.
 
not if it's measured in fahrenheit
 
In what?
 
lol
 
old temperature measurement
51 degrees F is about 10 degrees C
 
12:38 PM
Sarcasm: missed.
I'm not that uninformed.
0
Q: Can anyone name a good Online C++ Compiler, linker and evaluator as an alternative to using dev c++?

Mr_leighmanI have been wanting to increasingly use Android O/S instead of Windows O/S, But I find that Android does not seem to support C++ compliers! So as an alternative I have found that there is Online C++ compilers that one can upload one's code and have it compiled in what ever language one uses. As a...

 
sbi
@IntermediateHacker Because they have nice fireworks?! Wow, that's one heck of a strange criterion to pick a country to live in. (Last I heard they had good fireworks to be seen from the clink, too. Want to move in?)
@DeadMG You were meant to be pointed at this old form. I just thought I'd let you know...
 
@sbi I've seen it
[ ] You have reinvented PHP better, but that's still no justification
love it
 
sbi
Why is it that you can drink until the early morning, and when you wake up six hours later you're still thirsty? :-/
 
1:15 PM
Thirsty for water and angry at the foolishness of yesterday while suffering from the worst headache ever.
That kind of thirsty?
 
sbi
@StackedCrooked I could drink a keg. Well, except that my stomach seems to disagree.
 
Sec, I need to Google keg :)
I don't think I could.
 
sbi
@StackedCrooked Barrel.
 
Lately I can't handle it as well as I used to. It started going downhill two or three years ago when I was 28-29. It's scary.
 
sbi
@StackedCrooked I was in my earlier 30s when I used to drink a lot of beer several times a week. :)
Really, it wasn't all that bad last night. We started out drinking beer when we cooked dinner around 5pm. I had two beer, and I switched to red wine for dinner (at 7pm), which I stuck to until midnight, when I had two glasses of champaign. I switched back to red wine afterwards. So between 5pm and 4am I had two beer, to glasses of champaign, and I don't think I even drank a bottle of red wine. And lots of food. Still I am very thirsty. :)
 
1:23 PM
Being thirsty doesn't sound so bad.
Unless you don't have access to water.
 
sbi
@StackedCrooked Oh, this being central Europe I have access to plenty of tap water. But my stomach disagrees to the amounts of water my tongue demands. And I'm kinda torn between these two. :)
 
Even on a bad stomach I usually don't have trouble taking water.
 
sbi
1:43 PM
@StackedCrooked Hey, what's wrong with your comprehension module today? :) It's not the water in itself that's the problem, it's the disproportion between the amount of thirst and my gastric capacity.
 
Ok, I see that your thirst is really big then. Perhaps you had too much salty food also.
 
sbi
@StackedCrooked Yeah, maybe. Although we didn't eat any chips or stuff.
 

« first day (442 days earlier)      last day (4497 days later) »