Wednesday, June 26, 2013

No ads



Preamble:

We're living our lives in war fields, but still nobody seems to care. Each day, we go by, under the threat of deadly weapons.
They don't look like weapons, but they are, and they're shooting at your most precious thing, your mind.

That's damn right, I'm talking about ads. They're everywhere, shooting at your attention, from the radio, from the TV, from the side of the road while you're driving, from the clothes of those people passing by, from all those posters stuck one upon another on every wall, and of course, how could I forget, from the side, top, bottom, and between the lines of the web page that you're browsing.

From where I stand, there's no difference between a robber pointing a gun at me, and those people pointing ads at me.

Let's face the harsh truth, ads are nothing more but profit making weapons, used by people who don't give a damn about you. All they're interested in is your money. They want you to become a consumer, their consumer. They don't care if what they offer helps you in any way, as long as you buy their shit. Customer care is just a big pile of bullshit. ( RIP George Carlin )

On topic:

There are people advocating that it is not moral to use an ad blocker. Now, I'll just assume that it's an accident that most of them work in the advertising business. All I want to ask these folks is this: What about respect for the human being?

Shouldn't we respect the individual and let him decide when he wants to search for something he NEEDS?
Does it really makes more sense for every company that wants to sell something to blast each and every being with interminable ads?

It makes sense in a world obsessed by profit maximization and "economic growth"( the most deceiving euphemism ever ) . But this is insanely backwards. Trying to increase numbers in a bank account while depleting our natural habitat and making life a perpetual fight for almost every human being in the civilized world it is not a good strategy.

Instead, it would make much more sense to build a society centered on the individual experience, on helping not selling.
We should strive to discover what we like, our qualities, and use them to help each other. Provide value, and that value will find a way to get back to you just when you need it most.

As for all those ad shooters, I just want to tell you this: Fire an ad at me and I'll consider it a war declaration, as such, I feel entitled to employ any means to defend myself.

You have better options: put a price on it, or wait for donations. We should work together towards learning to give back for something we use, not towards extorting our share from every visitor. We need to let the individual exercise his freedom of choice. It's a much better alternative.

That said, work for perpetual war or for perpetual peace. It's your choice!

Tuesday, October 20, 2009

Why a good programmer can also be a good CEO

What? You don't believe me?
Here are some arguments supporting this idea:

So, similarities:

- both work with an abstract model of the system
- both give directives to some executing subroutines
- both ( supposedly ) understand the underlying, complex, intricate implications that a minor change can have in the system
- both have an overall view of their program
- both know that nothing is perfect, so they accept that debugging/optimizing their program is a necessity
- they are both masters of their domains
- their will is always fulfilled, even if is good or bad
- they both have red eyes from too many logs/reports they've read
- in many software start-ups the CEO is also the programmer and all in between..

Differences:

A lot probably, but they are all irrelevant.

So, know tell me that companies didn't screw up badly by not making a career path like this:
junior programmer -> programmer -> CEO.

Sunday, September 13, 2009

What makes an idea important?

If some hundred years ago, one person could cover almost all the information existent in the world during one's lifetime, today this is obviously not the case. The amount of information is expanding at an exponential rate, yet our capacity to process it pretty much stays the same (I'm referring here strictly to our brain capacity). Sure the perspective is that a new breed of computers is about to take charge but we're not there yet, so we still have to manage decision making on our own. So how do we deal with this much information? How can we really grasp the most important ideas that are out there and build the future upon them? My logic tells me that the higher our capacity to really get the most important aspects of our existence, the better the future will look like, and sooner. Now when I'm referring to a better future I envision one for the whole species.(About this, maybe in another article). If my logic is faulty, well I'll go on anyway, just for the sake of it.

So, I believe that it could bring us great benefit if we could learn to spot the most important ideas out there and use them. Therefore the question I'm tinkering with in this article is:
What makes an idea important? (or how TED put it What makes an idea worth spreading?)

To start, let's clarify what an idea is.
Well, for ease of use I'll paste bellow the definition given by the dictionary (which I believe pretty much covers it):

1. any conception existing in the mind as a result of mental understanding, awareness, or activity.
2. a thought, conception, or notion: That is an excellent idea.
3. an impression: He gave me a general idea of how he plans to run the department.
4. an opinion, view, or belief: His ideas on raising children are certainly strange.
5. a plan of action; an intention: the idea of becoming an engineer.
6. a groundless supposition; fantasy.
7. Philosophy.
a. a concept developed by the mind.
b. a conception of what is desirable or ought to be; ideal.
c. (initial capital letter) Platonism. Also called form. an archetype or pattern of which the individual objects in any natural class are imperfect copies and from which they derive their being.

Before moving on, I should also clarify what I understand by an important idea. Well, I think that by important I'm really saying “with a high impact” whether positive or negative. The next question is: Impact on what? I said in the beginning that it might be nice to find a way to understand the most important ideas, in order to take the best decision that influence the future of the humankind. So there you go, searching for ideas with the highest impact on our living. With this out of the way, I'm coming back to the definition of the idea.

While looking at the numbered definitions pasted above, it occurred to me (d'oh) that ideas can be hierarchized. I never thought of this before. The notions (that will be a type 2 idea) were there, I just never made the connections to get to this understanding (type 1 idea).
So a group of more ideas can be connected and generate a new one. I don't think that this new idea is necessarily more complex, on the contrary I believe that the higher we go on the hierarchy, new levels of abstraction are created and that tends to simplify things. Anyway this is probably another subject.

There are some type of ideas, that I find particularly interesting:

While ideas of type 2 are pretty simple, and although they're used as building blocks for other type of ideas, they're not powerful enough to stand on their own. However if they're proven wrong they could become pretty important, since this will bring down all other ideas built on them.

Now there are ideas of type 4. Beliefs, I think, are actually a nucleus of one or more core ideas that act like a force well, adding new layers of weaker, gravitating ideas (views and opinions) and together, in some cases, can create a small dictatorship inside our brain. Beliefs are important because they control our actions, and even more important, sometimes they have the power to prevent new ideas that can threat them in some way from occurring. With the capacity to influence our actions and our perception of new ideas, I'd say beliefs can have some deep impact into each individual life and scaling, on the whole society.
I'm not saying that all beliefs are bad, they can go both ways, but they are powerful and they should be watched.

Now, what are the differences between beliefs, opinions and views? Well, I think they all pretty much fall in the prejudices category, ideas that we have and take for granted without testing them periodically. There may be, although, a difference of nuance, and I'm referring to their level in the hierarchy, that the lower the level they are found at, the bigger their span of action. While beliefs, I think, are at a lower level and so influence a wider area in our thinking, opinions and view being at a higher level may influence a more specific part of our reasoning, but also their number may be greater. Pretty much like a solar system, with the beliefs being the sun and opinions gravitating around them. I'm not sure if there is any difference between views and opinions, right now I tend to say no.
I may be going too deep with this and may be talking about something I don't completely understand, but probably this is what exploring is all about. Anyway for the sake of the current topic I think this will suffice.

Another, also powerful, type of idea is type 1. I'm talking here about understanding ideas, about the change of perception that puts our existing ideas in a new light, or projects them from another angle and new connections emerge, therefore, new ideas. So an understanding is actually the birth of a new idea. An important understanding, I think, is that which tinkers with a group of ideas already in a stable structure, like a belief system. When this happens, a belief system can crumble like a castle made of playing cards, though this rarely occurs. However understandings can also help strengthen beliefs or help create them. (Here we should pay great attention to confirmation bias, since beliefs favor more the ideas that tend to confirm their core idea than the ones that disprove it).
When connected ideas are more loose, or maybe more outwardly oriented, innovation occurs, in the form of new ways to do things or, maybe more important, new things that can be done. However, innovation can be achieved also in thinking, that is coming up with new ways to think at things. The latter, I believe, is a particularly important type of innovation.

Up to this point, everything pretty much happens by chance, there's no general pattern, no guiding force to make us search for understandings, which are desirable, being the only ones that bring fresh new ideas to life, since we've seen that beliefs isolate ideas and hardly accept new ones. Idea type 7b, the vision or goal is of great help. I think we need to have a goal, an ideal towards which we should move, to polarize us and dictate the general direction. Now, I'm not talking here about a fixed, absolute ideal in the communist stile, but about an open one, actualized according to the current environment and facts. Probably these kind of ideas come also in hierarchies, from more specific ones to the more general, but anyway, I think that our ultimate goal should be to constantly optimize our way of life (no wars, no unnecessary complications like money and other control tools) and to try to understand what this Universe has to offer. I mean, what possible other goal could we have?

So, where did I start and where have I arrived? Yes, I was talking about what makes an idea important or what type of ideas are important. Well, after wondering in the Land of Ideas, seen some interesting species, I think it's time for a classification. Stand back, here it goes:

In the inverse order of their significance:

-Notions – simple, building blocks for other ideas, not much of an impact at a global scale

-Views, Opinions – they pretty much represent a fixed point of view regarding a certain aspect, but the really important question is, are they open to new ideas or do they tend to block them? If they do block, watch out, cause there may be some bigger monster that lurks behind

-Beliefs – some hardcore or even hard coded ideas, pretty hard to debug / debunk, they can influence our behavior and the way we receive new ideas, tend to accept only ideas that confirm their view. Beliefs are not always bad, only if they prevent other ideas from forming. If they enforce an open-mind kind of thinking and actually make sure that some ideas do not try to take over the control, and offer the chance to every idea to make itself heard, and democratically be validated by reason and logic, those are good beliefs

-Understandings – actually new ideas forming, there should always be a flux of new ideas coming in while other outdated ones are ruled out; they can bring innovations and revelations; we should always look for them, to actualize our mental model of the world

-Goals, Ideals,Visions – very important, because they give us meaning, and direction, and keep us in constant motion, also come in two flavors: closed selfish ones, and open cooperation based ones

I think that open is always better then closed, global always better then local (when it comes to ideas). So highest impact ideas? I'd say those that influence our behavior, our capacity to accept, and search for new ideas, also those that can impact our way of living. All ideas that influence these in a positive or a negative manner have the same importance, the only difference is that we should always go through a process of self actualization and try to get more good ideas in and the bad ones out. So, as a general pattern, I think, that ideas that influence our way of thinking are the most important ones, because through our actions they can influence the behavior of the whole system we call human society. Once an idea finds its way in a large number of skulls, and remember, we are billions, its impact can be very powerful, especially if it enforces/is/weakens a belief. I'd say it's actually a battle between ideas that form closed belief systems and those that form open ones (those that favor constant optimization of the way we live and think, through new understandings and innovations).
I must confess that I strongly believe our only way to live happy, free, joyful lives, is for all of us to adopt an open belief system.

As final word, I would like to express my belief that if every human on this planet would understand and act according to the principle that our individual actions can influence the life of all others because we all are parts of a bigger complex system, everything will be better.

Sunday, March 29, 2009

No purpose means any purpose

I don't believe that life has a purpose. I'm talking here about humans and all the living creatures that exist on this planet. You cannot assign a purpose to something that occurred from arbitrary events happening billions of years ago. I'm not going to ask myself if the Universe has a purpose, because it's beyond our ability to understand/determine that, but since we are contained in it, we can say that if it does have a purpose, maybe we share a small fraction of it.
In order to define a purpose for something, you actually need to answer the questions, Why it exists?, What function does it do?, What problem does it help solving and who benefits from it? In this case we can say that we are pure reproductive instruments in the game of evolution, our gene's way to measure their performance and determining the winners, which will be rewarded by passing into the next round (generation).
The collateral effect of this game is our life! The time spent between our birth and our death is called life, and what we do during this period of time, is something we can control to some degree. But there is no greater purpose to it since our existence as individuals is purely accidental. Our only function is to enable the passing of our genes to the next generation. That's it! So what then?
It seems that we've been given this opportunity to spend a certain amount of time in this form on this planet. What we do with it is entirely our choice, because nobody else cares.
And another thing, even if we do have a purpose, even if we inherited something from the purpose of the universe, nobody bothered to tell us, and more importantly didn't restrict us to do that one thing that is our purpose.
So does this mean we can do whatever we please? Well, yes! Somethings we can do only once and then die and others do repeatedly and enjoy.It's up to us.
Therefore, we can choose between passing our time aimlessly, or assigning ourselves a purpose which will give us meaning and make our life more pleasurable.
I'd sure say that the second is a more adequate choice, which leads me to the question,
If i were to choose a purpose for myself what would that be?, even more correct, What would be the best purpose i could choose for myself?
Well, if it's worthwhile to create a purpose it sure is worthwhile to help you feel better not miserable.
So the whole thing reduces to the search of a decent purpose for oneself based on a criteria which should help maximize the "feel good" component for that purpose.
So, i guess, a good purpose is one that is not beyond our physical / psychological abilities, but also not one that is easily achievable.
It should be a purpose that will always make us get the best of ourselves and become better trying to achieve it.
I've noticed that, generally, following a good purpose has as a result contribution to others. The fact that we're contributing with something to the humankind makes us feel better, and i suspect that maybe this is also part of our base function. This makes sense, because, although our genes are competing with each other inside the species genome they would not like for sure to become extinct. So they must be also aware about the good of the whole species while competing among them.
As time goes by, the evolution game is getting more complex, which would explain why traits as learning and thinking occurred.
We are after all machines capable of learning and reasoning, and i do believe a good purpose for a human is one that would use these traits to the full capacity, otherwise we would not be better then the animals which have a much narrower set of tools to use, like exposing their physical aptitudes either by beauty or by force.
So, to conclude, i think that when choosing a purpose for ourselves we should make sure that it employs constant learning and thinking as means to achieve it, and promotes contribution to others as a result.
This seems valid to me because it has the potential to make us feel whole beings using both our brain hemispheres, left (rational) and right (creative) and giving us the chance to express as individuals and also contribute to the good of all humankind.

A good article about the fact that life has no predefined purpose is this : Meaning of Life.

Sunday, March 23, 2008

Solving puzzles with genetic algorithms

The other days i bought a cube puzzle. It was made of small cubes tangled on a string grouped 2 or 3. Here is a picture to make a better idea of what I'm talking about:


The idea was to rotate the groups in such a way to obtain a bigger cube in the end. Before trying to solve this directly i said to myself: "Hey this is a great opportunity for some genetic algorithms programming". So, with this in mind i started to think about a way to program my computer to solve this. It turned out it wasn't very difficult to solve it directly, but hey! i enjoyed it more doing the program then just solving it the classical way.

As you probably know, or if you don't maybe you can check out wiki, the main idea in genetic algorithms is to create populations where each element represents a possible solution to your problem. Each characteristic of the solution is described, like in biology, by one or more chromosomes. So the first step is generating the population, the bigger the number of elements the higher the chances to solve your problem more quickly. Good.

After the population is generated you will need a way to evaluate the precision of your solution. More precisely, you will need a function to calculate the fitness of an element. The fitness will actually tell you how close your solution is from the desired result. Usually the desired result is marked with fitness 0. The more your fitness grows the further you go from the point of interest.

So after calculating the fitness of each element from your current generation, you will want to keep the best ones ( the ones with a better fitness ) and discard the others. Of course you will need to replace the discarded ones with new elements. These will be the offsprings of the survivors. In order to obtain an offspring we will take two random fellows from the previous generation and combine their characteristics(chromosomes). This process is called crossover and it's basically the same like in biology. For example the color ,of your eyes represent the result of the crossover of your parents chromosomes that are in charge with the "color of the eyes" characteristic. You've got the idea. The process of crossover basically represents taking a part of one parent chromosome and the other from the second parent and concatenating them to obtain the offspring chromosome. A chromosome is made of genes so, if let's say you represent your chromosome like an array, a gene will be the value from the ith position.

Now, during the process of crossover, mutations can appear. A mutation represents an anomaly in the process of crossover when a gene, or maybe more, ends up with an arbitrary value which is not present in any of the parents. Mutations are very important because they help you explore other areas of the solutions space although that characteristic was not present in any of the ancestors of the present population. You will need to specify the mutation rate, which represents the percentage of mutation occurrence.

So until now we have the following keywords that you should know when talking about genetic algorithms :

Population - the collection of elements that represent the solution to your problem
Fitness - a value which tells how close from the desired solution an element is
Chromosome - an entity which describes a characteristic of an element
Crossover - the process of combining two chromosomes to obtain another
Mutation - an anomaly occurring during crossover, which modifies the resulting chromosome with a random value.

The hardest part in applying genetic algorithms, at least in solving puzzles, is describing the solution in a programmable manner and even harder then this finding the function to calculate the fitness of an element.

Now, in my case, i found that a good approach is to describe the solution like a series of rotations for each group. The condition was to keep the first group pointing out in the same direction every time. Keeping this in mind i found the following notations :

0 - rotating the group to point forward
1 - rotating the group to point to the left
2 - rotating the group to point backwards ( or at me )
3 - rotating the group to point to the right
4 - rotating the group to point up
5 - rotating the group to point down

The reference position was 0. So i am keeping the first group pointing forward all the time.

I forgot to say that the cube's dimensions were 3x3x3.

Regarding the function to calculate the fitness here we go:

First i needed to find the constraints :

- i couldn't make the same rotation twice for two adjacent groups. Because having only groups with lengths pf 3 and 2, rotating both in the same direction would have exceeded the bounds of my cube (3x3x3).

- the rotations could be made by x , y , or z axes. So using the notations above, rotating by x axis i could only go into 0,2,4 and 5 positions , rotating by y axis 0,1,2 and 3 and rotating by z axis 1,3,4 and 5.
More clearly axis x is represented by 1 and 3 positions , axis y by 4 and 5 and axis z by 0 and 2.
When i'm rotating by an axis i cannot access the positions assigned to that axis so when i am rotating around x i cannot go into 1 or 3 positions.
The next rotation will be done by the axis assigned to my current position . So if my current position is 4, this means that the rotation for my next group will be by the axis y . As you can see the first constraint is covered by this one , so i will only have to worry about the next axis i am going to rotate by.

- the last but certainly not the least. The smaller cubes cannot overlap.

So i have3 constraints that can be reduced to two. Quite OK I'll say.
My plan is to use the second constraint when generating the population. So i am generating only elements that respect the bounding of 3x3x3 but there will be some overlapping. Anyway i will eliminate from the start the unreasonable cases. In order to generate a solution i iterate through every group and based on the previous position I pick a random position from the subset of allowed positions taking care not to break the second constraint. As i have said earlier, the first group always points forward so each generated solution will start with 0.

Now i know how i am going to calculate the fitness . The fitness is the number of groups unhandled because some constraint has been broken. So the function that calculates the fitness will check if the cube dimensions were exceeded or an overlapping occurred and return the number of groups that remained unhandled. In order to check for overlapping I've used a tridimensional matrix, marking the positions already occupied.

After some coding i am able to run the program. Of course it doesn't work from the first shot, but after some debugging I'm ready to go and YES! .. with a starting population of 50000 and a mutation rate of 0.01 in less then 10 seconds i had the solution . Actually they were two, depending from which side i was starting. Of course i needed to run it twice in order to get both solutions. It was pretty fun.


So if i were to derive a recipe for solving puzzles with genetic algorithms here it is:

  1. Analyze the problem and think if employing genetic algorithms will actually help or not.
  2. Find a way to describe the solution in a programmable manner.
  3. Find the restrictions the solution would need to respect and think about a way to implement them.
  4. Find the best way to generate the first population. When I'm saying "best" I'm referring to the fact that the fittest each member of the first generation is, the higher the changes to reach success quicker. Try to eliminate the unreasonable elements from the beginning.
  5. Find out what fitness represents in the problem's context.
  6. Create the function to calculate the fitness.
  7. If you've covered the previous six points you can start coding. Design your program to fully obey you. Implement the function to generate a new member, and the crossover. You will also need some statistics like the average fitness, the best fitness, the best member...
  8. After coding is finished maybe you will need to play a bit with the population number and the mutation ratio to find the most efficient combination. Finding a solution can take from a few seconds to maybe a few hours or more depending on the problem complexity and of course on the way you've thought the program.