HNHacker News
TopNewBestAskShowJobs

attilakun

150 karma · joined May 8, 2019

https://twitter.com/kunattila
submissionscomments
attilakun··on Show HN: CPU Prices on eBay
Very good points, thanks. Will be looking into these.
attilakun··on Show HN: CPU Prices on eBay
Yes, although this might be a not too difficult fix. I'll look into it.
attilakun··on Show HN: CPU Prices on eBay
It was a great experience, at least to the extent I needed it. What sold me on it is its support for template composition[1], something I've struggled with using the standard `html/template`. And I really like the idea of generating statically typed templates which are just Go functions in the end of the day. In theory, I can share them between many of my apps, especially as I'm using a monorepo for all my projects. This is yet to be tested though.

There are some rough edges around using `script` templates[2], for example it doesn't allow you to pass `this` and `arguments` from HTML event handlers[3]. This is not a show-stopper though, because you can always fall back to just defining your event handler in an HTML <script></script> block, albeit without type checking of the arguments and deduping the scripts. Also it hurts Locality of Behaviour which I'm a fan of.

That being said, I think it has some great potential. I can completely imagine people building fully-fledged UI libraries in this once component reusability is improved.

But the best part of using templ for me was that I could completely get rid of Node and NPM from my stack.

How was your experience?

[1]: https://templ.guide/syntax-and-usage/template-composition

[2]: https://templ.guide/syntax-and-usage/script-templates#script...

[3]: https://github.com/a-h/templ/issues/494

attilakun··on Show HN: CPU Prices on eBay
Yes, apologies for that, I had to disable that call as it was making too many calls to the eBay API endpoint which resulted in the rate limit getting hit.
attilakun··on Show HN: CPU Prices on eBay
No webpage scraping is involved here, data is from the eBay API. It's not using any database at the moment, just in-memory caching in the Go server. Problem is there are a lot of cache misses which result in API calls of which eBay only allows 5000 a day.

Funnily, the website seems to be crashing due to the API issues while the web server is at <1% CPU utilization.

attilakun··on Show HN: CPU Prices on eBay
The Amazon PAAPI is "interesting" because to even access it, you need to have 3 qualified sales. But... I wanted to use the API to create a website where I'd post the affiliate links on. It's a chicken-and-egg problem. That's why I went with eBay.
attilakun··on Show HN: CPU Prices on eBay
Yes, sorry, got rate limited by the eBay API!
attilakun··on Show HN: CPU Prices on eBay
Yes, it's possible. Will do this as soon as the rate limiting troubles with the eBay API subside a bit.
attilakun··on Show HN: CPU Prices on eBay
That's a very good idea, thanks! I think I'll have to do exactly that. Maybe in the fallback scenario, I can display a warning that data might be incomplete.
attilakun··on Show HN: CPU Prices on eBay
Haha yes! I think even their website design is great, it reminds me of a purer form of the internet before cookie banners, popups and auto-playing ads.
attilakun··on Show HN: CPU Prices on eBay
> It may make sense to run an hourly or daily job to collect data from the API and then implement the filters exclusively within your back-end.

Absolutely! I thought I could get away with just in-memory caching for the MVP but it looks like I can't.

attilakun··on Show HN: CPU Prices on eBay
Yes, got IP rate limited by eBay, sorry about that! Thought my caching was enough but apparently it is not!

eBay only allows 5000 API calls per day for most APIs useful to me which is very easy to hit: https://developer.ebay.com/develop/apis/api-call-limits

My infinite scrolling implementation probably didn't help either but I couldn't help myself, it was so easy to implement with HTMX.

attilakun··on AI and the Rise of Mediocrity
They already did in some domains, for example AlphaGo's move 37. The article's author is coping hard.
attilakun··on I disagree with Geoff Hinton regarding "glorified autocomplete"
I agree, Hinton's point is more about next-token-prediction being a good training objective for understanding, and not whether LLMs reproduce every aspect of a human's thought processes. They clearly don't (at least not at present scale), otherwise we'd have AGI now!
attilakun··on We Automated Bullshit
That's a bit too much hyperbole for me. Claiming that something always produces bullshit gives the impression that it is useless, which LLMs are clearly not.
attilakun··on Using Goatse to Stop App Theft
Somebody is doing something similar to my Chrome extension. They stole the (minified) code, slapped their own logo on top of it and started selling it. I filed a DMCA takedown request at Google and they removed the extension. Then the guy reuploaded the extension again with a slightly different UI. But I can still see that the underlying code is all mine!
attilakun··on Google Docs will now use canvas based rendering
I'm not sure but what you are suggesting is not outside the realm of possibility. There are already projects like https://makepad.dev/ which implement their GUI on top of WebGL. (Which is arguably more challenging than implementation on top of Canvas 2D.)
attilakun··on Cross-Database Queries in SQLite
Do you have a link?

I'm considering trying this with SQLite but I'm a bit worried about maintenance.

attilakun··on Command Line Shell for SQLite
I love this tool. There is a feature I use a lot: you can write multi-step queries, select part of them and hit F5 to execute just that part. I haven't really dug into the CLI yet, but I imagine this to be less convenient there.
attilakun··on Many small queries are efficient in SQLite
It's already possible: https://dba.stackexchange.com/questions/203220/sqlite-what-i...
attilakun··on Many small queries are efficient in SQLite
This might help: https://dba.stackexchange.com/a/222271
attilakun··on I don't want to do front-end anymore
Rust does have syntactic support for async but that's not the only thing you need to use async. You also need an async executor runtime, for example tokio. This can cause all sorts of headaches in practice when you want to use libraries which rely on incompatible async runtimes.
attilakun··on Learn Quantum Computation
Consider how the number of states are calculated: If you have n qubits, at the time of making the measurements those can be in 2^n distinct (basis) states. This is similar to how in the classical case you can use n bits to express at most 2^n different states.

Which one of the basis states we end up measuring depends on the squared of the complex amplitude of that state (Born rule). Therefore, if you were to simulate a quantum computer, in the general case you would need to keep track of these complex amplitudes belonging to the states, every 2^n of them. Because of the real and imaginary parts this amounts to 2*2^n=2^(n+1) numbers.

attilakun··on Learn Quantum Computation
Granted, it's an oversimplification but I wouldn't call it a misrepresentation. It's one of the (arguably key) things that make quantum algorithms work.

To quote Nielsen & Chuang (section 1.4.2 on page 30):

> Quantum parallelism is a fundamental feature of many quantum algorithms. Heuristically, and at the risk of over-simplifying, quantum parallelism allows quantum computers to evaluate a function f(x) for many different values of x simultaneously. In this section we explain how quantum parallelism works, and some of its limitations.

Then they go on and explain how e.g. the Deutsch–Jozsa algorithm is a good example of this. But I think it's a key component in Shor's algorithm as well when it comes to the period-finding step.

attilakun··on Learn Quantum Computation
> The fact that an n-qubit quantum computing system is significantly powerful than classical system because of 2^n states. But, a classical system with n-bits will also have 2^n states, isn't it?

Let's consider the execution of an algorithm. In the classical case you start with _one_ of 2^n states and keep evolving that single state. In the case of a quantum computer you can start with a superposition of all of the 2^n states and evolve them simultaneously. This is called quantum parallelism.

This sounds very powerful but comes with a caveat: at the end of the algorithm you will end up with some other superposition of the 2^n states but you can only read one of them. Which one it is going to be will be decided by the square of the complex amplitudes associated with those states. The greater the squared amplitude, the more likely it is that you will end up measuring the state associated with it. A key requirement when a quantum algorithm is designed is that it should yield a useful state at the time of measurement with high probability. This is in general difficult to do.

attilakun··on Std::visit is everything wrong with modern C++ (2017)
What is the app if you don't mind sharing?
attilakun··on Universal Basic Income is Capitalism 2.0
Thanks! So for your prototype you need a new hardware design? Or can the idea be validated in Qiskit/Q#?
attilakun··on Universal Basic Income is Capitalism 2.0
I'm curious: what kind of quantum logic are you working on?

Can you elaborate on what grounds did your advisor disadvise you to follow academic schooling?

attilakun··on Einstein’s Thought Experiments
You don't send any classical bits in superdense coding. You start out with a pair of entangled qubits in the state |00>+|11>. Then, if Alice has the first qubit and Bob has the second, by manipulating the first qubit Alice can perform 4 actions:

1. Nothing, which leaves the combined state unchanged: |00>+|11>.

2. Flip the sign of the base state |11>, thereby changing the combined state to |00>-|11>.

3. Flip the first bit which changes the combined state to |10>+|01>.

4. Perform choice 3 and flip the sign of base state |10>, which changes the combined state to -|10>+|01>.

Now notice that all 4 possible combined states are orthogonal to each other. But we reached each orthogonal state by manipulating only Alice's qubit. When Bob receives Alice's qubit he can put the 2 qubits together and see which state the combined system is in. You wouldn't be able to do this by sending a classical bit as that can't participate in entanglement. And entanglement is needed to access 4 different orthogonal states via manipulating just one qubit.

attilakun··on Einstein’s Thought Experiments
If you are familiar with probability theory, think of it like this: whatever you do with an entangled particle, it will never change other entangled particles' marginal probability, only the joint.
← PreviousPage 2 of 3Next →