
u/Bright-Historian-216

Best practices for efficient data structures
I'm very new to the language and I'm very confused on some things. Coming from imperative langs, I'd assume that modifying tuples is very fast since they're basically just vectors. Unfortunately, they're also immutable like every other data structure in the whole language. So, if I want to make, say, a Canvas data type that holds all my pixels in a 2d data structure, is there literally no way to make it even if a little more efficient than just making a new one every single time I update a pixel? Even if I made it a 1d data structure, is Elixir just the wrong tool here?
Is it possible to get Markdown formatting back on ios?
i used to be able to type out ^(superscripts) and `code blocks`, well not anymore. While asterisks convert to italics, \*backslashes\* also stay, which is just ridiculous.
Is this a good practice to use quote with guard clauses?
After looking up how guard clauses work, I found this snippet:
defmodule User do
defstruct age: 0
defmacro is_kid(age) do
quote do: 6 < unquote(age) and unquote(age) < 12
end
defmacro is_teen(age) do
quote do: 12 < unquote(age) and unquote(age) < 18
end
defmacro is_elder(age) do
quote do: 60 < unquote(age)
end
end
defmodule Greeting do
import User
def greet(%{age: age}) when is_kid(age), do: "Hiya"
def greet(%{age: age}) when is_teen(age), do: "Whatever"
def greet(%{age: age}) when is_elder(age), do: "You kids get off my lawn"
def greet(_), do: "Hello"
end
It feels really... unconventional. Obviously, that's my subconscious speaking after so much experience with imperative languages, but is this really the only way to introduce my own guard functions? Say I need some kind of Vec3.is_normalised/1 method, is there no other way to write it other than by quote-unquote: quote do: unquote(Vec3.magnitude(v)) == 1?
I made a program that automatically turns solar panels from Power Grid towards the sun
In theory this should work even if you unload the chunk, as I save the difference between the panel angle and swivel angle, but there is a CLI tool to correct the error if anything goes wrong. It is not perfect, but I have wattage approximate to the peak through the day.
The panels only turn from -90 to 90 degrees, at 6:00 to 18:00 ingame. The setup uses a speed controller and a 1/20 gear ratio. The swivel bearing is used for error correction, as the solar panel bearing doesn't have the angle information on it.
You can in theory attach as many panels as you want, but I haven't really tested what happens if only one chunk is unloaded.
Pastebin for ComputerCraft: https://pastebin.com/1h5jtqSL
writing code for a new project and ended up writing this long comment; do you think it's good to have comments explaining the entire thought process or is it too verbose?
do you think comments should be concise about what exactly the function does and not how it does it, or is it good to have in-depth explanations like this?
what is the best jailbreak to get? (11.02)
I'm not familiar with jailbreaking scene, I just have an old console and I heard that jailbroken ones have great second hand value. I have version 11.02 so the webkit should work; the tutorial showed goldhen i think it was called? is this one the best to get, or is there something better?
What do I use Crafts and Additions for?
Everyone seems to have it, but it doesn't add much use for electricity. Liquid fuels are extremely useful, but that's just a small part of the addon.
limitless supply not actually limitless?
filled a 10000 block hole in the overworld with lava. the hose pulley said "infinite". i immediately reroute all my lava supply to drain from my limitless hole, and immediately it is no longer limitless. did i do something wrong?
crushing random items with a mechanical press
How to make cogs, slider cranks and gear ratios
Dialectal pronunciation of "celsius"
The dictionary states that "celsius" is pronounced as /ˈsɛlsiəs/, which is what I usually hear from most people. However, I've heard a nuclear engineer from the US pronounce it as /ˈsɛlʃɘs/. How common is this pronunciation, and what regional variations may use it?
FINALLY figured out how to build a plane (i just can't pilot it well yet!..)
i still can't stick a landing... technically two humans survived my plane landing, it was internal bleeding that killed them, not my plane! they died on solid land!
i HATE HATE HATE that UI designers have to ruin the UI every few months just to keep their job
why the FUCK does the same motion i did for so long now do something COMPLETELY different
i can't reach for ANY buttons now and all the sliding directions are completely messed up