tag:blogger.com,1999:blog-50501131364008114962024-03-13T22:19:27.105-05:00Professor Craven's BlogThoughts from a Computer Science instructor at Simpson College, in Indianola, Iowa.Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comBlogger107125tag:blogger.com,1999:blog-5050113136400811496.post-70491619659018166062016-11-30T12:16:00.002-05:002016-11-30T12:19:56.445-05:00<p>Sample code for Moodle Quiz questions that have source code samples in them. In Moodle XML format.</p>
<pre class="brush: xml" name="code">
<?xml version="1.0" ?>
<quiz>
<!-- "Test" is the quiz question bank name -->
<question type="category">
<category>
<text>$course$/Test</text>
</category>
</question>
<!-- Sample short answer question with a code sample.
See: https://docs.moodle.org/31/en/Moodle_XML_format for more details.
-->
<question type="shortanswer">
<name>
<text>Test question</text>
</name>
<questiontext format="html">
<text>Look at the following code:
<![CDATA[
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<pre><code class="python"># Code Sample
def test_function():
print("Hi")
test_function()
</code></pre>
]]>
What does the program print when it runs?
</text>
</questiontext>
<!-- Case sensitive flag -->
<usecase>1</usecase>
<answer fraction="100">
<text>Hi</text>
<feedback><text>Correct!</text></feedback>
</answer>
<answer fraction="0">
<text>hi</text>
<feedback><text>Sorry, but case matters!</text></feedback>
</answer>
</question>
</quiz>
</pre>Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-40696458644824729022015-04-08T10:31:00.001-05:002015-04-08T10:31:34.829-05:00How much money can you get from YouTube video ads?I was curious about what kind of money a normal person can make out of YouTube video ads.
<br />
<br />
As part of my <a href="http://programarcadegames.com/">Program Arcade Games</a> web site I have a lot of tutorial videos. I've got about 2,000 subscribers and a half million views total on my video channel. Was that worth any money? Last Christmas I enabled advertising to find out.
<br />
<br />
The results:
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; width: 286px;">
<colgroup><col style="mso-width-alt: 6985; mso-width-source: userset; width: 143pt;" width="191"></col>
<col style="mso-width-alt: 3474; mso-width-source: userset; width: 71pt;" width="95"></col>
</colgroup><tbody>
<tr height="20" style="height: 15.0pt;">
<td height="20" style="height: 15.0pt; width: 143pt;" width="191">Start date:</td>
<td align="right" class="xl63" style="width: 71pt;" width="95">12/23/2014</td>
</tr>
<tr height="20" style="height: 15.0pt;">
<td height="20" style="height: 15.0pt;">End date:</td>
<td align="right" class="xl63">4/8/2015</td>
</tr>
<tr height="20" style="height: 15.0pt;">
<td height="20" style="height: 15.0pt;">Days advertising was active:</td>
<td align="right">106</td>
</tr>
<tr height="20" style="height: 15.0pt;">
<td height="20" style="height: 15.0pt;">Total views:</td>
<td align="right">81,165</td>
</tr>
<tr height="20" style="height: 15.0pt;">
<td height="20" style="height: 15.0pt;">Total earned:</td>
<td align="right">103.25</td>
</tr>
<tr height="20" style="height: 15.0pt;">
<td height="20" style="height: 15.0pt;">Amount earned per day</td>
<td align="right" class="xl64">0.9741</td>
</tr>
<tr height="20" style="height: 15.0pt;">
<td height="20" style="height: 15.0pt;">Amount earned per view</td>
<td align="right" class="xl64">0.0013</td>
</tr>
</tbody></table>
<br /><br />
<br />
<div>
You need at least $100 in revenue to get paid. I ended the experiment to see once I got over $100. Quite frankly, $100 doesn't seem worth it to annoy people for 106 days and 81,000 views.</div>
<div>
<br /></div>
<div>
Keep in mind you only get paid if someone clicks on the ad. So a person isn't paid on a per-view basis. The results varied a lot on a per-day basis. This is what the analytics looked like:</div>
<div>
<br /><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdKlfFW_sWIj0pg4d3c3t1YqJAzjjgGaKQH6m974D_uHo5KkD_HiDx2Upe2h1ARorCcS4HVqOZ1M2laCJtKx_vmg53rueY9lFhlVf4ExIYmAKt9ZKoTTxDSyTrT-1qox_pqyA7JF40V1w/s1600/2015-04-08_10-30-24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdKlfFW_sWIj0pg4d3c3t1YqJAzjjgGaKQH6m974D_uHo5KkD_HiDx2Upe2h1ARorCcS4HVqOZ1M2laCJtKx_vmg53rueY9lFhlVf4ExIYmAKt9ZKoTTxDSyTrT-1qox_pqyA7JF40V1w/s1600/2015-04-08_10-30-24.png" height="275" width="320" /></a></div>
</div>
Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-27587956795644513072015-02-14T16:00:00.000-05:002015-02-14T16:01:34.754-05:00Script for setting up Wordpress on an AWS machine<p>I found the documentation a bit of a headache to run through. This is a quick way to get a wordpress server up and running on Amazon Web Services.</p>
<pre class="brush: bash" name="code">
DBPASSWORD="yourdbpassword"
DBSERVERPASSWORD="yourdbserverpassword"
sudo apt-get -y update
sudo apt-get -y upgrade
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password yourdbserverpassword'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password yourdbserverpassword'
sudo apt-get -y install mysql-server
sudo apt-get -y install apache2 php5 php5-mysql mercurial
sudo service mysql start
mysql -u root -p
yourdbserverpassword
CREATE USER 'wordpress-user'@'localhost' IDENTIFIED BY 'yourdbpassword';
CREATE DATABASE `wordpress-db`;
GRANT ALL PRIVILEGES ON `wordpress-db`.* TO "wordpress-user"@"localhost";
FLUSH PRIVILEGES;
exit
cd ~
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
cd wordpress/
cp wp-config-sample.php wp-config.php
sed -i 's/database_name_here/wordpress-db/g' wp-config.php
sed -i 's/username_here/wordpress-user/g' wp-config.php
sed -i 's/password_here/yourdbpassword/g' wp-config.php
curl https://api.wordpress.org/secret-key/1.1/salt/ >> wp-config.php
sudo rm /var/www/html/index.html
sudo mv * /var/www/html/
sudo chown -R www-data:www-data /var/www/html
</pre>Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-20236800209019969152014-12-02T09:23:00.003-06:002014-12-02T09:23:32.990-06:00Learn to Program in Python!The second edition of <a href="http://amzn.com/B00CGAEY2W">Program Arcade Games with Python and Pygame</a> is out! I'm very happy with how it has turned out. A lot of feedback from the first edition has gone into making the second. The Amazon reviews are good as well. The whole book is available on-line at <a href="http://programarcadegames.com/">ProgramArcadeGames.com</a>.<br />
<br />
I'm not sure what my second professional project will be.Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-17260321655355642272013-03-11T06:31:00.000-06:002013-03-26T06:32:08.261-06:00Three Years After The Adoption<span style="background-color: white; color: #37404e; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 18px;">Three years ago today Val and I sat in a courtroom to adopt Tanya and Nastya. Ten days later they were officially ours, and soon after they were in the US. </span><br />
<br style="background-color: white; color: #37404e; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 18px;" />
<span style="background-color: white; color: #37404e; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 18px;">Nothing worth doing is easy. But it has been worth it.</span><br />
<br style="background-color: white; color: #37404e; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 18px;" />
<span style="background-color: white; color: #37404e; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 18px;">Nastya has learned so much and worked so hard. Her teacher this year didn't even know she’d been in Russia less than three years ago. </span><br />
<br style="background-color: white; color: #37404e; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 18px;" />
<span style="background-color: white; color: #37404e; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 18px;">Tanya, wow. The teenage years are hard enough. Wat</span><span class="text_exposed_show" style="background-color: white; color: #37404e; display: inline !important; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 13px; line-height: 18px;">ching her work through the frustration of everything and grow into a happy young woman getting ready to be independent is beautiful.<br /><br />Alyssa? She grew up. We no longer had time to be helicopter parents, and Alyssa showed that she could do great anyways. One minute she can be an adult, the next minute turn around and act like a kid with Nastya.<br /><br />Parents push their kids to do better, particularly when they don’t want to.<br /><br />What I didn't know was that kids push their parents to do be better. I've never been pushed harder by anyone, including myself. And no one has been there for me more than Val. In another eight years the kids will leave, and there’s no one I’d rather spend the rest of my days with than her.<br /><br />I think sometimes in life we focus so hard on where we’d like to be, that we forget to appreciate how far we've come. Nastya has had to learn everything a typical fourth grader knows in less than three years. Alyssa welcomed two strangers into her home as sisters. Tanya? She’s a typical high school student, defying the odds where half of all 15 year-olds that immigrate to the U.S. without English fail to even finish high school.<br /><br />Please excuse me as I congratulate my family. Not everyone could have done that.<br /><br />It has been a hard road, but we've traveled far and it looks like we have many miles ahead of us. Thanks to everyone that has traveled with us.</span>Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-60980358893052711322013-02-06T19:10:00.000-06:002013-02-06T19:10:32.667-06:00Pygame<a href="http://programarcadegames.com">Pygame Tutorials</a>
<p>Learn to create games using pygame with this free on-line e-book.Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-85096895283965543412013-02-06T14:26:00.002-06:002013-02-06T14:27:45.886-06:00Install Sphinx on Windows.<p>First, install Python 2.7. I've had no luck the the 3.x series.
<p>Then, download and install easy_install from here: <a href="http://pypi.python.org/pypi/setuptools/0.6c11">http://pypi.python.org/pypi/setuptools/0.6c11</a><br />
<p>Then, execute:
<pre class="brush: bash">
\Python27\Scripts\easy_install.exe sphinx
</pre>Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-57121241737730056532012-12-29T07:29:00.001-06:002013-01-10T13:22:16.361-06:00I recently installed <a href="http://rhodecode.org/">RhodeCode</a> onto Simpson's server. Awesome program, but setup isn't quite as easy as I'd like. So here are my notes, in case anyone else is interested.
<br />
I relied heavily on the following sites for information:
<br />
<ul>
<li><a href="http://packages.python.org/RhodeCode/installation.html">RhodeCode installation</a>
</li>
<li><a href="http://packages.python.org/RhodeCode/setup.html#setup">RhodeCode setup</a>
</li>
<li><a href="http://blog.excedalogic.com/post/2012/06/16/Complete-guide-to-install-and-configure-Rhodecode-on-Ubuntu-1204-using-MySQL-as-the-database-instead-of-sqllite.aspx">This guy's great blog post.</a>
</li>
</ul>
Installation was done on a Debian Wheezy system.
<br />
First, become superuser.
<br />
<pre class="brush: bash" name="code">sudo bash
</pre>
Install pre-requisites.
<br />
<pre class="brush: bash" name="code">apt-get install python-all-dev python-pip python-mysqldb rabbitmq-server python-virtualenv libmysqlclient-dev
easy_install -U distribute
pip install mysql-python
pip install virtualenv
</pre>
Set up the message queue system.
<br />
<pre class="brush: bash" name="code">rabbitmqctl add_user rhodeuser mypassword
rabbitmqctl add_vhost rhodevhost
rabbitmqctl set_permissions -p rhodevhost rhodeuser ".*" ".*" ".*"
</pre>
I prefer mysql for the database. Set this up.
<br />
<pre class="brush: bash" name="code">mysql -u root -p
create database rhodecode character set utf8;
create user 'rhodecode'@'localhost' identified by 'mypassword';
grant all privileges on rhodecode.* to 'rhodecode'@'localhost';
flush privileges;
exit
</pre>
Create a directory for installation
<br />
<pre class="brush: bash" name="code">cd /var
mkdir rhode
chown www-data rhode
cd rhode
virtualenv --no-site-packages /var/rhode/venv
cd /var/rhode/venv/bin
source activate
cd /
pip install pastescript
pip install rhodecode
cd /var/rhode/venv/bin/
wget http://ncu.dl.sourceforge.net/project/mysql-python/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz
tar -zxf MySQL-python-1.2.3.tar.gz
cd MySQL-python-1.2.3
python setup.py build
cd ..
paster make-config RhodeCode production.ini
</pre>
Edit production.ini so it looks like this:
<br />
<pre class="brush: bash" name="code">vim production.ini
# -----
use_celery = true
# broker.host = localhost
broker.vhost = rhodevhost
broker.port = 5672
broker.user = rhodeuser
broker.password = mypassword
# Find this line and change to:
sqlalchemy.db1.url = mysql://rhodecode:mypassword@localhost/rhodecode
</pre>
<pre class="brush: bash" name="code">paster setup-rhodecode production.ini --user=rhodeuser --password=mypassword --email=paul@cravenfamily.com --repos=/mnt/hg_repos
/etc/init.d/rabbitmq-server start
</pre>
See if celery works and hooks up to the message queue. If it does, hit ctrl-c and go to the next step. If it doesn't, debug before continuing.
<br />
<pre class="brush: bash" name="code">paster celeryd production.ini
</pre>
Start running. Then see if it works.
<br />
<pre class="brush: bash" name="code">paster celeryd production.ini &
paster serve production.ini
</pre>
I really wanted to use wsgi to serve stuff up. But I couldn't get authentication working. I am sad.
<br />
<pre class="brush: bash" name="code">vim apache.conf
----
WSGIScriptAlias /repo /var/rhode/venv/dispatch.wsgi
WSGIPassAuthorization On
WSGIDaemonProcess rhodecode user=www-data group=www-data threads=1 processes=10
WSGIDaemonProcess pylons \
threads=4 \
python-path=/var/rhode/venv/lib/python2.6/site-packages
</pre>
More wsgi stuff I didn't get working.
<br />
<pre class="brush: bash" name="code">vim /var/rhode/venv/dispatch.wsgi
------
import os
os.environ["HGENCODING"] = "UTF-8"
os.environ['PYTHON_EGG_CACHE'] = '/var/rhode/venv/.egg-cache'
os.chdir('/var/rhode/venv')
import site
site.addsitedir("/var/rhode/pyenv/lib/python2.6/site-packages")
from paste.deploy import loadapp
from paste.script.util.logging_config import fileConfig
fileConfig('/var/rhode/venv/bin/production.ini')
application = loadapp('config:/var/rhode/venv/bin/production.ini')
</pre>
To get the pass-through proxy working, this is what I did. First, enable the proxy mods:
<br />
<pre class="brush: bash" name="code">a2enmod proxy_http
a2enmod proxy
a2enmod mod_headers
</pre>
And some other stuff. I'll finish my notes later.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-8846291052787649802012-10-04T17:29:00.001-05:002012-10-04T17:29:35.030-05:00Computer Science – Simpson CollegeRather pleased with the customization we've done four our website: <a href="http://simpson.edu/computer-science/#.UG4NqUdCTF8.blogger">Computer Science – Simpson College</a>Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-10591643647193334232012-09-21T10:49:00.002-05:002012-09-21T10:56:26.601-05:00Flipped ClassroomA "flipped classroom" is one where students watch lectures at home and do their homework in class. The <a href="http://www.khanacademy.org/">Kahn Academy</a> has done wonders in helping instructors with flipped classes.<br />
<br />
I decided to try it with my class that introduces computer programming. My hypothesis: I could get more students to post excellent grades with this method than the traditional method.<br />
<br />
Over the summer I worked on <a href="http://programarcadegames.com/">this website</a>.<br />
<br />
I put the lectures on-line. A total of 55 videos, over 6 hours of run time. Most videos are short. I used a graphics tablet to mark up the screen during the video. I got a good microphone and edited the videos to remove annoying sounds, mistakes, or other distractions.<br />
<br />
The full text of the book is on-line. There are code examples and JavaScript animations that animate the code to visualize what is happening.<br />
<br />
I created a multiple-choice quiz engine to test the students on-line. That helps make sure they actually went through the material.<br />
<br />
The website got a lot of positive feedback from the community-at-large, I was helping more students learn programming on-line than I was in the classroom.<br />
<br />
It seemed like everything ready for a full test of a "flipped" class this semester. The first real results would be from Test 1.<br />
<br />
I started getting worried when there were students doing worksheets in class that had clearly not watched the lectures or gone over the material first. Plus my "draw a picture" lab had fewer images that really showed off the creativity of what students were able to do.<br />
<br />
The results of Test 1 confirmed my worries. It showed a noticeable down-tick in grades compared to prior years. Was it terrible? No, there were still a lot of "A" grades. However there were more students on the C-F range than what I normally get. It seemed like a "flipped" class was allowing more students to slip through the cracks than before.<br />
<br />
My conclusion, the data did not support my hypothesis.<br />
<br />
Here are more hypotheses I have:<br />
<br />
<ul>
<li>Students who don't want to do work outside of class still don't. They gain more from having the traditional lecture in-class and not doing the homework. In a flipped class they skip watching the lecture and just copy worksheets resulting in even less comprehension.</li>
<li>Fewer students will become inspired by the material and want to explore a career in that area. Students that aren't willing to ask questions about worksheets have little interaction with the instructor. Those students are less likely to be inspired by the instructor because they don't get to regularly see how excited he/she is about the material.</li>
<li>A flipped class will work well in an evening class. Evening classes with working adults have a high drop-out rate for an introductory computer science course. I think that teaching in a 'flipped' manner will result in higher scores for these students even if they result in lower scores for day students. Meeting four times a day, is better than a flipped class, which itself is better than meeting one time a week. </li>
<li>The 'flipped' class scales well. It will still perform 'well' with an average instructor and will involve little work on the instructor's part if the material is already created. e.g., a teacher that doesn't understand calculus well can still do a good job teaching calculus with help from the Kahn academy. Or a teacher can have more students in a class and still teach them. But neither can match a great teacher in a small class.</li>
</ul>
At some point I'll do a survey and see if I can't get more information from the class. I'm going back to my traditional methods for now.<br />
<br />
I am still reaching a lot of students who have never set foot at Simpson. So I don't think the effort spend on the website is a waste. But I'm not improving the scores of my class doing this.Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-90039036125170815852012-09-12T21:20:00.002-05:002012-10-04T15:10:34.004-05:00Prototyping an Arduino and Nixie Tube clockI finally got an Arduino I could dedicate towards my steampunk clock project. I have an LCD display and <a href="http://www.dfrobot.com/index.php?route=product/product&product_id=738#.UFFDbI1lQ3g">Nixie Tubes</a> to pair up. Here's a video of what I have working as of tonight:<br />
<div class="separator" style="clear: both; text-align: center;">
<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/hC_8mu3v9wQ/0.jpg" height="266" width="320"><param name="movie" value="http://www.youtube.com/v/hC_8mu3v9wQ?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" /><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><embed width="320" height="266" src="http://www.youtube.com/v/hC_8mu3v9wQ?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash" allowfullscreen="true"></embed></object></div>
<br />
You can see that on the lower left are my four Nixie Tubes showing minutes and seconds. Eventually it will just be minutes and hours, but that doesn't make for a good demo video. On the right is the Arduino and LCD shield hooked up to a <a href="https://www.adafruit.com/products/255">Chronodot</a>. The Chronodot also has a thermometer.<br />
<br />
In the background is the power supply. The project is pulling 0.38 amps at 12.1 volts.<br />
<br />
I like the <a href="http://adafruit.com/products/714">LCD shield from Adafruit</a>. I had to solder the LCD shield together, which I wasn't big on, but I like the ability to change colors and the integrated buttons:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/zeR4dlr4-Sc?feature=player_embedded' frameborder='0'></iframe></div>
<br />
The circuit layout is pretty simple, courtesy of <a href="http://fritzing.org/">Fritzing</a>:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIFYXXaV_Ead4S5agcdqCYiWeJ6HJ4G-wYPvevyx5YiojbCwny7t-Z-zwlsvSLrLNG0J2fiCzY3ZGQY682VbvHGC0YaLtsgTcTcPFQxP_6ulN90Dmcvw73OBUrNcGbdnmD3N8Q_pSXTZk/s1600/Clock_bb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="229" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIFYXXaV_Ead4S5agcdqCYiWeJ6HJ4G-wYPvevyx5YiojbCwny7t-Z-zwlsvSLrLNG0J2fiCzY3ZGQY682VbvHGC0YaLtsgTcTcPFQxP_6ulN90Dmcvw73OBUrNcGbdnmD3N8Q_pSXTZk/s320/Clock_bb.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The software uses this <a href="https://github.com/aguegu/nixie-tube">Nixie Tube library</a>, and also this <a href="https://github.com/Stephanie-Maks/Arduino-Chronodot">Chronodot library</a>.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-51321895064539026812012-09-06T14:22:00.001-05:002012-10-14T19:44:27.795-05:00Arduino Nixie TubeUpdate: See the finished project <a href="http://simpson.edu/2012/10/nixie-tube-clock-enclosure/">here</a>.<br />
<br />
The Nixie Tube [<a href="http://www.dfrobot.com/index.php?route=product/product&product_id=738">link</a>] from DFRobot.com was ordered Monday night. It was shipped Tuesday from Shanghai, China and arrived here in Iowa two days later on Thursday!!!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuLFYRaP27a9nT3FMTyJCz9CoxaDeSlR1tcIcBzh_7ktP06AJK50Ckhg4Jy1wcqEIkNRnbgDN4XivxI5kTQ4SAIgwaYgA-ynK_NtHdXkLtR8x0ihER4Kf9h7eV4Q-SXsD77h2RJSbdCBw/s1600/1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuLFYRaP27a9nT3FMTyJCz9CoxaDeSlR1tcIcBzh_7ktP06AJK50Ckhg4Jy1wcqEIkNRnbgDN4XivxI5kTQ4SAIgwaYgA-ynK_NtHdXkLtR8x0ihER4Kf9h7eV4Q-SXsD77h2RJSbdCBw/s320/1.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Opening the package revealed a DFRobot package.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVSBC0e40iGpIg_z7yrRndYR1LAK0kjv4_3pvswMegU0F364v3NdMyo2W4faxNX35vmr-0TFeERbIrrBGGuaYUHkJTUTI8d9EJ6e81Cr9wVbnL-lZoqO8J2h4YjYgXtnpr4iV0vOnxg_E/s1600/2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVSBC0e40iGpIg_z7yrRndYR1LAK0kjv4_3pvswMegU0F364v3NdMyo2W4faxNX35vmr-0TFeERbIrrBGGuaYUHkJTUTI8d9EJ6e81Cr9wVbnL-lZoqO8J2h4YjYgXtnpr4iV0vOnxg_E/s320/2.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Looks nicely packed with foam. Also included a pre-drilled plexiglass board for the four tubes I ordered. Cool, didn't ask or expect that.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4AuFcNpWTsyiLUPVHFAEnrFFQCTuch_XDZXPJLdfff5mTAI_9Wj3OKvztMWTzy-zg1_91DT2fbEG8XHyb6aesi6GQjdsHEOUlDOmrudjYUWtOq5c6cty28vlJ8OhyDcxp2NHojcZ2bGw/s1600/3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4AuFcNpWTsyiLUPVHFAEnrFFQCTuch_XDZXPJLdfff5mTAI_9Wj3OKvztMWTzy-zg1_91DT2fbEG8XHyb6aesi6GQjdsHEOUlDOmrudjYUWtOq5c6cty28vlJ8OhyDcxp2NHojcZ2bGw/s320/3.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Foam removed.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5AdnQj9yKxSO_A2Jwj3r72Sj7Sle3los5tls6ZEZ2ZhYpp-SQM5P18TzUvtkf5CFEe6tgQVTIhrNTyUMMHHV_0b0GCaxidoyrARxVRw5lo-ztDl2U0cKOfnUd9WC9NoIET_JV88_BLQw/s1600/4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5AdnQj9yKxSO_A2Jwj3r72Sj7Sle3los5tls6ZEZ2ZhYpp-SQM5P18TzUvtkf5CFEe6tgQVTIhrNTyUMMHHV_0b0GCaxidoyrARxVRw5lo-ztDl2U0cKOfnUd9WC9NoIET_JV88_BLQw/s320/4.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirQZfuMF58rn8TkAV61E6d2RNxNfg_qAlskxDGvF0dgeM4WKD9mXdSGw3g9KRjclMMSfYJjtY6ZixrPvq-AQ-_nlFpp0n6qUUoelDwmoGTD6ZHQnfDfCWBJHNLiRSw_J0urwRvq_deUQ4/s1600/5.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirQZfuMF58rn8TkAV61E6d2RNxNfg_qAlskxDGvF0dgeM4WKD9mXdSGw3g9KRjclMMSfYJjtY6ZixrPvq-AQ-_nlFpp0n6qUUoelDwmoGTD6ZHQnfDfCWBJHNLiRSw_J0urwRvq_deUQ4/s320/5.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
I downloaded the sample code and looked at the Wiki. Managed to hook up one module to power and do hit the test button with no issues. I hit the test button with a stick since it cautions the on-board voltage can be up to 170 volts.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Hooked it up to the Arduino and ran the breathSample from the code examples and got:</div>
<div class="separator" style="clear: both; text-align: left;">
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="315" src="http://www.youtube.com/embed/uNjAUwL48hw" width="420"></iframe>
</div>
My plan is to create a steam-punk style alarm clock with these as a personal art project.Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-34792177499667319552012-08-23T17:48:00.003-05:002012-08-23T17:48:45.149-05:00Getting the CMPS03 compass to work with the ArduinoCode for testing a digital compass using Arduino UNO<br />
<br />
<pre><span style="color: #444444;">/*
CMPS03 with arduino I2C example
This will display a value of 0 - 359 for a full rotation of the compass.
The SDA line is on analog pin 4 of the arduino and is connected to pin 3 of the CMPS03.
The SCL line is on analog pin 5 of the arduino and is conected to pin 2 of the CMPS03.
Both SDA and SCL are also connected to the +5v via a couple of 1k8 resistors.
A switch to callibrate the CMPS03 can be connected between pin 6 of the CMPS03 and the ground.
*/</span>
<span style="color: blue;"><strong>#include <span style="color: green;"><wire .h=".h"></wire></span></strong></span>
<span style="color: blue;"><strong>#define address 0x60 //defines address of compass</strong></span>
<strong>void</strong> <span style="color: #2040a0;">setup</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;"><strong>{</strong></span>
<span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">begin</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> //<span style="color: #2040a0;">conects</span> <span style="color: #2040a0;">I2C</span>
<span style="color: #2040a0;">Serial</span>.<span style="color: #2040a0;">begin</span><span style="color: #4444ff;">(</span><span style="color: red;">9600</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<span style="color: #4444ff;"><strong>}</strong></span>
<strong>void</strong> <span style="color: #2040a0;">loop</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;"><strong>{</strong></span>
<span style="color: #2040a0;">byte</span> <span style="color: #2040a0;">highByte</span><span style="color: #4444ff;">;</span>
<span style="color: #2040a0;">byte</span> <span style="color: #2040a0;">lowByte</span><span style="color: #4444ff;">;</span>
<span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">beginTransmission</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">address</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> //<span style="color: #2040a0;">starts</span> <span style="color: #2040a0;">communication</span> <span style="color: #2040a0;">with</span> <span style="color: #2040a0;">cmps03</span>
<span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">write</span><span style="color: #4444ff;">(</span><span style="color: red;">2</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> //<span style="color: #2040a0;">Sends</span> <span style="color: #2040a0;">the</span> <strong>register</strong> <span style="color: #2040a0;">we</span> <span style="color: #2040a0;">wish</span> <span style="color: #2040a0;">to</span> <span style="color: #2040a0;">read</span>
<span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">endTransmission</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">requestFrom</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">address</span>, <span style="color: red;">2</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> //<span style="color: #2040a0;">requests</span> <span style="color: #2040a0;">high</span> <span style="color: #2040a0;">byte</span>
<strong>while</strong><span style="color: #4444ff;">(</span><span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">available</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><</span> <span style="color: red;">2</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> //<strong>while</strong> <span style="color: #2040a0;">there</span> <span style="color: #2040a0;">is</span> <span style="color: #2040a0;">a</span> <span style="color: #2040a0;">byte</span> <span style="color: #2040a0;">to</span> <span style="color: #2040a0;">receive</span>
<span style="color: #2040a0;">highByte</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">read</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> //<span style="color: #2040a0;">reads</span> <span style="color: #2040a0;">the</span> <span style="color: #2040a0;">byte</span> <span style="color: #2040a0;">as</span> <span style="color: #2040a0;">an</span> <span style="color: #2040a0;">integer</span>
<span style="color: #2040a0;">lowByte</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">Wire</span>.<span style="color: #2040a0;">read</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<strong>int</strong> <span style="color: #2040a0;">bearing</span> <span style="color: #4444ff;">=</span> <span style="color: #4444ff;">(</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">highByte</span><span style="color: #4444ff;"><</span><span style="color: #4444ff;"><</span><span style="color: red;">8</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">+</span><span style="color: #2040a0;">lowByte</span><span style="color: #4444ff;">)</span>/<span style="color: red;">10</span><span style="color: #4444ff;">;</span>
<span style="color: #2040a0;">Serial</span>.<span style="color: #2040a0;">println</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">bearing</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<span style="color: #2040a0;">delay</span><span style="color: #4444ff;">(</span><span style="color: red;">100</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<span style="color: #4444ff;"><strong>}</strong></span>
</pre>
Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-59583281663204205442012-08-16T09:04:00.001-05:002012-08-16T09:07:38.563-05:00Getting started with Arduino robotsThe Arduino microcontroller has finally made robotics work fun. I've worked with other microcontrollers such as RoBoard, Freescale, Parallax, and found them to be more frustrating than fun. The Arduino has changed all that in my case. This shows what I've been able to do with just a few evenings.<br />
<br />
In the first evening, I was able to get an Arduino board to drive some LEDs within just a few minutes.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/ZYaeDx_G_s4/0.jpg" height="266" width="320"><param name="movie" value="http://www.youtube.com/v/ZYaeDx_G_s4?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" /><param name="bgcolor" value="#FFFFFF" /><param name="allowFullScreen" value="true" /><embed width="320" height="266" src="http://www.youtube.com/v/ZYaeDx_G_s4?version=3&f=user_uploads&c=google-webdrive-0&app=youtube_gdata" type="application/x-shockwave-flash" allowfullscreen="true"></embed></object></div>
<br />
A little more work, an I have motors and servos working. By the third evening, I had my first autonomous robot using one ultrasonic sensor for obstacle avoidance:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/fxCrXs30n1o?feature=player_embedded' frameborder='0'></iframe></div>
<br />
I made version 2.0 of my robot, so that I could have more breadboard space, giving me an LCD display and two ultrasonic sensors:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghxxU2OQKw6Mq2dvvY_bGqhC0dGeFRAzmYUf8kNz_X48HkvRjOU2H2i5mnVmaanG6uXdSiaS7aX3Ek9A8wUTLDlI7gGoIYIOOpXceob9QUrD1aj8sg_sYCVXmYfMPamub4JrgLiOy1Ltw/s1600/v2.jpg-large" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghxxU2OQKw6Mq2dvvY_bGqhC0dGeFRAzmYUf8kNz_X48HkvRjOU2H2i5mnVmaanG6uXdSiaS7aX3Ek9A8wUTLDlI7gGoIYIOOpXceob9QUrD1aj8sg_sYCVXmYfMPamub4JrgLiOy1Ltw/s320/v2.jpg-large" width="320" /></a></div>
<br />
The ultrasonic sensors had to be polled separately so they did not confuse each other. A bigger issue was the the robot no longer turned well. The front wheel does not turn, and the robot was now heavy enough that the front wheel no longer easily skidded sideways, like it did in version 1.0 of my robot.<br />
<br />
Yesterday in the mail I got <a href="http://www.robotshop.com/productinfo.aspx?pc=RB-Inn-25&lang=en-US">a different wheel</a> I ordered that solves this problem, by having small rollers on the wheel allowing it to slide sideways. So here is version 2.1 of my robot:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/5eJ9cXp0uKk?feature=player_embedded' frameborder='0'></iframe></div>
<br />
I'll be adding a magnetic compass soon, and eventually starting version 3.0 of my robot.Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-65136913619768093682012-06-29T15:23:00.001-05:002012-06-29T15:25:09.778-05:00<div class="separator" style="clear: both; text-align: left;">
I get in class new student teachers who need an endorsement that they have taken a programming class. Sometimes these students aren't that interested in programming, they don't see how it will apply to them.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
My lesson: "If you learn to program, and put your lessons out on the web you will reach more students than you ever would in the classroom." And I practice what I preach. <span style="background-color: white;">I've been working with my on-line book <a href="http://programarcadegames.com/">ProgramArcadeGames.com</a> a lot this summer. Traffic has increased, thanks mostly to reddit.com. Here is a graph of unique visitors per day:</span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfwAGjOqAcpl53JDn2khRZcxVWwkeKmuLHL1qarYeuaCVdtUMxqmThHjhF518dTlkCBYWiwF25bUkFKdwFnwD5LD-eaSiReCk7Urr501hEbs57PQHlydxzt_AMh3Ohed_KThG0p2V6Fdo/s1600/6-29-2012+3-12-42+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="181" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfwAGjOqAcpl53JDn2khRZcxVWwkeKmuLHL1qarYeuaCVdtUMxqmThHjhF518dTlkCBYWiwF25bUkFKdwFnwD5LD-eaSiReCk7Urr501hEbs57PQHlydxzt_AMh3Ohed_KThG0p2V6Fdo/s320/6-29-2012+3-12-42+PM.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Even more important, according to Google Analytics, about half of the visits are returning visitors. During the month of June I've had over 1,300 visits where more than ten minutes was spent browsing the site. About 500 of those spent more than twenty minutes on the site.</div>
<br />
I am reaching more students on-line than I am in the classroom.<br />
<div>
<br /></div>Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-8068130303277527182012-06-27T12:28:00.003-05:002012-06-27T12:28:34.585-05:00Learning to Program Arcade GamesI recently purchased <a href="http://programarcadegames.com/">http://ProgramArcadeGames.com</a> for my on-line book on how to program. A couple posts to reddit.com have brought in a lot of traffic. I'm hopeful that the new website address will help bring in search traffic.Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-67498540886396977392012-01-31T11:38:00.002-06:002012-01-31T14:30:54.085-06:00Educational Assessment<a href="http://inflationdata.com/inflation/inflation_articles/Education_Inflation.asp">College tuition is soaring five times faster faster than inflation</a>, while <a href="http://corporatevoices.wordpress.com/2011/01/27/the-ill-prepared-workforce-new-report-argues-that-lack-of-academic-rigor-undercuts-educational-attainment-and-skills-of-u-s-college-students/">45 percent of students did not demonstrate any improvement in learning</a>. For-profit schools are sucking up federal dollars, <a href="http://chronicle.com/article/For-Profit-Colleges-Show/126394/">some of them getting over ninety percent of their revenue from federal money</a>, while <a href="http://www.huffingtonpost.com/2010/11/24/forprofit-college-graduat_n_787964.html">graduating only 22 percent of the students that start.</a> The current solution to this problem that is being pushed to this problem: educational standards and assessment. It is, however, a dangerous path to follow.<br />
<br />
Where does this come from? I'll blame Iowa's own Edwards Deming. <a href="http://en.wikipedia.org/wiki/W._Edwards_Deming">Edwards Deming</a> helped manufacturing industry by attempting to apply a bit of science to manufacturing. Measure the quality of what you create. Try something new. See if it helps.<br />
<br />
The U.S. didn't like him, so he went to Japan. Guess what? Engineering your manufacturing process using evidenced-based changes did help! So now it seems like everything is made in Japan and other Asian countries. The key was to create a continuous cycle of evidence-based improvement.<br />
<br />
Now, society wants to apply this to teaching as well.<br />
<br />
Good teachers will naturally go through this process of assessment. They will continue to work on their class and find ways to improve it. They find out what other teachers are doing. Good teachers learn how to judge the personality of the students they work with, and learn techniques for working those students.<br />
<br />
This process of continuing improvement is why good teachers often write their own books, and keep editing them to make them better. They create their own lesson plans and improve them year after year. But the process isn't perfect.<br />
<br />
The problem in applying this to teaching? The impossibility of creating a common benchmark that can be used to evaluate the effectiveness of each teacher. Education is about humans. Since we are working with so many different humans, there are too many variables. Variables such as:<br />
<ul><li>Different teachers have different styles. (The variety between teachers works well to keep students interested.)</li>
<li>Students aren't all the same, and they respond to different techniques.</li>
<li>Some students are capable of excelling in certain subject areas. Other students just move slower.</li>
</ul>A continuous process of improvement assumes a controllable set of variables. Unfortunately this is not a situation that exists inside of academia. Particularly once the scope starts extending beyond the range of a single school, or even a single teacher.<br />
<br />
At an individual or small-group level this continuous improvement may still be possible. Once the process expands to a larger group, it is too easy to get caught up in the paperwork and 'process.' People pay attention to the paperwork being required, and ignore the real goal of providing evidence-based improvements. A process that worked for one group may not work for more people.<br />
<br />
This article does a wonderful job of explaining why this is bad:<br />
<a href="http://www.joelonsoftware.com/articles/fog0000000024.html">Big Macs vs. The Naked Chef</a><br />
<br />
(Seriously, go back and read that article. It is 10 times better than this one and you are wasting your time if you continue reading without having read that other article. Plus it has the word "naked" in the title, so it has to be good.)<br />
<br />
Yes, that article was about software development. But the theory is the same in education.<br />
<br />
What I hate about educational 'standards' is that it works to bring up poor performing people to the average, while bringing down high-performing teachers. We are left with an uninteresting homogeneous soup at the end.<br />
<br />
Do we want our schools to be McDonalds? Do we want our students to be Big Macs?Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-32010553571683790152011-05-16T10:13:00.001-05:002011-05-16T10:13:45.840-05:00Creating movies from still imagesI've been trying several ways to create movies from a set of still images. I find commercial packages to be too expensive for this simple task. <a href="http://www.blender.org/">Blender</a> does a good job, but I prefer the simplicity (and script-ability) of a command-line tool. At first I tried <a href="http://en.wikipedia.org/wiki/MEncoder">MEncoder</a>, but I could never find options that would produce a decent result. There were always too many compression artifacts.<br />
<br />
What I've settled on is <a href="http://www.ffmpeg.org/">ffmpeg</a>. I use the following command:<br />
<div style="font-family: "Courier New",Courier,monospace;"><br />
</div><div style="font-family: "Courier New",Courier,monospace;">ffmpeg -r 30 -b 1800kb -i image%d.jpg movie.avi</div><br />
The %d is the number of the picture. This seems to produce a decent balance between file size and output quality.Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-68575700915880849992010-10-27T14:19:00.000-05:002010-10-27T14:19:18.829-05:00Creating a brick wall with Blender 2.54I have been wanting to create a brick wall with <a href="http://www.blender.org/">Blender</a>. I found <a href="http://www.blenderguru.com/introduction-to-texture-nodes/">this tutoria</a>l to be very helpful. It works well if the camera is not very close to the wall. It is fast and easy to put together.<br />
<br />
It is also possible to put together a brick wall with an array modifier. But what really inspired me was the example script for creating castle walls available <a href="http://blenderartists.org/forum/showthread.php?t=105507">here</a>. That script did not work for the current Blender 2.54 Beta version. So I thought I would work on creating my own script.<br />
<br />
Here is a development version of my script. I thought I would post it here so that others looking for Blender 2.54 Beta scripting examples could find it<br />
<br />
<pre><a href="" name="1"> <span style="color: #804000;">import</span> bpy
</a><a href="" name="2">
</a><a href="" name="3"> row_count = 8 <span style="color: maroon;"># Number of rows</span>
</a><a href="" name="4"> bricks_per_row = 15 <span style="color: maroon;"># Number of bricks in each row</span>
</a><a href="" name="5"> cube_x = .25 <span style="color: maroon;"># Length of each brick</span>
</a><a href="" name="6"> cube_y = .25 <span style="color: maroon;"># Width of wall</span>
</a><a href="" name="7"> cube_z = .125 <span style="color: maroon;"># Height of each brick</span>
</a><a href="" name="8"> row_gap = .01 <span style="color: maroon;"># Gap between each row</span>
</a><a href="" name="9"> brick_gap = .01 <span style="color: maroon;"># Gap between each brick</span>
</a><a href="" name="10">
</a><a href="" name="11"> <span style="color: maroon;"># Calculated values</span>
</a><a href="" name="12"> offset_amount = cube_x/2 <span style="color: maroon;"># Staggers bricks</span>
</a><a href="" name="13"> rescaling_factor_x=cube_x/2 <span style="color: maroon;"># Used to size the brick</span>
</a><a href="" name="14"> rescaling_factor_y=cube_y/2
</a><a href="" name="15"> rescaling_factor_z=cube_z/2
</a><a href="" name="16">
</a><a href="" name="17"> <span style="color: maroon;"># Loop for each row</span>
</a><a href="" name="18"> <span style="color: #804000;">for</span> row <span style="color: #804000;">in</span> range(row_count):
</a><a href="" name="19"> <span style="color: maroon;"># Calculate if we stagger this row</span>
</a><a href="" name="20"> offset = row % 2 * offset_amount
</a><a href="" name="21"> <span style="color: maroon;"># Loop for each brick</span>
</a><a href="" name="22"> <span style="color: #804000;">for</span> index <span style="color: #804000;">in</span> range(bricks_per_row):
</a><a href="" name="23"> <span style="color: maroon;"># Add the brick</span>
</a><a href="" name="24"> bpy.ops.mesh.primitive_cube_add(
</a><a href="" name="25"> location=(index*(cube_x+brick_gap)+offset,
</a><a href="" name="26"> 0,
</a><a href="" name="27"> row *(cube_z + row_gap)))
</a><a href="" name="28"> <span style="color: maroon;"># Resize the brick</span>
</a><a href="" name="29"> bpy.ops.transform.resize(
</a><a href="" name="30"> value=(rescaling_factor_x,
</a><a href="" name="31"> rescaling_factor_y,
</a><a href="" name="32"> rescaling_factor_z))
</a><a href="" name="33"> <span style="color: maroon;"># Bevel the brick</span>
</a><a href="" name="34"> bpy.ops.object.modifier_add(type='<span style="color: #006000;">BEVEL</span>')</a></pre><a href="" name="34"><br />
</a>Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-6516046666374908672010-09-09T09:00:00.000-05:002010-09-09T09:00:09.215-05:00Agile ProgrammingA fellow U of Idaho alumni hit 'reply-all' to recent survey request sent by Idaho's computer science department. It was a shame that Idaho sent out the e-mail allowing this, and also that a graduate would make use of this fact. What really got me going was the e-mail:<br />
<br />
<blockquote>With all due respect, this "survey" feels like a complete joke and hardly gives me any confidence in the U of I C.S. program. How doyou expect a couple questions like that to really affect anything?<br />
<br />
The software world is going Agile and Lean. How much of that are you teaching to students yet? If you really want to be a leading edge CS department, you've got to be teaching people how to write good solid clean code. Is test driven development anywhere in the curriculum?<br />
When I graduated, I was sent into the world woefully under-prepared by the university. I pretty much taught myself how to really write code and on my senior project, I was the only person on the team that could really even write any code - I ended up writing all the code for the rest of the team - and they all got the same grade for the project that they could not even write the code for.<br />
<br />
Since then, I've hired a lot of software developers and run my own company for 15 years. Some of the best software developers I've hired had *NO* college education. I'm not the only one that's had that experience. It's making us software professionals question, more and<br />
more, the value of a college degree in this profession. Especially in this economy. I cannot in good conscious recommend to a talented youth that they spend 4 yrs at the U of I before they enter the profession. In fact, spending 4 years at the university might just set you back 4 or more years modern development paradigms.<br />
<br />
The U of I is in a position to make a difference, if you *REALLY* want to make a difference and not just appease the same old system of tenure and outdated instructors. The question is *WILL* you?<br />
<br />
I am part of a growing, international community of software professionals that really cares about our craft of software development. We teach others, put on conferences and make it work in real enterprise environments. I currently live in NYC where I'm more than busy staying at the top of my game. Myself and my colleagues really do care about the state of the software industry. I have yet to run into a single U of I person in this ever-growing Agile software<br />
movement. Why is that?<br />
<br />
I'd be interested to help you all in an advisory role if you really want to change. I'd even be interested in moving back to <span class="il">Idaho</span> if I though I could make a difference. I graduated in 1986 and I'm at the forefront of the Agile/Lean software movement. If you are just going to keep on doing the same old government funded, barely sufficient program that I experienced 20 years ago, I guess I'll keep on dismissing the message (and I'm not the only alumni, I'm sure).</blockquote><br />
I hate to feed the trolls, but I sent this back to him.<br />
<br />
<blockquote>I've found three categories for developers:<br />
<br />
1.) Developers that don't try to expand their knowledge.<br />
2.) Developers that read books on Agile, Scrumm, Rational, Crystal, XP, 6-Sigma, Test driven development, etc. and think it is the bee's knees.<br />
3.) Developers that have passed through enough versions of stage 2 and seen similar stages in business, marketing, engineering, etc. that they realize there is a difference between buzz-word fueled fads and the common fundamental techniques they all seem to wrap up. The key<br />
question: Are the fundamentals taught at Idaho?<br />
<br />
Had you listed the fundamentals that Idaho was skipping, I may have agreed with you. Instead, I got a few buzz-words.<br />
<br />
I always thought this was a good essay:<br />
<a href="http://www.joelonsoftware.com/articles/fog0000000024.html" target="_blank">Big Mac cs. The Naked Chef</a></blockquote><br />
I recently found the following article on reddit from someone who is similarly tired of hearing Agile all the time:<br />
<br />
<a href="http://www.whattofix.com/blog/archives/2010/09/agile-ruined-my.php">Agile Ruined My Life</a><br />
<br />
Agile, along with these other fads, does have fundamentally important concepts to be taught. But please drop the buzz-words that go with it. Concentrate on the techniques. And realize that not every set of pre-packaged and marketed management techniques will work for every project.<br />
<br />
Or maybe I should give up my whining and get rich by creating my own buzz-word, then repackage all those same techniques and pretend they are new. It is just so "formula."Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-31155507808919901602010-06-06T12:10:00.000-05:002010-06-06T12:10:02.698-05:00Parsing Facebook using PythonThis is an example of parsing Facebook to pull status updates out:<br />
<br />
<br />
<pre><a href="" name="1"> <span style="color: #804000;">from</span> HTMLParser <span style="color: #804000;">import</span> HTMLParser
</a><a href="" name="2">
</a><a href="" name="3"> <span style="color: #804000;">class</span> <span style="color: navy;">MyHTMLParser</span>(HTMLParser):
</a><a href="" name="4">
</a><a href="" name="5"> story = False
</a><a href="" name="6"> time = True
</a><a href="" name="7"> text = '<span style="color: #006000;"></span>'
</a><a href="" name="8"> updates=[]
</a><a href="" name="9"> times=[]
</a><a href="" name="10">
</a><a href="" name="11"> <span style="color: #804000;">def</span> <span style="color: navy;">handle_starttag</span>(self, tag, attrs):
</a><a href="" name="12"> <span style="color: maroon;">#print "Encountered the beginning of a %s tag" % tag</span>
</a><a href="" name="13"> <span style="color: #804000;">if</span> tag == '<span style="color: #006000;">span</span>' <span style="color: #804000;">and</span> attrs:
</a><a href="" name="14"> <span style="color: #804000;">for</span> name,value <span style="color: #804000;">in</span> attrs:
</a><a href="" name="15"> <span style="color: #804000;">if</span> name=='<span style="color: #006000;">class</span>' <span style="color: #804000;">and</span> value=='<span style="color: #006000;">UIStory_Message</span>':
</a><a href="" name="16"> self.story=True
</a><a href="" name="17"> <span style="color: #804000;">if</span> name=='<span style="color: #006000;">class</span>' <span style="color: #804000;">and</span> value=='<span style="color: #006000;">UIIntentionalStory_Time</span>':
</a><a href="" name="18"> self.time=True
</a><a href="" name="19">
</a><a href="" name="20"> <span style="color: #804000;">def</span> <span style="color: navy;">handle_endtag</span>(self, tag):
</a><a href="" name="21"> <span style="color: #804000;">if</span> self.story:
</a><a href="" name="22"> <span style="color: maroon;">#if len(self.text) > 0:</span>
</a><a href="" name="23"> self.updates.append(self.text)
</a><a href="" name="24"> self.text = '<span style="color: #006000;"></span>'
</a><a href="" name="25"> self.story=False
</a><a href="" name="26">
</a><a href="" name="27"> <span style="color: #804000;">def</span> <span style="color: navy;">handle_data</span>(self, data):
</a><a href="" name="28"> <span style="color: #804000;">if</span> self.story:
</a><a href="" name="29"> self.text = self.text + data.strip().replace("<span style="color: #006000;">\n</span>","<span style="color: #006000;"></span>")
</a><a href="" name="30"> <span style="color: #804000;">if</span> self.time:
</a><a href="" name="31"> update_count = len(self.updates)
</a><a href="" name="32"> <span style="color: #804000;">if</span>( update_count > 0 ):
</a><a href="" name="33"> self.updates[update_count-1] = data + "<span style="color: #006000;"> </span>" +self.updates[update_count-1]
</a><a href="" name="34"> self.time=False
</a><a href="" name="35">
</a><a href="" name="36"> f = open('<span style="color: #006000;">facebook log.htm</span>', '<span style="color: #006000;">r</span>')
</a><a href="" name="37">
</a><a href="" name="38"> htmlSource = f.read()
</a><a href="" name="39"> myparser = MyHTMLParser()
</a><a href="" name="40"> myparser.feed(htmlSource)
</a><a href="" name="41">
</a><a href="" name="42"> update_count = len(myparser.updates)
</a><a href="" name="43"> <span style="color: #804000;">while</span> update_count > 0:
</a><a href="" name="44"> update_count -= 1
</a><a href="" name="45"> <span style="color: #804000;">print</span> myparser.updates[update_count]</a></pre>Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-45631430311335822442010-02-22T21:42:00.000-06:002010-02-22T21:42:14.091-06:00Computer Science a Top-Paying Undergraduate DegreeAccording to NACE, Computer Science <a href="http://www.naceweb.org/Press/Releases/Early_Report_Shows_Lower_Average_Salary_for_College_Class_of_2010.aspx">ranks number four</a> in top paying undergraduate degrees. The top three are engineering degrees. Google "<a href="http://www.google.com/#hl=en&q=top+jobs">top jobs</a>" and see how often computer science jobs are in the top.<br />
<br />
Given this, and the fact that technology is critical to almost any popular job and entertainment option, why aren't more young people interested in computer science? Why are people waiting until they enter the workplace before realizing how important technology is?Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-74730143019045681882009-11-17T21:28:00.002-06:002009-11-17T21:44:32.839-06:00Lazy programmersI recently accessed the on-line customer service for the <a href="http://www.desmoinesregister.com">Des Moines Register</a>. Part of that process has you register your account number. Here's the message I got on the field to enter your account number:<br /><span class="icon-smtext"><blockquote>(You can find your account number on your invoice or call customer service at 1-877-424-0225. You must drop all beginning zeros and include the 'DM'. For example <script>handlePubCode('DM')</script>DM00012345 becomes <script>handlePubCode('DM')</script>DM12345.)</blockquote>Exactly how difficult would it be to write an algorithm that would add the DM if I forgot? Or drop the leading zeros?<br /><br />The DM Register is hardly alone. Many sites ask you to enter your credit card number, but without spaces. Stripping spaces takes only 1 to 2 lines of code, depending on the language you are using. If I want to enter spaces with my credit card number, don't let that stand in the way of my spending money at your web site.<br /></span>Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-83726981522134959382009-08-30T12:59:00.002-05:002009-08-30T13:10:55.617-05:00HP Counterfeit InkJust when I thought my HP Photosmart C7280 Printer could not be any more annoying, it has picked up a new "feature."<br /><br />What were a few of the original annoying features?<br /><ul><li>Continuously running 6 different processes.</li><li>Throwing up a dialog box to every computer in the house when it is low on ink, out of paper, or even if it has been turned on.</li><li>Originally it had 'critical updates' 2-3 times a week it needed to download. I figured out how to turn that off thankfully.</li><li>1/2 the computers in the house cause a blank sheet to print between each actual page we want printed.</li></ul>The 'new' feature: accusing me of using counterfeit ink. It is already a waste when studies have shown printers to report cartridges empty long before they actually are. But now I can't use my nearly full cartridge after only a month, because printer is suddenly convinced it is not a 'real' HP cartridge. At first it kept giving me nasty messages about voiding my warranty. Now it just refuses to use it at all.<br /><br />Bad Hewlett-Packard.Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.comtag:blogger.com,1999:blog-5050113136400811496.post-70316354691740911112009-07-09T10:11:00.004-05:002009-07-09T10:37:21.452-05:00Searching and Sorting algorithmsI'm teaching second semester programming this summer. This is the class where classic algorithms such as <a href="http://en.wikipedia.org/wiki/Binary_search_algorithm">binary search</a> and <a href="http://en.wikipedia.org/wiki/Quicksort">QuickSort</a> are introduced. These algorithms have a certain beauty about them that I really enjoy.<br /><br />The book I'm using is <a href="http://www.amazon.com/Java-Software-Structures-Designing-Using/dp/0136078583/ref=cm_cr-mr-title">Java Software Structures</a>. This book is a solid CS2 textbook that covers searching and sorting in the order one would expect. I did not find the book to be outstanding, just a solid contender. I think the book would be outstanding if these issues were addressed:<br /><ul><li>The book uses generics, iterators, and other advanced features of Java without adequate coverage in the text. There is some coverage, but not enough. Many students coming out of a CS1 course won't be prepped enough to use them.</li><li>Code for searching and sorting is only given using generics. This forces students to solve 2 problems, what is the algorithm doing, and what's going on with the generics. I'd prefer the code first be introduced using an integer array, or even pseudo-code. If the code using generics was shown right after an integer array example, it would help emphasize what generics add.</li><li>I'd like to see some recursive algorithms, like binary search, be shown in non-recursive form. Otherwise students might think that the recursive algorithm is the only way to do it.</li><li>I'd like to see better images of the searching and sorting in progress.</li></ul><br />Past that, not a bad book.Paul Vincent Cravenhttp://www.blogger.com/profile/10360093423000027330noreply@blogger.com