Thursday, October 15, 2009

Java Tutorial for Absolute Beginners

(I want to give programming newbies an introduction to Java, but in a way that they can do it independently such that the tools won't get in the way (eg. 'javac' to compile, 'java' to run, avoiding classpath issues, and so on). I think the best fit is to have them use Eclipse (or another Java IDE), which will allow them to get to the code quickly; hopefully the IDE won't distract them. Unfortunately, I cannot find any existing tutorials that fit the bill, so here's a set of instructions that I hope will work better.)

  1. Complete steps 1-4 of the Eclipse Java IDE tutorial. I assume you will be able to find and install Java and Eclipse (which are installed separately); when you choose a Java or Eclipse download, just choose a "Java" version... there's no need for anything fancy like "Java EE".
  2. Jump into "Part 2: The Syntax" of Brewing Java: A Tutorial, but stop when you get to "Command Line Arguments".
  3. In Eclipse, try to run the "Command Line Arguments" example, but realize that you'll get an error.

    In order to supply run-time data to your program, you'll have to add an argument to run it: right-click on your program and select "Run As...", but then instead of "Java Application" choose "Run...", then click on the "Arguments" tab and fill in something (like your name) and click "Apply".

    Now "Run" your program and you should get some good output.
  4. Now you can continue with Brewing Java: A Tutorial. If you get this far, you should be able to do the rest of any other tutorial out there.
Good luck!

Sunday, October 4, 2009

Rubik's Cube Cheat Sheet

I finally sat down and followed instructions to solve a Rubik's Cube. I used Dan Brown's videos, and here is my summary of the instructions... useful for reference until I have them memorized.

(F=turn front side clockwise / U=up side / D=down side / L=left / R=right, with cc=counter-clockwise)

1) Goal: Top Cross
Move one into correct spot. If flipped, put in front then:
Fcc U Lcc Ucc

2) Top Corners
Get one in or under spot, then:
Rcc Dcc R D

Now put the solved side on the bottom.

3 & 4) Middle Edges
Find one not matching now-top color, move by matching side color, then..
... if going left:
Ucc Lcc U L U F Ucc Fcc
... if going right:
U R Ucc Rcc Ucc Fcc U F

5) Cross
If "L" then put back-left, if line then put horizontally, then:
F R U Rcc Ucc Fcc

6) Match Edge Sides
Put one that matches side colors in back and the other to right or front, then:
R U Rcc U R U U Rcc

7) All Upper Edges in Correct Spots, Possibly Turned
If any in correct spot, put in front-right, then:
U R Ucc Lcc U Rcc Ucc L

8) Corners
Put any unsolved in front-right, then:
Rcc Dcc R D ... and maybe repeat until just that one is correct (even if the rest of the cube is messed up)
... and then Ucc and repeat for each unsolved upper corner