Wednesday 10. March 2010

Archive for the ‘development’ Category

03.02.2010 00:25

Here is a quick guide on installing a development environment (using the Eclipse IDE) for Android applications on Ubuntu 9.10.

1. Open the Synaptic package manager and install the sun-java6-jdk and the eclipse package (and of-course accept the depending packages).

2. Verify that you have a working java enviroment by running java --version in a terminal.

3. Download the lasted version of the Android SDK at android.com (http://developer.android.com/sdk/index.html).

4. Unpack the SDK file to your home directory (or somewhere else – its your choice)

5. Open the newly installed Eclipse IDE.

6. In Eclipse goto the Help menu and select the Install New Software

7. Click Add and create a site with…

read on
24.10.2009 12:54

With jQuery it is quick and easy to access and modify elements in a select dropdown box. There are of course several ways of doing thing and I will try to cover most of them here.

Quicklinks:
The test setup
Get the selected value from the select / dropdown box
Set the selected value
Insert new options and values in the dropdown box
Removing an entry from the select box
Disable and enable options
The code

The test setup.

For the following examples I will use a dropdown / select box like this:

10 Apples
5 Oranges
12 Bananes

The HTML-code for the dropdown is where basic:

<select id="dropdown">
<option value="apples">10 Apples</option>
<option value="oranges">5 Oranges</option>…
read on
09.10.2009 19:45

With this guide I will try to go through the very basic techniques of making a simple php script that can handle login authorization of website users.

The guide will be based on common Linux installations of both MySQL and PHP.

Step 1 – the database

Create a table in your MySQL database with 2 fields, username and password. This could be done by running the following code in your MySQL shell or from phpMyAdmin or another interface:

CREATE TABLE `login` (
`username` TEXT NOT NULL ,
`password` TEXT NOT NULL
)

The database table called login is now created with 2 field named username and password.

Step…

read on
03.10.2009 11:27

Have you ever had the need to check if a specific coordinate (point) is located inside or outside a polygon shaped area? I never did, so I had to found out how to automate this process, so I didn’t have to do this by hand.

The problem with this kind of assignment is, that I did not know what to search for on Google. Hadn’t though of it, as being a point in a polygon shaped area. I tried searching with words like ‘coordinate inside area’, ‘longitude latititude in area” and things like that, without much luck. Then a guy…

read on
21.08.2009 22:28

During the development of a gallery extension for TYPO3, I was having some performance issues when during the on-the-fly image scaling.

When displaying the images in the frontend, I would scale the images to a size specified in the plugin configuration. I was using the following code:

...
$imageConf['file'] = $row[image];
$imageConf['file.']['maxH'] = $this->conf[largeMaxH];
$imageConf['file.']['maxW'] = $this->conf[largeMaxW];
$thumbnailImage = $this->cObj->IMG_RESOURCE($imageConf);
...

The $row[image] would contain the image file to be displayed and the maxH and maxW is being set to the image sizes from the plugin configuration. When loading the page every image would be resized to the correct size, but when…

read on
28.07.2009 12:10

If you want to reuse your jQuery code, it can be a good idea to make the code into a jQuery Plugin. This makes it easier to use on different elements or even to distribute it.

Demonstration:
I have made a small simple 1 level menu for this demonstration. If you hover you mouse on Menu 1 or Menu 3 you will see a submenu sliding down. Menu 2 has no submenu and will therefor display nothing.

How: The HTML
The HTML is pretty much a standard list like this:

<ul id="nav">
    <li><a href="#">Menu 1</a>
        <ul>…
read on
23.07.2009 23:10

The Wordpress Theme Kickstarter is now ready in the first beta release. It is a tool for doing the initial file splitting when creating a new Wordpress Theme.

More info here

read on
05.07.2009 15:38

When posting website code and features it is nice to have the option to add some specific examples for demonstration usage. In Wordpress I couldn’t find any options to easily add custom Javascript or CSS for a blog post or page update.

There is an option to add meta data to a page, but as I understand, this requires that you configure the template to know these names, before it can output it. I thought it would be easier, if you can have 2 fields in the advance options – one for Javascript and one for CSS, so I made…

read on
28.06.2009 22:55

Hit statistics from visiting website users stored in a database. Then what? How do I list these log entries in a very simple way. The only important thing for now, is when the visitor came by the site.

The database stores a timestamp and which page the user visited. This can mean a massive amount of data and I don’t know how this first attempt will perform. At the moment, there is a relative small amount of data, but in time this should build up and if the performance starts lacking, I will take a look at it again.

To output the…

read on
26.06.2009 22:38

There are many of these “insert your very-long-link here, and you will get a nice and short one in return”-webpages and the are all more or less the same.

I’m at the moment fiddeling with a Wordpress extension for one of these, which gives the option to automatically output a short-url to every single page, blog entry and so on, in Wordpress.

The extention will be released very soon – it just needs some final testing. I have however inserted my test-extension on this page, so there should be a “share on twitter”-feature somewhere on the page.

read on