« first day (1143 days earlier)      last day (4031 days later) » 

user3010322
19:00
template<typename T, typename TFx>
    table& set_function( std::true_type, T&& key, TFx&& fx )
Xeo
Xeo
...
why does my static lib not contain the symbols for some of the things in it? :(
Xeo
Xeo
isfunction == false, right?
user3010322
See? It's not my fault. :c
user3010322
isfunction == true
user3010322
19:00
I'm not negating it there
Xeo
Xeo
Then how would it assert?!
user3010322
Oh, right. It asserts when false, not true.
2
Xeo
Xeo
...
user3010322
<_>
user3010322
So now we're back to square one. The type is a function type, though.
Xeo
Xeo
19:02
SSCCE or bust.
user1804599
SSCCE or busty.
user1804599
Wrong! Not compilable!
user3010322
^ Even GCC fails. :c
user3010322
It's supposed to not compile.
user3010322
19:05
It's meant to show the types and error messaes.
Xeo
Xeo
@rightfold "complete", not "compilable"
"Short, Self-Contained, Complete Example"
user3010322
Still, is_function is reporting false.
Xeo
Xeo
Or "correct" if you prefer
No it's not
user3010322
For a type that even after being decayed, is definitely a function pointer
Xeo
Xeo
decay produces function pointers
It's a function from R(Args...) -> R(*)(Args...) for function types
user1804599
19:07
I’m writing such bad code.
user3010322
And function pointers work with std::is_function type_trait, right?
user1804599
I’m practicing coding horror.
Xeo
Xeo
@ThePhD I seriously have to ask, did you listen when I said how is_function works?
user3010322
@Xeo Yes.
Why do you even need is_function?
user3010322
19:07
You said it should workfor R( Args... )
Just pattern match it.
user3010322
And also R( * ) (Args... )
user3010322
Or however it's written
Xeo
Xeo
@ThePhD No.
user3010322
:c
Xeo
Xeo
19:08
10 mins ago, by Xeo
#include <type_traits>

static_assert(std::is_function<void()>::value, "void()");
static_assert(!std::is_function<void(*)()>::value, "void(*)()");

int main(){}
See that ! in the second assert?
user3010322
....
user3010322
... Oooooooooooooooooooh.................
This is why I use not there.
user3010322
I'm... gonna go to my corner now.
Xeo
Xeo
@R.MartinhoFernandes MSVC doesn't like that by default, which is why I changed it
I had not on Coliru
19:09
Oh. That.
0
A: C++: Loop Optimization and Loop Unwinding (To loop or not to loop)

FredOverflowBy encoding which positions are part of which lines, you can perform the win check very efficiently: char square[3][3] = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}; char player = 'x'; unsigned progress[2]; const unsigned lines[3][3] = { 010010010, 010001000, 010000101, 00101...

Any bit hack lovers? :)
Xeo
Xeo
Also, I actually use == true and == false for such asserts
I should've done that here
Anybody here know how to make this line work? #define sse_t restrict float*
user1804599
float* restrict?
@FredOverflow Looks a bit (pardon the pun) like the most recent edit I added to my answer.
user1804599
19:12
Also typedef.
restrict is an annotation on parameter types. It does not make separate types, does it?
no.
@JerryCoffin I changed it by using hex literals to differentiate myself more from your answer ;)
Still, your solution uses a loop, where mine requires none.
@DeadMG why is it that you should pick the last square added (in A*) in case of a tie? I seem to have forgotten.
so have I
user3010322
19:16
What the hell @___@
@FredOverflow 'tis true--they're not identical, but the basic idea and encoding are certainly quite similar.
Also, your bits represent win conditions, whereas mine represent line membership.
user3010322
Visual Studio is a fucking liar. D:<
@rightfold there are two places it can go and none work :-(
@ThePhD Are you debugging a release build?
user3010322
19:17
@FredOverflow No, debug. All debug, all day.
user3010322
I KNOW Visual Studio is lying because the function I'm calling is a _cdecl function, like EVERY other function
user3010322
But it's still claiming stack corruption because the calling conventions are different!
no
that's just one example of why stack corruption can go wrong.
user3010322
Well, Visual Studio is still being a dirty liar. :c
user3010322
In either case, ESP is being smashed and it's returning a stack-smashed garbage value. =/
user3010322
19:20
So I'm SOL.
eh, you still basically only get that with unsafe pointer casting.
I am not positive, but it might be that it makes it more likely to choose the general direction of the final path (seems to be true for simple cases, at least).
user3010322
I'm doing static_cast from lua_func* to void*, and storing the void* in lua's lightuserdata table. :c
user3010322
And then going backwards.
@Pawnguy7 You don't need to understand every minutae of the algorithm.
user3010322
19:21
I checked the pointer value: it says it's alright.
user3010322
It's the same going in and coming out.
lua_func*?
shouldn't that just be lua_func?
user3010322
base virtual class.
I suppose.
ah, wrong naming convention, I was thinking of that lua_Function typedef thingie.
19:22
It was #define sse_t float* __restrict which is VS only. In GCC its the other thing... fuck
I am still slightly confused on the changed paths as well. I think you only do it for those already on the open list.
If it is closed, none of the things that branch of it will be corrected.
@Pawnguy7 If it's in the closed set and the distance is changed, it is re-added to the open set, so all paths leading from it will be retroactively updated, IIRC.
That could work.
@ThePhD Could be that the pointer points to a smashed value.
3
A: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select

kolexinfosif you tried everything here and it does not work you might want to check your mysql database collation mine was set to to a swedish collation the I changed it to utf8_general_ci and everything just clicked into gear, I hope this helps someone.

user3010322
19:24
@DeadMG I wouldn't think that it'd be smashed at that point...
Nothing to do with the question whatsoever. +5/-2.
well, fucking prove that it's not smashed.
user3010322
Okay, okay.
add a shitty global for debugging only that contains all live T* pointers and check it.
user3010322
So pushy. :c
That's smashing news
If ESP got smashed, how did the call manage to return?
@R.MartinhoFernandes haha
If I read it correctly, the wikipedia pseudocode will do as you said, but I don't see it removing it from the closed set. Unless it somehow updates offshoots some other way I don't see or realize.
probably doesn't need to be removed from the closed set
user3010322
19:29
@R.MartinhoFernandes That's fucking hilarious. xD
@R.MartinhoFernandes LOL! Only in US...
user3010322
"HOW DARE YOU TRY TO TAKE YOUR KID FROM SCHOOL YOU DISORDERLY CITIZEN YOU!"
@DeadMG In my mind, offshoots would not have updated gscores, and so it would not be accurate. I am not sure if some guaranteed coincidence fixes it anyway, though (those paths might get updated as well, for example).
look
I hate to break it to you, but it's been a really long time since I did A* and I really don't remember much about it.
and my situation was quite different to yours anyway
so you're really not gonna get much asking me about every little detail.
user3010322
Okay... I just checked to make sure it wasn't screwing up tables or creating any dangling pointers, and everyhting checks out, but I'm still getting a smash stacked error. =[
19:32
Ah.
I am curious, what was your situation?
well
it was basically free 3D space with no fixed obstacles and all obstacles being roughly circular.
so I realized that PF was a much better choice
In unrelated questions.
Is '*' special in search queries?
not as far as I know.
except it's commonly used as a wildcard I guess.
why?
For me, A* seems to... basically ignore the *. Only A* pathfinding works.
Sigh.
you need some backticks :D
user3010322
19:38
@DeadMG Well, I checked again. Everything's identical. Down to the vptr's and the addresses. I'm not sure what I'm doing wrong...
user3010322
Gonna try some more random things.
Not positive what you mean by backticks.
Or how to use them, rather.
well, you inserted some, and now it's actually possible to read your sentence.
True. But it is also now monospace.
you can put just the stars in, you know.
19:39
@Pawnguy7 what's your problems with A*?
Xeo
Xeo
@Pawnguy7 SO or Google?
@thecoshman Not positive. At first, I had no idea how it worked, so I was trying to change that. Theoretically now I have a pretty good idea, and... I should debug what I have.
@Xeo google
@Pawnguy7 Basically, A* was proven to be the most optimal algorithm for the general graph searching problem, ever.
there was an A and an A2 and an A3, I think, both derivatives of Dijkstra if I recall correctly.
but then the same author invented A* and proved that it was the best that could ever exist.
Xeo
Xeo
@Pawnguy7 Also, just google "a-star"
19:41
@DeadMG I think it's most optimal for a certain scenario, but that certain scenario is not what all problems are. A* is not the only pathfinding you should use.
Xeo
Xeo
@DeadMG Yeah. When we had pathfinding in class, we did BFS, DFPS, Dijkstra and then A*
A* is basically Dijkstra + heuristic
@thecoshman It's the most optimal for the general graph searching problem.
that doesn't mean that all problems are searching general graphs.
@Xeo That was somewhat successful, but also gets this.
@DeadMG indeed
or that searching a graph is the most useful approach.
Xeo
Xeo
19:42
@R.MartinhoFernandes That's just sad.
personally I'm a big fan of PFs in many cases.
user3010322
.... Hoooooooookay
user3010322
So I think I've done something horrible with shared_ptr ...
Xeo
Xeo
You're doing horrible things to code all the time, so that's nothing new.
user3010322
Yeah, but I'm not sure why it's horrible this tiem around. =/
user3010322
19:46
given a std::unordered_map<string, std::shared_ptr<lua_func>>, the following apparently smashes the stack:
user3010322
    std::shared_ptr<detail::lua_func> sptr( new detail::lambda_lua_func<clean_fx>( std::forward<TFx>( fx ) ) );
		    hint = funcs.emplace_hint( hint, fkey, std::move( sptr ) );
	    }
	    detail::lua_func* target = hint->second.get( );
	    (*target)( state( ) );
user3010322
lambda_lua_func is dervied from lua_func, so...I would expect this all to fit neat and tidy in there.
Arggh, FF throwing one of the upgrade tantrums.
Xeo
Xeo
Did you check if hint == end()?
user3010322
Yes, yes I did
user3010322
19:48
Er
user3010322
The whole thing looks like this in the end...
user3010322
It's... bizarre. I'm not sure why that's causing the stack to die...
SSCCE
Xeo
Xeo
@ThePhD I mean after reassigning hint
user3010322
19:49
Is std::shared_ptr allowed to hold base types?
user3010322
@Xeo Oh. Uh. No.
Xeo
Xeo
yes
user3010322
emplace_hint says it returns an iterator to the newly inserted element
Xeo
Xeo
Oh wait, should always return a valid iterator. Nvm
what if it didn't insert an element?
say, because fkey already existed?
Xeo
Xeo
19:51
Returns iterator to one with equivalent key
user3010322
I check if it's already been inserted beforehand as well.
user3010322
using a .find()
well, look.
sscce.
come back when you have one.
user3010322
    if ( hint == funcs.end( ) ) {
	    throw "FUCK!";
    }
user3010322
@Xeo ^ No throws. :c
user3010322
19:51
@DeadMG Okay
Does anybody ever make an SSCCE that actually has the same behavior?
yes.
I think I'mma throw up.
ate too much candies.
Pro tip: Burn the candles. Don't eat them.
lol
@thecoshman I am one devious li'll smurf
user3010322
19:57
When I remove the call fx, it the stack no longer gets corrupted...
I'm telling you, sscce.
user3010322
I'm trying to get to the simple part.
Xeo
Xeo
small
not simple
user3010322
....
user3010322
It's no longer erroring...
user3010322
19:59
MSVC CAN EAT THE BIGGEST DICK IN THE WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOORLD
user3010322
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA‌​AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGH
user3010322
Okay, oaky you want to know what the error was?
user3010322
Are you ready for this?
bad reference to fx.
your asserts were upside down
user3010322
19:59
template <typename... Tn>
int operator () ( types<void>, types<Tn...>, lua_State* L ) {
	stack::pop_call( L, fx, t );
	return 0;
}

template <typename... Tn>
int operator () ( types<void>, types<Tn...>, lua_State* L ) {
	auto r = stack::pop_call( L, fx, t );
	return 0;
}

« first day (1143 days earlier)      last day (4031 days later) »