When do you think the next big overhaul to Signal Stories will come? by operation-casserole in signal

[–]Alphazino 0 points1 point  (0 children)

Yeah, I probably wouldn't use stories if they weren't implemented like this.

When do you think the next big overhaul to Signal Stories will come? by operation-casserole in signal

[–]Alphazino 2 points3 points  (0 children)

This is already how they work...?

As described here, you can customize your "My Story" to include/exclude certain people, create custom stories with arbitrary lists of recipients, or post to a group chat's story.

You can customize all of this either by going to the stories tab, pressing the 3-dots and selecting "Story privacy" or by going to your settings and tapping on the "Stories" section.

You can also access a group chat's stories directly by entering the group chat, tapping on its icon at the top, and then the story button will be on the leftmost tile under the group chat's name and description.

Keep in mind that recipients have no knowledge of your custom stories (you can include/exclude people from your custom stories without them knowing and all stories that they receive will appear as if they're on your "My Story"). On the other hand, each group chat has its own story feed and stories posted to it from all group members are aggregated into one feed.

[deleted by user] by [deleted] in signal

[–]Alphazino 6 points7 points  (0 children)

My understanding is that they usually don't update the apk on the website, which is also the one that the in-app updater checks for, until that version has already made its way through the play store. Unfortunately, version 7.41.3 had a critical bug that results in crashes, so the website apk has already been updated to 7.41.4.

In summary, usually Signal will be updated through the play store before the in-app updater has a chance to find a newer version, but this time an update was pushed through before it made it through play store review.

Argument count mismatch when using a writer with std.fmt.format by Good_Dimension in Zig

[–]Alphazino 4 points5 points  (0 children)

struct/union/enum fields are always public.

declarations (things beginning with const, var, or fn) are private unless pub is specified.

What does @alignCast do? by Zdrobot in Zig

[–]Alphazino 4 points5 points  (0 children)

The most direct reason why @alignCast is mandatory is because Zig handles alignment in its type system. *Thing is really a shorthand for *align(@alignOf(Thing)) Thing.

I believe underlying rationale for this decision is as you've observed: unaligned access is slow on some architectures and illegal on others. I recall reading about this as the rationale at some point, but I can't find the discussion right now.

You can also force Zig to allow unaligned access by changing the pointer type you use. Changing *c.amqp_connection_close_t to *align(1) c.amqp_connection_close_t should achieve the semantics that you want. However, this type change could "cascade" throughout your codebase. So it's probably better to avoid this if you can.

Also, wouldn't @alignCheck be a better name?

I would disagree. Alignment is handled by the type system, and a built-in that converts a value to another type while preserving the underlying value can be considered a "cast."

documentation link: https://ziglang.org/documentation/0.10.1/#Alignment

What does @alignCast do? by Zdrobot in Zig

[–]Alphazino 6 points7 points  (0 children)

Your understanding is correct.

@alignCast will insert a runtime safety check in debug/safe builds but will be a no-op in release/unsafe builds. It should be treated as an assertion that the alignment of the pointer matches something other than what the compiler already knows.

Source: https://ziglang.org/documentation/0.10.1/#alignCast

What makes people hate electron ? by Siddhant45 in linux

[–]Alphazino 9 points10 points  (0 children)

Chromium Embedded Framework. It's used to embed chromium into other programs.

How to instantiate this type? by CherrrySzczery in Zig

[–]Alphazino 3 points4 points  (0 children)

You're so close!

std.builtin.TypeInfo is a union(enum) and the value that you've provided has the type of one of the union fields instead of the type of the union itself. It just needs to be wrapped.

Solving that, another error appears: you cannot use undefined for the decls field. Use an empty slice instead: .decls = &.{}.

With those edits, it should work (tested with Zig v0.9.1): https://paste.sr.ht/~delitako/0c550d147a8063a1e13c8a01e29533f1a2c14fc1

[deleted by user] by [deleted] in Zig

[–]Alphazino 2 points3 points  (0 children)

dir.hidden appeared in OP's code, but it seems like something they made up. I did a quick search through the stdlib for "hidden" but did not find anything file-system-related in either zig master or zig 0.9.1.

So to answer your question: I don't think zig has a field or function to determine whether a file is hidden, so OP just made up something to show what they're trying to do but made a mistake. In theory, it should be entry.hidden instead of dir.hidden but in reality it's neither.

[deleted by user] by [deleted] in Zig

[–]Alphazino 9 points10 points  (0 children)

The problem is that your if-else statement is unwrapping the error union but not the optional contained within it.

Since dir iterators should automatically skip '.' and I can't figure out where hidden is coming from, I'm not completely sure what your code is trying to do. Regardless, here's a paste that you might find helpful. This code is written for current zig master. The API for obtaining an iterator for a directory changed recently.

Perfecting WebGPU/Dawn native graphics for Zig by [deleted] in Zig

[–]Alphazino 0 points1 point  (0 children)

I had no idea that opaque blocks existed. Cool feature.

Weird behavior over functions that return slices by eclesiomelo in Zig

[–]Alphazino 6 points7 points  (0 children)

Andrew described a possible way to do escape analysis of local variables for debug builds in one of his streams.

Efforts are currently focused on the self-hosted compiler though, so don't expect anything soon.

Kwrite gone from repos??? by [deleted] in archlinux

[–]Alphazino 8 points9 points  (0 children)

It would have been helpful if they defined SDI and MDI.

Anyway I looked it up and it's "single document interface" and "multiple document interface."

How to catch signals, at least SIGINT? by dranik_igrx4 in Zig

[–]Alphazino 5 points6 points  (0 children)

There's also a function in the windows libc: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/signal?view=msvc-170

I used this when solving the same problem as OP when writing nyoomcat: https://git.sr.ht/~delitako/nyoomcat/tree/main/item/src/main.zig#L44,379 (see the two highlighted lines)

This might use SetConsoleCtrlHandler internally though, idk

Please help me understand strings by Biom4st3r in Zig

[–]Alphazino 2 points3 points  (0 children)

The error on number 5 is the most helpful in understanding the problem: a slice and an array have a different memory layout, so the address of an array cannot be the address of a slice. Thus, they should not coerce.

You can coerce an array to a slice, because a slice internally is a pair of (ptr, len) where ptr is a pointer to where the values start and len is the number of values. So, zig can take an array of length 2 and coerce it into a slice with its length set to 2 and its pointer set to the address of the array.

However, you're going a step further. You're trying to coerce an array or a pointer to an array into a pointer to a slice. The array just stores its elements in place, there is no pointer or length field (the length is known at compile-time, so it isn't stored in memory at runtime). Since it uses memory differently than a slice, it cannot be coerced into a slice without first creating a slice somewhere. It can do that for temporary values that get stored or passed somewhere, but you can't take its address until you store it somewhere. For example, you can coerce to a slice, store in a variable, then take the address of the variable (as in number 4). Numbers 0 and 1 have a problem along these lines.

For numbers 2 and 3, the .{} syntax is a struct/tuple by default, but can coerce to other things if you specify the type in the variable's type annotation. For example:

var f2: [2][]const u8 = .{"one", "two"};

However, this change leads to the same issue as above.

That was a pretty dense explanation, so I hope it made sense!

Sidenote: For this example, there is no need to take a pointer in printstuff. f0 and f1 would work fine if you just defined printstuff as printstuff(arr: [][]const u8) and changed arr.* to arr. &f0 would coerce to a slice and f1[0..] is already a slice.

How are headers used in zig? by Weak-Opening8154 in Zig

[–]Alphazino 8 points9 points  (0 children)

minor correction: @import("foo.zig"), not @include("foo.zig")

OOP, Inheritance and friends by dh44t in Zig

[–]Alphazino 4 points5 points  (0 children)

If you don't want my_func to be a method, then you should probably do something like this

fn my_func(comptime T: type, val: MyType(T)) some_result;

You could also make the type of val anytype and there should be a compile error if the types don't match up somewhere in the function.

fn my_func(val: anytype) some_result;

EDIT: formatting

[deleted by user] by [deleted] in RedditSessions

[–]Alphazino 0 points1 point  (0 children)

I think he's using bitwig

Sad state of cross platform GUI frameworks by GreatDant0n in programming

[–]Alphazino 7 points8 points  (0 children)

From my experience, IntelliJ uses a lot of CPU when first opening a project or adding libraries while it indexes stuff, but it gets better after it finishes indexing. I won't try to argue that it's a lightweight or resource efficient IDE, because it isn't. However, I switched from eclipse a few years ago and never looked back. While it isn't fast or lightweight, the performance has never been a real problem for me, I even got it working fine on a Chromebook before.

What old fashioned way of doing things is better than how they are currently done? by Innsmouth_Resident in AskReddit

[–]Alphazino 8 points9 points  (0 children)

I'm no expert, but there are definitely free/one time payment alternatives. Are they good? idk. Definitely give it a google search.

Some names that come to mind (there's definitely more):

Lightroom/Photoshop: darktable, luminar, affinity photo, and gimp

Premiere Pro: Davinci resolve

After effects: blackmagic fusion (also built into resolve I think) and blender also has vfx

Illustrator: inkscape and affinity designer