Turun

joined 2 years ago
[–] Turun@feddit.de 5 points 1 year ago

Gondolas can actually work as public transit. Depending on terrain they are actually a very efficient solution. You can find them in a few cities.

[–] Turun@feddit.de 2 points 1 year ago

I guess that's one way to understand that word.

Colloquially it is used to refer to the capability of a place that allows its inhabitants to live car free.

Completely banning cars is rarely a demand because it makes no sense. A car is not a problem, hundreds of them are. Especially if they are used and required for everyday mundane tasks.

[–] Turun@feddit.de 12 points 1 year ago (14 children)

Nur Sonderzeichen sind verboten. Gerund (Studierende), ausgeschrieben (Studenten und Studentinnen) und y (Studentys, bei der Variante bin ich mir nicht ganz sicher) ist weiterhin erlaubt.

Ich möchte außerdem anmerken, dass y-gendern dir einzige (mir bekannte) Variante ist die den "Bürgermeister" Test besteht. Alle anderen Varianten verzerren sich bei solchen Kompositworten ins Lächerliche oder umgehen das Problem indem sie nicht konsequent gendern.

[–] Turun@feddit.de 9 points 1 year ago

This would be so awesome if the letters were on a big rotating disk though!

[–] Turun@feddit.de 9 points 1 year ago* (last edited 1 year ago) (1 children)

The only thing that makes rust different from cpp is the lack of inheritance. We have classes, they are called structs. And Interfaces, they are called traits.

But instead of inheritance if you want shared behavior between two structs you need to have both of them implement the same trait. So instead of

fn pet(aimal: Animal)

You'd have

fn pet(animal: impl Petable)   // polymorphism via monomorphization

Or

fn pet(animal: &dyn Petable)  //polymorphism via dynamic dispatch

Instead of writing an animal super class you define a Petable trait:

trait Petable{
    fn pet(){}
}

We even have operator overload, because you can simply implement the f32::Add (or whatever) trait for your structs.

[–] Turun@feddit.de 13 points 1 year ago

Touristi ite domum

[–] Turun@feddit.de 5 points 1 year ago (1 children)

Where do you see the camera switch side? The fin on which the camera is mounted moves every now and then, but I think we only ever see the perspective of one camera.

[–] Turun@feddit.de 3 points 1 year ago (9 children)

Not gonna lie, ich gönn euch den Rausch, aber den Geruch von Cannabis kann ich nicht ausstehen. Also mampft gerne eure Kekse direkt neben dem Spielplatz, aber eine Kiff-Bannmeile finde ich gut.

(Sehe ich für bereits legale Drogen genauso: also ungefähr equivalent 500m nicht rauchen und 5m nicht saufen)

[–] Turun@feddit.de 2 points 1 year ago (4 children)

You can jump to definition in any language. In fact, python may be one of the worst ones, because compiled libraries are so common. "Real signature unknown" is all you will get some times. E.g. Numpy is implemented in C not python.

[–] Turun@feddit.de 1 points 1 year ago* (last edited 1 year ago) (6 children)

As a researcher: all the professional software engineers here have no idea about the requirements for code in a research setting.

I recommend you use

  • git. It's nice to be able to revert changes without worry.
  • descriptive variable names. The meaning of descriptive is highly dependent on your situation. Single letters can have an obvious meaning, but err on the side of longer names if you're unsure. The goal is to be able to look at a variable and instantly know what it represents.
  • virtual environments and requirements.txt. when you have your code working you should have pip (or anaconda or whatever) take a snapshot of your current python installation. Then you can install the exact same requirements when you want to revive your code a few months or years down the line. I didn't do that and it's kinda biting me in the ass right now.
[–] Turun@feddit.de 1 points 1 year ago

No.

I have written rust for my research (one does not simply calculate 4 million data points in python), but just no.

My main code is still python, because it's just so much nicer to write and iterate on.

[–] Turun@feddit.de 2 points 1 year ago* (last edited 1 year ago)

I use classes to group data together. E.g.

@dataclass.dataclass
class Measurement:
    temperature: int
    voltage: numpy.ndarray
    current: numpy.ndarray
    another_parameter: bool
    
    def resistance(self) -> float:
        ...

measurements = parse_measurements()
measurements = [m for m in measurements if m.another_parameter]
plt.plot(
    [m.temperature for m in measurements], 
    [m.resistance() for m in measurements]
)

This is much nicer to handle than three different lists of temperature, voltage and current. And then a fourth list of resistances. And another list for another_parameter. Especially if you have more parameters to each measurement and need to group measurements by these parameters.

view more: ‹ prev next ›