Tuesday, May 20, 2014

Basic JQuery Filters

Using Basic JQuery Filters
This is in the notes that i found from a video. To filter use below code,a dd it with your selection.

Filter Purpose
:first Select only the first instance
:last Select only the last instance
:even Select only even-numbered
:odd Select only the odd-numbered
:eq(n) Filters out elements that are not positioned at the given index
:gt(n) Includes elements that are past before the given index
:lt(n) Includes elements (H1,H2,H3,etc)
:animated Selects all elements that are currently being animated in some way.
:not(selector) Includes elements that do not match the given selector


For Example :
$("document").ready(function(){
   $("p:first").css("border", "3px solid red");
});

*p is for paragraph selected

Sunday, April 27, 2014

C# Creating new file and edit existing file.










This is the example exercises that I tried.

1. When creating a new text file using

Console.Write("\nPlease input filename : ");
string name = Console.ReadLine();
path += Path.DirectorySeparatorChar+ name + ".txt";
File.Create(path).Close();
  // Please bear in mind that you need to close the created process after create a file so that you can edit it later on.

2.When editing a file why would need to type the file name as you can list and choose the file number.

// Listing the existing file codes......
public string choose(string view)
        {
            Console.WriteLine("Please choose the existing file ");
            Console.WriteLine("--------------------------------");
            string[] choose= Directory.GetFiles(view);
            int i = 0;
            foreach (string s in choose)
            {   i++;
                Console.WriteLine("No {0} : " + s, i);               
            }
            Console.WriteLine("Please enter your selection file : ");
            i= int.Parse(Console.ReadLine());
            Console.WriteLine(choose[i - 1]);
            Console.ReadLine();
            return (choose[i - 1]);
        }

// Edit code...

public void editFile(string p)
        {
            string current = File.ReadAllText(p);
            Console.WriteLine("Opening file : "+ p);
            Console.WriteLine(current);
            string answer = "n";
            do
            {
                Console.WriteLine("Please write below your new text : ");
                current = Console.ReadLine();
                Console.WriteLine("\nAre you sure to save? (y/n)"); ///need improvise /evolution
                answer = Console.ReadLine();
            } while (answer != "y" );
            if (answer == "y")
            {
                File.WriteAllText(p, current);
                Console.WriteLine("Your text have been save.");
            }
            else Console.WriteLine("Your text have NOT been save.");
            Console.ReadLine();           
        }

* I still haven't found a really good codes to go with the (y/n/q) selection.

Learning C# codes.. Instructor


Whenever we starts a program the system will establish as following codes...

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
        }
    }
}

Hm.... i always wonder why do we need intstructor... such as

      class myClass
        {
            public myClass(string defaultMsg)
            {
                myMessage = defaultMsg;
            }

        }
Up until now i wonder the differences between these two method? Argh..... the explanation that i read is confusing....#%^&*^&(@

Sigh.... my life must carry on....  i just hope when i learn more i''ll understand it....


Thursday, December 19, 2013

Information Technology and Meatball

Nowadays many people worried about ability power to buy. Recently i read an article that show in the next 5-10 years there would be inflation so high that almost everybody will try to do a part time job so that they can live comfortably. Sigh.... this is a bad news to me. After 5 years where would i be? What would i do?
Maybe this is a good time for me to set up a business. But which one? I know computer stuff... I know programming and Linux but what can they help me in reality? Do i need to find a job? Did the job last forever?
Sigh...
Then i remember an article says that "Why should you find a job when you can create one.".. Can i create a job?? Hm... that search for a job that i can create but i can't... I can't create an IT related job as i'm not smart enough to developed a unique and usable system. There's too many of them in the market.. Maybe i'll change my field from IT to other.
My friends told me that the food is someone need everyday.. food will never outdated... food will never out of demand....
I search and search lastly i found one...
A delicious meatball with a fair and affordable price..... yummy....