Wednesday 10. March 2010
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
22.11.2009 13:07

The jQuery UI sortable widget offers a great interface for listing and moving element around.

I have been working on a small project of mine and figured that the sortable widget could be a great feature. I then started to output the list and the element that should be draggable like this:

My HTML list

<ul id="sort1">
  <li>
    <div>box no 1</div>
  </li>
  <li>
    <div>box no 2</div>
  </li>
  <li>
    <div>box no 3</div>
  </li>
</ul>

My jQuery code to enable the sortable widget and for getting a serialized result when an element has been dragged around:

$(document).ready(function() {
    $("#sort1").sortable({
        opacity: 0.6,
        update: function(event, ui) {…
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
08.10.2009 23:20

I was doing some benchmarking and performance analyzing on servers running Wordpress and TYPO3 websites and the result was not than good actually. My setup could use quite a bit of website optimization to get the pages loaded faster.

So. How do one find extra performance, without buying new expensive hardware. One way could to experiment with caching options. The eAccelerator software is highly recommend for TYPO3 setup, so I did some testing with this and there was quite a bit of performance hidden here.

The installation was quite simple on my setup. I followed the installlation guide which was more or less a…

read on
08.10.2009 22:46

Have you ever had the need for inserting extra stylesheet or javascript files in your TYPO3 template? I am used to having a TemplaVoila setup, which has the nice feature of mapping part of the header as part of the template, but this is not really that flexible when using extension template and etc.

An easy way of controlling this, is to setup the javascript and css files from the template configuration. There are some different ways of doing this and I will demonstrate two of them here.

The template configuration examples should be self-explainable, so I will not comment them futher:

Javascript…

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
29.07.2009 22:43

When working with HTML Forms, it can in some situations improve the usability of the site, if the content of elements can change and reflect the options, that the visitor made in the previous fields.

The most common form element are input, checkbox, radio buttons, textarea and dropdown boxes and I will try to cover them all, even though the code might be the same or very much alike.

Input boxes

Fetching content is done with:

// fetching the value
$("#inputbox").val();

Try it:

Setting new content is done with:

// setting a new value
$("#inputbox").val("We have now changed the text");

Try…

read on
29.07.2009 13:07

If you are building a site, which should support more than one language, there are two ways of doing this. Okay, perhaps there are more than two, but I will only give two examples.

The two I will cover is:
1. Manually adding language page
2. Integrated TYPO3 language support

1. Manually adding language page

This I will only touch briefly, as the solution should be obvious when the layout is presented. It should be very easy. Just create a tree like this and manually do the linking:
Manually Language Setup
That’s it.

2. Integrated TYPO3 language support

This is quite different compared to the first setup. We will…

read on