Skip to content

Instantly share code, notes, and snippets.

#Fit a linear regression line to model IncomePerCapita 'y' as a function of
#PercentCollegeGrad 'x' from the states.csv data set.
### Imports ###
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import os
os.chdir('/home/edward/workspace/school/datavis')
os.getcwd()
bool
execute_plugin(struct esh_command * cmd)
{
struct list_elem * e = list_begin(&esh_plugin_list);
for (; e != list_end(&esh_plugin_list); e = list_next (e)){
struct esh_plugin * currPlugin = list_entry(e, struct esh_plugin, elem);
if(currPlugin->process_builtin == NULL){
continue;
/*Checks 4 cases:
* when no argument is supplied & there are no stopped jobs
* when no argument is supplied & there is a stopped job
* when an argument is supplied & there is no stopped job at that jid or the argument is junk
* when an argument is supplied & there is a stopped job at that jid */
void
execute_bg_command()
{
struct list_elem *eJob = list_rbegin(&job_list);
struct esh_pipeline * lastJob = list_entry(eJob, struct esh_pipeline, elem);
given an array of size n in which every number is between 1 and n, determine if there are any duplicates.
ask dumb questions:
are they ints, is it sorted, are there any restrictions. Can you use additional space. Can it be empty.
go with brute force question (make sure it's rock solid)
public static void printStuffWrapper(Node root){
if(node == null){
System.out.println("wat");
}
LinkedList<Character> pathString = new LinkedList<Character>();
printStuff(node, pathString);
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
import Utilities.IO_Template.MyScanner;
public class testing {
__author__ = 'emcenrue'
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "594e70312e0a1bfcfb63073e64c517bd"
auth_token = "{{ 594e70312e0a1bfcfb63073e64c517bd }}"
function getShortestUniqueSubstring(arr, str):
t = 0
result = null
uniqueCounter = 0
countMap = new Map()
# initialize countMap:
for i from 0 to length(arr)-1:
countMap.setValueOf(arr[i], 0)
# scan str
for h from 0 to length(str)-1:
public static int search(int[] arr, int leftIndex, int rightIndex, int x){
int mid = (leftIndex+rightIndex)/2;
if(arr[mid] == x){
return arr[mid];
}
if(rightIndex < leftIndex){
return -1;
}
if(arr[mid] > arr[leftIndex]){
given initial state as:
5 4
.X..
...X
X.X.
....
.XX.
5 3
1 1