How can a ‘Request’ store a ‘Result’ code and its associated ‘Error’ code and still enforce the relationship between Result and Error?

I’m an application developer creating the database structure to represent a flat file message format. I’d like to ask the collective knowledge the best/correct way to represent the following scenario:

Request table (PK: RequestID) contains requests; a request has a Result property which is indeterminate (null) until the request has completed.

Result table (PK ResultID) is a lookup table containing (currently) two possible results:

  • Success (Result ID = 0)
  • Failure (Result ID = 1)

ErrorCode table (PK ErrorCodeID) is a lookup table containing error details and their parent ResultID:

  • No Error (ErrorCodeID = 0, ResultID = 0)
  • Generic Error (ErrorCodeID = 1, ResultID = 1)
  • Queue Full (ErrorCodeID = 2, ResultID = 1)
  • Unsupported Interface (ErrorCodeID = 3, ResultID = 1)
  • etc…

I’ve created a one to many relationship between Result (one) and ErrorCode (many). A ‘Success’ Result can only have a ‘No Error’ Error Code, while a ‘Failure’ Result can have a single error code of ‘Generic Error’, ‘Queue Full’, ‘Unsupported Interface’, etc.

When the Request has completed, I need to store the result and its associated error code.

I’ve thought of combining the two tables but that strikes me as repeating columns.

I’ve also thought of having the Request table store the ResultID and the ErrorCodeID but this doesn’t enforce the Result to ErrorCode relationship.

I’m a big believer in database that ‘defends itself’ from bad data so I want the relationship to reject a Result/ErrorCode combination that is invalid; a.k.a. a Result of ‘Success’ and an ErrorCode of ‘Generic Error’ or a Result of ‘Failure’ and an ErrorCode of ‘No Error’.

I’m also a big believer in solid initial design so when changes come down the pike at a later date (as they always do) the structure will not need rework.

Thank you in advance for your time.

Regards, John E.

Unity 2018.4.25f1 Errors – error CS0118 & error CS0234

I am getting 2 errors in my c# script.

  1. Assets\scripts\playerMovement.cs(8,5): error CS0118: 'PlayerControls' is a namespace but is used like a type
  2. Assets\scripts\playerMovement.cs(4,19): error CS0234: The type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)

playerMovement.cs:

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem;  public class playerMovement : MonoBehaviour {     PlayerControls controls;     Vector2 move;     void Awake()     {         controls = new PlayerControls();          controls.Gameplay.move.performed += ctx => move = ctx.ReadValue<Vector2>();         controls.Gameplay.move.canceled += ctx => move = Vector2.zero;     }     void Update()     {         Vector2 m = new Vector2(move.x, move.y) * Time.deltaTime;         transform.Translate(m, Space.World);     } } 

I am using the new Input System 0.2.1 in unity 2018.4.25f.

The PlayerControls script is auto-generated from an Actions Input object, and it is in the main root "Assets".

How to fix the error and do thread to those equation

 bList = Table[b, {b, 0, 4.1, 0.1}];   \[Chi][bList_] = (Z/K1)*NIntegrate[Subscript[f, pp1][q]*Subscript[F, pp1][q]*BesselJ[0, q*bList]*q, {q, 0, 1}] +  (N/K1)*NIntegrate[Subscript[f, pn1][q]*Subscript[F, pn1][q]*BesselJ[0, q*bList]*q, {q, 0, 1}];  

I want to do Thread and Interpolation to those values but always give me this error NIntegrate::inumr: The integrand (0.0131326 r Sin[q r])/(1+(E^(1.75439 Plus[<<2>>])+E^(1.75439 Plus[<<2>>])) (0.5 +0.0882389 Power[<<2>>])^1.5) has evaluated to non-numerical values for all sampling points in the region with boundaries {{[Infinity],0.}}.

 Subscript[f, pp1][q_] =(6.254736279890945*(1 - 1.4511668475476842*i)*i)/E^(0.2115*q^2)  Subscript[F, pp1][q_] := ((4*Pi)/q)*NIntegrate[Subscript[\[Rho], p][r]*Sin[q*r]*r, {r, 0, Infinity}];    Subscript[\[Rho], p][r_]=0.013132593248303927/(1 + (E^(1.7543859649122808*(-2.380427976610103 - r)) + E^(1.7543859649122808*(-2.380427976610103 + r)))*(0.5 + 0.08823886490842314*r^2)^1.5)   Z = 6;N=6;K1 =1.55;  Subscript[f, pn1][q_] =(18.25974896615874*(1 - 0.8748275119106319*i)*i)/E^(0.2115*q^2)  Subscript[F, pn1][q_]:= ((4*Pi)/q)*NIntegrate[Subscript[\[Rho], n][r]*Sin[q*r]*r, {r, 0, Infinity}];   Subscript[\[Rho], n][r_]=0.012100952740630248/(1 + (E^(1.8975332068311195*(-2.47 + r)) + E^(-1.8975332068311195*(2.47 + r)))*(0.5 + 0.08195512137553475*r^2)) 

OpenVPN authentication error

Now I use Synology’s MR2200AC as my home router and Synology’s DS918+ as my NAS for hosting some virtual machines. And I’m trying to connect to the virtual machines from my laptop via a OpenVPN server of VPN plus server app on the Synology MR2200AC.

However, when I’m trying to make a OpenVPN connection to the OpenVPN server, it results in authentication error. But I can success that once in a while. So username and password is correct. The error occurs both the laptop is inside and outside my home LAN.

Current environment of the connection is here.

The laptop is outside my home:
Laptop–Smartphone(tethering)–Internet–MR2200AC–virtual machines(on Synology DS918+)

The laptop is inside my home:
Laptop–MR2200AC–virtual machines(on Synology DS918+)

Laptop:MacOS 10.14.6, with using OpenVPN connect v3.2.1(https://openvpn.net/download-open-vpn/)
Smartphone:iOS(13.3)
MR2200AC:SRM 1.2.4-8081(Internet connection is IPoE(MAP-E))
DS918+:DRM 6.2.3-25426
virtual machines:ubuntu server 20.04 on DS918+’s Virtual Machine Manager app

The OpenVPN connection between the OpenVPN server and the virtual machines is not problem. The virtual machines can always success the authorization and can keep it’s OpenVPN connection with the OpenVPN server.

I can make vpn connection with the MR2200AC from outside my home if I use WebVPN function on the VPN plus server app(Not OpenVPN connection). So I have tried to export configuration file from OpenVPN tab on the VPN plus server app when the laptop is outside my home and used the file.
Also I have tried to change udp protocol to tcp protocol, and to launched the OpenVPN APP on the laptop with root priviledge.

But those work once in a while, not always.

I thought the above IPoE(MAP-E) may cause problem. But a DNS configuration of the MR2200AC works correctly.

I can’t understand what is wrong.

I’d like to want to build a reliable vpn connection between the laptop and the virtual machines. For example, I access to a mysql server on the virtual machine, whether the laptop is inside or outside my home LAN. In this example, the above WebVPN is useless.

Please help me.

One of Logs for example is here.

7/31/2020, 1:04:33 PM OpenVPN core 3.git::3e56f9a6 mac x86_64 64-bit built on Jul 3 2020 15:36:10 7/31/2020, 1:04:33 PM Frame=512/2048/512 mssfix-ctrl=1250 7/31/2020, 1:04:33 PM UNUSED OPTIONS 1 [tls-client] 3 [pull] 5 [script-security] [2] 7/31/2020, 1:04:33 PM EVENT: RESOLVE  7/31/2020, 1:04:33 PM Contacting ************* via TCPv4 7/31/2020, 1:04:33 PM EVENT: WAIT  7/31/2020, 1:04:33 PM UnixCommandAgent: transmitting bypass route to /var/run/agent_ovpnconnect.sock { "host" : "**********", "ipv6" : false, "pid" : 35641 } 7/31/2020, 1:04:33 PM Connecting to [***************]:**** (***********) via TCPv4 7/31/2020, 1:04:33 PM EVENT: CONNECTING  7/31/2020, 1:04:33 PM Tunnel Options:V4,dev-type tun,link-mtu 1603,tun-mtu 1500,proto TCPv4_CLIENT,keydir 1,cipher AES-256-CBC,auth SHA512,keysize 256,tls-auth,key-method 2,tls-client 7/31/2020, 1:04:33 PM Creds: Username/Password 7/31/2020, 1:04:33 PM Peer Info: IV_VER=3.git::3e56f9a6 IV_PLAT=mac IV_NCP=2 IV_TCPNL=1 IV_PROTO=2 IV_GUI_VER=OCmacOS_3.2.1-1484 IV_SSO=openers  7/31/2020, 1:04:34 PM VERIFY OK: depth=2, /O=Digital Signature Trust Co./CN=DST Root CA X3 7/31/2020, 1:04:34 PM VERIFY OK: depth=1, /C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3 7/31/2020, 1:04:34 PM VERIFY OK: depth=0, /CN=************** 7/31/2020, 1:04:40 PM SSL Handshake: CN=*****************, TLSv1.2, cipher TLSv1.2 DHE-RSA-AES256-GCM-SHA384, 2048 bit RSA 7/31/2020, 1:04:40 PM Session is ACTIVE 7/31/2020, 1:04:40 PM EVENT: GET_CONFIG  7/31/2020, 1:04:40 PM Sending PUSH_REQUEST to server... 7/31/2020, 1:04:40 PM AUTH_FAILED 7/31/2020, 1:04:40 PM EVENT: AUTH_FAILED  7/31/2020, 1:04:40 PM EVENT: DISCONNECTED  7/31/2020, 1:04:44 PM Raw stats on disconnect:  BYTES_IN : 4993 BYTES_OUT : 2163 PACKETS_IN : 10 PACKETS_OUT : 10 AUTH_FAILED : 1 ⏎7/31/2020, 1:04:44 PM Performance stats on disconnect: CPU usage (microseconds): 9352624 Network bytes per CPU second: 765 Tunnel bytes per CPU second: 0 

UPDATE with variables to renumber column gives syntax error

Searching for a way to renumber a column within mysql, I’ve found multiple articles showing the same approach:

  • Renumbering an Ordering Field in MySQL
  • How to update a MySql column with ascending numbers

among others.

But trying it on my table I get a syntax error.

mysql> SET @rankStart = 10; mysql> SET @rankInc = 10; mysql> UPDATE fileFileTbl SET rank = (@rankStart := @rankStart + @rankInc) ORDER BY `rank` ASC; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank = (@rankStart := @rankStart + @rankInc) ORDER BY `rank` ASC' at line 1 

The command looks identical to the articles posted. What am I missing?

Here’s the table (with some columns omitted):

CREATE TABLE `fileFileTbl` (   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,   `fileEngineId` int(11) DEFAULT NULL,   `rank` int(11) DEFAULT '0',   `fileName` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT 'newfile',   PRIMARY KEY (`id`),   UNIQUE KEY `fileEngineId` (`fileEngineId`,`rank`) ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; 

System is Centos 8, with mysql as:

# mysql --version mysql  Ver 8.0.17 for Linux on x86_64 (Source distribution) 

Parse error: syntax error, unexpected ‘dbp_tb_branch’ (T_STRING) in wordpress

I am creating plugin which is not showing on admin menu. I don’t know what happened.

<?php /* *Plugin Name:Arsh Forms  *Author:Arsh Venveru * *Description:Create forms. *Version:1.0.0 *License:GPL2 *License URI:https://www.gnu.org/licenses/gpl-2.0.html */  defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); add_action('admin_menu','arsh_admin_menu_option'); function arsh_admin_menu_option() {     add_menu_page('arsh-form-table','arsh-Forms-Table','manage_options','arsh-admin-menu','arsh_form_table','dashicons-thumbs-up',40);} function arsh_form_table(){        wp_enqueue_style('shortcode_table1','https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css');     wp_enqueue_script('shortcode_table','https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"');      wp_enqueue_script('shortcode_table','https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js');       wp_enqueue_script('shortcode_table','https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js');       $  content=''; $  content .='<div class="wrap">'; $  content .='<div class="container">';   $  content .='<h2>VENVERU FORMS</h2>';   $  content .='<table class="table table-striped">';     $  content .='<thead>';       $  content .='<tr>';         $  content .='<th>Sr.no</th>';         $  content .='<th>Form Name</th>';         $  content .='<th>Form Id</th>';       $  content .='</tr>';     $  content .='</thead>';     $  content .='<tbody>';       $  content .='<tr>';         $  content .='<td>1</td>';         $  content .='<td>Venveru-Form</td>';         $  content .='<td>[Registeration-Form]</td>';       $  content .='</tr>';       $  content .='<tr>';         $  content .='<td>2</td>';         $  content .='<td>Display-Entries</td>';         $  content .='<td>[Display-Reg-Form]</td>';       $  content .='</tr>';       $  content .='<tr>';         $  content .='<td>3</td>';         $  content .='<td>Add-branch</td>';         $  content .='<td>[Add_Branch_Form]</td>';       $  content .='</tr>';       $  content .='<tr>';           $  content .='<td>4</td>';           $  content .='<td>Display-Branches</td>';           $  content .='<td>[Display-Branches]</td>';       $  content .='</tr>';       $  content .='<tr>';           $  content .='<td>5</td>';       $  content .='<td>Login page</td>';       $  content .='<td>[Login_page]</td></tr>';       $  content .='<tr>';           $  content .='<td>6</td>';       $  content .='<td>Add Book</td>';       $  content .='<td>[add_book]</td></tr>';       $  content .='<tr>';           $  content .='<td>7</td>';       $  content .='<td>Teacher Reg</td>';     $  content .='<td>[Teacher_Reg]</td>';     $  content .='</tr>';     $  content .='</tbody>';   $  content .='</table>'; $  content .='</div>'; $  content .='</div>'; return $  content; } add_action('wp_enqueue_scripts','arsh_form_table'); 

How can I solve this error?

Error in pivot selection algorithm for merge phase [Sorting]

In the paper Comparison Based Sorting for Systems with Multiple GPUs, the authors describe the selection of a pivot element with respect to the partition on the first GPU (and its mirrored counterpart on the other GPU-partition). That pivot element is crucial for being able to merge the two partitions, given that we have already sorted them on each GPU locally.

However, the pseudo-code for that pivot-selection, as shown in the paper, doesn’t seem to reflect the whole truth since when implementing it 1:1, the selected pivot element is off by some elements in some cases, depending on the input – the amount of elements to sort and therefore the amount of elements per partition (the chunk of data that each GPU gets).

To get more specific, the problem is – to my understanding – that the while loop is exited too early due to the stride being reduced down to zero before the correct pivot element has been found. In general, the approach is binary search-like, where the range of where the pivot can fall, is halved each iteration.

Can anyone spot what needs to be done here?

Here is a C++ implementation of the pivot selection:

size_t SelectPivot(const std::vector<int> &a, const std::vector<int> &b) {   size_t pivot = a.size() / 2;   size_t stride = pivot / 2;   while (stride > 0)   {     if (a[a.size() - pivot - 1] < b[pivot])     {       if (a[a.size() - pivot - 2] < b[pivot + 1] &&           a[a.size() - pivot] > b[pivot - 1])       {         return pivot;       }       else       {         pivot = pivot - stride;       }     }     else     {       pivot = pivot + stride;     }     stride = stride / 2;   }   return pivot; } 

P.S.: I tried ceiling the stride in order to not skip iterations when the stride is odd, but this introduced the issue of moving out of bounds of the array and even after handling those cases by clipping to the array bounds, the pivot was not always correct.

Error on using Compile[]

My code is below.

deltaX = 1/128; W=256; Mmax=40;  lPoly = ParallelTable[    LegendreP[     order, (-1.) + (deltaX/2.) + ((index - 1.)*deltaX)],  {order, 0, Mmax}, {index, 1, W}];  XPoly = Compile[{{index, _Integer}},     Block[{},      polyMatrix =       Table[lPoly[[m - n + 1, index]], {m, 0, Mmax}, {n, 0, m}];      polyMatrix], CompilationTarget -> "C",    RuntimeAttributes -> {Listable}, Parallelization -> True,     RuntimeOptions -> {"CatchMachineIntegerOverflow" -> False}]; 

If I run XPoly[1], it will return:

CompiledFunction::cfse :  Compiled expression {{1.},{-0.996094,1.},<<48>>,<<71>>} should be a machine-size real number. 

I have encountered this kinda error multiple times, sometimes it solved. But I dont know why.

The froghemoth has both lightning resistance and Shock Susceptibility; is this an error? Are there other monsters like this?

In Volo’s Guide to Monsters, the Froghemoth (pg. 145) has resistance to lightning damage, but also has the Shock Susceptibility trait, which gives it various penalties whenever it takes lightning damage.

I find this hard to wrap my mind around from a creature biology standpoint, as well as from a gameplay point of view. Is this a mistake? Is there any precedent for a monster having this dual resistance and vulnerability?

Sqlmap not detects error based injection

I am working on Hack the VM (hard machine) for my OSCP preparation

There is a web app with two drop down boxes.. Year and month.. both contain numbers and a submit to fetch data from DB based on year and month

Now when I change the month value from 2,3,4,5 etc to /

I get this as an error

"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘AND MONTH(our_date) = 1 ORDER BY our_date DESC’ at line 1

Which I believe is error based SQL injection

THe problem is when I try this in SQLMAP, I tried to increase the risk and level.. I dont get the parameter is injectable..

If i change value of month to 1′ OR 1 = 1# , I get 502 bad gateway

How could I move on?

I read this link but not so helpful.

https://stackoverflow.com/questions/54809948/mariadb-sql-injection