Friday, December 25, 2009

Vizio TV Remote Code for Samsung BDP 1590/1600 Blue Ray Player

The manual does not list a code for the Samsung BDP 1590/1600s remote so that it can control a Vizio TV. I found that the LG TV code worked for me:

Press and Hold the TV power button on the Samsung Remote. Press 1,9 (code 19). Release the power button. Your TV should shut off (or turn on based on whether it was on or off before you started this process). This means that you found the right code for your TV.

Only downside: the TV source button did not work for me. Yet, this is better than lugging around 2 remotes to watch a movie.

Next: Looking for the remote code to control the BlueRay player using my Comcast DVR remote. (any ideas any one?)

Thursday, December 24, 2009

Changing the SMTP server used by Team Foundation Server (TFS)

Go to the folder: [TFS_INSTALL_FOLDER]\Web Services\Services (typically this will be “C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Web Services\Services”)

Open up the web.config file and update the following to values under “appSettings”
<add key="smtpServer" value="smtp server address" />
<add key="emailNotificationFromAddress" value="from email address" />

Monday, December 21, 2009

Session state unavailable in Global.asax event Application_PostAcquireRequestState

Under some circumstances (typically application start up and shut down) I would get the following “Session state is not available in this context” error within the Global.asax event: “Application_PostAcquireRequestState” whenever I tried to access the Session object.

image

According to the documentation: “The PostAcquireRequestState event is raised after the AcquireRequestState event has occurred.” And the AcquireRequestState documentation states: “Occurs when ASP.NET acquires the current state (for example, session state) that is associated with the current request.”

So I am not sure why the Session object was not available in the PostAcquireRequestStateMethod. The simple way around this issue is to wrap the access to Session state object in a try catch block and forget about it. But it bothered me, because I had the debugger set to break at all exceptions. So I wanted to find a better way.

And the better way is to wrap your access to the Session state object in the following if statement:

if (Context.Handler is IRequiresSessionState || Context.Handler is IReadOnlySessionState) {….}

Not sure exactly why the method gets called multiple times, but by making sure the ContextHandler needs the session state object, we can be sure that the session state object is available – as our access is from the PostAcquireRequestStateMethod event.

Reference:
http://msdn.microsoft.com/en-us/library/system.web.httpapplication.acquirerequeststate.aspx
http://msdn.microsoft.com/en-us/library/system.web.httpapplication.postacquirerequeststate.aspx

Saturday, December 19, 2009

DenverGov.org 1999 – 2009 – An evolutionary tale

Yesterday, we released a new version of the City and County of Denver’s website. It is mainly a skinning change authored by our web-master (Chani Goering). (The site is also undergoing changes related to hardware as well as the technologies used by some of the applications hosted on the site).

At this point I thought it would be good to take a look at how DenverGov has evolved since 1999 (the earliest that I could find a historical archive for the website). It is a telling tale and clearly shows the major leap that yesterday’s update to the site made in to the Web2.0 age.

Here is a video of the presentation taking you on a tour from 1999 to 2009.

And here is the presentation as a GoogleDoc

Thursday, December 17, 2009

JQuery Print Plugin

Just found the Jquery print plugin “JQuery Print Element” by ErikZ – works great.

http://plugins.jquery.com/project/printElement

Demo: http://erikzaadi.github.com/jQueryPlugins/jQuery.printElement/Sample

Only thing that I had to change was the use of $ symbol in the JS code (as in my environment it conflicts with some other JS APIs that I use).

Saturday, December 12, 2009

Some Gmail features have failed to load due to an Internet connectivity

Google Chrome error: Some Gmail features have failed to load due to an Internet connectivity

The above error started happening since yesterday in Google Chrome whenever I tried to open an email. I found that clearing the browser history fixed it.

Click on Wrench Icon.
Click on Options.
Goto Personal Stuff tab.
Click on Clear browsing history, select everything and then Clear Browsing Data.

Shutdown Chrome and then restart it.

Thursday, December 10, 2009

CSS – Style Inheritance

I was wondering how I could get style inheritance so that I could derive new styles from an existing style.

Looks like that is not possible (please correct me if I am wrong).

But the next best thing is to realize that you can use multiple styles on an element. The style is applied left to right. This provides a behavior that would be similar to what inheritance would provide me.

example:

.style1 { color:red; }
.style2 { font-weight:bold; }

To apply them both on a DIV:
<div class=”style1 style2”>Hello World</div>

ASP.Net – Custom Validator – Setting the error message in client script

Question: How do you set the error message in the Client Validation Script.

Answer: If the client validation method is called CheckEntry, then your code would need to look like this:

<script type="text/javascript" language="javascript">
    function CheckEntry(sender, args) {
        ctrl1 = document.getElementById("<%=ctrlToValidate1.ClientID%>");
        ctrl2 = document.getElementById("<%=ctrlToValidate2.ClientID%>");

        if (isBlank(ctrl1 .value) && isBlank(ctrl1 .value)) {
                args.IsValid = false; 
                sender.errormessage = "Please provide atleast one search criteria"
                return;
            }
        }
        args.IsValid = true;
        return;
    }
    
    function isBlank(str) {
        str = ValidatorTrim(str);
        if (str == null || str.length < 1)
            return true;
        else
            return false;
    }
</script>

The error message is updated via the sender.errormessage property. The “ValidatorTrim” method is provided by a method from JavaScript that ASP.Net injects for you into the page whenever you use a validation control.

Simple and Easy!

ASP.Net - Custom Validator – Multiple Controls

In ASP.Net, when you use a CustomValidator, it is easy to make it validate one control. But how do you use it to validate multiple controls (for eg: you want to make sure that if the City field has been filled out then you want the State field to also be filled out).

You first create your custom validator. But you do not assign it a ControlToValidate. Instead you add the following code to your aspx/ascx file:

<script type="text/javascript">
<!--
    ValidatorHookupControlID("<%= ctrlToValidate1.ClientID %>",
     document.getElementById("<%= customValidationCtrl.ClientID %>"));
    ValidatorHookupControlID("<%= ctrlToValidate1.ClientID %>",
     document.getElementById("<%= customValidationCtrl.ClientID %>"));
    ValidatorHookupControlID("<%= ctrlToValidate1.ClientID %>",
     document.getElementById("<%= customValidationCtrl.ClientID %>"));
//-->
</script>

The “ValidatorHookupControlID” method used above, is automatically injected into the page for you by ASP.Net whenever you use a validation control in your page.

One thing that I found is that I needed to add the code to the end of an ascx control, or next to the end of the form tag in an aspx page. Otherwise it throws an annoying JavaScript error.

HTML – Nested tables – removing the space

If you have nested tables then you will notice that there is a space between the 2 tables.

Sample nested text
Sample Text

To fix this, all you need to do is set the cellspacing="0" cellpadding="0" for the 2 tables.

Sample nested text
Sample Text

Wednesday, December 09, 2009

Traffic Lights – Innovations – Count-down timer

What an innovative idea, a count down timer built into a traffic light. The design is by “YankoDesign”.

eko03

Read more at - http://www.yankodesign.com/2009/11/30/a-better-understanding-of-stoplights/

Dragon Dictation app for iPhone

Voice recognition for the iPhone…. from Dragon Naturally Speaking. Free for now…. http://www.dragonmobileapps.com/apple/dictation_demo.html

image

Tuesday, December 08, 2009

More climate data – global annual temperature variations since 1880

This time I decided to look at the range between the maximum and minimum temperatures annually. The data again is from the Goddard Institute for Space Studies (GISS). (Global-mean monthly, annual and seasonal dTs based on met.station data, 1880-present, updated through most recent month)

What I thought I would see is a range that grew since 1880. But instead what I observed was that the range grew smaller. But what was even more surprising is that both the maximum temperature and the minimum temperature trendlines were both sloping upwards. This meant that not only were the summer months getting warmer, but so were the winter months!

http://spreadsheets.google.com/pub?key=t1-Xl4C6zccrFEDvd5aBMsg&output=html

global temperature variations since 1880 
TMax – trendline for maximum temperature, TMin – trendline for minimum temperature, TRange – trendline for range

I havent seen this analysis before, so if you happen by this post, I would be interested in your thoughts.

Monday, December 07, 2009

Climate Facts – 10 warmest years

Based on data from the Goddard Institute for Space Studies (GISS), the 10 warmest years on record occurred in the last 11 years.

Here is a Google Spreadsheet with the data from GISS:

http://spreadsheets.google.com/pub?key=tiOjptDEMMFEh1JlYEzXWyA&single=true&gid=2&output=html

Read more:
http://data.giss.nasa.gov/gistemp/graphs/

Date downloaded from: http://data.giss.nasa.gov/gistemp/graphs/Fig.A2.txt

URI vs URL – whats the difference?

First off – URL is deprecated terminology. You are better of using URI where ever you used to use URL.

Here is why:
URI – Uniform Resource Identifier
URL – Uniform Resource Locator
*notice: its not universal as many end up calling it – it is uniform.

The URI allows for the identification of resources using the identifier. The following are all examples of URIs:
ftp://ftp.sample.com/samplefiles/readme.txt
http://www.sample.com/samplefiles/readme.html
http://www.sample.com/samplefiles/readme.txt
https://www.sample.com/samplefiles/readme.html
mailto:jane.doe@sample.com

Even the scheme “tel:+1-800-800-8000” is considered a URI. In the early days (!), a URI was either a URN or a URL (i.e, the URI either referred to the the name without the location or the location of a resource). The term URL is now considered to be a URI that identifies a resource via its access mechanism (http, ftp, etc). Here the http, ftp, etc in the URL address are known as URI schemes (and define the syntax that is legal in the URI). So just remember, basically the URL is a subset of URI. (i.e., all URLs are URIs).

So, instead of worrying about the difference, just use the TLA URI instead of URL from now on.

reference:
Uniform Resource Identifier: Generic Syntax: http://labs.apache.org/webarch/uri/rfc/rfc3986.html
Uniform Resource Identifiers (URIs), URLs, and Uniform Resource Names(URNs): Clarifications and Recommendations: http://www.ietf.org/rfc/rfc3305.txt

Sunday, December 06, 2009

Ad Music – Annie Little – Fly Me Away – Amazon Kindle

The Amazon Kindle Ad

The song Fly Me Away is available as a free download from Amazon.

Lyrics
Silver Moons and paper chains,
Faded maps and shiny things.
You're my favorite one-man show.
A million different ways to go.
Will you fly me away?
Take me away with you,
My love.
Painted scenes, I'm up all night.
Slaying monsters, flying kites.
Speak to me in foreign tongues.
Share your secrets one by one.
Will you fly me away?
Take me away with you,
My love.
Now I cant think what life was like
Before I had you by my side.
Cant say what I'd do without you,
Knowing what its like to have you.
Hidden walk ways back in time.
Endless stories, lovers cry.
In my mind I've been set free.
Will you take this Journey
You and Me?
Will you Fly me away?
Take me away with you,
My love.
Fly me away with you,
My Love.
Take me away with you,
My Love.

Saturday, December 05, 2009

Using Google DSN on your Apple Mac

Google Public DNS is a free, global Domain Name System (DNS) resolution service, that you can use as an alternative to your current DNS provider.

Why do you need a DNS service?

You might not realize it, but you already use a DNS service, typically this is automatically setup for you by your ISP and so you dont have to do anything special to get it working. The DNS service is what allows you to type a named address (such as www.google.com) in your web-browser and get to the website. The DNS service resolves the name to the actual address of the server where the website is located.

So why use Google’s DNS service?

Its provided by Google – good enough for me.

Other reasons:
Google has its DNS servers located all over the globe and they use intelligent algorithms to use the closest one to your computer. This means faster browsing of the web.
Also, Google has a public privacy policy and so you know exactly what they are doing with the data they capture while you use their DNS service. I have no idea how my ISP uses the information it collects while I use their DNS service. (Google stores your IP address for 24 hours, and no other identifying information is stored for longer than that. Read more at http://code.google.com/speed/public-dns/faq.html#privacy)

Alternatives: There is OpenDNS (http://www.opendns.com), but that is not Google!

How to use it:

You need to configure your TCP/IP settings to use the following DNS servers: 8.8.8.8 and 8.8.4.4

Configuring your Mac to use Google DSN.

1. I use a WiFi network to get to the Internet from my Mac. So click on the Wireless icon (2nd from right)
Screen shot 2009-12-05 at 5.06.35 AM 
2. Select “Open Network Preferences”.
Screen shot 2009-12-05 at 5.07.12 AM
3. Click on AirPort and then “Advanced…”Screen shot 2009-12-05 at 5.07.26 AM
4. Click on DNS and enter the numbers “8.8.8.8” and “8.8.4.4”

Screen shot 2009-12-05 at 5.07.41 AM

And you are done. Close the dialog and fire up your browser. Browse to your home-page or my web-page (http://raj.aggregatedIntelligence.com/) and if it shows up – you are good to go.