HNHacker News
TopNewBestAskShowJobs

kjksf

6,940 karma · joined September 5, 2009

My website is https://blog.kowalczyk.info

Working on https://filerion.com/, a web based file manager (s3, Dropbox and more).

I created https://www.sumatrapdfreader.org

submissionscomments
kjksf··on Tracking supermarket prices with Playwright
Depends on the server.

Most have at least 20 TB of bandwidth included in the price, even the lowest $5/mo shared cpu machines. 20 TB is a gigantic amount unless you're serving videos or some such.

Some have unlimited bandwidth (I mean they are effectively limited by the speed of network connection but you don't pay for amount).

kjksf··on Twitter kills its San Francisco headquarters, will relocate to South Bay
Yes, that's how politicians and activists are shifting blame from their lack of interest in solving the issue to sacrificial goats.

The streets are full of homeless and drugged out people? That's not the reason restaurants are failing, it's the tech bro's cafeteria!

The house prices are sky high? It's not single house zoning and politicians blocking any house building, it's the rich tech bros gentrifying your neighborhood!

kjksf··on Twitter kills its San Francisco headquarters, will relocate to South Bay
San Francisco was ignoring this problem for at least 10 years before that judgement happened.

Not to mention the issue there wasn't exactly that the city was trying to do something but the fact that they were fining them and plaintiffs claimed the fines were so large that they were "cruel and unusual punishment" which is non-constitutional.

So no, it's 100% political and bureaucratic apathy over many years, not one court case.

kjksf··on Russ Cox is stepping down as the Go tech lead
Explain how Google proxy "shenanigans" are any different than "npm proxy shenanigans" or "cargo shenanigans" or "pip shenanigans". It's a service to improve Go ecosystem with anti-spoof security design (which can't be said about those other code download services).

telemetry design is actually very thoughtful, limited and reasonable about what and how much data it sends. Motivation for sending the data is clear (improving Go). It's only a scandal for unreasonable people.

kjksf··on Russ Cox is stepping down as the Go tech lead
Why is it a problem?

`go vet` is part of Go toolchain so the designers very much understand and acknowledge that code can have issues that are not always errors.

The distinction they made is very simple: an error is something that is always wrong and a vet warnings is something that is possibly wrong but not always.

They made a judgement call to split the responsibility: compiler only reports errors, other tools, including `go vet`, can tell you about other issues.

For example: passing a large struct by value to a function is potentially a performance problem but it's also correct code.

If you ever tried to compile C++ code with different compilers you would know why it's a wise decision.

The set of warnings is vast and not standardized so you take C++ source from project. It compiles for them but doesn't compile for you because you use different compiler or enabled different set of warnings. At which point you either try to get the other project to "fix" something that isn't an issue for them or you do stupid, pointless, time consuming work adjusting your build system.

The same would happen in Go and it would be a reusability killer. You use some library in your program but it doesn't compile because you decided to use more strict set of flags.

Lack of warnings switches also simplifies the toolchain. In go it's just `go build` and it works.

In C++ you have to write some kind of makefile because everyone executes `cc` with different set of flags.

kjksf··on Russ Cox is stepping down as the Go tech lead
Just last week I've implemented an iterator for my C++ type and lol to your comment. It was fucking nightmare compared to how you (will) implement an iterator in Go.

I didn't study the reason why Go chose this way over others. I do know they've considered other ways of doing it and concluded this one is best, based on complex criteria.

People who make value judgements like this typically ignore those complex consideration, of which playing well with all the past Go design decisions is the most important.

Frankly, you didn't even bother to say which language does it better or provide a concrete example of the supposedly non-ugly alternative.

kjksf··on Eating Processed Red Meat Linked to Increased Dementia Risk
"processed meat" is a meaningless term.

Here's how to make a smoke sausage:

    you kill a pig
    grind its meat
    add salt and maybe pepper or other flavorings made from plant
    put in a casing
    smoke it
This matches the definition of "processed meat".

The other way to make sausage, the industrial process, involves adding a bunch of chemicals to make it more shelf stable and god knows what else.

It's the chemicals that are harmful, not the meat or salt.

kjksf··on Eating Processed Red Meat Linked to Increased Dementia Risk
Sadly, this is another garbage study that you should ignore.

Why garbage? For 2 main reason.

First reason: the methodology. They way those correlation studies work is that they study large number of people (here 130k) over long period (here "up to 43 years").

They want to study "effect of X on Y". Here X is "consumption of red meat, processed or not" and Y is "dementia".

So what they do is they periodically ask "how much of X do you do". In this case apparently "how many servings of processed red meat you eat per month", "how many servings of unprocessed red meat".

Would be able to tell a precise "how many servings of processed red meat you eat per month"? Like, what is "processed meat"? What is "serving"?

If you're not taking meticulous notes you have not hope of answering this precisely, from memory. And let's face it, those 130k people are not fastidious scientists, they just answer a periodic survey that has no importance to them.

The opposite of "precise" is garbage. And garbage data leads to garbage conclusions.

Second reason: confounding of factors. No controlling for other variables. What if dementia is affected by heavy drinking, heavy smoking, drug use, lack of muscles or excessive sugar / carb intake?

What if heavy drinking is the real causation with 54% increase in dementia and the 14% correlation is purely coincidental i.e. in this particular 130k population, heavy drinkers are also eaters of processed meat?

You should ignore all those kinds of studies. They are all garbage.

There's also a general strand of anti-meat studies.

When you study "effect of eating X on bad outcome Y", then you'll find a correlation to something at some point. It's just a matter of time. The more studies you do, the more likely you'll find a spurious correlation.

Somehow the studies of "eating meat causes bad Y" get a lot of press, including landing on HN page. When was the last time you've seen a similar study for vegan diet or drinking soda or eating candy?

kjksf··on Tesla Q2 2024 Update [pdf]
The reason the original CEO was replaced by a guy and another guy and finally Musk is because the cost of Roadster parts was higher than the price of Roadster.

What Tesla needed was someone who is un-naturally good operator: someone who can drive the costs down, motivate the employees to deliver great product at a profit.

That was Musk.

And if you think that's just a given and any CEO can do it: currently Lucid and Rivian are still loosing tons of money on their cars. So does Ford and GM. Not to mention Fisker and few others who went bankrupt in the process.

You can do apples-to-apples comparison of execution of Musk vs. CEO of Lucid or Rivian by looking at "money burn at year N" of company's existence. Lucid and Rivian are still accumulating "money burn".

kjksf··on Tesla Q2 2024 Update [pdf]
Relative to everybody.

Megapack is a product they've been perfecting for many years and it's already at least a v3 product.

Not only they are not using Panasonic cells in Megapack (those go exclusively to their higher-end cars), if you think all it takes to create a competing product is to have money to buy battery cells then you exemplify "a little knowledge is a dangerous thing".

Megapack is a product with lots of sophisticated electronics that takes serious engineering to develop, it's at least v3 product with years of improvements. You need high-powered voltage conversion, battery management hardware and software so that it doesn't explode etc.

Tesla is a clear leader in the field: every major energy project announced, from Australia to California, uses Tesla megapack. I don't hear much about any of the competition.

Tesla is leading in scale and expanding rapidly (just finished ramping up first U.S. factory and building another factory in China).

Even for Tesla to build another 40 GWh factory which is mostly copy & paste of their existing megapack factor, it's a year long process.

If you start with battery cells, you're looking into a multi-year design & testing & initial production for the first megapack-like product and then at least another year to scale your first factory to 40 GWh yearly production.

By which time Tesla will have few more factories and v5 of Megapack.

kjksf··on Tesla Q2 2024 Update [pdf]
This is a chart of battery CELL production.

Megapack (a giant battery pack for grid energy storage) has much more in it than just battery cells.

Tesla's Megapack sales are growing rapidly, they just ramped one U.S. factory from 10 GWh to 40 GWh and are building another 40 GWh factory in China.

Every few weeks there's another big project announced that will use Megapacks.

As far as I know Tesla is a decisive leader in that field but hard to tell because while there is competition, they don't disclose the sales.

kjksf··on Ford spends $3B to expand large truck production in plant previously set for EVs
It's just short-term thinking of managerial class running companies like Ford or GM, not lack of infrastructure.

Thanks to Tesla U.S. has pretty good charging network. And it's very cheap to build (relatively speaking).

During the years that Tesla was investing in world-wide charging network despite loosing money, GM and Ford had plenty of profits they could have invested in that obvious un-blocker of EV adoption.

They didn't but that's on them and their management. The state (what you call "us") doesn't need to be involved. If Tesla alone was able to build and fund U.S.-wide network, if every other car company in U.S. chipped in, charging network could have been several times bigger today.

It'll be several times bigger, it'll just take few more years.

The real blocker is lack of good EV cars, priced competitively. Chinese have those which is why EU is now panicking and creating additional, punishing tariffs on Chinese cars, to protect their mis-managed car industry.

And it will work for a few years, until Chinese build factories in Europe and crush European car makers anyway.

kjksf··on Ford spends $3B to expand large truck production in plant previously set for EVs
And yet the best selling car last year, world-wide, was Tesla Model Y - a fully electric car, not a hybrid.

Hybrids are the worst of both worlds: you need a gas engine AND a battery.

It doesn't make sense economically.

Things cost money and putting both engine and battery costs more that putting just one of those.

People care about the price so in practice you end up with a car that has both gimped (cheaper) gas engine and gimped (cheaper) battery and a government subsidy to make it sense financially (for buyer).

Not to mention that study after study found that environment benefits of plug-in hybrids have been greatly exaggerated i.e. in real life charging happens 2-3x less than the initial predictions.

People buy them mostly because governments offer subsidies making them more attractive than similar gas cars and then don't charge them at all. Which also means that the battery in them is completely useless and it would be better if it wasn't there in the first place.

kjksf··on Just Be Rich (2021)
Even worse, it'll be spent buying votes (Biden's student debt relieve).

Billions will be allocated for building electric chargers and almost no chargers will be built.

Billions will be allocated for connecting poor people to internet and no people will be connected.

Hundreds of millions will be spent on homeless and will result in increasing homelessness.

A public toilet will be built for $2.5 million.

McKinsey will be paid $4 million for a study telling NY that garbage bins are better than plastic garbage bags.

$11 billion will be spent on 57 miles of rail tracks.

Those are just examples of government waste I can recall from memory.

Discussing levels of taxation is just a sideshow. Sound and fury signifying nothing.

The real problem is that government grows without bounds, more of our money goes to just paying the salaries of bureaucrats and contrary to what you might expect, more bureaucrats leads to making things more difficult and costly for non-government and to just breath-taking inefficiencies and waste of money by government.

kjksf··on Just Be Rich (2021)
Or maybe it's an argument for allowing states to try different economic strategies and compete for business based on outcomes of those strategies.

If California taxes people and businesses at insane levels, maybe we shouldn't replicate insane level of taxation everywhere else in U.S., on the off chance that it is not, in fact, an optimal level for generating wealth for the people.

Maybe Texas and Florida should be allowed to enact competing taxation schemes so that we can see which one is better.

And maybe Americans should have a freedom of movement within U.S. without having their private property confiscated by the state when they try to leave.

The justification for taxation based on residency is that you use commons like roads and school and police that the government funds so you need to contribute to funding those things.

What exactly is justifications for hitting people with more taxes when they try to leave the state?

kjksf··on Nevada’s public employee pension fund invests passively and beats peers (2016)
Returns from stock investing come from increasing stock prices.

Stock prices increase when earnings of the company grow.

In other words: when the economy grows.

You can argue that Amazon and Apple and Google and Facebook etc. will grow earnings even if the overall economy is flat or shrinks but I don't see how that would apply to passive investing i.e. investing in S&P 500 i.e. investing in 500 largest US companies.

S&P 500 is U.S. economy and they all are sensitive to overall economic situation. If people have less money, they buy less stuff. Amazon makes less money, their stock goes down. Apple sells less iPhones, their stock goes down. All other companies make less money, they spend less on advertising, Google and Facebook make less money.

I don't see a scenario where overall U.S. (or world) economy declines and S&P 500 doesn't decline.

In fact, declining economy is an argument for active investing. Even when overall economy declines, among 6000 companies listed on stock market there will be some that will be growing and if you invest in them, you'll make money.

kjksf··on Show HN: Edna, note taking app for developers
It's a possibility but I'm not using those myself so I don't have good intuition on what is a good UI for that.

A relatively simple thing would be to add "preview block" which e.g. for mermaid blocks would add a panel with rendered diagram.

A much more complicated solution would be to add codemirror view which renders diagram when cursor is outside the markup and switches to editing when inside markup.

But that's significantly more complicated.

kjksf··on Show HN: Edna, note taking app for developers
Yeah, that was for a different project that I no longer work on.
kjksf··on Show HN: Edna, note taking app for developers
As far as individual commits, you can see the scope yourself: https://github.com/kjk/edna/commits/main/

Yes, I like to work in relatively small, but logical, commits.

Yes, I did have clear goals in mind. I knew I wanted multiple notes, storing notes on disk, command palette, encryption etc.

I was writing the app for myself and using it every day, which helps with motivation and knowing what to do next.

There were also changes based on usage. For example, I've added a top nav bar but occasionally it would obscure the text so I made it hidden when typing.

One of the uses of Edna is keeping track of what I want to do next.

I have a note for each project, including Edna, and I keep a list of ideas there, sorted by the most important things at the top.

That way I can jump start the day quickly by looking at that note and picking one of the items to implement.

kjksf··on Show HN: Edna, note taking app for developers
To expand on this even more: it would be possible to make it a lightweight web playground like codepen.io

By convention, if a note has html block and javascript block (and optionally css block), I could consider that a small website with index.html, index.js and index.css files and provide a preview of html output.

kjksf··on Show HN: Edna, note taking app for developers
Yeah, the reason I could add Go quickly is because I already did the hard work of figuring out how to execute Go code when I built https://tools.arslexis.io/goplayground/

Executing JavaScript safely is actually hard. You don't want to just execute code in browser context because then an attacker could trick you to execute his JavaScript code and e.g. grab all your notes.

So you need to sandbox it via e.g. iframe or by running using wasm-compiled quickjs

Which is something I might do.

Additionally I'm thinking about allowing to run a javascript function over content of a block so e.g. you could base64-encode a text block etc.

kjksf··on Show HN: Edna, note taking app for developers
Regarding accessing from any device: at least for desktop you can store notes on disk, in a folder managed by DropBox or OneDrive or Google Drive (https://edna.arslexis.io/help-win#storing-notes-on-disk).

You can then access the note on every computer where you replicate that folder.

This doesn't cover accessing from mobile or computers you don't own but it's just a different kind of a problem of auth.

Edna is actually a self-contained go binary that you could run yourself on a server or your desktop.

Currently the backend (Go server) is there to just serve HTTP files but it wouldn't be hard to add storage API to Go server and modify Edna to use that. I already have 2 storage backends: local storage and file system api.

I would say it would be at most a few days of work to make it work similarly to SB but that's not something I plan right now. I still have some UI functionality to add to Edna and then we'll see.

kjksf··on Show HN: Edna, note taking app for developers
Funny you would say that.

Earlier I also made a fork of silverbullet: https://notedapp.dev/ with similar goals to Edna (which is a fork of heynote).

But don't use it. I stopped working on it half-way. In retrospect, I've made a mistake there of doing my note storage backend.

Then I was thinking about re-starting it and re-doing the backend for notedapp but then I saw heynote and used that as a based and I'm quite happy with the result.

I do like SilverBullet so it's a possibility that I'll do another project which combines the UX ideas of Edna with SilverBullet editing UI. But for now I still have some ideas for Edna, will keep me busy for at least a week :)

kjksf··on Show HN: Edna, note taking app for developers
Block type is also displayed at the bottom in the status bar. Click on that to change.

Or: context menu (right click), Block / Change Language.

Or: command palette, "Block: Change Language" command.

kjksf··on Show HN: Edna, note taking app for developers
You can do that with Edna too.

Store notes on disk (https://edna.arslexis.io/help-win#storing-notes-on-disk) and you can auto commit the whole directory with git.

Personally I store my notes (encrypted with a password) on directory managed with OneDrive.

Edna also auto-saves files.

kjksf··on Show HN: Edna, note taking app for developers
If you store notes on disk, which is what I do, you can back them up with any file backup tool.

I store my notes (encrypted with a password) on OneDrive.

See https://edna.arslexis.io/help-win#storing-notes-on-disk

I even have a settings option for a daily backup which exports all notes into a single .zip file in `backups` sub-directory. Not sure if it makes much sense, but it's there.

kjksf··on Show HN: Edna, note taking app for developers
I guess I could add 2 helpful features:

    - autocomplete for note name when `[`
    - if there's note `foo` and `[foo]` in markdown block, Ctrl + click could open to that note
kjksf··on Show HN: Edna, note taking app for developers
I only use that for `Alt + 1` - `Alt + 9` quick access shortcuts.

`Alt + N` for new scratch note is implemented via `Mod-n` CodeMirror keymap (keymap.js) so I'm not sure why it wouldn't work.

kjksf··on Show HN: Edna, note taking app for developers
Undocumented: Ctrl + K and Ctrl + O also work.

Ctrl + K was actually the first. Ctrl + O because it's naturally "open". And you can switch to command palette with `>`, like in vs code.

I've added Ctrl + P and made it the documented one because I also use VS Code heavily and I was tired of context switching.

It's unfortunate that it conflicts with browser's Print but I figured that you do this often and print rarely.

The ultimate solution, of course, is to allow customizing keybindings.

kjksf··on Show HN: Edna, note taking app for developers
It is. It has PWA manifest (https://github.com/kjk/edna/blob/main/public/site.webmanifes...) and you can install it as desktop app (tested with Chrome on Windows).

I should add offline mode.

If you need some specific PWA functionality that isn't there, please open an issue at https://github.com/kjk/edna/issues

← PreviousPage 8 of 34Next →