Blog

Using JSONP at MVC3

By Sergio Cavazos.   Quite recently we had to develop an API to expose some data among a MVC3 site, this data would be consumed at 3rd party domains via JSON, thus meaning that due to browser security restrictions, asynchronous requests to cross domains are restricted. Researching a little we found that there’s a technic called JSONP which allows you achieve this. What is  JSONP ?Known for JSON Padding, in this technic, an “?callback= “ is added to the querystring, so server would process the request, and instead of returning a JSON object or XML, it responds with an “application/x-javascript” response using the callback parameter as a wrapper function, so when request is answered, th...

Adding a rating column to default Blog Site’s Page in SharePoint 2010

By Rosario Almaguer. When we create a Blog site for our Site Collection, the default page doesn’t show a rating section, like in the follow image:   So if you want to show a rating you can do it following these steps: 1.       Firstly, you have to click in Site Actions and select View All Site Content, in the Lists section you will find a Posts list, click on it.   2. Next, you have to access to List tab on the Ribbon and click on List Settings section. You will see a page like this:   You can see which columns are parts of the Posts list in the Columns section.   3. In General Settings section, select Rating settings and you will be linked to the follow page:     ...

Design Patterns for Data Persistence

By Carlos Martinez. Repository Pattern   The repository is useful when trying to separate the domain logic from the logic that retrieves the data and maps it in entity objects. The repository is a small layer between the data source layer and the upper domain layers of the application. Gets the data from the data source and retrieves it to the upper layers. Also the repository contains the persistence logic of the domain objects. This logic separation has 3 benefits: ·         The logic for web services and data are centralized ·         It simplified the unit test. ·         It provides a flexible architecture that can be adapted as the overall design of the application evolves. La...

About Feedback & Tunnels (SDLC)

By Daniel Ramirez.   An important thing through the Software Development Cycle is the feedback a developer gets during or after iteration. He/she gets all kinds of it, from internal things such as code, to all the way up to what’s shown to the end users.   Feedback is important In any kind of work, I believe we should always look for some kind of feedback. Feedback does not necessarily means you have done things the wrong way, it can help you see how other people see your work, and lets you know if they understood correctly the idea behind it.   Feedback lets you know if things can be improved, motivates you to continue your work. If you get an email saying "Amazing work!"...

How to set Favicon to the SharePoint 2010 site?

  By Rosario Almaguer. SharePoint 2010 comes with a orange Favicon and it's present in SharePoint Root Folder\Template\Images [eg. C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES\]. Open this folder and search for favicon.ico and rename the file to FaviconBackup.ico. Now copy your favicon to this folder and make sure it's named as "favicon.ico", you can change the name of you favicon [eg. MyFavicon.ico]. Now restart IIS(open Command Prompt -> IISReset), clear browser cache/temproary internet files. Close the browser and reopen then browse the SharePoint site. In SharePoint Designer 2010 select Master Pages, then select the master p...

Why does my VS2010 project seem to forget assembly references at build time?

By: Alejandro Villarreal I recently experienced one of the most puzzling issues I’ve dealt with: after I finished coding my project in Visual Studio 2010 I tried to build it but it failed, complaining of namespaces that didn’t exist (which means a bunch of types that weren’t declared and thus code that the compiler didn’t understand). This didn’t make sense because the assembly that contained those namespaces was still in the “References” part of my project, and I had used IntelliSense with the types it contained. So I knew for a fact that Visual Studio did know that the assembly was there, and was able to analyze it and use it. But then why couldn’t I build my project? I tried removing a...

How to use Fiddler as an Ad Blocker

By Fernando Mendoza. I’ve been using Fiddler a lot these days. To test how requests and responses go to and come back from the server, being HTML responses, SOAP responses or custom responses from web services. One website I like a lot is StackOverflow; I use it to find answers when I’m stuck with a programming or configuration issue. I like this site, and even though they don’t have too many ads it still bothers me a bit. So one day I was thinking if it was possible to use Fiddler to modify the HTTP response from the StackOverflow server before it’s rendered by the browser. Turns out it’s possible, Fiddler has something called Rules that allows you do that. Let’s see how to do that st...

Beware of RequestUri when exposing WCF REST services through HTTPS

By: Alejandro Villarreal   We recently implemented a WCF REST service which authenticates the caller before executing any of the operations it exposes. It also has help page (so users can see the supported operations and the expected inputs) which we want to expose to any user, regardless of authentication. In principle this is very easy: we just needed to identify requests to the “help” section of our service (http://myServiceUrl/help) and allow them to go through without further validation.   We have a method that returns “true” for requests that should go through, and “false” for those that shouldn’t, so originally our code to solve the problem looked like this:   if (requestUri....

SQL Server: Fix duplicate values for uniqueness constraint.

By: Alejandro Villarreal During database development, unique indexes (or constraints) are very important part of the design. There’s always data for which you do not want to have repeated values, like usernames or email addresses. Different applications might have their own uniqueness requirements, but they all usually have at least one. It’s great when we can identify those requirements from the start and create the appropriate indexes up front. But what if your application now needs to enforce uniqueness on the values of a million-row table which has tons of duplicates in the production environment? A naïve solution (and definitely not appropriate for a production environment) wou...

SQL Server: Tip for Setting up replication in Virtual servers

By: Alejandro Villarreal Debugging replication-related problems can be extremely hard if you do not have access to an environment with the exact same replication architecture where the problem occurred in the first place. As consultants working for several clients, it is not feasible to have an exact replica of each of their environments, so a feasible solution is to set up a copy of the desired environment “on demand”, on virtual machines. This is exactly what we did a couple of weeks back, and although we finally got replication to work, we had to deal with this error first: Error 18483: Could not connect to server '<Server>\<Instance>' because '<login>' is not define...
 Next >>