tag:blogger.com,1999:blog-13802639672961487162023-12-21T02:02:01.540-05:00¡Viva Suciô!Politics meets mimetics.Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.comBlogger140125tag:blogger.com,1999:blog-1380263967296148716.post-27600663244644665082011-03-04T13:21:00.007-05:002011-03-05T10:12:12.278-05:00Going RoguelikeWell, so much for <i>"we'll cover MP3s in a couple of days"</i>. I made the mistake of downloading the <a href="http://will.thimbleby.net/roguelike/RogueApplet.java">source</a> for a simple Java <b><i><span class="Apple-style-span" style="color: red;">Roguelik</span></i></b><i><b><span class="Apple-style-span" style="color: red;">e</span></b></i> written by Will Thmbleby and then got completely engrossed in tinkering with it.<br />
<br />
So, what's a Roguelike? Rogue was an ASCII dungeon-crawler written for Unix systems in 1980. Since then it's inspired literally thousands of similar games - genericly called Roguelikes. Every year there's a competition to see who can devise the most interesting new variant in 7 days - <a href="http://roguebasin.roguelikedevelopment.org/index.php?title=Seven_Day_Roguelike_Challenge">The Seven Day Roguelike Challenge</a>.<br />
<br />
One Roguelike in particular has been under continuous development since 1987. If you don't mind wrecking your grades/life/marriage/career, download <a href="http://www.thegreatestgameyouwilleverplay.com/">The Greatest Game You Will Ever Play</a> from <a href="http://nethack.org/">the project's website <span class="Apple-style-span" style="background-color: purple; color: white;"><b>[nethack.org]</b></span></a>.<br />
<br />
Here's a dime-bag to give you a taste. Use the arrow keys (or "jkhlyubn") to move your intrepid explorer - <b>"<span class="Apple-style-span" style="background-color: black; color: blue;">@</span>"</b> - around a dungeon. Type ">" to go down any staircase (<b>"<span class="Apple-style-span" style="background-color: black;"><span class="Apple-style-span" style="color: white;">></span></span>"</b>) you encounter.<br />
<br />
<center> <applet archive="http://mgt.yourhda.com/Java/GoingRLApplet.jar" code="GoingRLApplet.class" codebase="http://mgt.yourhda.com/Java/" height="600" width="550"><br />
</applet></center><br />
<div style="text-align: center;"><i>Just reload the page to play again when you're killed.</i></div><br />
<div style="text-align: center;"><b><span class="Apple-style-span" style="color: purple;">(If you want to go deeper, play the version on the </span><a href="http://vote-sanchez.blogspot.com/p/roguelike.html"><span class="Apple-style-span" style="background-color: purple; color: white;">"Roguelike"</span><span style="color: purple;"></span></a><span class="Apple-style-span" style="color: purple;"> page above.)</span></b></div>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com54tag:blogger.com,1999:blog-1380263967296148716.post-63884812847627972852011-02-26T13:33:00.003-05:002011-02-28T19:05:47.447-05:00King of Pop<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGzXSLpEl3XijvOF_tYxPF9f31GJpyi37WptTxJu0CVVFiYl8hJTGJijHzxlT9iIkTQTJZBlnJz7LN7K9_CBTOcLwW3SDfAcQSjPhSl8L-cSMoksz1dw99sA9TPPxqHWVFT8ZSAv7jZoFx/s1600/King_of_Pop.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGzXSLpEl3XijvOF_tYxPF9f31GJpyi37WptTxJu0CVVFiYl8hJTGJijHzxlT9iIkTQTJZBlnJz7LN7K9_CBTOcLwW3SDfAcQSjPhSl8L-cSMoksz1dw99sA9TPPxqHWVFT8ZSAv7jZoFx/s320/King_of_Pop.jpg" width="213" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsoBpqWgOZotCJffsRUwzz5MXfWTf0cdxsOxrNl4Zkv73H4P6RLM0fmbFKBD8xA50keY6mxRoeJtMBp9QOA_W_OaKGkLqMjnDjOLIj031M2-BIZWaSfHQ-ZRcPzcaX5Y5cRnRi9oY0_fg4/s1600/Gaddafi_Thriller.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsoBpqWgOZotCJffsRUwzz5MXfWTf0cdxsOxrNl4Zkv73H4P6RLM0fmbFKBD8xA50keY6mxRoeJtMBp9QOA_W_OaKGkLqMjnDjOLIj031M2-BIZWaSfHQ-ZRcPzcaX5Y5cRnRi9oY0_fg4/s320/Gaddafi_Thriller.jpg" width="213" /></a></div><br />
<div style="text-align: center;"><i>What do you get if you cross Keith Richards with Michael Jackson?</i></div><br />
<br />
<b><span class="Apple-style-span" style="color: red; font-size: large;">@ Iulian Anghel - If you do manage to hack into my server, while you're there, would you mind fixing the login scripts? (-:</span></b>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com33tag:blogger.com,1999:blog-1380263967296148716.post-84380095379737875832011-02-25T16:28:00.000-05:002011-02-25T16:28:58.773-05:00Java : Comment Applet Vous? (Part 2)Today's post will be the dullest and nerdiest ever. Unless you need to post a "jarred" ("jarchived"?) applet right now, just skip to the pictures at the end. We're only posting this for our own benefit, as creating a jarred applet is the kind of tedious, fiddly, counter-intuitive task that's painful to learn but very easy to forget.<br />
<br />
Still with us? Okay, let's reprise what we covered last time:<br />
<ul><li>We converted our "PeekaBoo" stand-alone application ("App"), into "PeekaBooApplet".</li>
<li>So, "PeekaBoo", an extension of JFrame, became "PeekaBooApplet" an extension of Japplet.</li>
<li>Our constructor method was renamed "init()" and was given type void.</li>
<li>Our "paintComponent" method was renamed "paint".</li>
<li>We were able to delete the "main" method entirely.</li>
<li>We then added HTML code to our post to invoke the applet.</li>
<li>The HTML included a codebase clause to tell our browsers where to look for the applet and data.</li>
</ul>Today, we're going to bundle our applet program (".class") together with its data (two ".jpg"s) into a Java archive (".jar") file. the steps required are:<br />
<ul><li>Minimal code changes.</li>
<li>Create a "mainClass.txt" file to identify the main entry point of the applet.</li>
<li>Create a DOS batch file "makeJar.bat" to automate the archiving process.</li>
<li>Modify our HTML to tell our browsers where the archive is stored.</li>
</ul>First code change, we like to stick a "Jar" at the end of our class name to avoid confusing ouselves. (We must remember to save the file as "PeekaBooApplet<b>Jar</b>.java".)<br />
<pre class="prettyprint" style="font-size: x-small;">public class PeekaBooAppletJar extends JApplet implements MouseListener
</pre>In our "init()" method, we have to change the pathnames given for the image files from a <i>relative</i> pathname in a file-system to an <i>absolute</i> pathname within the ".jar".<br />
(In practice, this usually just means sticking a "/" at the front.)<br />
<pre class="prettyprint" style="font-size: small;">images [PEEKA] = loadImage("/Images/peeka.jpg");
images [BOO] = loadImage("/Images/boo.jpg");
</pre>That's it for code changes - told you they were minimal.<br />
<br />
We now create a text file "mainClass.txt" which passes information about the main entry point of our applet into the archive making program ("jar"). This is known as a <span class="Apple-style-span" style="color: red;"><b>manifest file</b></span>.<br />
<pre style="font-size: small;">Main-Class: PeekaBooAppletJar
</pre>One point to note there has to be a newline at the end of the "Min-Class:" line. We've no idea why - just stick a blank line at the end of the file.<br />
<br />
We next need a batch file - "makeJar.bat" - to automate the process of making the ".jar".<br />
<pre style="font-size: small;">@echo off
echo Making PeekaBooAppletJar jar...
jar cvmf mainClass.txt PeekaBooAppletJar.jar PeekaBooAppletJar.class Images
echo.
echo Indexing jar...
jar i PeekaBooAppletJar.jar
echo done
</pre><br />
A ".jar" file is just like a ".zip" file (you can even open a ".jar" with "WinZip").<br />
In our batch file, we're calling the "jar" utility twice. The first call is with flags<br />
<ul><li><b>c</b> - <b>c</b>reate a new ".jar".</li>
<li><b>v</b> - <b>v</b>erbose output.</li>
<li><b>f</b> - write the output to the specified ".jar" <b>f</b>ilename. (PeekaBooAppletJar.jar".)</li>
<li><b>m</b> - include <b>m</b>anifest information from the specified manifest file. ("mainClass.txt".)</li>
</ul>The second call is with flag<br />
<ul><li><b>i</b> - create an <b>i</b>ndex in the ".jar" of all the jars in the manifest.</li>
</ul>This second step probably isn't necessary for our simple example but we never, <i>ever</i> intend to read the manual for "jar", so we'll never find out.<br />
<br />
One last step is to add an archive clause to our HTML.<br />
<pre><applet
code="PeekaBooApplet.class"
archive="http://mgt.yourhda.com/Java/PeekaBooAppletJar.jar"
codebase="http://mgt.yourhda.com/Java/"
width="237"
height="315">
</applet>
</pre>Putting it all together:<br />
<br />
<ul><li>Copy yesterdays "PeekaBooApplet.java".</li>
<li>Make the above simple changes and save as "PeekaBooAppletjar.java".</li>
<li>Compile using javac.</li>
<li>Run makeJar.bat.</li>
<li>Copy the resulting "PeekaBooAppletJar.jar" to your server.</li>
<li>Modify the above HTML to point to your server and save to a blog post or ".html" file.</li>
</ul><br />
<center> <applet archive="http://mgt.yourhda.com/Java/PeekaBooAppletJar.jar" code="PeekaBooApplet.class" codebase="http://mgt.yourhda.com/Java/" height="315" width="237"><br />
</applet><br />
</center><br />
<div style="text-align: center;"><i>Click on Catwoman and move the mouse away to test.</i></div><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI6_qmGWuDml57fiYHOmn3OqJttVfWBun8j-O0TP56VVVVI8-7uVCgyQegEFyx1rLRpcDO9AbaA1j57k13oKp-_b3Z2TaJC_ZtfDYEJfZ2lL7LQ2wHc0Pd4as2zUOhKlcYL2x-pmzf7mKP//" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI6_qmGWuDml57fiYHOmn3OqJttVfWBun8j-O0TP56VVVVI8-7uVCgyQegEFyx1rLRpcDO9AbaA1j57k13oKp-_b3Z2TaJC_ZtfDYEJfZ2lL7LQ2wHc0Pd4as2zUOhKlcYL2x-pmzf7mKP//" width="320" /></a></div><div style="text-align: center;"><i>That's quite enough on applets.</i></div><br />
We'll give it a rest for a while. When we come back: playing MP3s in Java.Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com12tag:blogger.com,1999:blog-1380263967296148716.post-40673587931704178492011-02-23T15:05:00.002-05:002011-02-23T16:55:33.154-05:00Java : Comment Applet Vous? (Part 1)As promised, we're going to show how to convert our "PeekBoo" application into an applet and embed it in a Blogger page. We'll split the process into two posts: part 1 is about writing an applet where you have some control of the directory structure of the hosting server. Part 2 will be about bundling the applet and its data files into a ".JAR" (Java Archive) file.<br />
<br />
Our first code change is to define our class as an extension of <i><b>JApplet</b></i> rather than <i><b>JPanel</b></i>.<br />
<pre class="prettyprint" style="font-size: x-small;">public class PeekaBooApplet extends JApplet implements MouseListener
</pre>Next, we replace our declaration of the constructor method "PeekaBoo()" with an "init()" method. (The code of the method is unchanged.)<br />
<pre class="prettyprint" style="font-size: small;">public void init()
</pre>Our paint method changes name from "paintComponent(g)" to "paint(g)" (the code is again unchanged).<br />
<pre class="prettyprint" style="font-size: small;">public void paint(Graphics g)
</pre>Now all that's left is to delete the entire "main()" method, and our code is complete:<br />
<pre class="prettyprint" style="font-size: xx-small;">public class PeekaBooApplet extends JApplet implements MouseListener
{
private static final int PWIDTH = 237;
private static final int PHEIGHT= 315;
private static final int PEEKA = 0; // images[0] is Peeka
private static final int BOO = 1; // image [1] is Boo
private BufferedImage [] images = new BufferedImage [2];
private int imageIndex;
public void init()
{
setPreferredSize(new Dimension(PWIDTH,PHEIGHT));
images [PEEKA] = loadImage("Images/peeka.jpg");
images [BOO] = loadImage("Images/boo.jpg");
imageIndex = PEEKA;
addMouseListener(this);
}
public BufferedImage loadImage(String fileName)
{
try {
BufferedImage im = ImageIO.read(getClass().getResource(fileName));
return im;
} catch(IOException e) {
System.out.println("Load Image error for "+fileName+":\n"+e);
return null;
}
}
public void paint(Graphics g){g.drawImage(images [imageIndex],0,0,this);}
// stubs for you to play around
public void mousePressed(MouseEvent e) {}
public void mouseReleased(MouseEvent e) {}
public void mouseEntered(MouseEvent e) {}
// On mouse-click, display Boo image
public void mouseClicked(MouseEvent e) {imageIndex=BOO; repaint();}
// When mouse leaves window, display Peeka image
public void mouseExited(MouseEvent e) {imageIndex=PEEKA; repaint();}
}
</pre>Great, so how do we call it? Save the above code to file <b>"PeekaBooApplet.java"</b> and compile using "javac". Then, save the following piece of HTML code to file <b>"PeekaBooApplet.html"</b> <span class="Apple-style-span" style="color: red;"><b>in the same directory</b></span>. (Check that the directory has a sub-directory called "Images" containing "peeka.jpg" and "boo.jpg" from yesterday.)<br />
<pre><applet
code="PeekaBooApplet.class"
width="237"
height="315">
</applet>
</pre>Click on the file "PeekaBooApplet.html" to open it in your browser and you should see CatWoman.<br />
Click on her and move the mouse to see the action of the program.<br />
<br />
What's happening here is that the browser is looking for the file "PeekaBooApplet.class" in the same directory as your ".html" file. If found, the program is run using the Java Runtime Environment - pretty much like typing "java" from the command line.<br />
<br />
The running program then attempts to load the image files from an "Images" sub-directory of the current directory.<br />
<br />
Okay, so now how do we embed our applet in our blogger page? Just putting the above HTML code into your post won't work, because the browser will look for the file "PeekaBooApplet.class" in whatever directory Blogger holds your blog page in.<br />
<br />
So, we need to copy our ".class" file to a directory on a server that our readers can see. We're using "http://mgt.yourhda.com/Java" so we amend our HTML to read:<br />
<pre><applet
code="PeekaBooApplet.class"
codebase="http://mgt.yourhda.com/Java/"
width="237"
height="315">
</applet>
</pre>to point the browser to the right working directory.<br />
Now all we need to do is to make sure that our images "peeka.jpg" and "boo.jpg" are copied to the right server sub-directory: "http://mgt.yourhda.com/Java/Images".<br />
<br />
Let's try it: <b><span class="Apple-style-span" style="color: red;">click on CatWoman then move your mouse away.</span></b><br />
<br />
<br />
<br />
<center><br />
<applet code="PeekaBooApplet.class" codebase="http://mgt.yourhda.com/Java/" height="315" width="237"><br />
</applet><br />
</center><br />
<br />
That was easy. But we were messing with our own server, and for this small example it was easy to copy all the required image files to the right place relative to our ".class" file. Next time we'll look at how to bundle everything up into a single ".jar" file.<br />
<br />
<span class="Apple-style-span" style="color: red;">If you add an applet to your blog, please link in the comments or send us an email:</span><br />
<br />
<div style="text-align: center;"><b><span class="Apple-style-span" style="font-size: large;">java@vote-sanchez.com</span></b></div>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com25tag:blogger.com,1999:blog-1380263967296148716.post-19279511906668274302011-02-22T10:43:00.003-05:002011-02-22T10:48:33.180-05:00Java : Peeka, Boo!Our last program responded to mouse movements by <i>polling</i>: every time the Timer event "went off", we checked the current mouse position using <span class="Apple-style-span" style="color: #222222; font-family: monospace; font-size: small; line-height: 18px; white-space: pre-wrap;"><span class="typ" style="color: #660066;">MouseInfo</span></span><span class="Apple-style-span" style="color: #222222; font-family: monospace; font-size: small; line-height: 18px; white-space: pre-wrap;"><span class="pun" style="color: #666600;">.</span></span><span class="Apple-style-span" style="color: #222222; font-family: monospace; font-size: small; line-height: 18px; white-space: pre-wrap;"><span class="pln" style="color: black;">getPointerInfo</span></span><span class="Apple-style-span" style="color: #222222; font-family: monospace; font-size: small; line-height: 18px; white-space: pre-wrap;"><span class="pun" style="color: #666600;">().</span></span><span class="Apple-style-span" style="color: #222222; font-family: monospace; font-size: small; line-height: 18px; white-space: pre-wrap;"><span class="pln" style="color: black;">getLocation</span></span><span class="Apple-style-span" style="color: #222222; font-family: monospace; font-size: small; line-height: 18px; white-space: pre-wrap;"><span class="pun" style="color: #666600;">()</span></span>. Today we're going to modify our program to respond directly to mouse events. <br />
<br />
It's best if you make a new working directory, let's say <b>"PeekaBoo"</b>, with its own "Images" sub-directory.<br />
Now we need two new images: save them as <b>"peeka.jpg"</b> and <b>"boo.jpg"</b> in the new <b>"Images"</b> directory.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLlx5aMCotWeMgPps8SseMYOCF5UDRINC9qC2zqhVMQOQUZiDLqcLRx7mSLO2fhmBxQYs6hXuRsYFYElX_H-cBs42ohaC8aOwLCa9XR-eQ-UQUC28nfHCuKduqqUUj0pVeZy0Qul6Ttrm-/s1600/peeka.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLlx5aMCotWeMgPps8SseMYOCF5UDRINC9qC2zqhVMQOQUZiDLqcLRx7mSLO2fhmBxQYs6hXuRsYFYElX_H-cBs42ohaC8aOwLCa9XR-eQ-UQUC28nfHCuKduqqUUj0pVeZy0Qul6Ttrm-/s200/peeka.jpg" width="150" /></a></div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLc_fmjG-ekOqpyzXLrj23BwoaETnBqko9fNB3ir0hPXIarnW6S3Ldw00ZMSYwwlF8YupojrrP_HPCEah3nw_sqdqbV5MxUJQyKpDSRuNKPjGZ7eYAOwSyrm2t2GX0spIfDWJZ8BWu_vHz/s1600/boo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLc_fmjG-ekOqpyzXLrj23BwoaETnBqko9fNB3ir0hPXIarnW6S3Ldw00ZMSYwwlF8YupojrrP_HPCEah3nw_sqdqbV5MxUJQyKpDSRuNKPjGZ7eYAOwSyrm2t2GX0spIfDWJZ8BWu_vHz/s200/boo.jpg" width="150" /></a><br />
<br />
Instead of implementing "ActionListener" (listening for timer events), our class now implements "MouseListener" (listening for mouse events).<br />
<pre class="prettyprint" style="font-size: small;">public class PeekaBoo extends JPanel implements MouseListener
</pre>We can drop the definition of the PERIOD constant, as we're not using a timer, and change LEFT & RIGHT to PEEKA & BOO.<br />
<pre class="prettyprint">private static final int PWIDTH = 237;
private static final int PHEIGHT= 315;
private static final int PEEKA = 0; // images[0] is Peeka
private static final int BOO = 1; // image [1] is Boo
</pre>Our constructor (initialization) method becomes:<br />
<pre class="prettyprint">public PeekaBoo()
{
setPreferredSize(new Dimension(PWIDTH,PHEIGHT));
images [PEEKA] = loadImage("Images/peeka.jpg");
images [BOO] = loadImage("Images/boo.jpg");
imageIndex = PEEKA;
addMouseListener(this);
}
</pre>Instead of starting a Timer, we add a mouse listener.<br />
Now all that's required is to tell Java how to respond to mouse events.<br />
<pre class="prettyprint" style="font-size: x-small;">// On mouse-click, display Boo image
public void mouseClicked(MouseEvent e) {imageIndex=BOO; repaint();}
// When mouse leaves window, display Peeka image
public void mouseExited(MouseEvent e) {imageIndex=PEEKA; repaint();}
</pre>So, when a mouse-click is detected somewhere in the program window, display the "Boo" image. When the mouse leaves the program window, revert to the "Peeka" image.<br />
<br />
And that's it. Here's the full program:<br />
<pre class="prettyprint" style="font-size: xx-small;">// PeekaBoo.java
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.swing.*;
import javax.imageio.*;
import java.io.*;
public class PeekaBoo extends JPanel implements MouseListener
{
private static final int PWIDTH = 237;
private static final int PHEIGHT= 315;
private static final int PEEKA = 0; // images[0] is Peeka
private static final int BOO = 1; // image [1] is Boo
private BufferedImage [] images = new BufferedImage [2];
private int imageIndex;
public PeekaBoo()
{
setPreferredSize(new Dimension(PWIDTH,PHEIGHT));
images [PEEKA] = loadImage("Images/peeka.jpg");
images [BOO] = loadImage("Images/boo.jpg");
imageIndex = PEEKA;
addMouseListener(this);
}
public BufferedImage loadImage(String fileName)
{
try {
BufferedImage im = ImageIO.read(getClass().getResource(fileName));
return im;
} catch(IOException e) {
System.out.println("Load Image error for "+fileName+":\n"+e);
return null;
}
}
public void paintComponent(Graphics g){g.drawImage(images [imageIndex],0,0,this);}
// stubs for you to play around
public void mousePressed(MouseEvent e) {}
public void mouseReleased(MouseEvent e) {}
public void mouseEntered(MouseEvent e) {}
// On mouse-click, display Boo image
public void mouseClicked(MouseEvent e) {imageIndex=BOO; repaint();}
// When mouse leaves window, display Peeka image
public void mouseExited(MouseEvent e) {imageIndex=PEEKA; repaint();}
public static void main(String args[])
{
final PeekaBoo showPanel = new PeekaBoo();
JFrame showFrame = new JFrame("Peeka-Boo");
showFrame.getContentPane().add(showPanel,BorderLayout.CENTER);
showFrame.setDefaultCloseOperation (WindowConstants.EXIT_ON_CLOSE);
showFrame.pack();
showFrame.setResizable(false);
showFrame.setVisible(true);
}
}
</pre>And that's all there is too it. Save as <b>"PeekaBoo.java"</b> and compile and run in the usual way. Let's try it out. <span class="Apple-style-span" style="color: red;"><b>Click on the image below, then move the mouse away.</b></span><br />
<br />
<br />
<center><br />
<applet archive="http://mgt.yourhda.com/Java/PeekaBooApplet.jar" code="PeekaBooApplet.class" codebase="http://mgt.yourhda.com/Java/" height="325" width="400"><br />
</applet><br />
</center><br />
<div style="text-align: center;"><i>Something's different...</i></div><br />
Apart from the obvious change of image, the program running above is an <b><i>applet </i></b>embedded in a web page, rather than a stand-alone <i><b>app </b></i>like our program listing.<br />
<br />
Next time we'll go through the steps required to convert our app into an applet and post it on blogger.Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com27tag:blogger.com,1999:blog-1380263967296148716.post-47885959265313406502011-02-20T13:39:00.012-05:002011-02-22T09:48:24.065-05:00Java : Chasing Rodents - "Allegedly"As promised, today we're going to modify our "glorified .GIF" program to make it interactive. We're going to change the image depending on the position of the mouse.<br />
<br />
Even to us, it doesn't make sense to have Hitler and Bambi emit hearts based on the mouse position, so we're going to change the images. Who better to illustrate mouse following than famed celebrity rodent fan and Scott Brown lookalike, Richard Gere?<br />
<br />
We must admit, we almost changed our minds about using Mr Gere after doing a google image search. He's old, really old: his rodent catching days are long behind him. The only furry action he could get nowadays would be with a sloth.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOFvaKHND9li0BwkIixM7eeNQR-GMXj0n7r1PLE11mjj1MUZvb4NdsAPhXOmdrc8_hzSjTH4z_QiMF4w16d40TouUSbAsdBK66jGuCrRqIVjiKNUBb16eWnCtHTvdUMpgzOyqVZXgWb9Mm/s1600/Richard_Gere_sloth.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOFvaKHND9li0BwkIixM7eeNQR-GMXj0n7r1PLE11mjj1MUZvb4NdsAPhXOmdrc8_hzSjTH4z_QiMF4w16d40TouUSbAsdBK66jGuCrRqIVjiKNUBb16eWnCtHTvdUMpgzOyqVZXgWb9Mm/s320/Richard_Gere_sloth.jpg" width="235" /></a></div><div style="text-align: center;"><i>Richard Gere with his sloth companion, Mr Frisky.</i></div><br />
Also, let's face it, the whole felching thing <span class="Apple-style-span" style="font-size: xx-small;">(don't look it up)</span> has been done to death. There is absolutely no truth to the rumors, and after two (three?) decades it's time the internet gave him a break.<br />
<br />
<i>On the other hand</i>, Gere's iconic movies, "Officer & a Gentleman" and "Pretty Woman" defined the chick-flick genre. Thanks to Gere, we've had to sit through numerous sad re-hashes of these crappy wish-fulfillment fantasies over the years: all the time feeling as though a furry animal was burrowing in our bowels.<br />
<br />
So we owe him: sorry, <i>Dick</i>. We'll use this thumbnail of a Robert Mapplethorpe portrait of Gere and its mirror image. <span class="Apple-style-span" style="font-size: xx-small;">(Don't look up Mapplethorpe either.)</span><br />
<span class="Apple-style-span" style="font-size: xx-small;"><br />
</span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQQE8e5D0yQ4HOA3gfbhJhFwojRjATIrhUixAveRpaO56HTztiZXobW5HOoI1hzOwqMuk2zW7iYkme7TP75GyMtMFZOm1e8LmD_2WisJ1RQftegmKlnSoVRLWva4-aafv9y-EDMNlqOeD-/s1600/richard_gere_0.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQQE8e5D0yQ4HOA3gfbhJhFwojRjATIrhUixAveRpaO56HTztiZXobW5HOoI1hzOwqMuk2zW7iYkme7TP75GyMtMFZOm1e8LmD_2WisJ1RQftegmKlnSoVRLWva4-aafv9y-EDMNlqOeD-/s200/richard_gere_0.jpg" width="199" /></a></div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR5b0jxLKBspbMJV6r-Dn1k4VdgdQCzAmxIKggrOu0-ji9FFrV7xr9b0VSrRemtNVVLMkA0cMeCPEkn269CZSqaGRkcDUUGK0kA_kj9QetIQUYr-sQN0MmNz_OYmh-VbqNQbq-DV6Fj2VX/s1600/richard_gere_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR5b0jxLKBspbMJV6r-Dn1k4VdgdQCzAmxIKggrOu0-ji9FFrV7xr9b0VSrRemtNVVLMkA0cMeCPEkn269CZSqaGRkcDUUGK0kA_kj9QetIQUYr-sQN0MmNz_OYmh-VbqNQbq-DV6Fj2VX/s200/richard_gere_1.jpg" width="199" /></a><br />
<br />
<i>Save to your "Images" directory as <b>"richard_gere_0.jpg"</b> and <b>"richard_gere_1.jpg"</b></i><br />
<br />
Now to modify our program. First, let's add some new constant definitions "LEFT" & "RIGHT". the idea is that the left-facing image will be stored in the "0th" element of our images array, and the right-facing will be the "1th" element. (As in many languages, the 1st element of an array is numbered 0. Safer to say "0th" & "1th" than "1st" and "2nd".)<br />
<pre class="prettyprint">private static final int LEFT = 0; // images[0] faces L
private static final int RIGHT = 1; // images[1] faces R
</pre>Don't forget to load images of Gere rather than Hitler.<br />
<pre class="prettyprint">images [0] = loadImage("Images/richard_gere_0.jpg");
images [1] = loadImage("Images/richard_gere_1.jpg");
</pre>Now we change our Timer response method "actionPerformed()" to test which side of the window the mouse is at before painting the corresponding image.<br />
<pre class="prettyprint">public void actionPerformed(ActionEvent e)
{
imageIndex = getMouseDirection(); // is mouse to L or R?
repaint();
}
</pre>Here's the code of the "getMouseDirection()" function. Note that "MouseInfo.getPointerInfo().getLocation()" returns the position of the mouse in <i><b>screen </b></i>co-ordinates. I.e the point (0,0) is at the top-left corner of the <i>screen</i>. We need to call "SwingUtilities.convertPointFromScreen" to convert to <i><b>component</b></i> co-ordinates. I.e. the point (0,0) is at the top-left corner of the <i>panel</i>. If the mouse's x-co-ordinate in component co-ordinates is less than half the window width, return "LEFT", otherwise return "RIGHT".<br />
<pre class="prettyprint">public int getMouseDirection(){
// mouse location in *screen* co-ordinates
Point mouseCoordinates = MouseInfo.getPointerInfo().getLocation();
// convert to *component* co-ordinates
SwingUtilities.convertPointFromScreen(mouseCoordinates,this);
if (mouseCoordinates.x>=PWIDTH/2)
return RIGHT;
else
return LEFT;
}
</pre>Please note, in Java, like most other programming environments, <b><span class="Apple-style-span" style="color: red;">the y-axis is inverted</span></b>. I.e. the top row of screen pixels is row 0 and the bottom row will be row 767 or 1023 (or whatever the size of your screen is -1).<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz2QimrfakrTaCoqTJvewd4Nz6YfFdw2Sh6PgKN9-eeZBqTVeocv0Phgt92JpdQI34Q5tBoD8NmhQ2WHY8cYfrUDqDl9jWqP0dE8sqYNQiTSj1VrvyKGgrbU6WYJuYQToVuGztimON8AGd/s1600/co-ordinates.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz2QimrfakrTaCoqTJvewd4Nz6YfFdw2Sh6PgKN9-eeZBqTVeocv0Phgt92JpdQI34Q5tBoD8NmhQ2WHY8cYfrUDqDl9jWqP0dE8sqYNQiTSj1VrvyKGgrbU6WYJuYQToVuGztimON8AGd/s200/co-ordinates.gif" width="192" /></a></div><br />
You <i>will </i>forget this several times during the development of <i>every </i>program you <i>ever </i>write that uses screen co-ordinates. You can't help forgetting it, just remember to look for it when your program comes out upside down. Thankfully, in this program we're only concerned with the x-axis.<br />
<br />
And that's it. The rest of the program is unchanged.<br />
<pre class="prettyprint" style="font-size: xx-small;">// ShowGere.java
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.swing.*;
import javax.imageio.*;
import java.io.*;
public class ShowGere extends JPanel implements ActionListener
{
private static final int PERIOD = 1000; // Swing timer interval (ms)
private static final int PWIDTH = 243;
private static final int PHEIGHT= 244;
private static final int LEFT = 0; // image 0 points left
private static final int RIGHT = 1; // image 1 points right
private BufferedImage [] images = new BufferedImage [2];
private int imageIndex;
public ShowGere()
{
setPreferredSize(new Dimension(PWIDTH,PHEIGHT));
images [LEFT] = loadImage("Images/richard_gere_0.jpg");
images [RIGHT] = loadImage("Images/richard_gere_1.jpg");
imageIndex = LEFT;
new Timer(PERIOD, this).start(); // start Swing timer
} // ShowGere
public BufferedImage loadImage(String fileName)
{
try {
BufferedImage im = ImageIO.read(getClass().getResource(fileName));
return im;
} catch(IOException e) {
System.out.println("Load Image error for "+fileName+":\n"+e);
return null;
}
}
// triggered by the timer: face the mouse and repaint
public void actionPerformed(ActionEvent e)
{
imageIndex = getMouseDirection(); // is mouse to left or right?
repaint();
}
// Is the mouse to the LEFT or RIGHT of the middle of the window?
public int getMouseDirection(){
// mouse location in *screen* co-ordinates
Point mouseCoordinates = MouseInfo.getPointerInfo().getLocation();
// convert to *component* co-ordinates
SwingUtilities.convertPointFromScreen(mouseCoordinates,this);
if (mouseCoordinates.x>=PWIDTH/2) return RIGHT; else return LEFT;
} // getMouseDirection
public void paintComponent(Graphics g)
{
g.drawImage(images [imageIndex],0,0,this);
}
public static void main(String args[])
{
final ShowGere showPanel = new ShowGere();
JFrame showFrame = new JFrame("Show Images");
showFrame.getContentPane().add(showPanel,BorderLayout.CENTER);
showFrame.setDefaultCloseOperation (WindowConstants.EXIT_ON_CLOSE);
showFrame.pack();
showFrame.setResizable(false);
showFrame.setVisible(true);
} // main
} // ShowGere class
</pre>To run the program, copy and save the program listing to a file called "ShowGere.java" in your working directory. <span class="Apple-style-span" style="color: red;"><b>(Remember, the filename must match the class name.)</b></span><br />
<br />
Compile with<br />
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b style="background-color: white;">javac ShowGere.java</b></span></div><br />
and run with<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b style="background-color: white;"><br class="Apple-interchange-newline" />java ShowGere</b></span></div><br />
Move the mouse around and there you have it: <i>Richard Gere swinging both ways</i>.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZmJmuTxDimELih3KmReQ2mVeS2hx09HFF53BZKJ1dNdsbH7hMOMzqGCQpOo1IjTYn5RI_CnAaSbPWv4poahCDPGeAIzpHVaiieo8gLzIG02VNrEya1FtN6swBQONDZ_Jqg9stk8pCLR-W/s1600/sloth1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZmJmuTxDimELih3KmReQ2mVeS2hx09HFF53BZKJ1dNdsbH7hMOMzqGCQpOo1IjTYn5RI_CnAaSbPWv4poahCDPGeAIzpHVaiieo8gLzIG02VNrEya1FtN6swBQONDZ_Jqg9stk8pCLR-W/s320/sloth1.jpg" width="320" /></a></div><div style="text-align: center;"><i>Mr Frisky makes a mad dash for freedom.</i></div>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com28tag:blogger.com,1999:blog-1380263967296148716.post-70990666474791045152011-02-19T12:03:00.005-05:002011-02-20T16:08:21.428-05:00Java : When You've Got TimingIn yesterday's post we took our first, tentative steps into the world of Java GUIs with AWT and Swing.<br />
<br />
<b>WTF</b>! Too many <b>TLA</b>s (<b><span class="Apple-style-span" style="color: red;">T</span></b>hree <span class="Apple-style-span" style="color: red;"><b>L</b></span>etter <span class="Apple-style-span" style="color: red;"><b>A</b></span>cronyms). Let's back up a little and address each acronym in turn.<br />
<br />
<b>GUI</b> : a <span class="Apple-style-span" style="color: red;"><b>G</b></span>raphical <span class="Apple-style-span" style="color: red;"><b>U</b></span>ser <span class="Apple-style-span" style="color: red;"><b>I</b></span>nterface - think of the difference between Windows and DOS (if you're old enough to remember DOS). A GUI usually consists of windows, mouse, buttons, icons and so on.<br />
<br />
<b>AWT</b> : the <span class="Apple-style-span" style="color: red;"><b>A</b></span>bstract <span class="Apple-style-span" style="color: red;"><b>W</b></span>indow <b><span class="Apple-style-span" style="color: red;">T</span></b>oolkit. In other languages, we'd call AWT a <i>library </i>of routines. In Java, it's better to think of it as a <i>toolkit </i>providing class definitions for windowing, graphics and user-interface "widget" objects. AWT interacts with the host operating System (OS) - Windows, Mac or Linux - at a low level. Because of this, a window opened using an AWT class will look like a Windows window when the program is run on a Windows PC, and like an OS X window when the program is run on a Mac.<br />
<br />
<b>Swing</b> : a GUI widget toolkit kind of built on top of (and beside) AWT, that gives you more control over the look and feel of your applications.<br />
<br />
So, yesterday's program defined "ShowImageApp" as an extension of the Swing "JPanel" class. Our program's "main" method constructed a new "showPanel" (the contents of our program's window) and stuffed it into a newly constructed Swing "JFrame" object called "showFrame" (the frame of the window).<br />
<br />
Today, we're going to modify our program to load a second image, and to use an AWT timer to switch between the two images at one second intervals.<br />
<br />
Let's start with our second image - everything's cuter with hearts:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAIwJUYzYjpnYyxY6MFbbwezwtq1OAGxOrREqq1s8IXOnfDuNZCzliE_sqvpEBXlnGkC8_NM3Ca-0BWrnNsmyj1rMqGRhBbgHx3Gsw-oY9Xn9H58zhi5esvFKAhKmEx9FUQKXsaAQLjDB_/s1600/hitler_bambi_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="306" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAIwJUYzYjpnYyxY6MFbbwezwtq1OAGxOrREqq1s8IXOnfDuNZCzliE_sqvpEBXlnGkC8_NM3Ca-0BWrnNsmyj1rMqGRhBbgHx3Gsw-oY9Xn9H58zhi5esvFKAhKmEx9FUQKXsaAQLjDB_/s320/hitler_bambi_1.jpg" width="320" /></a></div><div style="text-align: center;"><i>When you've finished BAAAAWWWW-ing, save this image as <b>"hitler_bambi_1.jpg"</b></i></div><div style="text-align: center;"><i><b></b>in the same place you stored <b>"hitler_bambi_0.jpg"</b> yesterday.</i></div><div style="text-align: center;"></div><br />
First, we need to import definitions of timer-related objects:<br />
<pre class="prettyprint">import java.awt.event.*;
</pre>We need a new constant to define the period (in milliseconds) between picture changes.<br />
<pre class="prettyprint">private static final int PERIOD = 1000;
</pre>Now, we change our declaration of variable "image" to an array "images".<br />
<pre class="prettyprint">private BufferedImage [] images = new BufferedImage [2];
</pre>We also need a variable to keep track of which image from our array we should be displaying.<br />
<pre class="prettyprint">private int imageIndex;
</pre>In the "ShowImageApp()" constructor method, we change the initialization code to:<br />
<pre class="prettyprint">public ShowImageApp()
{
setPreferredSize(new Dimension(PWIDTH,PHEIGHT));
images [0] = loadImage("Images/hitler_bambi_0.jpg");
images [1] = loadImage("Images/hitler_bambi_1.jpg");
imageIndex = 0;
new Timer(PERIOD, this).start(); // start the Swing timer
} // ShowImageApp
</pre>This loads both images, sets the image index to point at the first (0th!) image, and starts a Timer with period 1000ms.<br />
<br />
The "paintComponent()" is modified slightly to display the current image.<br />
<pre class="prettyprint">public void paintComponent(Graphics g)
{
g.drawImage(images [imageIndex],0,0,this);
}
</pre>The only other change we need to make is to tell the program what to do every time the Timer "goes off". For that we define an "actionPerformed" method as follows.<br />
<pre class="prettyprint">public void actionPerformed(ActionEvent e)
{
repaint();
imageIndex = (imageIndex + 1) % 2;
}
</pre>So, each time the Timer period expires, the "actionperformed" method is called. The method calls "repaint()" to trigger our "paintComponent()" method. The "imageIndex" is then toggled between 0 and 1.<br />
<br />
One last change is to the line introducing the "ShowImageApp" class - we need to tell the compiler that "ShowImageApp" objects will listen for Timer actions:<br />
<pre class="prettyprint" style="font-size: small;">public class ShowImageApp extends JPanel implements ActionListener
</pre>In Java jargon, the class <i>implements </i>the <i>abstract interface</i> "ActionListener".<br />
<br />
Adding all of the above changes to yesterday's program we get:<br />
<pre class="prettyprint" style="font-size: xx-small;">// ShowImageApp.java
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.swing.*;
import javax.imageio.*;
import java.io.*;
public class ShowImageApp extends JPanel implements ActionListener
{
private static final int PERIOD = 1000; // Swing timer interval 1.0 secs
private static final int PWIDTH = 417;
private static final int PHEIGHT= 400;
private BufferedImage [] images = new BufferedImage [2];
private int imageIndex;
public ShowImageApp()
{
setBackground(Color.black);
setPreferredSize(new Dimension(PWIDTH,PHEIGHT));
images [0] = loadImage("Images/hitler_bambi_0.jpg");
images [1] = loadImage("Images/hitler_bambi_1.jpg");
imageIndex = 0;
new Timer(PERIOD, this).start(); // start the Swing timer
} // end of constructor
public BufferedImage loadImage(String fileName)
{
try {
BufferedImage im = ImageIO.read(getClass().getResource(fileName));
return im;
} catch(IOException e) {
System.out.println("Load Image error for "+fileName+":\n"+e);
return null;
}
}
// triggered by the timer: repaint and toggle the image index
public void actionPerformed(ActionEvent e)
{
repaint();
imageIndex = (imageIndex + 1) % 2; // toggle between 0 and 1
}
public void paintComponent(Graphics g)
{
g.drawImage(images [imageIndex],0,0,this);
}
public static void main(String args[])
{
final ShowImageApp showPanel = new ShowImageApp();
JFrame showFrame = new JFrame("Show Images");
showFrame.getContentPane().add(showPanel,BorderLayout.CENTER);
showFrame.setDefaultCloseOperation (WindowConstants.EXIT_ON_CLOSE);
showFrame.pack();
showFrame.setResizable(false);
showFrame.setVisible(true);
} // main
} // ShowImageApp Class
</pre>Save the program as <b>"ShowImageApp.java"</b> and compile and run in the same way as yesterday and you should get the cutest flashing image <i>ever</i>.<br />
<br />
"Big deal" I hear you say, "we could have done that with a .GIF". So true, but tomorrow we'll make our program interactive with a bit of mouse handling.Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com19tag:blogger.com,1999:blog-1380263967296148716.post-68137010606608084662011-02-18T15:31:00.002-05:002011-02-20T16:08:40.516-05:00Java : Framing Treasured MomentsYesterday's "Hello world!" program just wrote text to a DOS box. Today's program is going to open up a window and display an image in it. Not quite "Call of Duty: Modern Warfare 3", but remember - baby steps.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9ZmE2x380q43lyswpECVh3meUvYpugW7TOBC0GuimIADbKw3sFnI82p32k8Gkct_tFmCnOv07GCJjJoep9hLzIkUdl1Ezx1aaaNwFkW05hUXqCag0DHCp8VNf7pmSaFv4_fxX6M_Gg_PV/s1600/hitler_bambi_0.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="306" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9ZmE2x380q43lyswpECVh3meUvYpugW7TOBC0GuimIADbKw3sFnI82p32k8Gkct_tFmCnOv07GCJjJoep9hLzIkUdl1Ezx1aaaNwFkW05hUXqCag0DHCp8VNf7pmSaFv4_fxX6M_Gg_PV/s320/hitler_bambi_0.jpg" width="320" /></a></div><div style="text-align: center;"><i>We'll start with this heart-warming image of two lovable cartoon characters</i>.</div><br />
Make a new sub-directory of your Java working directory and call it <b>"Images"</b>. Save the image in there as <b>"hitler_bambi_0.jpg"</b>. <span class="Apple-style-span" style="font-size: xx-small;">(If you're offended by cartoon deer, you can use any image you like, but be sure to change the image and directory names in your program later.)</span><br />
<br />
Now for our program:<br />
<pre class="prettyprint" style="font-size: xx-small;">// ShowImageApp.java
// import definitions for the pre-defined classes & methods we'll be using
import java.awt.*;
import java.awt.image.*;
import javax.swing.*;
import javax.imageio.*;
import java.io.*;
public class ShowImageApp extends JPanel
{
// define constants to determine the width & height of our window
private static final int PWIDTH = 417;
private static final int PHEIGHT= 400;
// declare a variable to hold our image;
private BufferedImage image;
// ShowImageApp() is a constructor method for initializing new ShowImageApp objects
public ShowImageApp()
{
setPreferredSize(new Dimension(PWIDTH,PHEIGHT));
image = loadImage("Images/hitler_bambi_0.jpg");
}
// Load the image from <filename><filename>, returning it as a BufferedImage
public BufferedImage loadImage(String filename)
{
try {
BufferedImage im = ImageIO.read(getClass().getResource(filename));
return im;
} catch(IOException e) {
System.out.println("Load Image error for "+filename+":\n"+e);
return null;
}
}
// tells the window manager how to paint the window
public void paintComponent(Graphics g)
{
g.drawImage(image,0,0,this);
}
public static void main(String args[])
{
// construct a new object, showPanel, of class ShowImageApp
ShowImageApp showPanel = new ShowImageApp();
// construct a new window-frame object, showFrame
JFrame showFrame = new JFrame("Frame title goes here");
// link the panel to the frame
showFrame.getContentPane().add(showPanel,BorderLayout.CENTER);
// tell Java to shut down when we close the window
showFrame.setDefaultCloseOperation (WindowConstants.EXIT_ON_CLOSE);
// don't allow the window to be resized
showFrame.setResizable(false);
// display the window
showFrame.pack();
showFrame.setVisible(true);
} // main
} // ShowImageApp class
</filename></pre>Whoah! That's a big jump in complexity from the "Hello World" program. Let's strip out some of the noise and show some simplified pseudo-code.<br />
<pre style="font-size: xx-small;">import definitions;
public class ShowImageApp extends JPanel
{
define constants & declare variables;
ShowImageApp() is a constructor method for the ShowImageApp class
loadImage(filename) loads an image into a BufferedImage
paintComponent(Graphics g) tells the JVM how to paint the window
public static void main(String args[])
{
construct a new ShowImageApp object called showPanel;
construct a new window frame called showFrame;
tell JVM that showPanel is the content of showFrame;
tell JVM to shut down when we close the window;
make the window size fixed;
display the window;
}
}
</pre><br />
So, yesterday's program defined the "HelloWorldApp" class: today's defines "ShowImageApp".<br />
Yesterday's "main" method just printed a line of text: today's constructs a new object "showPanel"; makes a window for it "showFrame"; links the two; does some housekeeping; and displays the window.<br />
<br />
The most <i>confusing</i> part of this program for me as a beginner is the overloading (re-definition) of the word "ShowImageApp". In a better designed language, the constructor method for the "ShowImageApp" class might have been called "makeShowImageApp". This would make it a little clearer that the constructor is just an initialization method for a new class object. The declaration of "showPanel" would then read:<br />
<pre class="prettyprint">ShowImageApp showPanel = new makeShowImageApp();
</pre>Sadly, we're stuck with Java's execrable syntax.<br />
<br />
The most <i>complicated</i> part of our program is perhaps the method "loadImage". You'll see code like<br />
<pre class="prettyprint">try{some action}catch{some exception}
</pre>quite a lot in Java - usually when performing input/output (I/O) of some kind. It just tells the JVM to try to do something, and if something goes wrong, to handle the <i>exception</i> gracefully.<br />
<br />
To run the program, copy and save the first program listing (not the pseudo-code) to a file called "ShowImageApp.java" in your working directory. <span class="Apple-style-span" style="color: red;"><b>(Remember, the filename must match the class name.)</b></span><br />
<br />
Compile with<br />
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b style="background-color: white;">javac ShowImageApp.java</b></span></div></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div></div>and run with<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b style="background-color: white;"><br class="Apple-interchange-newline" />java ShowImageApp</b></span></div></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div></div>Your most likely source of problems is that the program looks for the image in the wrong place and with the wrong name. <span class="Apple-style-span" style="color: red;"><b>Java is case sensitive!</b></span> But, Windows often "fixes" file commands for you so cases "kind of" match. Make sure your images sub-directory is called "Images" not "images" or "ImAgEs".<br />
<br />
Once you get the program working, you can swap the image for something from your fap folder. remember to change the definitions of PWIDTH and PHEIGHT to match the size (in pixels) of your new image.<br />
<br />
Have fun.Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com15tag:blogger.com,1999:blog-1380263967296148716.post-49567544339716462722011-02-17T14:15:00.008-05:002011-02-20T16:08:56.188-05:00Java : Hello WorldWe're dragging our feet a bit here as <i>"Hello World"</i> programs are mind-numbingly dull. But, we've got to start somewhere. So, with a <i>rolled howl</i>, we'll lead our <i>low lol herd</i> to a <i>lewd ho roll</i> (in ASCII). <span class="Apple-style-span" style="font-size: xx-small;">("Hello World" doesn't even have any good anagrams.)</span><br />
<br />
First off, create a desktop shortcut to make it easy to start a DOS box in your Java working directory. On our Windows XP laptop, we copied the "Command Prompt" shortcut from <start><All Programs><Accessories> to the desktop. Right click on the DOS prompt icon and you should see "Target: %SystemRoot%\system32\cmd.exe". Change the "Start in:" field to your working Java directory. In our case <b>"C:\Documents and Settings\Sucio\Desktop\Java"</b>.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji-zf7wNFB3_gKc_iTkexE8wBpxlLrssXlno5M1gBWfVX8ar2MDyAvPxgCbSK5pdAF5atJuyuS6-CMEQ-UtGNMX1jfyHT5gow17RVR1SZcT8HR5qvWwEeFJa1Lw0bMiWH6Ugcwt9lwWPHs/s1600/Java_Prompt.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji-zf7wNFB3_gKc_iTkexE8wBpxlLrssXlno5M1gBWfVX8ar2MDyAvPxgCbSK5pdAF5atJuyuS6-CMEQ-UtGNMX1jfyHT5gow17RVR1SZcT8HR5qvWwEeFJa1Lw0bMiWH6Ugcwt9lwWPHs/s1600/Java_Prompt.jpg" /></a></div>On Windows 7, the Target would be "%windir%\system32\cmd.exe" and we'd probably start in "%HOMEDRIVE%%HOMEPATH%\Java" which comes out as <b>"C:\Users\Sucio\Java"</b>.<br />
(I changed the name of my shortcut to "JAVA Prompt.)<br />
<br />
So, I'm sure you're itching to try something so let's get started. Here's the text of our simple "Hello World" program.<br />
<br />
<pre class="prettyprint">class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Viva Sucio!");
}
}
</pre>There's a very good description of what every word of this program is doing at <a href="http://en.wikipedia.org/wiki/Java_(programming_language)#Hello_world"><span class="Apple-style-span" style="background-color: purple; color: white;"><b><Jimmy Wales' blog></b></span></a>. For now, we'll just say that the program defines a <i>class </i>of <i>objects </i>called HelloWorldApp and tells Java what the object can do (its <i>methods</i> - in this case, just the method<i> main</i>).<br />
<br />
Copy and paste the simple program into a new file "HelloWorldApp.java" in your working directory. (Note, a java program must have a file name ending with ".java"; and the name must match that of the <i>class</i> defined by the program - in our case "HelloWorldApp".)<br />
<br />
Once you've saved the program, at the command prompt, type<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b style="background-color: white;">javac HelloWorldApp.java</b></span><br />
<br />
and press enter. If you haven't screwed up, there'll be a slight pause and then you'll get a new prompt as though nothing's happened. But, if you list the directory contents, you'll find that there's now a new file called "HelloWorldApp.class". <span class="Apple-style-span" style="font-size: xx-small;">(If the PC complains that it can't find javac, it's because you didn't set the PATH environment variable properly. Follow the link in yesterday's post to find instructions.)</span><br />
<br />
So what happened here? The Java compiler ("javac") <i>compiled</i> (translated) the Java class definition in our program source file into <i>bytecode</i>. Bytecode is a special kind of machine instruction which can be run (interpreted) by something called the <b><span class="Apple-style-span" style="color: red;">J</span></b>ava <span class="Apple-style-span" style="color: red;"><b>V</b></span>irtual <span class="Apple-style-span" style="color: red;"><b>M</b></span>achine (JVM). the bytecode program is stored in a ".class" file.<br />
<br />
Rather than waffling let's have a go: type<br />
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><b style="background-color: white;">java HelloWorldApp</b></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">and press enter. Your "Hello World" message (in our case "Viva Sucio!") should appear on the screen, followed by a new prompt.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">The JVM ("java") loaded the bytecode in "HelloWorldApp.class" and started running the program at the "main" entry point. The "main" method told the JVM to print the line of text "Viva Sucio!" to the system output stream.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Hopefully some the the jargon in our last post is getting clearer now. We downloaded the <b><span class="Apple-style-span" style="color: red;">J</span></b>ava <b><span class="Apple-style-span" style="color: red;">R</span></b>untime <b><span class="Apple-style-span" style="color: red;">E</span></b>nvironment (JRE) which contained the <span class="Apple-style-span" style="color: red;"><b>J</b></span>ava <span class="Apple-style-span" style="color: red;"><b>V</b></span>irtual <span class="Apple-style-span" style="color: red;"><b>M</b></span>achine (JVM - "java"). We also downloaded the <span class="Apple-style-span" style="color: red;"><b>J</b></span>ava <b><span class="Apple-style-span" style="color: red;">D</span></b>evelopment <span class="Apple-style-span" style="color: red;"><b>K</b></span>it (JDK) which contained the Java compiler ("javac").</div><br />
<br />
Play around a bit changing the message string in the program.<br />
<pre><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">
,/, ,.%((.))) |.
'///_, (///)\\))) , |||/
\ ,' (([]-[]-\\\) y-";,-"
| | )| - @))) | |
| \ ((\___,"(( / |
| `---.__))| |())___.---' |
`-._ "-_ _ -" _,-"
"-.__," ".__.-"
( @ / \ @ )
`---' `---'
| |
| . |
/ \
/ "-.-" \
/ /^\ \
/ / \ \
/ / \ \
( ." ". \
\ ) \ \
\ ". `. \
". \ \ \
`. `) \ ".
\ ( \ \
.mno/ | \
Oonm'
</span></pre><b><i>"Sarah Palin nude"</i></b> - That should get the google hits up.<br />
<br />
<br />
<span class="Apple-style-span" style="font-size: xx-small;">(Based on an image by hjw at the <a href="http://www.asciipr0n.com/pr0n/">ASCII pôrn archive</a>.)</span>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com23tag:blogger.com,1999:blog-1380263967296148716.post-52905660354142339572011-02-15T15:25:00.016-05:002011-02-20T16:09:11.357-05:00Java : Baby StepsAs we indicated yesterday, we plan to post a series of pieces about Java. We don't intend (or expect) to teach anybody basic programming concepts - like <i><b>for loops</b></i> - there are plenty of better places to learn that stuff. What we'll focus on is the practical difficulties for a newbie getting started with Java.<br />
<div><br />
</div><div>The first big hurdle we encountered was in installing the language - almost a show-stopper. We decided to install the <b><span class="Apple-style-span" style="color: red;">J</span></b>ava <b><span class="Apple-style-span" style="color: red;">D</span></b>evelopment <span class="Apple-style-span" style="color: red;"><b>K</b></span>it (JDK) and the Netbeans <span class="Apple-style-span" style="color: red;"><b>I</b></span>ntegrated <b><span class="Apple-style-span" style="color: red;">D</span></b>evelopment <span class="Apple-style-span" style="color: red;"><b>E</b></span>nvironment (IDE) at the same time, and downloaded the <span class="Apple-style-span" style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;"> </span><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;"><span class="Apple-style-span" style="background-color: purple; color: white; text-decoration: none;"><b><a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk-netbeans-jsp-142931.html" style="background-color: purple; text-decoration: none;"><span class="Apple-style-span" style="color: white;"><JDK 6 Update 23 with NetBeans 6.9.1></span></a><span class="Apple-style-span" style="color: #222222;"> </span></b></span></span> package from <span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;"><span class="Apple-style-span" style="background-color: purple; color: white; text-decoration: none;"><b><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" style="background-color: purple; text-decoration: none;"><span class="Apple-style-span" style="color: white;"><oracle.com></span></a><span class="Apple-style-span" style="color: #222222;">.</span></b></span></span><br />
<br />
We started up the installer and then sloped away for a coffee. When we got back, there was a shiny new "Netbeans" icon on our desktop. After a precautionary reboot, we clicked on Netbeans and received a couple of error messages: <i>"The JDK is missing"</i> and <i>"Cannot locate java installation in specified jdkhome : C:\Program Files\Java\jdk1.6.0_23. Do you want to try to use the default version?"</i> We then wasted an hour or two tinkering with environment variables and the Netbeans configuration file ("netbeans.conf") before realizing that the first error message meant exactly what it said - the JDK was missing: it hadn't installed at all.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr5L2WziQmdcXiYHj12p9ElWq5VNNoL5C7xT8wdmDRbYtyCUQ9uowcHCy_XA2aUi61bYsgx7uLN5ctlswpjpS8a1-MFtt_hyphenhyphenNmSA9w7YPKEp-2-OFpC-aBYyaKEOS5ZlfeUUUJDtErtLMy/s1600/WorksInWindows.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="32" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr5L2WziQmdcXiYHj12p9ElWq5VNNoL5C7xT8wdmDRbYtyCUQ9uowcHCy_XA2aUi61bYsgx7uLN5ctlswpjpS8a1-MFtt_hyphenhyphenNmSA9w7YPKEp-2-OFpC-aBYyaKEOS5ZlfeUUUJDtErtLMy/s200/WorksInWindows.jpg" width="50" /></a></div>So, we ran the installer again, and this time the JDK installed.<br />
WTF?! The first of many <i>Half-Assed Excellence</i> awards for Sun/Oracle.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkhNpDaN2y0Txs0ah_-I7vtgYAVozjNNo2MuuKSF3WrLQDUP3Mq-cD8YRDCoOe97pETodyjBBgQ1kMOr6W7KBANgbOB5XCq-yDQvCYqmWSt6wzb46dSMFIHUdHtTachMOHH1ZBunxhwHTV/s1600/mavis.beacon.hope.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="75" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkhNpDaN2y0Txs0ah_-I7vtgYAVozjNNo2MuuKSF3WrLQDUP3Mq-cD8YRDCoOe97pETodyjBBgQ1kMOr6W7KBANgbOB5XCq-yDQvCYqmWSt6wzb46dSMFIHUdHtTachMOHH1ZBunxhwHTV/s200/mavis.beacon.hope.jpg" width="50" /></a></div>We then followed the instruction in step 4 on <span class="Apple-style-span" style="background-color: purple; color: white;"><a href="http://www.oracle.com/technetwork/java/javase/install-windows-189425.html"><span class="Apple-style-span" style="color: white;"><b>the oracle.com page linked <here></b></span></a></span> to set our PATH environment variable. This is so you can compile a program by typing <i><b>"javac Sucio.java"</b></i> in a DOS box, rather than having to type <b><i>"C:\Program Files\Java\jdk1.6.0_23\bin\javac Sucio.java"</i></b> - which would get old very fast (unless you're Mavis Beacon).</div><br />
Having gone to the trouble of downloading and installing Netbeans, we decided not to use it just yet. IDEs are a great tool for experienced programmers to crank out code quickly, but they can get in the way of learning about a language. (And we're too lazy to <a href="http://www.urbandictionary.com/define.php?term=RTFM">RTFM</a>.)<br />
<br />
So, for now, we're going to edit our code using Programmer's Notepad - a nice little editor that knows about Java syntax (and a lot of others) - which can be downloaded free <a href="http://www.pnotepad.org/" style="background-color: purple;"><span class="Apple-style-span" style="color: white;"><b><here></b></span></a>.<br />
<br />
Next time, we'll run through compiling a traditional "Hello World" program:<br />
<br />
<pre class="prettyprint">class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Viva Sucio!");
}
}
</pre><br />
(The code sample above was posted using <span class="Apple-style-span" style="font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 13px;"><a href="http://code.google.com/p/google-code-prettify/" style="color: #9e5205;">google-code-prettify</a> following the instructions posted <a href="http://vivianningyang.blogspot.com/2009/05/how-to-post-source-code-in-blogspotcom.html"><here></a>.)</span>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com23tag:blogger.com,1999:blog-1380263967296148716.post-34242245826127206042011-02-14T12:19:00.002-05:002011-02-20T16:09:28.925-05:00Java : Javanna Learn Java?When we started this blog last September, one of our goals was to become more proficient in "shooping". In particular, we wanted to learn <i>just-enough</i> GIMP to improve the crappy appearance of the software we occasionally write.<br />
<br />
Three months later, the GIMP thing had developed a life of its own. It was only after we spent a week creating the <a href="http://vote-sanchez.blogspot.com/2011/02/crabs-of-world-6-space-part-5.html">"Personal-Space Invaders"</a> .GIF and found ourselves thinking "it would have been easier to write the game" that we remembered our original plan.<br />
<br />
So, we've spent the past week or so learning the rudiments of Java and posting occasional test applets to see if it's possible to publish programs on blogger. Why Java? We want to use something that we can share with our readers, it's free, it's (kind of) portable and it's close enough to the vanilla C that we usually tinker in. Why not Flash? We'd all end up infected with McAfee malware.<br />
<br />
For the next few weeks (until the Java ad revenue dries up), we'll be posting applets and very simple tutorials on Java programming. (They'll have to be simple - we're just learning too.) If you want to follow along, you'll need to install the Java Development Kit from <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html" style="background-color: purple;"><span class="Apple-style-span" style="color: white;"><b>oracle.com</b></span></a>. We'll post about the problems we had installing <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk-netbeans-jsp-142931.html" style="background-color: purple;"><span class="Apple-style-span" style="color: white;"><b>JDK 6 Update 23 with NetBeans 6.9.1</b></span></a> on a Windows XP (SP2) laptop tomorrow.<br />
<br />
This brings us on to a word of warning: Sun's (now Oracle's) Java products are flaky. Installers don't always install fully - they often require manual tinkering, updates are naggy and annoying, and the run-time software may crash your machine or make your browser unstable. So, if you're not planning to go along with the tutorials, and you have no desire to play Java games like Minecraft, you're probably better off not installing any Java components.<br />
<br />
If you don't think you want to program but you would like to be able to view our applets, you'll need the Java Runtime Environment (JRE) from <a href="http://www.java.com/en/download/index.jsp" style="background-color: purple;"><span class="Apple-style-span" style="color: white;"><b>here</b></span></a>. The JRE page has a link to other pages where you can test whether your Java installation is working and up to date: but the tests and troubleshooting guides are pretty useless for anything other than Windows XP/Vista/7.<br />
<br />
<div style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"> <img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuAFv5eseL6xN9sw-s52VNmIiceVZutSbwXMu4ECR3msZM_5cSiUcAI6OEGIuuI5LvduzeYQGI2Cq7aXFsydNyzcYKB7z0btUcN0ph6CoQ0-TYLnel4Nx_CoKEG8cHoZT77eE0JjUm-eXk/s1600/icon_no_java.gif" /></div>For those choosing not to install Java, we'll try to remember to post a description of what the applet is doing, alongside the "no Java" button to the left.<br />
<br />
<br />
A final warning: Java is "portable" in the sense that if you work really, really hard, you can make it run under enough browsers and operating systems to cover (say) 99% of your target audience. we're <i>not</i> going to work that hard. After updating all our system software, our scuttling crablet sort of kinda works on our Ubuntu (amd64) machine - but crashes the browser and scrambles the screen. We haven't managed to view it at all on our OSX 10.5.8 machine. So, the 1% of our regular readers who use Linux, and the rather larger proportion of you that use Macs, are likely to be disappointed.<br />
<br />
Thankfully, very few of you use Internet Explorer, and none seem to be using the dreaded IE6. But, if you do try to view the applets with an old machine with an outdated Java Runtime Environment, we've no idea what you'll see. We'll leave the agonizing over backwards-compatibility to pony-tailed toss-pots who get paid to worry about such stuff.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr5L2WziQmdcXiYHj12p9ElWq5VNNoL5C7xT8wdmDRbYtyCUQ9uowcHCy_XA2aUi61bYsgx7uLN5ctlswpjpS8a1-MFtt_hyphenhyphenNmSA9w7YPKEp-2-OFpC-aBYyaKEOS5ZlfeUUUJDtErtLMy/s1600/WorksInWindows.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="206" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr5L2WziQmdcXiYHj12p9ElWq5VNNoL5C7xT8wdmDRbYtyCUQ9uowcHCy_XA2aUi61bYsgx7uLN5ctlswpjpS8a1-MFtt_hyphenhyphenNmSA9w7YPKEp-2-OFpC-aBYyaKEOS5ZlfeUUUJDtErtLMy/s320/WorksInWindows.jpg" width="320" /></a></div><div style="text-align: center;"><i>In recognition of our sloppy attitude, we award ourselves, (and Sun/Oracle) this special</i></div><div style="text-align: center;"><i><b>Certificate of Half-Assed Excellence.</b></i></div><br />
<br />
Tomorrow we'll go over a few of the quirks we found when trying to install the JDK.Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com21tag:blogger.com,1999:blog-1380263967296148716.post-56807882940508391352011-02-12T08:15:00.003-05:002011-02-20T16:09:48.222-05:00Test : Can You Hear Me Now?<center><applet archive="http://mgt.yourhda.com/Java/XformsApplet.jar" code="XformsApplet.class" height="500" width="500"><br />
</applet></center><br />
<div style="text-align: center;"><i>Let's try again without Google docs...</i></div>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com26tag:blogger.com,1999:blog-1380263967296148716.post-9227398609259209522011-02-11T17:50:00.006-05:002011-02-20T16:10:28.670-05:00Test : Another Crabby Applet<center><br />
<applet archive="https://docs.google.com/uc?id=0B2uAD6FckI8sMmMzNjY3OTktNTdkNy00MWY5LWI1NzYtZWQ4OGE1M2FmNjRh&export=download&hl=en" code="XformsApplet.class" height="500" width="500"><br />
</applet><br />
</center><br />
<div style="text-align: center;"><i>Just doodling.</i></div><br />
Like the previous post, this is a Java applet bundled up into a ".jar" and hosted at docs.google.com. I find I can see the crab in Firefox, Internet Explorer and Chrome on Windows XP (SP2) and Windows 7. I <i>haven't</i> yet been able to get it running in Safari (OS X) or Firefox/Chromium (Ubuntu amd64 - probably a plug-in issue).<br />
<br />
<i><b>In the comments please let me know whether you see a crab and what browser/OS you're using.</b></i><br />
<br />
(It seems that I can't view the applet from any browser that's logged in to my docs.google.com account. Probably a security measure to protect users from self-modifying applets.)Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com18tag:blogger.com,1999:blog-1380263967296148716.post-31688703029981875302011-02-09T20:51:00.004-05:002011-02-20T16:11:11.568-05:00Test : Please Ignore<center><br />
<applet archive="https://docs.google.com/uc?id=0B2uAD6FckI8sMWU5MTBhODktZDFjOS00Yzc0LTllMjItNTVmODE3OTY0MTZk&hl=en" code="ShowImageAppletJar.class" height="200" width="155"><br />
</applet><br />
</center><center><br />
</center><br />
<div style="text-align: center;"><i>Nothing to see here: move along.</i></div>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com26tag:blogger.com,1999:blog-1380263967296148716.post-13519665659247907462011-02-03T15:25:00.001-05:002011-02-03T18:34:34.585-05:00Crabs of the World - #6 Space (Part 5)<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3d5SyYT0WrZVaIaolNi_tEVLqCzIvPjNvkiB-YCsAyq7Hz8s4lbmCobdZAW_f_3T7BYKk6V4TDLJrAWNr_MvALD9gVtIY2DiPWJdRAddU7u6xkxWS8QjhzwqIHpzrgz8bD1uas7VCShyphenhyphenX/s1600/Personal_Space_Invaders_small.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3d5SyYT0WrZVaIaolNi_tEVLqCzIvPjNvkiB-YCsAyq7Hz8s4lbmCobdZAW_f_3T7BYKk6V4TDLJrAWNr_MvALD9gVtIY2DiPWJdRAddU7u6xkxWS8QjhzwqIHpzrgz8bD1uas7VCShyphenhyphenX/s1600/Personal_Space_Invaders_small.gif" /></a></div><div style="text-align: center;"><i><a href="https://docs.google.com/uc?id=0B2uAD6FckI8sNWYzZjhiMWYtZjE3ZC00ZTYwLWI4MDMtZWYxNTY0YmNiZTNh&hl=en">Personal-Space Invaders</a></i></div>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com50tag:blogger.com,1999:blog-1380263967296148716.post-92186150313468340432011-02-01T18:18:00.000-05:002011-02-01T18:18:40.290-05:00Crabs of the World - #6 Space (Part 4)<div class="separator" style="clear: both; text-align: center;"><a href="https://docs.google.com/uc?id=0B2uAD6FckI8sYzIzN2IxYzUtNzU5MC00NzQ1LTk3NGUtZDYwNTQ2MDYxZTlh&hl=en" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://docs.google.com/uc?id=0B2uAD6FckI8sYzIzN2IxYzUtNzU5MC00NzQ1LTk3NGUtZDYwNTQ2MDYxZTlh&hl=en" width="45" /></a></div><div style="text-align: center;"><i>Snow day!</i></div>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com38tag:blogger.com,1999:blog-1380263967296148716.post-34672531667068169282011-01-31T15:19:00.004-05:002011-01-31T21:42:41.808-05:00Crabs of the World - #6 Space (Part 3)Suciô's cold is getting better but he's left with a lingering cough and a feeling of disgruntlement. Pandering to our readers' <i>medicinal-hygiene</i> needs has rather kept us away from being mean-spirited to anyone (other than KU cheerleaders). Hopefully we'll make up for lost time when this animation is done. In the meantime there's always the comments section of your blogs. Go on, make my day, post some more Dr DRE, or dubstep, or some life-affirming shït about puppies.<br />
<br />
<br />
<div style="text-align: center;"><span class="Apple-style-span" style="color: #3d85c6; font-size: large;">Stage 3 - Who is This Super-Hero?</span></div><br />
Time to start work on our "gun". Given our theme, we obviously need a phallic image. We were going to go with a simple pixelated erection, but google image search came up with this winner:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIscqcR1hS_Dolgg71m1rejySTMMlrpcoUUdfOgx8EMLmkXvEdlUkin3Pd2mfdQd5u6n2KvSFE4m1eZME49ONTXPPkJGRpFuLkCrDY31Xsbu8ZUSwcuEoGhlIllwTtGX0kVQEgskkVJ47c/s1600/Call_me_Dick.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIscqcR1hS_Dolgg71m1rejySTMMlrpcoUUdfOgx8EMLmkXvEdlUkin3Pd2mfdQd5u6n2KvSFE4m1eZME49ONTXPPkJGRpFuLkCrDY31Xsbu8ZUSwcuEoGhlIllwTtGX0kVQEgskkVJ47c/s320/Call_me_Dick.jpg" width="253" /></a></div><br />
<div style="text-align: center;"><i>"My parents laughed when I told them I wanted to major in Drama,</i></div><div style="text-align: center;"><i>but look at me now."</i></div><div style="text-align: center;">(You can be as cool as this guy <a href="http://www.spirithalloween.com/product/inflatable-tricky-dick-adult-mens-costume/">for just $49.99</a>.)</div><br />
We think the model in the picture above has had enough humiliation for one lifetime. We'd like to replace his face with that of an utterly debased public figure, with not a shred of dignity and no redeeming features. We also need someone who's light on his feet. Who better than ex-Whitehouse Chief-of-Staff and soon to be king of the Cook County kleptocracy, Rahm Emanuel?<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2IzgtL_rwzfVW0jwXzSxUHiygsNCb1bh5aNuCycc9HQnKrXlku6camaE7O2HRnZbUAVFmh6n6bAJdBJ7WIsNhS__1eYbQ9UaD3C1eoaZfVdD5_-zSUgIr8esRHjeq6CN5zICuouUKrUBp/s1600/Rahm_Ballet.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2IzgtL_rwzfVW0jwXzSxUHiygsNCb1bh5aNuCycc9HQnKrXlku6camaE7O2HRnZbUAVFmh6n6bAJdBJ7WIsNhS__1eYbQ9UaD3C1eoaZfVdD5_-zSUgIr8esRHjeq6CN5zICuouUKrUBp/s320/Rahm_Ballet.jpg" width="152" /></a></div><div style="text-align: center;"><i>Ballet Rahmbert.</i></div><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJtdf74EojBVip3t3YDwdBE2aeFVJJXgt5_dBwpnBuPIMaDJydo4rUp1JwsV-lv2Ovz-VtKYEfG26ugGD3w-ElW7I8Q5vRTAP10aTGK3UgWJaC_s-O8SzYEE0TXO683id_OZDKRAxwQGkp/s1600/llegedly.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJtdf74EojBVip3t3YDwdBE2aeFVJJXgt5_dBwpnBuPIMaDJydo4rUp1JwsV-lv2Ovz-VtKYEfG26ugGD3w-ElW7I8Q5vRTAP10aTGK3UgWJaC_s-O8SzYEE0TXO683id_OZDKRAxwQGkp/s200/llegedly.jpg" width="173" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN94hd7V-42rDwY4vU0PQvs2wquQWzsevGMjH7XGBw89IwxnDsVDIQsGBthdqqZSHoWxu68b0uMEJs9k9wG7MndqaENFj8pQCnsSy7gZSEkUtvuOajs7-d0segNLIYO4xQeH5J0P4pYOO0/s1600/Rahm_MILF_Hunter.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN94hd7V-42rDwY4vU0PQvs2wquQWzsevGMjH7XGBw89IwxnDsVDIQsGBthdqqZSHoWxu68b0uMEJs9k9wG7MndqaENFj8pQCnsSy7gZSEkUtvuOajs7-d0segNLIYO4xQeH5J0P4pYOO0/s320/Rahm_MILF_Hunter.jpg" width="242" /></a></div><div style="text-align: center;"><i>One complication is his finger: lost in a tragic goosing accident when Nancy hiccuped.</i><br />
<i>(We'll ignore it : pretend he's wearing a "fingldo" prosthetic.)</i></div><br />
<br />
<div style="text-align: center;"><i><b>Behold! Rahm, the Hebrew God of Dicks.</b></i></div><div style="text-align: center;"><i><br />
</i></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr9HUi2-J02gZ-dQwz2o0_8u-Qru3-OESiRo08FwrfzUXvvtWvyq3Pd5ugmKEagB65sCw-_dGE3ZiX_2r0N00Kk-kyCIyvH2m4U5dJ6m7oqumDUrRUjIpcylTkS2CAzFYeBBv1urQKhoMM/s512/Rahm_Dick.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr9HUi2-J02gZ-dQwz2o0_8u-Qru3-OESiRo08FwrfzUXvvtWvyq3Pd5ugmKEagB65sCw-_dGE3ZiX_2r0N00Kk-kyCIyvH2m4U5dJ6m7oqumDUrRUjIpcylTkS2CAzFYeBBv1urQKhoMM/s512/Rahm_Dick.jpg" width="253" /></a></div><br />
<br />
<div style="text-align: center;"><i>We know Rahm's light on his feet. Is he light on his <a href="http://en.wikipedia.org/wiki/Space_hopper">balls</a>?</i></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg74k9aQjmdKe0UQsU58ln2jc6-K2FvMf1I8abqb5GRfYXrDXDqeqGPfVf0Q0MW0HRZq6vBtO0ujLXgErFYdzstwURiLCpL7uiXAELaFnElsRpQ4qKKCl1zI2LoI0F2KnQxkJ9IKnm9ck9g/s1600/Dick_Jump10.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg74k9aQjmdKe0UQsU58ln2jc6-K2FvMf1I8abqb5GRfYXrDXDqeqGPfVf0Q0MW0HRZq6vBtO0ujLXgErFYdzstwURiLCpL7uiXAELaFnElsRpQ4qKKCl1zI2LoI0F2KnQxkJ9IKnm9ck9g/s1600/Dick_Jump10.gif" /></a></div><br />
<br />
<div style="text-align: center;"><i>Looks good. Now we just need to add a black background and mask trailing frames...</i></div><div style="text-align: center;"><i><br />
</i></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJshpS1s1GxwPgEG32GBXo-80JAeZ0Qx0VFypsZvaBHyxul8gUAK9BrY8vLmQQFTkNdnFxRHI4lCitGx7qslwI2OSdC3yd9a7i1vptRi2eLVnvBwTrlwBPrQP3k4v0HjLaCq8L2ZSylpWV/s1600/Dick_JumpLRL.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJshpS1s1GxwPgEG32GBXo-80JAeZ0Qx0VFypsZvaBHyxul8gUAK9BrY8vLmQQFTkNdnFxRHI4lCitGx7qslwI2OSdC3yd9a7i1vptRi2eLVnvBwTrlwBPrQP3k4v0HjLaCq8L2ZSylpWV/s1600/Dick_JumpLRL.gif" /></a></div><div style="text-align: center;"><i>The Balled Avenger rides again.</i></div><br />
<br />
<div style="text-align: center;">Tomorrow we'll get him "shooting". (Unless the Illinois Supreme Court enjoins us not to.)</div><br />
<span class="Apple-style-span" style="font-size: xx-small;">P.S. Google is pure genius. Just previewing this brought up ads for "email marketing". Don't mention <span class="Apple-style-span" style="color: purple;"><i><b>H3RB4L V14GR4</b></i></span>!</span>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com33tag:blogger.com,1999:blog-1380263967296148716.post-36232623912076193132011-01-30T13:03:00.002-05:002011-01-30T15:39:00.317-05:00Crabs of the World - #6 Space (Part 2)A box of Kleenex (not in a good way) and half a bottle of malt whisky later and Suciô is feeling a bit better. He's still not in the mood for any marathon shooping sessions (or watching any more <i>φυκινγ</i> Dr DRE "music" videos).<br />
<br />
<div style="text-align: center;"><span class="Apple-style-span" style="color: #3d85c6; font-size: large;">Stage 2 - An Unstoppable Army of Crabby Minions.</span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinnhKgssSLc1N1P6kmj-X7y6gPLdd3Xf542Zoi_NXwNgpN8Vv23r130W5PiOKpVli72YBlu7R4ClncM7ihyL0S70eSlNuKQ5yja3x-nVmNbP670RG64okwDuXtOZB_rg8lQP36TNCFP13o/s1600/Louse4.png"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinnhKgssSLc1N1P6kmj-X7y6gPLdd3Xf542Zoi_NXwNgpN8Vv23r130W5PiOKpVli72YBlu7R4ClncM7ihyL0S70eSlNuKQ5yja3x-nVmNbP670RG64okwDuXtOZB_rg8lQP36TNCFP13o/s200/Louse4.png" width="155" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgitNJ3wT9HbirBWcSfw14PbSIpY40fKFbvmh8RQPab8Z4RsGG-OmmCbK8HbBUdRubvKYtsiC4M7TqH7svlBMwZ7uEx6pRIPYZtgThbW2wKMcJB9pBZ4CQl_aCyzPPrUjxcALicoH-kyv8g/s1600/Louse1.png"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgitNJ3wT9HbirBWcSfw14PbSIpY40fKFbvmh8RQPab8Z4RsGG-OmmCbK8HbBUdRubvKYtsiC4M7TqH7svlBMwZ7uEx6pRIPYZtgThbW2wKMcJB9pBZ4CQl_aCyzPPrUjxcALicoH-kyv8g/s200/Louse1.png" width="155" /></a></div><div style="text-align: center;"><i>The lice we made yesterday. Let's call them "Up" and "Down".</i></div><br />
<div class="separator" style="clear: both; text-align: center;"></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj82PfQ6SRtWmZOQVQKEq3P1Ee6MX2IJn1fY43OV_dwcQkrmKk3SXjU3NYguL-Qyxzm-I9WOOgA2kDsPvzECXaygQ0FxT9jQLPiopbMscyb0mUNXeBqFEBqxsDKHvDc6b1BN5laq9bz-TgO/s1600/Louse_5Up.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="40" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj82PfQ6SRtWmZOQVQKEq3P1Ee6MX2IJn1fY43OV_dwcQkrmKk3SXjU3NYguL-Qyxzm-I9WOOgA2kDsPvzECXaygQ0FxT9jQLPiopbMscyb0mUNXeBqFEBqxsDKHvDc6b1BN5laq9bz-TgO/s200/Louse_5Up.png" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1GthhIhb3nyo3giYdixKBgHl1zb_zeWoZ7KgYHJyd3Qtbg-tiwPuC8DShjS_pXrrJwBpjIv0VDKA272Wr5sa4vvRtYWbbn0-FAkllYB5wwYDFY7GxWim0xkd3_W30kbEDi9P8MqbF7dmd/s1600/Louse_5Down.png"><img border="0" height="40" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1GthhIhb3nyo3giYdixKBgHl1zb_zeWoZ7KgYHJyd3Qtbg-tiwPuC8DShjS_pXrrJwBpjIv0VDKA272Wr5sa4vvRtYWbbn0-FAkllYB5wwYDFY7GxWim0xkd3_W30kbEDi9P8MqbF7dmd/s200/Louse_5Down.png" width="200" /></a></div><div style="text-align: center;"><i>Make 5x1 arrays of "Up" and "Down"</i>.</div><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2JTRn4LN1QPpsiRFILmcFKGWxZjbIZaBPwWKvBlEtePijbKzU8TiNE5NCqt5-Qk2LB5Bg-cwXHPxE26OQVrf1v0bcgQG09sVt05tfUBFuSlYkqcqiTiRiRfXk1wFaItKVRhlB2JEiksHv/s1600/Louse_5x4_Up.png"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2JTRn4LN1QPpsiRFILmcFKGWxZjbIZaBPwWKvBlEtePijbKzU8TiNE5NCqt5-Qk2LB5Bg-cwXHPxE26OQVrf1v0bcgQG09sVt05tfUBFuSlYkqcqiTiRiRfXk1wFaItKVRhlB2JEiksHv/s200/Louse_5x4_Up.png" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkdUEL8PhHIK3z6ECUO1IMyPF3i-lUTZRThx9BgB_p3_1S9gdHOVQarJx9uRPg4Td40Ip_FVC0wY3oSi2GLtHUk4qCF-yBPXMUs_ENGsoi-4nW0g_l_ISYvNTVdIWJiP0LPboJmAsaf9gL/s1600/Louse_5x4_Down.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkdUEL8PhHIK3z6ECUO1IMyPF3i-lUTZRThx9BgB_p3_1S9gdHOVQarJx9uRPg4Td40Ip_FVC0wY3oSi2GLtHUk4qCF-yBPXMUs_ENGsoi-4nW0g_l_ISYvNTVdIWJiP0LPboJmAsaf9gL/s200/Louse_5x4_Down.png" width="200" /></a></div><div style="text-align: center;"><i>Then 5x4 arrays of alternating "Up" and "Down".</i></div><br />
Now create a black background big enough to hold 9x9 crabs.<br />
Paste the 5x4 arrays into successive layers starting with 5x4Up in column 5, row 1, then 5x4Down in column 4, row 1, etc. (Don't forget to black out the trailing edge column.) Save as a .GIF with a 1000ms delay.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://docs.google.com/uc?id=0B2uAD6FckI8sZDQ2ZTUzZmEtOGI2NS00ZjEwLTk0MWItY2NkZTNmNWMwNDI2&hl=en" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://docs.google.com/uc?id=0B2uAD6FckI8sZDQ2ZTUzZmEtOGI2NS00ZjEwLTk0MWItY2NkZTNmNWMwNDI2&hl=en" width="320" /></a></div><div style="text-align: center;"><i>Jerky, unconvincing animation - just like the real thing.</i></div><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://docs.google.com/uc?id=0B2uAD6FckI8sNzQ4Yjc4MjUtZTNiMy00MjE3LWEyOTYtNzIzOGVhZmVlNzAz&hl=en" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://docs.google.com/uc?id=0B2uAD6FckI8sNzQ4Yjc4MjUtZTNiMy00MjE3LWEyOTYtNzIzOGVhZmVlNzAz&hl=en" width="320" /></a></div><div style="text-align: center;"><i>Now let's add some bases. We have a "grassy knoll" that looks right for the part¹.</i></div><br />
<br />
<div style="text-align: center;">Tomorrow we'll start work on the "gun".</div><br />
<br />
<span class="Apple-style-span" style="font-size: xx-small;">1. We're sorry to disappoint our redheaded readers, but after a week of in-depth "research" into crab-related posts, Suciô would rather not see any more <i>"burning bushes"</i> for a while.</span>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com46tag:blogger.com,1999:blog-1380263967296148716.post-84015647533568291722011-01-29T11:35:00.003-05:002011-01-29T14:09:40.829-05:00Crabs of the World - #6 Space (Part 1)After a week of crab-related posts we think that our readers probably have all the <i>special shampoo</i> they need, so it's about time to move on to another subject. But first we'd like to give our little friends a special send-off with one last, extra complicated animation: we're going to call it <i>"Personal Space Invaders"</i>.<br />
<br />
Unfortunately, Suciô has a heavy cold at the moment (too much snow shoveling), and the large quantities of <i>medicinal</i> whisky and brandy he's consuming make extended shooping sessions impractical. So, we're going to split the post into several stages.<br />
<br />
<div style="text-align: center;"><span class="Apple-style-span" style="color: #3d85c6; font-size: large;">Stage 1 - The Invaders</span></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikM6F7QDxpc95BNS5qnv5cxem3NCEd_omx9llJtQ9SGfXNozW-rFOqglGuna0nHhmyBQ3aGToxev6bJQoU9bhOJahG6YWYxifFI5ltKOPG45-vm7SrEl9CVhx64xCV_tB5JHVahe-IPP0X/s1600/Louse0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikM6F7QDxpc95BNS5qnv5cxem3NCEd_omx9llJtQ9SGfXNozW-rFOqglGuna0nHhmyBQ3aGToxev6bJQoU9bhOJahG6YWYxifFI5ltKOPG45-vm7SrEl9CVhx64xCV_tB5JHVahe-IPP0X/s320/Louse0.png" width="249" /></a></div><div style="text-align: center;"><i>The original image - courtesy of the <a href="http://www.wellcome.ac.uk/">Wellcome Trust</a>.</i></div><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgitNJ3wT9HbirBWcSfw14PbSIpY40fKFbvmh8RQPab8Z4RsGG-OmmCbK8HbBUdRubvKYtsiC4M7TqH7svlBMwZ7uEx6pRIPYZtgThbW2wKMcJB9pBZ4CQl_aCyzPPrUjxcALicoH-kyv8g/s1600/Louse1.png"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgitNJ3wT9HbirBWcSfw14PbSIpY40fKFbvmh8RQPab8Z4RsGG-OmmCbK8HbBUdRubvKYtsiC4M7TqH7svlBMwZ7uEx6pRIPYZtgThbW2wKMcJB9pBZ4CQl_aCyzPPrUjxcALicoH-kyv8g/s200/Louse1.png" width="155" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx_UYhVhhKIWZidCmpq6BlBRYpGJT3ZRQsSWETxFmsFDVhVfJXlAdBy7PczqwT7KZMQgHCTjeZqTEx_W5Bp2kY_nbDfXnNCPrIxoEBarSVddX7uLau6-g2cbca-alpr3MkZQS6fVO7grLC/s1600/Louse2.png"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx_UYhVhhKIWZidCmpq6BlBRYpGJT3ZRQsSWETxFmsFDVhVfJXlAdBy7PczqwT7KZMQgHCTjeZqTEx_W5Bp2kY_nbDfXnNCPrIxoEBarSVddX7uLau6-g2cbca-alpr3MkZQS6fVO7grLC/s200/Louse2.png" width="155" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRFRr8JURbvXX1_f5jTbqAwoabJ3AQ_36aECTLup4nYSiMe7Ciqfts-764BxkW3FZC4-1W3f43NP8zLiqGFYeGgluC0uyK7noAaJ7whq8sG0qGMEQvAp_YyhHiGpMkJPh0Ck9HBfQbpU4P/s1600/Louse3.png"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRFRr8JURbvXX1_f5jTbqAwoabJ3AQ_36aECTLup4nYSiMe7Ciqfts-764BxkW3FZC4-1W3f43NP8zLiqGFYeGgluC0uyK7noAaJ7whq8sG0qGMEQvAp_YyhHiGpMkJPh0Ck9HBfQbpU4P/s200/Louse3.png" width="155" /></a><br />
<ul><li>Cut out the louse - just like we did with <a href="http://vote-sanchez.blogspot.com/2011/01/moarmons.html">Mitt Romney's head</a>.</li>
<li>Cut out the body....</li>
<li>and legs and antennae into separate layers.</li>
</ul><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7mn-AZ_LBoppGRdpUIJMYYakQ7JkI6zbvY5AlITWfbMAlfO8qd3uWLx0Hj18PVGz4H5UljXClq6CSFV75UmnSS7WKn4GbUoNfmKXzpf2RyuMS3GWj1YZCYHmG6UDjJO3KfsoiUjKwrR1k/s1600/Louse4.png"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7mn-AZ_LBoppGRdpUIJMYYakQ7JkI6zbvY5AlITWfbMAlfO8qd3uWLx0Hj18PVGz4H5UljXClq6CSFV75UmnSS7WKn4GbUoNfmKXzpf2RyuMS3GWj1YZCYHmG6UDjJO3KfsoiUjKwrR1k/s200/Louse4.png" width="155" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgitNJ3wT9HbirBWcSfw14PbSIpY40fKFbvmh8RQPab8Z4RsGG-OmmCbK8HbBUdRubvKYtsiC4M7TqH7svlBMwZ7uEx6pRIPYZtgThbW2wKMcJB9pBZ4CQl_aCyzPPrUjxcALicoH-kyv8g/s1600/Louse1.png"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgitNJ3wT9HbirBWcSfw14PbSIpY40fKFbvmh8RQPab8Z4RsGG-OmmCbK8HbBUdRubvKYtsiC4M7TqH7svlBMwZ7uEx6pRIPYZtgThbW2wKMcJB9pBZ4CQl_aCyzPPrUjxcALicoH-kyv8g/s200/Louse1.png" width="155" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSbzX30pzSlHbcqkYTK1PM7mab-Xn-TNzs30dcWJVAjklmoSbjkPpDJ03wmNsaCzhl6qitx3T9yw7hIt-7C4qv7r1GEESDYM3j9qd5rpdNw_vVb4hqY6k3RwtaGcj4iD7OHsG-iP8ryrnU/s1600/Louse6.gif"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSbzX30pzSlHbcqkYTK1PM7mab-Xn-TNzs30dcWJVAjklmoSbjkPpDJ03wmNsaCzhl6qitx3T9yw7hIt-7C4qv7r1GEESDYM3j9qd5rpdNw_vVb4hqY6k3RwtaGcj4iD7OHsG-iP8ryrnU/s1600/Louse6.gif" /></a><br />
<ul><li>Rotate each of the legs and antennae individually and merge them back with the body.</li>
<li>Add back our original cut-out image as a separate layer.</li>
<li>And save as a GIF (I've added a black background and 1000ms frame-delay).</li>
</ul><div><br />
Tomorrow, cold and whisky permitting, we'll assemble our invaders into rows.<br />
<br />
<span class="Apple-style-span" style="font-size: xx-small;">P.S. Just saw my best search referral ever: <a href="http://vote-sanchez.blogspot.com/2010/12/aqua-buddha-travelog-03.html">"Rub Kim Jong Il's belly for luck"</a></span><br />
<br />
</div>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com33tag:blogger.com,1999:blog-1380263967296148716.post-40611957150730104592011-01-28T10:33:00.000-05:002011-01-28T10:33:40.689-05:00Crabs of the World - #5 Bikini Bottom<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9G68kc1mfVdrpLbf11yfkWwXau1Vwz6vT4hlUu0S98TlFIKG1RiUwjRNhOtFM278ooV-Bh9RjFct9KgPEmQPC3X2K6_fzJojLfdRhW2gl-tyw9A4pgn52AmNO_q-lqxhPzDHUgM6RdTtj/s1600/Eugene_Krabs.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9G68kc1mfVdrpLbf11yfkWwXau1Vwz6vT4hlUu0S98TlFIKG1RiUwjRNhOtFM278ooV-Bh9RjFct9KgPEmQPC3X2K6_fzJojLfdRhW2gl-tyw9A4pgn52AmNO_q-lqxhPzDHUgM6RdTtj/s1600/Eugene_Krabs.gif" /></a></div><div style="text-align: center;"><i>Hello, I'm Mr Krabs and I like money.</i></div><br />
Well, these crab-related ads are surprisingly lucrative. Some of you must really like Maryland soft-shell crabs, or Kansas University sports memorabilia. Or perhaps you really need a hermit crab terrarium.<br />
<br />
It couldn't be anything else could it?Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com41tag:blogger.com,1999:blog-1380263967296148716.post-4088133857492056942011-01-27T18:15:00.001-05:002011-01-28T19:37:19.805-05:00Crabs of the World - #4 Kansas<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSEi-ADcgn18no_oErnoVfSZMwLjzWvs_xd9s4LwnfzH20xlE8ily6NIZ7Hl1bbQtR2AFeVag0WvXSEpqSVZSkQ88eRBJsaJFsQd870yJ-biFeHDqmGWLA6wy5Xky3jBh3W_iIctgv-lOC/s1600/Kansas_Pom_Pom_Crab.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSEi-ADcgn18no_oErnoVfSZMwLjzWvs_xd9s4LwnfzH20xlE8ily6NIZ7Hl1bbQtR2AFeVag0WvXSEpqSVZSkQ88eRBJsaJFsQd870yJ-biFeHDqmGWLA6wy5Xky3jBh3W_iIctgv-lOC/s320/Kansas_Pom_Pom_Crab.jpg" width="320" /></a></div><div style="text-align: center;"><i>A Kansas Pom-Pom Crab (Lybia tesselata kansasensis)</i></div><div style="text-align: center;"><i>pictured here with head cheerleader Ginger Muffington.</i></div><br />
Bio-Theologians from Kansas University today shocked the scientific world with the publication of the first definitive proof of the theory of <b><i>Intelligent Design</i></b>. Their findings show that KU cheerleaders are infested with a unique sub-species of pom-pom crab with coloration exactly matching that of the KU Jayhawks.<br />
<br />
Team-leader, Professor Chip Quackenbush told a packed press conference: "of course all cheerleaders harbor a rich and varied assortment of crustaceans, but the odds against this color combination occurring randomly are literally astronomical."<br />
<br />
At an emergency meeting, the Texas Board of Education ordered the recall of all Biology textbooks from the Texas school system. Teams of fundamentalist Bio-theologians are working round the clock to rush out new texts with all reference to Darwinian selection removed.<br />
<br />
Famed Rationalist Professor Richard Dawkins declined to be interviewed before his retirement to a Trappist monastery on the Franco-Swiss border.Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com27tag:blogger.com,1999:blog-1380263967296148716.post-28464306449534319742011-01-26T09:51:00.000-05:002011-01-26T09:51:37.701-05:00Crabs of the World - #3 The Kenyan Robber Crab<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRu2dvhEujpOF8fbTxp68xuiySBbnvPuz97jNlNaaU5lJv5wLGYVGaI7DfoaQMuVsEGHWi0pqQ2lVD9bFs4YLMVg3LniVrmdrofEsPfEi_tnQ-Fl3xxaJR3lzKjYMJoITbjl9iIiMRN53F/s1600/Kenyan_Robber_Crab.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRu2dvhEujpOF8fbTxp68xuiySBbnvPuz97jNlNaaU5lJv5wLGYVGaI7DfoaQMuVsEGHWi0pqQ2lVD9bFs4YLMVg3LniVrmdrofEsPfEi_tnQ-Fl3xxaJR3lzKjYMJoITbjl9iIiMRN53F/s320/Kenyan_Robber_Crab.jpg" width="320" /></a></div><div style="text-align: center;"><i>State of the Union.</i></div>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com48tag:blogger.com,1999:blog-1380263967296148716.post-71834961645014319172011-01-25T11:45:00.005-05:002011-01-25T18:17:36.170-05:00Crabs of the World - #2 Japan<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_3AnX0CJjpKc/TT75nf6qmdI/AAAAAAAAApo/YDprot9YQnY/s1600/Japanese_Crabs_Yamai_no_Sochi.jpg" imageanchor="1"><img border="0" height="312" src="http://2.bp.blogspot.com/_3AnX0CJjpKc/TT75nf6qmdI/AAAAAAAAApo/YDprot9YQnY/s320/Japanese_Crabs_Yamai_no_Sochi.jpg" width="320" /></a></div><div style="text-align: center;"><i>"Man with pubic lice"</i></div><div style="text-align: center;"><i>(Scene from the 12th century <a href="http://www.kyohaku.go.jp/eng/syuzou/meihin/kaiga/emaki/item04.html#">Yamai no Soshi</a> - Scroll of Diseases & Deformities.)</i><br />
<span class="Apple-style-span" style="color: purple; font-size: x-small;">[Blogger really hates this image: it keeps disappearing as censor-bots freak over the title then get overridden.</span><br />
<span class="Apple-style-span" style="color: purple; font-size: x-small;">I'm going to tint it a non-flesh color and re-post below - just as an experiment.]</span></div><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiAXTqAYCYTvvktpKputwlhi0PeQR8UTtBzx4EeQRp-MaDstyt1UfvblUiH8YIfXPc8o3HXbFBIWPqnwrFHOY2c7-bANUfI53578EvCNn6QYvL_iMQ0qqAXHQj427is0iI8Zhjn4shPSYb/s1600/Crabs_Yamai_no_Sochi_Blue.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="316" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiAXTqAYCYTvvktpKputwlhi0PeQR8UTtBzx4EeQRp-MaDstyt1UfvblUiH8YIfXPc8o3HXbFBIWPqnwrFHOY2c7-bANUfI53578EvCNn6QYvL_iMQ0qqAXHQj427is0iI8Zhjn4shPSYb/s320/Crabs_Yamai_no_Sochi_Blue.jpg" width="320" /></a></div><div style="text-align: center;"><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><i>"Man with blue pubic lice"</i></div></div><div style="text-align: center;"></div><div style="text-align: center;"><span class="Apple-style-span" style="color: purple; font-size: x-small;">[Let's see if the censor-bots react the same way to an image without flesh-tones.]</span></div><br />
<br />
<div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFPR_BOJZLAQp4ODCyxpIrvsrpWZziBcPPldTC4v5lzXnjGygNyhVTKDUyjTuIIHEYGegwQl-ZL8cHJUP7yU8ilvYmNG73AunFEg9qjY_NzCNqcWG_VjOo1n1sk3IMbdSKQ88O2_Qcavoa/s1600/Japanese_Spider_Crab.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="229" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFPR_BOJZLAQp4ODCyxpIrvsrpWZziBcPPldTC4v5lzXnjGygNyhVTKDUyjTuIIHEYGegwQl-ZL8cHJUP7yU8ilvYmNG73AunFEg9qjY_NzCNqcWG_VjOo1n1sk3IMbdSKQ88O2_Qcavoa/s320/Japanese_Spider_Crab.jpg" width="320" /></a></div><div style="text-align: center;"><i>Japanese spider crabs can grow to 13 feet across and can weigh 40lbs.</i></div>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com57tag:blogger.com,1999:blog-1380263967296148716.post-66570395810393403472011-01-24T13:15:00.004-05:002011-01-24T22:22:28.894-05:00Just Hangin'<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT9xYPlxnq0wNPysS9bAqYbS_FWXP3_38LpdNdSOLdvCaul8EnoqLm8SDPBaomXYAccV3Q1s-IuFxt1jh1u1emVdA5UkarSRtM0hRwJ0-TOvuWtwe_yQzWL2c5THPdigxW5LttN-22jScq/s1600/Pubic_Lice.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT9xYPlxnq0wNPysS9bAqYbS_FWXP3_38LpdNdSOLdvCaul8EnoqLm8SDPBaomXYAccV3Q1s-IuFxt1jh1u1emVdA5UkarSRtM0hRwJ0-TOvuWtwe_yQzWL2c5THPdigxW5LttN-22jScq/s1600/Pubic_Lice.gif" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div style="text-align: center;"><i>Google image search came up with these while I was looking for "spread thighs"<br />
(don't ask).</i></div><br />
<br />
<br />
<div style="text-align: center;"><span class="Apple-style-span" style="font-size: xx-small;">(This is great: I'm getting ads for tree-surgeons! <i>Pubic topiary?</i> Is that based on image recognition?)</span></div>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com42tag:blogger.com,1999:blog-1380263967296148716.post-25261869880383990572011-01-23T13:51:00.003-05:002011-01-24T12:24:38.395-05:00Completely Blotto<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxr85fHxwPqRlo8TG4-Jc-Q4q6kjgHaStHNtWq0xaf1aXJeuq0c8_lXHV693z2P-zZ7OyCqw-HCGufWZLHq98YXdaXIghVsx44A0XoKTCZZ4jXdv7UWG1ZltHHtoiNqCFJDlErCvlYKEN_/s1600/clive0.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxr85fHxwPqRlo8TG4-Jc-Q4q6kjgHaStHNtWq0xaf1aXJeuq0c8_lXHV693z2P-zZ7OyCqw-HCGufWZLHq98YXdaXIghVsx44A0XoKTCZZ4jXdv7UWG1ZltHHtoiNqCFJDlErCvlYKEN_/s200/clive0.jpg" width="200" /></a></div><span class="Apple-style-span" style="font-size: xx-small;">Today we'd like to go step-by-step through the process of "interpreting" one of <a href="http://www.blogger.com/profile/18058602884962010095">Rorschach Redemption's</a> ink blots. We'll use an old blot from <a href="http://rorschachredemption.blogspot.com/2010/12/inkblot-of-day-tuesday-transitions.html">December 21st last year</a> that we found particularly fun.<br />
So, staring at the blot, what's the first feature that strikes us?<br />
We see a figure in a suit in the middle of the image that dominates all the other things we can see. We have a picture of an "anon" suit from a <a href="http://vote-sanchez.blogspot.com/2010/12/born-too-soon-4-friedrich-nietzsche.html">post about Nietzsche</a> that's just right.</span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEca2l5jwUWauzbxJl9H60s-_5zt7VQnigSewwXjHDVGBGflgvHh_AEL3pD8_4PHAN98Q9rDFgPAaKkXWRCfij2CnD8GhAD7WY_X1sI_jVHScPqVH00F0PEEs1TCtfYssLnqyf_JV2SS9w/s1600/clive1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEca2l5jwUWauzbxJl9H60s-_5zt7VQnigSewwXjHDVGBGflgvHh_AEL3pD8_4PHAN98Q9rDFgPAaKkXWRCfij2CnD8GhAD7WY_X1sI_jVHScPqVH00F0PEEs1TCtfYssLnqyf_JV2SS9w/s200/clive1.jpg" width="200" /></a></div><span class="Apple-style-span" style="font-size: xx-small;">Okay, now we're suited up, what's the next most striking feature?<br />
Probably the scorpion/spider/crabs at the bottom left and right.<br />
Scorpions would be nice. Scorpions with penises for stings would be even nicer (psychoanalysts love genitalia).<br />
Hmm, can't find any of those but we do remember seeing a spider with tits in one of <a href="http://www.worldofdante.org/gallery_dore.html">Doré's illustrations for Dante's Divine Comedy</a>.</span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHpKUSV0Ae2NLRiRDFaW1CkOzn7n1UZLXa0FxCUoC-WoZQ8ZtkhJt2UqZZQX8fOehzDyoYhoVtBjozRry2pt1qXeImQuMJ702-RdTDiz0Kv3YtoQBj4YKvsXMD12ldAw64ADW-ILloSnE6/s1600/clive2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHpKUSV0Ae2NLRiRDFaW1CkOzn7n1UZLXa0FxCUoC-WoZQ8ZtkhJt2UqZZQX8fOehzDyoYhoVtBjozRry2pt1qXeImQuMJ702-RdTDiz0Kv3YtoQBj4YKvsXMD12ldAw64ADW-ILloSnE6/s200/clive2.jpg" width="200" /></a></div><span class="Apple-style-span" style="font-size: xx-small;">Nice! What next?<br />
The figure appears to have cloven hooves. That's good - analysts like religious imagery almost as much as genitalia and goats are a little of both.<br />
We remembered seeing some silly cloven-hoofed boots as fetishistic accessories to a fashion shoot. A quick image search soon turned them up.</span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBLxkeDSeuw6ijjyRdtH6h8Fx1IXWCmmLTzfg15-n3f2YmQ5qwzn0S1Az3454yezwYdjZN4BssHD8goyCP00xi-aHlvh8OXl9rpXscp_dc_3rspRH9EOZZcGDB_dTSiPXdeD3ij2_ZNoxQ/s1600/clive3.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBLxkeDSeuw6ijjyRdtH6h8Fx1IXWCmmLTzfg15-n3f2YmQ5qwzn0S1Az3454yezwYdjZN4BssHD8goyCP00xi-aHlvh8OXl9rpXscp_dc_3rspRH9EOZZcGDB_dTSiPXdeD3ij2_ZNoxQ/s200/clive3.jpg" width="200" /></a></div><span class="Apple-style-span" style="font-size: xx-small;">Now, our figure needs a head.<br />
It looks a bit like Kif from Futurama but that's not going to mess with anybody's head. We need a narrow-headed figure with religious or sexual connotations. <a href="http://en.wikipedia.org/wiki/Guanyin">Guan Yin</a> should fit the bill - her depictions are often very attenuated. (We suspect it started out as a pragmatic solution to fitting a figure into an ivory tusk and then became part of her iconography.)</span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkR3iDvIjtVEZgEcNvI9Sm1CrMrFxS2M60veAh9n-5lNrWs998HrOqjm7Z48qjP8vtCVmUsetUFhZVKQiD54Ggambybv0M0oN9pBrtLQedyK2UrF7RErxBHrvRGXMUaMvziI2nGaUHcX2Q/s1600/clive4.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkR3iDvIjtVEZgEcNvI9Sm1CrMrFxS2M60veAh9n-5lNrWs998HrOqjm7Z48qjP8vtCVmUsetUFhZVKQiD54Ggambybv0M0oN9pBrtLQedyK2UrF7RErxBHrvRGXMUaMvziI2nGaUHcX2Q/s200/clive4.jpg" width="200" /></a></div><span class="Apple-style-span" style="font-size: xx-small;">There we go. Now what? Still no genitals: a snake will do.<br />
Fortunately there's a suitable snake-head like white space above the bodhisattva's head.</span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNJHT3GVhtUyvfFwFUkIOmU1sYh4Ecp2926GwkH4xIpi3rDNrJANwC-3aJewk6ustRzjjNsiSR-RnmweoyHfFUCbPp7IQPtleqmRwNlVTciGebClOPajDXGU0S6HDRkF385pBWsh16nWkP/s1600/clive5.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNJHT3GVhtUyvfFwFUkIOmU1sYh4Ecp2926GwkH4xIpi3rDNrJANwC-3aJewk6ustRzjjNsiSR-RnmweoyHfFUCbPp7IQPtleqmRwNlVTciGebClOPajDXGU0S6HDRkF385pBWsh16nWkP/s200/clive5.jpg" width="200" /></a></div><span class="Apple-style-span" style="font-size: xx-small;">We should probably have stopped here but having covered up all the other bits, we're left with a pair of bushy-browed eyes and a Freddie Mercury mustache. We thought of putting Nietzsche's face in the background but we can't think of any head on pictures of him (he was probably cross-eyed).<br />
Who else do we know with a gay clone look?</span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm0YdtPTgOrA09CK6L8AwwNOE8vXXj7qTEqxxXhHKf7TtksXQPNvLk4JfO-BwCgnKzYT2HAzAFneXqSU0tcHMMwf3safIea1Ho7E0C0HLzWr0m4zzqgspSGuldGWmVcxqRkHGy9WCE9UzP/s1600/clive6a.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm0YdtPTgOrA09CK6L8AwwNOE8vXXj7qTEqxxXhHKf7TtksXQPNvLk4JfO-BwCgnKzYT2HAzAFneXqSU0tcHMMwf3safIea1Ho7E0C0HLzWr0m4zzqgspSGuldGWmVcxqRkHGy9WCE9UzP/s200/clive6a.jpg" width="200" /></a></div><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj4dqyXSUJ-n9PKHDCYxprTBJX5HIL4mLmNuxF5LIcqFxyrm4_GIHKNpbnhGHcQ3ysx35aW5UDVAxnro07qcdCwAz-5s1fy08QGwzjZ-C-z8yeeDOmM9QwRcPvrNfkWSjI1stKYXwnXpob/s1600/RR1.jpg" /><span class="Apple-style-span" style="font-size: xx-small;"><br />
Let's mess with RR's head a little and use his old profile picture.<br />
(Perhaps he changed it after trolling the onanomaniacs at Omegle a little too hard.)</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMs8haKb2KbRfyj3NetJHHNc9mXgIQV-DWao7lPih69h0npKcN8HvLGavFDUUpd1Ytj8GmHZEkPCb8uK-wJ9U9w6m6O5vmXcQOSpkKkmFTYz6MjM8PlB2iUCVbiy_0FxpjQP9FOoxkaH6a/s1600/clive6.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMs8haKb2KbRfyj3NetJHHNc9mXgIQV-DWao7lPih69h0npKcN8HvLGavFDUUpd1Ytj8GmHZEkPCb8uK-wJ9U9w6m6O5vmXcQOSpkKkmFTYz6MjM8PlB2iUCVbiy_0FxpjQP9FOoxkaH6a/s200/clive6.jpg" width="200" /></a></div><span class="Apple-style-span" style="font-size: xx-small;">...Maybe not - only his Mother would recognize her little boy under all that junk.<br />
How about cat's eyes?</span><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigV7HZK6dMCB61mYubtwASvzN6RRZvZEiAvF-LvN1FdVzQg4b1Fp9UFZqbLeIF3squ5uDOBXJLQ4oHicYTnutdsZ3AAYFhQRBfN_GWMaKQ6LPPKmGLLap07p9B3tAsQYNujBcnBnVVgwao//" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigV7HZK6dMCB61mYubtwASvzN6RRZvZEiAvF-LvN1FdVzQg4b1Fp9UFZqbLeIF3squ5uDOBXJLQ4oHicYTnutdsZ3AAYFhQRBfN_GWMaKQ6LPPKmGLLap07p9B3tAsQYNujBcnBnVVgwao//" width="320" /></a></div><div style="text-align: center;"><i>Let's go with this fellow instead.</i></div><br />
<span class="Apple-style-span" style="font-size: xx-small;">Okay, that'll do. Now we just need a pretentious name with a pun and/or <i>double entendre</i>.</span><br />
<span class="Apple-style-span" style="font-size: xx-small;">Maybe a quote from the movie with Freudian overtones? How about <i>"You know, you remind me of my father"</i>? (Suciô fell asleep half way through the movie so we're struggling a little here.) <a href="http://www.imdb.com/title/tt0468569/quotes">imdb.com</a> to the rescue: let's go with</span><br />
<br />
<div style="text-align: center;"><i>"Never start with the head, the victim gets all fuzzy"</i>.</div>Suciô Sanchezhttp://www.blogger.com/profile/12365362145664625757noreply@blogger.com37