Friday, September 18, 2015

Why it's the right time to learn TypeScript.

In Today's world, If you are an web developer and you don't know JavaScript then you will feel left behind. It's never been a good time to be a JavaScript developer than now. With the rise of Node.js  JavaScript is everywhere now. But as you know when Size and Complexity of your JavaScript is Increased it's very difficult to maintain and mange. That's where TypeScript comes into picture. It is a life saver some times. So in this blog post we will see Why It's the right time to learn TypeScript.

What is TypeScript?


TypeScript is a free and open sourced programming language developed and Maintained by Microsoft. It works as a super set of JavaScript. As we all know that JavaScript is very liberal language by nature. So that we tend to make more mistakes and we does not know all the errors at run time. TypeScript is a strict super set of JavaScript so that you can get most of errors at compile time only.  As per official website of TypeScript it's a language that lets you write JavaScript in the way you really want to. TypeScript offers all the features that you need for Object oriented programming. You can find more information about TypeScript on it's official web site on below link.

http://www.typescriptlang.org/

ECMAScript and TypeScript:


ECMAScript is the specification standard of the JavaScript. So right not standard stable version if ECMAScript 5 and some of the browsers support ECMAScript 6. ECMAScript 6 features are being adopted by latest browsers.While TypeScript follows most of syntax of ECMAScript 6 so that you don't have a feel of the learning new language. As per official road map of Typescript 1.6 comes with ES6 Generator so you can convert your script code into ECMAScript6. Your can find more about that on following blog post.

http://blogs.msdn.com/b/typescript/archive/2015/09/16/announcing-typescript-1-6.aspx

TypeScript is everywhere:


As we know TypeScript is a fully Object Oriented language, It's provide great productivity boosts than JavaScript and it's super set of JavaScript so it will be compiled into JavaScript itself. So because of this lots of great framework started using TypeScript like following.
  1. Angular JS
  2. Iconic Framework for creating frond end mobile App
  3. Native Script from Telerik is also completely written TypeScript itself.
Take a example of AngularJs, It is one of the most popular JavaScript Framework on earth. With Angular.js 2.0 it will be fully written with TypeScript.

Tooling:


Most of Web Development editor whether it's paid or free are having TypeScript tooling.  Most popular editors like Visual Studio, Visual Studio Code, WebStorm, Atom, Sublime text and Eclipse are having great tooling for TypeScript.

Why to use TypeScript:


Followings are reason why we should use TypeScript instead of JavaScript.
  1. Fully Object Oriented support with classes and interfaces. So It's a great productivity boost for any developer and easily maintainable and understandable.
  2. It's provide most of the errors compile time while JavaScript is more liberal than this. So less run time error means less bugs for your application.
  3. Refactoring is very easy in TypeScript compare to JavaScript.
So it's never been late. It is the right time to learn TypeScript. Hope you like it. Stay tuned for more!.
Share:
Thursday, September 17, 2015

Which visual studio themes you use? Interesting Survey

I have been using Visual studio since 2003 version and it's been decade and still my favorite editor. With visual studio 2010 they have introduced blue theme and With Visual Studio 2012 they also introduced a black theme. Lots of people are using lots of different themes. Some people like black themes and some does not. I had always argument with my friends about visual studio themes. So I thought it will be a good idea to get survey about themes and so what I have done is to put a survey on my blog. As you know this blog is technical blog so most of my readers will be developers. So far I have got a interesting data so I thought it will be a good idea to write a blog post and share those data with you.

So till now I have got total 124 votes for my survey  and here is the result of the survey till now.

visual-studio-theme-survey

From, the above survey I get following fact.
  1. Lots of people like black themes out of 124 votes I got 49 for black themes. So black theme is most the popular one.
  2. To my surprise light theme comes second which I thought will be a third place but I got 39 votes for that.
This survey is still open for the five days. So if you are new to this blog and still not cast your votes then its right time to do.

Where I can get customize Color themes:


If you need more customized colour  themes than I request you to visit http://studiostyl.es/. It got thousand of customized colour themes.

Visual Studio Theme editor extension:


If you need more option than this three themes and then you should also try visual studio color theme editor extension. It's available from visual studio 2010. Here is the links for different visual studio versions color theme editor extensions.

Visual Studio 2010:
https://visualstudiogallery.msdn.microsoft.com/20cd93a2-c435-4d00-a797-499f16402378

Visual Studio 2012:
https://visualstudiogallery.msdn.microsoft.com/366ad100-0003-4c9a-81a8-337d4e7ace05

Visual Studio 2013:
https://visualstudiogallery.msdn.microsoft.com/9e08e5d3-6eb4-4e73-a045-6ea2a5cbdabe

Visual Studio 2015:
https://visualstudiogallery.msdn.microsoft.com/6f4b51b6-5c6b-4a81-9cb5-f2daa560430b

Once you install you will get lots of default color theme choice as well you can customize your theme and save it.

visual-studio-theme-editor-default-options

Which color theme I'm using:


Now it's time to write about my personal preferences. It totally depends on the lighting condition where I am using visual studio. If there a lots of light I prefer to use light theme while if it is dark then I like to have dark visual studio theme.

Hope you like it. Stay tuned for more. Still this survey is open for next five days. Please do vote for your favorite themes.

Update on 1st October 2015

Here is the latest update for the survey, the survey are closed now and here is the final result.


Here are the some statistics

Survey period : 1 Month
Total votes so far: 149
Winner : Black

Clearly Black themes are more popular!.

Thank you all who participated on survey!!. Keep reading my blog and participate in this kind of survey
Share:
Saturday, August 8, 2015

New milestone achieved- 2 million pages view for my blog - www.dotnetjalps.com

Today, I have came to know that my blog has completed 2 million page views. I am not crazy about milestone and normally I don't share my milestones publicly but this is huge milestone so I'm sharing with you and there is another reason behind it. I want to say huge thank you to all my blog readers. Thank you from bottom of my heart.

I host my blog on blogger.com. So here is the statistics from blogger official statistics.

pageviews-blogger

Till 2010, I have not started tracking page views, But after that I have started tracking page views for my blog and I am almost getting 59k page views every month and approx. 2.5 page views everyday.
Here are the top 10 blog post all time as per blogger statistics.

top-ten-blog-post-blogger 

So once again, Thank you very much dear readers and I promise I continue to write blogs in my free time.

Also, last but not least I would like thank my family specially my wife who sacrifices her time some time as I am busy writing blog post for my blog post. So thank you dear wife!. My brother and father for continue providing all the support and my little rock star from where I get all energy to write blog post.
Share:
Sunday, July 26, 2015

Video - Custom Layout in Visual Studio 2015

Recently Microsoft has launched Visual Studio 2015 with loads of features. I have created a video for a feature called custom layouts in Visual Studio 2015. Followings are link for Youtube and Vimeo

Youtube- https://www.youtube.com/watch?v=IZ4LDZU7c_s
Vimeo- https://vimeo.com/134507008



If you  don't want to watch video then I have already written a blog post. Following is a link for that.

Custom Windows Layout in Visual studio 2015

Hope you like it. Stay tuned for more!.
Share:
Wednesday, July 22, 2015

Video - Difference between var and dynamic keyword C#

I have recently produced one video about difference between var and dynamic keyword. Please go through it and let me know how it was.

You can find complete video at following URL.

https://www.youtube.com/watch?v=FPNZ_sTfZBo



Hope you like it. Stay tuned for more!.
Share:
Sunday, July 19, 2015

SQL Server- Guest Post - Solutions for SQL Server Master Database Corruption

This blog post a Guest Post from one of my friend Priyanka Chouhan.

About Author:


Priyanka Chouhan is a technical writer in “Stellar Data Recovery “with 5 years of experience and has written several articles on SQL. She has the fine knowledge of SharePoint and SQL Server. In the spear time she loves reading and gardening.

Here is the her blog about - Solutions for SQL Server Master Database Corruption

Master database is a backbone of the SQL Server database. It is a must have database and user cannot start the SQL Server without master database. It contains the all information about server configuration. When a user installs a SQL Serverthen, it usually creates master, model, MSDB and TEMPDB system databases by default. MSDB and TEMPDB depend on the version of SQL Server database. All system databases performs the different task like: master database is used to store all system level information, TEMPDB stores the information about temporary tables and temporary stored procedures, model is worked as a template for all system created database and MSDB is used by the SQL Server Agent to schedule alerts and jobs.

Corruption in the master database is not a new thing. I will advise to all database users to take the backup of master database because without master database, SQL Server cannot be started. If corruption is high in the master database then SQL Server does not allow starting the database. In this case user can rebuild it by using command prompt or restore from the latest backup (Scroll down to see detailed information). In case of minor corruption, it might be possible that user may start the database but SQL server does not allow to access the details inside the database.

Restore from the Backup


These are the steps to restore the master database from the backup:
Start SQL Server Configuration Manager then click on the SQL Server Services.
Stop SQL Server Agent (it might connect first and prevent you to connect as a second user).
Right-click SQL Serverandthen click Properties.
Advanced tab, in the Startup Parameters box, insert –mto start the SQL Server in the Single User Mode.
Now Start SQL Server.
Start cmd.exe from start menu
Type SQLCMD on command prompt
Restore the master database using command:
RESTORE DATABASE master FROM DISK = ‘D:\MyFolder\master.bak’ WITH REPLACE
Now remove the startup parameter –m.
Start SQL Server.

This is the best way to fix master database corruption issues. If backup of corrupt master database is not available then user can easily rebuilt it by following below steps.

Rebuild System Database


Rebuild the system database means we are going to drop the re-create in their real location.

Open the command prompt and change the directories to the location of setup.exe file on the local server. Its default location in the server is C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Release.
Enter the following command in the command prompt Setup
Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=Instance_Name /SQLSYSADMINACCOUNTS=accounts [ /SAPWD= StrongPassword ] [ /SQLCOLLATION=Collation_Name]
Once the rebuild process completes then it returns the command prompt without any message. User can view the Summary.txt log file to verify the process. The default location of theSummary.txt log file is C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Logs.

Conclusion:

These are the methods to solve the corruption in the master database. Sometimes antivirus software can be the reason of master database corruption. So read the guidelines here to choose the antivirus https://support.microsoft.com/en-us/kb/309422/en-us



Share:
Sunday, July 5, 2015

Dependency Injection with Autofac: Keyed Registration

This will going to be a fifth post in my Dependency Injection series with Autofac. If you have not gone through all the previous post of this series then I would like to encourage you to go through it. Following is a list of blog posts.
Dependency Injection with Autofac : Getting Started
Dependency Injection with Autofac : Constructor Injection
Dependency Injection with Autofac : Module Feature
Dependency Injection with Autofac : Registration Ordering
Dependency Injection with Autofac: Named Registration

Keyed Registration:

There are multiple ways of register and resolving type in Autofac and keyed registration is one of them. Just liked named registration here you can resolve a type with a key. That key can be a valid C# object. Let’s create a sample console application for it. I have added reference of Autofac via NuGet package as did in my previous blog post. Following is a Customer class that I’ve created for the Keyed registration demo.


After creating Customer class following is a code that I’ve written for demo of Keyed Registration with Autofac.
If you see above code carefully, You can see that first I have created a object of customer as keyCustomer then I’ve register customer type with that keyCustomer Object.  After that I’ve resolved customer with that keyCustomer object and assigned few properties and then Print that customer with “PrintCustomer” object.
One thing to note that when you register type with Keyed Registration It can not be resolve without it. You can only resolve that type with same key you have registered.
Now when you run this application. You will following output as expected.

autofac-keyed-registration-output
That’s it. Hope you like it. Stay tuned for more!!.
You can find complete source code of this Autofac series on Github at - https://github.com/dotnetjalps/AutofacSamples
Share:

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews