Storing dates and their history of changes and emailing – Does my database design pose any problems?

Background

I’m designing some tables to allow dates to be assigned to an object so progress can be tracked on that object, along with functionality to store emails sent pertaining to these contracts and their dates. For example lets say that the Object is a Contract (A contracted task to be completed).

This means we would have a contract table

Now for this contract we can have Date fields such as a obtained date, start date, review date, estimated finish date, finish date etc. Right now most contracts will contain the same columns but we don’t know in the future if more columns will be added or less will be used as requirements change quite often.

Because of this, I figured to separate the dates from the contract table. Each date in this ContractDate table would have a foreign key to a FieldHeading table that describes what aspect of the contract the date is. And finally, a AuditTrail type table called ContractDateHistory that would keep track of changes of a Date.

This way we can also selectively choose what dates go to a contract. One contract may have 4 dates and another may have 6.

These contracts can have emails sent to people that inform them of how these dates are going or if a date has changed. Because multiple contracts can be contained in one email I have a ContractsForEmail table which contains the ID of the email of each contract that is contained in an email.

A row would be input for each email sent to a user, needsResolution is there if the user has to take action with the email (depends on the type of email) and resolved is there if the user has taken action, a program will check if the user has taken action after a set amount of time, and if not, the program will send a reminder email (which could possibly also show up in this table)

The template can have a list of users that the emails derived from the template sends to (an email will be sent for each user assigned to the mailing list of a template, additional could be sent too but users that without fail get an email sent are kept here.

My Question

I have many questions about if my design is okay but in specific I’d like to know, is what I am doing with contracts and contractDates is okay?

Instead of having the Contract and Dates separate should I just add Date columns to the Contracts table?

If they get used then good and if they don’t for a specific contract then its just kept as NULL.

This could lead to columns in the contract table that get added and never used again (almost always NULL). Like so:

AddedDateInFuture is there to illustrate that a column may be added in the future, it wouldn’t literally be there.

• What are the trade-offs between the two options?
• Is there anything I’m missing with the emailing tables? Would this kind of design work?

Currently the system would be catering to under 200 users but I’d like it to be built a little future proof for if many more use it.

As a last note some database tables such as the usual “User” table has been left out.

Are $\mathsf{\#P}$ problems harder than $\mathsf{NP}$ problems

I have a method to solve the $$\mathsf{\#P}$$ version of 3SAT in a way that seemingly reduces it to an $$\mathsf{NP}$$ problem. – I don’t have a formal understanding of these terms so I will just show an example here.

How many solutions does $$\phi=\left(x_1 \vee x_2 \right) \wedge \left(\neg x_1 \vee x_3 \right) \wedge \left(\neg x_2 \vee \neg x_3 \right)$$ have?

First convert to a boolean polynomial: $$\phi=\left(x_1 + x_2 -x_1x_2\right) \left(1-x_1+x_1x_3\right) \left(1-x_2x_3 \right)$$

Expand and simplify: $$\phi = x_2 – x_1x_2 + x_1x_3 – x_2x_3$$

Substitute $$x_1 = x_2 = x_3 = \frac{1}{2}$$ and multiply by $$2^n$$ where $$n$$ is the number of variables: $$|\phi| = 2^n\left(\frac{1}{2} – \frac{1}{4} + \frac{1}{4} – \frac{1}{4}\right) = 2^3\frac{1}{4} = 2$$

where $$|\phi|$$ is the number of solutions that $$\phi$$ has.

And indeed, those 2 solutions are (0,1,0) and (1,0,1).

I have proven that this works for any logical expression. Does this have any use/bearing on $$\mathsf{\#P}$$ vs $$\mathsf{NP}$$

If the human brain is turing machine then how is it able to ascertain that certain problems are undecidable?

I recently read about the idea that the human brain might be a turing machine (or turing complete). If that is true then how is the brain able to reason that a certain problem is undecidable for e.g. the the liar paradox. I assume that a turing machine will nor be able to reason that the liar paradox statement is a logical paradox with no decidable answer and will be stuck forever.

FTP Problems on v18.04 with vsftpd and Google Cloud Platform

I’m having some unexplainable issues trying to setup FTP on vsftpd with my Google Cloud Platform compute engine. I’ve been messing with a bunch of different settings to get this going, but one issue keeps popping up.

In FileZilla, I get an error saying “Failed to retrieve directory listing.” Does anyone know a good fix? Let me know what logs etc. you need from me.

I’ve tried this on fresh installs plenty of times with no luck. The ports are all set through the firewall as well.

Thank you so much!

Tools to debug ACPI problems

I came across this excellent paper written by Intel:

• How to achieve S0ix states in Linux*

It contains a nifty little bash script:

#!/bin/bash cd /var/tmp/ acpidump -b iasl -d *.dat lp=$(grep "Low Power S0 Idle" /var/tmp/facp.dsl | awk '{print$  (NF)}')  if [ "$lp" -eq 1 ]; then echo "Low Power S0 Idle is"$  lp         echo "The system supports S0ix!" else         echo "Low Power S0 Idle is" $lp echo "The system does not support S0ix!" fi  The output was littered with errors and at the bottom the script said: Low Power S0 Idle is 0 The system does not support S0ix!  I have a skylake i-7 6700HQ chip and am dubious of the results. I suspect all the ACPI errors are to blame and fixing them might change the result. The work file greped by the script contains this: $   cat facp.dsl /*  * Intel ACPI Component Architecture  * AML/ASL+ Disassembler version 20160108-64  * Copyright (c) 2000 - 2016 Intel Corporation  *   * Disassembly of facp.dat, Sun Jul 14 16:55:52 2019  *  * ACPI Data Table [FACP]  *  * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue  */  [000h 0000   4]                    Signature : "FACP"    [Fixed ACPI Description Table (FADT)] [004h 0004   4]                 Table Length : 0000010C [008h 0008   1]                     Revision : 05 [009h 0009   1]                     Checksum : 88      (... SNIP ...)  [103h 0259   1]         Encoded Access Width : 03 [DWord Access:32] [104h 0260   8]                      Address : 0000000000001800  /**** ACPI table terminates in the middle of a data structure! (dump table) */  Raw Table Data: Length 268 (0x10C)    0000: 46 41 43 50 0C 01 00 00 05 88 41 4C 57 41 52 45  // FACP......ALWARE   0010: 41 4C 49 45 4E 57 52 45 09 20 07 01 41 4D 49 20  // ALIENWRE. ..AMI    0020: 13 00 01 00 80 6F 89 37 10 42 EE 36 01 02 09 00  // .....o.7.B.6....   0030: B2 00 00 00 A0 A1 00 00 00 18 00 00 00 00 00 00  // ................   0040: 04 18 00 00 00 00 00 00 50 18 00 00 08 18 00 00  // ........P.......   0050: 80 18 00 00 00 00 00 00 04 02 01 04 20 00 10 00  // ............ ...   0060: 65 00 39 00 00 04 10 00 00 00 0D 00 32 12 00 00  // e.9.........2...   0070: A5 86 03 00 01 08 00 01 F9 0C 00 00 00 00 00 00  // ................   0080: 06 00 00 00 00 00 00 00 00 00 00 00 10 42 EE 36  // .............B.6   0090: 00 00 00 00 01 20 00 02 00 18 00 00 00 00 00 00  // ..... ..........   00A0: 01 00 00 02 00 00 00 00 00 00 00 00 01 10 00 02  // ................   00B0: 04 18 00 00 00 00 00 00 01 00 00 02 00 00 00 00  // ................   00C0: 00 00 00 00 01 08 00 01 50 18 00 00 00 00 00 00  // ........P.......   00D0: 01 20 00 03 08 18 00 00 00 00 00 00 01 80 00 01  // . ..............   00E0: 80 18 00 00 00 00 00 00 01 00 00 01 00 00 00 00  // ................   00F0: 00 00 00 00 01 08 00 03 04 18 00 00 00 00 00 00  // ................   0100: 01 08 00 03 00 18 00 00 00 00 00 00              // ............ 

The line /**** ACPI table terminates in the middle of a data structure! (dump table) */ causes me concern.

The full output starts out ok but I’ll show you some of the errors:

Intel ACPI Component Architecture ASL+ Optimizing Compiler version 20160108-64 Copyright (c) 2000 - 2016 Intel Corporation  Input file /var/tmp/apic.dat, Length 0xBC (188) bytes ACPI: APIC 0x0000000000000000 0000BC (v03 ALWARE ALIENWRE 01072009 AMI  00010013) Acpi Data Table [APIC] decoded Formatted output:  /var/tmp/apic.dsl - 8729 bytes Input file /var/tmp/bgrt.dat, Length 0x38 (56) bytes ACPI: BGRT 0x0000000000000000 000038 (v01 ALWARE ALIENWRE 01072009 AMI  00010013) Acpi Data Table [BGRT] decoded Formatted output:  /var/tmp/bgrt.dsl - 1495 bytes Input file /var/tmp/dbg2.dat, Length 0x54 (84) bytes  (... SNIP ...)  Pass 1 parse of [DSDT] Pass 2 parse of [DSDT] Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)  Parsing completed ACPI Error: External method arg count mismatch _SB_.PCI0.GFX0.ATPX: Current 7, attempted 4 (20160108/dmextern-822) ACPI Error: External method arg count mismatch _SB_.PCI0.GFX0.ATPX: Current 7, attempted 1 (20160108/dmextern-822)  Found 20 external control methods, reparsing with new information Pass 1 parse of [DSDT] Pass 2 parse of [DSDT] Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)  Parsing completed Disassembly completed ASL Output:    dsdt.dsl - 1135146 bytes  iASL Warning: There were 20 external control methods found during disassembly, but additional ACPI tables to resolve these externals were not specified. The resulting disassembler output file may not compile because the disassembler did not know how many arguments to assign to these methods. To specify the tables needed to resolve external control method references, the -e option can be used to specify the filenames. Note: SSDTs can be dynamically loaded at runtime and may or may not be available via the host OS. Example iASL invocations:     iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml     iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml     iasl -e ssdt*.aml -d dsdt.aml  In addition, the -fe option can be used to specify a file containing control method external declarations with the associated method argument counts. Each line of the file must be of the form:     External (<method pathname>, MethodObj, <argument count>) Invocation:     iasl -fe refs.txt -d dsdt.aml  (... SNIP ...)  ACPI Error: External method arg count mismatch _SB_.GGOV: Current 4, attempted 2 (20160108/dmextern-822) ACPI Error: External method arg count mismatch _SB_.GGOV: Current 4, attempted 2 (20160108/dmextern-822) ACPI Error: External method arg count mismatch _SB_.GGOV: Current 4, attempted 2 (20160108/dmextern-822)  (... SNIP ...)  ACPI Error: External method arg count mismatch _SB_.PCI0.LPCB.H_EC.ECWT: Current 6, attempted 7 (20160108/dmextern-822) ACPI Error: External method arg count mismatch _SB_.PCI0.LPCB.H_EC.ECWT: Current 6, attempted 4 (20160108/dmextern-822)  (... SNIP ...)  ACPI Error: External method arg count mismatch P8XH: Current 2, attempted 5 (20160108/dmextern-822) ACPI Error: External method arg count mismatch P8XH: Current 2, attempted 5 (20160108/dmextern-822) (... REPEATS 9 TIMES ...)  (... SNIP ...)  ACPI Error: External method arg count mismatch _SB_.SGOV: Current 5, attempted 2 (20160108/dmextern-822)  (... SNIP ...)  ACPI Error: External method arg count mismatch _SB_.SGOV: Current 7, attempted 2 (20160108/dmextern-822)  (... SNIP ...)  Etc., etc., etc. 

I’ve searched on github.com for tools to analyze ACPI in Linux and sure enough there are a lot of them. But I’m wondering if someone has had similar experience and what tool(s) they used?

SharePoint Online : Publishing Pages : problems with Ribbon and Page Content Field

I’ve got a big problem with Publishing Pages : On a Site Collection, a “publication portal” type. On every site which is a Publication site, in the Pages Library, i have got two different bugs in every page i create, with standard Sharepoint Content Types and standard Sharepoint Page layout.

Step 1 : Pages Library, in the ribbon, click on the arrow near “New Document” icon. I select “Article Page” (Sharepoint Standard Content Type), give it a name and select “(Article Page) : body only”.

Step2 : When the page is created, it is extracted. I click on it, then click on “Modify” and enter several lorem ipsum lines in the body. Then save it and publish it.

So far, everything works fine.

Bug #1 : On the page (which is published,not yet extracted), when clicking on “Site actions” (gear icon, upper right)=> “Modify Page”,

I have a message popping up, saying “You need to check out this page to modify it. Do you want to check it out?” I choose “Yes”. Then the first mess happens : I can’t modify the Page Content field : It is not clickable, and strangely, my ribbon doesn’t show the tabs “Text Format” and “Insert”.

So, i decide to cancel the check out.

Bug #2 : On my Page Library, my article page is published, and not yet checked out. I select it, and then go to the Page tab in ribbon and click on “check out”. Then, i click on my page title to see it. On the page, i click (like for the precedent bug) on “Site actions” => Modify. My ribbon displays the good tabs, but freezes, and becomes grey, therefore i can’t control any format of my content. But there is more, i can’t modify the text in my Page Content field. (like in bug #1)

Is there anyone here who does have the same problem ?

Do you know where it could come from?

Thanks a lot !

Intersection of decision problems?

Say we have two problems $$\Pi_1\in NP$$ and $$\Pi_2\in coNP$$. Where does $$\Pi_1\cap\Pi_2$$ live?

How to come up with NP Complete and NP hard problems?

So, from my understanding, NP-Complete is when there is no known algorithm to solve it. Lets take clique for example, it’s a known NP Complete problem with the info

clique

input: a undirected graph $$G$$ and a natural number $$k$$

question: Does $$G$$ have a clique of size $$k$$?

How do I make like a twist to this so that I know it’s still NP Complete?

I have Problems when uploaded the image on my product in backend magento 2.3.2

today when try to upload the image on my product, magento show me this error

firts time magento show me this error becauses, before i edited all my products, and now magento show me this.