May 12, 2012

Deploy windows metro app from the command line

Posted in Deploy, JavaScript, Metro, Windows 8 tagged , at 11:05 pm by lneir

I was developing a Windows 8 Metro JavaScript app and wanted to get the command line equivalent of Visual Studio “Build -> Deploy Solution”.

Simply do: devenv mysolution.sln /deploy “Release|x86″ /project myproject.jsproj /projectconfig “Release|x86″

The result is located in bin/x86/Release/AppX.

This is nice because the result includes the code for the all references.  It also creates a combined .pri (resouces) file.

April 6, 2012

solution for cygwin unable to remap problem

Posted in Uncategorized tagged at 12:42 am by lneir

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: 0×430000 != 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: 0×430000 != 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.

March 5, 2012

Search Bing from Chrome (and vice-versa)

Posted in Uncategorized tagged , , at 6:12 am by lneir

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

January 16, 2012

Cygwin bad PATH on Lenovo T420s with NVIDIA Optimus

Posted in Uncategorized tagged at 2:32 am by lneir

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.

September 25, 2011

Performance Test in Windows 8 developer preview

Posted in Windows 8 at 10:00 pm by lneir

In the past I’ve done a fair amount of UI development using WPF and Silverlight and at times we have run into issues with the performance of binding.  So, with Windows 8 we now can write C++ applications using Xaml.  You would think the performance of C++ compared to C# would be vastly superior; well maybe not…  I wrote a simply little test that has creates 100 TextBox elements and links them together such that when the first element is changed it causes a cascading update all the way back to the last TextBox.

The results were quite interesting…  The C++/Xaml app took on average about 42.9 ms to do the update while the C#/Xaml took 38.4 ms.  Hmmm, I would have expected much bigger difference than 4.5 ms.  Also in the test I measured the total initialization time (i.e., the time it took to create the 100 TextBox elements).  Here is the big surprise… It took C++/Xaml on average about 1735 ms to initialize while C#/Xaml took 464 ms.  That’s quite a big difference, I can’t explain the difference but would be interesting to know what results others see.

Links to the code are below: one for C# and another for C++.

https://skydrive.live.com/embedicon.aspx/.Public/CSharpBindingPerfTest.zip?cid=a8737c712a19e0f2&sc=documents

https://skydrive.live.com/embedicon.aspx/.Public/CPPBindingPerfTest.zip?cid=a8737c712a19e0f2&sc=documents

Note: Tests were performed using Window 8 developer preview on Acer tablet I got at PDC a few years ago.

Windows 8 developer preview

Posted in Windows 8 tagged at 8:44 pm by lneir

Got Windows 8 developer preview loaded on my old Acer tablet that I received for free at PDC a couple of years ago. It actually runs quite nicely on such old hardware! The best way I found to get it up and running was to setup a bootable VHD. Scott Hanselman had some great instructions: http://www.hanselman.com/blog/GuideToInstallingAndBootingWindows8DeveloperPreviewOffAVHDVirtualHardDisk.aspx

Follow

Get every new post delivered to your Inbox.