<?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>Mike Renfro's Blog &#187; Mike Renfro</title>
	<atom:link href="http://blogs.cae.tntech.edu/mwr/author/mwr/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.cae.tntech.edu/mwr</link>
	<description>A partial repository of whatever comes to mind</description>
	<lastBuildDate>Sat, 31 Oct 2009 23:02:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Matlab to Make Animations from Excel Simulation Results</title>
		<link>http://blogs.cae.tntech.edu/mwr/2009/10/31/using-matlab-to-make-animations-from-excel-simulation-results/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2009/10/31/using-matlab-to-make-animations-from-excel-simulation-results/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 23:02:35 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/?p=135</guid>
		<description><![CDATA[One of the faculty has some axisymmetric diffusion simulation code written in Excel and VBA. He didn&#8217;t think his 2D graphs of chemical concentration along a particle&#8217;s radius would be suitable for an audience he&#8217;d be presenting to, and that they&#8217;d be better served seeing an animation of how the concentration varied over time and [...]]]></description>
			<content:encoded><![CDATA[<p>One of the faculty has some axisymmetric diffusion simulation code written in Excel and VBA. He didn&#8217;t think his 2D graphs of chemical concentration along a particle&#8217;s radius would be suitable for an audience he&#8217;d be presenting to, and that they&#8217;d be better served seeing an animation of how the concentration varied over time and position. Here&#8217;s where we started, more or less:</p>
<p><a href="http://blogs.cae.tntech.edu/mwr/files/2009/10/starting-point-excel.png"><img class="aligncenter size-full wp-image-137" src="http://blogs.cae.tntech.edu/mwr/files/2009/10/starting-point-excel.png" alt="starting-point-excel" width="483" height="291" /></a>and I had to be informed that the horizontal axis was radius from the particle center (normalized to 1 for the original particle radius), the vertical axis was something resembling a chemical concentration or composition, and that each line represented a different point in time. Excel&#8217;s default line thickness and other design choices bother me, so let&#8217;s go ahead and redo that graph in Matlab:<a href="http://blogs.cae.tntech.edu/mwr/files/2009/10/starting-point-matlab.png"><img class="aligncenter size-full wp-image-139" src="http://blogs.cae.tntech.edu/mwr/files/2009/10/starting-point-matlab.png" alt="starting-point-matlab" width="568" height="502" /></a>As it turns out, the concentration isn&#8217;t undefined closer to the particle center. Since this is a differential equation solution, we assume that the concentration is identically 1 everywhere from the center to the inside boundary radius. So, the total graphs of concentration versus distance should be:<a href="http://blogs.cae.tntech.edu/mwr/files/2009/10/bc-added.png"><img class="aligncenter size-full wp-image-142" src="http://blogs.cae.tntech.edu/mwr/files/2009/10/bc-added.png" alt="bc-added" width="568" height="502" /></a>which makes it a bit more explicit that we have a lump of pure material that gets gradually eaten away by its surroundings and becomes smaller.</p>
<p>Now to convert that line graph into an axisymmetric representation. Mathworks already outlined <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f10-2524.html#f10-2674">how to do a basic mesh plot in polar coordinates</a>, so all we have to do is adapt their instructions to our data. We don&#8217;t actually have to work out all the complex math, we just need to make a matrix for each point in time of equal size to the X and Y matrices created by meshgrid and pol2cart. Each column of this matrix should be the original Y data from Excel for that particular time, and the repmat function takes care of that. The resulting mesh plot of the last time step examined then looks like:<a href="http://blogs.cae.tntech.edu/mwr/files/2009/10/mesh-frame-4.png"><img class="aligncenter size-full wp-image-143" src="http://blogs.cae.tntech.edu/mwr/files/2009/10/mesh-frame-4.png" alt="mesh-frame-4" width="568" height="502" /></a>All that&#8217;s left now is to:</p>
<ul>
<li>Change the mesh plot to a surface</li>
<li>Remove the edge colors on each patch (so we have just the patch colors, not the edges)</li>
<li>Reorient our view to top-dead-center (like how we see the original material under the electron microscope)</li>
<li>Change the colormap to grayscale (like how we see the original material under the electron microscope)</li>
<li>Convert each plot into a frame of a video file with avifile and addframe.</li>
</ul>
<p>Here&#8217;s the code:</p>
<pre>clear all
close all
data=[ ...
    0.968682635	0.352941008	0.847944832	0.604846848	0.614770029	0.736745905	0.309963787	0.792192895
    0.975319116	0.352912882	0.864179809	0.60473259	0.644348798	0.736479267	0.355305164	0.791705755
    0.981955598	0.352843355	0.880414786	0.604508532	0.673927568	0.735967459	0.400646542	0.790820863
    0.988592079	0.352367206	0.896649763	0.604178754	0.703506337	0.735228449	0.445987919	0.789595717
    0.99522856	0.349314226	0.91288474	0.603743855	0.733085106	0.734277487	0.491329297	0.788068624
    1.001865042	0.339595849	0.929119717	0.603165414	0.762663875	0.733127586	0.536670674	0.786265735
    1.008501523	0.322069418	0.945354694	0.60215826	0.792242645	0.731789334	0.582012051	0.78420522
    1.015138005	0.300279218	0.961589671	0.599529003	0.821821414	0.730264749	0.627353429	0.781899808
    1.021774486	0.277475921	0.977824648	0.592185016	0.851400183	0.728502808	0.672694806	0.779357749
    1.028410967	0.254600132	0.994059625	0.575269388	0.880978952	0.726191443	0.718036184	0.776577069
    1.035047449	0.23173444	1.010294602	0.544925458	0.910557722	0.722114592	0.763377561	0.773500341
    1.04168393	0.208878058	1.026529579	0.501653986	0.940136491	0.712945073	0.808718939	0.76979412
    1.048320411	0.186029734	1.042764556	0.449999723	0.96971526	0.692373171	0.854060316	0.76410296
    1.054956893	0.163188804	1.058999533	0.394837376	0.999294029	0.652709252	0.899401693	0.752396638
    1.061593374	0.140354946	1.075234511	0.338837483	1.028872799	0.589603167	0.944743071	0.72609778
    1.068229856	0.117527765	1.091469488	0.282806787	1.058451568	0.505896949	0.990084448	0.672977986
    1.074866337	0.094706669	1.107704465	0.226853501	1.088030337	0.4097422	1.035425826	0.583653876
    1.081502818	0.071890988	1.123939442	0.170955144	1.117609106	0.308800318	1.080767203	0.459732008
    1.0881393	0.049079865	1.140174419	0.115095194	1.147187876	0.206932201	1.12610858	0.313724213
    1.094775781	0.026271856	1.156409396	0.059265944	1.176766645	0.10513866	1.171449958	0.159292943
    1.101412262	0.003483628	1.172644373	0.00345515	1.206345414	0.003440781	1.216791335	0.003438214
];
nFrames=size(data,2)/2; % due to 2 columns of data per frame
revgray=colormap(gray);
% 64x3 array of gray RGB values ([1 1 1] -&gt; white and high values,
% [0 0 0] -&gt; black and low values) -- gray is a built-in colormap
% revgray=revgray(size(revgray,1):-1:1,:);
% Reverse order of rows in revgray: results in a 64x3 array of gray RGB
% values ([0 0 0] -&gt; black and high values, [1 1 1] -&gt; white and low
% values)
fig=figure;
aviobj=avifile('diffusion.avi','FPS',15,'Quality',100);
for n=1:nFrames
    radius=data(:,n*2-1);
    concentration=data(:,n*2);
    % Add an extra data point at r=0 and r=min(r)
    radius=[0; min(radius); radius];
    concentration=[1; 1; concentration];
    % Build a polar grid (from Matlab help, "Displaying Contours in Polar
    % Coordinates")
    [th,r] = meshgrid((0:10:360)*pi/180,radius);
    [X,Y] = pol2cart(th,r);
    Z = X+i*Y; % For the purposes of polar math, abs(Z) is basically r.

    f=repmat(concentration,1,size(Z,2));
    % repmat(X,nr,nc) repeats X by nr rows and nc columns. size(Z,2)
    % returns the number of columns in Z. We end up with an array of
    % identical size to Z. f ends up being 1*concentration for all theta,
    % and concentration only varies with respect to r.

    surf(X,Y,abs(f),'EdgeColor','none');
    axis([-2 2 -2 2 0 1]);
    colormap(revgray);
    view(2);
    axis equal;
    title(sprintf('Frame %d',n));
    F=getframe(fig);
    aviobj=addframe(aviobj,F);
    pause(0.1);
end
aviobj=close(aviobj);</pre>
<p>and the resulting still images and video:<a href="http://blogs.cae.tntech.edu/mwr/files/2009/10/frame-1.png"><img class="aligncenter size-full wp-image-146" src="http://blogs.cae.tntech.edu/mwr/files/2009/10/frame-1.png" alt="frame-1" width="568" height="502" /></a><a href="http://blogs.cae.tntech.edu/mwr/files/2009/10/frame-2.png"><img class="aligncenter size-full wp-image-147" src="http://blogs.cae.tntech.edu/mwr/files/2009/10/frame-2.png" alt="frame-2" width="568" height="502" /></a><a href="http://blogs.cae.tntech.edu/mwr/files/2009/10/frame-3.png"><img class="aligncenter size-full wp-image-148" src="http://blogs.cae.tntech.edu/mwr/files/2009/10/frame-3.png" alt="frame-3" width="568" height="502" /></a><a href="http://blogs.cae.tntech.edu/mwr/files/2009/10/frame-4.png"><img class="aligncenter size-full wp-image-149" src="http://blogs.cae.tntech.edu/mwr/files/2009/10/frame-4.png" alt="frame-4" width="568" height="502" /></a><a href="http://blogs.cae.tntech.edu/mwr/files/2009/10/diffusion.avi"></a></p>
<p style="text-align: center"><a href="http://blogs.cae.tntech.edu/mwr/files/2009/10/diffusion.avi">Diffusion video</a> (very short, 4 frames at 1 fps, may or may not play directly in the browser, so just download it)</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2009/10/31/using-matlab-to-make-animations-from-excel-simulation-results/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://blogs.cae.tntech.edu/mwr/files/2009/10/diffusion.avi" length="78336" type="video/avi" />
		</item>
		<item>
		<title>Capturing an Image from a WIA-compatible Digital Camera</title>
		<link>http://blogs.cae.tntech.edu/mwr/2009/09/03/capturing-an-image-from-a-wia-compatible-digital-camera/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2009/09/03/capturing-an-image-from-a-wia-compatible-digital-camera/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 23:14:28 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/?p=126</guid>
		<description><![CDATA[We&#8217;ve had a research project requiring a fair amount of image acquisition and processing, requiring  higher resolutions than most industrial cameras can offer. As a result, we&#8217;ve tried at least three different digital cameras (Canon PowerShot S3is, Nikon D40, and Canon PowerShot SD780is). Each of them has their own advantages and disadvantages:

S3is advantages:  good control [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve had a research project requiring a fair amount of image acquisition and processing, requiring  higher resolutions than most industrial cameras can offer. As a result, we&#8217;ve tried at least three different digital cameras (Canon PowerShot S3is, Nikon D40, and Canon PowerShot SD780is). Each of them has their own advantages and disadvantages:</p>
<ul>
<li>S3is advantages:  good control with Breezesys&#8217; PSRemote, including a pretty complete DLL that we can call from our LabVIEW code. Disadvantages: larger aperture sizes reduce the depth of field, and PSRemote can&#8217;t toggle macro and super-macro modes.</li>
<li>D40 advantages: complete manual control when needed, huge range of apertures including ones that allow for good depth of field, easy to grab pictures in PTP mode from Windows Explorer. Disadvantages: Breezesys&#8217; NKRemote for Nikon doesn&#8217;t support the D40.</li>
<li>SD780is advantages: ridiculously high resolution (12MP) in a tiny camera. Disadvantages: no PSRemote support, and little manual control of settings.</li>
</ul>
<p>So it came down to needing LabVIEW to acquire images from whatever camera automatically. We had gotten it working with PSRemote some time back for a different class of pictures, but the ones we needed now went beyond PSRemote&#8217;s and the S3is&#8217; ability to focus in on close distances. And the SD780is was out entirely. So that left the Nikon.</p>
<p>Previous testing with the Nikon generally consisted of putting it in PTP mode, opening up Windows Explorer, hitting the &#8220;Take a new picture&#8221; link, and then copying over the newest image to the local drive. Great, except for the clicking and dragging. The obvious solution would be to automate the process via Win32 COM programming. After a few hours with the Python docs and MSDN, a workable Python script was born:</p>
<pre>import win32com.client, time, os

WIA_COM = "WIA.CommonDialog"

WIA_DEVICE_UNSPECIFIED = 0
WIA_DEVICE_CAMERA = 2

WIA_INTENT_UNSPECIFIED = 0

WIA_BIAS_MIN_SIZE = 65536
WIA_BIAS_MAX_QUALITY = 131072

WIA_IMG_FORMAT_PNG = "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}"

WIA_COMMAND_TAKE_PICTURE="{AF933CAC-ACAD-11D2-A093-00C04F72DC3C}"

def acquire_image_wia():
    wia = win32com.client.Dispatch(WIA_COM) # wia is a CommonDialog object
    dev = wia.ShowSelectDevice()
    for command in dev.Commands:
        if command.CommandID==WIA_COMMAND_TAKE_PICTURE:
            foo=dev.ExecuteCommand(WIA_COMMAND_TAKE_PICTURE)

    i=1
    for item in dev.Items:
        if i==dev.Items.Count:
            image=item.Transfer(WIA_IMG_FORMAT_PNG)
            break
        i=i+1

    fname = 'wia-test.jpg'
    if os.path.exists(fname):
        os.remove(fname)
    image.SaveFile(fname)

os.chdir('c:/temp')
acquire_image_wia()</pre>
<p>Things I like about this:</p>
<ul>
<li>snaps the camera shutter, grabs the last image from the card, and stashes it on the local drive, no questions asked. Since I&#8217;ll probably set the camera settings once and leave it on manual focus, this is all I needed.</li>
<li>easily converted into an executable with py2exe.</li>
<li>roughly 3.2 seconds to acquire and save the image, with around 2 seconds of that spent on the ExecuteCommand() line with a 0.25 second shutter speed.</li>
</ul>
<p>Things I don&#8217;t like about this:</p>
<ul>
<li>Windows COM programming makes my brain hurt.</li>
<li>To make things entirely hands-off, I had to disable my Webcam. I&#8217;m sure there&#8217;s a way to make WIA connect to a named device, but ShowSelectDevice() was all I found ready documentation for. With multiple cameras available, it always asked which one I wanted to acquire from. With only one camera available, it just went on and snapped the picture.</li>
<li>I couldn&#8217;t find a good way of jumping to the end of the list of items stored on the camera. I can count them, I can iterate over them, but I&#8217;m having to iterate over each element until I get to the last one, and <strong>then</strong> I can transfer it over.</li>
</ul>
<p>Someone may have a better solution to the last two problems, but this should get people started.</p>
<p><strong>Update</strong> &#8212; Leaner, meaner code to grab the last image off one specified camera &#8212; thanks to Janzert in the comments below:</p>
<pre>import win32com.client, time, os

MY_CAMERA="D40"
WIA_IMG_FORMAT_PNG = "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}"
WIA_COMMAND_TAKE_PICTURE="{AF933CAC-ACAD-11D2-A093-00C04F72DC3C}"

def acquire_image_wia():
    # Find the camera
    devman=win32com.client.Dispatch("WIA.DeviceManager")
    for info in devman.DeviceInfos:
        for prop in info.Properties:
            if prop.Name=="Name" and prop.Value==MY_CAMERA:
                dev = info.Connect()

    # Snap picture
    foo=dev.ExecuteCommand(WIA_COMMAND_TAKE_PICTURE)
    # Transfer last image (doesn't actually use PNG format, but this
    # still is valid syntax).
    image=dev.Items[dev.Items.count].Transfer(WIA_IMG_FORMAT_PNG)
    # Save into file
    fname = 'wia-test.jpg'
    if os.path.exists(fname):
        os.remove(fname)
    image.SaveFile(fname)

os.chdir('c:/temp')
acquire_image_wia()</pre>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2009/09/03/capturing-an-image-from-a-wia-compatible-digital-camera/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting up Project Quotas under XFS in Debian GNU/Linux</title>
		<link>http://blogs.cae.tntech.edu/mwr/2009/09/01/setting-up-project-quotas-under-xfs-in-debian-gnulinux/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2009/09/01/setting-up-project-quotas-under-xfs-in-debian-gnulinux/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 15:45:37 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux/Unix]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/?p=119</guid>
		<description><![CDATA[Quick and dirty notes for getting XFS project quotas running: I&#8217;m working on making storage areas for various capstone design class groups, vehicle teams, etc. I&#8217;d like to ensure that they don&#8217;t take an excessive amount of storage, too. These instructions are slightly different than what I&#8217;d found elsewhere, and I&#8217;m hoping to have someone [...]]]></description>
			<content:encoded><![CDATA[<p>Quick and dirty notes for getting XFS project quotas running: I&#8217;m working on making storage areas for various capstone design class groups, vehicle teams, etc. I&#8217;d like to ensure that they don&#8217;t take an excessive amount of storage, too. These instructions are slightly different than what I&#8217;d found elsewhere, and I&#8217;m hoping to have someone confirm that what I&#8217;m doing is correct and update the appropriate man pages accordingly.</p>
<p>So assuming we have a project for ME4444, group 3 (I already had projects defined for groups 1 and 2 from earlier tests):</p>
<pre># grep /home /etc/fstab
/dev/md1000/home        /home   xfs     defaults,usrquota,prjquota      0      1
# echo "me4444-03:/home/projects/me4444-03" &gt;&gt; /etc/projects
# echo "me4444-03:3" &gt;&gt; /etc/projid
# mkdir /home/projects/me4444-03
# xfs_quota -x -c "project -s me4444-03"
Setting up project me4444-03 (path /home/projects/me4444-03)...
Processed 1 /etc/projects paths for project me4444-03
# xfs_quota -x -c "limit -p bsoft=5g bhard=10g me4444-03"
# xfs_quota -x -c "report -p"
Project quota on /home (/dev/md1000/home)
                               Blocks
Project ID       Used       Soft       Hard    Warn/Grace
---------- --------------------------------------------------
me4444-01           0          0    1048576     00 [--------]
me4444-02           0    5242880   10485760     00 [--------]
me4444-03           0    5242880   10485760     00 [--------]</pre>
<p>Now group 3 has a 5 GB &#8220;soft&#8221; quota, can exceed that for up to 7 days at a time, but can never exceed their 10 GB &#8220;hard&#8221; quota. All that&#8217;s left is setting up directory permissions and Samba configuration so that the authorized users can store things there.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2009/09/01/setting-up-project-quotas-under-xfs-in-debian-gnulinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is This Why Wireless Is So Slow?</title>
		<link>http://blogs.cae.tntech.edu/mwr/2009/04/01/is-this-why-wireless-is-so-slow/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2009/04/01/is-this-why-wireless-is-so-slow/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 19:08:21 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/?p=101</guid>
		<description><![CDATA[
I swear, it took me 10 minutes to get access to TTU-WLAN-1 from the top floor of Brown Hall today. At least one other WAP not shown above was on channel 11 earlier &#8212; I think its name was &#8220;Free Internet Access&#8221;.  So there are 5 networks running on channel 1 (one scrolled off the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><img class="size-full wp-image-102 aligncenter" src="http://blogs.cae.tntech.edu/mwr/files/2009/04/wireless-scan.png" alt="wireless-scan" width="581" height="563" /></p>
<p style="text-align: left">I swear, it took me 10 minutes to get access to TTU-WLAN-1 from the top floor of Brown Hall today. At least one other WAP not shown above was on channel 11 earlier &#8212; I think its name was &#8220;Free Internet Access&#8221;.  So there are 5 networks running on channel 1 (one scrolled off the top of the window) which I assume aren&#8217;t running in some kind of infrastructure mode, 4 obviously separate named networks on channel 6, and 2-3 on channel 11.</p>
<p style="text-align: left">I&#8217;m just guessing from <a href="http://expertanswercenter.techtarget.com/eac/expertAnswer/0,295208,sid63_gci995841,00.html">this Google result</a> for <a href="http://www.google.com/search?q=multiple+access+points+one+channel">multiple access points one channel</a> that this isn&#8217;t the best way to organize things.</p>
<p style="text-align: left">By comparison, from my office in Clement, 3 access points visible in the site monitor. All TTU-WLAN-1, all separate channels.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2009/04/01/is-this-why-wireless-is-so-slow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just upgraded to WPMU 2.7, and check out this spam count</title>
		<link>http://blogs.cae.tntech.edu/mwr/2009/03/21/just-upgraded-to-wpmu-27-and-check-out-this-spam-count/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2009/03/21/just-upgraded-to-wpmu-27-and-check-out-this-spam-count/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 17:41:27 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/?p=97</guid>
		<description><![CDATA[
2219 spam comments, nearly all caught without my direct intervention. And the Spam Karma 2 footer claims to have eaten over 11000 spams since I set this blog up.
]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><a title="Blog Spam Count by Mike Renfro, on Flickr" href="http://www.flickr.com/photos/mwrenfro/3373389508/"><img class="aligncenter" src="http://farm4.static.flickr.com/3447/3373389508_626925a9c7_o.png" alt="Blog Spam Count" width="485" height="356" /></a></p>
<p>2219 spam comments, nearly all caught without my direct intervention. And the Spam Karma 2 footer claims to have eaten over 11000 spams since I set this blog up.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2009/03/21/just-upgraded-to-wpmu-27-and-check-out-this-spam-count/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>re:PocketMod &#8211; DIY Tiny Paper Organizer</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/10/26/repocketmod-diy-tiny-paper-organizer/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/10/26/repocketmod-diy-tiny-paper-organizer/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 18:28:03 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Organization]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/?p=95</guid>
		<description><![CDATA[I&#8217;m not giving up my Treo 700p as my regular organizer, but there are times when I recognize the advantages of paper. re:PocketMod is a site with a Flash application on it that lets you lay out and print 8 pages of information onto a single 8.5&#215;11 sheet of paper. Properly cut and folded, the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not giving up my Treo 700p as my regular organizer, but there are times when I recognize the advantages of paper. <a href="http://repocketmod.com/">re:PocketMod</a> is a site with a Flash application on it that lets you lay out and print 8 pages of information onto a single 8.5&#215;11 sheet of paper. Properly cut and folded, the final size ends up fitting in a bifold wallet (slightly larger than a credit card, but I can put it in my wallet&#8217;s cash area, or in another pocket behind my work ID). If you lay out the pages with to-do lists, calendars, or other time-sensitive information, you might end up printing one of these each day. If you lay out the pages with less time-sensitive information, you could keep the one organizer page around for quite a while.</p>
<p>Oy. Not 3 minutes after I post this the first time, it gets Pingback spam from some jackass&#8217;s site because the above paragraph contains the word &#8220;paper&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/10/26/repocketmod-diy-tiny-paper-organizer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free PGI Visual Fortran Compiler for University Students and Faculty</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/08/28/free-pgi-visual-fortran-compiler-for-university-students-and-faculty/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/08/28/free-pgi-visual-fortran-compiler-for-university-students-and-faculty/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 15:24:56 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Fortran]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/?p=94</guid>
		<description><![CDATA[Free as in gratis, not free as in libre. But this may be good for home use. Go here to register and wait for your confirmation email to arrive.
]]></description>
			<content:encoded><![CDATA[<p>Free as in <em>gratis</em>, not free as in <em>libre</em>. But this may be good for home use. <a href="https://www.pgroup.com/purchase/freepvf.php">Go here to register</a> and wait for your confirmation email to arrive.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/08/28/free-pgi-visual-fortran-compiler-for-university-students-and-faculty/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DIY Planner style TTU Campus Map</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/08/25/diy-planner-style-ttu-campus-map/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/08/25/diy-planner-style-ttu-campus-map/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 22:17:05 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Organization]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/?p=91</guid>
		<description><![CDATA[A user over at diyplanner.com posted a simple campus map and course information template for college students. I thought it might be useful to make one for TTU.
So here you go:

PDF version, ready to be printed onto two side-by-side pages. Not sure why the fonts didn&#8217;t completely translate over.
OpenOffice.org version, ready to be edited.

]]></description>
			<content:encoded><![CDATA[<p>A user over at <a href="http://diyplanner.com/">diyplanner.com</a> posted <a href="http://diyplanner.com/node/5937">a simple campus map and course information template</a> for college students. I thought it might be useful to make one for TTU.</p>
<p>So here you go:</p>
<ul>
<li><a href='http://blogs.cae.tntech.edu/mwr/files/2008/08/classes_ooo.pdf'>PDF version</a>, ready to be printed onto two side-by-side pages. Not sure why the fonts didn&#8217;t completely translate over.</li>
<li><a href='http://blogs.cae.tntech.edu/mwr/files/2008/08/classes_ooo.zip'>OpenOffice.org version</a>, ready to be edited.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/08/25/diy-planner-style-ttu-campus-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If The Title of This Post Contains the Word &#8220;Tennessee&#8221;, Will It Attract Human Spammers?</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/08/11/if-the-title-of-this-post-contains-the-word-tennessee-will-it-attract-human-spammers/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/08/11/if-the-title-of-this-post-contains-the-word-tennessee-will-it-attract-human-spammers/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 14:12:22 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/?p=90</guid>
		<description><![CDATA[As noted before, I do love Spam Karma 2. 4000+ spams eaten over the last 18 months or so, and it&#8217;s nearly perfect as far as I can tell.
But it didn&#8217;t catch a couple of&#8230; terse&#8230; commenters on this post about a presentation I was about to give. One commenter seemed rather irritated, and posted [...]]]></description>
			<content:encoded><![CDATA[<p>As noted before, <a href="http://blogs.cae.tntech.edu/mwr/2007/06/23/i-love-spam-karma-2/">I do love Spam Karma 2</a>. 4000+ spams eaten over the last 18 months or so, and it&#8217;s nearly perfect as far as I can tell.</p>
<p>But it didn&#8217;t catch a couple of&#8230; terse&#8230; commenters on <a href="http://blogs.cae.tntech.edu/mwr/2008/04/22/giving-a-presentation-at-the-tennessee-higher-education-it-symposium/">this post</a> about a presentation I was about to give. One commenter seemed rather irritated, and posted a malformed link to some addiction recovery place or another.  A second commenter appeared to be much friendlier, and posted a few words mildly relevant to the presentation, but also added a link to another treatment center. And it&#8217;s just happening on this <strong>one</strong> post, as far as I can tell.</p>
<p>And this isn&#8217;t the garden-variety spam I&#8217;m used to seeing in Spam Karma 2&#8217;s reports. Which means it&#8217;s not getting caught with their Javascript test, their &#8220;Flash Gordon was here&#8221; test (comment posted just a few seconds after page load), etc. The comments contain one link, nothing formatted with BBCode, no unformatted links, and there are complete sentences attached to them that are just barely related to the post content.</p>
<p>Of all the posts I&#8217;ve got here, and all the opportunity for spam it provides, why this post, and why these spammers? The only thing the post and the spams have in common is the word &#8220;Tennessee&#8221;. Spammer 1 tried to link to an addiction recovery site with the word Tennessee in its URL. Spammer 2 successfully linked to a treatment center with the word Tennessee in its URL.</p>
<p>So I wonder, did I include the word &#8220;Tennessee&#8221; in this post enough to attract these folks&#8217; attention? Will they post more spam here? Because if they do, what Spam Karma 2 doesn&#8217;t catch, I will. Word of advice, guys. I don&#8217;t get an enormous volume of comments here. In fact, I get few enough to where I&#8217;m normally able to look at them within minutes of their arrival. If they&#8217;re spam, they&#8217;ll get deleted. If you&#8217;re getting paid by the hour, I guess it doesn&#8217;t matter. If you&#8217;re getting paid by number of valid links left after some period of time, you&#8217;re better off spamming elsewhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/08/11/if-the-title-of-this-post-contains-the-word-tennessee-will-it-attract-human-spammers/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Where&#8217;s MarcoPolo for Windows?</title>
		<link>http://blogs.cae.tntech.edu/mwr/2008/07/25/wheres-marcopolo-for-windows/</link>
		<comments>http://blogs.cae.tntech.edu/mwr/2008/07/25/wheres-marcopolo-for-windows/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 04:26:40 +0000</pubDate>
		<dc:creator>Mike Renfro</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blogs.cae.tntech.edu/mwr/?p=85</guid>
		<description><![CDATA[MarcoPolo, &#8220;context-aware computing for OS X&#8221; appeals to all three great virtues of the programmer: Laziness, Impatience, and Hubris. It makes me want a Mac notebook. Unfortunately, Pro/E, ANSYS, and other necessary tools for my regular work would mean I&#8217;d end up dual-booting the Mac all the time. And I&#8217;d miss my port replicator and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.symonds.id.au/marcopolo/">MarcoPolo</a>, &#8220;context-aware computing for OS X&#8221; appeals to all three great virtues of the programmer: Laziness, Impatience, and Hubris. It makes me want a Mac notebook. Unfortunately, Pro/E, ANSYS, and other necessary tools for my regular work would mean I&#8217;d end up dual-booting the Mac all the time. And I&#8217;d miss my port replicator and its enabling me to have one connection to the monitor, keyboard, mouse, network, etc.</p>
<p>So, why not build a MarcoPolo for Windows? I&#8217;ve not yet found one, but I&#8217;d be more than happy to be proven wrong there. In the meantime, I&#8217;m working on a Python/Windows proof-of-concept that could be the groundwork for a Windows analogue to MarcoPolo.<br />
<span id="more-85"></span></p>
<pre name="code" class="py">

# Idea for Win32 version of MarcoPolo (Context-aware computing for Mac OS X)

# Contexts
contexts = {
    &#039;Home&#039;: 1,
    &#039;Work&#039;: 1,
    &#039;pre-Noon&#039;: 1,
    &#039;post-Noon&#039;: 1,
    &#039;Unknown&#039;: 1,
}

import wmi, pybonjour, time, IP4Range
# wmi: http://tgolden.sc.sabren.com/python/wmi.html
# pybonjour: http://o2s.csail.mit.edu/o2s-wiki/pybonjour
# IP4Range: http://code.activestate.com/recipes/466298/

def main():
    c=wmi.WMI()
    # Evidence sources via WMI (direct from MarcoPolo features, some
    # sources may not be available in Win32)

    # Current audio output device (headphones/speakers) -- may not be
    # discoverable on XP and earlier.

    # Discoverable Bluetooth devices -- can find a Bluetooth adapter via
    # USB, but not a connected end-user device

    # Advertised Bonjour (Zeroconf) services -- &#039;browse_and_resolve.py
    # _daap._tcp&#039; finds a remote iTunes share, but no idea how to look for
    # random services.

    # Attached FireWire devices -- no FireWire-capable computers on hand

    # Assigned IP addresses
    ipList=[]
    for adapter in c.Win32_NetworkAdapterConfiguration(IPEnabled=&quot;True&quot;):
        ipList.append(adapter.IPAddress[0])

    # Ambient light level — may not be any standard sensors available to
    # Windows

    # Attached monitors
    monitorList=[]
    for monitor in c.Win32_DesktopMonitor(Availability=3):
        monitorList.append(monitor.Name)

    # Active network links
    networkAdapterList=[]
    for adapter in c.Win32_NetworkAdapter(NetConnectionStatus=2):
        networkAdapterList.append(adapter.Description)

    # Power source (power adapter/battery) — need to test on laptop

    # Running Applications
    applicationList=[]
    for process in c.Win32_Process():
        applicationList.append(process.Name)

    # Time of day
    timeOfDay=time.strftime(&quot;%H:%M&quot;)

    # Attached USB devices
    usbDeviceList=[]
    for device in c.Win32_USBControllerDevice():
        usbDeviceList.append(device.Dependent.Description)

    # Visible WiFi networks — need to test on laptop

    # Rules (type, criteria, context, confidence)
    ruleList = [
        (&#039;usb&#039;, &#039;Brother HL-5140 series&#039;, &#039;Home&#039;, 0.80),
        (&#039;usb&#039;, &#039;Visioneer OneTouch 7300&#039;, &#039;Home&#039;, 0.99),
        (&#039;monitor&#039;, &#039;Plug and Play Monitor&#039;, &#039;Home&#039;, 0.60),
        (&#039;ip&#039;, &#039;192.168.254.4&#039;, &#039;Home&#039;, 0.50),
        (&#039;ip&#039;, &#039;149.149.254.0/24&#039;, &#039;Work&#039;, 0.99),
        (&#039;ssid&#039;, &#039;mike-and-carolyn&#039;, &#039;Home&#039;, 0.99),
        (&#039;time&#039;, [&#039;00:00&#039;, &#039;11:59&#039;], &#039;pre-Noon&#039;, 0.99),
        (&#039;time&#039;, [&#039;12:00&#039;, &#039;23:59&#039;], &#039;post-Noon&#039;, 0.99),
        ]

    # Decision
    for rule in ruleList:
        itemFound = -1
        (ruleType, ruleItem, ruleContext, ruleStrength) = rule
        if ruleType==&#039;ip&#039;:
            ipRange=IP4Range.IP4Range(ruleItem)
            for ip in ipList:
                currentIP=IP4Range.IP4Range(ip.encode(&#039;ascii&#039;))
                if currentIP.issubset(ipRange):
                    itemFound = 1

        elif ruleType==&#039;monitor&#039;:
            try:
                itemFound = monitorList.index(ruleItem)
            except ValueError:
                pass
        elif ruleType==&#039;adapter&#039;:
            try:
                itemFound = networkAdapterList.index(ruleItem)
            except ValueError:
                pass
        elif ruleType==&#039;application&#039;:
            try:
                itemFound = applicationList.index(ruleItem)
            except ValueError:
                pass
        elif ruleType==&#039;usb&#039;:
            try:
                itemFound = usbDeviceList.index(ruleItem)
            except ValueError:
                pass
        elif ruleType==&#039;time&#039;:
            if cmp(timeOfDay,ruleItem[0])&gt;=0 and cmp(timeOfDay,ruleItem[1])&lt;=0:
                itemFound=1
         else:
            print &quot;Unknown rule type %s&quot; % (ruleType)
            continue

        if itemFound!=-1:
            contexts[ruleContext]=contexts[ruleContext]*(1-ruleStrength)

    myLocation=&#039;Unknown&#039;
    myConfidence=1-contexts[&#039;Unknown&#039;]
    for context in contexts:
        if contexts[context]!=1:
            if (1-contexts[context])&gt;myConfidence:
                myLocation=context
                myConfidence = 1-contexts[context]

    print &quot;Your location: %s (confidence %f)&quot; % (myLocation, myConfidence)
    print

if __name__ == &quot;__main__&quot;:
    main()
</pre>
<p>I know my Python is mediocre at best. But this does work so far in my limited testing (&#8221;Unknown rule type ssid, Your location: Home (confidence 0.999600)&#8221;). Thanks to David Symonds for his assistance in <a href="http://groups.google.com/group/marcopolo-discuss/browse_thread/thread/c4c4e7f6521af282/396bbcff92029b7b">this thread</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.cae.tntech.edu/mwr/2008/07/25/wheres-marcopolo-for-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
