tag:blogger.com,1999:blog-45858636288977390472024-02-20T08:56:54.595+00:00brain dumpThe private thoughts and muses of a web application and software developer.Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.comBlogger228125tag:blogger.com,1999:blog-4585863628897739047.post-58092824272163088442013-06-26T13:38:00.000+01:002013-06-26T13:38:03.818+01:00Visual Studio - Disable #Region Block Generated When Implementing An Interface<p>
One of the things I have found really annoying when coding in Visual Studio is the fact that when implementing an interface, the editor will wrap the method calls in a #region/#endregion block. So today I was determined to find out how to get rid of them.
</p>
<p>
It is actually really easy and all you have to do is :
</p>
<ul>
<li>Open the TOOLS menu.</li>
<li>Select Options...</li>
<li>Select the Text Editor option.</li>
<li>Select your target language (mine is C#).</li>
<li>Select the Advanced node.</li>
<li>Deselect the "Surround generated code with #region" option.</li>
<li>Click OK</li>
</ul>
<p>
Annoying problem goes away!
</p>Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-60284510270932668392013-02-19T13:44:00.000+00:002013-02-19T13:44:16.481+00:00Installing Visual Studio 2012 Update 1. Failures & a possible solution.<p>
Having installed Visual Studio 2012 about a month ago, I finally got around to wanting to do some serious coding with it. Attempting to run my test's I found a message in the Output window that reported an exception had been thrown and that test discovery mechanism had failed. Having a quick Google about I found a lot of people reporting the issue with Visual Studio 2012 Professional if Update 1 was not installed.
</p>
<p>
So I headed into Visual Studio 2012 and downloaded the Update and fired it off expecting it to be a 10 minute install with no issues.
</p>
<p>
The first install attempt failed. It didn't give me much to go on except the install log and a link to some Microsoft Tips and Solutions page (which no longer appears to exist). So I tried to repair it. That also failed!
</p>
<p>
So I removed the update and rebooted and downloaded another copy direct from Microsoft in case there were any issues with the first .exe. I installed again, it failed again. So this time I tried to repair the Update (from the Updates own installer). It failed.
</p>
<p>
Although it failed, this time I go more information, it had failed when it got to the Visual Studio JavaScript Extensions for Windows Library. After some more serious Googling about I found a post that, on a related subject, suggested downloading the library direct from <a href="http://www.microsoft.com/en-us/download/details.aspx?id=30687">Microsoft</a>. This I did and I run the Updates Repair option again.
</p>
<p>
It failed again! There was a serious patten forming here however, this time it complained about Web Deploy 3 already being installed. So I removed Web Deploy 3 and ran the Repair option again and <b>it worked!</b>
</p>
<p>
So far my overall experience of Visual Studio 2012 is not that great. I had <a href="http://amcrouch.blogspot.co.uk/2013/01/installing-visual-studio-2012-windows-7.html">issues</a> installing Visual Studio 2012 in the first place (on Windows 7) and now I have wasted a couple of hours trying to install Update 1.
</p>
Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-32049900740302682382013-01-21T15:17:00.001+00:002013-01-21T15:17:24.134+00:00Slow Chrome & Firefox Debugging on Windows 7.<p>
These days I live in web browsers and all of my day to day work is browser based. Since I moved to Windows 7 I have had an issue where by Chrome and Firefox would take ages to connect to my local IIS instance. After suffering this for some time I decided to get to the bottom of it.
</p>
<p>
As it turns out (and there are a lot of false claim on Google!) it is as simple as ensuring you have <i><b>127.0.0.1 localhost</b></i> uncommented in your hosts file. The hosts file can be found in \Windows\System32\drivers\etc. It would appear that if you use host headers for local development work then without this uncommented you are hitting the public DNS servers from what I can tell.
</p>
<p>
I should add that I am not running IPv6 and so did not enable <i><b>::1 localhost</b></i> but you should if you are running on an IPv6 enabled network.
</p>Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-706533629646936372013-01-14T17:04:00.000+00:002013-01-14T17:04:10.357+00:00Installing Visual Studio 2012 (Windows 7)<p>
Some things in life should be as simple but aren't! After years of installing various versions of Visual Studio you would think I would be prepared for battle but Visual Studio 2012 still managed to get me!
</p>
<p>
<b>tl;dr Use <a href="http://www.microsoft.com/en-us/download/details.aspx?id=30682">this</a> iso file to install Visual Studio 2012 Pro, the web installer doesn't work!</b>
</p>
<p>
<i>
(As a side note, I long for the day where installing something on Windows is as easy as it is on *nix. I can install a whole operating system and associated programs in the time it takes to install Office! Alas, that is a separate post!)
</i>
</p>
<p>
Being a modern kind of guy I opted to try and install Visual Studio 2012 Pro via the web installer. I have a decent internet connection and was not expecting a 2 hour install. I was even more disgruntled when it failed! It apparently had not managed to install the Javascript or Sql 2012 tools packages. Reading the ever interesting log files provided no useful (translate : Google'able) info and so I tried to repair the installation. That also failed only this time with a longer list of failed packages.
</p>
<p>
I then decided I would try a clean install using the old fashioned iso provided by Microsoft. I tried to uninstall Visual Studio 2012 and .... it failed! (I can see a patten forming here.) I tried various things and finally after three tries managed to uninstall it. By try various things I mean I rebooted, I tried to kill various processes that looked like the installer was orphaning and clearing out <i>%temp%</i>.
</p>
<p>
I then installed <a href="http://www.microsoft.com/en-us/download/details.aspx?id=30682">this</a> iso file (via the excellent daemon-tools). Forty minutes and another coffee later and it worked and installed.
</p>
<p>
You would think that in this day and age the web installer would be fail safe. It should know what packages you need download them and install them in a fast and successful manner. Come on Microsoft, it's not hard!
</p>
Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-28378488604070005462012-12-13T17:12:00.000+00:002012-12-13T17:12:26.232+00:00A Simple Bash open() function That Is Platform Independent.<p>
I use Bash as my shell of choice. This is partly laziness, I learnt Bash first and it has always been the default on clean installs, and also because if I end up on a server or a machine that has just been set up I know what I am doing and don't miss fancy functionality provided by other shells. That's not to say that on my To Do list for 2013 is to learn more about zsh.
</p>
<p>
One of the tasks I have been trying to do over the last couple of months is tame my dot-files. In doing this I have been trying to clean up functions that I have added to my .bashrc and make them more machine/platform independent. (Once I have done this I will write up how I have structured my dot-files and point you to my GitHub repo).
</p>
<p>
One of my more frequently used functions is open(). I use Bash extensively on Windows via <a href="http://www.cygwin.com/">Cygwin</a> as well as on *nix machines. The aim of the function I started out with was to allow me to open files directly from Cygwin's Bash shell that were standard Windows files (such as Word and Excel files). Since I got in the habit of using the function on Windows I wanted something that worked the same on Linux. Below is the (very) simple function I ended up with
</p>
<pre id='vimCodeElement' style='font-size:smaller;'>
<span class="LineNr"> 1 </span>function open()
<span class="LineNr"> 2 </span>{
<span class="LineNr"> 3 </span> UNAME=`uname`
<span class="LineNr"> 4 </span> OSLINUX="Linux"
<span class="LineNr"> 5 </span> OSCYGWIN="CYGWIN_NT-6.1-WOW64"
<span class="LineNr"> 6 </span>
<span class="LineNr"> 7 </span> if [ "$UNAME" = "$OSLINUX" ]; then
<span class="LineNr"> 8 </span> if [ "$1" = "" ]; then
<span class="LineNr"> 9 </span> echo "open Failed, No file specified to open."
<span class="LineNr">10 </span> else
<span class="LineNr">11 </span> xdg-open "$1"
<span class="LineNr">12 </span> fi
<span class="LineNr">13 </span> elif [ "$UNAME" = "$OSCYGWIN" ]; then
<span class="LineNr">14 </span> if [ "$1" = "" ]; then
<span class="LineNr">15 </span> NATIVE_PATH="."
<span class="LineNr">16 </span> else
<span class="LineNr">17 </span> NATIVE_PATH="$1"
<span class="LineNr">18 </span> fi
<span class="LineNr">19 </span>
<span class="LineNr">20 </span> WIN_PATH=`cygpath -w -a "${NATIVE_PATH}"`
<span class="LineNr">21 </span> cmd /C start "" "$WIN_PATH"
<span class="LineNr">22 </span> fi
<span class="LineNr">23 </span>}
</pre>
<p>
I am sure that the function <i>will</i> be cleaned up some more and made simpler however, it works as I need it to in the 5 mins I worked on it.
</p>
<p>
The function use's <i>xdg-open</i> which is desktop independent on Linux so it should "just work" otherwise on Cygwin it just uses 'cygpath' to generate the correct file path before using 'cmd' to launch the path.
</p>
<p>
<b>Please Note ::</b> The path provided to <i>cmd</i> is hard coded to my C:\ drive. I have long given up on using partitioned Windows disks so I took the lazy route here.
</p>
<p>
Once added to your .bashrc you can just call <i>$open file</i> or <i>$open .</i> or <i>$open ../</i> to open a file or open the File Manager in the current directory or parent directory.
</p>Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-36571017446615334162012-10-25T11:37:00.001+01:002012-10-25T11:37:51.133+01:00Internet Explorer JavaScript - Changing An Elements Type.<p>
<b>Note to Self :</b> When attempting to change an elements type attribute in JavaScript use the <i>setAttribute()</i> function as it is the only way to do it that works with Internet Explorer.
</p>
<p>
<b>Note to Browser Developers :</b> Please standardise this stuff as it takes too much time to achieve simple solutions!
</p>Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-70293844634555391402012-10-03T11:44:00.001+01:002012-10-03T11:47:23.973+01:00Powershell XML Configuration Files.<p>
Recently I have been playing with Powershell and while I still prefer Bash as a shell (long time user) I was impressed with the amount that can be achieved with Powershell.
</p>
<p>
One of the things that I was looking at doing was automating our build process as we had hit a css file count limit in Internet Explorer (31). I should point out that our css is not that badly laid out but we load specific css files dynamically based on the client's needs. So my aim was to minify our css with the Ajax Minifer tool which can be found on <a href="http://ajaxmin.codeplex.com/">Codeplex</a>. The only issue with our current development set up is that my co-developer hosts his svn working directories on a different drive to mine so I needed to provide a configuration file to specify the path to Ajax Minifer and our code.
</p>
<p>
Turns our this is really easy in Powershell as it can natively parse XML and provides a nice tree structure to use. The following reads, parses and provides the XML configuration file as said tree :
</p>
<p>
<i>
# read the local config file for various settings ...<br />
$cfgFile = "$PATH_TO_FILE" <br />
$root = "$NAME_OF_ROOT_NODE" <br />
$cfg = [xml](gc $cfgFile) <br />
</i>
</p>
<p>
At this point you have access to the child nodes through <i>$cfg</i>. For example <i>$cfg.$root.EnableDebugging -eq "True"</i> returns the value of the <EnableDebugging> child node and check's whether it's value is set to True.
</p>
<p>
As with all scripting and shells there appears to be more than one way to achieve this but it works perfectly for what I needed.
</p>Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-32938307059765705412012-09-20T14:07:00.000+01:002012-09-20T14:07:08.627+01:00Passing Arrays Between Contexts In Javascript<p>
Today I have found a nasty gotcha that stumped me for some time while creating a snippet of JavaScript which called a function that included an Array as a parameter.
</p>
<p>
I was trying to call a function on an object bound to the <i>window</i> which contains some utility classes. I created my <i>Array</i>, populated the values and sent it to the function. However, it didn't work as expected. After some head scratching and debugging in Chrome I found that the receiving code was not seeing the Array parameter as an instance of <i>Array</i>. Instead it was seeing it as an <i>object</i>.
</p>
<p>
After checking my calling code to ensure I was not having a daft moment, and after much trial and error I hit Google. The answer was actually rather obvious once I found it. The problem I was having was that the calling code was in an <i>iframe</i> in my page. When you create an <i>Array</i> you are actually creating a <i>window.Array</i> object. This of course means that the object's prototype is not available to in the window context (i.e. the parent page) and so the receiving function was treating it as an <i>object</i>.
</p>
<p>
The answer, as I realised while talking to my co-developer, was that in order for the parameter to be seen in the receiving code as an <i>Array</i>, it needed to be declared as <i>new parent.Array()</i>. Once this change was made everything worked as expected.
</p>Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-76681724018998822362012-08-20T23:23:00.001+01:002013-01-24T13:32:44.567+00:00Ruby on Rails Arch Linux Basic Instal<p>
I have been playing with Ruby on Rails for a while after completing a Coursera based SaaS course recently. While undertaking the course I worked on an Ubuntu VM which was provided by the course. However, as in all things I hack around with on Linux I really wanted to set up a basic Rails development environment on my main Arch Linux machine.
</p>
<p>
While the guide on the <a href="https://wiki.archlinux.org/index.php/Ruby_on_Rails">Arch wiki</a> was fine when I reached the point of testing my environment I got the following output in bash .... </p>
<p><i>
/usr/lib/ruby/gems/1.9.1/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
</i></p>
<p>
A quick hunt around the forums did not help me!
</p>
<p>
Following the link in the above error message I read up on <a href="https://github.com/sstephenson/execjs">execjs</a> and found that you need a supported runtime. I opted for <a href="https://github.com/cowboyd/therubyracer"><i>therubyracer</i></a>, an implementation of the Google v8 javascript runtime.
</p>
<p>
In bash I ran <i>gem install therubyracer</i> which installed the runtime. I then added the following line to my test applications Gemfile : </p>
<p><i>
gem 'therubyracer', :require => 'v8'
</i></p>
<p>
Running <i>rails server</i> now served up my test app on the default port (using WEBrick).
</p>Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-70984004122235665732012-08-08T23:05:00.001+01:002012-08-08T23:05:41.547+01:00Arch Linux glibc Update<p>Arch Linux has made a rather big change to the file system recently and has moved the files in the /lib directory to the /usr/lib directory and /lib is now a symlink to usr/lib. You can get an overview of the change <a href="http://www.archlinux.org/news/the-lib-directory-becomes-a-symlink/">here</a> and <a href="https://wiki.archlinux.org/index.php/DeveloperWiki:usrlib">here</a>. Both of these pages give instructions and possible issue resolutions for most case's.</p>
<p>However, as searching the <a href="https://bbs.archlinux.org/">Arch Forums</a> on glibc will show, the resolutions outlined in the above documents do not always work. There are a large number of users that have had problems due to various files that are left in the /lib directory. To quote <i>Zamboniman</i> from the <a href="https://bbs.archlinux.org/">Arch Forums</a> "This has been one of the more frustrating upgrades in my history with Arch." After running <i>pacman -Syu</i> recently I discovered I was one of these people!</p>
<p>I have now resolved my issue and wanted to detail it incase it is any help to anyone else still struggling with the issue. For a little background I am running Arch 64bit.</p>
<p><b>NOTE</b> DO NOT USE --force WITH pacman IN ANY FORM TO RESOLVE THIS ISSUE AND DO NOT DELETE OR MOVE ANY FILES MANUALLY.</p>
<p>First, I followed the recommended update method and ran <i>pacman -Syy</i> and then <i>pacman -Syu --ignore glibc</i>. This brought the system up to date and I then ran <i>pacman -Su</i> which will update glibc. However, like so many others, I got the following error output :</p>
<p><i>error: failed to commit transaction (conflicting files)
glibc: /lib exists in filesystem</i></p>
<p>This, apparently, is caused by files remaining in the /lib directory. As per a number of the suggested solutions I then ran <i>find /lib -exec pacman -Qo -- {} + </i>which lists who owns the files left in the /lib directory. As recommended in one forum post I started to look for files not owned by glibc. There was one file and that was <i>lib32-glibc</i>. A lot of the solutions suggested at this point to just delete the file or uninstall the program that it is installed by however, looking at the file version (2.15-10) I noticed that there was a newer version available. The file is installed from the Multilib repository and I was at a loss as to how it was not being updated. After a little more digging I found that the Multilib repository was commented out in the <i>/etc/pacman.conf</i> file. I uncommented the repository entry in the file and ran <i>pacman -Syy</i> and then <i>pacman -Syu --ignore glibc</i> and then ran <i>pacman -Su</i>.</p>
<p>This all appeared to work. As a final check I ran <i>ls -ld /lib</i> which should output <i>lrwxrwxrwx 1 root root 7 Jul 7 11:09 /lib -> usr/lib</i> which denotes that everything has worked.</p>
<p>This solution will probably not fix everyone's issue with regard to this update and the links below are to forum threads that helped me track down the solution to my problem</p>
<ul>
<li>https://bbs.archlinux.org/viewtopic.php?id=145006&p=1</li>
<li>https://wiki.archlinux.org/index.php/DeveloperWiki:usrlib</li>
<li>https://bbs.archlinux.org/viewtopic.php?pid=1129890 - <i>This thread contains Zamboniman's excellent advice which appears to have helped a number of people with slightly different issues to mine.</i></li>
<li>https://bbs.archlinux.org/viewtopic.php?id=109765 - <i>Multilib related.</i></li>
</ul>
Now, to get on with playing with KDE 4.9!Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-14491542083455041202012-05-23T12:41:00.000+01:002012-05-23T12:41:56.030+01:00Visual Studio 2012 Missing Project TemplatesSince I set up my new work machine I have been working on existing projects. However, today I wanted to start work on a little utility application and so fired up Visual Studio. On clicking new project I found I had no templates installed by default.<br />
<br />
After some digging on the interweb I found the answer is to close Visual Studio and then navigate to your Visual Studio install directory (c:\Program Files\Microsoft Visual Studio 10.0\) and then locate the devenv.exe. For me the full path was c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE.<br /><br />Once there in a Visual Studio Command Prompt you need to run the following :<br />
<br />
<i>devenv /installvstemplates</i>
<br />
<br />
It will take a couple of minutes to finish but once done you can fire up Visual Studio and all the default templates will be available.Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com1tag:blogger.com,1999:blog-4585863628897739047.post-29998852495922301462012-04-16T21:36:00.000+01:002012-04-16T21:36:09.560+01:00Arch Linux Qt Package Issue (KDE)For the first time in all the time I have been using Arch I have experience my first major package breakage.<br />
<br />
The night before last I ran pacman -Syu and one the packages upgraded was the Qt package. It was upgraded to qt-4.8.1-2. Next time I booted up I was getting a KDE Crash dialog appear noting an error with KRunner. Trying to run krunner from the shell I was presented with a host of errors.<br />
<br />
A quick search of the Arch forums I found <a href="https://bbs.archlinux.org/viewtopic.php?pid=1088565">this</a> post reporting similar problems. Following the advice in the post I downgraded the Qt package and my problems where resolved.<br />
<br />
To find out if you can downgrade your package you will need to search the <i>/var/cache/pacman/pkg</i> directory to ensure you have a package to downgrade to. If you do then you can run <i>pacman -U /var/cache/pacman/pkg/qt-4.8.0-6-x86_64.pkg.tar.xz</i> (or whatever version you have). If you can not find an earlier package in your cache then you will have to refer <a href="https://wiki.archlinux.org/index.php/Downgrading_Packages">here</a> (the Arch wiki) which will provide further details.<br />
<br />
(I should mention that I am running 64bit although I have no idea if this effects 32bit).Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-15427964195416583252012-04-15T14:20:00.000+01:002012-04-15T14:20:13.086+01:00KDE 4.8 Task Manager Launcher Issue.Of all the great new things that arrived in KDE 4.8 one of the most annoying to me was the inclusion of a browser and file manager launcher in the Task Manager. These are the little icons that appear when the said application is not running.<br />
<br />
I tried to remove the launchers with the usual right mouse menu option but everytime I re-booted I ended up with the icons back again.<br />
<br />
I have finally figured it out though. For some reason you need to remove the Task Manager from the panel and add a new instance of Task Manager and that seems to solve the problem.<br />
<br />
While it is a 2 minute fix it is something that should just work by default I think.Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-48665613804022732182012-03-22T20:58:00.000+00:002012-03-22T20:58:19.070+00:00Arch Linux - i3 Graphics SetupGonzo has been reborn!<br />
<br />
My trusty old Thinkpad has finally died and so I have brought a Fujitsu A531 to replace it. Its not a bad spec for the money I paid (i3 2.2, 8gb, 750gb HDD all for £419).<br />
<br />
I have just installed Arch 64 bit on it and had KDE up and running in less than an hour and a half. The first thing I noticed was the graphics acceleration was not enabled and I seemed to be suffering poor framerates. I found that by adding a file called 20-intel.conf to the /etc/X11/xorg.conf.d directory and adding the following solved my issues :<br />
<br />
<i><br />
Section "Device"<br />
Identifier "Card0"<br />
Driver "intel"<br />
Option "DRI" "true"<br />
Option "SwapbuffersWait" "false"<br />
EndSection<br />
</i><br />
<br />
Reboot and 3D effects and a good framerate where restored.Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-65342225755979314542012-02-28T17:01:00.000+00:002012-02-28T17:01:07.134+00:00Skype & IIS Clash.As I am working completely remotely these days I have found my use of Skype increase. This is mainly for chatting to my co-dev throughout the day. Not being a massive Skype fan I actually have it configured for use through Trillian which is quite a good multi-protocol IM client.<br />
<br />
Today while mid call with my co-dev I found my Firefox instance hanging and so did an iisreset on my local dev box. Killed Firefox and attempted to start debugging again. Only Visual Studio didn't want to play ball. It showed an error dialog with the following message :<br />
<br />
<i>Unable to start debugging on the web server. The server committed a protocol violation. Section=ResponseStatusLine.</i><br />
<br />
OK, that was a new one to me! I started to dig about and found that the caused of the problem was Skype. It appears that Skype will try and use ports 80 and 443 as optional ports to connect on. This meant that IIS was not able to listen to either of these ports.<br />
<br />
I killed Trillian (which in turned killed Skype) and all was resolved and I could debug again.<br />
<br />
It appears you can disable the option to listen to these ports in Skype. You need to go to :<br />
<br />
<b><i>Tools -> Options -> Advanced -> Connection</i></b><br />
<br />
On this option page you need to uncheck "Use port 80 and 443 as alternatives for incoming connections". Restart Skype and you should find you have no more issues.Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-35225326728272948102012-02-22T12:15:00.000+00:002012-02-22T12:15:06.128+00:00Column Editing Mode For Visual Studio & (G)Vim.I have been a heavy Visual Studio user for 10 + years. I was re-factoring some code today when I found that it has Column Editing capabilities. This was caused by me getting a keyboard short cut wrong and not noticing as I typed. From a quick Google this appears to be something that has been available for sometime. Usually when I need to do Column Editing in bulk I switch to (G)Vim and have often wished it was available in Visual Studio.<br />
<br />
To edit columns in Visual Studio you simple have to hold SHIFT+ALT after selecting the start point with your mouse and then drag to select the columns you wish to edit. Start typing and your columns will all receive the edit.<br />
<br />
As a side note Column Editing in (G)Vim is very easy. Simply hit CTRL+V to put you into column editing mode and then select the columns to edit. Once selected hit SHIFT+i to put you into insert mode and start making your edits. Once done hit ESC to exit column editing mode.Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-25698522666054552132012-01-03T22:13:00.000+00:002012-01-03T22:13:40.149+00:00SQL Server Express - How Not To Install It!So new year, new job and new laptop. This is a great way to start the new year.<br />
<br />
Working for a new company has meant installing a new Microsoft based development environment, part of which is the freely available SQL Sever Express. Installing it should have been a breeze using the free to download installer (or I believe you can also install using the Web Installer). However, as I had already installed the ASP.Net framework stack it turned into a rather long process.<br />
<br />
SQL Express does ship with Management Studio which I think is brilliant considering it's all free! However, when I installed SQL Express there was no option to install Management Studio. I, wrongly, assumed this would just be installed by default. When the install finished I looked for Management Studio but realised it was not installed. After much reading and research I found out that if you install SQL Express as part of the .Net framework installation you are unable to then install Management Studio tools as part of a subsequent instance installation.<br />
<br />
That's really not very helpful!<br />
<br />
The short version of the rest of the story is that you need to uninstall all instances of SQL server Express and then re install it again. Once you restart the installation you find you have the option to include Management Studio Tools.<br />
<br />
Now don't get me started about not being able to change the servers default collation ....Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-42987485728684358162011-12-21T13:25:00.000+00:002011-12-21T13:25:36.155+00:00Google Video Chat FixMy wife and I tend to communicate through gtalk and recently the video chat. However, a couple of nights ago her laptop stopped allowing her to invite people to video call.<br />
<br />
After realising it was something to do with the flash plugin I installed the latest version and applied all of the updates to no avail. <br />
<br />
After a little Googling I found the answer to be the following and I thought I would post it here in case it's useful to anyone else.<br />
<br />
Basically, go to your GMail account settings and find the Labs tab. Scroll right down to the bottom and there should be a Lab for Video Chat Enhancements. Click "Enable" for that lab and then save your settings. It worked a treat and she is now back up and running.<br />
<br />
This issue seemed to effect both Chrome and Firefox although other people I have read about only seem to be effected if you use Chrome. Either way that solve her problem.Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-53756770890659968162011-10-04T22:41:00.000+01:002011-10-04T22:41:51.687+01:00Arch Linux - LibreOffice Displaying Non EnglishWhen <a href="http://www.libreoffice.org/">LibreOffice</a> was first released I instantly installed it (via pacman) on Arch Linux. Having read lots about the grand work the project was doing to finally bring the project upto date since forking Open Office I was interested to see what they had achieved. I was quite impressed.<br />
<br />
I don't do a lot of document based work on my Arch laptop (and there have been a number of updates since I last used it) but I went to type up a letter for the wife tonight and fired up LibreOffice and found the UI was rendering in what appeared to be Russian (which I do not read or write).<br />
<br />
After a bit of digging about it appeared I made a fatal error in installing the libreoffice-uk language pack. Turns out that is the Ukrainian language pack ... oops!<br />
<br />
It turns out that I am not alone in making this assumption and if you happen to hit this issue and you actually need English and not Ukrainian then install the libreoffice-en-GB language pack and all will be well (and readable) again.Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com2tag:blogger.com,1999:blog-4585863628897739047.post-3344157264898066552011-08-09T17:03:00.000+01:002011-08-09T17:03:13.833+01:00Visual Studion 2010 Debugging Time Out.One thing that has started to bother me since going to a VS 2010/IIS7 setup is that by default the time-out on the debugger is incredible short. You start looking into a problem and be on the point of realisation when a Message Box pops up saying that the thread is aborting.<br />
<br />
Helpful, that is not.<br />
<br />
After a little digging about I found that it has something to do with the application pool settings in IIS. To increase the time the thread is available open IIS Manager, open the application pool your site is running on and click "Advanced Settings". In the property dialog that comes up there is an item labelled "Ping Maximum Response Time (seconds)". Set this value to your desired value and click OK. <br />
<br />
I have mine now set to 6000 which should be enough for now.Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-63615475071414286002011-08-08T19:20:00.000+01:002011-08-08T19:20:47.547+01:00Arch KDE SC 4.7 Missing KDM BackgroundIf after upgrading KDE to 4.7 on Arch you notice that your KDM theme is missing you need to run the following:<br />
<br />
<i>pacman -S kde-wallpapers</i><br />
<br />
It turns out the KDM default theme use's an image from the KDE Wallpapers package which has been split out on it's own from 4.7.Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-56615036199939371622011-08-03T22:23:00.000+01:002011-08-03T22:23:52.446+01:00Arch Linux Zope Interface Update IssueThe issue is old now, I have ignored it for about a month of pacman -Syu but in updating to KDE 4.7 tonight I hit it again.<br />
<br />
If you pacman -Syu and get<br />
<br />
<i>error: failed to commit transaction (conflicting files) <br />
python2-zope-interface: /usr/lib/python2.7/site-packages/zope.interface-3.6.3-py2.7.egg-info/ exists in filesystem </i><br />
<br />
The you need to go to <a href="http://www.archlinux.org/news/python2-zope-interface-update-requires-user-interaction/">this</a> page and follow the two simple commands.<br />
<br />
It would appear to be a simple bug in pacmans conflict resolution handling. It had to happen sometime I guess!!Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-17539265861698539442011-08-03T11:29:00.000+01:002011-08-03T11:29:51.384+01:00Disable Visual Studio 2010 w3wp WarningSo I have finally got to switch to my new laptop (windows 7, i5 lots of RAM!) and reinstalled all my tools. <br />
<br />
This first thing that started to really annoy me was that every time I attempted to attach to the w3wp.exe process to debug Visual Studio showed a message telling me it might be a bit dangerous to do so. Clicking OK allows you to attach and debug as usual. I had to find a way to disable that message.<br />
<br />
Apparently you can and I have! Thanks to a great little post over at <a href="http://thethoughtfulcoder.com/blog/46/Visual-Studio-2010-Attach-Security-Warning-Trying-to-attach-to-w3wpexe">thethoughtfulcoder.com</a> it appears this can be turned off in the registry.<br />
<br />
This is great and saved me some keystrokes however, it is the kind of thing you should be able to disable in Visual Studio itself rather than have to dig about in the registry for.Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-34736634299562449952011-06-09T22:51:00.000+01:002011-06-09T22:51:28.217+01:00C# Closing A Form In The ConstructorI had an odd need to close an application if a user failed to set some basic user data in a C# application tonight. The flow was that a very simple dialog was displayed during the main windows constructor call and if they dismissed the dialog the application was to end.<br />
<br />
After some head scratching I found the only way to do this was with ...<br />
<br />
<i>this.BeginInvoke(new MethodInvoker(this.Close));</i>Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0tag:blogger.com,1999:blog-4585863628897739047.post-78650275132682447362011-06-05T21:44:00.000+01:002011-06-05T21:44:52.161+01:00Install Dropbox in KDEI set up a new Linux distro today and the first thing I like to do is install <a href="http://www.dropbox.com">Dropbox</a>.<br />
<br />
As a KDE user this is slightly more involved than for those that like to play with Garden Ornaments!<br />
<br />
I did post previously a simple guide that showed how to do this but the article has gone! So below is how I set up Dropbox.<br />
<br />
First download the Dropbox package. The following two links (32 and 64 bit) should point to the latest builds :<br />
<br />
<ul><li><br />
<a href="http://www.getdropbox.com/download?plat=lnx.x86">32 bit Dropbox.</a><br />
</li>
<li><br />
<a href="http://www.getdropbox.com/download?plat=lnx.x86_64">64 bit Dropbox.</a><br />
</li>
</ul><br />
Save the file somewhere in your /home directory and the use an extraction tool to extract the contents into your /home/USERNAME directory. (This should be your /home directory as in /home/andy). This will create a folder called .dropbox-dist (note the . character, this is a hidden folder).<br />
<br />
Go to the KDE System Settings application and navigate to the "Startup and Shutdown" node and then the "Autostart" node. Click Add Script and use the file dialog to select the dropboxd file within the .dropbox-dist folder (and yes that is the dropboxd and not dropbox, this is a daemon that will be started on each logon).<br />
<br />
Once the dropboxd file name is selected click OK. That is the daemon set up and ready to use. <br />
<br />
Now to save logging out and back in again, open your file manager and navigate to the /.dropbox-dist/ directory (once again you will have to enable viewing hidden files and directories to see it), and double click the dropboxd file. This will start the daemon running and will display the Dropbox setup wizard. Within the wizard you can choose to create a new account or connect to your existing account.Andy Crouchhttp://www.blogger.com/profile/17213098526653897315noreply@blogger.com0