Rarely known C++ constructs (part 1): Function try blocks - <AUTHOR> http://szelei.me/rarely-known-cpp-constructs-part-1-function-try-blocks/

<comment><USER2> This is hack on top of a broken feature.

C++ doesn't zero-initialize instances before calling the constructor. Thus you can't tell which fields need to be cleaned up in a destructor in case of a partial construction [1]. So destructors aren't called for partial construction, and you need to handle the exception cleanup in the constructor. But you can't do that for member initialization lists, so there's this thing.

RAII and wrappers is one reasonable way out of the insanity, but the costs are arguably higher than zero initialization - certainly in ugliness of wrapper classes, if not in absolute runtime.

Forbidding exceptions in constructors is another reasonable way out, but that kind of sucks - constructors have no other way of communicating error, so you need to add isValid flags to your classes, and to be belt and braces secure, you need to check this flag for every operation.

The correct answer is zero initialization, possibly with some kind of pragma to prevent zero init for critical performance classes. The thing with zero init is that data flow analysis can mitigate the costs - the compiler would be able to eliminate the earlier zero assignment much of the time.

Overall it's more of the same from C++: unsafe, broken by default, bodged up with hacks to make it slightly more stable, and usually works mostly OK in practice owing to limiting C++ to a reasonable subset.

[1] I know that technically 0 can be a valid physical address, but even for (embedded) systems that do allocate there, it's worthwhile reserving it.

<comment><USER3> All caused by C compatibility, while trying to bring C developers on board with the "pay only for what you use mantra".

C developers tend to think on micro-optimizations and Assembly level before writing any line of code, even when it doesn't matter at all for the problem being solved.

C++ would be a much better language if C compatibility had been thrown out of the window. However, it might had not spread into the industry as it did.

<comment><USER4> > However, it might had not spread into the industry as it did.

Worse is better. C++ is nothing if not pragmatic, and the core of C++ programmers are similarly pragmatic.

If D or go or rust or whatever else ever become more practical to use than C++, then people will switch. I know C++ is very ugly, but it gives me an unmatched combination of runtime performance, good tools, API/OS compatibility, and acceptable language design. There's a good reason why so many VMs for other languages are written in C and C++, and it isn't elegance.

<comment><USER3> Sure, if you look at my history you will see I like C++, just not C.

The thing is that many of the WTF people associate with C++, are caused by C underpinnings.

> There's a good reason why so many VMs for other languages are written in C > and C++, and it isn't elegance.

While I do like C++, enough to have lots of C++ books, I only partially agree.

I come from the Pascal branch of languages and consider it has more to do with existing toolchain infrastructure than anything else.

<comment><USER4> I agree - the C++ compilers are pretty good, and if the OS is written in C and C++, working with the OS will be simpler if you use C++ than pascal.

One thing I've noticed is that the dominant languages for resource-constrained programs all seem to envelop the previous generation. You can embed assembly in C. You can embed C in C++. C++ has yet to be embedded in another language, at least if you want to keep the same memory layout of objects.

I'm curious to see if D or some other language can buck the trend.

<comment><USER3> I am quite active in D forums, and also follow Rust closely, given my interest in the ML language family.

If you look at the history of systems languages, the only ones that won market share, had the sponsorship of an OS vendor as their official language. Specially because many people hate to write FFI bindings for their favourite language and it doesn't scale to map the full OS API.

So the question is which OS vendors would pick the wannabe replacements.

</comment></comment></comment></comment></comment></comment><comment><USER5> "They are also syntactically valid on regular functions, but of little use."

I might litter my code with some of these to make it more "fun" for others to maintain it after I am gone / hit by a bus. At least I will go with the knowledge that they'll have to learn an obscure feature of the language, plus it'll remind me every time I see it (to stop the synapse degradation)

</comment><comment><USER6> Every C++ book I even read mentions function-level try blocks. Unfortunately, they are rarely useful due to scope semantics (it's difficult to perform shared cleanup, even when using object guards).

<comment><USER7> FWIW, I have never seen this, and I have quite a few C++ books on my shelf. I either missed it repeatedly, or it is so obscure that it never came up.

<comment><USER8> They are included in TC++PL at least. But so is everything else in C++ :)

They are probably obscure because they are only really useful for logging or remapping exceptions (unless a new exception is thrown the original one will be re-thrown at the end of the catch-block) in constructors and destructors.

They can be used in normal functions as well, but offers nothing beyond what normal try-blocks do there.

<comment><USER3> My copy of the book is currently 2000 km away from me, but I think the "C++ ARM" already mentioned it, does anyone know?

</comment></comment></comment></comment><comment><USER9> Jesus Christ. Never ever use try catch inside a constructor. It's the fastest way to a headache.

<comment><USER10> Exceptions are utterly broken in C++.

I get flamed a lot for this, but I just avoid them in general in C++. In most languages this isn't the case, but in C++ I find explicit error handling code to be less work to write/maintain, even if it is a bit more verbose.

<comment><USER11> I see two major use cases for exceptions in C++.

The first, is for errors during recursive functions. Very challenging to escape from 13 levels deep into a recursive descent parser without throw.

The second, is for container access-by-reference functions that are called on empty or out-of-bounds elements (eg array(4); array[16] = value;), since otherwise there is no way to return from the function, as you may not know how to construct a new container element (eg no default constructor), nor would you necessarily want to return a dummy object in that case.</comment></comment></comment>


Web Performance Made Simple - <AUTHOR> https://medium.com/baqend-blog/web-performance-made-simple-fc61d81d0c0e <comment><USER2> 1: That was way more than 20 words.

2: HTML

3: OK, add some images if needed. Links if possible, inline only if absolutely necessary.

4: If you really want the thing to load fast, inline styles as well.

5: Only use scripting if there is no other way to achieve what you want to achieve.

6: ...but maybe you want to achieve something which your users would be better off without?

</comment><comment><USER3> Not directly on-topic, but since the article mention CDNs: is there any privacy concerns when using CDNs?

<comment><AUTHOR> With CDNs, there are definitely privacy (and GDPR) concerns, since often the complete traffic passes through the CDN. And in order to cache, rewrite and optimize responses, SSL connections are typically terminated in the CDN. And this implies that the CDN provider processes and potentially sees sensitive user data in plain text. Due to the distributed nature of CDNs with many edge locations, one can never be really sure what the exact legal circumstances are when user data is passed through the CDN nodes in different countries. And even though CDN providers won't leak user data on purpose, cloud bleed [1] has shown that this can happen by accident and at massive scale.

This is one of the reasons, why at Baqend we opted for a different approach: by using Service Workers, we can make sure that as a service provider we will only see public data. Personally identifiable information like cookies and sensitive session information does not leave the user's browser. And if you think about it that makes a lot of sense, since the public data really is what makes a site fast or slow. User-specific data (e.g., a profile, payment data, etc.) is hardly ever the cause of performance problems. Nonetheless, we do use CDNs for public data as they are an indispensable tool to achieve low latency.

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

</comment></comment><comment><USER4> FMP? I laugh so hard at these guys, trying to convince us that its hard to do web performance.

When it's actually simple as long as (like everything else) it had always been.

<comment><USER5> This comment breaks the HN guideline which asks:

"Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something."

If you'd read [https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html) and only comment in the spirit of this site, we'd appreciate it.</comment></comment>


China's Dangerous Taiwan Temptation - <AUTHOR> https://www.brookings.edu/blog/order-from-chaos/2020/08/20/chinas-dangerous-taiwan-temptation/ <comment><USER2> It's pretty sad that in this day and age the PRC is trying to annex the ROC and arguing that the annexation would legitimate since the lands were part of imperial China more than a century ago. Apparently the citizens of the ROC have no say in this matter. Apparently the fact that the PRC and ROC have clearly demonstrated their ability to coexist doesn't matter. It's just sad.

Hopefully the PRC can find some other argument supporting their legitimacy instead of neo-imperialist aggression against its non-threatening neighbors.

<comment> spaced-out That's really what I can't get over about this situation. They've been living in peace for generations, and that area is more prosperous than it's ever been in history.

Yet two peoples who speak the same language might go to war with each other, why? Because of a civil war over an ideology that everyone has since abandoned? Because of how maps looked a 100 years ago? Because of crimes committed by Imperial Japan against the Qing Dynasty?

<comment><USER3> Because none of the above. Because Taiwan is a thorn in the side of China, the open truth for all to see that freedom, not despotism can be the foundation of a prosperous Chinese state.

</comment></comment></comment><comment><USER4> There's quite a difference between what Japan tried to do in WW2 and China reclaiming territory that was stolen from it by colonial powers.

The US is also militarily supreme and acting provocatively. Nobody wants a conflict between superpowers.

<comment><USER5> _Taiwan was not stolen from China by colonial powers._ You might have a point on Hong Kong, but not on Taiwan.

<comment><USER6> Taiwan was ceded from China to Japan, becoming Japan's first overseas colony, as a result of the first Sino-Japanese war. [1]

[1][https://en.wikipedia.org/wiki/Taiwan_under_Japanese_rule?old...](https://en.wikipedia.org/wiki/Taiwan_under_Japanese_rule?oldformat=true)

<comment><USER2> This is certainly true, but it's also true that Chinese colonized Taiwan as well. Taiwan has had a long history of outsiders coming in and taking over. At least today Taiwan's current inhabitants are in control of their own country, but unfortunately China wants to try to go in again. It seems Taiwan can never be left in peace.</comment></comment></comment></comment>


Ask HN: unpaid UX internships - <AUTHOR>

Is it possible to find a non-paid UX internship for somebody with no background in HCI?<p>A friend of mine lives in the valley and has done some very basic UI work here and there. She is looking for a non-paid internship to refine her skills and gain more experience. I am wondering if it is even possible to find such internship positions? <comment><USER2> Hi Siah, I'm sure it's definitely possible depending on her skill set and what size companies she wants to get an intership with.

I think you would have a pretty hard time finding a small startup that would turn down an offer for UX help from someone competent and quick to learn.

I'd suggest she posts some examples of her experience online, in this thread and just approachs small startups with a phone call and offer.

</comment><comment><USER3> Definitely. I'd imagine it wouldn't very hard to find even a paid internship if she puts the legwork in.</comment>


Simple d3 visualizations of Playboy centerfold voting results NSFW - <AUTHOR> http://playboy-fm.herokuapp.com/chart <comment><AUTHOR> Warning: This page doesn't have nudity except for one of Marilyn Monroe's breasts which didn't get cropped out but if you click on one of the other pages there will be nude Playboy centerfolds.

It will work on mobile but wasn't optimized.

The code is here: [https://github.com/adam-s/playboy- fm](https://github.com/adam-s/playboy-fm)</comment>


Ask HN: How did you discover your career? - <AUTHOR> <comment><USER2> I was interested in computers while growing up and a teacher in high school started a programming class that took place before school. I enjoyed that class and decided to become a software developer.</comment>


Ask HN: Is there a market for a Screenshot capture service? - <AUTHOR>

We needed to capture screenshots of some 50k+ URLs for one of our proprietary projects. After looking high and low, we found many services - some offered totally free usage while others offered (free +) paid plans.
On further study, we found that most of the free services were either defunct/broken or very restrictive and only the paid/commercial ones were going to be any good.
While exploring third-party solutions, we were also working on a roll-our-own hack which, eventually, came about quite nice recently.
At this point, I'm wondering if it would be worth while to launch a service of our own.
All comments, questions, ideas, suggestions etc. welcomed. :) <comment><USER2> What's wrong with the already-existing commercial ones?

<comment><AUTHOR> Nothing that we'd really know of, because we never actually used any. :)

Having said that, I must admit that we did study the specs of some of those and found a few gaps here and there (at least so far as our requirement was concerned).

To list a few off the top of my head:

1) Returning of http response codes 2) Following 300 class redirects 3) Control over exact pixel size of the images etc.

<comment><USER2> Why didn't you use them? A few missing features don't justify launching a whole new service, as the existing ones can just add the features in a day or so.

<comment><AUTHOR> The primary reason we didn't use them was the lack of several features we needed.

We're not really concerned about the existing services adding the missing features - what we really wish to find out is whether or not there exist (at least a decent sized) market for such a service.</comment></comment></comment></comment>


California is booming, but Californians are unhappy - <AUTHOR> https://www.nytimes.com/2019/12/29/business/economy/california-economy-housing-homeless.html <comment><USER2> I grew up in San Diego. I decided to stop commuting long distances several years ago and have only taken online jobs or worked in my own startups. For me it has not been easy to maintain a high income like this. But at least I don't have to deal with SoCal traffic to get to work every day. My current startup doesn't make any money and I couldn't afford my own apartment in San Diego anymore and so last year I decided to move across the border to Tijuana.

About 1% of the time the water or electricity doesn't work, but the rest of the time things are pretty great. Seems like my cost of living is about half even though I live right on the beach now. There have only been two shootings in my immediate neighborhood that I know of and those were both parties involved in drugs. And at least 99% or maybe 95% of the time it doesn't even smell bad.

</comment><comment><USER3> It might be because only a small fraction of mostly out-of-state/-country transplant knowledge workers are living well. Meanwhile, they price nearly everyone else out of the real-estate market and drive up costs-of-living. This leads to janitors and normal people living in their cars because they cannot afford rent or sky-high gas prices ($3.99/gallon vs. $1.99/gallon elsewhere) because they don't receive livable wages. And also, conservatively, several thousand homeless people living under bridges, along freeway onramp embankments and so on like a dispersed favela of a third-world country. It's embarrassing that people aren't treated more humanely in such a ridiculously rich country.

<comment><USER4> It's supply and demand. During the last decade all new buildings built that I've seen in the sf/bay area are business parks. When both new houses are not built, and we're not building up, yet corporations are allowed to build, you're going to get this kind of inequality.

In Florida, for example, it's common to see new apartment buildings starting at 10 stories tall. In the bay area, it's rare to see an apartment building past 3 stories.

There is massive potential to build up, but communities of home owners who treat their property like an investment are doing everything they can to prevent new real estate. This selfish behavior may benefit them and eventually their kids, but it hurts everyone else.

The irony being that the Democratic party is the party of helping the disadvantaged, yet the selfishness we are experiencing, isn't very in line with the dnc. California is a liberal state, believing odd balls should be treated like human beings, expressing creativity for who people are and embracing that. But, contrary to common belief, California isn't very left wing and it isn't even strongly in line with the democratic party. States on the east coast, like New Jersey, are far more left wing than California, but are less liberal. If you go north to Oregon, it's just as liberal as California, but is a Republican state.

What Californians need most is to end prop 13, or reduce it to some sort of capacity. This way we would be like every other state. Most of our problems would go away if we did that.

<comment><USER5> > What Californians need most is to end prop 13

How does Prop 13 inhibit new buildings?

Isn't it an incentive to buy? property taxes on new homes are capped with prop 13

<comment><USER6> From wikipedia:

Proposition 13 alters the balance of the housing market because it provides disincentives for selling property, in favor of remaining at the current property and modifying or transferring to family members to avoid a new, higher property tax assessment.[36][37]

Proposition 13 reduces property tax revenue for municipalities in California. They are forced to rely more on state funding and therefore may lose autonomy and control. The amount of taxes available to the municipality in any given year largely depends on the number of property transfers taking place. Yet since existing property owners have an incentive to remain in their property and not sell, there are fewer property transfers under this type of property tax system.

California also has high rates of migrants from other countries and states,[38] which has contributed to more demand for housing, and it has low amounts of moderately priced housing due to the increased property tax liability after a sale.[citation needed] In effect, because the different tax treatment makes real estate more valuable to the current owner than to any potential buyer, selling it makes no economic sense.

</comment></comment></comment></comment><comment><USER7> I moved to SoCal from Arizona about 1.5 years ago for a job, and I plan to leave within the next 6 months. The most striking aspect of living here is the incongruity between taxes/state spending and the general despair of the average Californian. Lots of natural beauty here but I can get better quality of life and keep more of my money somewhere else.

<comment><USER5> Where are you moving to? Transfer or new job?

<comment><USER7> New job, likely back to AZ since my industry is booming there too, and cost of living is much lower. Also considering WA because family.

</comment></comment></comment><comment><USER8> [http://archive.is/hjSkn](http://archive.is/hjSkn)</comment>


Everyone's Defaulting, Why Don't You? - <AUTHOR> http://www.slate.com/id/2239555/

<comment><USER2> The consequences of defaulting are not only moral or societal: it gets in your credit history. Banks will be less enclined to lend you money in the future, and if they do you'll end up paying 5x more premium.</comment>


How to Stay Creative Once Exhausted - <AUTHOR> http://www.minervity.com/?p=1816 Have you ever wondered how to keep staying creative even though you have hit the infamous "zombie" mode? Well, I thought I would scout the Internet for the 10 most effective ways how to keep you creative while exhausted during any looming deadline. Ten sure ways to keep work progressing. <comment><USER2> I take a nap.</comment>


Viewing Large Images - OpenLayers, GSIV, ModestMaps, DeepZoom, and Python - <AUTHOR> http://blog.kapilt.com/2008/11/30/sharing-large-images-openlayers-gsiv-modestmaps-deepzoom-and-python/ <comment><USER2> I've used IIPImage to good effect (IIPImageServer to serve, IIPMooViewer as client):

<http://iipimage.sourceforge.net/images.shtml></comment>


The Great Programming Language Continuum; or why C++ is dying - <AUTHOR> http://slidetocode.com/2013/01/20/continuum/ <comment><USER2> The article claims that "[human speech] would be the highest level language of all if anyone could write an interpreter for it."

What a load of nonsense.

Human speech is a lousy language for precise expression, and often fails even for human-to-human communication. This is why we invented mathematics.

I stopped reading at that point.

<comment><USER3> I stopped reading after "; or why C++ is dying".

</comment></comment><comment><USER4> "C has retained its popularity because the answer to the question what is the lowest level language I can code in without using assembly has always been C"

What a way to miss the point! There are plenty of languages between assembly and C. C wins because it's about as high-level as you can get before you start incurring run-time penalties.

</comment><comment><USER5> This article appears to directly contradict its main point, by claiming lisp is the most exclusive language, which everyone would want to use, yet almost no-one uses it.

</comment><comment><USER6> Wow, have you looked at C++11? It brings in everything you love about functional languages and improves on it.

<comment><USER7> I love C++11 but it still doesn't get me lazy evaluation

<comment><USER8> There are a variety of techniques for implementing lazy evaluation when using C++. What's stopping you from using these approaches, or using an existing library like Boost Phoenix?

</comment></comment></comment><comment><USER9> I completely disagree. C++ is not perfect, but it's evolving. I started my oo programing with java. I have used c#, go, obj c and many others. But I think C++ is still the best.

</comment><comment><USER10> Not sure I'd say that human speech is the highest level programming language. Human speech is just too vague.

I always wonder when someone will invent a programming language that is built for the mobile programmer. I don't mean mobile devices, I mean the programmer can program while walking around. Transparent hud, microgestures, something like that. That'd be pretty high level.

</comment><comment><USER11> Now let's look at that list again but remove languages that don't have native threads and vectorization.</comment>


OS X Command Line Utilities - <AUTHOR> http://www.mitchchn.me/2014/os-x-terminal/?x <comment><USER2> This article was nice, but it indicated that you need to change the system preferences in order to change the voice. It turns out that you can pass the -v flag to use a different voice, or "-v ?" to get a list of names.

So you can do

        say -v Samantha Help, I'm trapped in this castle!

or

        say -v Princess Help, I'm trapped in this castle!

But wait, it gets even better: The Mac comes with a number of voices for other languages, such as French, Hebrew, Chinese, and Arabic. And it turns out that the voices will work in English as well, _using that country 's accent_. I just tried it with a few different languages, and was amazed by how well this worked, within reason:

        say -v Sin-ji  "Hello, I am Chinese.  What do you want to eat?"
        say -v Thomas  "Hello, I am French.  What do you want to eat?"
        say -v Carmit  "Hello, I am  Israeli.  What do you want to eat?"

And yes, I _should_ get back to work...

<comment><USER3> Another fun one:

        say -v cellos dum dum dum dum dum dum dum he he he ho ho ho fa lah lah lah lah lah lah fa lah full hoo hoo hoo

Edit: 'In the Hall of the Mountain King' if anyone is curious.

There is also 'Pomp and Circumstance':

        say -v Good dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum

and Chopin's 'Funeral March':

        say -v Bad dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum dum

<comment><USER4> And yet another:

       say --voice='?' | perl -lane 'my $v = $F[0]; system("say -v $v \"Hi $ENV{'USER'}\"")'

<comment><USER5> Or just stay in the shell...

       for voice in `say --voice="?" | awk '{print $1}'`; do say -v $voice "Hello $USER, I'm $voice"; done

</comment></comment></comment></comment><comment><USER6> pbpaste and pbcopy never really occur in ambiguous situations, so I wrote the following shell script:

      function clip { [ -t 0 ] && pbpaste || pbcopy }

This is easier to type and allows for the following:

      % echo hello | clip
      % clip
      hello

<comment><USER7> > function clip { [ -t 0 ] && pbpaste || pbcopy }

That's great! Would you please explain why that works? Are there any cases you know of where that doesn't work as expected?

Edit: btw you need a semicolon after pbcopy to make that function valid on one line.

<comment><USER8> I'm not the OP, but I'll give it a go.

`[` is a Bash built-in command also known as `test`. The `-t` parameter tells it to test if a file descriptor is open for `0`, which is also known as `STDIN`.

So if you're piping something into `STDIN` it will do `pbcopy`. If not -- it will do `pbpaste`.

</comment></comment></comment><comment><USER9> For Linux users, `xdg-open` is the equivalent of `open`. The latter exists on Linux, but it will open a socket.

There are a number of utilities that handle copy/paste, but `xclip` is probably the most widely used.

Screenshots can also be done a number of ways, but `scrot` is my favorite. The two most useful flags to pass with it are `-s` and `-d`.

As for `launchctl`, `systemctl` is what you want to use to do the same things.

Note that these equivalents all address the same functionality, but the syntax may be different.

<comment><USER10> Having discovered the usefulness of pbcopy/pbpaste on OSX, I'm simply amazed that the equivalent X utilities are not included by default on every major Linux distribution.

<comment><USER11> Different philosophy, partly motivated by the consideration that with a package manager the barrier to installing it really low. Personally I prefer to have as little installed as possible in the base system so that I can pick and choose what I want on top. Metapackages that install a large selection of stuff or distros that ship a ton of stuff by default drive me crazy. I don't mind it so much on a Mac as that's kind of part of the whole philosophy of OS X, but Linux (and friends) are in a different niche for me.

I'm sure some desktop distros do ship xclip by default though. Knowing the typical variety of Linux distros I expect there's probably even an Xclipbuntu, dedicated solely to showing off the latest xclip release (the users of which have a decade long feud with Xseldora).

<comment><USER10> I guess I should say I'm more surprised that something like xsel or xclip is not part of the standard x11-utils or what have you.

<comment><USER11> Oh yeah, I agree. Pretty sure the reason xsel or xclip isn't in x11-utils is that they are not part of the Xorg project. Obviously something with equivalent functionality _should_ be there, but I guess the Xorg folks overlooked it and packagers don't want to stick in random stuff.

</comment></comment></comment></comment></comment><comment><USER12> A key command is missing: textutil.

textutil is a general purpose front end to the core text engine and is one of the cleanest docx-to-html converters I've run across, with a bunch of file formats supported and charset encoding translations, metadata manipulation commands, and assorted juicy goodness for people who have to mess with word- processed text.

Ironically the only common-on-Apple document format it can't do anything with is that of Apple's Pages word processor ...

<comment><USER13> The followup post (evidently this was from last year) credits you with that addition.

(I was surprised by the lack of support for Pages, too.)

</comment></comment><comment><USER14> I would add caffeinate, which prevents the Mac from going to sleep. It can do this indefinitely, for a fixed period of time, or after a process is done running. You can even specify that process either as the PID of an existing process or by invoking it through caffeinate itself.

<comment><USER15> Recommend "Amphetamine" as an alternative. More features and kept up to date with bug fixes and improvements. I am not affiliated, just a happy user.

<comment><USER16> Can you explain why one might use this, versus just setting the machine to not sleep in System Preferences, in combination with not turning off hard disks, etc?

I still set my display to sleep, however. Am I missing something?

<comment><USER17> You may want your machine to go to sleep normally - e.g., when you leave it on your desk at home and go to sleep - but not when you're at a hackathon, and are running some process while you go and get a snack, or are presenting a video that requires no actual input from you.

<comment><USER16> ah, I see, a `selective` sleep. Makes sense, I am going to check this out. Thank you.

</comment></comment></comment></comment></comment><comment><USER18> `say` is one of my favorite little things about OS X. In a couple of my build script, I have throw in a couple random say commands if say is installed on the system. Everyonce in a while a Dev will ping me when their computer speaks to them.

I created a gist that says a random starwars quote in each of the systems supported voices.

[https://gist.github.com/balasuar/6bf1c64594780836cfcd](https://gist.github.com/balasuar/6bf1c64594780836cfcd)

<comment><USER19> I use it for reminders, too -- eg

        sleep 240 && say "tea done"

so I don't over steep my tea

</comment></comment><comment><USER20> This is a great intro. Here's my favorite OS X Terminal trick:

⌘. (command period) is a hotkey not defined in the menu for sending BREAK. This is automatically equivalent to ctrl+c in shells, ctrl+g in emacs and ESC in Vim. Similarly, ⌘K is short for clearing the screen. These are much more ergonomic than the standards on Mac laptops and wireless keyboards.

<comment><USER21> How is cmd + K different from cmd + R and/or $ clear?

<comment><USER22> Using ⌘+K will not only clear the screen, but will also delete the scrollable history buffer in Terminal or iTerm2.

I find this useful before printing text that I want to search using ⌘+F.

</comment></comment></comment><comment><USER23> I can recommend using iTerm2 as the command line app. Apples Terminal has improved. But iTerm2 has a lot of handy features. A great terminal.

[https://www.iterm2.com](https://www.iterm2.com)

</comment><comment><USER24> One nice application I've found of pbpaste is when I want to count things I find in a browser. For example, to count the (approximate) number of comments in this thread, you can copy all text using Cmd+A, Cmd+C, then run this:

pbpaste | grep ago | wc -l

In this case there are easier (and more accurate) ways, but in other situations you can use it to find the length of a list on the web where it would otherwise be harder.

<comment><USER25> pbpaste | grep -wc ago

is 0.3% faster and 1.7% more correct :-)

</comment></comment><comment><USER26> And if you'd like to use some of those utilities on GUI apps, don't forget the utility to bind them all: Automator.app. It'll let you interact with terminal and GUI apps in all sorts of interesting ways. For example, you could create a global keyboard shortcut to upload the selected text to a pastebin.

</comment><comment><USER27> Remove unwanted formatting from text in the clipboard:

        alias pbclean='pbpaste | pbcopy'

<comment><USER28> I wrote "write the clipboard to a temp file; open it in vim; when vim exits, if the temp file has been written, load it into the clipboard". Pretty convenient.

Also, (though not, I think, relevant to OS X), binding a key to move content between PRIMARY and CLIPBOARD on X Windows has been very nice.

<comment><USER29> Not exactly memorable, but glad that I discovered it eventually: "Shift + Option + Command - V" = Paste as Plaintext.

</comment></comment></comment><comment><USER30> I'm surprised they didn't mention anything about the command line utilities to manage the mac's airport (scan for wireless networks, list network interface names, etc). I did a quick blog post about these a while back: [http://blog.mattcrampton.com/post/64144666914/managing- wifi-...](http://blog.mattcrampton.com/post/64144666914/managing-wifi- connections-using-the-mac-osx)

<comment><USER31> my airport time machine backup often hangs and I have to restart the machine (via airport utility). I wonder... is there a way to tell it to restart via a similar type of command?

</comment></comment><comment><USER32> A nice complement to the command line "open" command is adding a shell launcher to OSX finder. I have some instructions how to do this here: [http://www.win-vector.com/blog/2012/05/enhance-osx-finder/](http://www.win- vector.com/blog/2012/05/enhance-osx-finder/)

<comment><USER33> Oh wow I've been looking EVERYWHERE for that. Thanks so much!

Also, a tip: an easier way to change the icon of any app/folder/anything:

1\. Right click it -> Get Info.

2\. Drag an app that has the icon you want onto the icon in top-left of the Info window. (e.g. drag the Terminal.app into the Info window and drop it on the icon: that script will now have the same icon as the Terminal.)

</comment></comment><comment><USER34> Nice commands. Also 'sips' for batch resizing images.

If you aren't on OSX you can try the following for a simple 'say' alternative. It has some great robotic/singing voices, too.

[https://github.com/Jam3/says](https://github.com/Jam3/says)

</comment><comment><USER35> This was posted last year and did very well on HN [1]. I remember because it is literally the thing that got me interested in using the command-line as a power user...I'm embarrassed to say I hadn't really understood piping, but curling texts from Gutenberg into `say` was a fun introduction. Now I constantly use open, pbpaste, and pbcopy... learning about screencapture was also extremely helpful for my blogging and tutorial writing, as I've written a few wrappers around it to customize and optimize its output, including auto- uploading it and creating a snippet I can quickly paste into a blog post.

Great list!

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

</comment><comment><USER36> say -v cellos "Dum dum dum dum dum dum dum he he he ho ho ho fa lah lah lah lah lah lah fa lah full hoo hoo hoo"

:)

<comment><USER37> :)

I have a little local deploy script that runs this if it fails a smoke test:

say -v Bad "Deployment failed, server gave a bad response"

</comment></comment><comment><USER38> I have fond memories of discovering my college roommate's open SSH connection, and using "say" to great effect.

<comment><USER39> Back in the day you'd "telnet" into your friend's "Sun workstation" and cat an "aiff" to the "/dev/audio". How times have changed! :-)

<comment><USER40> The Sun 3/50's pixel buffer was world readable and writable by default, and in console mode had an area at the bottom not affected by scrolling. One could invert random horizontal bars across the screen, transpose the bitmap, or apply a sine wave to persuade the user the massive TV set on top of their workstation was broken. Or, fade text in and out as if the machine was commenting on the user's ineptitude. Much fun was had by all.

</comment></comment></comment><comment><USER41> The first of these is easier as:

      open -a Safari

<comment><USER42> Agreed, I often use `open -a 'Google Chrome' ./index.html` or `open -a 'Google Chrome' [http://0.0.0.0:8000`](http://0.0.0.0:8000`)

<comment><USER43> I do the same so I aliased it to just "chrome", "firefox", etc.

<comment><USER44> I aliased Sublime to `sub`. Without args it opens the current folder as a project; with args it opens the file[s].

<comment><USER45> The officially-supported name is `subl`, by the way:

[https://www.sublimetext.com/docs/2/osx_command_line.html](https://www.sublimetext.com/docs/2/osx_command_line.html)

<comment><USER44> Huh. I clearly didn't research before I wrote my one-liner. This is certainly a little more ... documented. Thanks for the heads up!

</comment></comment></comment></comment></comment></comment><comment><USER46> mdfind also has a -name option that allows one to search for the query in the filename rather than contents.

</comment><comment><USER47> Does anybody know of a good alternative to "at" on OS X? I know it's there but not enabled by default, I went through the paces required to activate it long ago but it something in Yosemite seems to have broken atrun and I can't find anything about it anywhere online.

<comment><USER48> Works for me. I would do an unload then load to see if it got messed up in the upgrade Yosemite.

      sudo launchctl unload -F /System/Library/LaunchDaemons/com.apple.atrun.plist

      sudo launchctl load -F /System/Library/LaunchDaemons/com.apple.atrun.plist

[edit: maybe check /var/at/at.allow]

</comment></comment><comment><USER49> Also dtrace and some of the included scripts like opensnoop are awesome.

</comment><comment><USER50> Great list, some really useful commands.

One question: What's wrong with "locate"? It is really fast because the file system contents are indexed. As long as you understand that it's not going to pick up the latest new files without running "updatedb" (sudo/usr/libexec/locate.updatedb" in os x) first, it's much better than find if you're doing a quick search.

However, I didn't know spotlight has a CLI. Cool.

<comment><USER51> I prefer mlocate to locate, as it rebuilds the index in a flash by diffing and by paying attention to modification dates when traversing, so you can run its updatedb more frequently without a noticable penalty.

That said, mdfind is terrific -- it's index is, as you suggested, always upto date, and it doesn't just index file names, but also content.

<comment><USER52> I like to use mdfind for ack-style search over my whole system: [https://gist.github.com/senderista/1246300](https://gist.github.com/senderista/1246300)

</comment></comment></comment><comment><USER53> Oftentimes I'll have something on the clipboard, so pbpaste | grep is good. But sometimes the thing I want to search for is long, such that I don't want to type it for the grep.

Fortunately, pbpaste takes a -pboard flag for selecting a different buffer. So cmd-e some text to put it on the find pasteboard, then 'pbpaste | fgrep --color -i "`pbpaste -pboard find`"'

I usually have this aliased to 'pbg'

</comment><comment><USER54> Sadly Xcode3's excellent merge tool seems inaccessible from the command line in Xcode4. Anyone have a fix? [http://stackoverflow.com/questions/13163670/how-to-use- xcode...](http://stackoverflow.com/questions/13163670/how-to-use- xcode-4-mergetool-in-a-standalone-fashion)

<comment><USER55>
        opendiff file1 file2

will invoke the merge tool.

<comment><USER56> It's also the default for git mergetool.

</comment></comment></comment><comment><USER57> Non-case sensitive really bothers me with OS X

<comment><USER58> This is not actually an OS limitation, it is a default filesystem choice. The Mac supports multiple types of filesystems, including case-sensitive ones.

Having said that, I wouldn't reformat your boot drive to be case-sensitive because this isn't a common configuration and I'd expect 3rd-party apps to have problems.

What you _can_ do is use Disk Utility to create a case-sensitive file system on a disk image, which gives you case-sensitive behavior when you really want it (and limited to activities on that disk).

<comment><USER57> Thank you I didn't know this. Then I will again asked why Apple is STILL on HFS+? If they actually moved to ZFS or any modern file format it really would help the developers world. Just seems that this is such a obvious need to be fixed that doesn't get any concern form Apple and most users/developers.

<comment><USER58> I'm not sure if there is an official explanation but a pretty good analysis of it is in John Siracusa's review of OS X 10.7 (Lion):

[http://arstechnica.com/apple/2011/07/mac- os-x-10-7/12](http://arstechnica.com/apple/2011/07/mac-os-x-10-7/12)

[http://arstechnica.com/apple/2011/07/mac- os-x-10-7/13](http://arstechnica.com/apple/2011/07/mac-os-x-10-7/13)

</comment></comment></comment></comment><comment><USER59> "Many a Linux power user has tried to use locate to search for files on a Mac and then quickly discovered that it didn't work."

Rather, that it gives you instructions for getting it to work. How's a Linux power user getting by without following such instructions to turn on one of their favorite utilities?

</comment><comment><USER60> I use: open vnc://myServer.local

It will open up the screen sharing app and connect for you :)

<comment><USER61> One of my favorite tricks when I learned it, because I was already in the terminal, no need to reach over for the mouse to remote into a wallboard via screen sharing.

</comment></comment><comment><USER62> Paging mods for headline change. I suggest, "OS X Command Line Utilities"

<comment><USER63> I would also change it, but your suggestion doesn't indicate if this is a comprehensive manual or a short introduction, apt for only-midly-technical folks.

I don't know if it would be worth the effort to enforce a more complete set of title guidelines, but having better titles would be nice.

</comment></comment><comment><USER64> I've documented many of these utilities here: [http://ss64.com/osx/](http://ss64.com/osx/)

<comment><USER65> Thank you for your site! When I first started using the shell, I found it useful for discovering new utilities. I still use it whenever I find myself on Windows and needing a cmd equivalent. :)

</comment></comment><comment> SG- Anyone happen to know how he's getting archey output to be colour for the Apple logo? my iTerm and Terminal is just in white/black.

<comment><USER61> Probably using an alternate shell like zsh

<comment><USER66> bash (and others) can show terminal colors just fine, terminal colors are not zsh specific.

</comment></comment></comment><comment><USER67> There is also `tmutil` to manage time machine backups, can be handy, especially in scripts.

</comment><comment><USER68> #6 is the likes of what got us detentions in middle school

</comment><comment><USER69> The "alphabetical list of all OS X commands" page this article links to is cute. :)

</comment><comment><USER70>
        say 'ay ay. ay ay. smoke weed. every day.'

</comment><comment><USER71> I like do harmless pranks on coworkers who don't lock their computers

        yes "lock your computer, numbskull" | xargs say

Just repeats the phrase in a monotone computer voice over their headphones. I only do this to engineers, tried it on a PM once, never again.

<comment><USER72> Have you ever asked yourself if maybe you're just being annoying? I don't lock my computer. It'll time out and lock after an hour but I prefer to leave it unlocked.

<comment><USER73> That's pretty terrible opsec. It presents a risk to separation of roles / compartmentalization if a coworker can walk over to your workstation and have access to it, to say nothing of malicious access by somebody who shouldn't be in the office in the first place.

<comment><USER74> If locking your computer in the office is required opsec, then you have already lost. First, you shouldn't have random people walking around the office. Once someone has physical access the battle is already over. Second, rogue employees are still rogue employees, and an unlocked computer is the least of your worries.

With that said, I always lock my computer out of habit.

<comment><USER75> Not sure what size company you're working in nor what the requirements for opsec are their nor your privilege levels but it certainly does not mean you have already lost.

</comment></comment></comment></comment></comment><comment><USER76> What's with all the buzzfeed-level headlines making HN frontpage the past few days?

Not to say this isn't a useful list (for OSX users that is), but I can't possibly be the only one weirded out by this.

<comment><USER77> > buzzfeed-level headlines making HN frontpage the past few days

This is most likely random fluctuation a.k.a. sample bias, but if you know of any that didn't get corrected, please email them to us at email@example.com so we can figure out why.

People post such titles all the time but we change them systematically. For example, we changed this one shortly after your comment. Normally we'd have replied to your comment then; probably the moderator didn't see it.

Users not in North American time zones do see more baity titles, though. We cover as broad a span of hours as we can, but it isn't 24.

<comment><USER76> Thanks - no, they all got corrected, you guys do great work :)

I think it's sample bias as well, just struck me because I rarely ever saw it before. Probably _because_ they all get corrected very quickly.

</comment></comment></comment><comment><USER78> Great list, not a big fan of homebrew personally, or its creator who seems to be full of himself. I'd recommend pkg_src from joyent[0]. homebrew seems to have a lot of the hip webdev packages, but pkg_src and joyent's repository is the real deal when it comes to hardcore UNIX package management. Some friends have a nice bootstrap for pkg_src on OS X called saveosx[1], too.

[0]: [https://pkgsrc.joyent.com/install-on- osx/](https://pkgsrc.joyent.com/install-on-osx/)

[1]: [http://www.saveosx.org/](http://www.saveosx.org/)

<comment><USER79> FWIW, I have no issues with homebrew, but I have used macports for many years and never had any issue. Especially now that it supports binary packages, I find it perfect for my usage.

<comment><USER80> I had tons of issues with macports over the years (e.g., emacs port was broken for months after 10.6 came out), but I think that was mostly a function of its smaller userbase and more difficult contribution system. Homebrew seems to have many more users and a far simpler way to contribute, so it's rare that I encounter a broken or old package.

</comment></comment></comment><comment><USER81> I'd like to someday ssh into somebody's computer; run `say` with creepy texts. JFF.

<comment><USER82> Years ago at my old office we had a G4 tower that no one used. I set up SSH on it so I could use it for long running tasks without slowing down my local machine.

A coworker was on it doing the rare at the time Safari testing - usually only on client request. I sshed into it and ran 'say "Help, I'm stuck in the computer"'. My coworker was very very confused and I was cackling to myself. He still talks about it to this day.

</comment></comment><comment><USER83> As a longtime Mac user (as early as System 7) and aficionado of UNIX, I love OS X's CLI and its affordances. The linked article provides several well- packaged tidbits that might encourage users of other CLI-replete OS's to check out OS X.

More power.

However, I'm not a fan of the soft recommendation for Homebrew. I understand Homebrew places everything in `/usr/local` but software installs on Mac should generally conform to dragging and dropping bundles inside `/Applications`.

In my experience, requirements to install packages using Homebrew could be circumvented by searching for .dmg or .pkg equivalents. The benefit is that software so installed is much easier for intermediate users to track and maintain.

<comment><USER84> I think MacPorts is a much better tool than Homebrew with way more useful packages. It also installs itself into /opt/local by default so it doesn't conflict with other stuff in /usr/local and for actual OS X or X-Windows apps, it installs them in /Applications. Luckily, they can both live on one system if you're careful, as some people insist on providing only Homebrew copies of their software, which is a bit unfortunate considering that MacPorts is clearly the better system.

<comment><USER85> I found home-brew much more problematic and more significantly much slower when i last used it (a few years back now).

<comment><USER86> At this point I've given up on any of these "package managers" for OS X.

I've thought about starting a project (possibly with some support from my company, which focuses on Linux packaging) to provide a) a tool to download and install .pkg files, and b) a toolchain for more easily building .pkg files for the things that aren't available.</comment></comment></comment></comment>


iRobot Roomba Serial Command Interface Specification [pdf] - <AUTHOR> http://www.irobot.com/images/consumer/hacker/roomba_sci_spec_manual.pdf

<comment><USER2> Having worked with Roomba SCI a while back, a few things come to mind. First is a lack of integrity checking. The default baud rate of 57600 is too high (at least for the 6-ft mini-DIN cables we could find), and it's really annoying when your Roomba goes careening off in a weird direction because your command got corrupted. Thankfully the baud rate can be reduced, but there really ought to be something in the next layer to check integrity, as the Roomba firmware is a black box.

Also, it's kinda obvious in retrospect, but Roombas were not designed to drive in straight lines. Which can be annoying if you want to use them as a robotics platform.

</comment><comment><USER3> Their competition Neato has, in my opinion, a more interesting platform to hack on, mostly due to the fact that the device has a LIDAR sensor on top.

[http://www.neatorobotics.com/resources/programmersmanual_201...](http://www.neatorobotics.com/resources/programmersmanual_20140305.pdf) [http://xv11hacking.wikispaces.com/](http://xv11hacking.wikispaces.com/)

</comment><comment><USER4> I was going to crack a "Roombaduino in 3..2..1.." joke but it turns out there is already a library for this: [http://www.airspayce.com/mikem/arduino/Roomba/](http://www.airspayce.com/mikem/arduino/Roomba/) (-:

</comment><comment><USER5> [https://github.com/dotjosh/iRobot.NET](https://github.com/dotjosh/iRobot.NET) I wrote one a while back as well, if you are using .net

</comment><comment><USER6> the cool kids are all using [https://www.npmjs.org/package/roomba](https://www.npmjs.org/package/roomba)

</comment><comment><USER7> this is hackerold not hacker news</comment>


What will happen to you as you grow older:  you will go "meta" - <AUTHOR>

That's my guess anyway.  It's certainly the case with me.  As I have grown older, I have focused more on the "big picture", thinking about things at a meta level.<p>Any similar experiences? <comment><USER2> There are two books on this, the better one was 'The Wisdom Paradox' (my bad! correction from earlier version of this comment), the less good, slower, less medical + informative was 'The Mature Mind'. IIRC from reviews (I only got 1/4 way through the first book), the theory is, that the right brain starts being used more (and it's been fed longer, now) so that, as you age, while you're maybe less 'whip smart', you have 10,000 shortcuts and indeed as you say, you see the bigger picture better.

Ugh - actually I couldn't swear the one that impressed me as 'sharper' was the first, I believe so though. I could use some of my old 'whip smarts', such as they were :(.

</comment><comment><USER3> I had a fair number of very general theories when I was young. They just weren't very good. Maybe it would be more correct to say that one will think more successfully about the big picture.

<comment><USER4> I find most of my general theories from when I was young were generally quite good, but slightly naive. My father was a mechanic, and I always wondered why cars didn't have generators used for braking. Regenerative braking became a great idea for cars powered by an electric motor, not so useful for gasoline powered cars. I thought about what it would be like to live forever, and I figured you would go through every possibility of an ever growing world. This is not so different from what I later learned about quantum physics.

</comment></comment><comment><USER5> Yes. Good observation. I wonder how much of it is environmental? As I grow older I'm thinking more about how to show other people how to do the things I figured out when I was younger and how to organize groups of people to get things done on a broader scale.

I don't want to stop thinking like I did when I was younger, though. It's important to continue learning things, which probably means paying some attention to lower-level topics.

Today is my birthday. [argh]</comment>


Uber France Leaders Arrested for Running Illegal Taxi Company - <AUTHOR> http://techcrunch.com/2015/06/29/uber-france-leaders-arrested-for-running-illegal-taxi-company/

<comment><USER2> previous discussion here :

[https://news.ycombinator.com/item?id=9798405](https://news.ycombinator.com/item?id=9798405)</comment>


Apple 'sorry' that workers listened to Siri voice recordings - <AUTHOR> https://www.bbc.com/news/technology-49502292 <comment><USER2> Your privacy and freedom should never be trusted with private business. Their statements are meaningless and they will continue to violate our privacy.</comment>


Ask HN: How to Allow Core Team to Work on Innovation Project - <AUTHOR>

I'm in an environment where a new project is being discussed where a couple of members from the Core dev team will be asked to leave the core work and start this project.
I feel that it's not good to have the other existing core devs to not be part of this new project that will be replacing the system that they will ultimately be maintaining.  Those members are eager and passionate to contribute to innovation and I feel not allowing that is harmful.
I recently read this article about how Facebook had their core team working in parallel on an innovative project.
https://hbr.org/2015/06/an-inside-look-at-facebooks-approach-to-automation-and-human-work
I'm wondering how to do something like this on a tactical level, especially in an agile scrum shop? <comment><USER2> Rewriting is (almost) always a bad idea. (and you're planning some kind of a rewrite, since the new system will replace the old one)

Let's assume that Team A will work on the newer version, while Team B will continue to work on the old version.

Team A will start working and implementing stuff. Team B will keep working on the old project and add new features. Team A will need to keep up and add new features that Team B added, and so on.

> Those members are eager and passionate to contribute ANYONE is eager to > contribute to a brand-new project!

\</comment><comment>--

How I'd do it?

1) Incremental changes on existing product. Unless you're using some ancient programming language and you have troubles on finding programmers (or you have some licensing options, or the product is locked on a certain platform; e.g. is written in obj.C and you want it ported on Windows and/or Linux), probably this is the best approach. If the system is too big to add features at first, start improving existing code. Clean up. Add unit tests. Clean up even more and start adding features.

2) If you're set on rewriting and this is the only option to consider, feature-freeze the existing project and move all developers to the new project (every once in a while, pull a developer to fix critical bugs _only_). Don't pull the same developer twice in a row though and don't ask them to fix trivial stuff.

\</comment><comment>-

Additional lecture (in no particular order):

\- [http://www.joelonsoftware.com/articles/fog0000000069.html](http://www.joelonsoftware.com/articles/fog0000000069.html)

\- [http://programmers.stackexchange.com/questions/6268/when- is-...](http://programmers.stackexchange.com/questions/6268/when-is-a-big- rewrite-the-answer)

\- [http://onstartups.com/tabid/3339/bid/2596/Why-You-Should- Alm...](http://onstartups.com/tabid/3339/bid/2596/Why-You-Should-Almost-Never- Rewrite-Your-Software.aspx)

\- [https://www.lessannoyingcrm.com/blog/code_rewrite_cautionary...](https://www.lessannoyingcrm.com/blog/code_rewrite_cautionary_tale)

\- [http://programmers.stackexchange.com/questions/6255/have- you...](http://programmers.stackexchange.com/questions/6255/have-you-ever- been-involved-in-a-big-rewrite)</comment>


It's Only Rock and Roll Event Prelude - <AUTHOR> http://daringfireball.net/2009/09/rock_and_roll_prelude <comment><USER2> His most recent post silences Beatles rumours: <http://daringfireball.net/linked/2009/09/08/beatles></comment>


The State of Mobile XMPP in 2016 - <AUTHOR> https://gultsch.de/xmpp_2016.html <comment><USER4> Related: [https://news.ycombinator.com/item?id=2069810](https://news.ycombinator.com/item?id=2069810)

To this day, XMPP is a bandwidth-hungry, unreliable mess of a protocol. Despite the enthusiasts having an XEP they can flash for every objection, the sad fact is servers and clients support varied subsets of XMPP, and it's a rare day when everyone involved supports all the features everyone wants to use.

The author seems to think that XMPP is qualified to compete with WhatsApp. While WhatsApp recently abandoned several platforms, for many many years they had even S40 (dumbphone) support. I tried to find XMPP/Jabber clients for S40 phones for YEARS, and every single one I found would immediately crash with OOM errors.

It's easy to blow off complaints like mine, because everyone on hackernews has a Samsung Universe S2000 or an iPhone 128 Plus, but these are real concerns that real people have in the real world. Wholly aside from network effects, even nontechnical users said "why do I need a smartphone to send text messages?" and "because XML" is not going to convince them.

XMPP is just a bad protocol, a holdover from an era where gleefully wrapping everything in XML was the new hotness. I hope we're moving past Global XML Obsession, and I hope I don't have to hear XMPP evangelism once we get past.

<comment><USER5> People are always bashing XMPP around but truth to be told, my experience with the Android client Conversations is pretty damn good.

I use the Android client with a personal XMPP server based on Prosody and I frequently use it to communicate with a friend who is also running his own XMPP server and the experience is very good. We never lost a message, we can share pictures just like in WhatsApp, we can send any type of file and the battery usage is unnoticeable.

It seems to me that the people who bash XMPP are people who never actually used it and they are just echoing myths from the last decade.

<comment><USER6> _It seems to me that the people who bash XMPP are people who never actually used it and they are just echoing myths from the last decade._

That's my take as well. At this point "XMPP sucks on mobile" seems to be just an outdated meme that keeps replicating itself, but has little actual relevance.

</comment></comment></comment><comment><USER6> I use Xabber on Android and it works great. All the hysteria over how bad XMPP is on mobile is over-stated in my experience. Battery life is barely affected by Xabber, compared to the main drains, like Gmail, Facebook, etc. And it pretty much "just works". I think anybody avoiding XMPP because they heard "it doesn't work on mobile" out to give it a try for themselves.

</comment><comment><USER7> Just a reminder, since this blog did not mention it at all, Matrix is great, is NOT an XML hellhole, and has their own implementation of Axolotl for private messaging: [https://matrix.org/git/olm/](https://matrix.org/git/olm/)

And Vector is pretty great too. I had the pleasant experience this weekend of making a new chat room to persistently share photos with relatives this weekend using it. And the Android client is really solid as well.

<comment><USER8> XMPP is great, NOT a JSON hellhole, and has its own implementation of Axolotl for private messaging: [https://conversations.im/omemo/](https://conversations.im/omemo/)

And Conversations is pretty great too. etc...

<comment><USER9> Honestly, there isn't a big XMPP v. Matrix thing (or at least I wish there wasn't). A good example is on the Olm side of things, where the OMEMO guys are investigating whether there's value in using Olm as their double ratchet implementation: [https://github.com/anurodhp/Monal/issues/9#issuecomment-2080...](https://github.com/anurodhp/Monal/issues/9#issuecomment-208063040) etc.

<comment><USER8> Then why, every time XMPP is mentioned, do droves of people praising Matrix and bashing XMPP show up out of nowhere?

<comment><USER9> I guess an overabundance of enthusiasm from the wider Matrix community, i guess. Speaking on behalf of the Matrix core team, we genuinely wish the XMPP community the best - for as long as Matrix & XMPP end up interoperating nicely, we're working towards the same goal of open communication. Hell, I spend most of my life atm wandering around wearing an XMPP hoodie!

If you like XMPP's philosophy of passing stanzas around, XML and XEPs, then use XMPP. If you like Matrix's philosophy of eventual-consistent synchronising conversation history, JSON and a monolithic spec, then use Matrix. Different tools for different jobs.

It's like SMTP and NNTP. You can use both of them to have conversations. They look kinda similar. You can build bridges between them. But they are totally different architectures and philosophies however and there's room in the world for both :)

</comment></comment></comment></comment></comment><comment><USER10> So... in practical terms, what's the simplest way for me to get an account on an XMPP server that supports all these modern XEPs? I _could_ maintain my own XMPP server, but I'd really rather not. Life is short, etc. Is there a reasonably-trustworthy company that I can just pay to use their XMPP server? I gather FastMail used to support this, but no longer does.

<comment><USER11> have a look at [https://account.conversations.im](https://account.conversations.im) I'm - <USER2> author of the essay and developer of Conversations - are running this server with one of the ejabberd developers. That server is really up-to-date and has everything you need to run Conversations. (every XEP mentioned in my essay)

If you want alternatives there is jabber.at, which has also proven to be very well maintained in the past.

And there is jabber.de (but they don't have MAM (yet))

<comment><USER10> This looks like a nice service, and the price seems very reasonable. Hope it works out well for you!

</comment></comment></comment><comment><USER12> Nice, I think XMPP is more relevant than ever, in an era of messaging apps that are incompatible with each others. I hope businesses come to their senses and provide a layer of interop with a standard such as XMPP. It's a win-win for everybody.

</comment><comment><USER13> Can anyone point to a comprehensive set of good XMPP clients for different platforms? It looks like Conversations is pretty solid for Android. What is there for Linux desktop? Terminal? I know about Pidgin and related ilk - <USER3> can I find which XEPs it supports?

<comment><USER14> [https://developer.pidgin.im/wiki/SupportedXEPs](https://developer.pidgin.im/wiki/SupportedXEPs) might be a good start.

<comment><USER15> Please don't recommend Pidgin; Pidgin is the IE6 of the chat world… it's terrible, it holds back the rest of the world, and it just won't die (although I know this was in response to the question; just sayin')

<comment><USER16> So what desktop client (Win/Linux) do you recommend instead? (I use pidgin, but mostly because that's what I've always used, it has quite a few weaknesses)

<comment><USER8> You could try [http://swift.im/](http://swift.im/)

</comment></comment></comment></comment></comment><comment><USER17> Given MiTM, etc attacks, why does this particular statement not sit well with me?

"Any discussion on end-to-end encryption in XMPP should begin with a reminder that in a federated system end-to-end encryption is not always necessary. When you trust your provider encrypting the transport layer is sufficient."

<comment><AUTHOR> If you trust the CA system (eg https, imaps) and your provider follows the spec and forces ssl, there isn't any particular mitm danger.

Like if you use mail internally in a domain, eg Gmail, outlook.com etc - there's no obvious mitm attack surface. Users logs into Gmail over https or imaps, emails user2@gmail either via https or smtps - and user2 logs in the same way (similar for self-hatred [lol, there were a few autocorrect errors, leaving this one in - appropriate for "self-hosted"] email).

As far as I know xmpp federation is "point2point", and the current standard demands ssl. So firstname.lastname@example.com talking to email@example.com will have the communication protected by the CA system and TLS from client1 via server1 to server2 down to client2.

It is a system of many devices, each of which might be compromised, but traditional mitm isn't the biggest danger in this case.

</comment></comment><comment><USER18> The last time I tried a mobile xmpp client it had a very ugly, painful user interface and needed to send me notifications when people where coming online or offline (which happens all the time with unreliable mobile internet).

That's the only reason I don't use it. If there's a good client I happily use it.

<comment><USER19> What app did you use? Conversations, ChatSecure and Xabber on Android and all of them are really good.

</comment></comment><comment><USER20> A naive question, can you do picture/images inside xmpp?

I hope irc can support inline images especially for web clients.

<comment><USER21> Yes. In fact anything.

<comment><USER20> [http://getkaiwa.com/](http://getkaiwa.com/) some good info on xmpp on that page.

most xmpp client still show inline-image via http-url, I failed to find any xmpp client that can natively insert an inline image just like what other popular IM messengers do these days.

</comment></comment></comment><comment><USER22> Related Communication freedom [1]

[1] [https://communicationfreedom.wordpress.com/jabberxmpp/](https://communicationfreedom.wordpress.com/jabberxmpp/)

</comment><comment><USER23> While this tells you which XEPs you should enable for a modern XMPP experience it doesn't tell you how to do that. In my experience the documentation especially for ejabberd is lacking and it's often not trivial to find out. Also this begs the obvious question: Why aren't the options to have a modern XMPP server enabled by default?

<comment><USER24> > the documentation especially for ejabberd is lacking

If you happen to remember specific things you were missing on [https://docs.ejabberd.im/](https://docs.ejabberd.im/) we'd be happy to hear about them:

[https://github.com/processone/docs.ejabberd.im/issues/new](https://github.com/processone/docs.ejabberd.im/issues/new)

</comment></comment><comment><USER25> why is XMPP shite? just look:

      <message from="email@example.com" to="firstname.lastname@example.com" xml:lang="en">
        <body>Art thou not Romeo, and a Montague?</body>
      </message>

69 chars just for the from/to. every. message. (more or less)

There is already a concept of session, why send the full ID? not just a short ID.

each byte costs energy, in this case most of the energy is spend on boilerplate, stuff that can be inferred much more cheaply.

Fortunately its not wrapped in HTTP, as that'd add _even more_ boilerplate each transaction.

<comment><USER26> [https://tools.ietf.org/html/rfc6121#section-5.2.1](https://tools.ietf.org/html/rfc6121#section-5.2.1)

because the message can be sent to different devices (resources) the user is connected with. This is not accidental complexity like you make it out to be. It is needed and wanted.

Or are you advocating a binary protocol? Personally I really like the messages exchanged with xmpp: they are easy to understand and easy to craft. I think the success of http too, lies a little bit in the fact that it is human readable.

<comment><USER25> But they are not human readable. They are only readable by humans because can be converted to text with a text reader. For a protocol to be good, it needs decent debug tools.

Yes I am advocating a binary protocol. If you want to have decent battery life, then you need to be efficient. This is the tradeoff you need to make. for something like text, I really don't understand peoples fear of binary protocols.

As an aside clients have memory nowadays, there is no reason to send the full ID for the sender in each message (unless of course you are doing encyption, but even then, once you've exchanged keys its moot) a client needs to keep track of buddies that are online, so this data can be cached, and a local ID used instead.

</comment></comment></comment><comment><USER27> timely, given [https://news.ycombinator.com/item?id=11834935](https://news.ycombinator.com/item?id=11834935)</comment>


Why this Linux user is now using Windows 3.1 - <AUTHOR> http://www.networkworld.com/community/blog/why-linux-user-now-using-windows-31

<comment><AUTHOR> My understanding is that best-practice on Hacker News is to post the title as is, but the title is somewhat misleading this article is about running photoshop on an android tablet through Windows 3.1 emulation.</comment>


No bullshit policy - <AUTHOR> https://www.gandi.net/no-bullshit

<comment><USER2> There's a law firm across the street from my office that has a "no dickheads" recruitment policy - <http://www.hyneslawyers.com.au/why-hynes-lawyers-.html>

Not dissimilar to 'Do No Evil', these are nice mantras that can garner media attention; just have to be sure they are actually implemented culturally in your company because otherwise you set yourself up for ridicule.

<comment><USER3> They may want to defend The Don't Be a Dick License (<http://github.com/SFEley/candy/blob/master/LICENSE.markdown>)

</comment></comment><comment><USER4> Five years ago I registered with them a wrong domain name, misspelled by my client. I asked them what could I do apart from registering the correct domain name this time, and they refounded my 12.54€ sending me a postal mail with a bank check. That was a good surprise for me, I will never go with another registrar.

</comment><comment><USER5> "No Bullshit" but then they force you to remember some stupid GANDI-12317251 username that you can't change.

</comment><comment><USER6> Ah man. I just started a Gandi account the other day when I needed a .it domain (and had been recommended). Definitely recommend then - the no bs stuff is real.

</comment><comment><USER7> I'm waiting for a day when you can compete successfully for selling software projects with "No Bullshit Policy".

<comment><USER8> Actually, i think the day is already here , i am seeing quite a few software companies, small-to-medium sized, competing successfully by simply saying "We will provide better customer service".</comment></comment>


UK to introduce "photograph a cop, 10 years in jail" law - <AUTHOR> http://boingboing.net/2009/02/03/uk-to-introduce-phot.html#previouspost

<comment><USER2> Flagged as flamebait. Doctorow seems not to be able to understand the difference between "armed forces" and the police.

</comment><comment><USER3> Flagged for being out of date. The post is over a year old.

<comment><AUTHOR> Ahh I didn't even notice that.</comment></comment>


Ask HN : Need Help from Hacker News Community - <AUTHOR>

So im doing this challenge and have been given the herculean task of getting 1000 surveys filled up in 24 hours (By Chinese demographic).
Here is the link
[https://www.surveymonkey.com/s/NHTR236]
I am open to any and all suggestions for help. Remember I have 24 hours to do this. <comment><USER2> Try finding a China version of Amazon's mechanical turk. And somebody who reads chinese.

<comment><AUTHOR> I think Google translate can help the students. What about any help with just getting it done in case I needed english students? Would mechanical turk be enough?</comment></comment>


Classical literature  mit.edu - <AUTHOR> http://classics.mit.edu/Browse/index.html

<comment><USER2> Quite good. Project Gutenberg, Wikisource, Wikilivres, the Internet Archive, and fourmilab (John walker's website) also have cool stuff. This is now added to my list.</comment>