Tuesday, December 22, 2015

Code Samples from Mobile Application Development Contest, 2013

This is the code from when I participated in the Mobile Application Development contest during my senior year of college. One of my friends an I created an Android application, "Maximize Me", a food tracking application, which contains Java and Database classes. Enjoy!

========================================================================

Database Info

TABLE NAME PRIMARY KEY COLUMNS
FOOD FOODID - AUTO NAME - TEXT SERVINGSIZE - TEXT FROMWHERE - TEXT NUTRITIONFACTS - INT(fk NUTRITIONS) HEALTHY - INT(0 OR 1)
MEAL MEALID - AUTO DATE - TEXT TIMEOFDAY - INT FOOD - INT(fk FOOD) LOCATION - TEXT FILLING - INT(0 or 1)
NUTRITIONS NUTRITIONSID - AUTO CALORIES - REAL TOTALFAT- REAL SATFAT- REAL TRANSFAT- REAL CHOLESTEROL- REAL SODIUM - REAL SUGAR - REAL PROTEIN - REAL



Food.java

package edu.ilstu.madapp;

public class Food
{
private long foodID;
private String name;
private String servingSize;
private String fromWhere;
private Nutrition nutrition;
private boolean isHealthy;
/**
*/
public Food()
{
super();
}

/**
* @param foodID
* @param name
* @param servingSize
* @param fromWhere
* @param nutrients
* @param isHealthy
*/
public Food(long foodID, String name, String servingSize, String fromWhere,
Nutrition nutrition, boolean isHealthy)
{
super();
this.foodID = foodID;
this.name = name;
this.servingSize = servingSize;
this.fromWhere = fromWhere;
this.nutrition = nutrition;
this.isHealthy = isHealthy;
}

/**
* @return the foodID
*/
public long getFoodID()
{
return foodID;
}

/**
* @param foodID the foodID to set
*/
public void setFoodID(long foodID)
{
this.foodID = foodID;
}

/**
* @return the name
*/
public String getName()
{
return name;
}

/**
* @param name the name to set
*/
public void setName(String name)
{
this.name = name;
}

/**
* @return the servingSize
*/
public String getServingSize()
{
return servingSize;
}

/**
* @param servingSize the servingSize to set
*/
public void setServingSize(String servingSize)
{
this.servingSize = servingSize;
}

/**
* @return the fromWhere
*/
public String getFromWhere()
{
return fromWhere;
}

/**
* @param fromWhere the fromWhere to set
*/
public void setFromWhere(String fromWhere)
{
this.fromWhere = fromWhere;
}

/**
* @return the nutrients
*/
public Nutrition getNutrients()
{
return nutrition;
}

/**
* @param nutrients the nutrients to set
*/
public void setNutrients(Nutrition nutrition)
{
this.nutrition = nutrition;
}

/**
* @return the isHealthy
*/
public boolean isHealthy()
{
return isHealthy;
}

/**
* @param isHealthy the isHealthy to set
*/
public void setHealthy(boolean isHealthy)
{
this.isHealthy = isHealthy;
}
}



Meal.java

package edu.ilstu.madapp;

import java.util.Date;

public class Meal
{
private long mealID;
private Date date;
private String TOD;
private Food[] food;
private String location;
private boolean isFilling;

/**
*/
public Meal()
{
super();
}
/**
* @param mealID
* @param date
* @param tOD
* @param food
* @param location
* @param isFilling
*/
public Meal(long mealID, Date date, String tOD, Food[] food,
String location, boolean isFilling)
{
super();
this.mealID = mealID;
this.date = date;
this.TOD = tOD;
this.food = food;
this.location = location;
this.isFilling = isFilling;
}

/**
* @return the mealID
*/
public long getMealID()
{
return mealID;
}

/**
* @param mealID the mealID to set
*/
public void setMealID(long mealID)
{
this.mealID = mealID;
}

/**
* @return the tOD
*/
public String getTOD()
{
return TOD;
}

/**
* @param tOD the tOD to set
*/
public void setTOD(String tOD)
{
TOD = tOD;
}

/**
* @return the date
*/
public Date getDate()
{
return date;
}
/**
* @param date the date to set
*/
public void setDate(Date date)
{
this.date = date;
}
/**
* @return the food
*/
public Food[] getFood()
{
return food;
}
/**
* @param food the food to set
*/
public void setFood(Food[] food)
{
this.food = food;
}
/**
* @return the location
*/
public String getLocation()
{
return location;
}
/**
* @param location the location to set
*/
public void setLocation(String location)
{
this.location = location;
}
/**
* @return the isFilling
*/
public boolean isFilling()
{
return isFilling;
}
/**
* @param isFilling the isFilling to set
*/
public void setFilling(boolean isFilling)
{
this.isFilling = isFilling;
}
}



Nutrition.java

package edu.ilstu.madapp;

public class Nutrition
{
private double calories;
private double totalFat;
private double satFat;
private double transFat;
private double cholesterol;
private double sodium;
private double sugar;
private double protein;
/**
*/
public Nutrition()
{
super();
}

/**
* @param calories
* @param totalFat
* @param satFat
* @param transFat
* @param cholesterol
* @param sodium
* @param sugar
* @param protein
*/
public Nutrition(double calories, double totalFat, double satFat,
double transFat, double cholesterol, double sodium, double sugar,
double protein)
{
super();
this.calories = calories;
this.totalFat = totalFat;
this.satFat = satFat;
this.transFat = transFat;
this.cholesterol = cholesterol;
this.sodium = sodium;
this.sugar = sugar;
this.protein = protein;
}

/**
* @return the calories
*/
public double getCalories()
{
return calories;
}

/**
* @param calories the calories to set
*/
public void setCalories(double calories)
{
this.calories = calories;
}

/**
* @return the totalFat
*/
public double getTotalFat()
{
return totalFat;
}

/**
* @param totalFat the totalFat to set
*/
public void setTotalFat(double totalFat)
{
this.totalFat = totalFat;
}

/**
* @return the satFat
*/
public double getSatFat()
{
return satFat;
}

/**
* @param satFat the satFat to set
*/
public void setSatFat(double satFat)
{
this.satFat = satFat;
}

/**
* @return the transFat
*/
public double getTransFat()
{
return transFat;
}

/**
* @param transFat the transFat to set
*/
public void setTransFat(double transFat)
{
this.transFat = transFat;
}

/**
* @return the cholesterol
*/
public double getCholesterol()
{
return cholesterol;
}

/**
* @param cholesterol the cholesterol to set
*/
public void setCholesterol(double cholesterol)
{
this.cholesterol = cholesterol;
}

/**
* @return the sodium
*/
public double getSodium()
{
return sodium;
}

/**
* @param sodium the sodium to set
*/
public void setSodium(double sodium)
{
this.sodium = sodium;
}

/**
* @return the sugar
*/
public double getSugar()
{
return sugar;
}

/**
* @param sugar the sugar to set
*/
public void setSugar(double sugar)
{
this.sugar = sugar;
}

/**
* @return the protein
*/
public double getProtein()
{
return protein;
}

/**
* @param protein the protein to set
*/
public void setProtein(double protein)
{
this.protein = protein;
}
}



Java Training Class Notes

While at work, I took an intermediate Java and Servlets training course and these were some of the notes I took during the class. Enjoy!


========================================================================


Instance Variables are a field

Encapsulation is when you put stuff in a class and everything is private

A class is a blueprint that uses classes with objects

Static classes = put static keyword next to it; you can’t make an object of static classes; you also don’t make objects because the fields and methods may not exist and would cause a null pointer error

The java term for CREATING an object is to INSTANTIATE it

Servlet = a java class

Types of access modifiers: Public (most visibility), Private (least visibility), Protected (can’t be used in another class outside of the package or subclasses (“child classes” derived from inheritance), Default (not putting one)

If there are no access modifiers (ex int x = 5), you can use those types of variables and methods within subclasses in the same package only

Primitive data types (all 8 of them): Byte, int (4 bytes), short (a type of int), long (8 byte integer aka a long number), Boolean (true/false in all lower case), char (single character with 2 bytes per character), float (4 bytes), double (8 bytes)

How to make a long variable: long x = 1234567890L (use an upper case L because a lower case one will get confused with a “1”)

Doubles and longs have floating points

How to make float variable: float x = 1234.567f (the F can be upper or lower case, but most people use lower) – there is also no perfect 0 with floats and it goes to .0000…1

Not having an “f” with a float variable causes the IDE to assume that the variable is a double

Floats are also not completely accurate because the rounding is different/off because it calculates based on logarithms (ex, float .27f x 100 is not the same as .27f)

Double doesn’t have perfect 0 either

Don’t use a primitive data type when needing to modify data

Passing by value vs by reference: Passing by value is for a primitive data type and by reference (address) is for an object

Division: / = dividing, % = modulus

String = an object and NOT a primitive data type, not mutable (not able to be changed) – if you want to change a string, you have to create a new object

Characters are a single letter only

Garbage collector = system.gc

The operating system has tons of tables

Rounding = math.round(); can take in a float or double in order to round to the nearest int (ex math.round(8/5)); returns a number

Java.lang package = doesn’t need to be imported (comes with Eclipse and most items are static)

Decimal format = NOT static or java.lang; need to import and make an object of it; decimal format is used for rounding; it returns a string; part of the java.text package

Naming conventions: Class = start with an upper case and the rest of the words are upper case; method/variable = start with a lower case and the rest of the words are upper case; methods are called with xyzMethod(); -- you always need the () in order to make it a method

Constructors = Name needs to match the classname (otherwise it violates “normal naming conventions”) – it’s the method that runs when the object is instantiated; it provides us tools for the object

Static methods are invoked with the classname and objects are invoked with the reference name (the name you called the object that you made)

Qualified name = everything in the storage hierarchy

Import java.x.* = import the entire package at the level where the “*” is and NOT below it

Resolving external reference: referring to something outside of a class that is trying to be brought in and then an error appears (and you have to fix it)

Constructor = runs first when an object/instance variables are instantiated; you need to initialize local variables

No arg constructor (default constructor) = calls the superclass super – super(); -- the super class involves parent and child classes (super classes are parents, subclasses are children) – the user can enter values or have everything initialized to default – you can add a default constructor by right clicking in the code area and selecting “source” – the super constructor is referenced implicitly in the default constructor, but adding it into the constructor is a good coding habit

Overloading a method: Same method with different parameters and different variables and types

Scope = where the code parts can be seen (ex within the method, within the class)

Duration = the time in memory

Mutator = changes the value of the instance variables (another name for a setter)

The object class does NOT have a super class

Constructors don’t have a return type

Whatever you put inside of () determines which constructor you run (when you’re calling one)

You need a parent class for inheritance

A servlet is just a java class (a regular old java class)

Java classes need: fields (variables), setters and getters that the constructors use, constructors, a toString() method, a place to test the code (ex a test app), and other (test) methods as needed

Legal Values: Private instance variables, public setters and getters; you define a method to give users access

You need OBJECTS and a super class for the “trickle down effect”

Always override the toString

Don’t put the test program and actual program in the same package!

Accessor = getter (grab values from variables) – call it by saying getTheMethod()

Mutator = a setter

Getting a Boolean variable – don’t call it “getSomething”, call it “isSomething” (ex isPositive, isEnabled)

This = this OBJECT and does NOT refer to the instance variable (hides the instance variable)

Setters/getters/constructors = in the eclipse source (you can generate it automatically)

Parameter = local variable = method (local variable) = variable in parameter

Always have access to instance variables

This.value = value  this = the instance variable; value = the local (parameter) variable

Memory address same vs different – NOT used to compare contents of 2 objects (use “.equals”, which is used with Booleans)

Equal vs equivalent  equal = same value (1=1); equivalent = references the same object

Pass an object = pass an address; variable = value

instanceOf = relational operator = sees if object type is the same… if no, then need to type cast (ex myClass(object)) – casting allows the types of the variables to match

Same type = comes from the same class

instanceOf also sees if something is an instance (variable) and sees if the variables are in the same class AND same original object  ex apple a = new apple, orange b = new orange, apple c = new apple  a and C are true for instanceOf, whereas a and b are not

Comparing to a primitive data type – make a method – returns an overloaded method in the example and can use an “==” and compare your object fields to primitive data types

Object – NOT an “==” and use it with primitive data types and numbers (use “=”)

hashCode = value generated when objects are created and use when comparing to other collections (ex arraylist, vectors)

equalsIgnoreCase = checks for capital letter vs small letter

vector class = synchronized =  1 user at a time, use on a servlet, is serializable now

arraylist = expandable array, not synchronized, servlets have multiple users at a time, use on standalone apps

serializable = read/write from disk byte by byte (Java does NOT do that); objects can be written to disk byte by byte to get the unique address

capacity = get more space when needed

double link list – java updates pointers by itself

data structure = arraylist or stuff linked together; based on pointers; java doesn’t do that for you and you need to link classes together

Clone objects = use assignment operator (=) (ex a = 3, b = 5, a = b) is NOT a clone, but sets a equal to b

There is NOT a copy method right now

You need to implement the “cloneable” method (implement cloneable) – an object can be cloned now and would need a try/catch block to ensure the clone you want to do is ok and “valid” – clonenotsupportedexception = forgot to implement cloneable

Deep/shallow copy  shallow = good if stuff is only primitive data types (bad with object references because it would only reference the original and not the cloned object); deep = makes a clone of class/object references where shallow copies ONLY primitive data types – no referenced object = null pointer error

Exceptions are events

Finalize = system.gc() – analyze free space

Final = constant

Composition/aggregation = “has a” relationship; component parts die with the method and they go out of scope (depends on one parent) – base out of scope, components go out of scope too – components within the parent

Aggregation = pass addresses into the method, base out of scope = components are OK because separate pointers – addresses passed to parents, but they’re separate params of the constructor

No object of “static”

Inheritance/polymorphism use different packages and public/protected

Methods and params need to match; super = first call in a constructor

Main uses object as its superclass because it’s static

Why Technology Students Should Obtain an Internship Graphic

I made this in my technical writing class in college. Enjoy!


Monday, December 7, 2015

Blog Posts for ISUTech Blog

When I was in college, I blogged for the Technology department. A select few students posted blogs for gen-ed level math students to read articles regarding emerging technologies and take a mini quiz on the article. I wrote for this blog during my second semester senior year of college (January-May 2013). Below is all my work I did for this endeavor. Enjoy!

Windows 8 Review

Data Ethics

Defying Women Stereotypes in IT

Technology in Academia

Cellphones and the Technology Boom

My IT Future After College

Sunday, December 6, 2015

What is Kendo UI?

What is Kendo UI?

Site: http://www.telerik.com/kendo-ui1

Kendo UI is a HTML5 and Javascript/JQuery framework that provides a Javascript library to create fast, rich, responsive, and interactive webpages. The DOM is utilized as well. This framework also provides several UI widgets that are in HTML5 and based on JQuery (which isn’t fully compatible with Internet Explorer yet). You can also integrate Angular JS and Bootstrap, which are supported as well. This framework is very mobile compatible. HTML5 tools such as data sources, templates, drag and drop components, and model view view model are utilized in this framework.

6 Ways to Thrive at an Internship or Career Fair

Meeting recruiters in person is being a step ahead of the other candidates who apply cold. You of course need to make sure to prepare an advance for the fair in terms of becoming knowledgeable about the companies you want to talk to, see which companies are attending the fair, and bring lots of patience with you because you know you're going to be waiting in plenty of lines. Make sure you prioritize your time in order to be able to talk to every company that you have on your list. That doesn't mean talk to every single company, but select a handful of companies that you may want to work for and go ahead and talk to them. If you have extra time at the end, feel free to talk to whoever else you want to as well. Don't talk to every single company for no good reason. You need to be somewhat picky in order to get a job you want, but only be selective until you are absolutely desperate to get a job (ex you're running out of time before the internship hiring period ends for all of the companies). Here are 6 steps on how you can thrive at an internship or career fair:

1. You should always treat an internship fair like an in-person interview, except it's usually a precursor to that. Dress to impress (business professional, meaning to wear a suit), give a firm handshake, and you're off with a smile and enthusiasm towards attaining the ultimate job for yourself!

2. Make sure you've done your research about each company that you plan on talking to because you may get asked questions to test whether or not you know anything about the company (ex where their   headquarters are). Also, some companies make their applications available online prior to the fair. While you're doing your research, check if the company has their application available. If so, definitely apply prior to talking to them. It will impress the company with your level of interest in the job. Who knows, maybe they'll schedule an interview on the spot! It is possible for that to happen, so be prepared! I have seen it happen and it has happened to me as well!

3. Don't get discouraged if the company decides not to talk to you because your GPA doesn't meet their requirements or if they automatically tell you that you don't meet their qualifications. Still apply online if that happens. You never know. You can blow them away with your technical skills, portfolio, or other outside professional experience that they may have missed when initially glancing over your resume!

4. Be prepared with everything that you could possibly need on hand, such as extra resumes, business   cards, pen/paper, a portfolio, and a bag to carry the random trinkets that you're given. Make sure to bring at least 2 resumes per company that you plan on talking to. Also, you should print your resumes on resume paper. Some career centers have some. Otherwise, you can find it at Wal-Mart or something like that. You never know. You may end up wanting to talk to more companies than expected. Bring a portfolio to store your resumes, pen/paper (in case you want to take notes while talking to the company, or right after), your business cards (which you should also bring), and a place to hold the free goodies you're going to get from all of the companies you talk to. They will give you little “knick knacks” such as flash drives, $5 gift cards to somewhere, hats, post it notes, etc. Recruiters will notice those "little things", such as using resume paper and bringing a portfolio and know that you have gone the extra mile in terms of handling yourself professionally! It also shows preparedness!

5. Bring your arsenal of questions. Even if you've talked to that particular company already at another   fair, asking questions continues to tell the recruiter how interested you are in the position. Bring 2 or so questions each subsequent time you talk to them. If this is your first time talking to that particular company, bring at least 3.

6. The very most important thing to bring with you to internship fairs is your “30 second commercial”, which takes place right after the initial handshake usually (or right after the recruiter asks you your year, major, what type of internship or job you're looking to apply for, etc. and glances at your resume). When you give your 30 second commercial, you say that you're a (year) majoring in (major). Your goal is to work in your company for (whatever position(s) you plan on applying for). You are involved in (list extracurricular activities). I love to (list hobbies). You are a leader of (something, if you are). You love and are very passionate about what you do. Your greatest strengths are (ex being very flexible). Basically, just emphasizing what you love, your goals, and your strengths in order to best sell yourself. You want to brag, but don't blab. Don't put the recruiter to sleep. Imagine someone who just won't shut up and you are just nodding your head pretending to care. You don't want to end up being in their shoes having someone nonstop blab to you!

So here's how it goes:

When it's your turn to talk to the recruiter, introduce yourself, give a firm handshake, smile, and be ready to sell yourself while being yourself. Just before giving your thirty second handshake, tell the recruiter what position you want to apply for. Next, ask if they would like a copy of your resume (and a business card) and hand it over to them. Afterwards, start the conversation by giving your 30 second commercial or by answering whatever the recruiter asks you (ex the “are you eligible to work” questions and if you know anything about the company). After all of that, since there is a line, the recruiter will ask you if you have any questions; you are ready to ask away. With those questions, try to embark in a good conversation. Whether it's about the company or hobbies you share, try to connect with the recruiter you're taking to. When you're done, ask for a business card and how you can apply (if you haven't already). When you're done, shake their hand, thank the recruiter for their time, and you're off to conquer the rest of the fair!

IT Field Career Week Presentation for High School Students

For those of you who are ever speaking to students who are in high school about pursuing an IT career, here's what I said for mine. It would have been helpful to be given an example of what "exactly" people present besides an outline because I made everything up and hoped for the best instead of having an example to base my content off of.

I was given the advice to explain more of what I do at my job on a day-to-day basis, as opposed to providing advice on how to be successful in college/land an internship successfully and whatnot.

The presentations were aimed at a 50 minute class towards the student who is most likely to fall asleep/get bored (meaning I tried to be entertaining and informative by what I said and providing videos for the students to watch to give further insight and something to watch besides me talking). I also wanted to be funny because I'm sure high school students don't want to listen to some monotone person blabbing for awhile and because I was giving this presentation on the last week of school.

I also removed some of my personal information from the presentation. Enjoy!

Saturday, July 4, 2015

Front End Frameworks

ANGULAR AND BOOTSTRAP
include like this (for Bootstrap):

So what is Bootstrap? Bootstrap is a free and open source front end web application framework containing a collection of tools to create websites and web applications. The primary languages used are HTML and CSS, which is helpful for creating dynamic responsive design webpage templates (with HTML5 and CSS3). The CSS classes need to be applied to HTML elements in order to be able to be reused. Some major features from the HTML and CSS are typography, forms, buttons, navigation, and other user interface components. Javascript and JQuery are compatible with Bootstrap. If using responsive design, not all components are compatible with Internet Explorer, thus, the display may be flawed.  This framework is very mobile compatible!

So why is this framework sometimes referred to as “Twitter Bootstrap”? Because it was created at Twitter (the social media company)

You can use a vanilla interface (an HTML/CSS framework not requiring extra markup classes or attributes to create a layout). This framework is fully responsive. To download this framework, go here: https://github.com/tylerchilds/Vanilla-HTML

You can use SASS as a CSS scripting language. For more information, go here: http://sass-lang.com/

LESS is a CSS framework that can be run on the server side: http://en.wikipedia.org/wiki/Less_(stylesheet_language)
Bootstrap is compatible with Angular JS too: https://angular-ui.github.io/bootstrap/

Some pros of Bootstrap:
*Not a huge learning curve and not too bad to begin learning
*Mobile compatible
*Handy grid system
*Can use basic styling for HTML elements (ex tables, forms, buttons, images, icons, etc.)
*Extensive component list (via the API)
*Bundled Javascript plugins that can be used (to make this JQuery compatible)

More awesomeness to come soon!

Friday, June 12, 2015

SAP Description

Brief Description of what SAP is: SAP (Systems, Applications, Products) is a German-based company who creates ERP (Enterprise Resource Planning) to help appropriately store and process data. There is software for accounting, logistics, human resources, technology, and other modules. All of these categories have sub-categories of modules (ex Insurance, Security, Finance), which delve into almost all existing industries. In order to implement SAP, the ASAP Methodology is used, which contains 6 phases: Project Preparation (planning and setting goals), Scope Validation (evaluate how SAP will be used to accomplish business goals and meet business process requirements), Realization (preparing for implementation), Final Preparation (completion of testing and user-end training, making finishing touches to go live), Go-Live Support (ensuring the applications are well supported and don't come crashing down), and Operate (make tweaks to the applications visually and functionally). Doing Agile development changes the Scope Validation phase with more of a Lean Blueprint phase

Example: Crystal Reports – Crystal Reports is a business intelligence application that generates reports from data sources such as SQL stored procedures to be stored in document types such as CSV, Excel, PDF, a Crystal Report file (RPT), and much more!

Layers of a Database

Layers of a database: 

Presentation (where the graphical user interface is, which serves as an interface for the other 2 layers, when requests are sent from the presentation layer, processing starts at the application layer, goes back to the database layer, and finally to the presentation layer again)

Application (where logical operations and load management are completed, message servers are used here for communication)

Database (Database Management System, Database Server - store, update, or delete data from a server, enable security features, can be combined with application later to reduce bottleneck traffic flow)