Unquote 2.2.0 has been released. This release includes several enhancements around operator decompilation.
Sunday, May 20, 2012
Visual Studio Build Output on first build in a newly opened instance
In both VS 2010 SP2 and VS 11 Beta, the first time you build a solution in a newly opened instance of Visual Studio, it will focus on the Output window, but fail to switch the output channel to Output like it usually does (i.e. “Show output from” drop down list).
This has always bugged me, and has effected me often since usually the last action I would have performed since the last time I used Visual Studio would be the run all my automated tests, so the Output window channel is persisted to Test in newly opened instances.
The solution is simply to toggle the “Show output from” option manually while the build is executing. Sounds too obvious to be worth mention, but the fact is, I never even noticed that drop down list because I am so used to it setting itself automatically in most cases.
Saturday, May 19, 2012
Remapping Lenova Keys
At work, I have a new Lenova T420 laptop which has a different keyboard layout than my wonderful Dell XPS 15z and it’s been driving me nuts. Specifically two issues
- The Ctrl and Fn keys are flipped
- The Fn+<arrow key> map to media buttons instead of Page Up, Page Down, Home, and End.
Apparently Lenova’s are infamous for #1, so much so that they added a special BIOS setting to go ahead and flip them (apparently Fn is a very special key which isn’t recognized by the OS and needs to be done at this low level)! So just go ahead and restart your computer, and press F12 at the opportunity, and hunt it down in the BIOS settings.
#2 was easily done using using KeyTweak. Note that while you can’t technically remap or create new Fn+<other key> combinations, you can remapped the media keys, which is effectively the same here.
Now I am happy, and I think I fixed the issue early enough that my wires aren’t too crossed.
Saturday, April 28, 2012
Odd br tags being inserted before and after VSPaste code when submitting blog post from Windows Live Writer 2011 to Blogger
The title says it all. I’m not sure if this is a problem with Windows Live Writer 2011 or Blogger, but I think it is Blogger’s issue because when I view source in WLW, it doesn’t show the breaks, they only appear after submission to Blogger. Indeed, I’ve been struggling against Google’s recent changes to Blogger, such as difficulties using my custom blog template I create for Project Euler for F#un to this, newer blog (I mean, sheesh, I only created the thing two years ago, would hope it wouldn’t obsolete ever, let alone so soon!).
Anyway, the solution was to edit the blog post through Blogger’s online editing tools, and remove the br tags from the source edit view there.
Quick way to convert a space delimited list to a literal F# data structure
First, I copied and pasted the list of words from the specification into a .fs file and easily made it into a literal multi-line string. Taking care to add an extra space at the end of each line so that the last and first words of two consecutive lines didn’t run together when ultimately split.
let reservedWords = "\ atomic break checked component const constraint constructor \ continue eager fixed fori functor include \ measure method mixin object parallel params process protected pure \ recursive sealed tailcall trait virtual volatile"
I submitted that to FSI.
val reservedWords : string = "atomic break checked component const constraint constructor c"+[156 chars]
Then, in FSI, I set the fsi.PrintLength to 1000 so that I could see the complete list in the output and split by ‘ ‘ and converted to a set.
> fsi.PrintLength <- 1000;; val it : unit = () > reservedWords.Split(' ') |> set;; val it : Set<string> = set ["atomic"; "break"; "checked"; "component"; "const"; "constraint"; "constructor"; "continue"; "eager"; "fixed"; "fori"; "functor"; "include"; "measure"; "method"; "mixin"; "object"; "parallel"; "params"; "process"; "protected"; "pure"; "recursive"; "sealed"; "tailcall"; "trait"; "virtual"; "volatile"]You can see that the resulting FSI output is directly usable F# code completing my task.
Sunday, April 15, 2012
Experimenting with precompiled regexes in Unquote
Today I spent some time experimenting with precompiled regexes in Unquote: https://unquote.googlecode.com/svn/branches/precompiled-regex. However, I was not able to show any measurable performance improvements from this work. Perhaps this was to be expected, considering Unquote only uses 5 compiled regexes currently and the upfront cost of compiling those on the fly must be small compared to the actual regex matching performed across all of Unquote’s nearly 500 unit tests (though Unquote uses a relatively small number of regexes, they are used frequently). So, for now, we’ll stick with normal compiled-on-the-fly regexes, unless we gain a large number of regexes in the future. But, it is worth noting the compiling on-the-fly does increase the performance of Unquote by 2x.
Friday, April 13, 2012
FsEye 1.0.1 released
FsEye 1.0.1 has been released. This is a maintenance release that only included a couple bug fixes (but critical if you wish to inspect any objects with setter only properties).