Stanford Classes on the Internet

October 26th, 2008 by comment Alex

Stanford Engineering Everywhere is a great thing.

Stanford Engineering Everywhere

Currently, there are 10 classes one may take online for free from Stanford. Now, these classes are not for credit but the material is given out for free. The classes range from Intro to Computer Science, Artificial Intelligence, and Electrical Engineering. The only class that requires no prerequisites is the Introduction to Computer Science class. This class introduces java, object oriented design and was designed to appeal to social scientists as well as computer scientist majors. The introduction to robotics class requires matrix algebra. The other classes usually require that you know some math and some programming already. Each class comes with lectures, video, assignments, and handouts.

This is just an amazing offering from Stanford. The content is protected under the Creative Commons License so content can be reused in non-commercial offerings.

This project is being funded by Sequoia Capital in Silicon Valley. Sequoia is a venture capital firm.

There is no communication between the professors and you as you are reading the material so you would need to find another outlet for questions on the material.

Lastly, they are thinking of putting more classes online depending on the success of this pilot program.

Wow. This is great.

ˆ Back to top

C#.NET Data Binding Basics

October 17th, 2007 by comment Alex

Binding data from windows controls to objects is easy in C#.NET.  Here is a basic introduction: 

Step one:

Create a class named Employee in C# and add a get property for each field you want to bind to a windows control.

public string getLastName {

      get { return mStrLastName; }

} 

Add a set property for any fields that you want two-way binding to occur. For example:

public string firstName {

      get { return mStrFirstName; }

      set { mStrFirstName = value; }

} 

Step two:

Add a form to your project and throw some controls on the form.  For this example, add a list box and a textbox. Also, create an array of objects that you want to bind to this list box.

arrayOfEmployees = new ArrayList();

arrayOfEmpoyees.Add(new Employee(”Doe”,”John”,”SoftwareEngineer”,”ServerTeam”));

arrayOfEmployees.Add(new Employee(”Smith”,”Jane”,”SoftwareEngieer”,”ClientTeam”));

Step three:

Bind the data from the object to the list box and textbox

listBoxLastName.DataSource = arrayOfEmployees;

listBoxLastName.DisplayMember = “getLastName”;

txtBoxForFirstName.DataBindings.Add(”Text”, arrayOfEmployees, “getFirstName”);

Step four:

Run the project and notice that the data is bound to the list box and the textbox. 

First, notice that the textbox is an example of two-way binding.  If a user changes the values in the textbox then the object is updated with a new first name.  To change this to one-way binding, just remove the set property from the object bound to the textbox.

Secondly, simple binding is done to controls like textboxes that only have one possible value.  Complex binding is done to controls like list boxes, that have multiple values to display at once. 

This example shows both simple and complex binding as well as one-way and two-way binding. More advanced data binding topics in C#.Net Visual Studio 2005 would cover the DataGridView class.

Cheers,

alex

ˆ Back to top