Skip to main content
Filter by
Sorted by
Tagged with
1 vote
6 answers
222 views

I've been studying Java for some time now to better understand what goes on inside some of the code parts. While studying Enum, which I am used to using exclusively for listing various fixed values (...
Ice K's user avatar
  • 37
1 vote
0 answers
45 views

I've been struggling for two days with a PostgreSQL enum type issue in Entity Framework Core. Despite all my configuration, EF Core keeps trying to send a string (`text`) to an enum column. The ...
Мирон Никитин's user avatar
2 votes
3 answers
175 views

The C++ Coding guidelines, Enum.3: Prefer class enums over “plain” enums contains following example: void Print_color(int color); enum Web_color { red = 0xFF0000, green = 0x00FF00, blue = 0x0000FF }; ...
Erik Man's user avatar
  • 874
0 votes
1 answer
130 views

I have a RecylcerView List of CardViews. Each CardView holds user data that is saved in a Room database. Some of the CardViews have due dates that have been entered by the user with a TimePicker. I ...
AJW's user avatar
  • 1,587
0 votes
0 answers
36 views

I have an ENUM with some documentation about the values ("Description 1", "Description 2"): ENUM(MyEnum, v_int32, VALUE(VAL1, 3, "ME_VAL1", "Description 1"),...
Jaanus Sepp's user avatar
3 votes
1 answer
70 views

I am writing a Python config script that creates an array of input files in a domain-specific language (DSL), so my use case is a bit unusual. In this scenario, we want medium-level users to be able ...
globglogabgalab's user avatar
2 votes
1 answer
192 views

I'm working from the 2nd edition of "C++ (Teach Yourself Computing)" by Richard Reily, see here. When he introduces enum, he gives the following code, which is supposed to output 'Today is 2'...
Fisherman's Friend's user avatar
4 votes
3 answers
424 views

We use protocol buffers both for gRPC server-to-server communication and for publishing messages to Pub/Sub. Pub/Sub is fairly sensitive to schema changes, not allowing any schema changes that would ...
Mike Williamson's user avatar
1 vote
1 answer
89 views

I have a set of classes linked into an enum: #[derive(Default)] pub struct A { } #[derive(Default)] pub struct B { } #[derive(Default)] pub struct C { } enum Classes { A(A), B(B), C(C), ...
Alan Birtles's user avatar
  • 38.3k
1 vote
0 answers
91 views

Let's say there is an enum with fields with a specific order. e.g., pub enum MyValues { U8(u8), U64(u64), U128(u128), Str(Vec<U8>), U16(u16), } How to add a test to make ...
A. K.'s user avatar
  • 39.3k
1 vote
1 answer
80 views

I am currently using an enum for the object ids in my array. This is type-safe and works well. However, it means I have to maintain two separate data structures: The enum and the array. Instead, I ...
Ben's user avatar
  • 16.8k
-3 votes
1 answer
69 views

I have code analogous to the following: struct A(String); impl A { fn new(&str) -> Self ... } struct B(String); impl B { fn new(&str) -> Self ... } struct C(String); ...
lilHar's user avatar
  • 1,883
4 votes
1 answer
72 views

I've been writing Rust for a several months now, and I've come across this headscratcher: I have the following code: trait MyTrait {} impl MyTrait for String {} impl MyTrait for str {} impl MyTrait ...
lilHar's user avatar
  • 1,883
0 votes
0 answers
73 views

I am new to Rust, and I am trying to learn the language by solving puzzles on coding sites. For this reason, I can't use external crates, and I need a solution which relies only on the standard ...
Shai Avr's user avatar
  • 1,420
1 vote
1 answer
36 views

Django Admin: How to combine archived_at and archive_status into one archival source? I’m building a feature to archive users via Django Admin. Currently, I’m using both a DateTimeField (archived_at) ...
raza hussain's user avatar
-2 votes
2 answers
91 views

Today I wanted to write a simple Java enum (using java 21) with a little help from my IntelliJ IDEA. Just a simple enum with one value. This is what IntelliJ created for me: public enum MySimpleEnum { ...
Cesar's user avatar
  • 333
1 vote
1 answer
80 views

My goal is to plot a xy scatter plot in Grafana. X-axis is 'setting', and the potential values are 'off', 'idle', 'standby', and 'on'. On the y-axis I have 'performance' and the data type is real. My ...
Jorgensen's user avatar
0 votes
5 answers
3k views

TypeScript has added the erasableSyntaxOnly flag, that doesn't let you use Enums. Have looked for several alternative options. Like: What's the best practice to implement an alternative to ...
Chen Peleg's user avatar
  • 3,190
1 vote
1 answer
170 views

As such I (questioner) am no longer looking for an answer but I am not sure on what grounds to recommend closing. It could possibly be helpful to someone. Here's an example of what I mean (based on ...
mike rodent's user avatar
  • 16.1k
0 votes
2 answers
73 views

I'm working on a Django project where we use models.TextChoices for fields like current_status. Our client requested wording updates — for example, renaming "Contacted" to "Contacted ...
raza hussain's user avatar
2 votes
0 answers
27 views

I have urls defined like this: E_one = '/url1/' E_two = '/url2/' E_three = '/url3/' export LINKS = { E_one: E_one, E_two: E_two, E_three: E_three} So I import 'LINKS', but then I want to dynamically ...
Travis Heeter's user avatar
1 vote
1 answer
65 views

I have this Dir type alias that is a set of 8 cardinal directions, used as an enum: type Dir = "N" | "NE" | "E" | "SE" | "S" | "SW" | "...
bigyihsuan's user avatar
0 votes
2 answers
42 views

For a Python3.13 project, I'm interested in objects created by Enum (e.g. MyEnum.VALUE); I need to serialize them ‘manually’ (=no marshal, no pickle). I think I've noticed several circular references ...
suizokukan's user avatar
  • 1,379
2 votes
3 answers
93 views

I have a typescript enum MyEnum: export enum MyEnum { ALPHA = 'ALPHA', BETA = 'BETA' } I want to use the enum values as properties of another class. I know can do stuff like that: export class ...
elcye's user avatar
  • 413
2 votes
2 answers
70 views

I have a situation where from upstream I get a union string, but downstream needs to use enums to express enumerated types. The types happen to overlap perfectly, but I need a way to treat them as the ...
dwjohnston's user avatar
  • 12.5k

1
2 3 4 5
458