C# How To Run C# Code Inside Sublime Text

Hey folks, I want to share a tip. Sublime Text is my favorite for quick scripts, text editing and doing other scripting things or anything which doesn’t require a whole IDE. I love the speed too much and it is super-fast. In the process, I found that you can run C# scripts too, right from inside the Sublime Text, like you can run JavaScript. This is what I will brief you about:
Sometime back, I wrote on configuring Sublime Text for JavaScript too. Here’s the link, if you want to learn:
Ok, let’s start. The process is simple. You need to have an executable file, which Sublime Text will use to execute the scripts.
For C#, we will use scriptcs. Like NodeJS can run JavaScript, scriptcs runs C#. You can write and execute an Application with only one line of code.

Steps to configure Sublime Text for executing C# codes
Step 1: Install scriptcs

In order to install scriptcs, you need to have chocolatey. Chocolatey is a package manager for Windows.

You can install it in two ways:
  1. Using the command prompt (cmd.exe): Run the command, given below in the console:
    1. @powershell -NoProfile -ExecutionPolicy Bypass -Command “iex ((new-object net.webclient).DownloadString(‘https://chocolatey.org/install.ps1’))” && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
  2. Using Powershell : Run either of the following commands
    1. iex ((newobject net.webclient).DownloadString(‘https://chocolatey.org/install.ps1’))
    2. iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex  

    There’s a chance you will get an error while running the script due to a Powershell Execution policy. By default, it is set to “Restricted” to prevent the harmful scripts from running. You can check the current execution policy by running “Get-ExecutionPolicy” command in Powershell.

If you encounter this error, set the execution policy to “RemoteSigned” and run the installation command again. Use the command given below:
  1. Set-ExecutionPolicy RemoteSigned
 Make sure you start the Powershell console in Administrator mode, otherwise the change will not take place.

 

 

Read full article here on C# Corner:

http://www.c-sharpcorner.com/article/how-to-run-c-sharp-code-inside-sublime-text/

Happy learning 🙂

Presented on Javascript Best Practices

Today we organized a user group meet at C# Corner – Delhi Chapter with sessions based on  MVC, Azure, JavaScript and AngularJS. I spoke on JavaScript Best Practices. Much appreciate the learning spirit of the attendees as they made it out even in the rain. Hats off to you guys! We discussion the DOs and DONTs of common programming constructs in JavaScript.

Sunny

It was great learning and fun again 🙂

Hope to have another one on Node.js very soon.

Happy learning 🙂

 

 

RealTime Pulse Monitor Using SignalR And Ignite UI igSparkline

Hey folks. Here I’m sharing a real time heart rate monitor app that I’ve created using SignalR and Ignite UI igSparkline chart. Ignite UI is so cool and comes in very handy when building adaptable UI for Line of Business applications.
Here’s an article, on Getting Started with Ignite UI igGrid from my recent posts:

Download the sample code for this demo from my GitHub Repo:

HeartRate Monitor Using SignalR & igSparkline.

Below is a snapshot of what I’ve built:

snapshot

Prerequisite: Install Infragistics Ignite UI, if you haven’t installed it yet. (Alternatively, you can use CDN versions of JS scripts and CSS files referred). Here, I assume that you have an idea on how SignalR works.

Create an empty ASP.NET project.

empty ASP.NET project
Add SignalR using Nuget.

 

Read the full article here @ C# Corner

 

Happy Learning 🙂

Getting Started with Ignite UI igGrid

I received an Infragistics Ultimate subscription yesterday and I’m really happy about it. It is gifted to every C# Corner MVP. Thank you Casey McGuigan, Infragistics, for the lovely gift and C# Corner for making it happen.

 

and I was like,
Thus, I happily headed to Infragistics.com, redeemed my coupon and I had the subscription activated in my account. I can explore a whole bunch of applications. They offer a wide range of intuitive UI tools. “JavaScript / HTML5” controls are my first love here and I’m gonna explore them first.

From the list of available downloads, I chose “Ignite UI 2016 Vol.1 Complete Bundle”. I downloaded and installed it. To proceed, go to your Program Files > Infragistics > 2016.1 > Ignite UI folder.

Happy Learning 🙂

Session Recap: Learn Building a Website with Node.js and Express.js

Here’s a recap of the session – “Learn Building a Website with Node.js and Express held at C# Corner Delhi Chapter today (2016-06-19, Sunday).

Attendees where mostly new to Node.js architecture and how it works. We started with Node Zero and went to building a web application using node.js and express. We also touched MongoDB  for storing user credentials for authorization purposes. It was a full hands-on with a 4-page PPT 🙂

Here’s the slide I used to Introduce Node.js and Express, and everything else was live hands-on.

 

Session was full of fun and learning with awesome audience. Thank you C# Corner for the platform and opportunity.

IMG_9074_

IMG_9058_

IMG_9077_

Source code of the demo application is available here at my github repo:

https://github.com/iamsunny/node.js-and-express-web-app

Make sure you have installed MongoDB on your machine and have it started before you expect the application to store user credentials. 🙂

Happy learning 🙂

Learn Building a Website with Node.js and Express.js in Visual Studio

Hey everyone, hope you all are doing great!

We have another session at C# Corner Delhi chapter on 19th June, 2016.  The session is going to cover various topics and I’m speaking Node.js this time. You’ll get to learn how you can build a nice web app using your favorite editor Visual Studio (if you’re from .Net Stack) utilizing the power of MEAN stack. There will be more hand on and less slides 🙂

Read more and register here:

Learn IoT, AngularJS, Web API, JavaScript and Node.js

 

 

Here are the slides from my previous sessions, just in case you might want to explore:

http://www.slideshare.net/sunnykumar08/presentations

 

See you there at @ C# Corner Delhi Chapter. You’ll get venue and contact details in the registration link provided above.

Happy Learning 🙂

Presented Microsoft Azure DocumentDB at Global Azure Bootcamp 2016

It was a great show at Global Azure Bootcamp, happening worldwide,  organized at C# Corner – Delhi Chapter (in Noida). We had a very successful event. I presented on Microsoft Azure DocumentDB. Here are few clicks from the session, and the slide deck – just in case you attended and want it for reference.

IMG_8440_
Group IMG_8436_

I would like to thank C# Corner and Microsoft for the opportunity!
Happy Learning 🙂

Project Migration Error – StackFlair-master

An hour back I was trying to generate a flair like StackOverflow and after a bit of research I landed up StackFlair Project by Rebecca Chernoff on GitHub.

Project - StackFlair - github

Right now I’m running Visual Studio 2013 Ultimate on my PC. I tried to start the project and it asked me to migrate. Fair enough. I did. And it didn’t go well. Threw an error with this nice message:

Project Upgrade Error- StackFlair.Web

 

Resolution:

I really had no idea and I again asked google search for help, see how smart I am 😉

Landed up on ASP.NET MV3 Release Notes and it solved the problem.

This line helped me resolving the issue:

Locate the ProjectTypeGuids element and replace {F85E285D-A4E0-4152-9332-AB1D724D3325} with {E53F8FEA-EAE0-44A6-8774-FFD645390401}.

 

If you see, the same project type text was mentioned in error description. I did the replacement and it worked.

🙂

 

ASP.NET Core Application Startup Error

asp.net core startup error

So, I started one of my Application on my machine in Visual Studio 2015 and I saw this beautiful error message.

The following error occurred attempting to run the DNX design time process (dnx-clr-win-x8+6.1.0.0-rc1-update1)

No Connection could be made because the target machine actively refused the connection. …

I thought to just ignore this error and carry on my work but I was unable to run my application.

I had really  no idea why the is that. I googled for a bit and found nothing related to it. May be because it’s a very new technology and not so many of us have been through it.

 

[Solution]

I just restarted my Visual Studio 2015 and the error was gone! I still have no idea how that happened 🙂

Please share your feedback why that happens if any of you have been through this error.

 

 

MySQL – ELT() and FILED() Functions to Extract Index Position From List

MySQL supports some functions that can be used to extract the index position or the actual value from a set of values arranged as an array. ELT() and FIELD() are example of such functions. Let us understand about them in details.

Source: MySQL – ELT() and FILED() Functions to Extract Index Position From List