Yeah I agree the table is very odd, but the project looks awesome anyway. Some users may care about things using native widgets when it comes to theming and stuff, though I wouldn’t even know what I’d call “native” on Linux. Is GTK native? Qt?
Yeah I agree the table is very odd, but the project looks awesome anyway. Some users may care about things using native widgets when it comes to theming and stuff, though I wouldn’t even know what I’d call “native” on Linux. Is GTK native? Qt?
They explain it a bit here: https://mitchellh.com/writing/ghostty-and-useful-zig-patterns
Also, calling out the warning signs, my bar for a native platform experience is that the app feels and acts like a purpose-built native app. I don’t think this bar is unreasonable. For example, I don’t think it’s unreasonable to say that Alacritty is kind of not native because new windows create new processes. Or that Kitty is kind of not native because tabs use a non-native widget. And so on (there are many more examples for each).
So nothing wrong with Kitty on MacOS e.g., but the “feel” is not native. Personally don’t care too much about that, but the author seems to do.
I’ll never get over how cool animated code folding looked when I first saw it. I love my terminal but man that’s sexy. Reminds me of some of the original demos of Dion. I feel there is definitely room to reinvent how we view and edit code.
May not be the most popular choice, but I absolutely love Sublime Merge. Only issue I have is that it doesn’t support workspaces. But I love how it doesn’t abstract git away. Most actions in the UI are just called like the underlying git command, there are no non-git things like a “sync”. Plus you can always click on the top to see which commands exactly were executed and with what output. And it’s Sublime-typical wicked fast.
It’s an unlimited free trial with the dark mode disabled. License costs $100 and lasts for 3 years of updates.
True. I was more going on the idea of OP that it must confuse english learners. I often feel people who only know one language tend to forget that most latin languages tend to have similar quirks, often making such quirks in a foreign language rather natural.
Can’t speak of other languages, but in German anyway the sentence is exactly the same. “Ich bin zuhause” meaning word-for-word “I am home”. Same issue, normally a location would have a preposition and an article. Reasoning is also the same as in english, “home” and “zuhause” are not a location but a state in this case.
I For Of Can’t The The Wait Fall Bourgeoisie
That’s exactly it, no wonder I couldn’t find it. Thank you so much!
I have night light turned on 24/7 on all my devices. If I don’t I get a headache after around a day.
In fact, I couldn’t consistently use linux until recently because only the latest Nvidia drivers (545) added support for night light on wayland. Those glasses could’ve been handy there.
First tried a really slow brute force, but after waiting many minutes heard others talk of Karger’s Algorithm, so I implemented that.
use rand::prelude::*;
use std::collections::HashSet;
type Graph = (V, E);
type V = HashSet;
type E = Vec<(String, String)>;
fn parse_input(input: &str) -> Graph {
let mut vertices = HashSet::new();
let mut edges = Vec::new();
for line in input.trim().lines() {
let mut it = line.split(':');
let left = it.next().unwrap();
vertices.insert(left.to_owned());
for right in it.next().unwrap().trim().split_whitespace() {
vertices.insert(right.to_owned());
edges.push((left.to_owned(), right.to_owned()));
}
}
(vertices, edges)
}
fn part1(input: &str) -> usize {
let (vertices, edges) = parse_input(input);
let mut rng = rand::thread_rng();
// Karger's Algorithm
loop {
let mut vertices = vertices.clone();
let mut edges = edges.clone();
while vertices.len() > 2 {
let i = rng.gen_range(0..edges.len());
let (v1, v2) = edges[i].clone();
// contract the edge
edges.swap_remove(i);
vertices.remove(&v1);
vertices.remove(&v2);
let new_v = format!("{}:{}", v1, v2);
vertices.insert(new_v.clone());
for (e1, e2) in edges.iter_mut() {
if *e1 == v1 || *e1 == v2 {
*e1 = new_v.clone()
}
if *e2 == v1 || *e2 == v2 {
*e2 = new_v.clone()
}
}
// remove loops
let mut j = 0;
while j < edges.len() {
let (e1, e2) = &edges[j];
if e1 == e2 {
edges.swap_remove(j);
} else {
j += 1;
}
}
}
if edges.len() == 3 {
break vertices
.iter()
.map(|s| s.split(':').count())
.product::();
}
}
}
github: https://github.com/Treeniks/advent-of-code/blob/master/2023/day24/rust/src/main.rs
codeberg: https://codeberg.org/Treeniks/advent-of-code/src/branch/master/2023/day24/rust/src/main.rs
gitlab: https://gitlab.com/Treeniks/advent-of-code/-/blob/master/2023/day24/rust/src/main.rs
Had to look on reddit for how to solve part 2. Wasn’t happy with the idea of using something like Z3, so I ended up brute force guessing the velocity, solving for the position and time and seeing if those are correct.
Lots of unintelligible calculations for solving the equation systems in the code that I just prepared on paper and transferred over.
https://github.com/Treeniks/advent-of-code/blob/master/2023/day22/zig/src/main.zig
(or on codeberg if you don’t like to use github: https://codeberg.org/Treeniks/advent-of-code/src/branch/master/2023/day22/zig/src/main.zig )
Every time I use Zig, I love the result, but I hate writing it. The language is just a little too inflexible for quick and dirty solutions to quickly try out an idea or debug print something useful, but once you’re done and have a result, it feels quite complete.
https://github.com/Treeniks/advent-of-code/blob/master/2023/day21/rust/src/main.rs
I reused my Grid struct from day 17 for part 1, just to realize that I’ll need to expand the grid for part 2 so I awkwardly hacked it to be a Vec>
instead of a linear Vec
.
I solved task 2 by reading through the reddit thread and trying to puzzle together what I was supposed to do. Took me a while to figure it out, even with literally looking at other people’s solutions. I wrote a lengthy comment about it for anyone that’s still struggling, but I honestly still don’t really understand why it works. I think I wouldn’t have solved it if I didn’t end up looking at other solutions. Not a fan of the “analyze the input and notice patterns in them” puzzles.
I’m pretty sure this only concerns twitch affiliates. Multistreaming was always allowed for non-affiliates.
yup, my bad. Frankly I thought grapheme meant something else, rather stupid of me. I think I understand the issue now and agree with you.
The way UTF-8 works is fixed though, isn’t it? A new Unicode standard should not change that, so as long as the string is UTF-8 encoded, you can determine the character count without needing to have the latest Unicode standard.
Plus in Rust, you can instead use .chars().count()
as Rust’s char type is UTF-8 Unicode encoded, thus strings are as well.
turns out one should read the article before commenting
if it’s taxed more, wouldn’t that just make them worsen the chances to compensate?
This talk is technically not about Zig, but he still shows many of Zig’s strengts: https://youtu.be/aPWFLkHRIAQ?si=b-rf_oM*removed*IvAdq
To me, Zig is a language that tries to be like C, but with all the decades of mistakes removed, or rather with modern knowledge of good language design in mind, while keeping as much compatibility as possible, as to not require a lot of work for the transition as Rust did. Thus, if you’re working in a C codebase, you’ll be good to go to integrate Zig in as little as an hour. They also have by far the cleanest solution to macros and generics that I have seen yet (although I miss my type classes).
High School without other people sounds absolutely awful.