Hacker Newsnew | past | comments | ask | show | jobs | submit | disposedtrolley's commentslogin

I wrote a rudimentary autopilot in Go that used a Kalman filter to maintain straight and level flight. It was a fun exercise!


And I wrote one in Python to climb/turn as well! And to navigate to any of the built-in X-Plane navaids -

https://austinsnerdythings.com/2024/04/06/adding-track-follo...

and the first post in the series -

https://austinsnerdythings.com/2021/10/15/creating-an-autopi...


Nice! I’m writing in C this year too, although I’m very much a beginner in C.

What kinds of optimisations have you had to do? Are you hosting your code anywhere?


For doing it in C, by far the most useful thing you could do is implement your own generic hash table. Having a good hash table handy makes things a lot easier. Though since you're a beginner you might want to find a good library for it at first. Writing a hash table is great C exercise though, so I definitely recommend doing it at some point.

I don't necessarily want to share my github as it contains my real name, but I'd be willing to send you a tarball of my 2020 code tomorrow if you send an email to mtlmtlmtlmtl at pm.me

I've just now started on day 1 for this year, so no code there yet worth showing off.


I think I understand how to build a hash table except for one thing: which hash function should you use? Is there a simple one that’s good enough for most things? How do you pick one?


You would write your hash table constructor to accept a hash function as a function pointer then pass in the appropriate hash function for whatever the key type is.

You can use the same hash function for any arbitrary struct as long as there's no pointers in it. If there are pointers, you'd have to implement one combining the hashes of all the members through something like xor. I used fnv1a_64 for my hash function in AOC 2020 which is a pretty good general choice for strings and other contiguous objects and is just 10 lines of code. Pseudocode on Wikipedia or I'm sure you can find C code on Stackoverflow. Hope that helps :)


if your hash table is a really good modern open addressed hash table, something like Google's Swiss Tables, you need a really good hash because you will be badly penalised otherwise, these modern structures demand a hash with proper behaviour for even halfway reasonable performance.

If it's just a My First Hash table with closed addressing, buckets etc. you needn't care too much. If you're hashing integers, just use the integer itself, that's a terrible "hash" but with this like 1980s data structure it's good enough.


A lot of the time if the key is an int however you can get away with an array assuming the range is reasonably small.

Worth noting that for AOC I got by just fine with the simplest possible bucket based implementation.



I can recommend a podcast set there if you’re after more Svalbard-themed entertainment!

https://thewhitevault.com


I love browsing the Strange Loop channel on YouTube. So many interesting topics that you wouldn’t normally search for!


Yes, but you'll also need space for a rack and contend with noise, heat, and electricity usage.

Don't get me wrong -- I love my Dell R730xd but it's definitely a commitment.


Fujitsu TX100 s3, TX120 s3, Dell ML110, HP microserver series are little towers, quietish (you can change out the fans to make them practically silent).


I'm disappointed that the three photos in the Gallery with the laptop in use aren't actually showing what the screen would look like IRL; they've been cleverly doctored by overlaying screenshots on top of the display.


Thanks for posting! Gave me a good chuckle at the beginning of my day, and I miss tiny projects that don't need to aspire to be the next big thing.

Although, I'm not sure if the game or some of the comments here is more entertaining...


I found out about this book through the EmbeddedFM podcast [1]. Their latest episode is an interview with the authors of the book. Highly recommend the episode, and the podcast in general for folks that are into electronics.

[1] https://embedded.fm


It’s cheap compared to other textbooks.


What kind of company were you working for? I've lived and worked in Melbourne my whole life and complacency is not a cultural attitude of the location, but of specific companies.


Agreed - I work in Australia and I've worked with a lot of complacent people but a lot of very good people too. I thought the complacent people was just Sturgeon's Law applied to people who work in technology.


I saw the complacency in daily life, not at work (which was mostly remote to another part of the world anyway.)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: