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.
- Developing a 5 KB Silverlight Game
- Generic Bind to Crystal Reports
- Generic Dispatcher
Well that is all folks, I think this is enough for the web :)
Regards
Rabeeh Abla
This post shows how easily a Silverlight form can be generated from XML schema file XSD. The XSD file will contain the form structure and rules on each field of the form using XML, and a class will generate a Silverlight form at runtime.
Automatically validation will be added to each field. This way saves lots of time; another thing defining a specification in XML is more generic and mobile than writing it in C#, vb.net or other language. After the user data is validated at the UI level, the data will be transformed into XML format and send to a service that reads this XML file, and issues proper action on database using ADO.Net entities. This nice scenario took me few hours to implement and the result was effective.
To make it more efficient and easier to users, it will be nice if an extension of XSD is created, let us call it FSDX , Form Schema Document Xml, which is a subset of XSD, the designer for this file will allow easy creation of form and binding it to a data source.
This simple idea can be the base for all generated Forms.
The following is class design of the Form generator

The following is the class design of the rule on form field

The expression field can be a regular expression, specified to validate data entered by user.
The developer creates the dynamic form using XSD language, a future update will contain a designer to help creating dynamic form graphically, and binding them to a datasource.
Currently the rules on form fields are specified using XSD type and attribute constraints.

The code is the easy part ;), I will leave you to write it!
Since I am generous, I will post sample code in the following line.
Download Sample: Code
Regards
Rabeeh Abla
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
SilverLight specification and use of XAML, drives one to inspect this platform. The use of standards is what enables manageable integration, and improves software maintenance. Having such platform integrated in .Net framework and available for developers, encourages one to experiment a little by using it.
Mesh viewers are common in CAD, and there are many available tools and libraries to develop and view complex mesh nets. In short a mesh is a net of connected faces, and a face is a set of vertices.
I created a humble very basic .Net Mesh Library that is free for anyone interested in improving and using it. This library can be used in .Net application, all that changes is the way of connecting two points i.e. drawing a line.
In windows application you can draw a line by using the Graphics object method DrawLine, in SilverLight you draw a line by creating a Line object and adding it to the main Canvas.
void engine_OnDrawLine(MeshSilverlightLibrary.Common.Point start, MeshSilverlightLibrary.Common.Point end)
{
Line l = new Line();
l.X1 = (float.IsNaN(start.X) ? 0 : start.X);
l.Y1 = (float.IsNaN(start.Y) ? 0 : start.Y);
l.X2 = (float.IsNaN(end.X) ? 0 : end.X);
l.Y2 = (float.IsNaN(end.Y) ? 0 : end.Y);
l.Stroke = new SolidColorBrush(Colors.Blue);
l.StrokeThickness = 1;
LayoutRoot.Children.Add(l);
}
Regards
Rabeeh Abla
The best way to predict the future is to create it. Peter Drucker
More Posts
Next page »