The Culture Code

http://www.amazon.com/Culture-Code-Ingenious-Understand-People/dp/0767920562|Clotaire Rapaille|

The Culture Code Cover

Dr. Rapaille describes in this book his discoveries on Archetypes applied to marketing. Gives a very general description of his method to uncover them using focus groups in extended sessions. One of the dissapointments about this book was my expectation to understand different cultures as it focus absolutely on the United States and a few topic on the French, English and German cultures. Some peeks to the Japanese and Italian. But that’s it. Patethically Euro-American centered. Also, it’s quite dissapointing the feeling left behind the attitude of being “more American than the Americans” o más gringo que los gringos, as the most common words are US, WE, OURS… It gets to a point in which is hard to say if an archetype, or “Code”, is mostly a reflection of Dr. Rapaille’s feelings.

Anyway, the insights given by the book are very interesting, as the sex/violence, food/fuel, money/proof… Most Codes are instructing and give us a peek on the perceived ingenuity, greed and results oriented attitudes we have of the americans.

[Hope I can extend this post as I re-scan the book]

 

Read More

ERB with custom tag

Ruby ERB is a great library that let’s you process a file and embed Ruby code within it using <% ... %> tags. As the file is processed, the code is evaluated and content may be replaced.

This is generaly used with HTML (or RHTML as generally known). Rails does this.

I’m now coding a generator for ASP scripts using ERB. As both ERB and ASP uses the <% <%= tags, I modified the original erb.rb file to use <@ <@= tags so the ASP code can be left as usual. Get the modified file here. If you want to use a diffent tag, I recommend to diff my file with the original erb.rb

Read More

How to *REALLY* disable ASP.NET viewstate

The .NET Framework and ASP.NET have some aspects that sometimes really annoys me. One of these is the infamous __VIEWSTATE used to track the state of all the controls in the page.  What is annoying about it is that it’s both a security breach and a performance issue. Also, makes easy things hard.

I wanted to remove it from an app I’m working on, so I started disabling it as suggested by MS. The VIEWSTATE is effectively not used but it stills yields the hidden input field to detect the Postback. This is a nag since this form is performing a GET action and the __VIEWSTATE is passed as part of the QueryString. After some Googling I found a method suggested by Scott Hanselman to move the position of the input field. I just adapted to plainly remove the complete thing as shown below:

       protected override void Render(HtmlTextWriter writer)
        {
            var sw = new StringWriter();
            var htmlWriter = new HtmlTextWriter(sw);
            base.Render(htmlWriter);
            string html = sw.ToString();
            int start = html.IndexOf(“            if (start > 0)
            {
                int end = html.IndexOf(“/>”, start) + 2;
                html = html.Remove(start, end – start);
            }
            writer.Write(html);
        }

    }

All this code just to get a simple, common, standard query string.

Read More