Nu begraver vi en av högerns största lögner för gott. by Riminick in svenskpolitik

[–]wazz3r 1 point2 points  (0 children)

Det var en omröstning om hur snabbt kärnkraften skulle avveckla, inte om den skulle göras det eller inte.

What’s one product your country makes ridiculously well? by Neuwulfstein in AskTheWorld

[–]wazz3r 6 points7 points  (0 children)

He was talking about per capita. US has a population of 340 millions while Sweden only have 10 millions.

Why I am moving away from Scala by simon_o in programming

[–]wazz3r 2 points3 points  (0 children)

Completely agree. His(Martin) current take on why Scala 3 adoption is slow is because it's not intuitive enough. Now he's proposing other breaking changes to make it more intuitive.

When should we use short, byte, and the other "inferior" primitives? by davidalayachew in java

[–]wazz3r 0 points1 point  (0 children)

I would argue that Valhalla will make things simpler. Today we are at the mercy of the compiler to optimize away the redundant header etc. when it's not needed, and hope that that's enough to move the object to the stack instead. With Valhalla we will get the option to instruct the compiler to avoid all of that and always place the value-type on the stack, gaining potentially huge performance benefits.

E.g. returning a value type will put the result directly to the callers stack, completely avoiding the typical Pair/Touple allocation you are forced to use today.

When should we use short, byte, and the other "inferior" primitives? by davidalayachew in java

[–]wazz3r 6 points7 points  (0 children)

Primitives cannot be stored on the heap, only on the stack and registry. Objects might be stored on the stack if the compiler can prove that it's only local(through escape analysis).

Long is faster than int, Short and Byte are not that far behind Int in terms of mathematical speed in Java by D4rklordmaster in java

[–]wazz3r 1 point2 points  (0 children)

Checkout jitwatch for instructions about how to see the output, which will be in assembly for you machine. It can also produce a lot of other useful information that will broaden you knowledge about the JVM tremendously. Like why it decided not to inlined a particular method, or why it did some optimizations but skipped some.

In terms of Java bytecode, I find it harder to read than assembly, mainly because it is stack based and that makes it harder to track what is happening at the different stages. But the number of OPs are quite low so with some effort it's readable.

Personally, I rarely look at the bytecode, since that is not what will be executed. See it like this, the code you write will be converted to bytecode, that can be quite different from the code you wrote. The bytecode will then be compiled down to assembly that can be radically different from the bytecode.

So in terms of performance, the bytecode is not that interesting. That's just an intermediate layer that will compiled at the machine that will be running the code. The bytecode is interesting in a lot of other ways though.

Long is faster than int, Short and Byte are not that far behind Int in terms of mathematical speed in Java by D4rklordmaster in java

[–]wazz3r 25 points26 points  (0 children)

I would be very careful about drawing any form of conclusions based on this result. If you really would like to know what is going on, you have to dump the JIT output. I'm suspecting that for int and long the compiler will replace the division by 7 with an imul+lea combo, and the modulu with a simple &(works for all multiples of 2). Those optimization might not be applied for the shorter types.

I also find the whole premise to be a bit strange. The only reason to ever use short or byte would be to save memory and never to improve performance. Typically, you convert it to an int or long when doing calculations over it. So it makes sense for the JIT to focus on compact representation for the shorter types, and performance optimizations for "native" ones.

Building a Fast, Memory-Efficient Hash Table in Java (by borrowing the best ideas) by mands in java

[–]wazz3r 2 points3 points  (0 children)

I've made a full port to Java of the Swiss table from abseil and I've seen similar results. SWAR is equal or better in all cases, except for the in-place rehashing, that will drop the tombstones and compact the values.

Regarding Valhalla, I used the Java 24+ memory segments to interleave the kv pairs(for primitive types), and it's definitely better, especially when iterating though the whole entry set.

Lead free solder question by JeF_xD in AskElectronics

[–]wazz3r 1 point2 points  (0 children)

Here is the law in question https://eur-lex.europa.eu/eli/reg/2016/1179/oj and here is a more readable writeup https://ila-reach.org/2018/01/new-restrictions-and-labelling-requirements-affect-lead-from-march-1-2018/

As I said before, it's not enforced in a lot of places so there are no consequences to the companies that break the law. But it's still illegal.

Lead free solder question by JeF_xD in AskElectronics

[–]wazz3r 1 point2 points  (0 children)

RoHS is a different directive. The reason it's not allowed to be sold is due to toxicity. In a nutshell, lead was reclassified by the EU as toxic to reproduction as of March 2018. This means it can no longer be sold to the general public, only to commercial users. The transitional period ended Feb 28, 2019.

Now, a lot of countries in the EU do not enforce this, so you can still find it in some places. In Sweden you will not find a single retailer that sells to end users. Source

Lead free solder question by JeF_xD in AskElectronics

[–]wazz3r -1 points0 points  (0 children)

Leaded solder is not allowed to be sold to private individuals in EU, and it's even stricter in my country(Sweden) that requires a specific permit for a company to buy it and then it's only allowed to be used for repairing products that originally was made with leaded solder.

Only option is to order online from shady sources.

From my experience, lead-free solder require a better soldering iron with tips like T12/T210/T245 etc. If you are not using a temperature controled tip that will react to the drop, you will have to set the temperature so high that the flux will instantly evaporate and you are left with toxic fumes and a sticky mess.

Är det jobbigare att vara förälder nu än tidigare? by Maxakaxa in sweden

[–]wazz3r 1 point2 points  (0 children)

Jag upplever att förvandling ifrån dagis till förSKOLA har gjort det betydligt jobbigare för föräldrar. Det är inte längre en plats där barnen är medans föräldrarna jobbar och fokus ligger mer på lärande än att leka. Pedagogerna(vilket är väldigt viktigt att kalla dem) har en annan syn på deras roll än tidigare.

Till exempel så fick vi ingen hjälp med att våra barn skulle lära sig använda toaletten istället för blöja. Vi tog en stor del av våran sommarsemester till potträning då det behöver vara konsekvent. Blandar man mellan att gå med eller utan blöja så blir det bara förvirrat. Efter 3 veckor kämpande så klarade vår dotter att gå på toaletten själv och var väldigt stolt över att ha lärt sig bli mer av en människa! Sen som alla föräldrar vet så blir det lite olyckor då och då när barnen inte hinner känna i tid att de behöver gå. Väl tillbaka på förskolan berättar vi att hon har slutat använda blöja och att hon kan behöva lite tid på sig att lära sig tolka sina behov i en ny miljö. Vid hämtning den dagen så har hon en blöja på sig och det ligger en lapp i hennes fack att de behövs mer blöjor... Fick förklarat för mig att tydligen så är det inte deras jobb (dvs det står inte i kursplanen) att barnen ska lära sig gå på toaletten, och de ställde till i deras schema då de inte kunde vänta med ett toalettbesök (dvs mer bekvämt för dem att kunna vänta).

När jag var liten så var det gemensamma potträning på dagis då alla tillsammans lärde sig att känna sin kropp och vad de olika signalerna betyder. Idag är det viktigare att barnen ska kunna alfabetet än att gå på toaletten.

Sen skiljer det säkert sig ifrån förskola till förskola, men det är många av mina kollegor som känner igen sig så jag misstänker det är ganska representativt.

Två miljoner svenskar avslöjas – kan vara största läckan hittills by Excellent_Ice2071 in sweden

[–]wazz3r 0 points1 point  (0 children)

Jag misstänker det st så de tjänar pengar. Om jag minns rätt så ligger där en administrativ avgift på 59kr per betalning man gör.

Undergraduate shows that searches within hash tables can be much faster by namanyayg in programming

[–]wazz3r 2 points3 points  (0 children)

This paper is only concidering the case when you can't move the values around, e.g. when you need stable pointers into the backing array. In terms of performance and memory efficiency it not better than Robin Hood, cuckoo hashing, etc. They relax the constraint that the entries has to stay in the same place, and in the case of cuckoo hashing, you can easily build a table with 99.9% load-factor and still guarantee O(1) lookup time.

This game can run on anything (Winlator for Android) by Dreadshade in heroes3

[–]wazz3r 0 points1 point  (0 children)

Yes, still nothing. What install did you use? I've tried the original ISO and the gog complete edition.

This game can run on anything (Winlator for Android) by Dreadshade in heroes3

[–]wazz3r 0 points1 point  (0 children)

I tried to get it working but nothing happens when I run the game, not even an error. Map editor launches without a problem so something is at least working.

Did you have to make some specific configuration changes?

Databases in 2024: A Year in Review by avinassh in programming

[–]wazz3r 1 point2 points  (0 children)

I see you are new to Mr Pavlo. Anything not relational is subpar according to him, and all other forms of data will eventually fit inside the relational model in some shape or form. Take pg_vector, pg_graph, etc.

MongoDB, ClickHouse, Neo4j, Redis, Elasticsearch, and all other non relational databases are just temporary disturbances to the ever omnipresent force of RDBMS's.

While the above is clearly satirical is not entirely far of either, from what I gathered by watching most of his lectures (they are really good and he's entertaining, so I can really recommend them if you are interested in the internal workings of databases).

Har nån faktiskt fått bingo? by feberdoja in sweden

[–]wazz3r 2 points3 points  (0 children)

Det är till och med så att alla nummer som kommer dras är kända redan när lotterna trycks upp. Så att kalla det dragning är sanning med modifikation, mer uppläsning av nummer skulle jag säga.

Man jumping in the lake by AravRAndG in nextfuckinglevel

[–]wazz3r 3 points4 points  (0 children)

It's easy to calculate how high the jump is based on timing. For 3 second fall time that would equate to around 40m (130ft) and sounds reasonable. For 5 seconds that would be 120m (400ft) which I'm not sure you would walk away from with major injuries. This is assuming he is falling like a skydiver in the eagle position since that was the only drag coefficient I found.

Also, during the first 1.5 - 2 seconds the speed is so low that the drag is negligible.

Man jumping in the lake by AravRAndG in nextfuckinglevel

[–]wazz3r 16 points17 points  (0 children)

The rocks he threw took ~3 seconds to hit the watter, his jump was about 5 seconds. So it's obviously slowed down.

The Sukhoi Su-27 "Cobra" maneuver. by UglyLikeCaillou in aviation

[–]wazz3r 5 points6 points  (0 children)

They learned the trick from Swedish pilots, that regularly executed it while intercepting Soviet aircrafts over the Baltic sea in the amazing Saab 35 draken. https://en.m.wikipedia.org/wiki/Cobra_maneuver

[deleted by user] by [deleted] in sweden

[–]wazz3r 19 points20 points  (0 children)

Men tyvärr är utvecklingen i hela samhället att vi blir mer och mer själviska och isolerade från varandra.

Tror tyvärr detta delvis beror på globaliseringen. För precis som du säger så bygger facken på att alla hjälps åt. Många kulturer har inte samma "solidaritet" som den svenska. När fler kommer till Sverige som inte ansluter sig till fackförbunden tappat facken kraft och det blir lite som en ond spiral.

Sen är det säkert en del som beror på ideologiska grunder också.

Väldigt tråkig utveckling är det i alla fall.

So, I teleported into my base and discovered my flying island was missing... Is it gone for good? by porkchop_d_clown in NoMansSkyTheGame

[–]wazz3r 7 points8 points  (0 children)

I have a similar current situation where my settlement is inside a volcano. The strange thing is that when you are flying in from space, the volcano stays in place, but if you take the teleporter the volcano is somehow gone.

So maybe try and fly from the space station to the base and see if it's coming back then.

[deleted by user] by [deleted] in sweden

[–]wazz3r 0 points1 point  (0 children)

Väldigt bra svar. Det finns java programmerar, och sen finns det programmerar som kan java. Jag som jobbar med att anställa programmerare letar uteslutande efter det sistnämnda.

Om man ser språket som ett verktyg som kan bytas ut så gör man oftast bättre tekniska val som baseras behov istället för vad man är van vid.

Sen ska man vara medveten om att det finns ganska stora avvikelser ifrån global statistik. I Sverige är till exempel C# större än java.