Posts

Showing posts from 2012

HSQLDB: how to commit after update on disk

HSQLDB does not save the update into disk immediately. According to HyperSQL database documentation, The WRITE DELAY controls the frequency of file sync for the log file. When WRITE_DELAY is set to FALSE or 0, the sync takes place immediately at each COMMIT. WRITE DELAY TRUE performs the sync once every 0.5 seconds (which is the default). A numeric value can be specified instead. I have this sample Java code as my Unit Test case class which I actually made it using Spring Framework, package org.mystuff.com.repository; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests; import org.springframework.transaction.annotation.Transactional; import org.junit.Befo

Compiling ant with wsimport error: taskdef class com.sun.tools.ws.ant.WsImport cannot be found

I got this error encountered though it's just a simple fix, however, I wanted to take notes on the XML element when executing a wsimport tool. To fix this problem, just add <pathelement /> and point where does your jax-ws tool is located. See below, < taskdef name = "wsimport" classname = "com.sun.tools.ws.ant.WsImport" > < classpath > <pathelement location="${jwsdp.home}/lib2/jaxws-tools.jar"/> </ classpath > </ taskdef > where your ${jwsdp.home}  is setup as a property value, seen below.   <property environment="env"/>   <property name="jwsdp.home" value="${env.JWSDP_HOME}"/> That will be set in the top of your ant build.xml (or build file).

java: java.io.FileNotFoundException when executing in Eclipse

Image
I once tried to encounter this problem. So I have this setup as, . ├── CatTree.xml ├── CatTreeVersion.txt ├── GetCategories.java ├── README.txt ├── config.properties └── request.xml and part of GetCategories.java, I have a statement there executing config.load( new FileInputStream( configFileLocation )); However, I got this exception "  java.io.FileNotFoundException  " where my file wasn't found. I just realize that in Eclipse, when you run your code as "Run as Java Application", Eclipse, by default, will point to the workspace. To fix that, you can have these options: 1. Place your file in your workspace, but that's not the ideal part 2. Replace your "Run configuration" with the working directory where your file exist or belong. See below,

eBay API GetCategories error encountered

if you try to download and execute to test the code that eBay have created, and then encountered this problem below, SendRequest IO Error: java.io.IOException: Server returned HTTP response code: 400 for URL: https://api.sandbox.ebay.com/ws/api.dll java.io.IOException: Server returned HTTP response code: 400 for URL: https://api.sandbox.ebay.com/ws/api.dll at sun.net. www.protocol.http.HttpURLConnection.getInputStream (Unknown Source)ERROR - GetOnlineVersionNumber: java.lang.NullPointerException at sun.net. www.protocol.https.HttpsURLConnectionImpl.getInputStream (Unknown Source) at com.trivand.apps.esapp.api.GetCategories.SendRequest(GetCategories.java:462) at com.trivand.apps.esapp.api.GetCategories.getOnlineVersionNumber(GetCategories.java:349) at com.trivand.apps.esapp.api.GetCategories.checkCategoryTreeVersion(GetCategories.java:300) at com.trivand.apps.esapp.api.GetCategories.main(GetCategories.java:97) java.lang.NullPointerException at com.trivand.apps.esapp.api.GetCategorie

Compiling C code with CPPFLAGS with multiple directories

To define multiple includes in your CPPFLAGS, just do, CPPFLAGS="-I/usr/include -I/opt/local/include -I/usr/local/include" Clearly, put the path inside the "double quoted" flag value. This can be included like when you compile a package, let say for example, compiling with "configure", you can, $> ./configure --prefix=/usr/local $> make CPPFLAGS="-I/usr/include -I/opt/local/include -I/usr/local/include -I/usr/include/malloc" $> make install where it includes and specify a malloc header looks for /usr/include/malloc/malloc.h for example, so you'll just use the base directory, which is /usr/include/malloc.

Installing PHP OAuth library in Mac OS X

Check the current version of OAuth you wanted to install in http://pecl.php.net/package/oauth Then just copy the link and use wget, since I love wget. wget http://pecl.php.net/get/oauth-1.2.3.tgz where 1.2.3 is the current version as of this writing. Then decompress it by tar -xzvf oauth-1.2.3.tgz Now go into that directory where the source has been extracted and run, $> CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure if you encounter an error like this, .... auth.c  -fno-common -DPIC -o .libs/oauth.o In file included from /var/root/oauth-1.2.3/php_oauth.h:47,                  from /var/root/oauth-1.2.3/oauth.c:14: /usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory In file included from /var/root/oauth-1.2.3/php_oauth.h:47,                  from /var/root/oauth-1.2.3/oauth.c:14: /usr/include/php/ext/pcre/php_pcre.h:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token /u

LinkedIn API: How to get API keys and OAuth keys

Image
Currently, I am on researching and learning API's that are available in the net and one of this is LinkedIn. LinkedIn seemed a little bit confusing to me where I can get the API keys, which I am accustomed to a straightforward delivery of API keys in other sites that has API. To get your API's, you need to create and specify what kind of application you are going to create. Just go in this link, https://www.linkedin.com/secure/developer Then fill-out the required fields of the form. After you submit the form, you'll get the "Application Details", with the API keys and OAuth keys. See below

Facebook e-mail length limit

I have been testing this e-mail length on  how many characters does Facebook would allow and validate an e-mail. It came up that it allows me up to 74 characters where I input "sushmitamayfranciscaopsimarbangynamuagdavaocitymariasofianicolet@yahoo.com" is valid. More than that, it invalidates the e-mail. Anyway, the purpose of this blog is just to have an idea of "how much characters does huge development company do think an e-mail is a valid one?".

This is my first blog

It's a great feeling to publish stuffs that you know, and make it as your diary and even share stuffs that some people can also utilize it and find it helpful. See you on more of my postings! Enjoy! ;-)