composite

F# - constructing nested types

依然范特西╮ 提交于 2021-02-19 07:13:18
问题 I guess this is pretty basic F# question: Types are: type Id1 = | Id1 of int type Id2 = | Id2 of string type Id = | Id1 | Id2 type Child = { Id : Id; Smth : string list } type Node = | Child of Child | Compos of Node * Node where Node and Child should represent replacement for Composite OOP design pattern. The problem is that I cannot instantiate types in this way: let i1 : Child = {Id = Id1(1); Smth = []} //Id1 value is not a function and cannot be applied let i2 : Child = {Id = Id1(1); Smth

F# - constructing nested types

眉间皱痕 提交于 2021-02-19 07:12:56
问题 I guess this is pretty basic F# question: Types are: type Id1 = | Id1 of int type Id2 = | Id2 of string type Id = | Id1 | Id2 type Child = { Id : Id; Smth : string list } type Node = | Child of Child | Compos of Node * Node where Node and Child should represent replacement for Composite OOP design pattern. The problem is that I cannot instantiate types in this way: let i1 : Child = {Id = Id1(1); Smth = []} //Id1 value is not a function and cannot be applied let i2 : Child = {Id = Id1(1); Smth

Composite Primary Key and Auto_Increment [duplicate]

♀尐吖头ヾ 提交于 2021-02-07 03:46:26
问题 This question already has answers here : mysql two column primary key with auto-increment (4 answers) Closed 7 years ago . I'm trying to do the composite key with one of them auto incrementing, but when I try to enter a new row it just continue the sequential. Here's the example of what happens: Item_1 | Item_2 1 | 1 1 | 2 2 | 3 2 | 4 2 | 5 Here's the example of what I want: Item_1 | Item_2 1 | 1 1 | 2 2 | 1 2 | 2 2 | 3 I create the table this way: CREATE TABLE IF NOT EXISTS `usuarios` ( `cod

Composite Primary Key and Auto_Increment [duplicate]

一个人想着一个人 提交于 2021-02-07 03:44:27
问题 This question already has answers here : mysql two column primary key with auto-increment (4 answers) Closed 7 years ago . I'm trying to do the composite key with one of them auto incrementing, but when I try to enter a new row it just continue the sequential. Here's the example of what happens: Item_1 | Item_2 1 | 1 1 | 2 2 | 3 2 | 4 2 | 5 Here's the example of what I want: Item_1 | Item_2 1 | 1 1 | 2 2 | 1 2 | 2 2 | 3 I create the table this way: CREATE TABLE IF NOT EXISTS `usuarios` ( `cod

Reduce size of an image when it is fusioned with other using ImageMagick from terminal in Linux

和自甴很熟 提交于 2021-01-29 11:45:46
问题 I am having these two pictures, labeled 1.png and 2.png , respectively: When I run this code from ImageMagick in my Linux terminal: composite -blend 75 -gravity West 2.png 1.png prueba.png I get this result: However, I would like the logo ( 2.png ) to be half or one-third size reduced and placed in the bottom left corner. How can I do it from the terminal? 回答1: You can do that in ImageMagick by using the convert syntax. It is more flexible than the composite syntax. convert 1.png \( 2.png

Gradle Composite Build, transitive dependency is not resolved

半世苍凉 提交于 2021-01-28 09:57:21
问题 First off, I'm sorry I have to showcase the problem in pseudocode, because the original library code is closed source and the overall build process is a little more complicated. The Problem is as follows: We have a project A, which uses an inhouse library B. This Library uses several opensource libraries, we call them C and D for now. For debugging purposes I want to create a gradle composite build of project A, which includes library B using, includeBuild . Project A: settings.gradle

Gradle Composite Build, transitive dependency is not resolved

大兔子大兔子 提交于 2021-01-28 09:56:23
问题 First off, I'm sorry I have to showcase the problem in pseudocode, because the original library code is closed source and the overall build process is a little more complicated. The Problem is as follows: We have a project A, which uses an inhouse library B. This Library uses several opensource libraries, we call them C and D for now. For debugging purposes I want to create a gradle composite build of project A, which includes library B using, includeBuild . Project A: settings.gradle

Constraint to prevent violation of FK constraint in a third table

跟風遠走 提交于 2020-03-09 05:39:48
问题 I can implement the constraints that I want in stored procs, but I'm wondering if I can define a set of foreign key constraints which will do the job. I have several tables, with these key relationships: NSNs --- Id PK Solicitations ---- Id PK NSNId FK - NSNs Parts ----- Id PK NSNId FK - NSNs BaseRFQs ------- Id PK NSNId FK - NSNs RFQs ---- Id PK BaseRFQId FK - BaseRFQs BaseRFQsSols ------------ BaseRFQId PK/FK - BaseRFQs SolId PK/FK - Solicitations RFQsSolsParts ------------- RFQId PK/FK -

r compute composite score and cronbach's alpha for multiple variables in a data frame and add them as columns

六月ゝ 毕业季﹏ 提交于 2020-03-05 06:05:22
问题 I want to calculate a composite score and cronbach's alpha for multiple variables in my data frame and add the results as columns to the data frame. Here is what my data frame looks like: t1pp_1 t1pp_2 t1pp_3 t1pp_4 t1se_1 t1se_2 t1se_3 t1se_4 t1cpl_1 t1cpl_2 t1cpl_3 t1cpl_4 6 3 5 3 4 3 4 3 1 2 2 3 7 4 7 6 5 5 4 5 5 5 5 5 4 4 6 5 4 4 4 4 1 2 3 2 5 5 7 5 4 5 4 5 5 4 4 4 4 2 6 6 4 4 3 4 4 4 2 3 6 5 7 5 1 1 4 4 1 2 2 2 Here is what I tried and of course this doesn't work, but maybe it gives you

JAXB and Composite Pattern

二次信任 提交于 2020-02-06 04:15:46
问题 I'm working with JAXB right now and I'm struggling to annotate my composite notion of precondition query so that JAXB would be happy. A precondition query can be: simple : only a text node containing the query compound OR : the preconditions of 1 precondition query OR the other matches AND : the preconditions of 1 precondition query AND the other matches Of course, compound queries can be made of compound queries, just like in the following example: <precondition> <or> <and> <query>foo</query