Show more

@hj haha yeah that is a simpler explanation I could have used

@Moon you can set up barriers like “until now this has been any, from this point onwards I am declaring that I know it to be X” and vice versa at pretty much any point of the code, but modules are an especially good start, as with TS you often also declare and import types, which fit naturally into the other imports of the module.

@Moon ts is the way, but very often the default config is too strict to switch into from an existing js project. Change the settings to, for example, allow for implicit any, and re-enable them when you refactor the code.

@hj AFAIK union in programming usually means “type A or type B(…or type C, or type D…)”, persisting even in times of early C, where a union is a space in memory that can contain data of any of the union types, so you can for example make a float64, uint8[] union, write floats and read them as separate bytes etc.

This is not the same as “contents of type A and contents of type B”.

@kumicota what’s that on the right? I don’t recognise.

Amikke boosted

Riot Games 2FA implementation is inherently broken: The same code can be used multiple times.

The code is also emailed to you, and email is known to be an insecure channel. You do not have the option to use your own TOTP application to generate login codes.

Riot Games responded to a report saying that the system is "working as intended"

Lesson? Phish Riot accounts. They will do nothing to stop you.

Also, HackerOne is an absolute fucking joke.

Amikke boosted

"A 2FA bypass is not a bug because you'd need to know the username and password to use it"

uhhhhh folks what do you think 2FA is for?

Show thread
Amikke boosted

@PausalZ oh yeah, I don’t discount the existing ecosystem nor claim that you should switch to Julia immediately. Yes, inertia-related reasons like the existing community, knowledge base, libraries and plain familiarity are very important and keep languages like Python alive even when worthy successors are present. This is not a “switch to Julia” post, it’s a “interpreted languages have become an artifact of the simpler past” post.

Nevertheless, I’m happy to inform you that Julia’s type and method overloading system provides all of the necessities for OOP too, and it’s not slower than C, C++ of Rust; with only the latter having the advantage of nearly runtime-free memory safety, at the cost of many restrictions. A properly done Julia program is as efficient as a properly done C program that also uses adequate high-speed calculation libraries for the platform, at a fraction of the required effort.

The advancements in compilation and JIT-compilation have made interpreted languages pointless.

Except for inertia-related reasons such as existing ecosystem, why would you use Python over Julia? It has all of its advantages and more and compiles to efficient binaries instead of redoing runtime maintenance work every time.

Amikke boosted
I'm currently trying to hack my way through Java's security API written in the finest traditions of Java Enterprise Development. After doing it for several hours (and after working with Java for several years) I'm beginning to think that all developers who worked on core Java APIs had some king of peculiar mental illness.

Let me illustrate. Imagine you have a cup of coffee represented as an object. You invoke some kind of method that returns that object. For example, getACupOfCoffee(). Problem is, you need a full cup, while the method returns you an empty one. If you are an inexperienced Java developer, you might expect to see coffeeCup.fill() method. Abandon such silly hopes. Having methods that solve problems in obvious ways just isn't The Java Way.

So what do you do? Here is a standard way the situation evolves:

1. You go thought the API documentation of CoffeeCup class. It has 89 methods. 60 of them have nothing to do with either coffee or cups. Of course it is nearly impossible to guess which is which without reading their descriptions.

2. In the process of doing just that (reading their descriptions) you discover a multitude insightful javadoc comments like "<i>setVolumetricQuadrance(Quadrance X) - This methods sets volumetric quadrance</i>". Really? I wouldn't have guessed in a lifetime!

3. You locate a method called initiateFillingProcess() -- only to find out that it is a deprecated method inherited from FoodRelatedObject class 6 levels up the inheritance chain. And yes, it has nothing to do with coffee.

4. You locate CoffeeCupFiller interface. There is no sign of classes that actually implement it.

5. You search the Interned with a query like "java CoffeeCup fill". There are 7,923,236 results.

6. The first link leads to an article about using X Enterprise Application Server to fill coffee cups. The code example spans 600 lines. It uses classes that depend on everything else in the server, which is 500 megabytes in size. (50 megabytes are XML configuration files you would need to rewrite if you wished to install it.) Best of all, after reading the sample code for an hour you find out that while the server does fill cups, it stores their filled instances inside itself without any way of getting them back.

7. The second link on the search page leads you to a thread on java.sun.com where someone else asked how to fill a cup with coffee. The reply? "Stop pestering us with such nonsense. You can use a search engine to find the answer." This is posted by a 5-star Certified Java Professional who is Triple Platinum Community Member of The Year and has 3748 points of positive karma.

8. The third link leads you to another thread on java.sun.com where the answer is "read the API reference". Yes, the same API reference you have read during step 1.

9. The twenty seventh link in search results finally leads you to a working solution. Apparently you need to use FillingEntitiesFactory to instantiate a FillingEntity, then initialize it with BufferedFiller object, which operates on CoffeeCup stub classes you can generate by running JDK command line tool cbrtrfl.exe. It's *that* simple.

~ "The Java Way", 2006
Amikke boosted
Amikke boosted

one of my biggest website pet peeves is when they break forward/back functionality

like you wanna skip back a page and you just keep ending up on the page you're already at

if you design websites like this, fuck you

Every solar power plant is a fusion power plant with extra steps.

Nearly every power plant is a solar power plant with extra steps.

Amikke boosted

@smigol nadal o wiele lepiej niż typowi przedstawiciele alternatyw, i piszę to jako ktoś kto życzy PO szybkiej i dokumentnej śmierci.

@xue @tk oh yeah, they only decrease the risk by an order of magnitude or two, no biggie. Not even mentioning HIV, which was the main problem in aforementioned Africa, for which a condom is the go-to safeguard.

As for the CC allowing condoms, I’m pretty sure the official statement from the official Pope Francis must count for something, he got a whole lot of flak from conservatives for that a little while ago.

@varl42 a Dyson sphere requires tearing the entire solar system down for materials, and is much less visible (as the sphere covers the sun). Simply moving the planets is much, much easier.

@zef@mastodon.technology there are two obstacles: the JSON purists who legit think pasting it in the middle of JS code is a sensible way of importing it and at the same time don’t like comments because muh pure data serialisation, and the state of the Node ecosystem which still has trouble with adapting ES2015 modules and gets panic attacks thinking of backwards compatibility with pre-JSON5 Node.

Show more
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.