Judging from this article, it will probably not be good for the acceptance of new technologies long term to build data centers in drought struck areas.
https://www.techpolicy.press/why-we-dont-know-ais-true-water-footprint
Judging from this article, it will probably not be good for the acceptance of new technologies long term to build data centers in drought struck areas.
https://www.techpolicy.press/why-we-dont-know-ais-true-water-footprint
Postgres seems to reign as the database solution of choice but there are lots of new specialised databases that are worth looking at. All of these can be used in production at scale for the right application.
Fun little write-up how to make a web frontend to a dataset that’s almost infinitely large. See it at: https://everyuuid.com
That’s an amazing overview of all the things that can and will go wrong in online PvP gaming. It covers the range from networking exploits to all the in-game ways that people try to grief or abuse others.
So I felt I couldn’t really bring myself to do Advent of Code this year since I have more than enough other things to do (and watch and play) and with work and the kids, it’s always pretty miserable to keep up.
I saw this thing called December Adventure though and that fits in nicely with my current push to release a major update for Cuppings. If I’m going to be programming until late this month, then I’d prefer it to be on something that I can release.
I can’t promise that I won’t do any AoC (Factor is looking mighty cool) but I won’t force myself to do anything. With that, let’s get going.
I started working on the map view which clicking around looked like it could be really annoying. I found some dead ends and was afraid I’d have to hack in Leaflet support myself but I found a dioxus example hidden in the leaflet-rs repository.
Yes, I’m writing this website in Rust/WASM, why do you ask?
That example required a bunch of fiddling with the configuration and a couple of false starts, but now I have a vanilla map view.
I can say that I’m amazed that in this ecosystem 1. an example exists 2. that example works 3. it works in my project with a bit of diffing and 4. it seems to do what I need.
I raised a PR to the project to advertise this example on its README just like it does the others so that others wouldn’t have to search like I did. That PR got merged:
https://github.com/slowtec/leaflet-rs/pull/36
Today I’ll see if I can tweak the map view to show the location of the cafe we tapped and get things to a point where I can commit the change.
To do this I need to figure out how to pass information along to a router when we tap a venue. That should be easy enough but the Dioxus documentation is between 0.5 and 0.6 now and a lot of it is broken.
A tip from the Discord said I need to put the data into a context from a parent and then get it out again in a child. It’s a bit roundabout and required some refactoring, but it works.
Done on time even for a reasonable bed time.
Turns out my changes from yesterday did not make it to the staging server. I’ll fix that and manually run the job again.
That’s these annoying wasm-bindgen version errors that keep happening and that require a reinstall of this: cargo install -f wasm-bindgen-cli --version 0.2.97
and the dioxus-cli
. Dioxus which by the way is preparing its long awaited 0.6.0 release.
Yes, I build this on the same Hetzner box that hosts it. So here you go: https://staging.cuppin.gs
Other than that not that much will happen today since I spent most of the evening noodling around with Factor (despite my intention not to do any weird programming). It’s a nice language that’s very similar to Uiua which I tried out a while back but not being an array programming language makes it feel somewhat more ergonomic.
I can’t describe how nice it is to wake up and not have to deal with a mediocre story line involving elves and try to find time to attack a programming problem.
After today, I’m going to need that quiet morning, because I spent until 01:30 debugging an issue: Going to a detail view from the frontpage worked, but loading a detail view directly would throw an error.
There were two issues at play here:
Leaflet maps don’t deal well with being created multiple times so either we have to call `map.remove()
or we have to check whether the map has already been created and keep a reference to it somehow.
I solved it by pushing the map into a global variable:
thread_local!(static MAP: RefCell> = RefCell::new(None));
These are Rust constructs I would normally never use so that’s interesting. More interesting is that they work in one go and that they work on the WASM target.
Then the error was gone but the page was blank. Not entirely sure what was happening I poked at the DOM to see all the map elements there but simply not visible. Turns out that because of the different path, the path for the stylesheet was being added to the URL like this: http://127.0.0.1:8080/venue/176/main.css
It just has these two lines:
#map {
width: 100%;
height: 100vh;
}
But without a height the map is invisible.
Both issues are solved but not committed. I’ll see tomorrow whether I’m happy with the solution and how to package this up. Also I’m not sure how main.css
is being served on production and whether the same fix will work there.
I couldn’t help but noodle on Advent of Code a bit. Here’s my day 1 part 1 in Factor: https://github.com/alper/advent-of-code/blob/main/2024/day-01/day-01.factor
I like Factor the programming language. It’s like Lisp or Haskell but without all the annoying bits.
The environment that’s provided with it, I’m not so keen about. It’s annoying to use and has lots of weird conventions that aren’t very ergonomic.
I’ve been bad and I’ve finished part 2 of day 1 of the Advent of Code: https://github.com/alper/advent-of-code/blob/main/2024/day-01/day-01.factor#L27
Not so December Adventure after all maybe. I’ll promise I’ll finish the mapping improvements I was working on tomorrow.
Went on my weekly long bike ride. Then in the evening I didn’t have that much energy for programming other than finishing Advent of Code day 3 part 1: https://github.com/alper/advent-of-code/commit/0a74c38e7641141e10b4c48203c9e414cc492e1c
(I looked at day 2 part 2 but that just looked very tedious.)
Got in a ton of commits on Cuppin.gs today. After fixing the map, I wanted to see what would happen if I would add all 2000 markers to the map.
Performance seems to be doable but this is probably not ideal for a webpage. Dynamically rendering the venues is something for later. For now I can probably get away with filtering for the 100-200 nearest locations by distance and dumping those into the map view.
Now I’m back debugging Github Actions. I’m splitting up the build and deploy of the backend and the frontend into separate actions. Compiling dioxus-cli takes forever which is a step I hope I can skip with cargo-binstall.
Iterating on Github Actions takes forever and there really doesn’t seem to be a better way to develop this or a better CI solution that everybody is willing to use.
Old people’s brains have been entirely cooked by the slop feeds that Meta produces. No parent worth their salt would trust these people to protect their kids. The EU should follow suit.
the law may infringe on the rights of young people and reduce their ability to participate in society
Since when is being spoon fed the worst advertising and content created by awful people looking to make a quick buck “participating in society”?
https://www.theguardian.com/media/2024/nov/29/meta-australia-social-media-ban-response
Seeing if I can move from Arc to Vivaldi but there are half a dozen radical improvements in Arc that *make* the experience. It just shows how much innovation and solid thinking was packed in all of that frivolous design.
Vivaldi on the other hand has a million settings which mostly show that nobody knows wat this app is supposed to be doing. There are entire note taking apps and e-mail clients in there but none of them fun or nice to use.
Products truly live and die in the pixels.
Chuffed by the strength of my team that we have most of the easy decisions from these Node.js pillars in place and we are making headway on all of them to the extent that’s appropriate for us.
I read this piece about CORS and the only thing I can tell you about it is that I hate web security.
What China has done in industry after industry is to flatten the supply curve by subsidizing hordes of producers. This spurs innovation, increases output and crushes margins. Value is not being destroyed; it’s accruing to consumers as lower prices, higher quality and/or more innovative products and services.
If you are looking for returns in the financial statements of China’s subsidized companies, you are doing it wrong. If China’s subsidized industries are generating massive profits, policymakers should be investigated for corruption.
A piece well worth reading about China’s economic policies if only for the fact that their flattening of supply curves is the only thing that is really fighting climate change.