Better HN
topnewbestaskshowjobs
Log inSign up

cogs

370 karma · joined Aug 11, 2014 (12y ago) · 74 submissions

Submissions

61.

Gene Drive(en.wikipedia.org ↗)

2 points · by cogs · 10y ago · discuss

62.

The life expectancy of anything(en.wikipedia.org ↗)

2 points · by cogs · 10y ago · discuss

comment 11y ago · link · parent

It lets us turn on and off different functional parts, to see the effect, so we can reverse engineer it.

We don't have good general theories about how brains work, so a good place to start is from the bottom up.

comment 11y ago · link · parent

Wordiness isn't really a problem, because I'm a fast typer and most systems have tab completion and history recall.

For me the benefit is that for lots of problems, whether databases or the filesystem, thinking in terms of sets feels really natural. I can't imagine why you'd want to pipe grep results to grep -v rather than say "and not"

I guess we all prefer the language whose syntax we know the best.

comment 11y ago · link · parent

Blatant plug: My pain at all these unnecessary hieroglyphics & man page work is why I built Crab, so I could use SQL to find things and an EXEC command to run commands on them.

etia.co.uk

Really it shouldn't have to be this hard.

comment 11y ago · link · parent

Crab doesn't pick up metadata during the scan, because this would slow the scan too much.

There is a wrapper function 'metadata' which returns a specific metadata item from a file at a given path at query run time, but this basically runs mdls under the hood.

Crab can handle extended attributes using the EVAL function function which runs an OS command and returns the result as a string. But you have to parse the string, for example to return the size of a resource fork:

select bytes + coalesce(matchedgroup(eval('ls','-l@',fullpath),'.com.apple.ResourceFork\t(\d+)'),0)

comment 11y ago · link · parent

We don't have any linux builds at the moment, if there's demand we'll make some.

We can scan mounted drives, and Crab has a command line switch to treat names as case sensitive or not. SHA-1 calls are probably not practical across a network to compare file contents, even scans can be a bit slow, but you might do something by comparing file sizes.

comment 11y ago · link · parent

The example does check the contents, by using the SHA-1 of the files

comment 11y ago · link · parent

We looked at Log Parser before building Crab. The syntax was far from standard SQL, it didn't have joins etc.

It didn't use string matching to identify subsets of files to query.

And maybe the most important thing, it doesn't have the exec function to run operating system commands on the files you get back in your query results.

comment 11y ago · link · parent

We're working on Windows, the query syntax and the functions are going to be the same.

comment 11y ago · link · parent

Crab is aimed specifically at the filesystem, rather than querying devices or processes.

For example wildcard matching on paths, combined with the exec function to run OS commands on the files you get back.

comment 11y ago · link · parent

Crab has tab completion, so there's not too much extra typing, and the repacement of hieroglyphics by words does help readability.

It's especially handy to see what is going on if you wrote it a month ago, and don't remember all the command line switches.

73.

Crab – SQL for your filesystem(etia.co.uk ↗)

127 points · by cogs · 11y ago · 43 comments

74.

Show HN: Hacking Sleep(etia.co.uk ↗)

2 points · by cogs · 11y ago · discuss

123