Mostrando postagens com marcador tools. Mostrar todas as postagens
Mostrando postagens com marcador tools. Mostrar todas as postagens

09 setembro 2009

Scott Hanselman's 2009 Ultimate Developer and Power Users Tool List for Windows

As I said in my first post, this blog will also serve as a kind of delicious for me, so you will see me posting many references to other blogs' posts. One reference I couldn't let pass is this post of Scott Hanselman's blog: An amazing list of tools for Windows developers and power users. For sure they worth a try.

28 agosto 2009

My Own Code Snippet Formatter

Some weeks ago when I needed to publish code snippets here for the first time, I looked for plug-ins for Windows Live Writer and found two good alternatives, from which I decided to use the simpler one.

After that, I started to build my own code snippet formatter. Only for C# snippets, and using JavaScript, that is far from what I'm used to write.

After some weeks working on it in my spare time, it's finally usable.

It is available here.

But, if you want a true syntax highlight tool, try this one.

Enjoy!

15 agosto 2009

Parsing a Delphi DFM File

Some time ago a friend asked me to help him to parse a DFM file into .NET objects. We tried to find something in the web that does the job but no success, so I accepted the challenge and wrote the parser he needed.

If for some reason you need a DFM parser, or just for curiosity, you can download it from here.

Here is an example of how to use it:

class Program { 
    static void Main(string[] args) { 
        var fileName = @"c:\Unit1.dfm"; 
        var dfmParser = new DfmParser(fileName); 
        dfmParser.ReadFile(); 
        foreach (var node in dfmParser.Nodes) { 
            if (node.PropertyType == "string") { 
                node.PropertyValue = "'Hello World!';"; 
            } 
        } 
        dfmParser.SaveFile(); 
    } 
}

The example above loads this file:

object Form1: TForm1
  Left = 0
  Top = 0
  object Label1: TLabel
    Left = 8
    Top = 40
    Caption = 'Label1';
  end
  object Label2: TLabel
    Left = 48
    Top = 40
    Caption = 'Label1';
  end
end

And rewrites like this:

object Form1: TForm1
  Left = 0
  Top = 0
  object Label1: TLabel
    Left = 8
    Top = 40
    Caption = 'Hello World!';
  end
  object Label2: TLabel
    Left = 48
    Top = 40
    Caption = 'Hello World!';
  end
end

If you find some use for this, enjoy :)

08 julho 2009

Replacer

One of the reasons I create this blog is to publish some smart small tools I built to make my fellows lives, and mine of course, easier.

The most useful of such tools is Replacer.

Replacer is a search and replace tool I built back in 2006 when I couldn’t find any such tool in the Internet that could make the job the way we needed.

It is pretty simple to use and its main purpose is to search or replace, at the same time, several one line text blocks in all files that match the given filter criteria.

The main features of Replacer are:

  • Filter criteria to include and exclude files;
  • Classic search options like case sensitive and whole word only;
  • Search or replace several one line text blocks at the same time;
  • Possibility to ignore comment blocks;
  • Find only the first occurrency of the search text on each file;
  • Create backups before to replace;
  • Prompt a confirmation before each replacement;
  • In the result screen, highlight the word that contains the search text;
  • In the result screen, show the number of the row where the text was found.

The main limitations are:

  • Only one line text blocks can be used *;
  • One line comment blocks cannot be ignored, only blocks with a start and an end mark;
  • Not fully tested, maybe it doen’t work with some kind of files;

As said before, it was not tested to become a sellable product, so if you want to use it, you must consider that statement that says it is distributed ‘as is’, offers no warranty and must be used by your own risk.

Replacer.zip

Hope you enjoy!

* I’ve started to work in a version that supports multiple line blocks, but it has introduced some bugs, so I’ll not publish it yet.