Thursday, 31 May 2012
Java Programming JComboBox
It also can be called drop-down list. Actually they are not same, but now we often use both of them as a same thing. Anyway, GUI is usually more useful than CUI
Wednesday, 30 May 2012
C# Binary Search
This method searches a one-dimensional Array for a value. The value must be in sorted order.
See the example below, it accepts two arguments: an array(students) and the value(“John Smith”) to be searched for
-------------------------------------------------------------------------
List<string> students = College.Students;
var result =Array.BinarySearch(students,“John Smith”);
-------------------------------------------------------------------------
http://msdn.microsoft.com/en-us/library/system.array.binarysearch.aspx
-------------------------------------------------------------------------
using System;
using System.Collections.Generic;
public static void BinarySearchName(ArrayList nameList)
{
CollectionBuilder cb = new CollectionBuilder();
ArrayList nameList = cb.GetNameCollection();
LinkedList<Person> persons = cb.GetPersonCollectionAsList();
string nameToFind;
Console.Write("\nEnter the name to find : ");
nameToFind = Console.ReadLine();
Console.WriteLine("\nStarting binary search\n");
int i = nameList.BinarySearch(nameToFind);
if (i < 0)
{
Console.WriteLine("Sorry the name " + nameToFind + " could not be found,\n");
}
else
{
Console.WriteLine("The name " + nameToFind + " was found");
}
}
-------------------------------------------------------------------------
See the example below, it accepts two arguments: an array(students) and the value(“John Smith”) to be searched for
-------------------------------------------------------------------------
List<string> students = College.Students;
var result =Array.BinarySearch(students,“John Smith”);
-------------------------------------------------------------------------
http://msdn.microsoft.com/en-us/library/system.array.binarysearch.aspx
-------------------------------------------------------------------------
using System;
using System.Collections.Generic;
public static void BinarySearchName(ArrayList nameList)
{
CollectionBuilder cb = new CollectionBuilder();
ArrayList nameList = cb.GetNameCollection();
LinkedList<Person> persons = cb.GetPersonCollectionAsList();
string nameToFind;
Console.Write("\nEnter the name to find : ");
nameToFind = Console.ReadLine();
Console.WriteLine("\nStarting binary search\n");
int i = nameList.BinarySearch(nameToFind);
if (i < 0)
{
Console.WriteLine("Sorry the name " + nameToFind + " could not be found,\n");
}
else
{
Console.WriteLine("The name " + nameToFind + " was found");
}
}
-------------------------------------------------------------------------
Monday, 28 May 2012
ASP.NET IsPostBack Property
"IsPostBack" property checks whether the page is being rendered for the first time or is being loaded in response to a postback. You should know the property to enhance the performance of the website.
http://msdn.microsoft.com/en-us/library/system.web.ui.page.ispostback.aspx
--------------------------------------------------------------------------
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
--------------------------------------------------------------------------
http://msdn.microsoft.com/en-us/library/system.web.ui.page.ispostback.aspx
--------------------------------------------------------------------------
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
--------------------------------------------------------------------------
protected void Page_Load(object
sender, EventArgs e)
{
if
(!IsPostBack)
{
BindData();
}
}
- See more at:
http://www.dotnetfox.com/articles/how-to-add-edit-delete-update-records-in-grid-view-Asp-Net-1003.aspx#sthash.VvxijT9d.dpuf
protected void Page_Load(object
sender, EventArgs e)
{
if
(!IsPostBack)
{
BindData();
}
}
- See more at:
http://www.dotnetfox.com/articles/how-to-add-edit-delete-update-records-in-grid-view-Asp-Net-1003.aspx#sthash.VvxijT9d.dpuf
protected void Page_Load(object
sender, EventArgs e)
{
if
(!IsPostBack)
{
BindData();
}
}
- See more at:
http://www.dotnetfox.com/articles/how-to-add-edit-delete-update-records-in-grid-view-Asp-Net-1003.aspx#sthash.VvxijT9d.dpuf
protected void Page_Load(object
sender, EventArgs e)
{
if
(!IsPostBack)
{
BindData();
}
}
- See more at:
http://www.dotnetfox.com/articles/how-to-add-edit-delete-update-records-in-grid-view-Asp-Net-1003.aspx#sthash.VvxijT9d.dpuf
protected void Page_Load(object
sender, EventArgs e)
{
if
(!IsPostBack)
{
BindData();
}
}
- See more at:
http://www.dotnetfox.com/articles/how-to-add-edit-delete-update-records-in-grid-view-Asp-Net-1003.aspx#sthash.VvxijT9d.dpufSunday, 27 May 2012
Microsoft SQL Server : How to Save changes?
When you are using Microsoft SQL Server Management Studio 2012, default setting does not allow you to save changes. You may be confused about that. Be sure to remember how to save changes.
http://support.microsoft.com/kb/956176
-----------------------------------------------------------------------------------------------
1. Go to the Tools menu, click Options.
2. In the Options window, click Designers.
3.Tick the Prevent saving changes that require the table re-creation check box, and then click OK.
-----------------------------------------------------------------------------------------------
http://support.microsoft.com/kb/956176
-----------------------------------------------------------------------------------------------
1. Go to the Tools menu, click Options.
2. In the Options window, click Designers.
3.Tick the Prevent saving changes that require the table re-creation check box, and then click OK.
-----------------------------------------------------------------------------------------------
Friday, 18 May 2012
Class diagram
Class diagram is used to design the object oriented modelling. It is used for general conceptual modelling of of the application. It's also used for data modeling.
I think class diagram is relatively easy to understand if you are familiar with object oriented programming(especially Java language)! But it's still hard to make a decision for class designing, just like making a variety of trials and errors!!!!
Wednesday, 16 May 2012
ASP.NET Ajax
The ASP.NET AJAX Control Toolkit is an open-source project which is built for the Microsoft ASP.NET AJAX framework. It provides powerful infrastructure to write reusable,
customizable and extensible ASP.NET AJAX extenders and controls to create an interactive Web experience. You can use a bunch of controls that enable you to easily create rich web pages.
http://www.asp.net/ajaxlibrary/ajaxcontroltoolkitsamplesite/
http://www.asp.net/ajaxlibrary/act.ashx
http://ajaxcontroltoolkit.codeplex.com/releases/view/63654
http://www.asp.net/ajaxlibrary/ajaxcontroltoolkitsamplesite/
http://www.asp.net/ajaxlibrary/act.ashx
http://ajaxcontroltoolkit.codeplex.com/releases/view/63654
Thursday, 10 May 2012
Action Listener in Java
Adding Action Listener in Java shouild be important for GUI programming, it looks difficulct though.
Now let's go with it!
Inner class in Java programming
In Java programming, an inner class is declared entirely within the body of another class or interface. It's very useful, but bit confusing. Actually it's definitely important when creating GUI windows or frames.
http://en.wikipedia.org/wiki/Inner_class
http://en.wikipedia.org/wiki/Inner_class
Wednesday, 9 May 2012
C# Delegates
The concept of Delegates is not easy to understand. Delegates are custom defined data types that can store methods internally. It'll be easier after you practice a few times. Although you may not use it that much, it's still worth learning.
http://msdn.microsoft.com/en-us/library/ms173171%28v=vs.90%29.aspx
http://msdn.microsoft.com/en-us/library/System.Delegate_methods.aspx
-----------------------------------------------------------------------------------
using System;
delegate void MyDelegate(int X, int y); //Declaring new delegate type
public static void MethodA()
{
MyDelegate process = new ProcessNums(AddNums); //Instantiating with AddNums method.
process(3, 5); //The output should be 8
}
static void AddNums(int x, int y) //The method is enclosed in the delegate(MyDelegate)
{
Console.WriteLine(x + y);
}
http://msdn.microsoft.com/en-us/library/ms173171%28v=vs.90%29.aspx
http://msdn.microsoft.com/en-us/library/System.Delegate_methods.aspx
-----------------------------------------------------------------------------------
using System;
delegate void MyDelegate(int X, int y); //Declaring new delegate type
public static void MethodA()
{
MyDelegate process = new ProcessNums(AddNums); //Instantiating with AddNums method.
process(3, 5); //The output should be 8
}
static void AddNums(int x, int y) //The method is enclosed in the delegate(MyDelegate)
{
Console.WriteLine(x + y);
}
CSS Opacity / Transparency property
CSS Opacity / Transparency property is one of the most confusing properties. I just simply wrote this code. However, if you need to support older browsers, you should be careful to use this property.
.div{
filter:alpha(opacity=50); /* IE7,8.9 */
-moz-opacity: 0.5; /* Firefox */
opacity: 0.5; /* Chrome, Safari*/
}
http://www.w3schools.com/cssref/css3_pr_opacity.asp
http://www.w3schools.com/css/css_image_transparency.asp
http://css-tricks.com/css-transparency-settings-for-all-broswers/
.div{
filter:alpha(opacity=50); /* IE7,8.9 */
-moz-opacity: 0.5; /* Firefox */
opacity: 0.5; /* Chrome, Safari*/
}
http://www.w3schools.com/cssref/css3_pr_opacity.asp
http://www.w3schools.com/css/css_image_transparency.asp
http://css-tricks.com/css-transparency-settings-for-all-broswers/
Tuesday, 8 May 2012
C# Anonymous type
You can define and instantiate a new type in one line of code using an anonymous type.
Both of examples below are the same. Many people use 2nd example rather than 1st one.
http://msdn.microsoft.com/en-us/library/vstudio/bb397696.aspx
---------------------------------------------------------------------------------
Both of examples below are the same. Many people use 2nd example rather than 1st one.
http://msdn.microsoft.com/en-us/library/vstudio/bb397696.aspx
---------------------------------------------------------------------------------
Person p = new Person();
p.Name=“Jackn”;
p.Age=35;
Person p = new Person{Name=“Jack”, Age=35};
---------------------------------------------------------------------------------
p.Name=“Jackn”;
p.Age=35;
Person p = new Person{Name=“Jack”, Age=35};
---------------------------------------------------------------------------------
Scala
Do you know "Scala"? Scala is a Java-like programming language designed to integrate features of object-oriented programming and functional programming. It can be a popular programming language!!! Take a look if you interested in.
http://www.scala-lang.org/
http://en.wikipedia.org/wiki/Scala_(programming_language)
object ExHello{ def main(args: Array[String]) { println("Hello, what's up?") } }
http://www.scala-lang.org/
http://en.wikipedia.org/wiki/Scala_(programming_language)
Monday, 7 May 2012
C# :LINQ with IEnumerable
See the example below. Both examples are the same. You may see var type more than IEnumerable<T>. You should know members_query is IEnumerable<T> type.
http://msdn.microsoft.com/en-us/library/9eekhta0.aspx
--------------------------------------------------------------------------------
var members_query = from m in people select m;IEnumerable<Member> members_query = from m in people select m;
--------------------------------------------------------------------------------
Sunday, 6 May 2012
iPhone 4S
There used to be lots of netbooks, now ultrabooks water has become a big
seller. We are lucky to have lots of choices, but the manufactures must
be struggling to sell their products. Anyway, new products are always
exciting
http://www.ultrabookwiki.com/Main_Page
These days I've seen lots of people using their smartphone or portable game machines in the train. Probably they are checking Facebook or playing games. There used to be many people reading newspapers or magazines.
That means the time has changed. But we still need to read books. Actually some books are heavy and hard to carry.
We will be able to stop carrying heavy books in the future if schools and companies actively adopte electronic books. Actually I'm tired of carrying heavy books...
http://en.wikipedia.org/wiki/Amazon_Kindle
Here's my iPhone 4S!!!
http://www.ultrabookwiki.com/Main_Page
These days I've seen lots of people using their smartphone or portable game machines in the train. Probably they are checking Facebook or playing games. There used to be many people reading newspapers or magazines.
That means the time has changed. But we still need to read books. Actually some books are heavy and hard to carry.
We will be able to stop carrying heavy books in the future if schools and companies actively adopte electronic books. Actually I'm tired of carrying heavy books...
http://en.wikipedia.org/wiki/Amazon_Kindle
Here's my iPhone 4S!!!
Eclipse
Eclipse is probably the most popular software development environment comprising an integrated development environment (IDE) and an extensible plug-in system for Java programming. You should get it and learn much about it. It must be fun!!!!
Friday, 4 May 2012
System design: Use case
Use case a methodology which is used in system analysis to describe software or system requirements. It's useful to analyze a current(or old) system and design a new system.
http://en.wikipedia.org/wiki/Use_case
Thursday, 3 May 2012
Drupal7 Instruction videos
Drupalize.Me: http://drupalize.me/
CodeKarate: http://codekarate.com/
C# Indexers
An indexer is a special type of property and it has getters and setters as a standard property do.
You can access to collections contained in a class using the familiar [ ] syntax of arrays.
It's quite handy although it may be confusing if you're not familiar with it.
http://msdn.microsoft.com/en-us/library/vstudio/6x16t2tx.aspx
----------------------------------------------------------------------------------
type this [type argument]
{
get
{
// do something return type;
};
set // optional
{
// do something
};
}
----------------------------------------------------------------------------------
namespace IndexersExample
{
class People:LinkedList<Person>
{
public Person this[string nametoSearch]
{
get
{
Person found=null;
foreach (Person p in this)
{
if (p.Name.Equals(nametoSearch))
{
found = p;
}
}
return found;
}
}
}
}
----------------------------------------------------------------------------------
You can access to collections contained in a class using the familiar [ ] syntax of arrays.
It's quite handy although it may be confusing if you're not familiar with it.
http://msdn.microsoft.com/en-us/library/vstudio/6x16t2tx.aspx
----------------------------------------------------------------------------------
type this [type argument]
{
get
{
// do something return type;
};
set // optional
{
// do something
};
}
----------------------------------------------------------------------------------
namespace IndexersExample
{
class People:LinkedList<Person>
{
public Person this[string nametoSearch]
{
get
{
Person found=null;
foreach (Person p in this)
{
if (p.Name.Equals(nametoSearch))
{
found = p;
}
}
return found;
}
}
}
}
----------------------------------------------------------------------------------
Subscribe to:
Posts (Atom)







