I am working with PHP and FPDF to generate a PDF invoice. The designers have created a couple of very helpful documents, there are three total. The first is a mockup of the invoice. The second shows fonts, font sizes, and font colors. The last document show the positioning of all elements on the invoice. My only problem, is that the document was made with pixels at a resolution of 300 DPI rather than in millimeters. Anyone that is familiar with FPDF will know that PDF’s created with FPDF can not be generated with pixels in mind. PDF documents in FPDF can only use point (pt), millimeteres (mm), centimeters (cm), or inches (in). (more…)
Archive for the ‘Uncategorized’ Category
I needed to get one of my servers to respond to another IP Address. I have mostly used Linux and not FreeBSD. Linux is quite easy, but I have never done anything like this on FreeBSD, so here is how I got it work properly. (more…)
One of my recent projects required that I round the price I was calculating to the nearest half dollar. This started out at a pain. Rounding to the floor, or to the ceiling, or normal rounding is quite easy. But I have never had to round to the nearest half dollar. (or quarter dollar) After a little bit of time thinking about it, I came up with a solution. (more…)
During my server migration, I decided that I was going to switch from five or six random Linux distributions to using a single operating system. My place of employment seems to have a fondness for FreeBSD so I decided to give it a whirl. Although very similar to the several Linux distributions I use, FreeBSD has some differences. First installing software, I have finally gotten accustom to apt-get on the Debian based distributions I use as well as YUM (Which is on the RedHat Linux variants) because FreeBSD uses an entirely different package management system I had to learn something new. (Which is always a good thing)
FreeBSD uses two different methods. I am going to focus on the Ports collection since this way seems to be the most flexible, I must warn you though, compiling everything can become a pain in the neck if you have a slow machine. Fortunately for me, all of the servers I am using in the Server Migration are new and quite fast.
The Ports collection is relatively easy to use. Simply go into the ports collection.
server# cd /usr/ports
Now you will need to find the package you want to install (I will forgo the instructions on how to do this, as I am assuming that you know how to do that already.) In my case I started with MySQL 5
server# cd databases/mysql50-server
server# make install clean
server# chown -R mysql:mysql /var/db/mysql
server# /usr/local/bin/mysqld_safe -user=mysql&
server# mysqladmin -u root password <password>
server# vi /etc/rc.conf
Now you will need to tell the server to automatically start the MySQL daemon when the computer restarts. Add the following line to your rc.conf file (Which you will be editing if you have followed the previous steps.)
There you go, as long as no error messages show up, your MySQL 5.0 server will be running and will be usable.
Right vs. Left that is how it has always been, Republicans vote against anything the Democrats want. Democrats vote against anything the Republicans want. For our own good this dangerous trend must end! (more…)
From time to time, when programming with MySQL, I have needed to change the auto_increment value to something other than the default (Typically it starts counting with 1 and goes up from there). To change this, simply use the following command:
mysql> ALTER tablename AUTO_INCREMENT=new_number
There you go, it is that easy to change the auto increment value for MySQL.
NOTE: I have discovered that MySQL will not allow you to set the auto_increment value to a number smaller that what is currently set. The data must be truncated and then set to get it to work properly.
“The house always wins.” or so everyone says. But in this case, everyone is wrong. The Caesar in Indiana had a big problem where the players took the house. This story at Yahoo, “Is winning on a faulty slot machine [a] crime?” talks about this. I have found it interesting that all of a sudden when the house starts to loose, then they go after everyone that has won. (more…)
In response to the many topics on which I have opinions on, I have decided to begin this blog. Its goal is to provide the world with my point of view. This will allow the world to know my views, and to understand how I think.
Please return often and comment on my views. I love to hear about the way others think on these topics.