Geek Stuff
Subscribe

Pie chart is now available at the Highcharts.Mvc package

Quite a basic feature, but I did forget about it :)

If you update to version 0.0.4 of Highcharts.Mvc, you will be able to plot charts like this.

Like all other Highchart’s charts, the Pie is also interactive, so you can click on it and show additional information based on the clicked area.

For others running example and the code needed to do it, please check the playgroud.

The next step is check what are the other basic features missing in the package before releasing the first stable version.

See ya!

bd44ee379d1d1050cbafc8cc6dd41624

Back to the University

UDESC

In mid-2011 I have graduated with a Technologist degree in Systems Analysis and Development at UDESC (Universidade do Estado de Santa Catarina). After a short break I’m back to the University, but now I’m on my way to a master’s degree in Applied Computing.

I’m currently a “Special Student”, which means that It’ll take more time to finish the course, but at least I don’t need to quit my current job. Aside from that, I’m still not approved for the master’s degree. If everything goes according to plan, I’ll subscribe to it in mid-2013 and hope to be approved.

I still don’t know what will be the subject of my research, but I expect to do something related to automated testing, Test-Driven Design, continuous integration and such. This is something I’ve been playing around and I’m really enjoying it.

One of the requirements to this course is that I need a certificate in english, still have to be defined, but it’s probably TOEFL. I hope this blog will help me to improve my english skills. If you find any grammar mistakes (even the minor ones), please drop me a comment, I will be very thankful for your help.

So that’s it, now let’s go back to studies :)

07a78301d0d6ce2cec9a1822c15e04d9

After almost 3 years of blogging…

It has been almost 3 years since I started to blog about software development in general. The first post was in mid August of 2009, on my brazilian blog (inactive). In the end of 2011 I decided to start a brand new blog, and this time it would have to be written entirely in english. That’s how I started the GeekStuff.

The first reason for it to be in english was that I could reach more people. The second one is that I need to practive it more since it’s not my primary language and it’s extremely necessary in the IT industry.

As of today, I decided to blog about more than just software development. Sometimes you get tired of speaking about a single subject. My life is more than my job and I found many other things that I could write about in here. Aside from that, I found writing about technical stuff easier than personal things like hobbies and your day-to-day routine becuase almost all english books I read are technical books.

I’ll try to use the category and tags as much as possible to make easier to visitors filter out unwanted content.

So, that’s it, see you in the next post :)

23ab95b117d340db1ba18f4a94c8a7eb

Uniqueness validation with Fluent Validation, NHibernate and ASP.NET MVC

Some days ago I tweeted about the current stack of .Net libraries and frameworks I’m using in my projects. While working on this projects I created some useful custom validators for Fluent Validation and also some NHibernate extensions. One of them that I use a lot is the Uniqueness Validator using NHibernate.

First of all, for those who doesn’t know what Fluent Validation is, here is a quick example of how to configure validation for an entity:

public class ProductValidator : AbstractValidator<product>
{
    private readonly ISession session;
    public ProductValidator(ISession session)
    {
        this.session = session;
        RuleFor(x => x.Name).NotEmpty().Length(0, 50);
        RuleFor(x => x.Price).NotEmpty().InclusiveBetween(1.00m, 999.99m);
        RuleFor(x => x.Code).NotEmpty().Length(0, 10);
    }
}
</product>

Continue reading

901c1b3cadf3796030642f4aa6232c87
Tagged , , ,

Highcharts MVC is now on NuGet

I was taking a take a look at NuGet and decided to publish my Highcharts MVC project as a package to see how it works. I found it very (very) easy, the documentation is amazing and contains some useful tips.

I released the package as a pre-release (0.0.2-alpha) because it’s still unstable and it does not cover the whole API (yet). I will keep working on it to release the first version as soon as possible. I also made some changes to the GitHub readme file, it now contains a guide on how to install, configure and use it.

Continue reading

b2fb618748d0daa1b5efb210d9041351
Tagged , , ,

Named string formatting in C#

While working in a project, I found myself in trouble when I had to use string.format with this “small” format:

string.format("{0,5}{1,6}{2,10}{3,8:C2}{4,20}{5,10}{6,40}{7,2}{8,2}{9,2} ... until {40,4}", ticket.Number, ticket.Owner, ticket.Whatever...)

So yeah, what information is stored in thirdy second parameter?
Well, I don’t know, let’s count the parameters: 1, 2, 3 … 32. Yes, that’s it, 32th parameter is the name of customer.

Continue reading

3720185d032fe2a6b9536e5e6c80b55a
Tagged

Nice update on Highcharts MVC

In the first commit of this project I did a very poor implementation of json outputting to build the chart. It was basically a lots of strings concatenation with conditions to see if the properties were set or not. It was ugly and a pain to develop new features.

In this update I’ve created a class called JsonObject (I’ll rename it as soon as I find a better name :) ) that handles the json ouput format. This greatly increased my development speed and I managed to deliver some nice Highchart features within a few hours. Aside from that, I’ve also started to use Lambda Expressions on the chart configuration to increase readability. Instead of this:

Continue reading

91885002270ce5c5d7031440a5c22913
Tagged , , ,

Client-side routing with ASP.NET MVC

While working with ASP.NET MVC on the last two years I’ve found lots of people on StackOverflow asking how to build urls on a javascript file. In most cases, this is needed when fetching data from the server using AJAX.

The top answers to this questions were:

  1. Store the url in a javascript variable in the header and use it in your javascript file.
  2. Store the url in a hidden input and use jQuery to get it.
  3. Hardcode the url. Eg.: $.getJSON(‘/Users/List’, …)

All of them works, but I tried to do something different and have come to a very clean way to build the urls.

Continue reading

4231042accf857d06dea56861f698a27
Tagged , ,

Client-side globalization with ASP.NET MVC

While working on a project with globalization and .NET Resources I had to use the translations on my javascript files and did not have time to stop and think on a cool way to do it. In the end I was doing something like this:

<script type="text/javascript">
var message = '@(MyStrings.WelcomeMessage)';
</script>
<script type="text/javascript" src="util.js"></script>
 
Then, in your util.js you do:
alert(message);

Yeah, that sucks. It’s a pain to use and hard to maintain.

Continue reading

1081c180b01b89dcd8912b56b0417042
Tagged , , ,

The beginning of Highcharts MVC

Some days ago I started working on a new OSS project that I hope to see it grow and be useful. The project is named Highcharts MVC and I supose the name is self explanatory if you already knows what Highcharts is.

For those who don’t, please take a look at this website: http://www.highcharts.com/

Now take a look at the demos page. Isn’t it awesome? It’s Fast, beautiful and very flexible, you can do lots of others things on top of it. Oh, and it’s pure javascript, no need for flash or silverlight plugins, it’s plain old javascript.

Know that everyone knows what Highcharts is, I can now explain what Highcharts MVC is.

Continue reading

23c764578369c00159093c3b00ccfd23
Tagged , , ,