Skip to content

Instantly share code, notes, and snippets.

Edward McEnrue emcenrue

View GitHub Profile
View stuff.java
@Override
public void changeFragment(String fragment_name) {
Fragment fragment;
Class fragmentClass = null;
if(fragment_name.equals(TeamFragment.TAG_TEAM_FRAGMENT)){
fragmentClass = TeamFragment.class;
Log.d("HW2", "team fragment selected");
View stuff.java
public class Solution {
public List<String> findWords(char[][] board, String[] words) {
//insert all words into trie
//for each cell, depth first search from that cell in all directions checking each growing string against the trie
//if eventually a word is found (all neighbors dont continue making a valid word in trie), then add that word to soln list
//if at any added character the string no longer is in trie, stop traversing, just return null
Trie trie = new Trie();
for(int i = 0; i < words.length; i++){
trie.insert(words[i]);
}
View threshold_run_output
=====================DIFF T, THRESHOLD VALUE=======================
./kmeans -n 4 -t .01 -i ./data/204800.txt
I/O completed
num of threads = 4
# iterations = 18
kmeans_clustering call from cluster.c took 0.428064
View threshold_run
echo -e "\n\n\n\n=====================DIFF T, THRESHOLD VALUE=======================\n\n\n\n"
echo -e "./kmeans -n 4 -t .01 -i ./data/204800.txt"
./kmeans -n 4 -t .01 -i ./data/204800.txt
echo -e "\n\n\n\n===================================================================\n\n\n\n"
echo -e "./kmeans -n 4 -t .001 -i ./data/204800.txt"
./kmeans -n 4 -t .001 -i ./data/204800.txt
View output_for_dim_32_on_x_and_y
-bash-4.2$ ./pf -x 32 -y 32 -z 100 -np 10000
VIDEO SEQUENCE TOOK 0.028908
XE: 16.549820
YE: 16.463238
0.718951
XE: 14.455943
YE: 17.535434
2.177538
XE: 12.490030
YE: 18.503280
View output_for_dim_1024_on_x_and_y
-bash-4.2$ ./pf -x 1024 -y 1024 -z 100 -np 10000
VIDEO SEQUENCE TOOK 12.033136
XE: 512.549820
YE: 512.463238
0.718951
XE: 510.455943
YE: 513.535434
2.177538
XE: 508.490030
YE: 514.503280
View gist:c241cb5cfcd33ab902bc34e2db2d27b0
from redbaron import RedBaron
import json
with open("the_unidiomatic_python_file.py", "r") as source_code:
red = RedBaron(source_code.read())
red
del red[1]
View idioms.py
#unpythonic code in idiom_tests_copy.py:
result = []
for i in range(10):
s = i ** 2
result.append(s)
print(sum(result))
View gist:280348c03d5a042c446b55b95fadaa12
/* globals React */
const shallow = require('enzyme').shallow;
const expect = require('chai').expect;
const setup = require('static/bundles/test/componentSetup');
const courseViewGradeData = require('static/bundles/ondemand/components/__fixtures__/CourseViewGrade.mock');
const courseMaterialData = require('static/bundles/author-grade/stores/__tests__/fixtures/courseMaterialData.newGradeWeights.js');
const beforeEachLoadPromisedObject = require('static/bundles/phoenix/test/lib/beforeEachLoadPromisedObject');
View gist:95316b24cd7c7a3c7c4e75d7e24eccd0
latencyAvg = getLatencyAvg();
loadAvg = getLoadAvg();
uptimeAvg = getUptimeAvg();
IOWaitAvg = getIOWaitAvg();
latencyAvg = ((latencyAvg) / (500));
loadAvg = ((loadAvg) / (10));
uptimeAvg = uptimeAvg/1000;
uptimeAvg = ((uptimeAvg) / (3600));
You can’t perform that action at this time.