HNHacker News
TopNewBestAskShowJobs

afiodorov

784 karma · joined June 21, 2019

Likes Computer Science, Mathematics, AI, ML
submissionscomments
afiodorov··on Claude's API now supports CORS requests, enabling client-side applications
I love making web apps where users bring their own keys. This approach combines the best of both worlds: the convenience of distributing executable files and the benefits of open source. So far, I have developed two web apps:

1. A live transcription and translation app that uses microphone input. This is useful for watching proprietary content and facilitating communication.

2. An app that translates SRT subtitles into various languages.

I opt for the "bring your own keys" model for two main reasons:

1. Low maintenance: As a professional software developer, I already maintain a lot of software, and the last thing I want is to maintain my side projects. My goal is to write and distribute these apps so they continue working without requiring constant attention from me.

2. Low cost: This model allows me to distribute the apps without ads. By having users provide their own keys, I can keep operational costs down and avoid the need for monetization through advertising.

This approach enables me to create and share useful tools while keeping both my maintenance burden and user costs to a minimum.

afiodorov··on Dasel: Select, put and delete data from JSON, TOML, YAML, XML and CSV
I occasionally need to remove PII from json payloads before sharing it on slack, would be nice if there was some kind of obfuscate option for either all json values or just some that’d replace all values with **.
afiodorov··on Go is my hammer, and everything is a nail
I used to work for a Go shop. We dealt with financial data. I found it so annoying that many of my colleagues would use Go for one-off tasks such as aggregating CSV files, updating the database with some data, or fetching data from the database, and then trying to make a plot. I saw my colleagues again and again implementing basic algorithms such as rolling median, or finding a maximum. Instead of loading data into Pandas and doing a group by, they would create some kind of loopy solution that would use maps.

I totally understand why some people prefer Go in production to Python, but I could never understand why people wouldn't just learn the standard data science tools instead of reinventing the wheel in Go, always debugging their own off-by-one errors. It was difficult for me to trust the results of such analyses, given that I knew how many of the basic functions were written on the fly and probably not even tested.

In the end, I didn't think it was a good use of the company's time. It felt more like an ego thing - thinking and showing that Go is sufficient. It reminds me of how people try to use iPads to code - only to show that they can do it.

afiodorov··on How Home Assistant is being used to protect from missile and drone attacks
>spiting on a cake is never how one can secure the cake for themself,

Not sure the analogy holds, Putin got a slice for himself and spits on the rest.

> War is the single most unproductive activity humans can do.

This war is a conflict about values; conflicting sides think human lives are worth sacrificing for the values let alone economical output.

afiodorov··on Introducing Copilot+ PCs
>Live Captions now has live translations and will turn any audio that passes through your PC into a single, English-language caption experience, in real time on your screen across all your apps consistently. You can translate any live or pre-recorded audio in any app or video platform from over 40 languages into English subtitles instantly, automatically and even while you’re offline.

Wow that's an amazing feature!

afiodorov··on Backdoor in upstream xz/liblzma leading to SSH server compromise
I've been told verifiable builds are possible already, I don't know how practical though:

twitter.com/stskeeps/status/1774019709739872599

afiodorov··on Backdoor in upstream xz/liblzma leading to SSH server compromise
We should be able to produce a tar and a proof that tar was produced from a specific source code.

Quote from the article:

    That line is not in the upstream source of build-to-host, nor is build-to-host used by xz in git.
Zero Knowledge virtual machines, like cartesi.io, might help with this. Idea is to take the source, run a bunch of computational steps (compilation & archiving) and at the same time produce some kind of signature that certain steps were executed.

The verifiers can then easily check that the signature and indeed be convinced that the code was executed as it is claimed and source code wasn't tampered with.

The advantage of Zero-Knowledge technology in this case is that one doesn't need to repeat the computational steps themselves nor rely on a trusted party to do it for them (like automated build - that can also be compromised by the state actors). Just having the proof solves this trust problem mathematically: if you have the proof & the tar, you can quickly check source code that produced the tar wasn't modified.

afiodorov··on Pyenv – lets you easily switch between multiple versions of Python
I've been programming in Python for years and I agree: Python isn't really for consumers. But hey it is used for LLMs that can generate React apps, so there's that.

I am only half-kidding. But it appears the industry as a whole is concentrating effort on fewer languages and Python is one of them. If I want to distribute my app - I write it in React, but I still often use python in the process: prototyping, asking GPT to rewrite X from python to typescript, making mock servers for tests / preparing data for unit tests.

afiodorov··on Why do tree-based models still outperform deep learning on tabular data? (2022)
A calculator outperforms deep learning on basic arithmetic tasks.

Tree-based models are extremely good at finding clustering patterns; they outperform trained humans at that, thus we have commercial applications such as fraud detection.

Deep Learning is most promising way of getting us to general intelligence. So far only known general intelligence, human intelligence, has many quirks at specific tasks and I think Deep Learning won't be any different. However Deep Learning models can recognise their own weakness and call tree-based model if they think that's appropriate.

afiodorov··on The One Billion Row Challenge in Go: from 1m45s to 4s in nine solutions
I thought this was an illustrative example of how to process big datasets. We could easily have a statistic per e.g. bitcoin transaction in a different problem, see https://github.com/afiodorov/bitcoin_ancestries .

I struggle a lot with this toy problem. Without constraints too trivial to pay attention to; then no one seems to agree on potential real-world constraints (stdlib only? no mmaps?).

If we have to solve just this problem as is, shouldn't we be timing simple solutions using various frameworks (polars, pandas, spark, bigquery[^1], go, awk) to compare various frameworks? Once you have the answer, why would you try to get the same answer again but in 4 seconds the second time round?

Comparing frameworks would at least indicate if a data practitioner should upskill and pick up yet another data framework.

[^1]: https://medium.com/@shuvro_25220/the-one-billion-rows-challe...

afiodorov··on The One Billion Row Challenge in Go: from 1m45s to 4s in nine solutions
What I am saying is that the solutions presented assume we have N stations which are way less than 1_000_000_000.

Worst case scenario for RAM would be if each line contained a unique station. In this case we'd have to allocate 1_000_000_000 * sizeof(stats) in RAM to contain the result of the computation.

So most of the solutions assume sufficient RAM ahead of reading the file.

In the first solution:

type stats struct { min, max, sum float64 count int64 }

would take up 32GB for the stats alone for all 1E9 stations, and that's ignoring space needed for each station's name!

afiodorov··on The One Billion Row Challenge in Go: from 1m45s to 4s in nine solutions
My first instinct would be to spin up a local Postgres and keep station data there. A lot of the solutions assume we have enough ram to keep the stats per station, however that's a bad assumption when dealing with a lot of data.
afiodorov··on Phind-70B: Closing the code quality gap with GPT-4 Turbo while running 4x faster
>but may be sufficient for a specific task

Yes more than sufficient for an internal tool - we can assume good intentions of the users of the tool since people want for this to actually work and have no intention of hacking.

afiodorov··on Phind-70B: Closing the code quality gap with GPT-4 Turbo while running 4x faster
You're right! It solved it. I didn't know about the Code/Search distinction. I still struggled for it to write me the unit tests. It does write them, they just don't pass. But this is definitely much closer to GPT4 than I originally thought.
afiodorov··on Phind-70B: Closing the code quality gap with GPT-4 Turbo while running 4x faster
https://www.phind.com/search?cache=r2a52gs77wtmi277o0xi4z2a
afiodorov··on Phind-70B: Closing the code quality gap with GPT-4 Turbo while running 4x faster
I don't trust the code quality evalution. The other day at work I wanted to split my string by ; but only if it's not within single quotes (think about splitting many SQL statements). I explicitly asked for stdlib python solution and preferrably avoid counting quotes since that's a bit verbose.

GPT4 gave me a regex found on https://stackoverflow.com/a/2787979 (without "), explained it to me and then it successfully added all the necessary unit tests and they passed - I commited all of that to the repo and moved on.

I couldn't get 70B to answer this question even with multiple nudges.

Every time I try something non GPT-4 I always go back - it's feels like a waste of time otherwise. A bit sad that LLMs follow the typical winner-takes-it-all tech curve. However if you could ask the smartest guy in the room your question every time, why wouldn't you?

---

Edit: USE CODE MODE and it'll actually solve it.

afiodorov··on Ask HN: What have you built with LLMs?
GPT4 is incredible! We watched https://en.wikipedia.org/wiki/The_Boy%27s_Word:_Blood_on_the... which is full of slang and it was perfectly comprehensive. I love how it'd translate informal speech into informal.
afiodorov··on Ask HN: What have you built with LLMs?
I have built a webapp for translating srt files: https://www.subsgpt.com

GPT-4 excels as a translator, but it often encounters issues with content warnings and formatting errors when translating entire subtitle files via ChatGPT. The solution is straightforward: divide the subtitle file into sections, focusing solely on translating the text and disregarding the timestamps. While it's feasible to have ChatGPT maintain the correct format, I've observed a decline in translation quality when attempting this in a single pass. My preferred approach is a two-phase method: first, translate the text, and then, if necessary, request ChatGPT to adjust the formatting.

The webapp splits the srt file into batches of 20 phrases and translates each batch. It also allows for manual correction of the final translation.

Ah and it's also serverless: you input your OpenAI token & select the model of your choice and the webapp makes the requests to OpenAI directly.

afiodorov··on Anki – Powerful, intelligent flash cards
I'm a big fan of spaced repetition, though I've hung up my hat with it for now. My journey with spaced repetition is a bit of a throwback - think pre-smartphone days, armed with SuperMemo on my trusty iPAQ hx4700. Picture this: a 19-year-old me, fresh in England for university studies, diligently working through English lessons on the Tube to and from work. Back then, I was convinced I'd settled in England for good, despite my English being a bit of a work in progress.

In hindsight, I'd tell my younger self to chill out and remember that learning a language is a marathon, not a sprint.

SuperMemo was a game-changer for me, boosting my memory like nothing else. It's like when you're coding in a language you haven't used in ages – things are on the tip of your tongue, but you're not quite sure. Is it len(arr), arr.length, arr.length(), or... darn it, is it size? sizeof? Space repetition solves this problem for good!

For my graduate math exams, SuperMemo was my secret weapon. I'd jot down all the proofs I needed to memorize and challenge myself to write them out. It worked wonders – I aced those exams. But interestingly, it wasn't about memorizing the proofs word for word; it was more about getting the structure and the key tricks down pat. In my practice runs, I'd often take shortcuts because who has the time to write everything out in full detail?

Then came Anki for my Spanish adventures. Nowadays, I'm dabbling in Portuguese but have given Anki and spaced repetition the cold shoulder. Why, you ask? Well, I'm a firm believer that if rapid recall is your goal, spaced repetition is your best friend. But most language learners don't use it. Are they missing a trick, or do they just not fancy efficiency? What stops them from optimizing their learning? I can only guess. As for myself, I've ditched it because, let's face it, reviewing cards over and over can be a snooze-fest. The most fun part about spaced repetition was creating the decks. Now, I'm learning Portuguese purely for the joy of it and don't mind how long it takes. I immerse myself in interesting content in Portuguese, occasionally revisiting something I've learned with a quick Google search. I'm perfectly fine with not reaching fluency quickly. After all, there's more to life than optimizing every bit of it!

afiodorov··on You've just been fucked by psyops [video]
I haven't had the time to set-up whisper - but I don't even have a gpu. By the way Deepgram hosts Whisper too, but according to https://news.ycombinator.com/item?id=35367655 their models are much better. Transcribing the video was almost instant.
afiodorov··on You've just been fucked by psyops [video]
transcript: https://raw.githubusercontent.com/afiodorov/fucked-by-psyops...
afiodorov··on Can you use your "free will"? Try your hand
I've long been very curious how one would generate a reasonably good source of randomness in a practical way without using a computer. Perhaps one could think of a song and then try to deduce randomness from the first letter of each word. I haven't found a way yet, any ideas?

I occasionally want to use a reasonably good source of randomness when e.g. picking a board-game player or picking a random item on a menu.

afiodorov··on Why I Hate Frameworks (2005)
The speed difference boils down to flexibility and tool usage. In the startup, I could swiftly create a new service, harness Kubernetes for deployment, and seamlessly integrate it into the existing architecture. Data computation used tools like Airflow/BigQuery, storing results in production PostgreSQL.

In contrast, with a Golang monolith, service integration often involved complex, time-consuming conversations due to rigid NIH abstractions. And given the tendency of senior engineers to resist changes, progressing became challenging. A developer like me would be caught between resistant seniors and a product team demanding immediate feature release. Additionally, data processing often required extensive custom coding, slowing down operations. And if more than one machine was needed, it would mean a total overhaul and a long wait.

In comparison, a lean startup allowed me to use apt tools (like BigQuery), containerize it with Docker, and then let it be - without involving anyone senior. Moreover, in case of a new feature, we could simply replace the entire component instead of struggling with additions.

The agile startup emphasized less on seeking senior developers' approval for every change. In the monolithic Golang environment, senior devs often fixated on code quality without acknowledging that, in a microservices context, it's frequently more effective, faster, and simpler to reboot and rewrite parts instead of altering the existing solution. Hence, the intense focus on solution maintainability becomes less critical.

afiodorov··on Why I Hate Frameworks (2005)
There isn't a one-size-fits-all solution to this issue.

Before joining the department, I was part of a start-up where, with a considerably smaller team, we were able to process even larger amounts of data. We could introduce a new feature in a single day - a feat unthinkable in the department I just described. This speed was not achieved at the expense of stability but was a direct result of our choice of tools.

Addressing the aspect of "questionable design and lack of readily available support", I believe only a handful of individuals are capable of developing something on the scale of Docker or Kubernetes, let alone doing it effectively. Assuming you're fortunate enough to hire such individuals, would you genuinely want them dedicating their cognitive resources to these types of problems? Even if they are highly skilled, can their solution truly compete with industry-standard frameworks developed by a team of equally competent individuals? And even if such an individual could design a superior solution, they are now responsible for maintaining it and training juniors on a system they likely have little motivation to understand.

Moreover, the 'Not Invented Here' syndrome can lead to a cascade of more of the same. For instance, we needed to orchestrate several processes. Had we adopted Kubernetes, I would have suggested utilizing Airflow, which could have been implemented in just a few days. However, we chose to develop a custom pipeline runner, which took several months to complete.

I understand that the no-frameworks sentiment has its roots – perhaps from Java's insistence on using frameworks. However, it seems that the industry swings from one extreme to the other. Golang emerged as a reaction to a world overrun with frameworks, but it appears to have veered too far in the other direction.

afiodorov··on Why I Hate Frameworks (2005)
I've always been hesitant about adopting frameworks, and I still favor Flask over Django. Yet, I spent a couple of years in a Go-centric department where the senior members were so against using frameworks that we ended up building everything ourselves from scratch. This included creating our own load-balancer, event store, and aggregation engine.

When I attempted to point out that we were investing substantial time solving problems that have already been resolved, I was invariably met with references to "frameworks" and "complexity". However, in my perspective, our reluctance to utilize frameworks led to an inflated team size, slower development cycles, and a lengthy onboarding process for new members.

I believe that if we had chosen to use industry-standard tools for our backend & infra (e.g. Kafka, Kubernetes, Apache Beam/Spark streams), we might have had to deal with a higher degree of complexity, but it would have been manageable. I would much prefer to diagnose issues with a Kubernetes deployment than to debug obscure panic-inducing code written by a colleague, which is questionably designed and lacks readily available support.

One of the main advantages of using a framework is standardization: thanks to tools like git, we don't need to familiarize ourselves with every company's unique version control tool. Similarly, if everyone agrees on using Kubernetes and Docker, we can eliminate the need to learn each company's specific deployment process. This would allow us to dedicate more time to providing actual business value, rather than contemplating how our code should be transitioned into production.

As for the department - it just got shutdown due to not making enough money and costing too much.

afiodorov··on Ask HN: Most interesting tech you built for just yourself?
Hey! Updated to include the id. By the way there's also a committed json with all the data: https://github.com/afiodorov/notebooks/blob/main/ideas.json.
afiodorov··on Ask HN: Most interesting tech you built for just yourself?
Glad you found it useful. Yes it should qualify and I wanted to make it a bit meta :). However I think https://thoughtful3.eth.limo is more interesting out of things I've built for myself. It's an onchain Twitter. I am currently using it as my personal microblog - however anyone could use it too if they wanted to to burn a few cents per post.
afiodorov··on Ask HN: Most interesting tech you built for just yourself?
One sentence summary of each top level comment here: https://github.com/afiodorov/notebooks/blob/main/2023_04_30_...

I wanted to read all the ideas but it became hard to read.

afiodorov··on I accidentally loaned all my money to the US government
You took one for the team. If the world ran on good software, you'd not cautiously deposit only $25 first and you'd not be tempted to stress-test the system with the $10k deposit. If the world ran on good software, the second $9.975k deposit wouldn't have bounced. Don't worry, I'll get back at them in my work by making the users suffer until they understand what good software is!
afiodorov··on Expectations for generics in Go 1.18
made my day
← PreviousPage 4 of 5Next →