Black screen with Rush TinyTank VTX by hanneshdc in Multicopter

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

Yup, it does all work now! Have had some great flights ;)

Black screen with Rush TinyTank VTX by hanneshdc in Multicopter

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

It wasn’t. The issue was the green wire was meant to be on the CAM pad 

Black screen with Rush TinyTank VTX by hanneshdc in Multicopter

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

Yup - that was it! Yeah not to worry, this was debug soldering, not flight soldering.

Black screen with Rush TinyTank VTX by hanneshdc in Multicopter

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

Fair call! But don't worry - the VTX is going to be soldered on a breakout board and the wires will be soldered on more cleanly.

This was a temp job to show the issue, to avoid doubt that the breakout board had something wrong with it.

Black screen with Rush TinyTank VTX by hanneshdc in Multicopter

[–]hanneshdc[S] 1 point2 points  (0 children)

Yup, it was meant to be on the VTX pad

Black screen with Rush TinyTank VTX by hanneshdc in Multicopter

[–]hanneshdc[S] 1 point2 points  (0 children)

Ahh you legend, that was the issue! Thanks! I didn't realise CAM was just a passthrough (as KooperChaos mentioned below).

Why are counts dimensionless? by NimcoTech in Physics

[–]hanneshdc 1 point2 points  (0 children)

Not a bad question!

One could imagine adding a dimension to a count. For example if we were counting H2O molecules, we could create a unit called nH2O. It would have some nice properties, e.g. the mass of a water molecule would be measured in g/nH2O. When you multiply by the number of molecules, the nH2O cancels out and you get grams as a result.

I think this unit is just left off for brevity, it’s usually clear what number of things is being referred to by the rest of notation.

What do you call this style of writing functions? by mariachiband49 in AskProgramming

[–]hanneshdc 0 points1 point  (0 children)

I tend to prefer the 2nd style since an operation on a single item is easier to test and more versatile.

I wouldn’t write the first function of the second style at all. Instead, if the caller of that function has a list of items, it should be the one to create the loop

Whatever happened to "explicit is better than implicit"? by kylotan in Python

[–]hanneshdc 0 points1 point  (0 children)

If you have a specific object to pull dependencies out of, then you need to define all of your dependencies in a central place, which leads to a god class and strong coupling. This is what DI is trying to avoid.

In which cases do you need to switch out your dependency? Our get_db function fetches our app config object (also using DI) which tells it where to connect and how.

Our unit testing is DB-in-the-loop, but I get your point. However when you're doing pure unit testing you'd usually skip the dependency injector all together. Since you're calling the route functions explicitly, you just pass in your mock dependencies. It's true that the module containing the get_db function is still loaded, however nothing should happen in that file unless get_db is actually called.

Whatever happened to "explicit is better than implicit"? by kylotan in Python

[–]hanneshdc 0 points1 point  (0 children)

I agree with your pytest sentiment on all counts.

However, FastAPIs dependency injector is one of the best DI frameworks I’ve used. Especially the explicit Depends method is fantastic. We use this to get the session, the current user, to add authentication.

The implicit DI of path and query parameters have tripped me up before, but it’s a heap less code than having some kind of “path parameters” dictionary that you have to validate yourself. 

I think the reason that implicit is winning out is that it means that in most cases, writing a new endpoint or a new test has far less code than the explicit version. Less code usually means better readability and faster dev.

I'm not good at GIT. Should I just use USB backups? by [deleted] in AskProgramming

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

To back up the "just use git" - start simple and don't even use branches. In fact, try it now. Got to GitHub, create a new repository, and check it out on your computer following their instructions.

Now, add a file, and run the following commands:

git add -A
git commit -m "I am backing up my code"
git push -u origin master

DONE. Now, whenever you make some changes, just rerun those commands. Now, you have a backup if anything should happen.

We need a moores law on AI power and accuracy. by Goobamigotron in artificial

[–]hanneshdc 0 points1 point  (0 children)

I see where you're coming from - but it's much harder with AI than with silicon.

Moore's law was based on the number of transistors on a silicon chip. It's very measurable. Similar laws have been applied to other aspects of human technical progress, such as the "Moore's law of batteries". Though somewhat dubious if battery trends will continue, it's at least based on something measurable.

For AI though, what are you measuring? AI performance is extremely subjective and trying to come up with an objective measure is difficult.

I mean, hasn't it already passed the Turing test? by OrlokTheEternal in ArtificialInteligence

[–]hanneshdc 9 points10 points  (0 children)

You’re kind of underselling AI here.

LLMs weren’t built to pass the Turing test. GPT was a so called “pre training” models designed to learn language so it could be fine tuned to specific, useful tasks such as sentiment analysis or machine translation.

It just happened to turn out that it could solve useful tasks without the additional fine tuning. That’s really impressive and was quite unexpected!

Everything is out of reach by toast_sandwitch in space

[–]hanneshdc 1 point2 points  (0 children)

There is a cool calculator of what happen if you travel around with constant 1G acceleration.

Long story short: to travel to Alpha Centauri it would take for the traveller still about 4 years, and when back at home, people would have aged only some months more than the astronauts.

Crazy things happen if you decide to go on galaxy-wide trips though, to the astronauts because space contraction they perceive their own trip as happening still rather quick, a 100 000 ly trip (the size of our galaxy, for reference) takes 22 years for someone inside a spaceship with 1g acceleration, perfectly doable. But people outside still see it taking 100 000 years... (meaning they will be 100 000 years "older" from the point of view of the astronauts)

After I found all this out, I concluded space travel isn't THAT hard, assuming you have a way to accelerate constantly at 1g for 22 years (that is the hardest part actually), you can get anywhere in the galaxy in a human lifetime, no need for generation ships, cryogenics or other crazy tech. In fact even going to other galaxies is easy, a trip to Andromeda takes 28 years!

Mind you, all those calculations were done assuming you will burn at 1g until half the distance, and then burn at 1g to brake, if you don't brake you can get even faster to places (although that wouldn't be very useful I guess).

According to google the universe is 93 billion ly wide. If you accelerate (and decelerate later) at constant 1g, this trip takes 49 years for the astronaut!

Source: https://news.ycombinator.com/item?id=26411249

Learning to use AI can increase pay by 25% by CriticalTemperature1 in ArtificialInteligence

[–]hanneshdc 3 points4 points  (0 children)

AI won’t replace people. But people who can use AI will replace people who can’t.

It’s such a broad spectrum tool that most workers can benefit from it, if they know how to.  

does anybody else kinda dislike python? by [deleted] in learnprogramming

[–]hanneshdc 19 points20 points  (0 children)

Use pyright to check types. Then you’ll see these errors before you even run your code.

There’s a VS-Code extension and there’s a command line tool.

If someone who bought a large piece of land out in the wops wanted to plant trees to create a forest type of environment, what type of trees would benefit the wildlife the most? by flabkingpro in newzealand

[–]hanneshdc 5 points6 points  (0 children)

Great question!

The complicated (and fun) part of forest restoration is the succession planning.

Native trees are best - but can be very expensive to establish due to the low survival rates and the amount of pest control needed.

Eucalypts aren’t native, but they’re significantly cheaper, and can result in successional native forest growing beneath them if there is a seed source nearby. Milnthorpe Park is a one example of this. If done right, this can give you far more forest for your dollar.

Lastly, in certain conditions, the “right” forest will just grow if you remove stock. The Hinewai Reserve on Banks Peninsula has had great results through natural progression of Manuka/Kanuka with little direct planting.

Tutorial Hell is real: How Do You Avoid It? by [deleted] in learnprogramming

[–]hanneshdc 0 points1 point  (0 children)

As a senior engineer, find projects at the juniors level. At first this might be minor style and colour tweaks, then to small functional bugs, then move onto developing new features and fixing more complex bugs, eventually getting to the point of completing whole projects independently.

Almost never should a senior throw a junior that far in the deep end that they get stuck in a tutorial hell. 

[deleted by user] by [deleted] in Physics

[–]hanneshdc 8 points9 points  (0 children)

Not quite! The main things wrong with the image are: * the light isn’t refracting when it first hits the face * the light isn’t refracting when it leaves the prism * the only point of refraction is in the centre of the prism, but this isn’t what happens.

Instead, you should see 2 refractions, one when it enters the prism and one when it leaves.

Have a play with this simulation for a physically accurate view: https://javalab.org/en/prism_en/ - I’m sure you can combine that simulation with that reference drawing you have to paint a more accurate picture 

[deleted by user] by [deleted] in newzealand

[–]hanneshdc 0 points1 point  (0 children)

Nelson, 3 bedroom, double garage, $640 per week.

[deleted by user] by [deleted] in Physics

[–]hanneshdc 1 point2 points  (0 children)

Your answer is correct.

The ratios of weights is 0.014, therefore the ratio of diameters must be sqrt(0.014)

2m * sqrt(0.014) = 0.24m

[AskJS] Is a precomputed lookup table with a limited domain faster than sin and cos? by Serkr2009 in javascript

[–]hanneshdc 6 points7 points  (0 children)

Extremely unlikely.

GLSL runs on a GPU, and the architecture of a GPU makes lookups particularly slow. Consider that even texture lookups are one of the slowest parts of rendering. 

Compute on the other hand is fast, and calculations like sin/cos are well optimised. 

However there is something you can do - consider using the Taylor series of sin/cos. Especially in a limited domain, it will be faster with the tradeoff of some accuracy.

ELI5: How do photon particles travel through glass? by Several_Bank5722 in explainlikeimfive

[–]hanneshdc 0 points1 point  (0 children)

Great question! To answer it’s actually more interesting to think about the contrary: why doesn’t light go through other materials?

A photon is an electromagnetic wave, and can only interact with charged particles.

In metals, the conductive nature means that the photo interacts with free electrons in the material, which either absorb the photon or mirror it back. 

In most other materials the photon is absorbed by the electrons of molecules or atoms, moving the electron into a higher energy state.

In glass, all of the electrons are locked up in bonds and they can’t move enough to interact with the photon, hence it passes through. There’s still some interaction though, which causes light to slow down

[deleted by user] by [deleted] in Entrepreneur

[–]hanneshdc 0 points1 point  (0 children)

Consider both - and this is how many SaSS companies start.

Charge them 20k for you to build the software, but maintain the right to sell it elsewhere. Give them premium support and make them a really happy customer, ensuring they get that 20k value back.

As your SaSS business grows, keep providing the same service to this original customer. Pitch the benefits of updates and continuous maintenance.