Browsing Tag

rants

Classes

10 Lessons Needed To Learn Programming In Any Language*

October 19, 2015

Without farther delay, here is my top 10 lessons to learn programming in the order they should be taught:

  1. Environment Setup, Input/Output
  2. Integers and basic arithmetic (+,-,*,/,%) + order of operations ()
  3. Float Arithmetic
  4. Variables
  5. Booleans
  6. Conditional Statements & Control Structures
  7. Functions
  8. Strings & Arrays
  9. Classes
  10. Exceptions

Ok, I lied. A lot of these have to be broken down and cross referenced. However, I think that should be the order in which people are introduced to programming. Too often people try to learn everything all at once. You can’t learn how to swim by jumping into the deep end. Well, some of us can. Learning a new skill isn’t always as easy to other people as it was to the teacher. Whenever I get a chance to be a bookstore, I like to look at beginner programming books. They all promise to teach a lot in a very short time. The honest truth is there is no shortcut. It takes a couple of years of programming in order to become a half dissent programmer. It is not because it is hard, it is just because there are too many variables. There are so many different things that you need to learn, that it can’t occupy just one book. It can’t even occupy the whole Internet. New things come up everyday that change what you knew before. Becoming a programmer is just one of these thing that require time.

So what is with this list? I got asked too many times at this point how I started programming and where/how to start. I have decided to write my own intro to programming. Over the next weeks I will publish small lessons that will build up to an ebook on programming. I will use Python-ish style code and most of the content will be generalized for almost any language. By the end of the book, you will be able to learn the syntax to a new language and program in any language you want. Best of all, the ebook and lessons will all be posted on this site and will be FREE. No strings attached. I believe anyone can learn programming at any age and that education should be available to all.

I have taught a few students before and there are several reasons why my list is different from other learn programming classes. The main objective is to start with something familiar that everyone in the 5th grade should know. Basic arithmetic and numbers. Than slowly build up while introducing new ideas and concepts. The secondary objective is to fully learn a topic before moving forward. That means when we will talk about a new concept we will go back and see how it reflects on other topics we have learned before. We are going to aim to turn fragile knowledge into concrete building blocks that will help us move forward and ultimately complete our objectives.

It should be mentioned what this course will not achieve. Beyond all else, you will not become a certified programmer or a hacker. Like I said before, that will take time. There is no class in the universe that can teach time. After you have completed the lessons, you will have to continuously learn new skills and develop yourself as a programmer. Think about learning programming more like going to the gym. You will not get a six pack and lose 50 lbs. in one setting, it takes time. Same thing with programming. You need to invest time to become a programmer. Just like going to the gym everyday, it will pay off in the long run and you future self will look back and thank you.

There are a bunch of reasons of why you should learn programming, I don’t feel like repeating most of them. I will just mention one. Programming is everywhere and it is here to stay. Programming has become a tool that used in virtually every field, even philosophy and history. Programming is almost equivalent to using excel. It is a skill more and more employers are looking for and will make you more valuable and your job easier. There are endless examples of how programming can shorten your job and sometimes turn an impossible human task into a simple short snippet of code. I believe that if you are reading up until this point, you already have a goal to learn programming. Or maybe you have already been through a class, but feel like you have missed the points and you want to know more. In programming there is always more to learn. Remember that.

First lesson will be published within a week. Make sure to follow me on Twitter @CptDeadBones to get notified.

* Ok. So technical, the class will teach you how to program in almost any language.

Personal, Random

Top Reasons People Give Up When They Shouldn't

October 1, 2015

We all face challenges, not only in coding, but in life. There are many points I find myself almost giving up. I find myself loosing grip and almost saying “fuck it”, but i don’t. I came across this list and realized, sometimes seeing the reason why people give up can show me how I can overcome giving up. Knowing is half the battle, right?

Top Reasons People Give Up

  1. Expect Fast Results - Nothing in life come easy, today more than ever. Everyone today excepts fast turn arounds. I built a site, now where is my million visitors? Results requires hard work. Hang in long enough to see the results. Life isn’t a video game that can be finished in a day.
  2. Stop Believing in Themselves - I really think this was a top contender for number 1 on this list. I have worked with students and startups that stop believing, at the most critical point. It is easy to believe in the beginning, but as time goes through doubt comes to mind. A lot of people tell you that you are no good. That your idea is wrong. You are caving in and starting to believe them. Write things down, so when you stop believing you will have someone to make you believe.
  3. Get Stuck in the Past - Too many people are caught up in what happened in the past. What is done, is done. Life will move forward and you should too.
  4. Dwell on Mistakes - It might seem similar to number 3, but it is not. The path to success often requires failure (and experimentation). No one is perfect. Everyone makes mistakes. It is what makes us human. Hell, even my calculator is wrong sometimes.
  5. Fear The Future - The marines have a saying: “The only thing we have to fear is fear itself”. The future will come, you need to brace yourself and move forward. Things will work out and soon enough the thing you fear the most will become a thing of the past.
  6. Resist Change - I can probably go on about this forever. This is one I do to myself. Resisting change. Not going with the times. It is hard, but the world today works fast. In order to accomplish your goals and reach success, you have to adapt. We had to adapt to live on this planet, the least you can do is use your smart phone.
  7. Feel the World Owes Them Something - Another common belief this generation has. The World doesn’t owe you a thing. Get over it.
  8. Never Visualize What is Possible - Anything is possible. If one man can build Facebook and enslave the World to it, you can do anything. Visualize what you want, all of what you want. There are no limits to your imagination.
  9. Overwork - Take a brake from things. Life can’t and shouldn’t be all work. You can actually give up because you are overworked. Take a vacation once in a while. Communicate with other people. Get inspired. Then come back to work and finish what you started. It doesn’t have to be a long brake. It could be just an hour. A day trip. Something that will make you miss your work and have you come running back to finish it off.
  10. Assume their Problems are Unique - Guess what? Everyone has problems. 99% of the time, someone else had the same problem as you. No money. Lack of tools. There are allays problem. Problems are meant to be solved. Seek help. There are many online tools and forums that can help you figure out a solution to your problems.

What do you think? Are there other reasons pope give up? Post it in the comments bellow.

Random, Tech

Why the Apple Watch isn't all that Exciting to me

April 21, 2015

A couple of years ago I read a post claiming that if Apple made a toilet bowl and sold it for a ridicules price, people will line up for it. Well, Apple isn’t quite at the plumbing department as of yet, but they are a little high on power. Lets all be clear, Apple is a very successful large corporation and they dictate how the market looks these days. They have the means, a big marketing department and a huge fan base. Before 2007, the idea of a smartphone was still in the womb. Tablets weren’t popularized until the iPad came along. Now we see apple getting into the wearable computers. They will move it forward no doubt, but I am not really all that excited. We have had smart watches and similar products for a while. So this one has an apple on it and comes with the brand name. And?

File:Apple Watch Sport.jpg

When Steve Jobs introduced the iPad, he didn’t claim it will replace computers. He introduced a device that ultimately changed they way we view the web and collect data in the filed. The desktop is still the only way to enter in a large amount of data. The Apple watch is going to be a great tool to collect data on the go. It will be a notification and passive data collection tool, nothing more. For those of you that remember, it will be similar to Dick Tracy’s watch more that Inspectors Gadget’s hat. It will not be a mini iPhone or iPod, but it will have its place among your Apple devices arsenal.

File:Dt2wrr.jpg

Personally, I wish Apple didn’t get into the watch business. I get it. This is the new trend and they have to stay current. However, I really wish they stayed as an innovative company. Making new products to solve problems that we didn’t even know we had. Eventually I will come around to get myself to the Apple store and see the Apple watch in person, but it is not very high on my agenda. If I end up getting one I would get a used one after the next generation comes out. Then again, who knows? Maybe I will win one as a door prize one day. All I am saying is I am not rushing into it. Especially not with the current price tag. There are a lot more things I would rather do with $500. Like go on vacation.

What do you think?

Programming Languages, Python

A Lesson about History, Objects, Classes, Time and Python

December 3, 2014

Object Oriented Programming (OOP) became very popular in the last couple of decades. I do find that a lot of people can tell me what an Object is, but few know what is the difference between a class and Object. In fact, many use them interchangeably. So let us clear the air a bit. Here is a short nice story about the evolution of programming. Sort of.

In the dawn of programming we had variables. For a time it was good. Char, Int, Sting, Float all run along nicely. For us programmers that was not enough. We like to make life more complex than that. So we start writing code. A lot of code. Code that uses a lot of variables. As programmers, we love looking for patterns. Slowly we found one. We are writing the same code, over and over. Now, we the coders are a lazy bunch. We like to be challenged, not to write the same lines of code again and agin. So, we came up with the notion of functions. Function are in fact awesome!. for a long time, one could do anything with a few variables and functions. Not to long after, we found ourself copying entire library of functions and files were getting really big. then we came up with the idea of modules, or libraries if you will. How awesome is it to import a whole battery of functions at your finger tips? Most programmers thought this was the best thing since slice bread. Not the we were around back then. After a while, we thought, you know what, how about we put the data (variables) and the methods (functions) together (encapsulation) and use it as one thing, lets call it an object. Yay! Objects.

This of course is a very short description of what actually happy. Hopefully you go the point. So what are objects? They are instantiation (from the word instants) of Classes with particular attributes and behaviors. Attributes refer to the object variables, behaviors to it’s functions. In most cases, but not all, the behaviors involve the attributes. Classes are the code, the recipe for an Object. 1 Class can produces as many Objects as you computer memory can hold. Having the attributes and behaviors together gives a sense of encapsulation. In OOP, the Object attributes are accessed using getters and setters (Access Modifiers). Getters retrieve a copy of the attribute. Setter overwrite the attributes. Setters and Getters are behaviors that help keep the information help by the Object correct. That means that if there is and attribute of a class that has to be a number between 0 and 10. The setter will not allow any other value to be stored. OOP gives us a sense of abstraction since we normally can’t see the code, but we don’t need to. There are a couple of more terms you should hear for now, inheritance and polymorphism. Inheritance means a class can be extended by another class to enhance functionality. Polymorphism means “of many forms”. This applies to OOP since we can have man ors of a single class.

Wow that was a lot to take in all at once. It is time for an example. What better language to use then our favorite, Python. Yay.

We are going to work on a time module that could be helpful for future programs. we are going to start from our basic class, an instant. For our purposes, an instant of time is date and time up to minute accuracy. That means that we are going to write a class, in Python, for an instant. We will have a date (year, month, day) and hour (hour, minute) as our class attributes. To set this up will have to use some special syntax. It will look like this:


class Instant:

	def __init__(self,year,month,day,hour,minute):
		self.year = year
		self.month = month
		self.day = day
		self.hour = hour
		self.minute = minute

Ok. We start with the keyword class, followed by the class name. then we define a function named __init__. This is a special function called a constructor. This function has to be in every class in order to create an object. It is only called once to set the Object up. As the function arguments we pass in self and the reminder of the variables we want to pass in to set the Object up. Some leagues allow multiple constructors. Python does not. We will pass self from this point to every function in the class, so that they can have access to the Objects attributes. Note that self.year is not the same as year. Self.year is the class variable, while year is a function variable.

To use this class, or to get an object, we can use the following code:


def main():

	i = Instant(2014,12,3,2,11)
	print i

if __name__== "__main__":
	main()

If you run it, you will get something that looks like this:

wpid-instantclasspython-2014-12-3-01-39.png

That number is a memory location where our object is stored. If we crated more Object they all will have different hex memory addresses. This is useful to know but not ver particle. If we want to debug or do anything we will need to print out the individual attributes within the class. Thankfully, there is a special function we can write called a to-string. It is noted in Python __str__ and will be called when asked to print the object. For our example the code will look like this:


def __str__(self):
	return  "Year: " + str(self.year) + " " + \
	   	   "Month: " + str(self.month) + " " + \
		   "Day: " + str(self.day) + " " + \
		   "Hour: " + str(self.hour) + " " + \
		   "Minute: " + str(self.minute)

And the output (for the same main() function from before):

wpid-instantstrpython-2014-12-3-01-39.png

You could be fancy and change the function to return something else like:

wpid-instantstrpython2-2014-12-3-01-39.png

if you really want you could play around with colors and strings in Python all that you want, but that is not the point. Now we are going to add some getters and setters. Getters are easy, the just retrieve information, so a getter for year looks like this:


def getYear(self):
	return self.year

We define getters to avoid direct access to class attributes. However, if we go back to out main we can issue a command ‘print i.year’ without an error. In order to avoid that we will add 2 underscores to the attribute name in the constructor. That will make the attribute private so only within the class using self.year we can access thee variable. So our new constructor will look like this:


def __init__(self,year,month,day,hour,minute):
	self.__year = year
	self.__month = month
	self.__day = day
	self.__hour = hour
	self.__minute = minute

And our getter will look like this:


def getYear(self):
	return self.__year

And if we wanted to print just the year, we would use it like this:


i.getYear()

Ideally, we would have a getter for every attribute in the class. That is not a must, just a friendly suggestion. Now we can move to the setters. In a setter, we will put a new value in the Object attribute. We could start with a simple method like this:


def setYear(self,year):
	self.__year = year 

This would work. However, normally it is a good idea to check what the user is putting as a year. In Python, variables do not have a declared type. That means that a user can end up passing in something like a String, Boolean or another Object for all we now. In addition, even if the user entered a number, what if it is a negative number? for our purposes, we are going to say that a year must be between 1900 and 2100. So our new setter will look like this:


def setYear(self,year):
	if not ((type(year) != type(2000)) or (year < 1900) or (year > 2100)):
		self.__year = year 

If you were following along you would notice a problem. When we first set self.year we never checked that the value of year upholds the setter standards. In order to correct this we would need to modify our constructor to do the same check. This does get tricky, but it is necessary to maintain the integrity f the Object data. We will modify our constructor set year line to look now like this:


if not ((type(year) != type(2000)) or (year < 1900) or (year > 2100)): self.__year = year
else: raise Exception('Year is not in correct format or out of range')

This means that for each variable we will need to similar work an add a getter and setter. Assuming we got all this done we could move forward. There are 3 more function we will want to added to our instant class:

  1. beforeMe
  2. afterMe
  3. addToMe

The first 2 functions are booleans that take another instant and compare the 2 to see if the other instant is before the current one. Similar idea with afterMe. The method add to me, will take a quantity and add it to instant. Lets take a look at the functions beforeMe and afterMe:

def beforeMe(self,other):
	if self.__year > other.getYear():
		return False
	elif self.__year == other.getYear():
		if self.__month > other.getMonth():
			return False
		elif self.__month == other.getMonth():
			if self.__day > other.getDay():
				return False
			elif self.__day == other.getDay():
				if self.__hour > other.getHour():
					return False
				elif self.__hour == other.getHour():
					if self.__minute > other.getMinute():
						return False
	return True

def afterMe(self,other):
	return not self.beforeMe(other)

I did get a little laze. I could have re-wrttien afterMe as a reverse to beforeMe, this seemed smoother to me. This function really should be straight forward. Lets move on to the next one. In the next one, we can add X minutes to an instant. That is cool and useful because it does require a little math. Let us first take a look at how this is done:


def add(self,min):
	if type(min) != type(1): raise Exception("Invalid minutes to add")
		self.__minute += min
		if self.__minute > 60:
			self.__hour += self.__minute / 60
			self.__minute = self.__minute % 60
			if self.__hour > 24:
				self.__day += self.__hour / 24
				self.__hour = self.__hour % 24
				if self.__day > 30:
					self.__month += self.__day / 30
					self.__day = self.__day % 30
					if self.__month > 12:
						self.__year += self.__month / 12
						self.__month = self.__month % 12

Do note that at this point I am making a lot of assumptions. I did not account for leap years and odd months. This function should be re-wrriten better, but for our sake right now it serves it’s purpose. So after all this is said and done, we should end up with a very interesting class that represents and instant, or a moment if you will in time. That class could be used to create many Objects. Even objects that interact with each other since we can compare 2 instants using the beofreMe and afterMe functions. Maybe next time we can extend this class to be used for a TimePeriod and maybe even a meeting in a schedule book.

Here is a link to the complete instant class in Python in case you want to play around with it.

Advertisement, Infographics

Why Travel Should Top Your To Do List

June 6, 2014

Most people look forward to traveling to new, exciting destinations, but few realize that such adventures can also promote better physical health. Travel may even contribute to a longer life, according to the Global Coalition on Aging.

A poll by the U.S. Travel Association revealed women who vacation every six years or less had a dramatically higher risk of heart attack compared to those who vacationed at least twice a year. The men who participated in the poll and reported not making time to escape their day-to-day life at least once a year were found to have a 20 percent greater risk of early death.

Travel offers nearly endless benefits to the body and the mind

The benefits of travel don’t stop there. The Global Coalition found the majority of travelers experience a significant reduction in stress within just a day or two of their vacation, and 90 percent of travelers generally have a more positive outlook on life.

Traveling can even help create better relationships by bringing couples closer together and building memories that last a life time. If you’re single, you’ll have more opportunities to meet others while traveling. You’ll blend in better with the locals and get a better sense of the culture and what it’s like to live there, expanding your mind. Don’t put off travel just because you don’t have someone to go with; consider it a self-confidence boosting adventure.

 

shutterstock_183673352

 

Increasing your happiness level

Whether experiencing a different culture, foods, or new activities, travel also offers countless opportunities to learn something new. Any new experience can increase happiness levels. When traveling, you don’t have to look for ways to reinvent your day and break away from the mundane, it naturally happens.

Tools to make it happen

If you don’t happen to be independently wealthy, finances may be holding you back from enjoying your travel dreams. Saving for your next trip can be made much easier using Mint.com’s vacation budgeting tool to help you figure out how much money you’ll need for your vacation. It allows you to track finances on your smartphone and can even give you updates to let you know how close you are to accomplishing your goal. It also provides a projected date when you’ll be able to afford it for added motivation.

Once you arrive at your destination, the Travel Budget & Expense Tracker app for iPhone and Android helps you save money while you’re there. You can create categories and keep track of how much you’re spending, while the app does all the rest. It’s a great time saver that will also allow you to relax and enjoy your travels.

Preventing identity theft

One of the downsides to traveling is that your risk of identity theft goes up. Before heading out to your destination, it's recommended that you invest in services to protect against fraud in order to decrease your chances of having that fabulous vacation ruined before it’s even begun. If a thief steals your credit cards or other personal information, like a driver’s license, your identity could be stolen, which can be financially devastating.

When you’re out and about, be sure to take extra precautions to protect your wallet and purse. You should also be cautious with your smartphone. With so much information in one little gadget, it could also give a would-be thief access to personal and financial date in just seconds.

Personal

What is Programming?

August 30, 2013

I just got back from a month trip to Europe. As much as I wanted to stay away from computers and discussing work, I quickly found it is hard to stay away. While I was visiting family, one of the usual questions was what do I do. My normal response is that I am a computer scientist, to which almost everyone in my family responded "what?" with a wired look on their face. I quickly found that if I answer "I program computers" they understand and leave me alone. If you have taken any Computer Science class the first thing you should have been told is that "Computer Science is no more about computers than astronomy is about telescopes". That is true for the most part. Programming is an art, it is a process to create something. Computer Science is all about exploring the options, it is about algorithms, it is about problems and possible solutions. There is nothing in Computer Science that actually requires you to even know programming. One of the key faculty members at my undergraduate university did not have anything o do with programming, he did not have a degree in Computer Science, he did not even have a computer in his office. Yet, he was a Computer Science professor who teaches algorithms. It might be hard to comprehend at first, but the more you learn Computer Science, the more you discover that programming is just a tool. It is nothing but a tool.

Programmierer_binary

Everyone like tools. Tools had been used by humans for a long, long time. We even found animals that use tools to hunt a gather. So what king of tool is programming? It is a computation tool. Much like a very powerful pocket calculator. One can utilize programming to accomplish repetitive or complicated tasks that would have taken a human a long time to complete. For example I could calculate by hand the 100th prime number, or I could use python the find the nth prime number. Both will produce the same number, one will take a split second, the other might take a while longer. This example has much to do with math. There are known formulas and "shortcuts" one could use to find the solution faster, but it is still not a Computer Science problem. It is a very good beginner programming problem.

Now that we have established what a programming problem looks like, let us look at what a Computer Science problem might be. Stable Matching, or Stable Marriage is a problem many algorithm books begin with. You could look at the basic definition of the problem below:

Problem description
Given an equal number of men and women to be paired for marriage, each man ranks all the women in order of his preference and each women ranks all the men in order of her preference.

A stable set of engagements for marriage is one where no man prefers a women over the one he is engaged to, where that other woman also prefers that man over the one she is engaged to. I.e. with consulting marriages, there would be no reason for the engagements between the people to change. -- Rosetta Code

Now, how could we even begin to solve this with programming alone? Programming is nothing by giving the machine mathematical instructions. In the case of the 100th prime number, we can literally count each number and check if it is prime. How could the stable matching problem be solved with programming alone? It can't. In order to solve this problem we need an algorithm. A logical set of instructions that can provide a correct solution to this problem. A computer scientist will sit with this problem and come up with a variety of solutions, with paper and a pencil (or a whiteboard). Once a optimal solution(s) is discovered, it may or may not be actually programmed into a computer, but that is not a requirement. One a solution is found and proved to be both correct and efficient, as a computer scientist my job is done.

Now you may think that given all this Computer Science looks done on programming. I know it may sound like this, but the truth is that with programming there could not be any room for Computer Sceince. The truth is Computer Science fins ways for the future of programming. Computer Science introduces ideas that later are implemented. As a compute scientist, there is no greater joy that programming your solution and seeing the results printed out to you. It is much like Astronomers could do very little without telescopes. After all, there is a limit to what can do in the abstract world of theory, where memory never runs out and the processor is always running.

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?

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?

Personal

Captain DeadBones Manifesto

January 5, 2013

There are somethings I guess no one can explain. 20 years ago no one knew what the Internet might become. It was built a page at a time. Websites going up and down, popular and abandoned. The rate of physical and functional growth of computing and the Internet in particular is astonishing. Among other thing the Internet has made the world a much smaller place. Arming humanity with devices enable us to update the internet instantly and communicate across the global without a losing a second. The Internet provides us with the ability to create information and an infinite supply of information, but that is not knowledge and information is not always true (or valuable). Just because someone else did it on YouTube does not mean you can do it. Or maybe it does?

wpid-BlankMap-World-noborders-2013-01-5-06-41.png

One of the notable Internet trends has been in social networks. Social sharing sites are at the core of the Internet and are the most visited websites. Google+, Facebook, Tweeter, Linkedin. The list goes on and on. We have somehow grown accustom of hearing these names. We also learned to associate a different functionality with each service. One is for friends, the other for strangers. Some are for professional work other for large corporation communication. Each with their own unique traits, they still have at least one thing in common. They each enable us to share a part of our personality with others. “We all wear masks” is something everyone has to agree to at some point in their life. One does not act the same way with their friends as the act with their parents. For good or for worse, we all have an idea of what privacy means to us. Some like to share more than others, but we share based on context and who sees it, or more precise who might see it.

wpid-Social_Network-2013-01-5-06-41.png

There are many more things the Internet is good for. The 2 things that are going to stick around is memory and searching. The Internet “remembers”. Everything. I am not sure if it is a good or bad thing, but once something “goes viral”, there is no ‘taksies backsies’. Since the Internet size is enormous, search engines are the only way to find something. I remember when I had a list of website I went to each time I was looking for something. Google, Bing, DuckDuckGo, LexisNexis and other search sites allows us to sift through the ‘mist’ and locate what we are looking for. Remember this, if someone wants to know about you, they will search your name. Whether it is an employer, parent, lover, teacher, a random person, etc. They will find you, and everything you ever did or put online. Be careful, the Internet “remembers”.

wpid-searchengines-2013-01-5-06-41.png

With all this in mind, it is easy to lose where ones self begins and ends. This is why I blog. This blog gives me the ability keep a journal of me. I have come to terms long ago that there are many parts of me. This blog represent who I perceive myself to be as a scientist. It is my belief that the term scientist has been somewhat lost and replaced with ‘I googled it’. Just the other day I was talking to one of my younger professors who was telling me he wished he could Google something in their office. I told him they are working on it. To me it is sad that experimentation has been replaced with search. Innovation is turning into modification. We are falling behind. The idea of the inventor, researcher, scientist is being lost. That is what I am trying to bring back.

To not be a hypocrite, I do use Google. A lot. There is nothing wrong with looking up information. It is what you do with the information. There is a distinct difference between information and knowledge. There is also a difference between fragile knowledge and concrete knowledge. I use search result to build knowledge. To build a solution. I look for a problem. I look for things others might have missed. I look for things that might have been lost to time. I take it back to try to move forward. I am a scientist, regardless of computer. What drives me is exploration, not exploitation.

wpid-The-Scientists-Manifesto-2013-01-5-06-41.jpg

In effort to stay true to my cause, I have started this blog. Maybe I started to late. For the past 5 years I have been in a constant research. I still am. I have a ton of information that I want to explore and some free time at the moment. This blog give me a chance to try to make some order in the chaos that is in my mind. Maybe then I can see the light. There are 2 goals in my mind that make a scientist solid. The first is the ability to transpose information. The second is to convey it. This blog is to suffice the latter. I can go through information on my own in my spare time. But without a log, without a journal, what is the point. Is the journey not the best part? Is the path not more interesting than the goal? In this blog I try to describe my journey and share it so others might learn. There are many thing that bring joy to my life. Teaching others and engaging minds is one I value more the others.

Inspired by Why keep a blog?

This is the 1st version of the Captain’s Manifesto.

Computer Programming III

My first assumptions...

August 30, 2012

Making assumptions are never an easy task, yet we have to make them every day. You might not realize it, but our brain is in fact lazy and wants to take shortcuts. For example, when someone asks you what's the time you have to make an assumption of in what way to tell him the time. is it 05:30 or 17:30? is it quarter to six or five forty five? Similarly I have to make some assumptions on you are. I will try to keep this short and to the point.

NOTE: Assumption list is in randomize order.

Assumption #0: You can read and write. I know this sounds silly, but I have to make that assumption to cover my basis. As long as we mention it, I encourage you to write to me. Writing is fun, but it's nice to read your thoughts as well.

Assumption #1: You have seen programming. I don't care what language you have learned, but I assume you know the basics of programming well enough to move on. I will try to put a document together that will include what I consider basic of programming. That being said, the document will be insufficient to learn from for a new programmer. For starter guides I recommend looking elsewhere.

Assumption #2: You want to know more. What I write is one way to look at things. Everyone learns different and There is no uniform way to satisfy such needs. For that reason I want you to go out and look at other resources and find your comfort zone. I also find that most of my previous students tend to learn more when they wanted to learn more.

Assumption #3: You have Internet access. This might be trivial, but again I want to cover the basis. I will try my best to have pdf's you can download for offline usage. As a programmer, having online access is sometime beneficial.

Assumption #4: MATH. I know this is a touchy subject, but you do need understanding of discrete math and algebra. Other math might help, but the rest could be learned on the go. Your logic skills need to be in play. Again, I will get back to this, but at this point I have to assume this much from you.

Assumption #5: Hardware & Software. All you need is either your daily laptop. You could have a seprate computer, but it's an over kill at this point. I am still debating what language I will use. I have a Mac and Linux. I highly recommend using one of these options. Ubuntu is not bad, I wouldn't use the latest one, version 10 or 11 will be enough. If there is any software to install I will make note of it and update this post.

This list may be updated from time to time. Assumptions made are subject to change at anytime without notice. You have been warned. If there are any you would like to add I will advise you to email me or leave it in the comments and it will be added.