user2426679
Not to be rude, but this is really off the mark. The only reason that we're not still in a cartel market regime of $100 barrels is fracking being invented/discovered and efficiently improved. It cut the price floor well in half.
Fracking is not the cheapest, but it's also not the most expensive (see Canada's oil sands). When you compare fracked WTI (basically the USA-sourced index) to offshore Brent (North Sea, off the coast of UK), the costs are apples to oranges because fracking can be readily tapped at a relative drop of the hat (if prices spike in a short term period), but offshore is a huge multi-million/billion endeavor where you have to depreciate costs over a really long time horizon (same with oil sands, but different tech).
https://www.theguardian.com/world/2018/dec/19/top-der-spiege...
Ime, the best case scenario is Acme Tech Co. "blogging" about "why we used abc codebase," but the reality is that it's simply rehashing well known information in narrative form for the purposes of PR, and worst case scenario is that it's just unoriginal op-ed garbage.
See: "We should replace Facebook with personal websites," which is currently trending at #10 for HN, above this OP at #16.
EFF is a great organization and can't say that it's surprising to see that this is the first time in a long time to come across an exception to the rule.
fwiw, line_len=79 is the default on both windows and linux ime. You would only encounter overflow if you (1) shrunk the terminal from its default width and (2) printed a message that was longer than that shrunken width.
If you really needed to have a progress bar that accounted for a shrunken display, it could be accomplished trivially with Python 3.? and less-trivially with Py2.
I could see depending on this library if the application was client facing and needed to be automagically pretty.
Also, one thing to note is that tqdm only fetches the console width when init'ing a progress bar... if you shrink the terminal while a progress bar is still "in progress," you will encounter the same overflow issue.
https://i.imgur.com/fvEeaJA.png
My library function is:
import sys def writeToTerminal(txt, line_len=79): # line_len is the max num of characters that can fit onto a terminal line without overflowing to a newline
# overwrite the line with blank spaces
# this takes care of the case where len(txt) is fewer than the [ len(txt) when this function was last called ]
sys.stdout.write( "\r" + " "*line_len )
sys.stdout.flush()
# write the txt, trimming to line_len
sys.stdout.write( "\r" + txt.replace("\t", " ")[:line_len] )
sys.stdout.flush()
Example usage:from time import sleep L = list(range(10)) for c, i in enumerate(L, start=1): writeToTerminal("%i / %i" %(c, len(L))) sleep(1)
That is exactly what this library does: "tqdm does not require any dependencies (not even curses!), just Python and an environment supporting carriage return \r and line feed \n control characters." -- https://github.com/tqdm/tqdm
Seems unnecessary imo to depend on an external library just to wrap and auto-prettify those 2 stdout commands.
The unfortunate thing is that the headline of this article should probably be "Google's Secret China Project Now Even More Secret."
Having written extensive amounts of SQL and greater than zero lines of COBOL (f. you, Lawson), this really couldn't be further from the truth.
> For a start, the bizarrely English-oriented structure forces a completely different ordering of the code than what comes out, and the syntax appears to completely ignore the underlying tabular concepts.
Every language has keywords; I'm not sure how you expect to write code that doesn't involve English in some form. Is the concept of `SELECT this_data FROM this_source WHERE true_conditions ORDER BY columns` really that convoluted? Sure, it definitely gets more complicated, but is there really a significantly better way to do it that doesn't involve taking away low-level control from the programmer, in exchange for something sexier and easier to pick up?
> Not to mention that IMO joining on foreign keys shouldn't be a thing--the database should be able to figure out what you want when you write `order.customer.address.taxRegion.rate`
Why can't you have a key-value storage engine that doesn't involve using keys to look up values?! (Is that really your question?) Okay, just as an example, what if you have more than one address for a customer? You need a way to tell the engine which address(es) you want.
> There's just so much awkwardness in trying to write a SQL query that I can definitely see why people would avoid it.
While I don't claim that SQL is easy (or always intuitive), saying that it is "terrible" for the above reasons is like saying that C is terrible because it's not Pythonic.
https://imdb.com/title/tt1263704/
I think you really knock Kubrick without giving proper respect to his work ethic. And sure, luck is when preparation meets opportunity, but Stanley had the preparation part in spades, in a way that even many other successful "titans" probably do not.
Wonder where Immortal Technique would fit within that chart.
In addition to being of personal interest (I think it's much more difficult and impressive to create rhymes with 3+ syllables due to the natural constraint of a smaller basket of words), it would also, presumably, avoid the issue that the author highlights:
> I used a research methodology called token analysis to determine each artist’s vocabulary. Each word is counted once, so pimps, pimp, pimping, and pimpin are four unique words. To avoid issues with apostrophes (e.g., pimpin’ vs. pimpin), they’re removed from the dataset. It still isn’t perfect. Hip hop is full of slang that is hard to transcribe (e.g., shorty vs. shawty), compound words (e.g., king shit)
(As you may already know), Swartz was heavily influenced by Chomsky, and Aaron definitely had that pessimistic view of the "news machine." But imo, it seems justified in hindsight considering the backlash that he personally experienced after (arguably, single-handedly) stopping SOPA in it's tracks. His legal persecution was practically guaranteed after that; he was going to be found guilty of something, eventually. Unfortunately, the Secret Service got him by the legal balls for using MIT's facilities to bulk download JSTOR docs.