Aug 31, 2012

How to improve Visual Studio performance

 

In this series, I’ll discuss how to the steps that I did to improve VS 2008/2012/2012 performance. Following these guidelines, I managed to reduce build time from +10sec to 3-5sec , and solution opening time from 20+ sec to just mere 5sec.

For some may think “a few sec ain’t a big deal”, I would like to stress: it’s really make a different when you test & debug. Anyway, what else will you do when VS is compiling ? Thinking of what to do with your life ? Smile. Life’s better when you can cut down build time and spent that on other hobby (for me it’s building performance workstation-  I just upgrade mine to 16GB DDR3-2000Mhz with RAID10 SSD ^^ )

OK enough chit chat, now back to the main point.

1.Requirements:

Before proceed with the guide, ensure that your machine meet these minimum requirements:

  • At least 2Gb free memory.
  • Core2Duo 1.8Ghz (dual-core) or equivalent AMD multicore.
  • At least 5Gb free HDD space.

2.Steps:

a. First, if you have lots of RAM (4GB+ ), you can use Ramdisk to create a separate partition, then map your output folder to it.

I downloaded Ramdisk , then install it. Using the tool, I created the symbolic link from the VS output folder via mklink :

C:\mklink /D "F:/RamdiskTemp/Src/bin" "C:/Work/Web/Src/bin"
symbolic link created for "F:/RamdiskTemp/Src/bin" <<===>> "C:/Work/Web/Src/bin"

b. Use the same mklink tool, create symbolic link for your ASP.NET temp folder, point tothe newly created Ramdisk.

The ASP.NET temp folder (for .NET 4.0) is at :

C:\windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files (64bit)

C:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files(32bit)

c. Use eBoostr to implement cache at OS-level for your VS. I used 512MB of memory to cache.

Detail of how to use eBoostr, please refer to their website.

<<to be continue>>

Aug 30, 2012

How to detect what JavaScript function is hooked up to an element

 

Recently I worked a lot with front-end development, and most of the time I want to know what JavaScript function is fired when I clicked on some buttons or images.

Luckily with Chrome, it is so easy.

How?

In Chrome, press F12 – it will open developer tool. Now right click on the element and select Inspect element. In the developer tool, look for the right hand side and expand Event Listeners. Tada, there you go – all the events that hook up to that element are shown. See the image below:

image

Aug 27, 2012

How to remove deleted songs from iTunes Library

 

Here are the instruction:

  1. Create a smart playlist with the criterion “Artist” is not “xxxyyyzzz” (or some other random string that does not occur as artist in your mp3 collection). Then name this smart playlist “all entries”. This way, we get a smart playlist with all database entries, working and broken.
  2. Create a static playlist called “working entries”.
  3. Open the “all entries” playlist, select all (ctrl-a/option-a) and drag the selection to the “working entries” playlist. iTunes will not copy dead entries, so now we have a list with everything and another with only the working ones. We need to substract them from each other. This is how:
  4. Create a smart playlist with the following criteria: “Playlist” is “all entries”, “Playlist” is not “working entries”. Check that all rules apply, not any rule. And dang! We just created a playlist of broken database entries. In this playlist, select all (ctrl-a/cmd-a) and hit shift-delete (alt-backspace on macs). iTunes will ask you if you want to remove the selected items from the iTunes library. Of course you want to!

from this blog.

Jul 27, 2012

Use Fiddler to compost form POST / GET

Fiddler 2 is a great tool for debugging web development. It serves well when you want to simulate a form POST / GET with various parameter.

But note when you want to do a form POST, remember to add this line to the header :

Content-type: application/x-www-form-urlencoded

Otherwise, the form POST parameters will not be understood.

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.