To understand this post, you should have seen Inception. Then lets imagine the chaos that can be created with Inception.
By Husband
Husband can do inception to make his wife think that,
- She is married to the most honest, most handsome, most perfect man
- She came on this earth to fulfill all his desires
- She should never complain and argue anything about time not spent at home
By Wife
Wife can do inception to make her husband think that,
- He is married to the most lovely, most understanding, most perfect woman
- His desires are of no value, and should be controlled
- His only purpose in life is to pay the credit card bills.
- His only purpose in life is to clean house in weekends.
- Looking at other female is crime.
By Boss
Boss can do inception to make his employees think that
- They are slaves
- They must not ask for appraisals
- They are not supposed to take leaves
- They must work all the time
- They must only and only work to make his boss the richest man on the earth.
By Employee
Employee can do inception to make their boss think
- He is born to pay great for their time wasted in the office premises
- He must give appraisals unconditionally and regularly
- He is not supposed to ask reasons for leaves
- He should not force strict timings
- He should pay more and more even if he is loosing money
Please add your own imagination of practical implementation of Inception in the comments and I will update the blog.
This article illustrates step by step procedure of how to setup MySQL Master to Slave Asynchronous Replication with MySQL 5.1 Server and with MySQL Workbench tools 5.2 on Windows Server.
Installation
You need to download MySQL from the corresponding download location and install “Windows Installer Package” and make sure you install the edition with Server configuration wizard and configure your server accordingly.
You have to setup 2 servers, one as Master and one as Slave, and both must be accessible via TCP/IP to each other.
Also configure Workbench to open localhost connection for administration.
Configure Bin Log on Master
Open configuration on Master and setup following options in Log Files to configure bin log.
Configure Master Server ID
Configure Replication User ID on Master
In order for Slave to access your server, you must setup a user “replication_user” (you can choose your own name) and give replication access as shown in picture.![]()
Configure Replication Slave Server ID
Now go to your Slave server and set its Server ID as shown below.
Configure Replication Settings on Slave
This is the last step to configure your Slave server, please make sure you enter correct address of your Master server and username and password as shown below. Just tick the Master info file name and give a path of file on any folder, even if file does not exist, dont worry, it will be created automatically by slave server.
Start Slave
The final step is to open query browser and run the query “START SLAVE”.
UI Atoms 2010 v1.9 update now includes Trace API for developers to log information on screen just like normal .NET application.
Diagnostics Trace API
Microsoft .NET provided Trace API to help in troubleshoot problems which is of great help at time of development. But Silverlight developers are disappointed for not being able to trace in Silverlight apps. However running apps on multiple platform isn’t quite easy, and different user experiences on different platforms raise unexpected issues. Such issues are difficult to resolve as deployed client computer may not have development tools available to troubleshoot and see application logs.
Trace.WriteLine(“ Hello World “);
We sure miss Trace in Silverlight, so we decided to add similar diagnostics API in Silverlight.
Trace Viewer
In Silverlight, as it runs inside a browser, there is no way to see any trace information not only this, on different platforms like Mac, it may be too difficult for no technical user to install and enable remote debugging.
So we decided to include a visual component that can be put anywhere on screen, just like “Output” pane in visual studio. Its developer’s choice to fit the Trace Viewer. Its pretty simple Text View control, where in you can see lines of log automatically scrolling down as log grows.
AtomTraceView
UI Atoms’s AtomTraceView control works well with Silverlight as well as WPF, in WPF it uses inbuilt Trace functionality and displays trace information to user, and in Silverlight we have added custom API, that is used to display Trace information. Syntax is pretty simple.
<Grid> <Grid.RowDefintions> <RowDefinition/> <RowDefinition Height="200"/> <Grid.RowDefintions> <MyUserControl/> <AtomTraceView Grid.Row="1"/> <Grid>
This way you can include AtomTraceView at the bottom of your page and it will display all traces programmed by the developer.
Limited API
However, .NET Trace API is very huge, and it is extensible, but Trace API offered by UI Atoms as of now is very limited, not by the design but by implications, Silverlight itself is very limited platform, this is just an Add-on for users to troubleshoot their apps.
Trace Statements in Silverlight
In order to write Trace statements, you have to import following namespace,
using NeuroSpeech.UIAtoms.Core;
Then you can write following statements and they will appear in AtomTraceView Control.
AtomTrace.WriteLine(" Hello World "); AtomTrace.WriteLine( exception.ToString() ); AtomTrace.WriteLine( string.Format("{0},{1} Coordinates", x, y) );
The AtomTrace class exists for both Silverlight and WPF, so it becomes easier to write your logs with AtomTrace instead of Trace, so your code can be shared on both Silverlight as well as WPF.
Trace and Multithreading
Trace statements can be accessed by thread in Silverlight app, however the sequence in which it will appear can not be guaranteed because it depends upon the processor and scheduling algorithm used in thread pool of Silverlight application.
Custom Trace Listener
Just similar to .NET, we have included AtomTraceListener class, which you can derive and customize trace information according to your need as well as it has Traced event, which you can implement and get trace notifications anywhere..
Future of Trace API in Silverlight
When Trace API will be included by Microsoft in future edition of Silverlight, we may plan to remove Trace API, to be consistent with the Silverlight development workflow, this API has been enabled only to write shared code between WPF and Silverlight environment. However otherwise, we plan to make tracing more rich with UI Atoms. But for now, it is very helpful for everyone.
Live Demo
Click Here to see live demo of Tracing in Silverlight.
Click Here to download demo version of UI Atoms 2010.
Scientific calculations often require measurement unit conversion and demand high accuracy. Although it may be very easy to google around the web and get some formula, however when we looked into SI units and its Unit Guide, then we realized that even units with same name have little different value in different countries and continents.
So we decided to bring them all into User Interface control for WPF and Silverlight.
- Which allows Developer to adhere to one standard unit.
- Which allows users to choose unit of their own choice.
- See the conversion while editing the value.
The following sample code displays how to use these unit converters in Silverlight and WPF.
Properties
Each of the measurement unit converter controls has four properties as mentioned below.
DisplayValue Property:
This is the editable value displayed in the text box, and user can directly modify this value by either using up/down arrow buttons or by typing in the value. The display value works in conjunction with the type of unit that is selected in Display Unit ID property.
DisplayUnitID Property:
Every measurement unit has different ID assigned by our developers to uniquely identify alpha numeric ID within the set of units. For example, meter and centimeter are IDs of Length. However you do not have to remember these IDs, when you edit your UI in Visual Studio, you can configure these IDs in the property editor. End user can visually modify Display Unit in order to retrieve and enter value in the desired unit.
ValueUnitID Property:
The DisplayUnitID is attached to DisplayValue, similarly the underlying actual value is attached with ValueUnitID property. This Unit ID is usually set to a constant throughout the lifetime of the application and is already defaulted to SI unit. e.g. for Length, it is set to meter. We recommend you to change this only if your base unit requirement is something different then SI unit. This unit can not be changed by end user it can only be programmed in the code at design time.
Value Property:
The value property is something which you are interested saving in the database and use it as base value. This is the converted value of unit ValueUnitID specified from display value of display unit.
Example:
In the first control in the above picture, Display Value is 100, Display Unit is Fathom, Value Unit is meter, so converted value in meter is 182.8804.
Live Sample:
Click here to view live sample in Silverlight.
Download Demo:
Click here to download the demo version of UI Atoms.
Building line of business applications for over years, we realized that the Silverlight DataForm offers very small subset of features that are needed in the long run. We figured out the problem with form based applications, that frustrates developers. That is “Change Management”.
Although WPF/Silverlight does offer very customizable UI designing platform but when we go on the field to develop ling of business applications, we realize that initial development hardly takes any time but maintenance is very difficult.
Lets review the designing problems of panels such as Grid, StackPanel, Canvas etc.
Standard Form Design
Lets review standard form design that is expected, this is the layout that can not be made except canvas panel because there is no way we can support variable columns per row. If you notice, first two rows have 3 columns equally placed and last 2 rows have two columns equally placed. Every field has description at the bottom and red required asterisk (*).
Initial Form Design
The first draft of UI in any application is very simple and we probably do it in minutes.
Changes Requested
But the bigger problem always comes later on when changes are requested.
Atom Flexible Grid
This is the reason we created “AtomFlexibleGrid” which supports variable columns per row as displayed in the picture above. You can see that form and the flexible grid have a property called “RowLayout” which accepts comma separated cell values to be displayed per row. As displayed in the example below.
This is very helpful in quick design, but this also way to easy to manage when changes are requested.
- Intelligent Flow Layout with ability share multiple items in single row.
- No attributes required on any child items.
- Comma Separated “RowLayout” instantly renders variable column grid.
- E.g. 3,2,1 = 3 cells in first row, 2 cells in 2nd row and 1 cell in 3rd row with automatic spanning.
Benefits of Atom Flexible Grid over Canvas, Grid and Stack Panel
- Atom Form children are similar to Wrap Panel children, but Wrapping is completely customized via simple attributes.
- Its easy to move items around without changing lots of attributes, Grid is very powerful but changing grid children can be huge pain.
- Canvas is very easy to operate, but needs a powerful designer, once again changing layout can be very tedious job.
Form Field Layout
This is how individual components of Form Field are positioned within the Form Field. Collapsible panels are only visible if the content is provided. However in future more of such components will be available in Form Field to standardize the fields.
In next slide, you will see how the fields are positioned in the Form.
Change Management
Changing layout is extremely simple, as you can simply move your items up and down and change “RowLayout” text field to quickly review how it will look. No tedious drag and drop and no typing.
Live Form Demos
Click here to see live UI Atoms form demos for Silverlight.
Click here to download UI Atoms form demos for WPF.
Here at NeuroSpeech, we figured out the problem with forms based business applications that frustrates developers and change management is not only time consuming but its quite boring job to do.
Although WPF/Silverlight does offer very customizable UI designing platform but when we go on the field to develop ling of business applications, we realize that initial development hardly takes any time but maintenance is very difficult.
AtomForm has been designed to offer a standard rich business class user interface along with various advanced validation methods and the change management is very easy as “AtomFlexibleGrid” offers simple row layout concept that is offered nowhere today.
Eclipse based IDEs such as Flash Builders have problem with generated source code with TFS 2010 (Visual Studio Team Foundation 2010 Everywhere), and here is the workaround to solve this problem.
Problem Definition
Eclipse monitors file system changes and automatically adds all generated files in the Team Foundation Server. Now TFS Everywhere for Eclipse does not support ignoring a folder. Eclipse keeps on adding code of your Web Service generated code in TFS and finally TFS shows lot of files in pending check ins. However if you check-in them, then next time, your code generation tools will not work correctly because files will have to be checked out. And even if you do, code generation will delete some files, and TFS will give error that it can not file and will not let you check-in new items.
- TFS will not let source code generator generate new files, as they are not checked out.
- After checking out, Deleted files will give errors while checking new files.
Web Library Projects as Solution
We ran with exact same problem with Eclipse to manage flex and java projects. Mostly the web service client code are generated dynamically and we really do not want it to go in TFS. So we created library projects and we only stored library project’s configuration in the TFS.
We can import the WebLibs in our main projects, there are various advantages.
- The generated code stays out of TFS.
- Compiled code of WebLibs takes lesser time to build project.
New update of UI Atoms 2010 v1.1 is now available, it includes fixes for Silverlight 4 and new controls as per following list.
Update 1.1
- UI Atoms is now upgraded to Silverlight 4, all binding workarounds have been removed.
- Six New Measurement Unit Controls have been added.
Measurement Unit Controls
Scientific measurements are complex and wide range of units are used everywhere, though conversions are not difficult but it is not possible to carry and remember all conversions and correct formulae.
UI Atoms 2010 v1.1 brings power of SI units conversion in set of following Measurement Unit Controls.
- AtomLengthEditor – helps in conversion of “Length” units.
- AtomTemperatureEditor – helps in conversion of “Temperature” units.
- AtomTimeEditor – helps in conversion of “Time” units.
- AtomVelocityEditor – helps in conversion of “Velocity” units.
- AtomVolumeEditor – helps in conversion of “Volume” units.
- AtomWeightEditor – helps in conversion of “Weight” units.
Currently, these controls offers very simple GUI as first draft, however you can see the number of units that are available that can help users view/edit the value in any desired unit.
This is Preliminary documentation about UI Delegation Pattern to create Clean and Reusable Data Components and UI Markups in a Business Application.
UI Delegation Pattern
I would call it simply divide and rule, UI Delegation Pattern is narrowing the focus towards piece of UI Element on the screen and have a UI component to fulfill every specific business needs.
User Interface is the direct connection between User and your business application, thought MVC, MVVM models exist, but they are found to be very useful in CRUD business applications, but when your application is more then CRUD and it involves complex UI and media / hardware interfaces for scientific and entertainment related applications, MVC/MVVM are little difficult to maintain over huge applications. This pattern is already in existence at many places.
Initial Rough Draft
This is initial rough draft, I intend to collect problems and solutions and then I want to give a good name to this pattern, for now I am calling this as “UI Delegation Pattern” however I don’t know whether it suits the name correctly or not. But your opinions are most welcome, if such pattern is already named and exists then I am sorry if I am unaware of it, but please suggest if you know so.
UI Markup vs. Editor Files
Earlier Visual Basic or Visual Studio would create .frm and resource files that would contain the contents of UI design created in “Designer/Editor” inside an IDE. These Editors would create code that is required to execute at runtime to create desired user interface. However since Editors would create code with specific style and pattern, these editor files are more or less very structured and they are less buggy. Of course too much of code will certainly make Editor very slow but at the same time, the consistency of UI code is preserved. But you are too much dependent on the Editor and complex UI could be very difficult to work in Editors.
Where else UI Markup based on xml, gives full freedom to user to create highly complex UI, but at the same time there is no consistency left as everyone writes code very differently. Markups gets piled into one file and it becomes way to difficult to maintain and understand how it works.
Identify Markup Noise
My first approach is to identify problems with Markup Noise, so lets identify what is markup noise. When I see any html, aspx, php or such web scripts, the most annoying things I discover that in spite great CSS and Modular programming support, the scripts becomes a big junk to maintain. Sure WPF / Silverlight are also text markups, hand coded markups becomes way to big junk to manage.
Bigger problem is to visualize markups as they become more complex. As more and more lines of code gets piled into markup, more time is spent understanding and troubleshooting the UI.
How to Reduce Markup Noise?
CSS brought a very useful way to reduce markup noise. Still lot of developers write inline styles and I hate to see that. Ideally nicely written code should have inline styles as small as possible.
Appearance Delegation
CSS comes under category of Appearance Delegation where your delegate the look and feel of your component to CSS file. In WPF and Silverlight the themes are styles are introduced and you must have all your styles and look and feel related code into resources only.
The markup containers (Connection Containers) such as Window / Page / User Control should not have any inbuilt styles at all.
Business Logic Delegation
This was not possible in plain html, but aspx, php etc did brought concept of server side controls where in you could inject business logic specific to components and reuse them. But these components (user controls / custom controls ) are only designed when they need to be reused, but even if it will be used only once, I would still suggest its better to have components as small as possible.
Example, Country Combo drop down , Gender Combo drop down, these boxes are nothing but set of options provided to user to select one of them. Now nobody makes specific custom controls for such items, but lets see a practical example.
Bad Markup Example
<Window.Resources> <XmlDataProvider x:Key="CountryData" XPath="/Countries"> <Countries xmlns=""> <Country CountryName="United States" CountryCode="US"/> <Country CountryName="United States" CountryCode="US"/> </Countries> </XmlDataProvider> </Window.Resources> <StackPanel> <ComboBox ItemsSource="{Binding Source={StaticResource CountryData}, XPath=Country}" DisplayMemberPath="@CountryName" SelectedValuePath="@CountryCode" /> <ComboBox> <sys:String>Male</sys:String> <sys:String>Female</sys:String> </ComboBox> </StackPanel>
Now this file defines a resource xml for Country List, and it is bounded by ComboBox to list countries and another ComboBox defines inline items to be displayed.
Let us identify “Controls and Connection Containers”.
The window, that hosts Country List and Gender Combo Boxes is “Connection Container” in which we should only host controls and connect inter dependent properties of every controls.
The Connection Container should not have any code that is not related to either any other items or business logic of the container at all.
List of Countries and Gender items are not at all related to anyone else except for the drop downs. This is pure markup junk where we have so many unnecessary information.
Solution
Define custom controls as shown below and see how small our markup becomes. And move Country List xml to some resource file.
public class CountryComboBox : ComboBox { public CountryComboBox() { this.DisplayMemberPath = "@CountryName"; this.SelectedValuePath = "@CountryCode"; Binding b = new Binding(); b.XPath = "Country"; b.Source = FindResource("CountryData"); this.SetBinding(ItemsSourceProperty, b); } }
public class GenderComboBox : ComboBox { public GenderComboBox() { this.ItemsSource = new string[] { "Male", "Female" }; } }
The final Markup.
<StackPanel> <local:CountryComboBox /> <local:GenderComboBox /> </StackPanel>
Wow, the markup is very clean now. Also the code is easy to understand.
Conclusion
The connection container (Window / Page / User Control) should only have interdependent declarations and should not have any items that are only specific to one control. It should be as clean as possible and it should execute all necessary business logic for the component.
Configuration items, even resource bindings should be avoided in Connection Containers. They should be narrowed down to custom controls as much as possible.
This increases readability, reusability and helps in troubleshooting while focusing by narrowing the target.
There is lot of buzz about LOB Business Form Layout for new platforms WPF & Silverlight, both capable of displaying rich content and extend functionalities of existing components so better then ever before.
XAML is better then earlier Rapid Form designers where you need to drag and drop within an IDE and the layout management becomes so complicated because no IDE is perfect. I remember upgrading from Visual Studio 2005 to 2008 and now 2010, most of our ASP.NET and WinForm projects would require lot of effort to work seamlessly in newer versions. The worst of all is, modifying layout without IDE becomes way to difficult.
In this presentation, I collected all important aspects of Business Form that we encounter in our day to day life and the complexity of forms make life terrible when clients request changes that takes hours on any IDE that sure breaks lot of code graphs and makes existing working system as completely useless code junk.
In UI Atoms, we at NeuroSpeech tried make set of components that are very easy to operate while going through tough change management.
