Thursday, July 31, 2014

Dex Loader Error - Generate Google App Engine Backend

There is an error occurred after generate Google App Engine Backend for an existing android project.

Unable to execute dex: Multiple dex files define Lcom/google/api/client/googleapis/extensions/android/accounts/GoogleAccountManager;

I took me hours to figure out what the problem was.

The problem was my app had already added these google jars for my existing coding and developement

C:\WorkSpace\myapp\libs\google-api-client-1.15.0-rc.jar
C:\WorkSpace\myapp\libs\google-api-client-android-1.15.0-rc.jar
C:\WorkSpace\myapp\libs\google-http-client-1.15.0-rc.jar
C:\WorkSpace\myapp\libs\google-http-client-android-1.15.0-rc.jar
C:\WorkSpace\myapp\libs\google-http-client-gson-1.15.0-rc.jar
C:\WorkSpace\myapp\libs\google-http-client-jackson-1.15.0-rc.jar
C:\WorkSpace\myapp\libs\google-http-client-jackson2-1.15.0-rc.jar
C:\WorkSpace\myapp\libs\google-oauth-client-1.15.0-rc.jar

But, the GPE kept adding these jars into my library

C:\WorkSpace\myapp\libs\google-api-client-1.18.0-rc.jar
C:\WorkSpace\myapp\libs\google-api-client-android-1.18.0-rc.jar
C:\WorkSpace\myapp\libs\google-http-client-1.18.0-rc.jar
C:\WorkSpace\myapp\libs\google-http-client-android-1.18.0-rc.jar
C:\WorkSpace\myapp\libs\google-http-client-gson-1.18.0-rc.jar
C:\WorkSpace\myapp\libs\google-http-client-jackson2-1.18.0-rc.jar
C:\WorkSpace\myapp\libs\google-http-client-jdo-1.18.0-rc.jar
C:\WorkSpace\myapp\libs\google-oauth-client-1.18.0-rc.jar

I removed conflicting jars by deleting those jars in version 1.15. Mission accomplished.





Tuesday, July 29, 2014

The use of ASP pages will be supported on Windows 8 for a minimum of 10 years from the Windows 8 release date.

Official announcement from Microsoft

http://support.microsoft.com/kb/2669020 

Active Server Pages (ASP) enables Web servers to dynamically generate Web pages and create interactive Web applications by using server-side scripting technology. The use of ASP pages with Internet Information Services (IIS) is currently supported on all supported versions of IIS.

The next major version of Internet Information Services (IIS) will be shipped as part of the Windows 8 operating system. The use of ASP pages will be supported on Windows 8 for a minimum of 10 years from the Windows 8 release date.

Monday, July 28, 2014

PMP (4th edition) mock exam

Here is a PMP mock exam questions generator based on the PMBOK guide 4th edition, with answers at the end of page)

Hope it is helpful to any one who would like or is going to take the exam. Good luck!

http://xcoder10.brinkster.net/pmp/default.asp

CodeReady

CodeReady is database client + ASP page generator written in Visual Basic in 2005.  I published the program to download.com at the end of 2006. I created a video for demonstrating function and features



https://www.youtube.com/watch?v=52BJn6INJ6Q

The program can still run on Windows 8.1, troublefree!

Download link: http://download.cnet.com/Code-Ready/3000-10254_4-10473550.html


Sunday, July 27, 2014

noclassdeffounderror, PhoneNumberUtil & Google App Engine

PhoneNumberUtil is not a supported class in GAE. Simply adding the jar into the jre/lib/ext will let you through the compilation, but you probably will get a java.lang.noclassdeffounderror after deployment.

The problem cannot be solved through Eclipse interface. What I do is to, first, copy the jar (mine one is libphonenumber-6.2.jar) to war\WEB-INF\lib, and then add the jar to build path in the project explorer.

This solution also works for other external jars.

To download PhoneNumberUtil, go to https://code.google.com/p/libphonenumber/.  

Mission accomplished!

Connecting Google Cloud SQL via mySQL ODBC database driver in Windows 8.1

There are 3 things you have to do in the "Access control" of the Cloud SQL instance
  1. Request an IP of the Cloud SQL instance. P.S. It costs you $0.01 per hour if there is an IP address assign to an idle instance
  2. Set a root password
  3. Provide IP address of the authorized network, usually it means to IP address of your workstation or server.

After that, get the ODBC database driver handy, you may download the driver via this link, your choice of 32/64bits


Next, configure the ODBC driver, enter the IP address provided by Google. You may test the connection by pressing the test button.


All things done, you are on.

I can even connect my Cloud SQL instance through my homebrew database client + ASP code generator created in early years.  You may still find my program published on download.com here. It works on 32bits driver only.


Tears coming out of my eyes

Calling GCM by using ASP classic

function sendToGCM(regIds, metaData)

'http://developer.android.com/google/gcm/http.html

Dim DataToSend

DataToSend = DataToSend & "registration_id=" & regids
DataToSend = DataToSend & "&collapse_key=location"
DataToSend = DataToSend & "&data.location=" & metaData

Dim key
key = "AdisfbsisP5MwE389fjnsidsslpx10fm2siusbi8bwc" 'Generated server key for the application

url = "https://android.googleapis.com/gcm/send"

set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
    xmlhttp.open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"
'Public API Server Key
xmlhttp.setRequestHeader "Authorization", "key=" & key
xmlhttp.send DataToSend
    returnString = xmlhttp.responseText
    set xmlhttp = nothing

sendToGCM = returnString

end function

Applying SMA10/20, SMA20/50 as trading signals

This is the comparison for results before and after applying SMA10/20 and SMA20/50 in the stock trader. Background Trading 3 stock ma...