Quick tip for developers who use OS X - <AUTHOR> OSX Terminal: hold option and click a position in the current line to move your cursor to that position. #yearslost <comment><USER2> Bash, running in your terminal, understands both the Emacs and the Vi commands. By default is Emacs, so you can C-a (control-a) for beginning of line, C-p to go back in command line history, or C-r to search it.

I prefer the Vi mode, though. Add to your .bashrc

set -o vi

Then you can press escape to go from input mode to normal mode; there k will take you to the previous line in command line history, j to the next line, ^ and $ to the beginning and end of the line, /something will search something back.

Editing is really fast; move by words with w (forward) and b (backward), do cw to replace a word, r to replace a letter, i to go back to input. It will remember the last editing command, just as Vi, and repeat it when you press . in normal mode.

<comment><USER3> I use these settings in my .inputrc. The get me a few more commands and even the ability to escape using jj.

        set completion-ignore-case On
        set bell-style none
        set editing-mode vi

        $if mode=vi
          set keymap vi-command
          "gg": beginning-of-history
          "G": end-of-history
          set keymap vi-insert
          "jj": vi-movement-mode
          "\C-p": history-search-backward

<comment> b-ryan Thanks for this. I switched my input mode to VI and was greatly missing using Ctrl-L to clear the screen when in input mode. I hadn't known about the inputrc before. Adding this line below your "\C-p" line fixed that for me:

        "\C-l": clear-screen

<comment><USER4> Command-K also does the trick

<comment><USER3> Command-K won't play nicely with tmux panes though.

</comment></comment></comment></comment></comment><comment><USER5> Another really useful command is the open

        $ open filename.png
        $ open .
        $ open -e filename.txt
        $ open -a Pixen filename.png

The first command will open the file with the default application.

Open . will open the current directory in finder, which I find very helpful.

The -e flag will open the file in textedit.

The -a will open the file in the given application name.

<comment><USER6> Under Linux there is a similar command: xdg-open

<comment><USER7> or gnome-open.

On Windows the equivalent is start (e.g. start C:\ )

<comment><USER8> I use start all the time, but also frequently curse at its stupid argument grammar and its interaction with auto-quoting on auto-completion. For example, type

      start C:\Doc

Next, hit tab to get

      start "C:\Documents and Settings"

Now, hit return, and watch a new command window open with title "C:\Documents and Settings".

Reason? If the first argument is a quoted string, it is used as the title of the window being opened ([http://www.microsoft.com/resources/documentation/windows/xp/...](http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en- us/start.mspx?mfr=true), [http://stackoverflow.com/questions/154075/using-the- dos-star...](http://stackoverflow.com/questions/154075/using-the-dos-start- command-with-parameters-passed-to-the-started-program))

If you ever use start in batch scripts, pass a dummy first argument of ""

<comment><USER9> You can use `explorer`, which doesn't exhibit this behavior:

        explorer "C:\Documents and Settings"

does what you'd expect.

</comment></comment></comment></comment></comment><comment><USER10> After making the switch to OS X in the last couple years after living in Linux and Windows before that, I think it's objective to say that keyboard shortcuts in OS X are much worse in both ease of use and consistency across applications.

<comment><USER11> Sorry, but this is laughable. Keyboard shortcuts are far more useful and consistent across applications in OS X. I'm failing to understand how you could form this opinion...which shortcuts / programs don't meet your expectations?

I guess I can sum this up by saying OS X has an additional modifier key than Windows, so you basically have 33% more power right out of the gate. The "Windows Key" is nearly useless.

<comment><USER12> > Sorry, but this is laughable. Keyboard shortcuts are far more useful and > consistent across applications in OS X.

I don't agree with this at all.

I find it baffling that a company of great designers made such _bad_ decisions about keyboard shortcuts.

Perhaps they are consistent, but they are consistently bad.

Paste and match style (incredibly useful) is "alt-shift-command-v" i.e. four keys. There are plenty of other shortcuts that also require four keys. Four is too many. Three is too many for such an important function. This is absurd.

Using shortcuts in IDEs is a nightmare on most apple keyboard. e.g. Intellij, to run your program: alt-shift-f10. This is daft in itself, but it actually translates to function-alt-shift-f10 on many keyboards. Yes, you can change your settings, but then you could remap all your keys in any O/S. Miss the function key and you've just muted your volume.

I have no interest in slagging Apple off; I use their products almost exclusively, but this is obviously an area where they messed up. I'd love to see this fixed, although I understand why they probably won't.

<comment><USER13> "Paste and match formatting" shouldn't be necessary for most programs, and isn't a platform standard. Paste is command-V. A sensible application should do the most likely thing the user wants with paste and overload the shortcut for weird stuff. The fact that Microsoft consistently does the weird thing by default isn't a platform problem with the Mac, just with Word.

Now you could point out Pages has the same shortcut and same stupid behavior. I agree, but that's what happens when there's a clear market leader.

(Oddly enough, I've been implementing a web-based word processor, and we make paste-and-match (paragraph) style while retaining (character) styles the default. You can't actually do this in Word or Pages — default or not — despite the fact it's what users want 99% of the time. So if I paste some text with an italicized passage, the font changes to match the ambient styling, but the italics remain. When we implemented it, the UX people were flabbergasted -- they assumed it must be impossible because no word-processor does it.)

<comment><USER8> _" Paste and match formatting" shouldn't be necessary for most programs, and isn't a platform standard._

Yes, it is. [https://developer.apple.com/library/mac/documentation/UserEx...](https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/AppleHIGuidelines/KeyboardShortcuts/KeyboardShortcuts.html) says _" Table A-2 lists the system-reserved and commonly used keyboard shortcuts mentioned in the rest of this document."_

Table A-2: contains ../art/ks_option_2x.png ../art/ks_shift_2x.png ../art/ks_command_2x.png V Apply the style of the surrounding text to the inserted object (equivalent to the Paste and Match Style command). See "The Edit Menu." That links to [https://developer.apple.com/library/mac/documentation/UserEx...](https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/AppleHIGuidelines/Menus/Menus.html#//apple_ref/doc/uid/TP30000356-TPXREF127), which describes the command, too.

I disagree with the claim that this is a bad choice, though. It may not be optimal if starting from a tabula rasa, but Apple did not do that when it introduced the combination, five years ago or so, in my memory. By that time Command-V has done styled paste for about 25 years, making it difficult to dethrone.

We must be glad that we have a standard for this, not angry that it may be a bit complex to type.

<comment><USER13> OK I didn't know Apple had made that a standard -- so I agree with the GP that it's dumb. If I can't easily type a shortcut with one hand, it shouldn't be a standard shortcut.

I'm suggesting the standard paste should behave as expected, not adhere to some literal definition the user doesn't care about. If I copy a passage of text from one document and paste it into another, I generally want it to look like it belongs in the destination document but I don't want to lose obvious intentional styling such as italicization.

The common case should be the easy case. Instead we have the common case and the four-fingered shortcut both doing the wrong thing. Awesome.

<comment><USER8> I think implementing "obvious intentional styling" is an AI problem. Suppose you copy a header, click in a normal paragraph, and paste. Keep styling information? Case 2: copy styled text from Keynote, and paste. Keep styling?

Maybe, the logic in a word processor should be to keep character styling, but not paragraph styling, but I think there will be many edge cases (for example, the user might be using the word processor as a document layout package)

I doubt those edge cases can be programmed away; user intervention is required. Microsoft solves that after the paste. That may be the better solution.

<comment><USER13> You can't program away edge cases, but the current standard behavior fails in the bog standard common case.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER14> Useful when copy/pasting things to share with other people in email and such:

        $ pbpaste | pbcopy

takes the current contents of the copy/paste buffer and removes color/font/background color rich formatting and puts just plain text back into the paste buffer.

And of course pbcopy and pbpaste are also very useful on their own.

<comment><USER15> You can also use shift-option-cmd-v to directly paste without markup :)

<comment><USER14> I can never remember which combination that is, but thanks.

<comment><USER16> You can override any key combination using the Keyboard preferences.

Just make a new shortcut under the All Applications group named exactly the same as the one you want to replace. [http://i.imgur.com/JqBncTy.png](http://i.imgur.com/JqBncTy.png)

I've also had to add an entry for "Paste as Quotation" because that's Mail's default use of Command-V.

</comment></comment></comment></comment><comment><USER17> Nobody seems to have posted this yet:

        python -m SimpleHTTPServer

I'd recommend an alias like "serve". It basically puts the current directory online (binds to 0.0.0.0:8000).

<comment><USER18> Am I wrong to have long dismissed this as little more than an easter egg, or, at best, a toy server to test basic webpage functionality?

<comment><USER19> Yes. It's like a ghetto SCP for giving files to people on windows who don't have SCP. You can use it for basic web functionality, you can use it (carefully) as a mechanism for testing or serving test results. I wouldn't keep it running for days, but it's an amazingly useful tool.

<comment><USER18> Whoa, never thought of it that way. The makeshift SCP is really a good idea!

</comment></comment></comment></comment><comment><USER20> A new one for me I accidentally found the other day..

If you use Spotlight to find something and then want to see the file in Finder, Cmd+click the item in the Spotlight dropdown.

 _Edited from Cmd+shift+click due to note in child comment :-)_

<comment><USER21> isn't it just Cmd+click ?

<comment><USER22> In Mavricks (only one I can be sure of) when you hover over spotlight results and hold Cmd, you get a (quite nice) file preview/info.

</comment></comment></comment><comment><USER23> oo! As long as we're sharing our favourite terminal tips, here's mine: In your .bash_profile, add this line:

alias imgsz='sips -g pixelWidth -g pixelHeight'

sips stands for "scriptable image processing system"[1], and provides terminal users with a toolset for inspecting and manipulating images. The alias above is really useful for web developers who need a quick look at how big a given image is:

        $ imgsz logo.png
        /path/to/logo.png
        pixelWidth: 500
        pixelHeight: 120

[1] [https://developer.apple.com/library/mac/documentation/Darwin...](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/sips.1.html)

<comment><USER24> thank you!

<comment><USER23> happy to help!

</comment></comment></comment><comment><USER25> Lovely, thanks. Also, is it common knowledge that CMD+click on a URL opens that URL in your default browser? Useful for the "Running on [http://127.0.0.1:5000/"](http://127.0.0.1:5000/") messages.

<comment><USER26> Nice tip, thanks. However, it only works with double-click for me.

</comment></comment><comment><USER27> The first thing I do when setting up a new Mac is make the Caps Lock key into another Control key.

System Preferences > Keyboard > Modifier Keys

Saves lots of awkward pinky-bending.

<comment><USER28> Is it me or do Mac Caps Lock keys require you to hold them down for close to a second for them to activate? There appears to be some kind of hardware timer in them to work...?

I noticed this coming from Windows and Linux on other keyboards where tapping Caps Lock works but on Mac OSX with an Apple keyboard or on a Macbook you have to make a real deliberate effort to keep the key down longer than a nanosecond for it to register.

Is it just me who has noticed this?

<comment><USER29> I noticed this on the lock screen. Often you'd have to tap multiple times on caps lock before it even turns on. I assume it's to prevent accidental caps locking, but it can be rather irritating

</comment></comment></comment><comment><USER30> I have tried to use Terminal, but I just can't. The ability to highlight and automatically have the text in clipboard is such a crucial feature in my workflow that not having it even as an option is a deal breaker.

Once I started with iTerm and built a config/flow around it, I can't go back.

Thanks for the tip though! I didn't realize this worked in Terminal too. I'll keep it in mind the next time I'm forced to use it.

<comment><USER31> Same here. Switched to iTerm for proper mouse support in Vim, and you need only click (no option key) to move your cursor in Vim if you have `mouse=a` in your vimrc.

I used to be a die-hard Terminal.app user but with Mavericks it felt incredibly sluggish doing everything from opening to listing files to editing things and this is another reason I moved to iTerm.

Be warned, though, that if you're using Vim with Solarized you and you're trapped in low color mode you want to be sure you're declared as a 256 color term and update your `vimrc` to remove the following for the colorscheme to work properly:

Remove:

* let g:solarized_termcolors = 256

* let g:solarized_termtrans = 1

* let g:solarized_contrast = "normal"

* let g:solarized_visibility = "normal"

<comment><USER32> I added mouse support to Terminal via MouseTerm: [https://bitheap.org/mouseterm/](https://bitheap.org/mouseterm/). Works like a charm with Vim.

</comment></comment></comment><comment><USER33> This works if whatever is currently running in your terminal has support for the XTerm mouse escape sequences.

Option-click is the shortcut to tell the terminal to forward the click to the application running in the terminal. That's usually your shell or some editor.

I seem to faintly remember that at some point this was actually configurable and you could configure the terminal to forward non-option-clicks and only enable selection mode on option clicks. I didn't find this option in current iTerm or Terminal.app versions though - I might just be imagining this.

<comment><USER34> I can confirm that this works with VIM and nano

</comment></comment><comment><USER35> Nother related tip: command + click on a file in iTerm opens it up. Test it out by doing ls -al then cmd+click on file name.

</comment><comment><USER36> Osx terminal uses almost all of the emacs movement keys by default. Ctrl-a and ctrl-e are useful but I find the meta movement keys to be the most helpful. (usually alt or ESC)

Meta-f jump forward a word

Meta-b jump backwards a word

<comment><USER37> It's not emacs, it's GNU Readline (or likely some BSD readline given apple and the GPL) [http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html](http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html).

The shortcuts also work in every text field in the OS.

<comment><USER38> Terminal may be using some kind of Readline, I dunno. But text objects in other OS X applications use _emacs_ keybindings because NeXTSTEP has had them since time immemorial. Like 1990 or so. Doesn't have anything to do with GNU Readline so far as I know.

<comment><USER39> > Terminal may be using some kind of Readline

Terminal.app passes the key sequences to the application running inside of the terminal. The default shell (bash) uses GNU readline, which has an emacs-mode and a vi-mode (emacs is the default).

Terminal.app does not use any Cocoa text fields, so has nothing to do with the Emacs keybindings inherited from NeXTSTEP.

</comment></comment></comment></comment><comment><USER40> Two more (for Bash) -

Ctrl-x, Ctrl-e will pop open your EDITOR so you can edit the command. Saving and closing the editor brings the command back in your terminal and automatically executes it.

fc will bring up your EDITOR with the last typed command. (You can use fc -l to see a list of commands)

<comment><USER41> damn.. thats the real #yearslost for me. I should have focused on learning that instead of the wordback/forward commands.

<comment><USER42> Whoa! I actually like this better than setting vi mode on terminal.

</comment></comment></comment><comment><USER43> Also useful is Apple's support doc listing of keyboard shortcuts. [http://support.apple.com/kb/HT1343](http://support.apple.com/kb/HT1343)

</comment><comment><USER44> Two more tips:

* Ctrl-a to go to beginning of line

* Ctrl-e to go to end of line

<comment><USER45> A couple more:

* ⌘ + ` (tilde key) to switch between different windows of your current application

* ⌘ + l (lowercase L) in most web browsers to highlight the address bar

<comment><USER46> I'm always telling people about ⌘ + `, it makes navigating windows on OSX so easy.

</comment></comment></comment><comment><USER47> mdfind to get Spotlight results in shell.

Also, iTerm is a great Terminal replacement, if you haven't tried it.

<comment><USER48> iTerm does not support OP's tip though.

<comment><USER49> Does for me.

iTerm 2.0 Build 18.104.22.16840112 (latest version)

<comment><USER50> Looks like they just added support for it

</comment></comment></comment></comment><comment><USER51> Increase or decrease volume by small increments: alt + shift + volume up / volume down or brightness up / brightness down. Also Alfred and Shortcat app.

</comment><comment><USER52> I would lose years if I used the mouse in the terminal..

</comment><comment><USER53> To cut & paste files in Finder - use Cmd + C, then Cmd + Option + V.

<comment><USER54> Thank you very much. Have been looking for this shortcut for eons. Made my Day :)

</comment></comment><comment><USER55> OSX also features a lot of neat trackpad multitouch commands that some might not be aware of (my Windows trackpad doesn't understand multitouch.)

Two fingers: up/down: scroll up/down, left/right: forward/back in some browsers (such as Chrome)

Three fingers: up/down: show/hide a list of applications/desktops; left/right: switch desktops one at a time.

Five fingers together/apart: show/hide desktop

Before I discovered these, I was confused why I would occasionally see the forward/back arrow in the browser for a short period of time, not realizing that it showed because I happened to use a couple of fingers to move the mouse cursor.

<comment><USER56> [http://www.boastr.net/](http://www.boastr.net/)

you can add tons of additional trackpad shortcuts too, as well as keyboard shortcuts.

</comment></comment><comment><USER57> The OP tip is nice to have built-in now. If I recall correctly, this was an option that had to be turned on in Terminal Preferences in earlier releases.

Another fave of mine: Ctrl-w for deleting whole "words" at a time. Better than holding that delete key down.

The default shell for OS X appears to be bash (my favorite shell as a Linux user as well).

Just google for Bash shortcuts. Here's a place to start: [http://teohm.github.io/blog/2012/01/04/shortcuts-to-move- fas...](http://teohm.github.io/blog/2012/01/04/shortcuts-to-move-faster-in- bash-command-line/)

</comment><comment><AUTHOR> via [http://apple.stackexchange.com/questions/5435/got-any- tips-o...](http://apple.stackexchange.com/questions/5435/got-any-tips-or- tricks-for-terminal-in-mac-os-x)

<comment><USER58> Great link, I spent a good while digging through there when I first found it. My favorite is using mdfind to leverage Spotlight for file search. Results come up instantly.

</comment></comment><comment><USER59> You can also CMD+click and drag (or double click as long as it's not a URL, which will open) to add to the text selection (like multiple cursors in Sublime Text 2).

Also, Option+click and drag gives you column selection mode.

</comment><comment><USER60> If you'd rather not use the mouse, the fc command will open the last-executed command on vim (this is configurable, I suppose), saving and exiting the file executes the command!

</comment><comment><USER61> Works even when you are ssh-ed into a remote machine! Nice.

<comment><USER41> yep. I tried it myself thinking it wouldn't. wow.

</comment></comment><comment><USER62> Source: [https://twitter.com/blackjack75/status/422036078540103681](https://twitter.com/blackjack75/status/422036078540103681)

More tips linked in above tweet: [https://apple.stackexchange.com/questions/5435/got-any- tips-...](https://apple.stackexchange.com/questions/5435/got-any-tips-or- tricks-for-terminal-in-mac-os-x)

</comment><comment><USER63> So I see a lot of comments in this thread about OSX has a much cleaner interpretation of Command-C vs Ctrl-C in Linux. Actually, the problem is that you should NOT be using ctrl-c to copy in linux. the global copy command in Linux obeys the CUA [1] standard. Copy is defined to be "Ctrl-Insert" and paste is defined as "Shift-Insert". This will work on all kinds of user interfaces on Linux - including the cmdline, the browser, etc.

However this is an issue which I dont know is a bug or something (I'm on Ubuntu 12.04) - if you open "System Settings" in Ubuntu and copy text from there, I'm not able to paste it on the browser, but am able to paste it everywhere else using the command sequence described above.

[1] [http://en.wikipedia.org/wiki/IBM_Common_User_Access](http://en.wikipedia.org/wiki/IBM_Common_User_Access)

</comment><comment><USER64> Type "set -o vi" on your bash, and you can edit your commands with the vi shortcuts.

</comment><comment><USER65> Works in iTerm too.

<comment><USER66> Not for me. Option-clicking produces no result for me on iTerm 126.96.36.19930319.

<comment><USER65> I tested it in iTerm 2 Build 188.8.131.5231228, where it works. It must be a recent addition.

</comment></comment></comment><comment> k-mcgrady Most useful thing I've seen all day - thanks!

</comment><comment><USER14> I wish there was a way to make the mouse cursor stand out more when (and only when) it's over the terminal. Maybe it's because I use a dark terminal background, I can hardly ever see the thing.

There's a system wide setting to make the cursor huge, but I don't want a huge cursor everywhere. And there's a terminal preference to make the insertion cursor different, but that's a different cursor, not the mouse cursor.

When do I want to see the mouse cursor? It's useful for things like highlighting a git hash or a few lines of text for copy/paste.

<comment><USER67> in windows theres something where you can press controll and it will shoot circles out from your mouse which is pretty useful, not sure if there is anything like that in osx

<comment><USER68> There are a few options for cursor highlighting here: [http://osxdaily.com/2011/07/12/3-ways-to-make-the-mac-os- x-c...](http://osxdaily.com/2011/07/12/3-ways-to-make-the-mac-os-x-cursor- more-visible-for-presentations/)

</comment></comment></comment><comment><USER69> drag + drop files to terminal to get its location.

I often do "cd " \+ dragon drop folder to get to that folder in terminal

<comment><USER70> There's a free app called Go2Shell that adds a button to finder to open the current directory in Terminal/iTerm. Also works great in conjunction with "open ."

<comment><USER71> You can drag/drop many things onto an application icon in the dock to open them in a new window.

This includes dragging a folder's proxy icon to the terminal app to open the current Finder window in a new terminal.

The proxy icon is the little icon in the top middle of the window, to the left of the name.

</comment></comment></comment><comment><USER72> Off-topic, but related: does anyone know a way to bind a key, and F-key for example, to a particular application in OSX? The behavior I'm looking for is almost achievable with Spaces - but it's basically when you hit the combo from anywhere, the target application comes to the foreground, or if it's not running, it launches.

Command-Tab is fine and dandy, but I want more _stability_ in my application switching. And if it doesn't exist, I may have to dust off XCode like I've been threatening to do for a while now.

</comment><comment><USER73> As it wasn't mentioned yet: _pushd / popd_

These two commands replace 'cd' and work with a directory stack of different paths.

       $ pushd tmp   # cd to tmp and remember current path /
       /tmp /
       $ pwd
       /tmp
       $ cd /usr   # normal cd to wherever you want...
       $ pwd
       /usr
       $ popd   # pop the stck and get back to the previous path
       /
       $ pwd
       /

Subsequent pushd will stack multiple paths.

It's a built-in of bash and other shells. It works even with Windows' cmd.exe

<comment><USER74> You can also use "cd -" to go back to the previous path:

      $ cd /
      $ pwd
      /
      $ cd /tmp
      $ pwd
      /tmp
      $ cd -
      $ pwd
      /

Not the same, of course, but still useful, I think.

</comment></comment><comment><USER75> Great Tip!

Regarding OSX Terminal, I'm an heavy user since Leopard but it's a shame that after upgrading to Mountain Lion (an now Mavericks) I discovered that they broke VIM vertical selection since control-shift does not generate a keycode anymore [1].

Anyone with the same problem? I tried iTerm recently and I don't like it! :-(

[1] [https://discussions.apple.com/thread/4694342?start=0&tstart=...](https://discussions.apple.com/thread/4694342?start=0&tstart=0)

</comment><comment><USER76> Wait, people use the mouse when they're in the terminal?

<comment><USER77> They do now.

</comment></comment><comment><USER78> I've always preferred, option + left/right for fast moving with left/right for fine adjustment so I don't have to leave the keyboard.

</comment><comment><USER79> Well, if you do not want to use the mouse, you can always:

Ctrl-e: go to the end of the line Ctrl-r: search backwards (input the text)

and you go to the point where the search begins.

</comment><comment><USER80> Great tip, thanks.

Another useful fyi that I haven't seen anybody else mention is the Bash framework bash-it [[https://github.com/revans/bash- it/](https://github.com/revans/bash-it/)]. It has tons of fantastic plugins, aliases and themes out of the box.

I've only tried it on iTerm2, but as it only replaces your .bash_profile file it should work fine on Terminal.

</comment><comment><USER81> The problem here is the "click" part of it.

<comment><USER82> Every once in a while it's much faster to just reach for the mouse than to use keyboard shortcuts.

</comment></comment><comment><USER83> OK, so for vim users with zsh:

bindkey -v

Now be happy, hit <ESC> and, use ^ and $ but also f<letter> t<letter> and also ,;.

You can copy/paste with dd, Y, etc...

<comment><USER84> set -o vi does the trick for vim. Most vi commands work, but when you type <ESC>v this will open vi to edit your command line, in case you feel any command is missing.

<comment><USER85> I've b een using vi-mode in the shell for a while,but haven't been able to get the <ESC>v behavior you described. Did you have to do anything to make that behave?

<comment><USER84> I haven't done anything, my version works under Mac OS X.

</comment></comment></comment></comment><comment><USER86> Doesn't work on iTerm2, which y'all should be using anyways. Besides being infinitely more configurable, and getting tabs right, it's also much faster when you are printing a bunch of text. No idea why OS X Terminal is so slow when it comes to this, but it's actually painful to `cat` a file of more than a thousand lines.

<comment><USER87> I don't cat files too often in my workflow so I guess I don't have that pain point, but I find find iTerm2 has this minor annoying latency (kind of like typing on a wireless keyboard on low battery) that ultimately drove me away from it.

<comment><USER86> Odd. I have never experienced that problem. I don't cat files, but I list git diff output, view log files, etc. Even a large-ish git blame introduces a noticeable lag.

</comment></comment></comment><comment><USER88> In MacTerm, command+option+click will move the terminal cursor in the same way by simulating keys. It also moves "up" or "down", for applications such as text editors that understand vertical arrows. There is even a preference setting that attempts to move the cursor automatically to wherever you drag and drop text with the mouse.

(Note: I wrote MacTerm.)

</comment><comment><USER89> I compiled my list of mac keyboard shortcuts and keyboard tricks: [http://kozikow.wordpress.com/2013/10/31/going-mouseless- on-m...](http://kozikow.wordpress.com/2013/10/31/going-mouseless-on-mac/) . Mac is the only non text based OS that you can control with 100% keyboard.

</comment><comment><USER90> Another useful tip is, in iTerm, map option+left and option+right to send escape sequence ^[b and ^[f respectively. :)

</comment><comment><USER91> That was the least obvious thing ever, and you've just measurably improved my development experience. Thank you.

</comment><comment><USER92> And if you use vim in the terminal, you can even use the mouse to select text... [https://github.com/apinstein/dotfiles/blob/master/vimrc#L150...](https://github.com/apinstein/dotfiles/blob/master/vimrc#L150-L164)

</comment><comment><USER93> If you want to invoke a command in the menubar quickly - such as applying filters in Photoshop - hit Cmd + Shift + ?. Thill will bring up the Help Search menu and you can type the name of the menu item you want to invoke. Then just hit Enter and it's done!

</comment><comment><USER94> Whoa, it would seem that you can option click above the line and go back in history!

</comment><comment><USER95> [http://apple.stackexchange.com/questions/5435/got-any- tips-o...](http://apple.stackexchange.com/questions/5435/got-any-tips-or- tricks-for-terminal-in-mac-os-x/5502#5502)

</comment><comment><USER96> another tip. Using mdfind you can do what find does but using Spotlight index

</comment><comment><USER97> I like checking the box in preferences to use Option as Meta, and then option + left/right will jump a word at a time, and option + backspace will delete the previous word, just like in most Cocoa apps.

</comment><comment><USER98> Move cursor left or right word-by-word: alt + left arrow, alt + right arrow

</comment><comment><USER99> If you use mouse to move around your Terminal, you're doing it wrong.

</comment><comment><USER100> Go to Keyboard Shortcuts in System Preferences and remap "Send reset" to cmd+ctrl+R or something, because it saves sanity when going back and forth between vi in a term and a browser.

</comment><comment><USER101> This is amazing. You have saved me countless seconds of frustration :-)

<comment><USER102> Maybe even more than that...lol... (Andy Hertzfeld & Steve Jobs Re: boot times) [http://www.folklore.org/StoryView.py?story=Saving_Lives.txt](http://www.folklore.org/StoryView.py?story=Saving_Lives.txt)

</comment></comment><comment><USER103> This. changes. everything.

<comment><USER28> sentences. seem. really. short. recently. but. I. don't. know. why. as. it. makes. the. text. impossible. to. read. and. also. makes. you. sound. like. you're. in. the. slow. readers. group.

</comment></comment><comment><USER104> I've found that maxing out the key repeat rate makes life better. System Preferences > Keyboard. Select the keyboard tab then move the Key Repeat slider all the way to the right.

</comment><comment><USER105> Or you could set up your .inputrc to make arrow keys (eg., ctrl+arrow to jump between words) work properly. It also helps to learn the other Readline shortcuts (ctrl-A for home, etc.).

</comment><comment><USER106> another one, you can drag files and folders onto the terminal and it will paste the path in at the cursor position... very useful to cd to some path you have open in Finder

</comment><comment><USER107> The search clipboard: cmd-e is to cmd-g as cmd-c is to cmd-v.

</comment><comment><USER108> I never understood the rationale of this behavior (not being able to just click anywhere to set the curser position). At least in not-yet-executed input.

</comment><comment><USER109> Is there a way to do something similar in Linux? I use gnome-terminal but would think about switching to something with a feature this useful.

<comment><USER110> Same deal, Gnome terminal, alt-b, alt-f are the closest I've found.

</comment></comment><comment><USER111> Or you can use vim editing mode directly in bash using:

set -o vi

this makes most vim motions available at the command line after hitting "esc"

</comment><comment><USER112> 20 years ago with Plan 9 you could have just clicked to move your cursor. _Plus ça change_...

</comment><comment><USER113> No one uses Terminal. iTerm ftw ;)

<comment><USER114> I use iTerm as well but besides from splitting panes and broadcasting I don't see the benefits. Why do you use it?

<comment><USER115> Terminal.app wasn't very good back in the day; I think a lot of people ended up on it because of that and never went back. Also, CMD-click is far nicer for opening links than CMD-doubleclick :)

</comment></comment></comment><comment><USER116> in .inputrc, I enable vi mode, and borrow some handful emacs keybindings(c-a beginning-of-line, c-e end-of-line, c-k kill-line etc) under vi insert mode, so I can get benefits from both worlds, just like what I did under vim :)

</comment><comment><USER117> Tip: Real hackers don't use a mouse.

/s

<comment><USER118> Perhaps it's simply personal preference, but I do find that limiting my mouse usage has resulted in real, tangible gains. I don't know how feasible that is in GUI-first operating systems like OS X, though.

<comment><USER71> Check out Alfred 2, Shortcat, Slate ([https://github.com/lunixbochs/reslate](https://github.com/lunixbochs/reslate)). You don't need the mouse as much as you might think.

</comment></comment></comment><comment><USER119> <Ctrl> X, <Ctrl> E to edit the current line in your default editor.

</comment><comment><USER120> You can type say "hello" and the terminal will greet you.

</comment><comment><USER121> hashtags on hacker news... please let me die. Nice tip!

</comment><comment><USER122> FYI this is 'Alt' on modern Mac keyboards.

</comment><comment><USER123> yearslostcounter++;

</comment><comment><USER124> Works on iTerm too!

</comment><comment><USER125> sips -Z 1280 file.jpg to resize a photo easily...

</comment><comment><USER126> If we'll ever meet, beer is on me. Thanks!

</comment><comment><USER127> Simple, to-the-point, and very useful. Thanks!

</comment><comment><USER128> This appears to work in iTerm2 as well. Neat!

</comment><comment><USER129> Nothing will ever be the same again #HolyWow

</comment><comment><USER130> Sucks that it doesn't work in iTerm2.

<comment><USER131> For some reason when I try this in iTerm2, it jumps to a different command in my history. No idea what's going on there...

<comment><USER132> Terminal does the same (for me). It's because opt-clicking above the line sends some up arrow keystrokes, which the shell interprets as moving back in history. In iTerm2 nightly builds (which are less stable than the betas) you can disable opt-click to move the cursor in prefs>profiles>pointer.

What's more interesting is the possibility of using the new shell integration features ([https://code.google.com/p/iterm2/wiki/ShellIntegration](https://code.google.com/p/iterm2/wiki/ShellIntegration)) to turn off this feature just at the shell prompt. I'll open a feature request for that :)

</comment></comment></comment><comment><USER133> ... Why didn't I know this before?

Thanks for sharing!

</comment><comment><USER134> Come on kid! set -o vi == life saved

</comment><comment><USER135> What do you mean by hold option?

<comment><USER28> Confusingly, the alt key that has had the word 'opt' put on it on some Apple keyboards and not on others...

[http://en.wikipedia.org/wiki/Option_key](http://en.wikipedia.org/wiki/Option_key)

</comment></comment><comment><USER136> Holy guacamole! #lifechanged

</comment><comment><USER137> Wow. Talk about #yearslost!

</comment><comment><USER138> This just made my day <3

</comment><comment><USER139> cmd option mouse-drag: blockwise selection

</comment><comment><USER140> thank you; you just made my year!

</comment><comment><USER141> #thankyousir

</comment><comment><USER142> Thank you :)

</comment><comment><USER143> oops, not working in iTerm2...

</comment><comment><USER136> holy guacamole! #lifechanged

</comment><comment><USER144> Thanks !

</comment><comment><USER145> you mean with a mouse?

No.

</comment><comment><USER146> holy shit.... thanks!

</comment><comment><USER147> oh my god thank you!

</comment><comment><USER148> years lost indeed..

</comment><comment><USER149> thanks for the tip

</comment><comment><USER150> cool, thanks

</comment><comment><USER151> Mind. Blown.

</comment><comment><USER152> Nice!

</comment><comment><USER153> You, sir, are a genius!

</comment><comment><USER154> I did not know this. Thanks! Very helpful tip.</comment>


A History of Palm, Part 1: Before the PalmPilot - <AUTHOR> http://lowendmac.com/2016/a-history-of-palm-part-1-before-the-palmpilot/ <comment><USER3> I was thrilled by my purchase of an original Palm Pilot during my last year of high school and delighted in filling its Notes application with a wealth of data which would now be in my "palm." I would go on to develop a few applications that ran on later devices such as the Palm III and Palm V. To this day, I recall with fondness poring over Palm's documentation and the book by Neil Rhodes and Julie McKeehan [1] and writing code using the MetroWorks CodeWarrior for Palm OS [2].

Having primarily used Windows and early Linux distributions at the time, Palm's elegant and useful user interface guidelines were my introduction to user experience and eventually led me to Mac OS.

While I fought the Palm OS storage model at the time, in retrospect, it was, like the UI approach, also an elegant abstraction that played a key role in safeguarding the performance expectations of the user experience.

[1] [https://www.safaribooksonline.com/library/view/palm-os- progr...](https://www.safaribooksonline.com/library/view/palm-os- programming/1565928563/)

[2] [http://www.palminfocenter.com/news/4762/metrowerks- releases-...](http://www.palminfocenter.com/news/4762/metrowerks-releases- codewarrior-for-palm-os-v9/)

</comment><comment><USER4> I worked at a law firm from 1997 to 2001. I was a person who liked gizmos and wrote programs for them as a programmer analyst. Whenever someone got a Gizmo like a Royal PDA with Datalink abilities to sync with Outlook they sent me to help. I even bought a Timex Datalink watch. There was Windows CE devices, and PalmPilots too. I had worked on a web based docket calendar and some of these devices had a calendar that synced with Outlook.

Apple had the Newton but poor handwriting recognition. Palmpilots had something like shorthand, but also a pop-up keyboard or an external keyboard as well.

I remember working with the Davinci devices as well.

It is good to see the start of the market, before Palm.

The Timex Datalink was the original smart watch and they even had apps for it, but it didn't have much in the way of memory and synced with Outlook using a program that only worked in Windows 95 unless you had the notebook adapter.

<comment><USER5> I lusted after a Timex Datalink so hard in the late '90s. Still being a teenager, I didn't have any data worthy of actually walking around like that (nor the money to buy one), but I was the kid who loved gadgets and that was _the_ gadget in my mind. I'd all but forgot about it until you mentioned it, despite walking around with an Apple Watch every day for the last year.

<comment><USER4> I had different alarms set on it for waking up, to getting to work on time, when work was over, and getting home, and going to bed. I never figured out how to make an app for it but it didn't have much memory on it and only so many buttons.

These days I am sick and disabled and cannot afford an Apple Watch and don't have an iPhone to work with it.

I remember stores didn't carry the Timex Datalink anymore, I had to find it at Walmart Jewelry sections and have them call different stores to see who had it in stock.

</comment></comment></comment><comment><USER6> GRiD's office in Mountain View used to be right across Garcia Ave from Sun Building 1, with big three dimensional sculptured letters of their logo in front. I wondered if that was where Sun got the idea of naming NeWS in the same lower-case-vowel style. According to Wikipedia: The lowercase "i" was a note of thanks to Intel for helping in the early days. [1]

Here's a fun Palm app called "PalmJoint" that I was beaming around and virtually toking with people at CodeCon. More of a pleasure card than a business card. [2]

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

[2] [http://imgur.com/a/OjhQ4](http://imgur.com/a/OjhQ4)

</comment><comment><USER7> I still use Tungsten T3 as improvised e-book reader. For long time there was nothing that combined the form-factor with the clarity of T3's display.

<comment><USER8> The T5 and T|X have a very similar screen and no slider. If your T3 wears out (which the slider is known to do), either might make a serviceable replacement. I also had good success migrating to an older iPod Touch in 2012, although if you use Plucker for reading on the Palm, you'll want to migrate to EPUB at the same time - that's no fun, but while Tomes was tolerable on iOS at that time, I would be surprised to learn it's still supported, especially with the Plucker format.

<comment><USER9> Plucker - now that's a ebook format that brings up memories of reading on the Palm.

If you still have Plucker files, you might have some luck using FBReader to read it. It apparently still supports Plucker (but not on android) [1]

[1] [https://fbreader.org/content/book-formats-supported-and- not-...](https://fbreader.org/content/book-formats-supported-and-not- supported)

</comment></comment></comment><comment><USER9> I have a few Palm devices scattered about. The PalmPilot Professional was my first one and widely recognised. One of my last as the Tungsten T3.

I got excited over webOS. Then it got bought by HP and killed. Sigh...

<comment><USER10> webOS is still my favorite mobile OS by far. It did so many things right like cards and the Touchstone charger. Cards and swiping actions were so natural. Synergy was very useful. The apps had some skeumorphism but nothing over the top. The notification system was very advanced for its time. With one-handed operation it's still easier for me to do all the swiping from the bottom of the screen instead of the top. Now the whole thing is just a slow front end for LG TV's.

<comment><USER11> I loved my Pre3 and used it until the apps got too old, eventually switching to a iPhone 5S.

It was a great UX but suffered from a variety of under the hood issues. Palm was the only other company that offered a (relatively) seamless upgrade experience. iOS has its faults but I much prefer the upgrade experience compared to Android.

</comment></comment></comment><comment><USER12> I still fantasize about the Palm Graffiti input method. I've tried Graffiti- like 3rd party keyboards and I just haven't clicked with any of the modern options.

<comment><USER6> Xerox PARC sued Palm over Graffiti for patent infringement in 1997 [1] [2], having filed a patent for Unistrokes in 1993 [3]. Their patent was ruled invalid due to prior art, Xerox appealed the ruling, and Palm payed Xerox $22.5 million [4]. Research [5] has shown Unistrokes to be somewhat faster than Graffiti.

>Furthermore, the [Unistroke] alphabet's strokes are well distinguished in "sloppiness space", allowing for accurate recognition of not-so-accurate input.

>Unlike Graffiti, Unistrokes gestures bare little resemblance to Roman letters. However, each letter is assigned a short stroke, with frequent letters (e.g., E, A, T, I, R) associated with a straight line. Unistrokes is analogous to touch-typing with a keyboard, as practice will result in high- speed, "eyes-free" input.

>Over twenty fifteen-phrase sessions, text entry speed in the Graffiti group increased from 4.0 wpm to 11.4 wpm. During the same time, text entry speed in the Unistrokes group increased from 4.1 wpm to 15.8 wpm. However, an analysis of variance yielded a lack of statistical difference in entry speed between the two techniques. Participants often performed unnecessary deletions, resulting in high correction rates. In addition, the duration of gesture chart views decreased quickly, but varied widely between participants. Inter-stroke time between the two groups was similar, but the significant difference in stroke duration favoured Unistrokes. The Graffiti alphabet's recognisability endears itself to novice users. However, this study shows that investing the same time learning Unistrokes can result in significantly faster stroke time and higher text entry speed.

Ken Perlin also developed a continuous stylus-based text entry system called Quikwriting [6] [7], which he patented [8]. And there have been various imitations and other questionable patents [9]. It would be interesting to measure how Quikwriting compares with Unistrokes and Graffiti -- it might be faster since it doesn't involve lifting the pen between letters.

[1] [http://www.brighthand.com/news/palm-xerox-finally-settle- gra...](http://www.brighthand.com/news/palm-xerox-finally-settle-graffiti- lawsuit/)

[2] [http://www.palminfocenter.com/news/8628/xerox-graffiti- lawsu...](http://www.palminfocenter.com/news/8628/xerox-graffiti-lawsuit-to- be-reconsidered/)

[3] [https://www.google.com/patents/US5596656](https://www.google.com/patents/US5596656)

[4] [https://en.wikipedia.org/wiki/Graffiti_(Palm_OS)#Lawsuit](https://en.wikipedia.org/wiki/Graffiti_\(Palm_OS\)#Lawsuit)

[5] [http://www.yorku.ca/mack/chi2008b.html](http://www.yorku.ca/mack/chi2008b.html)

[6] [http://mrl.nyu.edu/~perlin/doc/quikwriting/quikwriting.pdf](http://mrl.nyu.edu/~perlin/doc/quikwriting/quikwriting.pdf)

[7] [http://www.mrl.nyu.edu/projects/quikwriting/](http://www.mrl.nyu.edu/projects/quikwriting/)

[8] [https://www.google.com/patents/US6031525](https://www.google.com/patents/US6031525)

[9] [http://shr-devel.shr-project.narkive.com/wIClUJgX/someone- is...](http://shr-devel.shr-project.narkive.com/wIClUJgX/someone-is-trying-to- patent-quickwriting)

<comment><USER13> Either way, Graffiti is still the best (most reliable and fast) pen input method I've ever used on a portable device by far, and it's ridiculous that we haven't caught up with it in 2016.

I'd love to have ACCESS do something with it other than a (pretty much dead) Android keyboard.

<comment><USER6> Many useful techniques are tied up in patents. But there are great free open source techniques too!

"Dasher" is another interesting text input technique: navigating through the library of all possible books, based on continuous pointing gestures plus language modeling, which alters the target size by the probability of the corresponding text, can be easily trained on any writing style, and automatically learns as you use it.

Unlike Graffiti-like gesture recognition systems, and like pie menus: inaccurate gestures can be compensated for by later gestures -- you can continuously and perpetually correct your errors without changing mode, canceling or repeating gestures. And it works seamlessly with any alphabet like Hiragana and additional characters without any extra learning.

[1] [http://www.inference.phy.cam.ac.uk/dasher/](http://www.inference.phy.cam.ac.uk/dasher/)

[2] [http://www.inference.phy.cam.ac.uk/dasher/MobileDasher.html](http://www.inference.phy.cam.ac.uk/dasher/MobileDasher.html)

[3] Dasher: information-efficient text entry: [https://www.youtube.com/watch?v=ie9Se7FneXE](https://www.youtube.com/watch?v=ie9Se7FneXE)

[4] Dasher Poem: [https://www.youtube.com/watch?v=x-WLiY2p1LQ](https://www.youtube.com/watch?v=x-WLiY2p1LQ)

<comment><USER13> I tried it a few times, ovar the years. It is very impractical, takes up a lot of real estate and requires you to look at what you're writing - <USER2> that is not an issue with Graffiti.

<comment><USER6> I suspect a major reason it's ridiculous something like Graffiti isn't widely available in 2016 is because of patents, FUD and NIH.

A text entry system that requires visual attention which you can't use while driving a car might be considered a safety feature. ;) Then again, it might just kill people faster who insist on texting while they're driving without looking at the road. ;( YOLO! _BOOM_

Dasher has different goals and trade-offs than Graffiti, so its useful for different kinds of applications, but it supports some very important features (like alternative alphabets, and language modeling) that are impossible for Graffiti to provide, which many applications require (especially Hiragana, constrained grammars, text messaging and chat with Unicode and emoji symbols, easy training, and accessibility for people with limited motion or alternative input methods).

The paper comparing Graffiti and Unistroke [1] measured Graffiti at up to 11.4 words per minute with a consistent 26% correction rate, and Unistroke at up to 15.8 words per minute with decreasing correction rate from 43% to 16%.

Dasher is faster and has a steep but easy learning curve (it's self revealing and doesn't require a reference card).

David MacKay described an experiment in his Google Tech Talk [2] that measured novice users performance over time. Bottom of the class started at 5 words per minute, and improved to 10 words per minute after an hour of practice; top of the class started at 12 words per minute, and got to 25 words per minute after one hour of practice.

Expert dasher users using a hands-free eye tracking interface have been measured at up to 25 words per minute with an error rate of essentially zero.

I also think Dasher would be quite useful and natural for head mounted displays, and that is a fruitful avenue for further research. [3] [4]

[1] [http://www.yorku.ca/mack/chi2008b.html](http://www.yorku.ca/mack/chi2008b.html)

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

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

[4] [https://github.com/xanxys/construct](https://github.com/xanxys/construct)

<comment><USER6> There's a new version of Dasher 5.0 out, developed by Ada Majorek and supported by Google!

Dasher 5.0 beta release: [https://github.com/ipomoena/dasher/releases](https://github.com/ipomoena/dasher/releases)

Ada Majorek on Dasher: [https://www.youtube.com/watch?v=LvHQ83pMLQQ](https://www.youtube.com/watch?v=LvHQ83pMLQQ)

</comment></comment></comment></comment></comment></comment></comment><comment><USER14> I remember watching Palm founders Panel on Youtube few months ago, It was made in a format similar to computer history museum panels, but I cant find it now in their playlists :(. Anyone knows the link to the thing Im talking about? Im pretty sure I didnt imagine it.

</comment><comment><USER15> I still miss using my Palm III. It did one thing and did it really well. I switched to the Android G1 from the (rather buggy) Treo 680 when the first Android phone came out. Sadly, I trusted my Palm III more with my contacts (and the backup synced on Palm Desktop and that backed up to external media) than I do Android what with Google+ integration wrecking the Gmail Address Book and resulting in frequent duplicated or lost contacts.

</comment><comment><USER16> I bought the Palm 111, then the Palm TX. The Palm TX was great! It had internet access. That device made me an easy $15 grand in two months.

Now this was before smartphones were commonplace, and Goodguy's was going out of business. They had a huge section of video games. The wholesaler didn't know anything about video games, nor did I, but I knew they were worth more than $5 a game.

It was 9:30 at night, so I went to the outside of a local library. Got on the Internet, and found out people were buying Halo 3 Collector's edition for at least $30-$45.

I rushed back to Goodguy's and bought every box. They even threw in the displays.

The staff laughed at me. I remember thinking, I couldn't have pulled this off without that Palm TX. That TX gave me such a business advantage.

Two to three years later, everyone had a smartphone. My magic box was common place. I didn't have a commpetitative edge anymore.

Out of all business failures; the failure of Palm really bothered me then, and now. The Palms I had were rugged little products.

I connected the Palm to a gps, loaded the unit with Delorme maps, and took it down the Rogue River in a Baggie. The Rogue is a River in Oregon. I could see when Rainey falls, and Blossom Bar were about to hit us on that little black and white screen. Actually, with the zoom the screen size was more than enough. It worked beautifully.

A previous year I went over Rainey falls by accident. My best friend went over with me. He was 57 and a three pack a day smoker. He was under the water for a long time, but popped up, and swam to shore. The first words out of his mouth were, "Are my smokes wet?". Actually, his first works were yelling my name-- then the smokes. Unfortunately, the smokes did survive. After that accident, by the fire at night. He told me, "I just had a hillbilly ECG!".

Years later, a doctor insisted he get a scan. His arteries were squeaky clean. He made it to 70 smoking--only quitting two months before he died. The last year he did need lung medication, and oxygen. Actually, he need albuteral for at least five years? A few weeks before he died, he told me he was lying about his smoking habit. He said he was smoking close to four-five packs a day since 14. I figured he had good genes, or maybe it was his diet? He barely ate.

Anyways, he died peacefully in his sleep ten years ago. I do miss the guy.

On a selfish note, don't make friends with people who are much older than you. Or, if you do--cultivate a lot of friends. He was basically my only friend. We did a lot of crazy stuff together. My life hasen't been the same since he passed away.

Sorry, got off subject.

(When he finally quit-- a few months before he passed, he said, "I thought it would be harder to quit? I actually believed all those commercials comparing smoking cigs to heroin." "I would have quit years ago if I knew what I know now.")</comment>


Show HN: Simple Pascal interpreter written in Swift - <AUTHOR> https://github.com/igorkulman/SwiftPascalInterpreter <comment><USER2> For comparison, a Pascal compiler in Racket:

[https://github.com/soegaard/minipascal](https://github.com/soegaard/minipascal)

</comment><comment><USER3> Whats up with the emojis prepending the commit messages? Is that automated?

<comment><AUTHOR> Not automated, I do it manually when writing the commit messages according to [https://github.com/dannyfritz/commit-message- emoji](https://github.com/dannyfritz/commit-message-emoji)

<comment><USER4> As much as I hate the excessive use of cutesy emoji, I can't help but be drawn to this kind of thing.

Of course, you could also just write out the prefix "Bugfix: ", "Security fix: ", etc. Less internationalized, but no table lookup required.

It also would not be hard to write a plug-in for whatever text editor, or your shell, that generates these.

If you do use these, you ought to include this link in your readme so that people know what the heck the emoji mean.

</comment></comment></comment><comment><USER5> Very cool use of the Playground.

</comment><comment><USER6> How did you get Xcode to render the box-drawing characters? Or, is that a function of printing to stdout inside of a playground?

<comment><AUTHOR> If you mean the syntaxt tree, it is printed to the XCode output as text, I just made a screenshot and put it into to the Playground screenshot so it looks better.</comment></comment>


Writing Performant Code in Julia - <AUTHOR> https://techytok.ml/code-optimisation-in-julia/ <comment><USER2> Julia looks resembles modern Fortran in some ways (no semicolons or curly braces, array indices start at 1, built-in array operations), and several of the tips in the article amount to writing Julia like Fortran. So maybe one should write a computational kernel in modern Fortran.

"the type of the returned value of a function must depend only on the type of the input of the function and not on the peculiar value it is given." Fortran mandates this.

"Another common error is changing the type of a variable inside a function." Static typing, as in Fortran, disallows this.

"When a function is in a critical inner loop, avoid keyword arguments and use only positional arguments, this will lead to better optimisation and faster execution." I doubt this will matter for a compiled language.

"Avoid global scope variables." For a compiled language, it is unlikely to matter.

<comment><USER3> It's not an accident really, dynamic dispatch is slow but expressive, static dispatch is fast but restrictive. Julia (as a language trying to solve the two-language problem) is designed to be approachable to Fortran programmers, so writing it like Fortran will work (and it will be just as fast because static is fast), and for Python programmers (which will lead to slower but highly dynamic code). Idiomatic Julia is actually a middle ground though, you always program at the highest level possible (you don't assume types, you assume behaviors, as the language is fundamentally duck typed like Python). The difference to CPython though is that the Julia compiler will generate one optimal static implementation for each possible argument combination that is used, instead of one dynamic implementation (as long as each implementation is not so expressive that can't be represented through a static code, which usually means depending on runtime information).

About the third point, it really won't matter in most other languages since in this case the Julia compiler is actually optimizing beyond those thanks to the multiple dispatch paradigm (in some cases it will even replace the function call directly with the result if it can solve it entirely with compile time information). And global variables in general can't be optimized by the compiler since they can be modified at any point, so it can't make any assumptions about it.

</comment></comment><comment><USER4> For me the main performance problem with Julia is how long compilation takes. Yes, using it only in conjunction with Jupyter Notebook avoids the issues for the most part, but writing large programs across multiple files that way is so cumbersome(if even possible) I won't even try.

A program that otherwise takes 4 seconds to compile and run takes 30 seconds when I also let it export a diagram, because each time I run "julia file.jl" it recompiles the plotting library. If there is a way to have a Julia runtime in the background and letting it execute iterations of the program I haven't found it yet.

<comment><USER3> The easiest solution to have Julia on the background is using Revise.jl. Basically you import your program on the REPL and it will automatically track any change to the source code and precompile and update the environment as soon as you save it (and any function you run on the REPL, including slow to compile such as plotting, will be faster on the second time forward). You can combine it with other useful REPL modules such as Rebugger.jl, OhMyREPL.jl and Infiltrator.jl which you can import automatically in the startup.jl file.

The compiler team is prioritizing the compile-time latency and error messages for the 1.4 release, which if they succeed will make the language more approachable for people who use the same workflow as other dynamic languages (running the code from the shell).

<comment><USER4> Thanks for the suggestion. The first overhead is even more extreme but afterwards it works pretty smoothly.</comment></comment></comment>


Einstein-LIGO: in 100 years science advanced so much, publishing so little - <AUTHOR> https://www.authorea.com/users/2/articles/103757/_show_article <comment><USER2> HOLY SPAMVERTISEMENT BATMAN</comment>


HTML and JavaScript Among the Top Tools for Student Programmers - <AUTHOR> http://arc.applause.com/2015/07/28/top-programming-languages-for-students/

<comment><USER2> Interesting that C# is above Ruby for students - not what I would expect.

</comment><comment><AUTHOR> Devpost has some fairly robust data on what student hackers are working on.

</comment><comment><USER3> HTML, JSON, XML, Ajax, OpenGL, XAML, and WebGL are not "programming languages".</comment>


Uber Thinks Its Self-Driving Car Killed Because It 'Decided' Not to Swerve - <AUTHOR> https://www.theverge.com/2018/5/7/17327682/uber-self-driving-car-decision-kill-swerve <comment><USER2> The article's headline has no relation to the article. The article text clearly states that the pedestrian was flagged as a false positive. 'Deciding not to swerve' implies the system gave preference to the safety of the passenger over the safety of the pedestrian. Heavily misleading IMO.

</comment><comment><USER3> At least they're no longer pretending the car didn't see her. Perhaps they have no choice.</comment>


Ask HN: Someone is harassing me online, using my personal info. What can I do? - <AUTHOR> Hi everyone,
I am the admin of a relatively large forum site, and recently had to ban one user. Without going too much into the details, the user got extremely heated and researched my personal information online, found my CV and also where I'm currently doing my PhD studies. He has also built a blog site recording all my personal info/phone numbers/family members, etc. and sending them to my supervisors with a request that I be terminated due to unethical behavior. As I'm currently in Germany, you can imagine how this might cause a lot of confusion with my superiors.
So my question is, is there anything I can do to stop this individual? I have some basic information about this guy which I can report to some authorities (list of IP addresses, email address) but as he's located in Egypt, I'm not sure there's any good that these will do. Really looking for some help in dealing with this matter, and talking to this guy directly will probably not solve anything (maybe even just make it worse since he'll think he's winning). <comment><USER2> Problems like these can be extremely annoying and very hard to resolve. Beyond what lutusp already said (get a lawyer) you're facing an uphill battle because law enforcement in the country where your perpetrator is located (Egypt) will likely not assign a very high priority to resolving your issue.

I ban 100's of people daily on my own website and have run in on multiple occasions to people who love nothing more than to ruin other people's lives online from the relative shelter of online anonymity.

Worse still, authorities usually don't lift a finger (unless there is child pornography involved or the victim is a politician or a relative of one) and if they do move it is at a glacial pace.

If you know who he is then a letter from a lawyer _might_ help, if you only know IP addresses and a general location then you are facing a long and hard battle.

Going back through your server log might help you to figure out more information about this person, maybe he's made multiple accounts, maybe one of his aliases shows up in google allowing you to figure out more about him. Any work you can do prior to hiring the lawyer will likely result in some acceleration or maybe even prompt resolution.

The only reason this works is because there is an information asymmetry between you and your attacker, he knows all there is to know about you and you know nothing to very little about him.

As for your superiors, if they would act on anonymous complaints sent over the internet rather than have a good laugh at it then you should probably explain that _anybody_ with an axe to grind can attack anybody else on the net in this way for no particular reason.

Best of luck with all this.

<comment><AUTHOR> Thanks for the advice. I have his original IPs, and then a second list of Proxy sites which he used to create fake accounts and also post abusive posts (I had IP-banned him). Presently, the forum is locked down to new registrations until I can find a way to stop this guy from coming back.

I don't have his physical address, so not sure how I could get a letter delivered. Perhaps some kind of tool exists to bait him into giving me his geo coordinates?

The supervisors are not too pleased with getting 10-15 emails this morning, with a PDF of my personal information and other harrassing information related to my work for the site, which takes place off-work.

<comment><USER2> One user of my website, a girl that one morning decided that it was very clever to undress on cam got a guy that kept on mailing her bosses, her family and so on. It caused no end of trouble. Your bosses are essentially blaming the victim, it's a real pity that understanding of these matters is limited until you are typically hit by it yourself.

The fact that they assign any value to this at all is certainly worrisome.

If you send me an email privately (firstname.lastname@example.com) with what information you currently have on the guy then I may be able to give you a hand (no promises though).

</comment></comment></comment><comment><USER3> I run a large community as well, and had some similar issues. Occasionally threats work if you can convince them you're willing to take legal action, and you can scare them with evidence pointing to their name or IP address.

If that doesn't work, or they're based in Egypt which is going to make legal action difficult, you might be best off to ignore them completely. They're looking for a response. They want to see you upset, they want to see you in a panic, they want to see you begging them to stop, etc. If you ignore them, and never respond or talk again, they'll likely move on with their life. They're not going to maintain a blog on you forever, that takes time, and if they're getting nothing in return, they'll stop, although it might take weeks or months.

Now, work on preventing this in the first place. I had my community hosted on the same servers as my personal projects (small startup, didn't realize it was going to grow to the current size), and this allowed people to connect the dots to my name by looking up the server IP and related sites. I'm in the process of trying to separate my personal identity from my community, and to reduce the trail leading back to me. I can't recall how many people are banned from my community, but it's in the area of 5,000. I'm surprised I haven't had more personal attacks, but it's only a matter of time, so I'm trying to separate things before it occurs again. You might want to do the same if possible.

<comment><USER2> I actually did the exact opposite, I made sure that I'm _very_ easy to connect to the community to deflect all attention from those doing the actual moderation. I'm also known as someone who will happily sue you for every penny you've got and I tend to win so the jerks and jackasses tend to tread a little more careful around me. I wished that extended to the users of the website though, who on occasion do very silly things and make themselves identifieable in many ways.

They don't usually realize the consequences (even if warned) until it is too late.

But as a website operator I'd always make sure to attach both my corporate and personal identity with the service.

Why appear like a scam when you're not?

</comment></comment><comment><USER4> Because of the international aspect, people here aren't going to be able offer constructive help beyond sympathy. At risk of stating the obvious, you need to engage the services of a lawyer.

</comment><comment><USER5> Posting this kind of info is probably at least against the TOS of whatever hosting he uses, and probably illegal in most countries. If you want it taken down quickly, the help of a good lawyer is probably needed. Chasing him and putting out fires is probably all you can do without venturing into illegal territory yourself.

</comment><comment><USER6> You are being stalked. Research the protections that stalkers need in your country - you might want to set up a website describing what's happening so you can point people to it. Include links to stalking information to avoid as many "it must be something you did" accusations as possible, although there will be some of those.

CLEARLY DOCUMENT EVERYTHING. At some point in the future you may want to go to the police and having everything they need neatly laid out is helpful to them.

</comment><comment><USER7> Fight fire with fire. Find an altruistic hacker to hunt him down and make his life uncomfortable.

<comment><USER8> This got downvoted, and I can understand why, but I have to admit the idea has a certain dark appeal.

Well, I snorted appreciatively when I read it, at least.

(This is why I dislike downvoting. Ignore ideas you dislike, flag abuse, but downvote "honest opinions"? Hmm. Sure, that begs the question of abuse Vs honest opinions, but that is the purpose of discussion and reason: To sort the abuse from the honest opinions, to accept and improve upon the latter.)

<comment><USER9> I just downvoted the GP, and not because I disagree with his opinion, but because I think his advice is a dangerous one to follow. For example, the stalker could be using someone else's computer, and hacking him back would only harm that other person.

<comment><USER2> Stalkers typically use their own computer and do so through a variety of layers of deception. Recall that 'push to allow people from TOR on websites' earlier today right here on HN? That's what you get for your troubles.

As for the GGP comment, he advised to get the help of a 'hacker to hunt him down' not to hack him back. That's a world of a difference.

<comment><USER10> "Stalkers typically use their own computer and do so through a variety of layers of deception". In this specific case, the stalker is in Egypt and there is a very high chance he is using a "cybercafe" to access the internet rather than his personal PC/Internet connection.

</comment></comment></comment></comment></comment><comment><USER11> Dox him or pay someone to do it. Once you have an address, send him a german lawyer template asking him to take down the site.

Can you get his infos from the blog?

<comment><AUTHOR> Not much info about him on this blog, but tons of it on me. I'm not sure how much good a German lawyer template will do if he's operating in Middle East.

</comment></comment><comment><USER12> Ignore him, he'll go away eventually. There's not much you can do so "don't feed the trolls" is the best you're going to get. Of course, some people think differently - see Maddox's page of hate mail for example.

</comment><comment><USER13> What country is his blog site hosted in? If it's one of the big blogging sites, you may get a good response by contacting them about his breach of their terms of service. Law enforcement are unlikely to be interested.

<comment><AUTHOR> It's actually hosted on Wordpress.com. I've posted the URL yesterday to their abuse form requesting it to be taken down, but currently remains active. I guess they need time to process it.

</comment></comment><comment><USER14> You'll find this helpful: [https://digitaldefenders.org/digitalfirstaid/](https://digitaldefenders.org/digitalfirstaid/)

</comment><comment><USER15> What about using the new google tool that they were forced to do by the EU to get his blog out from the search results? I think you have a pretty good case.

</comment><comment><USER16> Have you tried talking to him? There have been a few times where I've managed to get trolls and hackers to desist with a friendly chat.

</comment><comment><USER17> Will he take down the information if you let him back onto the site?

</comment><comment><USER18> Would you getting fired make the asshole stop? If so...

Get one of your supervisors to contact the guy and lie to him that you have been fired, take on a new username and stop posting non-anonymous stuff with it.

</comment><comment><USER19> Unban him from the forum. Then he'll (maybe) stop. Maintaining control over your life and online reputation is more important than keeping him banned.

<comment><USER17> (banned person could be reading this thread)

Banning is a governance issue for any community. If the community is large enough, there may be other senior (by time and participation) community members willing to act in a leadership role. Ask for their help in formalizing the ban process.

The governance group (ideally excluding you) can engage the currently banned person in a public process on the forum, where terms of engagement are defined by the community, not lawyers or countries or emotional individuals.

If the costs (time, money, risk) of maintaining a forum become too high, other admins have closed their forum. Presumably the aggrieved party simply wants to participate in the forum, not destroy it.

<comment><USER20> Excellent response.

There should probably be an open discussion on the forum engaging members and other moderators where the banned user can see it. Let them discuss the ban as well as the subsequent harassment and honor their decision.

I am a former admin of a large forum. I let trolls and spammers wear me down over years and regret that I did not handle some things openly.</comment></comment></comment>


Show HN: Aylien News API Demo - <AUTHOR> https://newsapi.aylien.com/demo#!/?published_at.start=NOW-30DAYS&published_at.end=NOW <comment><USER2> A search of French language sources for "Yaya Toure" did not produce relevant results. The English language did.

What is the technology behind Aylien?</comment>


Ask HN: Help improve and monetize a (charitable) site for Movember - <AUTHOR>

Last year myself and fellow hackernewser hassy built http://moustachewars.com as a bit of fun for movember.
We only got it live on the 19th of the month, but by the end had received about 22k page views. We have just kicked the server into action again for this year and we'd like to make it even better.
Does anybody have any ideas how we can: - Improve the game so that it is more fun. Certainly some of the charm of Facemash is lost when you don't know most of the people. - Potentially monetize it to help raise money for the movember cause.
Incidentally if anybody wishes to take part, just tweet a photo of yourself using twitpic, and add a #movember hash-tag, and it'll show up. Your profile can then be found at http://moustachewars.com/mofile/<twitter_handle>
Thanks! <comment><USER2> Error:

Traceback (most recent call last): File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 513, in __call__ handler.post( _groups) File "/base/data/home/apps/moustachewars/2.345943956888778510/main.py", line 126, in post winner.elo_score = Rwinner + Kelo_ (1-Ewinner) File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py", line 542, in __set__ value = self.validate(value) File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py", line 2804, in validate % (self.name, type(value).__name__)) BadValueError: Property elo_score must be an int or long, not a float

<comment><AUTHOR> Ouch, thanks for that. Fixed.

</comment></comment><comment><USER3> Hi! The <http://movember.com/> website looks... um... old and somewhat abandoned to me. <http://us.movember.com/> is way better. Is the content really different from say <http://ca.movember.com/>? The slideshow seems the same at least. You should make the landing page somehow more modern/cheerful, or just skip it altogether.

<comment><AUTHOR> We are not officially affiliated with movember.com we just like the cause.

</comment></comment><comment><USER4> The "top" and "bottom" pages list photos that aren't statistically significant. It'd probably be best to put a threshold on those pages just to stop showing photos with only a single rating.</comment>


Jwz - Happy Run Some Old Web Browsers Day! - <AUTHOR> http://jwz.livejournal.com/856745.html <comment><USER2> This is exactly the kind of awesomeness I come to YCNews for.

</comment><comment><USER3> Does anyone know the answer to his question about the <HYPE> tag?

<comment><USER4> I found this: <http://www.htmlcodetutorial.com/sounds/_HYPE.html>

"<HYPE> is an "easter egg", an obscure feature hidden in a program for no other purpose than to make the programmers giggle themselves silly. In some versions of Netscape, <HYPE> plays a silly sound."

</comment></comment><comment><USER5> Better run those old browsers in a sandbox!

</comment><comment><USER6> For a minute I thought this was going to lead to a page about IE6. I was really looking forward to learning what drugs I needed to take to turn that into a happy experience.

Fortunately, I'm much more willing to forgive a browser that is incompatible with the standards that were written five years _after_ its release. :)

</comment><comment><USER7> Title should be hyphenated.</comment>


Ask HN: How did you know it was time to change careers or something else? - <AUTHOR> Hello HN. I know this isn't really related to tech but echoing some of the other AskHNs I've seen before, I really trust this community to give grounded advice so I thought I'd try.
How did you know when it was time to change jobs? Or how did you know you were burnt out? How did you know that what you felt wasn't normal perturbations of psychological homeostasis and actually something systemic?
I moved to SF over a year ago for a job and the transition hasn't exactly been graceful. I feel like the last 18 months has been a series of highest highs and lowest lows- both in work and outside. And each time I ask myself, what's the problem is it me or the environment? Do I push through and suck it up and learn? Is that what everyone else is doing? Is the issue deeper than a lack of motivation at work, or a lack of friends? How did you know it was time to make a meaningful change or seek help? <comment><USER2> I am not sure about seeking help part, if you feel you are at that stage its most likely time to look for help professionally or call an old friend or familey or something out of the blue. What do you actually like to do?

I would #1 delete FB/IG. #2 go for a run or walk #3 eat regularly #4 put yourself out there, do something to level yourself out. Sounds like you are a very up or down type person. You need something to balance that out.

<comment><AUTHOR> Thank you for the advice. I've been off social media for a year or so, exercise 3-5 times a week, and eat breakfast lunch and dinner. I like the notion of seeking more balance.

Thanks again.</comment></comment>