Skip to content

Instantly share code, notes, and snippets.

View tcarrio's full-sized avatar
🧙‍♂️

Tom Carrio tcarrio

🧙‍♂️
View GitHub Profile
@tcarrio
tcarrio / The Technical Interview Cheat Sheet.md
Created August 26, 2015 15:14 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@tcarrio
tcarrio / Project4.java
Created October 14, 2015 15:04
Project4 Comment Help
/* Programmer Name:Yulanda McCruter
Project Name:Project4
Course:CIS1500 Wednesday 6:00 p.m.
Date of Completion:October 10, 2015
Purpose Statement:This program will calculate the customers new balance and display the new balance
in a dialog box to determine if the customer has exceeded their credit limit.
*/
import javax.swing.JOptionPane; // import JOptionPane to make dialogs for user
@tcarrio
tcarrio / HeightParser.java
Last active October 19, 2015 14:47
Example height parser for accepting US standard and flat inches
// Global scope statements
EditText editHeight = (EditText) findViewById(R.id.set_height);
public int getHeight() throws HeightInputException {
String heightInput = editHeight.getText().toString().replaceAll("\\s","");
int ftInd = heightInput.indexOf("'");
int inches = 0;
if(ftInd!=-1){
int feet = 0;
try {
@tcarrio
tcarrio / Reset.java
Created October 26, 2015 01:28
Accessing SharedPreferences and setting values
private SharedPreferences sPref;
private final String PREFS = "SharedPreferences";
private final String genderKey = "gender";
private final String activityKey = "activity_level";
private final String timeKey = "time_frame";
private final String nameKey = "name";
private final String ageKey = "age";
private final String heightKey = "height";
private final String weightKey = "weight";
private final String goalKey = "target";
@tcarrio
tcarrio / WorkoutHashMap.java
Created October 27, 2015 15:41
Sample code from Workout Activity diagram
HashMap<String,String> map = new Map()<>;
map.put(“type”,doc.get(“type”));
map.put(“subtype”,doc.get(“subtype”));
ArrayList<View> list = new ArrayList<>();
// when showing View, add to list
list.add((View)findViewById(R.id.RepsText));
for( View v : list) {
switch(v.getId()){
case(R.id.RepsText):
@tcarrio
tcarrio / JavaVsPython
Last active October 30, 2015 18:55
Showing bebee the ridiculous difference between Java and Pythons Hello World
// Java Hello World
public class HelloWorldExample
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
## Python Hello World
@tcarrio
tcarrio / HelloWorld.lol
Last active October 30, 2015 18:56
It's like an adorable kitten got a computer
HAI
CAN HAS STDIO?
VISIBLE "Hello World!"
KTHXBYE
@tcarrio
tcarrio / gist:255d2969a41d5c426c9b
Last active December 11, 2015 20:52 — forked from mtroiani/gist:81ad68a1f19027086ed2
http://www.freecodecamp.com/mtroiani 's solution for Bonfire: Check for Palindromes
// Bonfire: Check for Palindromes
// Author: @mtroiani
// Challenge: http://www.freecodecamp.com/challenges/bonfire-check-for-palindromes
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function palindrome(str) {
str = str.toLowerCase().replace(/[^\w]|_/g, "");
return (str === str.split("").reverse().join(""));
}
@tcarrio
tcarrio / initAndMain.py
Last active December 21, 2015 15:38
Clarifying python __init__ and main
from selenium import webdriver
from collections import deque
import threading
class AccountManager():
def __init__(self):
self.login = []
self.emails= []
self.log = deque([])
self.IWT=5
@tcarrio
tcarrio / SelectRangeByCorrespondingChar.js
Last active December 21, 2015 18:18
Drive add-on to return array of values from second array where array ones corresponding index contained the specified char
function selectRangeByCorrespondingChar(c1,c2,char) {
var n=[], c=0;
for(var i in c1){
if(i===char){
n.push(c2[c]);
} c++;
}
return n;
}