Skip to content

Instantly share code, notes, and snippets.

View qharlie's full-sized avatar

charlie qharlie

  • Texas
View GitHub Profile
l = [[1,2],[3,4]]
[x for y in l for x in y ]
object Solution {
def buyTicket(seq: Array[Int]): Array[Int] = {
seq.drop(1) ++ seq.take(1).map(_ - 1 )
}
def waitingTime(ts : Array[Int], p : Int ) : Int = {
var tickets = ts; var time_in_line = 0; var position = p
def air_cargo_p1() -> AirCargoProblem:
cargos = [C1, C2]
planes = [P1, P2]
airports = [JFK, SFO]
pos = [At(C1, SFO),
At(C2, JFK),
At(P1, SFO),
At(P2, JFK),
]
neg = [At(C2, SFO),
(JFK, SFO, ATL, ORD) = symbols('JFK,SFO,ATL,ORD')
(C1, C2, C3, C4) = symbols('C1,C2,C3,C4')
(At, In) = symbols('At,In')
# (Load, Unload, Fly) = symbols('Load,Unload,Fly,At,In')
(P1, P2, P3) = symbols('P1,P2,P3')
@qharlie
qharlie / espn_nba.py
Created August 13, 2017 20:55 — forked from drewdresser/espn_nba.py
Grabs NBA play-by-play data for a given date range. Example usage: python espn_nba.py 2013-12-24 2013-12-26
from bs4 import BeautifulSoup
from urllib2 import urlopen
from datetime import datetime, timedelta
from time import sleep
import sys
import csv
# CONSTANTS
ESPN_URL = "http://scores.espn.go.com"
1 4 7 |3 6 5 |8 9 2
6 9 5 |8 2 7 |4 1 3
2 3 8 |9 1 4 |6 5 7
------+------+------
9 5 1 |2 8 3 |7 4 6
8 6 4 |1 7 9 |3 2 5
3 7 2 |4 5 6 |9 8 1
------+------+------
4 1 9 |6 3 2 |5 7 8
7 8 6 |5 4 1 |2 3 9
ValueError Traceback (most recent call last)
<ipython-input-7-5cf5b03019f2> in <module>()
24 model.compile(loss='mean_squared_error', optimizer=optimizer)
25
---> 26 model.fit(X_train, y_train, epochs=100, verbose=2)
/home/q/anaconda3/envs/p3/lib/python3.6/site-packages/keras/models.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, **kwargs)
868 class_weight=class_weight,
869 sample_weight=sample_weight,
--> 870 initial_epoch=initial_epoch)
vigate
LaTeX_envs
Help
Autosave interval (min):
In [ ]:
In [1]:
%matplotlib inline
# coding: utf-8
# In[ ]:
# In[1]:
@qharlie
qharlie / .block
Last active April 30, 2017 12:43
fresh block
license: mit