How to add SQLite framework into Xcode 4 for your iOS app

I’ve recently started some development of some iOS apps. And I wanted to build a small app that makes use of SQLite to store some data and I use Xcode 4 instead of Xcode 3.x as my IDE for developing my iOS apps. If you google around looking for how to use sqlite for your iOS app, you’ll get lots of solutions on the Xcode 3.x telling you to have to add the SQLite Framework by right clicking on the Frameworks under your project then “Add Existing Frameworks”.

Continue reading ‘How to add SQLite framework into Xcode 4 for your iOS app’

Flash z-index fix by setting wmode to transparent

You should have experienced that a div is being partially or completely covered by a Flash object or Flash movie. No matter how you specifically set the z-index of your DIV to be higher than the Flash movie, it’ll not work on your browsers.

Continue reading ‘Flash z-index fix by setting wmode to transparent’

How to generate PDF from XHTML or XML source using a Java Applet

Here is an example on how to use a Java Applet to generate a PDF from XHTML or XML source. The main advantage of using an Applet to generate from XHTML or XML source is XHTML/XML source can be gzip compressed from the source web server which reduces very much its size to be transferred over a slow network connection and is speedier, while compared to an actual PDF file that’s transferred over the same network.

Continue reading ‘How to generate PDF from XHTML or XML source using a Java Applet’

Create a pop-up lightbox upon body onload

This is an example that shows a lightbox effect upon the body onLoad event. There are three JavaScript functions here which you can call to show the lightbox, which are pop_up_light_box(), pop_up_light_box_with_delay(secs) and pop_up_light_box_for_ie_only(secs). As their names imply, the first one shows a lightbox effect, second one shows a lightbox effect with specified number of seconds of delay; while the 3rd one shows a lightbox for IE browser only.

Continue reading ‘Create a pop-up lightbox upon body onload’

Use HTML5 Canvas to draw and manipulate images

One of the goodies in HTML5 is it allows you to use the <canvas></canvas> tag pair to draw or manipulate images on it. But not all browsers support the HTML5 Canvas. To have a canvas displayed on your browser, you can simply have the following HTML code.

Continue reading ‘Use HTML5 Canvas to draw and manipulate images’

HTML5 allows you to store data on your local web browser

If you remember Google Gears, there was a feature (Local Database API) allowing to store data on your local web browser. But since HTML5 has emerged into supporting such a feature, Google has decided to retire its Google Gears.

Continue reading ‘HTML5 allows you to store data on your local web browser’

IP to country converter – using MaxMind GeoIP API

We’ve covered the HostIP.info API for converting the IP address to a country and city of your visitor. But you may have noticed sometime HostIP.info does not convert everything and might have comparatively lower accuracy. But if you want better accuracy, HostIP.info also recommends you to get a commercial version such as MaxMind

Continue reading ‘IP to country converter – using MaxMind GeoIP API’

How to get the country of an IP address in PHP?

The HostIP.info provides API allows you to get the country including the city as well. The simple PHP script that can get the country is as follow:

Continue reading ‘How to get the country of an IP address in PHP?’

How to print web page without prompt using JavaScript on Firefox

To print a web or HTML page without getting the usual printer prompt on your Firefox browser, you can make use of the Firefox plugin, JS Print Setup. Installation like usual installation of any Firefox plugins.

Continue reading ‘How to print web page without prompt using JavaScript on Firefox’

PHP How-to: HTTP POST without using cURL

You wanna call a remote web service using HTTP POST in your PHP, but you do not wanna use cURL as cURL might not be supported in your web host. The following codes explain how you can do it without using cURL.

Continue reading ‘PHP How-to: HTTP POST without using cURL’