Friday, June 29, 2012

Wednesday, June 20, 2012

6 Things You Need to Know About jQuery

http://www.cio.com.au/article/428093/6_things_need_know_about_jquery/?fp=4&fpid=16
1. jQuery Promotes Simplicity.
2. jQuery Elements Display Even When JavaScript is Disabled.
3. jQuery Easily Integrates With the Visual Studio IDE.
4. jQuery Makes Animated Applications Just Like Flash.
5. jQuery Pages Load Faster.
6. jQuery Can Be SEO Friendly.

An online HTML5, CSS3, JavaScript editor

Here's an online HTML5, CSS3, JavaScript editor for web designers and developers. It is very simple to use 
http://liveweave.com

HTML5 Offline Web applications as an afterthought in ASP.NET MVC

http://www.jefclaes.be/2012/03/html5-offline-web-applications-as.html

Thursday, June 14, 2012

How to covert string to image in MVC action?

        public FileContentResult ReturnImage()
        {
            Bitmap img = CreateBitmapImage("Render string to an image.");
            return File(Image2Byte(img), "image/tiff");
        }

        private byte[] Image2Byte(Bitmap img)
        {
            byte[] byteArray = new byte[0];
            using (MemoryStream stream = new MemoryStream())
            {
                img.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp);
                stream.Close();
                byteArray = stream.ToArray();
            }
            return byteArray;
        }

        private Bitmap CreateBitmapImage(string sImageText)
        {
            Bitmap objBmpImage = new Bitmap(1, 1);
            int intWidth = 0;
            int intHeight = 0;
            // Create the Font object for the image text drawing.

            Font objFont = new Font("Arial", 12, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);

            // Create a graphics object to measure the text's width and height.

            Graphics objGraphics = Graphics.FromImage(objBmpImage);

            // This is where the bitmap size is determined.

            intWidth = (int)objGraphics.MeasureString(sImageText, objFont).Width;

            intHeight = (int)objGraphics.MeasureString(sImageText, objFont).Height;

            // Create the bmpImage again with the correct size for the text and font.

            objBmpImage = new Bitmap(objBmpImage, new Size(intWidth, intHeight));

            // Add the colors to the new bitmap.

            objGraphics = Graphics.FromImage(objBmpImage);

            // Set Background color

            objGraphics.Clear(Color.White);

            objGraphics.SmoothingMode = SmoothingMode.AntiAlias;

            objGraphics.TextRenderingHint = TextRenderingHint.AntiAlias;

            objGraphics.DrawString(sImageText, objFont, new SolidBrush(Color.Red), 0, 0);

            objGraphics.Flush();

            return (objBmpImage);

        }

iTextSgarp, ASP.NET Create PDF From GridView

http://csharpdotnetfreak.blogspot.com/2012/06/aspnet-create-pdf-from-gridview.html

Control the execution order of your filters in ASP.NET Web API

http://www.strathweb.com/2012/06/control-the-execution-order-of-your-filters-in-asp-net-web-api/

 public class BaseActionFilterAttribute : ActionFilterAttribute, IBaseAttribute
{
    public int Position { get; set; }
   public BaseActionFilterAttribute()
   {
     this.Position = 0;   }
   public BaseActionFilterAttribute(int positon)
   {
      this.Position = positon;
   }
}

Thursday, June 7, 2012

How to enable Windows Authentication for IIS 7 on Windows 2008 server?

Solution: Add related role service.
Server Manager ->  Roles -> Role Services




Reference: Following link is for Windows 7/Vista
http://blogs.msdn.com/b/hongmeig/archive/2007/08/20/how-do-i-turn-on-windows-authentication-in-iis-7.aspx

C# On a Scale of One to Ten

  • you can write simple expressions
  • you can write a series of statements
  • you can write small programs
  • you rely on language features to improve code
  • you use a productivity tool like ReSharper, but rarely get code improvement suggestions
  • you can overrideoverload an operator without having to look it up
  • you understand all the keywords in the language and how they’re used
  • you can confidently talk about the internal implementations of how c# works
  • you have an opinion about new features being developed and are providing feedback
  • you are Jon Skeet



  • Wednesday, June 6, 2012

    What is design? from Steve Jobs

    how it works


    Design is a funny word. Some people think design means how it looks. But of course, if you dig deeper, it's really how it works. The design of the Mac wasn't what it looked like, although that was part of it. Primarily, it was how it worked. To design something really well, you have to get it. You have to really grok what it's all about. It takes a passionate commitment to really thoroughly understand something, chew it up, not just quickly swallow it. Most people don't take the time to do that.
    Creativity is just connecting things. When you ask creative people how they did something, they feel a little guilty because they didn't really do it, they just saw something. It seemed obvious to them after a while. That's because they were able to connect experiences they've had and synthesize new things. And the reason they were able to do that was that they've had more experiences or they have thought more about their experiences than other people.
    Unfortunately, that's too rare a commodity. A lot of people in our industry haven't had very diverse experiences. So they don't have enough dots to connect, and they end up with very linear solutions without a broad perspective on the problem. The broader one's understanding of the human experience, the better design we will have.


    http://www.wired.com/wired/archive/4.02/jobs_pr.html


    Tuesday, June 5, 2012

    Daily Routine of a 4 Hour Programmer

    Second, Don’t take any breaks for e-mail, surfing on the net, or anything like it. Here’s why: In an hour’s time, I can get x number of functions coded. I have found that if I work for four continuous hours, I can deliver not just 4 times but 8 to 16 times that amount of work. You will experience this when you 100% focused on one objective and not thinking about anything else. This is what we call the Flow mental state. I plan to write more about the state of Flow in a future blog entry.

    http://www.jayonsoftware.com/home/2012/1/9/daily-routine-of-a-4-hour-programmer.html

    The Differences Between Development on Windows Azure and Windows Server

    http://rachelappel.com/the-differences-between-development-on-windows-azure-and-windows-server