Visual studio feeds

All Visual Studio blogs in one place


Enter your email address:

Delivered by FeedBurner

Increase your website traffic with



Anti-spam: How many eyes has a typical person?

Follow us on FB


AngularJS Debugging and Performance

AddThis Social Bookmark Button
Just over a week ago an Angular project went live after several years of development. Our team peaked at over 25 developers distributed around the world. The source ended up at over 80,000 lines of TypeScript code (although I jokingly note this ends up as just one line of minified JavaScript) and includes hundreds of controllers, services, views, etc. You don’t get that far in an enterprise app without learning a thing or two about debugging and performance. I just released my video “AngularJS: Debugging and Performance” as the 12th lesson in my course, Mastering
AngularJS. This course covers everything you need to know to build business apps in Angular. Topics start out with fundamentals that provides an end-to-end overview, followed by a deep dive into scope and the digest loop. Learn about advanced filters, how dependency injection works, and what the built-in Angular services are. Lessons cover consuming web services from Angular (using both $http and ngResource), handling routing with ngRoute and ui-router, fundamentals of directives and advanced directives. I cover testing using Jasmine and this latest video is all about debugging and performance. The debugging and performance lesson starts by covering some of...(Read whole news on source site)

Get the login name of the current user in SharePoint 2013

AddThis Social Bookmark Button
Recently in one of my project, I wanted to retrieve the logged in user’s login name in the format of domain\username. This seems simple and to retrieve the username, I used the below code. SPContext.Current.Web.CurrentUser.LoginName But the output I received contains some extra stuff along with my domain name and username. My domain name is sp1013domain and user name is spsetup, see the output that generated by the above line of code. i:0#.w|sp2013domain\spsetup While searching over web, I found some guys speaking about retrieving the domain\username by splitting the above result by pipe (|) symbol, I was not convinced with that. The extra characters
added to the login name is by the claims authentication, so definitely we should be able to retrieve it automated. There is a SPClaimProviderManager class that is responsible for management of various claim providers in the SharePoint farm, and there is a DecodeClaim method, that decodes a claim from an encoded string, and for my requirement these are useful to retrieve the required information. string userName = null; SPClaimProviderManager mgr = SPClaimProviderManager.Local; if (mgr != null) { userName = mgr.DecodeClaim(SPContext.Current.Web.CurrentUser.LoginName).Value; } When I print the userName, I got the below output. sp2013domain\spsetup The DecodeClaim method is useful to retrieve the correct login name of the current user....(Read whole news on source site)

Implementing SLAB in an Azure service

AddThis Social Bookmark Button
In my previous post,  I talked about design considerations when using SLAB, and presented a class to be changed from regular trace logging to semantic logging using SLAB. In this post, I’m going to show you how to set up the event logging with SLAB, how to write the entries to Windows Azure Table Storage, […]

AngularJS Quick Tip: Counting Watches

AddThis Social Bookmark Button
Sometimes for troubleshooting purposes it is important to understand how many watches exist in an Angular app. You may be surprised to find that in certain scenarios, you are generating many more watches than you anticipate. For example, simply using ng-repeat on a long list will create a watch for every element unless you use a library like bindonce. Fortunately, because Angular is tightly coupled to the HTML DOM, it is not difficult to hook in and look under the hood. To make it even easier, I created a simple module called that contains
a single directive and service. To use the module, you simply place a directive at the topmost element in your app you want to count watches from, then reference the service and call the countWatches() method any time you wish to get an updated count. The main logic simply checks to see if an element has an associated scope, and if it does, uses Angular’s internal $$watchers collection to add the count. if (element.scope()) {
    _this.watchCount += element.scope().$$watchers.length;
} The function then recursively calls itself for each child of the element being inspected. angular.forEach(element.children(), function (child) {
}); The directive is...(Read whole news on source site)

The Web Weekly - Edition 9

AddThis Social Bookmark Button
Edition 9 of my Web Weekly newsletter has been published (sign-up to the right to receive it automatically)! Here’s what’s in this latest edition. The Web Weekly Newsletter Edition 1 The Web Weekly Newsletter Edition 2 The Web Weekly Newsletter Edition 3 The Web Weekly Newsletter Edition 4 The Web Weekly Newsletter Edition 5 The Web Weekly Newsletter Edition 6 The Web Weekly Newsletter Edition 7
The Web Weekly Newsletter Edition 8

font-size: 34px; font-weight: bold; line-height: 100%; padding: 0; text-align: center; vertical-align: middle;">
Keeping You on the Cutting Edge of Web Technologies

Useful jQuery Plugins

AddThis Social Bookmark Button
The jQuery plugins helps the Web developers to improve the UX in their web applications . There are plenty of frameworks and jQuert plugins available in the IT market and below are some of the useful jQuery plugins. Useful jQuery Plugins Image Cropper A simple jQuery plugin for image cropping. 3D Grid Effect 3D Grid Effect is a plugin to create a 3D Effect for an Grid item. multiScroll.js multiScroll.js is a jQuery plugin to create multi scrolling sites with 2 vertical layouts. PgwSlider PgwSlider is a fully responsive slider for jQuery / Zepto and supports all browsers and SEO
compaint as well. Transit Transit is a super smooth CSS  transitions and transformations for jQuery. Headhesive.js Headhesive.js lets the web developers create on-demand sticky header . slick slick is a plugin which brings in the carousel effect. RowGrid.js RowGrid.js is a simple ,  small and lightweight jQuery plugin for placing items in straight rows. Vibration API An API specially made for mobile devices that lets the developers to vibrate a device for a given duration. jQuery Tilted Page Scroll This plugin lets the web developers to create a 3D tilted scroll effect. Have you come across any other interesting jQuery...(Read whole news on source site)

Micro-optimization: the surprising inefficiency of readonly fields

AddThis Social Bookmark Button
Introduction Recently I've been optimizing the heck out of Noda Time. Most of the time this has been a case of the normal measurement, find bottlenecks, carefully analyse them, lather, rinse, repeat. Yesterday I had a hunch about a particular cost, and decided to experiment... leading to a surprising optimization. Noda Time's core types are mostly value types - date/time values are naturally value types, just as DateTime and DateTimeOffset are in the BCL. Noda Time's types are a bit bigger than most value types, however - the largest being ZonedDateTime, weighing in at 40 bytes in
an x64 CLR at the moment. (I can shrink it down to 32 bytes with a bit of messing around, although it's not terribly pleasant to do so.) The main reason for the bulk is that we have two reference types involved (the time zone and the calendar system), and in Noda Time 2.0 we're going to have nanosecond resolution instead of tick resolution (so we need 12 bytes just to store a point in time). While this goes against the Class Library Design Guidelines, it would be odd for the smaller types (LocalDate, LocalTime) to be value types...(Read whole news on source site)

ValidateAntiForgeryTokenAttribute and Ajax Requests

AddThis Social Bookmark Button
        Introduction:                    Cross-Site Request Forgery (CSRF or XSRF) is still in the top ten list of The Open Web Application Security Project (OWASP). Fortunately, ASP.NET MVC has built-in support to mitigate this attack since its earlier versions. The default ASP.NET MVC template include code to mitigate this attack. But if you are using ajax requests then you need to keep some points in your mind. In this article, I will tell you some tips that will help you when you are doing CSRF protection in your ajax requests.         Description:                         First tip is that when you send an ajax request to server then you
need to explicitly attach anti-forgery token with your request. Let say you have this form in your ASP.NET MVC view, @using (Html.BeginForm("Action", "Controller", FormMethod.Post, new { })) { @Html.AntiForgeryToken() ....................... .......................                     Then you can easily include/attach the request anti-forgery token with your ajax request using these lines of javascript(assuming that you are using jQuery), ...(Read whole news on source site)

How to secure your WCF service and authenticate users

AddThis Social Bookmark Button
There are several steps involved in making your WCF service secure, and ensure that clients consuming your service are properly authenticated.  WCF uses BasicHttpBinding out-of-the-box, which generates SOAP envelopes (messages) for each request.  BasicHttpBinding works over standard HTTP, which is great for completely open general purpose services, but not good if you are sending sensitive […]