Self-Driving Car Is Coming

February 11, 2016

The self-driving car has had a lot of news coverage within the last year, including the incident of one of these cars getting pulled over for driving too slowly. However, as with any technological advance, there are always legal components that are holding its development back. One of these was the US National Traffic Safety Administration (or NHTSA for short).

NHTSA

Originally, the term “driver” has always referred to the person that is holding the steering wheel and pressing the pedals. In our minds, that makes perfect sense because all of our cars currently require to have someone behind the wheel “driving” the car, right? Well, with Google’s autonomous car, that all changed – the computer system is “driving” the car, not any human. This legality had to be addressed in order for Google’s autonomous car to move forward.

google_car

Well, Google managed to do just that! The NHTSA on February 4th of this year modified the term “driver” to be for the case of the autonomous car the self-driving system as the “driver”.

The NHTSA stated: “In this instance, an item of motor vehicle equipment, the Self-Driving System, is actually driving the vehicle.”

So what does this mean for Google? Well, this means that according to BBC, the autonomous cars are “one crucial step closer to being allowed on public roads”, which is quite a big step!

I am curious to see what the future holds, but if you were thinking that these cars would not be on the road in your lifetime, I would suggest thinking again. They are coming soon, and best believe when they do, they will be on the road.

Now do I want a autonomous car? Well, call me old-fashioned, but I do like driving. Heck, I would much rather drive a manual transmission car than an automatic. For the USA audiences, that may be a bit surprising to hear! At any rate though, these cars are coming, and it won’t be long before they are the most popular vehicle on the road.

That’s all for now, until next time…keep that tech gear ticking.

~Goliath7470

Mafia Games Monday (MGM) – Code Consistency

February 8, 2016

So over the years of being a developer and a game owner I have seen A LOT of different code. I know, rather shocking. I have seen code in several different languages, different architectures, and much more.

However, when I begin a project, there is one thing that I almost always see: a lack of code consistency.

What is this, you ask?

Shurg Question

Well, take for example this small block of PHP code to say “Hello ” for each user:

$con = mysqli_connect('host','db_user', 'db_pass', 'db_name') or die("Error ".mysqli_error($con));
$userq = mysqli_query($con, "SELECT * FROM users");
while($useri = mysqli_fetch_array($userq)) {
echo "Hello :" . $useri['username'] . "! <br />";
}

Now that looks pretty simple, doesn’t it? Now, take this example:
$con = mysqli_connect('host','db_user', 'db_pass', 'db_name') or die("Error ".mysqli_error($con));
$uq = mysqli_query($con, "SELECT * FROM users JOIN u_other ON users.uid = u_other.uID JOIN u_inv ON u_other.uID = u_inv.uinv_ID");
while($useri = mysqli_fetch_row($uq)) {
echo "Hello :" . $useri[1] . "! <br />";
}

Now, by looking at that code, do you know what all it’s doing? You might (so kudos to you if you do), but in actuality it is doing the exact same thing as the previous example. Now from a consistency standpoint, there’s nothing wrong with that if these were two separate applications, but if you had both of these in the same application, that wouldn’t make much sense now, would it?

That is what I mean by code consistency – ensure your structure and methods are similar (or the same) throughout the entire application.

Let’s take one more example for good measure. It will be similar code, but look at the differences between this block:

$con = mysqli_connect('host','db_user', 'db_pass', 'db_name') or die("Error ".mysqli_error($con));
$userq = mysqli_query($con, "SELECT * FROM users");
while($useri = mysqli_fetch_array($userq)) {
  if($useri['red'] <> 0) {
    $redq = mysqli_query($con, "SELECT * FROM red_stuff WHERE ruid = {$useri['uid']}");
    if(mysqli_num_rows($redq) > 0) {
      $redu = mysqli_fetch_array($redq);
      echo $useri['username'] . "'s red value is: " . $redu['redval'] . " <br /> ";
    }
    else {
      echo "Error running query for user: " . $useri['username'] . " <br />";
    }
  }
  else {
    echo "No red value for: " . $useri['username'] . " <br />";
  }
}

and this block:

$con = mysqli_connect('host','db_user', 'db_pass', 'db_name') or die("Error ".mysqli_error($con));
$userq = mysqli_query($con, "SELECT * FROM users");
while($useri = mysqli_fetch_array($userq)) {
if($useri['red'] <> 0) {
$redq = mysqli_query($con, "SELECT * FROM red_stuff WHERE ruid = {$useri['uid']}");
if(mysqli_num_rows($redq) > 0) {
$redu = mysqli_fetch_array($redq);
echo $useri['username'] . "'s red value is: " . $redu['redval'] . " <br /> ";
}
else {
echo "Error running query for user: " . $useri['username'] . " <br />";
}
}
else {
echo "No red value for: " . $useri['username'] . " <br />";
}
}

What are the differences that you saw?

Well, if you looked at it very closely, the code itself is exactly the same; however, isn’t the first example a little easier to follow? Keep this in mind when you are writing any sort of code – you want anyone that sees your code to be able to read it.

But I’m getting off-track here. What does this have to do with consistency?

Well again, if you have both of these blocks of code in your application, that’s not only a problem with duplication of code, but also with consistency. It’s difficult to read when the way that they are written are not the same!

Ok, I’m sold that consistency is important. What could I do about it? Where do I start?

Well, the best place to start is to go through the last thing that you have personally written and see what you did there. As a developer, I can tell you that my most recent work is better than my first. That’s true with any industry, really. So anyways, start from there and structure your code based off of that for the rest of your application. If you indent your code between the braces one tab length, then do that throughout – that kind of thing.

Remember – the more consistent your code base is in your application, the easier it will be to change and/or fix!

That’s all for now, until next time…keep that tech gear ticking.

~Goliath7470

Robot Wars!

February 4, 2016

So I know I have posted several different things about robots. Many of them have been for a positive cause, whether that is to help track inventory or helping deliver goods (posted on my facebook page before).

But today, what about if those robots were out to kill you?

Yes, real life Terminators are being built – many even more powerful than the drones that are performing air strikes.

A panel of experts met at the World Economic Forum in order to discuss the robotics industry, as well as the question “What If: Robots Go to War?”

If you want to watch this discussion, you can watch it here.

A main point that was brought up during the panel discussion was by Roger Carr, Chairman of BAE Systems. He said: “Lethal autonomous robots have no emotion or sense of mercy”. Sounds like a real life Terminator, doesn’t it?

The panel also “stressed the need for human operators to oversee LARs”, which again just feels like another prompt from the Terminator! If you haven’t seen any of the Terminator movies, now would be a good time to watch them to get these references…

Anyways, I’m not saying it’s time to put that tinfoil hat on your head, but maybe it’s just time to consider where the world of technology is heading, and what really should be on the forefront of our discussion of new policies.

That’s all for now, until next time…keep that tech gear ticking.

~Goliath7470

PS: Credit for this discussion goes to the following articles by CNN and TechNewsWorld.

Mafia Games Monday (MGM) – Writing SQL 103

February 1, 2016

This is my third installment of the “Writing SQL” series. If you’re curious about the other two, you can check them out here and here.

So today is time to update some data!

Consider the following scenario:

A student (ID 54356) has just recently gotten married and changed their last name to ‘Beser’. The following are the relational tables below:

STUDENT(ID, LAST_NAME, FIRST_NAME, MIDDLE_INIT, SSN, DOB)
COURSE(ID, NAME, DESCR)
STUDENT_COURSE(SID, CID, SEMESTER_VAL)

We want to keep up with what their current last name is!

This will involve some new syntax:

UPDATE: This keyword is to signify that you want to change some data on a table.
SET: This keyword is to signify which field(s) you would like to update on said table to what value.

This would be another query. Now, this is what an update query would look like:

UPDATE table
SET field = value
WHERE 1=1;

So, taking the scenario above, we can then write the following query to perform the update:

UPDATE STUDENT
SET LAST_NAME = 'Beser'
WHERE ID = 54356;

That’s the query right there! Pretty simple, isn’t it? Wait a minute though! Why did I surround “Beser” in single quotes?

There’s a pretty simple answer: “Beser” is what is called a string type. If you want to write any string within a SQL query, you have to surround it in quotes. This guarantees that the SQL engine will understand that “Beser” is in fact a string. Why single quotes though? Well, if I used double quotes, some SQL engines may not recognize it, and instead treat it like you’re attempting to label the field and/or column. Labeling will come in a later installment.

Well wait, what if this was the scenario?

A student (ID 54356) has just dropped a course (ID 589) for the current semester (SEMESTER_VAL 22015).

Keeping history aside, you just want to delete it, as they are no longer enrolled. That would involve writing a DELETE query.

Doing this will involve some new syntax:

DELETE: This keyword is to signify that you want to delete data from a table.

The syntax would look like this:

DELETE FROM table
WHERE 1=1;

So, taking the scenario above, we can then write the following query to perform the delete:

DELETE FROM STUDENT_COURSE
WHERE SID = 54356
AND CID = 589
AND SEMESTER_VAL = 22015;

Starting to look a little more advanced now, aren’t we? But that query will accomplish the job!

Tune in on my next installment for some more advanced SQL writing!

That’s all for now, until next time…keep that tech gear ticking.

~Goliath7470

Mafia Games Monday (MGM) – Documentation: Boring Yet Necessary

January 25, 2016

So as someone who is on both sides of game creation (ownership and development), it would make it easy for me to see what happens on either side (as the owner and/or client and as the developer). Yeah, I know that just sounds odd to say, but hey, that’s my current hobby life!

Anyways, have you ever received something that you just did not have the manual to? Take for example IKEA. For those of you who don’t know what IKEA is, it is a store where you can purchase furniture, cabinets, or other items that you will then have to put together. So basically, you get all of the pieces and the manual on how to put it together.

Now, just imagine that you just got the parts. No manual to speak of. You would be pretty ticked off, wouldn’t you? Would you know where to even start? Probably not. You would probably not ever get that piece of furniture together!

Now just imagine that the piece of furniture was your code, and the person trying to put it together was your client. How would you feel as the client getting code that you have no idea how it works or how it goes together? They would probably be pretty ticked off at you, especially if they had an idea of how to program!

So to avoid all of these issues, be sure to not only document your code, but also create a general document for them so that they can get an understanding of how it all works.

I will explain what this document as well as what the documentation in your code should look like on a later post.

So, just remember: documentation is important!

That’s all for now, until next time…keep that tech gear ticking.

~Goliath7470

LEGO Education?

January 21, 2016

So in case you haven’t been following my Facebook and/or Twitter recently (or just haven’t really been keeping up on tech news), the annual Consumer Electronics Show (or CES for short) was run earlier this month (January 6th-9th) in Las Vegas by the Consumer Technology Association. This show is basically a way for many tech reporters and other members of the tech industry to see what is coming in the upcoming years.

As someone who was not able to go to CES this year (I know, disappointing!), I had to rely on the tech reporters to tell me what all was there.

So I eventually stumbled across an article by MakeUseOf: “the world’s leading destination for learning more about technology and the many ways that it can improve your life.” I didn’t hear about them until now…

Anyways, the article was titled “Best of CES 2016: 6 Amazing Products That Are Coming Soon“. So I thought: ‘ok, what do they have on here that I haven’t seen on other tech sites about CES?’. Well, besides the usual VR helmet:

A laptop that requires an outside GPU box (very portable, right?), smart glasses, and a segway robot:

LEGO announced an update to what they have been working on.

LEGO, huh? We all know what LEGO blocks look like – heck, many of us grew up building our own little world with LEGOs (maybe some of you still are to this day).

Anyways, at CES this year, LEGO launched WeDo 2.0 – a way to “make science come to life”.

To get an idea of what it is, feel free to watch their promotional video below:

https://www.youtube.com/watch?v=G9e_P9PXRQk

This software will encourage elementary students to “get involved in science exploration by asking questions, analyzing data and communicating their findings”. Promoting science is something that quite frankly many people have trouble doing, so I do feel that this a great step in the right direction.

However, since this currently only targets second-fourth grade students, it is a very small market. I hope that this is a start to incorporating something like this throughout childhood education!

What are your thoughts?

That’s all for now, until next time…keep that tech gear ticking.

~Goliath7470

PS: If you want to learn more about LEGO WeDo 2.0, check out their website here: https://education.lego.com/en-us/lesi/elementary/wedo-2.

David Bowie: The Internet Visionary

January 14, 2016

So as many of you have heard, David Bowie, acclaimed song writer, producer, and actor, passed away this past Sunday (1/10) at 69 years old from liver cancer. It was something that had many people looking back on his life and his music. Heck, on SiriusXM radio, there is a whole station this week just for his music!

David Bowie was somebody who really did not let the norm hold him back from exploring unknown territory. His music was more progressive than what was current at the time. Same went for the Internet.

Wait – what does David Bowie have to do with the Internet?

Shurg Question

Have you heard something called “BowieNet”? If you have, then you probably either heard of it very recently or took a part in it. BowieNet was “an ISP offering ‘uncensored’ access to the internet attached to a dedicated David Bowie website. Subscribers could browse a vast archive of Bowie’s photographs, videos and interviews, as well as a blog, career chronology and news feed”, which was very ahead of his time. This was back in 1997 – before any major torrent sites (Napster was released in 1999) as well as before most major artists utilized the Internet for any source of communication, let alone their own ISP!

If you’re curious as to what it looked like, below is a screenshot taken from The Guardian:

With BowieNet, there were many occasions where David Bowie would be in a chat room with other fans just talking to them. How would you feel if your favorite music star was in a chat room with you talking to you? Probably much more thrilled than when the artist re-tweets your comment or favorites it!

David Bowie was ahead for his time, and he was able to spot the potential for the Internet much faster than most of us ever could. He will be missed. Hopefully someone else will be able to take his place as a visionary for the new technology ahead.

That’s all for now, until next time…keep that tech gear ticking.

~Goliath7470

Mafia Games Monday (MGM) – Balance!

January 11, 2016

We as a society in the USA are workaholics. It’s not really something that can be argued against, especially considering how little time that we get off versus other countries. Take Switzerland for example – they require at least 4 weeks of holiday (or annual/vacation) leave to be given to employees 20 years of age or older.

Just think about that – how nice would it be if your job offered you 4 weeks of annual leave with pay? Wouldn’t that be fantastic?

USA’s retirement age is also creeping up to 67 whereas other countries are on average 65 or even 63. People in the USA just work a lot!

There comes a point when you have to step back and evaluate what’s going on in your life – become self-aware of what all you’re doing. Are you enjoying your current lifestyle? Or are you working until you’re older kind of philosophy? Because quite frankly, you don’t know when your last day will be!

Now I know what you’re thinking: how does any of this relate to MGM?

Shurg Question

Well, as somebody who is on both sides of the field (game co-owner and developer) it feels like there is never enough time in the day to get everything done. You’re right, there isn’t, but don’t stress yourself out on your game! You have to step back sometimes and enjoy yourself. If you don’t do that, you will burn out, and you then will not want to work on your game anymore.

That’s all for now, until next time…keep that tech gear ticking.

~Goliath7470

Remote Control for Everything in Your House?

January 7, 2016

So you use remote controls at home for you TV, Blu-ray player, DVD player, and even VHS (for those of you who still have that laying around). There are remotes on video game consoles (the controllers) and the like.

Well what if that remote could control your lights, your thermostat, and other devices in your house?

That’s exactly what is being done!

The idea with this remote is that it will work for all devices in your home. We as a society seem to enjoy being lazy, don’t we?

A picture of one of the remotes is below:

What are your thoughts on such a remote? Do you think this will help or hurt us as a population?

That’s all for now, until next time…keep that tech gear ticking.

~Goliath7470

PS: Credit for this discussion goes to this article: http://www.cnet.com/news/someones-inventing-a-remote-control-for-everything/. Check it out for more information!

Mafia Games Monday (MGM) – Writing SQL 102

January 4, 2016

Happy new year all!

I hope everyone has enjoyed their holiday. I know I have! However, now that the holidays are over, you are probably heading back to work today, which means that you might need a small refresher in order to get back on your feet!

If you would like a refresher on SQL, the link to that is here. I would suggest reading that again before continuing on with reading if you do not really know what SQL is or how to write it.

Now since that’s out of the way, SQL is great when you want to gather data from a database. But what about putting in some new data or updating older data? For instance, consider the following scenario:

A student (ID 54356) wants to enroll in a new course (ID 589) for the upcoming semester (SEMESTER_VAL 22015). The following are the relational tables below:

STUDENT(ID, LAST_NAME, FIRST_NAME, MIDDLE_INIT, SSN, DOB)
COURSE(ID, NAME, DESCR)
STUDENT_COURSE(SID, CID, SEMESTER_VAL)

So, by enrolling in a new course, the student is adding a new course to their schedule for that term.

This will involve some new syntax:

INSERT: This keyword is to signify that you want to add new data to a table.
VALUES: This keyword is to signify what the values of the data that you would like to insert into said table.

This would be another query. Now, this is what an insert query would look like:

INSERT INTO table VALUES (data1, data2);

So, taking the example, we would want to insert a new row into the STUDENT_COURSE table. The query would look like this:

INSERT INTO STUDENT_COURSE VALUES (54356, 589, 22015);

And there you have it! You now added that course to the student’s schedule. Pretty easy, right?

However, in order to write it this way, you must have all of your data for all of your columns for that table. What if you don’t have that luxury? Well, there’s a solution for that too!

You can write your query like this:

INSERT INTO STUDENT_COURSE (SID, CID, SEMESTER_VAL) VALUES (54356, 589, 22015);

As you can see, the SID will be 54356, the CID will be 589, and SEMESTER_VAL will be 22015. Writing it this way will help you identify what data you’re putting where, which may be a great thing for you to do when you’re just starting out.

What if you want to update data? Well, you will have to wait until my next SQL tutorial, which will be pretty soon!

That’s all for now, until next time…keep that tech gear ticking.

~Goliath7470