“Open Source PostgreSQL on Microsoft Azure” meetup in Islamabad

Microsoft has partnered up with the PostgreSQL Special Interest Group in Islamabad to bring you “Open Source PostgreSQL on the Cloud” on 23rd September, 2016! The session has been delivered by Mr. Ali Sufyan Butt, a Microsoft Most Valuable Professional on Visual Studio and Development Technologies.

Agenda

  • Introduction to Azure & its features
  • Deploy a Ubuntu Linux VM on Azure
  • Install and configure PostgreSQL on Ubuntu Linux Server hosted on Azure
  • Build a quick demo Asp.net app and connect it through the database using EF 6.0 drivers for PostgreSQL
  • Deploy the website on Azure

Mr. Corton Privacy Policy

Personal information

This application does not collect or transmit any user’s personally identifiable information. No personal information is used, stored, secured or disclosed by services this application works with.

Technical information

No technical information is sent (such as IP addresses included in the HTTP calls the application makes) neither of that is used or stored.

Communication

  • The communication made with the app in either text or voice is not stored anywhere in any form, all speech processing is done locally, only send the message to server to send back the response.

Third parties

If the app makes use of third party services, their usage of information is excluded from this privacy policy. You will be clearly made aware of the third parties involved in the app and we will ensure the very minimal set of data is set to those third parties. The third party is our AI engine which processes the sound and sends back the text.

Report violations or get more information

If you would like to report any violations of this policy or get more information on any app, please contact us by emailing at alisufyanbutt@hotmail.com.

This is just a virtual friend, any association or personal attachment to it is not our responsibility, please do not take the responses seriously, it might be not what you like, but we made sure they would be not vulgar, offensive and indecent.

NDepend is something we can depend on

Ndepend is a tool which I am really excited to review at last. I had a long time commitment with NDepend team but I for some reasons I had been too busy in other stuff that I really missed it, But I have not forgotten it at all and been using the tool and had great benefits which I want to share with you guys.

After downloading the tool, it is fairly easy to configure the extension with Visual Studio as well as we can also use Visual NDepend tool to visually analyze the solution or assemblies.

For first timers, this link can help to install and configure http://www.ndepend.com/docs/getting-started-with-ndepend

After running this tool for the first time, I scanned my project and viola, I was in deep trouble, just kidding, I mean I got a detail report of issue with my code, code metrics, dependency graphs, Dependency Matrix and a long list of rules violated in the code. This was really a great thing to see and I immediately started to work on making the mistakes right.

NDepend is giving me insights into my code that we normally ignore, but keep following through the standards and after a few iterations with NDepend, it was all sweet code. All thanks to NDepend tooling and support.

 

Extension method for IEnumerable to get a deep copy cloned object.

When we assign a List object to another it does a shallow copy, and making a change into copied object reflects in source object as well. This does not serves the purpose, thus finding a ways is through extension methods.

Code Snippet
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Csharp
  9. {
  10.  
  11.     public static class Program
  12.     {
  13.  
  14.  
  15.         static void Main(string[] args)
  16.         {
  17.             List<string> abc = new List<string>();
  18.             abc.Add("a");
  19.  
  20.             var newList = AddAlphabet(abc);
  21.  
  22.             Console.WriteLine(abc.Count);
  23.             Console.WriteLine(newList.Count);
  24.             Console.ReadLine();
  25.         }
  26.  
  27.         private static List<string> AddAlphabet(List<string> abc)
  28.         {
  29.             List<string> _abc = abc;
  30.             _abc.Add("d");
  31.             _abc.Add("e");
  32.             return _abc;
  33.         }
  34.  
  35.  
  36.         
  37.     }
  38. }

This produces following result in output

3

3

Changing the code and added an extension method will result in proper result that I expected earlier.

Code Snippet
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Csharp
  9. {
  10.  
  11.     public static class Program
  12.     {
  13.         public static IEnumerable<T> Clone<T>(this IEnumerable<T> collection) where T : ICloneable
  14.         {
  15.             return collection.Select(item => (T)item.Clone());
  16.         }
  17.  
  18.         static void Main(string[] args)
  19.         {
  20.             List<string> abc = new List<string>();
  21.             abc.Add("a");
  22.  
  23.             var newList = AddAlphabet(abc.Clone<string>().ToList());
  24.  
  25.             Console.WriteLine(abc.Count);
  26.             Console.WriteLine(newList.Count);
  27.             Console.ReadLine();
  28.         }
  29.  
  30.         private static List<string> AddAlphabet(List<string> abc)
  31.         {
  32.             List<string> _abc = abc;
  33.             _abc.Add("d");
  34.             _abc.Add("e");
  35.             return _abc;
  36.         }
  37.  
  38.  
  39.         
  40.     }
  41. }

This produces following result in output

1
3

We notice that it does not change the original value of source.