Wow!
I didn't have enough to study (ha!) so I started two courses on Udacity.com. We're working on regular expressions, a topic I have heard a lot about but never really learned before. Wow!! I don't want to waste any more time posting, so I'll get back to studying.
Wow!
Wednesday, April 18, 2012
Friday, April 13, 2012
The Wonders of Modern (?) Technology
I've already complained a bit about Wally, my ancient little G4 iBook with half the keys missing. It makes working on the projects on CodeYear more than a little challenging, so I decided today to try spending a little time on the site at our local libarary. My local library is absolutely awesome: great collection, great inter-library borrowing and holds system, tons of fairly good computers.
Computers that only run IE 8, which won't run CodeYear.
sigh...
Computers that only run IE 8, which won't run CodeYear.
sigh...
Tuesday, April 10, 2012
Friday, March 30, 2012
Intuitive(?) User Interfaces and Windows 8
According a recent article over at Ars Technica, the new "hot corners" design is so confusing to us ancient mouse-and-keyboard users (hang on, gotta get the phone, the tape on my answering machine is full) that a tutorial will automatically load the first time the OS is started.
How is that an intuitive UI?
How is that an intuitive UI?
I Did It!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Exercise_7_4
{
class Point
{
public int x;
public int y;
public Point(int x, int y)
{
this.x = x;
this.y = y;
}
public void DisplayPoint()
{
Console.WriteLine("In DisplayPoint()");
Console.WriteLine("Point at ({0},{1})", x, y);
}
}
class Square
{
Point topLeft;
Point topRight;
Point bottomLeft;
Point bottomRight;
public Square(Point startingPoint, int sideLength)
{
this.topLeft = new Point(startingPoint.x, startingPoint.y);
this.topRight = new Point(startingPoint.x + sideLength, startingPoint.y);
this.bottomLeft = new Point(startingPoint.x, startingPoint.y - sideLength);
this.bottomRight = new Point(startingPoint.x + sideLength, startingPoint.y - sideLength);
}
public void DisplaySquare()
{
Console.WriteLine("In DisplaySquare()");
topLeft.DisplayPoint();
topRight.DisplayPoint();
bottomLeft.DisplayPoint();
bottomRight.DisplayPoint();
}
}
class Program
{
static void Main(string[] args)
{
Point myPoint = new Point(3, 4);
myPoint.DisplayPoint();
Square mySquare = new Square(myPoint, 5);
mySquare.DisplaySquare();
//to keep console window open to view output
Console.ReadLine();
}
}
}
Output: (really basic, I know...)
In DisplayPoint()
Point at (3,4)
In DisplaySquare()
In DisplayPoint()
Point at (3,4)
In DisplayPoint()
Point at (8,4)
In DisplayPoint()
Point at (3, -1)
In DisplayPoint()
Point at (8, -1)
There are a ton of things I want to refactor (including the order in which the points are "drawn"), but I'm just so happy I got it! :D
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Exercise_7_4
{
class Point
{
public int x;
public int y;
public Point(int x, int y)
{
this.x = x;
this.y = y;
}
public void DisplayPoint()
{
Console.WriteLine("In DisplayPoint()");
Console.WriteLine("Point at ({0},{1})", x, y);
}
}
class Square
{
Point topLeft;
Point topRight;
Point bottomLeft;
Point bottomRight;
public Square(Point startingPoint, int sideLength)
{
this.topLeft = new Point(startingPoint.x, startingPoint.y);
this.topRight = new Point(startingPoint.x + sideLength, startingPoint.y);
this.bottomLeft = new Point(startingPoint.x, startingPoint.y - sideLength);
this.bottomRight = new Point(startingPoint.x + sideLength, startingPoint.y - sideLength);
}
public void DisplaySquare()
{
Console.WriteLine("In DisplaySquare()");
topLeft.DisplayPoint();
topRight.DisplayPoint();
bottomLeft.DisplayPoint();
bottomRight.DisplayPoint();
}
}
class Program
{
static void Main(string[] args)
{
Point myPoint = new Point(3, 4);
myPoint.DisplayPoint();
Square mySquare = new Square(myPoint, 5);
mySquare.DisplaySquare();
//to keep console window open to view output
Console.ReadLine();
}
}
}
Output: (really basic, I know...)
In DisplayPoint()
Point at (3,4)
In DisplaySquare()
In DisplayPoint()
Point at (3,4)
In DisplayPoint()
Point at (8,4)
In DisplayPoint()
Point at (3, -1)
In DisplayPoint()
Point at (8, -1)
There are a ton of things I want to refactor (including the order in which the points are "drawn"), but I'm just so happy I got it! :D
Oh, What's the Point?
Ha, ha, I made a punny.
No, it doesn't work yet, but I'm still at it. Now I have to finish it or my failure will be forever entombed in internet archives...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Exercise_7_4
{
class Point
{
public int x;
public int y;
public Point(int x, int y)
{
this.x = x;
this.y = y;
}
public void DisplayPoint()
{
Console.WriteLine("Point at ({0},{1})", x, y);
}
}
class Square
{
Point topLeft;
Point topRight;
Point bottomLeft;
Point bottomRight;
public Square(Point startingPoint, int sideLength)
{
this.topLeft.x = startingPoint.x;
this.topLeft.y = startingPoint.y;
this.topRight.x = startingPoint.x + sideLength;
this.topRight.y = startingPoint.y;
this.bottomLeft.x = startingPoint.x;
this.bottomLeft.y = startingPoint.y - sideLength;
this.bottomRight.x = startingPoint.x + sideLength;
this.bottomRight.y = startingPoint.y - sideLength;
}
public void DisplaySquare()
{
Console.WriteLine("I don't know what to put in DisplaySquare yet.");
}
}
class Program
{
static void Main(string[] args)
{
Point myPoint = new Point(3, 4);
myPoint.DisplayPoint();
Square mySquare = new Square(myPoint, 5);
mySquare.DisplaySquare();
//to keep console window open to view output
Console.ReadLine();
}
}
}
Still trying... :)
No, it doesn't work yet, but I'm still at it. Now I have to finish it or my failure will be forever entombed in internet archives...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Exercise_7_4
{
class Point
{
public int x;
public int y;
public Point(int x, int y)
{
this.x = x;
this.y = y;
}
public void DisplayPoint()
{
Console.WriteLine("Point at ({0},{1})", x, y);
}
}
class Square
{
Point topLeft;
Point topRight;
Point bottomLeft;
Point bottomRight;
public Square(Point startingPoint, int sideLength)
{
this.topLeft.x = startingPoint.x;
this.topLeft.y = startingPoint.y;
this.topRight.x = startingPoint.x + sideLength;
this.topRight.y = startingPoint.y;
this.bottomLeft.x = startingPoint.x;
this.bottomLeft.y = startingPoint.y - sideLength;
this.bottomRight.x = startingPoint.x + sideLength;
this.bottomRight.y = startingPoint.y - sideLength;
}
public void DisplaySquare()
{
Console.WriteLine("I don't know what to put in DisplaySquare yet.");
}
}
class Program
{
static void Main(string[] args)
{
Point myPoint = new Point(3, 4);
myPoint.DisplayPoint();
Square mySquare = new Square(myPoint, 5);
mySquare.DisplaySquare();
//to keep console window open to view output
Console.ReadLine();
}
}
}
Still trying... :)
Thursday, March 29, 2012
Keeping Myself On Task
It's embarrassing and corny, but I'm going to start posting all of my excercises from Liberty's C# book on my blog. CodeYear has built-in nags and bells that keep you working on the exercises, and I can access the site from Wally. It's been too easy to use the excuse that it's hard to book time on the "big" computer (which can run Visual Studio) and simply read and make notes for C#.
Without further ado (because writing a clever post would be just one more thing to delay me), here is what I'm working on right now:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Exercise_7_2
{
class Math
{
public static void Add(int num1, int num2)
{
Console.WriteLine("{0} + {1} = {2}", num1, num2, num1 + num2);
}
public static void Subtract(int num1, int num2)
{
Console.WriteLine("{0} - {1} = {2}", num1, num2, num1 - num2);
}
public static void Multiply(int num1, int num2)
{
Console.WriteLine("{0} X {1} = {2}", num1, num2, num1 * num2);
}
public static void Divide(int num1, int num2)
{
Console.WriteLine("{0} / {1} = {2}", num1, num2, num1 / num2);
}
}
class Program
{
static void Main(string[] args)
{
Math.Add(1, 2);
Math.Subtract(3, 2);
Math.Multiply(3, 5);
Math.Divide(81, 9);
// to keep the little console window open :)
Console.Read();
}
}
}
edited to show slight change in code...
Without further ado (because writing a clever post would be just one more thing to delay me), here is what I'm working on right now:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Exercise_7_2
{
class Math
{
public static void Add(int num1, int num2)
{
Console.WriteLine("{0} + {1} = {2}", num1, num2, num1 + num2);
}
public static void Subtract(int num1, int num2)
{
Console.WriteLine("{0} - {1} = {2}", num1, num2, num1 - num2);
}
public static void Multiply(int num1, int num2)
{
Console.WriteLine("{0} X {1} = {2}", num1, num2, num1 * num2);
}
public static void Divide(int num1, int num2)
{
Console.WriteLine("{0} / {1} = {2}", num1, num2, num1 / num2);
}
}
class Program
{
static void Main(string[] args)
{
Math.Add(1, 2);
Math.Subtract(3, 2);
Math.Multiply(3, 5);
Math.Divide(81, 9);
// to keep the little console window open :)
Console.Read();
}
}
}
edited to show slight change in code...
Subscribe to:
Posts (Atom)