Tuesday, September 25, 2007
Thursday, May 17, 2007
Hybridizing ACO and PSO
My masters thesis topic:
“Applying aspects of the ACO paradigm to PSO to create an improved algorithm to solve combinatorial optimization problems with better performance”
“Applying aspects of the ACO paradigm to PSO to create an improved algorithm to solve combinatorial optimization problems with better performance”
525
Just a number? Hardly a number! Its the number to a course. Its not just a course. Its more. CSCI 525 is a graduate (master's degree) course given in The American University in Cairo.
This course has been the most mind-boggling course I have ever taken. It has been one of the hardest and most demanding. At the same time it has been very displeasing. On the other hand I don't think I have ever enjoyed a course like this. It has been so challenging to the extent my mind was not powerful enough. LOL, I find this relevant to the subtitle of my blog: "An insight into a mind. A powerful tool, but only when tamed". Despite the tiring mind-boggling stress I managed to pull off a good grade in the second midterm. I was pleased with this...el humdulilah. There is still the daunting task of preparing for the final exam which is comprehensive and writing a literature survey paper of the Weighted Max-Sat problem. The person who writes the best paper will win a bump up in his end grade. WOW, I would love that. Fortunately and unfortunately I'm up against a lot of competition and im short of time since I have another final next week.
Life is hardship. If things came easy, there would be no self-pride and success...
This course has been the most mind-boggling course I have ever taken. It has been one of the hardest and most demanding. At the same time it has been very displeasing. On the other hand I don't think I have ever enjoyed a course like this. It has been so challenging to the extent my mind was not powerful enough. LOL, I find this relevant to the subtitle of my blog: "An insight into a mind. A powerful tool, but only when tamed". Despite the tiring mind-boggling stress I managed to pull off a good grade in the second midterm. I was pleased with this...el humdulilah. There is still the daunting task of preparing for the final exam which is comprehensive and writing a literature survey paper of the Weighted Max-Sat problem. The person who writes the best paper will win a bump up in his end grade. WOW, I would love that. Fortunately and unfortunately I'm up against a lot of competition and im short of time since I have another final next week.
Life is hardship. If things came easy, there would be no self-pride and success...
Thursday, March 1, 2007
overloading & overriding
Overriding is when you override an inherited method in a subclass.
Overloading is when you create many methods with the same signature, except the parameters are different (same name but different parameters).
the signature of a method (in Java) is the method name and the number and types of parameters.
Overloading is when you create many methods with the same signature, except the parameters are different (same name but different parameters).
the signature of a method (in Java) is the method name and the number and types of parameters.
Monday, January 22, 2007
Test-driven development
1. Add a test
Each new feature begins with writing a test.
2. Run all tests and see the new one fail
This validates that the new test does not mistakenly pass without requiring any new code. The new test should also fail for the expected reason. This step ensures the test will require the right behavior: it tests the test itself, in the negative.
3. Write some code
The next step is to write some code that will pass the new test.
4. Run the automated tests and see them succeed
5. Refactor code
Now the code can be cleaned up as necessary. By re-running the test cases the developer can be confident that refactoring is not damaging any existing functionality. The concept of removing duplication is an important aspect of any software design. In this case, however, it also applies to removing any duplication between the test code and the production code.
Each new feature begins with writing a test.
2. Run all tests and see the new one fail
This validates that the new test does not mistakenly pass without requiring any new code. The new test should also fail for the expected reason. This step ensures the test will require the right behavior: it tests the test itself, in the negative.
3. Write some code
The next step is to write some code that will pass the new test.
4. Run the automated tests and see them succeed
5. Refactor code
Now the code can be cleaned up as necessary. By re-running the test cases the developer can be confident that refactoring is not damaging any existing functionality. The concept of removing duplication is an important aspect of any software design. In this case, however, it also applies to removing any duplication between the test code and the production code.
Boxing and unboxing in C#
Boxing and unboxing is an essential concept in C#. With Boxing and unboxing one can link between value-types and reference-types by allowing any value of a value-type to be converted to and from type object. Boxing and unboxing enables a unified view wherein a value of any type can ultimately be treated as an object. Converting a value type to reference type is called Boxing. Unboxing is an explicit operation.
C# provides a unified type system. All types including value types derive from the type object. It is possible to call object methods on any value, even values of primitive types such as int.
Example:
class Test
{
static void Main() {
Console.WriteLine(3.ToString());
}
}
class Test
{
static void Main() {
int i = 1;
object o = i; // boxing
int j = (int) o; // unboxing
}
}
The above example shows both boxing and unboxing. When a variable of a value type needs to be converted to a reference type, an object box is allocated to hold the value, and the value is copied into the box. A boxing conversion permits any value-type to be implicitly converted to the type object or to any interface-type implemented by the value-type. Boxing a value of a value-type consists of allocating an object instance and copying the value-type value into that instance.
Unboxing is just the opposite. When an object box is cast back to its original value type, the value is copied out of the box and into the appropriate storage location.
C# provides a unified type system. All types including value types derive from the type object. It is possible to call object methods on any value, even values of primitive types such as int.
Example:
class Test
{
static void Main() {
Console.WriteLine(3.ToString());
}
}
class Test
{
static void Main() {
int i = 1;
object o = i; // boxing
int j = (int) o; // unboxing
}
}
The above example shows both boxing and unboxing. When a variable of a value type needs to be converted to a reference type, an object box is allocated to hold the value, and the value is copied into the box. A boxing conversion permits any value-type to be implicitly converted to the type object or to any interface-type implemented by the value-type. Boxing a value of a value-type consists of allocating an object instance and copying the value-type value into that instance.
Unboxing is just the opposite. When an object box is cast back to its original value type, the value is copied out of the box and into the appropriate storage location.
Subscribe to:
Posts (Atom)
