Archive for the ‘Programming’ Category

How to convert from pixels to millimeters

Wednesday, July 2nd, 2008

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…)

Rounding to the nearest half dollor (or quarter dollar)

Wednesday, June 18th, 2008

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…)

C# Image Server Client (Using XML for the application protocol)

Thursday, June 5th, 2008

Our assignment in class this week was to create a network based client that would connect to the teachers Image Server and make requests via XML for information such as getting a category list, getting and image list, and ultimately, getting the image itself. There were a few different things that needed to be handled to make this work properly. Granted, this isn’t the best code in the word, since the summer semester is so short, but it does work. For it to run properly, you have to be connected to the VPN at UVU. (more…)

C# Database Connection Example Program

Thursday, May 29th, 2008

We were given a programming assignment in my network programming class that is defined as below. This is my solution to the assignment. I know it isn’t the best code in the world, but it works and will hopefully help someone else who is in need of knowing how to connect to a MSQL database using C#.

Write a program that will connect to the Image Database, list the categories from the category table then when the user selects a category in the list, show the name of all images in that category in another list box. To access the database, you will need to be logged into CSEVPN. (more…)

Multicast Network Chat in C#

Wednesday, May 21st, 2008

In my network programming class CS3670 at UVU (UVSC) we had an assignment to write a multicast chat program that would allow everyone in the class talk in the same chat window. This was used to show that we were able to use the multicast addresses and to also demonstrate our use of the UDP client libraries. Here is my solution: (more…)

C# (C Sharp) Console and Input Program

Tuesday, May 20th, 2008

Well, I’ve started a network development class at UVU (UVSC) and I have to quickly learn C Sharp to be able to get my assignments and labs done. Here is my version of the first lab (which is a simple hello world style lab) (more…)

Microsoft AlphaImageLoader crashing IE 6

Tuesday, May 20th, 2008

I’ve been developing a website for a local group that supports the arts (www.scera.org). The client called my place of work and mentioned that some of their users were having difficulties with IE 6 locking up. After spending several hours on the issue, I discovered that Microsoft has a bug, that causes the filter to no work properly when the images are preloaded. So to fix this issue I had to do the following: (more…)

EVEN-EVEN Simulation

Tuesday, January 22nd, 2008

Simulate the EVEN-EVEN automaton found in the book in code. Don’t just “solve the problem”—implement the machine (i.e., there should be evidence of the states and transitions in your code). Input at least the strings below. The output should echo the string in quotes and indicate whether it is in the language EVEN-EVEN or not.

a, abab, aabbab, baab, <the empty string>
(more…)

CakePHP: Gift from Heaven, or from Hell?

Tuesday, January 15th, 2008

My development activies have called on my skill and talent to quickly and efficiently learn new things. So it is with CakePHP, at work we have several projects that need to be completed quickly with out much hassle, after looking at several different options, we decided to use the CakePHP libraries. I quickly discovered that CakePHP has some awesome features that allow me to quickly and easily built website from scratch.

(more…)

Makefiles made easy

Thursday, December 6th, 2007

Makefiles are quite simple and easy to use once you have learned the basics. I always felt that they were daunting due to the sheer size of most open source project make files. So I decided to start small, and work my way up. So, to help you get started with them I will start with the basics. (more…)


Switch to our mobile site