3,678 questions
Best practices
1
vote
4
replies
122
views
In Java, should I use `@Override` for record fields?
If my record implements an interface, with a field accessor implicitly implementing a method, it should be an instance of what the @Override annotation is meant to cover.
interface I { int f(); }
...
Advice
0
votes
2
replies
63
views
Is it possible to use Static_Predicate with a record type?
I wanted to define a record type with a Static_Predicate:
-- irregular_matrices.ads
generic
type Element_Type is private;
package Irregular_Matrices is
subtype Index_Type is Positive;
...
7
votes
1
answer
149
views
Records don't deserialize cycles
I stumbled upon something that got me curious. Apparently, serializing a record with a cyclic reference does not retain the cycle when deserializing it again, it becomes null. When doing the same ...
0
votes
1
answer
69
views
What is "freezing" and how to declare a vector of variant record type?
I've written the next piece of code in order to declare a vector of lexical elements:
type Lexical_Element_Kind
is (
Delimiter, -- & ' ( ) * + , - . / : ; < = > |
-- => .. ...
0
votes
1
answer
93
views
User Friendly Duplicate value message [duplicate]
I want to check to see if value from a form exists in Microsoft Access table using vba or macro that is user friendly but need help putting it together.
I've tried, Private Sub Donor_Key_LostFocus() I ...
1
vote
1
answer
85
views
How do I specify the correct record dependency version for my Flutter app in VSCode?
I want the app to record the user's voice and send it to a CSV file (Google Sheets). I have it working for user input so far. In my "pubspec.yaml" file, I've defined the record, ...
2
votes
1
answer
73
views
GHC.Record : Record data type may not be a data family
I would like to create a virtual record field "r" for the red component of a color using the Color package. This package uses a data family Color.
I tried to write the following :
import GHC....
2
votes
1
answer
141
views
Why is a field not initialized when using a custom record copy constructor?
I have this record:
record Foo {
string _bar = "initialized";
public string Bar => _bar;
}
I'm running the following code:
var foo = new Foo();
Console.WriteLine(foo?.Bar ?? &...
1
vote
1
answer
34
views
Null checks for record constructor arguments in Groovy
We are in the Groovy universe. Let's say I have a record like follows:
record Person(String firstName, String lastName, String city) {}
What is the shortest way to make sure that none of the three ...
2
votes
3
answers
187
views
Automatic property dependent on other properties
Let's say I have this:
class AA(string a, string b, string? c) {
...
}
record BB {
public string A { get; init; };
public string B { get; init; };
public string? C { get; init; };
...
1
vote
1
answer
78
views
SAS - Count how many times a value appear in a field for each record
I have the following SAS dataset, with a single columns called STAT (This field contains a series of values for each record):
I need to create a new field called CountOpen that, for each row, counts ...
1
vote
2
answers
172
views
Why do I get errors CS8803 and CS0106?
I am a new to C# and .NET 9. I am trying to execute the following program I found from the official MS tutorial - Create record types
public record Point(int X, int Y);
public static void Main()
{
...
6
votes
1
answer
176
views
How do I make a generic method that can convert all strings in a record to lowercase in Delphi?
I want a procedure that does something like this:
procedure RecordStringToLower(var MyRecord);
begin
// 1. Loop through all fields
// 2. Find string fields
// 3. Convert all string fields to ...
6
votes
1
answer
239
views
Can I trust the Delphi default() to initialize string in a record to be empty?
Given this declaration:
type
TRec = record
FNr: integer;
FName: string;
constructor Create(ANr: integer);
end;
and this implementation of the constructor:
constructor TRec.Create(ANr: ...
0
votes
3
answers
114
views
Shift data associated with an array's index based on filter data
I have an array of any values, as well as data associated with each value.
This data is stored as Record<string,FooData> where the key is generated using the index within the array.
However, I ...