<?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-2323822718917007065</id><updated>2011-04-21T11:10:05.458-07:00</updated><title type='text'>Richard's CS 462 Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rjd33.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rjd33.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Richard Duncan</name><uri>http://www.blogger.com/profile/04100438322438447578</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>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2323822718917007065.post-4342085859916697611</id><published>2007-12-12T13:16:00.000-08:00</published><updated>2007-12-12T14:05:11.225-08:00</updated><title type='text'>Lab 5 Finished</title><content type='html'>Now I hope I have everything working (it seems to be). I would have to say that this lab gave me the most stress. It might be due to the end of the semester as well, but I had a lot of difficulty getting this lab to work and being able to port it to another machine (more on this later). I'm mainly posting most of this information for my own benefit. So, if I ever do something like this again, I know where to look.&lt;br /&gt;&lt;br /&gt;First of all, I chose Java to implement the approval client. I started writing it out in Swing, and thought there's got to be a better way. I noticed that some of you used NetBeans, so I gave it a try. I love NetBeans 6.0; it is extremely easy to create the layout for the UI.&lt;br /&gt;&lt;br /&gt;After I built the UI, I tried tackling communicating with Amazon SQS. It was tricking finding a library that would work for me, but I found typica quite useful. This &lt;a href="http://code.google.com/p/typica/"&gt;site&lt;/a&gt; tells you the jar files needed and gives an example of accessing the SQS queue. I incorporated the jar files into my project, and typica worked wonders.&lt;br /&gt;&lt;br /&gt;Then I needed to parse and create XML for the ideas. I used the DOM feature. It might not be the best way to do it, but recently I have been programming in Javascript to open an XML (I wanted on offline search feature in HTML/Javascript). I used DOM plenty of times in Javascript. The javax.xml and DOM library acted very similar. So, it was quite easy to implement.&lt;br /&gt;&lt;br /&gt;Lastly, I tried to implement Whois feature. This caused me the most pain. I downloaded Eclipse and Apache Axis 2.0 WSDL2java generator. I was able to generate java from the wsdl file, but I could not figure out how to use those java files. I tried some other wsdl/soap libraries, but had trouble using those as well. Then I tried implementing my own version of soap, by creating an http connection and sending XML. That failed as well. Then I looked for ways to use wsdl in NetBeans. And I found one. Right click on your project, create new web service client, and there's an option for WSDL. Create a packet name for the Java files, click finish and BAM! you have complied Java files.&lt;br /&gt;&lt;br /&gt;To get whois info, I used:&lt;br /&gt;           Whois wi = new Whois();&lt;br /&gt;           WhoisSoap wisoap = wi.getWhoisSoap();&lt;br /&gt;           whoisData = wisoap.getWhoIS(domain);&lt;br /&gt;&lt;br /&gt;And then I had my client working. . . WRONG! It only worked on my on computer through NetBeans. I got the error: "java.langLinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (..) needs 2.1 API," when running from command prompt or another machine. It took me forever to solve this problem, and I couldn't bring my computer in to pass off since it's a desktop. Anyways, here is the solution:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download jaxws 2.1 if you haven't done so or isn't already installed. It would be in under java1/modules/ext in NetBeans directory if installed.&lt;/li&gt;&lt;li&gt;Copy the folder api in jaxws21 to your project's directory.&lt;/li&gt;&lt;li&gt;Then add the following to the java -jar command:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;-Djava.endorsed.dirs="[project_path]/api"&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;What that does is it overrides the classbootloader to load JAXB 2.1 instead of 2.0.&lt;/li&gt;&lt;/ol&gt;And there you have it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2323822718917007065-4342085859916697611?l=rjd33.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rjd33.blogspot.com/feeds/4342085859916697611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2323822718917007065&amp;postID=4342085859916697611' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default/4342085859916697611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default/4342085859916697611'/><link rel='alternate' type='text/html' href='http://rjd33.blogspot.com/2007/12/lab-5-finished.html' title='Lab 5 Finished'/><author><name>Richard Duncan</name><uri>http://www.blogger.com/profile/04100438322438447578</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-2323822718917007065.post-4317785452937331600</id><published>2007-11-20T12:49:00.000-08:00</published><updated>2007-11-20T12:58:11.342-08:00</updated><title type='text'>Lab 4: Finished</title><content type='html'>This lab really was quite simple because doing all the previous labs gave me the necessary tools to do this one. I found two libraries for akismet. Use this &lt;a href="http://www.voidspace.org.uk/python/akismet_python.html"&gt;one&lt;/a&gt; as the other always returns spam="true"; which drove me nuts.&lt;br /&gt;&lt;br /&gt;GUID worked well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2323822718917007065-4317785452937331600?l=rjd33.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rjd33.blogspot.com/feeds/4317785452937331600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2323822718917007065&amp;postID=4317785452937331600' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default/4317785452937331600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default/4317785452937331600'/><link rel='alternate' type='text/html' href='http://rjd33.blogspot.com/2007/11/lab-4-finished.html' title='Lab 4: Finished'/><author><name>Richard Duncan</name><uri>http://www.blogger.com/profile/04100438322438447578</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-2323822718917007065.post-7550915779148789475</id><published>2007-11-20T12:29:00.000-08:00</published><updated>2007-11-20T14:23:30.517-08:00</updated><title type='text'>Finished Lab3</title><content type='html'>The submit process was my greatest difficulty for this lab. I was clueless on how Python gets post variables and a bit confused on the submit script. After talking with Sam, I was able to complete it and was surprised how easy these were.&lt;br /&gt;&lt;br /&gt;to get post variables (var1, var2, ...):&lt;br /&gt;&lt;br /&gt;def index(req, var1="", var2="", . . . ):&lt;br /&gt;&lt;br /&gt;Submitting was a bit more tricky, but I just had to use urlencode(data{}) from the urllib to encode the data dictionary of variables. Then use urllib.urlopen(&lt;site&gt;url, urlencoded(data{})&lt;encoded&gt;).&lt;br /&gt;&lt;a href="http://docs.python.org/lib/node578.html"&gt;docs.python.org&lt;/a&gt; has a good example. What confused me was trying to use the http library that someone recommended for doing posts in python.&lt;/encoded&gt;&lt;/site&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2323822718917007065-7550915779148789475?l=rjd33.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rjd33.blogspot.com/feeds/7550915779148789475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2323822718917007065&amp;postID=7550915779148789475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default/7550915779148789475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default/7550915779148789475'/><link rel='alternate' type='text/html' href='http://rjd33.blogspot.com/2007/11/finished-lab3.html' title='Finished Lab3'/><author><name>Richard Duncan</name><uri>http://www.blogger.com/profile/04100438322438447578</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-2323822718917007065.post-7232484476632735531</id><published>2007-11-09T17:41:00.000-08:00</published><updated>2007-11-09T17:53:07.927-08:00</updated><title type='text'>Still Working on Lab3</title><content type='html'>Well, I'm getting there. I pretty much have the index and domain pages displaying properly now. The trick was finding out how to use XML in python. I tried Amara, but the installation failed. So, I decided to try ElementTree. I didn't have to install anything to use it. It was a bit tricky to understand how to use it at first, but it really isn't that bad.&lt;br /&gt;&lt;br /&gt;Here's an example:&lt;br /&gt;&lt;br /&gt;from elementtree import ElementTree&lt;br /&gt;    tree = ElementTree.XML('some xml string')&lt;br /&gt;   &lt;br /&gt;    # find all nodes with tag &lt;domain&gt;&lt;br /&gt;    for node in tree.getiterator('domain'):&lt;br /&gt;            # get attribute ideacount's value&lt;br /&gt;            ideacount = node.get('ideacount')&lt;br /&gt;   &lt;br /&gt;            # get text between the &lt;domain&gt;&lt;/domain&gt; tags&lt;br /&gt;            domain = node.text&lt;br /&gt;&lt;br /&gt;            # find child node of foo where tag = &lt;submit&gt;&lt;br /&gt;            foo = node.find('submit')&lt;br /&gt;            tech = foo.get('technology') #get technology attribute&lt;br /&gt;&lt;br /&gt;Now I just have to work on the submit process.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2323822718917007065-7232484476632735531?l=rjd33.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rjd33.blogspot.com/feeds/7232484476632735531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2323822718917007065&amp;postID=7232484476632735531' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default/7232484476632735531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default/7232484476632735531'/><link rel='alternate' type='text/html' href='http://rjd33.blogspot.com/2007/11/still-working-on-lab3.html' title='Still Working on Lab3'/><author><name>Richard Duncan</name><uri>http://www.blogger.com/profile/04100438322438447578</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-2323822718917007065.post-4819120827639287403</id><published>2007-10-08T17:09:00.000-07:00</published><updated>2007-10-08T17:26:05.657-07:00</updated><title type='text'>Lab 2</title><content type='html'>Lab 2 wasn't too bad. It took me a while to figure out how to use the json object in python since I  couldn't find any documention on it. So I opened up the python source code and found out that it has a member called 'items'. I looped through them setting the correct variables of my templates. I must say that using templates is really nice. I used an idea template for the ideas, which made the code much easier to read since I don't have html stuffed in.&lt;br /&gt;&lt;br /&gt;I did run into a problem with Python. I tried using exceptions to catch errors; for example, if the user entered a non-existing domain name. For some reason 'finally' caught everything even if no error occurred. I tried using 'break' in the 'try' section but 'break' is only for for-loops. So, does anyone know how to use exceptions appropriately in Python? Well, I just ended up using an if statement. If my webfileOpen() couldn't find the file it just returned None. If the calling method got 'None', it would return "NOT FOUND" message.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2323822718917007065-4819120827639287403?l=rjd33.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rjd33.blogspot.com/feeds/4819120827639287403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2323822718917007065&amp;postID=4819120827639287403' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default/4819120827639287403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default/4819120827639287403'/><link rel='alternate' type='text/html' href='http://rjd33.blogspot.com/2007/10/lab-2.html' title='Lab 2'/><author><name>Richard Duncan</name><uri>http://www.blogger.com/profile/04100438322438447578</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-2323822718917007065.post-8459367329250576443</id><published>2007-09-25T15:49:00.000-07:00</published><updated>2007-09-25T16:18:26.513-07:00</updated><title type='text'>Lab 1: Finally Finished</title><content type='html'>I thought this lab assignment was very educational. I thought it was really cool when I got my webserver up and running.&lt;br /&gt;&lt;br /&gt;The biggest issue I had, however, was getting my server to connect to the pound server automatically. I could connect if I ran my ec2 script manually. I tried examples others had posted on how to connect on startup, but to no avail. Finally after many hours messing with it and talking with Sam, I learned that calling the python script with: python ~/path/script.py was the problem. I changed it to: /root/path/script.py and it worked. I thought '~' was always root, my bad. Thanks again for your help Sam.&lt;br /&gt;&lt;br /&gt;Other than that the lab wasn't too difficult. It was only difficult finding the information on how to configure apache and use mod python with cheetah. Once I figured those out, the lab was relatively easy. In all, I thought it was a good lab to understand EC2, apache, and python.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2323822718917007065-8459367329250576443?l=rjd33.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rjd33.blogspot.com/feeds/8459367329250576443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2323822718917007065&amp;postID=8459367329250576443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default/8459367329250576443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2323822718917007065/posts/default/8459367329250576443'/><link rel='alternate' type='text/html' href='http://rjd33.blogspot.com/2007/09/lab-1-finally-finished.html' title='Lab 1: Finally Finished'/><author><name>Richard Duncan</name><uri>http://www.blogger.com/profile/04100438322438447578</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>
