The following are few quote written by Albert Einstein:
-
Out of clutter, find simplicity. From discord, find harmony. In the middle of difficulty lies opportunity.
-
Few are those who see with their own eyes and feel with their own hearts.
-
The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing.
-
I am enough of an artist to draw freely upon my imagination. Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world.
-
Perfections of means and confusion of goals seem-in my opinion-to characterize our age.
-
It's not that I'm so smart, it's just that I stay with problems longer.
Download Library: Code
The use of neural network is increasing, since scientists and engineers are able to achieve effective results that enable neural networks to be used in the industry.
You will find dozens of Neural Network libraries on the net, this library is written in C#, I wrote it when I was a student in university in 2003, the importance of this library is that it is simple to extend and maintain, and the code naming refers to neural network terminology, this makes easier for students and developers that have experience in the field to be able to work their way easily in the library.
The most important thing to keep in mind when specifying a neural network is the following:
1- Study the data; try to find patterns in the data that enables the classification of this data.
2- Massage noisy data, data massaging for noisy data is a must, since real world problems, are subject to lots of noisy data.
3- Specify a structure for the neural network, relative to data.
4- Choose the correct sample of data for training the network, the data should not all be similar. Best training procedure is to compile a wide range of examples that exhibit all the different characteristics we are interested in. It is important to select examples which do not have major dominant features which are of no interest to us, but are common to our input data.
5- The neural network should be trained to a specific curve, too much learning, will cause the neural network to memorize specific patterns, and fail in classifying similar patterns, for example a simple case is the OCR optical character recognition, and the hand written problem.
These are the basic general points that should be studied when trying to create an effective solution using neural networks.
"An artificial neural network (ANN), usually called "neural network" (NN), is a mathematical model or computational model that tries to simulate the structure and/or functional aspects of biological neural networks. It consists of an interconnected group of artificial neurons and processes information using a connectionist approach to computation. In most cases an ANN is an adaptive system that changes its structure based on external or internal information that flows through the network during the learning phase."(Wikipedia)
The following is Implementation of the multi-layered artificial neural network, and SOM Self Organizing Map Kohonen.

Multi-layered artificial neural network ANN is the base network for SOM and other networks.

Neural network activation functions, a base class called AActivationFunction, is for activation function classes.

Using the this neural network library is very easy in few lines of code, one will be able to setup a network and configure it for training and testing.

Training and testing network is very easy, and network weights can be saved and loaded easily.
Network.SetupData(trainingSample1);
Network.TrainNetwork();
Network.SetupData(testSample2);
Network.TestNetwork();
Download the library and read the documentation for further details.
This library is free for everyone to extend and use.
Regards
Rabeeh Abla
Help your helper classes by defining their context & responsibility at class design time, and applying refactoring techniques.
Each class should state clearly what are its responsibilities and roles in the context it is located in.
Appending the keyword helper to classes is getting misused and becoming a bad habit. Imagine having code with 30 or more helper classes, first people would start thanking language designer that they made use of namespaces, still this does not remove the ambiguity from helper classes and the duplication of code that is occurring in them.
The idea of a class to be helper to another class bounds its responsibility to helping a specified class or set of specified classes, and this causes less use of helper class in libraries or small frameworks, because most of the time there is no specified role for the helper class except helping and this is an ambiguous role because it could be anything!
This problem can be solved by defining unambiguous responsibilities and roles to the class, and naming the class with a name that reflects its responsibilities and roles, in addition that the class exposed functions and methods should satisfy the class responsibilities and roles. I recommend applying refactoring techniques available on http://www.refactoring.com/catalog/index.html, the following refactoring techniques are the most beneficial for such scenario "Extract Superclass", "Extract Class", "Extract Subclass", "Move Class".
All classes communicate & help each other under specified roles and responsibilities, these factors are the constraints that make system responsibilities and roles clear and maintainable. Misusing the helper concept causes the formation of an ambiguous system.
Take the following very basic and simple example:

We have a class called ‘Help’ that is responsible for viewing a special help file, and we have another class that helps the ‘Help’ class, I am going to name it as some programmers are doing these days, we will call the class ‘HelpHelper’ it saves and reads special help files. This is an example of bad naming that does not reflect the class responsibilities and roles.
While we can name the preceding classes as the following and specify unambiguous responsibilities and roles:
The ‘Help’ can be named ‘HelpViewer’ that has the responsibility and role of viewing a special help file, and the ‘HelpHelper’ helper class to ‘HelpFileManager’ that is responsible for managing the saving and reading, this a clear specification, that allows better maintainability and clear extension of classes in a framework or library.

My advice is to decrease the use of naming classes as helpers and work on specifying unambiguous responsibilities and roles for classes, to allow people working in this domain to have better understanding of the classes they are dealing with, for maintenance, testing, extendibility, effective use reasons.
Is there a class named with the Helper keyword in .net Framework? And if there exists, what is the number?
Sincerely
Rabeeh Abla
Download Files: Presentation GOF Pattern Template GOF Code Examples
Design patterns are recurring sequences and best practices for repeated scenarios in software development over the years.
They are common recurring design rules
We need software design patterns to define constraints on software architecture, in order to achieve the following goals:
1- Define and manage software extendibility
2- Bind to standards, eliminate ambiguity
3- Reduce maintenance cost
The idea is to maintain change, and enforce rules on a set of entities to define their behavior.
Download presentation and source code for more information.
Regards
Rabeeh Abla
The best way to predict the future is to create it. Peter Drucker
Design patterns are recurring sequences, built-in .Net patterns are scattered over the framework.
In practice following standard software patterns will help to achieve a more standard code, that is manageable, and understandable by a bigger set of software programmers/developers and architects.
For example the data adapter factory, that enables the creation of specific DBMS adapters. This centralized class helps in establishing a strong data layer, that supplies a more generic way to communicate with business layer.
For example:
Imports System.Data.Common
dbPFactory = DbProviderFactories.GetFactory(“FactoryName”)
adapter = dbPFactory.CreateDataAdapter()
Uml design of generic Adapter class, that makes use of 'DbProviderFactories' factory, and DbProviderFactory, to create a generic layer.
Fig -1-
In simple technical english, a factory pattern is responsible for managing and creating product class instances from a base class that has an increasing or more than one child classes. The DbProviderFactories is a factory of factories, that manages the dbms adapters in .Net 2.0. Building a class wrapper over this architecture and supplying the correct parameters will enable the direct generation of specified data adapters to communicate with most of the standard DBMS in the market.
The following is a code example of creating an adapter to connect to Access database
public DataTable GetData()
{
GenericAdapter.GenericAdapter genericAdapter = null;
ConnectionStringInfo conInfo = new ConnectionStringInfo();
DataTable table = null;
//Supplying parameters to connect to Access db
conInfo.DataBaseFilePath = @"c:\db.mdb";
conInfo.ProviderName = "Microsoft.Jet.OLEDB.4.0";
conInfo.DataSource = "{FilePath}";
genericAdapter = new GenericAdapter.GenericAdapter("System.Data.OleDb");
if (genericAdapter.SetConnectionString(conInfo))
{
table = genericAdapter.ExecuteTableCommand("MyTable"); //return table data
}
return table;
}
Singleton pattern is implemented in many places in the .net framework, single instance window applications, also in remoting we deal with singleton classes.
A singleton pattern can be achieved by forbidding the creation of direct class instance, using the constructors. This is done by making constructors private, and preventing the user from creating an instance of the class.
This enables only the creation of instances from class scope. To enable single instance in memory we use static or shared reference to the class, we make it private to prevent public access, and we set it to NULL.
We add a static or shared function that checks if the class static reference is NULL, if NULL an instance is created, otherwise the previous instance is returned.
The .Net frame makes good use of the proxy pattern , that is a mediator between the real object and the client object. When applying proxy design pattern, the proxy class provides the same services as the real object. That is they inherit from same base class, or apply the same interface. Proxy classes are used in remoting, and when communicating with services.
Such patterns define the road map for extending a framework, using these patterns will allow your applications benefit a great deal, in extendability and code maintenance.
This was an introduction to .Net Design patterns, an example of using DBFactory to create a generic adapter can be downloaded from this page.
Regards
Rabeeh Abla
More Posts