Monday, December 01, 2014

Lock the damn FN key in surface!

I bought surface pro 3 few months back and the most annoying feature on the device is that the entire F1..F12 require you to press FN with the key

Well apparently you can switch and make the FN locked by default by simply pressing FN and caps lock at the same time , now the most annoying issue is that to press Home/end/PgUp/PgDn/Del you need press FN


Friday, October 18, 2013

This version of Visual Studio requires Internet Explorer 10 which is currently not installed on your computer. Please install Internet Explorer 10 and then retry installing Visual Studio

I don’t really understand why VS2013 requires me to install Internet Explorer (no matter the version).

This is not the way to go, unless all the UI is HTML based and they didn’t do it cross browser …



Thursday, October 10, 2013

WEBAPI and Attribute Routing (prior to ASP.NET 4.5)

I am using WEBAPI v1 and I had to create few more routes in my API  for user controller (on top the default 4 CRUD)

after added one more method (that gets 1 parameters) and put attribute route for it [POST(“api/Users/WhoAmI”)] I saw that when trying to POST to “..API/Users” I get exception “Multiple actions were found that match the request”


My problem was that since I didn’t set static route to the original method (Postuser), than the default WEBAPI method to match an action (System.Web.Http.Controllers.ApiControllerActionSelector –> SelectAction) is called and it iterating on all methods on the controller class finding several methods with one parameter and throws the exception


My solution was to set the STATIC route on the original method [POST(“api/Users”)] and this fixed the problem

Friday, October 04, 2013

he data connection uses Windows Authentication and user credentials could not be delegated. The following connections failed to refresh: PowerPivot Data

Started using Sharepoint 2013 after several years which I didn’t touch this product. M$ did an amazing job, and I consider this one of the easier application to integrate with.

One thing that I liked is the office 365 (web version of Office).

When I try to refresh data using the web version I got a nasty error “the data connection uses Windows Authentication and user credentials could not be delegated. The following connections failed to refresh: PowerPivot Data” although my connection was clearly using SQL authentication in the query string

While searching for answer I found this article but sadly it is not related, since as said I am using SQL authentication.

I decided to review the connection and found a new option for “Excel services: Authentication Settings”


And when opening I saw that the default was use the authenticated user account (which I don’t need)


The solution in my case, was to switch to “None” and all is good Smile

Tuesday, October 30, 2012

Entity Framework, Inheritance, eager loading of association

Consider the following three objects:


string Name

Developer : Person

List<Skill> Skills




I thought that in this simple inheritance I would be able to eagerly load the associated Skills of the developers  if any in the list, by doing the following:

var people = (FROM p in Db.people.include((dev as Developer) => dev.Skills) select p).ToList();

Or Maybe just using string based ‘include(“Skills”) ‘

But this simply doesn’t work, in term of no support for such syntax or failure in runtime (not finding skills)

The only method I found to resolve this is to:

var developers = (FROM p in Db.people.OfType<Developer>().include(dev =>dev.Skills) select p).ToList();

var people = (FROM p in Db.people WHERE !(p is Developer) select p).ToList();

var result = people.union(developers);

very ugly since I need to exclude the special entries but working.


This case was raised long time ago and was rejected by M$…. here

Thursday, October 18, 2012

Quick Web APP infrastructure called Meteor

Just got an email from a friend about a “new” infrastructure to write web apps quickly called Meteor.

From the screen cast and short examples I have seen this look like a real promising infrastructure that can really grow, while I do have lots of concerns related to security it seems that they did something and provided some mechanism for it – still I am sure lots of work has to be done

One of the things I really liked is that the entire page is actually listening to the server side, even when you deploy a new version it will automatically be update on the client side (magic).

…. wow ….

Tuesday, October 16, 2012

Sending emails–not as easy as you think

I am just doing the last few lines of code for my new site (To be released very soon), part of every site is the ability to send emails to your customers.

I will start with 1 important line – “The communication with your customers is the key for success and as such you need to ensure that you have the right infrastructure”

You might want to use your native SMTP on your ISP/Host, and have write fancy code that will manage delivery, OOO operations, Unsubscribe, Report on delivery, track clicks, bounces and the list can continue

But before you do that remember the first syntax and understand that to write such infrastructure you need deep understanding and tons of line of code and time, which no one has.

Another alternative is to integrate into online infrastructure (using SMTP, Rest api, etc) and get all the above features for small price between 10$ – 80$ for small business depend on usages.

I decided to use SendGrid because it was free for my usages, but there are other companies like MailChimp, etc


While writing the small piece of code that just send the messages using SendGrid SMTP, I face few road blocks:

  1. My email went to the SPAM folder
  2. When I finally got the email it was badly formatted without style sheet

You really need to read some articles that talk about how NOT to go to the SPAM folder before you write emails and as for the styling I found out that there are many constrains for HTML in emails

Luckily there is a good site called PreMailer that enables you to convert HTML page or text into a well formed email with inline stylesheet as needed and it will also alert you on risky in your current stylesheet

After all the above the key was to TEST-TEST-And TEST again, which is pretty weird when you think about it, since you see the output but you can never know what will happen