Better HN
topnewbestaskshowjobs
Log inSign up

yudlejoza

163 karma · joined Jul 27, 2014 (12y ago) · 121 submissions

Submissions

comment 4y ago · link · parent

How is this news? Apple has had the exact specs (27 in, 5K res) available since something like 5-7 years ago, both as a stand-alone monitor and as an iMac.

comment 5y ago · link · parent

The example of "foo bar" didn't work with while but inserting tr fixes it:

    echo "foo bar" | tr ' ' '\n' | while read -r var; do echo ${var}; done
For examples in general, I guess something like "cat file.csv" could work. (the difference between using IFS= and not using it is essentially whether we want to preserve leading and trailing whitespaces or not. If we want to preserve, then we should use IFS=).

comment 5y ago · link · parent

Of xargs, for, and while, I have limited myself to while. It's more typing everytime but saves me from having to remember so many quirks of each command.

    cat input.file | ... | while read -r unit; do <cmd> ${unit}; done | ...
between 'while read -r unit' and 'while IFS= read -r unit' I can probably handle 90% of the cases. (maybe I should always use IFS since I tend to forget the proper way to use it).

comment 5y ago · link · parent

One way to think of a monad is through the example of a shell (e.g., bash) pipeline:

# cat data.csv | process-1 | process-2 | ... | process-n > final-output

Imagine you have this pipeline that already works for data.csv. But now you have data2.csv which has some difference (e.g., some values are null, while the original data.csv had no null values).

Monads are an approach to making the existing pipeline work (with minimal changes) while still being able to handle both data.csv and data2.csv. The minimal changes follow a strict rule as follows (this is not a valid shell command anymore):

# wrap(cat data.csv) ] process-1 ] process-2 ] ... ] process-n > final-output

In other words, only two kinds of changes are allowed:

- You can bring in a wrap function, that modifies the entries of the given csv data.

- You can bring in a new kind of pipe ']' instead of '|'

The idea being, the wrap function takes in original data stream, and for each "unit" (a line in the csv file, called a value) produces a new kind of data-unit (called monadic-value). Then your new pipe ']' has some additional functionality that is aware of the new kind of data-unit and is able to, e.g., process the null values, while leaving the non-null values unchanged.

Note, you didn't have to modify any of the process-1 through process-n commands.

BTW, the null value handling monad is called the 'maybe monad' (and of course there are other kinds of monads).

If you make the existing pipeline work in this way, you essentially created a monad to solve your problem (monad here is the new mechanism consisting of the new value, and the two new changes, the wrap function, and the new pipe).

edit: There may be a need to also modify the '>' mechanism. But I think that is not essential to the idea of a monad, since you could replace ">" with "] process-n+1 >" (i.e., you created a new outermost function 'process-n+1' that simply converts the monadic-values back to regular values).

edit 2: If instead of handling null-values, the purpose is to "create side-effects" e.g., at every pipe invocation, dump all/some contents of the data into a log file, then the kind of monad you end up creating would be something like an "I/O monad".

comment 5y ago · link · parent

Most comp-biologists who work directly with programmers are some of the biggest jerks, and the least qualified tech folks.

They hide all of that under "I'm a scientist, you're not".

comment 5y ago · link · parent

No similarities. The focus is different.

- BOINC looks like an interface for end-users to volunteer compute resources for various (existing) distributed-computing projects.

- Post is about building your own distributed system starting from minimal-yet-effective principles.

comment 5y ago · link · parent

What a compiler does used to be called automatic programming in the 1960s.

comment 5y ago · link · parent

I hadn't either. But I refer to the method as 'code isolation'.

There are a bunch of related stuff that's interesting:

- code slicing (known as code-splitting in JS community).

- round-trip compilation

comment 5y ago · link · parent

Thanks for putting it in context. This is exactly what I'm looking for. (making it practical, I'll take care of that myself).

comment 5y ago · link · parent

Wait, wait, wait. I was going to point out llvm/clang, but they disabled that too?

It's a BSD/MIT-license tool. Any idea why they did that?

second big-picture question: how hard is it to code up ast (as long as the source language is not C++)? we have lexers, parsers, PEGs, what not.

comment 5y ago · link · parent

99% of the effort is 'what hash function?'

comment 5y ago · link · parent

Consider a candidate both on a 'holistic-track' and a 'single-score track' and require them to meet standard on only one of the two.

comment 5y ago · link · parent

False choice fallacy.

comment 5y ago · link · parent

When it comes to measurement, 1.7320 is not the same as 1.732

The trailing zero was part of the measurement and, hence, is included in the significant digit count.

That also means you can't just measure 1.7320, and report 1.73200 instead (or 1.732). You have to report only, and exactly, what you measured.

(I'm ignoring rounding in what I said).

comment 5y ago · link · parent

I was going to mention that but 'zone' skipped my mind. I kept thinking 'solaris sandbox?'

comment 5y ago · link · parent

Lemme know when the catfight between systemd and docker is over.

I'm a bit busy with chroot and freebsd-jails over here.

comment 5y ago · link · parent

I hate to admit this, but I'm one of those types too (who you wouldn't want as the authors of your obit).

I've been called every name in the book by my own friends, e.g., Dunning-Kruger, "full of it", etc, etc. I know all these terms. I just don't know how to come across as a humble person, despite it hurting in my personal/social/work life. The only thing that helps is if I interact with others less (there I go again).

comment 5y ago · link · parent

If you switched from vim to evil-on-emacs, you didn't really switch to emacs. You switched to something akin to a best-of-both-worlds.

comment 5y ago · link · parent

Racket is about a gazillion times bigger than R6RS.

And R6RS is too big for me.

comment 5y ago · link · parent

I'm a big fan of C but, to be fair, your example makes border-line abuse of the macro system. In my opinion, the example doesn't show that C language per se (without the preprocessor part) is capable of higher-order functions (but as others have pointed out, it is, in the form of function pointers).

comment 5y ago · link · parent

I have very little interest in the ML family (well, let's just say that my interest in ML is in a different part of my brain that I don't want interfering with my thinking/exploration about systems like lisp/scheme and what kind of metaprogramming can be done with them).

I guess I'll have to think about dynamic-scoping a little more.

comment 5y ago · link · parent

- I don't get lisp's (lisp-2) dynamic scoping (a big reason I haven't switched from vim to emacs). I'm much more comfortable with the lexical scoping of scheme (lisp-1).

- I don't get big schemes (like R6RS). For a while, I thought of my own implementation of R5RS. But I've heard R7RS is pretty much R5RS with improvements. So R7RS it is.

- But I'd like to have macros. I wonder if R7RS has macros.

- Mainly interested in crazy metaprogramming and logic/relational experiments using Friedman/Byrd school of thought (reasoned schemer, minikanren, constraint kanren, that sort of stuff).

- Finally instead of rolling my own from scratch, I've heard I could use something like chibi as a starting point (additional points since chibi is implemented in C).

Comments?

comment 5y ago · link · parent

I just spent 20 minutes on imgui, as well as retained-mode and immediate-mode, and boy do people love to reinvent the wheel.

My guess: they're going to gloat over immediate-mode for a decade or two, then some folks are going to develop retained-mode code (library/framework/whatever) on top of imgui, and then they're going to gloat over that for another decade. And they'd reach a point where we are today. Fantastic.

The guy in the famous 40-minute video, the beginning of which explains RM vs IM, appears to make claims that he's too busy and doesn't have time writing research papers. Wow. He discovered IM on his own probably, and reached the conclusion that he's discovered something no one else has discovered and should be writing a research paper. Jeez.

comment 5y ago · link · parent

So you're saying big-tech and big-money hates scales and scalability?

Who do you think bought all those billions of android and apple phones and tablets?

12345