Best [Insert row / Remove row] user action for table on touch screen

I have to code a widget displaying a table on a touch screen and I’m wondering what is commonly used to do so? I thought about holding click down between two rows to insert and holding click down on a row to remove it, just like this:

enter image description here

Since it’s my first time in the touch screen world, how can I make it intuitive and help the user to “guess” the way he can insert and remove? Because on a regular computer I’d pop some kind of tooltip, if the key stops to move, but touch screens are different because finger is not held when moving.

¿Cómo crear un insert dinámico?

Tengo el siguiente escenario: [![introducir la descripción de la imagen aquí][1]][1]

Donde he logrado hacer un formulario dinámico de la siguiente manera. He creado una consulta que selecciona las columnas nombre, comment y extra, para poder mostrar el nombre de la columna mediante un comentario en la base de datos y además poder seleccionar aquellas columnas que no contengan el ‘AUTO_INCREMENT’. Además del nombre de la columna en si misma para poder apuntar a ella. Quedando la consulta de la siguiente forma:

[![introducir la descripción de la imagen aquí][2]][2]

En cuanto al formulario dinámico, tiene un array que mediante la variable $ ntabla (que recoge en cada momento la tabla que el usuario selecciona) muestro los inputs correspondientes de cada columna:

include("connect.php"); $  sqlnames="select `column_name`, `column_comment`,`extra` from `information_schema`.`COLUMNS` where `table_name` = '$  ntabla' and `extra` != 'AUTO_INCREMENT'"; $  names = mysqli_query($  conexion, $  sqlnames); ?>  <div class="form-style-5 position">     <form action= "#" method="post">          <h2>Registro</h2>                 <?php while(($  resfila = mysqli_fetch_array($  names,)))           {              $  i=1;             ?>              <div class="col-25">                 <label><?php echo $  resfila[1]; ?></label><br/>             </div>             <div class="col-75">                   <input type="text" name="<?php $  resfila[0]; ?>" required><br/>               </div>              <?php  $  i++;          } ?>          <button class= "button" type="submit" name="save">Afegir</button>     </form>  </div> <?php include "insert.php";?>```  El problema es que no sé cómo recoger los datos introducidos del formulario e insertarlo en las tablas, de tal forma que coja de la misma forma el nombre de las columnas e inserte en la tabla los respectivos datos.      [1]: https://i.stack.imgur.com/Ote9K.jpg   [2]: https://i.stack.imgur.com/gGgAp.png 

SQL Server Procedure -Recorrer tabla, comparar cada elemento obtenido y decidir hacer insert o no

os cuento mi contexto de necesidad:

Tengo una tabla (llamada PermisosPRE) con 2 columnas (Name, id_ref) que contiene 8mil u pico registros con la relacion de 1rol-1proceso, la columna Name contiene esos roles posibles en formato varchar, la columna id_ref contiene los nombres de procesos en formato varchar.

Necesito crear un procedimiento que me recorra esa tabla y por cada registro: 1) Obtener el id asignado (_roles.ID) a ese rol en (_roles.name) 2) Obtener el id asignado (descTree.ID) a cada proceso en (descTree.id_ref) 3) Comprobar si existe el rol (PermisosPRE.Name) y tiene permisos sobre el proceso en la base de datos actual (descRolProcess.id_a= _roles.ID y descRolProcess.id_b = descTree.ID) a) Si ya tiene permisos, no se hace nada b) Si no tiene permisos, se establecen, insertando un registro en la tabla descRolProcess. (Insert into descRolProcess (id_a, id_b) values (id del rol ‘_roles.ID’,id del proceso ‘descTree.ID’)

Por ahora tengo esto pero estoy bastante liado y no se como seguir:

    -- Variables     DECLARE @rol_elemento_actual AS VARCHAR(80)     DECLARE @proceso_elemento_actual AS VARCHAR(80)  -- Declaracion del cursor BUSCADOR.     DECLARE BUSCADOR CURSOR FOR         --Relacion roles-permisos definidos en la BD antes de la migración         SELECT qPRE.Name, qPRE.id_ref         FROM PermisosPRE qPRE            OPEN BUSCADOR  -- Recorremos el puntero y cargamos en la variable el valor del elemento actual       FETCH NEXT FROM BUSCADOR       INTO @rol_elemento_actual, @proceso_elemento_actual           WHILE @@fetch_status = 0             BEGIN             -- Obtener el identificador del rol de la tabla temporal(PermisosPRE) en la base de datos actual (_roles.Name)                 SET @rol_elemento_actual =                     (SELECT qR.Name                      FROM _roles qR                     INNER JOIN PermisosPRE qP ON qP.Name = qR.Name                     GROUP BY qR.Name)             -- Obtener el identificador del proceso de la tabla temporal en la base de datos actual (descTree.id_ref)                 SET @proceso_elemento_actual =                      (SELECT qRP.id_b, qPPW.id_ref                     FROM descRolProcess qRP                                  INNER JOIN descTree qT ON qT.id = qRP.id_b                     INNER JOIN PermisosPRE qPPW ON qPPW.id_ref = qT.id_Ref                     GROUP BY qRP.id_b, qPPW.id_ref)              -- Comprobar si existe el rol y/o tiene permisos sobre el proceso en la base de datos actual (descRolProcess.id_a= id del rol y descRolProcess.id_b = id del proceso                 IF (@rol_elemento_actual IS NOT NULL)                     -- Si ya tiene permisos, no se hace nada, ) Si no tiene permisos, se establecen, insertando un registro en la tabla descRolProcess.                                      BEGIN                         INSERT INTO descRolProcess (id_a, id_b)                          VALUES (id-del-roll,id-del-proceso)                          RETURN                     END                 ELSE                     BEGIN                         -- NADA                         RETURN                      END                            -- Avanzamos al siguiente elemento             FETCH NEXT FROM BUSCADOR             INTO @id_name_elemento_actual, @id_ref_elemento_actual         END      -- Cerramos el cursor         CLOSE BUSCADOR     -- Liberamos la memoria     DEALLOCATE BUSCADOR 

¿Me podéis ayudar?

how to Import custom CSV in magento 2 and insert in database Table

Here am added import custom upload drop down to magento backend succesfully. while am importing data its not getting insert into database, its showing Please enter a correct entity model. error

class CustomImport extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity {     const ID = 'p_id';     const STORE = 'store_id';     const SDATE = 'pstart_date';     const EDATE = 'pend_date';      const TABLE_Entity = 'retailinsights_promostoremapp'; //table name mayBE     /**      * Validation failure message template definitions      *      * @var array      */     protected $  _messageTemplates = [     ValidatorInterface::ERROR_MESSAGE_IS_EMPTY => 'Message is empty',     ];      protected $  _permanentAttributes = [self::ID];     /**      * If we should check column names      *      * @var bool      */     protected $  needColumnCheck = true;     /**      * Valid column names      *      * @array      */     protected $  validColumnNames = [     self::ID,     self::STORE,     self::SDATE,     self::EDATE,      // self::MESSAGE,     // self::DATE,     ];     /**      * Need to log in import history      *      * @var bool      */     protected $  logInHistory = true;     protected $  _validators = [];     /**      * @var \Magento\Framework\Stdlib\DateTime\DateTime      */     protected $  _connection;     protected $  _resource;     /**      * @SuppressWarnings(PHPMD.CouplingBetweenObjects)      */     public function __construct(     \Magento\Framework\Json\Helper\Data $  jsonHelper,     \Magento\ImportExport\Helper\Data $  importExportData,     \Magento\ImportExport\Model\ResourceModel\Import\Data $  importData,     \Magento\Framework\App\ResourceConnection $  resource,     \Magento\ImportExport\Model\ResourceModel\Helper $  resourceHelper,     \Magento\Framework\Stdlib\StringUtils $  string,     ProcessingErrorAggregatorInterface $  errorAggregator     ) {     $  this->jsonHelper = $  jsonHelper;     $  this->_importExportData = $  importExportData;     $  this->_resourceHelper = $  resourceHelper;     $  this->_dataSourceModel = $  importData;     $  this->_resource = $  resource;     $  this->_connection = $  resource->getConnection(\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION);     $  this->errorAggregator = $  errorAggregator;     }     public function getValidColumnNames()     {         return $  this->validColumnNames;     }     /**      * Entity type code getter.      *      * @return string      */     public function getEntityTypeCode()     {         return 'messages';     }     /**      * Row validation.      *      * @param array $  rowData      * @param int $  rowNum      * @return bool      */     public function validateRow(array $  rowData, $  rowNum)     {     $  title = false;     if (isset($  this->_validatedRows[$  rowNum])) {         return !$  this->getErrorAggregator()->isRowInvalid($  rowNum);     }     $  this->_validatedRows[$  rowNum] = true;     return !$  this->getErrorAggregator()->isRowInvalid($  rowNum);     }     /**      * Create Advanced message data from raw data.      *      * @throws \Exception      * @return bool Result of operation.      */     protected function _importData()     {         $  this->saveEntity();         return true;     }     /**      * Save Message      *      * @return $  this      */     public function saveEntity()     {     $  this->saveAndReplaceEntity();     return $  this;     }     /**      * Save and replace data message      *      * @return $  this      * @SuppressWarnings(PHPMD.CyclomaticComplexity)      * @SuppressWarnings(PHPMD.NPathComplexity)      */     protected function saveAndReplaceEntity()     {     $  behavior = $  this->getBehavior();     $  listTitle = [];     while ($  bunch = $  this->_dataSourceModel->getNextBunch()) {         $  entityList = [];         foreach ($  bunch as $  rowNum => $  rowData) {             if (!$  this->validateRow($  rowData, $  rowNum)) {                 $  this->addRowError(ValidatorInterface::ERROR_TITLE_IS_EMPTY, $  rowNum);                 continue;             }             if ($  this->getErrorAggregator()->hasToBeTerminated()) {                 $  this->getErrorAggregator()->addRowToSkip($  rowNum);                 continue;             }             $  rowTtile= $  rowData[self::ID];             $  listTitle[] = $  rowTtile;             $  entityList[$  rowTtile][] = [                 self::ID => $  rowData[self::ID],                 self::STORE  => $  rowData[self::STORE],                 self::SDATE => $  rowData[self::SDATE],                 self::EDATE => $  rowData[self::EDATE],                   // self::MESSAGE => $  rowData[self::MESSAGE],                 // self::DATE => $  rowData[self::DATE],             ];         }         if (\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE == $  behavior) {             if ($  listTitle) {                 if ($  this->deleteEntityFinish(array_unique(  $  listTitle), self::TABLE_Entity)) {                     $  this->saveEntityFinish($  entityList, self::TABLE_Entity);                 }             }         } elseif (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $  behavior) {             $  this->saveEntityFinish($  entityList, self::TABLE_Entity);         }     }     return $  this;     }     /**      * Save message to customtable.      *      * @param array $  priceData      * @param string $  table      * @return $  this      */     protected function saveEntityFinish(array $  entityData, $  table)     {     if ($  entityData) {         $  tableName = $  this->_connection->getTableName($  table);         $  entityIn = [];         foreach ($  entityData as $  id => $  entityRows) {                 foreach ($  entityRows as $  row) {                     $  entityIn[] = $  row;                 }         }         if ($  entityIn) {             $  this->_connection->insertOnDuplicate($  tableName, $  entityIn,[                 self::ID,                 self::STORE,                 self::SDATE,                 self::EDATE,                  // self::MESSAGE,                 // self::DATE,         ]);         }     }     return $  this;     } 

this is my table retailinsights_promostoremapp columns are p_id,store_id,rule_id,pstart_date,pend_date . thank you in advance

How do I insert different cell data from a table into a hyperlink

I have a table of different cell data that I want to insert into different hyperlinks for each item:

=HYPERLINK(“https://www.otcmarkets.com/stock/CELL DATA TO BE INSERTED/security”,”SECURITY”)

Cell data = four letter data below

KICK Expected output: https://www.otcmarkets.com/stock/KICK/security

SCGX Expected output: https://www.otcmarkets.com/stock/SCGX/security

RBTK

JCTG

HWGG

I am using google sheets. I do have Numbers, but not excel. Can I do this?

How do I get primary key of colliding row on failed insert?

After I try to insert a row into database and it fails due to duplicate (not primary key collision – another key), how do I get the primary key of the colliding row that prevented the insert?

Example: The table:

CREATE TABLE `my_table` (     `id` int(10) unsigned NOT NULL AUTO_INCREMENT,     `unique_value` varchar(60) NOT NULL,     PRIMARY KEY (`id`),     UNIQUE KEY `unique_data` (`unique_values`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; 

Some initial data:

INSERT INTO `my_table`(`unique_value`) VALUES ('unique string 1'); INSERT INTO `my_table`(`unique_value`) VALUES ('unique string 2'); 

And now, this will fail because of the collision in the index:

MySqlConnection conn = new MySqlConnection(connString); conn.Open(); MySqlCommand comm = conn.CreateCommand(); comm.CommandText = "INSERT INTO `my_table`(`unique_value`) VALUES 'unique string 2'"; comm.ExecuteNonQuery(); conn.Close(); 

Can I get the primary key of the colliding row without making another query?

Is there a way to group rows by a term and insert this term as a header in Google Sheets

I have a list of books on Google Sheets that will be turned into a paged layout on InDesign. Each book has two additional information besides its title (year and theme). Like this

Sample list of books

But I need this list to be structured in a stacked way. Grouping first by year, and then by theme, like this (I’ve formatted the cells just to clarify):

Stacked list

I currently do this stacking manually, and it requires quite a lot of time. Is there some sort of formula, or tool, to solve this problem? I guess it can be done with scripting, but I wanted to know if there’s a non-scripting way to do it before diving into Google sheets script documentation.

Disable modal dialog to insert password

I upgraded to Ubuntu 18.04 and I find a very annoying “feature” when I commit in git which was not present in 16.04 with Unity. I have gpgsign enabled and everytime I commit in git it opens a modal dialog box where I have to insert the GPG password.

As someone who values my security I keep all my passwords in a KeePass database which is conveniently not usable when this uselessly modal dialog comes up.

How do I stop Gnome from creating a modal dialog when asking for passwords?

I want to be able to copy&paste my password from KeePass when the dialog asking for password is already shown, and even better be able to search my KeePass db for the correct entry (i.e. I should also be able to type inside KeePass).

It’s a real waste of time having to cancel whatever operation, then copy the password and having 10 seconds to repeat it before the password gets cleared from the clipboard. Especially when I try to commit from an IDE since when selecting files it does not stage them which means if I forget to copy the password right before clicking on commit I have to reselect all the files/portions of files to commit.


BTW: I do not want to use the GNOME keyring. I want to be able to use KeePass. Is there a way to do this in Gnome or do I have to uninstall ubuntu-desktop and install kubuntu-desktop instead?

Como fazer um insert em duas tabelas distintas no C#

blz?

Eu preciso inserir valores em uma tabela X, em seguida recuperar o id da mesma, para que eu possa enviar na segunda tabela Y o id de X e outros valores, porém não sei como fazer isso. Segue o código abaixo do que estou tentando fazer sem sucesso…

class DCadastro {

private string _nome; private string _displina;

public string Nome { get => _nome; set => _nome = value; } public string Displina { get => _displina; set => _displina = value; }  public string Inserir(DCadastro dCadastro) {     string resp = "";     SqlCommand cmd = new SqlCommand();     SqlConnection con = new SqlConnection();      try     {         con.ConnectionString = Conexao.Cn;         con.Open();         cmd.Connection = con;          cmd.CommandText = "INSERT INTO PROFESSOR(nome) VALUES (@nome);  SELECT SCOPE_IDENTIY(); INSERT INTO DISCIPLINA(disciplina, idProfessor) VALUES (@disciplina, @idProfessor);";         cmd.Parameters.AddWithValue("@nome", Nome);         Int32 idRetorno = Convert.ToInt32(cmd.ExecuteScalar());         cmd.Parameters.AddWithValue("@disciplina", Displina);         cmd.Parameters.AddWithValue("@idProfessor", idRetorno);         resp = cmd.ExecuteNonQuery() == 1 ? "OK" : "Registro não foi inserido";      }     catch(Exception erro)     {         throw erro;     }     finally     {         if (con.State == System.Data.ConnectionState.Open) con.Close();     }     return resp; }