<?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>Robert Casto</title>
	<atom:link href="http://www.robertcasto.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robertcasto.com</link>
	<description>Software Developer and Performance Engineer</description>
	<lastBuildDate>Tue, 24 Apr 2012 13:38:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Check to see if you might be affected by a DNS virus</title>
		<link>http://www.robertcasto.com/2012/04/24/check-to-see-if-you-might-be-affected-by-a-dns-virus/</link>
		<comments>http://www.robertcasto.com/2012/04/24/check-to-see-if-you-might-be-affected-by-a-dns-virus/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 13:38:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.robertcasto.com/?p=498</guid>
		<description><![CDATA[Our local TV station ran a story recently about how hundreds could loose their Internet in July. &#160; http://www.wcpo.com/dpp/news/science_tech/hundreds-of-thousands-may-lose-internet-in-july &#160; This is not exactly true. The issue is that it could appear that way. A virus will change things on your computer to work incorrectly. DNS is a way of turning names like Amazon.com into&#8230;]]></description>
			<content:encoded><![CDATA[<p><span style="background-color: rgba(255, 255, 255, 0.917969); font-family: arial, sans-serif; font-size: 13px; ">Our local TV station ran a story recently about how hundreds could loose their Internet in July.</span></p>
<div style="font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">&nbsp;</div>
<div style="font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); "><a href="http://www.wcpo.com/dpp/news/science_tech/hundreds-of-thousands-may-lose-internet-in-july" style="color: rgb(17, 85, 204); " target="_blank">http://www.wcpo.com/dpp/news/<wbr>science_tech/hundreds-of-</wbr><wbr>thousands-may-lose-internet-</wbr><wbr>in-july</wbr></a></div>
<p><wbr></wbr><wbr></wbr><wbr></p>
<p><wbr></wbr><wbr></wbr><wbr></wbr></p>
<p></wbr></p>
<p>	<wbr></wbr><wbr></wbr><wbr></p>
<p><wbr></wbr><wbr></wbr><wbr> </wbr></p>
<p></wbr><br />
	<wbr></wbr><wbr></wbr><wbr></wbr><wbr></wbr><wbr></wbr><wbr></p>
<div style="font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">&nbsp;</div>
<div style="font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">This is not exactly true. The issue is that it could appear that way. A virus will change things on your computer to work incorrectly. DNS is a way of turning names like Amazon.com into an address the computer understands like&nbsp;72.21.194.1.</div>
<div style="font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">&nbsp;</div>
<div style="font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">The virus tampers with the computer making it return a different number for the name. Thus if you enter Amazon.com in your browser, you will essentially be taken somewhere else. That is something you definitely want to avoid.</div>
<div style="font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">&nbsp;</div>
<div style="font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">To check if this is a problem with your computer, the FBI has setup a very simple test. Go to the website below and follow the directions.</div>
<div style="font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">&nbsp;</div>
<p>	<a href="http://www.dcwg.org/detect/" style="color: rgb(17, 85, 204); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); " target="_blank">http://www.dcwg.org/detect/</a><span style="font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">&nbsp;</span></p>
<p>If you are told that you are affected, then you will need to have the virus purged. My favorite anti-virus program lately is from <a href="http://www.amazon.com/gp/product/B003JZNCFS/ref=as_li_ss_tl?ie=UTF8&amp;tag=cincijava-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B003JZNCFS">Malwarebytes</a>. That link will take you to Amazon.com where it is roughly $20 right now. Sometimes it goes on sale but I wouldn&#39;t wait.</p>
<p>I especially like that it will trap dangerous requests to websites from within the browser. These are requests back to servers that can then install dangerous software on your computer. I got hit January 2012 and had to take some drastic measures to fix everything. This program took care of the problem where other tools I was using at the time didn&#39;t even catch the problem.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>	</wbr></p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertcasto.com/2012/04/24/check-to-see-if-you-might-be-affected-by-a-dns-virus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slow queries in MySQL due to collation problems</title>
		<link>http://www.robertcasto.com/2012/04/01/slow-queries-in-mysql-due-to-collation-problems/</link>
		<comments>http://www.robertcasto.com/2012/04/01/slow-queries-in-mysql-due-to-collation-problems/#comments</comments>
		<pubDate>Sun, 01 Apr 2012 15:28:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.robertcasto.com/?p=415</guid>
		<description><![CDATA[Recently I have been dealing with some very slow queries in MySQL. I have a couple tables with millions of records and the queries have been doing full table scans. This is very bad because it kills performance and turns a query that should execute in less than a second to take a couple minutes&#8230;]]></description>
			<content:encoded><![CDATA[<p>Recently I have been dealing with some very slow queries in MySQL. I have a couple tables with millions of records and the queries have been doing full table scans. This is very bad because it kills performance and turns a query that should execute in less than a second to take a couple minutes instead. At first I thought it was an indexing problem. I tried a number of different index options but to no avail. The EXPLAIN on the query would always return that it wanted to do a full table scan on a couple of the tables. I tried to simplify the queries down to just the 2 tables involved and see why the indexes were not being used. It turned out that no matter what I did, MySQL didn&#39;t want to use the indexes. I even tried using the FORCE option but still no luck.</p>
<p><a href="http://www.robertcasto.com/wp-content/2012/04/character-set.png"><img align="right" alt="" class="alignright size-thumbnail wp-image-419" height="107" hspace="10" src="http://www.robertcasto.com/wp-content/2012/04/character-set-200x107.png" title="character-set" vspace="10" width="200" /></a>That is when I stumbled on the cause as to why the indexes were being ignored. While looking at the table structure, I noticed that the tables had different locale and collation settings. MySQL lets you store data in many different character sets. This is very useful when dealing with text since it can handle special characters required for a specific language. In my case, I was using UTF-8 on one table, and LATIN on the other. MySQL couldn&#39;t take the value from one table and use that text string in the other tables&#39; index. They would never be the same because different character sets were being used.</p>
<p>Because the index couldn&#39;t be used, MySQL had to compare EVERY text value with every row in the other table doing a conversion on the text first. This is similar to the <a href="http://www.robertcasto.com/2011/12/29/stop-calculating-dates-for-your-queries-in-mysql/">date problem I blogged</a> about earlier where date values had to be calculated for every row. &nbsp;So instead of a nice and quick look in the index, it had to go looking the long way for something that matched.</p>
<p>Changing the Locale and/or Collation for a table is not difficult and the MySQL documentation covers it nicely. Don&#39;t forget though to do the conversion on each text field inside the table. Changing the table just changes the default, not all of the fields in that table. I looked through my database and found 5 different collations that were in use. This probably happened because of the tools I was using to create and modify my tables. They would have different defaults and thus set the value for me without my knowledge. Over time all these changes grew to become a huge problem &nbsp;once the database became large.</p>
<p>I decided to change all defaults in my tools and then wrote a simple program to go through the database and convert every table and field to the same locale and collation setting. My queries are now as fast as they should be, customers are happier, and I am much more conscious of the potential pitfall of letting my tools decide on what collation I am going to use when working with my databases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertcasto.com/2012/04/01/slow-queries-in-mysql-due-to-collation-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choosing a VPS for running Java</title>
		<link>http://www.robertcasto.com/2012/02/29/choosing-a-vps-for-running-java/</link>
		<comments>http://www.robertcasto.com/2012/02/29/choosing-a-vps-for-running-java/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 14:45:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Amazon]]></category>
		<category><![CDATA[VPS Hosting]]></category>

		<guid isPermaLink="false">http://www.robertcasto.com/?p=412</guid>
		<description><![CDATA[For some time I have been using Amazon&#39;s EC2 service for my website SellersToolbox.com. I also run a database there on their RDS service. Recently &#160;I have been working on some small Java programs that do very specific tasks. They research the Internet gathering information and then put that data into my database. Each program&#8230;]]></description>
			<content:encoded><![CDATA[<p>For some time I have been using <a href="http://aws.amazon.com/ec2">Amazon&#39;s EC2</a> service for my website <a href="http://www.sellerstoolbox.com">SellersToolbox.com</a>. I also run a database there on their RDS service. Recently &nbsp;I have been working on some small Java programs that do very specific tasks. They research the Internet gathering information and then put that data into my database. Each program is run with 64 MB of memory. I could run them in 32 MB but the garbage collection occurs too frequently.</p>
<p>My first choice of course was a <a href="http://aws.amazon.com/ec2/instance-types/">micro instance</a> in Amazon&#39;s EC2. It has 613 MB of memory so I figured it was plenty big enough to handle the job. What I didn&#39;t realize was how poor the network performance was going to be. My applications were severely limited in accessing the Internet to gather the information they needed for processing. This instance type was a 1/4th of the cost being $14.60 for the month. The next step up is a small instance which costs $62.05. Neither of these prices include bandwidth charges.</p>
<p>I then decided to look around on the Internet and see what other VPS offerings there were. I found many and some as low as $3.95 per month. <a href="http://astrovps.net">AstroVPS</a> was one of these for $3.95 per month. They offer you just what you need and nothing else. A server with root access so you can run programs. Once I got through the signup process I got a machine started and began installing my software. Not that hard since it is just a few jars and a couple shell scripts.</p>
<p>The Java program wouldn&#39;t run. I couldn&#39;t figure out why for a while until a stumbled into something that mentioned you shouldn&#39;t run Java programs on a VPS that is using <a href="http://wiki.openvz.org">OpenVZ</a>. I thought this was odd but after further reading it turns out that Java and OpenVZ don&#39;t get along. It has to do with how it and Java deal with memory. <a href="http://hostingfu.com/article/xen-or-openvz">The article</a>&nbsp;compared OpenVZ with Xen and so I started looking for an inexpensive VPS using Xen.</p>
<p>Most VPS hosting companies want you to buy the whole month. I&#39;m not opposed to that, but after comparing a bunch of them, I decided to give <a href="http://www.rackspacecloud.com/3026.html">Rackspace Cloud</a> hosting a try since they let you get a Xen VPS for just $0.015 per hour. The signup process was simple, and in the last 2 days I have spoken to 3 different people about some solutions to some hosting needs I have. Try getting someone to talk to at Amazon! When I called it was answered by a human, not a computer that put you into a queue. These guys really do mean Fanatical Support which was a welcome surprise.</p>
<p>I setup my software on a machine and started it up. The program ran flawlessly, had plenty of bandwidth, and the machine wasn&#39;t under heavy load. So I fired up 2 more instances so I had 3 Java programs running each with 64 MB of memory. All 3 ran without a problem and had plenty of bandwidth and the TOP command still showed a load under 1.00. I was very surprised at how well the machine was running. For $10.95 I was going to be able to run 3 instances of the software and not have any performance issues to boot. This was a great find and far superior to what was available in the Amazon cloud.</p>
<p>By some poor configuration of CRON, I accidentally got a couple of the servers I started to have 6 instances of the program running. The load on the VPS was soaring over 12.00, but what was really surprising was that it actually was trying to do it. Try that in most VPS environments and your machine will be starving for CPU not to mention memory. These Linux servers seemed to be the real deal. Great bandwidth, plenty of CPU and great memory handling. Because of bandwidth usage my real cost is going to be about $33 per month per server. I was hoping to spend just $20 per month on a server but then I didn&#39;t plan on being able to run 3 or 4 instances of my program on just one VPS.&nbsp;</p>
<p>The last thing I tried was to create a copy of the computer image so I could have a backup and run more instances when I needed them. I found that process extremely simple on Rackspace. You select the server, click a tab for instances, and then click a button to manual create an instance. You can also setup a schedule to create backups of the server. There is a limit of 80B for an instance but since I don&#39;t use the disk it won&#39;t be an issue for me any time soon. Starting up new instances using the manually created instance is also a breeze. Amazon EC2 by comparison gives you a process that is more hands on, and can be quite frustrating. I was able to finally create a shell script that creates an AMI on a running instance, but it sure wasn&#39;t easy. At Rackspace you just do a couple clicks and your done. Come back later and the instance is there waiting for you. Their storage costs are $0.15 per GB compared to Amazon&#39;s $0.125 per GB so while they are higher, it won&#39;t be an issue since I&#39;m just storing machine images for when I need to start more of them and have a backup.</p>
<p>So my recommendation is to try a few of the VPS hosts out there and see what will work for your situation. If you just want to run some Java programs, I think you should avoid Amazon and use Rackspace instead. The difference is huge and you will save a lot of money that way. I&#39;m going to try some other hosting services and see if they will perform just as well and whether I can get my bandwidth costs down. I found <a href="http://vpslink.com/xen-vps/">VPSlink</a> which has a similar 256 MB server for just $20 per month and has 300GB of bandwidth per month. I&#39;m not sure if that is both incoming and outgoing. Rackspace only charges you for outgoing data which is great because my programs pull in a huge amount of data from the Internet for processing. Paying for all that data would really break the bank.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertcasto.com/2012/02/29/choosing-a-vps-for-running-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rebuilding a computer is not like it used to be</title>
		<link>http://www.robertcasto.com/2012/01/03/rebuilding-a-computer-is-not-like-it-used-to-be/</link>
		<comments>http://www.robertcasto.com/2012/01/03/rebuilding-a-computer-is-not-like-it-used-to-be/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 04:00:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.robertcasto.com/?p=407</guid>
		<description><![CDATA[Over the holidays I decided to take the opportunity to rebuild my computer. I replaced the boot drives with SSD&#39;s and installed some bigger drives since the old ones were a few years old. I&#39;m always scared to do this because there are inevitably problems you don&#39;t anticipate. This rebuild did not disappoint on the&#8230;]]></description>
			<content:encoded><![CDATA[<p>Over the holidays I decided to take the opportunity to rebuild my computer. I replaced the boot drives with SSD&#39;s and installed some bigger drives since the old ones were a few years old. I&#39;m always scared to do this because there are inevitably problems you don&#39;t anticipate. This rebuild did not disappoint on the negative side, but it also surprised me on the positive side. </p>
<p><strong>Surprise #1 &#8211; SATA drive happiness <br />
	</strong></p>
<p>The new SATA drives I got were smaller physically than the old ones but had more capacity. Also, the SSD&#39;s were the tiny 2.5&quot; ones. The surprise is better air flow around the drives and everything running cooler. Cable management also improved a bit because I had a chance to put the drives in the holders in order with the ports. The one true happy surprise was how easy it was to go back to my old OS by just swapping out the cables and power connectors. These new SATA connectors are great but you have to make sure they lock in properly. More than once I had cables coming loose causing a boot to fail.</p>
<p><strong>Surprise # 2 &#8211; The Internet Rocks <br />
	</strong></p>
<p>Normally when I rebuild a computer I spent a huge amount of time installing software, configuring it, getting settings right, and all that mess. This time I just brought up <a href="https://www.google.com/chrome">Chrome</a>, installed a few choice extensions such as <a href="http://www.xmarks.com/">Xmarks</a>, session manager, and a couple developer tools. Then I was up and running with most of the tools I use all the time. Using these Internet sites instead of installing software and dealing with all the management of it saved a bunch of time. Any more our computers are becoming access points to services on the Internet. That is good in many ways and bad in some, but it sure helped eliminate a huge time waster for me this time around. </p>
<p><strong>Surprise #3 &#8211; I was able to access everything <br />
	</strong></p>
<p>I use a password database called <a href="http://keepass.info/">KeePass</a> which is a Password Safe program. I find it impossible to live without. I keep a lot more than just passwords in it. I keep server addresses, configuration settings, logins and passwords of course, and any other kind of information I need to remember but will obviously forget. I keep the database file for it in <a href="http://www.dropbox.com/">Dropbox</a> so that it is available to me on any computer I use and my Android. A couple of times I had to go to my phone to look up some information I needed to provide for a login, configuration key, subscription id, etc. I also learned of a couple things I forgot to put in. But overall I had 95% of the information I needed and so the rebuild process went much smoother than normal. </p>
<p><strong>Surprise #4 &#8211; Always ask for hardware help<br />
	</strong></p>
<p>During the process of installing Windows 7, I had a problem that was causing the install to be very slow. Incredibly slow. Slower than watching grass grow in Siberia. After finally reaching a high level of exasperation, I called up my brother-in-law. He thought it was bad memory and had me try a few things including running <a href="http://www.memtest.org/">memtest86+</a> which didn&#39;t find an error, but stalled while testing the 4th ram stick. Pulling it resolved the problem which wasn&#39;t apparent before because Windows XP never made use of that stick. I had 8 GB installed and just kept putting off the rebuild. It is my main computer after all and my livelihood so having it down for 2-3 days is a real problem. Getting his help put everything on the fast track so the idea here is to enlist the help of someone else who has a broader view of the situation and can probably see something you won&#39;t. I would rather have my machine running properly than to feel stupid for asking someone a dumb question. </p>
<p><strong>Surprise #5 &#8211; Seeing the world through cleaned windows<br />
	</strong></p>
<p>I have enjoyed Windows XP for a VERY LONG TIME. It has been a very stable platform on which to do software development. It has its quirks of course, but over the years I have grown quite adept at dealing with it and being productive with the OS. Now that I have Windows 7 installed its as if I have emerged from a tunnel. Many of the problems my machine had are now working properly. The machine goes to sleep and wakes up properly. It boots extremely fast and doesn&#39;t spend 5 minutes after boot loading drivers, startup programs, and all kinds of other junk. And having a clean machine free of 100&#39;s of test installed, trial programs, and clean drives as well feels very liberating. I have drive space again, a small list of programs installed, and browsers that don&#39;t stall or need restarting all the time. It is amazing how much cruft can accumulate over the years and its affect on the OS.</p>
<p>So if you are postponing a rebuild my vote would be to go for it and just take the pain. Once you come out the other side it will all feel worth it. Just make sure you allow lots of extra time to deal with the problems that will pop up. I had a number of them but in the end I was able to get past them. Now I just have to tell myself not to try out every program I see or better, I should take the old drives and setup a machine where I can try out all kinds of things and not mess up my freshly build development machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertcasto.com/2012/01/03/rebuilding-a-computer-is-not-like-it-used-to-be/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop calculating dates for your queries in MySQL</title>
		<link>http://www.robertcasto.com/2011/12/29/stop-calculating-dates-for-your-queries-in-mysql/</link>
		<comments>http://www.robertcasto.com/2011/12/29/stop-calculating-dates-for-your-queries-in-mysql/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 01:28:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://www.robertcasto.com/?p=405</guid>
		<description><![CDATA[Recently I was working on a couple reports that were running slow. I was looking for indexes that could be created or modified in order to speed them up and provide a quicker response on my SellersToolbox.com website. I was able to find a couple but then the issue of dates popup up. I provide&#8230;]]></description>
			<content:encoded><![CDATA[<p>Recently I was working on a couple reports that were running slow. I was looking for indexes that could be created or modified in order to speed them up and provide a quicker response on my SellersToolbox.com website. I was able to find a couple but then the issue of dates popup up. I provide monthly, quarterly, and yearly reports and trying to select the right dates is very important. I have some logic there that determines the right range to be put into my queries.</p>
<p>What I learned recently though is that using functions such as YEAR(), MONTH(), and DAY() defeat the use of indexes and primary keys most of the time. Because these functions have to be performed on the date value, each record in the table is usually processed. This slows the query down greatly and causes a lot of needless computation to result.</p>
<p>What I found was the BETWEEN option in MySQL. Using this allows the query optimizer to utilize indexes fully, and eliminates the need for many date computations which can be expensive.</p>
<p>An added benefit I found was how to handle the beginning and end dates for my queries. Instead of calculating what the end date was, I could use the INTERVAL term and let MySQL figure it out for me. This also allowed me to use the same query for my monthly, quarterly, and yearly time ranges very simply. All I had to do was take the date and the interval such as the 3 examples below.</p>
<p>&nbsp; &nbsp; BETWEEN &#39;2011-10-01&#39; AND &#39;2011-10-01&#39; + INTERVAL 1 MONTH<br />
	&nbsp; &nbsp; BETWEEN &#39;2011-10-01&#39; AND &#39;2011-10-01&#39; + INTERVAL 3 MONTH<br />
	&nbsp; &nbsp; BETWEEN &#39;2011-10-01&#39; AND &#39;2011-10-01&#39; + INTERVAL 1 YEAR</p>
<p>In this way I didn&#39;t have to do any extra work in my application, and I was assured that MySQL would choose records in the correct date range and take advantage of my indexes and primary keys. In this case, trying to do some performance improvements taught me a better way to write my SQL and resulted in less code which was easier to understand.</p>
<p>As you can see, modifying the query with the right amount of time is quite trivial. I have dropdown values in the SELECT on my web pages and all I have to do is append &quot;-01&quot; and then append the interval the user has chosen. Its great when code can be made simpler and more powerful at the same time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertcasto.com/2011/12/29/stop-calculating-dates-for-your-queries-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If you do DataTables extensively, learn to use fnServerData</title>
		<link>http://www.robertcasto.com/2011/12/29/if-you-do-datatables-extensively-learn-to-use-fnserverdata/</link>
		<comments>http://www.robertcasto.com/2011/12/29/if-you-do-datatables-extensively-learn-to-use-fnserverdata/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 01:12:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.robertcasto.com/?p=398</guid>
		<description><![CDATA[Recently I have been rebuilding my website sellerstoolbox.com with some help from Mike Christoff who is a graphical designer in Columbus Ohio. I use tables extensively to present information about sales, inventory, and many other eCommerce related reports For this rebuild I have decided to use DataTables more extensively. It is very powerful, provides lots&#8230;]]></description>
			<content:encoded><![CDATA[<p>Recently I have been rebuilding my website sellerstoolbox.com with some help from Mike Christoff who is a graphical designer in Columbus Ohio. I use tables extensively to present information about sales, inventory, and many other eCommerce related reports For this rebuild I have decided to use DataTables more extensively. It is very powerful, provides lots of great features, all while using the browser to do the work instead of the server. One of the great things about it is being able to populate the table with JSON retrieved from my server using AJAX.</p>
<p>The problem though is what to do once the table gets this data. I want to modify some of the cells to add color, links, and other features based on the data there. Unfortunately the normal <em><strong>sAjaxSource</strong></em> value doesn&#39;t provide a hook where I can do these things after the data is retrieved. That is where <em><strong>fnServerData</strong></em> comes into play. I learned that by proving a function to this attribute, I can do just about anything after the JSON is returned. An example looks something like the following.</p>
<p>&nbsp;</p>
<p><code>&quot;fnServerData&quot;: function(sSource, aoData, fnCallback) {<br />
	<span class="Apple-tab-span" style="white-space: pre; "> </span>&nbsp; &nbsp;&nbsp;$.getJSON( sSource, aoData, function (json) {<br />
	<span class="Apple-tab-span" style="white-space:pre"> </span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;fnCallback(json);<br />
	<span class="Apple-tab-span" style="white-space:pre"> </span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;oTable.fnAdjustColumnSizing();<br />
	<span class="Apple-tab-span" style="white-space:pre"> </span>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;hideWaiting();<br />
	&nbsp; &nbsp;&nbsp;<span class="Apple-tab-span" style="white-space:pre"> </span>} );<br />
	<span class="Apple-tab-span" style="white-space:pre"> </span>}</code></p>
<p>&nbsp;</p>
<p>The code above will be called when ever JSON data is being retrieved for the table. In this case I call the <em><strong>fnCallback</strong></em>&nbsp;function to process the JSON data that was returned. Then I am fixing the header and table column alignment on the table, and then I am hiding the DIV that is being used as a waiting graphic while the data is being retrieved. I could just as easily called a method to update the table cells, calculate a sum or average, or any other task once the data has been loaded and put into the table.</p>
<p>In my case being able to hide the DIV being shown while waiting was my main reason for learning about <em><strong>fnServerData</strong></em>. But now I use it just about everywhere since I always have some cleanup or post processing I want to do to the table. This is much easier than trying to do that work and pass it back through the JSON data. I also appreciate that the work is done using the browser instead of my server so performance for my system is enhanced by having less work to do.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertcasto.com/2011/12/29/if-you-do-datatables-extensively-learn-to-use-fnserverdata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting new logo &#8211; 99designs.com review</title>
		<link>http://www.robertcasto.com/2011/10/23/getting-new-logo-99designs-com-review/</link>
		<comments>http://www.robertcasto.com/2011/10/23/getting-new-logo-99designs-com-review/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 00:14:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.robertcasto.com/?p=392</guid>
		<description><![CDATA[I recently wanted a new logo for my website SellersToolbox.com. I was worried that I would hire someone, it take a long time, and spends lots of money doing it. I was told about 99designs.com and decided to give it a try. I have never used these outsourcing sites but the prospect of hiring someone&#8230;]]></description>
			<content:encoded><![CDATA[<p>I recently wanted a new logo for my website SellersToolbox.com. I was worried that I would hire someone, it take a long time, and spends lots of money doing it. I was told about <a href="http://99designs.com">99designs.com</a> and decided to give it a try. I have never used these outsourcing sites but the prospect of hiring someone close by who could do the job as cheaply wasn&#39;t looking good.</p>
<p>I emailed them to ask a number of questions. I got answers to all of them from a person there who wasn&#39;t pushy or eager to make a sale. I wasn&#39;t ready to start the project right then and he didn&#39;t pressure me to do so. About 3 weeks later I created a contest and waited for things to happen. I got a few designs initially and provided a little feedback. Things didn&#39;t take off until around the middle of the week and then near the end a few really good designers jumped in. I ended up liking 2 of the designs so much I bought both of them. I can use one for a mobile phone button while the other one is being used for the website logo.</p>
<p>I highly recommend choosing a company to work with based on their support, feedback, and ability to deliver. There were other options, a number of them cheaper, but I feel like I got my money&#39;s worth and then some. It was a good experience and has opened me up to outsourcing more work. There are only so many hours and when there is a ton to do, and getting good help now seems like a definite possibility.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertcasto.com/2011/10/23/getting-new-logo-99designs-com-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dealing with null values in JSF without using tags</title>
		<link>http://www.robertcasto.com/2011/03/16/dealing-with-null-values-in-jsf-without-using-tags/</link>
		<comments>http://www.robertcasto.com/2011/03/16/dealing-with-null-values-in-jsf-without-using-tags/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 14:17:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.robertcasto.com/?p=385</guid>
		<description><![CDATA[I needed to check if a value was null and display something else in a JSF application. Problem is I could not change the backing bean to check for not and provide a different value. That other value was also in the backing bean. I didn&#8217;t have conditional tags available such as c:if or c:choose,&#8230;]]></description>
			<content:encoded><![CDATA[<p>I needed to check if a value was null and display something else in a JSF application. Problem is I could not change the backing bean to check for not and provide a different value. That other value was also in the backing bean. I didn&#8217;t have conditional tags available such as <em>c:if</em> or <em>c:choose</em>, so I ended up finding a way inside the <em>h:outputText</em> itself.</p>
<p>&lt;h:outputText value=&#8221;#{empty obj.name ? obj.other : obj.name}&#8221;&gt;</p>
<p>Using empty will check for both null and empty string values. Then it can choose which value using the ternary operator ? inside the value itself. Keeps the code clean, easy to read, and fewer tags to parse. I could have swapped the values and put the word <em>not</em> in front by then that is yet another thing to maintain and parse.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertcasto.com/2011/03/16/dealing-with-null-values-in-jsf-without-using-tags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Putting space between things in JSF</title>
		<link>http://www.robertcasto.com/2011/03/09/putting-space-between-things-in-jsf/</link>
		<comments>http://www.robertcasto.com/2011/03/09/putting-space-between-things-in-jsf/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 20:58:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JSF]]></category>

		<guid isPermaLink="false">http://www.robertcasto.com/?p=374</guid>
		<description><![CDATA[Sometimes the simplest things are made difficult due to using a framework. Recently I was asked to put some space around some checkboxes. Normally I would do this in CSS and be done 20 seconds later. I am not allowed to touch the CSS though so I had to find a way to do it&#8230;]]></description>
			<content:encoded><![CDATA[<p>Sometimes the simplest things are made difficult due to using a framework. Recently I was asked to put some space around some checkboxes. Normally I would do this in CSS and be done 20 seconds later. I am not allowed to touch the CSS though so I had to find a way to do it with JSF tags. It is simple really, but sometimes it is the simple things that give us a lot of trouble.</p>
<p><span style="font-family: courier">&lt;h:outputText value=&quot; &amp;nbsp; &quot; escape=&quot;false&quot; /&gt;</span></p>
<p>That is all. You don&#8217;t really need the spaces around the html entity for a non-breaking space, but I needed more room. Don&#8217;t forget to set escape to false. Otherwise it will show the text on the screen instead of allowing the browser to show the fixed space you were hoping for.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertcasto.com/2011/03/09/putting-space-between-things-in-jsf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing viPlugin from Eclipse</title>
		<link>http://www.robertcasto.com/2011/02/28/removing-viplugin-from-eclipse/</link>
		<comments>http://www.robertcasto.com/2011/02/28/removing-viplugin-from-eclipse/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 21:18:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://www.robertcasto.com/?p=369</guid>
		<description><![CDATA[Turns out it is simple but the directions are not so clear on this page. http://www.viplugin.com/viplugin/?q=node/15 You need to go into your eclipse directory and remove the following so that it is completely gone. It is not enough to just remove the jar file. plugins/com.mbartl.eclipse.viplugin.statusbar_1.0.4.jar plugins/com.mbartl.viplugin.eclipse.layer_1.19.0/ plugins/com.mbartl.viplugin.eclipse.help_1.19.0/ Look in the features directory to make sure&#8230;]]></description>
			<content:encoded><![CDATA[<p>Turns out it is simple but the directions are not so clear on this page.</p>
<p><a href="http://www.viplugin.com/viplugin/?q=node/15">http://www.viplugin.com/viplugin/?q=node/15</a></p>
<p>You need to go into your eclipse directory and remove the following so that it is completely gone. It is not enough to just remove the jar file.</p>
<ul>
<li>plugins/com.mbartl.eclipse.viplugin.statusbar_1.0.4.jar</li>
<li>plugins/com.mbartl.viplugin.eclipse.layer_1.19.0/</li>
<li>plugins/com.mbartl.viplugin.eclipse.help_1.19.0/</li>
</ul>
<p>Look in the features directory to make sure there is no <strong>mbartl</strong> jar files there as well.</p>
<p>Restart eclipse and you should no longer be bothered with the popup asking you to pay for a license.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertcasto.com/2011/02/28/removing-viplugin-from-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

