354 karma · joined January 15, 2012
All the top high stakes players already have solvers that they've spent a lot of money developing and studying privately. They would definitely be upset with you, but by releasing the code you are democratizing the information to all the midstakes pros who want to study but don't have the resources to pay developers and solve the game privately.
The fundamental analysis models don't fall apart with tech companies, it's just much harder to project revenues for a new, volatile, growing business than an old mostly stagnant or slow growing company.
"In your phrasing, you could say that government also "tells people what they can and can't" eat, in the form of the FDA."
"The FDA doesn't tell you what drugs you can and cannot take."
In your poison cucumber example I think this would qualify as knowingly poisoning someone else which is clearly illegal and we do not need the FDA for that. As long as the cucumber is labeled as "poison" I have no problem with people selling them.
No it doesn't. It's pure nanny statism. The government has no business telling people what they can and can't invest in or spend their money on. Yes startups are risky. So are lots of things. Why should the wealthy have no restrictions on them, but the poor do? This is literally "class warfare".
#1 CREATE INDEX tbl_idx ON tbl (date_column) SELECT COUNT() FROM tbl WHERE EXTRACT(YEAR FROM date_column) = 2017
I've never used EXTRACT() in my life, so I don't know if it's index aware. I do know in real life I would write "WHERE date_column >= '2017-1-1' AND date_column <= '2017-12-31' or if I were querying a school_year or something that spanned between two years I would add another column and probably an index on that column and query by that not by the date_column.
#2 CREATE INDEX tbl_idx ON tbl (a, date_column)
SELECT FROM tbl WHERE a = 12 ORDER BY date_column DESC FETCH FIRST 1 ROW ONLY
Who uses FETCH FIRST 1 ROW ONLY instead of LIMIT 1? Also indexes can be ordered by ASC or DESC so there's a possibility of a small optimization there.
#4 CREATE INDEX tbl_idx ON tbl (text varchar_pattern_ops)
SELECT * FROM tbl WHERE text LIKE 'TJ%'
I thought the general philosophy regarding indexes was create the ones you know you need like on foreign keys and very common ones like last_name, SSN etc and then if you notice queries running slow add more and test. This seems like one of those examples. Do you really need an index here? How often are you making this query and what's the speedup gained if you add an index?
#5 CREATE INDEX tbl_idx ON tbl (a, date_column)
SELECT date_column, count() FROM tbl WHERE a = 38 GROUP BY date_column
Let's say this query returns at least a few rows.
To implement a new functional requirement, another condition (b = 1) is added to the where clause:
SELECT date_column, count() FROM tbl WHERE a = 38 AND b = 1 GROUP BY date_column
This seems like another case in the real world where you might test what the slowdown is, and how often you're running this query. If needed you can add another index or run a subquery first, but the answer to this question can be found out in < 10seconds in the real world more quickly by testing it than even spending the time thinking about it.
1. Write code
2. Run code
3. See error
4. Google error
5. Write code to fix error
6. Repeat
I'd like a compiler that helps speed up steps 3-5. I know IDEs do some of this, but I'd like a compiler that automatically fixes errors instead of just telling me what went wrong. One that fixes parentheses that I left off or automatically fixes typos in variable names or function calls. One that knows to keep things DRY and creates a function for me when it sees the same similar code written twice. One that knows when I wrote an inefficient bubble sort and swaps it out with a faster sorting algorithm etc. One that can make my code run faster. I think this is a long way off, and I know it's really hard to write a program that writes code, but it's always seemed that programming simple things is way harder and takes longer than it should to me.
There is definitely a non zero percent chance of this happening. How much % chance is debatable, but it's certainly >0.
If anyone would like to collaborate with some model building get in touch. I already have a large db of most of the stats you’d ever need and some okay but not amazing models for most major sports.
1. Viewing games costs too much
2. The commentary for said games sucks
I'd happily watch a random MLB game on a Tuesday, but sorry I am not going to spend $113/season to watch on MLB TV. The NFL is the worst. If you're out of the US you can purchase and stream games for $200/season or so, but for in the US you have to have directTV to get all the games which isn't even offered for many possible subscribers or spend $30 in beer/food for lunch at a sportsbar with no audio for your game. If I'm at home I have the choice of the local game and maybe one other random national game and if both of these games are blowouts I'm tuning out.
People want to watch their team play. They don't even mind commercials as long as there's not TOO many of them. The NFL is reaching their limit. NFL viewership has peaked. 2016 ratings declined 8%. Watching a touchdown followed by a commercial followed by a kickoff touchback followed by a commercial is too much. The only way to grow a sport is to grow viewership and fans and the only way to do that is make content cheap, easy to access and enjoyable to watch which brings us to the commentary.
The future of sports and money in sports is in the live aspect and in the commentary. I want to watch a football game commented by Conan O'Brian or Snoop Dogg or even some entertaining twitch or youtuber not Al Michaels and Phil Simms. Why not collect royalties on commentary streams? Let 1000s of people pay for the rights to comment on an NFL game and let the viewers decide who they want to listen to commentary from. Its absurd that in 2017 people still resort to reddit.com/NFLstreams or NHLstreams to watch some low res game with pop up ads everywhere with commentary from two old white guys.
Once viewership increases, ad money will increase which would offset the streaming fees the leagues would be missing out on by providing their content for free. If ESPN would simply show sports and provide interesting commentary from interesting individuals I would watch around the clock.
def flatten(x):
def flatten_generator(x):
if type(x) == list:
for y in x:
for z in flatten(y):
yield z
else:
yield x
return list(flatten_generator(x))
assert(flatten([1, [2,3]]) == [1,2,3])
ary = [1, [2,3], [4, [5,6]]]
print flatten(ary)