This one was a hard one to guess. But it's something like:

  1. DbConnection conn = Entities.Connection;
  2. DbCommand cmd = conn.CreateCommand();
  4. string spname= "DoSomething";
  5. string entities = "Entities";
  7. cmd.CommandType = CommandType.StoredProcedure;
  8. cmd.CommandText = string.Format("{0}.{1}", entities, spname);

You need to go to the edmx file, right click, add -> function. The tricky part on this was guessing the Entities.DoSomething name for the stored procedure. Nuno did the guessing part.

This works on MS SQL Server 2008, don't know if it's available on other version. If you want a full raw SQL export with data, go to the database options, Tasks -> Generate Scripts and on the Script Orions select Script Data.

World of Goo Birthday Results

October 20th, 2009

The guys at World of Goo have just released the results of their pay what you want for World of Goo campaign. I don't know if they are just developers or have a background in marketing. But one thing's for sure: they made a hell of a job promoting the game. And it's amazing how one year later they manage to sell so much of the game... again!

The method is very simple: allow anyone to buy the game for any amount. And it worked. And now, they released preliminary results and and charts about the sales. I guess this article will be mentioned on a lot of places, and that the sales for this promotion are far from over...

Google has no face

October 16th, 2009

I use a lot of Google products: the search engine, docs, gmail, picasa, analytics, chrome, etc, etc. And I'm satisfied. But a problem in picasa web albums that I'm having brought to my attention something interesting: google has no face. We can't contact google, we don't get feedback from google, nothing. I registered a bug, and I got no follow up from the google staff. Note that google doesn't even allow comments on their blogs. There's a completely blackout posture regarding the costumers.

This posture is understandable. I manage a small scale project and I know how much noise we can get. Google has a good approach on this (like so many other companies): it provides a forum for help topics and there are always senior users that answer the basic questions, leaving only the complex ones unhanded.

Although the lack of direct customer support, google products aren't known for their bugs. So I guess they have strict error handling policies and statistics and they focus on that. No one answered me, but I guess all that internal server errors I'm getting, are being monitored by someone and will be fixed in time.

Even so, it's interesting that a company that focus so much on making collaborative and communication tools, doesn't communicate with their user base.  Guess they don't need it. I remember I once switched banking services exactly to have better customer care. I didn't care that the new bank was smaller and weaker, because that meant that the bank would value me much more as a client. And that was what I wanted.

It seams that as companies start to grow, they loose interest on pleasing every customer. Why would they, they have so many of them. While small companies have a strong focus on the customer, because they need all the customers they can get, and can't afford to loose any.

Sins of a Solar Empire

October 12th, 2009

The other day I played with a friend of mine Sins of a Solar Empire. Sins is a great 4X RTS sci-fi game. We like a lot of games like Civilization, but the new Civs are so slow on modern machines. This Sins was a great surprise, nice graphics, great gameplay, lots of fun. Later I searched for the game's site and I found out that the game was elected as the Game of The Year on several important sites such as IGN or GameSpy, winning against games like Fallout 3 on some sites.

This is really interesting. The game is pretty, but not that pretty. Here we have a game that won because of a great game design. This should be a lesson to a lot of game development companies out there.

When the internet codes for you

September 30th, 2009

The other day I went to assist a guy that is making a component to interact with my framework. He was having some connectivity problems and I went for the rescue. We could only tell me that he wasn't being able to process the authorization logic. I asked him to show me the code and I saw a lot of comments in Chinese (or some oriental language). Clearly, someone downloaded the code from he internet and well... it was working on his test cases.

This reminded me how often corporate companies fetch some code from the internet to incorporate on their projects. We're talking about big money companies, that employ software engineers, that instead of developing from scratch software components, just search the web and get some stuff that works. Many times we only need to search open source projects and use them, incorporate them, cut some source lines, and we're ready to go. It seams unfair to have large companies using software that someone made on their spare time, without the proper retribution.

Lets be fair, all developers search code on the internet. Sometimes we just need an example of how to use an API, or how to do some operation. I guess that's fine. The problem is when we incorporate code on the project that we don't understand, or that doesn't follow the project guidelines. On this particular case, the code's original author, used and abused of code like this:

  1. try {
  2.     ...
  3.     return true;
  4. } catch {
  5.     return false;
  6. }

This is bad in so many ways that I can't start to describe them. Someone made this bad quality code ant put it online, and someone else incorporated it on the project, without changing it, learning it, or even knowing how it works.  But why would someone do this? I can think of several reasons: he was on a tight deadline and had to make it work fast (not this case tho); he didn't know how to made the functionality by himself; he just didn't care.

I'm proud of the code I produce. But there are many developers that don't experience particular joy in programming, and that leads to poor code. It seams that we're at a time where many software developers are going to the software developer's school not because they love it, but because it's a career that pays well and doesn't leave anyone unemployed.

Being a programmer is boring…

September 24th, 2009

Don't get me wrong: I love software engineering. I love developing applications and the challenges that we face when we have a complex problem and we have to model it and make it work. I really like the creative and technological aspects of programming. But talking as someone that has been for three years on some corporate companies, several projects and a few teams, that isn't really what we do, is it?

From my point of view, here's the cycle of generic corporate work:

  1. We enter a project, that may be starting or not and we meet the team
  2. We start by analyzing the project's structure, learning how it works and what it does, during this time we may get some documents to read
  3. Then we get small tasks, like some bug fixes, minor development details and such
  4. Soon we start getting bigger tasks, and in time we'll feel more confident on the project, we'll know it well and start making ourselves profitable
  5. After the learning stage we become very valuable for the team, we'll fix bugs faster, we'll deploy faster, we'll implement faster, and we'll help the junior members of the team
  6. At some point we leave the project... maybe the project is finished, maybe we're needed elsewhere, and we go back to step number one

Looking at these steps, I'd say that the best ones are 1,2,3 and 4. Learning is very important to keep me motivated. When I'm on a new project, I have to learn new technologies, new concepts, and the structure of the project. I'll also get to know my team and I'll learn a lot from them.

Step number 5 is the boring one. When we already know everything related to the project is when we're most profitable for the company. At that time we mainly get to fix bugs, support the production environment, write documentation and maybe handle customers. We'll also get new developments and changes, but often these new developments will collide with something already done that wasn't expecting the new features. This may mean architectural changes that may prove quite annoying to accomplish.

When I'm at step 5, I feel my motivation getting lower every day. And the problem is, I spend the majority of my time at step 5. It comes a time when I get tired and start talking to management to get back to step 1, but management can't allow that. Now that we're important on the project, it isn't easy to take us away, so we need to hang on, for the company's sake.

Not all programmers dislike step 5. At step 5 developers have won a place on the team and are an important asset for the company: they reached the comfort zone. They may like it there, and sometimes step 5 provides some interesting challenges. Different people get motivated by different things. I'm not a step 5 type of people, but I know a lot that are, that really like what they do and they're good a it.

This is, of course, my own point of view, and does not reflect the truth for other developers. For me, change is important, and the degree of different things I get to do everyday contributes to my motivation as a developer.

Chrome moves to take down IE

September 23rd, 2009

This is very interesting: the guys at google created a plugin for IE that upon detection of a special code on the HTML, auto switches the renderer engine from IE to chrome. I've already read before that Google was thinking on how to steal browser quota from IE, and one of the ways was bundling it with their new operating system.

But this is a very interesting move because with this option they are allowing webmasters to choose the user's browser. Imagine that this plugin starts to become mainstream, and that is not very hard to accomplish if they start to include it on Google Earth, Google Desktop, etc. A lot of new computers already come with Google products installed by default. They are already making it happen on Google Wave!

Now imagine that webmasters start putting this HTML code on their websites:

<meta http-equiv="X-UA-Compatible" content="chrome=1" />

Given how much the web community hates IE, this could happen. How much browser share could Chrome steal from IE with this? Lets wait and see. :)

I couldn't find anything about this on the web that worked. I needed to create a new database and a user for it with proper access using C#/T-SQL. So here is the solution that I've found:

  4. IF NOT EXISTS(SELECT name FROM sys.syslogins WHERE name = 'USER' )
  5. CREATE login USER WITH password = 'waza', DEFAULT_DATABASE=DBNAME
  9. sp_grantdbaccess @loginame='USER'
  10. sp_addrolemember @rolename='db_owner', @membername='USER'
  11. sp_addrolemember @rolename='db_datareader', @membername='USER'
  12. sp_addrolemember @rolename='db_datawriter', @membername='USER'

You may need to add some GO's if you plan to run this on the query analyzer.

Where am I?

August 3rd, 2009

Sometimes someone comes to gtalk and rants about me not making any posts. In fact, this blog is being updated from time to time. I don't know why, but after a hard day of work doing computer stuff, I can't really find the proper motivation to blog about it. However, according to my friendfeed page, I do about 1 post per day. But not on this blog. :)

I write on a lot of blogs, mainly about my browser game. If you're interested, you can subscribe to my friendfeed page. If you already did that, you'd know some interesting things:

I'll be on vacations shortly... can't wait for some time off.