Jun 27, 2012

Stream media from your PC to Xbox 360 with Windows Media Center or Windows Media Player

There are many guides out there on how to stream media from your PC to Xbox 360, so I just paste the link here:

Just some key points to note:

  • Ensure in your router, UPnP (Universal Plug and Play) is enabled.
    Configure your router at
    http://192.168.0.1 , or if your IP is x.x.x.x then usually it is http://x.x.0.1  or http://x.x.x.1
  • Ensure your PC and Xbox are on the same subnet (preferably both should be on the same type of network : wired or wireless )
  • Ensure your firewall does not block port 88 and 3704 (both UDP and TCP).
  • Turn off DMZ Hosting (which expose one IP in your router to the whole Internet).
    Turn off port forwarding as well.

May 7, 2012

ASP.NET MVC - Including hidden fields in Form Submit (POST)

We can include some hidden fields in the form as the parameters. Most of the time, it is to avoid using query string (which can results in too long URL).

However, do not forget the attributes “name” for those hidden fields, otherwise they will not be include in form submission.

For e.g:

<form id=”frm1” action=”/actionHandler” method=”post”>
    <input type=”hidden” id=”hdnValue1” name=”hdnValue1” >
</form>

I encountered it and spend almost an hour to find out why. Just to share it.

Apr 17, 2012

How to redirect to different URL

From StackOverFlow

jQuery is not necessary, and window.location.replace(...) will best simulate an HTTP redirect.

It is better than using window.location.href =, because replace() does not put the originating page in the session history, meaning the user won't get stuck in a never-ending back-button fiasco. If you want to simulate someone clicking on a link, use location.href. If you want to simulate an HTTP redirect, use location.replace.

For example:

// similar behavior as an HTTP redirect
window.location.replace("http://stackoverflow.com");

// similar behavior as clicking on a link
window.location.href = "http://stackoverflow.com";

Apr 13, 2012

“GodMode” folder on Windows

Create a folder named :

GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

Double click it – you’ll see all the tasks in Control Panel !!! Quite neat.

Apr 9, 2012

To find out how long the system has been running

For Windows:

  • go to Command (Windows  + R, type “cmd”)
  • type: net statistics server

windows-uptime

For Linux/Mac:

  • In Terminal, type : uptime
  • The result would be like this
    $ uptime [RET]
    3:34pm up 4:31, 4 users, load average: 0.01, 0.05, 0.07
    $