Amazon.com Widgets Nick Hodges | A man's got to know his limitations

Less is More for your CSS

By Nick at October 24, 2012 10:34
Filed Under: Delphi, Software Development, Tech Stuff

As you may have noticed, I made a few changes to the website here at good ol’ nickhodges.com.  I added a column of boxes on the left, with the idea being to make stuff more accessible without so much scrolling.  And, well, yeah, okay, I’ve used that space to add a few more advertisements.

And while I was at it, I cleaned up a few things with the layout and the CSS.  It’s what I did with the CSS that I’d like to talk about today.

The main thing that I did was to start using the CSS pre-processor called Less.  Less allows you to do a lot of things “right” when writing CSS.  The first thing you notice when you start writing CSS is that it is a horrible violator of the DRY principle – Don’t Repeat Yourself – and Less solves a bunch of those problems.  It’s hard to write “clean CSS code”.  Less can help.  Less allows you to:

  • Create a *.less file that is then processed into your CSS file.  You can do this manually with a command line preprocessor, or you can do it on the client-side with Javascript.  Below, I’ll discuss how I pre-processed my *.less file automatically
  • Declare variables for colors and other things.  Say you have a color that you use in a number of different places.  You can declare

         @WidgetBorderColor: green;

    and then everywhere you had to type green, you could put @WidgetBorderColor instead.  Then, if you want to change from green to red, you only have to do it in one place.  That is really nice. 
  • You can also declare mixins – or chunks of CSS code that are commonly used.  For instance, if you have a bunch of places that use  

         {padding: 0px; margin: 0px}

    then you can declare

         .p0m0 {padding: 0px; margin: 0px}

    and use that as an “alias” in your *.less files

       body {
        .m0p0;
        font-family: Verdana;
        font-size: 13px;
        color: @Black;
        background: @White ;
       }

  • You can also use parameters to pass in to your mixins if you want, an other more complex constructs, though none of it is terribly difficult.   The Less page has all the documentation in one place.  The two features above were what I used in an effort not to repeat myself in my CSS.

Once you have your less file set up, you can process it via the command line, or using a GUI compiler tool.  Because Less is written in Javascript, you can use node.js to run it on your local machine.  To do that, you can download the Node Package Manager and then install  Less by simply executing

npm install less

npm is kind of interesting – it’s an online registry, so when you issue the above command, it goes out to a public registry and finds the Less package and simply installs it – there’s nothing for you to install. I guess it is much like Nuget in that regard. 

After that, you can then execute the lessc compiler. 

So the workflow at this point is:

    1. Write CSS and Less code in a *.less file
    2. Compile the *.less file into a *.css file.  (For instance, I use a batch file with:  c:\Code\node_modules\.bin\lessc C:\NickHodges\themes\nick\style.less c:\NickHodges\themes\nick\style.css
    3. Deploy the new CSS file with my site
    4. Repeat as necessary

Step 2 is kind of a bother, though.  You have to shell out to the command line to do the compile.  Who wants to do that if you don’t have to?

Well, I sure don’t.  So I found a cool tool called WinLess which does a nice thing – it automatically compiles your Less code into CSS every time you save your *.less file.

image

It works great – you just point it to your *.less files, and whenever you save changes, it automatically compiles the Less code down to CSS.  That way, your CSS is always up to date, and you just have to worry about your Less code.  Maintaining the CSS file is totally painless.  So now the workflow is:

  1. Update your *.less file as desired
  2. Save
  3. Deploy your *.css file.

That’s a lot easier, eh?

Now what I really want is a tool to find patterns in your CSS and automatically turn them into Less entries.  That would rock.

CSS is powerful and cool, and you can’t create a well-designed website without it.  But as a language, it’s not really very “best coding practices friendly”.  Less makes it much more so.  If you set things up correctly, you can do your styling in Less and forget about CSS altogether.

What do you guys do with your CSS?

Flotsam and Jetsam #67

By Nick at October 20, 2012 00:12
Filed Under: Flotsam and Jetsam, Delphi, Software Development
  • For those of you who still cling to the archaic notion that “Delphi Marketing Sucks”, you should know that I can’t go anywhere on the internet without seeing an add for RAD Studio XE3.  One of the things I appreciate about Google Adsense is that it knows the kinds of ads I want to see and what I am interested.  And it has very astutely determined that I like Delphi.  And Embarcadero marketing has very astutely provided ads to let me know that RAD Studio XE3 exists and that I can buy it.   That’s what marketing is all about.
  • How have I managed to miss this page of cool stuff all these years --  Delphi Inspiration? I’m particularly intrigued by the Delphi pre-processor.
  • Cool Thing Built With Delphi of the Week: dbConstructor
  • A bunch of you have ordered Delphi XE3 from me. I am very grateful. Thanks.  It's a great release -- I'm really enjoying using all the cool new language and RTL features, and I think you should too.

My Take on TypeScript

By Nick at October 17, 2012 12:43
Filed Under: Delphi, Tech Stuff, Software Development

Microsoft has been keeping the renowned Anders Hjelsberg busy on a new language called TypeScript.  Typescript is an open-source project (using the Apache 2.0 license) that allows you to write a super-set of Javascript that allows for a stronger typing system.  You can watch Anders’ original launch presentation

I’ve said a million times that I’ve said a million times that Javascript is the new Assembler – that Javascript will become the thing that everyone compiles higher level code into.  You’ll write your web apps in a higher order language, and then compile them to Javascript for execution in the browser. 

I refuse to believe that any rational person actually likes to write Javascript, and as it is designed currently, it really isn’t a language for developing the kind of large-scale applications that people seem to be wanting to use it for.  In the deep, dark past, Assembler used to be all there was, and we created higher order solutions that compiled to assembler.  And in the same way, for a while, Javascript was all there is for the browser.  Now, however, we are beginning to see higher order languages being brought to bear to produce Javascript for us. 

If Javascript is the “new Assembler”, then the Browser becomes the “new operating system”.  The cool thing about that is that the “new OS” is ubiquitous.  Just about every computer in the world – computers running Windows, OS X, Linux, Unix, whatever – has a browser that runs Javascript.  That means your application can run on any computer.  That’s a very compelling idea.

You can actually do that today with Delphi using a very cool tool called Smart Mobile Studio.  There is also the Elevate Web Builder tool from Elevate Software.  Both have the same idea – leverage the power of Delphi to produce Javascript-based applications.  Pretty cool, really.

Anders talked to Scott Hanselman about Microsoft’s offering in the “Language to compile down to Javascript” arena in the latest episode of Hanselminutes.  Anders is always a good interview – I love a guy who thinks and speaks as clearly as he does.  (That’s why I always loved a Danny Thorpe presentation.  Danny is pretty quiet and mellow, but his talks were always so clear and well organized – every single word he said was worth listening to – that they were always excellent and enormously educational.  Anders is the same way….) He does a great job discussing the notion behind TypeScript.

Here are some of my thoughts on what Anders said and on TypeScript in general.

  • TypeScript seems to exist for two reasons – to make Javascript “tool-able” and scalable. 
    • First, the type annotations, classes, modules, and other enhancements exist to allow Visual Studio and other IDEs to do things like Code Completion (the RAD Studio term that Anders used in the podcast instead of Intellisense – I loved that.  Smile  ), refactoring, and other language-based features that modern IDE’s do.  Javascript doesn’t provide enough information to let development tools do all the things that we expect, but TypeScript does. 
    • Second, TypeScript is also a way to make Javascript scale. By providing the notion of typed classes and modules, you can create larger, well-organized TypeScript applications which then compile to Javascript.   TypeScript is a language ready to do the heavy lifting that Javascript cannot.
  • Since TypeScript is a super-set of Javascript, it follows that pure Javascript is valid TypeScript.  Anders points out that you can use your existing Javascript as is inside of TypeScript.  The idea, though, is that TypeScript becomes the language you’d use instead of Javascript because of all the tooling support, and because it can be used to build applications via modules (units, for you Delphi folks).    Typescript doesn’t have any runtime or virtual machine – it literally just compiles to Javascript. 
  • You can create an external declaration file to define the types in your *.js file, so that means that existing Javascript libraries like Node.js and jQuery.js can be “typed” and thus used in the TypeScript environment.  I think that is a pretty cool idea – and I’m sure that Microsoft will be delighted if the community follows their lead and “converts” the existing popular libraries.
  • Anders also points out that TypeScript puts a “dial” on the typing level of your code.  Pure Dynamic advocates can leave everything untyped, and the strong-typing zealots can type everything if they want, and the folks who want to type some things and not type others can do that if they want.  That’s a very interesting notion – a language with a variable level of type-safety.

Now one thing to note is that tools like Smart Mobile Studio and Elevate Web Builder offer pretty much all these features as well.  There isn’t any reason that Embarcadero couldn’t make Javascript be something that is output by the Delphi compiler.  Heck, there is even a project out there to get LLVM to produce Javascript.  TypeScript would integrate well into HTML5 Builder. Whatever higher-end language you want to use, it seems pretty clear to me that Javascript will be the thing our compilers will be producing in the not-to-distant future.

Are you going to give TypeScript a look, or are you more interested in the Delphi-to-Javascript solutions?  I’ll probably check out both.  Either way I have to use a different IDE, so I’m guessing I’ll lean towards the Delphi-based solutions.  Plus, I frickin’ hate curly braces.  Winking smile

What do you guys think?

Frank is Back

By Nick at October 12, 2012 09:43
Filed Under: Delphi

This is posted without comment, because I really don’t know what to think or say.

Flotsam and Jetsam #66

By Nick at October 11, 2012 23:42
Filed Under: Flotsam and Jetsam
  • I’ve talked about my Ooma.  I love it – I has cut my phone bill from $50 a month to $5 a month.  It works great, and I get unlimited calling in the US, and $0.01 a minute to Canada.  (That’s important to me, as my wife is from Saskatoon and calls her family there.) In fact, the phone bill is $0, and the $5 is just taxes.  It is paying for itself in four months.  And right now, you can save $40 on the unit, meaning it will pay for itself even faster.  And if you buy from this link, I get a commission.  It’s a win for everyone. 
  • Blog Sightings:   There’s been a bunch of activity on the Embarcadero Blog site:
  • The Embarcadero MVP program is “official” now in that there is a web page and everything.  I’m honored to be included among the list of amazing, skilled, and knowledgeable folks.  Know someone who should be on the list?  You can nominate them
  • One of the cool new features in Delphi Xe3 is helpers for intrinsic types.  The most noticeable one is TStringHelper which lets you do things like MyStringVar.Length and MyStringVar.ToUpper.  However, I find it curious that they didn’t include a “standard” helper for integers.  I supposed it is because there are so many different integer types, but I seems that they could solve that through some form of inheritance, right?  I don’t know.  I just know that I’d like to be able to go MyIntegerVar.ToStringSmile
  • Here’s a blog post after my own heart: Why you should use Delphi’s Unit Testing – DUNIT.  In fact, there is a bunch of great stuff on the India Delphi User Group blog
  • Is it just me, or is it weird that Send To|Clipboard as Name isn’t a default behavior for a file in Windows Explorer?  I must use that twenty times a day.  I have to add a plug-in to have that feature. 

Flotsam and Jetsam #65

By Nick at September 25, 2012 10:14
Filed Under: Flotsam and Jetsam, Delphi
  • Hey, here is something cool.  I am now an Embarcadero Affiliate.  This means that you can buy Delphi XE3 from me.     You can click on that link or any of the banner ads right now, buy, and get a great version of Delphi.  I’d really appreciate it. Definitely.  Go on, you know you want to.  Winking smile
  • The Call for Papers for CodeRage 7 is out.  I will definitely be submitting some presentations.  This year they are actually having two CodeRages, one for Delphi and one for C++Builder.  If you have never done so, but have always wanted to be a speaker, I’d suggest that you submit some presentations.  It’s really cool being a presenter at these events.  I’ve always enjoyed it.
  • One of the unsung heroes of the Delphi community is Uwe Schuster.  Uwe does a lot of things that benefit us all.  Most prominently, he basically wrote and continues to update the Version Insight feature in the IDE.  If you are storing your Delphi code using Subversion, Mercurial,  Git, or Jedi VCSm then you should be using the IDE integration that Uwe has provided.  It’s actually quite amazing.  The Live Blame feature alone is worth it.  But that isn’t all – Uwe has a bunch of really good IDE plugins, including a nice TStringList visualizer, an expert that enhances the Object Inspector, and for those of you who hate the new modeless search feature, a modal search dialog.  So here’s an official F&J ShoutOut to Uwe for all the cool stuff he does.
  • The Jedi VCL Library is now ready for XE3.  I for one am very appreciative of all the great work the Jedi team does for the community.
  • I don’t know if many of you know Joe Hendricks. He’s been a Delphi community member for a long time.  Both he and his wife Heidi have been battling cancer for many years, and his Facebook posts about their progress, adventures, and life were an inspiration to me and many.  Their faith in Jesus was evident throughout everything they did.  Heidi passed away early this week.  I’m saddened at the loss of a woman I never met, but who was in inspiration to me.  And I send my condolences to Joe, who was a fine example of what it means to be a man, a husband, and a Christian.

Stuff I’ve Been Reading #1

By Nick at September 08, 2012 07:33
Filed Under: Software Development, Unit Testing, General, Book Review, Stuff I've Been Reading

Flotsam and Jetsam #64

By Nick at September 05, 2012 19:00
Filed Under: Flotsam and Jetsam, Tech Stuff, Delphi
  • Jim McKeeth was kind enough to interview me for the The Podcast at Delphi.org.   It was fun to do. 
  • In a previous Flotsam and Jetsam, I mentioned that I had received as gift an ASUS RT-N16 and loaded it with the TomatoUSB firmware.  So far, it’s been working great – I really like it.  The reason I did it was to be able to have better control over the Quality of Service so that I could install an Ooma Telo  Well I have done so, and am quite pleased. 
    • I paid the $40 to have my number changed over.  It took about ten days, and now I am running the Ooma as my house phone. 
    • I got the Ooma Telo from Amazon for $150 (a special price, apparently, as the price appears to have gone up), and paid $40 for the number transfer.  I have cancelled my phone service from Comcast, saving about $50 a month.  That means that the Ooma Telo will pay for itself in four months, and save me a pretty good chunk of change going forward.  
    • And here’s a fun thing about the Ooma – I can take my home phone with me.  If I say, take a trip to my folks house, I can bring the Ooma, plug it in, plug in a phone, and I have my “house”  phone there wherever I am.  I don’t know why I find that amusing. 
    • One concern I had was the fact that if the power goes out,  my phone goes out.  But that’s true for my Comcast phone as well, though it would take a while for the battery to wear out.  In addition, we live in a development with lots of neighbors, and we have cell phones.  And lots of people are starting to get rid of their house phones all together, so that turns out to be a minor concern for me anyway.
  • Alas – Barry Kelly has moved on from Embarcadero. His contributions to Delphi are many and lasting.  I don’t know if I’ve ever met a smarter person, frankly. He’s also just a very interesting guy generally.  Good luck to you, Barry.
  • I won’t be the first Delphi book on LeanPub.  Currently available is Parallel Programming with OmniThreadLibrary by Primož Gabrijelčič.  (You did catch that I am writing a book, right?)
  • There are some pretty cool goodies that you can get if you buy RAD Studio XE3 right now, including a FireMonkey grid from the excellent folks at TMS Software.  It’s called the RAD XE3 Bonus pack. 

I’m Writing a Book

By Nick at September 03, 2012 08:09
Filed Under: Delphi, General, Software Development, Unit Testing

I’ve decided that my first official act as an Embarcadero MVP will be to write a book.

Here’s some details:

  • You can see the outline and a brief discussion here.
  • I’m writing it on LeanPub.  LeanPub is very cool.  They make it very easy for a guy like me to write a book – that is, a guy who doesn’t really know anything about the process of actually producing a book, as opposed to the content in the book.
    • LeanPub outputs to PDF, MOBI, and ePub formats. 
    • Eventually I’ll probably put the book on Lulu or some other on-demand publisher to allow folks to get physical copies if that is what they prefer.
    • You can view the outline on the LeanPub page
    • The book will contain a lot of content from my blog, but of course I’ll enhance and improve that material.  And there will, of course, be a lot of new material.
    • Many of the topics will include the Delphi Spring Framework, DUnit, ,and other cool new frameworks. 
  • I’ve actually been working on the book for a while, but once I saw LeanPub, I knew that I had to make the move official.
  • You can sign up to find out when the book gets published.  You can also tell me how much you are willing to pay for the book. 
  • LeanPub lets you very easily update and enhance the content.  So I’ll probably publish well before I’m done and then update as I go along.
    • This will allow early buyers (who will likely pay a lower price) to provide feedback.  Sort of like a “beta test” program.
    • It will also let me correct mistakes
    • And of course all purchasers will always have access to the latest and greatest version.
  • I’ll naturally incorporate feedback as much as I can.  Your help will make the book better for everyone.
  • I don’t know yet what I’ll charge and when.  That’s another cool feature of LeanPub – I can experiment with the pricing.  A lot of books on LeanPub have a variable, choose-your-own price models.

So I’m pretty excited.  LeanPub really was the catalyst to finally move ahead and make my idea public. 

So give the book a look, sign up to receive updates, and please feel free to provide feedback – I’m interested in what the community has to say.  As long as you are polite and professional, of course.  Winking smile

On the EULA and the Delphi Community

By Nick at September 02, 2012 13:24
Filed Under: Delphi, Leadership, Personal

I won’t rehash the details of the recent “EULA Incident”.  You can read about it for yourselves in the newsgroups or on various blogs and comments.

I want to talk, instead, about the reaction, response, and behavior of some of the community to the event.

First, I’m well aware that because on the internet no one knows you are a dog, people feel free to behave in ways they never would in person.  I have been as guilty as anyone of this over the years, though I daresay that I like to think that I’ve become self-aware about the issue and been a much  better online citizen over the past few years.  However, being on the internet isn’t an excuse to be rude, offensive, and, well, a jerk.

And frankly, the response to the EULA issue by the Delphi community was shameful.  Seriously.  It wasn’t a rational discussion, it was a witch hunt.  I’ll not weigh in on the issue at all other than to say that I was glad to see Embarcadero respond to the uproar by deciding not to make the change.  And when I expressed that sentiment, I was pretty aggressively attacked for apparently not participating in what I called the “public flogging”.  And then I was aggressively attacked for calling it a public flogging.

And it was a public flogging.  It couldn’t even remotely be described as a professional discussion.  I understand that the proposed but never adopted change would have had a rather profound effect on many people.  But even so, that is simply not an excuse for meanness and vitriol.

Why am I writing this? Well, because I consider David Intersimone one of the finest men I’ve ever known and a good friend.  He is kind, gentle, smart beyond reason, and very, very dedicated to the Delphi community.  And for the Delphi community – whom he has served so well for many, many years – to treat him so badly was, well, very, very painful for me to see.  DavidI didn’t even remotely deserve the treatment he got, and those of you who were so unpleasant to him should be ashamed of yourselves. 

They say “All’s well that ends well”.  The Delphi XE3 EULA controversy apparently is ending well. 

But the Delphi community’s treatment of its longest and dearest friend did not end well at all.

Honored to be an Embarcadero MVP

By Nick at August 26, 2012 05:35
Filed Under: Delphi, General, Personal

I am honored to be included amongst a rather large list of impressive developers as an Embarcadero MVP for Delphi.  The program is still young, and so I’m not entirely sure what it means to be part of it, but whatever it is, I’m honored and pleased to be included, and I’ll do my best to be worthy of that honor. 

There is already a nice perk to the position – the team at DevJet – about whom I can’t say enough nice things  – have given us free versions of all their products forever. That’s a long time!  This is very cool, as I am a big fan of Document Insight, including the new Enterprise version.

I’m looking forward to seeing where this all goes.  So my thanks to all of you and to Embarcadero.

Flotsam and Jetsam #63

By Nick at August 23, 2012 20:38
Filed Under: Delphi, Flotsam and Jetsam

Flotsam and Jetsam #62

By Nick at August 22, 2012 08:36
Filed Under: Flotsam and Jetsam, Software Development, Delphi
  • Okay, so it looks like the release of Delphi XE3 is imminent.  My friend Tim Del Chiaro (the Delphi Insider) has announce the World Tour for the release.  The official page is here.  Tim also mentions something about a new product “HTML5 Builder”.  That sounds interesting.
  • JT, the Product Manager for RAD Studio, has a blog post with more info. I’ve not dabbled much in mobile development yet, so the most interesting part was “by adding memory management features such as automatic reference counting” – that’s very intriguing.  This could add a whole new dimension to the great FreeAndNil debateWinking smile
  • I’m always looking to sell stuff on ebay – so when I put in my new ASUS RT-N16 router, I thought I’d sell the old one.  Apparently, I’m not the only one doing that, as the router that Comcast gave me is worth only about 15 dollars, if that.  They are $40 at Amazon. Oh well.  Winking smile  I was hoping it was worth a bit more.  But hey, $15 is a lot of money, right?
  • I think I’ve said at least 453 times how much I love FinalBuilder.  So I’m always happy to pass along good news about what the folks at VSoft are up to.  Their latest is a very intriguing product called Continua CI, recently released in beta.  It’s a follow on to their FinalBuilder Server product.  I say “follow on” and not “upgrade” because it looks to be something quite a bit different and improved. Robert Love has a good write-up on it as well.    We here at Gateway Ticketing currently use Jenkins in concert with FinalBuilder, but if the licensing for Continua is favorable, it might be something for us to consider.  In any event, I always recommend looking at anything at all from the fine folks at vSoft Technologies.

Cool New Tool: Delphi Code Coverage

By Nick at August 18, 2012 10:27
Filed Under: Delphi, Software Development, Unit Testing

Code Coverage is an interesting topic – Wikipedia defines it as “the degree to which the source code of a program has been tested.”  The idea is that you want to measure what percentage of the lines of code in your application are executed when you run your test suite.  The “perfect” test suite would execute every single line of code in your codebase.  Being able to definitively measure that goes a long way towards validating your testing suite and giving you confidence that your tests are thorough and testing everything that needs to be tested.

So I was really happy to run across the Delphi Code Coverage tool. I was intrigued and interested, so I downloaded it and gave it a look. And I really liked it.  I decided to run it through its paces by checking the code coverage of the unit tests for my THTMLWriter project. It didn’t take me long to figure out how to use it.   It’s written by Christer Fahlgren.  He blogged about it back in 2010.  It has a couple of other committers, and it’s been an active project throughout out 2012

The project includes this note: “The 1.0 release was made possible through the generous support of DevFactory.” I thought that was cool, and so I encourage you to go to their website and check out their services.

Some things to note off the bat:

So what did I do?  Well, first I pulled the source to make sure I had it.  Then, I went ahead and downloaded the RC7 build, which has one file in it:  codecoverage.exe.  I took that file and put it in a folder along my path so I can call it wherever I need it.

Then, I read the nice simple documentation.  I was just testing it out, so I ran everything manually via the IDE just to see how it all worked.  Eventually, you’d want to integrate this into your continuous integration. So here is a quick rundown of what I did and what I found. 

First, I opened up the project options for my THTMLWriter unit test application and told the Linker to create a MAP file for the project when I build it. The tools uses the MAP file to trace all the code paths that the application under test uses.

Next, I looked for the appropriate command  line switches. 

  • I used it –e switch to name the executable that would run. 
  • I used the –m switch to name the *.map file.
  • I used the –u switch to tell the tool what code unit I wanted analyzed.  Note that the switch wants the unit name, not the file name.  You can list as many units as you want after this switch.  Alternatively, you can use the –uf switch to point to a text file that has a list of unit names (one per line) to be examined.  In my case, I’m interested in the code coverage for the uHTMLWriter.pas unit.
  • I used the –html switch to indicate that I wanted the output to be an HTML file.  This would make it easier for me to look at the results in this “by hand” method of running things. 

The resulting command line was as follows:

codecoverage -e HTMLWriterTestAppTests.exe -m HTMLWriterTestAppTests.map -u uHTMLWriter -html

Note that the above command line assumes that the current directory of your command prompt is the directory where the files in question are located.  I actually put the command line in a small batch file in the same directory.

So then I executed the command.  The tool popped up the GUI Runner for DUnit, I pressed the Run button, the tests ran, and when they were done, the tool finished up and produced some output in the form of an HTML file.  (It also provided a FastMM dialog at the end of its run, which took a few seconds to appear).

image

As noted, the result was two HTML files -- one summary file:

image

and a file that shows me the coverage for the uHTMLWriter unit.  That has a header in it that tells me that I have 98% code coverage.  Not bad!

image

But the real fun part is that the file contains a complete listing of the unit, color-coded to indicate which lines were executed (in green) and which weren’t (in purple). So 2% of my code isn’t covered?  So I scanned the file and came across this:

image

Looks like I never wrote a unit test for the OpenLabel method that takes a string parameter.  (I have one for the parameter-less OpenLabel).  Okay, so I went back, wrote a unit test for that one, and re-ran the code coverage tool, and now I have code coverage for that method:

image

 

Nice!  The tool also pointed out that I don’t test that a number of exceptions get properly raised, so I’ll get working on those, too.  I’d like to be able to run the report and have it return 100% for my coverage. 

Overall, this is a nice and powerful tool to help you make sure that your unit tests really are running every line of code in whatever you are unit testing.  It’s another great contribution to the Delphi community.  Thanks, Christer.

Flotsam and Jetsam #61

By Nick at August 11, 2012 06:54
Filed Under: Flotsam and Jetsam, Delphi, Tech Stuff
  • I’ve never been a hardware or network geek, but after I read this post by Jeff Atwood about how easy it was to set up custom firmware on a router a few notches above the “cheap one they basically give you when you sign up for cable internet”, I thought that I might try it some day.  I put the Atwood-recommended Asus RT-N16 on my Amazon wish list, and lo and behold, my parents kindly gave it to me for my birthday in July.  I actually left it sitting on the shelf for a few weeks, unsure if I really wanted to use it until a friend at work told me about Ooma.  Ooma is a phone service that works over your internet connection.  It’s not true VOIP, but similar.  Once you buy the device and get it set up, you basically get free phone service (I guess you pay some taxes or something each month, but only like $4 or something).  The Ooma should save me $50 a month.  Nice.  Anyway, if you have an Ooma, you really need a router that supports Quality of Service so that your phone calls don’t get aced out when your 13 year old starts downloading some huge game or something.  So today, I broke out the router, and used these instructions to flash the firmware on the Asus router, and now I’m up and running with TomatoUSB.  Very cool.   My next step is to buy the Ooma box and get that set up.  I’ll keep you all posted, as I know that you are eager to be updated on every single little thing I do.
  • You know, I just love all the stuff that the folks at DevJet are doing.  First, they are the impetus behind the Delphi Spring Framework, which as far as I am concerned you should treat like part of the Delphi RTL, as well as the really cool tool Documentation Insight.  Now they have release a new product that is the mirror to Documentation Insight – Documentation Generator.   You can pre-order it for 30% off, too.  What does it do?  Well, it takes all those great /// comments/documentation you wrote using Documentation Insight (which, by the way, is bundled with Delphi XE2) and turns it into online content.  For instance, here is the documentation for my HTMLWriter project.  And of course, all the documentation for the Spring4D project is online as well.  Nice.
  • There are some interesting Delphi book projects in the works:
  • Nick’s Opinion of the Week:  I think that if someone wants to open source their software, then they should do so.  And if they don’t want to open source their software, then they shouldn’t. And if you have a different opinion than the author of the software, then you should express it respectfully.  If your “advice” isn’t taken, then you should leave it be.  Just sayin’. 

My Book

A Pithy Quote for You

"Science is the belief in the ignorance of experts."    –  Richard P. Feynman

Amazon Gift Cards

General Disclaimer

The views I express here are entirely my own and not necessarily those of any other rational person or organization.  However, I strongly recommend that you agree with pretty much everything I say because, well, I'm right.  Most of the time. Except when I'm not, in which case, you shouldn't agree with me.