Error “Cast from pointer to smaller type ‘int’ loses information” in EAGLView.mm when update Xcode to 5.1 (5B130a)

Apparently the clang version in Xcode 5.1 and above is more strict about potential 32bit vs. 64 bit incompatibilities in source code than older clang versions have been. To be honest, I think, clang is too restrictive here. A sane compiler may throw a warning on lines like this but by no way it should … Read more

Getting the dimensions of the soft keyboard

We did it with this myLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { Rect r = new Rect(); parent.getWindowVisibleDisplayFrame(r); int screenHeight = parent.getRootView().getHeight(); int heightDifference = screenHeight – (r.bottom – r.top); Log.d(“Keyboard Size”, “Size: ” + heightDifference); } }); We only resize views with the keyboard, so we could use this.

VS 2015 compiling cocos2d-x 3.3 error “fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration”

Until now, Many libraries & programs used snprintf() function by defining it as _snprintf(), since _snprintf() was supported. #define snprintf _snprintf Finally, Visual Studio 14 defines snprintf()! Since, snprintf() is now officially supported. We should never #define it. Doing it will overshadow new snprintf() function defined in stdio.h. To restrict that, this is added in … Read more

What does “[ this ]” mean in C++

What does [this] means? It introduces a lambda – a callable function object. Putting this in the brackets means that the lambda captures this, so that members of this object are available within it. Lambdas can also capture local variables, by value or reference, as described in the linked page. The lambda has an overload … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)