Risks of Modern Life

According to Confused using social websites such as Twitter or Facebook can increase your risk of being robbed. It is even being said that using Facebook or Twitter may soon increase your home owners insurance. At first glance this seems pretty scary and is something that most people likely never considered.

Robbers want to rob a house when they will have the greatest chance of not getting caught. That means they do not want anyone to be home. These articles point out that when you post your ware abouts online, you are informing robbers. They could use the information that you are not home to go to your house and rob it. The first assumption is that your address is freely available. After doing a quick check of my computer illiterate friends on Facebook, I didn’t find any with that information available. However, the robber could use your name and a phone book to look you up.

The other problem is robbers already have tons of ways to find people that are not home. Simply picking up a phone book and calling numbers in order and going to the houses that do not pick up. In fact the robber could get lucky and they home owner would have put a message on their voice mail saying they will be out of town. Robbers also know that nearly everyone works during the day. So they can simply go up to a house during the day and knock to see if someone answers the door.

If we look at someone who can guarantee is not home during a certain time, such as a news anchor who is live on air at a certain time each day. We do not see an increase in the likelihood of robber for news anchors versus the average person.

I’m not saying its perfectly fine to post your ware abouts online. I just want to point out that it is very doubtful it increases your likelihood of being robbed. I hope the smart people at the insurance companies actually look at some data and not just jump on the chance to charge more money.

Future of AI

AI has always intrigued me. The idea of recreating human or at least intelligent behavior with software is an amazing idea. Unfortunately modern AI is nothing like the dream of creating human behavior. Sure the current solutions can solve some pretty cool problems, but its not the types of problems that people think of when they dream of AI. At h+ Magazine an article was posted discussing what the experts of the AI field predict to happen over the next century. Most seem to think we are a long way off from even being able to pass a 3rd grade exam and possibly 100 years off from making smarter than human AI.

The thing about most AI style problems is that we can solve them in a much easier ways without AI. Passing a 3rd grade exam could be done with advances in natural language processing and some clever Internet searching. It turns out to be very difficult to find ways to test AI. Even the famous Turing Test may not be as satisfactory as one might think. Its hard for a human to tell even if they are talking to another human even if they are, in fact, talking to another human.

The reason why it is so hard to identify another human during the Turing Test is because we don’t know what we expect from another human. It comes down to the fact that we have no idea what makes us human. Its nearly impossible to describe a humans intelligence and identify the intelligent parts. So it would be very difficult to quantify how an AI system is better than a human, let alone equal.

I think before we are able to make any true AI system we first need to figure out how the human mind works. Which is turning out to be much easier said than done. Every time we figure something out about the brain, it creates at least ten more questions about the brain. To put this problem in some sort of perspective: We had a theory of computation decades before the first computer hardware and we had predictive models of space centuries before we had the ability to test them. However we have the hardware to run our AI systems on, but no theory as to how to do it. So I think we are at least half a century away from having anything near what we dream AI to become.

Fast Case Converter

Often I find myself needing to convert between upper case to lower case and vice versa. This is a fairly simple thing to do if you understand ASCII encoding. A good reference for the ASCII Table can be found here. As you can see, to convert a letter to lower case you would add 32 to the current value and subtract 32 to convert it from lower to upper. However to implement this it takes a few lines of code to put some conditions in that check to see the current case and decide to add or subtract.

I was looking at the ASCII Table the other day and came up with a simplistic method to swap the case of a given character. That is to exclusively-or the value of the character with 0×20. This will convert the upper case to lower and the lower to upper. Its probably the fastest method to swap ,CPUs can xor in one cycle (excluding memory load time). However you still need some type of conditions to make sure the character is actually a letter and not a number of symbol.

Enjoy!

A Walk Through the Human Mind

I wrote the following paper for a Philosophy class that I am enrolled in. The paper mostly deals with dualism versus naturalism and focuses on some common arguments for both sides. I do a bit of a critical review of each side and attempt to conclude with my own views.

Whether Dualism or Naturalism is true hangs on more than just general philosophical debate. As would run contrary to the first glance, dualism would make the humans mind off limits to science, while naturalism gives science complete control. Both describe where the soul of a person is contained, but use radically different belief systems to come to their conclusions

The first question that would be asked is what is a soul? Webster gives the following definition: “the immaterial essence, animating principle, or actuating cause of an individual life.” At first glance this seems very well defined. As a human being I notice that I am radically different from any of my animal counterparts, however what exactly is it that makes me so different? On the physical side I obviously look different from any animal, but most animals look different compared to other animals. Also most dualists believe that only humans have souls, thus it cannot be physical traits that set me and the animal world apart. Is it intelligence, language, or reasoning? Well all three can be seen in some form or another in the animal kingdom. It is not so easy to find exactly what it is that makes us human and everything else not human.

To give a partially complete answer of what makes us human it would be in the way humans constantly reevaluate their thoughts and actions. We do more than low level reasoning to solve simple logic problems, we use high level reasoning that allows us to gain knowledge from little to no actual experience. For example, the ability to reason about the existence of a soul is a high-level reasoning problem that no animal is able to do. This seems like a huge leap from the most intelligent, non human animal but it is the next logical step after low level reasoning. While, most low level reasoning requires a single pass through of all of the information at hand to yield a result, high-level reasoning requires multiple passes, taking what we have previously decided to be true and using that as part of our input for the next round of reasoning to gain new meaningful information. So to be human means to have the ability to do high level reasoning and gain knowledge from no experience.

Now that we understand what the soul is, we must examine where the soul is. This is the heart of the debate between dualism and naturalism. In dualism it is believed that the soul is an immaterial object that is physically separate from the brain. Naturalism takes the stance that the soul, commonly referred to as the mind, is simply part of the brain. Which one is correct?

Descartes argues that dualism is the correct answer. He takes his arguments against scepticism and turns them into an argument for dualism. The argument often takes the form: I can imagine that my body does not exist, but I cannot imagine that I myself do not exist therefore I must be entirely distinct from my body. The two premises nearly follow directly from Descartes’ own arguments and the arguments of scepticism, however, the conclusion tends to be a bit of jump. Descartes does show that I myself and my body can be two separate things in this argument but he does not show that it is necessarily true. In fact the only way that it be necessarily true would be if the sceptical argument was correct, something that even Descartes has argued against.

It is a bit ironic that Descartes argues for dualism while he argues against scepticism. By forcing the mind to be separate from the body, as it is in dualism, he is creating a world in which nothing has to exist except for the soul. If souls are what make us human than we could simply be brains in a vat, or in the case of dualism, non-physical entities that either simulate a physical world or are actually connected to a physical body. Both cases would make the sceptical arguments virtually true.

Other arguments for dualism turn out to be a bit of a let down as well. Descartes attempts to argue for the connection between the human mind and the soul, but it doesn’t appear to be scientifically possible to transfer the information from our physical world to the non-physical world of souls. One could then argue that perhaps souls are part of this physical world and we have not yet found a way to measure their existence. If this were true, it seems scientifically silly to think the soul has to be outside of the brain.

With so many strikes building against arguments for dualism it seems like it cannot be correct. However, no matter how many individual arguments for a topic are proven to false, the topic, itself, could still be true until someone proves that it is not. In order to disprove dualism we must examine dualism itself and see what it implies, and see if these implications fit our model of the world or not.

Modern science believes that humans came from creatures that evolved over a very long period of time here on earth. At some point two creatures that where very human-like mated to give birth to a human child. Now starting with the assumption that evolution is correct, at what point did the soul come about? Well there are two answers: the first is that the souls were there prior to the existence of humans; the second is that they existed upon the creation of the first human child.

The first argument would imply that every creature has a soul. This argument doesn’t exactly make sense because we have already defined the soul to be what makes us human. It is possible that we ill-defined the soul, but most modern dualists do not believe that every creature has a soul. This isn’t exactly a satisfactory reason to discredit the argument. The idea of the soul is generally believed to stem from religion. Which says that the soul is what lives on after we have died in this physical world. From this it seems strange to believe that a god would make animals live on after they have died.

This leaves us with the second argument, which is that when the first child was born, a soul was either created or assigned for this first human. What was it that the parents of the first human didn’t have but the child did have? From evolution it is known that very subtle changes are the only ones that are made from parents to offspring. So the parents likely had pretty similar DNA and physical traits compared to the first human. It is hard to imagine that such a small change could have such a dramatic change on this world. Again, however, this isn’t exactly a fulfilling proof that the soul couldn’t have been attached at the first birth. Let’s assume that the first human did get a soul when it was created. How did this child mate to create new humans? Well, other non-human creatures could have created human offspring which had the exact same change from the non-humans that allowed the soul to be attached. These offspring would need to have been created fairly close together so that they could eventually meet and mate. This seems very unlikely, as the probability of this happening is very low. Another option is that the first human mated with other non-humans and again created a human. This seems to take away what makes a human special, the human offspring could be more like its non-human parent than its human one. Why would a soul attach to a slightly human creature and not other non-human creatures? The final option is that the first human had a sibling of the opposite sex who was also born with the unique set of traits that made it human. Then the siblings mated to create more humans. This seems unlikely because the only universal law of humanity is that siblings should not mate. That rule appears in every culture in some form or another. Why would the first generation of human violate what appears to be an inherent law of human nature?

Thus it appears that the dualist argument has been defeated given that evolution is true. It would be nice if we could get rid of the condition of evolution being true. There are arguments that attempt to do just that, but they tend to involve a lot of other assumptions and are not completely satisfactory proofs.

Let’s now turn our attention to that of naturalism. It seems natural to feel that you exist separate from your body. This part that we feel is separate we generally call the mind. The brain is not the same as the mind, but rather the physical vehicle for our mind. We can consider our brain as a black box; by this we mean that lots of input goes into our brain and a lot of output comes out of our brain. Our brain cannot directly interact with the world around it, all it can do is use the inputs from our senses to gather information and use our body to express information. Using this view of the brain it is natural to see where the mind comes from. The mind is an emergent property of our brain attempting to exist outside of itself. The brain must place itself outside of our bodies to be able to interact with the world around us. Thus our mind is created to be that imaginary thing outside our body.

So it appears that our belief in dualism is a natural side effect of the way our brain attempts to make sense of the input it receives in order to interact with the world. It is important to remember that disproving dualism does not disprove religion or cheapen the value of a human life. Religion sits in a different domain than science it answers what happens after this life, while science answers how this life works.

MySQL and Java common problem

Have you ever received the following error while using Java and MySQL:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘????????????????’ at line 1

This is a common error when you first set up Java and MySQL to work together. To correct it simply add the following lines of code to your my.cnf in the section [mysqld]

collation_server=utf8_general_ci
character_set_server=utf8

Self Replicating Code

For a class recently the teacher challenged us to write a code snip-bit that would be self replicating. By that I mean write a program that when executed would write out its own source code. This is a bit harder than you’d initially think it to be. My first attempt tried to store the source code within the program when execute it would output what was stored within. However this creates a chick and egg problem. The source code contains the source code. Something that at first stumped me. Then I remembered Stringification in the C preprocessor and I came up with this:

#include “stdio.h”
#define M(Code) main(){FILE* fp = fopen(“source.c”, “w”);fprintf(fp,”#include \”stdio.h\”\n#define M(Code) %s\nM(%s)\n”,#Code,#Code);fclose(fp);}
M(main(){FILE* fp = fopen(“source.c”, “w”);fprintf(fp,”#include \”stdio.h\”\n#define M(Code) %s\nM(%s)\n”,#Code,#Code);fclose(fp);})

This is a pretty cute program if I can say so myself. When its ran it will create a file called source.c that will be exactly the same as the code above. You could even recompile source.c and it will create another source.c. You should attempt to do this on your own to see if you can come up with other cool ways of doing it.

Download: SelfRep.c

Dual booting Linux and Windows with linux already installed

I have always been told in order to dual boot Linux and Windows you must first install Windows then Linux. The idea being that Window’s boot loader does not play nicely with Linux like Grub or Lilo does. However it is often easier to install Linux then Windows; like with the up coming Windows 7 release, Linux users may want to try out Windows 7 without having to reinstall their Linux installs. I cam across a great tutorial on how to do just this.

Consider both sides

I was recently watching some research project proposals at my university. One of the proposals caught my eye, it was a way to stop common cheating techniques for page rank. At first glance the proposal has some good merit, the system would stop the current techniques used. However the problem was that they did not take into account what new problems they would introduce.  The actual proposal is still private so I can not talk to much about the details.

It is very common to come up with solutions that fix very common bugs. What is equally as common is creating new bugs that are as bad as ones that were corrected. When fixing security vulnerabilities the fixer must consider both what is fixed and what bugs the fix will introduce.

A Lapse in Policy

We have all be on the phone talking to someone that we may not know all to well, when at the end of the conversation they say “sounds good, go ahead and shoot me an email about this.”. If you are like me you think, “why we just talked about it”. However that email actually is used for quite a few things: The most obvious one is that it will be used as a reminder, people often use there inbox as a to-do list. The next thing that email will be used for is a record of your request, most companies have very strict policies on change management where all changes must have a request associated with it. The final thing that email will be used for is authentication, with the raise of knowledge about social engineering over the phone email as authentication has come into play.

The lapse in policy comes from the last two things the email serves. It comes from the assumption that only the person who controls the email account can send an email from that email address.  Unfortunately email, like most Internet protocols was invented before security was taken into account. Its actually considered quite trivial to send an email appearing to come form any name and email address that you please.

Fortunately there is a simple fix to this problem: Simply reply to all request emails with a confirmation request. So if person A requests person B to preform some task on the companies file server. Before preforming the task, person B should send a confirmation email to A asking for A to confirm the task.  Then the request and the confirmation should be stored for record keeping and we can be sure to the point of the security of the email account that the request was authentic.

Paying the Ultimate Cost

In America and most of the western world when we hear the phrase “paying the ultimate cost” we think of dying for a cause. Basically it means we value ones life as the highest cost we can sacrifice. In security the only way to protect something is to make the cost so high that attacking it is simply not worth it to the attacker. So in the west and especially America we use the threat of taking away someone’s life as the cost for committing very serious crimes. Some would debate how well this works, but I am of the personal belief that it works pretty well.

People often argue that defending against a suicide attacker is impossible for the reason that the attacker doesn’t value their own life. The problem with this argument is in the assumption that to the attacker the ultimate cost is the attackers life. I would argue that there most be something that is to valuable to the attacker that will make them feel the attack is not worth it. An example suggestion would be the attackers family. If the 911 hijackers thought America would hunt down their family and killed them I would suspect they wouldn’t have done it.

Now this sounds horrific, that’s because it is. We in America and other Christian based moral codes would never hold the fault of a family member against the entire family. I would also never suggest that as a solution or support it. The point to the argument is that in trying to mitigate a risk you most consider the potential cost to the attacker. The higher you can make it the better. Unfortunately when you deal with people that have a different moral framework, like terrorist,  costs are measured differently. When attempting to develop mitigating controls to defeat terrorism we have to be creative in finding costs to the attacker that are ok in our own moral framework but are still costly enough to make the attacker not attack.