Nov
27
2010

Mounting a remote Linux folder as a Windows drive through SSH

There are some times in which you need to come to some extreme solutions. Having two days of trials without success to have a portlet running in a local Tomcat with Day portal I came to the following solution.

Shortly why I came to such a solution? I needed to work on some CSS on a portal solution, and the development cycle was taking too long. I had to commit to svn, run a teamcity build which deployed a war to weblogic to finally be able to test my CSS changes. Far too long.

So first idea was to have our portlet working locally in Day portal deployed on Tomcat. After many attempt to have this running, I have stopped with this idea.

Next idea was to work directly on the Linux file system, and modifying the CSS files which would be reloaded automatically by weblogic. Good idea, it was working but I needed more, I needed my development environment.

So I searched a solution to be able to mount a remote Linux folder as Windows drive through SSH. And I quickly found a solution! Thanks to Dokan SSHFS

I finally could fire JetBrains WebStorm on my Windows notebook, edit CSS files which are located on a remote Linux server, save the file and refresh my page on the browser. Straight solution, certainly not the best but at least I could work.

Dokan SSHFS is a great tool! It took me 10 minutes to install it and configure it.

You must take care of:

  • Dokan SSHFS supports only OpenSSH key format. So I used puttygen to convert my key.
  • Dokan SSHFS doesn’t work with Dokan 0.5, you have to use the updated files found on the web page

The rest was just easy! Well done.

Sep
28
2010

Using windows 7 symbolic link to organize your DropBox

If you are a user of the fantastic DropBoxtool you might know that you have to organize your folders under a top root folder. This was really an issue for me which I wanted to solve because I like to organize my files in a different manner.

I used the mklink command from a Windows Command

E:\My Dropbox>mklink
Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

        /D      Creates a directory symbolic link.  Default is a file
                symbolic link.
        /H      Creates a hard link instead of a symbolic link.
        /J      Creates a Directory Junction.
        Link    specifies the new symbolic link name.
        Target  specifies the path (relative or absolute) that the new link
                refers to.
I used it this way to create a symbolic link between a folder in “My Dropbox” folder on a folder outside:
E:\My Dropbox>mklink /D "Logs" "L:\Logs"
symbolic link created for Logs <<===>> L:\Logs

So now everything which is on my L:\Logs folder is synchronized using DropBox.

You can also use this trick to move folder around on your system after having those under the DropBox root folder. Before that I always stop DropBox and restart it after the creation of the symbolic link.

Very helpful!

Jun
4
2010

Build .NET projects from Windows Explorer using MSBuild Launch Pad (mPad)

In September 2009 I posted about a tool I am using to build my MSBuild projects from the shell “Build your .NET project with a right click in Windows Explorer

Last week I changed to MSBuild Launch Pad (mPad) which also add a context menu when you right click your project or solution files.

The added value for me is that it maintained project, 1.0 was released on May 21, 2010 with following release notes:

    • Support sln, csproj, vbproj, vcxproj, shfbproj, ccproj, oxygene and proj files execution.
    • Basic settings such as Show Prompt, and Auto Hide are provided.
    • MSBuild Shell Extension integration is achieved.

I also very much like that when I right click and say build I get the control on the .NET framework version I want to use and if it is a Release, Debug or what so ever.

4668737460_d5f6fd3791_o[1]

Nice little productivity booster tool.

May
21
2010

f.lux Better lighting…for your computer

A couple of month ago I was introduced by a colleague to f.lux.

At first I thought, hum ok another software that will just eat some memory for nothing. But after 2 days, in fact 2 evening, yeah I work a lot in front of monitors, I was conquered and I recommend this tool to all like me that spend their days and nights in front of monitors!

From f.lux pages

Ever notice how people texting at night have that eerie blue glow?

Or wake up ready to write down the Next Great Idea, and get blinded by your computer screen?

During the day, computer screens look good—they're designed to look like the sun. But, at 9PM, 10PM, or 3AM, you probably shouldn't be looking at the sun.

F.lux fixes this: it makes the color of your computer's display adapt to the time of day, warm at night and like sunlight during the day.

It's even possible that you're staying up too late because of your computer. You could use f.lux because it makes you sleep better, or you could just use it just because it makes your computer look better.

f.lux makes your computer screen look like the room you're in, all the time. When the sun sets, it makes your computer look like your indoor lights. In the morning, it makes things look like sunlight again.

Tell f.lux what kind of lighting you have, and where you live. Then forget about it. F.lux will do the rest, automatically.

flux-shot[1]

Apr
17
2009
Tools // WPF

Memory leak with WPF resources

I am working for a couple of months now with WPF and MVVM on an a business application using .NET Framework 3.5 SP1. Lately I faced a memory leak. Not the easy kind of memory leak with events handlers which keeps objects and its element tree alive, as explained here.

No it was something else ! I searched in our code for quite some time without finding anything.

My internet research brought me to a blog post from Ramon de Klein, “Memory leak with WPF resources (in rare cases)” which stated :

When does the problem occur?
The problem occurs in the following situation:

  1. A style is defined in the application’s ResourceDictionary.
  2. The style uses a control template that uses media effects (i.e. DropShadowEffect).
  3. The media effect should be referenced using a StaticResource.

We were matching the two first points and I tried the proposed fix:

You can force the effect to be frozen by specifying “PresentationOptions:Freeze=True”, but this is not common behavior.

The workaround is simple… Just add the Freeze attribute to all the effects that you don’t plan to modify at runtime.

But that didn’t made it.

I decided then to move the style definition from the application ResourceDictionary to the MainWindowView ResourceDictionary, which was for sure a better place for it. This to avoid the first point.

This worked! And we do not have this memory leak anymore. But as always when you fix one, some other popped up! But that’s another story.

How did I came to find the blog post from Ramon de Klein ?

With a perfect timing I got an offer from Red Gate to test their latest tool still in Early Access Program: ANTS Memory Profiler 5

You might watch a two parts video here (part1) and here (part2) and read about it here. You can even download a version from their forum, check it out.

First I used ANTS Memory Profiler 5 Timeline to see that the memory wasn’t released at certain points in which it should. The red line shows the Bytes in all Heaps and should go down after each vertical line (gray, blue and red)

Same result with Process Explorer, Memory usage going up without going down.

So we got on the screen the memory leak. Next step was to identify it.

Using Memory Profiler Class List, I browsed to the class that I new should be released, and proved it wasn’t: Live Instances is 3 and Instance Diff is +2. So at that time I knew that this class was maintained by something in memory.

Watching the Memory Profiler Instance list, I could identity the different instances still in Memory and one wasn’t new, so a good candidate to look at:

Finally switching to the Memory Profiler Object Retention Graph, I could navigate up the graph to see that DropShadowEffect was maintaining a reference:

Up to my application RessourceDictionnary, as exaplained in point 1 from Ramon de Klein blog post, as you can see.

All those information gave me the opportunity to find the blog post from Ramon and led me to the solution.

This is the result of the fix I implemented, as you can see I have now only one Live Instance of the ProductViewModel class and an Instance Diff of –1. This shows that the object wasn’t retained in memory and cleaned correctly.

 

ANTS Memory Profiler 5 and Ramon de KleinMemory leak with WPF resources (in rare cases)” blog post was of great help to fix this memory leak. Thanks!

Thanks flies also to Stephen Chambers for the support with my questions on ANTS Memory Profiler 5.

Finally I would like to warmly THANKS Laurent Bugnion for his kind chats that helped a lot, as always!

Apr
10
2009

ReSharper 4.5 released

As you might have realized following my blog, I am big fan of JetBrains ReSharper for quite some years! This tool really boost my productivity. Today they just realized ReSharper 4.5 which brings some new functionalities but also a huge improvement in performance.

What's New in ReSharper 4.5

ReSharper 4.5 delivers a great performance boost, new features and more. Read about them below or watch this Live Demo

Performance and Memory Usage Improvements

ReSharper loads and works faster and more smoothly in general, particularly on big solutions: now it takes 20 to 40 percent less time until the solution is ready for code editing. Website loading time has been reduced by 30%. Other accelerated operations include: renaming symbols, finding commonly used symbols, creating symbols from usage, and analyzing large XAML files. Memory requirements for analysis of jumbo autogenerated code files have been reduced. Read more »

Solution-Wide Code Inspections

To detect unused non-private members on the fly, we have improved our solution-wide analysis by introducing a set of specialized code inspections. They only work when you let ReSharper analyze your whole solution and help you discover: unused non-private declarations; unused return values of non-private methods; unaccessed non-private fields; unused parameters in non-private members; and more. Read more »

VB9 Support

Visual Basic .NET developers can now benefit from VB9 language support that includes implicitly typed local variables, object initializers, anonymous types, extension methods, lambda expressions, partial methods, and embedded XML. VB9 support is all around you, courtesy of new context actions, code completion, refactorings, and Parameter Info, among other supporting features. Read more »

Extended Naming Style Configuration

You can now define custom naming style settings for different languages and symbols including types, namespaces, interfaces, parameters, method properties and events, static and instance fields etc. Use them to precisely align the way ReSharper completes and generates code with your specific coding guidelines. Read more »

Other Enhancements

Go to Implementation — Jump from usage of a base type or member straight to any of its end implementations.
New and Improved Refactorings — Added Inline Field and refactored many other refactorings for greater performance.

Native MSTest Support — Finally provided natively in ReSharper on par with nUnit support.
Wider Cross-Language Capabilities — More efficient quick-fixes and context actions in many cross-language scenarios, as well as increased coverage for XAML and ASP.NET.
Smoother Language and Framework Support — Improved compatibility with F#, Compact Framework, Silverlight 2 and other languages and tools. Read more »

Download ReSharper

Jun
13
2008

ReSharper 4.0 with C# 3.0 support, JetBrains releases the ultimate Visual Studio plugin

JetBrains has released their ultimate Visual Studio plugin, ReSharper 4.0.

This much-anticipated productivity tool includes many new features and improvements.

It supports C# 3.0 and LINQ, plugs nicely into Visual Studio 2008 and 2005 and also support VB.NET.

It includes:

  • Full Support for C# 3.0 and LINQ; Full Edition and C# Edition provide comprehensive support for C# 3.0, including LINQ, implicitly typed locals and arrays, extension methods, automatic properties, lambda expressions, object & collection initializers, anonymous types, expression trees, and partial methods
  • Comprehensive Insight into .NET Framework
  • Solution-Wide Analysis, which looks for erroneous C# code in your whole solution on-the-fly, without compiling it first
  • Code Cleanup, flexible code compliance and formatting tool bringing together a dozen of ReSharper features. In addition to fine-tuning formatting style to use, you can opt to arrange 'this' qualifier, remove code redundancies, convert properties with backup fields to auto-properties, make fields read-only if possible, optimize using directives, shorten qualified references, update file header, replace explicit types with vars, and revamp your C# code with many more settings
  • New Refactorings
    • Convert Static to Extension Method
    • Convert Extension Method to Plain Static
    • Convert Property to Auto-Property
    • Convert Anonymous to Named Type
    • Inline Method
    • Convert Method to Indexer (to Default Property in VB.NET)
    • Convert Indexer (Default Property in VB.NET) to Method
  • Multiple New Productivity Features
    • Complete statement; inserts necessary syntax elements (braces, semicolons etc.) and gets you to the position to start the next statement, saving you from excessive juggling with the caret.
    • CamelHumps in Code Completion, allowing you to complete any symbol by entering only its uppercase characters.
    • Live Templates Editor & Manager, rejuvenated set of user interface items for viewing, managing, and editing all three types of templates — Live Templates, Surround With Templates, and File Templates.
    • Recent Edits, drop-down list similar to existing Go To features that shows files and symbols that you recently modified.
  • Smoother Interaction with Visual Studio Ecosystem
  • ASP.NET Speedup; significantly speed-up the analysis of ASP.NET pages 

You might read more details about all new features or the full list of features.

I recommend printing the keyboards shortcuts available in ReSharper 2.x / IDEA scheme and Visual Studio scheme.

You might also be interested by all the ReSharper’s plugins available: Gallio, RGreatEx, Agent Smith 1.1.8, Agent Johnson, ARP Another ReSharper Plugin, NHibernate Plugin 1.0, NSpecify, Scout plugin, xUnit.net 1.0

Finally you can download a free 30-day trial version of ReSharper 4.0. Go download it, it is just a must (at least for me and some others ;)!

May
20
2008

JetBrains ReSharper 4.0 EAP - First Beta Candidate released

JetBrains just released a First Candidate release of ReSharper 4.0 marked as Stable!

Date Build # Links Status Comment Known problems Fixed issues
19 May 2008 804 Download Beta Candidate Stable None Fixes
You might read more about this version 4.0 on the ReSharper 4.0 EAP Notes

I am using the 4.0 EAP for quite some time and I am really happy with it! In fact I just can't work without ReSharper!

Apr
22
2008

VisualSVN 1.4 released

VisualSVN, the plugin for Subversion in Visual Studio 2003, 2005 & 2008 was just updated with some new good features:

New Features
  • Quick Diff

    Quick Diff 
    Reviewing changes has never been so easy. Now you don't have to open separate diff window and remember locations of edited code blocks. VisualSVN marks in real-time the text lines changed since original version of the file and offers convenient navigation between them.
    Instead of pressing Page Up/Page Down several times and looking for changes just press Ctrl+Shift+Up/Down and jump to the next change immediatelly.

  • Toolbar

    Toolbar
    You don't need to remember curent code branch you are working on. There is current repository URL displayed on the VisualSVN toolbar and you can easily switch to another code branch from there. Buttons for the most common Subversion commands also make the life a bit easier.

  • Add Solution Wizard
    Add Solution

    First steps in using VisualSVN might have been non-trivial if you are not a Subversion expert. But with the brand new "Add Solution to Subversion" wizard it's just a piece of cake. The wizard automatically detects all potential problems and makes everything simple and intuitive.

  • Improvements and Bugfixes

    This release contains many stability fixes and improvements (eg. command-line tools included by default, digitally signed istallation package and more). For full list of changes please read VisualSVN changelog.

Upgrading from VisualSVN 1.3.x

The upgrade to VisualSVN 1.4 is free for all licensed users of VisualSVN. No need to uninstall previous version - simple install new one on top of it.

Download

Follow to the download page to get VisualSVN 1.4 and enjoy new level of productivity!

Mar
30
2008

VisualSVN Server 1.1 released

By starting to write a post about the new step achieved in the tooling of Tech Head Brothers development I just realized that VisualSVN Server 1.1 is released.

So I downloaded and updated my installation in 2-3 minutes, all went well, just nice.

VisualSVN Server Change Log

Version 1.1 (March 24, 2008) [Release Notes] [Download]
  • Added support for authentication via Windows domain.
  • Implemented VisualSVN Server dashboard.
  • It is now possible to edit server configuration via management console, without reinstallation.
  • Implemented "Import Existing Repository" command.
  • New user-defined configuration file named httpd-custom.conf has been added.
  • URL of the selected node is now displayed in the description bar.
  • New toolbar for the "VisualSVN Server" node has been added.
  • VisualSVN Server now will always use hostname as "server name".
  • VisualSVN Server will now suggest to subscribe to our news channel during installation.
  • "Copy URL" and "Browse" commands will now issue a warning if there are no users defined.
  • Warn user if the port we use is occupied by another service.
  • "Create Repository" command has been renamed to "Create New Repository".
  • "Copy URL" command has been renamed to "Copy URL to Clipboard".
  • Fix: File C:\.rnd was being created during installation.
  • Fix: VisualSVN Server couldn't be installed if there was no "C:\" drive in the system.

About Laurent

Laurent Kempé

Laurent Kempé is the editor, founder, and primary contributor of Tech Head Brothers, a French portal about Microsoft .NET technologies.

He is currently employed by Innoveo Solutions since 10/2007 as a Senior Solution Architect and certified Scrum Master.

Founder, owner and Managing Partner of Jobping, which provides a unique and efficient platform for connecting Microsoft skilled job seekers with employers using Microsoft technologies.

Laurent is awarded by Microsoft since Avril 2002: Most Valuable Professional (MVP).

MVP
Certified ScrumMaster
JetBrains Academy Member

My status

Twitter

Flickr

www.flickr.com
This is a Flickr badge showing public photos and videos from Laurent Kempé. Make your own badge here.

Month List

Page List