Thursday, May 31, 2007

A piece of UIP

Nowadays, I in fact deal with web applications, i have the opportunity to construct several and i learn some things about how you do things.

First i read about layers, and specially presentation layer, wich is the most expensive layer. Where you have to fight with HTML and if you have good luck with ASP.NET, an event oriented implementation that will be adopted by the other technologies soon or later, so dont worry. There is a special thing wich is called "the state", the only place confortable to store data wich you have to decide to store in a server state, or database or in memory, or wherever... and works ok.

There is a sublayer of the presentation layer, that is not commonly used "User Interface Process" or UIP, in this layer you have process objects for two things: 1) orchestate flow of pages, to avoid burn redirects in web pages and 2) handle state of the process, in order to mantain data about the currently process (supported in session of course). You can think about a process as a set of pages to do a task, and a UIP object to support transition of pages and a temporal data store.

Wednesday, May 30, 2007

Motorcycle Oil

Long time no write... so much work

Three days ago i check my (GS500) motorcicle oil, it is supposed that i has to be check everyday, but who has the time, no one... And when i check it, i found that the level was medium.

Initially i freak out, this is no good, when a engine has no oil is the first step to broke it and if you ride like that is sure a permanent damage. Imediatelly i go to mechanic, and he show the worry face (moments of pain) and begin to ask about everithing. I answer all questions, and there was one that make his face change: "where did you do your last motorcycle service"?

I was ashamed because last service were with another mechanic, but i told him that and in fact i had changed the oil branch, i move from Chevron to Repsol. Yeah sure, thats why...

He finally explains to my what happens when you change your oil branch, the oil start to consume itself, the reason, i really dont know, the fact is that really happens, thats why people advise you no to change the branch. There are so many miths about care of your motorcycle, and you have to select what you belive, sometimes so many cares carries you to nothing, sometimes is late to listen, its better chose a mechanic you believe and thats all...

Wednesday, May 23, 2007

Dropdown Issue

This issue recently happen... and theres no fancy solution

Working in my developer job, i face a problem that was not difficult but it seems noone in internet have publish a solution, or maybe i dont know how to search. Anyway, there´s some control in ASP.NET named ObjectDataSource wich it´s used in tree layer applications, at the web layer, this control usually used in CRUD situtations making the connection between the web layer and the business layer calling the instances of business objects.

So problem is very specific... when ViewDetail is connected with the ObjectDataSource and there´s one field edited with a DropdownList, the binding event of this DropDown the framework makes two things: 1. Populate the items, 2. Assign the value the record already have (remember is an editing). The framework does it ok, but what if you allow records at database to be null at the same field this DropDown edits? Well it results in a disturbing exception, cause DropDown can not load items with a null value, and therefore its impossible to bind to null.

Tuesday, May 22, 2007

Paintball

Yesterday, beautiful day to ride,

Since last week i was thinking about the idea of going to the paintball tournament, i recently noticed when some sunday, i really dont remember, i went to play paintball with my friend pacho and at the end of the match, i sit with a person who plays good (he belongs to vikingos team) and invited me to go to Llanogrande and see how a bunch of people spend big amounts of money shooting and sweting.

Well it seems like a good plan, and since the day told me.. please go go ride... so i have no choice, i ask my girlfriend, and start our trip to Llanogrande. Its not a big trip, its like an hour, but its so fun cause the road is so good, and its perfect... no long trip and smoth.

Now, i begin to see the flaws of a bike cooled by air, at the begining there was an accident, and that part of the trip is like climbing by a hill, and i have to stop and start several times, thats when my leg begin to feel the heat. Heating is normal in a bike, but sometimes i have to turn off or ride faster what is not always posible. Anyway thats the kind of things dont let you use all the power, but fortunatelly most of the road have a cold climate, so after 30 minutes i finally can go up to 10000 rpm and feel all the 52 hp that i can reach.

At the end, i reach only the final match of that day, but who cares.. for me all the matches are the same. Nevertheless all the trip was really good, i meet people, i saw montains, i feel freezing, i eat, and i laugh. Thats the kind of things i like to do in weekends

Saturday, May 19, 2007

The eye

I Know, its time to accept that i have lived a quarter of century, and years dont came free... Recently i finally accept that i need glasses and i aggree to check my eyes again. And result, im partially blind, and with no excuses i have to use those things that makes you a real nerd.

The funny thing, its the experience, i feel like a child, i forgot that colors are so intense, and things are sooo defined, but i cant get used to, i got so distracted about colors and shapes, and everithings looks so far. People said i got along with them, maybe its true.

Imagine, its so bored to clean them, i think i have a problem with my fingers, i tend to touch everyting that is made ith glass, sometimes people think i have a touch screen, so sometimes everithing looks strange.

The true, is that i can se now the dashboard clearly and i dont have to ask the person next to me "what does it say?", the true is that i can drive my motorcycle seeing all the holes in the road, the true is that my eyes dont get tired when i am working at the computer. So maybe, just maybe its ok...

Friday, May 18, 2007

About Quering

After so many thoughts, about quering, finally i decided to use store procedures, at the end there's no fast stuff, although is an structured way sometimes speed is needed, this doesn't mean that i will code business rules, it just mean that i will query

So, this is about quering, but not an "select * from persons", that is for teaching... Most of the projects i work are implemented in Sql Server 2005, and there's always a requirement... "i need to page results... i need to sort results... i need multiple criteria..." and the worst "i need all of them".

Well there's always a solution, but sincerely, i couldn find a good solution, all of those solutions throw away the advantage of a compiled store procedure cause they use dinamic query construction. And that's no right, it broke principles of authorization and ends with an database with free access to tables.

Well, this is a partial soluiton. The one i solve today is the criteria query, this requirement implies that you have to provide the user with the option to send a parameter with the value if he wants to filter, or he can send null if he doesnt want to filter, and can happen same with several parameters. The solution is a trick:

Sunday, May 13, 2007

Lets start

Ok, like i said, lets start a blog, im twenty five and maybe theres some interesting things in my mind,

So like its monday i just blog the thing i spend a lot of my time, my motorcycle, I have a Suzuki GS500, and i ride it everyday, in fact its a real "everyday", and like its usual every sunday i have two choices, or ride my bike or wash it, today was both.

Early at the morning it hapens, i fall once again, its funny 'cause when i finally got enough experience to feel confident, i fall again, yeah i know... it happens, but the good news is it doesnt have anything broken, at least thats what i think, because you always pay... soon or later, but you pay by your falls, its a fact. I was partially bored all day, and i decide to wash it, so i can face the stripes of my sad event. Anyway to keep this short, i learn two tings that i wanna share...

First, its important to buy knees protection, can you believe, i smash my knee again, and its hurts fall twice in the same leg, in fact use all protection, in fact dont go out... (blah), thats the risk we take
Second, dont use your front brake if you are turning, the motorcycle have a very strange behaivor in that situation, the forces of inertia can trow your bike by the side you turn, thats consecuences of a heavy bike.
Third, well if your transmision doesnt work well, first check the chain, it doesnt matter if your oil its the best, if the chain its not tight, it doesnt worth your worries