Night & Day Detection

If we assume that people’s interests vary according to the time of day, your website might be well served by promoting different kinds of content depending on whether its day or night. For example lets say we have two articles, one about the sun eventually burning out, and one about the Hale-Bopp comet. We can […]

Make Life Easier With Custom Photoshop Actions

Once you start working with Photoshop for some time you’ll find that your projects require many of the same, repetitive, actions and tasks. By creating custom actions for your more routine tasks, you’ll have more time to focus on your image. Creating a custom action is relatively easy, so in this tutorial I am going […]

Square CSS Badges

[frame align=”left”][/frame]I was playing around with CSS earlier today and came up with something rather interesting, I call them CSS badges since I’m really not sure what else to call them.The code behind these buttons is actually extremely simple and I have commented it along the way so you could easily see what controls what. […]

Programming In C: Functions with Viewer Choice

Using a Conditional inside a User-Defined Function If you want to give the viewer a choice of options, this can be handled either inside a user-defined function, or in the main( ) function. Let’s begin by handling viewer choice inside a user-defined function. In this example, a customer chooses how many books to order. The […]

Programming In C: Built In & User Defined Functions

There are several different types of functions in C. So far, we have used one type of function – the built-in C functions, like printf( ) and scanf( ). These functions are part of the C programming language. Another type is called a user-defined function. This is a function which the programmer creates and uses in a […]

Programming In C: Character Type Library Functions

Character Type Header File If you need to check what type of character the viewer typed, use ctype.h which is the character type header file. We write it like this: #include<ctype.h> Here is a list of character type library functions: isalpha  checks if the input is an alphabetical letter  isdigit  checks if the input is a number  […]

Programming In C: More Library Functions – strcmp, stricmp, strcat, strstr

strcmp: compare two strings You can compare the characters and spaces in a string using the strcmp function. For example, is “William Lambton” the same as “William Lamberton”? Using strcmp, the computer will compare each character and space, to see if they are identical. If the names are the same, the computer will return a value of […]

Programming In C: Library Functions for Strings – strcpy, strlen

C Library Functions for Strings C comes with libraries of special functions, that we can use in our programs. These functions are stored in the string header file, <string.h>, which we include at the beginning of our program: #include<string.h> Here is a list of string library functions: strcpy copies a string strlen calculates the length […]

Programming In C: Declaring Strings & Gets and Puts Functions

Declaring (Initializing) Strings As we learned in the lesson on Characters and Strings, a string is a character variable with more than one character. Strings can be abbreviations, words, phrases, sentences, or even paragraphs. To declare a string, use the char variable type, then specify how many characters are in the string. Add one to this number, because […]

Programming In C: Using a Pointer to Change the Value of a Variable

Declaring (Initializing) Pointers As we learned in the previous lesson, a pointer contains the address of a variable. Different types of variables have different types of pointers. For example, an integer variable will have an integer pointer; a float variable will have a float pointer. Pointers can be variables too. You can declare a pointer at […]

Programming in C: Information Storage, Variable Addresses and Viewer Input

Information Storage We know that computers store information in memory. Each byte of information has a specific location in the memory area. This location is called the address. Whenever you use a variable, the value of the variable is stored in a specific address. This is why we used the ampersand & with the scanf […]

Programming In C: Counting Array Elements & Sizes

Size of an Array How much space in memory does an array occupy? We can calculate this by using a special operator: sizeof. This operator calculates how many bytes of memory are occupied by an array. For example, here is an array: numbers[3] = { 8, 29, 63 }; Using sizeof, I can write: printf(“The numbers array […]