Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": "info-stocks"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": "Day_21_EdwardLee"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
# From https://code.google.com/p/modwsgi/wiki/ReloadingSourceCode
import os
import sys
import time
import signal
import threading
import atexit
import Queue
_interval = 1.0
import os
import monitor
monitor.start(interval=1.0)
monitor.track(os.path.join(os.path.dirname(__file__), 'site.cf'))
# ...
# The rest of your wsgi.py file
  • Complete this TODO.
import java.util.*;
import static org.junit.Assert.*;
import static org.junit.Assume.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.experimental.theories.DataPoint;
@eddieberklee
eddieberklee / intersection.java
Created December 22, 2015 23:51
Android Detecting Intersection of a Touch Point with a Path
float padding = Util.dpToPx(1);
RectF touchPoint = new RectF(x, y, x + padding, y + padding);
Path touchPointPath = new Path();
touchPointPath.addRect(touchPoint, Path.Direction.CW);
for (int i = 0; i < mHourPaths.length; i++) {
hourPath = mHourPaths[i];
touchPointPath.addCircle(x, y, padding, Path.Direction.CW);
touchPointPath.close();
Path hourPathCopy = new Path(hourPath);
@eddieberklee
eddieberklee / colored_arcs.java
Created December 22, 2015 23:54
Android Colored Half Hour Arcs around a Circle
int[] colors = new int[]{
getResources().getColor(R.color.flatui_red_1),
getResources().getColor(R.color.flatui_red_2),
getResources().getColor(R.color.flatui_orange_1),
getResources().getColor(R.color.flatui_orange_2),
getResources().getColor(R.color.flatui_yellow_1),
getResources().getColor(R.color.flatui_yellow_2),
getResources().getColor(R.color.flatui_green_1),
getResources().getColor(R.color.flatui_green_2),
getResources().getColor(R.color.flatui_blue_1),