Archive for the ‘Uncategorized’ Category

Debugging Embedded IE Browser with Visual Studio

July 31, 2014

Some Windows applications (like Skype – where I work) use an embedded IE browser to display some content.  With Visual Studio 2013 you can easily debug JavaScript/CSS in these types of applications.  To do this, in Visual Studio select ‘Debug -> Attach to Process’.  Then in ‘Attach to:’ select ‘Script code’ and finally in ‘Available Processes’ select your application.  After hitting ‘Attach’ you’ll be able to use the DOM Explorer (Debug -> Windows -> DOM Explorer) and view JavaScript console (Debug -> Windows -> JavaScript Console).  Also you can view JavaScript code in the ‘Solution Explorer’ and set breakpoints.  Breakpoints can also be set in minified code by selecting desired position in code then right clicking and selecting ‘Breakpoint -> Insert Breakpoint’

Dead simple to self-host wordpress with azure

December 22, 2012

It took me literally 5 mins to get a self-hosted wordpress site up on azure, see: http://www.windowsazure.com/en-us/develop/php/tutorials/website-from-gallery/

solution for cygwin unable to remap problem

April 6, 2012

I use cygwin a lot and if you (like me) have had huge problems like:

[main] python 5436 C:\cygwin\bin\python.exe: *** fatal error – unable to remap C:\cygwin\bin\cygintl-8.dll to same address as parent: 0x430000 != 0x6EBB0000

[main] python 5436 C:\cygwin\bin\python.exe: *** fatal error – unable to remap C:\cygwin\bin\cygintl-8.dll to same address as parent: 0x430000 != 0x6EBB0000

[main] python 964 fork: child 5436 – died waiting for dll loading, errno 11
[main] python 964 fork: child 5436 – died waiting for dll loading, errno 11

then most people will tell you to just run ash and then do a  rebaseall, but this doesn’t work for me!

What does work for me  is the following: http://code.google.com/p/chromium/wiki/CygwinDllRemappingFailure

In case the  link above is broken here are the steps:

  • Download the ListDLLs executable from sysinternals (http://technet.microsoft.com/en-us/sysinternals/bb896656.aspx)
  • Run it as administrator while some cygwin commands are running.
  • Scan the output for the cygwin process (identifiable by the command) and for DLLs in that process that do not look like cygwin DLLs (like an AV). Note the location of those libraries (there will usually only be the one). Pick an address space location lower than its starting address.
  • Quit all cygwin processes.
  • Run a windows command shell as administrator
  • cd in \cygwin\bin
  • Run “ash /usr/bin/rebaseall -b <base address>” (This command can also take a “-v” flag if you want to see the DLL layout.)

Basically what was happening to me was a DLL (from Nvidia in my case) was occupying the same address space (0x6EBB0000) that cygintl-8.dll was trying to remap to.  So rebasing to different address space that did not conflict fixed the problem.

Search Bing from Chrome (and vice-versa)

March 5, 2012

Google Chrome is a great browser but has one minor fault, it’s hard/inconvenient to use other search engines.  I regularly search for items using the default search in engine in Chrome (i.e., Google) but when I come to a search dead-end I usually end up using Bing.  Currently to do this you have to open a new tab, go to Bing.com, and cut-paste the search term.  Ugh, please save me some time!  So, I created a handy little Chrome extension that adds a little yellow ‘S+’ button.  Clicking this button while searching in Google automatically opens a new tab and searches for the same item in Bing.  Likewise, if you are Bing and hit this button it opens a new tab and searches Chrome.  Pretty simple.

If you want to try for yourself, here is the code, the install instructions are in the Readme file contained in the zip.

https://skydrive.live.com/embed?cid=A8737C712A19E0F2&resid=A8737C712A19E0F2%211100&authkey=AN4K-lbIIfDfPzM

Cygwin bad PATH on Lenovo T420s with NVIDIA Optimus

January 16, 2012

OK just to help out other people because I spent a bunch of time trying to figure out this problem…

I got a new Lenovo T420s and loaded up all my dev tools including Cygwin… But when I run Cygwin the PATH environment variable is wrong and shows: /usr/local/bin:/usr/bin:/cygdrive/c/Windows/System32/NV:. So what happened to all the other paths from windows that should have been brought over from windows PATH env var?

Well, after much investigating it turns out old NVIDIA drivers are screwing up the path. I previously had drivers from April 2011 and updated to newer drivers and the PATH is now correct!!! It makes sense since the DLLs in the NV directory are from NVIDIA. I’m guessing this all has to the auto-magic that NVIDIA is doing to switch between Intel and NVIDIA graphics (i.e., Optimus).

BTW, I got the driver updates from Lenovo’s website.