Introduction to Java

Watch out! This tutorial is over 8 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

JAVA was developed by Sun Microsystems Inc in 1991, later acquired by Oracle Corporation. It was conceived by James Gosling and Patrick Naughton. It is a simple programming language.  Writing, compiling and debugging a program is easy in java.  It helps to create modular programs and reusable code and is ‘platform independent’.

Continue reading

Getting Started with the Computing Department WordPress Infrastructure

Watch out! This tutorial is over 8 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

The Department of Computing & Mathematics at DkIT has a very advanced WordPress Infrastructure for use by students in their class work and end of year projects.  We use a Viglen IX2300 (2 x Quad Core Xeon CPUs, 12 GB RAM, 2 x 146 GB SATA disks) for the primary web server, and two Viglen HX2220i units provide MySQL Database Replication, failover and load balancing services to the master web server. These servers are all powered by Debian Linux.

Also, traffic to the servers is cached at the college’s main reverse proxy server (regardless of source). The result is a very fast setup indeed!

Continue reading

Using the WordPress functions.php file

Watch out! This tutorial is over 8 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

functions.php or the theme functions file is a template used by WordPress themes. It acts like a plugin and gets automatically loaded in both admin and front-end pages of a WordPress site. Usually this file is used to define functions, classes, actions and filters to be used by other templates in the theme. It can be used to add features and extend the functionality of both the theme, and the WordPress installation.

Continue reading

Ruby Expressions

Watch out! This tutorial is over 8 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

This is the first in a series for beginners on the Ruby Programming Language. Note that Ruby is a programming language. Ruby on Rails (“RoR”) is a web-application framework that is implemented in Ruby. Do not confuse the two. We will not covering Ruby on Rails in these tutorials.

These tutorials will be gather together under the tag #RubyTuesday, as we will be posting one each week from today to the end of term.  Ready? Here we go

Continue reading

Hello World in Morse code on Raspberry Pi

Watch out! This tutorial is over 8 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

Somebody posted a tutorial on YouTube showing a LED blinking “hello world” in Morse code using a Raspberry Pi.  However, they only show the code executing, not how it was put together. They also don’t show the hardware setup 🙁

Continue reading

Port Scanner in Python

Watch out! This tutorial is over 8 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

This post will show how you can make a small and easy-to-use port scanner program written in Python. There are many ways of doing this with Python, but we’re going to do it using the built-in module Socket.

Do not run programs like this one against servers in the college. Behaviour like this could be seen as malicious and get you suspended!

Continue reading

Use Google’s Copy Of JQuery in WordPress

Watch out! This tutorial is over 8 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

Grabs jQuery from Google’s CDN which your visitors will hopefully have cached. This can then be called in your header with <?php wp_enqueue_script("jquery"); ?>

// Call the google CDN version of jQuery for the frontend
// Make sure you use this with wp_enqueue_script('jquery'); in your header
function itlc_jquery_enqueue() {
	wp_deregister_script('jquery');
	wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null);
	wp_enqueue_script('jquery');
}
if (!is_admin()) add_action("wp_enqueue_scripts", "itlc_jquery_enqueue", 11);

 

Hello World in Python

Watch out! This tutorial is over 8 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

This is how you would display “Hello World” in Python.

print("Hello, World!")

Android Hello World

Watch out! This tutorial is over 8 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

Before you start writing your first example using Android SDK, you have to make sure that you have set-up your Android development environment properly. We also assume that you have a little bit working knowledge with Android Studio from class.

So let us proceed to write a simple Android Application which will print “Hello World!”.

Continue reading

A “Hello, World” HTML document

Watch out! This tutorial is over 8 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.

You create a file and put special character sequences called HTML elements into your file. These elements identify the structural parts of your document. When a Web browser displays the file, it will display your file’s content, but not the characters that make up the structure.

Here is an example:

<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
   <HEAD>
      <TITLE>
         A Small Hello 
      </TITLE>
   </HEAD>
<BODY>
   <H1>Hi</H1>
   <P>This is very minimal "hello world" HTML document.</P> 
</BODY>
</HTML>

Only the elements that you place in the BODY element (that is, between <BODY> and </BODY> ) ever get displayed in a Web browser’s window.

In this example, only the contents of the H1 element (between <H1> and </H1> ) and the P element (between <P> and </P> ) are displayed.