Using a modal to display a dynamic form?

So currently I am building an interface that consists of user created “Documents” which can have a variable number of “items” associated with it. The problem is that I am not sure what is the most ideal method to represent the aforementioned user workflows. Below is an early stage prototype which illustrates the issues.Would really appreciate any feedback on how I can improve the solution.

enter image description here

Dynamic programming algorithm with an O(n) performance that will give the optimal solution

I am currently learning the dynamic substructure and optimal solution for the coin change-making, and one of the questions given from my teacher is to describe an overall O(n) dynamic programming algorithm that will give the optimal solution and why is it O(n)? Can anyone help me to understand the question? Thank you!

Is the choice of static and dynamic typing not visible to the programmers of the languages?

From Design Concepts in Programming Languages by Turbak

Although some dynamically typed languages have simple type markers (e.g., Perl variable names begin with a character that indicates the type of value: $ for scalar values, @ for array values, and % for hash values (key/value pairs)), dynamically typed languages typically have no explicit type annotations.

The converse is true in statically typed languages, where explicit type annotations are the norm. Most languages descended from Algol 68 , such as Ada , C / C++ , Java , and Pascal , require that types be explicitly declared for all variables, all data-structure components, and all function/procedure/method parameters and return values. However, some languages (e.g., ML , Haskell , FX , Miranda ) achieve static typing without explicit type declarations via a technique called type reconstruction or type inference.

Question 1: For dynamically typed languages which “have no explicit type annotations”, do they need to infer/reconstruct the types/classes, by using some type/class reconstruction or type/class inference techniques, as statically typed languages do?

Question 2: The above quote says static or dynamic typing and explicit or no type annotations can mix and match.

  • Is the choice between static and dynamic typing only internal to the implementations of programming languages, not visible to the programmers of the languages?

  • Do programmers in programming languages only notice whether the languages use explicit type/class annotations or not, not whether the languages use static or dynamic typing? Specifically, do languages with explicit type/class annotations look the same to programmers, regardless of whether they are static or dynamic typing? Do languages without explicit type/class annotations look the same to programmers, regardless of whether they are static or dynamic typing?

Question 3: If you can understand the following quote from Practical Foundation of Programming Languages by Harper (a preview version is https://www.cs.cmu.edu/~rwh/pfpl/2nded.pdf),

  • Do the syntax for numeral (abstract syntax num[n] or concrete syntax overline{n}) and abstraction (abstract syntax fun(x.d) or concrete syntax λ(x)d ) use explicit types/classes with dynamic typing?
  • If yes, is the purpose of using explicit types/classes to avoid type inference/reconstruction?

Section 22.1 Dynamically Typed PCF

To illustrate dynamic typing, we formulate a dynamically typed version of PCF, called DPCF. The abstract syntax of DPCF is given by the following grammar:

Exp d :: = x x variable            num[n] overline{n}      numeral            zero zero      zero            succ(d) succ(d)      successor            ifz {d0; x.d1} (d) ifz d {zero → d0 | succ(x) → d1}      zero test            fun(x.d) λ(x)d      abstraction            ap(d1; d2) d1 (d2)      application            fix(x.d) fix x is d      recursion 

There are two classes of values in DPCF, the numbers, which have the form num[n], and the functions, which have the form fun(x.d). The expressions zero and succ(d) are not themselves values, but rather are constructors that evaluate to values. General recursion is definable using a fixed point combinator but is taken as primitive here to simplify the analysis of the dynamics in Section 22.3.

As usual, the abstract syntax of DPCF is what matters, but we use the concrete syntax to improve readability. However, notational conveniences can obscure important details, such as the tagging of values with their class and the checking of these tags at run-time. For example, the concrete syntax for a number, overline{n}, suggests a “bare” representation, the abstract syntax reveals that the number is labeled with the class num to distinguish it from a function. Correspondingly, the concrete syntax for a function is λ (x) d, but its abstract syntax, fun(x.d), shows that it also sports a class label. The class labels are required to ensure safety by run-time checking, and must not be overlooked when comparing static with dynamic languages.

Thanks.

SPServices Cascade Dropdowns dynamic filter

I have 3 lookup columns.

  1. Site – lookup column to specify type of environment (prod or non-prod)
  2. Operating System – lookup column to specify operating system to be used (linux or windows)
  3. Templates – lookup column that displays list of templates for linux and windows.

Basically, i want to filter the templates base on the type of environment and operating system. i’m using SPServices.SPCascadeDropdowns as solution. the problem is, cascade only works when form is loaded for the first time so in order to select different template whether for linux or windows, form needs to be refreshed. i am new to sharepoint and spservices. appreciate your help on this. below is the code

$  (document).ready(function(){ $  ("select[title='Operating System']").change(function() {     if ($  ("select[title='Operating System']").val() != 2)     {     queryCAML = "<Eq><FieldRef Name='Operating_x0020_System'/><Value Type='Lookup'>Windows</Value></Eq>",     osType()     }     else     {     queryCAML =  "<Eq><FieldRef Name='Operating_x0020_System'/><Value Type='Lookup'>Linux</Value></Eq>",     osType()     } });  

});

function osType() {     var osValue = $  ("select[title='Operating System'] option:selected").text();             alert (osValue);             alert (queryCAML);             $  (document).ready(function(){             $  ().SPServices.SPCascadeDropdowns({                 relationshipList: "TEST VM Templates",                 relationshipListParentColumn: "Site",                 relationshipListChildColumn: "Template",                 CAMLQuery: queryCAML,                 parentColumn: "Site",                 childColumn: "Template",                 debug: true             })         });  }  

Dynamic media queries with CSS inside PHP file

I’m currently developing a WP plugin (specifically a set of Gutenberg blocks), in which I would like to have the ability to set a series of breakpoint values through the plugin options, to later be able to retrieve them and use them as CSS media queries values.

The only approach I’ve thought of so far is the one described in this article, which basically consists in switching style.css for style.php and do all the PHP stuff needed in there.

Is this an optimal way to solve this issue? Any other suggestions or clarifications will be more that welcome.

P.S. As I mentioned, it’s a set of Gutenberg blocks, so any React/JS approach would also be very welcome 😉

sending mails with wp_mail() to multiple recipients using wp_cron and dynamic email body data

I have a frontend submission form, where users can add events to a custom post type. I want to send an email to each user 1 week before this event takes place.

The emails are sent via wp_cron. The function is called with a hook. Its working correctly, but i want to add custom values to the email body.

With my code its not possible to add dynamic value to the body template of my email.

With this function below, i loop through the events post type and get the required data

function leweb_get_events_detail() {      // Query     global $  wp_query;      // Arguments       $  args = array(         'post_type' => 'events',     );      // Start the Query     $  query = new WP_Query( $  args );      // The Loop     if( $  query->have_posts() ) {          $  results = array();          while( $  query->have_posts() ) {              $  query->the_post();                           $  event_date_timestamp = get_post_meta( get_the_ID(), 'event_date_timestamp', true );             $  future_timestamp = strtotime("+1 week");              // Damit wird geprüft ob schon einmal diese Email gesendet wurde             $  notification = get_post_meta( get_the_ID(), 'event_creator_notification' );              if( !in_array( '1week', $  notification )  && $  event_date_timestamp < $  future_timestamp ) {                  $  event_id = get_the_ID();                 $  event_email = get_post_meta( get_the_ID(), 'event_email', true );                  $  results[] = array(                                  'event_id'      => $  event_id,                                  'event_date_timestamp' => $  event_date_timestamp,                                 'event_email'     => $  event_email,                 );              }         }          return $  results;      }      wp_reset_query();  } 

The function below lets me fetch data from the post_meta array

function leweb_get_values_from_post_meta( $  meta = '') {      $  results = leweb_get_events_detail();      $  values = array();     foreach( $  results as $  key => $  value ){          $  values[] = $  value[ $  meta ];      }      return $  values; } 

The function below is called from wp_cron. The email is sent to all recipients who match the above conditions and a value is added to the post meta, to prevent multiple sends of this email.

function leweb_send_mail_to_author() {       // Alle Emails aus dem Array auslesen und für das BCC Feld im Email Header vorbereiten     $  emails = leweb_get_values_from_post_meta( 'event_email');      if ( !empty( $  emails ) ) {          $  emails = 'BCC: ' . implode( ',', $  emails );          // Email senden         $  to = '';         $  subject = 'Dein Event findet bald statt!';         $  body = file_get_contents( get_stylesheet_directory() . '/templates/email/event-creator-notification.php');         $  headers = array( 'Content-Type: text/html; charset=UTF-8','From: Example <office@example.com>', $  emails );          wp_mail( $  to, $  subject, $  body, $  headers );          // Wert in post_meta eintragen um die Mehrfachsendung zu verhindern         $  post_id = leweb_get_values_from_post_meta( 'event_id');          foreach( $  post_id as $  id ) {              add_post_meta( $  id, 'event_creator_notification', '1week' );          }      }  } 

After i coded this i figured out, its not possible to send dynamic content in the body of my email. The only way to achieve this, is to call the wp_mail() in foreach. But this would be heavy i think? Its possible that this job sends up to hundred emails per run in the future…

So i was wondering if there is another way to do this clean?

Thanks for your opinions, i know its a bit complex, but i dont have any other ideas…

Multiple choice knapsack dynamic problem

Giving a the following:

A list of a store items $ T=\{t_1, t_2,…,t_n\}$ .

A list of prices of each item $ P=\{p_1, p_2,…,p_n\}$ .

A list of quantities of each item $ Q=\{q_1, q_2,…,q_n\}$ respectively.

And total bill $ M$ .

Our goal is to find any possible list of items that its total value is equal to $ M$ using dynamic problem.

My question does 0/1 weighted Knapsack problem help, where $ M$ can be the capacity of the knapsack, and the weight of each item equal to the quantity of the item. If there is any other better approach I would appreciate any references.

ARP: Multiple dynamic IP address

Screen grab of CMD ARP -A command.

On a shared private WIFI with BTHUB 5, the IP .1.64 is assigned by the DHCP table, like all IP for various devices.

From my perspective, running CMD with interface .1.72, what is the significance of multiple dynamic address especially when one is NOT that belonging to the hub itself but rather that in this case the .1.64 belongs to another device?

Forbidden Sequence Dynamic Programming

Given a finite set $ \Omega$ , I have the following problem. Say there is a list of forbidden subsequences $ F \subset \Omega \cup \Omega^2 \cup \Omega^3 \dots \Omega^\infty$ , while we do not know the contents of list before hand, we can make a query about any sequence $ S \in \Omega^i$ to see if $ \exists f \in F, f \subseteq S$ . I want to construct a sequence $ S \in \Omega^n$ such that $ f \not \subseteq S, \forall f \in F$ .

I want to construct all the sequences $ S \in \Omega^n$ such that $ f \not \subset S, \forall f \in F$ .

The approach I thought would be best is to use dynamic programming. We iteratively construct valid sets $ V_k := \{S \in \Omega_k: f \not \subset S ,\forall f \in F, |f|< k\}$ , by requiring each subsequence of $ s \in V_1 \cup \dots V_{k-1}, \forall s \subsetneq S$ , and then remove all $ S \in F$ with queries. My question is, what’s the most efficient way to construct $ V_k$ ? One simple way would be to take $ V_{k-1}$ and then try adding each element in $ \Omega$ at the end, and then do some extra queries, but is there some better way?

Additionally, are there elegant ways to use incomplete valid sets $ I_k \subseteq V_k$ , where if $ I_{k+1} := \{S \in \Omega^{k+1} \setminus F: s \in I^1 \cup \dots I^k, \forall s \subsetneq S\}$ is empty, we can try to retroactively expand everything without mostly starting from scratch?