HNHacker News
TopNewBestAskShowJobs

mdnahas

267 karma · joined April 7, 2020

Masters in CS and Econ Designer of par2 file format Employee #7 in successful fintech startup Quantitative trader

https://michaeldnahas.com

submissionscomments
mdnahas··on The Rate of Return on Everything, 1870–2015 (2019)
Politicians in democracies favor property owners because they are a majority, reliable voters and are likely to stay in the district. Therefore, the tax and political policies encourage owning a house. Many families take inordinate risks to own a house when, with fairer rules, they would rent.
mdnahas··on The GJK Algorithm: A weird and beautiful way to do a simple thing
Computational Geometry has a technique for avoiding all of the complex cases where point are colinear, coplanar, cocircular, etc.. I’ve forgotten the techniques’ name, but coordinates are integers plus an epsilon term. As the epsilon goes to zero, you get the original statement of the problem.

The epsilon terms are used for breaking ties. If you are deciding if a point is to the right or left of a line, you can use the factors on epsilon terms to decide. If the limit of the point for epsilon close to but greater than 0 is right or left, you use that answer.

You can use multiple epsilon terms, one for each dimension and claim that the x-dimension approaches zero faster than the y or z-dimension, etc. It makes it all work as integer linear algebra with simple greater than or less than on scalar result.

mdnahas··on Understanding the neuroscience behind burnout (2022)
Having burned out hard, my explanation is hope. Hope is like a zero calorie meal. It will keep you going and focused, but eventually you’ll collapse.

We can learn to push through hard times, but not forever. You need connection, exercise, good food, and nature.

After burning out, I relaxed for a while. Then, I focused on things that were under my control and didn’t depend on others. Exercise, losing weight, etc.

mdnahas··on Ask HN: What would you spend your time working on if you didn't need money?
I don’t have enough to retire on, but spent my last decade working on what I wanted. I worked on Formal Proof, until I realized the problem wasn’t the tech but the math-proof business model. (Academic mathematicians aren’t incentivized to write formal proofs.). I got an Econ degree. I’ve studied housing in Austin and advocated to loosen restrictive regulation that causes high rents. And I designed version 3 of Parchive. (You may know the previous version by its file extension “.par2”)
mdnahas··on I organized a 20-acre game of Capture the Flag
Did similar in NYC in Central Park. Organizers were lawyers, so rules took 3 hours to sus out, but the game took less than 2.

The other team brought walkee-talkies! My team won. A devious member waited and then changed clothes into a bright floral full-length dress with a large floppy hat. Disguised as a random park user, she strolled in, grabbed the flag, and strolled out undetected!

Highly recommend.

mdnahas··on 23% of bachelor's degrees and 43% of master's degrees have a negative ROI
As an economist, I totally agree. Funding of high-return majors by good students should have rock-bottom interest rates.

The govt should only be stepping into the loan market if the market isn’t happening. (Not that the market is doing loans wonderfully, but there are some new innovators.)

The govt should be helping the poor and investing in strategic capabilities. But the whole loan market and helping school rob parents of as much as they can pay? No.

mdnahas··on Social engineering takeovers of open source projects
I think we need to philosophize. Is some software “infrastructure” and some even “critical infrastructure”? Or maybe they should be new classes of public goods? There are huge risks that society needs to address and I don’t think the non-profit (open source) market is providing it. And maybe not even the for-profit market.

I don’t think open-source project leaders have the resources to fight this risk on their own. We should discuss if there is a role for government, just the way government pays for security (police) and protects critical infrastructure.

mdnahas··on Structuralism as a Philosophy of Mathematics
There are other foundations for mathematics. Dependent Type Theory has a lot of support from people studying Proof Theory. It is based on typed lambda calculus. It is currently being researched and implemented in mathematical provers, like Coq and Lean.
mdnahas··on Big Tech's underground race to buy AI training data
I’m an economist. This is an example of a volume discount. Prices often decrease per-unit when buying larger quantities. That happens whether it’s milk or the square-footage of an apartment. I’d expect larger files to be worth less per-byte. Photo and video files tend to be larger than text ones.
mdnahas··on Tech Debt: My Rust Library Is Now a CDO
As a former quant and now economist, I want to congratulate the author on correctly using the term Collateralized Debt Obligation! That is a great metaphor for what they’ve done.

I do want to write an article on “technical debt” at some point. “Debt” is not a great metaphor for the concept. Maybe “high viscosity code” might be better? The code cannot be changed easily to accommodate new features, so it feels like it has a high derivative. Debt is something else completely.

mdnahas··on Pocketbase: Open-source back end in one file
Today.
mdnahas··on Pocketbase: Open-source back end in one file
It is a simple program that (1) hosts a webserver, (2) runs server-side code, and (3) hosts a database. It also has built-in support for logging in and permissions to data.

Thus, if you want to write a simple website that needs permissions, storage, and server-side code, it's a great backend solution. The limitation is that it isn't high performance.

mdnahas··on Pocketbase: Open-source back end in one file
If you want a front-end for a single-page webapp, I loved Svelte. It puts all the HTML, JavaScript/TypeScript, and CSS together in the same place. The tutorial is delightful.

BUT, if you need a multi-page webapp, SvelteKit is complicated and not well documented.

mdnahas··on Pocketbase: Open-source back end in one file
I was happy with Svelte. But it only does single-page apps. But it's simple and the tutorial is delightful.

When I moved to multiple pages, I had to use SvelteKit, which is complicated and not well documented.

mdnahas··on Pocketbase: Open-source back end in one file
No. PocketBase runs on a server. It needs a host.

It is simple, so its single program is (1) a webserver, (2) runs server-side code, and (3) hosts a DB. I'm running a $12-per-month server on Vultr and its only service is PocketBase.

You don't need to host the webpages on PocketBase. If you wanted all your webpages to be on Github Pages, you could do that.

mdnahas··on Pocketbase: Open-source back end in one file
PocketBase has a pb_migrations/ directory. If you throw a file of a certain format, PocketBase will automatically loaded it and update the DB.
mdnahas··on Pocketbase: Open-source back end in one file
PocketBase is trying to be a simple webserver, code-running backend, and database. I believe the author chose SQLite because it is simple. PocketBase isn't trying to have every feature nor be high performance.
mdnahas··on Pocketbase: Open-source back end in one file
I've been developing for PocketBase for 2 months.

As someone else mentioned, API rules can control access to rows.

It can send emails. Set timers. And send its own requests to other webservers. (I haven't used any of these features.) https://pocketbase.io/docs/js-sending-emails/

I had to write my own CSV importer. (I'm hoping to open-source it.)

As for internationalization, what specific features did you want? That seems more like a front-end feature.

mdnahas··on Pocketbase: Open-source back end in one file
Yes, that's correct. In server-side code, you can write SQL queries.

JavaScript API: https://pocketbase.io/docs/js-database/ Go API: https://pocketbase.io/docs/go-database/

mdnahas··on Pocketbase: Open-source back end in one file
I've been developing on PocketBase for 2 months. The system goes into production in 1 to 2 months.

I'm exceptionally happy with it. I'm developing an webapp for a friend's company and wanted a very simple system to hand-off. The whole thing is running with one binary: Pocketbase. It runs a webserver, server-side Javascript (compiled TypeScript) code, and SQLite database. The single process is hosted on Vultr for $12 per month. My frontend is written in SvelteKit (static adapter) + Svelte + TypeScript.

Pocketbase is well done. The author has been exceptionally responsive to my questions. He is fast and clear.

I have had a few minor issues: The documentation has bare spots (but is very good for most things). I had to write my own CSV loader. (I hope to open-source it.) Writing lots of objects through the CRUD interface is slow. (It's possible to write faster using server-side code.) Unit testing for the server-side JavaScript had to be shoehorned in. And I wish Copilot/ChatGPT could answer questions better. But these issues have been minor, given all my work on the project.

It has some quirks. There's no way to set the 404 page on the webserver. And the binary's location in the filesystem matters. It was designed for the author's use and you have to live with these choices.

As I said, I've been happy using it. It fit my needs exactly: simple and I could code everything in one language, TypeScript. Pocketbase is not high-performance, but I didn't need that. I've had a few ideas for side projects and, when I'm done this work, I'll implement one on Pocketbase because it is that easy.

And, as part of my contract, my friend's company will donate to Pocketbase. :)

mdnahas··on Xmas.c (1988)
My own investigation, from 20+ years ago:

http://michaeldnahas.com/xmassong/index.html

mdnahas··on Why America Abandoned the Greatest Economy in History
This article missed one huge change in the economy: the shipping container.

Incomes of the workers continued to increase, they were just outside the USA. Rich Americans were running a world economy, not just the American economy, so their incomes increased. American workers did well - their incomes remained high while competing with everyone in the globe.

mdnahas··on Why America Abandoned the Greatest Economy in History
Re: “historically, the world is doing better than ever.”

Yes, that’s true. If you read “Enlightenment Now”, there are tons of wonderful graphs showing life improving. And for almost every country, as it gets richer, it gets happier. But the one exception is the USA. We’ve gotten richer lately, but not happier.

Our government’s decision making ability is messed up. We have an excellent economy, but debt is increasing. Our government has income, but we nearly defaulted on our debt. Healthcare has been a problem for 30+ years.

My state of Texas is run by Republican primary voters, which are an extreme 10% of the population.

We need to end gerrymandering with single-party primaries. (I like jungle primaries with ranked choice voting.) We need popular elections for President (not everything riding on swing states). We need to remove the filibuster. We need to weaken the Speaker’s power, which caused omnibus bills rather than real debate.

I’ve seen good activism and change at the city level. YIMBY’s are making progress. They’re now working at the state level. But it is still hard to see us making the necessary fixes at the federal level. I have horrible worries about what will happen if we don’t fix those very soon.

mdnahas··on Confusing Git Terminology
A clear sign that Linus was happy with the internals (plumbing) but thought the UI (porcelain) needed work. Originally, the porcelain was all scripts calling the plumbing. Sadly, they hardcoded that UI to make it faster, without improving it.
mdnahas··on Confusing Git Terminology
AND we should have pseudo-pointers to the current directory layout and the files already “add”ed (a.k.a. cached/indexed/staged). Git’s UI should allow us to do “diff” or any other command on these. I tried to get the git maintainers to name these (DIR and NEXT?) and make them work with the big commands, but they didn’t see the simplicity of it all. So instead of “git diff DIR NEXT” we get “git diff” and instead of “git diff NEXT HEAD” we get “diff —cached HEAD” which are much less understandable.
mdnahas··on Who profits most from America's baffling health-care system?
I read a good book that says the US has many socialized medical systems. Medicare for the old is similar to Canada’s system. VA for veterans is similar to England’s system. Most salaried workers insurance is similar to Germany’s system, except the German insurers are all non-profits. (In the US, the insurers were all non-profits back in the 1970s.)

I started in tech, but went back and got an econ degree. A market for insurance works well for unpredictable things, like broken legs. But it doesn’t work well if some can predict their need, like life-long conditions. So, there is a role for non-market solutions. At that point, you need to address how to keep patients from consuming “too much” healthcare, because they’re not paying the full cost.

Many countries spend less and have longer lives. But it is hard to get the US to implement one of those systems when healthcare companies spend more than $1 million per member of Congress on lobbying and campaign donations.

mdnahas··on Who profits most from America's baffling health-care system?
You don’t want to compare companies by profit margin. (Profit/Revenue) You want to compare them by return on capital. (Profit/Capital) Some businesses have a high turnover of inventory, so revenue is large even if there was very little money invested.
mdnahas··on The deep link equating math proofs and computer programs
Agreed! The most famous mathematician in the field told me “I used the first tool I could understand how to write a proof in.” Most he could not!

I was so disgusted by the tutorials for Coq that I wrote my own. It has been reviewed positively on Hacker News before. If you want a look at some of the basics of formal proof and these tools, take a look:

http://michaeldnahas.com/doc/nahas_tutorial.html

mdnahas··on The deep link equating math proofs and computer programs
A good way to do this is to replace Geometry class. It is only there because Euclid’s Elements was read by Charlemagne’s kids. Geometry teaches proof, but a very outdated style of proof. It should be replaced with formal proofs, written in Lean or Coq. Since “a proof is a program”, it would also introduce programming into the curriculum.
mdnahas··on The deep link equating math proofs and computer programs
Write the code and proofs in Coq. Coq can output OCaML. I believe OCaML can compile to JavaScript.

That will allow you to verify the pure functions. It will not verify the input/output that will also be necessary.

← PreviousPage 5 of 6Next →