Archive for the ‘Uncategorized’ Category

A more advanced Survey List in SharePoint 2013

July 5, 2016 Leave a comment
Hi everyone!

My customer has asked for a solution to evaluate developped applications by the end users. A solution based on Survey template was proposed but the default template is just a form with the questions as fields. The interface is not convivial if we have a long survey!

Let us assume that we have a survey with three questions. The following pictures shows the default NewForm:


Enter a caption

What is the difference between a custom list and a survey then? Some interesting features can be cited:

  • The stats part to evaluate the survey.Surevey12
  • The branching feature in the survey that allows to jump to a given step based on what is chosen by the user at the current step.Surevey13

Now, let us develop a more advanced survey using just javascript! We want to achieve these objectives:

  • View just one question at a given step
  • Two buttons to access to the next or the previous question
  • View the Finish button once the user has finished the survey
  • Confirm the answers before saving

3 libraries will be used for different purposes:

  • SP.js for notifications.
  • SPUtilies.js for hiding and showing the questions.
  • JQuery for SPUtilities.

Simply we will write a custom html file that will be referenced into a Content Editor WebPart added on the page NewForm.apsx of your survey:


Here is the content of the Quiz.html:

<!DOCTYPE html>

<html lang="en" xmlns="">
    <!-- Javascript files references -->
    <script type="text/javascript" src="/JS/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="/JS/sputility.min.js"></script>
    <script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
    <script type="text/javascript" src="/_layouts/15/sp.js"></script>
<meta charset="utf-8" />
    <!-- A table containing the Next and Previous buttons -->
<table class="ms-rteTable-default" cellspacing="0" style="width: 100px;">
<td  style="width: 100px; height: 20px;">
<div id="Previous"><<<</div></td>
<td  style="width: 100px; height: 20px;">
<div id="Next">>>></div></td>
<script language="javascript" type="text/javascript">
        //A variable to keep the current position in the survey
        var i = 0;
        //An Arry to store the list of the questions fields
        var fieldsArray = [];
        //This functions is invoked when we click on Finish Button
        function PreSaveItem() {
            var fields = SPUtility.GetSPFields();
            var message = 'Are you sure to save these answers ?\n';
            for (fieldName in fields) {
                message = message + fieldName + ' : ' + 
                SPUtility.GetSPField(fieldName).GetValue() + '\n';


            if (confirm(message)) {

                return PreSaveAction(); // allow save form...
            //Notify the user
            function PreSaveAction() {
                SP.UI.Notify.addNotification('Your Answers are being saved...', 
                return true;
            $(document).ready(function () {
                //Hiding the form toolbar
            var fields = SPUtility.GetSPFields();
            for (fieldName in fields) {   
                //Get the questions list
                //Hide all question
                //Show the first question
        //Next handler
            $("#Next").click(function () {
                //Hide the current question
            if (i < fieldsArray.length-1) 
           //Show the form toolbar when we reach the last question                 
            //Show the next question             
            //Previous handler         
           $("#Previous").click(function () 
             //Hide the current question             
           if (i > 0) {
            //Show the previous question


Let us see the results!

Oh yes, the buttons Next and Previous allow you to navigate between the questions:

First Question:


Second Question:


Thrid Question:


Now if we clic on the Next button the Finsih button is shown:


Before saving the answers a confirm window is launched to confirm the answers:


Finally, a notification label dispalys the message of saving the answers:


Ok that’s all! Hope it helps!



Docker Cloud; you can deal with different Cloud Providers through a single API! (part1)

March 2, 2016 Leave a comment

Hi again!

How Docker is good, is attractive, is … splendid. Just after the Docker Datacenter, Docker Cloud is the new solution to create cluster nodes on different platforms like Azure, containers and Stacks (in Swarm fashion).

Ok today I will show you some steps for two scenarios on Azure:

  1. A simple Web application hosted in a single container (part1).
  2. A 3 tiers application (part 2) based on:
    1. Haproxy as a load balancer and reverse proxy hosted on a single container
    2. 4 Web applications hosted on 4 containers
    3. Redis server hosted on a single container to provide cache capabilities

Let us start with the firts scenario:

  1. First of all, you import a certificate into the settings of your Azure account to authenticate the Docker Cloud API.
  2. You create a cluster of a given number of nodes. You can resize your cluster. However according to Docker Cloud, the first node is free!!!! Yes. You have just to select the template of your service cloud.


  1. After that, you will notice that a service cloud and the corresponding virtual machine are created.


  1. Ok, now you will create a container that will host the Web Server and the application.



  1. You select the appropriate image. In my case I choose dockercloud/hello-world image. Here you will notice that you can select a deployment strategy when using a cluster of nodes. You can instanciate a given number of the containers from the same image. You can also define a stack file that draws the composed architecture.


  1. On the Ports section you have to publish the default port. In my case I define the default http port. But don’t forget to define an endpoint listening on this port for the virtual machine hosting the containers host.




  1. Now the service is created, we have just to start it.


  1. And a beautiful page is dispalyed from your browser.


Categories: docker, Uncategorized

Via docker, I noticed that Mono 4.2.1 is faster than Mono 3.2.8

February 14, 2016 Leave a comment


Hi again,

I am developping a prototype of micrsoservices running into docker containers. These micrsoservices process files operations using WCF. It will be perhaps the topic of future articles incha Ellah.

On my Ubuntu 15.04 machine I have installed Mono 3.2.8 shiped with Monodevelop. I installed docker and the latest mono image from the hub.

To study the overhead of my microservice, the same web service was also executed on my host. A windows application was used to consume the web services.

According to my tests when writing sequentially files, I noticed that my docker webservice responded faster than my webservice on the host.

As the docker container is sharing the same kernel as my host, I consulted the version of the mono installed in the image from which I created my container using this command:

docker exec -it “myDockerName or ID” mono –version

Bingo!!! Mono 4.2.1 was installed into my container. To verify that my hypothesis is correct, I updated my Mono on the host. The results were similar finally!

Thank you docker! And thank you Mono!

Categories: docker, Uncategorized

Probable Double Take 7 bug during the failover of SQL Server 2005, 2008 or 2008 R2!

February 4, 2014 Leave a comment


Hi again!

I am working currently on a replication project using the famous Double Take to replicate SQL Server 2000/2005 databases and file shares between two remote sites.


I have some experience with The Storage Mirroring (Double Take) 5.3 from HP and I liked really its different consoles. As we have not the necessary licence for Entreprise Edition, we were obliged to use the new Double Take 7.0 delivered by Vision Solutions. And unfortunatly my expectations were not met.

Unlike Storage Mirroring 5.3, when configuring a SQL replication job, there is no manner to configure the SQL services to start during the failover process. I have searched for a file in the Double Take repository that contains the services to start but no way!


And the final result when you launch your failover process, the job fails! Just take a look on the job log to find the cause : the SQLSERVERAdHelper service cannot be started!

This service is just launched when an SQL Server object needs to be created in the Active Directory to register an instance of SQL Server and is configured to start manually. So the only way to start the MSQLSERVERADHELPER is from SQL Server.

But our famous Double Take fails when starting this service! And this is very logical!

What is the solution? If this SQLSERVERAdHelper service is not so crucial for you, you can delete it! Yes this solution was applied in our case using this command : sc delete MSSQLServerADHelper.

By doing so, the failover process worked for us finally!

NB: the MSSQLSERVERAdHelper service is removed from SQL Server 2012 and later (I suppose). So, no problem when replicating with Double Take 7.0.

3id Moubarek!

August 7, 2013 Leave a comment

taqabal_Allahou_minna_wa_minkoum_23475393id Moubarek to all Muslims over the world!

Categories: Uncategorized

The new features of Windows 2012 R2 Hyper-V explained by Aidan Finn

August 2, 2013 Leave a comment

Hi again!

I was searching for the new capabilities of Windows 2012 R2 Hyper-V and I have found this post of the famous Aidan Finn. Most of the new features are explained in the same blog. A real gold mine for the virtualization geeks.


The process is not in background processing mode when using SCUP 2011 with SCCM 2012 SP1 for third party updates

April 10, 2013 2 comments

Hi Geeks!

Is SCUP 2011 supported with SCCM 2012 SP1 for third party updates? The answer is YES.

Now to accomplish your mission successfully, please take a look on this excellent step by step video guide.

Now after configuring correctly my SCUP 2011, I couldn’t download the third party updates to deploy them using SCCM 2012 and I obtained this error : The process is not in background processing mode.

To troubleshoot the problem, you have to consult the Patchdownloader.log file.


HttpSendRequest failed HTTP_STATUS_FORBIDDEN or HTTP_STATUS_DENIED  and  DownloadContentFiles() failed with hr=0x80070193 are the errors to solve.

As you can see, the content of the update package can not be downloaded from WSUS to the temp directory.

All right, now, I have tried to download the cab file using the mentioned URL and … surprise! The proxy is blocking me.

I have configured the proxy to bypass the local addresses and bingo, it’s working!