<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DallinJones.com &#187; Uncategorized</title>
	<atom:link href="http://www.dallinjones.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dallinjones.com</link>
	<description>One more geek in the world.</description>
	<lastBuildDate>Fri, 09 Apr 2010 17:02:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to convert from pixels to millimeters</title>
		<link>http://www.dallinjones.com/2008/07/how-to-convert-from-pixels-to-millimeters/</link>
		<comments>http://www.dallinjones.com/2008/07/how-to-convert-from-pixels-to-millimeters/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 13:47:46 +0000</pubDate>
		<dc:creator>SlipStream</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.dallinjones.com/2008/07/02/how-to-convert-from-pixels-to-millimeters/</guid>
		<description><![CDATA[ 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 [...]]]></description>
			<content:encoded><![CDATA[<p> 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&#8217;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).<span id="more-65"></span>So I needed to come up with a way to convert things to what I needed them to be. Here is the solution I came up with. First, we need to discuss the conversion factors. My document had a DPI of 300, DPI stands for Dots Per Inch. This means that in every in there are 300 pixels. But we aren&#8217;t using inches for measurements on the document, we are using millimeters. Well, there are 25.4 millimeters in an inch. So, how do we go all the way from pixels to millimeters. Simple.</p>
<p>In chemistry, we studied something called dimensional analysis. Dimensional analysis is a method for converting from one unit to another. So first off we multiply the number of pixels by 1 over our DPI (in this case 300 DPI) then we multiply that by 25.4 by one inch (number of millimeters in an inch) Once everything cancels out we are left with a fairly nice, simple and easy to use formula.<br />
<code>mm = (pixels * 25.4) / dpi</code><br />
In order to convert back from millimeters to pixels we simply reverse the formula using simple algebra.<br />
<code>pixels = (mm * dpi) / 25.4</code><br />
There you have it. A very simple way to convert from pixels to millimeters. And then from millimeters back to pixels.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dallinjones.com/2008/07/how-to-convert-from-pixels-to-millimeters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Two IP Address on a single network card on FreeBSD</title>
		<link>http://www.dallinjones.com/2008/06/two-ip-address-on-a-single-network-card-on-freebsd/</link>
		<comments>http://www.dallinjones.com/2008/06/two-ip-address-on-a-single-network-card-on-freebsd/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 15:10:42 +0000</pubDate>
		<dc:creator>SlipStream</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.dallinjones.com/2008/06/30/two-ip-address-on-a-single-network-card-on-freebsd/</guid>
		<description><![CDATA[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.
First of all you need to figure out what your IP [...]]]></description>
			<content:encoded><![CDATA[<p>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.<span id="more-64"></span></p>
<p>First of all you need to figure out what your IP Addresses are. If you are using private address (ie. 192.168.1.0/16, 10.0.0.0/8, etc) you can pretty much use whatever you want. If you are like me and have statically assigned IP addreses that are world viewable, then you will need to plan this out a little more. In my instance, I have a block of 16 address. They are 209.90.112.16 thru 209.90.112.31. I have already assigned my webserver to be 209.90.112.22, 209.90.112.23 is assigned to another server so I wanted to assign 209.90.112.24 as the secondary IP address.</p>
<p>To do this, it is quite simple, simply login as root to the server, you will need to edid the /etc/rc.conf file using your favorite editor. I personally use vim (or vi depending on which machine I am using) so we enter:</p>
<p><code><br />
vi /etc/rc.conf<br />
</code></p>
<p>This command gets us into the file and allows us to make changes to it. The next thing that you will need to do is find the line that is similar to <em>ifconfig_em0=&#8221;inet 209.90.112.22 netmask 255.255.255.240&#8243;</em> this line will differ on each machine simply because not all machines have the same ethernet cards and the IP subnet mask. Below this line you will need to add the following line:</p>
<p><code><br />
ifconfig_em0_alias0="209.90.112.24 netmask 255.255.255.255"<br />
</code></p>
<p>This tells the networking system on FreeBSD to add a secondary IP address to the network interface. The subnet mask <strong>MUST</strong> mask out everything. Why? Well, in order for there to not be any conflicts between the two IP addresses one of them needs to only reference the single address. (this is because they are on the same subnet) This can turn into a big mess, so trust me, you need it this way.</p>
<p>Now, save your work on the file. (<em>:wq</em> if you are using vi or vim) Finally you are ready to restart the networking and routing systems to allow the IP address to actually function. We can do this by using the following command:</p>
<p><code><br />
/etc/rc.d/netif restart &amp;&amp; /etc/rc.d/routing restart<br />
</code></p>
<p>This forces the network interface to restart and pickup the additional IP address, it also restarts the local routing service, so that the system knows how to send packets out onto the network.</p>
<p>Now you can run the <em>ifconfig</em> command. You should get something that looks like the following:</p>
<p><code><br />
sirius# <strong>ifconfig</strong><br />
em0: flags=8843<up,broadcast,running,simplex,multicast> metric 0 mtu 1500<br />
options=19b<rxcsum,txcsum,vlan_mtu,vlan_hwtagging,vlan_hwcsum,tso4><br />
ether 00:30:48:93:11:11<br />
inet 209.90.112.22 netmask 0xfffffff0 broadcast 209.90.112.31<br />
inet 209.90.112.24 netmask 0xffffffff broadcast 209.90.112.24<br />
media: Ethernet autoselect (100baseTX <full-duplex>)<br />
status: active<br />
lo0: flags=8049<up,loopback,running,multicast> metric 0 mtu 16384<br />
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2<br />
inet6 ::1 prefixlen 128<br />
inet 127.0.0.1 netmask 0xff000000<br />
</up,loopback,running,multicast></full-duplex></rxcsum,txcsum,vlan_mtu,vlan_hwtagging,vlan_hwcsum,tso4></up,broadcast,running,simplex,multicast></code></p>
<p>One thing to be careful about though, FreeBSD starts at zero and counts up, so you can add as many as you want, be remember that if you skip a number, any of the aliases above that will be ignored. Also make sure that you are careful and don&#8217;t put in the wrong information or the wrong interface, this will cause the networking to stop functioning. If this happens, and you machine is on the other side of the world in some datacenter, you will be in big trouble because the networking won&#8217;t return.</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dallinjones.com/2008/06/two-ip-address-on-a-single-network-card-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rounding to the nearest half dollor (or quarter dollar)</title>
		<link>http://www.dallinjones.com/2008/06/rounding-to-the-nearest-half-dollor-or-quarter-dollar/</link>
		<comments>http://www.dallinjones.com/2008/06/rounding-to-the-nearest-half-dollor-or-quarter-dollar/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 14:35:09 +0000</pubDate>
		<dc:creator>SlipStream</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://www.dallinjones.com/2008/06/18/rounding-to-the-nearest-half-dollor-or-quarter-dollar/</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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.<span id="more-63"></span>I first thought about the algorithm needed to round to the floor or to the ceiling. This was easy, since the project is a PHP project, I simply had to use the rounding functions. Rounding to the nearest half dollar was harder because we had to come up with a way to round evenly. So here is the algorithm I used:</p>
<p><code>$rounded = round(($initial_value / .5), 0) * .5</code></p>
<p>There you have it. A very simple (and quick way) of rounding to the nearest half dollar. To be able to round to the nearest quarter dollar, tenth of a dollar or anything else you feel like rounding to, simply change the .5 to .25 (for quarter dollar) or .1 (for tenth of a dollar) depending on what is needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dallinjones.com/2008/06/rounding-to-the-nearest-half-dollor-or-quarter-dollar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting MySQL to run on FreeBSD 7.0</title>
		<link>http://www.dallinjones.com/2008/04/getting-mysql-to-run-on-freebsd-70/</link>
		<comments>http://www.dallinjones.com/2008/04/getting-mysql-to-run-on-freebsd-70/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 23:43:51 +0000</pubDate>
		<dc:creator>SlipStream</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Server Maintenance]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.dallinjones.com/2008/04/10/getting-mysql-to-run-on-freebsd-70/</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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)</p>
<p>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.</p>
<p>The Ports collection is relatively easy to use. Simply go into the ports collection.</p>
<p><code><br />
<strong>server# </strong><em>cd /usr/ports</em><br />
</code><br />
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<br />
<code><br />
<strong>server# </strong><em>cd databases/mysql50-server</em><br />
<strong>server# </strong><em>make install clean</em><br />
<strong>server# </strong><em>mysql_install_db</em><br />
<strong>server# </strong><em>chown -R mysql:mysql /var/db/mysql</em><br />
<strong>server# </strong><em>/usr/local/bin/mysqld_safe -user=mysql&amp;</em><br />
<strong>server# </strong><em>mysqladmin -u root password &lt;password&gt;</em><br />
<strong>server# </strong><em>vi /etc/rc.conf</em></code></p>
<p>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.)</p>
<p><em>mysql_enable=&#8221;yes&#8221;</em></p>
<p>There you go, as long as no error messages show up, your MySQL 5.0 server will be running and will be usable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dallinjones.com/2008/04/getting-mysql-to-run-on-freebsd-70/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Political Madness</title>
		<link>http://www.dallinjones.com/2007/12/political-madness/</link>
		<comments>http://www.dallinjones.com/2007/12/political-madness/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 04:56:28 +0000</pubDate>
		<dc:creator>SlipStream</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.dallinjones.com/2007/12/06/political-madness/</guid>
		<description><![CDATA[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!Our politicians need to start doing what is right, not what keeps them in office. Sure, there are some things about President Bush [...]]]></description>
			<content:encoded><![CDATA[<p>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!<span id="more-35"></span>Our politicians need to start doing what is right, not what keeps them in office. Sure, there are some things about President Bush that I don&#8217;t like, but at least he is trying to do the right thing. Several politicians seem to switch back and forth between sides faster than my microwave can heat up my hot chocolate. STOP following the polls and start doing what is right for the good people of this nation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dallinjones.com/2007/12/political-madness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing auto_increment on MySQL</title>
		<link>http://www.dallinjones.com/2007/12/changing-auto_increment-on-mysql/</link>
		<comments>http://www.dallinjones.com/2007/12/changing-auto_increment-on-mysql/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 19:09:55 +0000</pubDate>
		<dc:creator>SlipStream</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.dallinjones.com/2007/12/06/changing-auto_increment-on-mysql/</guid>
		<description><![CDATA[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&#62; ALTER tablename AUTO_INCREMENT=new_number
There you go, it is that easy to change the auto increment [...]]]></description>
			<content:encoded><![CDATA[<p>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:</p>
<p><em>mysql&gt; ALTER tablename AUTO_INCREMENT=new_number</em></p>
<p>There you go, it is that easy to change the auto increment value for MySQL.</p>
<p>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.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dallinjones.com/2007/12/changing-auto_increment-on-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Against all odds</title>
		<link>http://www.dallinjones.com/2007/07/against-all-odds/</link>
		<comments>http://www.dallinjones.com/2007/07/against-all-odds/#comments</comments>
		<pubDate>Sat, 21 Jul 2007 04:15:05 +0000</pubDate>
		<dc:creator>SlipStream</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.dallinjones.com/2007/07/20/against-all-odds/</guid>
		<description><![CDATA[&#8220;The house always wins.&#8221; 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, &#8220;Is winning on a faulty slot machine [a] crime?&#8221; talks about this. I have found it interesting that all of a sudden [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;The house always wins.&#8221; 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, <a href="http://news.yahoo.com/s/ap/20070719/ap_on_fe_st/generous_slot_machine" title="Is winning on a faulty slot machine [a] crime?">&#8220;Is winning on a faulty slot machine [a] crime?&#8221;</a> 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.<span id="more-34"></span></p>
<p>This raises a wonderful questio, actually, it isn&#8217;t a question but it raises a point about who is liable for what. I believe that the manufacturer is the one liable. The casino should call it good and move on. You read it and tell me what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dallinjones.com/2007/07/against-all-odds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to DallinJones.com</title>
		<link>http://www.dallinjones.com/2007/06/welcome-to-dallinjonescom/</link>
		<comments>http://www.dallinjones.com/2007/06/welcome-to-dallinjonescom/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 20:29:17 +0000</pubDate>
		<dc:creator>SlipStream</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dallinjones.com/?p=3</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>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.</p>
<p>Please return often and comment on my views. I love to hear about the way others think on these topics.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dallinjones.com/2007/06/welcome-to-dallinjonescom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
