3,678 questions
Best practices
1
vote
4
replies
127
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
153
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
72
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
88
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
144
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
190
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
175
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
177
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
241
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 ...
5
votes
1
answer
182
views
Why does the default equality comparer for records behave differently when the record contains certain fields and is accessed by list index?
Using TEqualityComparer<T>.Default for record types seems to "work" in some situations ("work" as in checking for value-equivalence across all fields between two records), ...
1
vote
0
answers
57
views
After a call to TAdsTable.AdsGotoTop, the TAdsTable.Bof function returns False but not True
I don't understand why TAdsTable.Bof does not return True after a call to TAdsTable.AdsGotoTop.
The question may seem stupid, but I want to understand the real reason why this happens.
I'll give an ...
1
vote
1
answer
119
views
Unexpected Duplicate Configuration Values in .NET 8 WorkerService
I'm developing a .NET 8 WorkerService project where I load configuration from multiple sources (e.g., appsettings.json and appsettings.Development.json). My configuration file defines a section Units ...
1
vote
2
answers
321
views
Avoiding null attributes in records
I have the following record. But the collection cannot be null. Is there a way to default it to an empty list if it's null?
public record Car(
long id,
String model,
List<...
0
votes
0
answers
21
views
I want to save 5+ waves which is in different sizes using the RT-lab opwritefile block
I want to save 5+ waves which is in different sizes and different sample times using the RT-lab opwritefile block.
But the max RT-lab opwritefile group number is only 5.
max opwritefile group number
...
0
votes
0
answers
46
views
how to return dynamic columns with multiple records with out passing a columns to functions returning "record" in PostgreSQL [duplicate]
I have a table like below
create table public.test_dynamic_data_tbl(col1 int,col2 character varying,col3 double precision);
insert into public.test_dynamic_data_tbl values(1,'test1',12)
insert into ...
1
vote
1
answer
258
views
Record Class with findAll with Spring Data JPA
I am using SpringBoot 3.4.2 (latest as of right now) I can create RESTful controllers that access the Service, and then we make a Repository call to get data from the database which all works 100%. ...
0
votes
2
answers
234
views
Record vs. typical class
I don't understand why the authors of Dart defined fields of record instance as 'final'.
I think, that Record concept is convenient shortcut to create typical class. But fields in class don't have to ...
0
votes
1
answer
145
views
Get value from a record using a combobox
Ok, this seems quite basic, but I can't figure out.
I have a record myRecord = {key1: "value1", key2: "value2"}
I also have myCombo with the options ["key1", "key2&...
0
votes
0
answers
114
views
Can you map a record struct or list of record struct-s in Entity Framework Core 9?
I am a bit confused as to whether EF Core 8 and 9 support owned record structs and collections of those or not (ChatGPT says you can do it and even gives me examples...).
Am I doing something wrong, ...
0
votes
1
answer
111
views
Complex JSON Serialization and Deserialization of record in C#
I'm diving into the world of Functional Programming in C# and trying to replicate some of my projects using functional programming. One aspect of functional programming is functions and immutability.
...
1
vote
0
answers
51
views
Flutter App Crashes During Real-time Audio Playback with Fatal Signal 6 (SIGABRT)
Description
I am developing a Flutter app designed to assist people with hearing impairments by playing real-time audio from the microphone to the speaker. The app uses a recorder to capture audio and ...
-1
votes
1
answer
34
views
sorting internal index of multidimensional array with column in PHP
I have a JSON record I converted to a PHP array.
$db=array(
array("Name"=>"Beans","Price"=>"10"),
array("Name"=>"Salad","...
0
votes
0
answers
45
views
Creating Multiple New Records at Same Time in Existing Access/SQL Table [duplicate]
I have been asked by our company to begin work on a new Sample Register for test pieces we handle. I have found a way to append information to a list of samples once they have been allocated a number. ...
0
votes
1
answer
162
views
C# records, is there a way to property Name is a part of a record so I can use with expression?
I am writing a library similar to Fluent Validator that will allow object modification. For ordinary classes, it works without a problem but I try to code a similar approach with a record and stumble ...
0
votes
1
answer
66
views
Declare record type from object or table type
I have an object type type_object created in the database and want to declare a record type type_record in a package for fetching data in a loop using a ref cursor, which doesn't seem to work with an ...
0
votes
2
answers
114
views
How to Solve Law of Demeter Violation in Java Records?
I am using the below record in my Quarkus application and at some point I need to access the requestId field, located in Statements nested record. I want to avoid using the getters provided by the ...
-1
votes
2
answers
108
views
Sort numbers in Latex file between delimiters [closed]
I have a latex file which consists of a list of about 10,000 records consisting of a head word plus reference numbers separated by a comma. Some numbers are marked with latex codes.
ʾallik \refnumbers{...
2
votes
1
answer
688
views
How to convert Record to Table in Nushell?
I found how to convert Table to Record using the following code
here.
let fruits_original = [[key, value]; [apple 10] [banana 42] [mango 5]]
let fruits = $fruits_original | reduce -f {} {|it, acc| $...
0
votes
2
answers
305
views
Oracle APEX 24.1: Generate page links from placeholders in text
I'm converting an old Perl/MySQL database application to Oracle APEX and there's one feature in the old system that I've been unable to figure out a way to do...
Assume that each table is made up of a ...
1
vote
0
answers
34
views
Can the chunk size or IMFSample of the IMFSourceReader:: OnReadSample method be modified?
I use Flutter to call the record package and start the recording stream on Windows.
The audio format I set is 16bit PCM, 48000HZ, signal channel.
The source code in the package uses IMFSourceReader, ...
1
vote
1
answer
184
views
Record’s field as formal parameter of procedure in Delphi
I want to create a procedure which performs some manipulations on a variable record type. Globally, I have an array of records. I want to sort the array, but by the records’ fields. I want to pass the ...
0
votes
0
answers
82
views
Why can't record struct contain init property?
This is my C# code:
record struct recName(int A) { }
And this is generated code behind the scenes:
internal struct recName : IEquatable<recName>
{
public recName(int A)
{
<A&...
0
votes
1
answer
50
views
Cloudkit records disappeared
App crashed showing error index out of range. In cloudkit dashboard, querying the table showed half of the records missing.
No changes were made neither to the app nor the database since the last ...
-2
votes
3
answers
438
views
Best way to fix data inconsistency [closed]
If you have a column in your table that contains inconsistent data for destinations, for example some may be "New York", some "New York, USA", "NY", etc. for different ...
1
vote
1
answer
57
views
How to make different record `type`s unequal
I am learning PureScript due to not being satisfied (in particular) with TypeScript's type safety of what's called "records" in PS. While doing so I stumble upon the exact same problem in PS,...
1
vote
2
answers
67
views
Intersection of Record with generic key extending template literal doesn't infer result of index access
In principle (T & Record<K, U>)[K] should evaluate to U but it doesn't seem to work in the case where K is generic and extends a template literal.
function foo3<
K extends `a${string}`...
0
votes
2
answers
422
views
'record' keyword not working in Visual Studio
When I try to use the record keyword in my C# WPF .NET Framework file, it is recognised as a keyword, in the sense in appears in the code completion drop-down menu when you start typing, but then does ...
-2
votes
3
answers
162
views
Batch Script to split record by fixed length [closed]
I have an input text file with a single line having thousands of records one after another. I want to split them after length of 10 characters each.
**Input Record** -
====================== Begin of ...
3
votes
1
answer
541
views
Override Equals method on records
Consider this Minimal Reproducible Example.
Point point1 = new Point(1, 2, 3);
Point point2 = new Point(1, 2, 31);
Console.WriteLine(point1 == point2); // True
Console.WriteLine(point1.Equals(point2)...
2
votes
2
answers
127
views
Why is record class's bool Equal(R obj) a virtual method
From the spec:
The record type implements System.IEquatable<R> and includes a
synthesized strongly-typed overload of Equals(R? other) where R is the
record type. The method is public, and the ...
0
votes
2
answers
64
views
How to duplicate records in pandas dataframe based on column values
I have created a pandas dataframe as follows:
ds = {'col1' : ["A","B"], 'probability' : [0.3, 0.6]}
df = pd.DataFrame(data=ds)
The dataframe looks like this:
print(df)
col1 ...
2
votes
1
answer
205
views
Using generics to match a single string literal in Typescript
The class MyClass interfaces with an indexing sub-system that requires each record (Record<string, any>) to contain a specific primary key field. I'm trying to use Typescript's type system to ...
2
votes
2
answers
181
views
Do string variables in records get freed when the record goes out of scope?
In Delphi you can declare a record containing a String. This means the record just contains a pointer the heap when the string is located; does the heap memory get freed when this record goes out of ...
1
vote
2
answers
73
views
Is there any advantage of using a closed record with a rest descriptor over an open record?
Consider the scenario where we create a record for capturing a JSON payload. (application/json content type)
Is there any benefit of using a closed record with a JSON type rest descriptor over an open ...