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

<channel>
	<title>Mental Masturbation, Musings, and Methods &#187; Duke</title>
	<atom:link href="http://blog.alexbeutel.com/category/duke/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alexbeutel.com</link>
	<description>The Mind of Alex Beutel</description>
	<lastBuildDate>Mon, 02 Aug 2010 06:20:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Rankophilia and Rankophiliacs</title>
		<link>http://blog.alexbeutel.com/275/rankophilia-and-rankophiliacs/</link>
		<comments>http://blog.alexbeutel.com/275/rankophilia-and-rankophiliacs/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 03:24:26 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Duke]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/?p=275</guid>
		<description><![CDATA[For my CPS 182S class, we have an assignment which is a competition among groups of students (and the professor) to have the highest ranking page on Google for the terms rankophilia and rankophiliac.  As such, I have created a page at rankophilia.dorm.duke.edu to be my group&#8217;s main page on Google. For now, there is [...]]]></description>
			<content:encoded><![CDATA[<p>For my CPS 182S class, we have an assignment which is a competition among groups of students (and the professor) to have the highest ranking page on Google for the terms rankophilia and rankophiliac.  As such, I have created a page at <a href='http://rankophilia.dorm.duke.edu/' target='_blank' title='rankophilia, rankophiliac, rankphilia, rankphiliac'>rankophilia.dorm.duke.edu</a> to be my group&#8217;s main page on Google.  For now, there is not much interesting on there, and I am merely posting it here in an attempt to increase the PageRank.  I am considering adding more interesting content and submitting it around online rather than just spamming.  I will post updates (probably at least a few for links) as the contest goes on.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/275/rankophilia-and-rankophiliacs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL Injection at Duke TechExpo 2009</title>
		<link>http://blog.alexbeutel.com/265/sql-injection-at-duke-techexpo-2009/</link>
		<comments>http://blog.alexbeutel.com/265/sql-injection-at-duke-techexpo-2009/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 19:56:07 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Duke]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/?p=265</guid>
		<description><![CDATA[I gave my first public talk today at Duke&#8217;s TechExpo 2009. I along with my coworker Artem Kazantsev discussed the risks of SQL Injection. The presentation gives a good overview of the capabilities of SQL injection along with how to prevent such vulnerabilities. I also gave a demo of performing a SQL injection attack on [...]]]></description>
			<content:encoded><![CDATA[<p>I gave my first public talk today at <a href="http://techexpo.oit.duke.edu/" target="_blank">Duke&#8217;s TechExpo 2009</a>.  I along with my coworker Artem Kazantsev discussed the risks of SQL Injection.  The presentation gives a good overview of the capabilities of SQL injection along with how to prevent such vulnerabilities.  I also gave a demo of performing a SQL injection attack on a vulnerable site during the talk.  For any web programmers who aren&#8217;t familiar with SQL injection, take a look at the code for the demo to see exactly how and why it is vulnerable, along with how to fix these vulnerabilities.</p>
<p><a href="http://ambmediadesign.com/SQLInjection.pdf">SQL Injection Presentation</a></p>
<p><a href="http://ambmediadesign.com/SQLInjectionDemo.zip">SQL Injection Demo</a></p>
<p>Additionally, earlier in the year I worked with Duke&#8217;s ITSO to write up examples of good coding practices to protect against a variety of web application security issues.  This referenced is linked on Duke ITSO&#8217;s site here: <a href="http://www.security.duke.edu/ITSO_Web_Application_Security_Standard_v1.pdf">http://www.security.duke.edu/ITSO_Web_Application_Security_Standard_v1.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/265/sql-injection-at-duke-techexpo-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag and Drop off the Desktop in Duke Webfiles</title>
		<link>http://blog.alexbeutel.com/255/drag-and-drop-off-the-desktop-in-duke-webfiles/</link>
		<comments>http://blog.alexbeutel.com/255/drag-and-drop-off-the-desktop-in-duke-webfiles/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 23:07:39 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Duke]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/?p=255</guid>
		<description><![CDATA[While on break, I&#8217;ve been playing around with Mozilla&#8217;s File API and integrating it with Duke Webfiles, which I work on for OIT. This is only a proof of concept since the spec has not been completed and I only implemented it in the icon view of Webfiles. Regardless, I think it is pretty cool [...]]]></description>
			<content:encoded><![CDATA[<p>While on break, I&#8217;ve been playing around with Mozilla&#8217;s File API and integrating it with <a href="http://webfiles.duke.edu" target="_blank">Duke Webfiles</a>, which I work on for OIT.  This is only a proof of concept since the spec has not been completed and I only implemented it in the icon view of Webfiles.  Regardless, I think it is pretty cool and makes the application much easier to use.  Here is a screencast to see it in action:</p>
<p><object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/9RBfyC60ADI&#038;hl=en&#038;fs=1&#038;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/9RBfyC60ADI&#038;hl=en&#038;fs=1&#038;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
<p>To do this I used examples from <a href="http://www.thecssninja.com/javascript/drag-and-drop-upload" target="_blank">here</a> for the new File API and <a href="http://blog.igstan.ro/2009/01/pure-javascript-file-upload.html" target="_blank">here</a> for the AJAX upload.  Obviously this could be expanded upon by implementing it in all three file views in Webfiles and by showing progress bars for each file.  Additionally, there are some small bugs with uploading large files.  However, if you are a Duke student and want to give it a try, follow the instructions below.   Please note, this is a alpha version of the software, and you may run into some bugs when using it.</p>
<ul>
<li>Make sure you are using <a href="https://developer.mozilla.org/devnews/index.php/2009/08/07/firefox-3-6-alpha-1-now-available-for-download/">Firefox 3.6 Alpha &#8211; Namoroka</a>.</li>
<li>Go to our <a href="http://pnsdev.oit.duke.edu" target="_blank">development version of Webfiles</a> and log in.</li>
<li><em>After</em> you are logged in, go <a href="http://pnsdev.oit.duke.edu/#beta" target="_blank">here</a> to turn on the new drag and drop feature.</li>
</ul>
<p>Please, give it a try and let me know your thoughts.  Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/255/drag-and-drop-off-the-desktop-in-duke-webfiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Duke LDAP on the iPhone</title>
		<link>http://blog.alexbeutel.com/113/duke-ldap-on-the-iphone/</link>
		<comments>http://blog.alexbeutel.com/113/duke-ldap-on-the-iphone/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 23:11:41 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Duke]]></category>
		<category><![CDATA[Miscellanious]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/?p=113</guid>
		<description><![CDATA[I got an e-mail this morning from someone who saw my post on Twitter about using LDAP on the iPhone here at Duke.  The person said they followed the tutorial but couldn&#8217;t quite get it to work.  So I figured it may be useful to post a few quick instructions on setting it up.  As [...]]]></description>
			<content:encoded><![CDATA[<p>I got an e-mail this morning from someone who saw my <a href="http://twitter.com/alexbeutel/status/2691509584" target="_blank">post</a> on Twitter about using LDAP on the iPhone here at Duke.  The person said they followed the tutorial but couldn&#8217;t quite get it to work.  So I figured it may be useful to post a few quick instructions on setting it up.  As the post on Twitter explains, the basic instructions for getting to adding an LDAP account can be viewed <a href="http://blogs.sun.com/chienr/entry/configuring_ldap_on_iphone_3" target="_blank">here</a> and Duke&#8217;s LDAP server settings can be found <a href="http://www.oit.duke.edu/email-accounts/dukemail/how-to/ldap.php" target="_blank">here</a>.  Once you are set to add the LDAP account, simply set the server to ldap.duke.edu, no need for a username or password.  Once you click next you will want to turn off SSL and change the Search settings for duke,edu to have a base value of &#8220;ou=People,dc=duke,dc=edu&#8221; (leave the scope at subtree).  And that&#8217;s it.  To use it, which turned out to be the issue for the person emailing me, go to write a new email and start to type in the name of the person to search.  You should see a throbber show up at the top of your screen, showing that it is connecting to the server.  There is a bit of a lag but it should eventually return the contacts for people by that name.  Below are some pictures of the settings and the search.  Let me know if you run into any issues.</p>
<div style='float:left; padding-bottom: 10px; padding-right: 20px;'><a href='http://blog.ambmediadesign.com/wp-content/uploads/2009/07/ldap1.png' target='_blank' class='thickbox' rel='ldap' title='Main Settings'><img src='http://blog.ambmediadesign.com/wp-content/uploads/2009/07/ldap1.png' title='Main Settings' style='height: 350px;' /></a></div>
<div style='float:left;'><a href='http://blog.ambmediadesign.com/wp-content/uploads/2009/07/ldap2.png' target="_blank" class='thickbox' rel='ldap' title='Search Settings'><img src='http://blog.ambmediadesign.com/wp-content/uploads/2009/07/ldap2.png' title='Search Settings' style='padding-bottom: 10px; height: 350px;' /></a></div>
<div style='clear:both;'></div>
<p><a href='http://blog.ambmediadesign.com/wp-content/uploads/2009/07/ldap4.png' target='_blank' class='thickbox' rel='ldap' title='Email Search'><img src='http://blog.ambmediadesign.com/wp-content/uploads/2009/07/ldap4.png' title='Email Search' style='height: 350px;' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/113/duke-ldap-on-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Begginning of Summer 2009</title>
		<link>http://blog.alexbeutel.com/49/begginning-of-summer-2009/</link>
		<comments>http://blog.alexbeutel.com/49/begginning-of-summer-2009/#comments</comments>
		<pubDate>Sat, 30 May 2009 19:14:43 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Duke]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/?p=49</guid>
		<description><![CDATA[As usual I haven&#8217;t posted in a while but there actually have been some things going on that may be worth writing on here.  I&#8217;m at Duke for the summer doing research with the Physics Neutrino group, among other things so here are some things that have happened: Ethical Hacking Seminar Duke OIT gave me [...]]]></description>
			<content:encoded><![CDATA[<p>As usual I haven&#8217;t posted in a while but there actually have been some things going on that may be worth writing on here.  I&#8217;m at Duke for the summer doing research with the Physics Neutrino group, among other things so here are some things that have happened:</p>
<p><strong>Ethical Hacking Seminar</strong></p>
<p>Duke OIT gave me the opportunity to take this hacking seminar at Duke the first week of summer.  It was definitely an extremely beginner course and I was a little disappointed to see that so much of it was just &#8220;pick the right tool and run it,&#8221; but good opportunity to dig a little deeper into network protocols and learn some new things; without a doubt was worthwhile.  If anyone reading this is as much of a beginner as I am check out things like <a href="http://ettercap.sourceforge.net/" target="_blank">Ettercap</a>, <a href="http://nmap.org/" target="_blank">nmap</a>, and <a href="http://www.nessus.org/nessus/" target="_blank">Nessus</a>.</p>
<p><strong>Duke&#8217;s AFS Online Interface &#8211; Webfiles</strong></p>
<p>The past year I have been working with OIT, half doing web application security and half doing programming updating Duke&#8217;s online interface for its AFS file system, <a title="Duke Webfiles" href="http://webfiles.duke.edu" target="_blank">Webfiles</a>.  Essentially, it was an attempt to make the online interface more comfortable for average users and make it most similar to Windows Explorer and OS X Finder so that using it is as intuitive as possible.  The coding was anything but beautiful, but it was a good opportunity to learn more about Javascript and play with some fun things.  General changes are that it now has an icon and outline view, drag and drop, some of the typical shortcut keys, etc.  Below are some screenshots and I will try to create a demo site at some point.  I am also excited to say Duke is making all my code open source so let me know if you would like to implement it yourself.  I believe Carnegie Mellon is currently looking at deploying it on their systems, which I think is exciting.</p>
<p><span style="padding-right: 20px;"><a href="http://blog.ambmediadesign.com/wp-content/uploads/2009/05/icon.jpg" target="_blank"><img src="http://blog.ambmediadesign.com/wp-content/uploads/2009/05/icon-150x150.jpg" alt="icon" title="icon" height="150" class="alignleft size-thumbnail wp-image-55" /></a></span> <a href="http://blog.ambmediadesign.com/wp-content/uploads/2009/05/outline.png" target="_blank"><img src="http://blog.ambmediadesign.com/wp-content/uploads/2009/05/outline-150x150.png" alt="outline" title="outline" height="150" class="alignleft size-thumbnail wp-image-56" /></a></p>
<p><strong>Neutrino Physics</strong></p>
<p>I just started working with Professor Chris Walter and his Neutrino Physics group.  So far, just to get into the group, I have been working on creating a plug-in for <a href="http://root.cern.ch" target="_blank">ROOT</a> to make it read and write to a specific kind of distributed file system faster.  It has been an interesting experience getting back into C++ and a little bit of Fortran, and learning about this large project out of CERN.  I&#8217;m still finishing up the plug-in but hopefully I will be able to post the code or at least write about how to easily integrate the plug-in into ROOT when I&#8217;m done.  Not sure what I will be doing after that; I am taking classes on GEANT4 and think I will be doing monte carlo simulations of some sort for the rest of the summer, but I will write about this when I know more.</p>
<p><strong>Simple Flash Cards in Python</strong></p>
<p>The second reason I am here for the summer is that I need to take Spanish to fulfill Duke&#8217;s foreign language requirement.  If you actually know me, you will know that I am horrible at foreign languages and have been dreading taking these classes since I got to Duke.  It has now been two years since I last took a Spanish course, so jumping back into the language has been an interesting experience.  Also, Spanish 63 is known to be a lot of work and over the summer its so jam packed together that it is actually a good amount of work each night.  Anyway, we had our first test last Friday, and I had about 100 words of vocabulary to memorize, one of my worse skills.  So, both to procrastinate from actually studying and because I thought it could be useful, I decided to make a basic command line flash card program.  I&#8217;m trying to bit by bit pick up Python, so I used it and it was fairly simple.  The program essentially takes in a plain text file with the two sides of the flash card on one line, each side separated by a colon.  It then goes through the lines, shows you the second half of the line first, waits for you to press enter and then shows you the first half.  If you press enter again it will discard the word and go to another random word in the deck; if you type &#8216;x&#8217; and then press enter it will put the word back in the stack.  Fairly basic, and the code is nothing special; probably took about 15 minutes to throw together, but it was surprisingly very useful as I could run through a lot of the vocab very fast and repeatedly.  I&#8217;ll probably update it to make it a little better packaged together with proper arguments, etc. so you can check back for that.  Anyway, to run it (if you have a Mac python is installed by default and in Windows you need to do it yourself) open up a terminal and make sure you are in the folder where the code and the text file with the vocab are.  Then just type:</p>
<pre>python flashcards.py yourvocabfile.txt</pre>
<p>The code for <a href="http://ambmediadesign.com/flashcards.py" target="_blank">flashcards.py</a>  (<a href="http://ambmediadesign.com/genteDeCine.txt" target="_blank">example vocab linked here</a>) can be seen below:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://blog.alexbeutel.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=49&amp;download=flashcards.py">flashcards.py</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p492"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
</pre></td><td class="code" id="p49code2"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #808080; font-style: italic;"># encoding: utf-8</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">random</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> clearscreen<span style="color: black;">&#40;</span>numlines=<span style="color: #ff4500;">100</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">name</span> == <span style="color: #483d8b;">&quot;posix&quot;</span>:
        <span style="color: #808080; font-style: italic;"># Unix/Linux/MacOS/BSD/etc</span>
        <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'clear'</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">name</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;nt&quot;</span>, <span style="color: #483d8b;">&quot;dos&quot;</span>, <span style="color: #483d8b;">&quot;ce&quot;</span><span style="color: black;">&#41;</span>:
        <span style="color: #808080; font-style: italic;"># DOS/Windows</span>
        <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'CLS'</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> <span style="color: #66cc66;">*</span> numlines
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span>argv=<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">if</span> argv <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #008000;">None</span>:
		argv = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span>
	allLines = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
&nbsp;
	again = <span style="color: #483d8b;">'x'</span>
	<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>argv<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>:
		again = argv<span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span>
&nbsp;
	f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>argv<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>, <span style="color: #483d8b;">'r'</span><span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> f:
		allLines.<span style="color: black;">append</span><span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>
&nbsp;
	clearscreen<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
	cnt = <span style="color: #ff4500;">0</span>
	wrong = <span style="color: #ff4500;">0</span>
	wWords = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
	<span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>allLines<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">0</span>:
		cnt += <span style="color: #ff4500;">1</span>
		l = allLines.<span style="color: black;">pop</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">random</span>.<span style="color: black;">randint</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>, <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>allLines<span style="color: black;">&#41;</span>-<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
		parts = l.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;:&quot;</span><span style="color: black;">&#41;</span>
		p = <span style="color: #ff4500;">1</span>
		p2 = <span style="color: #ff4500;">0</span>
		<span style="color: #ff7700;font-weight:bold;">print</span> cnt, <span style="color: #483d8b;">&quot;(&quot;</span>, <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>allLines<span style="color: black;">&#41;</span>, <span style="color: #483d8b;">&quot;). &quot;</span>, parts<span style="color: black;">&#91;</span>p<span style="color: black;">&#93;</span>
		inp = <span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>
		<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>inp == <span style="color: #483d8b;">&quot;exit&quot;</span><span style="color: black;">&#41;</span>:
			<span style="color: #ff7700;font-weight:bold;">break</span>
		<span style="color: #ff7700;font-weight:bold;">print</span> parts<span style="color: black;">&#91;</span>p2<span style="color: black;">&#93;</span>
		inp = <span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>
		<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>inp == <span style="color: #483d8b;">&quot;exit&quot;</span><span style="color: black;">&#41;</span>:
			<span style="color: #ff7700;font-weight:bold;">break</span>
		<span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span>inp == again<span style="color: black;">&#41;</span>:
			allLines.<span style="color: black;">append</span><span style="color: black;">&#40;</span>l<span style="color: black;">&#41;</span>
			wrong += <span style="color: #ff4500;">1</span>
			wWords.<span style="color: black;">append</span><span style="color: black;">&#40;</span>l<span style="color: black;">&#41;</span>
		clearscreen<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
	clearscreen<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Missed &quot;</span>, wrong, <span style="color: #483d8b;">&quot; times&quot;</span>
	<span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> wWords :
		<span style="color: #ff7700;font-weight:bold;">print</span> line
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
	<span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span>main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>Again, nothing special or fancy, but seemed to work well; I guess I&#8217;ll know how effective it was when I get the test back haha.  Anyway that is all for now, I may make public a <a href="http://blog.ambmediadesign.com/32/catching-up/">post</a> I wrote a few months ago that I never published, so check for that and I&#8217;ll write of any other things I do this summer.  Also check my twitter as I post more frequently there.  Time to go outside.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/49/begginning-of-summer-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Break from Studying</title>
		<link>http://blog.alexbeutel.com/23/break-from-studying/</link>
		<comments>http://blog.alexbeutel.com/23/break-from-studying/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 22:28:58 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Duke]]></category>
		<category><![CDATA[Miscellanious]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/?p=23</guid>
		<description><![CDATA[In the middle of studying for some finals, I thought I&#8217;d take a break, install the new WordPress 2.7.  Of course, this required I actually write a blog post to give the new version a legitimate spin.  So just wanted to post that my new favorite command (after rsync) has been wget, installed via macports, [...]]]></description>
			<content:encoded><![CDATA[<p>In the middle of studying for some finals, I thought I&#8217;d take a break, install the new WordPress 2.7.  Of course, this required I actually write a blog post to give the new version a legitimate spin.  So just wanted to post that my new favorite command (after rsync) has been wget, installed via macports, which I used to download all of my notes for a few classes off my teachers&#8217; websites.  Again, another small amazement in Unix, and thus OS X.  Maybe over break I&#8217;ll pick up a book and really learn its full potential.  Anyway, I&#8217;ll try to write a few more blog posts over break with whatever I&#8217;m working on or any other exciting news.  Back to studying.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/23/break-from-studying/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rsync Backup and Batch Printing</title>
		<link>http://blog.alexbeutel.com/22/rsync-backup-and-batch-printing/</link>
		<comments>http://blog.alexbeutel.com/22/rsync-backup-and-batch-printing/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 18:24:40 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Duke]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/?p=22</guid>
		<description><![CDATA[So I haven't posted in months and have a short break between classes so I wanted to post some scripts that I wrote this year and have been particularly useful.  These are both specific to Duke's campus, but could easily be extended to other situations.  The first is backup.  In the past few months I [...]]]></description>
			<content:encoded><![CDATA[<p>So I haven't posted in months and have a short break between classes so I wanted to post some scripts that I wrote this year and have been particularly useful.  These are both specific to Duke's campus, but could easily be extended to other situations.  The first is backup.  In the past few months I had my external hard drive in addition to numerous friend's entire computer crash.  My dad, just before I left, bought a year long subscription to Mozy, so, nervous about losing all of my data, I thought I'd look into it.  On their very informative site, they give alternatives to their product.  Most of the solutions are rediculous like burn 30 DVDs of all your data each month, but one happens to be a great idea: "Run a cron job of rsync, gzip and mcrypt piped over ssh to your friend's server over his DSL line."  I am assuming they were hoping the use of as many acronyms as possible and funny sounding words would deter people from actually reading the statement, but it turns out the basic concept as very easy to implement.  Considering here at Duke each student has 5 gig of server space and I have a server in my room, and its all in-network so its very fast, a simple ssh into the server and running rsync is actually really easy.  I have multiple different rsyncs set up as bash files, such as one for just my schoolwork so I can quickly and frequently back this up and one for my whole harddrive which takes slightly longer.  I also recently set this up for my not-quite as technical friend and gave her a small AppleScript application to run to do the rsync after I set it up.  The only real set up is go onto the server, create a folder (in a private directory) and thats it.  Then configure the script below appropriately and your done.  Here is the script:</p>
<div class="igBar"><span id="lapplescript-3"><a href="#" onclick="javascript:showPlainTxt('applescript-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">APPLESCRIPT:</span>
<div id="applescript-3">
<div class="applescript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">tell</span> application <span style="color: #ff0000;">&quot;Terminal&quot;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; activate</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; do <span style="color: #b1b100;">script</span> <span style="color: #b1b100;">with</span> command <span style="color: #ff0000;">&quot;rsync -avvvz --delete-after -e ssh /Users/{name}/directoryToBackup/ username@login1.oit.duke.edu:~/Private/backupFolder&quot;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">end</span> <span style="color: #b1b100;">tell</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
Above we see to simply first reference the name of the folder on your local machine to back up and then username@server address colon folder on server to back up to.  And that's it.  Simple and very effective.  Thanks Mozy.</p>
<p>The second recent hacked together script I made was a basic way of batch printing.  Duke has a system called E-Print, which runs basically by Line Printer Daemon (LPD) to a specific address.  Any network printer set up like this.  The other key requirement is that I have set my short name on my Mac to my NetID because this short name is the username that is sent through to LPD.  If you have this, I create a simple AppleScript application that takes either all selected items or all files in a folder and prints them separately and in duplex with the lpr command.  This script is below.</p>
<div class="igBar"><span id="lapplescript-4"><a href="#" onclick="javascript:showPlainTxt('applescript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">APPLESCRIPT:</span>
<div id="applescript-4">
<div class="applescript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">-- script was clicked</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">on</span> <span style="color: #000066;">run</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">tell</span> application <span style="color: #ff0000;">&quot;Finder&quot;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> selection <span style="color: #b1b100;">is</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">then</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">set</span> selection <span style="color: #b1b100;">to</span> files <span style="color: #b1b100;">in</span> folder <span style="color: #b1b100;">of</span> <span style="color: #000000; font-weight: bold;">the</span> <span style="color: #000000; font-weight: bold;">front</span> window</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">if</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">set</span> finderSelection <span style="color: #b1b100;">to</span> selection <span style="color: #000066;">as</span> alias list</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">tell</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000066;">print</span> <span style="color: #66cc66;">&#123;</span>finderSelection<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">end</span> <span style="color: #000066;">run</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">-- script was drag-and-dropped onto</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">on</span> <span style="color: #000066;">open</span> <span style="color: #66cc66;">&#40;</span>theList<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000066;">print</span> <span style="color: #66cc66;">&#40;</span>theList<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">end</span> <span style="color: #000066;">open</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">-- print</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">on</span> <span style="color: #000066;">print</span> <span style="color: #66cc66;">&#123;</span>listOfAliases<span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">repeat</span> <span style="color: #b1b100;">with</span> currentFile <span style="color: #b1b100;">in</span> listOfAliases</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">set</span> currentFileName <span style="color: #b1b100;">to</span> POSIX path <span style="color: #b1b100;">of</span> currentFile</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; do shell <span style="color: #b1b100;">script</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;lpr -o sides=two-sided-long-edge '&quot;</span> <span style="color: #66cc66;">&amp;</span> currentFileName <span style="color: #66cc66;">&amp;</span> <span style="color: #ff0000;">&quot;'&quot;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">repeat</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #b1b100;">end</span> <span style="color: #000066;">print</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>
Or you can download the application <a href='http://ambmediadesign.com/PrintAll.app' title='PrintAll application'>here</a>.  Place this inside your applications directory, and then in Leopard you can drag it to the toolbar of Finder.  I believe you also need to make sure you have the LPD printer set to your default printer. The, you can always easily batch print.</p>
<p>Note: You can also in command line use lp but this will combine all of the documents printed into one item on the print queue, which has its disadvantages in the Duke e-Print system.  Also, I need to thank Henrik Nyh whose <a href='http://henrik.nyh.se/2007/10/open-in-textmate-from-leopard-finder'>"Open in Textmate"</a> script I use and worked off of for this.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/22/rsync-backup-and-batch-printing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Duke&#8217;s new ACES</title>
		<link>http://blog.alexbeutel.com/18/dukes-new-aces/</link>
		<comments>http://blog.alexbeutel.com/18/dukes-new-aces/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 17:01:50 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Duke]]></category>

		<guid isPermaLink="false">http://blog.ambmediadesign.com/?p=18</guid>
		<description><![CDATA[As a rising sophomore at Duke University and a web programmer, I was naturally excited to see the update to our new Automated Computer Enrollment System (ACES). However, upon seeing the update, I was quite disappointed to say the least. Not to add to the moaning and groaning coming from plenty of my classmates, but [...]]]></description>
			<content:encoded><![CDATA[<p>As a rising sophomore at Duke University and a web programmer, I was naturally excited to see the update to our new Automated Computer Enrollment System (ACES).  However, upon seeing the update, I was quite disappointed to say the least.  Not to add to the moaning and groaning coming from <a title="Facebook Group - The new ACES sucks " href="http://www.facebook.com/group.php?gid=21191751563&amp;ref=mf" target="_blank">plenty</a> of my classmates, but I'd like to make a few technical points about this supposed upgrade.  First, why PeopleSoft 9?  It was released two years ago, which in web development is a long time.   Additionally, from what I have read, it was known for its security, which I had believed was the point of Shibboleth in which case there was no need for PeopleSoft.  Partially as a result of it being so old, it uses horribly inefficient, old web development styles.  There is no AJAX at all anywhere on the site, nor many iframes.  Rather, the site is a few large frames and nearly every click requires a full page load - as a matter of fact almost every link is a full form submit.  And, simply as a matter of design, it is heavy and ridiculously inefficient to navigate.  To get to anything takes numerous unnecessary clicks and page loads; and there is no one definitive place to do any specific action - enrolling can be done in two DIFFERENT locations that look <em>nearly</em> identical, so I ask - why two spots then?  And, of course, Duke didn't set it up quite right yet so as a result most classes are displayed with sections and times from old years.  To say the least, it is a mess and essentially unusable.</p>
<p>As I have done before, I would like to ask Duke to push the envelope on this project.  The administrators have on their hands literally hundreds of students who clearly care about this system, viewing the site within the first 24 hours of it being released and posting their opinion eagerly on their Facebook status, creating <a href="http://www.facebook.com/group.php?gid=21191751563&amp;ref=mf" target="_blank">the Facebook group</a>, and e-mailing the registrar.  Both I and a rising Junior independently created webpages to <a href="http://ambmediadesign.com/dukeSched/" target="_blank">build a graphical schedule</a> despite the old system being lost, and another one of my friends told me that he was planning on doing the same thing, and now planning on helping me out to enhance mine.   Without a doubt students and <a href="http://www.xanga.com/DukeEgr93/666801976/the-new-aces.html" target="_blank">teachers</a>, want things to change and apparently are willing to put at least some thought and time into it.  However here is the killer, there are too many hurdles.  In the three days that the link to my schedule generator has been posted on Facebook there have been 125 visits and 160 pageviews, but only 56 graphical schedules actually generated.  Why?  It is a simple flaw of my site, it is pain, god knows how many clicks, to actually download the iCal file and upload it to my site as compared to the simple old system of refreshing a single page.  So here is what I would like from Duke - LET us help out, just do the one thing we can't, take down the barriers.  Make a system for us to easily access a logged in user's data and customize the way its displayed, let us take all of the data for all of the classes and create our own systems of searching and testing out schedules - neither of these tasks seem to be much of a privacy concern.  My friend Nick Bottenus <a href="http://www.duke.edu/~nbb5/" target="_blank">created a system</a> for testing out different schedules, but again it could have been far more effective if it had better site integration.  Hell, even allow students to choose other interfaces for registering for classes; take some of that load off of your servers that manage to nearly be brought down to a halt each semester on those splendid 7 AM morning rushes, always nearly as chaotic and clearly effective as the free Homecoming t-shirt give away this year.   Use the internet to its strengths, and likewise the students, and prove that Duke is a place of innovation, action, and on the forefront even in class registration.  Having a development platform for class registration, now there is something different I didn't here on a college tour.  Administrators, you have it easy, an open opportunity.  There are willing and able students who want to help, all you have to do is let us.</p>
<p>Update: Nick Bottenus and I have created a new version of the schedulator, enjoy: <a title="Duke Schedulator" href="http://dukesched.ambmediadesign.com/" target="_blank">http://dukesched.ambmediadesign.com/</a>.</p>
<p>Update: New version of the Schedulator and a new address: <a title="Duke Schedulator" href="http://www.dukeSchedulator.com" target="_blank">http://www.dukeSchedulator.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexbeutel.com/18/dukes-new-aces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
