Saturday, November 28, 2015

Here is a VB.NET port of existing C# library for accessing WordPress WooCommerce API (https://gist.github.com/jakobt/b7400463e90e16928f57).
From my testing experience, the C# library worked very well for API versions v1 and v2. However, in it's original form, it was unable to generate proper OAuth signature for WooCommerce API v3.

Also, I have decided to port it to VB.NET as I'm not aware of currently available VB.NET versions of WooCommerce API libs (at least , OAuth based ones). This version also includes a tiny modification which will enable easier debugging of possible authentication failures ( try / catch block which is able to fetch original error message from the server).

-Make sure your storeURL is exactly the same as the site URL in WordPress settings (for example, if you query link http://127.0.0.1/wp/wc-api, and your WP site settings are set to http://localhost, you will get authentication failures.)

Monday, November 23, 2015

If you are developing an Android library in Eclipse or Android Studio, and you are having problems using it in your Android application, please make sure that your library does not use local resource in its res/ folder. Those resources won't be exported to final lib(.jar), and your target application will miss them (by generating either ClassNotFound or similar Exception).
EDIT:
If you want to deploy resources with your library, you can use AAR format instead of JAR format.

If you're trying to monitor AJAX requests using Chrome Development tools, and nothing is showing up in your Network tab, make sure you have "Preserve log" option checked.
In case of any redirection, Chrome Development Tool will clear the request list, leaving you without any clue from where does data arrived.
Once you mark Preserve log as checked, clear the log and refresh the page. It should now show all actual requests to the web server(s).

Calling findViewById() on the Activity object will only work if the current Activity layout is set by setContentView. If you add a layout through some other means, then you need the View object of the layout and call findViewById() on it.

If you go with Unit Testing or TDD approach, and split the problem into tiny subproblems, then you are more likely to find a solution quickly.
In this case, it was a matter of context in which findViewById() was called.

Saturday, November 14, 2015

If you want to be able to extract each captured group as a separate Matcher group, then make sure you put greedines sysmbol INSIDE the bracket.
For example, this will be fetched correctly as a whole expression:
Pattern.compile("(\r|\n\|.)+?=(\r|\n|.)+?")
Matcher.group(0) will return whole fetched text.
However, Matcher.group(1) and Matcher.group(2) will return something like empty strings!
In order to properly obtain group 1 and 2, you should use this:
Pattern.compile("(\r|\n\|.+?)=(\r|\n|.+?)")
Now you will have it all : group 0 (all), group 1 and group 2!

Monday, November 9, 2015

I have planned to use Genymotion emulator VM to debug my Android application which is being developed in my VirtualBox hosted Ubuntu's Android Studio.
However, I had problems connecting my adb using adb connect IP. It always returned device offline status.

When I have tried from Windows (with latest version of adb), it worked ok.
Then, after upgrading my Linux adb to latest version, it worked ok from Linux as well.

So , in case you have status "Device offline" when issuing adb devices command, you should consider obtaining latest possible adb/sdk version!!!!

Now go to Edit mode (TAB) and select a face on this object. Click U to unwrap, and unwrap for any other face you want to texturize.

Export to .OBJ and loading using Assimp library should now work. Make sure you have normals correct and that they are included in the Export (CTRL N in edit mode switches normals, in case you have problems with lighting in OpenGL).

Recently, in an attempt to include excellent TwitterOAuth library to my Magento 1.9 lib folder, I have found a problem with array_map function in Util.php file (in TwitterOAuth\Util). The namespace used with that call must be modified to match the one used by Magento (usually empty).

Otherwise, error 32 is generated - "Couldn't authenticate".

Besides this little problem, library classes must be renamed to comply to Magento's autoloading rules (i.e. class Config should become Twitteroauh_Config, while being installed to lib/Twitteroauth/Config.php).