Picat: A Logic-Based, Multi-Paradigm, Programming Language - <AUTHOR> http://picat-lang.org/ <comment><USER2> Picat is a pragmatic mix of several programming paradigms, and it supports both directional and non-directional computing.

Pattern-matching is directional. Consider the following predicate definitions:

p([a,b|_]) => true.

q([X,X]) => true.

A call p(L) succeeds only when L has at least two elements and the first two elements are a and b, respectively. A call q(L) succeeds only when L has exactly two identical elements.

Functions are directional. In Prolog, the length(L,N) predicate can be used to compute the length of L and can also be used to create a list of a given length N. In Picat, you need to use function new_list(N) to create a list, and use function len(L) to compute the length of L.

Loops are directional. Unlike in ECLiPSe-CLP where it is possible to iterate over a list that is to be created, in Picat the collection of every iterator must be fixed.

Unification is non-directional. A call X = Y is like an equality constraint over terms. Built-ins predicates, such as member(X,L) and append(L1,L2,L3), are defined by using unification, and can be used in the same way as in Prolog.

Constraints are non-directional. While a unification X = Y has a unique solution when it succeeds, a system of constraints may have multiple solutions. Picat provides a built-in, called solve, that calls the imported solver to search for a satisfactory or an optimal solution.

</comment><comment><USER3> That looks nice. List comprehensions, higher-order functions and arrays in a logic-based language with CLP and planning facilities sounds great. In terms of looks, I'm not sure why but it reminds me of a cross between Python and Prolog.

There's a few things that look a bit strange though. e.g.:

      perms([]) = [[]].
      perms(Lst) = [[E|P] : E in Lst, P in perms(Lst.delete(E))].

So, "|" is a cons operator, but can't be used to take a list apart by recursively separating its head from its tail? That's a bit strange.

Also:

      Compared with Prolog, Picat is arguably more expressive and
      scalable: it is not rare to find problems for which Picat
      requires an order of magnitude fewer lines of code to
      describe than Prolog and Picat can be significantly faster
      than Prolog because pattern-matching facilitates indexing of
      rules.

That's just ... no :) [Because modern Prologs index all predicats, including rules, by pattern mathing and there's nothing more expressive than FOL so].

<comment><USER4> I don't know exactly what's meant by "pattern-matching facilitates indexing of rules", but I wouldn't dismiss it so quickly. Zhou has long experience with a Prolog implementation (B-Prolog) and seems to know his stuff. The tabling feature in particular suggests that this is a state-of-the-art offering.

As for expressiveness, I think he's using the term in the sense of "how easy it is to express things", not "what is possible to express".

<comment><USER3> >> I don't know exactly what's meant by "pattern-matching facilitates indexing of rules", but I wouldn't dismiss it so quickly.

Far as I can tell, "pattern-matching facilitates indexing of rules" means that the indexing scheme builds an index with a key for every instantiation pattern of a predicate in the program database.

Prolog uses pattern matching to match a query (or a goal) to the head of a predicate in its database. To speed things up, predicates are indexed by their functor name (the predicate symbol) and the value of their first argument, if it is a constant. That's all for default Prolog.

In modern Prologs keys are built for deeper patterns- more arguments, or compound arguments at different depth etc. The particulars depend on the implementation, but basically what I get from "pattern matching facilitates etc" is that Picat allows indexing on multiple arguments, including compound terms, which could enable matching the entire pattern of a query to an index key. Which is cool and all but it's not something you won't find in Prolog.

You can find details of one indexing scheme for Prolog in Swi-Prolog's documentation on its jiti clause indexing, here:

[http://www.swi-prolog.org/pldoc/man?section=jitindex](http://www.swi- prolog.org/pldoc/man?section=jitindex)

Hope the above makes sense- I assume some knowledge of Prolog, let me know otherwise and I'm happy to clarify.

<comment><USER4> Ah, that's interesting. I wasn't aware that modern Prologs did that much indexing, though it stands to reason that they would; I hadn't really thought about it.

</comment></comment></comment></comment><comment><USER5> Interesting syntax. Can Picat programs be run backwards or in other-than- expected directions, as in Prologs and Kanrens? This relational aspect is the killer feature of logical languages, and it would be unfortunate if Picat doesn't have it.

<comment><USER6> Yes, it's possible in picat. For example, here's factorial in picat that can be computed backwards: [http://www.hakank.org/picat/factorial_reversible.pi](http://www.hakank.org/picat/factorial_reversible.pi)

</comment></comment><comment><AUTHOR> Here's the homepage of what appears to be the author or one of them. He's done a lot of interesting work on logical programming, solvers, etc. I pinged him via email in case he wants to answer anyone's questions about it.

[http://www.sci.brooklyn.cuny.edu/~zhou/](http://www.sci.brooklyn.cuny.edu/~zhou/)

</comment><comment><USER7> Example 1 makes this look like a very imperative language, otherwise why would you write out a "map" as an imperative loop? We are back to manually allocating an array the same size as an existing array, and having to remember to increment a counter at the end of a loop? I will write code like that only if there is a performance reason.

</comment><comment><USER8> My biggest problem with logic programming is that my imperative brain can't make the jump to thinking in those terms. Maybe if someone could post a bunch of examples comparing idiomatic python to prolog I could start to think in those terms. There is a 99 problems in Prolog, but those aren't exactly what I think is needed. I think that should also be done for functional programming, but I find FP far easier to grok.

<comment><USER9> In a sense, if you already understand functional programming, then the leap to logic programming is comparatively straight-forward:

Say you have a function f with N arguments that yields a value y. That is, you have y = f(x_1,...,x_N).

Then you can regard such a function as a _relation_ with (N+1) arguments, _relating_ the N arguments to the intended result y.

So, in other words, the function can be modeled as a predicate P(x_1, ..., x_N, y) that _holds_ iff y = f(x_1, ..., x_N).

The key differences between functions and predicates are:

1\. In contrast to a function, a predicate can relate the same arguments to multiple (different) results.

2\. You can query a predicate in _all_ directions, also if none of the arguments and not even the result is known, and it will still often yield useful answers. In fact, it no longer even makes sense to regard one particular argument as the "result". A predicate simply holds for certain combinations of arguments, and does not hold for others.

Hence, you can consider predicates as a natural generalization of functions, and if you are already familiar with functional programming, logic programming will likely be comparatively easy to grasp.

A large number of the 99 problems you mention are very imperatively worded, and if you solve them only in the way they are phrased then you will benefit only little from the true potential of Prolog. For example, the task descriptions ask you to "find", "reverse", "flatten" and "eliminate", but rarely to actually _express the relation_ between things so that you can use the predicate in _all_ directions and thus truly benefit from logic programming.

Ideally, the same Prolog predicate can be used to generate _all_ solutions, validate any _given_ solution, to compute a _specific_ solution etc.

</comment></comment><comment><USER10> How does this compare to Mercury?

<comment><USER9> Picat has a built-in _planner_ that enables some interesting solutions to planning tasks.

Picat has strong built-in support for important _constraints_ , notably constraints over finite domains which is a very important paradigm for solving combinatorial tasks, and a strong SAT solver that is in fact so good that it is quite competitive with some much more specialized SAT solvers.

Compared to Picat, the syntax of Mercury is much closer to Prolog. In fact, Mercury's syntax is so close to Prolog that many Mercury programs are also syntactically valid Prolog code (if you remove or support some declarations that are specific to Mercury).

In contrast to Picat, Mercury is statically typed, with explicit type, mode and determinism declarations. Mercury can and does reorder goals to satisfy mode constraints.

Mercury supports definite clause grammars (DCGs), like Prolog.

Mercury is a _pure_ language, and Picat isn't: For example, Picat programs may emit output on the terminal without any special declarations or other dedicated provisions.

<comment><USER10> Thank you for taking the time to respond! It's quite an honor to receive an answer from you, as your book has been a valuable resource whenever I worked with Prolog.

</comment></comment></comment><comment><USER11> The mix of logical and imperative programming is nice. That's probably what I should have done for fizz :(</comment>


Make your internet speed faster by unplugging your phones - <AUTHOR> https://medium.com/@rohitnadhani/make-your-internet-speed-faster-by-unplugging-your-phones-e75a0c74b449 <comment><USER2> tl;dr: connect fewer devices to router

> ... _upload, it's placed in a queue and has to wait it's turn_

its* turn</comment>


Ask HN: Are you comfortable with Checkster's User Agreement? - <AUTHOR>

A friend of mine recently started the application process for an in-house software development job at a firm where he was formerly working as a contractor. The HR department instructed him to use Checkster, but he found that service's User Agreement to be alarmingly broad. Unfortunately, when he indicated to HR that he preferred to submit his list of references in a more conventional manner (and explained why), he was told he must agree to use Checkster in order to apply for the position.
I reviewed the User Agreement in question, and I too found it to be a bit troubling:
https://app.checkster.com/legalese.php
Essentially, it seems to waive one's rights to fend off defamation, slander and libel, and to relieve Checkster of any and all legal responsibility in the event one's reputation were to be genuinely abused via their service.
What does HN's readership think of this User Agreement? Have you encountered others like it?
Have you been in a situation like my friend's, where refusal to make use of a 3rd party "HR service" has proved an obstacle to being hired? <comment><USER2> The Release Form in the User Agreement really asks you to sign away a lot in order to use their service. It doesn't seem worth it (unless maybe you're desparate for a job).

Here's a lawyer's blog that calls defamation during background checks "second most common corporate illegality": [http://macomb.patch.com/groups/richard-g- marcils-blog/p/bp--...](http://macomb.patch.com/groups/richard-g-marcils- blog/p/bp--talkin-smack-get-payback-what-to-do-about-workplace-slander).</comment>


Ask HN: What are your tips to reduce drinking alcohol? - <AUTHOR> I don't want to go teetotal, I enjoy a drink and drinking socially, at dinners, weekends etc. But there are times I drink too much and forget what happened the night before or get anxious that I did something or said something. I only ever drink on a weekend and not throughout the week.<p>Justin Kan just announced he's giving up drinking alcohol: https://twitter.com/justinkan/status/1120188473263050758 and I admire people who do this. But I always see info/tips on giving up completely, what about just keeping a lid on it? <comment><USER2> My grandfather was an alcoholic. It came about because of the great sorrow he felt after his own father died in a car accident. A small drink each day became a larger one. This iterates. Time passes. I remember when he was in rehab once, as a child I was brought to visit him. His genuineness was so magnified. He was such a good man sober; well known and loved by many in the town through his small business. He never broke free for long though. Never violent but never fully there because his faculties were always suppressed by the effects.

After many years, when his health was failing, he begged us grandchildren not to follow this path. The regret was so palpable. This was later in my college years, and with all the parties it was hard to pull back. Augustine once wrote, "To many, total abstinence is easier than perfect moderation". It is a respectable path especially for anyone too far along. I am no teetotaler either though. Moderation is also admirable.

I set two limits and they have worked fairly well in my own life:

1) No more than two reasonably sized drinks in a day.

2) Never drink alone.

I nurse those drinks along and savor each tiny sip. It has worked well for over ten years and prevented ramping up into anything further. A suggested third rule that has grown on me is:

3) Drink only to amplify joyful occasions never to drown sorrowful ones.

It may not be for everyone however perhaps this will help some. Godspeed.

</comment><comment> La-ang Change your social circle and engage in a radical (to you) sport that requires lots of stamina and endurance (Muay Thai). In short, the lifestyle you have loves conjuncting with alcohol. Sports are a major player. Not only the body gets hammered but the mind as well. I used the same method before to quit smoking. Even if you will show up at social events you won't have the same longing for Booz as you used to. I firmly believe this apply to the general public. Athletes in general do not drink as much as the average joe ( If they do at all). It's funny how people want an easy not so harsh solution to their problems, because there simply isn't. Once the elephant in the room starts ballooning you need to set your ego aside and admit you need change; major change.

<comment><USER3> I second this one. It is difficult to just change a habit on a whim. A high intensity sport (like a martial art) requires changing lifestyle habits if you really want to see serious progress.

<comment> La-ang You missed my last point. It's not meant to be easy.

</comment></comment></comment><comment><USER4> I think I have a different view on this than most people here.

It seems that there is a tendency to simply suggest that anyone who does drinks to excess sometimes is an alcoholic and therefore is a special case who cannot drink.

What I observe is that most (not only a special few) people who drink have times where they over-do it and it usually has significant negative consequences in those cases.

In my opinion people want to blame the individual because they love alcohol and don't want to admit that it could be a problem in itself.

I think there is a basic thing working against everyone who intends to moderate their alcohol consumption which is that alcohol reduces your ability to make good decisions. So on a bad day or circumstance with a reduced cognitive capacity, anyone can make a wrong decision about whether to have another drink.

So personally I think the answer is just to find other activities that are fun that don't require alcohol. Also this idea that anyone who runs into problems is an alcoholic is false and effectively stigmatizes people who decide to quit because it has the suggestion that they are an alcoholic and something is wrong with them.

If you sometimes run into problems with alcohol it's not you. It's the chemical. Don't let people try to blame you for it.

To me the answer for social lubrication is just to have some kind of structure for group activities, in other words a game. It works fine. You don't see kids walking around depressed because they couldn't go drinking with their buddies. Kids have activities and play games and have fun. There is nothing about being an adult that makes it so you can no longer have fun without alcohol.

</comment><comment><USER5> You might consider the Sinclair Method. [https://cthreefoundation.org/the- sinclair-method](https://cthreefoundation.org/the-sinclair-method)

You take an opioid antagonist, like naltrexone, 1 hour prior to drinking. Since drinking produces endorphins, which are blocked by the antagonist, the brain stops associating drinking with pleasure, which results in a lower desire to drink.

The downside being that if you drink without the antagonist, your brain returns to its old patterns.

Anecdotally, my personal experience was after trying the method was that I no longer wanted to drink, and when I did, with or without the naltrexone, my problematic drinking behaviors mostly went away. I mostly abstain now.

<comment><USER6> Upvoted. TSM worked wonders for me. I'm now past 9 months of total abstinence after using TSM for about 8 months leading up to quitting.

The idea of counter-acting the dopamine rush one gets from drinking makes a world of sense. Alcohol is a fundamentally addictive substance and naltrexone can help loosen its hold on your brain.

Abstaining now is fairly trivial. I pretty much never have the impulse to drink.

I think a lot of folks see Sinclair method as somehow cheating or "having your cake and eating it too". While that may be an alluring idea, the reality is you wind up just not wanting to drink. I now associate drinking with how naltrexone makes me feel, which is not the most fun experience.

</comment></comment><comment><USER7> When I lived in NYC I started inviting friends for a "walk and talk" instead of going to a bar. Going to a bar is such a generic crutch for "I want to spend some time with you". Walking around the city and catching up while on a nice amble was a refreshing change. Saved some money too.

<comment><USER8> This is a really good advice. I have started going on walks with my friends as well instead of going to a pub. Inspires ideas and you get way clearer thoughts.

</comment></comment><comment><USER9> If you're not a "one or two drinks" type of person and alcohol is a negatively impacting you, then you really have to permanently stop drinking like Justin Kan. The average drinker "keeps a lid" by moderating their intake because they know how to stop. It's that simple. If you don't know how to stop, then you have to stop completely.

<comment><USER10> This is something I guess I cannot understand about people who consume alcohol to the point of blacking out... For me the consequences are so harsh I just never seek to near that point. I achieve a certain level of buzz, and simply maintain it, sipping throughout the social event. It's quite pleasant, doesn't take many drinks to uphold, and I don't feel hungover in the morning. Maybe some of it is just "brain wiring"?

</comment></comment><comment><USER11> > there are times I drink too much and forget what happened the night before

That's bad.

You may not be able to reduce your alcohol consumption. Not everyone can. But...

> I only ever drink on a weekend and not throughout the week.

That's a good sign. So what's happening here is that alcohol lowers your inhibitions. When you're sober, you have control over yourself, which is why you can get through the week. When you start drinking, you lose that control, so you keep drinking, and you pass out. Whether you can drink without crossing that threshold is an open question. Like I said, not everyone can do that. For some people, one drink pushes them over the edge.

Do this experiment: next weekend, don't drink at all.

If you can do that, then the FOLLOWING weekend have ONE drink and STOP. (That's one drink for the WHOLE WEEKEND. Not one drink on Friday and another on Saturday.)

If that works out OK, then the NEXT weekend, have two and then stop. Not all at once. Pace yourself. At least an hour between drinks. If that works out OK, then the NEXT weekend go up to three.

If at any time you find yourself thinking, "This is all OK, I can have one more" then STOP. That's the danger sign.

If at any stage in this process you find yourself making excuses for why it's OK short-circuit any step in the process, then I have bad news for you: you're an alcoholic, and if you don't want to keep blacking out you're going to have to just stop.

UPDATE: raztogt21 also had some very good advice: never drink alone. It also helps to let your drinking buddies know that you're on this program so that they can help keep an eye on you. If your friends ever encourage you to drink past your limit, get new friends.

<comment><USER12> My fear is that OP is an alcoholic (yes, you can be an alcoholic without drinking - it's that you're genetically predisposed to having a drinking problem). In this case abstinence is the only answer. If you have problems to which you cannot give up even a weekend then that's a red flag.

<comment><USER11> Yes, I share your concern. That's why I framed the answer the way I did. But not everyone who occasionally drinks to excess is an alcoholic.

<comment><USER13> And, despite popular belief, there are other ways to manage alcoholism than the 12 steps & total abstinence.

<comment><USER12> Are the other methods better? What are those methods?

<comment><USER13> One medical option mentioned upthread is the Sinclair Method. It involves taking medicine like Narcan before drinking. The medicine blocks the endorphins released by drinking, so you don't get the pleasurable "reward." You basically retrain your brain, reducing your desire to drink.

When I was struggling with alcohol, I found that I needed a secondary reason to manage my drinking. Once I decided that I wanted to start dating more, and realized that my drinking and the related weight gain was an impediment, it was an incentive to reduce my alcohol intake to a more responsible amount.

I didn't quit– I still love California wine and I'm building a nice collection. And when seasonal beer that I like comes out, I definitely pick some of it up. But it doesn't control me like it used to.

</comment></comment></comment></comment></comment></comment><comment><USER14> My take is that you're better off finding a social life that is not alcohol fueled.

I have never "blacked out" but I did get in trouble with my extended family for going to parties with an open bar, drinking too much, and acting like an ass.

That for me was a wake-up call.

Then there was the time that we made a huge amount of applejack and around the holidays I would drink consistently quite a bit and find that if I didn't drink my body felt warm and I was a little irritable and I figured that was a sign of getting physically dependent -- that was a wake up call too.

More recently I've found that I usually wake up with a glucose reading around 95 (good but not great), but if I drink alcohol and have disrupted sleep I get a glucose reading around 120 (flaming diabetic).

As a result of that it is really rare that I drink these days. Maybe I have a beer or two now and then but not on a regular basis.

For me the consequences and fear of consequences has been sufficient motivation.

</comment><comment><USER15> YMMV, but after a substantially embarassing night (that I found out about the following day) I realized that the feeling of wondering if I did something embarassing (or, horror of finding out that I did) was quite a bit worse than the good feelings I got from drinking that much.

Now, whenever I drink I keep those thoughts in the forefront of my mind. I know I will have _more_ fun if I don't go overboard - with a bonus that I don't need to worry about anything the following day. Whenever I'm approaching my limit, I weigh each drink with these thoughts in mind. What will be more fun? An extra drink, potential embarassment, and lots of anxiousness? Or a glass of water, no embarassment, and no anxiousness?

I imagine this requires friends who wont egg you on. I'm lucky to have a group of friends that understand when I say "I'm done for tonight", they say "okay, no problem! want a water? pop?" rather than encouraging me to get black-out drunk.

<comment><USER16> This. Except for me it's the hangover rather than the embarrassment.

It can help to find something that isn't water to drink that will make your companions feel less like they're leaving you out - be that soda, juice, club soda, etc.

</comment></comment><comment><USER17> 1\. Build a budget for drinking. Nothing caps it like limiting the amount that you can spend on it. 2\. Have your socializing focus on activities as opposed to drinking. E.G. If you are bowling you'll be more focused on the game and than you are on the drinking. 3\. Drink a glass of water in between each drink. Double bonus for reducing hangover effects 4\. Buy a breathalizer. Yep! A weird one but you can keep the BAC below the driving limit and you'll be pleasantly surprised. 5\. Change locations often, and walk in between locations. First this is great for getting quality time with your friends. Second, you can use this trick to save money (happy hour in one place, dinner in another). Third, there will be prolonged periods of time between each location that you will not be drinking.

Sounds like you could also benefit from just imbibing drinks that are limited in alcohol content. Session Beers, Campari spritz, some sakes etc.

<comment><USER18> What if your workplace is part facilitator? Many a startup's fridges are full of beers and other alcohol in full view. Which, I think makes both 1 and 2 a challenge.

For 3, i feel like drinking a glass of water in between drinks, though a good though, only eggs you on to drink more drinks since you know you are countering it at each turn.

<comment><USER17> The author of the original post said that he doesn't drink during the week. I would agree that a fridge full of beer makes it harder.

</comment></comment></comment><comment><USER8> This is just a personal anecdote, but after taking Ecstasy/MDMA once around 9 months ago i realised how bad the alcoholic "high" is. Since then i have been drinking way less. Often only one or two beers, then i'm done. I guess what im trying to say is to reflect over who you become and how alcohol affects your personality, temperament and motoric skills when drinking alcohol excessively. Knowing i will become bad at speech, get bad motorics, and start focusing more and more on sex, and will start behaving like a cave-man towards women and men alike makes me think of alcohol in a totally separate light than before.

</comment><comment><USER19> I started to really question my drinking over the last year or so. During the week I would drink a few beers or glasses of wine a night with a martini or other cocktail sprinkled in. The weekends would often involve more with a heavy hangover coming after neighborhood parties. I've gone the route of moderation and counting drinks and it was difficult to do, depressing and left me feeling deprived much of the time. One day I was in a forum reading a question much like this and someone mentioned a book called This Naked Mind by Annie Grace. It's been a game changer for me and I'd highly recommend it. She actually suggests continuing to drink normally while you read it. She dives into a lot of the science and really opens your eyes to the world of alcohol around you. I haven't stopped completely and I'm not sure if I ever will but the pull that booze had on me before is gone and I can confidently feel I'll have a drink whenever I want; the idea of allowing yourself that freedom is empowering. Over the last 6 months I'm down maybe 75%. The social pressures are really the hardest for me now. The line of questioning you get is intense and something I was guilty of doing myself to others who weren't throwing them back with me at the time. Best of luck in your own journey wherever it takes you.

</comment><comment><USER20> Set a limit before you go out. Alternate alcoholic drinks with other drinks. Chose smaller weaker drinks. Ask your friends and family for support with your new lower limits.

[https://www.nhs.uk/live-well/alcohol-support/tips-on- cutting...](https://www.nhs.uk/live-well/alcohol-support/tips-on-cutting-down- alcohol/)

</comment><comment><USER21> Take it one day at a time. Tell yourself that today I will not drink. There are other methods, such as to be curious about your behavior.. ask questions of why you drink or ask yourself why you are drinking too much. You can find a therapist who would help with that. Be curious and explore what are the conditions that you find yourself wanting a drink and what reasons may account for them. Can you replace alcohol with something else? Then there's naltrexone and other medical interventions that work well. Essentially you redirect your biology and associate alcohol with feeling sick so your body will develop an aversion to it. Other methods include changing your group of friends if they are a source of drinking as well unless are ok being sober in their company. You can also join AA or find a sponsor. AA doesn't work for everyone but it sure does show you a cross section of life and how alcohol impacts it.

</comment><comment><USER22> For me, having hobbies that don't often include drinking seems to help. I play board games, go to book discussions, writer's groups, attend hack nights, go see a movie, go out hiking with people.

Depending on the group, there could be alcohol involved, but usually there isn't, in my experience (or just one or two people will drink, and only a glass or two).

For me it very much depends on who I'm with. I once dated a girl that loved to get wasted on alcohol on dates, and I liked her so I drank a lot with her myself. The current woman I'm dating gets sick if she drinks alcohol, so I pretty much only drink a drink here or there when I meet up with her family or I'm out with certain friends. I easily go six months without a drink now, and usually not much more than a couple of drinks a month.

If I drink too much my next day is completely unproductive, and I hate that, so that also helps to keep me from drinking too much also.

</comment><comment><USER23> Hard limit at 3. Never more. That's it. You don't need more than 3 in a night. Enjoy those 3. Never cross it.

</comment><comment><USER24> I used to drink quite a bit as a student and for a few years after uni. It's very common in the UK.

Now I have children I'd be up in the night quite a lot and if you were drunk it would feel horrendous. Also there is the possibility that you might need to be there for them if they were sick or need to go to hospital in the middle of the night. Additionally I like to do a lot of sport in my free time and I struggle to do anything even a gentle bike ride or walk if I've had a drink.

A couple of years ago I set myself a 2 drink limit. I've only broken it once or twice and I don't see that as an issue. Most of the time it means I'm ok to drive in an emergency, can be up early without a hangover and can stay active. I have a beer at home 2 or 3 times a week and really enjoy it so I don't think drinking alone is an issue for me.

Wish I'd done it years ago!

</comment><comment><USER25> It's easy for social drinking, I did it to.

There are some great 0% beers out there in Belgium. I personally recommend "Brugse Zot" ( with alcohol) and "Sport Zot" ( without alcohol), nobody will see the difference and it will make it a lot easier. ( Both taste great)

If you go to someone at home, just bring 1 pack of each with you and drink the 0%. It's the best trick I found out to reduce social drinking.

Just drink 1 of 2 without and try it out. It's actually not much different, the social "vibe" is the same.

The biggest difference seems to be when you drink water ( socially)

Ps. Only drank 1 evening in the weekend. But it was mostly when I had a lot of stress from work, that I drank too much

</comment><comment><USER26> Don't buy alcohol. Seriously, when there's no booze around, I don't drink. When there is booze around, I often end up drinking ALL of it. Don't buy it, and you're good to go.

<comment><USER27> True!

You can "out plan" temptation if you avoid making decisions in the moment.

Though - the same as a careful diet - social engagements throw a wrench in the discipline machine. Restaurants, bars, parties, etc.

<comment><USER26> Ah yeah, true true. I tend to deal with the social temptations by "pauperizing", as my wife describes it. I was very, very poor in college, would often eat before social engagements to avoid prepared meal prices etc... So now when everyone is having drinks, I pretend I'm too poor to afford them, always walk to the bar and grab a soda water on the rocks. Everyone assumes I'm drinking a mixed, and I can always DD. It's interesting how being that frugal can improve my discipline, rather than degrade it!

</comment></comment></comment><comment><USER18> What is a 'normal amount'? Is there a way of calculating this?

I know people who drink three drinks and they are gone. I also know people who drink 6 drinks a day, don't black out, get home safe and are fully(seemingly, not sure) functional and productive the next day.

Reducing to 'normal' or some level has to be backed up by meaning i think. And that meaning of normal is what I am trying to discover.

</comment><comment><USER28> Precommit. When you go to drink tell everyone (including the barkeep) your limit. When you have had a few and your inhibitions drop, come back to your precommitment.

Do not keep alcohol in your house - inconvenience is a friend of sobriety.

Remember the old saw about alcoholism : first you take a drink, then the drink takes a drink. A little bit of a runaway process may not be in your control.

</comment><comment><USER29> One technique that's worked for me is drinking a good non-alcoholic drink. In my case Beck's non-alcoholic beer is the best I've found. It's not cheap and costs more than the the usual beer I drink.

It's good enough though that I hardly notice when I drink it rather than my usual, traditional 5pm beer.

</comment><comment><USER30> Ensure you've eaten well.

Pick a drink which has a taste to your liking. Relish it while you drink it.

Drink a glass of water between drinks.

Stop after a couple of drinks. This is much easier if you've done the above.

(This may turn out to be rubbish advice but there may be a good idea or two in there.)

</comment><comment><USER31> I'm in the middle of a $5000 bet with a friend on who can stay completely sober the longest.

This seems to be working great for both of us, it's been almost a month with no end in sight.

It's crazy how satisfying non-alcoholic beers are, can't say I really miss "real" beer.

</comment><comment><USER32> I would highly recommend the book "Alcohol Explained" by William Porter.

I found it very simple yet powerful - down to earth and practical, cold explanation about every side of drinking alcohol.

</comment><comment><USER33> 1\. Never drink alone

2\. Socially, never have more than 2

Follow those two rules, and you should be fine.

</comment><comment><USER34> Count your drinks. It's way too easy to just say "yea I'll have one more" when you're not consciously thinking "well, I've had 6 already..."

</comment><comment><USER35> Looks like your system is already giving negative feedback and you are reacting to it.

</comment><comment><USER36> Remove the psychological pressure that's driving you to drink and you'll find you don't want to drink. I changed my job and dumped all my drinking friends. I'm also ok forging my own path without friends so that part was easy for me.

</comment><comment><USER37> [https://www.reddit.com/r/stopdrinking/](https://www.reddit.com/r/stopdrinking/)

</comment><comment><USER38> I never keep alcohol in my house. If I am really craving a beer, I might buy a six pack, drink one, then throw the other five in the trash.

<comment><USER39> Why not just purchase 1 beer without the six pack?

<comment><USER38> I buy the one beer unless it isn't sold individually. Only maybe once a year would I buy a six pack and only drink one.

</comment></comment></comment><comment> ko-ko-ko Drink hard liquor.

It may depend on the culture of your country and social circle, but cutting beer, wine and cocktails has allowed me to drastically cut my alcohol intake.

For example, people around me will often drink wine while eating lunch or dinner. Or they might offer you a beer if you're coming in on a hot sunday afternoon. Or if you're watching TV together. In all of these situations, drinking hard liquor or asking for it would be strange socially speaking. There are only a few occasions (before dinner with appetizers, after lunch as digestive, while having "a" drink after work...) in which it's okay to drink liquor and to be the only one doing so. And if you're invited, it would be rude to ask for a lot of liquor from your hosts (because it's more expensive than wine and they likely did not prepare for it anyways so the supply is short).

IMO It's also easier to feel you're getting drunk with liquor, because it's not as gradual as beer: when you stand up after having 3 or 4 drinks, it hits you right away that you've had too much. So you know it's time to switch to water.

<comment><USER12> This is terrible advice.

<comment> ko-ko-ko It would be if OP were an alcoholic which he clearly isn't.

OP does not mention dependence issues, his drinking is not even habitual and the effects on his social life or personal health are minor. All the advice about 12 step programs, lifestyle changes with exercising and teetotaling is going overboard b/c that is clearly not what OP asked about.

Op wanted tips on how to drink "sustainably", I find that drinking light alcoholic beverages is harder to control than hard liquor both for physical and social reasons (more social pressure to drink "light drinks", more stigma on "liquor")

<comment><USER12> > It would be if OP were an alcoholic which he clearly isn't.

You don't know that, and can't be determined by a very abbreviated post.</comment></comment></comment></comment>


UberDNS Service where you manage your zone/records with Git - <AUTHOR> http://uberdns.eu/

<comment><USER3> Love the idea, but seems a little too fly-by-night for me to want to trust real production stuff to it. DDoS-ing DNS providers seems to be the rage these days, and I'd hate to be collateral damage because the weekend project I was using as a DNS provider couldn't handle it...

And I totally get that this was just for fun... but a variant project that still used git as the UI, but sat on top of a bigger-player DNS provider's API (Route 53, maybe?) could probably give you the best of both worlds: a weekend's worth of hacking, but still using infrastructure people felt like they could trust.

<comment><AUTHOR> Thanks for your comment, and yes, of course I understand you.

I would have the infrastructure (an anycasted network with 11 PoPs, etc) - <USER2> as you said, was only a weekend project and I wasn't about using this for the project. But hm, I could later just rewrite this away from a independend dns service to some parsing thingy to input zonefiles and use APIs of existing, reliable providers (most of the popular ones have nice APIs). It's something to think about, thanks.

<comment><USER4> +1 on making this a frontend to 3d-party DNS providers.

Git-push integration with Dyn, Route53, Zerigo/8x8, Gandi, etc. would be an awesome feature.

</comment></comment></comment><comment><USER5> I don't see anything here I couldn't do myself, and in a more secure way. I don't trust handling of my DNS to random projects.

<comment><AUTHOR> Hm, but that's not an issue with this specific project, and yes, of course there is nothing what is impossible to do on yourself - but I never said that ;)

If you would let me know if there is anything what you don't like, then I'm happy to fix it or whatever :)

<comment><USER5> Well, from what I see on your site security and trust is an issue. You are asking people to direct their DNS to your servers, that is a lot of responsibility to take on. Who are you? How do I trust you? How do I know that someone can't corrupt my zone entries in your system, either on purpose or on accident. eg. lets say I setup a git repo with zone entries for another customer you serve, how do you decide which one is authoritative?

I would only consider this useful if you posted your code on github so that people can run it on their own DNS servers.

</comment></comment></comment><comment><USER6> Brilliant in its simplicity.

Could you share the technical details? What DNS server/software are you using? How do you handle input, errors (broken zones? do you perform sanity checks?), and reloads?

Do you enforce any limits? Support DNSSEC?

What's the web stack?

<comment><AUTHOR> I'm glad to answer your questions. As I wrote, this was just a fun project for like two (maybe three) evenings, you can't expect to much.

Webstack is Nginx + Ruby + Sinatra + MySQL (Datamapper, I know I should switch to Sequel) and a worker in Node.js on the slave nameserver for writing configs + reloading nsd

Servers are two small VPS, one on my own dedicated server in Frankfurt, Germany, the other in Canada from lfchosting. Nameserver is nsd, because it looked not to bad.

> How do you handle input, errors (broken zones? do you perform sanity > checks?), and reloads?

I'm performing some checks, with nsd-checkconf, etc, but I'm sure there is something I could improve. It gets reloaded everytime someone enters a domain name or pushes changes to bitbucket/githup and they are posting to the specific URL.

> Do you enforce any limits? Support DNSSEC?

Nah, there are no limits, currently. DNSSEC: No, also not looking to implement it with this project, since besides that I'm working on a more serious one, even with anycast, etc and there is dnssec already possible.

I hope I was able to answer your questions as you expected it, please let me know if you want anything more detailed or have more questions for me :)

</comment></comment><comment><USER7> <http://www.luadns.com/> is doing this as well.</comment>


Show HN: A Better redis-cli - <AUTHOR> http://iredis.io/ <comment><USER2> Nice work! I have a similar "better" redis-cli that I unfortunately never cleaned up enough to release but the two features that I built this tool for you have also added: 1) the ability to connect via TLS to a Redis instance and 2) the ability to add aliases (or DSN in your case) for easy accessibility.

On the topic of TLS connections, taking a super quick glance at the source code [1] and the documentation it looks like you've added support for this but I couldn't get it to work. I think it's failing silently and defaulting to 127.0.0.1. I tried using `--url` and dsn_alias in an `iredisrc` file. Unfortunately you don't have a flag to toggle TLS so you can't connect using TLS using only individual flags (`-a`, `-h`, etc.)

[1] [https://github.com/laixintao/iredis/blob/e0c690186c7e1875dee...](https://github.com/laixintao/iredis/blob/e0c690186c7e1875deebaf24d3de87a0e4b1237b/iredis/client.py#L62-L65)

<comment><AUTHOR> Thank for reporting this, I have to admit that I havn't test it under TLS ehouth. I will fix it ASAP.

</comment></comment><comment><USER3> Will definitely try this. Redis needs it.</comment>


Ask HN: As a lazy but concerned user, how do you run your own email server? - <AUTHOR> What the easiest to have secure email server (open source  & auto-updated, not necessarily free) running on a VPS. I've been looking into:
* https://yunohost.org/ (has email server, open source and free, GNU AGPL v.3)
* sandstorm.io which hinted at email server, but seems to be stalling
* http://cloudron.com/ which seems interesting but couldn't find much reviews
Yunohost covers the bill, but I'm surprised it has no tracktion on HN, no comments/reviews.
Are there alternatives I'm missing? What are your recommendations?
Background: Given how important email has become as authorization and how sometimes account access is hacked or revoked + how the email data usually stays with the provider I'd like to run my own server. <comment><USER2> The problem is not setting up your own email server (this is relatively easy), it is getting all your mail into other people's inboxes. Basically the big players these days (I am looking at you Microsoft) just treat any mail coming from a private server as spam. Even more frustratingly they don't do it consistently, just frequently enough that you can't rely on anyone getting your email.

After running my own email server for 15 years I gave up a couple of years ago and paid for someone else to solve the nightmare of dealing with the big email gatekeepers.

<comment><USER3> Run it in AWS. They keep their IP ranges comparatively clean.

Other hosting services, yes, you may as well not bother. I haven't found another one yet that is reliable enough at keeping deliverability from their IP ranges in good enough order.

Also make sure you set up SPF and DKIM right from the outset.

<comment><USER2> I ran into problems with an IP address I had owned for 15 years. Clean IP's will help, but they don't solve the problem completely. The real nightmare are the emails that just go missing - they don't even end up in the spam folder. If you are running some sort of mailing list it doesn't really matter, but if you are sending important transactional emails the it really does.

Apart from SPF and DKIM also make sure you also set your reverse DNS name and also set up DMARC.

</comment></comment></comment><comment><USER4> You should fix the link for cloudron, it's [https://cloudron.io](https://cloudron.io)

The problem there is as they moved from beta - you need to pay them 8$/mo to get catch-all email and updates..

<comment><USER5> Curious. Why is it a problem?

</comment></comment><comment><USER6> I run my own email server and have done for ~25 years, but what do you mean by 'secure'?

SMTP isn't a secure transport.

Having your email stored on someone else's computers (ie the cloud) is not necessarily 'secure'.

Having a well-constructed and well-managed host somewhere you physically control seems to me the most 'secure' arrangement, which is what I have always had. Currently for the cost of a Raspberry Pi and occasional 'apt-get update' etc.

<comment><AUTHOR> Thanks! I meant "more secure" = safer from (i) data mining/advertising and (ii) being locked out, than compared to gmail.

But also quite secure from discovered security vulnerabilities. For example wordpress auto-updates and doesn't rely on me doing 'apt-get update'.

I didn't mean secure as in "I want to keep out the NSA or anybody who's going after me in particular".

</comment></comment><comment><USER5> Fwiw, I can vouch for cloudron. been using it as my primary email server for over a year now. Works really well

</comment><comment><USER7> I pay for protonmail. Works like a charm, got even an app. 50 bucks a year, totally worth it.

</comment><comment><USER8> You could try an all-in-one solution like iRedMail[0] or Mail-in-a-Box[1]. Those supposedly do most of the leg work for you and set up a commonly used stack (Postfix, Dovecot, SpamAssassin, Roundcube, etc). I've never used either of them since I just install everything piecemeal, but I imagine there is an ease of use tradeoff compared to setting the same stack up yourself. In other words, it'll be easier to set up initially, but the downside is that you wont learn the ins and outs of the individual components. So if something breaks or you need to make an adjustment you're going to have a more difficult time at that point.

That said, there are some things you should be aware of when running a mail server:

1\. You need to make sure that the IP address and domain name that SMTP is bound to is not on a blacklist[2]. You also need to consider the trustworthiness of your host because you could very well get caught in the cross-fire if one of their other customers gets them range banned. Certain cloud providers that make it very easy to change IP will more than likely have all of their addresses on some blacklist or another.

2\. You also need to make sure you have matching forward (A record) and reverse (PTR record) DNS records for that IP address. This is called Forward- confirmed reverse DNS, aka FCrDNS. Many mail servers will reject email from servers that do not have or have mismatching records for FCrDNS.

3\. You must set up SPF and DKIM. Many mail servers will either reject mail from servers without these, or at least weight heavily against it.

4\. You probably want to make sure TLS is set up properly, otherwise your mail is going to travel the internet in plaintext.

5\. The IP address you're sending from is going to start off with no reputation. The volume, type of mail, and how many people mark your mail as spam is going to decide whether other mail servers start filtering you or not. You may have no problems here. If you're unlucky, you will need to try to reach out to whichever major mail provider is filtering your mail. Many of them have a ticketing system for this, but you'll be at the mercy of whomever is working that ticket. There are also various whitelists that might be worth trying your server on. They're usually very selective and will probably reject your request.

6\. You really, really need to make sure you've got your policies set up correctly because you do not want to accidentally set up an open relay[3] that will be used to spam other people.

7\. Greylisting is a very, very effective means of spam filtering. The downside is that mail from new servers wont be delivered instantaneously and will instead be delivered whenever their mail server tries to deliver it again. Other than that, most spam is malformed in some way so some basic DNS checks will filter a ton of it. There are also free RBL and DNSBL lists that will pick up the slack.

[0] [http://www.iredmail.org/](http://www.iredmail.org/) [1] [https://mailinabox.email/](https://mailinabox.email/) [2] [https://mxtoolbox.com/blacklists.aspx](https://mxtoolbox.com/blacklists.aspx) [3] [https://en.wikipedia.org/wiki/Open_mail_relay](https://en.wikipedia.org/wiki/Open_mail_relay)

</comment><comment><USER9> you don't.</comment>


Military site blocking - <AUTHOR>

Did you know 500,000+ users in the navy network can not access bit.ly or any .ly on the web?  If your demigraphic is 18-26 then beware of this traffic stopper.  This goes for any domain that is not US.  I am not sure what the reasoning would be for blocking entire toplevels, any ideas? <comment><USER2> "any ideas?" - due to the embargo against Libya?

Presumably the Navy doesn't block every non-US domain. For instance, surely .ca and .uk are OK?

<comment><AUTHOR> .ca and .uk are only allowed via exception.

<comment><USER2> Good thing my UK-based web sites use .com :)

</comment></comment></comment><comment><AUTHOR> Forgot to mention that the navy then post links using bit.ly.</comment>


Men In Tech - <AUTHOR> http://blog.wekeroad.com/2012/05/11/men-in-tech <comment><AUTHOR> I like Rob's piece here - it certainly made me put myself into a woman's shoes more than I have in the past.

That said, it seems like this "brogrammer" thing may be getting a bit overblown. I'm certain that it is a real thing, but it can't really be as common as the litany of articles about it make it sound, can it? Maybe I don't see it as much because I'm on the East Coast?

<comment><USER2> Consider immature littleboy behavior is everywhere. Its not More prevalent in programming, and this is not an issue, or any more of an issue than anywhere else.

Still, its good to recognize a problem in your own house, and this is as good a place (HN) as any to look into the dirty corners of our industry.</comment></comment>


First ever official ReactOS laptop - <AUTHOR> http://www.youtube.com/watch?v=Vw7aOCJiaX8

<comment><AUTHOR> in russian:

[http://habrahabr.ru/company/reactos/blog/261313/](http://habrahabr.ru/company/reactos/blog/261313/)</comment>


Pseudolocalization to Catch i18n Errors Early - <AUTHOR> http://google-opensource.blogspot.com/2011/06/pseudolocalization-to-catch-i18n-errors.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+GoogleOpenSourceBlog+%28Google+Open+Source+Blog%29

<comment><USER2> I'm doing it a little simpler and I think it's even easier to spot missed translations. Let's say there's a text that translated in english would be: 'Please type your username and do something'. Instead of using plain english as the source for the translations, I'm using something like this as source: 'TYPE_USERNAME_DO_SOMETHING'. Caps are very easy to spot.</comment>


Why Teachers Like Me Support Unions - <AUTHOR> http://www.anurbanteacherseducation.com/2011/03/why-teachers-like-me-support-unions.html

<comment><USER2> I don't necessarily disagree with his points. School administrators are corrupt a lot of the time. And schools are run in a way that's counterproductive a lot of the time.

But the flaw in his logic is that he's saying we need another corrupt system to balance out the corrupt administrative system. When the real point seems to be that the system in its entirety is corrupt. From the school administration to the school unions.

The real answer is that any system that's not held accountable will become corrupt. Given that we have to ask the question of whether the unions help make the system as a whole more accountable.

Or in other words I agree that unions are only half the problem but they're still part of the problem and not the solution.

</comment><comment><USER3> Here in Quebec we always get that same argument that teachers unions are in the end the safeguard of our education system, status quo.

A new political party (<http://www.coalitionavenir.org/>) proposed an option to increase teacher's accountability. They proposed an automatic salary raise of 35% to all of Quebec public school teachers but in exchange unions had to drop seniority, let schools evaluate teachers each year and give them the possibility to lay-off the rotten tomatoes. Guess what was the unions response to this fair deal ... NEVER. You can make your own conclusion...

Unions are not even fighting for their members they are fighting for their own survival.

</comment><comment><USER4> School choice ([http://www.edchoice.org/School-Choice/What-is-School- Choice....](http://www.edchoice.org/School-Choice/What-is-School-Choice.aspx)) via vouchers addresses the needs of students. Presumably he should support that since it will keep "malicious administrators" in check the same way supermarket choice keeps malicious supermarket managers in check.

<comment><USER5> Ireland, where I grew up, has public education but also a pretty free school choice system. I think it's better than the US approach, but it's not a magic bullet.

Retail competition works well because there isn't a huge cost involved with trying out or switching to a competing supplier. Switching schools is a big disruption for everyone involved, and a market that can't clear in the normal economic way, same as healthcare/insurance. So while I'm supportive of your idea, it's only part of a broader approach to reform.

<comment><USER6> It seems a lot of money goes into massive school complexes. In a more free education market, I think you'd see smaller neighborhood schools, which would make school switching much less costly.

A teacher needs a single room, which can be in a community center, a small office, or their home. If the licensing requirements for teachers and schools were removed it would be easy to setup. Parents could decide who qualified to teach, instead of bureaucrats.

<comment><USER5> _Parents could decide who qualified to teach, instead of bureaucrats._

This already happens via elected school boards. And you get people teaching intelligent design instead of evolution. I see the point you're trying to make, but think you're being wildly optimistic and over-simplifying the problem to boot.

</comment></comment></comment></comment><comment><USER7> Sure, they're a great idea. Idea. In reality, teachers unions don't seem to care about actually educating kids. Particular example, why was the rubber room process in NY so hard to get rid of? And why does that seem like the norm? Anybody who cares about education should despise a system that makes it take years to fire people who -deserve- to be fired.

Author just ignores the 'they are often corrupt' and 'arguments against unions emphasize their attention to the interests of the teachers at the expense of the students' points - they get one sentence and then dropped. This reads like an argument in favor of communism. Look at it on paper, looks great. Doesn't work well with actual people involved.

</comment><comment><USER8> I would have liked the post to include specific instances and episodes that illustrate why teacher unions are a good idea. As it stands, it's difficult (impossible?) for me to evaluate

</comment><comment><USER9> Unions are great when the group supported is homogeneous. Otherwise, in my opinion alone, they are pretty inefficient to the functioning of the firm.

I don't say that people shouldn't have the right to collectively bargain. I just worry about the right balance of power between right-to-work and union extremes.

</comment><comment><USER10> The problem with public schools aren't just unions. He's right. Corrupt administrators mostly stem from the direct transfer of school funds. Because the funds are transferred in bulk from government entities, there's plenty of opportunity for nepotism, corruption, and other unfortunate side-effects. Everybody wants a piece of that pie.

Easily solved by eliminating the proxy of those government officials. Vouchers. Since the parents are channeling the cash, it makes it much more difficult to grab a piece of it. On top of that, parents can exert significant force to make sure teachers are treated fairly, especially if they're the ones writing the checks.

</comment><comment><USER4> _When school children start paying union dues, that's when I'll start representing the interests of school children._

Albert Shanker - past president of the American Federation of Teachers

</comment><comment><USER11> Keeping your job regardless of performance is what's wrong with the core element of many unions. Not all unions are corrupt but the majority of them fit the description my mom gave them, "Unions are to protect lazy workers". By the way, she's a union bus & light rail operator for 10+ years.</comment>


Android ICS will be available in January for all devices with CyanogenMod - <AUTHOR> http://www.slashgear.com/android-4-0-ice-cream-sandwich-will-be-available-in-january-for-hacked-devices-15195342/ <comment><USER2> Headline is inaccurate; Cyanogen's tweet is in no way a promised release date for anything. Although I'd still bet good money that the CM team will have a stable ICS build out well before most manufacturers.</comment>


Show HN: Hiring and Seeking Who Is Hiring Faster - <AUTHOR> https://osjobs.github.io/ <comment><USER2> Love how simple this is. Looking forward to seeing how it works.

Even in such a simple form, I'd like to see good usability practice: \- If I leave the field without modifying it, I shouldn't see an error message. \- When I click the Subscribe button after correcting an error, it moves and my click misses. It can be tricky, but you should take care to ensure UI elements do not move when the user might be in the middle of an interaction. It's not always avoidable, but it should be as rare as you can make it.</comment>


A Crash Course in Computer Science: Reading List - <AUTHOR> http://refer.ly/p/jchenry/collections/show/a_crash_course_in_computer_science__reading_list/fcecf4a0003811e2a4ec22000a1d0d51 <comment><USER2> "Crash" suggests quick. I don't see anything quick about these books. Working through these would take many months of full-time work. Many of these books are references, not particularly suited to self-study.

@dmor, these are not a good introduction for non-technical people to start to learn about computer science. Try the coursera course <https://www.coursera.org/course/cs101>

<comment><USER3> OTOH, better to spend your time and effort on the best, than to spend it in varying degrees of frustration with the relatively poor quality of alternatives.

In this sense, an excellent list of the best resources can indeed be part of a "crash" course. Because, going in, the student may not know what to pick, and without a good instructor/mentor/advisor -- whether in person or in video and text -- less optimal choices may considerably slow things down.

</comment></comment><comment><AUTHOR> Submitting this primarily for my non-technical YC batchmates - Colin is a good friend of mine who was very supportive as I became a software developer. These are great resources from a tough but awesome teacher. Yes, this is on @Referly so Colin will earn money if you buy through his links.

<comment><AUTHOR> Also, here is the blog post that accompanies this collection: [http://jchenry.me/2011/05/26/Reading-List-%3AA-Crash- Course-...](http://jchenry.me/2011/05/26/Reading-List-%3AA-Crash-Course-in- Computer-Science.html)

</comment></comment><comment><USER4> I applaud the fact that this isn't just a post about "how to learn" to code; however, I think there is a need to specify that some of these references are not entirely necessary for a decent subset of programmers. For example, you listed Computer Organization and Design by Patterson & Hennessy. I think it's a fantastic book, and had to go through 11 chapters of it for the sake of a Stanford architecture class. The first few chapters almost feel like a must read for all, but unless you're going to be doing system stuff, i'm not sure it's really that important to know the intricate detail of pipelining.

Additionally, I think a good starting reference you may want to add for not- so-deeply technical folks is Computer Systems, A Programmer's Perspective by Bryant & O'Hallaron.

<comment><USER5> I would add the book 'Elements of Computing Systems' [1] by Nisan and Schocken (in addition to CS:APP) as a replacement for COD. COD is more of a reference book rather than a teaching one.

[1] <http://www1.idc.ac.il/tecs/>

</comment></comment><comment><USER6> Looks like 10 text books (read: ~$100 each) with no descriptions and referral links to Amazon.

edit for clarity.

<comment><USER7> The Dragon Book alone tops your estimate by about 15%.

<comment><USER8> I think he meant ~$100 each.

</comment></comment></comment><comment><USER5> Here is the blog post that goes along with this - [http://jchenry.me/2011/05/26/Reading-List-%3AA-Crash- Course-...](http://jchenry.me/2011/05/26/Reading-List-%3AA-Crash-Course-in- Computer-Science.html)</comment>


Ottoman-Era Photographs Take on New Meaning in Their Digital Life (2018) - <AUTHOR> https://blogs.getty.edu/iris/ottoman-era-photographs-take-on-new-meaning-in-their-digital-life/ <comment><USER2> To whomever posted this, thank you. My father was from Turkey, and he often spoke longingly of his homeland. The images included here were transporting. I only wish he were still around so that I could sit there and thumb through them with him.

<comment><USER3> If you haven't gone before, you must visit!

</comment></comment><comment><USER4> For those that don't know, Turkey (Ottoman Empire) ruled for over 600 years over a very large empire. [https://en.wikipedia.org/wiki/Ottoman_Empire](https://en.wikipedia.org/wiki/Ottoman_Empire) Quite a few times they tried taking over proper Europe, like Italy (Pope was there) and Austria. They ruled the Balkans, Northern Africa, Saudi Arabia, Caucasus etc etc. They didn't invest anything in occupied areas but didn't _directly_ force conversions to Islam. Conversions had a lot of benefits of course so quite a few people did over the centuries.

Eventually Russia and European powers did them in, empire was rotting for centuries...

(Turkey's Erdogan is now trying to be the Sunni leader, only to be opposed by Saudi Arabia, which was pwnd by the Turks for centuries.)

<comment><USER5> > _but didn 't directly force conversions to Islam_

Well, not for the general population. But they did it lots of times...

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

"They began as an elite corps of slaves made up of kidnapped young Christian boys who were converted to Islam"

<comment><USER6> Also I think there was an extra tax for other abrahamic, and if you married into you had to convert.

</comment></comment></comment><comment><USER7> I was surprised to see an enormous sign saying YORKSHIRE, although i suppose if a Yorkshireman put up a sign it would hardly be a small one. Having squinted at the pixels, i think it was probably an advert, or an office sign, for an insurance company:

[https://heritage.aviva.com/our- history/companies/y/yorkshire...](https://heritage.aviva.com/our- history/companies/y/yorkshire-insurance-company-ltd/)

There's another sign for an insurance company, Aachen & Munich, below it.

</comment><comment><USER8> Latin labels on the buildings are very interesting. Because, we switched to latin in 1928.

<comment><USER9> You mean to the Latin alphabet from the Arabic one, right?

</comment></comment><comment><USER10> Is the full set of images available for viewing online by the general public or only for "Experts"?

<comment><USER11> From the comments to the article:

> Annelisa Stephan on December 18, 2018 at 12:07 pm

> You can browse all the photos at the following link: > [http://primo.getty.edu/GRI:GETTY_ALMA21118428440001551](http://primo.getty.edu/GRI:GETTY_ALMA21118428440001551)

> Click the links to the right of the screen reading "Connect to digitized > images of…" to browse the various series. From there, select an item by > clicking the blue title link. Once you are in a record for an individual > image or album, click the thumbnail image to the right of the screen to see > it larger and, in the case of albums, page through the contents.

<comment><USER10> Very easy to miss seeing the image thumbnail, it appears on the extreme right, and if you don't scroll horizontally, not visible.

<comment><USER12> Even with that description, I can't find it.

</comment></comment></comment></comment><comment><USER13> Could someone who has actually bothered to read the article (unlike me) elucidate in what way the photographs have changed in meaning? Thanks.

<comment><USER14> One way is through changes in context, by organizing them by origin and theme so that they contribute to a larger narrative. Another is through enriching them with metadata that would not be obvious from simply looking at the image.</comment></comment>


Ask HN: How do you sell things that you don't have? - <AUTHOR>

Inspired by Microsoft early strategy, they sold their product before they have build/have it? Interested in knowing how you guys do & did it? <comment><USER2> Your methodology will depend on the product or service you plan to offer. If it's software you could build an interactive mockup. If it's a physical product you could hire a 3D artist to create some photo-realistic renders based on your product specs. The rest really comes down to having a strong knowledge of your market and your offer. Like Elyrly said, you could go the crowdfunding route. You could also set up your own landing page and accept email addresses or pre-orders. The key is to make sure you have a strategy and system in place to actually fulfill your promise. That might mean lining up manufacturers or other vendors ahead of time, creating a budget, and working out a timeline for fulfillment.

</comment><comment><USER3> I have seen products created on crowdfunding website that actually showed how- many customers have paid for the item. This in turns allow you time to manufacture the product knowing each item is not a sunk cost.</comment>


A look at the inner workings of the Great Firewall of China - <AUTHOR> http://viewdns.info/research/dns-cache-poisoning-in-the-peoples-republic-of-china/?

<comment><USER2> Here is another look at the inner workings of that marvel of technology:

<http://www.wired.com/threatlevel/2008/05/leaked-cisco-do/>

and

<http://www.nytimes.com/cfr/international/slot1_021606.html>

If China got their gear through shell companies in the West that would be one thing but to find outright proof that Cisco (and Juniper Networks) knew the destination of the hardware they sold and were cooperating with the Chinese authorities on this is unforgivable.

Their excuse is that 'other companies would do the same thing if they didn't do it'.

Selling hardware with deep packet inspection capabilities to repressive regimes should be against the law.

And maybe DPI should have never been added as a feature to begin with, the downsides of a feature like that are much larger than the upsides.

<comment><USER3> I've been involved in conversations with ISPs in different countries who are required by law to intercept their customers traffic. On one particular occasion I remember being told by an ISP in Germany that they wouldn't buy from us unless we developed a feature that allowed them to snoop on their users. It's called 'lawful interception'.

We developed this feature and sold them equipment. Am I a bad person? Where do you draw the line?

ISPs all over the world are looking at their users' traffic. Some of them are doing it nefariously while others are being required by law to do so against their will. It's shouldn't be the job of a vendor to determine right from wrong.

Before you go condemning networking vendors think about weapons manufacturers. American companies routinely sell guns to countries that use them against their own citizens. And nothing comes of it.

<comment><USER2> > Before you go condemning networking vendors think about weapons > manufacturers. American companies routinely sell guns to countries that use > them against their own citizens.

Yes, and that is something that ought to be illegal too.

Whether you're a bad person or not is not for me to say, you can make that judgment for yourself. Personally I would refuse to build such a feature and likely it would cost me my job. Then someone else, maybe you, would step in to do it anyway. So in the end my resistance would amount to 'nothing'. But I'd sleep a lot better because of that, as long as you don't lose sleep over it you're doing fine.

We all get to make these decisions on an individual basis.

<comment><USER4> > Whether you're a bad person or not is not for me to say, you can make that > judgment for yourself.

If you're not saying that these people are "bad people" then what's your basis of demanding that their actions be illegal?

<comment><USER5> Laws aren't always based in morality, even when they align with morals. Even when a person commits a "bad" act, that does not necessarily make them a "bad person."

After all, only God can judge them, right? ;)

<comment><USER6> I think it doesn't make them a 'bad person' because people are always capable of changing (even if it only happens once in a while). And it doesn't make them a bad person because our actions are mostly a reaction to our environment, and we don't always have a correct/full view of it to begin with.

So, applying your judgments to a person who reacts to their environment based on limited information and experiences, and saying they are fundamentally good or bad may not be totally logical.

Then the saying "only God can judge" means that an omnipotent being, who perfectly understands everything, is the only being capable of perfect judgments and certain condemnation or praise.

</comment></comment></comment></comment></comment></comment><comment><USER5> First off, I take issue with starting an article by citing an emperor from over 2000 years ago to bolster a claim about a modern government.

That said my brother is in China now, and I setup a squid proxy for him using AWS (in singapore). Unencrypted it does no good, facebook and youtube actually cause the proxy to stop working for him briefly (without a proxy its a coinflip wether they will load or not).

So he just sent me a public key so I can setup an SSH tunnel. That should do it, too bad it's impractical to set up 1billion+ SSH tunnels for the citizens over there!

<comment><USER7>
      > r from over 2000 years ago to bolster a claim about a
      > modern government.

It may be specious reasoning, but I read justifications for a number of things coming out of China that appeal to their long history. E.g. Country X was part of China X hundred years ago, therefore it has always been a part of China and we are just reclaiming what is ours.

<comment><USER5> That is fair too, China has more history than any other country, and only few cultures can claim to be as old.

When asked about democracy most Chinese I have spoken to refer to their last hundreds years of history, which is filled with all kinds of turmoil. When thinking of managing a billion people stability is an easy concept to appeal to.

<comment><USER8> _China has more history than any other country_

No. That would be Iraq or Egypt. Writing was invented much earlier in the Fertile Crescent and in the Nile Valley than in China.

<http://oi.uchicago.edu/OI/MUS/ED/TRC/MESO/writing.html>

It always jars me (I was a Chinese major as an undergraduate) when people refer to "5,000 years of Chinese history," because that is wrong by 2,000 years. China only has 3,000 years of history, and the actual history of China, as for most countries, includes accounts of pre-historical legends that go back before accurate, recorded history.

It is correct (other comments in this thread) that Chinese political philosophers mostly came up with rationales for strong central authority rather than rationales for individual liberty like the Greek and Roman political philosophers, but that was a bug rather than a feature.

</comment></comment></comment></comment><comment><USER9> DNS Cache Poisoning is one method to perform censorship, however people could bypass it by distributing customized /etc/hosts file, when youtube and twitter were first blocked, it's widely used. Then ppl behind GFW realized that, they deployed keyword detection and IP blocking. Nowadays, to access "outside world" Chinese ppl have to use VPN or encrypted proxies.

</comment><comment><USER10> I wonder how strategic they're being in their choice of IPs returned. Sending a large number of invalid requests from IPs all over China to foreign servers could help in masking their hacking attempts against those servers.

</comment><comment><USER11> In the end, it won't matter whether the Chinese Communist Party controls routers and deploys DPI scans. It's irrelevant, because lasting change usually comes from WITHIN. In the not too distant past, Eastern Germany suffered a similar fate; people couldn't receive western airwaves, phones were monitored, mail got searched... the 'Stasi' had almost 'the perfect control' setup. And they still collapsed. _From within_. Ditto for the new arab spring. It's just a matter of time.

</comment><comment><USER12> Can they use Google Public DNS to avoid this issue?

<http://code.google.com/speed/public-dns/>

<comment><USER13> No, because it's not that Chinese DNS servers are returning bogus data, it's that the DNS servers are returning correct data, which is being modified before it gets to you.

You could point your system to Google DNS (assuming for a moment that it isn't blocked, which it is), but then your DNS results would still be twiddled in transit.

</comment></comment><comment><USER14> Does this mean that you can still browse websites like Facebook or Twitter by directly typing in the IP address?

</comment><comment><USER15> Can someone speak with authority as to how easy it is (or isn't) for tech- savvy Chinese to get around the GFOC, and what techniques are used?

<comment><USER16> The most common methods are using web proxies and VPNs. Web proxies usually get blocked fairly quickly, whereas VPNs normally cost money. I don't know what you mean by "tech-savvy" but both are widely used by ordinary citizens.</comment></comment>


Mattermark Index: Y Combinator Summer 2013 Companies - <AUTHOR> http://mattermark.com/fastest-growing-y-combinator-summer-2013-companies-ranked-by-mattermark-score/

<comment><USER4> The index and score from Mattermark are great for consumer facing companies and mobile app companies but are pretty useless for most other industries. I checked some companies that are making making millions in revenue and they had a double/triple digit mattermark score. I am pretty sure that isn't a good representation.

Also, a note for those signing up for the trial, there is neither an option to cancel your subscription directly nor information about billing inside the application. You have to email them to cancel the account and i got a response after 5 days(3 working days) when i sent an email asking them to cancel my trial account. While it is totally acceptable for an early stage startup to not have those features and i am sure they have it in their backlog, just make sure you don't send that cancelation email the day before your trial ends.

</comment><comment><USER5> _We 've ranked the current Y Combinator Summer 2013 batch by Mattermark Score – which awards points to each company on a weekly basis for increasing their website traffic, mobile downloads, inbound links, Twitter followers, Facebook likes, and LinkedIn followers._

It's hard for me to understand how this formula could be a valuable measure of growth of a startup, since most of these things can be easily purchased. I'd guess that growth of Facebook Likes, Twitter followers, LinkedIn followers and website traffic are more accurately a measure of a company's ad spend than their actual growth in revenue and users.

<comment><USER6> Those things are easy to purchase in the short term, but it quickly becomes very expensive to purchase 10% week-over-week increase of Twitter followers, Facebook likes, web traffic, etc (I know, I've tried this before). The Mattermark Score reflects long term growth trends, short term spikes aren't enough to move the needle.

<comment><USER5> I think that could make sense in the long term, but with YC companies on demo day, I'm not sure it does. Most of these companies appear to have <1000 followers on the services you're measuring. If Likes and Followers cost a dollar each, then it wouldn't be too expensive to buy a spot at the top of your list in this case.

It's interesting that the company at the bottom of your list (Reebee) has 3x the Twitter followers and 6x the FB followers that the company at the top of the list (OneMonthRails) has. If Reebee started out (i.e., when you started tracking them) with a couple hundred followers on each of these services and OneMonthRails started out with none, then Reebee had the deck stacked against them, needing to add 100x+ the number of followers added by companies that began with no traction, during a limited time frame.

<comment><USER6> We're very aware of these issues and our algorithm accounts for them.

You're welcome to sign up for free trial to poke around and see why each company's score it what it is. We provide graphs and details on all the data points for each company. [http://www.mattermark.com/app/signup](http://www.mattermark.com/app/signup)

</comment></comment></comment></comment><comment><USER7> Based off of Danielle Morrill's previous blog posts ranking startups and this Mattermark post, I get the sense that a lot of this ranking is putting certain companies "against" each other even though it's like comparing apples and oranges. For example, does it makes sense to compare a SaaS company with a $10K ACV that makes Google Adwords work against a company that gets 10 tweets a second because it's viral?

<comment><USER6> It's just ranking the growth rates of the signals I listed in the post - <USER2> saying which company is "best". Frankly, I think a lot of these rankings differ greatly from what I think the overall potential of a company is (I saw them present yesterday at Alumni Demo Day), but potential is not what we're measuring here. Growth is certainly another data point for investors to consider, and historically has been a part of massive information asymmetry - VCs are already looking up all these metrics about companies (manually) as they research, source and diligence. We're just making that more efficient and transparent.

At the end of the day investors do have to choose one company over another, as very few can justify investing in all of them. We're trying to give them more info to go off beyond hype. All of these companies tackle large markets with varied margins, and I believe investors are smart enough to sort that out for themselves and make decisions based on their domain knowledge, relationships, and expertise.

<comment><USER8> "We're trying to give them more info to go off beyond hype."

All you're measuring is hype though. Startups that rely on likes, follows, etc. as a gauge of success/traction are by nature, hype driven.

There are many industries - B2B, EdTech, etc. - where lack of social media traction is not at all an indicator of the health of a startup. I know because I run one. We have 0 likes, 0 mentions, 0 follows, but a hundred paying customers and on track to hit 1MM in revenue in less than 20 months since launch (with only 4 employees).

I hate to be critical of other founders, but all you're doing is contributing to and validating all the silliness that is the SV startup scene.

<comment><USER9> I think you make good points .. and also that mattermark probably would agree.

One problem is stats like you mentioned are hard to count, as for one you may have a competitive incentive to hide them. For another, there are no easy APIs or ways of scraping that data.

What mattermark could do (and are probably doing) is learning what stats are signals of success for what types of startups. For a consumer web or mobile startup, mattermark's data is likely a very good health indicator, for a b2b thing likely not.

<comment><USER7> Yes I agree that this data is better to have than to not have. A savvy investor can use this as a starting point for their own research, I was just worried at the framing of the posts ranking companies (in the past based off of alexa mostly and now off of other metrics such as likes, follows, tweets).

A couple examples to play devil's advocate even when discussing consumer startups against other consumer startups: 1) The social media startup that relies on spammy incentives to retweet or like something. 2) The ecommerce startup that relies on free giveaways or hefty price cuts to get people to tweet or post deals that are not sustainable from a business perspective.

Unless there are other signals that you can combine with this data, in many instances it can be deceiving. Like I said, the data can still be a great starting point because you at least see the data ranked with the names of the startups and then can investigate those startups closer from other perspectives.

<comment><USER6> At the end of the day investors still need to meet with founders and do their diligence, but I believe we may be able to bring attention to _good_ companies that are not spammy or dishonest but also don't get a lot of press, attention, etc.

Within Mattermark Pro investors can filter by stage, vertical, business model, geography and many other factors to create useful comparisons between companies... Mattermark scores for B2B companies are quite meaningful when comparing apples to apples. I know it is painful to judge and be judged in this ecosystem, but I hope people will see that we are blogging about interesting stuff that others aren't covering and bringing more transparency and information symmetry than before.

</comment></comment></comment></comment></comment></comment><comment><USER10> Not only are these Mattermark posts becoming quite boring and repetitive, but for the company's sake it's time to move on. Readers of HN aren't going to make a purchase. And if entrepreneurs/hackers are the target market, then it's time to rethink that strategy a bit.

<comment><USER11> I think you underestimate the number of investors reading HN. They may not post. They're definitely reading.

</comment></comment><comment><USER12> Seems like there are an awful lot of programming tools, restaurants, and delivery. The programming tools I get - these are hackers developing for hackers. Is delivery a wave because of Amazon and others trying to provide convenience, or is it the softwarization of our industry? And the food - <USER3> that on the back of the GrubHub and SeemlessWeb success?

</comment><comment><USER13> Interesting index. One funny note: [http://www.hackermeter.com/](http://www.hackermeter.com/) and [https://onemonthrails.com/](https://onemonthrails.com/) use the same photo. Found that kind of funny

</comment><comment><USER14> This is a great tool for other startups, funds, and companies. Just clone these companies in that order, they're already pre-vetted by good VC's like PG and also somewhat market tested.

A smart VC could just send of them as a spec to dev team in Russia/India, and hire mechanical turkers to blitz forums. Even hire a few good writers to create blogs and post to HN.</comment>


Ask YC: Best Mailing List Software? - <AUTHOR>

What are all of you using to manage your mailing lists? I've been using Mailman, but am curious as to any other alternatives I might have overlooked that are arguably better. <comment><USER2> ezmlm ( <http://ezmlm.org/> )

<comment><USER3> Totally agreed. And if you aren't running qmail, there is a GREAT clone of ezmlm called mlmmj which works on other MTAs. Find it here: <http://mlmmj.mmj.dk/>

Oh, and Mailman is a total piece of garbage. The fact that it sends me a plaintext email with my plaintext password is garbage. And that monthly subscription reminder? All garbage.</comment></comment>


Ask HN: How do you market an iPhone App? - <AUTHOR>

Although I have been developing for the iPhone for a while, I just released my first personal iPhone app.  What is the best way to market the app?  What blogs should I contact and offer free codes?  What techniques have you found work the best? <comment><USER2> Wave your magic wand and get featured by apple ;)

For "free" marketing techniques : -Add your app to your forum signatures wherever you post most often -Twitter giveaways -Tell your friends and family -Submit to review sites/ blogs (In my experience you might try small blogs first unless you have connections at a major blog or think your app is mind blowing)

For paid techniques: -iAds (I haven't seen conversion numbers yet) -Admob/Adwords/etc (No one that I know has had success with this) -Pay per install

Disclaimer: I own and am just launching a pay per install company called adsreloaded.com (there was another thread about this launch in which people seemed skeptical on the idea, but I also received interested from a few developers). If you are interested I have a special offer in which the 25% cut I usually take is added to your campaign instead. If you aren't interested I hope some suggestions of mine do help :)

</comment><comment><USER3> There are several ways, this is what I would do:

1) Give the app to industry bloggers, writers and anyone willing to listen to your pitch 2) Submit your app to as many directories as possible 3) Find where your target demo congregates online and become active there 4) Consider an affiliate program to induce sales (banner ads) 5) Rinse and repeat...

</comment><comment><USER4> Tell all your friends about it. Write to bloggers who have written about the problems your app solves (or if it sib entertainment, relevant bloggers in that space). Tell us about it. Socialize a lot and tell everyone you meet about it (after you've genuinely enquirer about their passion/work/life).

</comment><comment><USER5> I am wondering, does anyone have insight into how App Store search results are ordered? Can anyone give SEO tips for the app store search?

</comment><comment><USER6> I have no experience, but it would help to tell us which app, I imagine techniques can be different for different types of apps.

</comment><comment><USER7> Show HN: ... might be a good start

</comment><comment><USER8> submit your app to the review sites there are quite a lot of them</comment>


Editing code on Android using Atom on PC (tomwhore) - <AUTHOR> (From some hacking by https://keybase.io/tomhiggins)
On your AndroidOS device

  Install Termux (https://termux.com/)

  Launch Termux

  Type these commands

     > apt install openssh

     > touch ~/.ssh/authorized_keys

     > chmod 600 ~/.ssh/authorized_keys

     > chmod 700 ~/.ssh

     > ssh-keygen

     > cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

     > chmod 600 ~/.ssh/authorized_keys

     > sshd

     > scp ~/.ssh/id_rsa email@example.com:/path/of/id_rsa

To SSH into Android from the Remote Host

   Type this command from within a Terminal

      > ssh -p 8022 -i /path/of/id_rsa IPofYourAndroid

To SFTP into Android from the Remote Host

    Type this command from within a Terminal

      > sftp -P 8022 -i /path/of/id_rsa IPofYourAndroid

 To Mount to the Termux Directories On the Remote Host Device

   Make sure you have SSHFS installed

   Type this command

      >sshfs anything@IPofYourAndroid:/data/data/com.termux/files/home/ /path/on/remote/to/mount/ -p 8022 -o IdentityFile=/path/of/id_rsa

   Once Mounted you can access the files and directoris on the Android device from

   any app/program (example, file managers, Atom editor, Libre Office, etc etc)

 Links to sources:
SSH Under Termux - https://oliverse.ch/tech/2015/11/06/run-an-ssh-server-on-your-android-with-termux.html
Termux Help - https://termux.com/help.html <comment> yjftsjthsd-h ecdsa keys are, I believe, faster and more secure. To use them, replace "rsa" with "ecdsa" wherever it occurs, and ssh-keygen with "ssh-keygen -t ecdsa"</comment>


Revealed: US Spy Operation That Targets Social Medial [2011] - <AUTHOR> http://www.guardian.co.uk/technology/2011/mar/17/us-spy-operation-social-networks?resubmit

<comment><USER2> > He said none of the interventions would be in English, as it would be > unlawful to "address US audiences" with such technology...

Huh? Because Americans do not speak Farsi or Arabic? What about Chinese? Or Spanish? Or French? Is the NSA going to provide a list of languages that Americans are not officially supposed to speak?

</comment><comment><USER3> Historically accusations of being agent provocateurs or public opinion saboteurs have been used against political enemies just as often as the actual tactics. Maybe more often, even.</comment>


Array languages for Lisp programmers (2010) - <AUTHOR> http://archive.vector.org.uk/art10500180

<comment><USER2> One of the things that annoys me most is when people suggest that the power of array-oriented programming is in having a boatload of built-in array processing functions with short names. As noted in the article, that kind of thing is simple to build as a library in most languages. There is a deeper thing, built into the semantics itself -- the way operators are automatically generalized to work on arbitrarily high-dimensional arrays, which can be manipulated by the programmer. Append (`,` in J) isn't just for tacking a vector onto a vector. It's also for sticking an extra element onto every row of a matrix (or every column), or for tacking the rows of two matrices together (or their columns), extending a rectuangular prism with a new plane (along which dimension? whichever you want!)... I'd talk about 4-, 5-dimensional, and higher if we had convenient prose terms for them. All this is from manipulating how the append function gets lifted to multi-dimensional structures. Or maybe you want to just add a matrix and a vector... do you want to treat the vector as a row or as a column? How about getting an outer product? Operate on the entirety of one argument and individual cells of the other, still just by manipulating how lifting is done. If you haven't been messing with verbs' ranks, you've only had a superficial look at array- oriented programming.

This kind of flexibility is not specific to the functions that come in the standard library. It's part of the language semantics, so it applies to every function the programmer writes. That's a fair bit harder to package up as a library (I've done it in Racket by more or less temporarily redefining function application), so I tend to be dubious of claims to have brought this paradigm into another language. Array-oriented programming is not just a combinator library.

<comment><USER3> >One of the things that annoys me most is when people suggest that the power of array-oriented programming is in having a boatload of built-in array processing functions with short names.

I agree, and that's unfortunate because that's not the most differentiating thing about array languages. As you point out, it is the semantics: some of it appears in other functional languages (like doing away without loop constructions) but some are unique to array languages (like using various properties of matrix/vector operations to express certain computations concisely).

I am a big believer of linear algebra as a great tool of thought for computation that most people have little to no knowledge of, and the APL family (and actually, Excel) brings home this point.

EDIT: And I definitely speak from my experience. I was a professional q programmer for two years, and I came to realize what makes q difficult for many people is not just its cryptic notation but also the general lack of understanding of linear algebra/matrix operations.

</comment></comment><comment><USER4> Notation as Tool of Thought [1] is worth reading. I always felt Ken Iverson took the wrong path in developing J. I think it was a case of wanting to fit a square peg into a round hole: Doing a non-ASCII character set was very hard back then. In leaving symbols behind he destroyed the very thing he so eloquently examines in this important paper.

[1] [http://www.eecg.toronto.edu/~jzhu/csc326/readings/iverson.pd...](http://www.eecg.toronto.edu/~jzhu/csc326/readings/iverson.pdf)

</comment><comment><USER5> I remember this piece being better. Now it seems rather glib. As someone who programs mostly in Lisp, I think I've learned more from studying array languages than from anything else outside of Lisp. Implementing a handful of functions and declaring APL "absorbed" is silly.

</comment><comment><USER3> A great IDE to learn array languages for most people: Excel/Google Spreadsheets.

No, I am not kidding. Excel, or spreadsheets in general, is a great, readily available environment to learn how to think like an APL programmer. Sure, the notations are not there, and you will be copy-and-pasting cell references as opposed to typing in obscure operators, but the essential idea is there: how to think about computation in a geometrical/tabular way.

</comment><comment><USER6> Just having a collection oriented interface is not enough. However, with aggressive deforestation and JIT it would make for an interesting rival. I think and hope this is where Julia is headed.

The novelty of array languages lie not just in their semantics of acting on collections rather than items at a time. They shine when their interpreters are especially tuned for this use case. So in spite of being interpreted, these languages can be quite fast because once the interpreter dispatches to a(n ideally) hefty primitive that operates on collections, the interpreter gets out of the way for a while.

These languages are designed to express _and, critically, also exploit_ low

       (interpetation workload) / (computation workload)

This is a similar to the notion of minimizing communication per computation.

Assuming this post will attract some array language experts, may I ask what happened to Nial ?

@sedachv If you arent familiar already, Manticore might interest you. [http://manticore.cs.uchicago.edu](http://manticore.cs.uchicago.edu)

<comment><USER7> > However, with aggressive deforestation and JIT it would make for an > interesting rival.

SERIES had a lot of early work in deforestation and almost made it into the Common Lisp standard: [http://series.sourceforge.net/](http://series.sourceforge.net/)

I want to see NESL ([http://www.cs.cmu.edu/~scandal/nesl.html](http://www.cs.cmu.edu/~scandal/nesl.html)) brought back for modern systems. Even StarLisp ([http://en.wikipedia.org/wiki/*Lisp](http://en.wikipedia.org/wiki/*Lisp)) makes Hadoop look absolutely retarded.

</comment></comment><comment><USER8> It would be very interesting to see some code in CL, which would allow to run embedded J. Not a Lisp equivalent - since notation is important - but straight J.

<comment><USER2> J's notation is a bit problematic for anything that has completely separate phases for translation and execution. An identifier may stand for a noun (array), verb (first-order function), adverb (unary second-order function), or conjunction (binary second-order function). Which one it stands for affects how the line containing it should be parsed but is not really known until run time. Historically, implementations of APL family languages have generally gone back and forth between reading a line, executing it, reading another line, etc.

<comment><USER9> True, but K doesn't have this problem - the parsing is entirely lexical, like Lisp (and unlike J, C and C++)

</comment></comment></comment><comment><USER10> I find it odd that R isn't mentioned. It's the most widely used and popular 'array' language, and rules the statistics/ML domain...</comment>


Taxes Won't Kill Bitcoin, but Tax Reporting Might - T-A http://dealbook.nytimes.com/2014/03/26/taxes-wont-kill-bitcoin-but-tax-reporting-might/?_php=true&_type=blogs&_r=0

<comment><AUTHOR> _Suppose you are self-employed, and you hire a virtual assistant in the Philippines to help manage your administrative tasks, and that person accepts payment in Bitcoin. Under the I.R.S. guidance, you have to obtain a taxpayer identification number from the assistant, just as if you were paying the person in dollars._

Not, to my understanding, actually accurate. Assuming your assistant in the Philippines is not a US person and performs no work physically within the United States, then their income from you is not US-source. You have no obligation to 1099 them (and, indeed, filing a 1099 would be incorrect). If you wanted to develop a paper trail for explaining to a later examiner why you didn't 1099 them you could ask for a W8-BEN, which is basically just "The named person certifies they are not a US person. Signed, Named Person" with a few more form fields. You aren't even, to my understanding, obligated to get that.</comment>