Skip to main content

Posts

AngularJS validation directives library

I wrote a set of directives that make validation in AngularJS a tad simpler. The directives are available at https://github.com/technovert/angular-validation I have detailed about the directives on my company website http://blog.technovert.com/2014/03/angularjs-form-validation-library-directives/ and there is also a jsfiddle to play with http://jsfiddle.net/3vxgy/1/ or

Common Pitfalls using AngularJS

I recently blogged about some common pitfalls using AngularJS on my companies blog. Anyone interested in the details should visit my post at. http://blog.technovert.com/2014/02/common-pitfalls-angularjs/ You can also subscribe to my feed here Happy Reading :)

Integrating ASP.Net MVC with AngularJS

We recently released a Project Template for ASP.Net MVC and AngularJS here and here . I did a follow up post detailing how the project template has been setup and how to make AngularJS and MVC play well together on my company blog . If you are interested in understanding how the template works head over to my blog post and read it!

Visual Studio Project Template for AngularJS SPA + ASP.Net MVC \ Webapi

I am very exited to announce that our team at Technovert has release a Visual Studio project template for AngularJS . More details on how to install and use this template are available on the Technovert Blog   Knockout.js has been a standard library that .Net devs have been using for creating rich interactive business apps. But AngularJS from Google provides a more complete framework and is gaining a lot of dev community support. This project template can help you get up and running with AngularJS in no time and evaluate it for your future needs.

AngularJS Model - ViewModel

Recently Robin Ward did a comparison between AngularJS and Ember (both the post and the comments are interesting read). One of the complaint that Robin had that AngularJS does not provide any specialized model class. As described in the blog There is no standard Model base class, nor is there a component or interface in AngularJS that defines what a model is supposed to be. What that means is that anything defined on $scope can acts as model, as this sample on the blog describes For some (like me) this is the flexibility where as for others who want a more structural approach this is a nuisance.AngularJS does not even provide any definite guidelines around how the model should be actually designed to be effective with AngularJS This leads to what we call as $scope pollution. We define multitude of properties on the $scope object and managing it becomes difficult.  Looking at the code one cannot tell what is the actual model and what properties are just to support UI...

IIS Url Rewrite and HTTP POST data

If you play around with IIS Url Rewriting rules and try to do redirects on an HTTP POST you loose your POST data. To make sure you get the post data you have to set the `redirectType` to `Temporary` within your rules. So the action configuration looks like this <action redirectType=" Temporary " type="Redirect" url="http://{HTTP_HOST}{REQUEST_URI}"> </action> You may think what scenario warrant a POST request redirect. We faced one such scenario while doing SSO with a federated Identity Provider (IP)  such as Google, Azure AD. In federated authentication scenario once the user is authenticated by the IP, it redirects back to your site with claim tokens in a POST request over secure channel (https). In our case we wanted to redirect to user back http after receiving the request. But any redirects were causing loss of token. By doing a 307 (Temporary) redirect we were able to preserve the post data.

Remote login on Azure Roles

In case you do not follow this guy :), there has been one significant change to Azure which would make developers life much easier while debugging and testing an azure deployment. You can now enable remote login into azure deployment without requiring you to enable it during the package creation. This means even if the deployment happened with Remote login not enable, you can still enable remote login from azure management portal directly. More details are available here  So no more forgetting remote login option. Just do a deployment and if required enable remote login from azure management portal .

Logging .Net Exception Details with Complete Stack

I learned today that in .Net doing a ex.ToString() would log the complete exception details including any inner exception details. The important thing here is that it would do this recursively so if there is an InnerException it would call ToString() on it, which in turn can call ToString() on the next level hence forming a recursive chain. So we can do away with such format string System.Diagnostics.Trace.TraceError("The error was {0}. Stack Trace {1}. InnerException Details {2}",ex.Message, ex.StackTrace,ex.InnerException.Message);  

Google Driven Development GDD

In this era of TDD, BDD, DDD and all other  *DDs , we have a breed of developers doing Google Driven Development (GDD). Sounds interesting, indeed it is :). Here is how to identify a GDD guy This person does not believe in writing anything on his own, copy/paste from blogs, articles, source code is a way of life. And since I have not written it I don't care how it works as long as I see something working. His best friends are Ctrl-C, Ctrl-V and Google. Cannot write 5 lines of code or code for 5 minutes without doing a Google search. His productivity is directly related to performance of corporate network, and how fast Google searches. If the network is down, it's better to go for a coffee. Search hours on Google for " Object reference not set to an instance of an object " and then believes that the whole world is facing the same issue. Who cares what the context of problem is. To solve the error He then tries each and every solution that Google GOD provide...

Azure and Package Deployment for Specific Roles

When a single Azure Subscription Service has multiple roles (Web and Worker) in it, updates to the role cannot be selective. Time and again I have had scenarios where I wanted to update the one role but did not want to touch the other. But as Azure deployment works, there is a single package and it updates all roles in the subscription.  While doing an update today I was pleasantly surprise that now while updating the site I do have an option to select which specific role to update. Here is what the dialog looks like now So now we can update specific roles without touching other ones. Great!!! Things to keep in mind here would be, once deployment is complete you cannot tell which role was updated and which is still running on a older version. But the deployment name does change. So i think this is a good feature for some quick fixes, else we should stick to simultaneous updates only.

Angularjs and inplace edit

AngularJS is an awesome framework and Angular Directives make this framework super awesome :) AngularJS  directives help us extend the existing HTML DSL. You can create new tags, extend functionality using existing tag and create reusable component. I recently created a Inplace editable control in AngularJS. It basically allows to do in place editing for elements like H1, H2, H3 div etc, basically all read only control. I took the initial idea from this fiddle and added Text selection on edit. Cursor positioning Handle the Enter key press. Here is my fiddle

Integrate ASP.Net MVC + WebAPI with Autofac in 5 mins

Recently i configured Autofac with ASP.Net MVC 4 and WebAPI . Here are the steps required to configure Autofac Install package Autofac.MVC4 Install package Autofac.WebApi Add a class AutofacBootstrap. Use this class to configure the dependencies within your project. Open Global.asax file and add a method like  Call the method from Application_Start And you are done !!

Appharbor build notification using Google Talk (XMPP) - Implementation

In my last post about creating an Appharbor notification bot, I described about the problem domain, the solution approaches and how the end to end scenario works.This post would dig deeper into the implementation aspects of the solution. To start with we need to understand the two esential ingredients for this recipe Appharbor Service hooks : Appharbor Service hooks are the building block for the solution. Appharbor provides capability, where it can post to any public url with status of a build on completion. Service hooks are available for events Build Success. Build failure. XMPP protocol : XMPP is a protocol used for Instant Messaging (IM) communication. It allows us to relay messages to the users IM client using XMPP servers (in our case Google Talk messaging servers). With the understanding on these two concept we are ready to dive into the nitty gritty  of the solution. Assuming that the user did the initial configurations to setup notifications (see ...

Appharbor build notification using Google Talk (XMPP)

Appharbor recently ran a contest to encourage developers to use their API and showcase the API capabilities. Based on some ideas floated by the Appharbor team I too decided to build something useful\interesting for Appharbor platform.I decided to create a desktop notification client which can notify user when the build is complete, its status in terms of success or failure. How Appharbor works is that you push your code to a git repo supported by Appharbor ( github , bitbucket etc). As soon as the checkin is done, Appharbor pulls the code base build it, and updates the running website. It's like a single click deployment! I started to explore my option for a desktop client and some of the options I though of were Build a desktop windows app and integrate with the Appharbor API.  This approach was the most flexible approach. I have full control of features and capabilities, but would take a good amount of time to develop. Use third party desktop notification apps like...

Azure Blob file download not resuming !

Azure Blobs are a scalable infrastructure to host\store files. I was working on understanding the behavior of large file uploads and downloads and create a reasonable strategy to support both scenarios in our application. Azure blob file can be downloaded using any browser or internet download manager. For a public blob the url of file would suffice, but for downloading a private blob one needs to create a url containing the Secured Access Signature . While testing downloads I realized that in case I pause and resume the download in Firefox or Chrome or any download manager the download restarts !!! I was expecting that the download should start from the place it paused. Imagine the scenario where we have uploaded half of a 2GB file and resuming the download would start over again !!! Clearly the Azure Blob storage was not supporting HTTP Range header . As it turns out the Azure blob service is not a trivial file server. It is more of a Storage Application Server. It exp...

Alogorithm: Finding Longest Increasing Subsequence using Patience Sort in C#

Finding the Longest Increasing Sequence is an interesting problem and there are multiple solutions available with varying time complexity. The solution that i plan to share today is the uses of Patience Sort  to find such a sequence. The solution finds a particular longest increasing sub-sequence as the original sequence may contain more than one such sequence. In 1999 The Bulletin of the American Mathematical Society published a paper by David Aldous and Persi Diaconis entitled: “Longest Increasing Subsequences: From Patience Sorting to the Baik-Deift-Johansson Theorem”. I have implemented this solution in C# and derived it from this excellent article which provides a Python implementation for the same. This is how patience sort works Take a deck of cards labeled 1, 2, 3, … , n. The deck is shuffled, cards are turned up one at a time and dealt into piles on the table, according to the rule A low card may be placed on a higher card (e.g. 2 may be placed on 7), or...

Caching Images downloaded from web on Windows Phone Isolated storage

I was helping on a Windows Phone application where the requirement was to cache the images the phone downloads on the isolated storage for offline viewing. I wanted a solution which was simple and as transparent as possible. While researching I found  someone wrote a Silverlight converter for loading images from isolated storage. Taking that as a base I created a converted which can Load image from web (http + https), and persist it to isolated storage. In case of network connectivity issues can load the same image from isolated storage. It does that by mapping the http url to a isolated storage location. In case the network is down and the image is neither there in cache, loads a default image, passed as parameter to converter. Here is the gist for the implementation. To use the converter Import the name space. Declare the converter as resource. Set the Image Source Property to use this converter like this 

Architect? Give me a break :)

Davy Brion has posted some rants about the Microsoft MVP program and the type of people that are attracted to it. What David has mentioned holds true in some other areas of IT industry too. "Architect" another cool but severely abused title :) If you take David's post and replace "Microsoft MVP" with the word "Architect" you would find everything still holds true. I am a strong believer that "Architect" as a designation\title should be done away with. In my 8+ years of IT experience I have seen quite a few of this breed :) With exception of few I found most of them just good with UML modelling tools (such as Visio) Generating high quality project artifacts (Such as Function Specs, Design documents) Buzz word mongers. Smooth talkers These maybe important qualities to have in an Architect but a sound technical background is a non negotiable. Everyone knows what is the end result if you engage such people. Such Architects most...

So you got a job offer !!!

So you got a job offer !!! It always a great feeling irrespective of ones experience level. You start envisioning about your fatter pay-cheque, your role, your growth prospects, may be a new city (in case you are transferring).  During this euphoria we may throw caution to the wind and not do a thorough check about the organization, type of work, work culture. The consequence of our carelessness can cost us, sometimes dearly. Through this post I just want to highlight things one should consider while looking out for jobs and while accepting any job offer. Since i am an IT professional i can and would only talk about IT companies and jobs. Product Company vs Services Company : Many may not have any preferences on this but this distinction has an affect. Services company is all about billing and one almost always works under deadline pressure, delivery pressure. The story is different in product companies where activities revolve around the product. Time to market is im...

Case of missing Iron Foundry VMC client

While installing the latest Iron Foundry VMC client and Cloud Foundry Explorer there is an installation issue. Due to this VMC client install gets lost if both the VMC Client and CF Explorer are installed irrespective of the location of the install. As it turns out, if you install VMC client first and CF Explorer next, installer would delete the VMC install directory. If you install CF Explorer first and try to install VMC client later you get this error "This version or newer version of VMC Command Line Tool is already installed."  Current workaround would be copy the installed folder for VMC before starting CF Explorer install. Hope it helps.