Skip to main content
Filter by
Sorted by
Tagged with
13 votes
4 answers
1k views

I tried to write the following code and it was rejected by the compiler: #include <type_traits> struct Base { virtual void f() {} }; template <typename T> struct Derived : Base { ...
Olly's user avatar
  • 301
Advice
0 votes
3 replies
86 views

In PostgreSQL, it is easy to set a uniqueness constraint for two columns using CONSTRAINT UNIQUE. For example CREATE TABLE someTable ( id serial PRIMARY KEY, col1 int NOT NULL, col2 int ...
Alexander Fedorov's user avatar
-2 votes
1 answer
86 views

I have implemented this code to add a check constraint after creating the table ALTER TABLE recruitment_data.candidate_experiences ADD CONSTRAINT chk_experience_dates CHECK ( ...
Beliz Yazici's user avatar
3 votes
2 answers
141 views

I'm trying to create a package of generic adjacency matrices to define graphs, and the first goal is to define a static version based on two-dimensional array: with Ada.Containers.Vectors; generic ...
tymurmchyk's user avatar
0 votes
0 answers
74 views

I’m on GridDB Cloud (Free). For a TimeSeries container, I want each device to have at most one row per timestamp, i.e., enforce uniqueness on (ts, deviceid). Schema: CREATE TABLE TSDB ( ts TIMESTAMP ...
Badhon Ashfaq's user avatar
-2 votes
2 answers
148 views

[EDIT] Hi everyone, I am looking for clues to work out a sorting formula with Sheets. We are planning "teambuilding" school trips at our international college. I need to split a list of 200+ ...
peritus's user avatar
6 votes
2 answers
192 views

I'd like to enforce a CRTP template parameter to be an actual derived type. Unfortunately it seems to be impossible to express that as a constraint. The problem is that the constrained type is ...
Bernd's user avatar
  • 2,469
0 votes
1 answer
64 views

Can someone help me with system verilog constraint for the below requirement.1) Fixed queue size of 10 and has four 6s in it at random position. I tried the below constraint to start with. class ...
User99's user avatar
  • 11
1 vote
1 answer
75 views

I have this datatype newtype Dimension a b = MkDimension b Whenever it is properly formatted (e.g. satisfies the format constraint), I want to derive a set of classes. I do not want a Dimension which ...
Ashok Kimmel's user avatar
0 votes
2 answers
83 views

I have the following code func setupUI() { self.view.backgroundColor = .white let titleLbl = UILabel() titleLbl.text = book.title titleLbl.textColor = .black ...
Chris Hansen's user avatar
  • 8,781
1 vote
0 answers
32 views

My problem is: I have to optimize my collaborative assembly line with solving a bi-objective optimization model using metaheuristics. We chose to start with GRASP. The two objectives are to minimize ...
Hind Bhr's user avatar
1 vote
1 answer
121 views

Why is my deferred constraint checking an intermediate state and not the final state of the record? We use PostgreSQL 16.9 for our database and we use Python3 and Psycopg2 to manage our data pipeline. ...
Marissa's user avatar
  • 13
4 votes
3 answers
128 views

I am trying to split my code into nice modules. However, while doing this, one of the classes I have in the imported module (Outer in Module 1 below) needs a constraint that is only known in the ...
Niek Janssen's user avatar
2 votes
2 answers
152 views

Can I have a foreign key constraint that takes a timestamp column but uses it as date only? I'm trying something like this but it doesn't work: alter table table1 add constraint my_constraint ...
runnerpaul's user avatar
  • 7,580
4 votes
1 answer
73 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
48 views

I am trying to estimate a Bayesian logistic model (with a latent variable and two comparison groups, apart from model parameters), while specifying that two parameters should be equal. My SAS code ...
user2450223's user avatar
0 votes
0 answers
25 views

example: I have a clazz table, with name and package name, the two columns need unique together. class clazz { long id; // primary key QString name; // class ...
Shaobin Qian's user avatar
0 votes
1 answer
99 views

I want to make sure, that a column doesn't have a value that exists in another column of another table. It is kind of like a negative foreign key check, if you will. However adding a constraint doesn'...
Caulder's user avatar
  • 459
1 vote
1 answer
40 views

a constraint requires me that. "the value of B, present in table B1, must always be less than that of A present in table C1". is it correct to implement two triggers to do this? one that is ...
dok's user avatar
  • 469
2 votes
1 answer
136 views

I have this pydantic model with a field, and this field could be either an int or a non numeric value like a str or list. from pydantic import BaseModel, Field class Foo(BaseModel): bar: str | ...
A-Abe's user avatar
  • 75
1 vote
3 answers
235 views

We have two columns, id_begins and id_ends. We use a BETWEEN statement to select the row where a specific id number will fit between the values in those two fields (including the begins and ends ...
dallin's user avatar
  • 9,514
0 votes
1 answer
44 views

I'm trying to migrate a MS-Access DB into MySql using MySQL Workbench. During the migration I get a "Failed to add the foreign key constraint. Missing index for constraint 'RegistrationsInvoices' ...
Bob-it's user avatar
  • 119
1 vote
1 answer
83 views

I am trying to implement a predecessor constraint similar to the Job Scheduling example given in java. But I struggle with the ordering constraint definition to consider predecessors. I have defined ...
NCointe's user avatar
  • 13
5 votes
1 answer
111 views

I have a following class: template<typename Population, typename... Operators> class GA { public: template<typename Evaluator, typename std::enable_if_t< std::...
Peter's user avatar
  • 121
0 votes
4 answers
201 views

I'm new to Minizinc, and I want to solve the following problem. I have a given matrix of 6x6 cells. Rows are numbered from 1..6, columns from A..B. All cells shall be filled with digits from 1..9 by ...
Guenther's user avatar
-2 votes
2 answers
69 views

I have a requirement to create a system for storing organization information. My client does re-organization maybe once a year and changes the names and codes of the organization. There are cases ...
ads's user avatar
  • 1,743
0 votes
1 answer
33 views

I have this table that stores historical data of a record. Any update even with code and name fields should insert a new record of the same id but may have different values for code, name and ...
ads's user avatar
  • 1,743
2 votes
1 answer
113 views

If you apply return to 'a' you get a value of type m Char, belonging to the Monad class: :t return 'a' → return 'a' :: Monad m => m Char. If you apply the resulting value to some other value, say, ...
Skab's user avatar
  • 83
2 votes
1 answer
53 views

I need to find a way to write an independent routine to add a particular constraint to a minimization problem in solnl() With a concrete example, one has this ##### for optimization library(MASS) ...
SuperLeo's user avatar
  • 135
1 vote
1 answer
82 views

I am working on optimizing the decision threshold of a trained decision model for a binary case (targets 0 and 1). I want to optimize the decision threshold of the model, i.e. the point at which the ...
emil's user avatar
  • 343
2 votes
1 answer
137 views

In the documentation for mgcv::pcls(), an example of constructing a monotonically increasing gam model is provided with the following code: set.seed(1234) # added for reproducibility in this post only ...
langtang's user avatar
  • 25.3k
2 votes
1 answer
87 views

I have four tables (simplified) CREATE TABLE ProductDetails ( ProductID int, ProductName varchar(50), CONSTRAINT PK_ProductDetails PRIMARY KEY (ProductID) ); CREATE TABLE CaseDetails -- ...
Brady Hinman's user avatar
2 votes
0 answers
54 views

One can express (a ~ b), but can one write something like (a !~ b)? My hunch is that no, since in a handwawy way constraint resolution is analogous to search, and one can't conclusively say there's no ...
ron's user avatar
  • 9,458
1 vote
1 answer
86 views

I'm trying to use multi language by domain, for example I have domain.fi.local for language Finnish and domain.es.local for language Spanish and on every of them you can switch to English and I have ...
narovi's user avatar
  • 9
-1 votes
1 answer
68 views

I am working with UIKit. I have a main view that contains a few stack views + few label views + a horizontally scrollable collection view. I am then adding this main view to a superview. I would like ...
luismps's user avatar
  • 43
1 vote
0 answers
53 views

Say I have a function f(x,y,z) I want to minimize using scipy.optimize.minimize. I want to minimize it subject to the constraint x < y < z. I don't think I can use the bounds argument to do this ...
Ben's user avatar
  • 539
0 votes
1 answer
132 views

I want to add a column of type TEXT, NOT NULL, with a DEFAULT value of empty string, which should reference a column in a different table. I can add foreign key references when creating a table. But ...
Martin's user avatar
  • 21
7 votes
1 answer
86 views

I have an NxM grid of square cells. traversal can only happen in North, South, East and West directions in the cells. Some of the cells are blocked and cannot be traversed. A bot is given a start and ...
Lucinda Rigetti's user avatar
1 vote
5 answers
399 views

The Hitori puzzle consists of an nxn grid filled with numbers 1..n, some of them repeated in rows and/or columns. The goal is to cover some of the repeated numbers so that i) there are no repeated ...
donman's user avatar
  • 67
0 votes
1 answer
74 views

I am having difficulty getting all classrooms to be assigned to a class for a room assignment problem. I am using a grid calculated based on class capacity & room capacity (values 0-1). ...
user29393214's user avatar
0 votes
0 answers
55 views

I am trying to train a constrained Hidden Markov Model using the hmmlearn package but I faced some issues. I override the CategoricalHMM class and set certain transitions to 0 after each M-step as ...
fypstudent's user avatar
0 votes
1 answer
39 views

The sum of the elements of an array needs to be one while the elements adhere to certain maximum and minimum constraints. If the element is smaller than the minimum allowed value, it element may be ...
Lise Prinsloo's user avatar
0 votes
0 answers
25 views

I have an abstract class that consumers of my library are expected to implement: public abstract class StatusIndicator { protected StatusIndicator(Class<? extends StatusIndicator> thisClass) { ...
bobbyrne01's user avatar
  • 6,843
0 votes
0 answers
19 views

We would like to control the naming of contraints when JpaBuddy generates Liquibase from Jpa Entities. When I add the names explicitly e.g. via @ForeignKey JpaBuddy makes them upper case what I don't ...
Christian Schmitz's user avatar
1 vote
1 answer
118 views

In my C# application, I have an abstract class that is a wrapper around UnitsNet library to group closely related properties (such as a numeric value and unit for that value that user has chosen), to ...
K.S.'s user avatar
  • 77
0 votes
0 answers
50 views

I Have 3 tables ProdVariant, Variant, VariantValues. ProductVariant ---------------------------- ProductVariantID PK ProductID FK NOT NULL VariantID FK NULL ...
Miff's user avatar
  • 15
1 vote
1 answer
87 views

I'm building myself a parsing library, and I found a key distinction between two types of declared trait bounds. Take the following trait: pub trait Parsable: FromStr<Err: Display> {} With this,...
Levente Bokor's user avatar
0 votes
0 answers
37 views

I am working on an OLS regression problem where: The dependent variable (target) ranges from 1 to 6 (with steps of 1). The independent variables range from 1 to 10 (with steps of 0.5). I want to set ...
ASD's user avatar
  • 47
0 votes
1 answer
1k views

I'm trying to seed data into my Supabase database but even though my seed.sql (generated by Supabase) includes SET session_replication_role = replica at the top, constraints are still being enforced. ...
Joel Castro's user avatar
0 votes
0 answers
71 views

Problem Description I am trying to add a constraint to my scheduling optimization problem to ensure that generated timetables have consecutive hours (i.e., no gaps between time slots within a day). ...
Amoux's user avatar
  • 5

1
2 3 4 5
180