« first day (524 days earlier)      last day (4650 days later) » 

04:01
Fuuuck, now I have to rebuild the whole thing in debug. I'm feeling really productive right now.
lol
The thing I hate with that project, is that we have a really schizophrenic stdafx.h. So when you sneeze on a file somewhere, the project might require a full rebuild.
lol
that sounds hilarious
stdafx.h is the thing I always delete first
Well, in our case it's supposed to reduce build times. But it's so retarded it fucks the incremental building, which is pretty much essential with a project of this size.
04:18
hmmm
to dynamically load the unit types from files..?
or to have them statically built into the game
For an RTS?
yes
I'd say dynamic is better. Allows you to tweak unit stats without having to rebuild the shit. And it makes creating new unit types easier.
fair play
the problem that I'm facing is that the dynamic formats aren't really to my liking
eh, I'll just use Lua
Yeah, I think scripting the whole thing would be best.
04:24
no
it's dodgy, at best, to mix scripting and concurrency
Hmm.
Then, yeah, perhaps you should only use Lua as a file format.
the problem is
it's not UTF-16
so if you were to say, attempt to load a file which contains Unicode characters, it would die a horrific death
Really? Damn, I hate when languages don't use Unicode.
agree
I mean, fuck, even JavaScript supports Unicode.
04:27
it's a Unix language, really
@EtiennedeMartel Somewhat.
so the designers are probably like "Well, Unix works fine with UTF-8, bitches"
so unless I want to implement the language from scratch :P
@RMartinhoFernandes Oh, so you do read the discussions.
What discussions?
perhaps something like XML would do
04:29
@DeadMG Don't you already have a language?
I dislike XML quite a lot, though
@DeadMG Nooooo!
@EtiennedeMartel Sure, but it's not exactly ready for prime time :P
JSON! Ok, ok, I'm biaised.
lol
I could try embedding JS, I guess
04:29
Fuck fuck fuck fuck. My best marksdorf decided to happily go outside fill his waterskin during the worst siege they ever had. They have a well inside.
@RMartinhoFernandes Let me guess: got his ass pierced by 999999 arrows?
or I could use LuaPlus
@DeadMG V8 has very "un-Google like" source. Plenty of templates in there.
they added UTF-16 support into their changes to the Luasource
Yeah, I think Lua would do a great job.
well
apart from anything else, Lua is a simple, easy language and I'm an expert, as far as it is possible to be an expert, in it
so I'd be super-productive
of course, if you want LuaPlus you have to have Git
I feel so dirty :(
04:33
Woah. He' s awesome! He scared a squad of goblins away by himself just dodging them and bashing them with the crossbow.
@RMartinhoFernandes So that's why he's your best.
@DeadMG How so?
@EtiennedeMartel The only way mentioned to download the source is to clone their repo
@DeadMG Well, time to install Git to run a single command.
nope, apparently, I just missed the button
04:35
Wut.
oh, no, wait
that's not what you said you were at all! I already cancelled my Git install
:(
Oh my, LuaPlus looks awesome.
if it Does What It Says On The Tin™, then indeed, yes
hmmm
when I say git clone X, I wonder where the hell git put it?
probably in some really obscure directory I'll never fin
04:39
In the current directory.
So you have to cd into where you want the stuff to go.
And then run the shit
it most definitely did not mention that
so I wonder where is the Cygwin default current directory? :P
Probably somewhere in wherever /home is.
Oh, if it's on Github...
the Start instructions say to run a bat file after editing my PATH variable
but the folder it suggests needs adding to PATH does not appear to exist
04:47
Maybe you need to install that jam thingy separately?
Isn't Jam the thing used to build boost?
I hate making and all such
@EtiennedeMartel They have their own branch, I think
@EtiennedeMartel But this is JamPlus!
New and improved! Now with 27% more kittens!
and you have to click 100000 links to try and actually download the thing
and 'm not even sure that I've got the tool I think I wanted
04:49
lol
Does it ask for your email?
And your SSN?
well, I downloaded the tool
aaand the LuaPlus bat file won't work with it
why oh why don't they just ship pre-built source codes
Built with what? GCC 4.whatever with some obscure flags?
and I can't get the LuaPlus bat file to work
why is building even necessary anyway? just ship some normal source codes :(
04:59
What does that mean?
well, I don't even get what this tool is supposed to do
what's wrong with just downloading the source code and including the damn header?
There's some .cpp things to compile?
But, yeah, sometimes I miss the old Unix way: configure; make install.
Then I remember that with VS I can just click the shit out of the process.
@RMartinhoFernandes I'll just add them to my project?
If that works, it's worth a try.
But it may be missing defines and shit.
05:03
I don't know if it will work
maybe the source is full of those crappy macros which you need an external program to expand
last time I tried that with LLVM and it didn't go so hot
It might need some funky settings.
sod this
2
Q: How do you include LuaPlus into your project?

NaturalDreI downloaded the visual2008 file from here(http://luaplus.org/projects/luaplus/files), but I don't know how to add it to my project. It's not like the other libraries where I just had to add the include directory to my Visual Studio folder and the bin to my system32 or project folder. There are n...

Perhaps that'll help.
write simple recursive descent parser for similar grammar
nah
the problem is that the batch file doesn't work
else I would have just executed the thing and been done with it
obviously, LuaPlus needs some specific derivate of Jam- of which, there are obviously 10000000- and didn't mention that
05:22
ok
found the specific derivate it wants, installed it just how it wants, and it still doesn't work?!
warning: levels of fail rising to Epic!
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 69 skipped ==========
right
just gonna write my own quick format with a recursive descent parser
argh, Intellisense, y u suck? :(
 
1 hour later…
07:00
You should be able to create a generic (not lock-free) atomic variable std::atomic<MyType> atom right? I tried this with a std::string and gcc linker is complaining that it can't find a reference to it's member method, I'm currently simply trying to call is_lock_free.
Only for trivially copyable types.
@RMartinhoFernandes Well I tried the same with a struct MyType {int a;} and I got the same error ( I was not sure if std::string was trivial)
I think it's only implemented for user types in GCC 4.7.
Lemme try.
Yep.
That's it.
so once again still working on gcc 4.6 tackles me, thanks for the help :)
07:30
posted on March 23, 2012 by Anders Schau Knatten

There didn’t seem to be a basic gloox tutorial available, and the example on their home page is out of date, so I decided to write one. This tutorial is based on their example, but extended and updated to work with gloox version 1.0. Since you are reading this, you probably already know, but gloox [...]

 
1 hour later…
08:32
does anyone have experience with ostream and ofstream ?
my main concern right now when using ostream, and ofstream is memory management. I use ostream with stringbuf, and use the ofstream as the similar ostream pointer. eg.. they have the same base class. Though it looks like ostream in its deconstructor doesnt delete the provided stringbuf.
The situation is different for ofstream that when deleted will destroy it's output steambuf.
Both are able to be accessed via the rdbuf
08:54
@Chad: Just put your question on SO (with a clear code sample)
Morning
09:22
Hello.
@Chad it's called a destructor, not deconstructor. :)
@RMartinhoFernandes Hi too, keyboard
but yeah, post it on SO with a code sample
@jalf That sounds like a philosophical method
09:24
All I can say from that description is that "both ostream and ofstream have correct destructors which clean up everything they are supposed to clean up.
Unconstructor.
@jalf Not necessarily if you set a new streambuffer pointer, IYAM
It is more or less the canonical way to alias streams like os.rdbuf(std::cout.rdbuf()) and that would mean a problem if both streas took 'ownership'
@sehe IYAM?
@jalf GIYF, but "if you ask me"
If you ask me.
We have an acronym list on the wiki!
09:27
That doesn't even make sense. ostream's destructor doesn't depend on whether I'm asking you. :|
@jalf Then don't ask me and be happy
ok
so... any one care much for Mastodon?
Working with IOStreams from the implementation side is a pain.
Boost.IO is nicer.
09:40
Hi.
@thecoshman What's that?
> @DhruvPathak I object to calling football soccer. The game US play must be called handegg to resolve ambiguity. – Anycorn 1 hour ago
This is awesome.
@RMartinhoFernandes except, an american football is not egg shaped and is not played with both hands and feet
Shut up, it's played primarily with the hands.
Football is also played with both hands and feet, so what?
probably further to my point
personally, I settle with the argument, football came first, America, get your own damn name!
or, call it English Football
09:48
"Handegg" is awesome. I don't care for the inaccuracies you mentioned: it's more accurate than "football".
@RMartinhoFernandes call it what you will, it's still an odd sport
@RMartinhoFernandes I assume you must be, since I don't see it :)
I propose "yet another silly sport".
@CatPlusPlus Egg plant?
09:50
@RMartinhoFernandes (╯°□°)╯︵ ┻━┻
This will end in a bloody revolution, sooner or later
well that's a worth while page ¬_¬
Add something.
@RMartinhoFernandes ouch
and that's all I have to say about that
09:52
Unrelated: Fabric is awesome.
At least he gets to visit a country he never visited before.
Indeed, it saves from the shame of our own bodies
@RMartinhoFernandes In the same way someone who's fallen out of a plane has a chance of sightseeing.
3
lol
> Why do I see an #include at the bottom of this header file (that contains templates)?
damn, that's a smart yet simple idea
09:55
@thecoshman include the template definitions?
I've always known it as, if you want templates, it has to be done all in the header
"Header" is just a convention.
Preprocessor couldn't care less for the extension or the contents.
wow... I want UB to order me pizza :)
10:16
oh dear... this code is going to get real messy real fast if I am not real careful
trying to create a control system that can have it's output piped to either real world devices through I/O or to a virtuallised version so that I can test the control logic in simulation
@thecoshman It will anyway.
10:34
@thecoshman Use AdaptorSingletonFactory.
@thecoshman Doesn't sound too hard to abstract.
How do you write inline code in the wiki?
Oh, there's a monospace option.
@StackedCrooked loɹʇuoЭɟOuoısɹǝʌuI containers
What's ∈ontrol?
Element of ontrol?
Don't mention IoC.
10:46
@StackedCrooked it probably isn't, but the will has sapped from me
Lol.
This I haven't seen before.
@thecoshman Maybe you can use boost signal allow external parties to connect to your control system.
Or is it stream based?
erm... it's for robotics... the output's are controlled by linux file magic, writing to the files controls the I/O
Isn't it simply a matter of specifying a different output filename depending on whether you want to do a real run or simulated run?
I think I should wait until I can get the hardware and building it up from there
@StackedCrooked I suppose, but then I would need to write code to read from those files... but I guess that is probably the best way to do it
Though I was thinking that I could by pass the writing to file stage
@RMartinhoFernandes close enough :P
Disclaimer: I don't endorse the tips and tricks I wrote there.
I knew you'd add that.
> locker_box<racy> box; // shared data is not accessible without locking
wait, sorry. I was going to say isn't that like shared_ptr, but I see what it is
do you not need to lock your box again afterwards? or do you have some clever it is valid until it goes out of scope and then the delete functions relocks the box... or unlocks :S
That's the point!
The box is only open (i.e. the lock is held) while the loop runs.
The loop runs only once, but a for is a loop.
so you are using the for loop, just to scope?
And to take a reference to the object that is inside the box.
could you not swap that for a do{}while(false) and acquire your lock with in that loop, or is that not how you locking system works?
11:12
@thecoshman You'd have to create a local variable for that.
And give it a name.
And another line to take the reference.
#define as ,
#define with(x, y) for(auto&& y : x)
with(box.open() as x) {

}
do{ auto& x = box.open(); x.do_racy_stuff() } while(false)
would that not work?
@CatPlusPlus Oh, neat. Doesn't invoke the same reaction.
@CollinHockey open needs to return two things: the reference and the object that does the release upon destruction.
Why not just:
{
      auto& x = box.open();
      stuff();
}
@RMartinhoFernandes Oh, I didn't read close enough
In your example, if x is the scoped handle for the lock, you need something else to get the object. If x is the object, you need to release the lock manually.
The for loop hides away the scoped handle for you.
11:17
This was solved a few years back by Alexandrescu with Scoped Guard (google for it, read the article in DrDobbs), and with C++11 it would be just much nicer :)
Where nicer means that you can use lambdas. Scope guard provides a function to execute at the end of the block, and the lambda can provide the actual code to execute.
Not quite the same.
@DavidRodríguezdribeas The attribution to Andrei is quite a bit misleading. It was not his thing.
{
    scoped_guard _ = box.open(); // Nice, the lock is held. Where's my object, dude?
}
Uhm... I guess that I too did not read enough back... but I can offer a different article by the same author in the same publication if you want.... volatile: The Multithreaded Programmer's Best Friend The title alone should make you get interested once you know that it is not just a bunch of bullshit. Some people like it, some people don't, but no one has claimed that it is absurd.
too bad you can't overload the . operator.. then open() could return an object that acts like a ref to the box but closes it on destruction
11:22
Oh, make it a reference if you want.
@CheersandhthAlf: Well, the author I read is coauthored by him, and he appears first
@RMartinhoFernandes I was thinking you would have a system such as box.open(); box.some_racy_thing(); box.close()
@thecoshman But that requires manual closing.
The point is to not have to close manually.
RAII is neat.
11:23
@CheersandhthAlf: I agree that he explicitly mentioned that the original solution is from the other author
@DavidRodríguezdribeas Hm, also that one is misleading. Andrei and Scott Meyers wrote the follow up that completely killed the idea of using volatile.
@DavidRodríguezdribeas Andrei's contribution was mostly to make it better known. And he wrote a higher level wrapper that nobody used.
The original author of the solution is Petru Marginean (I had to look it up), but the article is his.
I can't remember the name of the guy! But I do remember that he ended up at Goldman-Sachs. What's with my memory?
so, the general just of RAII is that you don't have (to use) release functions when and object is about to go out of scope, because the destructor will call it, or similar
@CheersandhthAlf Can you point me to that follow up? I know the shortcomings, which basically boil down to the fact that you cannot create a thread safe interface by adding locking to a thread unsafe interface
11:26
That's part of it, also that you shouldn't have uninitialized variables laying around (Resource Acquisition (including memory!) is Initialization)
"andrei meyers volatile" <- google
@CollinHockey opposed to lazy instantiation then?
and you know that if an object can take 100 byes, and you have 100 10 of them there is 1000 bytes in use
@thecoshman You Fail Math Forever.
@CheersandhthAlf If you refer to the perils of double locking then they relate to two different things
11:28
no, not really
stupid extra zeros floating around
In the article I linked volatile is not use because of the properties of reads/writes, but rather as an annotation of I am calling from a locked section
@thecoshman You can lazy initialize, but the idea is that your user code is handling fully formed objects at all times that take care of their own destruction. The class would hide away the lazy part
IIRC, nowhere in the article was volatile used on an actual variable, but just on methods and the reference to the object that offered those functions
Right, he uses volatile only for its tagging properties.
11:30
@CollinHockey oh ok. so, like if you had your own string class, it would handle the memory it uses at all times
That is why I claimed that the title itself should be a reason to read it knowing that while the design might be disputed, it is not wrong
You can const_cast volatile away at will, and that is used to turn on and off part of the interface.
ooooh, CRTP... mad shit right there
It's a neat idea. As is typical with Andrei, he forgot to list the cons, though.
In any case, abusing volatile makes me less at ease than abusing range-for.
And the locking pointer leaves the shared data open. It requires discipline to use it everytime.
My box is enforced by the compiler.
You can take the reference and store it to cheat, but you deserve what you get for that.
11:40
I guess you can only protect idiots users so much
Programming by hoping you'll never make mistake is silly, if you can make compiler handle boilerplate for you.
The main con (again) is that you cannot make a thread safe interface out of a thread unsafe one by just adding locking. The interfaces must be adapted. Consider std::stack. There is no safe way of extracting an element by just adding locking on each member as there would be a race condition between top() and pop()
@DavidRodríguezdribeas STM ftw!
@DavidRodríguezdribeas That's not a con of his approach. It's a con of locking in general.
I think the main con is that it involves UB.
(Gimme a moment while I confirm)
11:42
STM ftw????
> §7.1.6.1/6 If an attempt is made to refer to an object defined with a volatile-qualified type through the use of a glvalue with a non-volatile-qualified type, the program behavior is undefined.
@DavidRodríguezdribeas Software Transactional Memory.
... for the win!
Uhm... I should have imagined coming from Jalf :)
:)
And C++98 has a similar paragraph in §7.1.5.1.
@jalf Nice to see you
11:44
howdy :)
I gotta go to work now. See you
is it still ok with RAII to make use of release functions... I assume so, just that you would need to make sure the destructor does not try to release stuff if it does not need to be
@thecoshman Yes, it makes sense. Sometimes you want to destroy early, sometimes you want to handle exceptions from destruction...
@thecoshman ummm?
std::basic_fstream::close
11:47
I thought so :)
@thecoshman I don't get the last half, but I think the answer is yes
@jalf the destructor should not assume that resources ALWAYS need releasing as some of them may have already been released
You can never assume resources always need releasing.
@thecoshman If that 's the case, you need some kind of marker.
of course
11:55
And now I'm not sure if dtor runs if ctor throws.
Then I've been coding them bit too defensively. Oh well.
But already constructed members don't leak.
@CatPlusPlus lol
@CatPlusPlus only fully constructed objects have their destructors called
@RMartinhoFernandes so if ctor allocates a big block of memory, then throws... what happens to that block of memory?
11:57
so if the constructor throws, all fully constructed subobjects will be destroyed, but whatever threw the exception won't
@thecoshman the ctor has to clean it up :)
@thecoshman Depends. If it allocates with make_unique it's fine. If it allocates with naked new it's lost.
or each operation should be wrapped in a separate RAII object, then you get correct cleanup for free
since the allocation succeded, and that gets wrapped in a RAII object, which is fully constructed, it will deallocate correctly
so much clever shit going down
as soon as the same class becomes responsible for multiple throwing operations, it gets complicated, and you have to do manual cleanup
or split up the class :)
It's all finely tuned.
11:59
Or wait until people notice and file a bug.
But I didn't say that.
@CatPlusPlus or close the bug as WONTFIX
Oh, WONTFIX is better.

« first day (524 days earlier)      last day (4650 days later) »