## Using output from Solve or Reduce as a value in subsequent equation

I’m trying to run a simulation. I will number sentences to make response easier. (1) Here is my first equation:

``𝑗[LBar_, y_, x1_, σ_, X2M_, w_, X1M_]:=(LBar(𝜎−1)⁄𝜎 + 𝑦(𝜎−1)⁄𝜎−x1(𝜎−1)⁄𝜎)𝜎⁄(𝜎−1)−(𝑦−X2M+𝑤(LBar+X1M)−𝑤x1) ``

(2) I insert some parameter values and Reduce:

``Reduce[𝜕x1(𝑗[100,𝑦,x1,13⁄,42,.23,80])==0 && x1>0, x1, Reals] ``

(3) This produces output:

``x1 == 119.575 ``

(4) When I try to call the output value (119.575) I run into problems. (5) For instance

``2 % ``

results in:

``2 (x1 == 119.575) ``

(6) and

``j[100, 80, %[[2]], 1/3, 42, .23, 80] ``

produces this output:

``-79.4 + 1/Sqrt[41/160000 - 1/239.149[[2]]^2] + 0.23 239.149[[2]] ``

Hey I am using a WPQuery to loop through and show blog categories in posts. It’s in a page tempplate. has 21 posts and I want them to show 10 per page with navigation links for next pages of 10 posts but below code is not outputting that buttons

``<div class="container-blog-post d-flex flex-wrap justify-content-start">          <?php  \$  paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;         \$  args = array(             'post_type'      => 'post',             'category_name'  => 'blog',             'posts_per_page' => 10,             'orderby'        => 'date',             'order'          => 'DESC',              'paged' => \$  paged         );          \$  the_query = new WP_Query( \$  args ); ?>          <?php if ( \$  the_query->have_posts() ) : ?>              <?php while ( \$  the_query->have_posts() ) : \$  the_query->the_post();                    if(has_post_thumbnail()) {                     \$  image = get_the_post_thumbnail_url();                 }else{                     \$  image = get_template_directory_uri().'/assets/images/default.svg';                 }                                             \$  url   = get_permalink();                 \$  title = get_the_title();                 \$  text  = excerpt(20);                 \$  date = get_the_date();              ?>                                <a href="<?php echo \$  url; ?>" class="single-post card">                 <figure class="image-wrapping">                   <img src="<?php echo \$  image; ?>" alt="">                 </figure>                 <div class="body-post card-body">                   <h3 class="title-post card-title"><?php echo \$  title; ?></h3>                   <p class="card-text line-clamp-2"><?php echo excerpt(10); ?></p>                   <button class="btn-read-more arrow">Read more</button>                   <div class="button-post">                     <span class="date-post"><?php echo \$  date; ?></span><span class="author-post"><?php echo the_author(); ?></span>                   </div>                 </div>               </a>                <?php endwhile; ?>                      <div class="previous">                 <?php previous_posts_link(); ?>         </div>         <div class="next">             <?php next_posts_link(); ?>         </div>             <?php wp_reset_postdata(); ?>         <?php endif; ?>        </div> ``

## MYSQL TIMESTAMP when adding DATE_FORMAT then the output is blank, PHP conflict?

Usingthe following shortcode function, I have the code building a table by querying the DB. That all works fine. BUT when I add any type of formatting to the `TimeStamp` column such as DATE_FORMAT or TIME the output for that column only goes blank. No errors are in the console to look at. I am trying to extract only the time and put it in a 12 hour format instead of the typical TIMESTAMP format of date and time in the 24hr set up.

Is there a conflict with some of the PHP that causes it not to display the timestamp?

`` function test2() {         global \$  wpdb;     \$  results = \$  wpdb->get_results("SELECT `name`, `partysize`, `phonenumber`, `emailaddress`, DATE_FORMAT(`Time_stamp`, '%h %i' ), `Wait`, `currentstatus` FROM mytablename m RIGHT JOIN (SELECT wdt_ID, CONCAT(ROUND(Time_to_sec(TIMEDIFF (NOW() ,`Time_stamp`))/60,0), ' Min') AS Wait FROM mytablename) as t on m.wdt_ID = t.wdt_ID WHERE Time_stamp >= date_sub(now(),interval 3 hour)  ");          if(!empty(\$  results))         {             echo "<table width='100%' border='0' style='display:inline-table'>             <th>Name</th>             <th>Party Size</th>             <th>Phone Number</th>             <th>Email Address</th>             <th>Time Stamp</th>             <th>Status</th>             <th>Wait</th>             <th>Action</th>     ";             echo "<tbody>";                   foreach(\$  results as \$  row){                  echo "<tr>";                 //echo "<td>" . \$  row->wdt_ID . "</td>";                 echo "<td>" . \$  row->name . "</td>";                 echo "<td>" . \$  row->partysize . "</td>";                 echo "<td>" . \$  row->phonenumber . "</td>";                 echo "<td>" . \$  row->emailaddress . "</td>";                 echo "<td>" . \$  row->Time_stamp . "</td>";                 echo "<td id='tdid_".\$  row->wdt_ID."'>" . \$  row->currentstatus . "</td>";                 echo "<td>" . \$  row->Wait . "</td>";                 echo '<td> <a href="javascript:void(0)" class="button seated-btn" onclick="seatclick('.\$  row->wdt_ID.')" data-id="'.\$  row->wdt_ID.'"></a></td>';                 echo "</tr>";             }             echo "</tbody>";             echo "</table>";          }     }     add_shortcode('test2', 'test2'); ``

## Why does Horizontalgauge output flicker when i sliding the marker?

The simplest HorizontalGauge[] as following:

``HorizontalGauge[Dynamic[x], {0, 100}] ``

when i dragged the triangle marker along the axis, the axis kept flicker until i released it, but if i used Slider[] instead as following:

``Slider[Dynamic[k], {0, 100}] ``

the Slider never flicker, so what’s the problem with HorzontalGauge[]?

## SQL: CASE WHEN having AVG() as condition not giving right output

I have a table of unique users that each has a "rating" column (it’s an average rating they give out of all their ratings given in a different table of reviews). I want to add another column to my table, which specifies either them giving a rating that is above the average of all ratings of all users (hence I use the AVG() function), below or at average (I call it "bias"). In other words, I want to see whether each user gives on average higher or lower ratings than the total average. I understand the limitedness of this query, and ideally I would include an interval (i.e. within 0.5 points below or above average still counts as average) but I can’t seem to make even the simplest query work.

I’ve been using the Yelp dataset from a Coursera course, but I tried to create a sample that produces the same result that I do not want – just one row. I want to have this categorization for each row, hence it should return 3 rows in this example, "below average" in the first two and "above average" in the third. However, the code below produces just one row. I have been working with R and this seems like I am using incorrect syntax, but after 30 minutes of searching the web I cannot find a solution.

I am working in and want to use SQLite syntax as part of the course in Coursera

``CREATE TABLE test      (      id integer primary key,       rating integer     );  INSERT INTO test (id, rating) VALUES (1, 1);  INSERT INTO test (id, rating) VALUES (2, 3);  INSERT INTO test (id, rating) VALUES (3, 8);  SELECT id, rating,   CASE     WHEN rating > AVG(rating) THEN "above average"     WHEN rating < AVG(rating) THEN "below average"     ELSE "no bias"    END AS "bias" FROM test ``

## why does bool(9) or any other no. except 1&0 with bool give the output true and why not false in python ? What is the logic behind it?

In Python programming when i write bool(1) the output is true while when i write bool(0) the output is false. But when i write any other number with bool it turns out to be true.

## I am not getting output for the below batch file as expected [closed]

I wrote the below mentioned test batch file… But while executing it, when I give input as "How are you" then the file automatically gets terminated.

@echo off echo Hi! echo Happy to be at your service 🙂 :start set /a A = How are you set /p help="How may I help you? " if /i %help% EQU excel (start excel) else (if /i %help% EQU %A% (echo I am good! Thanks for asking)) goto start

But, if I write…

@echo off echo Hi Sir! echo Happy to be at your service 🙂 :start set /a A = How set /p help="How may I help you? " if /i %help% EQU excel (start excel) else (if /i %help% EQU How (echo I am good Sir! Thanks for asking)) goto start

and when I give input as "How"… I get the output as expected.

The output that I get at this case is…

Kindly help me in solving this issue.

## how to get rid of curly brackets writing minimization output to file

I have the following code

``SetDirectory["C:\test"]; fname = FileNameJoin[{%, "results.dat"}]; str = OpenWrite[fname, FormatType -> StandardForm]  D1 = 0.4; D2start = 0.26; D2fin = 0.5; Ntot = 12; D2step = (D2fin - D2start)/Ntot;  For[i = 0, i <= Ntot, i++,   D2 = D2start + i*D2step ;   With[{minsol = NMinimize[fnew[D1, D2, x], x]},   fmin = First@minsol;   xn = Values@ Last@ minsol;];   Write[str, D2, " ", xn]; ]   Close[str]; ``

i.e I minimize the function fnew wrt x and write the value of x in the file results.dat. The problem is that the output is

``0.26 {0.711259} 0.28 {0.744881} 0.3 {0.776204} 0.32 {0.805418} etc. ``

How do I get rid of these annoying curly brackets?

## Given a plot of a network Graph[] how can the {x,y} screen coordinates be output?

Is there a general way to get the screen or "world" coordinates for every vertex in the graphic output of something like this?

``Table[Graph[Table[i \[UndirectedEdge] i + 1, {i, 20}],    GraphLayout -> l,    PlotLabel -> l],  {l, {"CircularEmbedding", "SpiralEmbedding"}}] ``

Trying to build an algorithm to generate novel layouts and want to use a large amount of other algorithms for training data.

## Hardwiring the output in quantum black box separation

In this paper, while using a diagonalization argument in Section $$5$$, the authors write:

Fix some enumeration over all $$poly(n)$$-size quantum verifiers $$M_{1}, M_{2},…$$ which we can do because the number of such machines is countably infinite (by the Solovay-Kitaev theorem [15]). Some of these verifiers may try to decide a language by trivially “hardwiring” its outputs; for example, by returning 1 independent of the input. We start by fixing a unary language $$L$$ such that no machine $$M_{i}$$ hardwires the language. We can always do this because there are more languages than $$poly(n)$$-sized machines.

Maybe I am missing something very basic, but:

1. Why do we care if some of the verifiers have the output hardwired?
2. How can we find an $$L$$, like in the description? Why will this $$L$$ even be decidable? I know there are more languages than there are Turing machines; but those extra languages aren’t decidable.