<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5684229007805784813</id><updated>2012-02-16T04:56:28.114-05:00</updated><category term='sql sqlserver database scripts storedprocs storedprocedures cursors'/><category term='sqlserver sql server sqlcmd'/><category term='js javascript syntax highlighting code css blogs blogging'/><category term='ruby programming languages arrays hashes'/><category term='unix bash cygwin shell html scripts'/><category term='mysql'/><category term='center'/><category term='klipsch pot volume speakers electronics howto'/><category term='google tasks gtd management rtm remember milk productivity howto'/><category term='dell vostro 1500 dvd-rw dvd howto diy'/><category term='vim editing documents toc'/><category term='vertical'/><category term='style'/><category term='sheets'/><category term='java xerces sax javac compiler command prompt classpath sourcepath jdk j2se 1.6 shell'/><category term='dbproviderfactories'/><category term='css'/><category term='pot potentiometer klipsch promedia ultra 2.0 speakers hack hacks fixes'/><category term='.net mvc c# csharp modelstate validation programming'/><category term='svn subversion grep regex regular expressions expression bash shell cygwin extraction formatting'/><category term='div'/><category term='caulk ketchup ideas innovation inventions'/><category term='Sony Playstation playstation3 ps3 electronics groundloop howto troubleshooting'/><category term='asp.net'/><category term='.net ajax sys.component.create api javascript'/><category term='.net'/><category term='doctype html browsers ie chrome firefox'/><category term='jquery javascript client-side scripting regex regexp regular expressions programming'/><category term='startups startup bus startupbus programming cleveland software engineering'/><category term='tableadapter sql sqlserver connectionstring login integrated security'/><category term='w3c'/><category term='centering'/><category term='cascading'/><title type='text'>ClevelandFlash Tech Blog</title><subtitle type='html'>A blog about programming, innovations, and all things technology.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-2518507416255708560</id><published>2011-06-20T22:17:00.000-04:00</published><updated>2011-06-20T22:17:48.473-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim editing documents toc'/><title type='text'>Making a Navigable Table of Contents in Vim</title><content type='html'>I love Vim. I never thought I'd say this, seeing as a decade ago I was strictly a notepad/Word guy, but I &lt;i&gt;really&lt;/i&gt; like Vim. There is no doubt a learning curve, but it's well worth the effort.&lt;br /&gt;&lt;br /&gt;Today I decided to create a simple document with a table of contents with a document in Vim. Text editors like Google Docs provide internal linking structures, but in Vim it's much, much simpler. Simply create a TOC with one item per line like the following:&lt;br /&gt;&lt;pre&gt;&gt;&gt;SECTION_1&lt;&lt;&lt;br /&gt;&gt;&gt;SECTION_2&lt;&lt;&lt;br /&gt;    &gt;&gt;SECTION_2_a&lt;&lt;&lt;br /&gt;&gt;&gt;SECTION_3&lt;&lt;&lt;br /&gt;&gt;&gt;SECTION_4&lt;&lt;&lt;br /&gt;    &gt;&gt;SECTION_4_a&lt;&lt;&lt;br /&gt;    &gt;&gt;SECTION_4_b&lt;&lt;&lt;br /&gt;&gt;&gt;SECTION_5&lt;&lt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Once you create your TOC, it's really easy to navigate about your document. Simply move the cursor to the line in your TOC that you'd like to find in the main document, then hit the asterisk "*" key. Vim will find the closest word following the cursor's current location on the line and then search for the next value in the document that matches that word. You'll also notice I've used underscores in my section headings. The reason for this is that Vim will treat underscores as part of a word, rather than as a delimiting character like a space or hyphen. Does it get any simpler than this?&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;~Mike&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-2518507416255708560?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/2518507416255708560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2011/06/making-navigable-table-of-contents-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/2518507416255708560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/2518507416255708560'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2011/06/making-navigable-table-of-contents-in.html' title='Making a Navigable Table of Contents in Vim'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-2796123601676447725</id><published>2011-05-20T11:08:00.001-04:00</published><updated>2011-05-20T11:08:56.809-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='google tasks gtd management rtm remember milk productivity howto'/><title type='text'>Getting Google Tasks Into Remember the Milk</title><content type='html'>I was looking for a quick and easy way to import my existing Google Task lists into Remember the Milk today and found that, while fairly easy, you need to jump through a couple small hoops.&lt;br /&gt;&lt;br /&gt;First off, Google Calendar and Gmail offer different functionality for Tasks. Originally, I was going to use the "print tasks" action and just copy-paste into an email that I'd send to RTM, but there's an easier way. I usually deal with tasks exclusively through the Calendar and so, initially, I didn't see that they offer an "Email Tasks" Action. You have to access Tasks via Gmail in order to see this action. Basically, you just use your RTM import email address and send the tasks to it. Done.&lt;br /&gt;&lt;br /&gt;One thing to note here is that RTM doesn't support subtasks, so if you have any hierarchy built into your Google task list, it will be lost. If you need to keep these "buckets" alive, I'd suggest tagging your subtasks before sending them over. Just check out the smart add options for details - http://www.rememberthemilk.com/services/smartadd/&lt;br /&gt;&lt;br /&gt;~Mike&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-2796123601676447725?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/2796123601676447725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2011/05/google-tasks-remember-milk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/2796123601676447725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/2796123601676447725'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2011/05/google-tasks-remember-milk.html' title='Getting Google Tasks Into Remember the Milk'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-2676205438224205942</id><published>2011-03-28T23:26:00.001-04:00</published><updated>2011-03-28T23:27:25.220-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby programming languages arrays hashes'/><title type='text'>Picking Up Some Ruby</title><content type='html'>I'm currently spending some spare hacking time by making my way through Seven Languages in Seven Weeks. Conveniently, it starts out with Ruby, which happens to be a language I've been looking to dive into for quite some time now. There's a question and task in the book that asks for a way to convert from a hash to an array. This is pretty simple as hashes have a "to_a" method. As an example, take the following hash:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:ruby"&gt;aHash = {"a"=&amp;gt;100, "b"=&amp;gt;200, "c"=&amp;gt;300, "d"=&amp;gt;400}&lt;br /&gt;=&amp;gt; {"a"=&amp;gt;100, "b"=&amp;gt;200, "c"=&amp;gt;300, "d"=&amp;gt;400}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Converting this to an array results in the following:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:ruby"&gt;aArray = aHash.to_a&lt;br /&gt;=&amp;gt; [["a", 100], ["b", 200], ["c", 300], ["d", 400]]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, going the other direction is a bit more complicated as there doesn't seem to be a "to_h" method to convert from an array to a hash. By using the "inject" method, this is what I've come up with:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:ruby"&gt;aArray.inject({}) {|a,b| a[b[0]]=b[1]; a}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I pass an empty hash as an argument to the inject method, which is the initial value for "a." Since "b" is the array of arrays, the values can be accessed via the bracket [] method and used to assign a key/value pair for the hash. Ruby's dynamic nature means we don't have to worry about initializing the hash size up front as this is all handled by the Ruby interpreter at runtime. Finally, there's a bit of trickery after the semi-colon. Every expression in Ruby returns a value, so by having the last value of our code block be the hash "a," we're able to prime the next value for "a" by doing this, thereby allowing us to incrementally build our hash.&lt;br /&gt;&lt;br /&gt;A more visual way of seeing this in action is as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:ruby"&gt;aHash.to_a.inject({}) {|a,b| a[b[0]]=b[1]; puts a.inspect; a}&lt;br /&gt;{"a"=&amp;gt;100}&lt;br /&gt;{"a"=&amp;gt;100, "b"=&amp;gt;200}&lt;br /&gt;{"a"=&amp;gt;100, "b"=&amp;gt;200, "c"=&amp;gt;300}&lt;br /&gt;{"a"=&amp;gt;100, "b"=&amp;gt;200, "c"=&amp;gt;300, "d"=&amp;gt;400}&lt;br /&gt;=&amp;gt; {"a"=&amp;gt;100, "b"=&amp;gt;200, "c"=&amp;gt;300, "d"=&amp;gt;400}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I'm eager to hear feedback on this if anyone is willing to share.&lt;br /&gt;&lt;br /&gt;~Mike&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-2676205438224205942?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/2676205438224205942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2011/03/picking-up-some-ruby.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/2676205438224205942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/2676205438224205942'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2011/03/picking-up-some-ruby.html' title='Picking Up Some Ruby'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-7739217160027449037</id><published>2011-03-03T15:49:00.001-05:00</published><updated>2011-03-03T15:49:41.732-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='startups startup bus startupbus programming cleveland software engineering'/><title type='text'>I've Joined the 2011 Startup Bus!</title><content type='html'>Chances are, unless you're involved in it you have no idea what the Startup Bus is. I got my ticket bid to join the bus a couple days ago and officially accepted earlier today.&amp;nbsp;Since I have a good deal of preparation I'd like to cram in before the bus rolls out on Tuesday, I'll simply refer you over to their website/blog -&amp;nbsp;&lt;a href="http://startupbus.com/"&gt;http://startupbus.com/&lt;/a&gt;. I'm truly thrilled and honored to be able to join a group of talented developers from the Cleveland area in the hopes of establishing a successful startup company!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-7739217160027449037?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/7739217160027449037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2011/03/ive-joined-2011-startup-bus.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/7739217160027449037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/7739217160027449037'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2011/03/ive-joined-2011-startup-bus.html' title='I&apos;ve Joined the 2011 Startup Bus!'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-7161658295133516800</id><published>2011-02-21T21:36:00.000-05:00</published><updated>2011-02-21T21:36:55.860-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net mvc c# csharp modelstate validation programming'/><title type='text'>Retrieving Errors From the .NET MVC ModelState</title><content type='html'>There's good reason to write extension methods that help adding errors to the .NET MVC ModelState Dictionary, and the Microsoft tutorials present some reasonable, readily-available solutions for this. But you might also desire to get back those errors in the form in which they were added in the first place, and for that it's a little bit trickier. Using the RuleViolation class pattern provided on the asp.net website, the code below uses LINQ query syntax with &lt;i&gt;outer range variables&lt;/i&gt;&amp;nbsp;to handle the SelectMany query projection into an IEnumerable&amp;lt;RuleRiolation&amp;gt; collection object.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:csharp"&gt;public static IEnumerable&amp;lt;RuleViolation&amp;gt; GetRuleViolations(this ModelStateDictionary modelState)&lt;br /&gt;        {&lt;br /&gt;            var violations = from vals in modelState&lt;br /&gt;                             from errors in vals.Value.Errors&lt;br /&gt;                             where vals.Value.Errors.Count &amp;gt; 0&lt;br /&gt;                             select new RuleViolation(errors.ErrorMessage, vals.Key);&lt;br /&gt;&lt;br /&gt;            return violations;&lt;br /&gt;        }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-7161658295133516800?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/7161658295133516800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2011/02/retrieving-errors-from-net-mvc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/7161658295133516800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/7161658295133516800'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2011/02/retrieving-errors-from-net-mvc.html' title='Retrieving Errors From the .NET MVC ModelState'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-6235687456877521491</id><published>2011-01-09T12:40:00.000-05:00</published><updated>2011-01-09T12:40:43.292-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='caulk ketchup ideas innovation inventions'/><title type='text'>Ketchup Caulking Gun</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Somebody needs to make this, just give me a percent.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gvBEIwkDw4Q/TSnywTg_ILI/AAAAAAAAAA0/nfwgo6LhSOg/s1600/heinz.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="256" src="http://4.bp.blogspot.com/_gvBEIwkDw4Q/TSnywTg_ILI/AAAAAAAAAA0/nfwgo6LhSOg/s400/heinz.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-6235687456877521491?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/6235687456877521491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2011/01/ketchup-caulking-gun.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/6235687456877521491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/6235687456877521491'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2011/01/ketchup-caulking-gun.html' title='Ketchup Caulking Gun'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_gvBEIwkDw4Q/TSnywTg_ILI/AAAAAAAAAA0/nfwgo6LhSOg/s72-c/heinz.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-5133954849101351994</id><published>2010-12-29T12:20:00.002-05:00</published><updated>2010-12-29T12:30:44.794-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jquery javascript client-side scripting regex regexp regular expressions programming'/><title type='text'>jQuery Selector Filtering With Regular Expressions</title><content type='html'>jQuery ships with a whole host of extremely useful &lt;a href="http://api.jquery.com/category/selectors/" target="_blank"&gt;selector expressions&lt;/a&gt; that allow you to pick, choose, and otherwise narrow down exactly the items on the page that you want to manipulate with your jQuery scripts. It does not, however, ship with an obvious way to perform regular expressions using the selector syntax. Instead, one way I've found to do this is by using the library's &lt;a href="http://api.jquery.com/filter/" target="_blank"&gt;filter()&lt;/a&gt; method. You simply pass a function as an argument and then use your own predicate to perform the filtering within the passed function. A short example scenario follows.&lt;br /&gt;&lt;br /&gt;Let's say you have some items on the page that you'd like to manipulate by using a server-side property name. You might do this for some AJAX error handling, for instance. Get a response from the server containing the fields in error and add an appropriate message next to the corresponding input field.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Client-side field IDs&lt;/b&gt;&lt;br /&gt;rates[1]_MyRateThing&lt;br /&gt;Name&lt;br /&gt;FirstName&lt;br /&gt;LastName&lt;br /&gt;&lt;br /&gt;So let's say "Name" had an error because the user didn't supply one. With jQuery the selector would be pretty straightforward, and there's no need for any regex in this case. This is assuming we already have the AJAX response and are iterating over the error values in a loop, each error being represented by an "item" object with PropertyName and ErrorMessage properties.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:js"&gt;if ($(item.PropertyName + ':visible').length &amp;gt; 0) {&lt;br /&gt;    errors++;&lt;br /&gt;    $(item.PropertyName + ':visible').after('&amp;lt;span class="error"&amp;gt; *' + item.ErrorMessage + '&amp;lt;/span&amp;gt;');&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This works equally fine for FirstName and LastName as well. But what about MyRateThing? You'll notice there's a prefix on that property, the reason being MyRateThing is part of a list of items to be sent to the server. Without going off on a tangent, this is how .NET MVC happens to handle lists of things for easy manipulation server-side and the prefix is both simple and necessary. So how can we generalize our matching algorithm to fit both simple property names as well as those with more compound structures like the list prefixes? We could try using the jQuery "ends with" selector as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:js"&gt;$('[id$="' + item.PropertyName + '"]:visible')&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This solves our problem for MyRateThing fairly easily. Only the visible elements ending with the specified property name are selected with this approach because it simply matches on an element whose name ends with the PropertyName value. The only problem is that now our other properties don't work as expected. Let's say we have an error with Name. Unfortunately, now both FirstName and LastName will be matched as well. We need slightly finer grained control over the pieces of our string in order to tell jQuery to filter out elements in some cases, but not in others. This is where our regex will come in. Basically, when our selection method is looking at element ID's with an underscore character "_" we want it to ignore everything leading up to, and including, the underscore. When there is no underscore character, we want the selector to look at the entire id. We'll simply add our regex onto the select class filter from our previous example. So here it is:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:js"&gt;var matchedElem = $('[id$="' + item.PropertyName + '"]:visible').filter(function() {&lt;br /&gt;    var regex = new RegExp('^(.*_)?' + item.PropertyName + '$');&lt;br /&gt;    return this.name.match(regex);&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;if (matchedElem.length &amp;gt; 0) {&lt;br /&gt;    errors++;&lt;br /&gt;    matchedElem.after('&amp;lt;span class="error"&amp;gt; *' + item.ErrorMessage + '&amp;lt;/span&amp;gt;');&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Mike&lt;br /&gt;&lt;br /&gt;&lt;i&gt;References:&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://api.jquery.com/filter/" target="_blank"&gt;http://api.jquery.com/filter/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://api.jquery.com/category/selectors/" target="_blank"&gt;http://api.jquery.com/category/selectors/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-5133954849101351994?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/5133954849101351994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/12/jquery-selector-filtering-with-regular.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/5133954849101351994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/5133954849101351994'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/12/jquery-selector-filtering-with-regular.html' title='jQuery Selector Filtering With Regular Expressions'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-1048198679524128796</id><published>2010-12-24T14:04:00.001-05:00</published><updated>2010-12-24T14:04:28.476-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix bash cygwin shell html scripts'/><title type='text'>Export HTML List of Links With Bash/Unix/Cygwin</title><content type='html'>Why use an IDE when you can have fun with the Shell??? This little tidbit will rip through the files in the current directory and redirect the output with hyperlink wrappers to a file named links.html.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;for file in *;&lt;br /&gt;do&lt;br /&gt;echo &amp;quot;&amp;lt;li&amp;gt;&amp;lt;a href=\&amp;quot;$file\&amp;quot;&amp;gt;$file&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&amp;quot; &amp;gt;&amp;gt; links.html;&lt;br /&gt;done&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-1048198679524128796?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/1048198679524128796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/12/export-html-list-of-links-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/1048198679524128796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/1048198679524128796'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/12/export-html-list-of-links-with.html' title='Export HTML List of Links With Bash/Unix/Cygwin'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-5318012219215488174</id><published>2010-12-23T10:57:00.000-05:00</published><updated>2010-12-23T10:57:05.724-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='svn subversion grep regex regular expressions expression bash shell cygwin extraction formatting'/><title type='text'>Extracting File Names From Full Paths Using Regex</title><content type='html'>There are tons of ways to do this, and this is pretty introductory, but I felt like posting it anyway. I wanted a quick, repeatable way to print out a list of just file names, excluding the path, from a Subversion changeset. Here it is:&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Unix-style&lt;/u&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;svn status mydir | grep -o '[^\/]*$'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;u&gt;Windows&lt;/u&gt;&lt;br /&gt;&lt;pre class="brush:bash"&gt;svn status mydir | grep -o '[^\\]*$'&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-5318012219215488174?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/5318012219215488174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/12/extracting-file-names-from-full-paths.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/5318012219215488174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/5318012219215488174'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/12/extracting-file-names-from-full-paths.html' title='Extracting File Names From Full Paths Using Regex'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-8211224431015711344</id><published>2010-11-03T13:44:00.003-04:00</published><updated>2010-11-03T13:49:46.001-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sony Playstation playstation3 ps3 electronics groundloop howto troubleshooting'/><title type='text'>PlayStation 3 Video Problem - Fixed!</title><content type='html'>I Twittered (prematurely) not long ago about my PlayStation 3 having miraculously recovered from a video flicker and horizontal scanline problem. I thought it might have been an overheating issue or a bad solder connection on the video card and was getting ready to send it into Sony to have it repaired/replaced. Little did I realize what the real root of the problem was.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gvBEIwkDw4Q/TNGX01RW7QI/AAAAAAAAAAk/twLHO9TNBbo/s1600/PS3.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/_gvBEIwkDw4Q/TNGX01RW7QI/AAAAAAAAAAk/twLHO9TNBbo/s320/PS3.jpeg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;In actuality, I was the victim of a phenomenon known as a &lt;i&gt;ground loop&lt;/i&gt;. First, I should mention that I am using the RCA connection for video as opposed to the HDMI cable (no HDTV), so if you have this problem with HDMI it might be something else entirely. In my configuration a ground loop was absolutely the issue. Often enough, electronic equipment is connected using only a two-pronged plug, not the three-pronged variety. Electrical devices connected to power in this fashion are known as a &lt;i&gt;floating ground.&lt;/i&gt;&amp;nbsp;This is normally not an issue, but in a system where devices are connected via cables and not all the devices in the system are connected as floating grounds, this can become a problem. Why? Well&amp;nbsp;I'm not a certified electrician and you can certainly read a bit more about it on &lt;a href="http://en.wikipedia.org/wiki/Ground_loop_(electricity)"&gt;Wikipedia&lt;/a&gt;&amp;nbsp;if you like, but it comes down to a difference in ground potential between the connected devices.&lt;br /&gt;&lt;br /&gt;Electricity, in a nutshell, works on the principal of two points in a circuit having a difference in potential. You can think of it like water flowing from a point on top of a mountain down to the sea. The effect of gravity in concert with the difference in elevation is essentially the same principal as that of electrical potential. The water wants to flow from the point of high elevation (high potential) to the point of low elevation (low potential). Without a difference in gravity potential there is no reason for the water to move from point A to point B. And likewise, without a difference in electrical potential there is no reason for electrons to create electricity by moving through a conductor. Not having a common ground within a system of connected electrical devices causes this difference in potential and voila! instant video problems because we end up having a flow of electrical current where there &lt;i&gt;should not be a current.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;/i&gt;I was honestly surprised to see this happen, and it took a good deal of grief before I realized what it was. In the case of the PS3, Sony decided to use a three-pronged (grounded) plug similar to what is used for most computers. I'm not sure what the reason behind that decision was, but I really don't see a whole lot of danger there because the case is enclosed by plastic and would buffer you from shock in the event of a short anyhow. That aside, this is the first part of how we get a ground loop. The other part comes from your television, but not your television's power connection. Rather, it comes from your cable line connection! Yes, your cable line into the back of the television, if not properly isolated, can cause a ground loop in concert with a fully grounded piece of equipment connected to your television.&lt;br /&gt;&lt;br /&gt;In my case, having the PS3 plugged into a grounded outlet, that is to say the PS3 is &lt;u&gt;not&lt;/u&gt; a floating ground, along with having it connected via RCA cables to a television connected to a non-isolated cable line, caused a ground loop. Since I'm using online media exclusively now, all I had to do was unplug the cable line and I was all set. If you have cable and need the connection, you could: verify your cable box is has an isolating transformer to shield from ground loops, unground your PS3, or add a special filter to your cable line to protect it from ground loops in the way a cable box would normally do.&lt;br /&gt;&lt;br /&gt;~Mike&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-8211224431015711344?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/8211224431015711344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/11/ps3-video-fixed.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/8211224431015711344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/8211224431015711344'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/11/ps3-video-fixed.html' title='PlayStation 3 Video Problem - Fixed!'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_gvBEIwkDw4Q/TNGX01RW7QI/AAAAAAAAAAk/twLHO9TNBbo/s72-c/PS3.jpeg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-16327133333811733</id><published>2010-10-29T09:29:00.000-04:00</published><updated>2010-10-29T09:29:55.627-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='klipsch pot volume speakers electronics howto'/><title type='text'>Back to the Klipsch ProMedia Volume Problem</title><content type='html'>I posted a blog a number of months ago about having some issues with the volume control knob on my Klipsch ProMedia speakers. I tried some basic fixes using a light oil, which seemed to work pretty well at first, but the speakers later reverted to their original behavior. I really like the sound on these speakers, but it seems Klipsch has little, if any interest in addressing the known issues - they have even stopped producing this set of speakers altogether. Actually, this isn't the first product from Klipsch I've had problems with, but that's a whole other story.&lt;br /&gt;&lt;br /&gt;I'd really like to get these things working again so I've taken the first steps towards that goal by disassembling the volume control from the rest of the internal electronics.&amp;nbsp;I desoldered the volume pot switch from the internal PCB, but now have to figure out where to find a replacement. I found at least one posting from someone that detailed pulling the casing on the switch apart and soldering new wire connects along with a series of other steps, but I just don't care to do that. What I'd really like is to find another pot that matches the one in the photo below. We'll see where this goes.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_gvBEIwkDw4Q/TMrLm-vtqrI/AAAAAAAAAAc/1XlNMLwuank/s1600/wpid-IMAG0225.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="191" src="http://4.bp.blogspot.com/_gvBEIwkDw4Q/TMrLm-vtqrI/AAAAAAAAAAc/1XlNMLwuank/s320/wpid-IMAG0225.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-16327133333811733?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/16327133333811733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/10/back-to-klipsch-promedia-volume-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/16327133333811733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/16327133333811733'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/10/back-to-klipsch-promedia-volume-problem.html' title='Back to the Klipsch ProMedia Volume Problem'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_gvBEIwkDw4Q/TMrLm-vtqrI/AAAAAAAAAAc/1XlNMLwuank/s72-c/wpid-IMAG0225.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-5470020211261121318</id><published>2010-10-28T18:57:00.001-04:00</published><updated>2010-10-29T12:40:13.822-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dell vostro 1500 dvd-rw dvd howto diy'/><title type='text'>Dell Vostro 1500 - DVD-RW Replacement</title><content type='html'>The DVD drive on my laptop took a dive the other day, so being well out of warranty I decided to replace it myself. Even on the Dell website doing a search for parts for the Vostro 1500 wasn't very fruitful. I'm not really sure why they don't have the appropriate parts for this computer, but there's not much I can do about that. I ended up finding a new drive made for an Inspiron 1520 on Ebay for a reasonable enough price. I have no idea how compatibility works for these things, but I had come across a posting on the Dell forums that indicated the Inspiron and Vostro were virtually the same machine. On that advice, I purchased the drive.&lt;br /&gt;&lt;br /&gt;Replacement was really pretty easy. Shut down your comp, remove the mounting screw for the drive on the bottom of the computer, and slide the drive out. Due to a funky configuration, you might have to remove the faceplate from the old drive and use it instead of what comes with your replacement drive. There are a couple plastic snaps that you can work loose with a screwdriver, but attaching the plate to the new drive is as simple as snapping it into place. From that point it's just inserting the new drive into the DVD drive bay and tightening the mounting screw. &lt;br /&gt;&lt;br /&gt;Really, that's about it! For a quick test I played a CD and it worked without any hassles whatsoever. I did notice that similar to my old drive, the player vibrates quite loudly while ripping a CD. Seems like there may have been a missing part to control vibration on my laptop? I say this because another programmer friend of mine bought the exact same laptop at the same time I did, and not once did it have issues. I'm not really sure, but at least the thing works again.&lt;br /&gt;&lt;br /&gt;Here's the old drive after removal.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_gvBEIwkDw4Q/TMr4kuPTBoI/AAAAAAAAAAg/eX1pz0wM3zA/s1600/wpid-IMAG0227.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/_gvBEIwkDw4Q/TMr4kuPTBoI/AAAAAAAAAAg/eX1pz0wM3zA/s400/wpid-IMAG0227.jpg" width="239" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;Old hunk o' junk&lt;/div&gt;&lt;br /&gt;~M&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-5470020211261121318?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/5470020211261121318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/10/dell-vostro-1500-dvd-rw-replacement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/5470020211261121318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/5470020211261121318'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/10/dell-vostro-1500-dvd-rw-replacement.html' title='Dell Vostro 1500 - DVD-RW Replacement'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_gvBEIwkDw4Q/TMr4kuPTBoI/AAAAAAAAAAg/eX1pz0wM3zA/s72-c/wpid-IMAG0227.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-5172354818843938984</id><published>2010-09-17T19:30:00.000-04:00</published><updated>2010-09-17T19:30:23.381-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='doctype html browsers ie chrome firefox'/><title type='text'>If At First You Don't Succeed, Make Sure You Added the DOCTYPE</title><content type='html'>I just thought of something that can be ridiculously aggravating.&lt;br /&gt;&lt;br /&gt;Picture this: You're working along, making good progress structuring your HTML with beautiful DIV, UL, P elements, among other SEO-friendly markup. The CSS is nicely organized and as cross-browser safe as you can possibly make it. You're developing in Firefox or Chrome and everything looks fantastic, but you figure it's a good idea to check out IE since, while good developers know the tools on other browsers are vastly superior, this is largely still the public's browser of choice. And in order for any site to be successful you &lt;i&gt;have&lt;/i&gt; to develop to the lowest common denominator, right? But wait, what's this!? IE just barfed all over your perfect markup, exclaiming "You don't know what you're doing, kid. Nice try!" Well, rather than throwing your computer out the window or starting from scratch, you might double-check that you didn't forget to include the DOCTYPE element at the top of your page. Forgetting to specify the document type can be the cause of some of the most annoying rendering bugs, so it pays to check.&lt;br /&gt;&lt;br /&gt;Mike&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-5172354818843938984?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/5172354818843938984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/09/if-at-first-you-dont-succeed-make-sure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/5172354818843938984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/5172354818843938984'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/09/if-at-first-you-dont-succeed-make-sure.html' title='If At First You Don&apos;t Succeed, Make Sure You Added the DOCTYPE'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-7885368167913511226</id><published>2010-09-14T15:54:00.001-04:00</published><updated>2010-09-14T16:01:28.860-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='js javascript syntax highlighting code css blogs blogging'/><title type='text'>Yet Another Syntax Highlighter For the Web and Blogs</title><content type='html'>Today I was looking at the ol' tech blog thinking that while my current code syntax rendering is okay, it's not great. There must be something better. So I poked around the web for a bit looking, at a few other prominent technical blogs, and I came across an excellent JavaScript-based syntax highlighter appropriately named, well, &lt;a href="http://alexgorbatchev.com/SyntaxHighlighter"&gt;SyntaxHighlighter&lt;/a&gt;. I know, sometimes fancy marketing names just don't make the to-do list.&lt;br /&gt;&lt;br /&gt;The library is configurable on a number of fronts. Probably the most important feature is the ability to add what the creator calls &lt;i&gt;brushes&lt;/i&gt;. These are essentially code files specifically tuned to the particular language's syntax you're looking to highlight. For instance, there are SQL, JavaScript, Java, and C# brushes, among others. Another nice add is the ability to tune the overall formatting via a CSS theme. This allows you to tweak the colors to various display types including but not limited to Eclipse and Emacs. Pretty nice indeed. Lastly, you don't even need to host the requisite files. The creator, Alex Gorbatchev, provides free hosting - all he asks is for a donation to help with the Amazon S3 costs.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Configuration&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Configuration is also pretty much a breeze. If you're modifying an existing blog template on Blogger, as was the case for this site, you'll probably want to do a backup of your existing template.&amp;nbsp;Login to your account and navigate to the &lt;i&gt;Design &lt;/i&gt;tab. From here you'll be looking for the sub-menu option entitle &lt;i&gt;Edit HTML&lt;/i&gt;. Backup your template via the supplied download link. That being done, search for "" in the template document in the textarea below. Just above the closing "" element is where you're going to insert the following code.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:js"&gt;&amp;lt;!-- Syntax Highlighter code --&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- SH::Setup CSS --&amp;gt;&lt;br /&gt;&amp;lt;link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/&amp;gt;&lt;br /&gt;&amp;lt;link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeEclipse.css' rel='stylesheet' type='text/css'/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- SH::Setup JS --&amp;gt;&lt;br /&gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- SH::Configure Brushes --&amp;gt;&lt;br /&gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&amp;lt;script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- SH::Run syntax highlighter --&amp;gt;&lt;br /&gt;&amp;lt;script type='text/javascript'&amp;gt;&lt;br /&gt;     SyntaxHighlighter.config.bloggerMode = true;&lt;br /&gt;     SyntaxHighlighter.all();&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There are four main sections here:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;CSS&lt;/li&gt;&lt;li&gt;JavaScript core files&lt;/li&gt;&lt;li&gt;Syntax brushes&lt;/li&gt;&lt;li&gt;Config and run highlighter&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;If you're running this in Blogger, you should include the line &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;config.bloggerMode=true&lt;/span&gt;&lt;/span&gt;, as per the documentation. You'll notice I've included a number of brushes. There is also an autoloader feature that sounds like it should offload some downloading on pages that don't require all the brush files, but I haven't tried it out yet. The last thing to do is use the highlighter in a blog post. It really doesn't get much more complicated than the following:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:js"&gt;&amp;lt;pre class="brush:js"&amp;gt;&lt;br /&gt;function testMeOut()&lt;br /&gt;{&lt;br /&gt;    alert("You should really try this out.");&lt;br /&gt;}&lt;br /&gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In this example I've decided to highlight a simple JavaScript function by specifying a brush type of "js" in my outer "&amp;lt;pre&amp;gt;" class definition. &amp;nbsp;One important thing to note is that there are actually two different ways to go about highlighting with this library. I've used the "&amp;lt;pre&amp;gt;" tag method, as this is the recommended method for blogs, but it requires you to HTML escape your code. It's a minor inconvenience, but still important to note because the syntax highlighting will not work if you have less-than "&amp;lt;" symbols in the code you are trying to highlight.&lt;br /&gt;&lt;br /&gt;That should do it. If you're not seeing the correct results, make sure you've included all necessary files, referenced your brush types correctly, and escaped your HTML.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Links&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://alexgorbatchev.com/SyntaxHighlighter"&gt;http://alexgorbatchev.com/SyntaxHighlighter&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-7885368167913511226?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/7885368167913511226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/09/yet-another-syntax-highlighter-for-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/7885368167913511226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/7885368167913511226'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/09/yet-another-syntax-highlighter-for-web.html' title='Yet Another Syntax Highlighter For the Web and Blogs'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-1164830969700807040</id><published>2010-09-09T17:38:00.003-04:00</published><updated>2010-09-14T14:15:35.690-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql sqlserver database scripts storedprocs storedprocedures cursors'/><title type='text'>Dropping Multiple Stored Procedures</title><content type='html'>Occasionally when you're working with a database, e.g. your local dev environment, you need to do a little bit of cleanup. Let's say you run a stored procedure creation script from with SQL Server Management Studio and forget to specify the target database. So instead of having a bunch of procedures in the intended database you now have them in another database or, perhaps worse, in your master database.&lt;br /&gt;&lt;br /&gt;SSMS doesn't allow you to select multiple procs to run commands on at once, so you have to select them one-by-one and issue the drop. I don't know about you, but there's no way I want to do that for ten, let alone fifty or more stored procedures. A better way to approach this is to instead write a batch processing script that loops over a list of stored procedure names and executes the DROP command on each of them.&lt;br /&gt;&lt;br /&gt;The trick here is to get a list of user-defined stored procedures that fall under the desired catalog (database) and loop over that list with a cursor. The reason for this is that unlike a WHERE clause you can't pass a list to the DROP PROCEDURE command. To accomplish a batch DROP, you have to store the resulting value from the current row retrieved from the cursor and execute the command on each value inside a loop. The complete code is shown below.&lt;br /&gt;&lt;br /&gt;* Please be advised this code is provided as is with no warranties of any kind. Don't run this on a production environment if you're not absolutely certain as to how it will affect your database system.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:sql"&gt;--&lt;br /&gt;-- DROP USER-DEFINED STORED PROCEDURES&lt;br /&gt;--&lt;br /&gt;&lt;br /&gt;USE MASTER; -- Change to desired database&lt;br /&gt;GO&lt;br /&gt;SET NOCOUNT ON;&lt;br /&gt;&lt;br /&gt;PRINT '---- STARTING ----';&lt;br /&gt;&lt;br /&gt;DECLARE @UserStoredProcedureName    VARCHAR(200),&lt;br /&gt;        @Command                    VARCHAR(200);&lt;br /&gt;&lt;br /&gt;PRINT '---- Creating Cursor... ----';&lt;br /&gt;&lt;br /&gt;DECLARE SPCursor CURSOR SCROLL STATIC READ_ONLY FOR&lt;br /&gt;SELECT SPECIFIC_NAME &lt;br /&gt;  FROM INFORMATION_SCHEMA.ROUTINES&lt;br /&gt; WHERE SPECIFIC_CATALOG = 'master' -- Change to desired database&lt;br /&gt;   AND SPECIFIC_NAME IN &lt;br /&gt;   -- This inner select is likely redundant, but I'm not clear on all the &lt;br /&gt;   -- differences between sys.objects and INFORMATION_SCHEMA&lt;br /&gt; (&lt;br /&gt;    SELECT name FROM sys.objects&lt;br /&gt;     WHERE type='P'&lt;br /&gt;       AND is_ms_shipped = 0 &lt;br /&gt;       -- A value of 0 represents user-defined procs&lt;br /&gt;       -- Please note, some diagram utility stored procs don't follow this rule&lt;br /&gt; );&lt;br /&gt;&lt;br /&gt;PRINT '---- ...Finished Creating Cursor ----'&lt;br /&gt;&lt;br /&gt;PRINT '---- Opening Cursor... ----';&lt;br /&gt;&lt;br /&gt;OPEN SPCursor;&lt;br /&gt;&lt;br /&gt;PRINT '---- ...Finished Opening Cursor ----';&lt;br /&gt;&lt;br /&gt;PRINT '---- Retrieving First Rec... ----';&lt;br /&gt;&lt;br /&gt;FETCH NEXT FROM SPCursor&lt;br /&gt;INTO @UserStoredProcedureName;&lt;br /&gt;&lt;br /&gt;PRINT '---- ...Finished Retrieving First Rec ----';&lt;br /&gt;&lt;br /&gt;PRINT '---- Starting Command Loop... ----';&lt;br /&gt;&lt;br /&gt;WHILE(@@FETCH_STATUS = 0)&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;    -- Include a schema name as a prefix, if necessary&lt;br /&gt;    SET @Command = 'DROP PROCEDURE dbo.' + @UserStoredProcedureName;&lt;br /&gt;    &lt;br /&gt;    PRINT '----     executing:: ' + @Command;&lt;br /&gt;    &lt;br /&gt;    --SELECT @Command&lt;br /&gt;    &lt;br /&gt;    --***Only uncomment the line below if you're sure the correct procs will be affected***&lt;br /&gt;    --EXEC(@Command)&lt;br /&gt;    &lt;br /&gt;    FETCH NEXT FROM SPCursor&lt;br /&gt;    INTO @UserStoredProcedureName;&lt;br /&gt;    &lt;br /&gt;END;&lt;br /&gt;&lt;br /&gt;PRINT '---- ...Finished Command Loop ----';&lt;br /&gt;&lt;br /&gt;PRINT '---- Closing Cursor... ----';&lt;br /&gt;&lt;br /&gt;CLOSE SPCursor;&lt;br /&gt;&lt;br /&gt;PRINT '---- ...Done Closing Cursor ----';&lt;br /&gt;&lt;br /&gt;PRINT '---- Deallocating Cursor... ----';&lt;br /&gt;&lt;br /&gt;DEALLOCATE SPCursor;&lt;br /&gt;&lt;br /&gt;PRINT '---- ...Done Closing Cursor ----';&lt;br /&gt;&lt;br /&gt;PRINT '---- FINISHED ----';&lt;br /&gt;&lt;br /&gt;SET NOCOUNT OFF;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-1164830969700807040?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/1164830969700807040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/09/dropping-multiple-stored-procedures.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/1164830969700807040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/1164830969700807040'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/09/dropping-multiple-stored-procedures.html' title='Dropping Multiple Stored Procedures'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-6988400085163200203</id><published>2010-06-28T14:17:00.002-04:00</published><updated>2010-06-28T14:19:43.993-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pot potentiometer klipsch promedia ultra 2.0 speakers hack hacks fixes'/><title type='text'>Klipsch ProMedia Ultra 2.0 Pot Fix</title><content type='html'>One of my favorite audio companies for years now has been Klipsch. They've offered unparalleled THX certified sound for the computer audio enthusiast and as a result I've happily purchased multiple sets of speakers from them. Unfortunately, I've come to find that the volume and bass potentiometers (a.k.a. pots or rheostats) on the ProMedia Ultra 2.0 series are faulty. I put up with the irritations that go along with the knob adjustment crackling and popping sounds for a while, but finally had to do something about the issue when the sound started to cut out altogether.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I concluded there to be a couple options in this case since I'm out of warranty by at least a couple years and Klipsch no longer produces these speakers. I could have certainly attempted to switch out the pots with new, perhaps higher quality ones but this option didn't thrill me all that much because it's invasive, time consuming, and a last ditch effort in the event there are no other options. Fortunately, I was able to find evidence that people were successfully fixing the pots by opening up the speaker enclosure, spraying compressed air onto the pot, and subsequently lubricating the knob with a light oil of some variety. This solution seemed a lot better to me so that's what I went ahead and did. Sure enough, the speakers are already performing more reliably than they had been before this fix. However, I must report that as I write this they have already cut out one time and I had to turn the speakers off and on again in order to get the faulty pot to work. We'll see how things go moving forward. Who knows? I may soon find myself writing an article about replacing the potentiometer with a new one...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Mike&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-6988400085163200203?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/6988400085163200203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/06/klipsch-promedia-ultra-20-pot-fix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/6988400085163200203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/6988400085163200203'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/06/klipsch-promedia-ultra-20-pot-fix.html' title='Klipsch ProMedia Ultra 2.0 Pot Fix'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-5458226505811963139</id><published>2010-06-04T16:51:00.000-04:00</published><updated>2010-06-04T16:51:58.302-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java xerces sax javac compiler command prompt classpath sourcepath jdk j2se 1.6 shell'/><title type='text'>Compiling Java From the Command Line - Part 1</title><content type='html'>&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;More often than not Java developers end up using an IDE like Eclipse or Netbeans for writing, compiling, and packaging their projects. There's also a good chance a tool such as Ant or Maven is being leveraged in this environment. These are all great tools for productive development which I actually use myself, but they shield a developer from what's going on under the hood.&amp;nbsp;This is generally a good thing, but for those occasions when something goes wrong or you're having a hard time understanding why class Foo is not being picked up by the compiler, it's good to have an understanding of what magic is really happening underneath all the bells and whistles.&lt;br /&gt;&lt;br /&gt;In this article we'll be discussing the ins and outs of the javac compiler and how it's used with the sourcepath and classpath arguments as well as how the compilation process is affected by code packaging schemes. This article assumes you already have java 1.6 installed and properly configured on your machine and that you're using Windows XP. While some of the commands are OS-specific, the lessons are fairly universal so Unix/Linux users shouldn't have much trouble following along as well. By no means will this be an exhaustive discussion, but it should have you well on your way to using the command prompt (or shell) for compiling Java applications.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;Javac Me Gently&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Let's start with a simple example to get the ball rolling. First, open up a command prompt and get your project structure in order. Here's my sample project structure:&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\&amp;gt;cd DevProjects\ExampleProject&lt;br /&gt;C:\&amp;gt;tree /F&lt;br /&gt;C:.&lt;br /&gt;├───classes&lt;br /&gt;└───src&lt;br /&gt;        MainClassNoPkg.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;I &lt;b&gt;*strongly*&lt;/b&gt; urge you to put your code in a location that has no spaces in the folder names. It's possible to get around this, but the headaches you'll get especially with more complicated projects and tool dependencies make it not worth the hassle.&lt;br /&gt;&lt;br /&gt;and the java class, MainClassNoPkg.java, is as follows:&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;// MainClassNoPkg.java&lt;br /&gt;// Default package&lt;br /&gt;&lt;br /&gt;class MainClassNoPkg {&lt;br /&gt;    MainClassNoPkg() {}&lt;br /&gt;    &lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        System.out.println("Msg from MainClassNoPkg");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;For a text editor I've grown quite fond of gvim. It's a Windows port of the popular and ubiquitous Unix editor, Vi, and has many powerful text editing features. I highly recommend learning an editor like this, but it's not something you pick up overnight so feel free to use any plain text editor you like for this tutorial.&lt;br /&gt;&lt;br /&gt;The last thing I'd like you to do here is clear out the CLASSPATH environment variable. More on why I'm having you do this later, but for now just go with it and run the following in your command shell:&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;set CLASSPATH=&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Now let's run javac and see what happens...&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;javac -verbose src\MainClassNoPkg.java&lt;br /&gt;[parsing started src\MainClassNoPkg.java]&lt;br /&gt;[parsing completed 31ms]&lt;br /&gt;[search path for source files: .]&lt;br /&gt;[search path for class files: C:\java\jdk1.6.0_18\jre\lib\resources.jar,C:\java\&lt;br /&gt;jdk1.6.0_18\jre\lib\rt.jar,C:\java\jdk1.6.0_18\jre\lib\sunrsasign.jar,C:\java\jd&lt;br /&gt;k1.6.0_18\jre\lib\jsse.jar,C:\java\jdk1.6.0_18\jre\lib\jce.jar,C:\java\jdk1.6.0_&lt;br /&gt;18\jre\lib\charsets.jar,C:\java\jdk1.6.0_18\jre\classes,C:\java\jdk1.6.0_18\jre\&lt;br /&gt;lib\ext\dnsns.jar,C:\java\jdk1.6.0_18\jre\lib\ext\localedata.jar,C:\java\jdk1.6.&lt;br /&gt;0_18\jre\lib\ext\sunjce_provider.jar,C:\java\jdk1.6.0_18\jre\lib\ext\sunmscapi.j&lt;br /&gt;ar,C:\java\jdk1.6.0_18\jre\lib\ext\sunpkcs11.jar,.]&lt;br /&gt;[loading java\lang\Object.class(java\lang:Object.class)]&lt;br /&gt;[loading java\lang\String.class(java\lang:String.class)]&lt;br /&gt;[checking MainClassNoPkg]&lt;br /&gt;[loading java\lang\System.class(java\lang:System.class)]&lt;br /&gt;[loading java\io\PrintStream.class(java\io:PrintStream.class)]&lt;br /&gt;[loading java\io\FilterOutputStream.class(java\io:FilterOutputStream.class)]&lt;br /&gt;[loading java\io\OutputStream.class(java\io:OutputStream.class)]&lt;br /&gt;[wrote src\MainClassNoPkg.class]&lt;br /&gt;[total 297ms]&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;That might look overwhelming at first, but bear with me and all we'll walk through it. On the first line we're actually executing &lt;b&gt;javac&lt;/b&gt;. I've intentionally included the -verbose argument so we can take a look at what's going on under the hood, but normally you can feel free to leave it out. Immediately following you will see the reference to our MainClassNoPkg.java class file we wrote. Everything else that follows is output from the javac compiler.&lt;br /&gt;&lt;br /&gt;First, you can see that the compiler picked up our java source file and parsed it. Notice that immediately following the compiler mentions searching paths for source and class files. The default for both sourcepath and classpath is the current directory. In addition, the compiler will add the bootstrap and extension classes that shipped with the javac compiler being used, though you can modify this behavior with the -&lt;b&gt;bootclasspath &lt;/b&gt;and&lt;b&gt; -extdirs&lt;span class="Apple-style-span" style="font-weight: normal;"&gt; options if you wish&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;. However, we won't be changing these options in this article. You can see all the bootstrap and ext classes listed in the output for the class file search path. Finally, the output shows the compiler loading the classes MainClassNoPkg references.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;For one simple java source file that was pretty painless, right? You could even simplify this further by using wildcards&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;javac src\*.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;But we've only compiled one file, you might say. The standard Java tutorial shows me how to do that, there must be more to it than this, right? Indeed, there is. Next we'll discuss compiling multiple source files at once and using the -&lt;b&gt;sourcepath&lt;/b&gt; and -&lt;b&gt;classpath&lt;/b&gt;&amp;nbsp;options.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;Let's Get To the Source&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;In this section I'm going to cover how the compiler searches for your uncompiled Java source files and turns them into executable bytecode. We're going to add to our example now by creating another class appropriately named &lt;b&gt;AnotherClass&lt;/b&gt;&amp;nbsp;with the following contents&lt;/div&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;// AnotherClass.java&lt;br /&gt;// Default package&lt;br /&gt;&lt;br /&gt;class AnotherClass {&lt;br /&gt;    AnotherClass() {}&lt;br /&gt;&lt;br /&gt;    public void printMessage(String msg) {&lt;br /&gt;        System.out.println("The message is: " + msg);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Next, modify the MainClassNoPkg.java to use the newly created class.&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;// MainClassNoPkg.java&lt;br /&gt;// Default package&lt;br /&gt;&lt;br /&gt;class MainClassNoPkg {&lt;br /&gt;    MainClassNoPkg() {}&lt;br /&gt;    &lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        System.out.println("Msg from MainClassNoPkg");&lt;br /&gt;        AnotherClass lAnother = new AnotherClass();&lt;br /&gt;        lAnother.printMessage("Hello Java developers!");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Your source tree should look as follows, assuming you've cleaned up the previously created &lt;i&gt;.class&lt;/i&gt; file.&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;tree /F&lt;br /&gt;Folder PATH listing&lt;br /&gt;Volume serial number is&lt;br /&gt;C:.&lt;br /&gt;├───classes&lt;br /&gt;└───src&lt;br /&gt;        AnotherClass.java&lt;br /&gt;        MainClassNoPkg.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Now run javac as we did before, specifying the main class name. Don't use the wildcard character this time.&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;javac src\MainClassNoPkg.java&lt;br /&gt;src\MainClassNoPkg.java:8: cannot find symbol&lt;br /&gt;symbol  : class AnotherClass&lt;br /&gt;location: class MainClassNoPkg&lt;br /&gt;        AnotherClass lAnother = new AnotherClass();&lt;br /&gt;        ^&lt;br /&gt;src\MainClassNoPkg.java:8: cannot find symbol&lt;br /&gt;symbol  : class AnotherClass&lt;br /&gt;location: class MainClassNoPkg&lt;br /&gt;        AnotherClass lAnother = new AnotherClass();&lt;br /&gt;                                    ^&lt;br /&gt;2 errors&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Uh-oh what happened!? That is most definitely NOT what we want to happen, but no worries as this was just a way to make a point about how the javac compiler finds the classes it needs during compilation. Remember when we cleared out the &lt;b&gt;CLASSPATH&lt;/b&gt; environment variable? By doing so we instructed javac to default it's classpath to the current directory (normally denoted by a period). The compiler also takes a &lt;b&gt;-sourcepath&lt;/b&gt; argument and when we don't specify this the default is also the current directory.&lt;br /&gt;&lt;br /&gt;The point to make here is that while we specified a java file to compile in the &lt;i&gt;src&lt;/i&gt; directory, the compiler couldn't find the referenced &lt;i&gt;AnotherClass.java&lt;/i&gt; file. Why, you might ask? But isn't the compiler smart enough to grab other files in the same directory as the source file we instructed it to compile? Well, no actually. The Java compiler does not really do any searching based on the source files (and their paths) you pass as arguments to javac. If you want javac to find &lt;i&gt;AnotherClass.java&lt;/i&gt; you have to handle it like this:&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;javac -sourcepath src src\MainClassNoPkg.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;or this&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;javac -cp src src\MainClassNoPkg.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;or this&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;cd src&lt;br /&gt;C:\DevProjects\ExampleProject\src&amp;gt;javac MainClassNoPkg.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;In the first two examples we specified a location for the compiler to find other ancillary classes by passing the &lt;i&gt;src&lt;/i&gt; directory as the &lt;b&gt;-sourcepath&lt;/b&gt; or &lt;b&gt;-cp&lt;/b&gt; (same as &lt;b&gt;-classpath&lt;/b&gt;) options. In the third example we cd'ed into the src directory and executed the javac command. Specifying a sourcepath or classpath was unnecessary because remember that the compiler uses the current directory as the default when those options aren't specified. If you need to pass more than one directory, simply separate them with a semicolon (;), no spaces. Also note that we could have set the CLASSPATH environment variable instead of using the command line arguments. This is particularly well-suited for long path definitions or for occasions when you'll need to run the javac command more than once.&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;A more complete order of operations for searching for source files is as follows and additional details can be found in the javac documentation listed in the references at the end of this article.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;paths listed via the&amp;nbsp;&lt;b&gt;-sourcepath&lt;/b&gt;&amp;nbsp;option are searched&lt;/li&gt;&lt;li&gt;&lt;b&gt;-cp&lt;/b&gt;&amp;nbsp;or&amp;nbsp;&lt;b&gt;-classpath&lt;/b&gt;&amp;nbsp;arguments are searched&lt;/li&gt;&lt;li&gt;The&amp;nbsp;&lt;b&gt;CLASSPATH&lt;/b&gt;&amp;nbsp;environment variable is searched&lt;/li&gt;&lt;li&gt;The current directory&lt;/li&gt;&lt;/ol&gt;OK, now assuming you've successfully run one of the examples above, the compiler should spit out a couple .class files and you should be able to run your program without any errors as follows:&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;java -cp src MainClassNoPkg&lt;br /&gt;Msg from MainClassNoPkg&lt;br /&gt;The message is: Hello Java developers!&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The point in this section's example is to show that you &lt;b&gt;must&lt;/b&gt;&amp;nbsp;include the relative or absolute path in your source file list and you must include at least one reference to a source file, whether by wildcard or explicit declaration, regardless of what you include as arguments to &lt;b&gt;-cp&lt;/b&gt; and &lt;b&gt;-sourcepath&lt;/b&gt;. The following, while seemingly clever enough and seemingly within javac's rules, just simply will not work!&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;javac -sourcepath src *.java&lt;br /&gt;javac: file not found: *.java&lt;br /&gt;Usage: javac &amp;lt;options&amp;gt; &amp;lt;source files&amp;gt;&lt;br /&gt;use -help for a list of possible options&lt;br /&gt;&lt;br /&gt;C:\DevProjects\ExampleProject&amp;gt;javac -sourcepath src MainClassNoPkg.java&lt;br /&gt;javac: file not found: MainClassNoPkg.java&lt;br /&gt;Usage: javac &amp;lt;options&amp;gt; &amp;lt;source files&amp;gt;&lt;br /&gt;use -help for a list of possible options&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Furthermore, the&amp;nbsp;compiler will oblige you to grab source files referenced by any source files you are compiling, but &lt;b&gt;only&lt;/b&gt;&amp;nbsp;if it can find them on the source or class paths. There is simply no way to instruct javac to search recursively for a source or class file. This comes into play when we deal with packages, but we'll discuss this further in the next section. Now onto our next lesson, compiling using references to source that's already been compiled.&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;Javac and Source Files Vs. Class Files and JARs - What the Diff?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;We've already compiled a number of example projects so now let's expand on this code to illustrate another point - how javac treats java source files differently from previously-compiled class files (java bytecode in a file with a&amp;nbsp;&lt;i&gt;.class&lt;/i&gt;&amp;nbsp;extension).&lt;br /&gt;&lt;br /&gt;Imagine you've been coding a project for a while now and have numerous source files distributed across multiple packages (we'll cover this later) and projects and are using a couple external libraries. Obviously, there are times that we might not want to compile every last bit of code in our project, but more importantly there are times when this might not be feasible. Think of the situation where you've purchased a jar file from an external company and all you've received is compiled java bytecode. In other words, you don't have the source code because it's proprietary. But you still want to use the wonderful API/library that, perhaps ClevelandFlash, has developed for you. Will ClevelandFlash let it be so? Can this be done? Of course it can! Otherwise we wouldn't be here and instead developers would be off using some other language for its code reuse facilities. Even if you have access to the source code, which is par for the course for open source projects (thus the term "open source!"), you don't want to be compiling them from source unless absolutely necessary. Leveraging previously compiled code is in fact pretty simple to do, but first let's modify our code so that it's not using the yucky default package anymore.&lt;br /&gt;&lt;br /&gt;Hopefully you're familiar with Java packages as I'm not going to go into the details here, but if not no worries as you should still be able to run the examples. I do, however highly recommend your taking the time to check out the Java Tutorials &lt;a href="http://java.sun.com/docs/books/tutorial/java/concepts/package.html"&gt;basic package explanation&lt;/a&gt; and &lt;a href="http://java.sun.com/docs/books/tutorial/java/package/index.html"&gt;package trail&lt;/a&gt;&amp;nbsp;at your earliest convenience. Okay, onto the examples now. First, let's move our java source files to their new package locations and rename &lt;i&gt;MainClassNoPkg&lt;/i&gt; to &lt;i&gt;MainClass&lt;/i&gt;. I'm going to be using &lt;i&gt;com.clevelandflash&lt;/i&gt; as my root package name to stick with convention, but you're free to use your own values here if you wish. Just be sure to adjust the source code and command prompt commands accordingly to reflect these changes!&lt;br /&gt;&lt;br /&gt;My tree now looks like the following&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;tree /F&lt;br /&gt;Folder PATH listing&lt;br /&gt;Volume serial number is&lt;br /&gt;C:.&lt;br /&gt;├───classes&lt;br /&gt;└───src&lt;br /&gt;    └───com&lt;br /&gt;        └───clevelandflash&lt;br /&gt;            └───javac_tut&lt;br /&gt;                ├───core&lt;br /&gt;                │       MainClass.java&lt;br /&gt;                │&lt;br /&gt;                └───helper&lt;br /&gt;                        AnotherClass.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;And here are the updated source files:&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;// MainClass.java&lt;br /&gt;// No longer the default package&lt;br /&gt;package com.clevelandflash.javac_tut.core;&lt;br /&gt;&lt;br /&gt;import com.clevelandflash.javac_tut.helper.AnotherClass;&lt;br /&gt;&lt;br /&gt;class MainClass {&lt;br /&gt;    MainClass() {}&lt;br /&gt;    &lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        System.out.println("Msg from MainClass");&lt;br /&gt;        AnotherClass lAnother = new AnotherClass();&lt;br /&gt;        lAnother.printMessage("Hello Java developers!");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;// AnotherClass.java&lt;br /&gt;// No longer the default package&lt;br /&gt;package com.clevelandflash.javac_tut.helper;&lt;br /&gt;&lt;br /&gt;public class AnotherClass {&lt;br /&gt;    public AnotherClass() {}&lt;br /&gt;&lt;br /&gt;    public void printMessage(String msg) {&lt;br /&gt;        System.out.println("The message is: " + msg);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Now, run the following command&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;javac -d classes -sourcepath src src\com\cleveland&lt;br /&gt;flash\javac_tut\core\MainClass.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Here we've used the &lt;b&gt;-d&lt;/b&gt; option with a value of &lt;i&gt;classes&lt;/i&gt;&amp;nbsp;to instruct the Java compiler to output the &lt;i&gt;.class&lt;/i&gt; files to the &lt;i&gt;classes&lt;/i&gt; directory rather than alongside the &lt;i&gt;.java&lt;/i&gt; source files, as is the default. The compiler does something additionally useful in that it automatically generates the package folder structure in the output directory. Cool!&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;tree /F&lt;br /&gt;Folder PATH listing&lt;br /&gt;Volume serial number is&lt;br /&gt;C:.&lt;br /&gt;├───classes&lt;br /&gt;│   └───com&lt;br /&gt;│       └───clevelandflash&lt;br /&gt;│           └───javac_tut&lt;br /&gt;│               ├───core&lt;br /&gt;│               │       MainClass.class&lt;br /&gt;│               │&lt;br /&gt;│               └───helper&lt;br /&gt;│                       AnotherClass.class&lt;br /&gt;│&lt;br /&gt;└───src&lt;br /&gt;    └───com&lt;br /&gt;        └───clevelandflash&lt;br /&gt;            └───javac_tut&lt;br /&gt;                ├───core&lt;br /&gt;                │       MainClass.java&lt;br /&gt;                │&lt;br /&gt;                └───helper&lt;br /&gt;                        AnotherClass.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This is really good considering the Java language &lt;i&gt;requires&lt;/i&gt;&amp;nbsp;you to match the folder structure to your package names. One small exception, though not considered a best practice, would be if you had a source file in the &lt;i&gt;core&lt;/i&gt;&amp;nbsp;directory but left it declared as part of the default package. Javac would compile it just fine, but when it writes out the &lt;i&gt;.class&lt;/i&gt; file it would put it in &lt;i&gt;.\classes&lt;/i&gt; instead of in &lt;i&gt;.\classes\com\clevelandflash\javac_tut\core&lt;/i&gt;. Another important thing to note is that unless you use the &lt;i&gt;*.java&lt;/i&gt; wildcard on a each directory or enumerate each file that needs compiling, the compiler will NOT pick up non-referenced source files. So for instance, if you had a file IO helper class (just thinking of something random here) in the &lt;i&gt;helper&lt;/i&gt;&amp;nbsp;directory that was atomic from the rest of the code, you'd have to be sure and include it in your javac command explicitly, otherwise it won't get compiled. The compiler only picks up necessary references (i.e. import statements in code) or files you explicitly declared in the source files list when calling javac. Make sense so far? Good! Let's just run our sample real quick to make sure everything works with our new package structure.&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;java -cp classes com.clevelandflash.javac_tut.core&lt;br /&gt;.MainClass&lt;br /&gt;Msg from MainClass&lt;br /&gt;The message is: Hello Java developers!&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Looks good, but I do want to draw attention to the fact that you need to specify two things&amp;nbsp;when running the program so that the JVM can find your program. First, you must specify the classpath to include the &lt;i&gt;classes&amp;nbsp;&lt;/i&gt;directory, and second, call the class that contains the&amp;nbsp;&lt;i&gt;main&lt;/i&gt;&amp;nbsp;method (&lt;i&gt;MainClass&lt;/i&gt;) by its full qualified name. If you went through the packages trail on the Java tuts site (if you didn't, now's a great time) you would immediately notice this is done simply by appending the class's package name as a prefix to the class name. If you've made it this far, you're well on your way to understanding Java compilation and classpaths from the command line. Thanks for reading!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;But You Didn't Cover JAR and External Class Files Yet!@#%&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The last section was just getting so long and it seemed only appropriate to wrap it up. Alright, on with the show as promised. In this final section we'll be compiling source code against some external libraries as well as some previously compiled code that we wrote ourselves. First thing's first, we need to setup another project directory and download a good library to use for our code examples.&lt;br /&gt;&lt;br /&gt;Modify your folder setup so that you now have another project named &lt;i&gt;LibProject&lt;/i&gt; at the same level as &lt;i&gt;ExamplProject&lt;/i&gt;. Mine looks like this:&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\LibProject&amp;gt;tree /F&lt;br /&gt;Folder PATH listing&lt;br /&gt;Volume serial number is&lt;br /&gt;C:.&lt;br /&gt;├───classes&lt;br /&gt;├───lib&lt;br /&gt;├───resources&lt;br /&gt;└───src&lt;br /&gt;    └───com&lt;br /&gt;        └───clevelandflash&lt;br /&gt;            └───goodtimes&lt;br /&gt;                ├───core&lt;br /&gt;                │       ClassForXerces.java&lt;br /&gt;                │&lt;br /&gt;                └───model&lt;br /&gt;                        Company.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Go ahead and also create the additional subdirectories and files as I have shown above. We'll work out the source code for the two java files shortly but first we need to find a library.&lt;br /&gt;&lt;br /&gt;Just for fun, let's go with the Xerces XML parser. XML parsing, while potentially memory intensive, is a very popular and necessary activity for programmers these days. You can download it for yourself here - &lt;a href="http://xerces.apache.org/xerces2-j/"&gt;Xerces2 Java Parser&lt;/a&gt;. I'm not going to go into setup instructions, but at the very least you'll need the following jar files:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;resolver.jar&lt;/li&gt;&lt;li&gt;serializer.jar&lt;/li&gt;&lt;li&gt;xercesImpl.jar&lt;/li&gt;&lt;li&gt;xml-apis.jar&lt;/li&gt;&lt;/ul&gt;Let's put these in the &lt;i&gt;lib&lt;/i&gt; directory located in the&amp;nbsp;&lt;i&gt;LibProject&lt;/i&gt; you just created. Also, we're going to need an XML file to work with. Seeing as the focus of this article is not XML nor Xerces, we'll save the complicated examples for another day and use something simple. This is the XML file, &lt;i&gt;companies.xml&lt;/i&gt;.&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;&amp;lt;companies&amp;gt; &lt;br /&gt;    &amp;lt;company status="spectacular"&amp;gt;ClevelandFlash&amp;lt;/company&amp;gt; &lt;br /&gt;    &amp;lt;company status="good"&amp;gt;Some Company&amp;lt;/company&amp;gt; &lt;br /&gt;    &amp;lt;company status="bad"&amp;gt;Terrible Corporation&amp;lt;/company&amp;gt; &lt;br /&gt;&amp;lt;/companies&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;You can also download it here if you're so inclined&amp;nbsp;&lt;a href="https://doc-0c-1k-docs.googleusercontent.com/docs/secure/ha0ro937gcuc7l7deffksulhg5h7mbp1/09fnpjan4kc44ha97g6cn5juvugbpl9e/1275609600000/00152762195717067162/*/0B-pBKof3gA9WODU3ZjgwMTgtNzU4Mi00ZDQ5LTg0MTMtMzViZWYxNTdjMDM4"&gt;companies.xml&lt;/a&gt;. Place this in &lt;i&gt;resources&lt;/i&gt;&amp;nbsp;directory in your &lt;i&gt;LibProject&lt;/i&gt; folder.&lt;br /&gt;&lt;br /&gt;Okay, so let's code something already. We'll put the XML parsing code in &lt;i&gt;ClassForXerces.java&lt;/i&gt;&amp;nbsp;and the model structure in &lt;i&gt;Company.java&lt;/i&gt;. This is an admittedly contrived example with very little if any emphasis on elegant design patterns, but we're not really concerned with that right now.&lt;br /&gt;&lt;br /&gt;Here's &lt;a href="http://docs.google.com/leaf?id=0B-pBKof3gA9WMTFjNjE1MTctMjkzMS00MDEyLThmYjktNzRmMzEyM2QwYTc5&amp;amp;hl=en"&gt;ClassForXerces.java&lt;/a&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;package com.clevelandflash.goodtimes.core;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import javax.xml.parsers.FactoryConfigurationError;&lt;br /&gt;import javax.xml.parsers.ParserConfigurationException;&lt;br /&gt;import javax.xml.parsers.SAXParser;&lt;br /&gt;import javax.xml.parsers.SAXParserFactory;&lt;br /&gt;&lt;br /&gt;import org.xml.sax.Attributes;&lt;br /&gt;import org.xml.sax.helpers.DefaultHandler;&lt;br /&gt;import org.xml.sax.SAXException;&lt;br /&gt;&lt;br /&gt;import com.clevelandflash.goodtimes.model.Company;&lt;br /&gt;&lt;br /&gt;public class ClassForXerces extends DefaultHandler {&lt;br /&gt;    private Company mCompany;&lt;br /&gt;    private StringBuffer mCurrentName;&lt;br /&gt;    private String mCurrentStatus;&lt;br /&gt;&lt;br /&gt;    public ClassForXerces() {&lt;br /&gt;        this.mCompany = new Company();&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    public Company getCompany() {&lt;br /&gt;        return this.mCompany;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void parseFile(String pFileToParse) {&lt;br /&gt;        SAXParserFactory lSpf = SAXParserFactory.newInstance();&lt;br /&gt;        try {&lt;br /&gt;            SAXParser lSp = lSpf.newSAXParser();&lt;br /&gt;            lSp.parse(pFileToParse, this);&lt;br /&gt;        } catch(FactoryConfigurationError fce) {&lt;br /&gt;            fce.printStackTrace();&lt;br /&gt;        } catch(ParserConfigurationException pce) {&lt;br /&gt;            pce.printStackTrace();&lt;br /&gt;        } catch(SAXException se) {&lt;br /&gt;            se.printStackTrace();&lt;br /&gt;        } catch(IOException ioe) {&lt;br /&gt;            ioe.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // Handle events from SAX parsing&lt;br /&gt;    &lt;br /&gt;    public void startDocument () {&lt;br /&gt;        System.out.println("Start document");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    public void endDocument () {&lt;br /&gt;        System.out.println("End document");&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    public void startElement(String pUri, String pName, String pQName, Attributes pAtts) {&lt;br /&gt;        this.mCurrentName = new StringBuffer();&lt;br /&gt;        this.mCurrentStatus = "";&lt;br /&gt;        if(pQName.equalsIgnoreCase("company")) {&lt;br /&gt;            this.mCurrentStatus = pAtts.getValue("status");&lt;br /&gt;            if(this.mCurrentStatus.equalsIgnoreCase("spectacular")) {&lt;br /&gt;                this.mCompany.setStatus(pAtts.getValue("status"));&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void characters(char pCh[], int pStart, int pLength) {&lt;br /&gt;        this.mCurrentName.append(new String(pCh, pStart, pLength));&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void endElement(String pUri, String pName, String pQName) {&lt;br /&gt;        if(pQName.equalsIgnoreCase("company")) {&lt;br /&gt;            if(this.mCurrentStatus.equals("spectacular")) {&lt;br /&gt;                this.mCompany.setName(mCurrentName.toString());&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;     &lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;and &lt;a href="http://docs.google.com/leaf?id=0B-pBKof3gA9WMmMzMjhmMmUtZjk3YS00YTA4LTllODktNTAyOWEyMWUwZjNj&amp;amp;hl=en"&gt;Company.java&lt;/a&gt;, our model class that will act as a container for Company data:&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;package com.clevelandflash.goodtimes.model;&lt;br /&gt;&lt;br /&gt;public class Company {&lt;br /&gt;    private String mStatus;&lt;br /&gt;    private String mName;&lt;br /&gt;&lt;br /&gt;    public Company() {}&lt;br /&gt;&lt;br /&gt;    public Company(String pStatus, String pName) {&lt;br /&gt;        this.mStatus = pStatus;&lt;br /&gt;        this.mName = pName;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // Getters and Setters&lt;br /&gt;&lt;br /&gt;    public void setStatus(String pStatus) {&lt;br /&gt;        this.mStatus = pStatus;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public String getStatus() {&lt;br /&gt;        return this.mStatus;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void setName(String pName) {&lt;br /&gt;        this.mName = pName;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public String getName() {&lt;br /&gt;        return this.mName;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // Override toString so we have something pretty to show&lt;br /&gt;    public String toString() {&lt;br /&gt;        StringBuffer lSb = new StringBuffer();&lt;br /&gt;        lSb.append("Company detail: ");&lt;br /&gt;        lSb.append("name=" + getName() + ", ");&lt;br /&gt;        lSb.append("status=" + getStatus());&lt;br /&gt;&lt;br /&gt;        return lSb.toString();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Also go ahead and update &lt;i&gt;MainClass.java&lt;/i&gt; to use the Xerces parser classes we created in &lt;i&gt;LibProject&lt;/i&gt;:&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;// No longer the default package&lt;br /&gt;package com.clevelandflash.javac_tut.core;&lt;br /&gt;&lt;br /&gt;import com.clevelandflash.goodtimes.core.ClassForXerces;&lt;br /&gt;import com.clevelandflash.goodtimes.model.Company;&lt;br /&gt;import com.clevelandflash.javac_tut.helper.AnotherClass;&lt;br /&gt;&lt;br /&gt;class MainClass {&lt;br /&gt;    MainClass() {}&lt;br /&gt;    &lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        System.out.println("Msg from MainClass");&lt;br /&gt;        AnotherClass lAnother = new AnotherClass();&lt;br /&gt;        lAnother.printMessage("Hello Java developers!");&lt;br /&gt;&lt;br /&gt;        // Use Xerces!&lt;br /&gt;        ClassForXerces lParser = new ClassForXerces();&lt;br /&gt;        lParser.parseFile("..\\LibProject\\resources\\Companies.xml");&lt;br /&gt;        Company lComp = lParser.getCompany();&lt;br /&gt;        System.out.println("Found a company here...");&lt;br /&gt;        System.out.println(lComp.toString());&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Now that you've typed, copied/pasted, or dictated your way through getting that code where it needs to be we're ready to compile. The first logical thing we'll want to do is compile the LibProject source code and this will be our first chance to include some external Java libraries (jars) in our compilation. There are no other code dependencies, unlike &lt;i&gt;ExampleProject &lt;/i&gt;which depends on &lt;i&gt;LibProject&lt;/i&gt;, so it's safe to start here when compiling. At this time, go ahead and clear out any previously compiled &lt;i&gt;.class&lt;/i&gt;&amp;nbsp;files from your projects as well as the entire directory tree under the &lt;i&gt;classes&lt;/i&gt;&amp;nbsp;directories&amp;nbsp;so we have a fresh start. Your project directories in their clean state should look like the following:&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\LibProject&amp;gt;tree /F&lt;br /&gt;Folder PATH listing&lt;br /&gt;Volume serial number is&lt;br /&gt;C:.&lt;br /&gt;├───classes&lt;br /&gt;├───lib&lt;br /&gt;│       resolver.jar&lt;br /&gt;│       serializer.jar&lt;br /&gt;│       xercesImpl.jar&lt;br /&gt;│       xml-apis.jar&lt;br /&gt;│&lt;br /&gt;├───resources&lt;br /&gt;│       companies.xml&lt;br /&gt;│&lt;br /&gt;└───src&lt;br /&gt;    └───com&lt;br /&gt;        └───clevelandflash&lt;br /&gt;            └───goodtimes&lt;br /&gt;                ├───core&lt;br /&gt;                │       ClassForXerces.java&lt;br /&gt;                │&lt;br /&gt;                └───model&lt;br /&gt;                        Company.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;tree /F&lt;br /&gt;Folder PATH listing&lt;br /&gt;Volume serial number is&lt;br /&gt;C:.&lt;br /&gt;├───classes&lt;br /&gt;└───src&lt;br /&gt;    └───com&lt;br /&gt;        └───clevelandflash&lt;br /&gt;            └───javac_tut&lt;br /&gt;                ├───core&lt;br /&gt;                │       MainClass.java&lt;br /&gt;                │&lt;br /&gt;                └───helper&lt;br /&gt;                        AnotherClass.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Now, navigate to the LibProject directory and execute the following:&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\LibProject&amp;gt;javac -d classes -cp "lib/*" -sourcepath src src\com\c&lt;br /&gt;levelandflash\goodtimes\core\ClassForXerces.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;You shouldn't receive any errors. If you do, you should first do a thorough job reading the error output to make sure it's not something simple like a misspelled word (case sensitivity matters in Java, if you haven't run into this yet) or missing semicolon.&lt;br /&gt;&lt;br /&gt;The first argument to javac you should recognize from earlier - we're just telling the compiler again to output compiled bytecode to the &lt;i&gt;classes&lt;/i&gt; directory instead of alongside our source files. The next argument, &lt;b&gt;-cp&lt;/b&gt;, is where the dependency magic really happens. Here we're telling the compiler to include &lt;i&gt;lib&lt;/i&gt;&amp;nbsp;directory on the classpath. Even better, the compiler allows us to use the wildcard symbol "*" to automatically include any and all jar files that happen to be in that directory. This saves us from having to type every single jar file in the classpath, though you could just as easily do that if you so desire. One more thing to note is that in using the wildcard symbol I'm forced to surround my classpath with quotes. This isn't true for all environments but it is for my Windows XP machine as it's currently configured. Again, check the javac documentation in the references below for more information about using the &lt;b&gt;-classpath&lt;/b&gt; argument. The next argument, &lt;b&gt;-sourcepath&lt;/b&gt;, is nothing special and again we include the full relative (that's relative from where we're executing javac) path to the root class we want to compile.&lt;br /&gt;&lt;br /&gt;Now, navigate to the ExampleProject directory and execute the following:&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;javac -d classes -cp ..\LibProject\classes -source&lt;br /&gt;path src src\com\clevelandflash\javac_tut\core\MainClass.java&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This time we're leveraging the classes we just compiled from &lt;i&gt;LibProject&lt;/i&gt;, thus we include their relative root compiled classes location as a classpath argument to javac. Unlike when we compiled LibProject there's no need to include the Xerces jar files on the classpath. Why? Because while the project ultimately needs those jars to execute, the dependency on them is further down the chain and we've already compiled the code that depends on those jars directly. In other words, since &lt;i&gt;ExampleProject&lt;/i&gt;'s source code doesn't directly rely on the Xerces jars, we don't need to worry about them when compiling &lt;i&gt;ExampleProject&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;The last thing for us to do is run our little experiment with the java tool. So finally, type the following in your command prompt and hit enter.&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;C:\DevProjects\ExampleProject&amp;gt;java -cp ..\LibProject\classes;..\LibProject\lib\*&lt;br /&gt;;classes com.clevelandflash.javac_tut.core.MainClass&lt;br /&gt;Msg from MainClass&lt;br /&gt;The message is: Hello Java developers!&lt;br /&gt;Start document&lt;br /&gt;End document&lt;br /&gt;Found a company here...&lt;br /&gt;Company detail: name=ClevelandFlash, status=spectacular&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Assuming all goes as planned, you should see the output as I've shown above. This time, the classpath includes references to the classes directories for both projects as well as the &lt;i&gt;lib &lt;/i&gt;directory from the &lt;i&gt;LibProject&lt;/i&gt;. Remember when I said you'd still need to think about that? Now, had our code not actually invoked any classes/methods that depended on those Xerces jar files we would not run into any problems. However, if you want to see what happens, rerun the example excluding the jar directory on the classpath, and you will be greeted with a grotesque error message from the JVM complaining about not being able to find such and such class. Last thing to note - the path you include to the Companies.xml file is relative to where you are actually call "java" from. Just something to keep in mind if you decide to do some of your own tinkering (which I encourage). Sorry, just one more thing... Those Xerces jars I had you download? Well, they come packaged with Java as of JDK 1.5, so really we probably didn't need to download them separately. But then again, that would have ruined the jar dependency lesson ;-) Okay, that's about it for this article on using the Java compiler and Java execution tool from the command line.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;Conclusion&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Give yourself a hand! In the world of advanced tooling and IDEs, many developers never get a chance to learn the basics and sometimes they just plain forget them. Now that you understand the Java compiler, go download Ant, or better yet, Maven!&lt;br /&gt;&lt;br /&gt;Thank you for reading and I hope this article leaves you much more informed in compiling and running your own projects. Stay tuned for the next part in this series when I show you how to create your own class libraries in conjunction with the jar command!&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Mike&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Reference:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://java.sun.com/javase/6/docs/technotes/tools/windows/classpath.html"&gt;http://java.sun.com/javase/6/docs/technotes/tools/windows/classpath.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html"&gt;http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://openjdk.java.net/groups/compiler/"&gt;http://openjdk.java.net/groups/compiler/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.sun.com/docs/books/tutorial/reallybigindex.html"&gt;http://java.sun.com/docs/books/tutorial/reallybigindex.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.saxproject.org/"&gt;http://www.saxproject.org/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-5458226505811963139?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/5458226505811963139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/06/compiling-java-from-command-line-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/5458226505811963139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/5458226505811963139'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/06/compiling-java-from-command-line-part-1.html' title='Compiling Java From the Command Line - Part 1'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-3632535703617648855</id><published>2010-05-26T11:32:00.003-04:00</published><updated>2010-05-26T11:41:27.390-04:00</updated><title type='text'>Where to Find Previous Java JDK Releases</title><content type='html'>Today I was trying to update my JDK installation to include the src.zip file. For whatever reason it didn't install with the JDK+EE install I did months back and I it's really nice to include it with your Eclipse IDE. If you're looking for a specific version of a previous version of the Java platform (JDK, JRE, etc.) simply go here - &lt;a href="http://java.sun.com/products/archive/"&gt;http://java.sun.com/products/archive/&lt;/a&gt; - this will give you anything and everything you could hope for and it beats having to navigate through the Java website.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;~Mike&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-3632535703617648855?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/3632535703617648855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/05/where-to-find-previous-java-jdk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/3632535703617648855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/3632535703617648855'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/05/where-to-find-previous-java-jdk.html' title='Where to Find Previous Java JDK Releases'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-6627666654147743984</id><published>2010-03-27T14:11:00.002-04:00</published><updated>2010-03-27T14:13:31.226-04:00</updated><title type='text'>Turing machine</title><content type='html'>A friend of mine passed along this excellent site about a guy who put together his own Turing machine using a Parallax microcontroller. Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://aturingmachine.com/"&gt;http://aturingmachine.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-6627666654147743984?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/6627666654147743984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2010/03/turing-machine.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/6627666654147743984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/6627666654147743984'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2010/03/turing-machine.html' title='Turing machine'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-2731405208638376403</id><published>2009-11-05T13:31:00.003-05:00</published><updated>2009-11-05T13:34:50.280-05:00</updated><title type='text'>Format Blogger Source Code</title><content type='html'>Just in case anyone is wondering, I use the following utility for formatting source code in my blog posts.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://formatmysourcecode.blogspot.com/"&gt;http://formatmysourcecode.blogspot.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Mucho thanks to that guy for setting it up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-2731405208638376403?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/2731405208638376403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2009/11/format-blogger-source-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/2731405208638376403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/2731405208638376403'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2009/11/format-blogger-source-code.html' title='Format Blogger Source Code'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-9073248168181467134</id><published>2009-11-05T12:45:00.005-05:00</published><updated>2009-11-05T13:30:15.712-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sqlserver sql server sqlcmd'/><title type='text'>Sql Server - Execute multiple scripts from a master script</title><content type='html'>I was fiddling about with Sql Server Management Studio today trying to come up with a way to setup a master .sql script that would call numerous other scripts. What I landed on was the &lt;span style="font-style: italic;"&gt;sqlcmd&lt;/span&gt; command line utility. I'd have liked to have run this from the query editor itself, however the option that presented itself there was a stored proc named &lt;span style="font-style: italic;"&gt;xp_cmdshell&lt;/span&gt;. I didn't feel like messing around with my security settings locally (it's apparently turned off by default for security concerns) and figured it would be an issue with the remote host as well, so I went ahead with &lt;span style="font-style: italic;"&gt;sqlcmd&lt;/span&gt; instead.&lt;br /&gt;&lt;br /&gt;Basically, I set up a simple batch script I called &lt;span style="font-style: italic;"&gt;dbCreate.bat&lt;/span&gt; and put the following commands in it:&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;sqlcmd -E -dMyDatabaseName -iDBCreateAll.sql&lt;br /&gt;pause&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The -E argument tells the script to use your local machine's permissions. You'll need to change this for operations on a remote host. I'll provide a reference page in the links at the end of this article. The "-d" option allows you to specify the database context you want to work with. It's like including the "USE &lt;dbname&gt;" option in your script itself. The -i argument tells &lt;span style="font-style: italic;"&gt;sqlcmd&lt;/span&gt; what script you want to call. I didn't need a full path reference in this case because it uses relative paths and my batch file is in the same directory as the scripts I'm calling. The last piece here is the "pause" instruction. This is simply a command line instruction that awaits a user hitting a key before moving on. This would allow you to view the output from calling the batch file before the window disappears if you double-click the file rather than run it from an open command shell.&lt;br /&gt;&lt;br /&gt;The last part to running a list of scripts from one master sql file is the contents of the master sql file itself.&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;&lt;br /&gt;--DBCreateAll.sql&lt;br /&gt;&lt;br /&gt;:On Error Exit&lt;br /&gt;&lt;br /&gt;PRINT 'CREATING DATABASE...'&lt;br /&gt;&lt;br /&gt;:r .\DBCreate.sql&lt;br /&gt;&lt;br /&gt;PRINT 'FINISHED CREATING DATABASE...'&lt;br /&gt;&lt;br /&gt;PRINT 'LOADING DATA...'&lt;br /&gt;&lt;br /&gt;:r .\DBDataLoad.sql&lt;br /&gt;&lt;br /&gt;PRINT 'FINISHED LOADING DATA...'&lt;br /&gt;&lt;br /&gt;PRINT 'FINISHED SETTING UP DATABASE'&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;It's pretty self explanatory, but basically your batch file calls the immediately following filename. The &lt;span style="font-style: italic;"&gt;sqlcmd &lt;/span&gt;utility interprets the :r as an instruction to add the text from the referenced sql file to the statement cache for execution.&lt;br /&gt;&lt;br /&gt;So that about covers it! Now you have a method to separate your scripts and still run them all in Sql Server.&lt;br /&gt;&lt;br /&gt;Reference&lt;br /&gt;&lt;/dbname&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms162773.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms162773.aspx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=5684229007805784813&amp;amp;postID=9073248168181467134#%20http://msdn.microsoft.com/en-us/library/ms180944.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms180944.aspx&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-9073248168181467134?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/9073248168181467134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2009/11/sql-server-execute-multiple-scripts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/9073248168181467134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/9073248168181467134'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2009/11/sql-server-execute-multiple-scripts.html' title='Sql Server - Execute multiple scripts from a master script'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-4321717408289947712</id><published>2009-07-23T23:21:00.003-04:00</published><updated>2009-07-23T23:38:03.093-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sheets'/><category scheme='http://www.blogger.com/atom/ns#' term='center'/><category scheme='http://www.blogger.com/atom/ns#' term='vertical'/><category scheme='http://www.blogger.com/atom/ns#' term='w3c'/><category scheme='http://www.blogger.com/atom/ns#' term='div'/><category scheme='http://www.blogger.com/atom/ns#' term='centering'/><category scheme='http://www.blogger.com/atom/ns#' term='style'/><category scheme='http://www.blogger.com/atom/ns#' term='cascading'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Vertical Centering with CSS</title><content type='html'>I've got a secret for many of you out there. You may have perused the CSS Zen Gardens of the internet in awe-stricken hope, looking for the answer to one very simple, yet extremely elusive concept... how to get your text et. al. to center vertically with cascading style sheets. First, let me say I spent a good number of hours tinkering about in the belief that I was missing just one simple point about how elements work together in HTML. No, I wasn't missing one simple point. The point, as it turns out, is that the W3C Consortium neglected to include vertical alignment capabilities for their block level elements. Don't believe me? Check out this page straight from the horse's mouth about vertically centering text and other goodies.&lt;br /&gt;&lt;a href="http://www.w3.org/Style/Examples/007/center#vertical"&gt;&lt;blockquote&gt;W3C - Centering Things&lt;/blockquote&gt;&lt;/a&gt;&lt;br /&gt;Yeah, I was a bit underwhelmed myself too. You actually have to change the display mode over to &lt;span style="font-style: italic;"&gt;table&lt;/span&gt;. See, unlike other block-level elements, tables DO have vertical centering capabilities and so the workaround is to gleefully turn your DIVs, Ps, H1s, etc., etc. into TABLE wannabes. So there you have it. There is &lt;span style="font-style: italic;"&gt;no&lt;/span&gt; out of the box method for vertically centering block elements in HTML via CSS without changing their display type or performing one of the other myriad CSS-kung-fu moves. &lt;a href="http://www.w3.org/Style/Examples/007/center#vertical"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-4321717408289947712?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/4321717408289947712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2009/07/vertical-centering-with-css.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/4321717408289947712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/4321717408289947712'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2009/07/vertical-centering-with-css.html' title='Vertical Centering with CSS'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-4045662085182084567</id><published>2009-07-09T15:07:00.003-04:00</published><updated>2009-07-09T15:33:30.208-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dbproviderfactories'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><title type='text'>Microsoft .NET Code Generation Error with MySQL</title><content type='html'>Sometimes in tech you're forced to combine technologies that don't always seem naturally well-matched. This is especially true when you're hosting company offers one database technology, but not another, and when the natural scripting language partner to that database is slower than than the other competing language. So that brings me to running a MySQL database with ASP.NET 2.0/3.0 running the front end. Creating a simple web-based database application is pretty trivial, but even in those cases you can run into issues with unclear solutions.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;As I was putting together a simple web application with asp.net and mysql, I ran into a mysterious and misleading error that went something like:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;Failed to generate code. Exception of type 'System.Data.Design.InternalException' was thrown.&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Oddly enough, the error pointed to the first line of my DAL DataSet.xsd where the XML declaration resides. It turns out, this is not a parsing error at all, but rather an issue with the .NET compiler being unable to auto-generate the C# code from the DataSet's XML. The reason being, it couldn't find the appropriate &lt;span style="font-family:courier new;"&gt;DbProviderFactory&lt;/span&gt;.&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:georgia;"&gt; The solution was pretty simple in the end. All I had to do was add the following SQL DB Provider to my &lt;span style="font-family:courier new;"&gt;web.config&lt;/span&gt; and I was on my way.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;system.data&amp;gt;&lt;br /&gt; &amp;lt;DbProviderFactories&amp;gt;&lt;br /&gt;   &amp;lt;add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net&lt;br /&gt;     Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory,&lt;br /&gt;     MySql.Data, Version=6.0.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D" /&amp;gt;&lt;br /&gt; &amp;lt;/DbProviderFactories&amp;gt;&lt;br /&gt;&amp;lt;/system.data&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-4045662085182084567?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/4045662085182084567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2009/07/microsoft-net-code-generation-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/4045662085182084567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/4045662085182084567'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2009/07/microsoft-net-code-generation-error.html' title='Microsoft .NET Code Generation Error with MySQL'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-4110682151638593694</id><published>2009-04-28T20:12:00.006-04:00</published><updated>2009-04-29T12:05:27.136-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tableadapter sql sqlserver connectionstring login integrated security'/><title type='text'>.NET TableAdapter - connectionString fails for 'xxxx\ASPNET'</title><content type='html'>While working on getting an application copied from my development environment over to IIS for production testing I ran into an interesting database error.&lt;br /&gt;&lt;blockquote&gt;System.Data.SqlClient.SqlException: Cannot open database "xxYourDBNameHerexx"  requested by the login. The login failed.&lt;br /&gt;Login failed for user  'xxComputerNamexx\ASPNET'.&lt;/blockquote&gt;&lt;br /&gt;My first thought was that I had wiped out a necessary database login or user when I accidentally wiped them all out the other day (you'll see how I recovered from this in another post), but it was much simpler to correct. There's a parameter in the connectionString, "&lt;span style=";font-family:courier new;font-size:85%;"  &gt;Integrated Security&lt;/span&gt;" that's set to true when you create your TableAdapters in Visual Web Developer. This tells your application to login to SQL Server using the current logged in user's credentials, which seems to be those of IIS for a web application. From MSDN says this of the &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;Integrated Security&lt;/span&gt;&lt;/span&gt; setting:&lt;br /&gt;&lt;blockquote&gt;When &lt;span&gt;&lt;span class="input"&gt;false&lt;/span&gt;&lt;/span&gt;, User ID and Password are specified in the connection. When &lt;span&gt;&lt;span class="input"&gt;true&lt;/span&gt;&lt;/span&gt;, the current Windows account credentials are used for authentication.&lt;/blockquote&gt;&lt;br /&gt;Simply change the value to &lt;span style="font-style: italic;"&gt;false&lt;/span&gt; and then supply a username and password like so:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;connectionString="Data Source=YOUR-COMPUTER\SQLEXPRESS;Initial Catalog=YourDBNameHere;Integrated Security=False;User ID=YourUserName;Password=YourPassword"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-4110682151638593694?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/4110682151638593694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2009/04/net-tableadapter-connectionstring-fails.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/4110682151638593694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/4110682151638593694'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2009/04/net-tableadapter-connectionstring-fails.html' title='.NET TableAdapter - connectionString fails for &apos;xxxx\ASPNET&apos;'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5684229007805784813.post-4550993211373305241</id><published>2009-03-27T08:45:00.000-04:00</published><updated>2009-03-29T18:05:13.274-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net ajax sys.component.create api javascript'/><title type='text'>.NET Ajax - Using Sys.Component.create and $create</title><content type='html'>I recently spent some time getting intimate with the .NET Ajax library v1.0 and found the documentation for &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;Sys.Component.create &lt;span style="font-size:100%;"&gt;&lt;span style="font-family:georgia;"&gt;and &lt;/span&gt;&lt;/span&gt;$create&lt;/span&gt;&lt;/span&gt; particularly ambiguous, so I've decided to talk about it here to help other developers facing similar problems.  First I'd like to again clarify that for backwards compatibility with the .NET 2.0 app I'm working with I've been using .NET Ajax 1.0 as opposed to the newer 2.0 version.&lt;br /&gt;&lt;br /&gt;The doc's provide a similar example in all cases:&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;$create(MyControl, {id: 'c1', visible: true}, {click: showValue}, null, $get('button1'));&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;This would be fine, however I've referred to four Microsoft doc sources on the 'create' method and there are two main issues:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The "id" property cannot be set on a &lt;span style=";font-family:courier new;font-size:85%;"  &gt;Sys.UI.Control&lt;/span&gt; object, rather only on a Component or Behavior.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The fourth argument's syntax, &lt;span style="font-style: italic;"&gt;references&lt;/span&gt;, is never thoroughly explained. This is true even in the newest version of the docs.&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;It appears that the example is actually a mashup of instantiations for two object types, &lt;span style=";font-family:courier new;font-size:85%;"  &gt;Sys.Component&lt;/span&gt; and &lt;span style=";font-family:courier new;font-size:85%;"  &gt;Sys.UI.Control&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Issue 1:&lt;/span&gt;&lt;br /&gt;If you try to set the id property on a Control object you'll get a JavaScript exception thrown along the lines of:&lt;br /&gt;&lt;blockquote&gt;Error: Sys.InvalidOperationException: The id property can't be set on this object.&lt;/blockquote&gt;You can set the id property without issue on Component objects and I believe Behavior objects as well.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Issue 2:&lt;/span&gt;&lt;br /&gt;For the other issue I will simply describe the existing documentation further, since something left incomplete cannot exactly be dubbed wrong. The MS documentation describes the &lt;span style="font-style: italic;"&gt;references&lt;/span&gt; parameter as follows: &lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote&gt;(Optional) A JSON object that describes the properties that are references to other components.&lt;/blockquote&gt;&lt;br /&gt;I was also able to turn up some documentation that describes the &lt;span style="font-style: italic;"&gt;references&lt;/span&gt; parameter a bit further, but is still not quite enough to be useful, &lt;a href="http://www.asp.net/AJAX/Documentation/Live/tutorials/CreatingCustomClientControlsTutorial.aspx"&gt;http://www.asp.net/AJAX/Documentation/Live/tutorials/CreatingCustomClientControlsTutorial.aspx&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;An optional JSON object that contains references to associated components, passed as component name/ID pairs.&lt;/blockquote&gt;&lt;br /&gt;The components referred to here are other JavaScript objects created with the &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;$create()&lt;/span&gt;&lt;/span&gt; method. So if you create an object A and set its id to 'c1', you can create an object B and then refer to object A by passing a property in the references parameter with 'c1' as the value. The undocumented mystery here is that the $create() method will extrapolate an object reference out of the id string value you supply. Figuring this out is made even more difficult when you are seemingly unable to set the id value in the first place if it's a Control (see issue 1). The main question here to answer is what should be passed as an id, a DOM id or object id? When using a &lt;span style=";font-family:courier new;font-size:85%;"  &gt;Sys.Component&lt;/span&gt; object, there is not a corresponding DOM element associated with it and so you must specify an id during object instantiation, which is the id you will refer to for &lt;span style="font-style: italic;"&gt;references&lt;/span&gt;. When using a &lt;span style=";font-family:courier new;font-size:85%;"  &gt;Sys.UI.Control&lt;/span&gt; object, the id will derive from the required associated DOM element and this is the id value to pass in the &lt;span style="font-style: italic;"&gt;references&lt;/span&gt; list. Below I've included a really simple example demonstrating the use of the &lt;span style="font-style: italic;"&gt;references&lt;/span&gt; parameter to refer to another .NET Ajax component.&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;//------------------&lt;br /&gt;// ContentManager.js&lt;br /&gt;//------------------&lt;br /&gt;&lt;br /&gt;/// &amp;lt;reference name=&amp;quot;MicrosoftAjax.js&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;Type.registerNamespace(&amp;quot;ContentManager&amp;quot;);&lt;br /&gt;&lt;br /&gt;ContentManager.TestA = function() {&lt;br /&gt;    ContentManager.TestA.initializeBase(this);&lt;br /&gt;    &lt;br /&gt;    this._othercontrol = null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ContentManager.TestA.prototype = {&lt;br /&gt;    show: function() {&lt;br /&gt;        alert('TestA show function called.\nthis._id: ' + this._id + '\nthis.get_id(): ' + this.get_id());&lt;br /&gt;    },&lt;br /&gt;    set_othercontrol: function(val) {&lt;br /&gt;        this._othercontrol = val;&lt;br /&gt;    },&lt;br /&gt;    get_othercontrol: function() {&lt;br /&gt;        return this._othercontrol;&lt;br /&gt;    },&lt;br /&gt;    getUsed: function(arg) {&lt;br /&gt;        alert(&amp;quot;TestA getUsed called, passed this val: &amp;quot; + arg);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ContentManager.TestA.registerClass('ContentManager.TestA', Sys.Component);&lt;br /&gt;&lt;br /&gt;ContentManager.TestB = function(a) {&lt;br /&gt;    ContentManager.TestB.initializeBase(this, [a]);&lt;br /&gt;&lt;br /&gt;    this._othercontrol = null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ContentManager.TestB.prototype = {&lt;br /&gt;    show: function() {&lt;br /&gt;        alert('TestB show function called.\nthis._id: ' + this._id + '\nthis.get_id(): ' + this.get_id());&lt;br /&gt;    },&lt;br /&gt;    set_othercontrol: function(val) {&lt;br /&gt;        this._othercontrol = val;&lt;br /&gt;    },&lt;br /&gt;    get_othercontrol: function() {&lt;br /&gt;        return this._othercontrol;&lt;br /&gt;    },&lt;br /&gt;    useOtherControl: function() {&lt;br /&gt;        this._othercontrol.getUsed(&amp;quot;Passed from TestB!&amp;quot;);&lt;br /&gt;    },&lt;br /&gt;    getUsed: function(arg) {&lt;br /&gt;        alert(&amp;quot;TestB getUsed called, passed this val: &amp;quot; + arg);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ContentManager.TestB.registerClass('ContentManager.TestB', Sys.UI.Control);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ContentManager.TestC = function(a) {&lt;br /&gt;    ContentManager.TestC.initializeBase(this, [a]);&lt;br /&gt;&lt;br /&gt;    this._othercontrol = null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ContentManager.TestC.prototype = {&lt;br /&gt;    show: function() {&lt;br /&gt;        alert('TestC show function called.\nthis._id: ' + this._id + '\nthis.get_id(): ' + this.get_id());&lt;br /&gt;    },&lt;br /&gt;    set_othercontrol: function(val) {&lt;br /&gt;        this._othercontrol = val;&lt;br /&gt;    },&lt;br /&gt;    get_othercontrol: function() {&lt;br /&gt;        return this._othercontrol;&lt;br /&gt;    },&lt;br /&gt;    useOtherControl: function() {&lt;br /&gt;        this._othercontrol.getUsed(&amp;quot;Passed from TestC!&amp;quot;);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ContentManager.TestC.registerClass('ContentManager.TestC', Sys.UI.Control);&lt;br /&gt;&lt;br /&gt;// Notify the ScriptManager that this is the end of the script.&lt;br /&gt;if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;&lt;br /&gt;//--------------&lt;br /&gt;// AJAXTest.aspx&lt;br /&gt;//--------------&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeFile=&amp;quot;AJAXTest.aspx.cs&amp;quot; Inherits=&amp;quot;management_AJAXTest&amp;quot; %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;Ajax Test&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;asp:ScriptManager ID=&amp;quot;ScriptManager1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;Scripts&amp;gt;&lt;br /&gt;                &amp;lt;asp:ScriptReference Path=&amp;quot;~/ContentManager.js&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;/Scripts&amp;gt;&lt;br /&gt;        &amp;lt;/asp:ScriptManager&amp;gt;&lt;br /&gt;        &amp;lt;asp:Button ID=&amp;quot;Button1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Button1&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;asp:Button ID=&amp;quot;Button2&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Button2&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;            var app = Sys.Application;&lt;br /&gt;            app.add_load(applicationLoadHandler);&lt;br /&gt;&lt;br /&gt;            function applicationLoadHandler() {&lt;br /&gt;                // instantiate a component&lt;br /&gt;                var aCtrl = $create(ContentManager.TestA, { id: 'controla' });&lt;br /&gt;                // instantiate a control&lt;br /&gt;                var bCtrl = $create(ContentManager.TestB, null, null, { othercontrol: 'controla' }, $get('Button1'));&lt;br /&gt;                // instantiate a control&lt;br /&gt;                var cCtrl = $create(ContentManager.TestC, null, null, { othercontrol: 'Button1' }, $get('Button2'));&lt;br /&gt;&lt;br /&gt;                // Display alert message from TestA, TestB, and TestC&lt;br /&gt;                aCtrl.show();&lt;br /&gt;                bCtrl.show();&lt;br /&gt;                cCtrl.show();&lt;br /&gt;                &lt;br /&gt;                // Display alert message from TestA (aCtrl var) via TestB (bCtrl var) property referencing TestA.&lt;br /&gt;                bCtrl.get_othercontrol().show();&lt;br /&gt;                // Display alert message from TestB via TestC property referencing TestB, 'Button2'.&lt;br /&gt;                cCtrl.get_othercontrol().show();&lt;br /&gt;                &lt;br /&gt;                // Display alert message calling TestB function that uses TestA behind the scenes.&lt;br /&gt;                bCtrl.useOtherControl();&lt;br /&gt;                cCtrl.useOtherControl();&lt;br /&gt;            }&lt;br /&gt;        &amp;lt;/script&amp;gt;&lt;br /&gt;    &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Running the example will give you a simple page with two buttons that pops up three alert messages on page load. In a real circumstance it would probably make more sense if I applied these alerts via some onclick handler function, but it gets the point across.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Mike&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;References:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.asp.net/AJAX/Documentation/Live/ClientReference/Global/CreateShortcutMethod.aspx"&gt;http://www.asp.net/AJAX/Documentation/Live/ClientReference/Global/CreateShortcutMethod.aspx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.asp.net/AJAX/Documentation/Live/ClientReference/Sys/ComponentClass/ComponentCreateMethod.aspx"&gt;http://www.asp.net/AJAX/Documentation/Live/ClientReference/Sys/ComponentClass/ComponentCreateMethod.aspx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb397487.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb397487.aspx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb310863.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb310863.aspx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.asp.net/AJAX/Documentation/Live/tutorials/CreatingCustomClientControlsTutorial.aspx"&gt;http://www.asp.net/AJAX/Documentation/Live/tutorials/CreatingCustomClientControlsTutorial.aspx&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5684229007805784813-4550993211373305241?l=clevelandflash.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://clevelandflash.blogspot.com/feeds/4550993211373305241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://clevelandflash.blogspot.com/2009/03/net-ajax-using-syscomponentcreate-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/4550993211373305241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5684229007805784813/posts/default/4550993211373305241'/><link rel='alternate' type='text/html' href='http://clevelandflash.blogspot.com/2009/03/net-ajax-using-syscomponentcreate-and.html' title='.NET Ajax - Using Sys.Component.create and $create'/><author><name>ClevelandFlash</name><uri>http://www.blogger.com/profile/02088122649658818209</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
