Category Archives: Development

Simple internal phone list with php and mysql

Here is a simple piece of PHP code to create a internal phone list.  It has no styles applied to it so you can integrate it to your own site.  I used MySQL for the database.  You need to create a database called telephone and create a table in that database called employee.  You can also modify the db.php file if you wish to use another name.  The following sql will create the database for you.

CREATE DATABASE telephone;
USE telephone;
CREATE TABLE `employees` (
 `number` varchar(10) NOT NULL,
 `name` varchar(50) NOT NULL,
 `department` varchar(50) NOT NULL,
 `extension` varchar(10) NOT NULL,
 PRIMARY KEY (`number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `employees` (`number`, `name`, `department`, `extension`) VALUES
('1', 'Frank', 'Finance', '200'),
('2', 'Joe', 'HR', '201');

Continue reading

Redirect users with mobile devices

English: Sharp Smartphone Android IS03 日本語: シャ...

There are a couple of different methods to re-direct users using mobile devices such as iPhones and Android phones to your mobile website.  One of the easiest way though is to add a simple bit of javascript to to the <HEAD> section of your web page.

This snippet of code will redirect the user to a different page based on their screen size.

Continue reading

developing an android app

English: Android Robot. Français : le logo d'a...

Image via Wikipedia

I find the easiest way to learn to develop for a new system or learn a new programming language is to actually create a complete application.  It is even better if there is an actual use for this application because it forces you to complete the whole process from analysis to deployment.  For my android application I wanted to try and learn as many features as possible including using a  database, creating a background service, and using GPS.  Of course not being a java programmer it was going to be a steep learning curve anyway. Continue reading

Switching from VB.Net to C#.Net

C Sharp (programming language)

I am finally making the switch from VB.Net to C#.Net a move that is long overdue.  I have never felt the need to switch because VB.Net did everything I needed, and was easy and fast to develop with.  This is especially useful when developing prototypes.  Most experienced .Net developers appear to use C#.Net and I am also working on some Android projects in Java which has a similar feel.  So now felt like the right time to make this decision.

Continue reading

Android SDK, Java SE Development Kit not found

When installing the android sdk you may get an error stating that the Java development kit could not be found.  If you get this error and you have the JDK installed just click the back button and click next again.  The JDK will be found this time.  It appears there is a bug in the installer.

Visual Studio default browser

When debugging web applications in Visual Studio the default browser is used. With Internet Explorer as the default browser when you close the browser the application stops running or if you stop the application the browser window closes. If you use Firefox, Chrome, or any of the other popular browsers there isn’t this level of tight integration. To keep one of these browsers as you default but use Internet Explorer for debugging is very easy.

Continue reading

Removing leading zeros from a text field

I am using MS Access currently because it allows quick prototyping of database applications.  You can easily link tables to SQL databases and generate reports and queries.  One issue I had lately was a text field containing a number with leading zeros.  After writing a loop to remove the zeros I discovered this simple way of achieving the desired result.

Continue reading

Updating sub forms in MS Access

I had a request to do a simple update to a MS Access subform which should be easy enough but it can be tricky for new users to VBA to get the syntax correct.  The subform needed to be refreshed to ensure it has the current records, and then the number of records to be put on the label for the subform.  Here is my solution –

Form.frmSubForm.Form.Requery
Me.frmSubForm_Label.Caption = Me.frmSubForm.Form.RecordsetClone.RecordCount & " Records"