Blog

Using the LINQ Aggregate fuction to create a CSV string from an IEnumerable.

By Osvaldo Orozco   This is the basic code that you can find when someone converts from an IEnumerable to a CSV string. This will be our starting point.   StringBuilder strBuild = new StringBuilder(1024); foreach (var item in myList) {       strBuild.AppendFormat("{0},", item.Key); } if (strBuild.Length > 0)       strBuild = strBuild.Remove(result.Length - 1, 1); string result = strBuild.ToString();   Now, we are going to use the “Aggregate” LINQ  function to create the CSV string.   First we need to add the namespace. using System.Linq;   The Aggregate function has several overloaded methods. The first method:                 TSource Aggregate<TSo...

HEAD.JS

By Daniel Ramirez A simple but yet powerful script, and a must have for all the fellow web developers out there.  As its slogan says: The only script in your <head>. But why is that?, what benefits does it have? Some of the best practices in web development is to execute and include scripts at the bottom of the page, and set all the styles on the <head> section. This is to improve the usability and render first all the visible parts to the user so he/she feels the site more responsive and fast. If scripts were to be put on the <head> section, it would then block the rendering of the page (since it’s single threaded) because it has to download, parse and execute these scr...

Enabling Fiddler on the Windows Phone 7 emulator

By David E. Fiddler is a Web Debugging proxy to capture traffic between our computer and the Internet. It shows in detail all the requests made ​​by any application that accesses the Internet. Sometimes it is useful to review a page using Fiddler if there’s an image that we need or we want to know the logic of some specific client functionality, as Fiddler can tell us all files that are loaded when a page loads: html, aspx, css, js, etc. One of the biggest advantages of a Web Debugging Proxy is that it is possible to see some requests to some services in our applications. Even though we have a desktop application, if there is a reference to a service in our code and we put a call to a m...

CSS Transforms, Animations and Transitions

By Cesar Olivas Transforms, Animations and Transitions are new modules of CSS3. These 3 modules of CSS are still as a working draft and we can only do as much as it only works in webkit engine but they allow us to see the potential of these properties. This post will explain briefly what can be done using these, as they are something different, that allow us to add eye candy to our pages without fancy JavaScript. Notes:The red border on the divs are just to point to the top of the boxThese Examples will only work on Safari and Google chrome. A live example can be seen at http://www.sieena.com/Pages/transforms_animations_transitions.htmlAdded to the CSS that I will mention, all of these...

CSS Hacks and Tricks

By Cesar Olivas When developing and designing websites, it is imperative to make them work in multiple browsers, from IE6 to the newest browsers in Windows and Mac. Cross browsing is the most challenging task of a web designer and it takes lots of time and effort to do. I do not condone their use, and I think that in most cases, standard compliant CSS should alleviate most of the issues between browsers, even for the dreaded IE6. I personally start developing the website in Firefox 3, and then I go and work with IE, Safari and other browsers if needed. As personal experience, the differences between FF3, 2 and IE8 are very minor, but when it comes to IE7 and IE6 it can be somewhat dif...

How to deal with Fancy Fonts without using images!

By Cesar O.   Fonts are one of the biggest troubles for web designers to date. For ages we have been either using images or scripts to work around this issue.  If you want to use a fancy font, you have only a couple of alternatives: you could use @font-face, you could just use images (the most common way to do it), or you could use a rendering engine like SIFR  or cufon. This blog will explain roughly what these 2 alternatives are, some pros and cons and just an overview of how they work. If you want to learn in depth what they can do at its fullest I recommend going to http://wiki.novemberborn.net/sifr/ for SIFR3 and http://cufon.shoqolate.com/generate/ for cufon. SIFR This techniq...

How can you make your website work with IE6 in 6 simple steps?

By Cesar O. This is a topic that, as a web designer, I don’t like a whole lot, because compatibility for IE6 in websites costs time, effort and money; but this is not the main problem, the main problem is that you can spend more time (and I have seen this several times) making your site work for IE6 than actually creating the whole website; so, How can you minimize this? How can you reduce the cost of compatibility with IE6? There are some simple steps you can take to try and ensure compatibility and/or reduce the time you spend making it work for IE6. 1-      From conception, from the first line of html you start typing, remember that this is supposed to work for IE6. What I mean by ...

CSS Best Practices

By Cesar Olivas When you start creating a website, you have to make some choices before you start. Some of these choices are using HTML or XHTML, Tables or Divs, Floats or Position, Inline Styling, etc. In this post I will give you some explanation of all the elements that you usually need to choose from. DoctypeEvery website needs to have a doctype declared, failing to do so may result on your page rendered ineffectively.  The best way is declaring a doctype like xhtml transitional, strict or html 4.01 and help meet standard requirements. As a personal experience, this has been an issue in SharePoint implementations, since default masterpages do not include a doctype. In a customizatio...

CSS3: New Cool Features

By Cesar Olivas CSS has been around for some time now, since 1996, and it completely changed the way people used to make websites, for good. First came CSS1, with some support for fonts, color text, backgrounds, spacing between words, alignment, margins, paddings and some other attributes; it looked really good for its time. Then same CSS level 2 in 1998, which introduced some powerful features like positioning, z-index, media types. Then came the revision we use right now, CSS level 2 revision 1(CSS2.1) which fixed some errors in CSS2 and removed some unsupported features. But the web is evolving, turning into a more interactive, user-centered design; the technologies were bound to ev...