Thursday, December 12, 2013

Ubuntu: Day 2 - MySql, Python, Keyboard Only XP

Keyboard Only

Since I am working off a pc mounted to my friend's tv and didn't have access to a mouse, I tried to navigate around with just a keyboard. I was able to get around quite a bit with just the keyboard. Linux has a bunch more keyboard shortcuts which I learned quite easily, although some of them I have to consciously think about because the key patterns are different from windows.

For example, navigating webpages uses the alt plus arrow keys. You'll see me just hacking away at the backspace like your standard ID10T. Also does not help that my friend's keyboard also has foreign keys so the layout is just slightly different enough to mess with my fingers. There is an extra key between alt and space. I learned that I find the alt key by referencing the space key. Also the right shift is much smaller to fit in the up arrow which is probably the most frustrating lesson for my fingers to learn.

What I found most interesting was navigating YouTube. I cannot find a way to get the "cursor" to activate on the video. So, I cannot rewind, fastforward, stop, full-screen, and worst of all skip super long commercials. Fortunately, the video auto-starts because if it didn't I'd be stuck for a while. I was using YouTube to test the video because there is quite a bit of lag with the TV.

Disabling Screen Saver or Monitor Power Off

While watching some of the tutorials, the TV would turn off after 5 minutes of inactivity. So whenever I forgot to press a button or doing some chores while watching, the TV would just turn off. Because I am such a sucker for punishment, I wanted to just figure this out without looking online. The more I couldn't find it, the more I didn't want to look it up. I looked under power, monitor display, and even the TV menu (thinking perhaps there is off-chance that it was the TV... although it was obvious since it would say that it loses data connection). But seriously... who would look under brightness and lock? 

Installing Applications

My Ubuntu life became much easier when I familiarized myself with the Ubuntu Software Center. It works similar to the Google store. And works quite while with just the keyboard.

The first app was Chromium. A nice small lightweight application to test out the install process. I found that this is much easier tool for first-time users. After getting the hang of Linux a bit, I can see how the command prompt could be slightly faster once someone is familiar with it.

Next, I installed MySQL. I find it interesting that I say "my-S-Q-L" for MySQL when I use "sequel" for SQL. I wish I kind of knew why I do that. Anyways...

At first, I thought Linux crashed because it stayed at the same point in the install for a very long time. I am still quite not sure what happened. The PC is somewhat slow but it took a few hours. Fortunately, I was doing chores so I didn't just sit there the whole time.

After that, I installed the MySQL Workbench which appeared to be an developer environment somewhat similar to Microsoft's Management Studio. This time it installed at a much more normal rate that I expected.

I watched a couple quick tutorial while it downloaded and installed. It has some functionality similar to Management Studio like the ability to create tables and databases, but very different overall. The naming schema is not the same. The structure of schema, database, and tables are not exactly the same, but not difficult to learn.

Python

My friend was talking about how he had to learn Python to use a certain library that did what the manager needed. So, I (being the easily distracted person that I am) started to look into Python. Python is already installed in Ubuntu so that part is super easy.

You can start writing commands write in the terminal and see results of what happens. It being a scripting language and with the interpreter engine, there is no need to build a project and compile to see something happen. This is very similar to VBScript and JavaScript but even easier.

I stumbled across a tutorial on string manipulation, and I was impressed to how easy it was to manipulate a string variable. Very intuitive, simple, and still elegant to read even for someone that hasn't even written Python code before. In C# or Java, it would still be quite a bit more verbose to do the same functionality. Of course, Python may not be as perfectly efficient in execution in the highest tier of efficiency but most applications and developers do not have to think at that level anymore. I could even argue that traditional languages could be inefficient if designed incorrectly.

Conclusions

I still have a long ways to go. For some reason, work has been very busy so I have not been able to put as much time and energy into getting my Linux project going. But I have been able to put a couple hours into it so far. I hope I can at least have a simple web application up and running by next week.