Swift: Madness of Generic Integer - <AUTHOR> http://blog.krzyzanowskim.com/2015/03/01/swift_madness_of_generic_integer <comment><USER2> To summarize, the author has two problems:

1\. Bit shift is not part of the IntegerType protocol, when it should be (although the author could avoid the issue by accumulating the bytes in a UIntMax instead of the generic type).

2\. Construction from (and conversion to) a UIntMax bit pattern is not part of the IntegerType protocol, when it should be (done correctly, this addresses the author's sign _and_ construction complaints)

The author incorrectly claims/implies that these are problems with generics or protocols or the diversity of integer types in Swift. They're really a problem of omissions in the standard library protocols that are forcing some very cumbersome workarounds. The necessary functionality exists, it just isn't part of the relevant protocols. Submit these as bugs to Apple.

Edit:

As a follow up, here's a version that gets around the standard library limitations using an unsafe pointer...

      func integerWithBytes<T: IntegerType>(bytes:[UInt8]) -> T? {
        if (bytes.count < sizeof(T)) {
            return nil
        }
        var i:UIntMax = 0
        for (var j = 0; j < sizeof(T); j++) {
            i = i | (UIntMax(bytes[j]) << UIntMax(j * 8))
        }
        return withUnsafePointer(&i) { ip -> T in
            return UnsafePointer<T>(ip).memory
        }
      }

Of course, at that point, why not simply reinterpret the array buffer directly...

        func integerWithBytes<T: IntegerType>(bytes:[UInt8]) -> T? {
            if (bytes.count < sizeof(T)) {
                return nil
            }
            return bytes.withUnsafeBufferPointer() { bp -> T in
                return UnsafePointer<T>(bp.baseAddress).memory
            }
        }

<comment><USER3> The more protocols that are added, the more concepts there are to scare people away from what they think of as relatively simple primitives. 26 is already a scary number of concepts to tie to simple whole numbers.

To be clear, the complexity is inherent in using numbers programmatically. The only real way around it would be to reduce flexibility around overloading operators, forcing people to implement bundles of related operators that are all associated with a concept (protocol). This would decrease the utility of overloading for implementing some algebras.

</comment></comment><comment><USER4> Wow that takes me back. Back to a conference room where we were talking about Integers in Java. If you made it a class, an Integer could carry along all this other stuff about how big it was, what the operators were, etc. But generating code for it was painful because your code had to do all of these checks when 99% of the time you probably just wanted the native integer implementation of the CPU. And Boolean's were they their own type or just a 1 bit Integer? And did that make an enum {foo, bar, baz, bletch, blech, barf, bingo} just a 3 bit integer?

Integers as types can compile quickly, but then you need multiple types to handle the multiple cases. Essentially you have pre-decoded the size by making into a type.

At one point you had class Number, subclasses Real, Cardinal, and Complex, and within those a constructor which defined their precision. But I think everyone agreed it wasn't going to replace Fortran.

The scripting languages get pretty close to making this a non-visible thing, at the cost of some execution speed. Swift took it to an extreme, which I understand, but I probably wouldn't have gone there myself. The old char, short, long types seem so quaint now.

<comment><USER5> Just because they look like objects to the programmer they don't need to be at implementation level, like the Pascal family of languages.

<comment><USER6> This is only true until the programmer actually uses them like objects. If the programmer, say, sticks the IntObj into a LinkedList<IntObj>, suddenly that integer is going to need some sort of additional overhead associated with it.

<comment><USER5> Why?

It is a matter of how a specific language is implemented, if tagged types are used, how generic code is handled and so on.

<comment><USER6> Because adding/removing an object in a linked list requires some sort of connection between the object and the list (e.g. a "next" field). Regardless whether or not that's abstracted away by the language --- no language can perform magic.

(To pre-empt a possible misunderstanding: I'm talking about adding the integer itself to the list, not a copy of a snapshot of its value.)

<comment><USER7> What? Are you familiar with pointers? If you want a List<*int>, you can have that. "Next" is part of the list cell, not the contained object.

<comment><USER6> Yes, I'm a bit familiar with pointers ;)

You can store the "next" in a list cell if you want, but there still has to be some way to figure out, given just the object, which cell it corresponds to. Well, you could traverse the whole list to find it, but I sure hope you understand why that's a bad idea. Sure, compute a hash---but that computation is overhead.

Why do you think Java distinguishes Integer from int? If it were possible to have integers that walked, talked, and quacked like an object, but without any overhead, then we wouldn't use integers. We'd use those things instead.

<comment><USER5> > Why do you think Java distinguishes Integer from int?

Because the compiler writers didn't want to spend effort using tagged types or compiler optimization techniques.

The original goal was to generate bytecode for simple execution in embedded devices.

.NET for example, does not distinguish between Integer and int. One is the alias for the other.

Eiffel INTEGER is mapped to a plain C int[0], when generating native code.

Smalltalk implementations usually use byte tagging to map primitive objects to register sizes. Described in the blue book.

Ada Integer has quite a few pre-defined attributes and the language allows for additional user defined attributes[0]. Additionally one can specify the amount of bits used for storage.

Any good CS compiler design course would cover such cases in detail.

[0] Which is a pure OO language.

[1] think methods

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> I once, many years ago, wrote something titled "Type Integer Considered Harmful". (This was way back during the 16-32 bit transition). My position was that the user should declare integer types with ranges (as in Pascal and Ada), and it was the compiler's job to insure that intermediate variables must not overflow unless the user-defined ranges would also be violated. Overflowing a user range would be an error. The goal was to get the same answer on all platforms regardless of the underlying architecture.

The main implication is that expressions with more than one operator tend to need larger intermediate temporary variables. (For the following examples, assume all the variables are the same integer type.) For "a = b * c", the expression "b * c" is limited by the size of "a", so you don't need a larger intermediate. But "a = (b * c)/d" requires an temporary big enough to handle "b * c", which may be bigger than "a". Compilers could impose some limit on how big an intermediate they supported.

This hides the underlying machine architecture and makes arithmetic behave consistently. Either you get the right answer numerically, or you get an overflow exception.

Because integer ranges weren't in C/C++, this approach didn't get much traction. Dealing with word size differences became less of an issue when the 24-bit, 36-bit, 48-bit and 60-bit machines died off in favor of the 32/64 bit standard. So this never became necessary. It's still a good way to think about integer arithmetic.

<comment><USER9> Especially in higher-level languages, I've wished language designers would move toward using variable-size/bignum integers instead of fixed size integers (Python does this, for example). It eliminates overflow, and the need to analyze each int to see if it will overflow the type you're sticking it into.

I wouldn't mind being able to have a "RangedInt<min, max>" type either, in addition. If the bounds are tight enough, the compiler could just use the next-bigger machine integer type (and do bounds-checking, please!). I think a integral type that was always modulo the max would be useful in many applications as well (i.e., unsigned, and overflow is well-defined to wrap, but you explicitly opt-in to this behavior.) You can imagine,

      int: signed, bounded only by memory
      ranged_int<min, max>: integer type capable of holding anything in [min, max].
         Over/underflow is an error (exception? panic? [1])
      modulo_int<min, max>: unsigned, overflow wraps.
         (Mathematicians probably have a better name here… "ring"?)
      "usize" or "size_t": capable of holding any memory address, so useful for indexes.
      native::uint8, native::uint16, etc: whatever your hardware gives you, if you really need it.

The default type a new coder would grab for (int) won't overflow on them, although there are questions about what does some_array[int_index] do, esp. if it overflows the index type.

[1] Rust has some interesting thoughts here, and I thought they did a good job of detailing the consequences and their reasoning; see [https://github.com/rust- lang/rfcs/blob/master/text/0560-inte...](https://github.com/rust- lang/rfcs/blob/master/text/0560-integer-overflow.md).

<comment><USER8> If you want wrapping, use the "mod" or "%" operator. The compiler should be made to understand how to generate fast code for idioms such as "n = (n+1)%65536;"

</comment></comment></comment><comment><USER10> For amusement value, the Haskell equivalent is:

      import Data.Bits
      import Data.List(unfoldr)

      f :: (Num a, Bits a) => a -> [a]
      f = unfoldr $ \case
        0 -> Nothing
        n -> Just (n .&. 0xff, n `shift` 8)

<comment><USER11> That's the inverse of the function the author wants, which ought to have type '[Word8] -> Maybe a' (where 'Nothing' is returned when the bytes exceed the range of the type in question).

<comment><USER10> My bad. Then I'll leave it as an exercise for the reader; the signature of the correct function is the same.

<comment><USER12> This is so typical in the Haskell world, comment with a short snippet of code that does not produce the intended result, and when this is pointed out dismiss it as a trivial implementation problem.

<comment><USER13> Here you go, then:

        -- little-endian sequence of bytes to arbitrary integral type
        integerWithBytes :: (Bits a, Integral a) => [Word8] -> a
        integerWithBytes = foldr (\byte acc -> (acc `shiftL` 8) + fromIntegral byte) 0

At least, I'm pretty sure that's what the article was trying to do...

I don't think this is some amazing showcase of Haskell; after all, the article includes a (working?) implementation in C++. But it does serve as a nice counterexample to the idea -- expressed elsewhere in the thread -- that being generic is necessarily a hugely painful or complicated thing.

<comment><USER14> Yep this works:

        λ> import Data.Bits
        λ> let integerWithBytes = foldr (\byte acc -> (acc `shiftL` 8) + fromIntegral byte) 0
        λ> integerWithBytes [0xFF, 0xFF, 0xFF, 0xFF]
        4294967295

</comment></comment></comment></comment></comment></comment><comment><USER15> Generic code is like nerd sniping.

I look at this and think "why would you want to write generic code for all those ints?"

The integer types may look similar but they're different in more ways than they're similar. They have different bit sizes, different signedness. The CPU literally has to do different things depending if its `uint8` or `int64`. So why do you want or expect one piece of code that does it all?

It's just so much easier and faster to do it like Go, have non-generic functions that do exactly what you want and as a result, get meaningful work done. It's faster to write (because you don't need to figure out how to do in a generic way), faster and easier to read, and possible to make changes to one func but not others.

<comment><USER16> Because it should be trivial?

        template<typename T>
        T getValue(std::array<char, sizeof (T)> bytes) {
            return *reinterpret_cast<T *>(bytes.data());
        }

<comment><USER17> Well, it's not really fair to compare an implementation that throws out memory safety to a type-safe language. Swift has pointer casts too.

<comment><USER16> A memory safe implementation is only a bit longer:

        template<typename T>
        T getValue(std::array<char, sizeof (T)> bytes) {
            T result = 0;
            for (char byte : bytes) {
                result <<= 8;
                result |= byte;
            }
            return result;
        }

<comment><USER3> The reason this works in C++ is because it doesn't have protocols. The operations that T is required to support in order to be a valid type argument to this function are not expressed symbolically; they need to be documented, otherwise you end up with compiler error messages that quickly get unwieldy in more complex scenarios.

In large part, that's the problem the OP is confronted with. When you make these things symbolic and first-class, unless they're extremely complete, you find holes in the system. And when they're very complete, you find yourself overwhelmed by the number and apparent complexity of what should be simple. There's an inherent conflict.

<comment><USER18> C++ templates do have "protocols," they just aren't necessary. The result is that the perpetrator of a template error is ambiguous.

check out type traits: [http://en.cppreference.com/w/cpp/types](http://en.cppreference.com/w/cpp/types) and std::enable_if: [http://en.cppreference.com/w/cpp/types/enable_if](http://en.cppreference.com/w/cpp/types/enable_if)

"concepts lite" is a proposal to add syntactic sugar for type traits as well as enhance them a bit.

in general this is how C++ does things now: first add library-level solutions as far as possible, then add language-level syntactic sugar once the usage and implementation is fully understood.

</comment></comment></comment></comment></comment></comment><comment><USER19> I guess this sort of gets at the crux of the issue: Do you want it to be more like a scripting language (which would basically give you the mathematical equivalent of "integer" including unlimited size) at the cost of speed, or do you want it to be closer to the implementation in the CPU, which entails dealing with 8/16/32/64 bit limits and sign bits?

Why not have a way to do both? You can get an easy-to-use Int when speed is less of a concern, and can deal with Int16's, Int32's, UInt32's and whatnot when the job demands it.

<comment><USER20> If you have tagged integers you can have 31 bit ints that are super fast (one shift away from the actual number). The performance cost (allocation) is only when it overflows.

</comment></comment><comment><USER21> I think you all are being too nice to Apple.

I had a similar experience as the blog post author. I spent many hours battling generics and the huge forest of (undocumented) protocols to do something seemingly trivial. I just gave up rather than try to pin down exactly what was wrong in a long and detailed blog post.

The prevailing answer to everything seem to be: Write a bug report to Apple and use Objective-C (or Swift's UnsafePointer and related).

This ignores what I think really is the issue here: Swift has an overly complex type system. This picture:

[http://swiftdoc.org/type/Int/hierarchy/](http://swiftdoc.org/type/Int/hierarchy/)

Tells a lot. And this is from unofficial documentation that has been generated from Swift libraries. When you read the documentation Apple provides there is little explanation of this huge protocol hierarchy and the rationale behind it.

It seems to me that: Swift has been released in a rush with bugs even in the core language and compiler. Lacking documentation. And of course even a larger number of bugs in the IDE support, debugging etc.

Secondly: Swift battles the problem of easy-to-understand typesafe generics like so many other languages only it has it much worse: It carries a lot of stuff from Objective-C and it has to support easy interoperability. Plus it has ideas like not allowing implicit conversion of number types (requiring an integer added to a double to be explicitly converted to a double) causing the big type system to show it's messy head again and again.

I really want to love Swift but it will take years for Swift to be as clean and productive as Objective-C.

I my opinion what Apple should have done was to create the "CoffeeScript" of Objective-C. A language that essentially was Objective-C in terms of language features but with a concise syntax.

</comment><comment><USER22> How does [0xFF, 0xFF, 0xFF, 0xFF], interpreted as a UInt32 turn into 16777215?

I would have guessed 4294967295

<comment><USER23> I assume it's just a typo/incomplete edit; his graphic directly below has the bit representation 00000000111111111111111111111111 indicating [0x00, 0xFF, 0xFF, 0xFF].

</comment></comment><comment><USER24> The Swift equivalent of his first `NSData` example is essentially this:

        func integerWithBytes<T:IntegerType>(bytes:[UInt8]) -> T
        {
            let valueFromArrayPointer = { (arrayPointer: UnsafePointer<UInt8>) in
                return unsafeBitCast(arrayPointer, UnsafePointer<T>.self).memory
            }
            return valueFromArrayPointer(bytes)
        }

        let bytes:[UInt8] = [0x00, 0x01, 0x00, 0x00]
        let result: UInt32 = integerWithBytes(bytes)
        assert(result == 256)

</comment><comment><USER25> "All problems in computer science can be solved by another level of indirection, except of course for the problem of too many indirections." ~David John Wheeler

</comment><comment><USER26> I wouldn't expect a much better design from a language developed behind closed doors with no community input.

Now all we can do is file bugs against Apple, and hope they improve it; they who chose to release a new language with but three months of public beta. They obviously didn't care much to have their designs tested or incorporate feedback then.

</comment><comment><USER27> > More or less, what I want to archive can be done with old world NSData: > data.getBytes(&i, length: sizeofValue(i))

That doesn't work in C/C++ if you are using a modern optimizer.

C does not have the other Swift issues the author mentions, so shifting into the largest int and casting from there does work.

</comment><comment><USER28> I'm glad I'm not the only one having this issue.

</comment><comment><USER29> So no macros? Seriously, isn't that the way to solve this?

<comment><USER30> No macros in swift</comment></comment>


Covid-19 Australia: Understanding Exponential Growth and ICU Saturation - <AUTHOR> https://www.reddit.com/r/australia/comments/fomffv/covid19_in_australia_understanding_exponential/ <comment><AUTHOR> "Exponential growth is a difficult concept to grasp. One looks at the numbers and they seem reasonable, so you take measured action. But in 3 days those numbers double, and in another 3 days they double again. Suddenly 100 cases becomes 500 and then 2000. The only way to control exponential phenomena is to get ahead of the curve. The charts below indicate that we are only days away from reaching a critical point where the cases will exceed the capacity of our healthcare system."</comment>


Resolved Question: What is the meaning of the Universe? - <AUTHOR> http://answers.yahoo.com/question/index?qid=20100508154542AAe2LPl

<comment><USER2> > _The closest to "objective purpose" that humans can understand is survival._

No, that's not an answer to a question about meaning, it's another unanswered question: "what is the meaning of survival?" Survival is not itself a meaning, it is a means to an end, but it leaves unanswered the question of what end survival serves.

The existence of the universe, and the fact of human survival, are equally uninformative by themselves.

It's circular to answer a question about the universe with the "explanation" that it's about survival.

This is why philosophy isn't either a science or a suitable activity for grownups.

</comment><comment><USER3> I thought this question had already been answered by Deep Thought? :)</comment>


Ask HN: Advice for a newly graduated Rails dev - <AUTHOR>

The two posts earlier today asking for advice made me realise that I could do with some myself.
I graduate from university this week and have been looking for a job for the past few months. During uni I did contract work and am now trying to find something permanent. I've gotten through multiple rounds of interviews with several companies and coding tests have never been an issue for me, despite this I've been unsuccessful so far.
It'd be good to hear stories of how people got their first jobs whether at startups or not. <comment><USER2> When I was interviewing for my first developer job (about three years ago) I found most employers/interviewers were far more interested in side projects I had been doing for fun than anything I did for/at school.

If you already have some side stuff you do on your own try to highlight those during the interview process, if you don't you might want to consider starting one. Ideally open source these (on GitHub or similar) so they can see the quality of the code you write in "real life" (i.e. as opposed to whiteboarding during an interview).

Learning other languages can also be helpful, even if you're only interested in Ruby stuff. Each language you learn will make you a better programmer, and it demonstrates to potential employers a desire to learn ( _very_ important in our industry).</comment>


How to create a snap for how2 (stackoverflow from the terminal) - <AUTHOR> https://blog.simos.info/how-to-create-a-snap-for-how2-stackoverflow-from-the-terminal-in-ubuntu-16-04/ <comment><AUTHOR> tldr; how2 is a command-line nodejs app. The installation on your Linux system involves installing nodejs and dependencies (duh!). This tutorial shows how to create a snap with snapcraft so that the whole thing is confined and only allows networking to work.

If you are not interested in the tutorial, you try install the snap straight away by running

snap install how2

and then try it out with

how2 read file while changing

Snaps are supported in several Linux distributions, [https://snapcraft.io/](https://snapcraft.io/)</comment>


What happens if GPS fails? - <AUTHOR> http://www.theatlantic.com/technology/archive/2016/06/what-happens-if-gps-fails/486824/?single_page=true <comment><USER2> Too much reliance on GPS.. this is not smart high-tech...</comment>


Why Las Vegas has coped well with drought so far - <AUTHOR> http://www.economist.com/news/united-states/21660546-why-las-vegas-has-coped-well-drought-so-far-concrete-oasis <comment><USER2> As a current resident of Las Vegas, it is interesting to see articles like this written. We recycle 94% of the water that makes it to a drain[1]. In addition, recycled water accounts for 40% of our overall water usage[2].

However, I just broke a 3 year lease after 2 years because of both an in ground pool and very green lawn. Both contributing to a $300+/month water bill 5 months a year. The landlord could not get the HOA to approve landscape changes and the pool evaporated a thousand gallons a month. It is great there are laws for new houses, but there is still a challenge to change for homes built 20 years ago. Add in the electric bill for non-stop air conditioning in the summer months ...

No income tax in Nevada only goes so far. It will be interesting to see how much longer we can sustain our growing 2 million person population[3].

[1] [http://www.snwa.com/ws/reclaimed.html](http://www.snwa.com/ws/reclaimed.html) [2] [http://voices.nationalgeographic.com/2012/02/10/even-your- ev...](http://voices.nationalgeographic.com/2012/02/10/even-your-evian-was- pee-at-some-point/) [3] [https://en.wikipedia.org/wiki/Las_Vegas](https://en.wikipedia.org/wiki/Las_Vegas)

<comment><USER3> How common are roof-top solar panels over there? Seems to me like you'd have the optimal climate for solar (in germany you see solar panels on the roofs of detached houses all the time).

<comment><USER4> The problem is that when you're renting, your landlord has zero incentive to install panels on the house. You're the one paying the electric bill, after all.

If you own, however, you'd be crazy to have a south-or-west-facing roof in Las Vegas and not throw some panels on there.

</comment></comment></comment><comment><USER5> I'm surprised the article doesn't mention the elephant in the room: Vegas has almost no agriculture.

<comment><USER6> Well maybe it's a choice. In California water should be more expensive to discourage people/industries from using it (depending on population desnity, it could be better to import). But the agriculture lobby ensures their consumption of water is protected. Maybe if there isn't enough water i California, then intensive agriculture was a bad idea in the first place?

<comment><USER7> It's just that the rest of the country needs to pay market rates for the California water they're consuming via agriculture. It's the whole country's problem.

<comment><USER8> Your message seems to imply that its consumers fault for paying to little for food from California; that's a silly way to think about this problem.

California allows the disruption of true prices of water. If water is scarce, it should be more expensive.

If the water at true market value is so expensive that prices of goods produced with that water are now no longer competitive on the market, then that means that agriculture is not sustainable nor feasible in California and will be correctly priced out of the market by those who are able to produce the same quality product for less.

<comment><USER7> It implies nothing of the sort, just points out that many parties critical of California's handling of the drought are also enjoying the benefits of that mishandling.

</comment></comment></comment></comment></comment><comment><USER9> This is what good government does, creates a framework that forces the right behaviour through artificial controls to preempt the problem.

I hope we get to limiting co2 emissions soon.

I hope we get a gradual tax on gas and push that back into infrastructure.

<comment><USER10> Honestly, in times like these, it's so good to see someone talk about what government is good at. All we hear is the opposite, especially with things like TPP coming towards us. It's as if we've forgotten what government does. Yours are great examples.

<comment><USER11> Is it really the government doing something though, or failing to do something (control water prices)? What would go wrong with a free water market? Sure some types of user that are currently subsidised wouldn't be able to survive but they probably should be in a more water rich location for overall greater efficiency.

<comment><USER12> You're essentially saying that people won't be able to survive and that's the reason Free Market Water is a bad idea.

People will pay a premium to keep their lawns green and if you can't afford to hydrate or bathe, tough.

People will die so people like this can continue living like they aren't in a desert: [http://www.chicagotribune.com/news/sns-wp-washpost-bc- calif-...](http://www.chicagotribune.com/news/sns-wp-washpost-bc-calif- water13-20150613-story.html#page=1)

\--

This was an autokilled post by another poster, if you have showdead on you might see it.

<comment><USER11> Poor choice of word "survive" there. I meant economically survive in high- priced-water areas such as what California might be if it had a free water market. I agree with you that people a willing and should pay more for luxuries like lawns in the desert.

For drinking, you won't be living there in the first place if you can't afford the water bill, so nobody's going to die of thirst. That, and drinking water is a negligible proportion of water that people use domestically overall.

<comment><USER12> > For drinking, you won't be living there in the first place if you can't > afford the water bill, so nobody's going to die of thirst.

That's the problem. Millions of people are already living in places where water is scarce / becoming scarce. This would call for a mass exodus from the desert, an infeasibility for almost all and the communities they belong to. Workers would abandon local economies and have to enter ones that most likely have no room for them.

Chances are that the people that will need to abandon their homes do not have the economic means to do so nor have the skills to enter a new market and find work.

> That, and drinking water is a negligible proportion of water that people use > domestically overall.

People need to bathe and wash their clothing / dishware as well.

> I agree with you that people a willing and should pay more for luxuries like > lawns in the desert.

Ideally, that wouldn't be an option because regulations would be set to prevent excess waste of a vital resource.

</comment></comment></comment></comment></comment></comment><comment><USER13> In 1997, I drove across the Hoover Dam on my way to McCarran Airport and was witness to water splashing over the spillways. It was a rare and unprecedented event in the history of the dam and unique in my lifetime.

The growth in Vegas at the time was mind boggling. New casinos, subdivisions, schools, hospitals, highways, freeways, it was unparalleled and nothing short of remarkable.

Today, that water level is easily 80 ft. below the top of the spillway and Vegas stridently inches its way back to its old dynamism.

Water has ALWAYS been its most important issue. Like every city, it's not perfect, but it's done a damn good job so far.

</comment><comment><USER14> In Oslo, Norway, a city with abundant supply of fresh water, the water use per citizen is about 42 gallons per day. This includes industrial use and leaks from pipes. The city wants to further reduce this to less than 35 gallons per person. These numbers are not particularly low in Europe.

243 gallons is quite a lot in comparison to these numbers.

<comment><USER15> I don't know how relevant comparing Oslo with a desert city is.

in any case, why is Oslo reducing water usage if it is abundant?

<comment><USER14> I agree, comparing is probably unfair, but still, 5-6 times higher water consumption is quite a lot and I found the numbers interesting. Actually, most poor people living in deserts around the world use a fraction of the water we use in Oslo.

Population is Oslo is increasing, and the city wants to keep the cost of treating waste water down, and one way is to reduce fresh water use.

<comment><USER16> I don't think your comparison was unfair. It's impressive that LV has managed to manage\recycle their water as much as they have but to me it is _shocking_ that they still somehow consume 5-6 times as much per capita as Oslo (and, according to some basic searching, much of the EU). Not wanting to turn this into the usual EU\US back-and-forth, but ... man how is it possible to use that much water?

<comment><USER17> If you're dividing the whole county's water consumption by the county's population to get a usage-per-capita figure, that's going to be incredibly distorted by the Las Vegas strip (hotels [luxury showers and toilets that actually flush], pools, fountains, etc) and related (golf courses). These don't contribute to the denominator, but contribute enormously to the consumption. (If golf and the hotels consume 14% together, that would increase the per-capita consumption by 16%.)

<comment><USER16> I guess it'd depend on how this is counted. If it is simply "total volume of gallons of water consumed divided by permanently resident population" then your suggestion probably explains the bulk of it. I would have hoped that it'd be measured slightly smarter however.

</comment></comment></comment></comment></comment></comment><comment><USER18> In the long term, Las Vegas is in way more trouble than California. California has several sources for its water, and even though those sources are pretty pitiful right now, there are always be the emergency fall-backs of desalination (at great cost) or forcing the farms that use up 85% of its water out of the state (at great cost to the US food supply). Vegas meanwhile gets 90% of its water comes from Lake Mead, and if that dries up, people will simply have to leave the state. If this drought turns out to be an effect of climate change instead of just being a historically bad drought, it's really not going to be long before this is the situation.

I personally think that Vegas will be attracting a whole new set of tourists at the end of this century as the world's largest ghost town.

<comment><USER19> The solution for Vegas, given the vast amount of people and money there, will be to build coastal desalination plants and pipe the water inland. It'll cost a lot, and they'll do it in the next 30 years. It might be done on a 50/50 basis with California, sharing the plants.

A lot is a relative term though, is $50 billion spread out over 30 years too much to ensure Las Vegas has water? No, it's very cost effective in fact. San Diego's big new plant has a billion dollar price tag, but provides enough water for 300,000 people. Las Vegas has 1.4 million people in its metro area. In the grand scheme of things, this is a comically trivial problem to solve.

I have a counter prediction: Las Vegas will finish the century as the same engineering dependent marvel it is today. Except it'll be even more impressive.

<comment><USER20> I think it is unlikely the citizens of California are going to be be willing to shoulder all the environmental damage required to move massive amounts of water from the Pacific Ocean to Las Vegas, even if the full financial burden is shouldered by Nevada.

<comment><USER15> What environmental damage? It's dangerous to just assume that Any Development == Environmental Catastrophe

</comment></comment></comment></comment><comment><USER21> "Las Vegas sucks up a lot of water. In 2010, the latest year for which nationally comparable figures have been released by the US Geological Survey, each resident of Clark County, which covers the entire urban area of Las Vegas and its suburbs, used 234 gallons of water every day. In California, the figure was 181 gallons. But in recent years southern Nevada has dramatically cut its water use. Between 2002 and 2014 the region's consumption of Colorado river water fell by 30%, even as Clark County added half a million residents."

This seems to confuse things, implying that Vegas is becoming more thrifty when measured from 2002 to present but the snapshot from 2010 shows strikingly high utilization. Where did they start, 300 gallons per day per person?

<comment><USER22> As it says at the beginning, people used to have real lawns and palm trees and so on, so yeah, probably per-capita figures were higher.

</comment></comment><comment><USER23> What's even more concerning to me is the water rights / treaties for the Colorado (Lake Mead) still date back to the 1920's and 1930's.

</comment><comment><USER24> Those interested in this may be interested the novel _The Water Knife_ by (Hugo and Nebula winner) Paolo Bacigalupi.

I really enjoyed it. _The Windup Girl_ was an amazing debut, and I think this is just about as good.

Reviews: [http://www.npr.org/2015/05/28/408295800/the-water-knife- cuts...](http://www.npr.org/2015/05/28/408295800/the-water-knife-cuts-deep)

[http://www.latimes.com/books/jacketcopy/la-ca-jc-paolo- bacig...](http://www.latimes.com/books/jacketcopy/la-ca-jc-paolo- bacigalupi-20150524-story.html)

</comment><comment><USER25> Strange that the drought leads to chaos in California, especially with fires. I'm far away from the US but every year I know it's summer when I hear news of Californian wild fires. It became so super normal already, that I don't even listen in on these news any more. So why is it a surprise for California, I wonder.

</comment><comment><USER26> I live on an Island in Canada population 140,000 right now it's cool 18C/64F but even we have water restrictions and have been for the last three years.

I can't even imagine a desert climate with millions of people even finding any water for all those people boggles my mind.

<comment><USER11> This is the irony of water shortages. They're not a function of how much water is available. They're a function of how much money people are willing to spend on it. Water, it turns out, is a renewable resource but it costs money to produce.

<comment><USER26> In my area on and island of about 200 miles long by 30 miles wide it's mainly farming and also the majority ~75% of the population lives in the capital city. Too much demand for too little volume and modern conveniences of coffee shops, car washes but also golf courses.

</comment></comment></comment><comment><USER27> Even with the conservation, LV is still looking at augmenting its water supply by grabbing it from others.

[http://lasvegassun.com/news/2008/jun/22/not- water/](http://lasvegassun.com/news/2008/jun/22/not-water/)

[http://www.reviewjournal.com/columns-blogs/john-l- smith/repo...](http://www.reviewjournal.com/columns-blogs/john-l-smith/report- warns-damages-pumping-aquifer-water-lv)

</comment><comment><USER28> Emphasis on the so far</comment>


New website and onboarding flow feedback - <AUTHOR> https://survicate.com/ <comment><AUTHOR> Hi Guys, We have introduced a new website, and have a user flow that does not require signing up before you have a chance to play a bit with the software. Feedback appreciated! Thx!</comment>


Fr-087: Snake Charmer PC Demo - <AUTHOR> https://demozoo.org/productions/173256/ <comment><USER2> While it has a nice atmosphere, I don't see what makes it special enough to be featured on hacker news? It looks just like a simple vertex shader to me TBH, or an I missing something blatantly obvious here?

<comment><USER3> It's a cute little demo that's only basically 1MB all in.

That said, I don't think it's the best for this group - they've done more in far less before.

[https://www.youtube.com/watch?v=wqu_IpkOYBg](https://www.youtube.com/watch?v=wqu_IpkOYBg) for example, is an executable only 177KB big.

</comment></comment><comment><USER4> Pouet.net is the more popular information repository for demos. Here's their link for the same demo:

[http://www.pouet.net/prod.php?which=70418](http://www.pouet.net/prod.php?which=70418)

</comment><comment><USER5> Summary of the pouet.net comments: Proof of concept DX12 engine by chaos. One effect, no post processing. Still pretty cool though.

</comment><comment><USER6> Farbrausch has made some of the coolest demos I've ever seen.

<comment><USER7> They have (fr08 completely blew my mind when I ran it at the time), but this isn't one of them.

Far cooler from the same competition alone is fr-minus-019 (a 64k intro) [https://demozoo.org/productions/173267/](https://demozoo.org/productions/173267/)

</comment></comment><comment><USER8> Not following the demo scene, and not being current on the capabilities of graphics cards these days, I have no idea if this is impressive. Wish it came with some explanation.

</comment><comment><USER9> Still remember seeing fr-08 live at The Party here in Denmark 17 years ago. It has to be one of the most impressive things ive seen and it was what got me into demos.</comment>


Falsehoods Programmers Believe - <AUTHOR> https://spaceninja.com/2015/12/07/falsehoods-programmers-believe/ <comment><USER2> These lists are great for getting us to consider our assumptions, bit I wish more of them had links to read up about the domain a bit more. For example, I know a reason that there may not be 86400 seconds in a non-DST day -- leap second implementations may not smooth that second out over a longer period, but instead add a literal extra second. But I want to read about that to make sure my knowledge is complete, and I'd like to read about the ones that I may not believe or agree with.</comment>


Cicada 3301 - <AUTHOR> https://en.wikipedia.org/wiki/Cicada_3301 <comment><USER2> [http://sevens.exposed/](http://sevens.exposed/) [http://www.1711141131131.xyz](http://www.1711141131131.xyz)

^^ Possible 2018 puzzle ... though some claim that they're not legit because no PGP signatures have been found. Z 3301 has claimed to be a 2012 winner ... and now running the puzzles. (based on emails claimed to be sent in 2017 - [http://www.defango.com/wp- content/uploads/2017/05/CICADA2017...](http://www.defango.com/wp- content/uploads/2017/05/CICADA2017.pdf))

The most recent thing I've seen get dropped is a video on youtube a couple of days ago ...

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

There's several groups still working on solving the Liber Primus from 2014 ...

<comment><USER3> If there are no GPG signatures then it isn't legit. Thats pretty much rule number 1 of 3301

</comment></comment><comment><USER4> I worked on x11-b-1381 until there appeared to be an encoding error in a variation of the enigma cipher they used that made it unsolvable. The author insists it wasn't a problem, but I think that one really derailed the puzzle.

It was very immersive, but the author giving interviews broke the spell.

There was another aspect of it that isn't talked about much, which was that the x11-b puzzle author seemed to launch several hundred Tor exit nodes (named for the puzzle) out of holland if I remember correctly. I didn't have my gear or the time to start trying to find and extract injected malware from the nodes or do diffs against the videos from the internet vs. those exit nodes, but since that was a next level play, I couldn't take the time to run down that rabbit hole.

</comment><comment><USER5> Good overview video [https://www.youtube.com/watch?v=I2O7blSSzpI](https://www.youtube.com/watch?v=I2O7blSSzpI)

</comment><comment><USER6> Some previous discussions: [https://hn.algolia.com/?query=Cicada%203301%20points%3E10&so...](https://hn.algolia.com/?query=Cicada%203301%20points%3E10&sort=byDate&dateRange=all&type=story&storyText=false&prefix=false&page=0)

</comment><comment><USER7> to this day I'm still curious as to what the people behind 3301 were aiming to achieve. They claimed they were building crypto tools for a freer internet (in typical cypherpunk fashion) and that the puzzles were a way to recruit skilled and like-minded individuals. But what _have_ they built/done, if anything? Especially given the effort that went into creating the puzzles.

<comment><USER2> It seems like they are working on stuff. But it is unclear how large or what the structure of the organization is. What they actually get up to continues to be a mystery.

It seems they did have a finalist do some work on something called CAKES (Cicada Anonymous Key Escrow System)...

[https://www.rollingstone.com/culture/culture-news/cicada- sol...](https://www.rollingstone.com/culture/culture-news/cicada-solving-the- webs-deepest-mystery-84394/)

It sounds like they rolled up his brood through and the project never came to fruition. Which is too bad, because it sounds really cool.

Whatever the case, the do have an air of secrecy around them. But yeah from what I can tell they're looking for talented individuals to work on crypto & privacy projects, which is awesome. Kind of reminds me of the old Telecomix folks.

A site came up a while back cicada3301.org, and then was either debunked as not legit or something happened, and was promptly taken down... it is... still however online ... though the DNS no longer points to the server.

I found this by doing a shodan search for Cicada 3301...

[http://22.214.171.124/](http://22.214.171.124/)

(I've got a local copy backed up already in case the author of the site takes it down. But it's an interesting read.)

<comment><USER7> yeah I read that site a while back. The ideas espoused there seem to line up at least roughly with the philosophy 3301 spoke about, and it's theoretically interesting, though it seems to have a generous dose of speculation and esotericism thrown in too - not that that's uncommon when it comes to 3301 theories.

I read about CAKES and the brood system, but it seems like the 1 or 2 years they managed to get people together (that are publicly known about), they sacked off the brood fairly quickly.</comment></comment></comment>


The Pentagon's new China war plan - <AUTHOR> http://www.salon.com/news/china/index.html?story=/news/feature/2011/08/13/sino_us_stephen_glain

<comment><USER2> Am I the only one who finds this article to be somewhat inchoate? It starts out by talking about the Pentagon's refocusing on the Pacific rim and why such a refocusing is necessary. It says that Beijing identifies the US as a threat, rather than a partner. Right after that, however, the article contradicts itself. It says that Beijing is _not_ a threat; Beijing's pronouncements regarding the South China Sea have been misinterpreted and in reality they mean us no harm.

So which is it? Is Beijing a real threat to the freedom of the seas in the South China Sea? Or is Washington overreacting to innocuous statements? The author _seems_ to indicate the latter, but the conclusion isn't nearly as explicit as it should be.</comment>


Ron Rivest on why MD6 was withdrawn from the SHA-3 contest at NIST - <AUTHOR> http://groups.csail.mit.edu/cis/md6/OFFICIAL_COMMENT_MD6_2009-07-01.txt <comment><USER2> It seems to be a very classy withdrawal. I wonder how much the other candidates satisfy the two 'suggestions'.

<comment><USER3> You echo Bruce Schneier's sentiments.

<http://www.schneier.com/blog/archives/2009/07/md6.html>

</comment></comment><comment><USER4> In case anybody is interested, the md6 reference implementation is here: [http://groups.csail.mit.edu/cis/md6/code/md6_c_code-2009-04-...](http://groups.csail.mit.edu/cis/md6/code/md6_c_code-2009-04-15.zip) , this was the one submitted to NIST and has now apparently been withdrawn.

</comment><comment><USER5> Note that this is not identical to withdrawing MD6 from the "SHA-3 contest" -- they are just not entering the next round of the contest, because they haven't figured out how to prove the resistance of MD6 to differential attacks while making it as efficient as NIST require.

<http://groups.csail.mit.edu/cis/md6/>

</comment><comment><USER6> Why not submit it on a provisional basis? i.e. full rounds, and let it be slow.

Would NIST reject it outright?</comment>


PHP Fog to be discontinued on December 21st - <AUTHOR> http://docs.appfog.com/migration <comment><USER2> This sucks.

But actually, I'm glad to hear it. Over the past 2 weeks (since we upgraded matchist to a PHP Fog dedicated server), their support team has basically dropped off the face of the earth.

Their support live chat disappeared. Their phone number goes to voicemail. And there's no way to get a hold of them other than their ticketing system (which they respond to every few days if you're lucky).

I loved PHP Fog when I first heard of it and started using it 6 months ago. But honestly, I'm not sure we're going to switch to AppFog since it's the same team. Not sure I want that level (lack) of service.

<comment><USER3> I'm very sorry to hear about your experience with our support team over the past few weeks. While there have been some changes to live chat we are still available via phone during business hours depending on volume and are highly responsive with tickets (hours turnaround if not quicker on average).

Was there a particular ticket I can review for you to see what happened? I want to make sure we don't drop the ball here.

<comment><USER4> What are business hours when you are a developer platform used by developers globally?

</comment></comment></comment><comment><AUTHOR> Just got the email:

Dear Fogger,

It is with a heavy heart that I let you know that the PHP Fog service will be discontinued in December in favor of AppFog, which is PHP Fog 2.0. I am incredibly sorry for any inconvenience this may cause you.

Creating PHP Fog has been an amazing experience for us and it could not have happened without you––thank you for your support. With your help, we've built an amazing PaaS for PHP developers. And along the way, we've applied what we've learned to creating our new product, AppFog.

AppFog is the future of our business, and we very strongly believe it is also the future of PaaS. So, in order to focus our team and efforts on continuing to build a better solution for developers, we will be shutting down the PHP Fog platform this coming January and focusing solely on AppFog.

We have considered this change very, very carefully because we understand that this could present challenges for some of our users. But in the end, we are confident that moving to AppFog will give you additional flexibility, additional languages, additional infrastructures, and the ability to deploy your apps to private cloud infrastructure as well as leverage the strengths of the OpenStack and Cloud Foundry ecosystems.

To help in the migration, we will do be doing everything we can to help this be as easy and painless as possible: 2GB of RAM in our Free Plan We will be releasing a series of blog posts that walk you through the migration to AppFog. We will also be publishing documentation of the migration path as well as solutions for some of the edge-case differences between the platforms. To start with, we have created a migration FAQ that should help you begin the migration process.

I am committed to making AppFog a product that will make you look back at PHP Fog and think, "I'm really happy I switched."

<comment><USER5> Same here.

PHP Fog had its share of problems, but AppFog doesn't support Git.

<comment><USER6> Purely informative but it seems you can add commit hooks to your version control to connect to theirs: <http://blog.appfog.com/553/>

Seems pretty stupid to drop support of git in favor of their own product.

<comment><USER5> I only used them for development but at least I never had to worry about the application server and the git workflow worked perfectly. Didn't use their shared database, which didn't support stored procedures etc, but it was easy to connect RDS. They came out with their own "dedicated DB" product but it was just RDS with a 100% markup and no other advantage. Not that I blame them for trying to monetize since it sounds like it they weren't making money off the basic stuff.

</comment></comment></comment></comment><comment><USER7> I had the worst experience with appfog/phpfog. They ignore emails and state things on their hp that are clearly not true (like they would support .NET which they are not).

Should have been warned whem some time ago a 15year old hacked their system and controlled all their servers.

</comment><comment><USER8> As a current customer since 7/11 (over a year) I am SHOCKED they aren't working on automating a process to migrate over to AppFog. I guess they don't want my business - off to heroku and/or ec2.

<comment><USER9> John,

I am so sorry for the inconvenience, we are working on some tools to make the process easier, but for now here is a tutorial:

[http://blog.phpfog.com/2012/11/12/migrating-your-php-apps- fr...](http://blog.phpfog.com/2012/11/12/migrating-your-php-apps-from-php-fog- to-appfog/)

<comment><USER10> That doesn't really seem to be about migrating, but about setting up an arbitrary php app with AppFog. Here's a few things that are wrong with it:

* It assumes you have the directory locally. Can't it be downloaded from phpfog?

* It doesn't say anything about copying environment variables.

* It doesn't talk about making sure you have at least as much system resources. It should say how to find how much memory you had with phpfog to make sure you have enough with appfog.

* It doesn't cover data migration.

* Even without covering data migration, it could at least have covered migrating the database configuration, but it doesn't.

* It leaves with an appfog domain name. It should say how to switch them.

* Too much of the post is devoted to going through AppFog's features.

* It has some cheesy marketing for AppFog like "af-plus-php-equals-win" and "Lots more functionality where that came from".

I don't think I could bring myself to call it a migration tutorial.

<comment><USER11> Please note: this is the first in a series of tutorials. This tutorial in particular is devoted solely to migrating application code. Tomorrow, we will post the first of two data migration tutorials that will walk users through the data migration process.

<comment><USER10> I know, I know. It's all that was available at the time this was announced, a little over a month before free accounts are scheduled to be shut down. Some people are probably already migrating.

Is it true that appfog's filesystem is volatile? Does this mean that it could be wiped without a system fault or a user shutting down the system? If so, there doesn't seem to be a clear migration path to appfog for PHP users that are using the writable directory support. If not, it should probably be documented that writes will only go to the one instance and that if you're using multiple app server instances you need to set something up.

</comment></comment></comment></comment></comment><comment><USER12> A bit of a positive note here, I found that PHP Fog was more difficult to use than AppFog. I had some higher-level issues with Apache on the PHP version of AppFog that I brought up and were quickly addressed.

It might sting now, but those that used PHPFog might like AppFog more.

<comment><USER11> You're right. I think people need to give AppFog a chance.

Once they do something like, for example, cloning an app in Singapore and re- deploying it in Ireland in less than a minute, they'll see the value in what we've built.

</comment></comment><comment><USER13> Well done, a lot of people are going to be unhappy about this. I think it takes courage to take the pain upfront and concentrate on doing one thing really well.

</comment><comment><USER14> Which has a pretty low limit on the database (100mb), no dedicated database, no persistent file system (there goes a large portion of PHP downloadable software), no monitoring and you have to retool the way your database works, using json, in a way that no other hosting service does.

</comment><comment><USER5> Personally I will give AppFog a try. If you're the sort of person who liked PHP Fog, the alternatives are not THAT great. Here's a good roundup from last month:

But regarding the business transition over at App Fog, you know what's really strange: Why does the 'dead simple' migration process start with creating a new account? Isn't it the same company? At the very least, if I were in charge of AppFog I wouldn't make everyone sign up again. Just saying.

 __ __ __ __ __ __ __ __ __ __ __ __ __ __Signing up for AppFog

First things first: score yourself a free AppFog account at console.appfog.com. It's the same thing we've all done a million times: e-mail, password, and then e-mail verification.

<comment><USER5> Oop, here is the link about PHP PAAS [http://philsturgeon.co.uk/blog/2012/10/cloud-hosting-php- pip...](http://philsturgeon.co.uk/blog/2012/10/cloud-hosting-php-pipe-dream)

</comment></comment><comment><USER2> Other than dotCloud, what are some other PHP as a platform competitors?

<comment><USER9> AppFog is PHP Fog 2.0, it does PHP and has way more functionality

<comment><USER2> AppFog is also run by the same team as PHP Fog, which in my experience in the past few weeks, cares very little about customer support. I'd like to see what else is out there.

</comment></comment></comment><comment><USER15> I think the solution is to find another service. How can I trust appfog after this terrible surprise? Tomorrow I will receive an email. We are very sorry but appfog will be dicontinued.

<comment><USER11> AppFog is absolutely NOT being discontinued! We are incredibly proud of what we accomplished with PHP Fog, but we think that the AppFog is the true future of PaaS: polyglot and poly-infrastructure. We simply don't think that single- language PaaS on a single infrastructure is the future, and we're working on rolling all of the functionality from PHP Fog into AppFog, where you'll be able to deploy Node, Java, Python, Ruby, and other runtimes and deploy to a variety of infras.

AppFog is absolutely thriving right now and will be around for quite some time, we assure you.

<comment><USER16> Sure it is. And I'll bet if you look through your archives you'll find that you made the same assurances about PHPFOG...

</comment></comment></comment><comment><USER17> I feel sorry for all the small businesses relying on PHP Fog who maybe don't have an in-house IT team and will really struggle to meet this very short deadline. I'm talking about the kind of business, who may have hired someone to build a small app for them on PHP Fog, and to do anything with IT they have to hire an outside IT consultant by the hour.

I would encourage App Fog to offer a "fully managed" migration option, even if it's for a token fee.

</comment><comment><USER3> Just to clarify, all free tier services are being shut down in late December and paid (dedicated) services in late January.

<comment><USER2> What kind of migration support are you providing if we decide to switch to AppFog? Your support quality and service level has dropped off a cliff in the past 2-3 weeks, in my experience.

</comment></comment><comment><USER18> You could always migrate to <https://pagodabox.com/>

</comment><comment><USER19> Argh.

PHPFog was my goto place for self-hosting Wordpress blogs, is AppFog as simple?

<comment><USER9> AppFog is just as simple and way more powerful too.

<comment><USER20> But will WP work without a persistent file system? Doesn't that mean you can't upload pictures to your posts?

<comment><USER11> AppFog does not currently support persistent file systems, but we're working hard on adding this feature. In the meantime, we strongly recommend Amazon S3 as a persistent file store.</comment></comment></comment></comment>


Staring at the Camera for $15, 037 - <AUTHOR> http://www.kickstarter.com/projects/notfound/staring-at-the-camera

<comment><USER2> Wat.

<comment><USER3> I thought this was just another stupid comment but now that I've actually read through that page I feel like you've summed up my thoughts perfectly.

<comment><USER2> Initially my comment was longer, but I quickly realized that it was all redundant.</comment></comment></comment>


A Candle Loses Nothing by Lighting Another Candle - <AUTHOR> http://stephaniehurlburt.com/blog/2017/8/4/a-candle-loses-nothing-by-lighting-another-candle <comment><USER2> I liked the analogy, though I'll confess I clicked the link expecting to see a layman explanation of some interesting physics trivia.

<comment><USER3> Ditto. I googled around and the gist of candle physics is this: -wick is lit and then heat travels downward to the candle -immediately begins melting the wax, which are hydrocarbons that fuel the fire. it's a simple combustion reaction as they mix with oxygen in the high heat -capillary action sends melted hydrocarbons up the wick, continuing the reaction

No mention of energy loss when lighting another candle... but really heat is the byproduct of the combustion reaction, so lighting another candle is harnessing the byproduct and doesn't interfering the reaction. The expression is valid! :-P

[http://www.explainthatstuff.com/candles.html](http://www.explainthatstuff.com/candles.html)

[http://candles.org/candle-science/](http://candles.org/candle-science/)

</comment></comment><comment><USER4> I have a little brother and a brother in law who each went from bad financial situations to making a lot of money in a relatively short time. By a lot I mean much more than I make, and I do pretty well. I found it strange that I was both happy for them and resentful at the same time. We got along well before and after their success and I never felt like they became arrogant or condescending. I think my resentment came from having to face up to my own mistakes and weaknesses. Maybe there were reasons they were more successful than I was; that it wasn't just luck. Thankfully the resentment has long since faded.

The experience also made me think what would happen if you were at a party with a large group of friends. God appears and gives everyone with a birthday on an odd numbered day a million dollars then leaves with no explanation. How happy for their friends are the people who didn't get anything? They are no worse off but I can't help thinking they would be happy.

<comment><USER5> Strictly from a selfish perspective, it's in your best interest to have rich friends and family, rather than poor friends and family... even if your own personal economic status is the same in both circumstances.

<comment><USER6> Unfortunately, you'll lose most of the newly rich friends

<comment><USER5> I don't buy that. What makes you think so?

</comment></comment></comment></comment><comment><USER7> I hate to admit it, but I fall into the resentment camp. I don't belittle others, but I do envy their success. I know this attitude is counterproductive, but that doesn't motivate me to change. I suppose this is one of the many reasons the author is successful, and I am not.

<comment><USER8> Oh the resentment is perfectly natural, but it's pretty easy to overcome. It's like skipping the third beer or not buying the chocolate bar when you walk past it.

<comment><USER9> One of the best ways to heal this aspect of yourself is to actually expand the feelings of resentment in a safe therapeutic setting (possibly with a psychedelic or equivalent, i.e. Breathwork) and to get to the root of where your sense of survival was threatened by another's success.

This is quite common in the current us school system where children are routinely pitted against one another for the love of a proxy parent, aka teacher.

</comment></comment></comment><comment><USER10> > He told me that that was pretty easy, boring work, but I guess good enough > to pay the bills.

I've been told a lot in my side projects a similar thing: that the problem I solved wasn't the "valuable" one to solve, and that other people were far ahead in the "real" problem. It drives me absolutely insane. People diminish the success of others just so their project can be "superior," despite when it's actually far behind in the department that one excels at.

<comment><USER11> People generally want to be high status, and status is relative, so a way of propping your own status is to diminish the status of others. For some it's a need, like a fish with one fin trying desperately to stay afloat. I've met a handful of people like that, and I couldn't stand to hang around them very long, but a few people get along with them quite well, I suppose by buying into their version of reality.

<comment><USER9> This is often diagnosed as narcicism. Two people sharing one persons over inflated ego.

</comment></comment></comment><comment><USER12> The author rightfully acknowledges that "it is a decision that cost me some short term profits early on".

But I also know people and companies that were so nice and generous that people and customers learned to bleed them to figurative death. It's worth noting there might be some survivorship bias here.

<comment><USER13> >But I also know people and companies that were so nice and generous that people and customers learned to bleed them to figurative death.

Are there examples an average person might've heard of?

<comment><USER12> Unfortunately these tend to be woven into tales of incompetence and failure, not being too nice. That's the bias.

When you open your house to a haggard stranger (as my in-laws did) and they turn out to be fugitive that robs them (as their guest did), they were praised for their empathy but blamed for their naievity, and never made whole.

In the corporate sphere this story appears as an abrupt shutdown when customers refuse to pay for the thing they have been accustomed to getting for free. In open source it looks like a popular project being abandoned because the maintainer has to grind elsewhere to pay the bills.

You generally won't read feel-good blog posts about these. Once again, that's the bias.

<comment><USER13> Thanks for the genuine response. I think I understand your point more clearly.

</comment></comment></comment></comment><comment><USER14> I've seen this in employers as well. I worked for a textile mill that was technologically stuck in the Stone age, drilled you all day long for nearly minimum wage. Then I got a break and they made me a line lead, a reward for being such a good worker. But they found a way to take that position away when they found out I was using the extra money to pay for college courses and attend conferences. Needless to say, I quit, and I found a job at a technology-oriented company. They supported it from day one, and I'd be happy to stay with them and apply for more effective jobs.

</comment><comment><USER15> One should never make another person feel bad for any self-admitted lack of mathematical knowledge, ever.

I know a bit of math myself, and sometimes I do ask such questions as "have you heard of 'math concept X' or ' physics concept Y'?", however, my reaction to someone saying "I don't know what that is," is never a negative one. If anything, it's the opposite of the one described in the article: I am filled with excitement.

(In particular if I know that the other person would benefit from knowing 'math concept X.')

I love it whenever I get the chance to test myself and see if I can share/explain something properly. If I can make it interesting. I am testing to see if I understand it myself (kinda like using the Feynman Method in a conversation?)

If I leave that conversation without the person having "won/learned" more than me through the exchange, that's a failure on me, not them.

</comment><comment><USER16> The only part of this essay I didn't like was the bit about how good people:

"Ask me how they can help me. Give without expecting to receive if they're in a position to do so."

If you're in my immediate family, or you're a close friend, I'd help you for the sake of helping. If you're a random person I'm meeting, I don't think you should feel entitled to my generosity.

</comment><comment><USER17> This was a nice metaphor, but remember!--matches must light candles first:

"Oh, hard! that to fire others, the match itself must needs be wasting!" \-- _Moby Dick_ (Chapter 37, Sunset)

If you truly believe in something--be ready to lose a lot. One of those things you may lose is freedom from the scope and bile of other's jealousy.

</comment><comment><USER18> The issue is social signals. "Resentment" is perfectly natural, and is a result of social status posturing. Party A views Party B as socially competitive and the result is discomfort, an attempt to pull B back towards the status quo or block them from succeeding, and of course, resentment.

I think the "lighting another candle" group are naturally wired more pragmatically; they're confident enough (or otherwise differently programmed) so that they don't feel socially competitive, and instead focus on growth. They focus on complementary aspects of Party B's success and act within reasonable social contexts to help propel Party B forward, understanding that if they're able to play a role in doing so, they'll likely be rewarded (be it financially, socially or otherwise).

I would posit that Silicon Valley can only exist because of a surplus of the latter category; it's the underpinning of VC as an industry, and business development as a branch of a corporation. In fact, it's downright dangerous for an investor to be socially competitive with founders - if you're expecting power law returns, you, by definition, have to invest in somebody that's likely going to end up more individually successful than you are and it's _your job_ to make sure they get there.

All that said, there's definitely grey area. I'm sure that the "pragmatic" / "candle" group can still easily succumb to envy when the party they're interfacing with _is quite literally competitive_ in a vertical they're operating in. None of us are perfect, so I think creating a delineation is a little dangerous. In-group vs. out-group thinking is only going to increase the social resentment factors (we can see it in this thread already).

</comment><comment><USER19> This was so beautiful! So glad to see it on Hacker News. I find myself in the resentment camp too often, and I'm reminded that little can be accomplished by pushing others down. We're all stronger when we form a web of support. Greater heights can be reached.

</comment><comment><USER20> What she described reminded me of the people I knew while living in Seattle.

It was no surprise to me that it's where the author lives.

It's more of the tech community attitude there.

People are afraid of being judged as not as smart so put others down as a defense. It's sad.

</comment><comment><USER21> Some people resent people that find success in modest startups. Selling useful libraries to developers won't make you a billionaire, but it can create a comfortable, steady revenue stream-- RAD game tools (in Seattle) has been doing this for a long time, selling things like video codecs and profilers and animation systems.

You could write a basic version of these tools in a few months, so it's easy for some programmers to dismiss-- but companies can do basic math, and understand that a $5,000 licensing fee is much cheaper than 3 months of developer time!

<comment><USER22> I would love to hear more about these types of companies on HN.

</comment></comment><comment><USER23> I'm not really a resentful person myself, and am generally quite happy when someone succeeds. That's pretty much why I post all those articles about underrated channels and content creators, to bring more attention to them in the hope that my opinion on the quality of their work will eventually become the prevailing one and that they'll do well from their efforts.

However, I still have to admit I feel resentment in some cases. And that's usually if:

1\. The person/creator/organisation didn't seemingly try very hard to succeed and just coasted their way through life. The people running those prank channels on YouTube and making thousands of dollars through low effort content that purely became big because of a YouTube algorithm change... those are people I might resent. Especially if they're doing better than people I consider much better artists or creators. Same goes for those creating fake news sites or what not.

2\. The person or organisation becomes selfish, throws everyone that helped them under the bus and thinks they're some big shot that the world should worship. This is surprisingly rare, with my experience being a lot of successful people do tend to be pretty nice on a personality level (in contrast to cliches about only sociopaths succeeding in life).

But for the most part, I'm happy when people succeed. Only makes sense, why not be happy for anyone who succeeds through hard work and determination? It makes you feel there's a certain amount of fairness in a world that can sometimes seem very random.

</comment><comment><USER24> I agree with the author that we should avoid feelings of resentment towards people who are successful. However it bothers me that the author classifies trace of a matrix as math trivia. I think sometimes people will categorize their current knowledge as "the important stuff", and everything else is "just trivia". This can be a dangerous trap that prevents personal improvement.

<comment><USER25> I get what you are saying, but my impression was that she wasn't dismissing unknown knowledge as intrinsically trivia, just the use of it in a certain context. When you use knowledge as a status marker, it becomes trivia -- because it isn't related to the application of such knowledge.

In the case laid out in the OP, it is a little subtle, but it's really about status games, not the knowledge itself. Otherwise he wouldn't need to make someone feel like shit for not knowing (or remembering) the term.

For example, I will readily admit I had to look it up because I don't use the term often -- I remembered learning it, and vaguely that it was related to the diagonal/determinant, but that was about it. That doesn't make it trivia, but it doesn't make me an idiot either.

So, it's not trivia if one needs to use it, but that's not how the protagonist in the essay used it. You can imagine how differently things would have gone if he kept his judgement to himself, had sharing information as the real goal, and simply explained what the trace was in the context of the conversation without the putdown. It wouldn't be trivia in that context, because it would be relevant to a useful conversation -- not a status cudgel.

</comment></comment><comment><USER26> With javascript disabled, the page is displayed fine while it's loading, then it all fades away into a blank page. It's disturbing.

<comment><USER27> Same here :) Reader mode works nicely in FireFox in this case.

</comment></comment><comment><USER28> A candle loses half of the attention when it lits another, all candles know that. Some just choose to revel in the doubling of the light.

</comment><comment><USER29> Long-term that's true ... but just like you can make a fire go out by putting too much fuel on it too early, if you try to light too large a candle, the candle might go out.

</comment><comment><USER30> Another option to avoid turning off the candle is not talking to people, or wait for them to bring up the subject. I'm awkward so I often end up doing this.

</comment><comment><USER31> _I 'm established now. I own a great company. I love my work and have happy customers and supportive people in my life. So I can see straight through the resentment for what it is..._

It's likely enough the author is observing something real in at least some cases, but it's laughable to imagine that perspective and deep insights into the minds of others (i.e., empathy) comes with success and comfort. All evidence is that the opposite is true. It's not farfetched to suppose that he sometimes reads something else (like frustration) as resentment.

<comment><USER32> Although i'm not a big fan of pronoun police, the author is definitely a "she". it's quite rude to assume otherwise.

</comment></comment><comment><USER33> Also the candle burns out long before the legend ever does. Everybody knows that's how it goes.

</comment><comment><USER27> Seems like a humblebrag.

<comment><USER34> It definitely is. It's a more thoughtfully written "haters gonna hate" status post.

That said, I do sympathize with her for the things she talks about having experienced. I'm not even successful by HN's standards, just a CS grad working their way up the tech ladder in some decent companies, but every time I've experienced any level of success along the way I've always been met with petty resentment from not just peers but some I, at times, thought of as friends. Some people are just bizarre.

</comment></comment><comment><USER35> I know this isn't related to the article, but I'm also surprised that the author had never worked with the trace given that they work in graphics, their company is called Binomial, and their product is called Basis.

</comment><comment><USER36> Well, if is someone is paying you for your light...

</comment><comment><USER8> A fundamental underpinning of open source.

</comment><comment><USER37> If you fall into the resentment camp, you are exhibiting a defensive reaction because you are in denial about your own flaws and that will be a hindrance to your success.

</comment><comment><USER38> We need DRM on Candles..

</comment><comment><USER39> actually usually when I light 2 candles you have to tip one and so it burns more to a side and then they burn extra hot for a second so you do actually lose some.

what is the sound of one hand clapping?

<comment><USER40> If you tilt the candle to be lit, rather than the candle that is doing the lighting, then the lighting candle does not have that problem.

<comment><USER39> shit I've been doing it wrong!

</comment></comment></comment><comment> tj-teej Technically it loses potential oxygen out of its possibly finite supply required to stay alight.

But I like the sentiment :)

<comment><USER41> and thus proving the point of the article.

<comment><USER42> Those who would be lit must endure burning.

</comment></comment></comment><comment><USER43> It's a tad unrealistic to expect positive interactions at all times. There is a whole social behavior called 'negging'.

But it's always a good idea to cut off negativity where you have control.</comment>


10 interesting open source software forks and why they happened - <AUTHOR> http://royal.pingdom.com/?p=391

<comment><USER2> I'll tell you what's interesting. This blog. It's from a fairly unsexy uptime monitoring company, whose services I've got little interest in. If the blog was just company updates ("we've got a new server" or "20% off all packages this week") it'd get very little traffic. But I've got it in my RSS reader and it hits the social news sites every other day with well-written and often humorous observations on tech.

Lots of people have heard of Pingdom who ordinarily wouldn't; it just goes to show how a little effort making your website something more than just a corporate website can go a long way.

<comment><USER3> Absolutely. And to ask the next question: how many people signed up (and paid) for their service because they heard about it via the blog?

<comment><USER4> At least this one. I've been trialing it and am planning to sign up at the end of the trial. The service works well.

</comment></comment></comment><comment><USER5> One interesting fork was egcs, forked from gcc in the 1990s, by people who wanted to try out the "bazaar" development model (as opposed to the "cathedral" model the FSF used, which meant very little engaging of the community.) The experiment turned out very successful and eventually the egcs version was named the one and true gcc (and the gcc we use today is a derivative of it.)

</comment><comment><USER6> Best line in the article, re: Carrier forking from Pidgin: "A fork (initially called Funpidgin) was done of Pidgin 2.4.0 because there were disagreements about the size of the text entry field."

<comment><USER7> Sometimes developers can be very childish and proud. Just make the damn thing resizable or write a plugin or something.

</comment></comment><comment><USER3> Why not link to the projects being discussed. That's a lame oversight.

</comment><comment><USER8> This article is interesting, but I think it is too shallow to get any deep understanding of causes of forking as a phenomenon. A case study on /that/ would be kick ass, and quite a treat in terms of both software engineering methodology and oss anthropology.

<comment><USER9> For example, it doesn't even mention that OpenBSD's priority is security and NetBSD's is portability, and that _that_ is the reason for the fork.

</comment></comment><comment><USER10> Pretty good choices for the list. A bit of history and details, but only very little analysis of why they forked.

<comment><USER11> Eh, made for an easy read. I'm ok with it.</comment></comment>


Customers proactively chase mint.com for UK version. - <AUTHOR> http://blog.mint.com/blog/updates/mintcom-free-online-personal-finance-web-app-now-live/#comments

<comment><AUTHOR> One way to gauge whether you're doing well: customers are chasing you for product.

Scroll down a page. Since September, the thread has been taken over by people interested in Mint submitting their details for a (completely unannounced) UK beta release, asking themselves to be added to the list if and when it happens.

</comment><comment><USER2> Mint _looks_ cool but I don't get how they have so many users. I think you'd need to be batshit insane to put a large collection of your financial details into an online third party service.

<comment><USER3> I also found that reading Mint.com's "Privacy and Security" FAQs raised more questions than it answered.

How do they "ask for your online banking user name and passwords" but not 'see' the information (as they claim)? They must be finessing the meaning of 'see'.

Who are these "online financial service providers" where my "online banking credentials are stored"? They aren't named, but the wording suggests they are someone other than either Mint itself or my own financial institutions. If these are the most important link in the chain -- the place where my credentials are stored! -- I have a right to know who they are.

<comment><USER4> Mint uses Yodlee

Here's one take on it, <http://www.brokegradstudent.com/mint-myths-debunked/></comment></comment></comment>


Layar Wants More Layers, Opens Augmented Reality Platform To Developers  - <AUTHOR> http://www.techcrunch.com/2009/07/08/layar-wants-more-layers-opens-augmented-reality-platform-to-developers/ <comment><USER2> Layar is absolutely amazing, and I think this will be one of the killer apps on the mobile platform.

The first demo I saw (a while ago) was so totally unexpected that I thought it was a mock-up of some science fiction like application on a mobile phone instead of a real live demo.

This is one company to watch closely.</comment>


Benchmarks for the Top Server-Side Swift Frameworks vs. Node.js - <AUTHOR> https://medium.com/@rymcol/benchmarks-for-the-top-server-side-swift-frameworks-vs-node-js-24460cfe0beb#.2hlh0v866 <comment><USER2> Oh hey look, a single-threaded runtime running a callback-oriented language performs poorly. how surprising.</comment>


OK: An implementation of the K5 programming language - <AUTHOR> https://github.com/JohnEarnest/ok <comment><USER2> Fun for interview questions: [https://github.com/JohnEarnest/ok/blob/gh- pages/examples/str...](https://github.com/JohnEarnest/ok/blob/gh- pages/examples/strings.k)

</comment><comment><USER3> Contrast with "An implementation of the K5 interpreter."

Or maybe others see them as one in the same?

Of course from a performance and aesthetic perspective there is a world of difference between node.js and the tiny q/k interpreter from kx systems.

On the other hand, the author's "Forth interpeter" in PostScript (Four.PS) is, at least from a reading standpoint, a thing of beauty. IMHO.

Rightly or wrongly, I think of the PostScript interpreter as Forth-like, so I might be tempted to call Four.PS an implementation of the "Forth language", i.e., a small part of it.

</comment><comment><USER4> Damit! Piped at the post with the name. (I had a working title of 'ohk' of my own k5 impl (based of rob pike's ivy) although like most things I do will probably never see the light of day.

A js implementation! This is something I can't wait to play with! Thanks!

</comment><comment><USER5> Really interesting.

This could even be implemented as a require() provider so that you could mix K and JavaScript in your Node app.

Is there somewhere to follow along with the development of K5?

<comment><USER6> Some interesting things often get posted to [http://www.reddit.com/r/apljk/](http://www.reddit.com/r/apljk/) from time to time. For example, old posts from geocar contain screenshots of the kOS desktop.

</comment></comment><comment><USER7> Hi, I really like that you use Whitney's style in your javascript! This is a good tribute to this great programmer.

</comment><comment><USER8> kuro5hin is already in Perl :)

This looks great. Going to play with this later.

</comment><comment><USER9> That is the most beautiful javascript code I have ever seen.</comment>


Unicorns vs. Horses: Why I Want to Be In-N-Out Burger, Not McDonalds - <AUTHOR> https://medium.com/@awilkinson/unicorns-vs-horses-f81d8dd61f17

<comment><USER2> Is there Hacker News like website that isn't startup focused but more lifestyle focused?

Don't get me wrong, Hacker News is great and I learned a lot of useful stuff about the startup world. But the startup world is probably a world I'll never be a part of and the lack lifestyle business advice here makes me feel I'm missing out on stuff that matter to me more.

Closest things to what I'm looking for are reddit's /r/startups and /r/entrepreneur subreddits but they're still reddit which doesn't have the kind of quality discussion that I like about HN.</comment>


Wall St flees coronavirus and glimpses its mortality - <AUTHOR> https://www.ft.com/content/28389850-ac5c-4496-aaf0-f49ccc86ae85 <comment><AUTHOR> De-paywalled: [http://archive.md/mJ1MR](http://archive.md/mJ1MR)</comment>


PyPdf: How to Write a PDF to Memory - <AUTHOR> http://www.blog.pythonlibrary.org/2013/07/16/pypdf-how-to-write-a-pdf-to-memory/ <comment><USER2> Do you also get a performance bump by writing to memory? This post was quite helpful. Thanks</comment>