ovveride and virtual sample

July 29, 2008 – 10:22 am

using System;
using System.Collections.Generic;
using System.Text;

namespace CA
{
    class Program
    {
        class A
        {
            public virtual void WhoAreYou()
            {
                Console.WriteLine("I am an A");
            }
        }
        class B: A
        {
            public override void WhoAreYou()
            {
                Console.WriteLine("I am a B");
            }
        }
        class C : B
        {
            public new virtual void WhoAreYou()
            {
                Console.WriteLine("I am a C");
            }
        }
        class D : C
        {
            public override void WhoAreYou()
            {
                Console.WriteLine("I am a D");
            }
        }
        static void Main(string[] args)
        {
            C c = new D();
            c.WhoAreYou();
            A a = new D();
            a.WhoAreYou();
            Console.ReadLine();
        }        
    }

}


students.cs

July 23, 2008 – 11:08 am

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
class Student
{

public int x = 0;
public enum Course
{
IT,
IM,
CS,
IS,
Undefined
}
public enum Subject
{
Undefined,
System_Prog,
Software_Engr,
Discrete_Math,
IT_Fundamentals,
C_Prog
}

private string name;
private Course course;
private Subject[] s1 = new Subject[3];

public Student()
{
}

public Student(string name, Course course)
{
this.name = name;
this.course = course;
}

public string Name
{
get
{
return name;
}
set
{
name = value;
}
}

public Course _Course
{
get
{
return course;
}
set
{
course = value;
}
}

public void Enroll(Subject load)
{
if (s1[0] == Subject.Undefined)
{
s1[0] = load;
// Console.WriteLine(”Student can only enroll 3 subjects for this semester.”);
}
else if (s1[0] != Subject.Undefined && s1[1] == Subject.Undefined)
{
s1[1] = load;
// Console.WriteLine(”Student can only enroll 3 subjects for this semester.”);
}
else if (s1[0] != Subject.Undefined && s1[2] == Subject.Undefined)
{
s1[2] = load;
// Console.WriteLine(”Student can only enroll 3 subjects for this semester.”);
}
else
{
Console.WriteLine(”Student can only enroll 3 subjects for this semester.”);

}
}

public void Modify(Subject a, Subject b)
{
for (int x = 0; x < 3; x++)
{
if (b == s1[x])
{
Console.WriteLine(”Student can only enroll 3 subjects for this semester.”);
}
}

}

public void ShowOutput()
{

Console.WriteLine(”Name: ” + name + “Course: ” + course + ” Subject: “);
if (s1[0] == Subject.Undefined)
{
Console.Write(” “);
}
else
{
Console.Write(s1[0]);
}

if (s1[1] == Subject.Undefined)
{
Console.Write(” “);
}
else
{
Console.Write(s1[1]);
}

if (s1[2] == Subject.Undefined)
{
Console.Write(” “);
}
else
{
Console.Write(s1[2]);
}

Console.WriteLine();

//else if (s1[1] == Subject.Undefined)
//{
// Console.Write(” “);
//}
// Console.WriteLine(”Name: ” + name + “Course: ” + course + ” Subject: ” +s1[0]+s1[1]+s1[2]);

// //else
// //{
// // Console.Write(s1[c]);
// //}
////for (int c = 0; c < 3; c++)
//// {
//// if (s1[c] != Subject.Undefined)
//// {
//// Console.Write(s1[c]);
//// }
//// else
//// {
//// Console.Write(” “);
//// }
//// }
//}

}
}
}


REGEX

July 9, 2008 – 11:17 am
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            string str = textBox2.Text;
            string find = textBox1.Text;

            MatchCollection Matches = Regex.Matches(str, find, RegexOptions.IgnoreCase);
            listBox1.Items.Clear();
            this.listBox1.Items.Add(textBox1.Text.ToString());

        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            string str = textBox2.Text;
            string find = textBox1.Text;

            MatchCollection Matches = Regex.Matches(str, find, RegexOptions.IgnoreCase);
            listBox1.Items.Clear();
            foreach (Match NextMatch in Matches)
            {
                this.listBox1.Items.Add(NextMatch.ToString());
            }

        }

        private void button3_Click(object sender, EventArgs e)
        {
            string str = textBox2.Text;
            string find = textBox1.Text;

            MatchCollection Matches = Regex.Matches(str, find, RegexOptions.IgnoreCase);
            listBox1.Items.Clear();
            if (Matches.Count == 0)
            {
                listBox1.Items.Add("There are no matches");
            }
            else
                listBox1.Items.Add("Matches found");
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }
    }
}


time span

July 7, 2008 – 9:54 am

using System;

using System.Collections.Generic;

using System.Text;

namespace ConsoleApplication1

{

class Program

{

public enum AgeGroup

{

Baby, Child, Teen, Adult

}

static void Main(string[] args)

{

string Name;

Console.Write("Name:");

Name = Console.ReadLine();

Console.Write("BirthDate : ");

//int age = 2008 - date.Year;

DateTime date = DateTime.Parse(Console.ReadLine());

int age = 2008 - date.Year;

TimeSpan t = DateTime.Now.Subtract(date);

age = t.Days / 365; if (age < 0)

{

Console.WriteLine("Hello " + Name + " Invalid input");

}

// Console.WriteLine("Hello." + Name);

Console.WriteLine("Hello" + Name + " You are " + age + " years old" + " You are a");

if (age <= 1 && age >= 0)

{

Console.Write(AgeGroup.Baby + ".");

}

if (age <= 12 && age >= 2)

{

Console.Write(AgeGroup.Child + ".");

}

if (age <= 19 && age >= 13)

{

Console.Write(AgeGroup.Teen + ".");

}

else if (age <= 20 && age >= 135)

{

Console.Write(AgeGroup.Adult + ".");

}

if (age > 135)

{

Console.WriteLine("Hello " + Name + ".. Invalid input");

}

Console.ReadLine();

}

}

}


DESKTOP

July 3, 2008 – 2:08 pm

Motherboard—————————————-

Asrock ALive NF7G-HD720p R5.0

CPU—————————————–

AMD Athlon™ X2 Dual-Core

Printer—————————————–

HP D2460

OR

HP D1460

And ………….

160GB HDD

1GB RAM

LCD 17” inch (SAMSUNG)

DVD COMBO

 

Package Accessories

-AVR

-mouse

-keyboard

-speaker

-CD Ink pen

-Headset with Microphone


OUT GOING (”HOME”)

May 12, 2008 – 2:24 am

To all my classmate in high school,

Planner: DARRYL JAY LEDDA

Hi guys, nice to see yah on this page. Fisrt of all i just want to say: just leave your comment or maybe a reaction about this trip.

He is the one who told me folks that we have a small "TRIP" on the last week of May… Darryl said: "so that are bond each other will not fade", but I guess that many of us can’t come on this party because some of us thinking for their enrollment(like I). As what i have said that post something a little comment for have a good "PARTY".

OK GOD BLESS YOU(",)

WHAT IS THE BEST DAY FOR THIS?

i hope that we could come up nice result about this.


Mother’s Day

May 6, 2008 – 11:03 am

 

To your MOM: "HAPPY MOTHER’S DAY" in advence by: joHnATTERz

We know that mother’s day is always at the second sunday of may. Eventhough there is a lot of days to come, just cling to your mom, and don’t even make a lament thing guys. Give your day to her and don’t forgot to say "I LOVE YOU". Give the best you can because your mom need the days of her youth sometimes to rejuvenate her..

so good luck guys….. feel the sweet sunny days of MAY….

GOD BLESS YOU AND YOUR FAMILY(",)
"I LOVE YOU" friends(dont forget it!)

POEM:

A Mother loves right from the start.
She holds her baby close to her heart.
The bond that grows will never falter.
Her love is so strong it will never alter.


A Mother gives never ending Love.
She never feels that she has given enough.
For you she will always do her best.
Constantly working, there’s no time to rest.


A Mother is there when things go wrong.
A hug and a kiss to help us along.
Always there when we need her near.
Gently wipes our eyes when we shed a tear.


So on this day shower your Mother with Love.
Gifts and presents are nice but that is not enough.
Give your Mother a day to have some peace of mind.
Be gentle, be good, be helpful, be kind.


Happy Mothers Day.


Pinoy Big Brother Teen Edition Plus

March 30, 2008 – 3:44 pm
 
  Photobucket
 
 

            Auditions for the second Teen Edition, later to be called Pinoy Big Brother: Teen Edition Plus were held as early as September 2007 and during the run of the second Celebrity Edition (alongside those of the seasons of PDA and the third regular season of Pinoy Big Brother). It was announced during the finale of the said Celebrity Edition on January 5, 2008 that this new Teen Edition will start sometime in March of the same year.

            Already it was announced in advertisements that thirty of the teens, who did their auditions in several cities in the Philippines, as well as in Dubai, Milan, and Madrid, were each given Dream Keys, but those who would receive them were told not to divulge them to others. The Dream Keys were used as a mark to show proof to the crew that they had passed their auditions and had answered their casting call. From the thirty Dream Key holders, fourteen were chosen to be official housemates.

            The season started on March 23, 2008 with a summer vacation theme. The reason for addition of the word Plus to the title were revealed: Luis Manzano’s return as host, an additional two housemates to the announced twelve, and a secret second "House."

 

Host:

Toni Gonazaga | Mariel Rodriguez | Bianca Gonzales | Luis Manzano 

 

TEEN HOUSEMATE:

                        Ejay
                        Kevin
                        Nicole
                        Linda
                        Nan
                        Alex
                        Rona
                        Jieriel
                        Jolas
                        Beauty
                        Valerie
                        Priscilla
                        Robi
                        Josef

     

    Of the fourteen Guardians, twelve are parents, one is a close relative and another is a good acquaintance. They are listed below:

  • Boy (Robi’s father)
  • Anna (Josef’s aunt)
  • Ningning (Linda’s mother)
  • Gerry (Jieriel’s stepfather)
  • Carina (Beauty’s mother)
  • Rose (Rona’s mother)
  • Sandy (Nicole’s mother)
  • Ike (Jolas’s father)
  • My Love (Nan’s mother)
  • Erning (Ejay’s father)
  • Violy (Her "second mother")
  • Jinky (Priscilla’s mother)
  • Minda (Alex’s mother)
  • John (Kevin’s father)

 


Valerie Weignmann—PBB TEEN EDITION PLUS

March 30, 2008 – 2:17 pm
 
 
Photobucket
 
DOZZLING DOLL of Europe
 
 
            Valerie Weignmann is 18 from Germany. She is profiled as a “Daddy’s Girl” currently trying to reestablish her ties with her Filipina mother since the death of her German father. Although she has lived most of her life in Germany, she has a great Filipina sensibility, visiting her mother’s country very often. She also has a good command of the Tagalog language and has plans to enter Philippine showbiz.

Rona Marie Libby—PBB TEEN EDITION PLUS

March 30, 2008 – 2:15 pm
 
 
Photobucket
 
 
PRISONER’S DAUGHTER of Dumaguete
 
 
             Rona Marie Libby is 16 from Dumaguete. She is profiled as a “prisoner’s daughter” as her father has been in prison for four years for an unspecified crime. Despite this, she and her siblings have excelled in many activities, both in academics and in extra-curricular ones. She aims to have her father released from his incarceration.