HNHacker News
TopNewBestAskShowJobs

cgrubb

237 karma · joined July 5, 2010

Los Angeles
submissionscomments
cgrubb··on Jq: A lightweight and flexible command-line JSON processor
You might check out these:

http://www.w3.org/Tools/HTML-XML-utils/

However, I just use a Ruby script which loads the Nokogiri library:

https://github.com/clarkgrubb/data-tools/blob/master/src/dom...

https://github.com/clarkgrubb/data-tools/blob/master/doc/dom...

cgrubb··on Practical Tmux
C-b M-2 to rotate the panes into a horizontal split.

C-b M-1 to rotate the panes back into a vertical split.

cgrubb··on Do More and `make` Less with GNU Make and Less.js
> Providing a separate %.d rule would fix this issue

Yes. The following is an example of how to handle C header dependencies. It could be adapted to build css from less and would be an improvement on the blog post technique.

    sources := $(wildcard *.c)

    -include $(subst .c,.d,$(sources))

    %.d: %.c
        $(CC) -M $(CPPFLAGS) $< > $@.$$$$; \
        sed 's,\($*\)\.o[ :]*,\ 1.o $@ : ,g' < $@.$$$$ > $@; \
        rm -f $@.$$$$
It uses the fact that if you include a file which doesn't exist but for which there is a rule to build it, GNU make will build it for you.
cgrubb··on Using Vim as a writing environment
LaTeX is ASCII, so no need to enter unusual characters. But LaTeX notation seems like a convenient way to enter mathematical characters even when not creating a LaTeX document. There are LaTeX input methods for Mac OS X, Emacs, and X Windows here:

https://github.com/clarkgrubb/latex-input

cgrubb··on Kolmogorov Complexity - it's a bit silly
I think the post is correct that we can define a language which makes the algorithmic complexity of a given string zero. This doesn't contradict the invariance theorem, as far as I can tell. The constant c in the invariance theorem

    |K_1(s) - K_2(s)| <= c
will be at least the complexity of the special string in the other language, but it still exists.
cgrubb··on Build Tools – Make, no more
There are tools like ocamlbuild and cabal, which are implemented in Ocaml and Haskell, and used to build Ocaml and Haskell.

But ocamlbuild doesn't have a build file. It just knows how to build Ocaml. And build Ocaml is about all it can do. Cabal is powered by a .cabal file, which is a data structure, and a Setup.hs file, which is run like a shell script via runhaskell.

I think what tikhonj envisions would be a lot of work to achieve. Maybe he already knows that. I suspect that the closest most of us will ever get is putting something like this at the top of a Makefile :)

     .ONESHELL:
     SHELL = /usr/bin/runhaskell
cgrubb··on Build Tools – Make, no more
Your build system has types? Is that so you can catch errors at compile time instead of run time? Who builds the build tool?
cgrubb··on OkCupid urges users to abandon Firefox
Isn't there a false dilemma fallacy? Who invented all these fallacies? They seem to be unavoidable.
cgrubb··on Space Elevators Are Possible
Early in the book:

    The first few years will enable 20ton payloads without humans [radiation
    tolerance an issue for the two week trip]...
From Finding 7-5:

    Radiation is not a problem for tether climbers, as the designers will
    incorporate this threat into the design requirements and ensure operational
    success through any radiation environment.  Historic precedence supports this
    conclusion as the space community runs spacecraft in all regions where the
    space elevator will be operating.  However, when people are included in the
    tether climb [after some years of robotic success], the radiation problem
    becomes an order of magnitude more difficult.  There are many ways to reduce
    the radiation and shorten the trip, which will have to be incorporated when
    the human element is added.
Although the authors envision eventually using the elevator for transporting humans, I don't see any discussion about how to speed up the trip or increase the shielding.

There is a fairly long section on debris. The authors note that significant debris only exists in low earth orbit. They think the chance of collision is small, but large enough that the situation needs to be monitored. They think debris can be tracked and that if a collision were forecast, the cable could be moved. Also, they think space faring nations should be tasked with removing some of their junk from orbit.

cgrubb··on Record-Breaking Meteorite Crash on Moon
It doesn't look like there are fewer craters at the north pole:

http://www.wired.com/images_blogs/wiredscience/2011/09/lunar...

cgrubb··on Why we love Scala at Coursera
To put some meat on the discussion, what would be an example of a logic error which would be introduced by a refactoring?
cgrubb··on Message from Mexico: U.S. Is Polluting Water It May Someday Need to Drink
Having read up more on this, it looks like there are 2 active uranium mines in AZ, and one in each of NE, UT, WY. Industry people seem to think leaching is the cleanest way to mine uranium. Older techniques created radioactive dust.
cgrubb··on Message from Mexico: U.S. Is Polluting Water It May Someday Need to Drink
I think this is the mine:

https://en.wikipedia.org/wiki/Smith_Ranch-Highland

This is the process:

https://en.wikipedia.org/wiki/In-situ_leaching#Uranium

Hard to evaluate how serious the problem is without knowing how toxic and radioactive the waste is and how large the underground aquifers are.

cgrubb··on Nassim Taleb: We should retire the notion of standard deviation
Wherein the author makes the suspect claim that newspapers discussing the stock market always define standard deviation using the definition for mean deviation.
cgrubb··on Comments should be sentences
http://en.wikipedia.org/wiki/Straw_man
cgrubb··on Comments should be sentences
Sorry, I didn't think it was hard to find these:

     13     open_source = tokenize.open     # pylint: disable=E1101
     27	# from coverage.py:
     30	    # In Py 2.x, the builtins were in __builtin__
     33	    # In Py 3.x, they're in builtins
     38	    """The same as s.rsplit(sep, 1), but works in 2.3"""
    101	    # Create a module to serve as __main__
    140	        # Restore the old __main__
    143	        # Restore the old argv and path
A reminder of what the blog post tells us:

     Start comments with a capital, have a subject and a
     verb, and end them with a period.
cgrubb··on Comments should be sentences
As of 2 months ago Ned doesn't follow his own advice:

https://github.com/nedbat/byterun/blob/master/byterun/execfi...

cgrubb··on Tiobe Index for January 2014
When I search for "javascript programming" on Google I get 77M hits, but when I search for "transact-sql programming" I get 937k hits. Which seems real. The relative TIOBE rankings of the two languages does not.

EDIT: more searches:

    amazon:  javascript: 6010 hits, transact-sql: 1194 hits, t-sql: 2162 hits 
    youtube: javascript: 1.3M hits, transact-sql: 3970 hits, t-sql: 250k hits
cgrubb··on Dropbox is down
I haven't seen any proof from the hackers. The emails in the pastbin from @1775Sec are old. They are in this pastebin from a month ago: http://pastebin.com/64PAAV1c
cgrubb··on Life After Amazon
An interesting claim in the article is that Amazon isn't doing its fair share of helping people discover books. The primary source of the research doesn't appear to be public. An excerpt from a July 2013 Salon article:

    According to survey research by the Codex Group, roughly
    60 percent of book sales — print and digital — now occur
    online. But buyers first discover their books online only
    about 17 percent of the time. Internet booksellers
    specifically, including Amazon, account for just 6
    percent of discoveries. Where do readers learn about the 
    titles they end up adding to the cart on Amazon? In many 
    cases, at bookstores.
Why couldn't we be told what percentage of books are discovered in physical bookstores? The idea that 83% of books are not discovered online seems wild. Who did the Codex Group survey?

http://www.salon.com/2013/07/19/amazon_could_be_a_victim_of_...

cgrubb··on Command-line tools for data science
Nice tools. I see some stuff I might add to my own personal repo: https://github.com/clarkgrubb/data-tools

Would be nice if some of these tools became standard at the command line. I don't know about "sample" though, since that can easily be implemented in awk:

    awk 'rand() < 0.2' /etc/passwd
cgrubb··on The Flattening of Ebook Sales
I'm with John Carmack that really it is just better having everything in the cloud:

http://www.youtube.com/watch?v=w1sjRD7NSec#t=3m57s

So ebooks only growing at 5% with 25% market share surprises me. At that rate it will take ebooks 10 years to draw even with print:

http://www.wolframalpha.com/input/?i=Solve%5B0.25+*+1.05%5En...

cgrubb··on High-fructose corn syrup prompts considerably more weight gain than sugar (2010)
It's not the corn subsidies; it's the tariff on sugar imports. The US cannot produce much cane sugar domestically.

Corn subsidies are only about $2B a year, and 75% of corn is used for animal feed or ethanol.

    http://farm.ewg.org/progdetail.php?fips=00000&progcode=corn
    https://en.wikipedia.org/wiki/Maize#U.S._usage_breakdown
cgrubb··on Venezuela: My experience in the surveillance state
> I would love to read a similar run down on what amount of money, intelligence and human resources the US has pured so far in the Venezuelan opposition.

How much money is given to Venezuela is public.

http://gbk.eads.usaidallnet.gov/query/do?_program=/eads/gbk/...

It takes some time to make sense of this data. The funding agency and the implementing agency are usually the same. I personally am not familiar with some of the agencies, so I have to read about them on Wikipedia. The "funding account" seems illuminating. The "implementing partner" is I think who got the money in Venezuela, but all we get is the implementing partner "type".

All the same, it doesn't look to me as if any money is given to opposition political parties.

cgrubb··on Huge 'Dead Zone' Predicted in Gulf of Mexico
You might double check your source. Lawn fertilizer is a $5B industry, but it is usually priced at a dollar a pound, and a 50 lb bag might have 5-10 lb of N and 5-10 lb of P. USDA numbers for fertilizer use by crop are available, and based on those it looks to me like lawns account for less than 10% of the national fertilizer consumption. Corn uses 50%.

    http://www.epa.gov/greenacres/wildones/handbk/wo8.html
    http://www.lowes.com/cd_Fertilize+Your+Lawn_624094472_
    http://www.ers.usda.gov/data-products/fertilizer-use-and-price.aspx#26720
cgrubb··on The Setup: Joe Armstrong
I went ahead and asked him and here is what he said:

@clarkgrubb I use the #erlang Prolog system github.com/rvirding/erlog from @rvirding and swipl.

cgrubb··on The Setup: Joe Armstrong
Which implementation of Prolog does Joe use I wonder?
cgrubb··on Announcing Kiln Harmony: the Future of DVCS
I've been doing Google searches every now and then to try to assess the relative popularity of Git vs Mercurial. Two years ago it seemed to be 2:1 in favor of Git. A year ago it seemed to be 3:1 in favor of Git. Now I think it is about 5:1 in favor of Git. Here are my most recent Google hit counts:

    git 208M
    git revision 6M
    git version 56M
    git control 19M
    mercurial 29.5M
    mercurial revision 1M
    mercurial version 7M
    mercurial control 6M

Google trends of "git repository" vs "mercurial repository":

http://www.google.com/trends/explore#q=git%20repository%2C%2...

update:

    hg revision 5M
    hg version 55.5M
    hg control 63.M
    hg OR mercurial revision 6M
    hg OR mercurial version 70.5M
    hg OR mercurial control 74M
The decline in popularity of "mercurial" vs "git" seems real, but I agree that "mercurial" searches may be under-reporting the popularity of Mercurial. The top hits for "hg -mercurial revision" have nothing to do with Mercurial, tho.
cgrubb··on Why do programming languages use curly braces?
Features of BCPL (Martin Richards, 1967):

  * used { } instead of BEGIN and END keywords
  * single type called WORD
  * declared variables with LET
  * used // style comments like C++
Features of B (Ken Thompson, 1969):

  * used = instead of := for assignment
  * variables could be declared AUTO or STATIC
  * semicolons as statement terminators
  * ++ and -- incrementors/decrementors in prefix and postfix position
Features of early C (Dennis Ritchie, 1970)

  * two types: int and char
  * struct introduced in 1973
  * /* */ style comments from PL/I
  * && and || operators with short-cut semantics
cgrubb··on Why Use Make
Ant doesn't conditionally re-execute a recipe when the prerequisites are newer than the target. Such logic isn't needed for Java projects since it is built into javac. Hence Ant is okay perhaps for Java projects but inefficient for others.
← PreviousPage 2 of 3Next →