using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
ConsoleTitle();
Greeting();
}
static void Greeting()
{
string strHello = "\u0048\u0065\u006C\u006C\u006f\n";
// Unicode of Hello
string strWorld = "\x77\x6F\x72\x6c\x64\x21\b";
// Hexidecimal of world
Console.Write("{0}", strHello);
Console.Write("{0}", strWorld);
Console.ReadLine();
}
static void ConsoleTitle()
{
string strTitle = "Hello(Unicode) World(Hexidecimal) v0.01";
Console.Title = strTitle;
}
}
}
Visual c# 2008 Hello (Unicode) World (Hexidecimal)...
Java Centimeters to Inches Calc...
As before here is the Java version of the Centimeters to Inches calculator.
[ Main.java ]
public class Main
{
public static void main(String[] args)
{
GetUserInput.GetInput();
}
}
[ GetUserInput.java ]
import java.util.*;
public class GetUserInput
{
 static void GetInput()
{
String strUserInput;
Scanner in = new Scanner(System.in);
System.out.print("Enter Centimeters: ");
strUserInput = in.nextLine();
in.close();
ConvertUserInput.ConvertInput(strUserInput);
}
}
[ ConvertUserInput.java ]
public class ConvertUserInput
{
static void ConvertInput(String s)
{
double d;
d = Double.parseDouble(s);
PerformCalculation.Calculate(d);
}
}
[ PerformCalculation.java ]
public class PerformCalculation
{
static void Calculate(double i)
{
double cm = 0.393700787;
double total;
total = (i * cm);
DisplayResults.Results(total);
}
}
[ DisplayResults.java ]
public class DisplayResults
{
static void Results(double r)
{
System.out.println("total Inches: " + r);
}
}
Visual c# 2008 Centimeters to Inches Calc...
My spouse needed to figure out what 83 cm equaled in inches. I know the formula, so I could have easily written this out by hand...but why? I also know that I could have written this using one file...but why? This is another example of how to separate methods into separate class files.
Well 1 inch = 0.393700787 centimeters, so 83 * 0.393700787 = 32.677165321 inches!
[ Program.cs ]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CM2IN
{
class Cent2Inches
{
static void Main(string[] args)
{
SetConsoleTitle.ConsoleTitle();
GetUserInput.UserInput();
}
}
}
[ SetConsoleTitle.cs ]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CM2IN
{
class SetConsoleTitle
{
public static void ConsoleTitle()
{
string strTitle = "Centimeter to Inches Calculator v1.0";
// Set Console Title
Console.Title = strTitle;
}
}
}
[ GetUserInput.cs ]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CM2IN
{
class GetUserInput
{
public static void UserInput()
{
string strUserInput;
Console.Write("Enter Centimeters: ");
// Prompt for user input
strUserInput = Console.ReadLine(); // Read user input
ConvertUserInput.ConvertInput(strUserInput);
// Pass user input to Convert Class
}
}
}
[ ConvertUserInput.cs ]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CM2IN
{
class ConvertUserInput
{
public static void ConvertInput(string s)
{
double d;
d = Convert.ToDouble(s); // Convert string to double
PerformCalculation.Calculate(d);
// Pass double value to Calculation Class
}
}
}
[ PerformCalculation.cs ]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CM2IN
{
class PerformCalculation
{
public static void Calculate(double i)
{
double cm = 0.393700787;
double total;
total = (i * cm); // Perform Calculation
DisplayResults.Results(total);
// Pass Results to Display results Class
}
}
}
[ DisplayResults.cs ]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CM2IN
{
class DisplayResults
{
public static void Results(double r)
{
Console.WriteLine("Total Inches: " + r); // Print results
Console.ReadLine();
Console.Clear();
}
}
}
Visual c# 2008 Hello User 1.2 Console App...
I decided to split up the code into two files to illustrate how to call a separate class. It is overkill for such a simple application, but it is an example!
[ Program.cs ]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloUser
{
class Program
{
public static void GetUserInput()
{
string strInput;
Console.Write("Enter your first name: ");
strInput = Console.ReadLine();
Console.WriteLine("Hello " + strInput);
Console.ReadLine();
}
public static void SetGreeting()
{
string strTitle = "Hello User 1.2";
Console.Title = strTitle;
}
}
}
[ AppTest.cs ]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloUser
{
class AppTest
{
static void Main(string[] args)
{
Program.GetUserInput();
Program.SetGreeting();
}
}
}
Hello User Java Edition Console App...
import java.util.*;
public class HelloUser
{
public static void main(String[] args)
{
GetUserInput();
}
private static void GetUserInput()
{
String strInput;
Scanner in = new Scanner(System.in);
System.out.println("Enter your first name: ");
strInput = in.nextLine();
in.close();
System.out.println("Hello " + strInput);
}
}
Hello World Java Edition Console App..
As you can see the syntax is similar to that of C#
public class HelloWorld
{
public static void main(String[] args)
{
Greeting();
}
private static void Greeting()
{
System.out.println("Hello world!");
}
}
Visual c# 2008 Hello User 1.1 Console App...
This is a much better approach of writing Hello User. It does require a few more lines of code, but it is better for modularity purposes. It is not a good practice to write everything in the Main method as I did in the previous examples.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloUser
{
class Program
{
static void Main(string[] args)
{
SetConsoleTitle();
GetUserInput();
}
static void GetUserInput()
{
string strInput;
Console.Write("Enter your first name: ");
strInput = Console.ReadLine();
Console.WriteLine("Hello " + strInput);
Console.ReadLine();
}
static void SetConsoleTitle()
{
string strTitle = "Hello User 1.1";
Console.Title = strTitle;
}
}
}
Prompt for input
Write to screen
SQL (70-431) Question of the week...Q3
You are the database administrator for a shipping company named Cargoflow. You are asked to create a database for the company's marketing department for trend analysis of shipments. This database will be bulk loaded with information from a data warehouse when it is first created. Data will be analyzed but not modified in any way. You are trying to decide on an appropriate recovery model for the database. Which recovery model should you implement for this new database? Choose the best option(s) from those listed below.
a) Full recovery
b) Bulk-logged recovery
c) Simple recovery
d) Warehouse recovery
Self Evaluation:
Compare your answer to the explanation and correct option(s) provided below.
Explanation:
The simple recovery model is the most appropriate recovery model to use in this scenario. Since the data in the database will never change, point-of-failure recovery is not necessary. This means that data in the transaction log is not critical to recovering the database and does not necessitate being backed up. The simple recovery model relies strictly on full and differential backups of the database to recover.
Correct Option(s):
c) Simple recovery
Incorrect Option(s):
a) Full recovery - The full recovery model is inappropriate in this scenario due to the unnecessary administrative overhead associated with transaction log backups.
b) Bulk-logged recovery - The bulk-logged recovery model is inappropriate in this scenario due to the unnecessary administrative overhead associated with transaction log backups.
d) Warehouse recovery - SQL Server 2005 does not support a warehouse recovery model.
Questions Provided by SkillSoft
Visual c# 2008 Hello User Console App...
The HelloWorld app showed you how to make a simple app that uses static data. Here is an app that prompts for user input. Same concept just a few more lines!
// Directive
using System;
using System.Collections.Generic;
using System.Linq; // Remove if being used in Visual C# 2005
using System.Text;
namespace HelloUser
{
class Program
{
// Main Method
static void Main(string[] args)
{
// Data Members
string strTitle = "Hello User 1.0"; // Set string value
string strInput; // Declare variable
Console.Title = strTitle; // Set console title
Console.Write("Enter your first name: "); // Prompt for input
strInput = Console.ReadLine(); // Read user input
Console.WriteLine("Hello " + strInput); // Write line of text
Console.ReadLine(); // Read line of text
}
}
}
Visual c# 2008 Hello World Console App...
I figured I would post a simple Hello World Console Application built with Visual C# 2008. So here we go.
// Directive
using System;
using System.Collections.Generic;
using System.Linq; // Remove if being used in Visual C# 2005
using System.Text;
namespace HelloWorld
{
class Program
{
// Main Method
static void Main(string[] args)
{
// Data Members
string strOutput = "Hello World"; // Set string value
Console.Title = strOutput; // Set console title
Console.WriteLine(strOutput); // Write line of text
Console.ReadLine(); // Read line of text
}
}
}
SQL (70-431) Question of the week...Q2
You are creating a new SQL Server 2005 database for Brocadero's sales department. To ensure maximum availability and reliability you decide to implement the database across multiple data files. When creating the data files you want to follow Microsoft's recommended best practices for naming. How should the primary and secondary data files be named? Choose the best option(s) from those listed below.
a) The primary data file should have an .mdf extension.
b) The primary data file should have an .ndf extension.
c) The secondary data file should have an .mdf extension.
d) The secondary data file should have an .ndf extension.
Self Evaluation:
Compare your answer to the explanation and correct option(s) provided below.
Explanation:
Microsoft's recommended best practices state that a heavily used database should store the database catalog in a primary data file and all data and objects in secondary data files for the best performance, availability, and reliability. Microsoft recommends that primary data files use the .mdf file extension, while secondary data files should use the .ndf extension.
Correct Option(s):
a) The primary data file should have an .mdf extension.
d) The secondary data file should have an .ndf extension.
Incorrect Option(s):
b) The primary data file should have an .ndf extension - Primary data files should use the .mdf extension.
c) The secondary data file should have an .mdf extension - Secondary data files should use the .ndf extension.
Questions Provided by SkillSoft
The Heineken BeerTender...
Simple trivia...If we have ever hung out then you know that I on occasion will indulge with an icy cold bottle of what imported beverage? The answer is simple an icy cold bottle of Heineken. I have never been partial to canned beer, but that doesn't mean I haven't consumed a canned beer before. I just so happen to prefer the taste of bottled beer over canned. Since Heineken has teamed up with Krups appliances to produce, wait for it...tada The Heineken BeerTender. Now I can enjoy draught beer not only in the convenience and safety of my own home, but in my unmentionables no less. That was for those who needed a visual! The BeerTender is conveniently equipped with four components, but two of them I think go hand in hand.
1. Volume indicator which monitors the level or beef left. 2. A freshness indicator with a 30 day countdown. 3. Temperature control with three presets: 36, 39 & 42 degrees. 4. Ready to drink indicator which shows the actual temperature of the DraughtKeg and most importantly it also lets you know when the beer is ready to be enjoyed!
The BeerTender is designed for the Heineken DraughtKeg which holds 1.33 gallons of Heineken or Heineken Premium Light. That is equivalent to (20) eight ounce glasses, (14) 12 ounce glasses or 10 refreshing pints. The DraughtKeg roughly sits at 11 inches tall by 6.8 inches wide with a circumference of 21.6 inches and weighs approximately 12.1 lbs.
The BeerTender was first introduced to the USA in March of 2008 despite the fact it has been released to other countries nearly four years ago, but who's counting. So far the prices range from $249 to $325. Like other items in time the price will drop or a sale will spring up brining this little piece of heaven down to a more attractive price range. Hey what can I say...I am a bargain shopper! If I can get this "must have" kitchen appliance for $150 or less then believe me I am going for it. Until then there is not a chance unless one of my close friends or family members decides to give it to me as a gift. Hint! Hint!
So in the mean time I will continue to enjoy my Heineken in the dark green bottles that I have already grown to know and love. Remember know your limits and please drink responsibly!
My New mini MP3 Player...
The Sansa™ Clip is a compact MP3 player that boasts big sound and comes loaded with useful features, including a clip for wearing, FM radio, recorder and a large bright, four-line screen. The Sansa Clip’s solid state flash memory allows for skip-free playback of music, making it a perfect music player for the gym-goer, runner, walker or traveler. Overall everything you need for a great digital music and audio book experience is found in the Sansa Clip.
I bought it online at Buy.com [Link] for $49.99 + $5.49 2nd Day Shipping...not to shabby!
Feature List
- 4GB solid state flash memory
- Plays MP3, WMA, secure WMA and Audible audio file formats
- FM tuner with 40 preset channels
- Up to 15 hours of play time with internal rechargeable battery
- Voice recording with built-in microphone
- Holds 1000 MP3 for 60 hours of playback
- Holds 2000 WMA for 128 hours of playback
Minimum System Requirements
- Windows® XP SP2 or Vista® Operating System
- Windows Media Player® 10 or 11
- CD-ROM drive
- High-Speed USB 2.0 port required for hi-speed transfer
Package Contents
- Sansa® Clip MP3 player: 4GB, Silver
- Clip accessory
- USB 2.0 transfer cable
- Earphones
- Promotional Inserts
- Quick Start Guide
- Installation CD with user guide
More Pictures
[Part No. SDMX11R-004GS-A70]
Some accessories
The i.Sound 4x Foldable Portable Speakers. It uses a standard head phone jack so it works with other MP3 Players, not just IPODS. It is simple and in a small form factor which works for my needs. Probably not intended for the true music enthusiast who demands high quality sound. I only paid $20 so it not a serious bumping setup.
C'mon I just got into the whole MP3 world so I am getting into the water one step at a time. I am looking to use it for my learning audio media, you know for languages, test preps and so on. In some cases for music too.
SQL (70-431) Question of the week...Q1
You are the SQL Server administrator for your company. You have been assigned the task of installing Microsoft SQL Server 2005 Enterprise Edition on an existing server. This server has a 600 MHz Pentium III processor, 256 MB of RAM, 10 GB hard disk and Microsoft Windows 2000 Server with Service Pack 1 installed. All of the components installed are upgradeable if required. What components must you upgrade before installing SQL Server 2005 on this server? Choose the best option(s) from those listed below.
a) Processor
b) RAM
c) Hard disk
d) Operating System
Self Evaluation:
Compare your answer to the explanation and correct option(s) provided below.
Explanation:
Before installing SQL Server 2005 Enterprise Edition on the server, you would need to upgrade to 512 MB of RAM and install Service Pack 4 or later just to meet the minimum system requirements. Microsoft recommends the following system requirements for a 32 bit system:
Processor - 600 MHz Pentium III-compatible or faster processor; 1 GHz or faster processor recommended
Operating System - Microsoft Windows 2000 Server with Service Pack (SP) 4 or later; Windows Server 2003 Standard Edition, Enterprise Edition, or Datacenter Edition with SP 1 or later; Windows Small Business Server 2003 with SP 1 or later
Memory - 512 MB of RAM or more; 1 GB or more recommended
Hard Disk - Approximately 350 MB of available hard-disk space for the recommended installation
Correct Option(s):
b) RAM
d) Operating System
Incorrect Option(s):
a) Processor - The minimum requirement for a processor is a 600 MHz Pentium III-compatible; therefore, the processor in this scenario meets the minimum requirements.
c) Hard disk - The minimum requirement for a hard disk is approximately 350 MB of available hard-disk space; therefore, the available hard disk space in this scenario exceeds requirements.
Questions Provided by SkillSoft
Happy Labor Day...
I hope you have a safe and festive Labor Day! I know the picture is a little fuzzy, but we are experimenting a bit...cooking them a little differently than usual. I will let you know how they taste. Mmmmmmmm....ribs!
Before...
After...