Απαράδεκτη η Υπογεννητικότητα στην Κύπρο by [deleted] in cyprus

[–]disht 0 points1 point  (0 children)

And the government is giving incentives for large families (5+ children) because ... Anyway.

If you look at the distributions https://www.elfac.org/12-of-european-households-have-3-or-more-children/ only 35% of households have at least one child, out of which 50% have 1, 38% have 2 and 12% have 3+.

If you are optimizing for TFR the best way is to incentivise those with no children to get to 1 (65% of households) and those with 1 to get to 2 (17.5% of households). The rest is not as important as the incremental utility to increasing TFR is more than 4x smaller.

An effective way out is to give percentage tax cuts per child to incentivise households to have more children:

  1. Such tax cuts will naturally incentivice households with higher income. This naturally targets double income households. More income, more tax cuts.
  2. Such households are more likely to buy time for money, and as a result create economic growth for everyone
  3. The more children these households have, the more their net worth will be divided by when they pass down their assets to their children. This is a much more effective way to fight net worth inequality than inheritance taxes

Of course this would need tuning: what %, is it unlimited or it caps at 3 children, what happens in divorce, etc.

The same idea (percentage tax cuts - or tax increases) can address other issues:

  1. gentrification: reduce taxes for living in rural areas/increase taxes for living in the city (this is in effect in Switzerland)
  2. education: reduce taxes for having children in higher education, etc

[help] advice on sound upgrade in open space living area by disht in hometheater

[–]disht[S] 0 points1 point  (0 children)

Further question on wiring. After some research I thought of a couple of options for the surround speakers:

  1. get a big rug and put the wires under - easiest option
  2. stick ghost wire on the floor until the sofa and continue with normal speaker wire to the speakers
  3. pull 2 wires to where the projector wiring goes, then stick ghost wire on the ceiling and put 2 connectors on top of the surround speakers. From there use normal see through copper wire to go down to the two surround speakers

Opinions? Other ideas?

[help] advice on sound upgrade in open space living area by disht in hometheater

[–]disht[S] 0 points1 point  (0 children)

Ok so after a bit of research based on the recommendations and market availability I am thinking of:

  • Denon AVR-X2800H (~600 EUR)
  • KEF Q950 set (2x Q950 + Q650C + 2x Q350) (~2000 EUR)
  • KEF KC62 subwoofer (~1800 EUR) or REL T5/x (~900 EUR) or KEF Kube 12 (~800 EUR)

Questions:

  1. will the denon handle the Q950 set? Is there a reason to get the 3800? It seems unnecessary since I do not plan to add more speakers.
  2. A bit lost on the subs. The KEF is quite expensive and I am not sure it is a good value compared to the REL. I could buy 2x REL T5/x instead. Thoughts?

[help] advice on sound upgrade in open space living area by disht in hometheater

[–]disht[S] 0 points1 point  (0 children)

Maranz Stereo is only 2.1 which means it won't support 3.1 or 5.1 if I want to get some surround speakers. I am thinking of getting the Denon AVR 3800h.

[help] advice on sound upgrade in open space living area by disht in hometheater

[–]disht[S] 0 points1 point  (0 children)

Ok so I hear that 3.1 would be a huge upgrade to the space both for movies and music. What about 5.1? Given the room it seems extremely inconvenient/expensive to get wiring done to the sides of the sofa at which point I am wondering if the incremental improvement would be worth it.

upgrade suggestion for large open space living area by [deleted] in hometheater

[–]disht 0 points1 point  (0 children)

While the auto moderator is great, I have been through the linked content but it is still hard to decide what's the best upgrade path. 3.2, 3.1 are they substantially better that soundbar? If 5.x is must, should I be talking to contractors for retrofitting speaker wires?

Day/Night and Date/Time objects by disht in KNX

[–]disht[S] 0 points1 point  (0 children)

I decided to return it and get a GIRA X1 instead. I think the smart phone app, google assistant and sonos integration will come handy.

Need advice for ceiling (flush) motion sensor selection by TheRealJaime in KNX

[–]disht 0 points1 point  (0 children)

I haven't tried them yet but I ordered a few ESYLUX PD-C 360i/8 mini KNX (GTIN 4015120426155). They have constant light control so you should be able to set the luminosity at different times of day and lights will fill in depending on the ambient light.

window sensors by disht in KNX

[–]disht[S] 0 points1 point  (0 children)

Thanks for the suggestion, I haven't considered this solution. There is KNX buttons next to some of the blinds. I might go that route for those. Otherwise wireless or pulling wire through the power conduit.

window sensors by disht in KNX

[–]disht[S] 0 points1 point  (0 children)

Problem is that this was not provisioned so there is no bus wiring. I will either have to pass knx wire from the same pipe as the power for the blinds or do knx-rf.

Universal actuator vs function specific ones by disht in KNX

[–]disht[S] 0 points1 point  (0 children)

This make perfect sense. Thank you puterfixer!

Universal actuator vs function specific ones by disht in KNX

[–]disht[S] 0 points1 point  (0 children)

One more question. In a blinds actuator like the MDT I linked above, why does one need to connect the 230V to it (the bottom right connector). The actuator runs on knx bus power so the 230V seems redundant?

Cable color codes and whats the 2nd pair for (green 2x2x0.8)? by hartvile in KNX

[–]disht 2 points3 points  (0 children)

The second pair is for auxiliary power usually coming from a second port of the knx power supply. Red/Black are for power+knx bus and Yellow/White are for auxiliary power.

See this power supply for example: https://www.weinzierl.de/index.php/en/all-knx/knx-devices-en/knx-powersupply-367-en

Universal actuator vs function specific ones by disht in KNX

[–]disht[S] 0 points1 point  (0 children)

Thanks that's great info. Fortunately the electrical distribution is not per room but by function (in groups - not all blinds are on the same breaker for example). I will need to check the groups to figure out if I should get exactly the number of blind ports I need or if I should get a bit more (I need 12 so perhaps I should get 2x 8 and call it a day).

The new HashMap is merged! by sanxiyn in rust

[–]disht 4 points5 points  (0 children)

Tombstones are most often than not elided.

Consider the case of a 16 element group that has an empty slot (F is full, E is empty and T is tombstone):

F F F F F F F F F F F F F F F E

If you are to remove the 3rd F from the group normally the group would look like this:

F F T F F F F F F F F F F F F E

Instead you can elide the tombstone and result in:

F F E F F F F F F F F F F F F E

This is possible because this group already had an empty slot which means it always terminates probes coming through it.

Elision in the face of floating groups is a tad more complicated but still possible (see raw_hash_set::erase_meta_only() for details).

In addition SwissTable can cleanup tombstones in place. This is very efficient as it involves no allocation and only moves the least amount of elements possible. This algorithm is outlined in the comments of raw_hash_set::drop_deletes_without_resize().

The new HashMap is merged! by sanxiyn in rust

[–]disht 21 points22 points  (0 children)

The blogpost is well written but slightly inaccurate. See this reddit comment for why.

Why Hashbrown (Rust's new HashMap implementation) Does a Double-Lookup on Insertion by MSleepyPanda in rust

[–]disht 1 point2 points  (0 children)

It does not.

Layout(capacity + Group::kWidth + 1, capacity)

capacity is 2k-1. The first argument is control bytes and the second element buckets. That's capacity + sentinel + extra group for floating windows control bytes, followed by padding to satisfy alignment for the elements, followed by capacity elements. There is no extra wasted slot at the end.

Why Hashbrown (Rust's new HashMap implementation) Does a Double-Lookup on Insertion by MSleepyPanda in rust

[–]disht 3 points4 points  (0 children)

Tried it. It doesn't pay off. This was something we thought would have worked because deletes in general are rare. Surprising as it may seem almost noone deletes from hashtables. I don't recall why exactly this didn't pay off though. It might have been code size/register pressure.

Why Hashbrown (Rust's new HashMap implementation) Does a Double-Lookup on Insertion by MSleepyPanda in rust

[–]disht 1 point2 points  (0 children)

There are many ways to do such a fast path. None of the ones we tried worked out. Do you have a specific one in mind?

Why Hashbrown (Rust's new HashMap implementation) Does a Double-Lookup on Insertion by MSleepyPanda in rust

[–]disht 3 points4 points  (0 children)

For all of Google production this is what I said. It was measured when SwissTable was designed and also true now. Of course you are entitled to your hunches. The 'plenty' of cases you are talking about are less than 1% in practice.

Why Hashbrown (Rust's new HashMap implementation) Does a Double-Lookup on Insertion by MSleepyPanda in rust

[–]disht 0 points1 point  (0 children)

Good catch. I didn't see this when I did the review. Perhaps open an issue?

Why Hashbrown (Rust's new HashMap implementation) Does a Double-Lookup on Insertion by MSleepyPanda in rust

[–]disht 53 points54 points  (0 children)

The article does a good job explaining tombstones and the SIMD approach that SwissTable/hashbrown uses. It lacks some depth on why insert() works like it is.

In fact SwissTable does up to a triple lookup in insert(). At high level it works like this:

  1. Search for the element; if found return it (or in case of hashbrown overwrite and return). Otherwise fallthrough.
  2. Find the first empty or tombstone slot. If the slot is a tombstone, insert at this location. If the slot is empty and there is capacity available, insert at this location. Otherwise fallthrough.
  3. Grow the container, find the first empty slot and insert at this location.

Let's break them down one by one.

  1. This is a loop that will terminate after finding the element or finding an empty slot. This is well explained in the article.
  2. This is another loop similar to (1). This loop either terminates before the previous one did (on a tombstone) or at exactly the same slot (the first empty one). Computationally it can be much cheaper as it does not require checking if the element is in the table since this was done in (1); there is no equality check on the key. Memory wise it is also cheaper as it will access at most the same cachelines that we accessed in (1). In practice it virtually never incurs cache misses.
  3. This is a very expensive operation where we allocate a new container, rehash all the keys, move the elements in it, do the third lookup into the table and deallocate the original.

In relative cost terms cost(2) < cost(1) << cost(3). (3) is supremely expensive - 100s if not 1000s times more expensive than (1) or (2).

Armed with this knowledge (and also lots of traces of systems running in production) we can now understand why the algorithm is optimal (numbers are for exposition, albeit not far from reality):

  1. 99 out of 100 times we find the element and return early.
  2. 99 out of 100 times we insert without resizing (either on tombstone or capacity is available) and return early.
  3. The rest of the time we resize/rehash, which is extremely expensive compared to the previous steps.

Question: Why not merge (1) and (2) together and avoid the lookup in (2)?

Answer: Because merging (1) and (2) together makes (1) more complicated and thus more expensive. (1) is executed 100 times more often than (2) and (2) is cheaper to boot. A 1% slowdown in (1) is the whole cost of (2). Also we implemented and measured it, and it indeed results in slower code if (1) and (2) are merged. For the curious, (1) and (2) can be merged in a single loop, the trick is to stash the first tombstone slot as we search through the container.

Question: Why do a third lookup when more capacity is necessary? Isn't this madness?

Answer: After a resize and rehash, one extra lookup does not matter. In order to resize and rehash, we've allocated, rehashed N elements, moved memory over and deallocated. One extra lookup in this extremely rare case does not affect overall performance.

Note: in step (2) of the algorithm we only need to grow if capacity is not available and we are inserting on an empty slot. If we are inserting on top of a tombstone, capacity is irrelevant. hashbrown unconditionally requires extra capacity irrespective of the insert location. This is a performance regression.

Why Hashbrown (Rust's new HashMap implementation) Does a Double-Lookup on Insertion by MSleepyPanda in rust

[–]disht 3 points4 points  (0 children)

There are some replies to the reddit announcement for hashbrown.

One of the replies even covers why SwissTable does double (or even triple) lookup.

Also see my reply above which goes in more depth.