• 0 Posts
  • 43 Comments
Joined 2 years ago
cake
Cake day: August 3rd, 2023

help-circle
  • A system I work with gives all keys a string value of “Not_set” when the key is intended to be unset. The team decided to put this in because of a connection with a different, legacy system, whose developers (somehow) could not distinguish between a key being missing or being present but with a null value. So now every team that integrates with this system has to deal with these unset values.

    Of course, it’s up to individual developers to never forget to set a key to “Not_Set”. Also, they forgot to standardise capitalisation and such so there are all sorts of variations “NOT_SET”, “Not_set”, “NotSet”, etc. floating around the API responses. Also null is still a possible value you need to handle as well, though what it means is context dependent (usually it means someone fucked up).


  • is-number is a project by John Schlinkert. John has a background in sales and marketing before he became an open source programmer and started creating these types of single function packages. So far he has about 1400 projects. Not all of them are this small, though many are.

    He builds a lot of very basic functionality packages. Get the first n values from an array. Sort an array. Set a non-enumerable property on an object. Split a string. Get the length of the longest item in an array. Check if a path ends with some string. It goes on and on.

    If you browse through it’s not uncommon to find packages that do nothing but call another package of his. For example, is-valid-path provides a function to check if a windows path contains any invalid characters. The only thing it does is import and call another package, is-invalid-path, and inverses its output.

    He has a package called alphabet that only exports an array with all the letters of the alphabet. There’s a package that provides a list of phrases that could mean “yes.” He has a package (ansi-wrap) to wrap text in ANSI color escape codes, then he has separate packages to wrap text in every color name (ansi-red, ansi-cyan, etc).

    To me, 1400 projects is just an insane number, and it’s only possible because they are all so trivial. To me, it very much looks like the work of someone who cares a lot about pumping up his numbers and looking impressive. However the JavaScript world also extolled the virtues of these types of micro packages at some point so what do I know.


  • It really is as simple as blending rolled oats and water in a 1:4-ish ratio for 30 seconds or so, and straining the result twice. Adding sugar is optional. It stores pretty well in the fridge, maybe up to 5 days. Trust your nose!

    Personally I don’t make it very often, as my main use for milk is in cappuccino, and plain oat milk doesn’t steam very well. The barista editions you can buy have some added extras (fat, sugar, proteins, stabilisers) to improve the characteristics for steaming.

    I totally understand the convenience factor of store-bought too. If you don’t have a blender on standby it’s a bit of a hassle. And the store bought stuff is shelf-stable for weeks when sealed.


  • There’s a couple reasons behind this:

    • Economies of scale. Oatmilk is not nearly as big of a market and therefore tends to be more expensive per gallon
    • Dairy subsidies. Dairy farmers can be pretty heavily subsidized, depending on the country, making the milk artificially cheap
    • Marketing. Oatmilk is mostly consumed by upper middle class (sub)urban folks who have enough disposable income to worry about things like animal welfare and the environment, and thus are willing to pay a premium for eco-friendly products. Companies know this so a lot of oatmilk is positioned and priced as a premium product.

    In a way it’s sort of disgusting that capitalism is exploiting your desire to save the planet for extra profits, however that’s how it is generally designed to operate: nothing happens unless there is a profit to be made from it.







  • I think for these types of discussions it’s really necessary to clearly define what “low level” really means, something both you and the author kinda skip over. I think a reasonable definition is about the amount of layers of abstraction between the language’s model of the machine and the actual hardware.

    The author is correct that nowadays, on lots of hardware, there are considerably more abstractions in place and the C abstract machine does not accurately represent high performance modern consumer processors. So the language is not as low level as it was before. At the same time, many languages exist that are still way higher level than C is.

    I’d say C is still in the same place on the abstraction ladder it’s always been, but the floor is deeper nowadays (and the top probably higher as well).




  • Before they went public, who was foolish enough to invest in a company that has never turned a profit?

    You’d be surprised. The basic strategy of losing money hand over fist for years to grow yourself to as large a user base as possible, before finally aggressively monetizing that user base, is well established in silicon valley. Investors would not even raise an eyebrow at the loss numbers posted by Reddit because of how exceedingly common that is.

    And it has worked several times, making some people ridiculously wealthy. Good examples are Amazon, Facebook, and Uber. So usually companies on this level have raised hundreds of millions to sometimes billions of dollars in investment capital, allowing them to operate at these levels of losses for years at a time.


  • Because you’re exchanging stock worth $193 million for an equivalent amount of dollars, there’s technically no profit or loss involved in the transaction. In the same manner, when paying stock as a compensation, you secure services valued at $193 million for an amount of shares worth the same: the transaction is entirely equal. So you don’t make or lose any money by paying in stock.

    Of course, the trick is that the value of the CEO’s work for one year can be whatever he says. If your claim is that they could have gotten more value out of the stock had they sold it in the IPO, I think you are absolutely correct in that regard.




  • There’s not really any definite border. FAA controlled airspace generally ends at flight level 600 (around 60,000 feet, although flight levels are defined by air pressure not distance from the ground, so the actual altitude can vary). Above that will be uncontrolled airspace, though that doesn’t necessarily mean the US won’t claim sovereignty there.

    The Outer Space treaty, generally considered the first step in establishing space law, stipulates that “outer space” is for the benefit of all mankind and not subject to sovereignty claims by any country. However there isn’t a legal definition of where outer space begins. The Karman line (100km) is a common practical definition. However the US has flown spacecraft (notably the shuttle) below 80km above Canada, without asking for permission first.

    Practically speaking, there are as yet not enough craft flying at these kinds of altitudes for real legislation to be necessary. The spacefaring countries mostly work it out between them on a case by case basis.



  • I don’t get this article, it’s clearly got a bone to pick with self-checkout and seems to be contradicting itself in the process:

    Consumers want this technology to work, and welcomed it with open arms. […] In a 2021 survey of 1,000 American shoppers, 60% of consumers said they prefer to use self-checkout over a staffed checkout aisle when given the choice

    Okay, so even given the myriad of poor implementations out there, a majority of people prefer it. But then at the end:

    Simply, “customers hate it”.

    Oh really? Because your quoted survey seems to say the opposite. And then there’s stuff like this:

    In addition to shrink concerns, experts say another failure of self-checkout technology is that, in many cases, it simply doesn’t lead to the cost savings businesses hoped for. Just as Dollar General appears poised to add more employees to its check-out areas, presumably increasing staffing costs, other companies have done the same.

    This is too light on data. Even a luxurious 1 cashier per 2 self-checkout stations will result in large cost savings for a business where employee costs are a significant fraction of total expenses. Especially in low margin businesses like grocery stores, removing even small amounts of overhead makes a big difference. Just because stores are adding a few employees back, doesn’t mean cost-savings are completely negated.

    Despite self-checkout kiosks becoming ubiquitous throughout the past decade or so, the US still has more than 3.3 million cashiers working around the nation, according to data from the US Bureau of Labor Statistics.

    Surprise, a large nation did not completely get rid of cashiers! The number is meaningless without more context: did the number of cashiers go down? What about average cashiers per store? Where is the data?

    My point is, maybe companies just went too hard on the cost-cutting and are trying to find the right balance. What is the best ratio of self-checkout to classic cashier checkout? What is the right amount of self-checkout assistants? How do we make checking out yourself a good user experience? All of these things are still being experimented with. What does seem to be clear is that self-checkout has become near ubiquitous, and therefore it is most certainly not a “spectacular failure” by any definition.