HNHacker News
TopNewBestAskShowJobs

arithma

342 karma · joined March 6, 2012

submissionscomments
arithma··on What is the index of an empty string in an empty string?
The most appropriate behavior is implemented by regex.

Find the empty string and replace with say

  `($&)` 
where

  `$&`
refers to the captured variable, and with input

  `xyz`,
the result is

  `()x()y()z()`
With an empty input, the result is

  `()`.
The result of indexOf can consistently return the first index of the first half open subrange in a string. It just so happens that the first subrange of an empty string in an empty string is [0, 0).

The limiting case is also an interesting way to look at it:

  ()a()b()c()
  ()a()b()
  ()a()
  ()
arithma··on Tricking Monty Hall
I haven't done the analysis, but one major assumption that the whole result is based on is whether the rules of the game are pre-established or just revealed after the first pick. With an adversarial game host who has the option to reveal or not, maybe the result changes, but more importantly, it explains the intuitionistic refusal for some to buy the argument.
arithma··on Tricking Monty Hall
Are we siblings
arithma··on Introduction to Spherical Harmonics
Spherical Harmonics became extremely trendy in the graphics literature for dynamic lighting and pre-baked light maps of some sort, and completely dropped off at some point. Still remember some discussions and questions regarding how they're not easy to "orient".
arithma··on I’m a productive programmer with a memory of a fruit fly
I often don't comment code, especially in personal stuff, but when I occasionally do, which happens mostly when things get overwhelming, I find bugs or fix things that I was stuck on. Writing forces you to understand better, name better, and almost feels like providing you with another perspective, all without leaving your own self.
arithma··on I've been abusing HTTP Status Codes in my APIs for years
What I like about this approach is that if you are using any other protocols for transport, everything becomes instantly portable. Imagine having the same logic serving objects per IDs through HTTP and websockets. Rest makes things more clumsy. Though I would concede doing things the REST way, as in the app-server participating in the http headers/status enables caching and all sorts of things that would be hell to do through otherwise.
arithma··on Fastest-ever logic gates could make computers a million times faster
Interesting to think how many 10^6 faster gates would be needed to do the work of 10^9 at the same speed. Say take the 8086 and make it a million times faster. At about 30K transistors and 5MHz. A photonic 8086 apparently would run blindingly fast around anything available now.

Serial speed is always a gain up, no questions asked I guess.

Obviously all of that is over simplified, and not considering other components to any system that would be built (but hey, it's not like any of this is happening tomorrow anyway).

arithma··on “Computer science is not about computers”
Computer science is much more like Mathematics than Physics. It feels wrong calling "computer science" a science, in the same sense of calling "Mathematics" science.
arithma··on Backblaze Drive Stats for Q1 2021
In addition to the other mentioned reasons, I guess it's valuable feedback for their providers, and if that feedback is acted upon, it's beneficial for them.
arithma··on Bitcoin as a Battery
Bitcoin is more of ash rather than a battery in this analogy.

I like bitcoin (the idea, not the burning of the planet, even though it's only a temporary hack to bootstrap the whole thing). And hey, maybe it will encourage building nuclear mining farms, that will give their owners free bitcoin, and then we can use the nuclear plants.

The only defense I can stomach for Bitcoin's unfathomable energy consumption is that it might be only temporary. Is it worth it? So far, not that much, but I think developed-countries under-estimate the value of bitcoin, since they have more stable economies, and thus currencies, and enjoy freedom of moving their money, and data privacy...

arithma··on Draw an iceberg and see how it would float in water
I knew this was happening, but reading it, hey, maybe that's one way to get anti-gravity. Just loop the topology on itself. Obviously commenting in jest, but now I'm intrigued to see if someone has seriously considered this.
arithma··on C++ Is 9.4 Times Faster Than Python in Prime Number Test
C++ expression-power has increased considerably since C++11, and I believe, semantically, Prime Number generation in both C++ and Python could be python-line for c++-(line[s]) translated. C++ approaching the comfort and ease of use of Python is a worthy goal to reach. The flip side is well appreciated too (Cython, where Python can converge to C++ performance is noteworthy as well).
arithma··on The Dunning-Kruger Effect Is Probably Not Real
We all at least are dumber than we'd like to be. Nobody would refuse a pill that would make them smarter. Sorry for off-topic, but this has been gnawing at me lately, feels like something is a miss about my cognition, only very subtle, nothing to go for any kind of practitioner. Is there any route actually for giving the good old fat bucket a rattle to make it work back at original capacity? Have you ever tried anything?

I know this is off-topic, if it annoys anyone, I could take it somewhere else, but thought people interested in this article might have experimented or self-reflected.

arithma··on Bitcoin breaks above $20k
Just a question, isn't all criticism against bitcoin applicable to gold?

Money/Currency/Value in general can't be reduced or derived from first principles. You always have to take into account human nature, economic activity, and most unfortunately: psychology. So all criticism about how bitcoin inherently being pointless, sounds like off-tune. I want good reasons to/NOT-to buy in.

First-world country citizens kind of trust their governments to at least behave lawfully, or at least be eventually accountable. There are systems in place for transactions and accounting, and "everyone" has access.

The "Value" of bitcoin, coming from a struggling third-world country (Lebanon), is in the ability to be independent of a currency that is inflating quickly, being able to transact with the outside world (even if only in bulk) without being under the mercy of a failing financial system that is lurking around to take a share in every which way possible.

The energy consumption needs of bitcoin are an obvious drawback. But I don't think it's fair to brush away the whole thing for only that reason.

Disclosure: I own an embarrassingly small amount of bitcoin (~0.4BTC).

arithma··on Ask HN: What are some good methods to prove current time?
Reading something allows one to create a proof of being after. Writing something allows one to create a proof of being before.

Are there other ways of conceptualizing this problem?

arithma··on Compressionism: A Theory of Mind Based on Data Compression [pdf]
This kind of reminds me of the usual interview question: can you make a fair die from an unfair one.

Similarly, us as humans, could possibly have the ability to get over some/all of our distorted senses.

I am not talking about every day life here. It's in principle possible to deal with the logical fallacies that we're programmed with, but it requires effort.

What am more interested to convey is: our potential for objectivity is troubled with subjectivity. It is, however, not impossible on just the account of having subjective distortions. Those can be overrun.

There are many other similar analogies that come to mind, one that is prominent: digital systems made from purely analog ones.

arithma··on Ask HN: Is there still a place for native desktop apps?
From a capabilities point of view, they're native. You can access the OS api just like any other native app.

From a developer side, it looks like developing a webapp without the usual limitations of API access, albeit at an extra cost of marshaling or build-complexity.

There really is no reason to think of HTML/CSS/JS as Web only though.

arithma··on Timeline of the Far Future
Are there similar predictions but on a short time scale. Like from now until 10,000 AD?

Culture, technology, and geology (and hey, everything else, biology, astronomy..)

I find it hard to try and see what the future may hold, and it seems that is the case since we're at an event horizon of human culture change. Talks of singularity already having come upon us is relevant in terms of predictability to a certain extent, but I kind of feel comfortable to say that humanity will indeed stabilize in at most 5k years, since we're already hitting marginal returns in technology investments. There might be two more singularities that can unlock more unpredictability: AI and biology.

arithma··on Surprisingly Turing-Complete
This is definitely interesting, but there's always Javascript in the browser. It's turing complete by design, and it can and is sandboxed to a lot of success. The fast and quick conclusion that TC in itself is dangerous is not warranted, but when it's not intended, it can have unexpected consequences that might have some security, or other (stability) implications. That's what I take away from the article.
arithma··on Database Lab – Full-size staging databases as a service
A bit tangential, but this reminded of an idea I had when I was learning about containerization and overlayfs. Would postgres work with data stored in an overlay and allow a similar workflow?
arithma··on Software Disenchantment (2018)
Users don't know about this performance gap, but there is a gap, and that gap is an economic opportunity.

Since the current practices are so inefficient, users are having to pay for this from pocket as hardware expenses. Buy a $1000 smartphone, to get the same experience as last-year's.

A different stack (don't need to reinvent the universe), can be branded as brutally efficient, uses slim hardware, and strict engineering practices to provide a much better experience at a fraction of the price (1/5 possible.)

I believe nobody is doing that yet since there are two main barriers:

1- Risk of no-market (I think this might be proven unfounded, given the current trend in price hikes)

2- Capital investment necessary to get started (But this also can be solved given the obvious appetite for the next-big-thing money being poured left and right, without anything catching on yet)

arithma··on IncludeOS: a minimal unikernel operating system for C++ services
I think people confuse two important things. 1- Energy consumption of the lower stack versus total of a single implementation (could possibly be very low) 2- Energy consumption of the lower stack multiplied by everywhere it is deployed

1- Yes, optimizing for lowering this consumption by an app-developer can definitely be an ill-advised endeavor economically (you're saving 0.1-10% of your cost.. by adding a huge investment of time, possibly larger than the application development itself) 2- Optimizing across all deployments, can definitely move the needle, in a very significant way, against the effort required, since you're automatically deployed on 1000-1M places.

It's the same reason library developers (especially system/langugage/heavily-used-libraries) have a very good reason economically (and therefore ecologically as well) to optimize. Competition here is a huge benefit to everyone, including the environment.

arithma··on In Praise of the 5-Hour Workday and Other ‘Radical’ Ideas
If you spend 80 hours you're being inefficient. If you spend 20 hours (and they're being charged for value,) they feel they were deceived. Selling your hours to anyone truly seems like a lose-lose situation.
arithma··on PostgREST
"ORM" is more like a compiler, it takes one language/(api can be seen as a language) as input and outputs another language (SQL) as output.
arithma··on No Silver Bullet (1986) [pdf]
Can you elaborate on that just a bit, I couldn't find anything relevant by doing a quick search for a few combinations of those keywords.
arithma··on Interviews with programming language creators (2010) [pdf]
Which does not compile in C++ or C# :)
arithma··on VMware Acquires Carbon Black for $2.1B and Pivotal for $2.7B
Very tangential question that hit me while reading the comments: Is the current scenario possible: company A owns 10% of company B, and company B owns 10% of company A. Does that mean getting the valuation of both companies require solving algebra? Or is this outright prevented by other methods, like the board of A owns most of A and 10% of B?
arithma··on 'Matrix 4' officially a go with Keanu Reeves
I hope Matrix 4 explores how Neo expresses disgust with humanity, as in, becoming more like Smith, and Trinity now kills him. Anything that continues the saga with a goody-two-shoes Neo at this stage is... boring. He's too powerful not to be a villain?
arithma··on “Wealth work” is one of America’s fastest-growing industries
If an AI is doing it, maybe, but it also has to be unhinged from all of the people programming it or owning it. That was unthinkable until recently.
arithma··on Why is modern web development so complicated?
Everyone expects the frontend to be easy, especially non-engineers: "hey, it's just a box, and you can just resize it and center it just that way..", while non-engineers would just move away when you mention thread/concurrency/parallelism.

The outside perception, I am afraid, affects me. I don't want to be stuck all the time doing things that are equally hard, but much less appreciated.

I have a lot of respect for frontend development, and approach it with the same kind of caution and respect that I do the backend stuff, however that is not always appreciated, and since it can get complicated fast, and people are expected to finish quickly as if on a treadmill, those things get messed up, hacked, and brittled up.

Another analysis paralysis issue with frontend is cost/benefit for doing it "right." Since frontend is a leaf and not the dependency of another layer in the application, it becomes dispensible to a certain extend in some scenarios. It is seen as replaceable and not worth spending a lot of time on. So when working on frontend, second guessing whether it will be scrapped off later is always hanging in there, paralysing you between "engineering" mode, or just give it a quick hack.

I would not dread doing frontend development, if allowed to do things correctly.

Page 1 of 6Next →