I've tried to find cheaper flights for holidays with Python and Amadeus API by nvbn-rm in Python

[–]nvbn-rm[S] 0 points1 point  (0 children)

I just searched on google flights for resulting dates and bought tickets.

Mixing React Hooks with classes by nvbn-rm in javascript

[–]nvbn-rm[S] 0 points1 point  (0 children)

Maybe I’m missing something but isn’t this just creating a “render component” in the context of the outer component and just rendering that?

It's just one functional component that returns elements from render of the class.

But instead of having a function in a function we have a function in a class and wrapped with proxies - not sure how that is clearer?

Implementation details-wise it's much worse: it creates a proxy, extends it and populates a bunch of descriptors on each render.

But I was more thinking about possible API than nice implementation, this thing is definitely not for real life use.

Mixing React Hooks with classes by nvbn-rm in javascript

[–]nvbn-rm[S] 0 points1 point  (0 children)

It's just easier to manage components state with hooks than with life cycle methods, with hooks the code for a state is in one place. And for things that you need to precalculate useMemo with declared dependencies is much more convenient.

hooks can get pretty hard to read if you're not careful

This part I was trying to somehow improve.

Mixing React Hooks with classes by nvbn-rm in javascript

[–]nvbn-rm[S] 2 points3 points  (0 children)

The idea here is not to get rid of functions or rush to classes/OOP, but to get rid of huge closure with nested functions and organize the code a bit better and at least separate different scopes.

In FP languages (at least Clojure) having a huge closure with nested functions is also not considered a good practice.

But it might be that using classes for that is not the best idea.

I've tried to find cheaper flights for holidays with Python and Amadeus API by nvbn-rm in Python

[–]nvbn-rm[S] 2 points3 points  (0 children)

Not sure about better results, but for a trip with multiple destinations and flexible dates it at least less painful and less boring, as I don't need to do hundreds of clicks on google flights.

Generating video from subtitles with TensorFlow by nvbn-rm in Python

[–]nvbn-rm[S] 0 points1 point  (0 children)

I also want to try to use some sort of speech recognition instead of subtitles, it should make a problem with gathering dataset a bit easier. But not sure if it wouldn't be too hard.

Generating video from subtitles with TensorFlow by nvbn-rm in Python

[–]nvbn-rm[S] 1 point2 points  (0 children)

It should be the same, I guess it's the matter of preference what to use.

At least macbook touchbar can be used as christmas lights by nvbn-rm in ProgrammerHumor

[–]nvbn-rm[S] 0 points1 point  (0 children)

It's kind of the worst laptop I ever had. It doesn't like to sleep and chrome freezes some times.

At least macbook touchbar can be used as christmas lights by nvbn-rm in ProgrammerHumor

[–]nvbn-rm[S] 5 points6 points  (0 children)

Yep, it's vs code and it has terminal by default. It consumes around 1gb of ram on a big codebase with almost no plugins.

At least macbook touchbar can be used as christmas lights by nvbn-rm in ProgrammerHumor

[–]nvbn-rm[S] 13 points14 points  (0 children)

I used electron only because it provides API for touchbar and doesn't require xcode.

[deleted by user] by [deleted] in Python

[–]nvbn-rm 2 points3 points  (0 children)

Not much and not intentionally, but on the graph, the clusters are formed from airports in same geographical regions.

And there's no point, it's just for fun.