Saturday, January 21, 2017

A weekend theory about evolution of mammals

Many theories and hypothesis arise about where first mammals came from.

The general accepted main-stream theory claims that mammals evolved from reptilians and that reptilians, in turn, evolved from amphibians.

I think this is just wrong. I have an alternative theory that match better with many experimental facts.

Be prepared .... Here it goes:

"Mammals evolved directly from amphibians, and the first mammal to arise in planet Earth was no other than a tiny cute bat".

Where this arbitrary claim come from?. Curiously, to arrive to it I took the opposite direction applying some spots of deductive and inductive reasoning and starting with some evidence nobody will deny.

Simply put: "Bats fly".

It could look a curiosity at first sight, but a very weird one. It's weird because there is no doubt than flying is something *hard*. Flying is difficult, very difficult. Flying requires lot of energy, lot of changes in the brain and lot of physiological changes in the body of a bat. It's also weird, extremely weird that bats are the only mammals that can fly.

Bats are closely related to rodents and in particular to their mouse cousins, up to the point that is quite normal to associate bats to flying mouses. This is where some deductive reasoning takes place.

Darwin's theory of evolution explains how living beings evolve through *small changes*. Random *small changes* in the ADN provides some *adaptive advantage* that makes the new specie to survive. The words *small changes* and *adaptive advantage* are highlighted because here is where things starts to fail with the current theories:

 According to established theories bats evolve from rodents but this is very hard to explain with Darwin's theory of evolution. There is no small change that suddenly allows a mouse to start flying. There is no single change in the ADN that magically lets a rodent fly. Even if magically a mouse would be born with wings, its brain would not be adapted to flying. Even if magically a mouse would be born with wings and also magically its brain would change to let him fly its digestive system will not be adapted to consume all the energy needed to fly. Even if magically a mouse would be born with wings, with an adapted brain and a digestive system allowing it to fly, it will need changes to its breathing system, and some sort of mechanism not to loose heat throught its wings, and many other adaptations just because as already said, flying is hard to achieve, even for human engineers designing an airplane it's very, very complex (and humans count with the advantage of being able to burn tons of petrol to make an airplane fly, something forbidden to living beings).

Could it be the case that through thousands or hundreds of thousands or millions of years some species of  rodents could evolve through small changes until, at some point, they were able to fly?

  The problem with that hypothesis is that it goes directly against Darwin's theory of evolution.  All the *small changes* required for a bat to fly provide no *adaptive advantage* until such a bat actually flies. Quite the opposite a mouse with "big wings" but unable to fly will be doomed to die. It will not be able to move and will loose heat very fast. This is exactly the same for many other adaptive changes.

And so, if the evolutionary step driving from rodents to bats are hardly difficult to explain, what about the opposite? What if rodents evolved from bats?

Curiously this question is much easier to defend while respecting Darwin's theory of evolution of species. Maybe just at some point the bat's wings started to become atrophied or the bat augmented its weight or its metabolism didn't allow them to consume as much energy as needed to keep flying. Not being able to fly will be a disadvantage that could be *immediately*  be compensated by the fact that such a bat will waste much less energy by just "walking". This is something we have already observed in many birds (Does it sound familiar to you some naturist that observed some albatross in Galapagos island with atrophy in its wings?).

So let's assume the arrow of time moved forward from bats to rodents. What then? Where do bats came from, if not from rodents? What other mammal could evolve to the point of creating such curious flying mammal? They easy answer is:  NONE. 
The same arguments that lead us to the conclusion that rodents can't be the parents of bat would apply to any other mammal.

There is no such mammal. Bats are actually the first mammals living in Planet Earth.

Who was them the parent of first bats? Well, I have not a clear answer to this question but intuitions tells me that, with high probability, some sort of flying frog were their parents. I base it on the next coincidences:

- Both frogs and bats emit sound and they do with similar patterns. No other amphibian or reptilians have such a feature. Emitting sound as frogs and bats do require important changes and new "modules" in the brain to be able to control it.   This is an extremely sound coincidence for such small primitive creatures with small brains and in fact the audible sound emitted by bats resembles to a certain point to that of frogs (
- In general both species are much more active during the night.
- The physical appearance of flying frogs and bats have many coincidences, specially their "hypertrophied" hands-wings.
- Both have insects as main source of proteins.
- Size and weight match.

To hypothesize that a flying frog could at some point be able to "just fly" is not hard to believe and there are adaptive advantages in passing more and more time flying. It could be that at some point this flying frog could pass most of the time flying. This will trigger many fast evolutionary steps. Its lungs will change fast to allow to breath more oxygen from the air and pass more time flying. At some point being able to carry foetus inside will allow that flying amphibian to traverse many distances in search of food or just escape from predators with easy. Flying would favor warm-blooded to support sudden changes in temperature due to the wing. (Curiously the other warm-blooded species in animal kingdom apart from mammals are birds who also fly).

At some point this flying frog changed and a first mammal, a primitive bat, was born!.

If a theory is to be taken seriously it must also have some predictive power. Let's examine what this theory can predict:

- If bats were actually the first mammals on Earth there must be many different subspecies of them after so many years of evolution. This is in fact true, and as today bats is the second more diversified specie in the mammal kingdom living in all sort of climates and places. Curiously they are only surpassed by rodents, that will be nothing more than adapted bats.

- If bats were actually the first mammals there must exists fossils where no other o very few other species of mammal actually exists. This is actually true, and fossils of bats have been found in places where mammals were difficult to find.

- If all mammals come from bats there must be some trace easy to identify. This is not so evident, but in fact bats needs lot of brain power to control their wings. Curiously bats wings are nothing more than hands in newer mammals, and curiously many mammals have extraordinary skills to control their hands than no other terrestrial specie do have. Mammals brain also have a great power to understand the world in "three dimensions", something that could have appeared while bats learn to move in three dimensions.

And finally, as a gift for curious researches with no plans for the weekend, this is a non-yet-proved predictive fact of this theory. It's well known that bats use sound to localize and hunt insects. My hypothesis is that some (or many) subspecies of frogs could be using such same mechanism to localize insects, and not just as a way for males to get the attention of females. It's even possible that they will be using the same frequencies and we were not noticing it just because we didn't even thought about it.

Saturday, October 22, 2016

Energy saving issues with Lubuntu (and how to fix it with powertop)

I'm a big fan of Lubuntu (Light Ubuntu), the Ubuntu without all bloated software since, on average, it saves up to 1 or 1.5 Gigas or RAM when compared to standard Ubuntu will of the fancy (and useless) 3D effects.

Something that annoys me anyway is that the default setup in Lubuntu (I ignore if that's the case in Ubuntu) is quite energy-hungry.

I use a Dell XPS 13 laptop equiped with brand new hardware that "theoretically" must work in silence most of the time, but when I just boot up Lubuntu and a couple of apps (Firefox, Eclipse) the fan starts to run at max speed.

The easy (patch) solution is to run next command:

sudo powertop

then go to the "Tunables" tab, and switch all from "Bad" to "Good", except most probably for the USB keyboard and mouse and the wifi or ethernet. (For those really concerned with the integrity of their HD data, don't swith also al SATA related stuff).

Actually, activating the power saving for the PCI Intel Core processor Graphics Controller is usually "good enough" to make the fan settle down, but switching on all the others makes no harm and our computer will be happier with us (don't forget that sooner than later IA equiped macro-computers will punish those poor humans that through the years tortured their indefense CPUs, so it's better to get friends as soon as possible before it's too late).

Friday, December 4, 2015

Swift got it closer, but still fails

Continuing my religious and long war against null beings.

I just read about Swift improvements to avoid null pointers. In Swift a variable can not be assigned a null (nil in Swift nomenclature) unless it's declared optional. And this nil is actually an object of a defined type with a presence in memory, not a pointer to a forbidden memory address (0 in practice).

Still, while Apple's guys got closer to a solution, they didn't get the point.While the solution proposed by Swift fixed the Null pointer exception, it doesn't fix all the semantic inconsistencies of using Nulls. A nil object in Swift is still something empty of information, and so the "information lost" is still present.

The solution to fix the problem was much, much simpler and much, much more effective:


See more about it

Tuesday, June 30, 2015

Downloading youtube Videos with VLC (command line)

Ladies and gentlemen, we present you the fast and easy way to download Youtube videos using VLC and a shell script:

The script:

  # INPUT is the URL as seen in the browser
  # OUTPUT is any arbitrary file.
  vlc --intf dummy "${INPUT}" --sout=file/ts:${OUTPUT} vlc://quit

A problem appears if there are many related videos to download (for example a 50 video tutorial).
 Using Firefox I just select them all on the "right column" (related videos), right-click to select "see source code selected" and then clean the html to let only the input URL and the video title. 

Then a few Vim macros is all that needed to convert them in a shell script.

World Domination is an step closer now!

Tuesday, January 20, 2015

Science is not Politics


Looks unfortunate that most software developers have forgot this point.
Many modern programming languages just try to reach a consensus instead of doing things right. Let's observe how Javascript, the most widely used language today still keeps "null" and "nondefined" types around even if science says they must be dropped (backward compatibility is just an excuse, not a reason).

(Edit 2015/02/13: ECMAScript 5 Strict Mode will throw a ReferenceError when trying to evaluate a non-existing variable). 

Thursday, December 11, 2014

Is that good or bad?

This is the type of achievement to hide in a CV :(

Edit (2015-01-05): New hit on Stackoverflow!

Friday, December 5, 2014

Obfuscating Python code

Obfuscating code is probably a bad idea. It can have unpredicted consequences. Think twice before continuing

The script:
Next shell script will serve as reference to obfuscate Python code by compiling original files to .pyo while hiding the original source from py files.

# DIR_L: directory list (module list)

DIR_L="pythonModule1 pythonModule2 pythonModule3"

for dirA in ${DIR_L}; do
    cd ${CWD}/${dirA}
    rm -f *pyc *pyo
    python -OO -m compileall .
    ls *py | while read f ; do
        # Create empty "file".py with same modification time
that tmp (the renamed original "file".py used to
        # create the pyo file)
        mv $f tmp && touch -r tmp $f && rm tmp

 Python will *always* compare the modification date of the *py file with the one hardcoded in the *pyo object. If it doesn't match, the pyo will be recreated.
Creating a pyo file and then removing the code in the original *py file will not work since once the code is removed (echo -n "" > the modification date is updated. Next run will update the pyo file from the empty py file.
 Removing the py file leaving only the pyo file will not work either, since python will ignore the pyo file if the matching py file is not present.

The quick-and-easy solution then is to use "touch" with the -r option. This combination will create an empty file and update the creation/modification timestamp of the new file taking as reference the file passed to "-r".  Since moving a file doesn't modify its modification timestamp a line similar to:

  mv tmp && touch -r tmp && rm tmp 

will create the empty with a modification timestamp matching that of the myfile.pyo (created previously using python -OO -m compileall .)

While not shown in the script it's pretty clear that we must be working with a copy of the original sources. Otherwise they will be lost after obfuscation. Is up to the reader to choose its favourite way to do the copy. As a hint I use something like the next one-liner:

tar -C src_dir -cf - * | tar -C working_dir -xf -

pyminifier  provides utilities to minify, obfuscate and compress Python code as well as a Python API to use it inside other Python code. Unfortunately in my own tests it was buggy with many cryptic errors about missing modules.

touch is just available on UNIX-POSIX friendly systems. Probably it will also work on Windows with the help of cygwin, but it's not tested at all (and it will never be!).