Friday, April 29, 2011

FreeBSD

I’ve been playing around with FreeBSD lately, and I really enjoy the portage system. I like the idea of compiling things optimized for your own computer, and only compiling what you want. Also it helps to learn the intricacies of how computer software works internally.

But I am starting to feel like FreeBSD doesn’t offer the same things Linux does. For example, it uses the old gcc 4.2, which is fine I suppose but the fact that the new gcc 4.6 isn’t used because the FreeBSD team doesn’t like the license kind of irks me. I was able to compile some software with the new gcc in FreeBSD, but if I compiled a library with 4.2 and tried to link a program using 4.6, it wouldn’t compile. So using >4.2 caused more problems than solutions.

Also, there are several applications which are only available for Linux right now, such as Dropbox and Flash. I was able to get Flash running through the Linux emulator, and I was able to compile Dropbox through the source, but nautilus never seemed to pick up the dropbox extension, essentially rendering it useless.

So what to do if I enjoy the portage system but also like the structure of Linux? Well, after some research it seems Gentoo is a good solution. I will be trying out Gentoo in the upcoming days and seeing if I like it.

Oh and FreeBSD didn’t have nvidia 270 yet, which was simple enough to import into /usr/ports myself, but was required for me because of this bug.

Sunday, February 21, 2010

ext4 in Windows

I recently bought Windows 7 to install, but all my files are already in an ext4 partition.  How to access them?  The ext2fs program doesn't really work well with the full ext4 system, and Microsoft.... well let's just say they won't be making any moves to create an ext4 driver.

So here's what I did that works perfectly:
  1. Install VirtualBox
  2. Install a linux variant inside virtualbox
  3. Set up raw partition access in virtualbox.  This is the key step.  The user manual for virtualbox does a very good job explaining it, but I've noticed that to use this correctly everything must be run in administrator mode in windows.
  4. Make a script to automatically mount the virtual raw partition (the ext4 partition)
  5. Set up symlinks inside the linux os to point to the mounted partition
  6. Set up samba in the virtual linux os to share the mounted partition
  7. Set up the virtual network adapter in virtualbox so that the virtual machine has an ip address you can access (try pinging it from windows to test it).  Make sure it's a static IP so you always know what it is.
  8. Access your files through in windows using samba :)
  9. (optional) turn off the linux os's gui to save memory and processing power, etc.
  10. (optional) set up a network map so that the partition is always mapped to a specific drive letter (like Z:\ )

Monday, January 18, 2010

Evolution

The scientists of the world have agreed that all evidence points to the theory of evolution as existing.  However, the mechanism for evolution has been assumed to be natural selection, which is quite possible.  The evidence for natural selection is in "superbugs," which are bacteria that have evolved to be resistant to our medications.  Whatever the underlying mechanism for evolution, the premise is that random mutations of genes, along with a "selective pressure," causes evolutions in biology.

However, I am reminded of the concept of diffusion, and how a person's willpower along with chaotic motion can change different concentrations of gases.  Allow me to elucidate by means of an example.  If we desire to open a syringe we create a selective pressure gradient, and the mechanism of diffusion allows for a change in different densities of gases to flow in the syringe.  So if we think about the idea of intelligent design as analogous, is it dismissible?  For example, if "nature's" or "God's" will was for a species to evolve in a certain way, couldn't that willpower be used to create a selective pressure, and the mechanisms of random genetic mutations along with natural selection would take over to produce the "willed" outcome?  It isn't unreasonable to assume that if humans have willpower, then nature couldn't also have willpower.  Until we can quantify willpower, we can't simply dismiss intelligent design as religious babble.  However, it should also be noted that the direction of increased entropy is always followed (the laws of thermodynamics), and hence perhaps willpower is just an illusion.  This will have to be reconciled as well before intelligent design is scientifically accepted or dismissed.

Monday, December 7, 2009

Śūnyatā

The Buddhist concept of emptiness is interesting, complex, deep, and confusing all at once.  One particular consequence of the ideology is the concept of an inherent "you", or "I".  Let's explore that for a moment.  Do the cells in your body constitute "you"?  Well what about the ions and the cells?  But then there are living bacteria in your intestines that you could consider part of you or not part of you, depending on your definition.  Or perhaps at a given moment in time you are the sum of everything that can you can control. 

As a simple example, most people assume that their leg is part of them, and the person next to them is not a part of them.  But in a truly physical sense, is this even true?  One can argue that we can directly control the muscles in our leg, to walk if we want.  So given a desire, or a set of neuronal inputs, we can make the nerves that go to our legs fire, and make our legs walk.  However, there are 2 main problems with this. 

  1. Some people are paralyzed, and cannot control their legs.  So for these people, is their leg not a part of them?  This thought experiment refutes the idea that things that we directly control constitute parts of us.
  2. You can, if you desire, force the nerves to your hands to give the person next to you the middle finger, which will most likely make them walk (away), or perform some other action (kicking you comes to mind haha).  This simple example just means to demonstrate that there are other things we can control through our nerves, which we normally don't say are a part of who we are.

So we can control our legs (but not always) through the nerves stemming from our brain, and we can control the legs of someone else (but not always, or not predictably) via the nerves stemming from our brain.  So how can we honestly say that our leg is more a part of us than the people around us, such as our friends, enemies, etc.?  Even if we say that the densities of atoms between our legs and our brains is much higher than the density of atoms between someone else's legs and our brains, this is does not mean anything.  Slight pulls of EM force and gravity from our brain directly affect someone else leg's.  Furthermore, any physicist can tell you that what we think of as "attached objects" are not entirely as they seem, as all objects are physically affecting all other objects, but to different degrees and in different ways.  So while we can say that our legs are "more" a part of who we are than someone else's legs, there is no definite segmentation.

The next logical step Buddhists take is to say that since everything is interconnected, being compassionate, nice, giving good karma, etc. to others actually helps ourselves.  There are many other factors to consider here before this is taken at face value, but it just goes to show things are rarely as they seem.  Some Buddhist also claim that all negative emotions (jealousy, lust, anxiety, depression, etc.) stem from not understanding the true nature of reality, but again, this requires further thinking.

It's truly fascinating to understand how other cultures, religions, and people think, and I suppose the most obvious conclusion from all this is to really think critically about our actions and assumptions.

Monday, October 5, 2009

Speeding with the Garmin

So I was on a long drive, and while the speed limit was 65 mph, I was going 75.  My arrival time said 10:15pm, and I wanted to know how long I would have to drive for that 10:15pm to decrease by 1 minute.  This is how I figured it out, with the result being

"Driving Time" = "Speed Limit" / ("Speed Limit" - "My Speed") * "Change in ETA"

So given my circumstances, 65 / (65 - 75) * (-1) = 65 / 10 = 6.5 minutes.  So after 13 minutes of driving, my ETA would be at 10:13pm, for example.  (By the way, this is actually only valid for a single road's speed limit.  Once I left the highway, I would have to recalculate.)  If I were going 85 mph, then it would have decreased every 65 / 20 = 3.25 minutes.  

The easiest way to calculate it in your head is as follows:
  1. Take the speed limit (e.g., 40mph)
  2. Divide by how much faster you are going (If you are going 50mph, do 40 / 10.  For 60mph, do 40 / 20.  etc.)
  3. That's how long (in minutes) it will take for your GPS's arrival time to decrease by 1 minute.

To see how much of an effect traffic has, you can do the same thing:
  1. Take the speed limit (e.g. 40mph)
  2. Divide by how much slower you are going (If you are going 30mph, do 40 / 10.  For 20mph, do 40 / 20.  etc.)
  3. That's how long (in minutes) it will take for your GPS's arrival time to increase by 1 minute.

So for people who get annoyed at drivers going 35mph in a 40mph speed limit zone (me included), you would have to be behind that person for 8 minutes before your arrival time is affected by a single minute.

Just some food for thought.

Monday, September 21, 2009

Karma

As with any analysis, the basic assumptions must be stated upfront.  So we're going to start with the basic premises that

  1. If you smile at someone, they will be inclined to smile at someone else (not necessarily you).
  2. Your "soul" will be reborn into another body after you die.  

The variables here are:

  1. The distribution of people's ages.
  2. The distribution of interactions between people.
  3. The distribution of frequencies of smiles.

As an aside, there can always be more variables added, such as if you smile at someone, they may only be 80% inclined to smile at someone else instead of 100%.  But with these variables, any mathematician, statistician, economist, etc. worth his/her salt can come up with simple equations proving karma exists.  In fact, the output of the equations will be how long, on average, it takes for karma to come back to you. I.E. if you smile at someone today, how many years, or how many lifetimes, on average it will take for you to receive a smile, because of that initial smile you gave someone.  I will not derive the equations (as an initial guess I'm pretty sure they are simply partial differentiable equations), because this is just a thought experiment.  The question isn't if you will receive karma - it is when.  It's just math.  However, if you take into account that frowns make someone less inclined to smile, then the question actually does become if, instead of when.

Furthermore, a more complicated (and realistic) analysis of karma could be performed by assuming that smiling at someone else makes a positive impression in their brain.  Perhaps that positive impression will make them more inclined to smile at someone else, or perhaps 15 positive impressions will make them more inclined to perform a "bigger" good deed, such as helping an old lady cross the street.  Then, you wouldn't see a direct effect of your smile in the future (i.e. you wouldn't necessarily receive an equal smile at some point in the future), but perhaps a large good deed will be performed for you.  Again, the equations become more complicated, but any semi-decent mathematician can come up with them.  The idea is that you don't know what kind of results will come from your good deeds, but there will be some.  

Actually, an interesting output of these equations is what is the probability that you will "receive your karma" in this lifetime.  So for example, if you don't believe in assumption #2, then you could see what is the benefit of doing good deeds in this lifetime.  My instinctual guess is that what good karma you receive in this lifetime will only be realized if a large number of people increase the frequencies of good deeds.  This may be a depressing thought, but with the number of people in the world, if only you increase the number of good deeds you do, then there might not be a significant increase in the karma you personally will receive.  A more optimistic idea, however, is that if you take into account the fact that the people you have the most interactions with are probably going to be the ones who are the subject of your good deeds, then the increasing the number of good deeds you do to them will, in fact, probably have a significant impact on your life in the near future.

As with any probabilistic analysis, there will be variance.  That means that if you smile at someone today, you may receive a smile tomorrow, or it may take 1000 years for you to have received that smile.  It is not a guarantee that it will happen at a specific date, or within a certain number of years - there is only a confidence value that it will happen within a certain time range.  For example, if you want to know if a smile will be returned to you within the next 10 years, all you can say is "yes" or "no" with a 95% confidence interval (well, not exactly mathematically, but you get the idea).

Monday, September 14, 2009

Cool video I found

Kind of spiritual and philosophical, but hey we all wanna be happy, right?