Brandons Bytes

Feed Rss

Happy New Years, Everyone!

Anyways, I figured I would do a blog post before I went back to school on Monday.  The courses  I am enrolled in to take this semester are:

  • Operating Systems
  • Computer Forensics
  • Programming Language Concepts
  • Calculus-Based Physics I

Most of the time I would talk about the above courses but I think I will reserve that for another time.  It has become clear to me that the path I am on is going to be a long, harsh but ultimately beneficial for myself.  As I sit here and write this blog post, I am thinking about numerous things like trying to find a research topic for an undergraduate C.S. research project and starting to study for the GRE (Graduate Reentrance Exam) in addition to starting to look at and gather the documentation needed to apply to a Ph.D. program.  Oh and I am starting a new tutoring job at Southern Polytechnic State University which means I will no longer be an employee of Georgia Perimeter College.

Overall, everything (I think) is going well but things in certain areas could be better.  My stress level is fairly high but that’s pretty normal for an undergraduate, I think.  Since the New Year, I’ve been thinking about things I need to improve on, things I need to cut back on and things that I need or want to keep around.

Sometimes, it makes me think of the “Justified” (great TV show, by the way) opening song (which can be found at http://www.youtube.com/watch?v=yT2i2UylxJ0)

Well, until next time and I hope I will be able to write another blog post in the coming weeks to update you on my classes.

It’s been a while since i’ve posted here but I thought i’d give it a try again.  This semester I am getting to take one of the more interesting courses for my CS curriculum: Data Structures.  The first few weeks were C++ basics (pointers, etc.) and simple data structures such as arrays and vectors.  For the most part, I’ve been fine with C++ and been okay adjusting to it, though there have been a few issues that I’ve managed to correct along the way.  One of the most irritating facts is my lab 3.  Now this wasn’t a hard lab by any means but a few things have happened:

  1. I’ve learned that my teacher gave us the code for the methods: pop and top.  These weren’t hard methods by any means but I finished the lab before day of the lab so it kind of made my work seem pointless.
  2. I received a 17/20 on the lab and received feedback on the issues (more on this in just a second

Sigh, a 17/20 is an 85 but I feel like that isn’t good enough.  After viewing the comments left on the programming, it left me absolutely livid.  Why? because the comment was wrong and the things that were said in the comment was absolutely incorrect and no way of happening.  I now have to go and deal with this crap with my professor.. sigh.

Against my better judgement, I am going to post the comment left and I am going to explain why this is incorrect by showing portions of my code: “You’re unnecessarily expanding the size of the stack every time you pop an element.  The idea behind resizing the stack is that, because it’s slow, we only do it when we have to – and expand it to double the size so that it’ll be a while before we have to do so again.  In addition to being slow, increasing the size of the stack each time you *remove* and element means the stack will eventually be using up a lot of memory it doesn’t need.  I.E. If it starts off as 5, and you pop 3 elements, your stack will now be 26 elements long.”

 

Okay, a few points to be made here:

  1. He has a point — resizing a vector takes up precious CPU cycles
  2. My pop() method does NOT expand the size of the vector (as you will see in just a moment) but instead reduces the size to help keep down the memory usage.  (This is a perfect example of the Time-Space tradeoff)
  3. Using my method, starting with 5 elements and popping 3 off leaves you with a stack size 2 and a total capacity of 4 — not the crazy 26 elements long as he so claims (we’re going to see the code for it in just a second)

My pop:

pop

 

Let’s break this down:

  • if the size of the stack is 0 — do nothing (this is per the instructions but in a real-world scenario, you’d want to throw an exception and handle it gracefully)
  • we create a new Integer variable that is unsigned (basically — this is to potentially prevent any negative numbers) which is equal to size() – 1.  We do size() – 1 because we want the 2nd element in the stack (since this is a vector implementation, it’d be the 2nd to last in the vector)
  • we reset the capacity to newSize * 2 (For example: if we had 5 elements and popped 3, it’d leave us with 2 * 2 which gives us 4)
  • We create a generic vector with the new capacity
  • We then iterate through the array and place the data from the original values vector into the temp
  • We free up the memory used by values to prevent any issues
  • We point _values at temp (since arrays/vectors can be treated as pointers in C++)
  • At this time, we set the size of the Stack to the new size (For instance, if we pop 1 element off of a 5 element stack the new size is 4)

push2

 

 

This one is a little bit more complicated since my pop will allow the stack to go down to 0, we need to handle that correctly:

  • Check to see if the size of the stack is equal to the capacity
    1) If it is:
    1) if size and capacity are equal to 0, delete _values to free up the memory, and reset it to the default of 5 element capacity with a size of 0
    2) If size and capacity aren’t equal to 0, grow the stack to a new size in order to accommodate the new values
  • Finally, insert the values into the stack
  • Increase the size of the stack

My tester file:

 

testerfile

The output to that tester file: (As you can see, it’s nowhere near the 26 that was claimed in the comment)

Runtime

 

To be honest, I am not really pissed about it as much as I was when I first discovered this since I know it was probably an honest mistake but still, people need to be more careful when grading assignments.  In addition, blogging about it helped to let off some steam about it and lets you all have a view into the life of a C.S.

Anywho, my teacher is awesome and the TA is nice enough so I’m fairly sure I’ll get the 3 points back.

On a much better note, we started Big-O notation this week and I have a much clearer understanding of it now than I did when I was doing CSCI 1302.  I now understand really how important it is and how it affects algorithms.

Here’s an example of some of the notes I took:

BigO

 

Oh, and since I’ve started C++ I’ve been using the pre increment versus post as I’ve been told it is faster than using post.

Ah, this is my first semester back to school in a year and what can i say?  Some things have gone undoubtedly smoothly and others not so much.  More recently though are issues relating to my Technical Writing class, which is an absolute blast thanks to my teacher who I will be recommending to other students entering SPSU.  I really, really hate group projects at times because well people will do things to make my life (and others lives) miserable.  For example, we have project #3 due this week and two of my members have gone MIA.  Thankfully, me and the 2 others in the group are going to be able to pull it together and get it turned in on time.  This brings me to the real reason I am writing this blog post tonight.

I realized today after emailing my teacher about what I should do and the response was as follows (paraphrased): “Have they done any work?  If this was real life, somebody would be fired.  It’s not your fault, and you can’t–and shouldn’t–save them. They are all adults, they know the consequences.”  This is the absolute truth but it doesn’t mean that I don’t at least somewhat feel bad for basically tossing them out on their ass.  This project is worth 30% of their grade; a zero with this means they ARE retaking the class because there is NO way to bring back their grade from this absolute devastation.  Now, I joke around a lot with things like putting students through hell, etc. but at the end of the day I won’t ever turn down a student (unless they’ve done something really horrible to me) who asks for help.  If these two students were to just at least contact me and talk to me about what’s going on, i’d be more sympathetic but no emails, no responses so I can’t really help them.  Do i feel bad that I am about to completely destroy and ruin someones grade? Yes but in the grand scheme of things it’s their fault as we are all responsible for our own destinies.

One of my professors (who is now also a good friend and colleague) gave me this advice when I neared my Calculus 2 final with Dr. Walls (great teacher, by the way if you are taking Calc at GPC Dunwoody): “If you are going through hell, keep going.” -Winston Churchill

I believe that this quote applies here: it’s hard to kind of straight out screw a student like this but then again I don’t want them getting a grade they didn’t fairly earn.

I think that’s about it for now.  I can say this: I will be finding a DD and taking a visit to Czar’s Ice Bar after the end of my finals — Anyone want to go?

So, i started school last Wednesday and so far i like all my classes except for my Intro. to Software Engineering.  Now, don’t get me wrong it isn’t a BAD class but it’s also not nearly as exciting as my Discrete, Stats, and even my Technical Writing classes are.  I have a friend who said he took the class and to this day, still doesn’t really know what it was about.  That’s a bit much to believe because I think I know what the class is about and that is not physical software engineering but the political process used by management and to an extent the actual software engineers themselves to take a project from concept to public release.  I can say this for sure: it won’t be an exciting class but it will be a great opportunity for me to learn about the other stuff (other then just straight out coding) that comes with Software Engineering (even though i am CS not SWE).  Another tidbit of exciting news is that i was gifted an ebook by a friend called “Effective Programming: More than Writing Code.”  I have to say that this is a very appropriate time to gift me this book: Why? because it fits right along with Introduction to Software Engineering and Technical Writing.  I have gotten through the first chapter and a half and I must say: this should be a must read for all Computer Science and Software Engineering majors (and minors).  In the book, the guy makes the point that in order to be a better programmer, we must be able to hand off our code to someone else who replaces us after we leave for whatever reason.  I entirely agree with this opinion, because without comments and proper documentation of how our software works it is virtually useless.  Anyways, i’ll talk more about the book in a later post because I want to talk more about my classes.

I am absolutely loving my Discrete Mathematics class as it is quite interesting and so far I am able to relate a lot of it to programming helping me understand the concepts better as well as how programming (and really the logic of computers) work.  As for my Technical Writing class, I am pleased to say that the teacher is quite technical in the fact that she recognizes that Blackboards’ WebCT Vista is a piece of crap; however the replacement she found for WebCT (which i will withhold the name) is actually worse then WebCT.  I have run into numerous issues that should have NEVER allowed it to roll out to the public in its current state.  Not only those technical issues (which are highly annoying and make the user experience bad), there are also privacy issues at hand like allowing you to login with your Facebook login.  There are pluses to this new LCMS like how it takes a “Facebook style” feed and puts it into the UI (quite nicely, i might add).  I believe that if that feature were implemented into other LCMS in a sensible way, it could bring about a new way of online learning and make the experience of taking an online class feel more “real.”  There is only so much you can do when the only way to contact someone is through an email or forum type of system and it kind of takes away from the learning experience.  Anyways enough about the LCMS and on to the class i have yet to talk about: Introduction to Probability and Statistics.  I’ll be honest this is a pretty straight forward class and doesn’t seem too difficult at this point.

One last story to tell before I run off to Intro. to SWE: I was sitting in the CS/SWE labs (using a Mac — yes hell has frozen over.. again) and one of the higher ups walks into another’s office and the first thing out of the persons mouth is “Microsoft sucks.”  In addition, there is a pirate flag hanging up in the office where this conversation took place.  I have to say: I love Southern Polytechnic State University.

Well, that’s it for now and I am off to Introduction to Software Engineering as my last class of the day.  Hope everyone has a good first week back!

Today was supposed to be a momentous moment as the last Batman movie by Christopher Nolan was released.  Unfortunately, today will be marked by the bloodshed of a mad man who went into a theater and shot 58 people; 12 of whom were taken from their families without provocation or cause.  I want everyone who reads this to take a second and say a prayer for the families who affected by the horrendous crime.  In addition, I have to something to say to the shooter:

Burn in hell

I wish everyone who is recovering from this a speedy recovery and hopefully we will have some answers as to why this guy did what he did.

(Found this on tumblr)

I figured i’d take the opportunity to talk about what is in Android 4.1 and one of the coolest things (other then the Notification Bar) is something called Google Now.  When this was first announced at Google I/O 2012, i was like “woah, that’s going to be interesting.”  I was right; i finally gave in and unlocked my bootloader as well as rooted my phone and flashed the Jellybean 4.1 and then a few days later, the Jellybean 4.1.1 rom.  Over the past few days, i have been mostly playing with Google Now or a game called Dead Trigger (more on that later).  Anyways, what Google Now is a interface between the voice search on Android phones (which i believe have been vastly improved but i can’t prove this to be sure since i almost never used voice search but now i am) and Google’s products.  It has the ability to link into Google Maps and tell you how far you are from home / work, tell you the time it will take you to cover that distance and how much traffic there is.  It then has the ability to link into Google Search and bring back results like never before (as we are about to see).  Anyways, onto the good stuff.  First, i’ll show you the sample cards that come with Google Now/voice search:

Now, for the next few screens i am going to show some of the cards actually in action and me playing around with it:

This one was actually shown off at Google I/O. I probably should’ve used something else, but ..

Randomly picked a Delta airlines flight and this is what it gave me

This was one of my “accidental” finds, i guess. I tried using voice search to search for the ingredients in a Margarita and instead it tells me where to find one

Telling me how far i am away from home

I used the voice search to search for pictures of Kristen Bell. It presented itself to me in a nice box instead of the search

(As if i didn’t already know this but i figured i’d ask Google to see what would happen): I asked the voice search when the release date was for the Dark Knight Rises and it gave me this plus said it out loud on my speaker

I also asked it what the rating was for the dark knight rises and again, it gave it to me in a nice box and said it out loud

Now another cool thing about Google is the fact that they have a free Navigation program that is tightly integrated into Google Maps, so this is what happens when you ask Google Now to find you a certain place, etc:

The cool thing about this is if you only have one result, it will automatically start getting the directions for you and automatically send it to Google Maps. From there, you can activate the Google Maps Navigation app.

Well, i think that wraps up my kind of overview of Google Now.  I am pretty sure all of you on my Facebook are sick of seeing pictures of it and hearing me talk about it but this goes over it more in detail, i hope.  I also hope you now understand why i am so excited about Jellybean and this feature in particular.  I think in the next blog post, i will show off a few of the other things about Android 4.1 with a focus on the awesome notification bar that Google introduced.

Anyways, for those of you wondering about the phone i used for this awesome display: it is a Samsung Galaxy Nexus (Toro (Verizon Wireless)) with an unlocked boot loader and rooted on the Vicious Jelly Bean 4.1 Toro rom.  Hope you’ve enjoyed this!

My phone

We continue on our journey with more of the tools that are used to make a Drinqer release.  I am hoping to finish up the tools portion with this blog post, and get started with more of the meat of this blog series.  Let’s start off with some of the text editing tools that i use.

Evernote:

Like Pencil, i have just very recently began to use Evernote to sync my to do lists, and bug reports across multiple pcs.  This is a very useful program as i can access any of my notes wherever i am.  I also use it for other things such as making notes about DB table schemas.  I am going to show a screenshot of what i am talking about in hopes that you get the idea.

You can see how this would be a very big help to me, as i can write short hand notes and check off issues when they are fixed.  Not everything goes into Evernote, but a lot of things do.

Notepad++:

I don’t really have much to say about this, except that i really only use it when i need to make small changes to a file and don’t want to open Aptana Studio.

Aptana Studio 3:

Now this program is probably just as important as Eclipse is (and Aptana is based off of Eclipse).  Aptana allows me to manage and update the server side software that powers Drinqer.  The screenshot below shows the basic outline of Aptana.

Microsoft WFetch 1.4:

Not going to say much about this, except that it helps test the server software in a way not normally possible.  There won’t be much more said about this, and no screenshot will be included.

WordPress / XAMPP / PHPMyAdmin:

Now, the next pieces of software all work in conjunction with each other really.  WordPress is somewhat the backbone of Drinqer as it is a WordPress plugin that provides most of it.  There are a few other custom written scripts that work outside of WordPress but are still built side by side with the plugin.  As well, for the MySQL stuff i use PHPMyAdmin to design my tables that get integrated with the WordPress plugin.

  

These two shots show phpmyadmin and the general layout of my internal build WordPress build.  I’d like to mention something about the WordPress version that i am running: it is a CUSTOM build of WordPress.  I had to actually modify my WP software to support Drinqer in a way which affects v1.13 and onwards.  Unfortunately, with this change i have lost the ability to just “upgrade” WP freely and will add yet ANOTHER layer of testing and development.

SQLiteAdmin:

SQLiteAdmin acts just like PHPMyAdmin and therefore i am not really going to say much about this nor show a screenshot (i am being a bit lazy).

Anyways, this wraps up the section on the software used to manage and build a single version of Drinqer.  In the next section of this series, i will be getting deeper into the development process and start showing the internals of Drinqer.

Enjoy!

Now since we’ve officially kicked this blog series off with a generalized overview and the hardware that is used to build Drinqer (and lots of other apps); we are going to look at the tools used in the production of the software.  Obviously, one of the major components of building it is the operating system because let’s face it, without the OS all a computer does is light up so we are going to skip the OS because that’s already been discussed.  So, let’s first take an inventory of all the software that is used in the production of Drinqer:

  • Eclipse 3.7.2 (Indigo) / Javadoc
  • Aptana Studio 3
  • Evernote
  • Android SDK (Android Software Development Kit) and AVD (Android Virtual Device)
  • Drinqer Internal Build Tools
  • Microsoft WFetch 1.4
  • Google Drive
  • XAMPP
    • PHPMyAdmin
  • Pencil
  • SQLiteAdmin
  • Notepad++
  • Wolfram Mathematica 8

Now, this is a list of software that is generally used to build Drinqer.  Each application carries its own weight, and serves a specific purpose.  Since this is such a long list of applications, i will be breaking this up into several smaller blog posts.  So let’s start off with Eclipse, Android SDK/AVD, the Drinqer Internal Build Tools/Wolfram Mathematica 8 and Pencil.

 

Eclipse:

This is somewhat what I see when I open Eclipse, except that i usually have files open.  This is the basic layout of Eclipse.  Now, we are going to see a lot more shots of Eclipse later on.  You can already see some of the files such as CHANGELOG and AndroidManifest.xml.  There is one major problem with Eclipse, however: it’s a major ram and cpu hog due to the auto completion among other things.

Android SDK/AVD:

What these tools allow (and there are some you can’t see, such as ADB) is to manage emulated versions of the Android operating system and to allow you to update and install all of the packages needed to build an Android application.  Other than that, there’s really not much to this but I figured it was important enough to show you some of the things I deal with.  You will also notice on the AVD that i haven’t added a Gingerbread image yet; that is coming very shortly.

Drinqer Internal Build Tools / Wolfram Mathematica 8:

These are specially built scripts that run in command prompt that give me access to install and uninstall builds of Drinqer from my phone/emulator as well as generate checksums to ensure the integrity of the APK files.  You will also notice that there is a Java program called BACTester; this program allows me to test the BAC formula (it’s still being tweaked) in a “real world” scenario without actually using my application in order to debug.  There is also another tool called BAC Formula, and it is an internal script designed to test the actual math of the algorithm:

(It seems I have also made an error in the instructions; it should also have “and hit Shift-Enter” at the end of it)

Pencil:

This is a new program that I have just recently discovered.  What this program does is allow me to draw out layouts before I start implementing them in my program; this is awesome because it allows me to have a hard copy of what I’m seeing or wanting out of  the layout as well as having a “hard copy.”

This is what the concept for the “Browse” function looked like in Pencil:

Well, that’s it for now.  In the next blog post, we will cover tools part 2 which will include Aptana Studio 3, XAMPP, SQLiteAdmin and WFetch.

I decided I wanted to kind of do a fun blog post (for me) and for everyone interested in what it takes to really build an android app with a focus on how I go from alpha 1 to final release candidate (what actually hits the Google Play Market).  In these next few blog posts, I am going to detail what tools i use (including some custom built tools), the specs of my computers, and the inner workings of an android app (including how some of Drinqer works).  This will be the first blog post of a series, and i hope everyone enjoys this. So, we’ll get this started by going over the physical hardware that powers and builds Drinqer.

The APK file (Android Package file or in more user-friendly terms: install file) is actually built using one of two computers (depending on where I am at):

My desktop (specs as follows):

  • 3.1 GHz Intel Core i5-2400
  • Windows 7 Ultimate 64-bit
  • 8 gigs of G. Skill Jigsaw DDR3
  • 1 terabyte of hard drive space
  • MSi NVidia 560 GTX-Ti – 2gig model

My laptop (specs as follows):

  • 2 ghz Intel Celeron
  • 2 gigs of ram
  • Windows 7 Home Premium 64-bit
  • 250gigs of hard drive space
For testing the application internally: i use an Android Virtual Machine running Android 4.0.2 (Ice Cream Sandwich), (soon) Android 2.3.5 (Gingerbread) and a Verizon Wireless Samsung Galaxy Nexus on Android 4.0.4 IMM76K build.

Obviously, there is a big difference between the two machines but they both get the job done even if one is slower than the other.  However, there is another aspect of Drinqer — the server side of the application which actually serves the content.  On this subject, I am not going into detail as how everything is setup (that’s a rather big security issue) but the machines that serve the content are very much capable of doing so.

I believe I will save the tools I use for the next blog post, but until then enjoy this nice little snippet and the beginning of a series of blog posts.

Oh, one more thing: 6 / 19 / 2011 is the day Drinqer (originally known as Calorie Inquiry) went live on the Google Play Market (originally, Google Market).  It will mark one year of development.

Well, it’s been a while since I’ve blogged but I figured I’d go ahead and do so.  I have been busy working on a lot of things related to my android app (click here to go to the Google Play Market page for it), and a lot of things have gotten fixed as well as launched.  I have managed to push out two (going on three after 6/19/2012) new revisions of the app to the market in a span of about 4 weeks, and made major changes to the software that provides the backend stuff of Drinqer.  Anyways, enough about that (if you want to read more, you can go here) and more about what I’ve been up to the past few weeks.  Mainly, I’ve been playing a lot of Team Fortress 2 but there have been a few events that have come up such as going to TWO going away parties (one for my friend Prayash who is moving to Delaware to start his doctoral program in high energy physics, and the other for my friend Laura (who has also been an amazing bartender) — both were epic nights and both culminated in lots of drinking (the second one more then the first))

I’ve also managed to get a Biloxi trip, which was by far one of the best trips i’ve been on in a while.  I didn’t win any money, but it was by far very very interesting.  On the other hand, i might not have made any money but my grandmother did.. she hit a royal flush on a dollar machine.

Anyways, i think that’s enough blogging for now.