MySQL - Stored Function - Custom Repeat Function With Placeholder

This MySQL stored function mimics the behavior of the built-in MySQL REPEAT function. However it, allows you to use a placeholder in the repeat string, which is replaced internally with the current repeat index. Read more »

Java - File Transfer Example 2

This code snippet demonstrates a simple console based file transfer. The server listens for incoming connections and can connect to multiple clients. On connecting to the server, the client sends the filesize and filename of the sending file to the server in two separate transmissions. On the third transmission, the client sends the file. The server is made aware of the filesize and the filename and proceeds to receive the file from the client. The filename is supplied as an argument when executing the client from the command-line. Read more »

Java - Simple Echo Server

This code snippet demonstrates a simple echo server. The Client sends the string "Hello World" to the server and the server echo's back the string to the client. Read more »

Java - A Simple Client Server Connection

This code snippet demonstrates a simple client/server connection. There is no communication between the client and the server. The purpose of this code is to demonstrate the connection at its simplest. Notice that the server accepts clients in an infinite loop so that it can accept multiple clients. Read more »

MySQL - Stored Function - Uppercase First Character In All Words

This MySQL stored function converts the first character in all words found in a sentence to uppercase. Read more »

MySQL - Stored Function - Uppercase First Character

This MySQL stored function can be used to change the first character in a string to uppercase much like PHP's ucfirst() function. Read more »

PHP - A Simple Dependency Injection Container

A simple lightweight dependency injection container for PHP. Read more »

C# - Client/Server Broadcast Example 1

This code snippet demonstrates how to broadcast messages to all connected clients. The server listens for incoming connections. Each connection is handled by a new thread. The server maintains a list of all connected clients in an array. When a client sends a message to the server, the thread responsible for that client then sends the message to all clients except for it's self. Run the server first then load multiple client instances. Read more »

C# - Client/Server File Transfer Example 1

This code snippet demonstrates how to transfer files from a client to a server. In this example, both the client and server are console applications and use the TcpClient/TcpListener classes. The client sends the filesize and filename to the server before sending the file. The server uses the filesize to determine how much data to expect from the client and uses the filename to save the file locally. Read more »

PHP - Introduction To PDO Part 1

PHP Data Objects (PDO) is a simple database abstraction extension that allows you to interact with databases. This tutorial introduces you to the PDO extension and provides sample code to help you get started. Read more »

PHP - Tokenizer Class

This class can tokenize a string into user defined tokens. Supply an array with all the tokens to capture. The parse() method will return all matched tokens with it's position and length. It can also capture strings in double quotes.
Read more »

MySQL - Table To CSV Procedure

This simple stored procedure can be used to export a table to a csv file. This procedure does not include csv headers. Read more »

Java - Control Flow Statements - The Switch Statement

This article continues on Control Flow Statements. We take a look at the Switch Statement with code examples. Read more »

PHP - Simple Template Engine Part 1

In this two part tutorial, I will explain how to develop your own template engine that uses a simple find and replace technique. In part 1, you will learn how to find and replace special tags known as placeholders with scalar values and in part 2, I will explain how to use simple objects as placeholders. Read more »

PHP - Simple Template Engine Part 2

In part 1, I explained how to develop a simple find and replace template engine which substituted placeholders in a template file with scalar values. In this tutorial, I will explain how to access object properties and array elements in the template. Read more »