News for hackers. Stuff that matters.

haroldl

You create formulas to estimate the cost of running a given query plan. Use statistics collected about the tables (e.g. how many rows) to try to be accurate. The topic is "Cost Based Optimization".
Re:Client libraries are better when they have no API on Wednesday April 10, 2024 @11:47AM (#39992028)
Person 1 adds code that uses this with Pandas. Person 2 sees the csvbase:// URIs and copy/pastes them to use with some other library Foozle that uses URIs and it works because Foozle also happens to use fsspec. Foozle migrates off of fsspec to some other filesystem wrapper. 3 years later, after persons 1 and 2 have left the company, person 3 bumps the version of Foozle the project uses and suddenly tests are failing because they can't resolve csvbase:// URIs, but the Foozle release notes say nothing about removing support for csvbase:// URIs.
Re:January 1, 2024 is Public Domain Day on Sunday December 31, 2023 @01:27PM (#38826228)
The opening of the animation has the phrase “A Mickey Mouse Sound Cartoon” on screen. IANAL but I saw on the news that this means the character’s name and old-style likeness are fair game for new content by anybody.
The most common point is that they're safe to share between threads making parallel algorithms easier to invent, understand, and implement correctly.

You can also safely re-use sub-structures without performing a deep copy. For example, if you want to keep a sub-tree around for later you can do that in O(1) time because it's safe to keep a reference to it. If it is a mutable tree you don't know what's going to happen to it so you need to do a deep copy of the entire sub-tree you're holding on to. This can save a lot on memory allocation and copying depending on your use case.

I think starting with Standard ML is a good idea. It is the core of ocaml and really highlights the differences with other approaches to programming. I went from SML to ocaml to Haskell.
Re:An Intuition for Lisp Syntax (2020) on Monday August 29, 2022 @01:03AM (#32634960)
I've been using Java since version 1.1 and I've seen features added that required a new version of the language spec to go through committee and get implemented before we got to use them where you could just add these features yourself at the top of any Lisp file and then immediately start using them. For example consider the try-with-resources [0] syntax sugar. So instead of thinking "I never actually ran into a need for them", think of new language features that you have started using: those are the kinds of things you could've added yourself.

Also look at any kind of code-gen tooling like parser generators or record specifications like Protocol Buffers as examples of what you could do within the language.

[0] https://docs.oracle.com/javase/tutorial/essential/exceptions...

Re:We are all nerds: The literary works of Neal Stephenson on Sunday August 28, 2022 @02:00PM (#32630450)
It's clear he can do it: the ending of Anathem ties up everything very neatly and it is hard for me to imagine any major events happening in the characters' lifetimes that would rival the plot arc they've been through.
Re:We are all nerds: The literary works of Neal Stephenson on Sunday August 28, 2022 @01:55PM (#32630405)
I feel that his novels are becoming more and more mainstream friendly, and Termination Shock is my suggestion. The world is very similar to our own, set in the near future (versus The Diamond Age) of our planet (versus Anathem) and is very relatable.

My other suggestions would be REAMDE for people who are into action movies or spy novels, or the first half of Seveneves for space nerds.

Re:Investors bought a quarter of US homes sold last year on Tuesday August 23, 2022 @03:49PM (#32570470)
A large enough increase in supply could cause property values to level off while also increasing the vacancy rate for rental properties. I think the idea is that those circumstances would make real estate no longer attractive as an investment.
Re:Meta is raising the price of the Quest 2 to 400 USD on Tuesday July 26, 2022 @02:38PM (#32242133)
Apple is big enough to make it happen and there are plenty of iOS game devs out there to make it a success.
In a Scrabble AI coding contest I discovered the GADDAG which is like a trie but indexes all of the words forwards and backwards from any starting point within the words.

https://en.wikipedia.org/wiki/GADDAG#:~:text=A%20GADDAG%20is....

This was really interesting both in exploring the architecture of a retail system and looking at how systems fail. Better to read about it and learn than to live it.

I'd call it a 4 hour outage because the initial "recovery" was a result of cashiers manually typing in prices for items. Then when load decreased and they discovered that scanning items worked again the problem came right back.

Maybe returning 404 for both a cache miss and a "there's no endpoint at this path" error is an issue too. For other status codes there's a distinction between temporary and permanent failure; e.g. 301 versus 302. It would've been good to use HTTP 400 Bad Request for the misconfigured URL and 404 for a cache miss.

In the 10% of stores with the early roll out of the config change the cache hit rate went to 0 right away, and that started 12 days before the outage. Alerts on cache hit rates and per-store alerts would've caught that.

Then there were 4 days where traffic to the main inventory micro-service in the data center jumped 3x which took it to what appears to be 80% of capacity. Load testing to know your capacity limits and alerts when you near that limit would've called out the danger.

Then during the outage when services slowed down due to too many requests they were taken out of rotation for failing health checks. Applying back pressure/load shedding could have kept those servers in active use so that the system could keep up.

Re:EndBASIC on Wednesday June 08, 2022 @12:24AM (#31663170)
I worked on a C project where we counted 14 different hash table implementations done for different key/value data types strewn through the code.
Re:Tips to prevent adoption of your API on Wednesday June 16, 2021 @01:34PM (#27531194)
One reason for tests to hit a real external API is if you're using a "record and replay" test framework to capture the interactions so that you can run the tests against the recorded data quickly later. But because the API calls you make change (and the external implementation changes) you need to re-record from time to time.

This strikes a balance where 99% of the time you are making calls that never leave the process for fast testing, but can validate against the real implementation as needed.

Re:2022 Ford F-150 Lightning on Friday May 21, 2021 @10:52AM (#27234774)
There is no picture of the entry level model; it says "coming soon". Since the Ford F-150 usually costs a lot to upgrade to 4 full-size doors and a navigation computer, I'm wondering if that will be the case here too. Near the bottom of the page it looks like you have to upgrade two levels to the "Lariat" configuration to get that 15.5 inch touchscreen.
Re:You need to be able to run your system on Thursday February 25, 2021 @07:12PM (#26270066)
In the spirit of the article, I think that the approach would be to ask your partners to provide a sandbox/test environment that your sandbox/test environment can interact with, or test accounts in production at least.
Re:Modeling a Wealth Tax on Tuesday August 18, 2020 @01:40PM (#24201668)
He is not modeling the threshold below which wealth is not taxed. The wealth tax being proposed in California is 0.4% on amounts over $30MM, so the lifetime percentage taken by the government on a $30MM stock cash-out via the proposed wealth tax would be 0%.

So the proposal boils down to $30MM tax free, and then 21.4% on the amount over that. But you're also likely to invest that money making, say, 7%. So your return each year on the first $30MM is 7.0% and is 6.6% on the rest after paying this tax.

Re:Crema Coffee in San Jose Closes Due to ADA Lawsuit on Monday February 03, 2020 @09:05PM (#22231648)
Sounds like other fixes were needed:

"Crema Coffee owner June Tran said bringing her 100-year-old building up to code would cost $100,000."

Re:Crema Coffee in San Jose Closes Due to ADA Lawsuit on Monday February 03, 2020 @09:01PM (#22231614)
Agreed.

"Crema Coffee owner June Tran said bringing her 100-year-old building up to code would cost $100,000."

Bringing a 100-year-old building up to code != installing a ramp.

Re:Why I Prefer Functional Programming on Thursday September 19, 2019 @02:27PM (#21019052)
Functional Programming is not just for Haskell; modern Java has lots of pretty decent options so I feel like their Java version of the code is a bit of a straw man. Here is how a more modern code style in Java 8 (which is years old now) might look. Notice that the logic for this problem is 7 lines of code, with one line being the closing brace.

https://gist.github.com/haroldl/aee6a407a01131345fc4ecb1b9c9...

I think the analogy is to suppose you insure your car with 10 different policies and then total it so you can collect 10x what it is worth.
Re:Say no to Venn diagrams when explaining SQL joins (2016) on Saturday January 12, 2019 @02:48PM (#18892918)
“A JOIN is really a cartesian product (also cross product) with a filter.” It always boils down to this for me.
Not there yet, but yes, people are thinking about this:

https://en.wikipedia.org/wiki/Lithium%E2%80%93air_battery

Re:Homegrown Computer Science for Middle Schoolers on Wednesday December 12, 2012 @02:08AM (#4909040)
They might like the book "Super Scratch Programming Adventure!" It walks through building several games in a comic-book format. I thought it was good.