Curious Junior Developer

Detective of life, New Dad, Developer.
A Flatiron Fellow

SQL is the queen of Relational Database Management Systems (RDBMS). RDBMS are enhanced when taking advantage of XML. XML provides tags that can be included in a text document in order to define it’s structure, allowing for greater management and manipulation of your data. If you want to be anti-fragile, then its time to build a Data Warehouse. Your going to need your Data Warehouse to be malleable, but also representing your organization’s history. If you find yourself growing beyond a one stop shop, then you may need to plan building data marts, subsets for your Data Warehouse that have a particular data focus.

Replication is a beautiful thing
Consider the Publisher, owner of data, defines the data given to subscribers, at different locations. Sometimes subscribers need to write back to the publisher to enhance the story. That’s when we’ll call on a merge replication, so the subscriber’s contribution can synchronize with the publisher’s. Merge Replication is great when you need to allow multiple users to develop data independently and later unit their information.

Data Warehouse parties can be exclusive
Context matters. Constraints on your data are vital, if none of the data is unique then its hard to make it work anything. Its up to you to set the Rules on what data types are acceptable in a column. Its hard to find the answer for ‘2 + apple.’

Not every table is an island
You’re going to need ways of confidently importing and moving data from multiple sources regularly. Depending on the services you provide you may need to conduct Online Transaction Processing (OLTP) to keep tabs on your users’ exchanges of data. Storing this information will allow you to figure out trends in your data warehouse later.

I’m currently taking COMP102x Introduction to Computing with Java on edX. While a lot of it is review, and I recommend going through a book so you don’t have to wait for next week’s lecture, taking an online course does offer some benefits. Primarily its the approach, learning about the same topic but from different perspectives and with different assignments brings new experiences.

I’m currently halfway through the edX Intro Java course. They use BlueJ, which making practicing Java easy, but its best to practice as you’ll actually work. For me, that means using Eclipse. If you are starting Java for the first time I do recommend playing with BlueJ. Below is a short guide to using this fun easy IDE.

How to install BlueJ on a Mac
1. Visit http://www.bluej.org/
2. Choose



How to add libraries
1. Click on “BlueJ”
2. Choose “Preferences”
3. switch to the “Libraries” tab
4. Click Add
5. Select library to add
You’ll have to restart the virtual machine for these changes to take effect.


How to create a new project
1. Click “Project”
2. New Project
3. Save the project at the desired location


How to create a New Class
1. On the left hand side, choose “New Class…”
2. Create a Class Name and leave the “Class Type” as “Class”
3. Click OK
4. You’ll see your new class appear as

5. Right click on the new class
6. Select “Open Editor” to view the source code editor
7. Delete the default code so you can write your own.


Reopening BlueJ Projects
1. Choose “Project”
2. “Open Project”
3. Locate desired project
4. Select & Open

How to stop an infinite loop
Ctrl + shift + R


Debugging time! Setting break points
1. Compile code
2. Select line for break
3. Tools
4. Set/ Clear Breakpoint
5. To remove breakpoint: Repeat


Shortcuts

compile command + k
Set/Clear break command + b
Create Documentation command + J

Each programming language is unique, to prepare code correctly you need familiarity with the ingredients. Java is more explicit with initializing its variable types. If you need to set up Eclipse, please see my previous post on Java.

For a comprehensive list visit Java Data Variables. Below are common types I’ll be using during future Java tutorials on this blog.

boolean: Truth values (true / false)
int for Integer: Whole numbers, for example 42
double: Real numbers. We use doubles for negatives and numbers including decimal places, for example -42.0
String: Text.

Lets try using Java variables.

VariableType Name;
int answer;

Variable = variable’s value;
answer = 42;

Lets put it all on one line!
String answer = “Answer to the Ultimate Question of Life, the Universe, and Everything is 42.”;


Time to look at Class Structure
class CLASSNAME{
public static void main(String[]arguments){
CODE
}
}

Output

System.out.println(some String) output to the console
i.e. System.out.println(“output”);


Lets get deeper…

The above will produce the following…

This series of posts teaches JS using the game Munchkin. A fun way to learn how to play is by watching the Table Top Video staring Felicia Day, Steve Jackson and Sandeep Parikh.


Declared functions, like the Plutonium Dragon from the last post, are built in memory right as we load the program.

Function expresessions are assigned to a varaible so they’ll only be loaded when its reached inside the program.

// Syntax of a Function Expression
var variable = function functionNameIsOptional (parameters) {
code to be executed
};

The function name above is optional. If the function has no name, then its an anonymous function.

// example of calling a Function Expression
variable(parameters);

You’ll notice above that the variable name includes parentheses, and we’ve included parameters to be used by the function it contains.

Lets see an example



Call the Function Expression

We’ll be programing Java on Eclipse.
Eclipse provides …
- Library management
- Autocompletion
- Run app from the editor
- Real time error checking


To set up Eclipse on your Mac OS X
1. Visit http://www.eclipse.org/downloads/?osType=macosx
2. Download the appropriate version
3. Open the Zip File
4. After starting it, it may state you need to install Java. You may select to allow it to install now
5. You’ll be prompted to select which folder you’d like to save your projects. We’ll go with default: /Documents/workspace


We’re close the Workbench (start portal) and move directly to creating a new Java Project. Let’s start with "Hello World."
1. Select File -> New -> Java Project
2. Enter the project name hello_world



3. At the bottom right hand corner click Finish

4. Right click on src -> New -> Class



5. We’re going to give our New Java Class the name HelloWorldMainClass, then click Finish at the bottom right hand corner.



You’re now ready to write your first Java program!



To run your program, hit the green play button



At the bottom of Eclipse you’ll see your code ran in the Console.

This series of posts teaches JS using the game Munchkin. A fun way to learn how to play by watching the Table Top Video staring Felicia Day, Steve Jackson and Sandeep Parikh.


Game note: Pursue only relates to an attempt to run from the monster. If the monster does not pursue a specific character they automatically succeed on their escape attempt and do not need to roll the die to run away.

In the game you open the dungeon door and enter a room. Oh no! You spot a Plutonium Dragon!



We’ll create a JS function to describe the dragon.
// Syntax for a function
function functionName (variable1, variable2){

Operations for our function.

};


// Syntax for calling a function
functionName (variable1, variable2);

Lets see an example in play…



Choose your character’s level…







Donald Knuth published The Art of Computer Programming in 1968. His goal was to provide firm mathematical and historical foundations to programming methods. He is now considered by many as the “father” of the analysis of algorithms.



3 Steps to a Solution:
1. Divide the problem into subproblems
2. Conquer each subproblem
3. Combine the solutions

Time to revisit sorting…
Approach:

Array[p..r]
p = proportion, or index
r = n = total sample size


1. Divide the n-element array into two sequences, Array[p..q] and Array[q+1..r]
2. Conquer each sequence by sorting them
3. Combine the sorted sequences for a total sorted solution






And of course, Merge-sort with Transylvanian-saxon (German) folk dance

I was inspired by the youtube video Insert-sort with Romanian folk dance

We are going to recreate the sort method. We’ll order the elements of an array in numerical order.

Pseudocode:
Iterate through the array.
Each time take a key to compared with the rest of the values to the left of it.
If the key is smaller than the one immediately to the left, swap them.
We will skip the 0 index of the array, because there is nothing to its left.


"Lets determine the correct param for this form." Felicia and I continued to pair program when we heard the call. Blake announced, "Head to the dance floor, we’re going to discuss the science fair." The dance floor is our safe space, its our lecture space.

The Flatiron Science Fair is an opportunity for us to display projects and practice presenting code we’re proud of. To me it looked like a reverse career fair, where potential employers would move between booths to inspect talent.

Blake framed expectations more appropriately. “Think of this as meeting people at a party or bar. Tell them fun interesting things about yourself and be sure to ask them about their interests as well. Its about seeing if they’re a good fit. Be positive. You may prefer Angular, but if you get more familiar with an alternative framework perhaps you’ll like that more.”

The real question: How can I prepare?
The real goal: Become over prepared.

Lets get real… whats important is being present for the experience.
Its our experience to enjoy as much as theirs. While its tempting to have every project we’ve prepared on tap, its best to identify 1 to 3 projects we enjoyed building. Including a group project is a good thing, considering the time invested in it. If of course you love Game of Thrones, I’ll show you that class Sinatra project.