Monthly Archives

May 2013

Random

Virtual Reality to Change Future Gaming Experience

May 31, 2013

Video games have been around since the 50’s and are in an ongoing state of ”evolution”. Gaming players and developers are constantly on the lookout to incorporate new technologies into gaming, hardware and software. Today, there are many tools available to enhance user interaction and capture human movement. Yet, most of the systems are expensive, require high maintenance and are somewhat unnatural. Gaming consoles today include a full range of motion capture devices, yet gaming popularity among motion capture games is not as high compared to ”regular” gaming. The question at hand is weather any of the Virtual Reality (VR) systems could be incorporated into gaming in the near or far future and weather such act will revolutionize gaming to another level.

In order to address this question appropriately let us divide gaming into 3 sub-categories: video games, simulation and specialize devices. We can consider video games as the mass end-user, home, gamers. These are the games that do not primely intend to simulate a real environment (although they may) but to entrain and amuse the user(s). Let us name simulation to such games (although they might be in the first category as well) that primarily intend to simulate an environment without too much external devices. This might include some motion capture device, but mostly the affordable and low-end commercial ones. The third category are the large, cave like, simulators that intend to be inline with Ivan Sutherland’s Ultimate Display. If you have not read that little short article, I highly suggest you do it now. This is the category that in my mind will not become home ”friendly” and will mostly remain as specific devices that are built for specific uses. Such uses include therapy, military training, etc.

In the category of video games, I do not see any VR system that can really revolutionize gaming experience anytime in the near future. In terms of hardware there might be small improvements, curved displays, better controllers (if possible), 3D technology and other similar hardware will come to the market very soon and will reduce to reasonable price at some point. However, system such as the data glove, Oculus rift, motion trackers and similar motion capture and output devices. They all have been around, some for a while, and yet none has taken off in a direction of being mass produced or gaming related. Although some home improved recently and cost has gone done significantly, they have yet to emerge as a new gaming experience. In addition, they require high maintenance and would fail in ”real world” living room gaming experience. I do not think any gamer would spend an hour prior to gaming calibrating a system or/and getting into full body gear. More so if after an hour of calibration the wires get tangled or the batteries need to be recharged.

Skipping to the last category I think specialize VR systems have improved tremendously over the past years and will continue to do so. With the increase use of simulation in the military and therapy environment, cave like rooms, or spheres will get more accurate and truly will come close to The Ultimate Display. The reason this large scale devices will ”grow” is because in the long run they save money and life. For military use, the ability to virtualize war like scenario will yield better soldiers and better prepare them for real world scenario. In therapy full room simulation might help in ways we simply can not today. Farther more, full room simulations have endless uses in many more fields that I wish to consider for this paper.

Simulation, to my opinion, will benefit and advance the most in the near and far future. This includes hardware such as the Wii Remote, Microsoft Kinect and the PlayStation Move. I think more and more games will come to utilize the hardware. However the greatest advancement in my mind will come from mobile gaming and augment reality. The growing gaming community at the moment is the mobile devices, namely mobile smart phones and tablets. Furthermore, there is a great niche that augment reality can fill. Bringing games outside of the virtual space and interacting with real life objects will revolutionize gaming. Using generic object, such as a box, table, wall and etc. Using augment reality can enhance an environment to a new frontier. This will require light and cheap HMD with hours of battery life time. ”Smart glasses” if it may, will be the next leap in computation and gaming. That will be a point in which we meet the Virtual and Reality, somewhere in the middle.

Now one knows what the future will truly bring. Microsoft and Sony have just lunched their new top of the line systems, but are they really that much different? Have we seen anything “new”? Sadly, no. We are looking at improvements on well built past. The future of gaming might be close, but it is not really here. At least not for me. What do you think? Is the future already here?

Infographics

Wi-Fi Security Breaches: Escape the Void

May 29, 2013

Google was fined €145,000 ($189,000) by German officials on April 22 because it violated German citizens’ privacy rights while developing the Street View mapping service. Google illegally acquired personal information from public and private Wi-Fi networks, including emails, photographs and other unencrypted data, according to the New York Times. The data was collected by Google’s Street View automobiles, which have digitized about five million miles of roadways in 49 countries.

According to BBC News, Germany’s data chief claimed Google’s actions as “one of the biggest known data protection violations in history.” It was also noted that the miniscule penalty would not dissuade future abuses. The maximum penalty currently allowed by law is €150,000. Google made $10.7 billion in net profit last year, over 50,000 times the amount of the penalty, stated by The Times of India.

 

Program Errors or Negligence?

Google claims the privacy violations are nothing more than program errors. However, numerous other countries have filed suits as a result of the company’s negligence. Peter Fleischer, Google's global privacy counsel, told the New York Times that the company does its best to respect privacy rights and does not deliberately farm private data.

DailyTech revealed that Google settled privacy litigation with 38 U.S. states in March for $7 million. The company was also ordered to establish an internal privacy program, run educational advertisements in major newspapers of the effected states, and explain to users how to encrypt their data while using Wi-Fi via a YouTube video.

These developments shed light on just how easily individuals and corporations can gain access to private information through wireless networks. There are several precautions that can maximize your security while using Wi-Fi. Specific services, such as LifeLock Identity Protection, can not only aid in preventing security breaches, it will save you the time and hassle of calling your credit card companies to cancel accounts.

At Home

Almost all wireless routers have security technology known as Wi-Fi Protected Access Version Two (WPA2). It encrypts information as it travels from point A to point B. Always make sure this feature is on and make certain the router access password is at least eight letters long, includes both lower and upper case letters, numerals and at least one punctuation mark.

On the Go

Smartphones far outsell PCs, which means hotspots are utilized more than ever. It's best to connect only to those that require a password to maximize privacy and security. You can also use a VPN (Virtual Private Network), which encrypts all data sent or received by your device. VPN services are relatively inexpensive, and can be installed on most smartphones. By using a VPN, you can use those free Wi-Fi hotspots without worrying about hackers or corporations “accidentally” scooping up your personal information.

Mathematics

Computing Pi with Python

May 28, 2013

Pi is a truly magical number that has a lot of people following it. I am not quite sure what is so fascinating with an irrational number that keeps repeating forever. From my point of view, I am interested in computing Pi, that is computing the value of Pi. Since Pi is an irrational number, it goes on forever. This means that any computation of Pi is just an approximation. If you compute 100 digits, I can compute 101 digits and be more accurate. Some people have set aside super computers to try to compute the most accurate Pi to date. Some extremes include Calculating 5 Trillion Digits of Pi. You can even find online a txt file containing 1 billion digits of Pi (Be warned, it will take a while to download the file and you can not open it with your regular notepad application). For me, it is interesting how you can compute Pi with a few simple line of Python.

wpid-200px-Innovation_and_Technology_Commission.svg-2013-05-28-12-54.png

You could always use the math.pi variable. It is included in the standard library and it should be used before you try to calculate it. In fact, we are going to use it to calculate our accuracy. To get started, let us take a look at a very straight forward approach of computing Pi. As usual, I will be using Python 2.7, same ideas might apply for different version. Most of the algorithms that we are going to use are direct implementations from the Pi WikiPedia page. Let us look at the following code:


import sys
import math

def main(argv):

	if len(argv) != 1:
		sys.exit('Usage: calc_pi.py <n>')

	print '\nComputing Pi v.01\n'
	
	a = 1.0
	b = 1.0/math.sqrt(2)
	t = 1.0/4.0
	p = 1.0
		
	for i in range(int(sys.argv[1])):
		at = (a+b)/2
		bt = math.sqrt(a*b)
		tt = t - p*(a-at)**2
		pt = 2*p
		
		a = at;b = bt;t = tt;p = pt
		
	my_pi = (a+b)**2/(4*t)
	accuracy = 100*(math.pi-my_pi)/my_pi
		
	print "Pi is approximately: " + str(my_pi)
	print "Accuracy with math.pi: " + str(accuracy)
	
if __name__ == "__main__":
	main(sys.argv[1:])
		

This is a very simple script, you can download, run, modify and share it as you like. You may see an output similler to the one bellow:

wpid-simple_python_pi_calculation-2013-05-28-12-54.png
You will notice that one n is larger than 4 our approximated Pi and accuracy do not change anymore. We can only assume that the same will apply for larger values of n. So what are we to do? Lucky, there is more than one way to crack this egg. Using the Python Decimal Library we can compute Pi to a very high degree of accuracy. Let us see how the library works. The simple version is that it gives you a decimal number with more than 11 digits the normal Python float will give you. Here is an example of the Python Decimal Library:

wpid-python_decimal_example-2013-05-28-12-54.png

Look at all those digits. Wait! We only entered 3.14, why are we getting all that junk? That is memory junk. In a nut shell, Python gave you the decimal number you wanted, plus a little extra. It won’t effect any calculation as long as the precision is less than when the junk numbers begin. You can specify how many digits you want exactly by setting the getcontext().prec to the number of digits you want. Let us try it out.

wpid-python_decimal_example_6_digits-2013-05-28-12-54.png

Sweet. Now let us try to use this to see if we can get a better approximation with our previous code. Now I normally am against using from library import *, but in this case it will make the code look nicer.


import sys
import math
from decimal import *

def main(argv):

	if len(argv) != 1:
		sys.exit('Usage: calc_pi.py <n>')

	print '\nComputing Pi v.01\n'
	
	a = Decimal(1.0)
	b = Decimal(1.0/math.sqrt(2))
	t = Decimal(1.0)/Decimal(4.0)
	p = Decimal(1.0)
		
	for i in range(int(sys.argv[1])):
		at = Decimal((a+b)/2)
		bt = Decimal(math.sqrt(a*b))
		tt = Decimal(t - p*(a-at)**2)
		pt = Decimal(2*p)
		
		a = at;b = bt;t = tt;p = pt
		
	my_pi = (a+b)**2/(4*t)
	accuracy = 100*(Decimal(math.pi)-my_pi)/my_pi
		
	print "Pi is approximately: " + str(my_pi)
	print "Accuracy with math.pi: " + str(accuracy)
	
if __name__ == "__main__":
	main(sys.argv[1:])

And the output:

wpid-python_pi_accuracy-2013-05-28-12-54.png

Ok. We are more accurate, but it seems like there is some rounding off. We got the same accuracy from n=100 and from n=1,000. So now what? Well, now we come to ask for help from formulas. The way we calculated Pi until now is by summation of the parts. I found some code online from DAN on his article about Calculating Pi. He suggests we use the following 3 formulas:

Let us start with the Bailey–Borwein–Plouffe formula. It looks like this:

wpid-48f7653d58f4ad747327d271ed789415-2013-05-28-12-54.png

In code we can write it like this:


import sys
import math
from decimal import *

def bbp(n):
    pi = Decimal(0)
    k = 0
    while k &lt; n:
        pi += (Decimal(1)/(16**k))*((Decimal(4)/(8*k+1))-(Decimal(2)/(8*k+4))-(Decimal(1)/(8*k+5))-(Decimal(1)/(8*k+6)))
        k += 1
    return pi

def main(argv):

        if len(argv) != 2:
		sys.exit('Usage: BaileyBorweinPlouffe.py <prec> <n>')
		
	getcontext().prec = (int(sys.argv[1]))
	my_pi = bbp(int(sys.argv[2]))
	accuracy = 100*(Decimal(math.pi)-my_pi)/my_pi

	print "Pi is approximately " + str(my_pi)
	print "Accuracy with math.pi: " + str(accuracy)
    
if __name__ == "__main__":
	main(sys.argv[1:])

Set aside the “wrapping” code around it, the bbp(n) function is really what you want. The larger n you give it and the larger you set getcontext().prec the more accurate your calculation will be. Let us take a look at some exaction of the code:

wpid-python_BaileyBorweinPlouffe-2013-05-28-12-54.png

That is plenty of digits. As you can tell, we are not more accurate than we were before. So we need to move on to our next formula, hoping to get a better accuracy, the Bellard’s formula. It looks like this:

wpid-dbf2d4355c108f6b3388985be4976799-2013-05-28-12-54.png

We are going to only change our commutation formula, the rest of the code will remain the same. If you want you can download Bellard's formula in python. Let us take a look at bellards(n):


def bellard(n):
    pi = Decimal(0)
    k = 0
    while k &lt; n:
        pi += (Decimal(-1)**k/(1024**k))*( Decimal(256)/(10*k+1) + Decimal(1)/(10*k+9) - Decimal(64)/(10*k+3) - Decimal(32)/(4*k+1) - Decimal(4)/(10*k+5) - Decimal(4)/(10*k+7) -Decimal(1)/(4*k+3))
        k += 1
    pi = pi * 1/(2**6)
    return pi

The output:

wpid-bellards_pi_run-2013-05-28-12-54.png

Not , we get the same accuracy. Well, let us try the third formula, Chudnovsky algorithm, that looks like this:

wpid-826dc7788dba249ee86fc0135e06b035-2013-05-28-12-54.png

 

Again, let us only look at the computation formula (assume we have a factorial formula). If you want you can download Chudnovsky formula in python.

Here is the code and output:


def chudnovsky(n):
    pi = Decimal(0)
    k = 0
    while k &lt; n:
        pi += (Decimal(-1)**k)*(Decimal(factorial(6*k))/((factorial(k)**3)*(factorial(3*k)))* (13591409+545140134*k)/(640320**(3*k)))
        k += 1
    pi = pi * Decimal(10005).sqrt()/4270934400
    pi = pi**(-1)
    return pi

wpid-chudnovsky_pyhton-2013-05-28-12-54.png

So what is our conclusion? Fancy algorithms do not live up to the expectations in machine float worlds. I was really looking forward to a better accuracy than what we got when we used the summation formula. I guess that is too much to ask for. If you really need Pi, just use the math.pi variable. However, for fun and to test out how fast you computer really is, you can always try to calculate the first million digits of Pi, or maybe more...

Random

Why Switching to RackSpace Mail is Worth the $2

May 23, 2013

Some of my clients live in the dark age of fighting off email storage limits. To me this is a thing of the past. We are in the year of 2013, I can buy a 1 TB hard drive for $60 off of Amazon, having a 1GB email limit sounds absurd to me. Yet, there are many provides that take advantage of consumers who do not know any better. Begin a well informed consumer is always a benefit. I strongly advise anyone to do their own research and not relay on my words and/or opinions. Just for a quick compression, Google Gmail will give you 10+ GB for free. However, using Gmail is not always a good solution when you are a legitimate business and must maintain a professional approach. Seriously, put yourself in the shoes of your clients. If you were communicating with a sales person and got a proposal from the following 2 addresses, which are you more likely to not consider junk?

someplace@gmail.com or mike@someplace.com

It is obvious that the ladder is a better selection. You most likely already have a website for your company, if not, you should. So you have the domain name and regular email from your own hosting provide. For example, HostGator will say that you have unlimited storage. In reality, at 1 GB emails sent to your mailbox will bounce back to the sender. You could delete old email, but what if you want to keep some for archiving, marketing or even legal future usage? The answer is that you need more storage. In part, that is one of the reason I suggest to my customers to move to RackSpace for their email provider. You can still keep your domain name and hosting at different locations and just have your email service through RackSpace Email.

wpid-Rackspace_Cloud_Company_Logo_clr_300x109-2013-05-23-16-43.jpg

RackSpace offers 2 different packages, they offer regular email mailboxes for $2 per month per mailbox and for $10 they offer full exchange. This leads me to some “hidden benefits” RackSpace has. Quite often people like to use Microsoft Exchange as a way to scare people into buying equipment that can sum up to $10K and more. The truth is that if all you need is the following times, most likely RackSpace email will do the trick for you.

  • 25GB Mailbox
  • Contacts
  • Calendar
  • Tasks
  • Notes

The system will allow you to share contacts and calendar appointments as well as keep personal ones. In a nut shell, it will give you all the power of exchange without you having to worry or pay an arm and a leg. Now, Microsoft Exchange does have some more advance features. If you really need it, you could go with that option, for $10 you can have it all. If you want you can even take the system out for a RackSpace Email Test Drive. Here are some screen shoots of their system taken directly oof of RackSpace website:

wpid-email-2013-05-23-16-43.jpg

wpid-contacts-2013-05-23-16-43.jpg

wpid-calendar-2013-05-23-16-43.jpg

wpid-tasks-2013-05-23-16-43.jpg

wpid-notes-2013-05-23-16-43.jpg

I hope I at least got you thinking about your email service. Yes, you can get away with free email, but you usually get what you pay for. For my client RackSpace might work. For others it may not. We live in a “Zero Time Communication Age”. Internal and external digital communication has to be fast and reliable in order to succeeded. I feel confidante that the migration for my client will work well and that I will be able to share their experiences in the near future. If I have not convinced you yet, I suggest you start a chat with one of the RackSpace support or sale staff. They are always their to answer question and are very knowledgeable.

Infographics

Never Give Up On Your Dreams

May 13, 2013


young dreams may never die

young dreams may never die

Infographics

What you can do to avoid data loss

May 8, 2013

Backup Battalion Saves World from Intergalactic Data Disasters brought to you by OnlineBackupGeeks.com
Join the Backup Battalion today by sharing this infographic from www.OnlineBackupGeeks.com!

Cool Stuff

Coding With Your Voice Using Python and Emacs

May 5, 2013

Personal

The Code Bug That Bites

May 1, 2013

It may come as a great “shock” to most people almost every software or hardware contains “bugs” or errors. For the purpose of this paper I will focus on software, but the same ideas may apply to hardware as well. This first record of programming error is attributed to Ada Lovelace, the first computer programmer on the analytical engine. She noted that the order of cards inserted to the machine may be off and this might result in an error. In 1946, Grace Hopper encountered a malfunction that turned out to be a moth inside an early electromechanical computer that caused a literal bug in the hardware. Weather it is an actual insect or other types of error, software and hardware may malfunction and deviate from the original programmers intend. End-users encounters errors almost every day. I am sure there does not exists a user who has not come across some form of software error. Weather they acknowledged the "bug" or not, the software most certainly does. Over the past decades, numerous times developers and cooperation alike are blamed for software malefaction. The results of these bugs range from a user smacking the monitor, to lawsuits and even the cost of human life. The question that arises is who to blame? Over the past decade my view has changed on what should and shouldn't be the developers responsibility. The following is my own opinion on the matter.

Before I wrote my first “Hello World!” program, I was an end-user like many others. As an end-user, we often use the software and get annoyed when it doesn't work properly. Corporations and developers go to extreme lengths of effort to develop bug-free code. Yet many bugs are not discovered until after the official release. Updates are often issued to fix certain bugs, but many bugs remain doormat in the system. If a problem is localized to a small amount of users, it might take a while until the problem is addressed by the developers. As an end-user, we expect a perfect product. No one wants a software that contains bugs, yet every software has them. When bugs are encountered, we look for whom to blame, often the developer or the company behind the software. Corporations and developers learned long ago that in order to protect their interests, they should have a disclaimer issued with the software. Over the years, these disclaimer grew longer to protect the software issuer from all sort of liabilities. As an end-user I never (and still don't) read any part of it. We tend to just click the “I agree” button and move on. This is not a good practice, but it is more practical than reading. For example, Windows 7 Home version EULA is about 12 pages long. In addition to the length, companies typically reserve the right to change it from time to time. In some cases, users don't even see the agreement as most of the software comes pre-installed on the machine they bought or are issued by their employer.

There are many reasons as to why companies choose to hide behind long disclaimers. For one, they have enough money and they pay their lawyers good money to protect them from lawsuits. Private developers might not have the same luxury, but they also want to protect themselves just as large corporations do not wish to be liable. Sometimes, people might seek out to sue a large corporation for damages, just because of the money it might entail in the end. Other times, it might be because of an actual fatality directly from a faulty software. Software “bug bites” (that is when a bug occurs) differs and are individual per case. In some cases it is very clear where the faulty bug is, where in others it might not be so cut and dry. When “bugs bite”, people often look for whom to blame when things go wrong. Even if the user was at fault all along.

Over the past years my views on the matter have changed significantly. I used to believe that developers, individual or corporation, must be required to develop bug-free software. As I learned more about the effort it takes to produce such software (or close to). I now believe that developers cannot be liable for bugs as much I used to believe. It is improbable, if not impossible, to produces a complete bug free code. So what can we do? In my mind there are three distinct cases of buggy software that can be classified as follows:

The first case is when a bug is known to exist within before a software is released.
The second is when a bug is discovered after the initial release.
The third is when a bug becomes a feature.

The third case is the easiest to explain. Sometimes bugs are discovered to be beneficial and produce a good outcome. In such cases, the bug is often incorporated into the software and no harm is done. The first two cases are harder to examine. In the first case, a developer is directly liable, in my opinion, if they know that there is a possible issue with the software. For example, if I were to write a software for a bank, but know that there is a trap door that might grant an unauthorized user access to every bank account, I am directly liable. The reason behind it is that I know there is a problem that might cause harm, yet I have not done anything to stop it. In fact, if such a bug is exploited and bank account information is leaked, guess who will be first to have a knock on their door? In the second case, that is that a bug is discovered after the release, I believe that a developer cannot be expected to be liable. Going back to the same example, only that this time I was not aware of such bug, I cannot be expected to be liable if I did not anticipate it. I am using the word anticipate intentionally, because I believe that as with every software, it is my responsibility to check for bugs prior to the official release of the software. If I, as a developer, do not check for every reasonable scenario prior to the release, in my mind I am not doing my job correctly. This is not to say that every situation possible should or could be considered. Code is very complex and it is hard to anticipate every situation an end-user might encounter. However, there needs to be sufficient testing to an extent that the software might be used and beyond. If I am writing a program for school, program testing might be very small and limited to a sample input-output. However, if the software is to be used to monitor heart rate in an ICU, the software must be completely checked before the release, or at least it should. Doing so might not create a complete bug-free system, but will reduce the likelihood of a critical bug tremendously. Some people also suggest that testing might reduce the future upkeep cost of software, but that is an entirely different topic.

My individual opinion might be nice in theory, but in reality it fails almost every time. As time goes by, new information might be presented to me that may alter my opinion. As it stands, there are many factors to take into consideration while developing software. In many cases it is easier to write what the software cannot do, or when it might fail, than to fix the problem. In other cases, there might not be the manpower to fix the problem, or a deadline that needs to be upheld, so certain bugs are left untouched. Some developers might even hide their knowledge of a bug just to avoid the liability or the work needed to fix it. After everything is said and done, software or hardware is just another tool. An end-user should see no difference between a hammer or software. Just like a hammer might break if using it incorrectly, one should not be liable if the software or hardware was used incorrectly. Furthermore, just like there is no user disclaimer for a wrench set, there needs not be one for many, if not all, digital applications. This is not to say that if I try to use a brand new hammer and it breaks the first time I won't ask for a new one. However there are certain things that are outside of reasonable use and can not be anticipate by developers. After all, an operating system contains millions of lines of code. I doubt anyone can examine all of them and find the odd character that might cause a problem somewhere down the line.

What are your thoughts on the matter? Are developers liable for software bugs?