redirect page after embedded youtube video ends

<script type='text/javascript' src='swfobject.js'></script>

<div id='mediaspace'>
This video requires Javascript and Flash</div>

<script type='text/javascript'>
var player = null;
function playerReady(thePlayer) {
player = document.getElementsByName('ply')[0];
addListeners();
}
function stateMonitor(obj) {
if (obj.newstate == 'COMPLETED') {
// load a new page
window.location = 'http://www.google.com';
}
};
function addListeners() {
if (player) { player.addModelListener("STATE", "stateMonitor"); }
else { setTimeout("addListeners()", 100); }
}
// var s1 = new SWFObject('player-viral.swf', 'ply', '470', '320', '9', '#ffffff');
// s1.addParam('allowfullscreen', 'false');
// s1.addParam('allowscriptaccess', 'always');
// s1.addParam('flashvars', 'file=http://www.youtube.com/v/SXg1qpUiY7Y&autostart=true');
// s1.write('mediaspace');
</script>

<object id="thePlayer" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="ply" width="400" height="315">
<param name="movie" value="player-viral.swf" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value="file=video.flv&image=preview.jpg" />
<embed
type="application/x-shockwave-flash"
id="player2"
name="player2"
src="player-viral.swf"
width="400"
height="315"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="file=<%= VideoPath %>&image=preview.jpg&autostart=true"
/>
</object>

http://www.warriorforum.com/programming-talk/35546-redirect-another-url-after-embedded-youtube-video-ends-possible.html

enable remote connection on sql server 2008

http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/

the trick is to enable tcp/ip protocol:

- On the left window, expand SQL Server Network Configuration -> Protocols for SQLEXPRESS. You see that TCP/IP protocol status is disabled.

- Right-click on TCP/IP and select Enable to enable the protocol.

html parser

http://htmlagilitypack.codeplex.com/

extension methods in linq

public static class MyExtensions
{
    public static IEnumerable SelectWhere(
     this IEnumerable source,
     Func filter)
    {
        var results = new List();

        foreach (var s in source)
            if (filter(s))
                results.Add(s);

        return results;
    }
}


    private double? GetConvertedPrice(RealEstate realEstate)
    {
        return realEstate.Price * exchangeRates[realEstate.PriceCurrencyId.Value - 1].Value;
    }




        var realEstates = _db.RealEstates.SelectWhere(re =>
                                                       (re.CategoryId == null || catId == null || re.CategoryId == catId)
                                                       && (re.TypeId == null || typeId == null || re.TypeId == typeId)
                                                       && (re.CityId == null || cityId == null || re.CityId == cityId)
                                                       && (re.DistrictId == null || districtId == null || re.DistrictId == districtId)
                                                       && (re.Price == null || priceMin == null || GetConvertedPrice(re) >= priceMin)
                                                       && (re.Price == null || priceMax == null || GetConvertedPrice(re) <= priceMax)
            );


http://msdn.microsoft.com/en-us/library/bb383977.aspx

search this blog (most likely not here)