« first day (1287 days earlier)      last day (3659 days later) » 

user1804599
9:01 PM
@ScarletAmaranth if the actual implementations of the algorithms are complicated you do it this way because the code is cleaner. When they're one liners this would be overkill. — paxos1977 4 mins ago
 
user1804599
lol, how is that even relevant.
 
@TonyTheLion I kick arse, I chew bubblegum, I'm the meanest motherfucker in the jungle and I put nails in the coffin of the whole language, let alone one or two minor library features :P
 
@rightfold any fancy erlang project going on?
 
at least, I will be doing that when I fix my compiler, which is currently on the workshop floor in more pieces than I can count.
 
@rightfold wasn't even worth to reply to
 
user1804599
9:05 PM
@bamboon No.
 
user1804599
I’m into LiveScript today.
 
And tomorrow you'll be into something else?
 
@rightfold Meh, it would have surprised me if you still were into the same thing :P
 
man
why did I eat that chocolate.
 
user1804599
@EtiennedeMartel Next week I guess.
 
9:07 PM
I should learn to stop turning grumpy days into super grumpy days.
 
user1804599
Eat fruit.
 
user1804599
It’s way tastier than chocolate is.
 
@rightfold But, you're young, so try all the stuff
 
user1804599
Don’t tell that a Dutch person.
 
^^
 
9:08 PM
Fruit and chocolate is even better.
 
@rightfold Also doesn't come with digestive side effects.
and costs less.
 
user1804599
inb4 puppy has scurvy
 
user1804599
@StackedCrooked okay. :v
 
@DeadMG How is your job search going?
 
9:11 PM
I haven't even started yet.
 
i want to control "+" "<<" and other sorts of operator. like cout<< displays output, cin>> has keyboard input, can we define operator as we wish?? If so, what is it called?
 
it's called operator overloading
google and Stack Overflow search will give you plenty of hits
 
thanks
 
user3010322
@Rapptz I GOT IT WORKING. <3
 
user3010322
I new'd up a C++ class and it's calling methods, uguu~
 
user1804599
9:14 PM
@DeadMG y u feed help vampire.
 
user1804599
Instead of binning it.
 
I required a distraction from what I was doing
 
user1804599
You must be really sick today.
 
@ThePhD congrats
 
user3010322
Of course, Id di this all inside MSVC. :v
 
user3010322
9:15 PM
So, you know.
 
probably doesn't work
just like member function pointer thing
 
user1804599
Don’t die puppy I love you. :(
 
:v
 
So, this summer, 19 bars in Montreal will remain open until 6h00.
(Up until now it's until 3h00)
 
user3010322
Oh wait
 
user3010322
9:16 PM
It's not working again. :(
 
lol
 
@rightfold nah
I broke 10,000 lines of code and I have no idea how to fix them.
 
user3010322
Listen, listen.
 
user3010322
It called the constructor.
 
user3010322
I can't really argue.
 
user1804599
9:16 PM
@DeadMG look at the diff.
 
what diff?
 
user1804599
The diff with the version that worked and the version that’s broken.
 
there isn't a version that worked.
 
user1804599
lol
 
user3010322
See
 
user3010322
9:20 PM
Here's this fucking shit again
 
user3010322
 // We could actually allocate Foo itself as a user data but
// since user data can be GC'ed and we gain unity by using CRT's heap
// all along.
Foo ** udata = (Foo **)lua_newuserdata(l, sizeof(Foo *));
*udata = new Foo(name);
 
user3010322
Double pointerific shit, they always do this.
 
yeah..?
that's what I did too
I don't get how that's a problem
userdata is memory managed by lua and finalised by the __gc metatable, light userdata isn't
 
user3010322
You could also do
 
user3010322
Foo* udata = (Foo*)lua_newuserdata(L, sizeof(Foo));
 
user3010322
9:22 PM
and then just placement new. Why don't people just do that?
 
Foo* udata = new (lua_newuserdata(L, sizeof(Foo))) Foo(...);.
 
user3010322
Is it bad or something? Is it better to new everything? Does it save on lua's userdata space?
 
I honestly have no idea
 
@CatPlusPlus gg
 
void *lua_newuserdata (lua_State *L, size_t size);
seems like it's plausible
 
user3010322
lua_newuserdata is just like a malloc, but I'm wondering if there's some internal heap who's space I'm running down.
 
One day I'll win a Deep Dwarf
 
user3010322
Oh well.
 
user3010322
I'll ask on SO maybe one day hopefully.
 
user3010322
So, it turns out the functions all registered correctly, BUT
 
9:25 PM
@ThePhD There isn't.
 
user3010322
The upvalues are not registering coorectly.
 
Lua takes it's memory from the allocator function you gave it.
 
user3010322
I never gave it one. o_o
 
which defaults to malloc, give or take.
 
nite nite
 
user3010322
9:26 PM
Oh.
 
user3010322
Well, then.
 
if you used the luaL_newstate() that passes in a default.
now to see if I can determine what the fuck is going on in this code I wrote previously.
 
user3010322
I have no idea when I'm supposed to call lua_pushlightuserdata
 
user3010322
It won't tell me, damnit. D:<
 
ligher?
 
user3010322
9:27 PM
push_light, sorry
 
user3010322
the light user data pushing function thingymahjigger
 
the Lua manual explains this pretty clearly.
a full userdata is meant to store T, and a light user data stores T*.
 
yep
 
user3010322
Yeah, I have lots of T* and I put them in lightuserdata
 
user3010322
But when the function call is made, on the other side,
 
9:28 PM
I tried that approach already
 
user3010322
The user data comes back 0x00000000
 
I showed it to you remember?
 
user3010322
You did, BUT
 
user3010322
.... ... My brain farted.
 
but nothing :v
 
9:29 PM
you probably tried to get a light user data out of something that wasn't actually a light user data.
 
user3010322
Maybe. I think I have to associate this user data with the meta table.
 
user3010322
And... not with the class itself.
 
user3010322
You're doing ti with full userdata
 
user3010322
If I'm reading right...
 
user3010322
9:31 PM
OH
 
user3010322
NEVERMIND
 
user3010322
I can't read.
4
 
iunno why it didn't work
kinda wish it was easier to visualise the lua stack
 
the Lua API is fucking disgusting.
 
yeah it is
 
9:35 PM
one of these days, I'm going to re-implement the VM with a sweet API.
time to take me amitriptyline
 
user1804599
Man.
 
user1804599
I wish tab were next to one, escape beneath tab and control beneath escape.
 
user3010322
 
user3010322
@Rapptz I HAVE CONQUERED IT ^
 
cg
 
user3010322
9:43 PM
cg?
 
congrats
lemme try breaking it
 
user3010322
Waaait
 
user3010322
I'm not doone!
 
user3010322
I need to implement constructors.
 
no wonder it works :v
 
user3010322
9:44 PM
Er, more constructors. Right now it's just default constructors only.
 
you dropped the hardest part
 
user3010322
I already have plans for it!
 
user3010322
The, uh
 
user3010322
only problem is I can't support overloads.
 
user3010322
Each constructor chosen for lua has to have a different arity.
 
9:45 PM
> One of the difficult things to do is generalising the constructor of a class or what happens when there are multiple constructors. I think for the best case it's better if I pass the constructor types in a variadic template along with the class type. It's probably also for the best to only support a single constructor rather than multiple, since Lua doesn't even have function overloading and overloaded functions don't work with sol anyway so there's no expectation of it working.
 
user3010322
^ What you said. :D
 
user3010322
I was going to use a tag-based approach.
 
@ThePhD which reminds me of the Arrietty anime movie.
 
well
lemme break it anyway
 
user3010322
sol::constructors<sol::types<>, sol::types<int>, sol::types<int, string>>
// Allows access to constructor of 0, 1, and 2 arity with the specified argument types
 
user3010322
9:47 PM
It's.... really wordy, but it does give people the option.
 
that's terrible
:v
 
user3010322
I've got no other ideas. ;~;
 
user1804599
Can I open multiple files side by side in Vim?
 
user1804599
I never tried it in Vim, but I got used to it due to Emacs.
 
it'd be weird if you couldn't
 
user3010322
9:50 PM
@Rapptz Give me ideeeas. ;~;
 
user1804599
 
user1804599
Like the panels here.
 
@ThePhD I don't even know how you did the API.
 
user3010322
gist: lua_class.c++, 2014-04-25 21:52:04Z
 
interesting one box
 
9:55 PM
@stix I've updated the answer with a sample that uses the holder to manage the allocation/lifetime of the actual commands, while exposing pure value-semantics for the grammar: see it Live On Colirusehe 3 mins ago
Look ma! Sean-Parent Approved(TM) polymorphism and Unicode p0rn in one sample.
Oh, and Boost Spirit. <nerdgasm/>
@Rapptz Maybe they heard our complaint about ginormous github oneboxes?
 
@ThePhD I'll probably change it up a bit
 
user3010322
I'm not quite done hammering it out
 
user3010322
Plus, I have no idea if it's pushing / popping things... properly.
 
I didn't pop at all :v
 
this was one hell of a game
if you haven't played it yet, do it gog.com/game/sacrifice
 
user3010322
10:03 PM
I remember that game.
 
user3010322
Great game. :D
 
whenever I think about my favorite games this one comes to mind first
so I guess it's the #1 favorite
 
user3010322
Reminds me of Giants: Citizens Kabuto
 
I've heard they're somewhat similar
I haven't played Giants
 
user3010322
Doit.
 
user3010322
10:04 PM
Do it right fucking now.
 
it's on gog, might just pick it up :D
 
you seem to be into a peculiar niche of games
 
It turns out UKIP could only find an immigrant to pose as a British worker who lost his job because of immigration http://www.independent.co.uk/news/uk/home-news/face-of-ukip-poster-is-irish-migrant-actor-9287616.html
UK, U Y SO HILARIOUS
Oh god, wait, it's everywhere
 
@StackedCrooked if this counts as peculiar, yeah :D
sacrifice is one huge exception and nowadays I wouldn't have the patience to play it again
 
I played some Heroes of Might and Magic 2 in the past. That was kinda fun.
 
10:10 PM
the more the difficulty goes up, the more my interest drops
I find the best fun in games where I get a gun and I'm told to shoot stuff
haven't played much H2
I did like H3 and H4 (especially)
 
I should check of H4 then.
 
Xeo
3 weeks till Transistor comes out
can't wait to play that
 
user1804599
You can go up to H6, so don’t be too enthusiastic.
 
H4 had the best music
Paul Anthony Romero & co had their own classical-like style
I think this track from M&M 7 summarizes best what I like about their music
more exactly what starts at 1:30 and keeps on going until the track ends
 
@Xeo What you poking zygoloid about?
 
10:20 PM
supreme commander was always one of those hardcore RTS games that I'd never fully understand how to play :(
 
Xeo
@DeadMG lambda stuff
 
k
@AlexM. Reached top 50 on the global ladder myself.
 
Xeo
and return type deduction
 
shit, that's hardcore
I... uh, beat the AI in AoE 2 once!
 
eh
the game came out in March 2007 and my exams ended in like, June or something
so I warmed up and then I did the whole, 8 hours a day, kind of thing.
I think that I have something in the realm of 1500 hours total logged between SC and FA
 
10:24 PM
that sorta sounds like me and CS 1.6
 
SupCom
it could have been one of the best games of all time
but it was too slow, too buggy, and the balance just kinda sucked
 
except there were no exams and I still play it since I was in 7th grade
 
well
for me I mostly played the same games for about 5-8 years
World of Warcraft, WC3/TFT, CSS, SupCom
 
back then I had to play it in internet cafes because I had no idea games could be downloaded off the internet
 
oh and Enemy Territory
man that game was great.
 
10:26 PM
Quake Wars?
 
nah
QW is the sequel they tried to put out (but it sucked)
 
Technically, this is not answering the question. It doesn't say how to pass a bind expression to a bind expression. — sehe 4 secs ago
 
Wolfenstein: Enemy Territory is a free and open source multiplayer first-person shooter video game set during World War II. It was originally planned to be released as a commercial expansion pack to Return to Castle Wolfenstein and later as a standalone game. However, due to problems with the single-player aspect, the multiplayer portion was released on 29 May 2003 as a freeware standalone game. In January 2004, the source code for the game logic (not the game engine) was released to the benefit of its modding community. The game uses a modified Return to Castle Wolfenstein engine, itsel...
this one then I guess?
 
yep
 
only found out about these much later once I started reading gaming magazines
due to my entourage I was limited for a long time at what my colleagues played
 
10:29 PM
well
ET was the first class-based shooter I played with actual teamwork in it and proper objectives
before that it was stuff like Unreal Tournament that was just "Get the most frags" kind of thing.
not that Unreal Tournament wasn't fantastic
but since ~2012 or so it's mostly been indies/a little older games that I buy for cheap during Steam Sales.
 
user3010322
@Rapptz Found the bug which might have been screwing you over
 
?
 
CS:GO £3.75, 178 hours, that's value for money right there.
 
user3010322
Aside from the member function UB which we know about, I forgot a std::forward in state.hpp's
 
user3010322
template<typename T, typename TFx, typename TObj>
state& set_function(T&& key, TFx&& fx, TObj&& obj)
 
user3010322
10:33 PM
So TObjy never got forwarded
 
user3010322
And ended up collapsing to a temporary reference.
 
user3010322
Or rather, it became a reference to a temporary
 
TObj is a plain lvalue reference, why would you forward it?
 
user3010322
That
 
user3010322
Is a typo.
 
10:34 PM
and
 
user3010322
Fixed. x3
 
even if you didn't forward it
it would still be an lvalue reference to the original reference target.
I fail to see how this can result in a reference to temporary.
 
user3010322
Yes. But the original was a moved TObj
 
user3010322
s.set_function( "add", &f::add, f( 10 ) ); // All the issues
 
... so?
 
10:36 PM
I, too, don't see the issue.
 
unless you decided to move or not later on depending on whether or not it was an lvalue...
 
user3010322
That's exactly what's going on.
 
I see.
 
user3010322
return set_lvalue_fx(Bool<std::is_lvalue_reference<TObj>::value || std::is_pointer<TObj>::value>(),
            std::forward<T>(key), std::forward<TFx>(fx), std::forward<TObj>(obj));
 
Oh
 
10:38 PM
you should probably require the use of reference_wrapper if you want to refer to things.
 
user3010322
I... should?
 
yes.
bind has the correct behaviour in this case.
it always keeps a copy/move, unless you explicitly std::ref it.
 
I was planning on doing a large rewrite on his code later
:v
 
user3010322
I'm not so sure that's the right thing to do here.
 
well, here's the thing
if I do set_function(..., f(stuff));, I have no idea whether or not you kept a reference to the result of f(stuff).
there's plenty of cases where it's an lvalue but I'd want you to copy it anyway.
and silently sometimes keeping a reference instead is bad.
 
user3010322
10:41 PM
MyBigHonkinClass huge_man( so, many, data, things );
lua.set_function( "twist_those_knobs", &MyBigHonkinClass::BigProcessing, huge_man );
 
user error.
better to introduce a copy where a reference was intended, than a reference where a copy was intended.
 
user3010322
I'm not sure what would return an lvalue reference that would want to be copied.
 
for example, if I expected a copy, I might go mutating the source object on another thread and fun stuff like that.
@ThePhD std::vector<T> vec; /* fill vec */ for(auto&& obj : vec) lua.set_function(..., obj);.
obj itself is an lvalue but it clearly won't survive the current end of scope.
 
user3010322
I see.
 
Konung 2 got released on Steam and is getting a whole lotta hate from the community, with most of the hating members not even having played it :(
I hope they'll add Konung 1 too
 
10:44 PM
frankly
even the potential for unexpected thread-related problems immediately says "DON'T DO THIS SHIT".
 
I took screenshots. here is @codinghorror insulting my post which he has since plagiarized http://t.co/vNkoGsyUF3
Whoa. War has begun
 
it's gonna be difficult/impossible for me to debug
 
user3010322
My initial feeling was that if I make one instance of a class and I pass it to set_function, I expect the instance that it works on to be the class I gave it, not some copy, because I'm assuming I've specifically set up the class to be the one that interacts with lua (unless I give it a temporary, in which case I clearly don't give a damn).
 
user3010322
But, I can change it to be std::ref-respecting.
 
user3010322
.... Later, after I get these bugs and other things cleaned up with some other code-cutting refactors.
 
user1804599
10:48 PM
@sehe lol arguing over twitter.
 
user1804599
/me gets popcorn and throws it away because this is way too uninteresting
 
@ThePhD I will probably rewrite the code later.
It's no biggie and I've been planning on doing it
 
user1804599
later my ass
 
user3010322
@Rapptz Which syntax do you think is better? lua_class into table, or table into lua_class?
 
user1804599
It works, so you don’t dare touch it.
 
10:49 PM
@rightfold I don't read that. Instead I read t.co/o1I1eJ7l27
 
@rightfold Nah. I'll touch it all I want.
 
user3010322
sol::lua_class<f> lc{ &f::add, "add", &f::add2, "add2" };
lc.register_into( s.global_table() );
 
@ThePhD neither
 
user3010322
@rightfold @Rapptz Lives on the edge
 
user3010322
@Rapptz How do you expect it to work well, then? :c
 
user3010322
10:49 PM
Is it just supposed to be a function?
 
user1804599
@Rapptz That’s what she said.
 
@ThePhD latter then
 
user3010322
So... what I have above?
 
no
 
user3010322
So..... mytable.add_class( my_lua_class ); ?
 
10:51 PM
yes
 
user3010322
Ah. On it.
 
don't call it class, call it userdata because that's what it is
 
user3010322
Oh.
 
lua_class => userdata
 
user3010322
Well, hokay.
 
user1804599
10:52 PM
 
I still don't know why my approach is broken :s
 
user3010322
Probably something with how you set the tables.
 
user3010322
Fun fact: because I override __index, it'll be damn near impossible to support indexing (that is, someluathingy[10])
 
user3010322
But quite honestly.... I'll figure it out later. <_>
 
what..
are you aware how lua "classes" work ?_?
 
user3010322
10:54 PM
Not really. :D
 
user3010322
Das onebox
 
that's the only "class" I have with operator overloading and everything
 
user3010322
What should be the function name?
 
user3010322
add_class? set_class? create_type ?
 
user1804599
11:01 PM
f.
 
user3010322
Also, user_data or userdata ?
 
user3010322
I think userdata matches the enum name
 
Unfortunately C++ is more verbose than C. If you have a C++11 compiler you might want to look into regular expression though. — Joachim Pileborg 20 mins ago
Why does the guy keep saying rash stuff like that
 
If you have a trivial text string to parse, why bother with some trivial code to parse it when you can call a massive library instead? The more code you pull in, the bigger your executable and the more impressive it looks:)
 
userdata
 
user3010322
11:16 PM
Okays
 
user3010322
For now, I think I'll go with set_class
 
user3010322
Uh
 
user3010322
With regex
 
user3010322
how do you specify in the bracket box
 
user3010322
That you want to find (or not find) spaces?
 
user3010322
11:20 PM
Like, for the grouping syntax
 
user3010322
ab[a-z ]cd
 
user3010322
Doesn't seem to work escaped, either...
 
@MartinJames Precisely. You know me so well
 
What do you want to match
 
user3010322
Uh. I'm trying to match multiples of four spaces
 
user3010322
11:23 PM
But I can't seem to save match until not-space
 
@MartinJames However:
@JoachimPileborg I don't think regexes should be recommended for parsing floating point data. — sehe 15 mins ago
 
are you using sed to format your code..
2
 
user3010322
Uh.
 
user3010322
Maybe.
 
Don't
 
user1804599
11:28 PM
Use ed.
 
edlin, much more arcane
 
user3010322
All tests pass for me.
 
user3010322
PUSHING AND PULLREQUESTING. <3
 
Whoa "linux goth slut" was a thing - never knew this
 
11:36 PM
time to refactor :v
 
user3010322
:c
 
hmm
 
user3010322
@Rapptz Puru ♥♬♥
 
teco is much underused.
 
11:45 PM
lol
I thought you deleted your repo and repulled
 
user3010322
I did on my local disk.
 
good job
 
user3010322
:c
 
user3010322
I did change a lot of things, though.
 
I'll fix it dw
 
11:49 PM
I should post this to that 'bad questions' meta - a classic linked-lister 'i have no idea why it doesn't work' with no debugging:
http://stackoverflow.com/questions/23304433/my-malloc-is-losing-a-lot-of-memory-in-my-linked-list-program-why
Hahah WORSE - 'please debug my 1300+ line code dump':
http://stackoverflow.com/questions/23304725/code-instability-i-need-someone-that-can-walk-it-through
This really does need downvoting to MH370 level.
 
@MartinJames why isnt it an error to have statements after return?
 
why would it?
 
if the code can never be reached, clearly its a bug?
 
if(x) { return x; } int y = x + 10; return y; technically has statements after the initial return.
unreachable code isn't an error :v
if anything it should be a warning and I think GCC and Clang have one
 

« first day (1287 days earlier)      last day (3659 days later) »