HNHacker News
TopNewBestAskShowJobs

twawaaay

3,192 karma · joined June 9, 2022

submissionscomments
twawaaay··on SQL Maxis: Why We Ditched RabbitMQ and Replaced It with a Postgres Queue
I do agree, but listen... this is supposed to be handy solution. You know, my app already uses MongoDB, why do I need another component if I can run my notifications with a collection?

Also, I am firm believer that you should not put actual data through notifications. Notifications are meant to wake other systems up, not carry gigabytes of data. You can pack your data into another storage and notify "Hey, here is data of 10k new clients that needs to be processed. Cheers!"

The message is meant to ensure correct processing flow (message has been received, processed, if it fails somebody else will process it, etc.), but it does not have to carry all the data.

I have fixed at least one platform that "reached limits of Kafka" (their words not mine) and "was looking for expert help" to manage the problem.

My solution? I got the component that publishes upload the data to compressed JSON to S3 and post the notification with some metadata and link to the JSON. And the client to parse the JSON. Bam, suddenly everything works fine, no bottlenecks anymore. For the cost of maybe three pages of code.

There is few situation where you absolutely need to track so many individual objects that you have to start caring if they make hard drives large enough. And I managed some pretty large systems.

twawaaay··on SQL Maxis: Why We Ditched RabbitMQ and Replaced It with a Postgres Queue
Which is fine, queueing systems can't store infinity of messages either. In the end messages are stored somewhere so there is always some limit.
twawaaay··on SQL Maxis: Why We Ditched RabbitMQ and Replaced It with a Postgres Queue
MongoDB's change stream is accidentally very simple to use. You just call the database and get continuous stream of documents that you are interested in from the database. If you need to restart, you can restart processing from the chosen point. It is not a global WAL or anything like that, it is just a stream of documents with some metadata.
twawaaay··on SQL Maxis: Why We Ditched RabbitMQ and Replaced It with a Postgres Queue
As much as I detest MongoDB immaturity in many respects, I found a lot of features that are actually making life easier when you design pretty large scale applications (mine was typically doing 2GB/s of data out of the database, I like to think it is pretty large).

One feature I like is change event stream which you can subscribe to. It is pretty fast and reliable and for good reason -- the same mechanism is used to replicate MongoDB nodes.

I found you can use it as a handy notification / queueing mechanism (more like Kafka topics than RabbitMQ). I would not recommend it as any kind of interface between components but within an application, for its internal workings, I think it is pretty viable option.

twawaaay··on Why is sea level rise worse in some places?
Except water in oceans is at 4C (at least almost everything deeper than ca 200m). And in the vicinity of 4C the thermal expansion is very negligible. This graph should explain why: https://images.app.goo.gl/FXzvTkPvE9dYxoUA7
twawaaay··on Why is sea level rise worse in some places?
Not true.

First of all, most of the temperature rise only happening close to the surface with average surface temperature rise being only about 1.5F or 1C since 1901.

This article says deep ocean water is projected to warm up by only 0.2C during next 50 years: https://www.openaccessgovernment.org/deep-ocean-warming-subt...

Furthermore, at around 4C which is what deep ocean water is close to (everything below 200m is essentially 4C), thermal expansion is almost nil. For colder water thermal expansion is actually negative.

4C is when water is at its densest. It is not an accident that all oceans are 4C, because 4C water sinks to the bottom and anything colder or hotter than 4C floats up. This remarkable property of water is what causes even shallow water to be fantastically stable in temperature -- a lake that has more than couple tens of meters in depth is likely to be 4C at the bottom throughout the year whether it is frosty winter or hot summer above it, unless some kind of powerful event is able to mix the water in the lake.

Now, the small temperature differences will definitely have outsize effects on water circulation, ocean currents, life and weather. But I doubt they will cause meaningful sea rise unless somebody can calculate otherwise?

twawaaay··on I worked at Google for -10 days
I fail to see the reason for why ban on revoking offers would cause 2x more interview rounds.
twawaaay··on Why is sea level rise worse in some places?
There is only one reason the sea can rise currently due to weather and that is glaciers getting melted.

Another reason (but not due to weather) is that when land somewhere goes up, it will displace water everywhere else. And so, for example, if the land is still recovering from the ice age we should see ocean levels going up everywhere except for the pieces of land that are recovering from the weight of the glacier that is no longer there.

Mind that Arctic is not causing sea level rise. Any ice that is floating on water will not cause any water level change when it melts. (I know this is somewhat unintuitive but it comes directly from Archimedes principle)

So we are talking basically Antarctic ice and Greenland because these are by far the largest bodies of frozen water that are supported by land rather than floating on the ocean.

I think it should be pretty easy to observe how much of that water melted or slipped into the sea.

I also think that currently, coastal erosion is mostly caused by changing weather patterns. Basically this comes down to wind blowing in different directions, speed and variety and these changing patterns mean coasts are eroding in different places than before.

twawaaay··on Problems with AWS Amplify and its use of DynamoDB
I would add a bit of my own experience.

Products like this are great. But if you already know the technology, know what is happening and you are using it to basically eliminate a bunch of coding or setup tasks that you would have to do.

The problem this is only great for a certain type of knowledgeable developer who is also setting up the system.

The next person that comes or a junior developer who does not have grasp of the underlying tech will just see a bunch of magic. But he will be required to be productive with it.

So if the original devs leave and don't get people with grasp of the underlying tech, the new people will start accumulating technical debt at an ever faster rate without ever being able to pay it back. Because with so little knowledge and expectation of performance, whenever something small happens that requires you to learn stuff you will skip learning and just move stuff around hoping some random change will fix it.

So I will amend my original statement:

"Products like this are great." But only if you are working on the project alone and don't expect anybody else to join it in the future.

twawaaay··on Exploring nine simultaneously occurring transients on April 12th 1950 (2021)
Great. Here: https://en.wikipedia.org/wiki/Dark_forest_hypothesis
twawaaay··on Exploring nine simultaneously occurring transients on April 12th 1950 (2021)
Ups. "Dark forest" comes to mind...
twawaaay··on Perennial rice: Plant once, harvest again and again
I am not convinced (I grew up on a farm).

It is usually harder to get rid of any weeds when your crop is growing on the field. After harvest, you just get rid of everything, turn the soil (but I don't know anything about rice farming) and you kinda get a fresh start.

ON THE OTHER HAND, we already have robots that can easily identify weeds with a camera and zap them with lasers or other shit. Which just seems so much more reasonable in the near future than trying to harvest individual rice grains off of a perennial plant that cannot be damaged so that the plant can provide sun cover to prevent weeds... just not seeing it.

Also, Chinese harvests rice up to three times a year. And the harvest itself is much easier if you can grab entire plants. So I am not convinced anybody is going to get interested in it.

twawaaay··on Perennial rice: Plant once, harvest again and again
I know Chinese harvest their rice up to three times a year. I don't see how perennial rice could compete.

Harvesting normal rice is just grabbing entire plants, as many as you can grab at a time. I may know nothing about how harvesting perennial rice is supposed to work, but I grew up as a farmer and I have imagination. You have to leave some part of the plant for it to keep growing crop which means you can't just grab it all. And I think this is a deal breaker.

It just does not make sense to get even more labour intensive plant at a time where labour in all parts of the world that grow rice becomes suddenly so much more expensive.

So until they figure out to build robots that can individually pick rice grains off of a tiny, fragile rice plant, I am not seeing any future for perennial rice.

twawaaay··on Wikipedia’s “Supreme Court” to review Polish-Jewish history during WWII
No conflict here. You can own a piece of art that is racist or antisemitic without being racist or antisemitic.

Also, in certain parts of Poland antisemitism is so pervasive that it is basically part of local folklore. So you try to go read children's book and there will be a Jew in it trying to steal kids money... and nobody thinks twice about it just like nobody questions stories about a fat guy wearing red suit flying around dropping presents.

twawaaay··on Wikipedia’s “Supreme Court” to review Polish-Jewish history during WWII
Sure. A person singing a racist song might just be liking the song and not thinking twice about it. Doesn't change the fact the song is racist.
twawaaay··on Wikipedia’s “Supreme Court” to review Polish-Jewish history during WWII
So the way antisemitism here works is pretty much the same way it always did. The same way Nazis used.

People assign certain qualities to Jews. They repeat the same ad nauseam in jokes, in caricature, etc. Rather than treat Jews individually, antisemites tend to treat them in a way that dehumanises them -- which is a move that makes further antisemitism easier. You see, dehumanising is about disconnecting your empathy, about not seeing "them" as individuals but as a class of people that you can assign to qualities you hate.

Also there is a reason Nazis hated Jews so much. The whole goal was to find a way to be able to make people do things by finding a common enemy that will be easy to vilify. And Jews were already pretty common (everywhere in Europe), easy (no own government) target and already with pretty poor sentiment. No, Nazis did not invent antisemitism.

The funny thing about all this is that historically Jews were prevented here from many trades and, out of necessity, they took up certain professions connected with finances because they just couldn't do much else. Because of this Poles formed this connection between Jews and money and greed while completely forgetting that it was the governments at the time that caused this.

twawaaay··on Wikipedia’s “Supreme Court” to review Polish-Jewish history during WWII
The "Jew with a Coin" is antisemitic. The coin is used in this case to symbolise greed which antisemites here automatically assign to all Jews. (I know, I am a Pole)
twawaaay··on Jim Simons Trading Strategy Returned 66% Annually
There are strategies that seem to work but are burdened by a fundamental problem -- they just shift the risk. They bring steady results until an event happens that causes huge amount of loss.

As a risk guy I can tell you basic thing about risk: risk is cost. One way to make people miss an obvious large cost is if there is low risk of something happening but very large loss associated with it.

Ideally, you want to invest in things that have relatively known and quantifiable risks. Because that's pretty much a prerequisite to making an actual, informed decision. If there are large, unquantifiable risks then you are simply gambling.

As an obvious example of illusory returns, if you talk to your friend who has "invested" in a pyramid scheme they will tell you how fantastic and steady returns they are getting. You might decide to invest yourself and you will also probably see steady returns. Until the whole thing crashes down and, on average, everybody will lose.

twawaaay··on Jim Simons Trading Strategy Returned 66% Annually
I don't doubt it. (For background, I worked with financial risk and algorithmic trading and are now doing my own investments.)

You can create strategies that return well above the market average. But there are caveats:

* You have to know something nobody else knows. The moment a strategy becomes public it stops being effective. By very definition, everybody can't be reaping well above market average... And there is a huge number of very, very smart and very, very motivated people backed by very, very large pools of money thinking about this problem.

* Ability to test strategies on past data is very limited. When you come up with a thousand strategies and find out one of them works very well with historical data -- that's exactly what you found. A strategy that works with historical data -- not necessarily with future trading conditions. Also at some point your trading starts affecting the market and that cannot be simulated with historical data.

For anybody thinking about investing their own money I can highly recommend ignoring any complex financial products and just buy shares of companies that you think are going to be doing well in the future, that you think are undervalued at the moment and you have knowledge and experience to understand their business. Please, do yourself a favour and read "The Snowball: Warren Buffett and the Business of Life".

twawaaay··on Mindset shifts for functional programming (with Clojure)
Again, the ultimate goal is to make the code readable (without sacrificing too much other qualities like performance).

When you have a language and context that makes recursion easier to understand than loop -- go for recursion.

One other reason to go for loops is to make sure you control the stack. With recursion it is not always immediately clear that the loop is going to get tail call optimisation. And good 9/10ths of developers meet me with a blank stare when I mention it. At least with a loop it is clearly visible how much space and in what way you are allocating. I had one dev who said he likes recursion because he says it is more memory efficient. To which I had to point out that each level of recursion creates a new stack frame. The guy just wasn't aware of it...

twawaaay··on Mindset shifts for functional programming (with Clojure)
Your question was, and I quote:

> is there actually any chipset with the algorithmic ability to add more than 2 numbers altogether in one operation (without having to store intermediate results)

I was just answering your question. I am not responsible for quality of your questions.

What you do is you posted a question but had something else in mind. You got an answer but that answer does not match the question you had in your mind so now you think it is ok to berate somebody for not being able to read your mind.

twawaaay··on Mindset shifts for functional programming (with Clojure)
Chips have ability to run vector operations that can add a bunch of numbers.

The issue is that recursion in software development is relatively rarely about arithmetic operation. For example, you might want to traverse a tree of objects (like a filesystem folder) to run some operation on them, etc.

In this case the intermediate information is pointers to where you are currently processing various folders in your tree structure, etc. In a loop you would have to create a data structure to hold these. In recursive function this would typically be spread in multiple frames on your stack pointing to objects in your heap.

twawaaay··on Mindset shifts for functional programming (with Clojure)
I don't understand where you come from with your argument.

Recursion is also producing results that are "wrong answers" although I prefer to call them partial results. Just like a loop that is producing partial results as long as it has not finished yet.

twawaaay··on Gaia's first black hole discovery: GAIA-BH1 (2022)
If you are looking if something is "surprising" then it is not surprising, by very definition.

We know BHs should be pretty common. Earlier generations of stars were composed of larger and more short lived stars (due to their low metallicity) that should mostly end up as black holes.

As to detecting gravitational microlensing it is not as easy as it sounds. A black hole remnant of a star will be microlensing the light just like a star -- only without very visible reason for the microlensing to be happening.

In practice what you would see is when a black hole moves in front of a star that star's light is suddenly magnified without any good reason. It is one time event, it is rare and afterwards there is nothing else to study. These types of events tend to be very hard to capture because they require you to look at entire sky all the time.

twawaaay··on Mindset shifts for functional programming (with Clojure)
> Transformations over Instructions

Hell yeah! The problem with "functional" programming is that a lot of people simply don't get you want to push as much of your program to be generic tools that transform things (ie FUNCTIONS!) When I start on a new problem I typically look at what kind of tools (functions) would make the solution concise and readable. Then create the tools and then write the solution with the tools.

Unfortunately most developers come with preconceived notions of how the program should be laid out and what the development process should be. If they come from OOP world, you will see code that pretty much looks like objects just without OOP machinery. If they come from scripting/procedural then you will see long stretches of instructions just split into smaller "functions".

> Recursion over Looping

Recursion is elegant but it is also hard to understand for many people. I object putting anything into code when the only purpose is making the code look elegant / more advanced at the cost of narrowing audience that can effectively work with it.

My goal is to make the code stupid simple. My main challenge is preventing my ego from trying to impress the reader.

Frequently recursion is more readable than looping. I don't hesitate using recursion in that case. But I make sure that the reader should be able to instantly recognise the pattern and the pattern is not too complex.

Another thing to push recursion to be more manageable is just structuring your code to extract recursion from everything else. Make one or two very small functions that are only responsible for recursion, extract all other logic into other functions that are meaningful on its own (and just happen to be used in recursive context).

If the recursion would be too complex, usually iteration is going to be easier to represent the solution in manageable chunks without requiring the reader to take everything in in one go.

twawaaay··on Ask HN: What lesser-known accessories do you use with your computer?
Toslink switch. A kind of device that can switch a path between multiple inputs and multiple outputs. Mine has 4 inputs and 4 outputs and a remote that lets me select current input and output separately with two button presses.

My inputs:

- laptop with external Behringer audio interface with optical output,

- bluetooth receiver/transmitter with optical output

- PS4 (through toslink output)

My outputs:

- DAC (with optical input) into headphone amplifier into headphones

- "large" amplifier (with optical input) for my bookshelf speakers,

- bluetooth receiver/transmitter with optical input

The bluetooth receiver/transmitter is a funny device that can perform one of two roles and has separate remote to toggle. It is connected to the switch twice, once for output, once for input. I use this to send signal to up to two pairs of bluetooth headphones (for example for watching movies on external monitor). I also use this to capture output from my phone or laptop when the laptop is not connected to the docking stotion.

What all this does is it allows me to send any listed input to any listed output, except bluetooth into bluetooth -- that device can only operate in one selected mode. For example I may play PS4 on my speakers and with one button press send it to my bluetooth headphones or my wired headphones. Or I can use my bookshelf speakers with my laptop on my lap. Everything without connecting any cables at all -- just up to three presses on two remotes.

I had non-optical solution before but this caused a lot of interference. Rather than try to debug and fix this I decided to just not have any copper between devices. Optical cables fixed it all for me.

twawaaay··on Apple halted M2 chip production in January amid 'plummeting' Mac sales
I think the answer isn't that simple. It depends.

For me my M1 Macbook Pro has the following pros:

* It just works. I detest Windows. I love Linux but lately I started spending too much time maintaining it, I have busy life and decided that taking care of my OS is a luxury and I would rather use something that is acceptable than spend a lot of time getting to perfect.

* It is viable powerful workstation. I just connect it to a good docking station and have a nice setup with two 60Hz 4k monitors. It is silent and usually cold while in this setup. And it is surprisingly (and I mean it) powerful.

* It has gorgeous display. For hugging together and watching movies with my kids and wife.

* It is a status symbol. All people at my company who mean anything have one and it is easier for me to just fit in and pick other, more meaningful battles.

* It is durable. It will last me a long time, hopefully. It is true that it is fragile, but it is mostly fragile in certain ways that I can manage around. I am generally gentle and caring about my gadgets. If I don't kill it in a stupid way there is good chance it will be perfectly good working laptop for many, many years to come. I can hand it down to one of my family while I get a newer machine.

twawaaay··on Reducing Iron Oxide with Ammonia: A Sustainable Path to Green Steel
I also think so. Rather than move hydrogen, move the electricity or the iron. Produce hydrogen on site and even on demand to get rid of most of the need to store/transport it.

As to cost, who can quantify me the risks of having and transporting so much ammonia?

twawaaay··on Former Hiroshima Branch of the Bank of Japan
From a purely moral point of view, I don't think the morality of the decision to drop bombs on cities is in any way influenced by what actually happened after. It is only influenced by what happen up to this point and knowledge allies had at that time.

Hindsight is 20/20. We do know that it was expected that Japanese will be fighting to the bitter end and it will be difficult to get them to capitulate. But it is not possible to predict the future exactly -- who is to say that the same course of action could not happen after a powerful demonstration without actually dropping bombs on large cities?

If you start taking future as excuse for the past you could come to some extreme conclusions.

twawaaay··on Former Hiroshima Branch of the Bank of Japan
I think it would be more accurate to say that the US government notified Japanese government but nobody expected the warning to be taken seriously.

I personally believe doing this is morally no different from just dropping the bomb without warning. Because nobody expected the warning to be taken seriously. Because there was no precedent, because the bomb was developed in complete secrecy, because there was no proof or demonstration to the Japanese government that the claim is real for them to take it seriously.

It is essentially just looking for an excuse for your actions without really honestly trying to avoid using the bomb and deter your enemy. There is a lot alternative ways US could use those bombs without dropping them on densely populated areas.

They could drop it on an unpopulated area and tell "we have more of these". They could drop it on any military installation or grouping of forces that is a bit further away from a populated city. They could explain they have the bomb and invite a representative for a demonstration.

At this point Japan had no capability to prevent US from overflying its territory so it is not like Japanese could do anything to prevent the bomb dropped. Knowing a bomb so powerful was developed and ready they would have no choice but surrender.

Instead US chose to send a signal to everybody at the cost of tens of thousand of lives that were lost only for the purpose of making that signal so much more powerful.

Telling Japanese to evacuate was really completely meaningless move with no moral implications.

← PreviousPage 2 of 25Next →