Posts Tagged ‘header’

There are a number of ways to change the document header and footer styles in LaTeX. One of the easiest and most flexible options is to use the fancyhdr package. fancyhdr is a massive package with a crazy number of tweaks and modifications available for your document’s header and footer styles. This tutorial will only […]

301 Redirects in PHP

Posted: 9th July 2010 by Tim in PHP
Tags: , , , , , , , , , ,

If you have a web page which has been moved to another URL, or if the page has been completely removed, chances are people will have that address saved in their bookmarks, or they will try to access the page via a search engine and get a 404 – Page Not Found error. Not only […]

Standard LaTeX allows you to extract the current page number using the thepage command. That’s an easy one. To get the total number of pages (ie: number of the last page) is a little more involved. To do this, you need to use the \lastpage package and use \pageref{LastPage}. For example: \usepackage{lastpage} … You are […]

Millisecond timer in C / C++

Posted: 18th October 2009 by Tim in C, C++
Tags: , , , , , , , ,

If you’re looking for a timer with fairly good accuracy in C or C++, you can use the functions in time.h and sys/time.h to build a millisecond timer. This is useful for things like evaluating the execution time of a program, roughly accurate to the nearest microsecond. double get_time_ms() { struct timeval t; gettimeofday(&t, NULL); […]

Creating a 2 column layout in HTML / CSS

Posted: 1st October 2009 by Tim in CSS, HTML
Tags: , , , , , , , , ,

Standards-compliant layouts can be difficult to do. Below is an example of an HTML 4.01 Transitional / CSS 2.1 compliant two-column layout, with headers and footers. An example can be seen here. Note: WordPress destroys tabs and layout. See the source code in the example for more readable code. HTML <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML […]