Hisham Elbreky

Simulate The Nature

  • Coding With Windows Azure IaaS

    This post will focus on some advanced programming topics concerned with IaaS (Infrastructure as a Service) which provided as windows azure virtual machine (with its related resources like virtual disk and virtual network), you know that windows azure started as PaaS cloud platform but regarding to some business cases which need to have full control over their virtual machine, so windows azure directed toward providing IaaS.


  • WebSockets and Web Pages Two Way Communication

    Suppose that you have to design a web application (i.e. stock exchange) which should be designed in the way that the client should be updated instantly with any change submitted by other clients, and also you have to implement this design using ASP.NET (or other web apps technologies).
    As you know that HTTP protocol is stateless protocol based on request/response using non-permanent connection with server which is not longer than your request/response time, there is no problem to implement this type of applications using windows forms and WCF full duplex, but the challenge here is to implement it using web pages technology.

    So what is the scenario that you can use to implement this design using ASP.NET Pages?
    - Periodical checking the server side for any updates from other clients (also the same will be done by other clients) which will lead into hitting server performance with direct proportion with transactions number, also this is not corresponding with real time apps like stock exchange due to the delay of periodical checking and other issues, So this scenario is not practical scenario for this type of apps.
    - The above scenario will leading you to think about something that let server side updating the subscribed clients with any change between each other, but again the nature of HTTP protocol will not help you to do that whilst the request direction always from client to server, some developers resolved this issue with some tricky way by letting the connection opened between server and client, and to do that your server side should be in continuous response until you ending your session with server. This scenario will resolve our issue concerned with HTTP protocol; but still complex to be implemented and hard to maintain.
    - Another scenario is to use the new invented technique “WebSockets” standardized by W3C and supported mainly by latest version of browsers like chrome and fire fox, also there is a Lab by Microsoft(part of HTML 5 Labs) to be supported in IE, WebSockets is a technique for two-way communication over one (TCP) socket, using WebSockets is the best scenario to implement Stock Change app based on web technology and also it will be the future of this type of apps, this solution will save a lot of time and work around to introduce real-time apps through web browsers.

    What is WebSockets? WebSockets is a technology providing for bi-directional, full-duplex communications channels, over a single Transmission Control Protocol (TCP) socket, it is designed to be implemented in web browsers and web servers, The WebSocket API is being standardized by the W3C, and the WebSocket protocol is being standardized by the IETF

    Good WebSockets links


  • DB Documentation Tool

     Recently I have uploaded new project to codeplex site, DbDocument or DbDoc project is a helper tool used side by side with MS SQL server management studio tool, you can design your DB Tables in visualized way through Diagrams and then use “DbDoc” tool to generate design document in MS Word format, the generated file can be used in design review process or as history reference, the tool facilitate and reduce the time of writing DB structure document


  • WebShell, new web applications framework

     I have released the first beta version of WebShell framework on Codeplex, Which aims to facilitate and improve the process of development by providing new and easy way to build module/component driven applications based on request driven design pattern; so re-usability, integration, system updates and deployment will be done smoothly and faster with respect to market demands changes.


  • Game program for kids less than 2 years :)

    My daughter Mariam (=Mary) one year old always coming to my pc when I doing some work and climbing me then hitting keyboard randomly (oh, the pc gone to be like small cat fall in the pool :( )
    I’m decided to save my pc (as possible :) ) then I developed this simple game for kids less than 2 years that thinking the pc is a toy .

    mariam game


  • Eye On .Net - episode 4

    Brad Abrams

    -          What is .NET RIA Services?

    -          Business Apps Example for Silverlight 3 RTM and .NET RIA Services July Update, part1, part2, part3, part4, part5, part6, part7,part8

    -          Simple Example of Managed Extensibility Framework (MEF)  in Silverlight

    Rob Bagby

    -          Azure Application, part1(intro), part2(Access Azure Table Storage), part3(Expose (REST) Web Service And Consume in Silverlight)

    -          Building An Azure Application From The Ground Up

    Dave Ward

    -          Improving jQuery’s JSON performance and security

    -          Never worry about ASP.NET AJAX’s .d again

    -          11 keystrokes that made my jQuery selector run 10x faster

    Joe Stagner

    -          I’m asked, how did you learn what you know ?

    -          Resources for learning the ADO.NET Entity Framework

    -          More Entity Framework Resources

    Oleg Sych

    -          Text Template Transformation Toolkit

    -          T4 Architecture

    -          T4 Template Design

    -          Code Generation with Visual Studio Templates

    Rick Strahl

    -          Introducing CodePaste.NET

    -          How do ASP.NET Application_ Events Work

    -          Creating Visual Studio Templates from your Web Projects

    Phil Haack

    -          JSON Hijacking

    -          Is It Too Late To Change JSON?



  • Web Developer Top up for Next Web Generation

    Web developers will need for some top up there web dev experience with new frameworks and technologies that will be required by new web development Trend, Web Developer should know about:

    1-      Javascript frameworks (Jquery,Dojo ….)

    2-      Service Oriented Architecting (SOA), Web Services will play the first role in new trend

    3-      REST Architecture

    4-      Cloud Computing

    5-      Model Driven Architecture

    6-      Rich internet Applications (RIA) and User Experience (UX)

    7-      Web 3.0 (ie. Google gears)


    The following is my view about Web based applications Trend

    Software applications moves toward Web due to web user experience and other Web based applications benefits at least user do zero effort to move from one version to another (Easy Deployment) and the big benefit is that web app is a client-server model by default  and other advantage of web based applications.

    Number of users that use world wide web is in increasing due to technological progress and social changes, and then web applications should be ready for the upcoming users that will hit Web App Server, Web based Application should have architecture that will fit new changes and requirements.

    There will be two trends in web app UI architecting :

    1-      Server Pages, Rendering all UI in server side by using Server pages and server web controls.

    2-      Native html and JavaScript frameworks, we can say bye bye server pages or server UI rendering (don’t worry about dynamic content the architecture pattern will explain how to do that).

    I’m with second trend “Native html and JavaScript frameworks” where is the right and nature path, most server performance is consumed by UI rendering and also bugs of development comes mostly from UI and developers founding themselves doing  client side scripting, with “Native html and JavaScript frameworks” there will be a thin layer on server side dealing with client side UI throw Web service.



  • Swaplist [JQuery Plugin]

    A few days ago I developed Jquery plugin, it was very useful to use it in client side, the plugin generate UI for two lists and give you ability to swap items between them
    Plugin have methods to initialize it with data or get data from it, data is represented in plugin with JSON format

    Plugin methods:
    1- SetListData(Data):

     the input represented in json format as a list of items for first list, like { items: [{ key: 'item1', value: '1' }, { key: 'item2', value: '2'}] };

    2- GetSelectedItems():

     returns second list items in json format, like { items: [{ key: 'item1', value: '1' }]};

    3- SetListClass(CssClassName):

     takes class name as input, this method concerned about setting css for lists

    How to use?
    1- add div element to your form,

    2- use ready function to assign plug-in into div class "swaplist" or for your defined class in your div element, $().ready(function() {
    var data = { items: [{ key: 'item1', value: '1' }, { key: 'item2', value: '2'}] };


    To download it use the following link http://plugins.jquery.com/project/SwapList


  • JQuery Tips

    Getting text box value
    Chang or set label text
    $(“#LabelId”).text(“Your Text”);
    Set control CSS “i.e td border width”
    $(“#td_id”).css('border-width', '1px');

    Display DIV element with animation

    Swap Items between two lists
    $(“#list1-id :selected”).remove().appendTo(“#list2-id”);

    Passing parameters to asp.net web services
    var prm1=”value”;
    var prm2=2;
            type: "POST",
            url: "/AjaxWebMethods.aspx/WebMethod ",
            data: '{"parameter1":"' + prm1+ '”,"parameter1":"' + prm2+ '"}',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(msg) {
                /*your code*/
            error: function(err) { /*your code*/}
    Look for data line


  • An entry to JQuery

    JQuery is  a JavaScript library simplify using JavaScript in client side, with JQuery you can handle document objects where you can select and change style or behavior in easy way, I think JQuery as a successful JavaScript Library will play a big role in the next days of web development and that is makes Microsoft embedding JQuery in ASP.NET AJAX.

      JQuery  Site :









    Blogs :

     http://encosia.com/category/jquery/  -Dave Ward


    http://www.west-wind.com/presentations/jQuery/default.aspx - An introduction to jQuery By Rick Strahl


    Manning.jQuery.in.Action – By John Resig