Giter Club home page Giter Club logo

Comments (10)

nqthqn avatar nqthqn commented on August 31, 2024 2

"none" would be when border does not have a time

from craconweb.

daved avatar daved commented on August 31, 2024 1

I need to add the field for grey/gray. Is there any preference for spelling? Also, I screwed up the gcycle insertion query (missed the timeout column) and will fix that today.

from craconweb.

daved avatar daved commented on August 31, 2024

That's it! The reason grey and blue were both included was because of black.

IF blue != true && grey != true THEN border = black

Or is the logic more complex than I'm aware of?

Also -
What is none VS dash?

from craconweb.

nqthqn avatar nqthqn commented on August 31, 2024

if the border is dashed or if there is no border

from craconweb.

daved avatar daved commented on August 31, 2024

IF dash == true THEN border = dashed
ELSE border = solid

IF border != "0" THEN border = "existing"
ELSE border = none

IF blue != true && grey != true THEN border = black

I believe this covers the possibilities. The only issue is that blue and grey can both be true. Though, having true for three colors does not avoid that either.

from craconweb.

abadi199 avatar abadi199 commented on August 31, 2024

So, technically, we only have 5 possible border colors and styles:

  • solid black (black)
  • solid blue (blue)
  • solid grey (grey)
  • solid white (none)
  • dashed black (dash)

I think we need at least 4 fields, otherwise, we won't be able to reperent none. Maybe we should just call them solidblue, solidgrey, solidblack, and dashedblack. none is just when all 4 are false

from craconweb.

daved avatar daved commented on August 31, 2024

@abadi199
We already (should) have four, so you're correct!

  • blue
  • grey
  • dash
  • border

from craconweb.

nqthqn avatar nqthqn commented on August 31, 2024

How about gray, cuz, 'merika.
http://grammarist.com/spelling/gray-grey/

from craconweb.

daved avatar daved commented on August 31, 2024

I'm graytful greatful grateful for your answer.

Also, this is done.

Here is the sql to upgrade the db without rollback/migrate. Preserving the gcycle data was important enough to me to write this up:

BEGIN TRANSACTION;

--

ALTER TABLE gcycle_ugimage RENAME TO tmpx_gcycle_ugimage;

CREATE TABLE tmp_gcycle_ugimage (
    gcycle_ugimage_id BIGINT UNSIGNED NOT NULL PRIMARY KEY,
    gcycle_id BIGINT UNSIGNED NOT NULL,
    ugimage_id BIGINT UNSIGNED NOT NULL,
    sort INT UNSIGNED NOT NULL DEFAULT 0
);

INSERT INTO tmp_gcycle_ugimage
(gcycle_ugimage_id, gcycle_id, ugimage_id, sort)
SELECT gcycle_ugimage_id, gcycle_id, ugimage_id, sort
FROM tmpx_gcycle_ugimage;

DROP TABLE tmpx_gcycle_ugimage;

--

ALTER TABLE gcycle RENAME TO tmp_gcycle;

CREATE TABLE gcycle (
    gcycle_id BIGINT UNSIGNED NOT NULL PRIMARY KEY,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP,

    gsession_id BIGINT UNSIGNED NOT NULL,
    sort INT UNSIGNED NOT NULL DEFAULT 0,
    fixation BIGINT UNSIGNED NOT NULL DEFAULT 0,
    selection BIGINT UNSIGNED NOT NULL DEFAULT 0,
    pictures BIGINT UNSIGNED NOT NULL DEFAULT 0,
    redcross BIGINT UNSIGNED NOT NULL DEFAULT 0,
    probe BIGINT UNSIGNED NOT NULL DEFAULT 0,
    border BIGINT UNSIGNED NOT NULL DEFAULT 0,
    timeout BIGINT UNSIGNED NOT NULL DEFAULT 0,
    width INT UNSIGNED NOT NULL DEFAULT 0,
    height INT UNSIGNED NOT NULL DEFAULT 0,
    blue BOOL NOT NULL DEFAULT 0,
    gray BOOL NOT NULL DEFAULT 0,
    dash BOOL NOT NULL DEFAULT 0,
    probe_index BIGINT UNSIGNED NOT NULL DEFAULT 0,
    target_index BIGINT UNSIGNED NOT NULL DEFAULT 0,
    selected_index BIGINT UNSIGNED NOT NULL DEFAULT 0,
    start_index BIGINT UNSIGNED NOT NULL DEFAULT 0,
    FOREIGN KEY(gsession_id) REFERENCES gsession(gsession_id)
);

INSERT INTO gcycle
(gcycle_id, created_at, gsession_id, sort, fixation, selection, pictures, redcross, probe, border, timeout, width, height, blue, dash, probe_index, target_index, selected_index, start_index)
SELECT gcycle_id, created_at, gsession_id, sort, fixation, selection, pictures, redcross, probe, border, timeout, width, height, blue, dash, probe_index, target_index, selected_index, start_index
FROM tmp_gcycle;

DROP TABLE tmp_gcycle;

--

CREATE TABLE gcycle_ugimage (
    gcycle_ugimage_id BIGINT UNSIGNED NOT NULL PRIMARY KEY,
    gcycle_id BIGINT UNSIGNED NOT NULL,
    ugimage_id BIGINT UNSIGNED NOT NULL,
    sort INT UNSIGNED NOT NULL DEFAULT 0,
    FOREIGN KEY(gcycle_id) REFERENCES gcycle(gcycle_id),
    FOREIGN KEY(ugimage_id) REFERENCES ugimage(ugimage_id),
    UNIQUE (gcycle_id, ugimage_id) ON CONFLICT FAIL,
    UNIQUE (gcycle_id, sort) ON CONFLICT FAIL
);

INSERT INTO gcycle_ugimage
(gcycle_ugimage_id, gcycle_id, ugimage_id, sort)
SELECT gcycle_ugimage_id, gcycle_id, ugimage_id, sort
FROM tmp_gcycle_ugimage;

DROP TABLE tmp_gcycle_ugimage;

--

COMMIT TRANSACTION;

from craconweb.

nqthqn avatar nqthqn commented on August 31, 2024

a, b = b, a

thanks

from craconweb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.