claudiolassala

Claudio Lassala is an independent Software Developer who currently works mostly building Ruby on Rails applications. Previously, he has worked for several years developing .NET applications, presented several lectures at Microsoft events such as PDC Brazil, TechEd Europe, and various other Microsoft seminars, as well as several conferences and user groups across North America, Europe and Brazil. He is a multiple winner of the Microsoft MVP Award since 2001 (for Visual FoxPro in 2001-2002, and for C# ever since). He has articles published on several magazines, such as MSDN Brazil Magazine and CoDe Magazine. He started the Virtual Brown Bag meetings in 2009 and have been hosting it weekly since then. When not writing code, Claudio is probably rocking out with his band, Descent Into Madness.

Homepage: https://claudiolassala.wordpress.com

How to do XML comparison in an application?

Working on a tool that does some end-to-end testing, I have a need to compare xml input/output. Comparing xml isn’t a simple string comparison, as a single extra space would deem the results aren’t equal. I need to compare both the structure as well as the actual data contained in the xml.

This is a .NET application. I’ve looked for some components out there that perform such comparison and found some, but there’s still quite a bit of work involved in taking the results the components give me (listing each line and each difference) and showing it to the user in a meaningful way.

Instead of spending a lot of time (and therefore, a lot of my client’s money), I figured the easiest/cheapest way to implement this was to simply integrate Beyond Compare into the app. That way, it’s very, very easy to see what the differences are between the two xml documents, as Beyond Compare clearly shows the differences down to the attribute level.

The way I’m doing it is my saving the XML content to disk, and then firing up Beyond Compare using the Process class, passing along the path to the files. (see code below)

public class XmlDiffController : IXmlDiffController    
{        
	public void OpenDiff(string leftXml, string rightXml)        
	{            
		var leftResultsXml = @"c:\temp\left-results.xml";
    	File.WriteAllText(leftResultsXml, leftXml);
    	var rightesultsXml = @"c:\temp\right-results.xml";
    	File.WriteAllText(rightesultsXml, rightXml);    
        
		Process.Start(new ProcessStartInfo(TesterSettings.DiffToolPath)
		{                
			WindowStyle = ProcessWindowStyle.Maximized,                
			Arguments = string.Format("\"{0}\" \"\"", 
								 leftResultsXml, rightResultsXml)            
		});
 	 }  
}

 

DiffToolPath is the path to Beyond Compare on my environment. As I’m doing this development on a Windows Virtual Machine inside a Mac host, my DiffToolPath points to Beyond Compare on my Mac, like I’ve described on my Integration of Beyond Compare and Parallels on the Mac post.

Works like a charm, quick, cheap, and easy!

Leave a comment

Integration of Beyond Compare and Parallels on the Mac

I’ve been using Beyond Compare as my tool of choice for file and folder comparison for a long time now. When I first moved to the Mac world there wasn’t a Mac-version available yet. That was a bummer. Fortunately, now there is one now.

When I need to do work on a PC, I run a Windows virtual machine on my Mac using Parallels Desktop.

I’ve just learned recently that I can use my Beyond Compare on the Mac directly from within my Windows virtual machine (at least using Parallels). It works just like that: I invoke the comparison from inside the virtual machine, and Beyond Compare pops up on my Mac (the host). Pretty nifty!

One great benefit is that I can have just one license of Beyond Compare for the Mac, instead of having licenses for both the PC and the Mac.

,

Leave a comment

Virtual Brown Bag on Feb 16, 2016

Good things coming up for the Virtual Brown Bag:

The website is back up!
http://virtualbrownbag.com/

We are also on Slack:
http://slack.virtualbrownbag.com/

A Community on Google:
Virtual Brown Bag Community on Google

We’re scheduling people to come give us a 10-30 minute talk on specific subjects, in order to get some discussions going. We’ll be publishing our schedule to some online calendar.

Other topics covered this week:

Angular 2

JB’s struggles with Ember

George’s checklist for project estimation:
https://github.com/togakangaroo/estimation-checklist

I shared the Breaking the Time Barrier book, written by the creator of
Freshbooks.

I also shared about Rails Assets, and asked how the guys handle pulling libraries into Rails app. JB says he’s given up on using gems for that, and just puts the files into the project. I’ll probably try that, too.

JB also shared this: Google assets sync rails

Enjoy!

Leave a comment

Using an iPad as a Second Screen

At least one extra screen is essential for me. Many years ago I posted about Organizing Windows and Multiple Monitors.

When I migrated to using a Mac most of the time, as well as using an iPad for many things, I was happy to know there was a way to use the iPad as a secondary monitor. That to me was great because whenever I wasn’t at my normal working place (maybe traveling to clients or conferences) I always have both my Mac and my iPad with me, so I could still work in a dual-screen set up (not huge screens like I prefer, but still…).

At the time I wrote up about that: Setting an iPad as an extra monitor. That approach, however, wasn’t flawless. The app I was using, Air Display, connected the Mac and the iPad through the wi-fi network. In some networks, I just couldn’t get this to work. Also, there was a noticeable lag when moving between screens.

Fortunately, about a year ago I found this app: Duet Display. Life was good again. This app uses the iPad USB cable to connect to the Mac, and it has zero lag.

Now I just need to get me that bigger iPad!

Leave a comment

Virtual Brown Bag on Feb 9, 2016

My notes for last week’s VBB…

George talked about JavaScript generators.

I talked about my struggles integrating AngularJS templates into a Rails app, which boiled down to me skipping a step or two following instructions on how to use the Angular-Rails-Templates gem.

I mentioned Postach.io, which is a blogging platform that allows us to maintain a blog by writing the posts as notes in Evernote. This is what I’m using for my musical blog, Sanctuary of Nevermore.

For my professional blog, www.lassala.net, which is hosted on WordPress, I’ve been using a blogging tool called Blogo, which allows me to write my drafts in Evernote, and then edit the posts and publish it using this tool.

I’ve also mentioned my post Catching up with my Book Reading, and talked about three books I’ve finished recently that I really enjoyed:

Anything you Want: 40 lessons for a new Kind of Entrepreneur, Derek Sivers

Mastering Creativity, James Clear

The 22 Immutable Laws of Marketing, Al Ries & Jack Trout

, ,

Leave a comment

Stop Thinking About It and Just Do It!

I think I’ve been good at having ideas and saving them off somewhere. I’m now trying to get in a flow where I turn those ideas into something.

I’ve been following James Clear’s blog posts where he shares several good tips around building habits, taking action, etc. Here are two posts that I have been keeping in mind and trying to put it to good use:

The Mistake Smart People Make: Being In Motion vs. Taking Action

Example: If I outline 20 ideas for articles I want to write, that’s motion. If I actually write and publish an article, that’s action.

I read that post and his examples resonate with me. I went back to where I keep ideas, and sure enough I’ve been having a lot of “motion”, but not “taking action”. I decide to change that, so I picked a few ideas that seem to make me go like “yeah, I want to do that”, and started to take action on them, tracking the steps and trying to make progress.

This is another post of his I keep going back to:

The Physics of Productivity: Newton’s Laws of Getting Stuff Done

  1. Objects in motion tend to stay in motion. Find a way to get started in less than 2 minutes.
  2. It’s not just about working hard, it’s also about working on the right things. You have a limited amount of force and where you apply it matters.
  3. Your productivity is a balance of opposing forces. If you want to be more productive, you can either power through the barriers or remove the opposing forces. The second option seems to be less stressful.

I’m keeping those ideas in mind and trying to apply them on a daily basis. I also enjoy these two short free PDF books available at his site:

Leave a comment

Virtual Brown Bag on Feb 2, 2016

Last week both George an I couldn’t make it to the VBB, but JB came through and shared more of his Earlang, Elixir and Phoenix love. The video is up and running so you can catch up (I just did!):

,

Leave a comment

Follow

Get every new post delivered to your Inbox.