<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:access="http://www.bloglines.com/about/specs/fac-1.0">
<access:restriction relationship="allow" />
<channel>
<title>Oh, pshaw!</title>
<link>http://pshaw.pbwiki.com/</link>
<description>A wiki for my personal source code.</description>
<language>en</language>
<image>
 <url>http://pshaw.pbwiki.com/feedlogo.gif</url>
 <title>PBwiki</title>
 <link>http://pbwiki.com/</link>
</image>
<generator>PBwiki 1.3.8</generator>
<webMaster>support@pbwiki.com</webMaster>
 <item>
  <title>cs111_fall2008_september29</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008_september29</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/cs111_fall2008_september29">cs111_fall2008_september29</a></h3>
<span style="font-weight:bold;color:green;background-color:#cfc;">Answer any questions the students have regarding the homework assignment.</span><br />Review from last class<br />Max and Min of 3 numbers<br />Boolean<br />Boolean.parseBoolean(String s) Note: only evaluates true when string is &quot;true&quot;<br /><span style="font-weight:bold;color:green;background-color:#cfc;">The most useful feature of the Wrapper classes is that most of them have the ability to convert numbers found in Strings into a primitive data structure (like int).<br />This allows us to essentially to read everything in as a String data type and convert it to a number later. In the next section, we will see an example where we are forced to use this.<br />String some_text = &quot;42&quot;; int answer = Integer.parseInt(some_text); // &quot;42&quot; is converted to the numerical 42. String some_value = &quot;3.1415&quot;; double pi = Double.parseDouble(some_value); // &quot;3.1415&quot; is converted to the floating point value 3.1415<br />The Wrapper classes can also store values, just like the primitive data types.<br />Integer a = 10;<br />To be perfectly honest, I never</span>]]></description>
  <pubDate>Mon, 29 Sep 2008 09:51:11 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>cs111_fall2008_september29</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008_september29</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/cs111_fall2008_september29">cs111_fall2008_september29</a></h3>
System.out.println(&quot;The smallest value is&quot;+Math.min(Math.min(a,b),c));<br />System.out.println(&quot;The largest value is&quot;+Math.max(Math.max(a,b),c));<br /><span style="color:red;background-color:#fcc;">&amp;lt;verbatim&amp;gt;<br />!! Powers</span><span style="font-weight:bold;color:green;background-color:#cfc;">Powers</span> of<span style="color:red;background-color:#fcc;"> 2<br />&amp;lt;verbatim&amp;gt;</span><span style="font-weight:bold;color:green;background-color:#cfc;"> 2</span><br />System.out.println(Math.pow(2,0)); // 1.0<br />System.out.println(Math.pow(2,1)); // 2.0<br />]]></description>
  <pubDate>Mon, 29 Sep 2008 09:22:08 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>cs111_fall2008_september29</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008_september29</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/cs111_fall2008_september29">cs111_fall2008_september29</a></h3>
Boolean<br />Boolean.parseBoolean(String s) Note: only evaluates true when string is &quot;true&quot;<br /><span style="font-weight:bold;color:green;background-color:#cfc;">Dialog Boxes<br />Requires you have this line:<br />import javax.swing.JOptionPane;<br />String JOptionPane.showInputDialog(null, String message);</span><br />]]></description>
  <pubDate>Mon, 29 Sep 2008 01:18:20 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>cs111_fall2008_september29</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008_september29</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw added <a href="http://pshaw.pbwiki.com/cs111_fall2008_september29">cs111_fall2008_september29</a></h3>
<toc><br />
<br />
! Review from last class<br />
<br />
!! Max and Min of 3 numbers<br />
<br />
  <verbatim><br />
  double a, b, c;<br />
<br />
  System.out.print(\"A=\");<br />
  a = scan.nextDouble();<br />
<br />
  System.out.print(\"B=\");<br />
  b = scan.nextDouble();<br />
<br />
  System.out.print(\"C=\");<br />
  c = scan.nextDouble();<br />
<br />
  System.out.println(\"The smallest value is\"+Math.min(Math.min(a,b),c));<br />
  System.out.println(\"The largest value is\"+Math.max(Math.max(a,b),c));<br />
  </verbatim><verbatim><br />
<br />
!! Powers of 2<br />
<br />
  </verbatim><verbatim><br />
  System.out.println(Math.pow(2,0)); // 1.0<br />
  System.out.println(Math.pow(2,1)); // 2.0<br />
  System.out.println(Math.pow(2,2)); // 4.0<br />
  System.out.println(Math.pow(2,3)); // 8.0<br />
  System.out.println(Math.pow(2,4)); // 16.0<br />
  System.out.println(Math.pow(2,5)); // 32.0<br />
  System.out.println(Math.pow(2,6)); // 64.0<br />
  System.out.println(Math.pow(2,7)); // 128.0<br />
  </verbatim><br />
<br />
! Wrapper Classes<br />
<br />
Each of the eight primitive data types have what\'s called a \"Wrapper Class\". The names of these classes are identical to the names of their primi</toc>]]></description>
  <pubDate>Mon, 29 Sep 2008 01:15:39 +0000</pubDate>
  <category>add</category>
 </item>
 <item>
  <title>cs111_fall2008</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/cs111_fall2008">cs111_fall2008</a></h3>
cs111_fall2008_september22 - Fun with Random Numbers<br />cs111_fall2008_september24 - The Math Library<br /><span style="font-weight:bold;color:green;background-color:#cfc;">cs111_fall2008_september29 - Message Boxes and Wrapper Classes</span><br />]]></description>
  <pubDate>Mon, 29 Sep 2008 00:16:51 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>cs111_fall2008_september24</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008_september24</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/cs111_fall2008_september24">cs111_fall2008_september24</a></h3>
Object Field<br />You can tell it's an object because it begins with a lowercase letter and a field because there is no () after it<br /><span style="font-weight:bold;color:green;background-color:#cfc;">System<br />System controls the Input/Output operations and things related to your operating system. There are three items you need to remember:<br />System.in<br />Defines Keyboard Input<br />System.out<br />Defines Screen Output<br />System.exit(int number)<br />A method which abort your program. The number input should either be 0 (meaning a normal exit) or 1 (meaning an exit in response to an error<br />The Math Class<br />double<br />Math.E<br />Field which evaluates to 2.71828183<br />double<br />Math.PI<br />Field which evaluates to 3.14159265<br />double<br />Math.abs(double num)<br />Returns the absolute value of num<br />double<br />Math.long(double num)<br />Returns the natural logarithm of num<br />double<br />Math.min(double a, double b)<br />Returns either a or b, whichever is smaller<br />double<br />Math.max(double a, double b)<br />Returns either a or b, whichever is larger<br />double<br />Math.pow(double base,</span>]]></description>
  <pubDate>Sun, 28 Sep 2008 23:40:13 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>cs111_fall2008_september24</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008_september24</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw added <a href="http://pshaw.pbwiki.com/cs111_fall2008_september24">cs111_fall2008_september24</a></h3>
<toc><br />
<br />
\"Politics is applesauce\" -Will Rogers<br />
<br />
! Identifying Fields and Classes<br />
<br />
Classes always begin with an uppercase letter. Objects should always begin with a lowercase letter.<br />
<br />
|Example|Name|Description|<br />
|ClassName.method()|Class Method|You can tell it\'s a class because it begins with an uppercase letter and a method because it has the () after it|<br />
|object_name.method()|Object Method|You can tell it\'s an object because it begins with a lowercase letter and a method because it as () after it|<br />
|ClassName.field|Class Field|You can tell it\'s a class because it begins with an uppercase letter and a field because there is no () after it|<br />
|object_name.field|Object Field|You can tell it\'s an object because it begins with a lowercase letter and a field because there is no () after it|<br />
</toc>]]></description>
  <pubDate>Sun, 28 Sep 2008 21:54:40 +0000</pubDate>
  <category>add</category>
 </item>
 <item>
  <title>cs111_fall2008_september23</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008_september24</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw renamed cs111_fall2008_september23 <a href="/cs111_fall2008_september22">cs111_fall2008_september22</a></h3>
]]></description>
  <pubDate>Sun, 28 Sep 2008 21:49:30 +0000</pubDate>
  <category>mv</category>
 </item>
 <item>
  <title>cs111_fall2008</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/cs111_fall2008">cs111_fall2008</a></h3>
cs111_fall2008_september17 - Strings<br />cs111_fall2008_september19 - Number formatting and System.out.printf<br /><span style="color:red;background-color:#fcc;">cs111_fall2008_september23</span><span style="font-weight:bold;color:green;background-color:#cfc;">cs111_fall2008_september22</span> - Fun with Random<span style="color:red;background-color:#fcc;"> Numbers</span><span style="font-weight:bold;color:green;background-color:#cfc;"> Numbers<br />cs111_fall2008_september24 - The Math Library</span><br />]]></description>
  <pubDate>Sun, 28 Sep 2008 21:49:08 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>vim</title>
  <link>http://pshaw.pbwiki.com/vim</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/vim">vim</a></h3>
$<br />end of line<br /><span style="color:red;background-color:#fcc;">#G</span><span style="font-weight:bold;color:green;background-color:#cfc;">(number)G</span><br />Go<span style="color:red;background-color:#fcc;"> To Line Number.</span><span style="font-weight:bold;color:green;background-color:#cfc;"> to line (number).</span> (Leave off number for last line of file.)<br />Note: Prefix a cursor movement command with a number to repeat it. For example, 4j moves down 4 lines.<br />Starting Insert Mode<br />]]></description>
  <pubDate>Tue, 23 Sep 2008 08:32:29 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>cs111_fall2008_september23</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008_september23</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/cs111_fall2008_september23">cs111_fall2008_september23</a></h3>
Random random = new Random();<br />Here are the interesting methods.<br /> 1<span style="color:red;background-color:#fcc;"> random.next()</span><span style="font-weight:bold;color:green;background-color:#cfc;"> random.next(int bits)</span> - Generates a<span style="color:red;background-color:#fcc;"> 0 or a 1</span><span style="font-weight:bold;color:green;background-color:#cfc;"> random numbers of exactly 'bits' bits.</span><br />]]></description>
  <pubDate>Mon, 22 Sep 2008 01:28:09 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>cs111_fall2008_september23</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008_september23</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw added <a href="http://pshaw.pbwiki.com/cs111_fall2008_september23">cs111_fall2008_september23</a></h3>
<toc><br />
<br />
! Make corrections on homework assignment.<br />
<br />
DecimalFormatter will only format decimal numbers. It will not right justify text. Thank you. Printf will format decimals and right justify text. It is better. The book fails to mention Printf. I do not know why.<br />
<br />
! Determinism and Computers<br />
<br />
Philosophy classes often talk about determinism and nondeterminism.<br />
<br />
Determinism is the idea that everything has a prior cause. Even if the prior cause isn\'t exactly clear, it still had a prior cause.<br />
Indeterminism is the idea that not everything has a prior cause. Some things can be without cause.<br />
<br />
Philosophers like to debate this stuff because when it comes to people, these are complicated issues. When it comes to computers, they were built to be purely deterministic. Keep that in mind: Computers are deterministic.<br />
<br />
This is one of the reasons why most computer scientists believe that true artificial intelligence isn\'t possible: only an indeterministic mechanism can think for itself, and because compute</toc>]]></description>
  <pubDate>Mon, 22 Sep 2008 01:26:52 +0000</pubDate>
  <category>add</category>
 </item>
 <item>
  <title>cs111_fall2008</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/cs111_fall2008">cs111_fall2008</a></h3>
cs111_fall2008_september17 - Strings<br />cs111_fall2008_september19 - Number formatting and System.out.printf<br /><span style="color:red;background-color:#fcc;">cs111_fall2008_september29</span><span style="font-weight:bold;color:green;background-color:#cfc;">cs111_fall2008_september23</span> - Fun with Random Numbers<br />]]></description>
  <pubDate>Mon, 22 Sep 2008 00:29:00 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>vimrc</title>
  <link>http://pshaw.pbwiki.com/vimrc</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/vimrc">vimrc</a></h3>
filetype plugin on<br />autocmd FileType * set formatoptions=cqo<br /><span style="color:red;background-color:#fcc;">autocmd BufRead makefile, Makefile set noexpandtab</span><br />autocmd BufRead *.c,*.cpp,*.h,*.java,*.py,*.pl,*.rb,*.scala set autoindent nospell<br />&quot; I cannot spell these words.<br />]]></description>
  <pubDate>Sat, 20 Sep 2008 00:03:43 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>vimrc</title>
  <link>http://pshaw.pbwiki.com/vimrc</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/vimrc">vimrc</a></h3>
filetype plugin on<br />autocmd FileType * set formatoptions=cqo<br /><span style="font-weight:bold;color:green;background-color:#cfc;">autocmd BufRead makefile, Makefile set noexpandtab</span><br />autocmd BufRead *.c,*.cpp,*.h,*.java,*.py,*.pl,*.rb,*.scala set autoindent nospell<br />&quot; I cannot spell these words.<br />]]></description>
  <pubDate>Fri, 19 Sep 2008 23:58:53 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>vimrc</title>
  <link>http://pshaw.pbwiki.com/vimrc</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/vimrc">vimrc</a></h3>
autocmd FileType * set formatoptions=cqo<br />autocmd BufRead *.c,*.cpp,*.h,*.java,*.py,*.pl,*.rb,*.scala set autoindent nospell<br />&quot;<span style="color:red;background-color:#fcc;"> Common words that need correcting</span><span style="font-weight:bold;color:green;background-color:#cfc;"> I cannot spell these words.</span><br />ab  teh      the<br />ab  heigth   height<br />]]></description>
  <pubDate>Fri, 19 Sep 2008 23:57:43 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>vimrc</title>
  <link>http://pshaw.pbwiki.com/vimrc</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/vimrc">vimrc</a></h3>
set   tabstop=4<br />set   textwidth=0<br /><span style="color:red;background-color:#fcc;">syntax enable</span><span style="font-weight:bold;color:green;background-color:#cfc;">filetype plugin on</span><br />autocmd<span style="color:red;background-color:#fcc;"> BufRead *.c,*.cpp,*.h,*.java,*.py,*.pl,*.rb,*.scala</span><span style="font-weight:bold;color:green;background-color:#cfc;"> FileType *</span> set<span style="color:red;background-color:#fcc;"> autoindent</span><span style="font-weight:bold;color:green;background-color:#cfc;"> formatoptions=cqo</span><br />autocmd BufRead *.c,*.cpp,*.h,*.java,*.py,*.pl,*.rb,*.scala set<span style="font-weight:bold;color:green;background-color:#cfc;"> autoindent</span> nospell<br />&quot; Common words that need correcting<br />ab  teh      the<br />ab  seperate separate<br />ab  resturant restaurant<br />&quot;<span style="color:red;background-color:#fcc;"> REQUIRED. This makes vim invoke latex-suite</span><span style="font-weight:bold;color:green;background-color:#cfc;"> Turn off those annoying placeholders</span> when<span style="color:red;background-color:#fcc;"> you open a tex file.<br />filetype plugin on</span><span style="font-weight:bold;color:green;background-color:#cfc;"> editing LaTeX files<br />let g:Imap_UsePlaceHolders = 0</span><br />&quot; IMPORTANT: grep will sometimes skip displaying the file name if you<br />&quot; search in a singe file. This will confuse latex-suite. Set your grep<br />]]></description>
  <pubDate>Fri, 19 Sep 2008 23:54:31 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>cs111_fall2008</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/cs111_fall2008">cs111_fall2008</a></h3>
cs111_fall2008_september17 - Strings<br />cs111_fall2008_september19 - Number formatting and System.out.printf<br /><span style="font-weight:bold;color:green;background-color:#cfc;">cs111_fall2008_september29 - Fun with Random Numbers</span><br />]]></description>
  <pubDate>Fri, 19 Sep 2008 23:08:38 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>cs111_fall2008_september19</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008_september19</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/cs111_fall2008_september19">cs111_fall2008_september19</a></h3>
double bread = 3;<br />double oneThird = 1.0 / 3.0;<br /><span style="font-weight:bold;color:green;background-color:#cfc;">double expensive = 1000;</span><br />System.out.println(&quot;gum is &quot;+pricePattern.format(gum));<br />System.out.println(&quot;milk is &quot;+pricePattern.format(milk));<br />System.out.println(&quot;bread is &quot;+pricePattern.format(bread));<br />System.out.println(&quot;oneThird is &quot;+pricePattern.format(oneThird));<br /><span style="font-weight:bold;color:green;background-color:#cfc;">System.out.println(&quot;expensive is &quot;+pricePattern.format(expensive));</span><br />The three print statements in Java<br />System.out.println - Prints text and automatically adds a new line on the end<br />]]></description>
  <pubDate>Fri, 19 Sep 2008 01:34:35 +0000</pubDate>
  <category>mod</category>
 </item>
 <item>
  <title>cs111_fall2008_september19</title>
  <link>http://pshaw.pbwiki.com/cs111_fall2008_september19</link>
  <author>email.hidden@example.com (pshaw)</author>
  <description><![CDATA[<h3>pshaw edited <a href="http://pshaw.pbwiki.com/cs111_fall2008_september19">cs111_fall2008_september19</a></h3>
System.out.println(&quot;Pi is equal to &quot;+pi2decimal.format(Pi));<br />System.out.println(&quot;Pi is equal to &quot;+pi4decimal.format(Pi));<br /><span style="font-weight:bold;color:green;background-color:#cfc;">// Let's use it for prices:<br />DecimalFormat pricePattern = new DecimalFormat(&quot;$0.00&quot;);<br />double gum = .25;<br />double milk = 3.99;<br />double bread = 3;<br />double oneThird = 1.0 / 3.0;<br />System.out.println(&quot;gum is &quot;+pricePattern.format(gum));<br />System.out.println(&quot;milk is &quot;+pricePattern.format(milk));<br />System.out.println(&quot;bread is &quot;+pricePattern.format(bread));<br />System.out.println(&quot;oneThird is &quot;+pricePattern.format(oneThird));</span><br />The three print statements in Java<br />System.out.println - Prints text and automatically adds a new line on the end<br />]]></description>
  <pubDate>Fri, 19 Sep 2008 01:31:10 +0000</pubDate>
  <category>mod</category>
 </item>
</channel>
</rss>
