Skip to content

Instantly share code, notes, and snippets.

View kellegous's full-sized avatar

Kelly Norton kellegous

View GitHub Profile
{"Message":"Object reference not set to an instance of an object.","StackTrace":" at Comcast.Customer.BusinessClass.UI.Services.AccountService.GetOutageMessage()\r\n at Comcast.Customer.BusinessClass.UI.Services.AccountService.GetServiceStatus(String accountNumber)","ExceptionType":"System.NullReferenceException"}
309.89x-4.02
534.47x-6.91
709.20x-7.31
159.46x-3.62
626.19x-6.96
388.98x-7.28
21.80x-4.82
131.56x-4.65
46.56x-4.70
98.42x-5.51
package worker
import (
"sync"
)
type Worker struct {
n int
q chan func() error
d chan bool
@kellegous
kellegous / read-features.cc
Last active August 29, 2015 14:10
read-features.cc
bool ReadFeatureDescriptors(const std::string& path,
std::vector<cv::KeyPoint>& keypoints,
cv::Mat& descriptors) {
cv::Mat img = cv::imread(path.c_str(), CV_LOAD_IMAGE_GRAYSCALE);
if (!img.data) {
return false;
}
cv::SurfFeatureDetector detector;
cv::SurfDescriptorExtractor extractor;
void FindMatches(
std::vector<cv::DMatch>* matches,
cv::Mat& desc_a,
cv::Mat& desc_b,
float threshold) {
cv::FlannBasedMatcher matcher;
std::vector<cv::DMatch> all;
matcher.match(desc_a, desc_b, all);
float min = 1e6, max = -1e6;
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
int main(int argc, char* argv[]) {
void* ptrs[9];
// allocate 3 16 byte buffers.
for (int i = 0; i < 3; i++) {
#!/usr/bin/env python3
import math
def ex1():
return '%0.3f' % (4 * math.pi * math.pow(5, 3) / 3.0)
def ex2():
return '$%0.2f' % (60*(24.95 * (1 - 0.4)) + 3.00 + 0.75*59)
def time_to_mins(t):
h, m = [int(x) for x in t.split(':')]
return h*60 + m
import math
print(4 * math.pi * math.pow(5, 3) / 3)
# run this with python3 ex2.4.py
#!/usr/bin/env python2.7
import optparse
import os
import subprocess
import sys
import tempfile
import time