Unix Commands I Wish I'd Discovered Years Earlier - <AUTHOR> http://spin.atomicobject.com/2013/09/09/5-unix-commands/ <comment><USER2> If anyone is interested there were several great posts on Hacker News a while about about useful UNIX commands [1, 2, 3]. I have also created several screencasts about command commands like the following [4], and one about the Filesystem Hierarchy Standard [5].

      ls man pwd cd top ps df du cp mv rm mkdir rmdir less cat vi

[1] [https://news.ycombinator.com/item?id=6046682](https://news.ycombinator.com/item?id=6046682)

[2] [https://news.ycombinator.com/item?id=5022457](https://news.ycombinator.com/item?id=5022457)

[3] [https://news.ycombinator.com/item?id=4985393](https://news.ycombinator.com/item?id=4985393)

[4] [http://sysadmincasts.com/episodes/13-crash-course-on- common-...](http://sysadmincasts.com/episodes/13-crash-course-on-common- commands)

[5] [http://sysadmincasts.com/episodes/12-crash-course-on-the- fil...](http://sysadmincasts.com/episodes/12-crash-course-on-the-filesystem- hierarchy-standard)

<comment><USER3> Great links, though I admit when I saw the OP I was expecting content like that and was pleasantly surprised that they really were "Unix commands I wish I'd discovered years earlier", and not the standard array of unix tips+tricks that you can get by without for awhile but as you become more advanced become second-nature.

"Man ascii." The number of times that I wound up generating my own ascii table from whatever language I was working with...

"xxd" I always either used search in emacs hex-mode (which I find cumbersome and annoying but haven't taken the time to customize), or rolled my own search using a programming language. This would have come in handy SO many times back when I used to muck around with videogame save files and the like. I never even knew it existed nor how to discover that it did.

'cal' I learned about early on so never missed it and the 'ssh' stuff kind of fits into the regular "unix tips and tricks" category.

<comment><USER2> re: ascii tables

You reminded me of something. There is actually a really cool and simple site called asciiflow [1], which I use all the time to draw diagrams for explaining things in email, etc. It's pretty cool, and was even submitted several times to HN [2, 3].

[1] [http://www.asciiflow.com/#Draw](http://www.asciiflow.com/#Draw)

[2] [https://news.ycombinator.com/item?id=2847177](https://news.ycombinator.com/item?id=2847177)

[3] [https://news.ycombinator.com/item?id=3598177](https://news.ycombinator.com/item?id=3598177)

<comment><USER4> Wow. This is really cool! Not only can you make the ascii drawings, but there is an integration with a service called ditaa (unaffiliated) that then turns your ascii drawings into actual images. I am keeping these. [http://ditaa.sourceforge.net/](http://ditaa.sourceforge.net/)

</comment></comment></comment></comment><comment><USER5> Command line globbing! For the uninitiated:

Let's say my pwd is `/home/projects` and i want to edit `/home/projects/a_huge_sprawling_app/940j_394/lol/flight_controller.rb`

      `vim **/flight_controller.rb`

opens our flight_controller.rb straight away. In terms of effort, this allows you to basically omit a `find -name` when you're in a rush to edit some damn file where the hell is it again damn we need to reevaluate this directory str...

\----

Double bang to re-use your last terminal entry. One great use, taking all the pain out of forgetting your sudos

      `rm -rf /var/log`
      rm: cannot remove `/var/log': Permission denied
      `sudo !!`

All evidence of wrongdoing is now destroyed.

\-----

Ok, here is an awesome one for users of the ultimate cloud IDE: Vim.

In your local ~/.ssh/config:

      `ForwardX11 yes`
      `SendEnv WINDOWID`

In your remote server's /etc/ssh/sshd_config:

      `AcceptEnv WINDOWID`

In your vimrc:

      `set clipboard=unnamedplus`

This has the effect of seamless yank and paste between local and remote vim sessions, no need for ctrl+shift+v.

I love linux.

<comment><USER6> FWIW, the double-star recursive globbing was added in Bash 4.0. My reading of the manual[1] suggests it is disabled by default, and can be enabled by setting the 'globstar' shell option. I believe it's enabled by default in zsh.

[1]: [https://www.gnu.org/software/bash/manual/bash.html#The- Shopt...](https://www.gnu.org/software/bash/manual/bash.html#The-Shopt- Builtin)

<comment><USER7> I just tried it on bash 4.2.25, and it worked, even though I just learned about it. Maybe not every OS enables the same default options for Bash (I'm using Lubuntu 12.10 at the moment)

<comment><USER6> Yep, that is a fair point. I should have qualified my statement about bash's defaults, since many OSs include their own custom start-up files that may modify the defaults.

</comment></comment></comment></comment><comment><USER8> My favorite is the parallel jobs feature of xargs. For example, say you want to run a script you wrote called process-video.sh to do some processing on all the video files in a directory (extracting audio to MP3, converting format, etc.). You want to use all 8 of your cores. You could write a Makefile and run it with -j9, or you can do this:

       find . -name "*.flv" | xargs -n 1 -P 9 ./process-video.sh

This immediately forks 9 instances of process-video.sh on the first 9 .flv files in the current directory, then starts a new instance whenever a running instance completes, so 9 instances are always in flight. (I usually set to number of cores plus one for CPU-bound tasks, hence 9 for my i7 with eight cores [1].)

If you add -print0 to the find command and -0 to the xargs command, it uses null-terminated filenames (which does the right thing when filenames contain whitespace).

[1] Logical cores. Most i7's have four physical cores which become eight logical cores through the magic of hyperthreading.

<comment><USER9> If you like xargs, but want more flexibility, I'd highly suggest GNU parallel. Such flexibility includes running jobs on multiple computers, running intensive command using all available CPU's (like xargs -P), and creating unique scripts to handle multiple parameters.

[http://www.gnu.org/software/parallel/man.html](http://www.gnu.org/software/parallel/man.html)

<comment><USER10> Parallel also lets you transparently run stuff on remote servers, automatically handling stuff like copying files back and forth. When I have some heavy ad-hoc data processing to do my new favorite trick is spinning up 50-100 ec2 spot instances, point GNU parallel at them and just fire and forget.

</comment></comment></comment><comment><USER11> Replaces the current day of the month with []:

         $ cal | sed "s/.*/ & /;s/ $(date +%e) / [] /"

            September 2013
         Su Mo Tu We Th Fr Sa
          1  2  3  4  5  6  7
          8  9 [] 11 12 13 14
         15 16 17 18 19 20 21
         22 23 24 25 26 27 28
         29 30

<comment><USER12> Hmm, the day is already highlighted for me (inverted color).

<comment><USER13> You can turn that off with:

      cal | cat

<comment><USER14> can you please explain how this works?

<comment><USER15> it's quite a common pattern in commandline apps to check if the stdout is a tty or not, and do things differently if so. So when you pipe it through `cat', it does the no-fancy-included output, much like the colouring that `ls' will apply interactively, but not when piped/redirected.

<comment><USER16> It's important for grepping and sedding - the colors are escape codes and would mess with your regular expressions otherwise (you want to find foobar , but bar was blue so you got foo\e[1;34mbar\e[0m instead, and it doesn't match with foobar).

<comment><USER17> On the other hand, if you _want_ colors displayed you can force grep/ack to display the color 'always' and then pipe the output into 'less -R'. The -R (or --RAW-CONTROL-CHARS) flag has less display output such that color escape sequences work as you might expect, coloring the output displayed by less.

</comment></comment></comment></comment></comment></comment></comment><comment><USER18> One of the more useful bits of ssh is not mentioned: remotely running commands.

Example:

ssh username@host "echo $HOSTNAME && sudo somecommand && cat somecommand.log"

There's probably a better way to do this, but in a pinch I can fix a problem on dozens of machines just by altering the host string.

<comment><USER19> The single most useful thing about ssh to me is that it connects stdout/in across the channel (this is behavior inherited from rsh). This allows for e.g.:

      % (cd /foo; tar cpf - .) | ssh bar \(cd /baz\; tar xpf -\)

Or:

      % cat ~/.ssh/id_rsa.pub | ssh bar tee -a .ssh/authorized_keys

<comment><USER20> Forgive my ignorance, but I don't know what what it means to connect "across the channel", but it sounds important. Do you know a link that explains the concept? I've failed to Google it.

<comment><USER21> It means that whatever you put into the ssh process's STDIN gets sent to the STDIN of the remote process. For example you can do this:

        tar cj $bigdir | ssh host 'tar xj'

That creates a tar.bz2 archive on your machine, sends it over ssh to the remote host, where it's unpacked. Ad hoc compressed and encrypted file transfers made easy.

<comment><USER22> That's a good illustration, but rsync, if available, would generally be preferred for that use case:

      rsync -az $bigdir host:$bigdir

<comment><USER19> Sure, of course. But I've used that tar|ssh combination so much that it was the first example of using the rsh-like stdout/in pairing that came to mind. As much as I bitch about Unix and POSIX and horrific shell brain damage, I still reach for crazy shell pipelines when I have data manipulation tasks up to some pretty large scale _n_.

</comment></comment></comment></comment></comment></comment><comment><USER23> I recently used xxd to illustrate the concept of text encoding, and put together a little vimscript to make it easier to visualize:

      "Toggle hex edit mode
      nmap <Leader>h :call ToggleHex()<CR>

      let g:hex_mode_on = 0

      function! ToggleHex()
          if g:hex_mode_on
              execute "%!xxd -r"
              let g:hex_mode_on = 0
          else
              execute "%!xxd"
              let g:hex_mode_on = 1
          endif
      endfunction

Stick this in your .vimrc, type something, use \h to convert it to hex, change a value, then \h to convert it back and observe how the text has changed. Not super useful, but a neat party trick.

</comment><comment><USER24> Mac OS: pbpaste & pbcopy

For instance:

pbpaste | fgrep -i "`pbpaste -pboard find`"

To search the copy clipboard with the find clipboard.

<comment><USER25> On X11 systems, there's also xclip:

        xclip -o -selection clipboard

<comment><USER26> There's also xsel, which seems to be installed by default more often than xclip.

      … | xsel -b  # Copy.
      xsel -b | …  # Paste.

</comment></comment></comment><comment><USER27> Rather than 'man 7 ascii', there's the 'ascii' command itself.

It will also provide encodings for single characters: $ ascii a ASCII 6/1 is decimal 097, hex 61, octal 141, bits 01100001: prints as `a' Official name: Miniscule a Other names: Small a, Lowercase a

        ASCII 0/10 is decimal 010, hex 0a, octal 012, bits 00001010: called ^J, LF, NL
        Official name: Line Feed
        Other names: Newline, \n

<comment><USER28> Which Unix includes that command?

<comment><USER27> Debian GNU/Linux. It's the 'ascii' package.

</comment></comment></comment><comment><USER29> Protip, you can make emacs use mdfind with (setq locate-command "mdfind")[1]

[1]: [http://emacsredux.com/blog/2013/07/05/locate/](http://emacsredux.com/blog/2013/07/05/locate/) (setq locate-command "mdfind")

</comment><comment><USER30> I know it's not exactly an unknown command, but I didn't know about "sort" until last week.

It's freaking fast and convenient, sorts hadoop reduce results like a champ.

<comment><USER2> One of my favorite things about unix is that you can chain commands together with pipe (|). Say for example that you have a example data file that looks like this:

      # Deflection    Col-Force       Beam-Force
      0.000              0              0
      0.001            104             51
      0.002            202            101
      0.003            298            148
      0.0031           104            149
      0.004            289            201
      0.0041           291            209
      0.005            104            250
      0.010            311            260
      0.020            104            240

You can chain commands together to quickly get ball park figures. I do this all the time when reviewing log data to get simple counts and look for anomalies.

      $ cat data.txt | grep -v '#' | awk '{print $2}' | sort | uniq -c
          1 0
          4 104
          1 202
          1 289
          1 291
          1 298
          1 311

Let me break this down a little. I _cat_ data.txt, which just prints the contents to the console, I use _grep_ to remove the _#_ header, then use _awk_ to print the second data column, the _sort_ the values for my next procedure, and lastly I use _uniq -c_ , which takes the input and counts all the unique values. So you can see that "4 104" means that 4 instances of 104 were found. I use this often to look at httpd logs for IP addresses or to review sudo commands, etc. Very handy!

ps. there are optimizations that could be done here, but that what is great about unix and "one function" utilities. There are many ways to the same destination!

<comment><USER31> Yes, there are some ways to simplify. You can get rid of the "UUOC". Instead of

         cat data.txt | grep -v '#'

you can do:

         grep -v '#' data.txt

or you can simplify further by moving the grepping into awk, so that the full command becomes

          awk '!/#/{print $2}' data.txt | sort -n | uniq -c

sort -n is good to use for sorting numbers. You could probably pull the sort | uniq -c into awk somehow, but I have already demonstrated the full extent of my awk knowledge. One of these days I will get around to actually learning it.

<comment><USER25> You can also pre-sort if you have GNU utils:

        sort -n -f 2 <data.txt | awk '!/#/ ...

</comment></comment></comment></comment><comment> why-el `cd -` to go back to the previous directory. Saved me LOTS of time over the past few months.

<comment><USER32> Wow. Thanks for this. I always cursed myself for forgetting to pushd, and now it turns out I didn't need to!

<comment><USER33> I recently found out that zsh lets you magically popd as well, as long as you're cding deeper into the tree. If you jump to a different subtree it will pop its internal stack until it finds a parent of the target dir.

</comment></comment></comment><comment><USER34> I recommend Quicksilver on mac, free and powerful. It lets you to find a lot of stuff (application, contact, email, etc.) and manipulate them (send, forward, print, etc.)

[http://qsapp.com/](http://qsapp.com/)

<comment><USER35> Also in that vein on Mac it's worth having a look at Alfred [http://alfredapp.com](http://alfredapp.com)

<comment><USER36> Alread rocks. You can develop workflows for common groups of tasks and it integrates well with iTunes, 1Password, Terminal and other system actions/apps.

<comment><USER37> It really does. My computer would be like 30% less usable without it. The file search is particularly amazing.

</comment></comment></comment></comment><comment><USER38> bash(?) thing I wish I'd discovered years earlier: diff <(command1) <(command2) instead of command1 > file1; command2 > file2; diff file1 file2; rm file1 file2

<comment><USER39> Yup, cool use of named pipes.

<comment><USER40> Named pipes are filesystem objects you create with mkfifo.

What's in use here is more widely known as "process substitution".

<comment><USER39> Which works by creating two named pipes and feeding them to diff and pumping your processes data into them. Process substitution is built on named pipes, they are the enabling mechanism that makes it work. Try this in a terminal:

      echo <(true)

And you'll see the anonymous named pipe created by the subshell and passed to echo.

</comment></comment></comment></comment><comment><USER41> Do yourself a favor: unzip the source for ascii.7 and change the order of the tables: hex, then decimal, then octal.

You'll thank me later.

<comment><USER17> I kind of like how the hex and char columns are next to each other though. Makes it easier to read those two columns together quickly.

</comment></comment><comment><USER42> I recently discovered ncdu ([http://dev.yorhel.nl/ncdu/scr](http://dev.yorhel.nl/ncdu/scr)) as an alternative to du. Quite handy.

<comment><USER43> baobab ?

<comment><USER17> baobab is nice when you have X around, but ncdu has allowed me to get back up and running on more than one occasion.

</comment></comment></comment><comment><USER44> xargs. Can't tell you how many times I wrote quickie C programs and awk scripts to do what xargs does.

[http://sidvind.com/wiki/Xargs_by_example](http://sidvind.com/wiki/Xargs_by_example)

<comment><USER45> And find, that's a nice alternative to xargs when your args are a huge set of files.

<comment><USER46> You can also use parallel instead of xargs when files are huge.

</comment></comment></comment><comment><USER10> GNU Parallel. My new favorite command. I have probably written at least two or three ad-hoc, buggy, feature poor versions of that command before discovering it.

</comment><comment> brown9-2 I'm unreasonably excited about discovering xxd.

<comment><USER47> xxd is on OSX, but not on FreeBSD. Under FreeBSD, I always use 'hd somefile.bin'.

<comment><USER48> I have xxd on my FreeBSD setup.

        uname -rms
        FreeBSD 9.1-RELEASE-p19 amd64

Although the xxd man page doesn't have the BSD label, and is from 1996, so I'm not sure if xxd only recently found its way into FBSD.

        This manual page documents xxd version 1.7

        AUTHOR
           (c) 1990-1997 by Juergen Weigert

<comment><USER49> It maybe in ports, but it's not part of the base install:

        $ xxd
        xxd: Command not found.
        $ uname -rms
        FreeBSD 9.1-RELEASE amd64

edit: fixed typo where I put _xdd_ instead of _xxd_

<comment><USER48> I didn't add xxd on my local FBSD (installed last night) setup, and my remote FBSD shell has xxd installed by default...

        $ uname -rms
        FreeBSD 9.1-RELEASE-p7 amd64

        $ xxd -v
        xxd V1.10 27oct98 by Juergen Weigert

Perhaps different builds have different things included?

<comment><USER49> No, it installs as part of _vim_ : [https://news.ycombinator.com/item?id=6361210](https://news.ycombinator.com/item?id=6361210)

<comment><USER48> [http://vim.wikia.com/wiki/Improved_hex_editing](http://vim.wikia.com/wiki/Improved_hex_editing)

You're right, xxd is included with vim, but as an external program.

 _Vim provides this capability through the external program xxd, which is included by default in standard distributions of Vim._

My pedantic nature was hung up on the release dates of the respective programs, as xxd predates vim on Unix.

</comment></comment></comment></comment></comment></comment></comment><comment><USER50> TL;DR: man ascii, cal, xxd, ssh, mdfind

<comment><USER51> `mdfind' in non-Mac UNIXs is spelled `locate' (and the corresponding `updatedb' updates the indexing db, obviously (although you don't have to do this often, as it runs as a cron job)).

<comment><USER52> mdfind is incomparably more powerful than locate.

</comment></comment></comment><comment><USER53> I have the bad habit of trying out everything in /usr/bin (linux, OX) and in c:\windows\system32 (and further on, digging Program Files / Applications / etc.).

This is how I discovered myself "fsutil" (Windows) :)

</comment><comment><USER54> I'm always surprised at the lack of general knowledge of Regular Expressions, so egrep would be a huge one for newcomers.

</comment><comment><USER55> I want a command that counts files in a tree like du does sizes but without having to pipe _find_ through _wc_ which is crazy for hundred thousand files.

Can't they just directly access inodes for high speed counting?

<comment><USER56> tree does this, don't know about suppressing the actual tree, but it tells you number of files and dirs printed at the end.

<comment><USER49> A regex match will do that easily enough:

        tree | egrep -o "[0-9]+ file(s|)"

edit: or you could just tail the output (should have thought of this first!)

        tree | tail -n1

</comment></comment></comment><comment><USER57> A personal favorite: the file command. Through deep magic(5), it can describe the content of a lot of files.

</comment><comment><USER58> Never knew about the "cal" command. I especially like that you can quickly look up a previous or future month/year. >> cal 3 1973 quickly shows a calendar of March 1973

<comment><USER59> you can even look up `cal sept 1752`

<comment><USER60> Funny, 3-13 are missing here.

      > cal sep 1752
         September 1752
      Su Mo Tu We Th Fr Sa
             1  2 14 15 16
      17 18 19 20 21 22 23
      24 25 26 27 28 29 30

Edit: Oh, colour me surprised. [https://en.wikipedia.org/wiki/September_14](https://en.wikipedia.org/wiki/September_14)

<comment><USER61> This was the best thing I learned today

</comment></comment></comment></comment><comment><USER62> One of my favorites: column -t

Examples include: $ df -h | column -t $ column -t -s: /etc/passwd

</comment><comment><USER63> I really love pushd/popd.

<comment> guard-of-terra zsh has AUTO_PUSHD, guess what it does.

<comment><USER64> jump just made it into oh-my-zsh:

[http://jeroenjanssens.com/2013/08/16/quickly-navigate- your-f...](http://jeroenjanssens.com/2013/08/16/quickly-navigate-your- filesystem-from-the-command-line.html)

</comment></comment></comment><comment><USER65> My biggest improvement was about finding out about .inputrc and configuring the Bash to use VIM-keybindings which is pretty handy if you are used to the editor. Also the following mapping from ESC to pressing jf via

imap jf <ESC>

was very nice as I find it much more ergonomic. And to use it in Bash I have

set editing-mode vi set keymap vi

$if mode=vi set keymap vi-insert "jf": vi-movement-mode $endif

set show-all-if-ambiguous on

<comment><USER66> I have my Bash set to vi keybindings, but I had no idea it was possible to remap them. Now I can finally stop hitting escape in Bash too. Thank you so much!

<comment><USER65> Yeah it is great if you can use similar commands across applications. Btw. there is also a nice history inside VIM (implemented as a separate buffer) that can be accessed using q: so you can scroll through the history with jfkl. E.g. I use that for accessing files: If you are working on a project you will probably edit similar files. If you use one "programming" vim sessions where you always edit files via :tabe you will find all the recent edited files in your history and using q:/ you can search for them pretty fast. So over time you have automatically a working environment adapted to your current project.

</comment></comment></comment><comment><USER67> There are some other useful commands for organizing the stream of datas for pretty printing:

column - columnify the incoming stream into columns

pr - set up incoming stream for pretty printing including columnification along or across the screen

tr - sanitize input, collapse several delimiters into one

<comment><USER68> I use tr all the time when I want to check $PATH:

echo $PATH | tr : '\n'

</comment></comment><comment><USER69> One of my favourite traceroute replacements, that is installed by default on Ubuntu: mtr !

</comment><comment><USER70> I love "tail -f" to see realtime updates on a file that I am writing to!!

<comment><USER63> If you don't want to clog up your terminal, try 'less' and then hit 'F' to follow.

<comment><USER71> Better yet use 'less +F'. It's as easy to remember as tail -f.

The advantage of using less here is that you can easily interrupt the tailing (ctrl-c). For example, to search. Then just hit 'F' again to restart tailing. But now your search pattern will be highlighted as the data streams by.

<comment><USER72> I have been using both "tail -f" and less for years, and never knew about this. Thank you. In three lines of text, you have made my logfile-centric life oh-so-much easier to deal with.

</comment></comment></comment></comment><comment><USER73> I believe xxd is actually part of vim and not a Unix command itself. It's used to support hex-editing binary files, but you can see why it's useful in other roles as well.

<comment><USER48> The origins of xxd seem to be a bit murky, as I've seen others say the same thing about xxd being available only if vim is installed, but I've never seen a Unix system that didn't have vi(m) included.

        $ man xxd | grep vi
           Use xxd as a filter within an editor such as vim(1) to hexdump a	region
           Use xxd as a filter within an editor such as vim(1) to recover a	binary
           Use xxd as a filter within an editor such as vim(1) to recover one line

[http://grail.cba.csuohio.edu/~somos/xxd.c](http://grail.cba.csuohio.edu/~somos/xxd.c)

From what I've been able to find, vim was released in 1991, and xxd has been around since at least 1990, whereas vi was written by Bill Joy in 1976. (according to Wikipedia)

Interesting bit of trivia, perhaps someone with a good memory can clear it up for us?

<comment><USER28> There are no hits for xxd on the Unix Tree ([http://minnie.tuhs.org/cgi- bin/utree.pl](http://minnie.tuhs.org/cgi-bin/utree.pl)) so it's definitely not a traditional Unix tool. I'm sitting in front of a BSD system which includes nvi. I don't have xxd.

</comment></comment></comment><comment><USER74> Less +F with search highlighting mentioned in comments is my new fave command. I was beholden to 'tail -f', not that it sucked.

</comment><comment><USER75> One little known, but very handy tip:

At any password prompt, if you knowingly mis-keyed your password, rather than pressing return, getting the "your an idiot" message (often after an annoying 1 - 2 second delay), and having to retype the command, you can actually press ctrl-U, which is the "Clear the line" bash command, and start over typing your password again.

<comment><USER76> For those of us using emacs-style bash keybinds. For vi-style keybinds, it's something more like "esc dd".

PS if you are a Vim user, you owe it to yourself to try the vim-style keybinds. They make a world of difference.

</comment></comment><comment><USER77> For the ssh section, I'd also include sshfs. It's super handy when you want to use local (or GUI) applications for a file on a server, or just to mount your home computer as a drive while you are away. I personally use it to mount my backup server's drive on my Chromebook, effectively giving myself a 500GB hard drive whenever I need it.

</comment><comment><USER78> A great one I found out about recently is 'watch'. Periodically calls a command and refreshes the screen with its stdout.

</comment><comment><USER79> I'm feeling rather good about myself because although I'm a complete novice at linux, I knew the cal command. Yay me! I read about it here: [http://linuxcommand.org/tlcl.php](http://linuxcommand.org/tlcl.php)

</comment><comment><USER80>
        history | grep <keyword>

I use this for <keyword> rsync or rdesktop when I have forgotten the long list of options & directories etc

I also use ctrl R <keyword> at the bash prompt but that only gives me the most recent match.

<comment><USER81> > _I also use ctrl R <keyword> at the bash prompt but that only gives me the > most recent match._ //

Are you sure, I'm using BASH on Kubuntu and I get previous matches by repeated use of ctrl+R.

Actually inspired by a previous post here I made a script "hs" that searches archived history files and shows me all past match lines. Before that I did what you do now.

<comment><USER80> Indeed it does! Excellent

</comment></comment></comment><comment><USER82> ctrl-R in bash was mine.

<comment><USER83> Try C-x C-e – especially helpful if you want to paste stuff from websites.

</comment></comment><comment><USER84> Along with the SSH recommendations, I would include some of the great helpers for ssh agent like keychain.

[https://wiki.gentoo.org/wiki/Keychain](https://wiki.gentoo.org/wiki/Keychain)

</comment><comment><USER85> man units

</comment><comment><USER86> I'm quite impressed no one mentioned 'fg', 'bg', and 'jobs'. Since I got used to them, the number of open ptys in my screen dropped drastically.

</comment><comment><USER87> When do you need man ascii and xxd? I'm a front-end developer so I have no clue about these low-level things but I'm interested and would like to learn.

<comment><USER88> There are a lot of usecases for bot of them, mostly debugging I's say. So I'm gonna tell you what I used them for in the past months:

The ASCII table might be useful when you're dealing with encoding problems and want to know e.g. what exactly happened in a broken URL encoding. I used both of them for binary exploitation in the security class I took at university: When utilizing buffer overflows, it's important to get every byte at the right place of your payload. Sometimes, you also need to treat it as a string and that's where ASCII comes in.

These are only two specific usecases. As I said, there are a lot more. Development of binary file parsers could be another.

</comment></comment><comment><USER89> look at: man utf8 man syscalls

... and the best hint imo to process malformed filenames per 'find -print0' is:

find ... -print0 | { while read -d $'\0' fil ... # use variable fil }

Regards

</comment><comment><USER90> I recently discovered whatis and I love it.

<comment><USER91> Yup, it's a great way to review a lot of commands without reading every man page.

Want to find all the tools on your system that use the curses library (for user-friendly interfaces)? Try this:

      for i in `\ls /bin/* /sbin/* /usr/bin/* /usr/sbin/* | sort -u` ; do ldd $i 2>/dev/null | grep -q curses && whatis `basename $i` ; done | grep -v 'nothing appropriate'

Don't know how your current path finds a program? Use which:

      pwillis@zippy:~$ which df
      /usr/bin/df
      pwillis@zippy:~$ which mount
      /bin/mount

Annoyed that /sbin and /usr/sbin aren't in your path? Use whereis:

      pwillis@zippy:~$ which ifconfig
      which: no ifconfig in (/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/kerberos/bin:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin:.)
      pwillis@zippy:~$ whereis ifconfig
      ifconfig: /sbin/ifconfig /usr/man/man8/ifconfig.8.gz /usr/share/man/man8/ifconfig.8.gz /usr/X11/man/man8/ifconfig.8.gz

<comment><USER92> Apropos 'which', let me show 'type -a':

      % type -a which
      which is a shell builtin
      which is /usr/bin/which

Convenient if you really want to know what you'll be calling.

</comment></comment></comment><comment><USER93> Brace expansion to create a backup:

        cp {file,.bak}

reduces to

        cp file file.bak

<comment> qu4z-2 Brace expansion is great! My understanding, though, is that you'd need to write:

      cp file{,.bak}

Was it a typo, or is there some feature/special-case I don't know about?

<comment><USER93> Oh, you're right. Thanks. (Can't edit the original comment anymore)

</comment></comment></comment><comment><USER94> How can one use a Unix/Linux system without knowing SSH? How to login remotely without it?

<comment><USER19> There are a large percentage of people who first encounter unix on single- interactive-user machines.

</comment></comment><comment><USER95> my favorite is apt-file

<comment><USER96> Thank you.

</comment></comment><comment><USER97> strings - find the printable strings in a object, or other binary, file. Good command to know of if you want to snoop around in binary files.

</comment><comment><USER98> Didn't know about the ascii one.

</comment><comment> guard-of-terra xmlstarlet is a very nice obscure utility which you will love if you touch moderate amounts of XML.

<comment><USER39> Yes it is!

</comment></comment><comment><USER99> Glad to learn of cal!

</comment><comment><USER100> Unix and Common Lisp are similar in many ways:

1\. Both are operating systems

2\. Both are conceptually simple.

3\. There is always nice command that does what you want but you somehow forget it. I can't believe that Common Lisp has just 900+ symbols but I routinely forget some of them when programming.

<comment><USER101> My favorite part is when you implement something you could've had running in a minute or so, but instead developed it for hours or days and it's still not as good as the existing solution. I often get that with C and libraries. There has to be a better way to search through existing stuff which is good and proven, not just for C of course.

<comment><USER102> Haskell has hoogle [0], that lets you search by type signature. If you already know roughly what kind of function you want, it's a lot easier to sift through a tiny handful of (or even a single) functions that match a given type signature.

ISTR Forth had something similar, or maybe I'm just thinking that in Forth, words are almost uniquely defined by their stack annotations.

[0] [http://www.haskell.org/hoogle/](http://www.haskell.org/hoogle/)

</comment></comment></comment><comment><USER103> ssh, come on...</comment>


Optimal Purely Functional Priority Queues (1996) [pdf] - <AUTHOR> http://www.brics.dk/RS/96/37/BRICS-RS-96-37.pdf <comment><USER2> Nice data structure. As one would expect from Chris Okasaki (unfortunately I'm not familiar with the other author).</comment>


Creating standalone Mac OS X applications with Python and py2app - <AUTHOR> https://www.metachris.com/2015/11/create-standalone-mac-os-x-applications-with-python-and-py2app/ <comment><USER2> If you want to package your Python application, you should really take a look at PyInstaller[0]. I have been using it for years with great success.

[0]: [http://www.pyinstaller.org/](http://www.pyinstaller.org/)

</comment><comment><USER3> How does this package layout interface with code signing and bundle IDs?

My main project uses a custom-setup ".app" bundle on Mac OS X (combining both a pure Python front-end and C++ bindings) and I've found that it does require a bit of care to see correct behavior.

For instance I found that El Capitán seems to really hate symbolic links now and will consider a code-sign tainted if there is an outside symbolic link (at least, for certain link destinations?).

And I found, at least on older Mac versions, that system calls would sometimes think my application _was_ Python and assume the Python bundle ID instead of my own, if I simply ran Python itself. Whereas, after I included a built binary directly in the MacOS folder that essentially says "int main(int argc, char* argv[]) { return Py_Main(argc, argv); }", it was fine.

I wanted to run the system Python by _reference_ and not bloat my executable; the call-Py_Main() approach worked well for that, too.

<comment><USER4> Do you happen to have a repo for this app you speak of? Would love to take a look!

<comment><USER3> Yep. :) It's "MacTerm":

        https://github.com/kmgrant/macterm

The Python front-end is mostly here:

        https://github.com/kmgrant/macterm/tree/master/Build/Application/PythonCode

The ".app" bundle layout is constructed as part of the build:

        https://github.com/kmgrant/macterm/blob/master/Build/GNUmakefile

...but basically it puts Python scripts and a Python-runner into "MacOS", and Python and C++ libraries into "Frameworks". You could also download the built ".app" to see the final layout.

This is actually quite a bit simpler than it used to be. In the old days I was able to support both PowerPC and Intel, multiple versions of Python and about 6 different old Mac OS X versions in the same bundle. I still can't quite believe that it worked. :)

<comment><USER4> Awesome! Thanks for sharing, will definitely dig through this. :)

</comment></comment></comment></comment><comment><USER5> This looks great. There is also rumps[0] if you just need to create a status bar app from Python code.

[0]: [https://github.com/jaredks/rumps](https://github.com/jaredks/rumps)

<comment><USER6> Thanks, added a link to the post!

</comment></comment><comment><USER7> If I see correctly this is using python 2?

<comment><USER8> Yup, has a `from __future__ import print_function` in one of the examples in the bitbucket repository.

</comment></comment><comment><USER9> Just a reminder that this is a wrapper for the python app and not a compiler, hence someone can easily dig through the app and get your Python code.

</comment><comment><USER10> Is Slack's desktop app just a container for web-based technologies?

Is it's iOS app pure native or is it also built with web technologies?

<comment><USER11> No idea why you are getting downvoted -- Slack for OSX is built on Electron AFAIK. [http://electron.atom.io/](http://electron.atom.io/)</comment></comment>


Ask HN: What are the best songs to listen to while cranking out code? - <AUTHOR>

I'm doing a survey and wanted to get a sense for the most popular songs or types of music that everyone listens to while cranking out code. <comment><USER2> I prefer Electronica while drinking Mt. Dew.

<comment><AUTHOR> Thanks for your feedback - I appreciate it.

</comment></comment><comment><USER3> I'm most productive in silence.

<comment><AUTHOR> Thanks!

</comment></comment><comment><USER4> I like to play this song :</comment>


GitHub Open Source Survey 2017 - <AUTHOR> http://opensourcesurvey.org/2017/ <comment><USER2> A lot of great information here that can be used to think about the viability and sustainability of open source projects.</comment>


The invasion of corporate news - <AUTHOR> http://www.ft.com/intl/cms/s/2/937b06c2-3ebd-11e4-adef-00144feabdc0.html#axzz3Dz2wbYoI <comment><USER2> I noticed a recent increase in the amount of native advertising, especially poorly labeled "sponsored content," and built a chrome/firefox extension to flag these articles [1]. It includes rules for the sites mentioned - Buzzfeed, Mashable, Quartz, and Vice - as well as about 100 others.

Reactions from publishers and native ad companies were surprisingly positive - some even reached out asking to me add their sites. In general I think a lot of people in publishing are very conflicted about the problem because it gets into journalistic ethics, which are deeply ingrained.

Currently an organization called the IAB provides the standard for the industry, but it's vague and lags behind innovation in native ads [2]. Native ads aren't necessarily bad, but their inconsistency that makes them very deceptive to users. I think publishers would benefit from an updated set of standards that enforce consistent messaging.

[1] [http://ianww.com/ad-detector](http://ianww.com/ad-detector)

[2] [http://www.iab.net/nativeadvertising](http://www.iab.net/nativeadvertising)

<comment><USER3> A great idea, thanks. A suggestion: If you could post it someplace that allows user reviews, I'd be much more likely to download it. It's hard to tell if it will cause performance problems, installs/uninstalls well, false- positive/negative rates, identifies advertorials that I wouldn't find on my own, etc. I could try it, but there are many, many add-ons to try!

That said, I hope it works well and becomes widely used. The publishers should be putting that alert on their pages themselves.

<comment><USER2> Thanks for the feedback. The chrome/firefox pages have user reviews but there aren't many of them.

I was sensitive to performance when I wrote it - in most cases detection rules are single selectors. It won't run anything on sites not in the db. No library dependencies.

There's a phantomjs test suite that flags false positives and negatives. Of course, I can't personally compile a list of every site with sponsored content, so if it's not on the list the addon won't display anything.

If you're interested, the code is open source at [http://github.com/typpo/ad- detector](http://github.com/typpo/ad-detector).

Hard for me to say whether it can spot ads that you can't. Many people think they aren't susceptible to ads like these, and I'm one of them, but I built this for peace of mind. Sponsored content can be easy to miss. My favorite examples are this Yahoo news article on climate change (written by an oil company), and a Newsweek article on personal injury lawyers:

[1] [https://finance.yahoo.com/news/global-cooling-real- inconveni...](https://finance.yahoo.com/news/global-cooling-real-inconvenient- truth-140500879.html) [2] [http://www.newsweek.com/10-best-personal-injury- attorneys](http://www.newsweek.com/10-best-personal-injury-attorneys)

</comment></comment></comment><comment><USER3> Here is why the integrity of journalism is so important:

In my experience, most people form opinions by effectively shopping among the various narratives offered by the many forms of media, including those described in the article, and picking the one they like most -- as if they were shopping for a sweater to wear. Then they base their opinion on the chosen narrative, but of course once the questions are framed and facts established, their 'opinion' is preordained.

That is no accident. The narratives often are created by interests whose goal is to manipulate public opinion, and their stories are repeated widely, wittingly by their agents and unwittingly by everyone else. This isn't conspiracy theory; you can read plenty of legitimate research where this process is openly described; even the vocabulary you probably use to discuss public issues often is carefully constructed by someone. Public opinion can be manipulated to vary widely from the facts (consider climate change, Saddam Hussein's connection to 9/11, etc. etc.) and also it is an extremely valuable asset. Manipulating it can change history, and create and destroy political and personal fortunes -- and nations, as well as start/end wars, kill/save hundreds of millions of people, and make/lose trillions of dollars ('regulation is choking the experts on Wall Street'). So of course there are many, many people who will manipulate it. There is a game being played and most people don't know it is happening, much less that they are its objects.

How does this happen? I think many people are swayed by the big lies -- they can't believe so much is so deceitful. Also, in my experience the best educated, smartest people I know are often the most easily led; perhaps they are hamstrung by their intellectual confidence, because I often hear them repeating one side or another's talking points and underlying propaganda. Finally, it's hard to educate anyone on this issue; there is no nice way to say, 'you've been fooled' and 'most of what you say is someone else's propaganda'.

But how does it happen? It's not true that society can rely on citizens to sort truth from falsehood; the reality is that people are easily led. It is up to the elites in our society, including journalists, to ensure they are getting something closer to the truth. I doubt there is a solution for corrupt elites.

<comment><USER4> If you come up with a different understanding from the mainstream it will take an hour of your time to explain it to the average person, if and only if they are extremely open minded, and then they will forget it.

The mainstream media gets to talk to hundreds of millions for a couple of hours every week. At least it's a bit better now that there's the internet.

<comment><USER5> "The mainstream media gets to talk to hundreds of millions for a couple of hours every week."

Its known that the numbers are single digit millions, for individual shows.

[http://tvbythenumbers.zap2it.com/category/ratings/top- news/e...](http://tvbythenumbers.zap2it.com/category/ratings/top-news/evening- news/)

Probably double digit millions if you add it all together. There is likely a lot of overlap. "News junkies" watching ten newscasts equals ten views, but doesn't equal ten different viewers.

Maybe triple digits if you add the entire world together across all languages and cultures. But that might be pushing it.

The primary use of the news is signalling positions to the other side. Nobody is supposed to learn anything from it, just signal to other groups.

</comment></comment></comment><comment><USER6> The single most depressing quote from the article, understandably lifted even on the page itself:

> _" For every working journalist in America there, are now 4.6 PR people, up > from 3.2 a decade ago"_

We can respin (pun intended) that in slightly different way: _journalists in US are outnumbered by spin doctors more than 4 to 1_. That's a sad figure for anyone who cares about finding out the truth.

<comment><USER7> Not sure what makes me more sad, the idea that you think journalists are in some way involved in the task of "finding out the truth" or that you are surprised by the ratios. Journalism has been on its death bed for at least a decade with the number of people working in that field dropping every year, while marketing and advertising have continued to grow in a world where the standard user expectation is to not pay for online content and where they instead expect to be surrounded by advertising as the price of admission.

<comment><USER6> It is subtler than that, but I am surprised by the ratios.

Journalists do not themselves uncover truths. They uncover material and details that can point to a truth. And the core of the problem is that journalism is _slow_. In the time it takes to fact-check an investigative article, the spinmeisters have had ample time to do what they do best. Namely, set up smoke and mirrors.

The power asymmetry is painful, and I have no doubt about this being even a recent thing. There's a quote attributed to Mark Twain on the subject: _"A lie can travel half way around the world while the truth is putting on its shoes."_

</comment></comment></comment><comment><USER4> Reminds me of this Conan O'Brein piece.

[http://www.youtube.com/watch?v=TM8L7bdwVaA#t=26](http://www.youtube.com/watch?v=TM8L7bdwVaA#t=26)

Basically, 100s of local newscasts are all using the exact same script, even on trivial human interest stories where they could improvise.

</comment><comment><USER8> In case you haven't seen it yet, I highly recommend taking the next 11 minutes to watch John Oliver talk about native advertising:

[https://www.youtube.com/watch?v=E_F5GxCwizc](https://www.youtube.com/watch?v=E_F5GxCwizc)

</comment><comment><USER9> I wonder when the golden age of unbiased news reporting was. I'm 55 and my whole life everyone complained about the biased media.

Heck, even the reporting on the Boston Massacre is a classic of bias.

<comment><USER3> >I wonder when the golden age of unbiased news reporting was. I'm 55 and my whole life everyone complained about the biased media.

Agreed; people naturally exaggerate the good old days and forget how advertisers and other interests often owned [EDIT: figuratively and literally] many media outlets. Maybe it's better that those powers publish their own stories; at least they generally own up to it rather than hiding behind journalists for legitimacy.

But I also disagree strongly: It's a matter of degree, of course. No journalism ever was written, edited and published by wise saints, but some is much better than others. There is Fox News and there is the Financial Times; neither is purely bad or good, but one is far better than the other. The problems discussed in the article make journalism significantly less valuable and reliable, and there is no good substitute for it. The public simply will lack good information and will believe more false information.

<comment><USER10> > There is Fox News and there is the Financial Times; neither is purely bad or > good, but one is far better than the other.

I used to believe so too. And I also believed that the BBC was far better than either, because they may have failed to be unbiased, but they definitely made a goodwill effort towards it.

That's what I used to believe until the recent Scottish referendum, when I started observing the actual behaviour of the media closely. And then you start to see that there is no difference. The BBC were just as nasty, ignorant, lying amoral shits as Fox news generally are.

I would look at the Google News feed and watch as the Daily Mail and the BBC and the Financial Times would compete to update the same lying crap to basically spam the newsfeed so that they would always be the top story. Truth be damned.

I love the world, and I love most people because people are generally great and mostly do the right thing, but you are not cynical enough.

<comment><USER11> Your post is no better than the reports from the flawed media; it's full of name calling and presents zero facts backed by any evidence.

It's not like we can approach the Scottish independence as a physics experiment: run it in a controlled environment, adjust for different variables, and expect the results to be replicated in another laboratory. So in this case I'm going to be skeptical of anyone who claims there's a "truth" that I can choose and sleep soundly at night knowing I made the right choice. It's too complex of an issue - socially, politically, and economically.

I'm cynical enough to suspect you're not unbiased either and that you have a self-interest in one side of the Scottish independence discussion.

Too bad for both of us that cynicism have never solved any problem.

</comment></comment></comment></comment><comment><USER12> Wow. Scary trend in corporate control of the local news.

I have been concerned for a long time about corporate control of the few large news outlets like MSNBC, Fox, CNN, etc. I think that they all filter the news and enforce a slanted version of the news not in the public interest. There are some organizations like Democracy Now that do a much better job.

<comment><USER13> > Scary trend in corporate control of the local news.

Local news has been in a death spiral since the early 1990s, and no longer exists in most places that aren't big enough to have skyscrapers. I think there's a strong case that this is better than nothing, and that the honesty of its patronage limits the damage (and will encourage competition).

This is not theoretical to me. I grew up in the area, and do not feel that McClatchy (who basically has a monopoly) has managed its East Bay mastheads in an effective or useful manner.

<comment><USER4> There used to be good independent radio in the early 90s too but it all got bought up by clear channel. I used to listen to the radio but the music stopped changing in the early 90s after grunge came out.

<comment><USER14> For music I like to think that Gen X nailed it. My 18 year old bought a record player and collects 80's and 90's records while keeping up with the new stuff, but maybe it's just the man keeping her down.

</comment></comment></comment></comment><comment><USER15> As Marshall Mcluhan said: The medium is the message.

When television came to dominate the media landscape in the 60s, it also redefined news and media. Now social media and the internet is starting to do the same, in its own way. Inherent properties and biases of this new medium are distorting the types of content that fit in it.

</comment><comment><USER16> Personally, I think this is a good thing, because the more blatant aspect of the propaganda coming out of these outlets will inspire and frighten the people on the other side -- inspiring competitive voices.

We've operated in a world where influence is more subtle and it was easy to pretend that the news was unbiased. It wasn't, especially at the local level. The reporting wasn't propaganda, but the editorial board directs the reporters -- and the juiciest news is always the stuff that isn't in the paper, or is buried in section Z somewhere.

One of my relatives was a cabinet-level official in a mid-sized city in the 80s and 90s, when a hotshot reporter drove a Porsche. Unless it was a personal scandal affecting the Mayor, or people were marching in the streets, my relative could either make a phone call or have his boss make a phone call and kill/neuter a story.

If you look at news in the American Revolutionary era through the Civil War, it was big mess of different news outlets with very well defined biases. It's different than the late 20th century model of Woodward and Bernstein in the paper and a fatherly figure with good hair on TV, but it worked and will work again.

<comment><USER17> > _" the editorial board directs the reporters"_

... and both the editorial board and reporters select _how_ to cover the news.

Some of my relatives were active on a significant political issue in the 80s and 90s, holding state-level positions in a well-known organization. As a teen, I would occasionally attend rallies, protests, etc. (sometimes with counter-rallies/protests across the street) and watch from a distance, and then I'd watch the news coverage that evening. The camera always seemed to fall on awkwardly dressed senior citizens from our side, ignoring our speakers who were often young professional women who were excellent public speakers, and ignoring the large and diverse crowd. And the camera never showed the guys on the other side making threatening remarks (though I know they got those remarks on film); they'd instead seek comment from a lawyer in their office to give a calm presentation of that side. So even though they covered the event, the coverage gave the impression that one side was professional and well- spoken while the other was out of touch and weird, which was exactly the opposite of the impression I got from being there.

<comment><USER18> I was once filmed for a documentary (on migrant workers) made for BBC and I was quoted saying something like "This newspaper used to be full of job ads" \- they cut off the ending of my sentence: "now it is all in the internet". Plus starting the interview with my daughter crying - while in fact she was mostly quiet during the 3 hours filming - they cut the moment that she did cry and put it at the start of the interview to set up the emotional tone.

I understand that they did this to make a 'story' out of it, it was not really malicious - but I was surprised to see such a blatant manipulation done in a BBC documentary.

<comment><USER19> after the BBC coverage of the Scottish Independence referendum, I am not surprised anymore. Sad to say from a public service...

</comment></comment></comment></comment><comment><USER20> Bernays would be jealous. [https://en.wikipedia.org/wiki/Edward_Bernays](https://en.wikipedia.org/wiki/Edward_Bernays)

[http://vimeo.com/85948693](http://vimeo.com/85948693) The Century of the Self - Part 1

</comment><comment><USER21> This is a serious issue in the UK, particularly where local governments use taxpayer money to put free 'newspapers' in everyone's doors. It's actually reached a point where the national government has had to look into what one MP has called, "propaganda masquerading as independent newspapers"[1]

[1] - [http://www.editorsweblog.org/2010/01/21/uk-government-to- inv...](http://www.editorsweblog.org/2010/01/21/uk-government-to-investigate- local-council-papers)

</comment><comment><USER22> This issue comes from the increasingly shameless attitude from corporations toward what is, plain and simple, getting money. Now there are news about multibillion dollar businesses coming up, start-ups that become successful, etc, etc. Big companies are realizing this and are starting to take action. Ugly action.

</comment><comment><USER5> There is another oddity about the article

"emerge in the age of hyper-local digital news brands such as Patch"

Patch is closing down and firing people. Ours closed. It does not appear to be a survivable business model, although they gave it a good try and it was interesting reading while it lasted.

</comment><comment><USER23> I'm not sure how that's really new tho. Its stronger than ever before if anything, but ive seen non-sponsored news and news that were factual since i dont know.

</comment><comment><USER24> _Cardiff University researchers estimated in 2006 that 41 per cent of UK press articles were driven by PR, a phenomenon known as "churnalism"._

Wow.

</comment><comment><USER25> related pg essay: [http://www.paulgraham.com/submarine.html](http://www.paulgraham.com/submarine.html)

</comment><comment><USER26> Never believe anything.

</comment><comment><USER27> What's the difference between corporate influence and political influence regarding news? Politicians influence the news from their beginning, the only difference being that they pay reporters and media outlets with tax money. Given the small revenues that a news article generates, I fully understand the temptation to write for a check. Hey, at least the journalist doesnt have to blackmail any company/individual with disclosures they want to remain secret.

<comment><USER28> Not sure where you're from but the US government doesn't fund any news organizations in the US. In developed countries with taxpayer-funded news (like the BBC), there are several layers in between the funding and reporters to protect their independence.

</comment></comment><comment><USER29> I found this article to embody every problem with the attitude of journalists from traditional media institutions. The author effectively is lamenting his loss of role as the gatekeeper of all information. Apparently, all journalism was 'pure' and devoid of any conflicts of interest and the only way to receive the 'truth' for a reader.

You can see this near arrogance flow through much of the anecdotes. "Ugh, more and more PR people trying to get my attention all the time. It's sooo annoying." "Ugh, PR girls are even trying to sleep with me, but you can't compromise my editorial integrity." It's perfectly represents the entitlement of the gatekeeper role that must've been built into that last generation of journalists.

Sorry for the mild rant but sites like Hacker News and Reddit have shown that readers are plenty smart, and capable of sifting through the bullshit, whether produced by a corporation, a newspaper, or an individual. When news media held a monopoly on distribution and there were few sources of info, I understand the danger of a corporation holding the sole lifeline of info. That's no longer the case.

<comment><USER30> > Sorry for the mild rant but sites like Hacker News and Reddit have shown > that readers are plenty smart, and capable of sifting through the bullshit

It's not that they are not capable or smart, it's that they don't bother fact checking every single story or seek out opposing analysis or interpretation, especially for things like US foreign policy.

<comment><USER29> Main difference is stories aren't fact-checked before discussing. In the end the right information ends up disseminated probably as often as a standard news story, it's just the 'sausage is made' in the public eye vs. in a closed newsroom the public has no visibility to.</comment></comment></comment>


Survey of MIT Students on their Stress - <AUTHOR> http://tech.mit.edu/V132/N59/pressure/breakdown/index.htm

<comment><USER2> Very interesting. Some people take this to think MIT students have self-image problems, but I don't see that. To me I see this as most students reasonably confident with their own abilities (although feel they could do a bit better academically, although those are just high standards), but are very humble about themselves relative to their peers.

Compared to most groups in life, this is a very rare breed of "yes I know I'm amazing, but I know the people around me are REALLY amazing". Which I'd argue is shockingly healthy for such a large group of people so smart and under so much pressure.

</comment><comment><USER3> I know I'm judging, but wow, MIT students (for how smart they are in general) are not the most self-confident bunch... 9-21% of students think that next to the AVERAGE, their accomplishments are impressive.

I expected this to be skewed above 50%. I wonder what response sets for this survey would be like at other schools.

<comment><USER4> Yes, and only 31% consider themselves above average academically.

I have to laugh, but it's also sad that so many MIT students feel so insecure. I think it must be the shock that comes from being at the top of one's high school, then arriving at MIT and no longer being head-and-shoulders above most of one's peers.

Anyway, maybe the administration should see if there's something they can do to give students a more realistic view of where they stand.

<comment><USER5> I came here to point that out as well. But I was thinking it was a good thing, rather than a bunch of fools playing out the Dunning–Kruger effect.

One of the more valuable things you can learn as a smart kid in college is that you're not the smartest kid around. It also means that they're being challenged at the school. There's plenty of schools that are hard to get in, but there's no challenge after you're in.

Besides, I don't know about you, but I can't stand people that think (or pretend) they're heads and shoulders above in ability when they're not.

[http://tech.mit.edu/V132/N59/pressure/breakdown/year/index.h...](http://tech.mit.edu/V132/N59/pressure/breakdown/year/index.htm)

<comment><USER6> For me personally, most of the stress does come from being challenged academically.The professors pull no punches, and some of the classes are downright exhausting.

Although I appreciate being challenged, it can be disheartening whenever I observe the local coding guru / math major knocking out problems in a fraction of the time it takes me.

However, I believe that this student response best sums it up:

 _"I still believe it's true that at MIT, students generally compete more against themselves than against each other."_

Everyone simply wants to be the best that they can be.

\- MIT Sophomore in EECS

</comment></comment></comment></comment><comment><USER7> Perhaps this is a little bit of inside baseball, but LOL at the breakdown by Course number for "Academically, I would consider myself above average at MIT".

Course 18 in the lead followed by 8 5 and 6. The only thing that's changed in the past few decades is that 5 is getting a bit more uppity.

<comment><USER8> For those who don't know the numbers, 18, 8, 5, and 6 correspond to the sciences, math, physics, chemistry, and EECS, respectively.

<comment><USER9> For those of us, it would be thoughtful to reveal that in some way in the graphs. Do MIT students really memorize the correspondence of course numbers to subjects?

<comment><USER10> They do.

There's even an MIT "joke" that's just a string of course numbers followed by "out," indicating the stereotypical path of a struggling MIT student.

<comment><USER11> Out of curiosity, what's the string?

<comment><USER12> (Anything)->15->Out.

I suspect there are others.

</comment></comment></comment></comment></comment></comment><comment><USER13> very cool, but from a usability stand point, you should show all the questions without the collapsing. Have to click 2 times for answers is not optimal.

<comment><USER14> Add to that: it should be possible to link to the results of a specific question. Also, there is no mention of the sample size of each group.

<comment><USER15> Really? I thought I saw one for the majors. Might be wrong.

edit: nope, you're right. I was remembering a different tech survey graphic.

</comment></comment></comment><comment><USER16> I admit to a serious case of greener-grass syndrome, but it seems to me that the environment at MIT would do quite a bit to lower stress. In my experience, the primary source of stress when doing what interests you is dealing with people who are either disinterested or otherwise generating friction within the group (not comprehending, communicating, etc). The less of those types, the more stress you get just from _doing hard work_ – something MIT and at least a few others should be perfectly capable of handling ;)

<comment><USER17> People who do hard work tend to bite off more than they can chew, especially at MIT, and there is obviously a limit to how much you can handle. What MIT does right when it comes to stress relief is its housing system. You get to pick where you want to live, and you mostly get your choice (or you can move eventually). That way you can live within a supportive community. It really makes a difference during those hell weeks.

\- MIT '11 MEng '12

<comment><USER18> +1. Columbia is the same way; you're surrounded by talented people who don't need to be stressed, but they choose to be. A lot of people try to do everything (which many are used to from high school) and most find that it's too much too late. After a while, though, you find about the right balance. For most people, this happens second semester senior year (:

</comment></comment></comment><comment><USER19> The gender breakdowns are of particular fascination.

<comment><USER20> Yes. What does "Other" mean?

<comment><USER21> Other could be somewhere on the spectrum between male and female without quite feeling comfortable calling yourself either. (Transgender, maybe even pre-op or post-op gender change.) Or it could mean asexual.

<comment><USER22> "Asexual" isn't the term you're looking for -- asexuality has no more to do with what gender you identify as than heterosexuality, bisexuality, etc. do. The concepts might be related for some people, but they aren't inherently so.

<comment><USER21> OK, what's the term for someone of no gender?

<comment><USER22> I believe it is simply "agender". I've also heard the word "neutrois" for a third gender neither male nor female, but that's not quite the same as no gender.

<comment><USER23> You are correct. Agender or nongendered are both fine (with me, anyway, but I think generally too).

</comment></comment></comment></comment></comment></comment></comment><comment><USER24> Perhaps, the respondents are just being humble. Most MIT students must know that they are clearly above-average students. However, being humble and always striving to improve is a good trait.

There does seem to be a trend of self-confidence improving year-over-year for undergraduates.

<comment><USER25> The comparison is to other MIT students, not to students in general; these results didn't surprise me in that light.

</comment></comment><comment><USER26> MIT students don't know what stress is. Try Georgia Tech for that one. #2 least happy students in 2002.

<comment><USER26> Explain your downvote please. It's not at all helpful to me if you don't explain.

<comment><USER27> You are already downvoted as I type this. I downvote you too. You say some gross generalisation and throw out some statistic without backing.

<comment><USER28> Perfect. now his average is at 3.14! Good job, sir.

<comment><USER26> First post in 159 days to point out that my average is close to pi? Yep, you definitely go to MIT :)

</comment></comment></comment></comment></comment><comment><USER29> 40% of urban planning majors pull an all-nighter at-least once a week.

</comment><comment><USER30> What the hell is course 11??

<comment><USER31> "Urban Studies and Planning". I went to MIT and honestly have no idea what it actually is (beyond the web descriptions of it), and never interacted with anyone from the program -- it's a very tiny program which seems inherently fuzzy.

It's a tiny program, so I suspect a few people who responded really skewed the numbers.

</comment></comment><comment><USER32> I'm looking on my iPhone and all the colors seem the same, how do I read this?</comment>


Ask HN - Feed back Appreciated - CribSpace - <AUTHOR> http://cribscribble.com/

<comment><USER2> My first comment is that it loads VERY slowly. I mean like ridiculously, painfully, unacceptably slowly... Nobody outside a venue like this would wait that long. Especially considering while it loads I have absolutely no clue what the site is or does.

Even your navigation is in Flash so while the huge thing loads there is literally NOTHING to do.

That's your biggest problem for sure. Fix that before you even think of anything else.

Second, is it CribSpace or CribScribble?

Third, even after waiting that painful time for it to load I'm not sure what exactly I'm looking at.

</comment><comment><AUTHOR> Guys would love some (more the merrier) feedback on the site. Still very basic. Would love strategies on how to actually market it and monetise it. Sorry for the asking on the basics.</comment>


The Alice and Bob After Dinner Speech (1984) - <AUTHOR> http://downlode.org/Etext/alicebob.html <comment><USER2> Those interested in cryptology and coding theory should definitely consider "The Code Book" by Simon Singh. It's a great account of how cryptology was used throughout history.

<comment><USER3> "The Information" is an excellent book with similar themes.

</comment></comment><comment><USER4> Someone want to explain the alphabet joke? "A for 'orse, B for..."

<comment><USER5> Wikipedia has a nice article, you might need some of the alternatives.

[https://en.wikipedia.org/wiki/Cockney_Alphabet](https://en.wikipedia.org/wiki/Cockney_Alphabet)

<comment><USER6> Thanks. I didn't recognize it either, but guessed it was Cockney rhyming slang ([https://en.m.wikipedia.org/wiki/Rhyming_slang](https://en.m.wikipedia.org/wiki/Rhyming_slang)), another somewhat similar way to do wordplay in English.

</comment></comment></comment><comment><USER7> I find it interesting that exaggerated description of the pocket calculator at the end sounded a lot like a smart phone. Looks like predictions about future tech can be accurate after all.

<comment><USER8> I feel like the most accurate predictions start as satire or comedy, not as serious bets. Satire plays to our gut instinct of what we suspect from the nature of future, and is shielded from technical criticism, so people feel more comfortable to take a stab at it without having to hedge.

<comment><USER9> There was a short story, which appeared in one of the HP calculator-centric publications of the 70's or 80's, I think written by a certain George R.R. Martin or Gordon Dickson, which attempted to extrapolate the HP 41CX into a portable voice activated assistant that could schedule appointments for you. I remember thinking that was pretty far fetched for a calculator. I don't think it would have made much more sense if the author had referred to the device as a "phone"...

<comment><USER10> On the one hand, if you squint, yes, we all have them in our pockets.

On the other hand, I recall a lot of "personal assistant" predictions in which phones were _personal assistants_ , not just glorified calendars. As in, able to call the other person and do a live negotiation of times over voice, possibly with the other person's assistant. We don't have that yet; that turns out to be harder than we thought. Even the recent trend towards "bots" are still focusing on people interacting with the bots; nobody's brave enough to have the bots reaching out to people _other than their customers_ and interacting with them yet, AFAIK. (Those who seem to use a lot of humans in the backend.)

</comment></comment></comment></comment><comment><USER11> Poor Eve. Always the villain.

<comment><AUTHOR> mandatory XKCD reference?

[https://xkcd.com/177/](https://xkcd.com/177/)

</comment></comment><comment><USER12> Loved this line, never saw it before.

 _We are told by Suetonius that Julius Caesar communicated with the Orator Cicero in a cipher in which 'A' was sent as 'B', 'B' as 'C' and so on. If you apply this cipher to HAL - the computer in the Stanley Kubrick movie: 2001 - you get IBM._</comment>


Why Some People Become Lifelong Readers - <AUTHOR> https://www.theatlantic.com/education/archive/2019/09/love-reading-books-leisure-pleasure/598315/ <comment><USER3> Reading for me goes through cycles. For months, I would not feel like reading at all, except for the daily dose of WSJ.com or HN and Reddit programming. Then, all the sudden I happen to discover a book from those online sources and spend most of my free time to read it. Sometimes, I went back to finish books I abandoned ages ago if they happen to coincide with what interest me at the moment. For example, I started to learn playing piano with some of Bach's easy classical pieces (1st prelude in WTC book 1, minuet, etc...). It strikes me that I have a book discovered from HN called Godel, Escher, Bach from 2009. I stopped reading after the 1s chapter back then. Now, I can't seem to put it down and am on chapter 5. I think knowing a bit about music and appreciating Bach make this book approachable for me again. The other example is Enterprise integration patterns. I got it in 2006 but never finished it. Now, I start reading it again with a lot of interest after getting involved in a project at work with a lot of teams tangled with integration issues.

<comment><USER4> I think that aligns with their third point on motivation.

</comment></comment><comment><USER5> I go through periods of intensive reading, then downtimes. These both span for months.

Problem is a lot of it is dreck.

Some books draw out a story for 1100 pages then stuff all the cool stuff in the last 200 pages. It feels dishonest.

A lot of classics aren't.

A lot of pulp is captivating and fast paced.

I tried reading infinite jest - I had to return it.

I finished fear an loathing in las vegas in a day.

It's a crap shoot.

<comment><USER6> The key is to just put it down and move on to another book if you're not enjoying it. Many people have a completist attitude towards reading - <USER2> continue to slog through to the end of a book once they've started, even if they don't like it. They'll make slow progress, and it blocks them from picking up a new book.

Cut your losses early - your total reading throughput will be much higher, and most nonfiction books aren't worth reading all the way to the end anyway.

<comment><USER7> Interesting. I'm actually heartily in favor of the "completionist" mindset. I adopted it from playing videogames. With videogames at times I would end up hopping from game to game to game, never really finishing many of them. And in a weird sense it felt less fun and it definitely felt less worthwhile. I couldn't have more than surface level conversations about the content and I never felt like my opinions were holistic enough of that content either.

Now I only play one game at a time and I _really_ try to finish it unless it straight up is just not fun for me. I've slogged through parts of games where I've become bored after X number of hours and ultimately been much happier for it as I witnessed everything the game had to offer (especially with regards to story). Final Fantasy XV comes to mind here. The gameplay had become tired after 30 hours or whatever but getting the whole story arc (for all its flaws) was extremely worth it.

I've carried this over to books. Unless I'm really not interested I will stick with the slow parts and generally I've been happy with the results. The Stand by Stephen King comes to mind here. It's like 1,200 pages of tiny font and is pretty slow in the middle but has some stupendous moments and is really an epic tale I'm happy to have under my belt. I do have to pair this with a conscious "required" reading time, e.g. an hour before bed so that I'm always hitting a minimum rate so I don't slow to a snails-pace and read a book a quarter or something.

<comment><USER8> Probably because for you just the act of completing something is _fun_.

Personally I'm reading or playing a video game because of the entertainment it provides. If it's not interesting or doesn't hold my attention, it's not worth slogging through it. Life's too short.

That's one big plus of digital entertainment: I can refund what I don't like in a single click, I don't feel like I _have_ to finish it nor I have to justify my reasons to anybody.

Though I have to admit I've bought for the second time some video games or books I had previously refunded, because I finally understood what's the correct mindset to have to enjoy them fully.

</comment></comment></comment></comment><comment><USER9> I was never in to reading as a kid, and it drove my dad crazy as I am wired personality-wise like him. Reading would become too hard after 3-4 paragraphs and I just thought I was always lazy. I found out I had a print-related disability when I was an adult, specifically severe convergence insufficiency, after I was diagnosed with a rare disease.

I use screen readers now for immersive reading, specifically Voice Dream Reader (iOS|Android) and Kurzweil 3000 (Windows|Mac|Web). I finally got in to reading habitually after reading some history books. It can still be physically painful for me to read, but it is worthwhile.

</comment><comment><USER10> >a chief factor seems to be the household one is born into, and the culture of reading that parents create within it.

Aye, my mother regularly took us to the biggest public library within driving distance. Every few weeks. And we didn't just grab and go, we would spend some time browsing the stacks.

As her mother did before her. It was inexpensive entertainment for those that weren't well off.

I developed very wide interests in everything imaginable, just from stumbling upon really good books.

Mind you though, I didn't develop an appreciation for fiction for a long time. To some, "readers" are those who are always reading fiction.

<comment><USER11> Aside from having literally a room or two full of books at home, the regular trip to the library was literally a highlight of my childhood. Piling up the books to take back, and then running around and choosing a new stack to take out, it was a great time.

It's literally free entertainment for children that lets them effectively supervise themselves, and god knows as a parent one can use entertainment for young children.

Plus its an actual constructive skill.

We live in the time with the most access to the most information available and almost no one wants it. I'm constantly blown away that the default position isn't: "Why isn't the human race just constantly reading?".

<comment><USER12> Even with all of the content of the Internet, I often still look for a book when I'm digging into a new topic and need to be shown the basics A-Z. It's just too hard to get a complete picture from the tiny snippets people organized for free online. Books paid someone to write something with a specific audience in mind. Often, for things like gardening or pottery, a recent book isn't necessarily more relevant than an old book. Libraries are amazing for things like this.

</comment></comment></comment><comment><USER13> My kindle helped me fall in love with reading books. Plus, not having to worry about physical books (heavy, easy to damage), being able to borrow books from the library electronically, and control font size and lighting easily has turned me into a convert, and I couldn't be happier.

<comment><USER14> Same for me. Kindle makes it easy to read during travels.

</comment></comment><comment><USER15> I absolutely love reading. I can't make it through four seasons of TV (my most recent failure is Battlestar Galactica '04) and I can't seem to get myself to suffer through repeated failure at video gaming for more then thirty minutes at a time, but I absolutely love books. My trio of hobbies are coding, writing, and reading and it's a really happy and productive combination!

I prefer fiction, generally hard science fiction and high fantasy (less so the latter), but occasionally if I come across a truly exceptional historical fiction book I'll and that to my TBR list as well (Shogun, Silence, and Pillars of the Earth, for example). I also prefer longer books, since if I'm sitting down to read something I really want a lot of detail and meat there. Even irrelevant details are welcomed, I almost just enjoy the act of reading. When it comes to selecting books, I value some kind of novelty of uniqueness above almost anything else, but it also has to have a sense of craftsmanship.

I must confess I'm addicted to buying physical books, as well. I have quite a few books on Kindle, and do read them, but whenever feasible (and it isn't always) I prefer to buy books from Amazon. Specifically, Mass Market Paperbacks, which I find to be the perfect form factor (and cheaper than Kindle books, too).

<comment><USER16> I suspect your downvote (not from me) came from your calling Shogun 'truly exceptional historical fiction'.

<comment><USER15> Okay yeah that's fair! I was wondering about that. Honestly, thank you for pointing that out. I'm aware it's not really accurate, but more of a western fairy tale, what I more meant by exceptional was unique and with some kind of enjoyment value. If I want to read a history book I can, so as long as I keep in mind that Shogun isn't accurate it should be fine right? (:

</comment></comment></comment><comment><USER17> _If I finish a book a week, I will read only a few thousand books in my lifetime, about a tenth of a percent of the contents of the greatest libraries of our time. The trick is to know which books to read._ \- Carl Sagan, 'Cosmos' (1980)

... from [https://github.com/globalcitizen/taoup](https://github.com/globalcitizen/taoup)

</comment><comment><USER18> I used to read constantly for fun and interest.

Then I entered "higher education" which involves a large amount of "required reading." Although I was able to complete the "required reading" and coursework, I no longer enjoyed reading the way I had before. Reading had become an unpleasant chore.

Now I seem to lack the motivation and attention span for "recreational" reading and when I try it I just don't enjoy it. Reading non-fiction for interest is a bit better, but it still feels too much like drudgery to be enjoyable.

</comment><comment><USER19> From 2007 to 2017, I read zero books. Before that, I only read self help books. I didn't find any use for fiction or novels for that matter. Self help books were actionable to me.

But then I stopped. The most I did during that decade was read Wikipedia entries or cliff notes. But one day I stumbled upon the alchemist. The book came to me at a moment I truly needed it, and it offered me some answers. Little after I read another fiction, Life of Pi. These are simple books with profound messages that can easily lure you back into reading. I ended reading more than 20 books that year.

Today, I can't imagine myself not reading. Books are where smart people take their time to clearly and precisely formulate their ideas. And the great advantage is that when you forget what's in a book, you can read it again.

</comment><comment><USER20> The author talks about picking up a book as an alternative to your phone or watching TV as a post dinner activity. If anything, modern life has consolidated activities from specialised 'things' like radios, phones, books, TV to computing devices. I've been reading on my iPad and phone for years now. This makes me wonder what the impact is to kids - since they learn so much by watching you.

If you pick up a book, you arouse their curiosity to do the same. If you pick up a phone and launch an epub reader - not so much.

<comment><USER21> I have a similar concern with my daughter; I have a Kindle and have had for years, have more or less ceased reading physical books, and do most of my reading before sleeping - so while I read daily, my daughter sees very little of it and almost never something that looks like a book!

</comment></comment><comment><USER22> I'm a life long reader. Finished the majority of the classics section one might find in an american library. I find it hard to get a steady stream of quality narrative with engaging ideas, so I tend to find a good author and read everything I can find they've written. I'm also one of those can't-sleep- more-than-4-hours-a-day people, so I spend time reading books then.

</comment><comment><USER23> If your're reading non-fiction, then you're probably learning something.

If your're reading fiction, then it is most likely just entertainment. So, its equivalent to watching a fiction movie or tv show, or whatnot.

I find it odd thats its encouraged and considered good to just _read_ , regardless of content. _What_ you're reading is critical.

You can read 'Harry Potter' and divert and entertain yourself, or read 'A Brief History of Time', and do the same, but also learn a bit.

<comment><USER24> The act of reading is a skill that needs maintenance. It doesn't matter much whether it's fiction or nonfiction.

Harry Potter is a bit of an unfair example as it's intended as a children's book, they still need to build up the skill.

But more importantly, good fiction (and other art) _teaches about the human condition_. I have learned a lot from Vonnegut and Pratchett even though everything I read by them was fiction.

<comment><USER25> I bet a lot of people have learned about life and being human from Harry Potter as well

(I haven't read it)

</comment></comment></comment><comment><USER26> I used to read a lot and then stopped. There are things that I find more interesting these days, and I've already read the most important books about the subjects I've been interested in. There comes a point where the diminishing returns are too small.

There would have to be a tectonic shift in understanding to get me interested in reading another book.

<comment><USER25> What if the tectonic shift is inside one of those books you'll never read?

<comment><USER26> What if the tectonic shift is in a place you'll never visit?

What if the tectonic shift is in a television show you'll never watch?

What if the tectonic shift is in a friend you'll never meet?

What if the tectonic shift is in a meditation you'll never do?

What if, what if, what if...

<comment><USER25> > There would have to be a tectonic shift in understanding to get me > interested in reading another book.

Maybe I misunderstood this. I thought you meant that you would need a mindset change before you would be willing to consider reading another book. In that case, suggesting that you may never get that shift without reading is a bit of irony (a Catch-22 if you will).

However, if you meant that you wouldn't read a book unless you knew there were some kind of major insight on it for you, then: 1) my statement probably did come off as trite to the point of deserving sarcasm, and 2) I feel bad that your mind is so closed to considering new opportunities.

<comment><USER26> You're still being condescending. Re-read your last line.

My point is that opportunities are everywhere and never stop coming, and so one must invariably pick and choose where they'll look. It generally makes for a calmer life to not get too worked up over FOMO, because it's incredibly rare to miss out on anything really important in the grand scheme of one's life.

</comment></comment></comment></comment></comment><comment><USER27> I used to read a lot, until I entered middle school. You see, in middle school, we had to read 4 books a year from a whitelist and write a report about them and such.

This meant I no longer felt motivated to read a book _not_ on that list; after all, if I read a book from that list instead, I'd be killing two birds with one stone. Reading a book not on the list just seemed like a waste of time. Of course, I decided which books to read by randomly stumbling upon them, not by picking them from some list, so I was rarely motivated to read books that _were_ on the list either. Not to mention that reading was now homework, where I'd need to think about how to write the report and which excerpts to use at all times.

The result was that I just stopped reading for the most part. It sucked all the fun out of it.

<comment><USER25> Not sure how old you are, but at some point you will probably be happier and more successful if you take ownership of your life decisions.

</comment></comment><comment><USER28> > They can be identified by their independent-bookstore tote bags, their "Book > Lover" mugs, or—most reliably—by the bound, printed stacks of paper they > flip through on their lap. They are, for lack of a more specific term, > readers.

Is there some hidden irony in the pointlessness of this paragraph?

<comment><USER29> Humor from the unexpected juxtaposition of an expository style usually used to describe something rare and unfamiliar with the commonness of the thing being described (plus the implication that reading is becoming unfortunately less common today - or at least acknowledging the fear that it may be so).

I found it cute. :)

<comment><USER28> Thanks. I sometimes miss those cues and don't know if I should take things at face value.

</comment></comment></comment><comment><USER30> I've read 50 books this year after reading only 30 last year. I want to really crank then out in these next few months.

It is so important to me to keep reading and keep improving.

</comment><comment><USER31> I am a voracious reader and have been since I was a boy. Travel books, historical fiction, science, biography, history, westerns, sci-fi, detective/suspense, I read them all. I am very fortunate to live in a city with a well-funded (and well used) library system so I have access to just about anything I read or hear about that sounds interesting. It is time well spent.

</comment><comment><USER32> I always found it extremely hard to read anything at length. I could read just fine, but my mind would start to wander, and then I'd have to re-read a page 3-5 times unless I was extremely focused.

I was later (as an adult) diagnosed with ADHD.

Audiobooks work much better for me, as I can do other things at the same time, but I still get the information passively.

</comment><comment><USER33> In primary school I read anything and everything but my favorite was science fiction. After finishing school, I didn't read as much and noticed something: my creativity seemed less and I wasn't coming up with many big 'next step' ideas. After starting to read regularly again, it came back.

</comment><comment><USER34> With mobile devices if you count reading articles etc most people are gonna be life long readers

</comment><comment><USER35> I've never read a book.

At least not a non-technical, fictional one. At school I'd just dig up a summary. Didn't stop me from getting a job at a FANG.

Whenever I read, I feel like I'm wasting my time. It's slow, boring and feels superficial. Just something arbitrary someone wrote. I can't focus and get no value from it.

<comment><USER36> i wonder if your tendency to cut corners is reflected in your code (assuming you're a developer) if you've never read an RFC or grinded through technical documentation. Do you enjoy reading other people's code?

>Didn't stop me from getting a job at a FANG.

probably stopping you from being a top developer at a FAANG

<comment><USER37> Second this. Being a good developer means lots of reading. In the old days that was usually manuals, these days it's far more likely to be whatever Google coughs up, but I'd sure be a lot slower if I couldn't see what others said about whatever unfamiliar territory I'm trying to navigate.</comment></comment></comment>


Emoticons are the future of communication - <AUTHOR> https://medium.com/better-humans/f45d56a8f78d

<comment><USER2> I definitely appreciate the argument that more emotional context is the future of digital communication. I just wonder if emoticons are really the solution to it.

I'd like to think something more akin to snapchat, where someone can send a quick temporary picture of themself smiling, frowning, etc is a much more mature/natural/sensible (not sure the appropriate word for it...) method of conveying the same emotional information.

<comment><AUTHOR> I totally agree with you - I don't think it's specifically emoticons that are the future. Snapchat is definitely a perfect example of the direction we are going in (picture + text).

</comment></comment><comment><USER3> The linkbait title had me all ready to be in a huff but that was very well done.

<comment><AUTHOR> Muahaha</comment></comment>


Ask HN: Do any of you suffer from "front-end fatigue"? - <AUTHOR> This is not an attack on front end development as a craft, my intention is not to start a flame war here. But I look at the tooling and evolution of frameworks etc and I question to relevance of this whole thing. Also why doesn't this happen in backend/AI/systems engineering ? Curious to know your thoughts. <comment><USER2> I find writing front-end code, and process of learning new APIs, tools, and frameworks to do it in different ways, immensely interesting. I find I have the opposite of fatigue; building interesting browser-based software actually energizes me.

</comment><comment><USER3> Ah, based on some other comments, I think I see what you mean with fatigue, because you have to use HTML/CSS/JS or something that compiles into this like Clojurescript and you still have to know what javascript is and how it works to get anything useful done on the front-end. I am praying for a really slick alternative to come soon, where we can capture clicks and events and still keep some sanity with regards to layout, structure, and tying things into the backend via message passing.

</comment><comment><USER4> I think the tooling on front-end vs. backend has something to do with the end of the pipeline. Backend systems can be developed using multiple languages and frameworks that will ultimately run on only one platform. Front-end _can_ be developed with multiple languages, but will ultimately be transpiled to JavaScript and rendered as HTML/CSS. Front-end has to accommodate multiple platforms and browsers.

To me it also feels like the "modern" tooling for front-end is created for front-end developers by backend-developers.

</comment><comment><USER3> What do you mean, designing interfaces or getting code and components to play nicely together?</comment>


JPEGrescan: unique way to losslessly shrink any JPEG file - <AUTHOR> http://pastebin.com/f78dbc4bc <comment><USER2> Is there any other information on what he's doing in the code and why? I wouldn't mind implementing something like this in a project I'm working on.

<comment><AUTHOR> He's basically taking advantage of a trick which is almost never used for compression purposes, so it can be used after any JPEG encoder to improve compression, since nobody else seems to do this.

Specifically, it abuses the progressive scan system. It's well-known that progressive scan in JPEG (which causes the image to load starting at the lowest detail and being refined up to full quality) doesn't just add to usability for the viewer of the image, but it also slightly improves compression. However, progressive scan allows you to specify almost _any_ splitting of the coefficients--each of which gets its own Huffman table for compression.

To make this script, Loren did an exhaustive search of all possible splitting options on a large collection of images. He then collected statistics from this and used it to devise a pretty fast and simple search of the most common best-split situations to maximize compression. You can read the comments for more specific details.

 _Extra note: Loren has been the primary maintainer of the x264 video encoder over the past 5 years and is also an ffmpeg developer._

<comment><USER3> So it's the JPEG version of PNGcrush et. al.?

<comment><AUTHOR> Basically. There are three ways to losslessly compress a JPEG:

1) Huffman table optimization

2) Ordinary progressive scan

3) Trying all sorts of split orders for progressive scan

Most image apps worth their salt hopefully do 1) and 2). This script does 1) if it wasn't done already, and 3), which is its main purpose.

<comment><USER4> Any stats on likely percentage improvements over just doing 1)?

</comment></comment></comment></comment></comment><comment><USER5> Just ran this on some files, random files about 801 or so jpg files...

Pre utility: du -d 1 -k 39710 .

Post utility: du -d 1 -k 37074 .

So about a 6-7% reduction. These are files uploaded via wordpress, not sure if it does any type of reduction by itself in the upload wizard, i doubt it.

Time to run the utility:

          279.84 real       176.08 user        72.19 sys

</comment><comment><USER6> Hey! If the title is accurate, we can just keep applying it over and over, until every jpeg shrinks to 0 bytes!

Yaaaay!</comment>


Show HN: RESTful Bitcoin payment channel server (written in Haskell) - <AUTHOR> GitHub repo: https://github.com/runeksvendsen/restful-payment-channel-server
Hello everyone
This server allows the operator to receive instant Bitcoin payments (no waiting for confirmations) from a single, pre-defined sender; paying the Bitcoin transaction fee only once, when the channel is closed.
One could imagine, for example, setting up a service which sends video in response to payments, the first minute being free (if you have an open payment channel), and then charging, say 0.1 cent per second thereafter. That's trustless pay-per-view. Pretty cool, if you ask me.
I'm at a stage where I'm interested in getting feedback on this, and having people try it out, to see what I've missed. I've been thinking about this for the past two years or so, and have been working for the past year on code, with most of the code written in the past six months (I've rewritten the server at least five times now).
The README in the JavaScript client implementation contains an explanation of what a payment channel is (which is not necessarily a Bitcoin-only concept): https://github.com/runeksvendsen/paychanjs-client/blob/master/README.md#bitcoin-payment-channel-primer. Conceptually, it simply involves requiring each potential receiver of funds to also sign the transaction (as opposed to just the sender), thus solving the double spend problem at the expense of limiting the potential number of receivers.
Side note: if someone is good at JavaScript, I could use help with the client implementation. It works, but it's not pretty. I find myself completely lost in JavaScript land, coming from Haskell. <comment><USER2> Payment channels are cool. REST is cool. This is cool^2.</comment>