Sunday, October 26, 2008

Don't forget you past

A country that forget it's past is doomed to repeat it. These last days Spain is committed to break apart one of the most remarkable prisons of the dark time, and by dark time I mean Franco's rule: the Carabanchel Prison. Hundreds, if not thousands of innocents where kept inside those walls, just for the crime of thinking of a better society.

No doubt we all evolve, but I can't help looking at how Americans have San Quintin and other famous prison as reminders of past mistakes. Spain is tearing apart a symbol of disrespect, of past repression, of denying the right to be an independent thinker. May be this is a sign of what is yet to come........

Enjoy life, if you can............

Labels: ,

Saturday, October 25, 2008

From today on, I'm officially in Panic Mode

Friday, October 24, 2008

No Microsoft, It wasn't you!!!

It wasn't you who discovered the benefits of multi-tire applications, no, it wasn't you who discovered the wonders of using namespaces to logically organize what you call types, and the rest of the world call classes, interfaces, and so on.

These days of financial crisis I'm reading a book about ASP.NET. The book isn't bad at all, but is somehow Microsoft biased. Written by a bunch of MS MVPs (Most Valuable Professional) is not difficult to understand that the authors must keep the big brother happy. But sometimes is so much, that it feels like a comedy book. I'll give you some examples:

1.- Microsoft forget easily: This book criticize merciless the classic ASP model. Well, I still remember how they sold us this cutting edge, flawless technology. Not only classic ASP was a total crap, but now M$ have found the way to make our life easier: fully object oriented server side code, and compiled, Ohhhhhh thanks M$, Thanks for delivering what Java gave us almost 8 years ago, thanks anyway for the laugh.

2.- Microsoft have discovered that mixing presentation and logic isn't good: This is absolutely hilarious. Microsoft have discovered 2 years ago, a principle of Software Engineering that has been with us, software engineers, for almost 10 years now, if not more. It was about time lads!!!.

3.- The most amazing, namespaces: .Net organizes classes into logical units called namespaces!!!!!!!!!!!! WTF at this point I though maybe I was drinking poisoned water. How is this possible, even the most M$ biased programmers now that namespaces have been around for about 20 years now. Of course the horrible Win32 API don't now much about this, but this is no reason to say that one of the wonders of the .NET framework (which I think is a good thing) are namespaces. I will put this in another way, .NET without namespaces would be absolutely pointless.

Well, I could continue for hours, but I think it's enough for today. I hope you have laughed reading this as much as I'm reading that ASP.NET book.

Maybe I'll give the book's title in a future post.

Enjoy life lads!!!!

Labels: ,

Monday, October 20, 2008

Alone in the crap, sorry, in the dark. The .. movie?

I've just watched Alone in the dark, movie based on the homonym video game. The game was a classic in the era of ancient computers (spectrum and Friends), but the movie has nothing to make it worth the time, thus another 93 minutes of my precious life wasted.

The story is totally meaningless, well, this is shared with the video game. The acting is horrendous, totally dull characters. Christian Slater was good in The name of the rose, but is still using that lost puppy look, for every kind of feeling, which doesn´t work with terror o puzzlement, I´m sure you know what I mean. The music, ohhh the music. Music is meant to emphasize parts of a movie, making it more intense. Well in this movie music comes and goes, distracting and interrupting action, which may not be that bad. It´s used in the wrong place, and the selection doesn´t match the situations at all. Last, but not least, the special effects, well, umm, they really seem to have been created using the same kind of computers that made the videogame famous. If the designer of Alien is making money with the rights, this movie has given him enough for next Christmas presents. I presume they bought ONE kind of Alien monster, and used it once, and again, and again, .......

I like videogames and I like movies, but the combinations isn´t really working out. Games can be simple, because you are the main character, and that felling compensate the lack of depth or excessive simplicity, but in a movie you are only an spectator, and more have to be given to take you into the movie.

Bye.

Labels: ,

Saturday, October 18, 2008

No words, BRILLIANT

Thursday, October 16, 2008

Multithread programming

Multi-threaded programs are a must in a world dominated by servers, GUI applications, multiprocessor computers and so on. The standard way of managing threads is by using POSIX threads. I've found and amazingly easy to follow article about POSIX threads. It's only recommendable for those of you who already have knowledge of the basic thread mechanisms and OS design:

Multi-Threaded Programming With POSIX Threads

Examples are written in plain old marvelous C, so it might be hard to understand for the Java, and C# crowd, but lads, this is real software!!! :)

Here you have a little example using threads, it's not rocket science, but makes the job:


#include
#include
#define LIMIT 100

/* prototype of the function that will be executed by a
thread. It's compulsory to return a void * and to receive
a void * as the only parameter */
void * do_loop(void * arg);


int main()
{
/* The thread to be created */
pthread_t MiThread;
/* We will use these two as parameters to do_loop */
int th1 = 1;
int th2 = 2;
/* Will get the return value of pthread_create(...) */
int rc;
printf("Starting application\n");
/* Actual thread creation. Parameters:
1st .- The thread to be initialized
2nd .- Configuration parameters, NULL to use default
3rd .- The function to be executed by the thread
4th .- The parameter to be passed to do_loop
*/
rc = pthread_create(&MiThread,NULL,do_loop,(void *)&th1);
/* The main thread also executes the loop, to show us the intermixed
execution of both threads */
do_loop((void*)&th2);
/* Just in case, the main thread waits for the auxiliary thread to
finish */
pthread_join(MiThread,NULL);
system("PAUSE");
}

void * do_loop(void * arg)
{
int i = 0;
for (i = 0 ; i < LIMIT ; i++)
printf("Hello Thread %d\n",*(int *)arg);
return NULL;
}



By the way, there is a companion article that gives an introduction to parallel programming. Interesting for the newbie.

Parallel Programming - Basic Theory For The Unwary

Enjoy!

Labels: , ,

Tuesday, October 14, 2008

ASP.Net Datagrid control

Hi lads,

Slowly but steadily I'm discovering the goods and bads of ASP.NET programming. On the one hand it's pretty simple to make a simple but rather functional web application, on the other hand the programming model, if any, it's really simplistic, and this is good, but also bad. On top of that there aren't billions of frameworks to use, in contrast to the Java world, that makes things easier, but also gives you less power. Other factors are the insane dependency on Microsoft, slave forever of IIS, that is definitely not good. Ahh, and don't forget you can program almost everything using very simple HTML and C#, this last one is becoming my favourite language, after god C++, of course.

Well, one very powerful web control provided by ASP.NET is the Datagrid control. It basically allows to show information in a table. This information must come to any source that implements the IEnumerable interface. All the dirty HTML code is automatically generated by ASP.NET, and this, for those of you who fought with the old classic ASP, is a blessing.

I have found a couple of good articles and web sites about the use of this Datagrid web control, I hope they are useful for you.


Enjoy!!!!!!!

Labels: , ,

Saturday, October 11, 2008

Mono 2.0 Use .NET out of Windows

Since .NET assemblies compile down to CIL bytecode that's executed in a virtual machine under Windows, there's no reason, in principle, that they shouldn't be able to run under any platform. After all, Java's "write once, run anywhere" mantra has the same fundamental architecture: a VM running bytecode that taps into a series of standard APIs and classes.

Labels: , ,

U.S. takes North Korea off terror list

Sounds like a joke. What a wonderful year! First the Olympic games in China, well known for it's respect for human rights, and now North Korea, one of the most open countries in Asia is taken off the terror list.

But these guys actually believe that we are stupid??? I hope Obama has a little more common sense.

Labels: , ,

Joerg Haider has been killed in a road accident

I don't consider myself a "conspiranoic" but it's rather suspicious that Haider has died just a couple of weeks after getting excellent results in Austria's presidential elections.

Probably we wouldn't have known the results of the far-right parties if Haider hadn't been it's leader. This fact gives him an important and dangerous role, "head" of Austria's most hated out of Austria political movement. Bad for Austria's name, bad for businesses, bad for him.


Rest in peace.

Labels: , ,