Retrieve Polygon on a Google Map with datatype geography

Retrieve Polygon on a Google Map with datatype geography

To retrieve a polygon (that has a list of lat, long coordinates) on a google map with a data type of geography. The function below (C#) extract a polygon, by first converting to a string and then doing a regex to filter data that is not needed. The formatted that is return is a string, […]

Read More

AspNet Identity Owin

So lately I being playing around with AspNet Identity. Number of things I have found out that:- SignInManager was responsible for creating authentication cookie. SignInManager constructor need a UserManager ==> SignInManager(UserManager x) UserManager requires a implementation of IUserStore IUserStore uses Entity Framework User Store IUser<TKey> Using the existing SigninManager as a reference,  a IUser<TKey>. publicclassCustomUser:IUser<string>{publicstringId{get;set;}publicstringUserName{get;set;}} […]

Read More

PolyMorphism

Poly – means many , Morphism – mean form A person behaves as a mum in house while at the same time, a person behaves like an employee in the office There are two types of polymorphism. Dynamic and Static – Static: Method overloading in the same class Having more than one methods in a class […]

Read More

How to set a table field unique in SQL Management Studio

1. Right click on Table –> Design 2. Right click on particular field eg Name, click on Indexes/Key 3. Click on Add, it create default key constraint and under Columns change to table field name 4. Is Unique set to Yes

Read More

Dependency Injection (Ninject)

Definition:- Is a set of software design principles and patterns that enable us to develop loose coupled code. Loose Coupled means that class, modules and assembly have good isolation from each other. So if we need to make a change to one part of our application we only need to update the relevant module. We do […]

Read More

Kendo Scheduler with Remote Data Source

Ok so lately I been spending heaps of time try to get Kendo Scheduler working. The documentation is all over the places but one good documentation link I found that seem to be helpful is in http://docs.telerik.com/kendo-ui/api/javascript/ui So some of things I learnt trying to make Kendo Scheduler work using remote data source:- load the […]

Read More

How to document SQL Tables using SQL Management Studio

Paste this query in SQL Management Studio.  The query use the system catalog views which show the table attributes of the tables. Change the db to respective db USE [db]; SELECT OBJECT_SCHEMA_NAME(T.[object_id],DB_ID()) AS [Schema], T.[name] AS [table_name], AC.[name] AS [column_name], TY.[name] AS system_data_type, AC.[max_length], AC.[precision], AC.[scale], AC.[is_nullable], AC.[is_ansi_padded] FROM sys.[tables] AS T INNER JOIN sys.[all_columns] AC […]

Read More

Free Resources at VisualStudio – Plural Sights / Azure

  You need to have a Microsoft account As of August 2016 you can get free plural-sight resources by Sign into https://www.visualstudio.com/en-us/products/visual-studio-dev-essentials-vs.aspx Click on Benefits Activate Plural-sight documentation (3 Months Pluralsight)

Read More

Using Azure WebJob to Schedule Application on Cloud

Below are the steps after you have Azure Account, to make host a visual studio application on azure using the WebJob to schedule the Azure applications Create Application Hosting on Azure Login on to Azure – https://portal.azure.com/ Click the App Services Click on the + sign Enter App Name Enter Subscription Create Resource Group Create App […]

Read More

Angular UI-Grid

In this post, I use a angular ui grid to render data from a json file. The sample code is in here. The json file has data format as below:- This is renders to a angular grid as below:- The add player button show a popup modal to add a new player into the grid […]

Read More

Security Access using Authorize/Annoymous or Web.Config

Say for example you need to allow anyone to access the Account/Register Page for registration and only certain people to access Account/Login. Below are two methods:- Using the Authorize and Annoymous – Method:1 In MVC 4 and above you can secure login access using Authorize and Annoymous So in the global app Filter there is authorization […]

Read More

Sending Email in C# using Google Account

Below is code snipped to send email via gmail.com MailMessage mailMessage = new MailMessage(); mailMessage.To.Add(“someone@somewhere.com”); mailMessage.Subject = “Test”; mailMessage.Body = “<html><body>This is a test</body></html>”; mailMessage.IsBodyHtml = true; // Create the credentials to login to the gmail account associated with my custom domain string sendEmailsFrom = “emailAddress@mydomain.com”; string sendEmailsFromPassword = “password”; NetworkCredential cred = new NetworkCredential(sendEmailsFrom, […]

Read More

Custom Google Search Engine in C#

Create Custom Google Search Engine Firstly you need a Google account Get Google Api Goto https://console.developers.google.com create a project enable custom search api in Project, goto credentials and create a new key and select this a browser key note down the key to be used later Create Google Search Goto https://www.google.com/cse/all Click on add to […]

Read More

Automating Google Search with Email Results using C#

Google custom search allow you to add a search engine where you can limit this to specific sites or criteria. This allow you to search for specific metadata or something that is relevant to you. Take for example in a university setting, search engine should can be limited to only specific educational sites. In this blog […]

Read More

Storing Images, Sound Files in Azure using Asp.Net

Azure has 4 main types of storage: Blob, FIles, Table and Queue. Blob – allow  storing unstructured data likes images, sound files. FIles is for smb-based cloud file shares, Table storage for NoSQL data, Queue storage to reliably store messages, and Premium Storage for high-performance, low-latency block storage for I/O-intensive workloads running in Azure Virtual Machines. Without […]

Read More

Using EWAY (Credit Card Gateway) REST/JSON API in C#

Eway is payment gateway that can be used to facility credit card payment in number of languages such as PHP, ASPNET, JAVA, RUBY, NODE.JS In this blog we will look at how we can use a EWAY REST/JSON API URL and convert this in ASP.NET C# Object to use this within our Visual Studio Project. […]

Read More

Using Selenium in C# to automate Web Browser

Below is snippet of code using Selenium in C# to automate the following tasks To Login to codeschool using firefox browser Sign with email address using selector Name  The selector Name of element is found by using inspect Sign with password using selector ID. The selector Id of element is found using inspect  Click the submit button […]

Read More

Angular Advanced Directives

Lately I have been trying to learn deep dive into angular directives, but it definitely got a steep learning curve. One good video tutorial I found on angular directive was by David Mosher. His screen cast explain how from a html tag you can write a angular directive with some excellent debugging tips. * So the scenario […]

Read More

Debugging your Visual Project on Andriod or Iphone

At times you may need to bind your Visual Studio Project to a Ip address. One good reasons why you may need to this is, say for example you need to view your responsive web sites on a Andriod or Iphone. Having your visual project on a Ip address you can easily access your project in Andriod using […]

Read More

Style CSS Position Absolute and Relative

With the use of Style Position on a html element, you can position that element anywhere on html. There are two main type of mode that can used with style position that is absolute and relative positioning. Relative position on a element, simply means that the element can be resize in portion to the screen size […]

Read More