Mafia Games Monday (MGM) – “A New Beginning”

April 4, 2016

So a couple of weeks ago, I mentioned about a re-design of my website (you can check the post out here if you haven’t read it yet). I call my re-design “a new beginning” (at least to me).

Why is that, you may ask?

I call it such because I am essentially re-branding my site. It is something that many companies do from time-to-time, some more so than others. Take Google for example – they have changed their Google logo a number of times.

This is from 1997:

See how big of a difference that is compared to now? It is a way to modernize your site and market itself.

However, re-branding isn’t just changing a logo around. There is much more to it than that.

There is? What could that be?

Shurg Question

What about your staff? Take this opportunity to evaluate the staff that you have: are they doing their jobs? Do you have enough staff? Do you have too much staff?

What about the features you have on your site? Are some outdated or not being used? Are some features missing that really should be there?

During a re-branding process, these are the things you should be considering on top of just the logo. This is a golden opportunity to put those thoughts into action!

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

~Goliath7470

Mafia Games Monday (MGM) – Test Your Stuff!

March 28, 2016

Things do have a tendency to repeat themselves. I feel the “full circle” effect happening from time to time, especially in the tech industry. We try our best to not repeat things (hence the DRY principle), but irregardless it happens.

One of those things that I see more often than I would like to admit is the lack of testing. Testing is something that really is difficult to get your head completely around. As a developer, the testing you are doing is to go through your code to make sure that you have implemented it properly. As a designer, the testing is to make sure that it all looks right and is appealing to the eyes. For a user, it is to simply try it out.

We tend to ignore the testing phase quite often, or simply put it on the back burner. Many things have been released to the public that quite frankly don’t work or have very noticeable issues. This isn’t just in the tech industry, either. Kanye West released an album called “The Life of Pablo”, and he has made several edits to it as it was unfinished.

For musicians, my advice to you is to finish an album before releasing it because even though people are starting to “get used to” things being released that are not “complete”, it is very frustrating to be someone that purchased an album and that album was not even done yet! Think about that for a minute – say you had a CD of an album that was released. You went to the store and bought it. Two weeks later, you go back to see that there is a “new version” of that very same album. Pretty frustrating, don’t you think? You would have to keep checking for new versions!

That is exactly what those in the tech industry should think about. Sure, in tech it is much more difficult to release something that is “bug free” (because it’s pretty much impossible to do), but at least release something that really shows what you can do. It should not be made haphazardly, as every feature or update that you make is another reason for someone to join or leave your game. You don’t want to be making a mess of your game along the way!

So with all of this, how do you go about testing?

Well, it depends on what you’re doing, but there are a number of different “tests” that you can do. Some of them are the following:

  1. Unit Testing – This testing is to test individual parts of your application (or feature, in this case). Test each part out one at a time using various scenarios for each part. These parts of your feature should be very small so that you can easily tell where something went wrong in order to fix it correctly.
  2. Black Box Testing – This type of testing is for those that have no knowledge of the back-end or logic of your application. This would essentially be a client or somebody who knows what you are trying to do with the feature.
  3. White Box Testing – This type of testing is for those that have knowledge of the back-end or logic of your application. So essentially, when the developer does tests, this is what they are doing (mostly).
  4. Integration Testing – This type of testing is to test out the links between the feature and the rest of the site to make sure that they work properly and nothing has been compromised by the new (or updated) feature.
  5. Usability Testing – This is for a group of users, usually called a “pilot”. They test out the feature to make sure that they can use it to its entirety and understand the feature. If they don’t understand it, then you can’t expect that your other users would!
  6. Acceptance Testing – This is the client (or owner) testing out something that a developer has created for them to make sure that it meets their specifications and standards. Once this acceptance testing is completed, that is usually when the “pilot” is conducted.

And there you have it. There are some tests that you should be doing in order to make sure that your feature(s), when implemented, are done properly. If you do most (not even all) of these tests, you should be in pretty good shape once that new feature hits your production (or “live”) environment.

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

~Goliath7470

Post #100 – What’s Next?

March 24, 2016

So this is my 100th blog post. I have been doing this for almost two years. That means that I have been writing blog posts twice a week for almost two years (52 * 2 = 104). I’m usually not one to go on about this kind of stuff, but 2 years of writing a technology blog with posts at least once a week has been quite a fun experience. It can get quite tiring, yes, but it’s well worth it to interact with all of you who read my work. In only two years, this blog has certainly evolved into something more than I thought I would have been able to do by myself.

At any rate, so what does this have to do with anything tech?

Well as with any technology, we are always looking forward. Looking to see what we can do to improve, to better ourselves not only in our hobbies, but as a whole. For some it could be to make their time more efficient, for others it could be to get the next gadget.

For me at this point, that means a complete re-do of my website, from top to bottom. I made this website over two years ago without the blog, and I think it’s time that it gets cleaned up with some more modern features.

The release date for this change is set to be May 1st. That will give me enough time to do a full site re-do. Most of what you see will still be there (especially this blog), but with a complete fresh look. To note, I won’t stop writing blog posts during this time – I will still be active on this blog with MGM as well as the other posts that I write.

I also will be opening myself up to new work starting May 1st, so I will do the first project that I accept for free. That means that if you have a website you want to get done or a large project that you need some help, I will help you for free. This is (obviously) a first-come, first-serve basis, so keep that in mind. You can contact me either through my website, through Facebook, or through Twitter. You can contact me now until then to fill up this time slot!

I hope to work with one of you, and I am looking forward to what the future holds – not only for this blog, but for technology as a whole.

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

~Goliath7470

Mafia Games Monday (MGM) – Writing SQL 202

March 21, 2016

Today is the intermediate tutorial on MySQL INSERT statements (hence the 202). If you need to review the previous tutorial, you can check that out here.

Last time, we did an INSERT of a single row into a table, but what if we wanted to do several?

That will involve some changing syntax. That syntax will look like this:

INSERT INTO table2 (col1, col2) 
SELECT col1, col2
FROM table1
WHERE 1=1;

Now with this, we could insert more than one row into a table at a time. This can be proven to be very useful when you have to do a bulk insert into a table.

This combines a SELECT statement in order to get 1 or more rows from table1 and then an INSERT statement to put those rows into table2. I have found this to be very useful when writing programs that will be run many times (crons mostly).

I know that this post is quite small, but next level (302) we will be going into how exactly the INSERT statement works on the database, so stay tuned!

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

~Goliath7470

New Payment Methods: The Way Of The Future?

March 10, 2016

Technology is changing much faster than we can adapt. I think that’s pretty much well-known by now, but if you’re still not convinced, need proof?

Then why not look at all of the new payment methods. We have Apple Pay, Android Pay, Samsung Pay, and now a “new” way from Google called Hands Free. There are so many ways now to pay for that cup of coffee or for your groceries.

This post isn’t about the number of ways we can pay for things because quite frankly, I don’t think that’s at all entertaining or useful as it seems like they change every week. No, this is about the adaptation of these new payment methods.

We all know that technology is faster than laws. Heck, we saw that with Drones – they were free range for years, and finally at the end of last year legislation was put in place to have them registered. But is it faster than the retailers can adapt? Heck yes, it is!

Try going to your local Cafe and try to pay for your coffee with Apple Pay, Android Pay, or Samsung Pay. You most likely could not do it. It is just something that cannot be done on your phone yet. Most retailers still only accept the credit or debit card in your wallet as the “most technologically advanced” method.

And speaking of which, the USA is still very far behind with the credit and debit cards, too! For those of you not in the USA, do you know that we are finally beginning to put microchips on our credit and debit cards? How long has it been available in your country? Years probably? Yeah, exactly – let that sink in.

Anyways, with every technological change, there is always an important thing to discuss – security. I know that this Apple VS FBI debate has really sparked the privacy debate to a whole new level, but let’s just put that aside for now. Are these new payment methods secure? Of course Apple, Google, and Samsung will say “of course!”, but I don’t know if I should just blindly follow the crowd on this one.

I think that these methods are securely “better” than our current method, especially when we swipe our credit and debit cards! If you think it’s secure, check out this excerpt from the show “Adam Ruins Everything”:

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

How long do I think it’ll take for these newer methods to be adopted? I really have no idea. I think that if public opinion is strong on using these newer payment methods, then the retail companies will adapt much faster than they are now.

Eventually, I think it would be great to not have to carry a wallet around full of plastic cards, but until such time has arrived, I’m just going to keep having to getting new cards when my CC information gets stolen (like what happened ~6 months ago). Great.

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

~Goliath7470

Mafia Games Monday (MGM) – Development Environment: Necessary?

March 7, 2016

About two months ago, I was contacted by an owner of a game and asked me to do an update to their experience system. They said it was outdated, and it did not calculate experience to what they felt was correct. Not really a difficult project, so by all means, I expressed interest and asked to take a look at what they had as well as what they wanted to accomplish.

They showed me the file that was on their game of where the experience is calculated. Ok, all makes sense, this should be fairly simple to work with. I was given a basic set of requirements that were a little vague, but with any project that’s quite usual – start with a basic set and ask questions to gather the rest. I started asking questions, got some answers, so I felt like I was ready to take it on.

Before I started doing any sort of negotiations, I asked where I would be making the changes. He said “on the game”, referencing the live version of his site (or production).

Now this is starting to scare me.

Working on a core algorithm on a live site? No, no, a thousand times no.

It brought back memories of in the past when I owned my very first game and only had one site. I had to make changes to an algorithm in the “core”, and making that change cost me a couple hours of the site being down because I messed it up. It also brought up a golden rule for my development: Never develop in production. You never know what your change will cause.

I brought this up with him, mentioning that I cannot and will not be making that kind of change on a live site. He tried to negotiate with me, but my mind was made up about doing this on the live version of his site. He eventually gave up, didn’t even bother to ask me about setting up a “beta” or “development” site, and I have not heard from him since.

What was the point of this whole story? You should have a development version of your site, no matter how big or small it is. You do not want to make changes directly on the live version of your site because you really do not know what your change will do. You may think you know, but believe me, it is much more difficult to actually know rather than be “pretty sure”. A “pretty sure” that causes the live version of a site to go down will not look good, and your users will not be happy.

Now you may be looking at me, saying “Why didn’t you just set up your own development environment”? Good question – and in this case, to answer your question, I couldn’t without access to everything, which I could not get. Not only that, but if anything else was changed on his live site (which that’s where he was making all of his changes at), it could impact my changes! You never know what changes could impact something else!

So, create a development version! It is not that difficult – use a sub-domain, or have a whole different area for it. If you are unsure about how to create one, ask! You do not want your whole site (or even a portion of it) to completely stop working all because you could not be bothered to make the change in a development version first.

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

~Goliath7470

Helping Blind People See?

March 3, 2016

So we know that that the technology pertaining to your eyes has been quite popular, such as Google Glass, Oculus Rift, and many other VR headsets. I have been following these things as they improve, but I just haven’t seen something yet in this realm which has engaged me to actually buy into it. It still feels like we’re partially back in the days of Virtual Boy, which was in the 80s!

However, this week, I stumbled across a CNN article which has really caught my attention.

A company called Second Sight Medical Products is developing a set that looks like glasses to help those that have an extremely hard time seeing (or can’t see at all) to be able to “detect shapes and pick up contrast between light and dark”. So essentially, it’s helping those of which that are blind to actually see again. They certainly won’t be able to see a lot right now, but it’s certainly much more improved than what it is blind.

Now this is something that I would call a breakthrough in technology. If this continues to be improved and refined, one day this could very well be a way for someone to completely see again!

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

~Goliath7470

Mafia Games Monday (MGM) – Writing SQL 201

February 29, 2016

Today is the intermediate tutorial on MySQL SELECT statements (hence the 201). If you need to review the previous tutorial, you can check that out here.

So take for example, we have the following relational tables below:

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


What if we wanted to get the course name, course description, student name, the most recent time the student took that course, and the grade for student ID 54356 and course ID 444?
This information would be useful for an office to get an understanding of whether or not a student took the course more than once, or what they got in that course at that point in time.

Doing this will utilize what’s called a sub-query or nested query. That is essentially a query that when run returns a result that is then used in the parent query to meet a condition.

The syntax looks like this:

SELECT data
FROM table
WHERE data1 = (SELECT data2
FROM table2
WHERE 1=1);

The SELECT statement that is within the parentheses is known as the sub-query.

Now how does this apply to the scenario above? Well, since we cannot guarantee that a student did not take a course more than once, we will have to get the last time the student took the course. Assuming that the SEMESTER_VAL value increases as the year goes further into the future and, we can write something like this:

SELECT NAME, DESCR, LAST_NAME, FIRST_NAME, MIDDLE_INIT, SEMESTER_VAL
FROM STUDENT_COURSE JOIN COURSE ON CID = ID JOIN STUDENT ON SID = ID
WHERE SEMESTER_VAL = (
SELECT SEMESTER_VAL
FROM STUDENT_COURSE
WHERE SID = SID
AND CID = CID)
AND SID = 54356
AND CID = 444;

Would this query work? Not as it’s currently written, no. There are a few things that we will have to do in order to make this query work.

We will have to use an alias. An alias is another way to identify the table so that the SQL engine knows how to properly run this query. Using aliases is a good practice to get into, especially when you are writing queries that use multiple tables. So, taking this scenario for example, we can then rewrite the query like this:

SELECT C.NAME, C.DESCR, S.LAST_NAME, S.FIRST_NAME, S.MIDDLE_INIT, SC.SEMESTER_VAL
FROM STUDENT_COURSE SC JOIN COURSE C ON SC.CID = C.ID JOIN STUDENT S ON SC.SID = S.ID
WHERE SC.SEMESTER_VAL = (
SELECT SC2.SEMESTER_VAL
FROM STUDENT_COURSE SC2
WHERE SC2.SID = SC.SID
AND SC2.CID = SC.CID)
AND SC.SID = 54356
AND SC.CID = 444;

Now will the query work? Well, no, because if the student took the course multiple times, that sub-query will return more than one row, which will cause this query to error out. This will require an aggregate function. An aggregate function is a way to perform some mathematical calculation on the value in the select statement before the result is returned. There are several aggregate functions, but today we will be using the MAX() function.

The MAX() function will allow us to get the maximum value for the column that is in the parentheses. So for example, if we did MAX(SID), we would get the largest student ID.

For the query above, we will have to use this function as such below:

SELECT C.NAME, C.DESCR, S.LAST_NAME, S.FIRST_NAME, S.MIDDLE_INIT, SC.SEMESTER_VAL
FROM STUDENT_COURSE SC JOIN COURSE C ON SC.CID = C.ID JOIN STUDENT S ON SC.SID = S.ID
WHERE SC.SEMESTER_VAL = (
SELECT MAX(SC2.SEMESTER_VAL)
FROM STUDENT_COURSE SC2
WHERE SC2.SID = SC.SID
AND SC2.CID = SC.CID)
AND SC.SID = 54356
AND SC.CID = 444;

And there you have it!

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

~Goliath7470

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

February 22, 2016

So a few weeks ago I posted a post titled “Documentation: Boring Yet Necessary“. If you haven’t read this post, read it before continuing on with this post so that I don’t have to re-explain what I already have explained. Done? Awesome. Let’s continue!

So what should this code documentation look like? Well, it really all depends upon personal preference, but here are some tips on what you should be doing in your code:

  1. Have a documentation block at the top of every file – This is a good practice to have. Basically, this documentation should include your name, the file name, the creation date, and a basic description of the file. A sample of this is below:
    /**
    Author:       G7470
    Filename:     build.php
    Date Created: 02/15/2016
    Description:  This file allows a user to build a new building, which will allow them to collect some valuables.
    **/
  2. Document each function or method – If you are creating a function and/or a class method to handle a particular “function”, that should be documented with what that function does, what is needed to run the function or method, and what is returned from that function or method. A sample of this is below:
    /**
    Name: get_user_level
    Parameters:
    $userid - integer - The user's ID
    Return:
    $level - integer - The user's level
    Description: This function given the user's ID will calculate their level and return this value.
    **/
    function get_user_level($userid) { 
  3. Document any other ambiguous code – Any other code that is a pretty large block should be documented, including large if statements, for loops, while loops, switch statements, etc. A sample of this is below:
    /** For each user, add 50 points to their account **/
    while($useri = $db->fetch_row($uq)) { 

Get the idea now? Essentially, the main idea of doing such documentation is to provide anybody reading your code with some understanding of how it all comes together. Without that, your code appears to be messier than it really is, and anybody reading it will be clueless as to what they need to do.

What about general documentation though? Well, again, it depends on what you feel is best to provide for the user, but my suggestion is to provide the five basic areas for each “module” or “feature”:

  1. Functional Overview – The basic idea of what the “module” or “feature” will be doing for your site.
  2. Updated/New Files – This can provide the reader of where the code for that “module” or “feature” is located.
  3. Technical Details – Any specific technical details, like for example if the user must have x amount of coins to do something, that’s something to note here.
  4. Database Information – Any database tables that were updated or new should go here.
  5. Other – Any other information of importance should go here.

With that, I’ll use your imagination as to what this document should look like. My suggestion would be to make this document as formal as possible. If you create one-off documents that are difficult to read and/or follow, then there’s no point in providing the documentation at all!

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

~Goliath7470

Apple Versus The FBI: Is Privacy At Stake?

February 18, 2016

Privacy has certainly been a big issue since the creation of the Internet, and especially within the past few years, with the Patriot Act certainly at the forefront of this discussion. Well, that issue of privacy has come up again, but this time, it is from the FBI.

The FBI has asked Apple to essentially unlock the iPhone used by Syed Rizwan Farook, who was one of the shooters at San Bernardino massacre a few months ago. If you don’t know about that massacre, look it up, although the only relativity it has to this post is that it was a mass shooting.

Apple has placed encryption on the iPhone, and a feature that if attempts to unlock the iPhone fail 10 times, any data on the iPhone is wiped. The FBI obviously would not want this to happen, so they are asking Apple to either unlock the iPhone completely or remove this feature from this phone so that they can use brute force to unlock it.

What do you think Apple would do in this situation? Probably go ahead and comply one way or another, right?

No, they refuse to do it.

Talks between Apple and the FBI got so heated that they ceased completely, and this caused the Justice Department to file a court order to either remove the feature or unlock the phone.

Apple is going to appeal this court order.

According to Apple, “the software the F.B.I. wants it to create does not exist” and that doing so would “create a ‘backdoor’ to get around its own safeguards”. They wrote a 1,100-word letter to Apple customers about this, which you can check out here.

As someone in the tech industry, I can see both sides to this argument; however, I would be very surprised if Apple actually wins this case. As mentioned on the New York Times article by Ira Rubinstein, a senior at the New York University Information Law Institute, “this was a fight that was inevitable”, and I do agree with that. With all of the privacy concerns that have been stemming in recent years, I am not surprised whatsoever that something like this has come to the forefront. Apple can make this software, and with that phone unlocked, it could lead to a crackdown on anyone involved in the San Bernardino shooting, but I can see why Apple would not want to do this.

Now, all we can do is sit tight and see what the verdict is.

What do you think will happen? Do you believe that this is a breach of privacy?

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

~Goliath7470