HNHacker News
TopNewBestAskShowJobs

ls65536

640 karma · joined May 14, 2020

submissionscomments
ls65536··on YouTube bans coronavirus vaccine misinformation
I really do think the hardware/software analogy here works quite well. In that sense, one could argue that the software has also become more complex, and perhaps more fragile, in recent times in order to better assist individuals in navigating this world.

To your other point, I think that "education" and "critical thinking skills" are often conflated as one and the same, or that perhaps one necessarily leads to the other, but this is certainly not the case. While I think being educated to some degree is important in order to share a "common language" with others and to become a contributing member of society, the ability to think critically, and to act on it, is really necessary if we are to succeed and not fail catastrophically along the way.

To go back to the analogy, having the ability to execute the software faithfully is one thing, but understanding when it might make sense to modify the software and how to do so responsibly given the fixed hardware we have available is really the critical piece.

ls65536··on 14,000x Speedup (2015)
The way in which I like to often think about these things in practice is with "hidden" constant factors. For example, you can think of the O(1) algorithm as really taking O(1 * K1) time, and the O(n) algorithm taking O(n * K2) time to complete. For different algorithms, K1 and K2 will almost certainly be distinct, and may even differ by significant amounts. Of course, if K1 is less than K2, then the value of "n" is irrelevant, and the O(1) algorithm always completes faster. But if K1 is greater than K2, as is the case quite often, then this really depends on the nature of what "n" is in practice, and whether or not it is larger than the value of K1/K2. This of course still ignores any other, often important, considerations beyond just run time such as memory consumption (which may also affect run time indirectly), but I find it's a good starting point when trying to reason about when O(n) can run faster than O(1) in various real-world scenarios.

It's a good reminder to always try to understand your likely workloads as well as possible (know your "n"), and to get good measurements (what are K1 and K2 values) before prematurely optimizing these kinds of things.

ls65536··on Show HN: 8-bit CPU simulator in C
It's certainly possible, but remember that with 8 bits you have just 256 different possible representations, and every instruction opcode with its set of all distinct valid parameters will map to a number of those limited 256 states. For example, this makes it a big challenge to encode anything other than very small ranges of immediate values inside an instruction.

Typically whenever there's a reference to an N-bit instruction set, it's referring to the widths of the registers and data paths. Very often this is not the same as the instruction size, and in many cases instructions may even be of variable length.

So while it's much more restricting to commit yourself to only an 8-bit instruction size, it should still be possible to build something with it.

ls65536··on Show HN: 8-bit CPU simulator in C
This is neat! I had some thoughts recently about creating something similar as well.

For a simple but still practical instruction set, you can probably sanely get away with about two dozen or so different instructions, but at the expense of having larger programs (by number of instructions) to accomplish the same tasks compared to a more featureful instruction set.

Here's a fairly simple set that might be a reasonable place to start...

ALU: and, or, xor, complement, shift left/right, rotate left/right, add, subtract, multiply, divide, compare (or just use subtract and set flags for this one)

Memory: move (copy between registers), load and store (between memory and a register), maybe also push and pop for sanity if you want to provide explicit stack instructions.

Control flow: jump, branch (maybe depending on flags from ALU), call/return

It might also be helpful to look at the 8-bit AVR instruction set (quite popular for small microcontrollers, including what you might find on many Arduino boards). It contains about a hundred or so instructions, with all of the above list present in one form or another (although many are just aliases for some other instruction with the same opcode but otherwise fixed parameters). In the case of AVR, where code size is often the limiting constraint, having a larger vocabulary of instructions is useful for expressing a program in the smallest amount of space possible, but it certainly isn't necessary to have all of them just for completeness.

ls65536··on Show HN: Global sailing navigation simulator using real weather/ocean data
I haven't heard of the Microtransat Challenge before, but this looks interesting, so thanks for sharing that!

As for sails-simulator (first time looking at this as well), there appears to be, not surprisingly, quite a bit of similarity, but with one notable difference that I can see so far...

One of the goals of my project was to simulate a large number of boats at the same time with realistic large-scale navigation, geographical and weather effects, so there is much less focus on the individual aerodynamic and hydrodynamic sailboat physics (as these can also get computationally expensive). The "boat physics" in my case consists of four lookups from a "wind response" table (using angle from wind and wind speed as inputs) with interpolation between the four points to get the final result (boat speed over water). With some profiling and optimizations, I've found through load testing that it can simulate (on a modern machine) several hundred thousand boats per CPU thread with a simulation timeslice of one second. I'm certain this would be far more difficult to achieve if I was trying to simulate more "real" physics against the surfaces and masses of every boat. The tradeoff then is that the boat controls are very crude (basically just selection of course over water), and you don't have finer controls over sails/rudder, etc.

ls65536··on Show HN: Global sailing navigation simulator using real weather/ocean data
I created a public race that begins shortly (apologies if it's already started by the time you read this comment!), if anyone would like to join and try out the "multiplayer" mode: https://8bitbyte.ca/sailnavsim/races.php

Just copy the race ID (809d3260e3e6b76da6282842cef7a342 for this one), and join the race from the start page.

Also a note that anyone can create a public race with custom parameters, and anyone else is also free to join that race by using the published race ID.

ls65536··on Show HN: Global sailing navigation simulator using real weather/ocean data
Hey, thanks!

Yes, different boat profiles is on my list of things to add at some point. There are some impressive global races [1][2] that happen every few years using some interesting boats, so it would be neat to follow along virtually in this way.

[1] https://en.wikipedia.org/wiki/The_Ocean_Race

[2] https://en.wikipedia.org/wiki/Vend%C3%A9e_Globe

ls65536··on Show HN: Global sailing navigation simulator using real weather/ocean data
Thank you for the feedback!

There's definitely a tradeoff to work with when it comes to keeping things technical and finding a broader audience. I suppose there's also room for a "simple" mode vs. "expert" mode interface or something along those lines to try to cater to everyone, while keeping the underlying mechanics of the simulation the same. Nevertheless, I acknowledge there's still room for improvement here for all audiences. :)

As for the maps (and at the risk of sounding a bit paranoid here), I put them on a separate page to keep the embedded map pages from possibly getting access to the users' boat keys (since they're GET parameters and therefore part of the URL). I fully realise that putting "secrets" in GET parameters is bad practice, but in this case the bookmark-friendliness of having your own boat page URL seemed to be worth the tradeoff of putting something semi-secret like a randomly-generated boat ID/key in the URL itself. On the other hand, I didn't find it worth the tradeoff of potentially leaking everyone's boat keys to third party sites (however trustworthy they may be) through embedded components by putting the maps on the same page.

ls65536··on Show HN: Global sailing navigation simulator using real weather/ocean data
Thanks for the feedback and questions!

> Are robots really a problem or the problem are just morons that create too many boats?

I don't have much evidence of bots actually being a problem so far, but with that being said I didn't want to start off by making it too tempting to begin with. Without the captcha it would be trivial to write a bot that generates a large number of garbage boats. Every boat adds to the server load, however small the marginal amount may be.

> How many boats do you have currently? If I don't log in for a month, is my boat sink/rescued?

There are around 500 boats on the server at this time, but the number is still growing as I type this (many new boats today certainly coming from HN users). Currently, if you don't send a command to your boat (course change, start/stop) within 14 days, it gets garbage collected to free up resources...whether you consider that getting "sunk" or "rescued" is up to you. :)

> When I read race, I expect at least two boats. Is there a record board when I finish the race.

When you race other boats, there is a table at the bottom of your boat details page that shows information about all the boats. When a boat finishes its race, this will be clearly shown in this table, along with the time it took to finish.

To race other boats, you need to create a race with custom parameters (the form is at the bottom of the start page) and choose a start time in the future, with as little as 5 minutes or perhaps as long as several days, to give others time to join.

> Do you organize some kind of events where people can race against other people?

So far I've raced just with a few friends myself (including some races lasting weeks, between continents), but anyone is free to create a public or private race and invite anyone else to join. Public races are published on the Races page [1], where anyone else can copy the race ID and join before the race begins.

> It would be nice to see the target area in the map

There's a "click here for maps" button on the boat details page, which will take you to the maps page for your boat/race.

> How do you calculate the direction. From another post, I remember it is a mix of the direction of the wind and the direction of the boat (and the direction of the sail?).

The boat attempts to follow the true course commanded to it, subject to wind direction and the boat wind response [2]. The ocean current vector is also added to the result of that calculation, which gives the final course and speed over ground.

> Is this a standard boat model? Is it a good idea to add more models of boats?

The boat modeled here is just a contrived boat model that seems reasonable enough for perhaps some sort of 30-40 foot boat which may or may not exist in the real world. I've created a polar plot [2] showing its wind response so participants know what they're dealing with when racing. I would like to add more boat models in the future (including models of real-world boats), possibly even allowing for custom boat models to be uploaded by the user for any given race.

[1] https://8bitbyte.ca/sailnavsim/races.php

[2] https://8bitbyte.ca/sailnavsim/img/wind_response.png

ls65536··on Show HN: Global sailing navigation simulator using real weather/ocean data
Great tips overall, but if I may add a few additional points about this simulation...

- The captcha can show notches in either 30 or 45 degree increments. I thought that the extra challenge of discerning between the two would be interesting, but it seems to be causing more frustration than I would have anticipated. Definitely lessons learned from the feedback here. :)

- The fastest boat direction from the wind also depends on the wind speed, and this also depends on the boat itself. You can find a wind response polar plot for the boat modeled here shown on the site's help page [1].

[1] https://8bitbyte.ca/sailnavsim/help.html

ls65536··on Show HN: Global sailing navigation simulator using real weather/ocean data
Hey, thanks!

The boat's historical track is shown after some time (within an hour of starting), but it will only draw the lines between the positions at the top of each hour (so intra-hour positions are lost, but this isn't that interesting anyway for more long-distance races). But you're right, it's a bug that it doesn't show you any track within the first hour. :)

Also, when you have more than one boat in a race, you'll see your historical track and all the other boats' tracks shown on the same map. This makes it interesting for long-distance races with multiple boats.

ls65536··on The War on Upstart Fiber Internet Providers
The asymmetry between download and upload speeds on cable connections is really awful in recent years. I see advertised download speeds like 300 Mbps and 1 Gbps available in many places, but the upload speeds seem to never exceed 30 Mbps around here (which is just 3% of the download speed at 1 Gbps!). Having something like 250/250 Mbps symmetric available would be overall more preferable than 1000/30 in all but the most extreme download situations, in my opinion.

I suppose maybe the cable networks are more optimized for average user behaviour (far more download than upload), but maybe there's also a fundamental limitation with the cable infrastructure that prevents faster uploads, perhaps to do with cable's legacy delivering television broadcasts? Whereas with fibre, almost everything I've seen available comes with symmetric speeds by default.

ls65536··on Why Climate Change Won't Be Stopped (2018)
There really does seem to be this pervasive idea that there's a non-stop linear march of progress from the beginning of time, that despite some bumps here and there "things always improve over time", and that for any of the big problems humanity is facing that "they'll think of something", without much thought as to who "they" are or what that "something" is, or even about the additional side-effects of what that "something" might entail, which could go on to cause ever greater problems later on (where the same argument is again applied ad infinitum). This seems like a common argument made to avoid the emotionally difficult thoughts about what an individual could do right now to help prevent or even just to mitigate existing problems from becoming worse.
ls65536··on Why Climate Change Won't Be Stopped (2018)
It's great to see something from John Michael Greer come up on HN. I've read a number of his books, many critical of modern society and its ills, and while one might not always agree with everything in full including his predictions about the future, it is difficult to argue that he hasn't done a fantastic job backing up his claims and ideas, including providing many references to past societies, drawing though-provoking parallels between what's happened many times in history and what we're observing and living through today. As a bonus, his writing style is often lively and fun to read, while still maintaining the intellectual seriousness that such topics deserve.
ls65536··on Build yourself a weather station
There's also the Citizen Weather Observer Program [1]. It's more North America-centric (where the data even gets ingested for use by some weather forecast models, after various data quality checks), but anyone from anywhere in the world is also free to share their weather data.

[1] https://en.wikipedia.org/wiki/Citizen_Weather_Observer_Progr...

ls65536··on Show HN: High Resolution Terrain Maps of Cascade Volcanoes
Also have a look at the ASTER GDEM data for elevation and water body classification: https://asterweb.jpl.nasa.gov/gdem.asp. I have managed to successfully use this in one of my own projects, but it did take some processing to get it into a different data format for my purposes. Although this data has only about a 30-metre resolution, all the raw data does seem to be available for the vast majority of the globe (between 83 south and 83 north latitude).
← PreviousPage 5 of 5