Tuesday, October 4, 2011

When will GitHub change its pricing?

Today Bitbucket supports git.

Not very surprising since git is amazingly awesome (well, with a few exceptions like this but sh!t happens). I use git in almost everything that involves code, and there are a lot of areas where I do. The problem is I don't want my repo to be shared, but I really want them to be stored safely on the cloud (ehem). But GitHub doesn't support private repo until we pay for it. And with their cheapest plan, GitHub only allows 5 private repos and 1 collaborator. That sucks! Yeah, I paid for GitHub but mostly because I need to share my repo with my friend. I hope GitHub will adapt itself soon and start supporting private repos for free of charge. That would be great...

Btw, you should check out one of my repo in GitHub. It's quite interesting ;) GitHub or read it here.

Sunday, October 2, 2011

Stupid BOOL return value between Win 32 (unmanaged) DLL and .NET managed application

If you are developing a C# application and you have to call a function inside a Win 32 DLL which returns a BOOL value. You will encounter an unusual problem. Like when your application works in Debug mode but dies hard in Release mode.

For example you have something like this in C++ (the unmanaged DLL)

extern "C" __cdecl bool DoWork();

Very normal stuff, eh? And you think you can do this in C#

            EntryPoint = DllConstants.ENTRY_POINT_DO_WORK,
            CallingConvention = CallingConvention.Cdecl
        private static extern bool DoWorkCpp();

Noooo, DO NOT DO IT! You know why? Because in C++, bool value is stored in 1 byte but in C# (and in ANSI C), bool is 4 bytes. You have to marshal manually using [returnMarshalAs(UnmanagedType.I1)], and it will work. Hope this helps many out there. Peace out!

Saturday, October 1, 2011

YAFB has been updated to use Facebook OAuth 2.0

Facebook requires every site to switch to OAuth 2.0 and no later than October. I have updated my most appreciated masterpiece. Current version is 5.0.4b, download is available here.

The add-on is rewritten completely (hell, the old structure is a mess, hahah). Actually I don't plan to update this anymore but the guy from Zynga contacted me a week ago and asked if I can help him move the Zynga forums to OAuth 2.0. He contacted me a few times before and I offered to lend him a helping hand and it was a pleasure assist him and Zynga's community. I always try my best and on this occasion the outcome was great. You can now head over to http://forums.zynga.com/ and click the Connect to Facebook link, I hope it works for everyone out there.