RegEx Pre-Compiler

I have silently added a Software tab in this site, which will contain all the applications that I want to release for free to the public. I am still deciding if I'm going to include the source code. I'll probably will, but for now only binaries will be there.

The first application is the RegexCompiler. This is a powerful tool that makes it easy to build common regular expression into .Net assemblies. Such assemblies can be used to organize and distribute commonly used regular expressions; in some cases, it even improves performance of execution of regular expressions.

This application was built for a very regex intensive application, and I wanted to have such expressions interchangeable using DLLs for my application. In some cases, if the expression is to big, it improves the performance of the regular expression, but this is not always the case.

This is an example of the final usage of the Compiled Expressions:

C#:

SelectPattern pattern = new SelectPattern();
bool isMatch = pattern.IsMatch("\"select * from table1\"");

Patterns are stored in an xml file with extension *.recproj. The application provides an example which is:

XML:

<?xml version="1.0" encoding="utf-8"?>
<recproject name="Structum.Patterns.Data">
  <assemblyfilename>Structum.Patterns.Data</assemblyfilename>
  <namespace>Structum.Patterns.Data</namespace>
  <regex name="SelectPattern">(?ism)\"[ \t]?.*select\b(?-ism)</regex>
  <regex name="InsertPattern">(?ism)\"[ \t]?.*insert\b(?-ism)</regex>
  <regex name="DeletePattern">(?ism)\"[ \t]?.*delete\b(?-ism)</regex>
  <regex name="UpdatePattern">(?ism)\"[ \t]?.*update\b(?-ism)</regex>
</recproject>

The whole file represents an assembly and it is identified by the 'assemblyfilename'.
Each 'regex' tag contains the name of the Class and the actual Regular Expression. In the case of the Select Pattern:

XML:

<regex name="SelectPattern">(?ism)\"[ \t]?.*select\b(?-ism)</regex>

Which is looking for expressions of the form: "select * from table". It was used to identify select statements in code.

Also, this is my first application with C++/CLI. I'm a hardcore C++ fan, and I wanted to try the CLI version. While building the application, I was trying to have a more .Net mindset than C++, so that I could really learn the language. I have to say it was a really cool experience. It has been extremely useful for me, I hope it is also helpful for everybody else.

You can download RegEx Compiler in here.

A sample project can be found here.

30th Birthday to meeee!!!

Yep, today I'm 30 years old. And after the day is almost finished, I can say that it was one of my happiest birthdays. It all began at 12:00 at night, when my wife baked me a delicious cake with 30 candles. I was pretty excited about it. You can see the picture below.


In the morning, I began working my way through my current tasks for this sprint (very early in the morning). I have been working with scrum lately, and this is how my personal scrum dashboard looks like:

I know it looks a bit crowded, I know, but it works for me. I am trying to implement Scrum fully, but it has been difficult since my teams are mostly off site. I have been trying to use applications like Mingle or ScrumWorks, but they don't seem to fit my needs. I might build a simple solution for the time being or maybe expand an existing one. For now, my monitors will do.

Anyways, after work, my beautiful wife Sophie (pictured above), took me to an amazing trip for my birthday. We went to eat to the Blue Bayou restaurant in Disneyland. It is very dark in the picture, but the expression on our faces describes our excitement. By the way the food was great, small menu, but great flavor.

After dinner we went to the Disneyland rides like Buzz Light Year, Pirates of the Caribbean and we also went around Toon Town. It was very exciting, I love Disneyland.


Buzz Light Year !!!!


I obviously lost, but I look so cool :D


Toon Town, trying to show my wife my super strength. Obviously, I was not able to do it, but there is always a next time.


Toon Town again, I couldn't resist, I saw a lonely bone, and I had to take a bit at it.

I think a picture talks more than a thousand words. It was a really fun birthday :D. Want to see more? Check out my Photo Album

Stay-at-Home Server..

I just stumbled upon this beauty:

Mommy, why is there a server in the house?

It is a children's book which is focused on explaining the kids the Windows Home Server. I think it is a Marketing beauty. Check it out.

Microsoft, not Innovative enough? Says Who ?

I have been reading in several blogs (i.e. here and here) that Microsoft is not innovative enough. Some even argue that Microsoft is just a follower.

I really don't think so. I know by now, that you can attribute prior art to almost anything if you find a different angle, but that doesn't really take it away. I think Microsoft is pretty innovative, and will continue to do so.

The actual article that got me to write a post about this is here. In this article, IEEE performed a survey about the number and quality (regarding scientific value) of the patents generated, and Microsoft was ranked No. 1. Being followed closely by IBM.

These are some examples of what I believe is pretty innovative work done by Microsoft:

Visual Studio 2008 + .Net 3.5 Released today!

Somasegar Announced today that Visual Studio 2008 and the .Net Framework 3.5 was released today.

So today is a great day. :D

The details can be found on Somasegar's blog.

Anneke parts ways from The Gathering… :(

I have just learned that Anneke left The Gathering. This is a shock because, just like the Beatles, the Gathering is a great band as a whole, and not separate. I mean John Lennon was great, but never as great as the Beatles.

This is an interview that talks about Anneke's departure: Video

BTW, Anneke already got her solo project on the way: http://www.aguadeannique.com/

This is the first single: Video

This is an interview from MetalHead.ro: Interview.

Update: I removed the embedded video to avoid making the page loading slow, you can still see the video in the above links.

Sanitize Your Data Inputs

I was just browsing and I got across this beauty:

Sanitize your Data comic

Microsoft puts .NET Framework’s source code on a glass box.

Open Source has been gaining momentum for several years now. The movement has even been called the largest disrupter that the software industry has ever had. And now the movement has taken Microsoft to a place nobody ever thought it would get. Microsoft is releasing the .Net Framework's source code using a Reference License.

What this license means is that you can read the code, but not modify it. A lot of people have written about Microsoft's license not being open source, and it is not. This is like having the code in a clear glass box, as opposed to being a completely black box.

A lot of Open Sourcers might feel offended by this, since they want everything to be open for modification and extension. Then, Why would Microsoft cleared the .Net Framework's source code to be available publicly? I have a few hypothesis of my own:

1) Viral Effect: Now with this license, you are able to look at the .Net Code without even working on it. This means that you have been infected. And even if you try to avoid it, you will be pushed to see the code when the debugger in Visual Studio 2008 takes you. Yes, with the new version of Visual Studio, you will be taken to the source code if some problem occurs. This of course is good for people that don't plan to contribute to Mono; but if you do plan to contribute to Mono, you have a problem.

You can see in the Mono Contributing page the following note:
"If you have looked at Microsoft's implementation of .NET or their shared source code, you will not be able to contribute to Mono."

This note is only intended to protect the Mono project from possible code violations. The problem now is that the number of people that will be excluded by that note is going to be up after Visual Studio 2008 is released.

This doesn't mean that Microsoft is after Mono, for all I know they might be protected from this kind of situation; but still, I haven't seen that note disappear since the Novell/Microsoft deal.

So in other words, Microsoft is using Open Source's own weapon to at least make it harder for Open Source to succeed, and that is through Licenses.

2) Copyright Protection: I know it sounds weird but having the code publicly available makes it easier to protect it, because since everybody can see it, it can be easily compared.

3) Debugger Integration: This is the objective that the initial announcement provided when explaining why they released the code. And it is a real good one, I might add. Development is simplified when people understand what is happening. And knowing how things work helps in avoiding stupid problems.

I think that after all Microsoft is trying to fulfill developers needs. The ability to see the source code has been a request of windows developers for quite some time. Now it is a reality, but at what cost?

UPDATE:

Wicked Code

I was just reading Abhi's latest post about C# Compiler Mysteries . He talks about a piece of code that seems to emit an compiler error:

C#:

public static void Main()
{
    if(true)
        int i;
}

The main reason why this code emits an error, is that without the braces there is no use for that variable since it will go out of scope right away after creation. This is also true to the following code:

C#:

public static void Main()
{
    if(true) {
        int i;
    }
}

There is one difference though: Intention. With the first code, there is no intention, since without the braces there is nothing more to come, that variable will be out of scope the moment it is created; but in the second snippet of code, there is intention to use that variable later on.

I did the test on snippet compiler, and I was able to reproduce it:

This is the failed case:
Intention Mystery Failed Case

This is the success case:
Intention Mystery Success Case

I recommend you go and read the post by Abhi, it has links to resources that actually explain the error, and why the .Net Framework team thought about it.

Audrey 2007.08.04

This an screenshot from one of my machines. This is the machine I use the most to work on Structum's projects. It can be seen here a project I am working on a small application that is just being created as an experiment, nothing more. Later on I will post more information on it.

Audrey Screenshot


About

Alex Espinoza is a very passionate software developer who likes to build stuff with his computer.
More.


View Alejandro Espinoza's profile on LinkedIn

Photo Albums