text:
Q: PHP jQuery Form Data I have just started to develop the form below and I have the following questions:
How using PHP or Local Storage could I save the data of the previous page when the client clicks next?
How could I attach an image to the form.  When the form is completed I would like it to be attached and sent in an email?
<form action="#" method="post">
        <legend>Company Details:</legend>
        <label for="companyName">Company Name: </label><input type="input" name="companyName" id="companyName"/>
        <label for="companySlogan">Company Slogan: </label><input type="input" name="companySlogan" id="companySlogan"/>
        <label for="companyEmail">Company E-Mail: </label><input type="email" name="companyEmail" id="companyEmail"/>
        <label for="companyPhone">Company Phone: </label><input type="phone" name="companyPhone" id="companyPhone"/>
        <label for="companyFax">Company Fax: </label><input type="phone" name="companyFax" id="companyFax"/>
        <label for="companyAddress">Company Address: </label><textarea name="companyAddress" id="companyAddress"></textarea>
        <legend>Web Hosting:</legend>
        <label for="hostingRequired">Hosting Required: </label>
            <select name="hostingRequired" id="hostingRequired">
                <option value="hostingRequiredPleaseSelect">Please Select</option>
                <option value="hostingRequiredYes">Yes</option>
                <option value="hostingRequiredNo">No</option>
            </select>
            <label for="domain">Domain: </label><input type="url" name="domain" id="domain"/>
            <label for="domainType">Domain Type: </label>
            <select name="domainType" id="domainType">
                    <option value="domainTypePleaseSelect">Please Select</option>
                    <option value="domainTypeRegister">Register</option>
                    <option value="hostingRequiredNo">Transfer</option>
                </select>
    </form>

A: For your first question, you can save the data in a database or session variables, I think you may want to save in session variables instead (although I don't know exactly how you want to use your data).
I don't quite understand your second question, clarify... By the way, if you don't want any section to load on the selection of an option, be sure not to attach any event to it.
Use input type="file" to attach a file (in this case an image file to the form) and send along with other data

A: Part 1:
Save the data to a database on your backend when the user hits next, it is really saving data and retrieving it on the next page.
or
pass the data in URL parameters to the next page
Part 2:
google it.


text:
Q: cannot get html special chars from url I'm very new to php and can't find answer to my issue.
I try to echo a string with special characters (ie. à,é) from the URL.
URL string:
preview.php?content=
blà é bla

Expected echoed result: blà é bla
So I do this:
$cont = $_GET['content'];
echo $cont;

Result:
    bl
So, even if my page has a <meta charset="UTF-8">, I tried:
$cont = $_GET['content'];
$cont = html_entity_decode($cont, ENT_COMPAT, 'UTF-8');
echo $cont;

Same result:
    bl
I tried with a header (header('Content-Type: text/html; charset=UTF-8');) at top of the page with same result.
What's weird is that is I try this:
echo html_entity_decode("
blà é bla
");

or even this:
echo "
blà é bla
";

I get the expected result:
    blà é bla
So, I don't think it's a charset issue but can't understand why it works with the literal string but not with the get variable, can someone help me?

A: Encode your URL with: urlencode and htmlentities for example:
$url = 'content=' . urlencode('content=
blà é bla
');
echo '';

A: @JustOnUnderMillions, is correct.
E.g:
If you try to access data from URL like
http://localhost/index.php?content=%3Cp%3Eblà%20é%20bla%3C/p%3E

echo $_GET['content'];

OUTPUT: bl

But when you pass data by encoding data like
http://localhost/index.php?content=%3Cp%3Ebl%26agrave%3B%20%26eacute%3B%20bla%3C%2Fp%3E

echo $_GET['content'];

OUTPUT: blà é bla

It is better to use urlecode function for encode data in URL.

A: Thanks all.
This works perfectly !
Actualy, as my URL is generated with javascript, I did a encodeURIComponent on my link's href variable and it works as well.

A: If you want to pass a URL with parameters as a value in a URL and through a javascript function, such as.

Pass the URL value through the PHP urlencode() function twice, like this
<?php

   $url = "index.php?id=4&pg=2";
   $url = urlencode(urlencode($url));
   echo "";
?>

On the page being opened by the javascript function (page.php), you only need to urldecode() once, because when javascript 'touches' the URL that passes through it, it decodes the URL once itself. So, just decode it once more in your PHP script to fully undo the double-encoding.
<?php
   $url = urldecode($_GET['url']);
?>

If you don't do this, you'll find that the result URL value in the target script is missing all the var=values following ? question mark.
index.php?id=4

kindly check this online tool also : URL Encode , URL Decode

redpajama_set_name: RedPajamaStackExchange


text:
Q: SQL Pivot with variable columns I have two tables say Person(person_id, name) and another table Contacts(person_id, phone_type, phone_no).
Person
-----------------
person_id    name
-----------------
P1           Abc
P2           Xyz

Contacts
--------------------------------
person_id   phone_type  phone_no
--------------------------------
P1          phone1      12345
P1          phone2      23455
P2          phone1      67897
P2          phone3      89786

I need to create a view v_pc which looks something like

v_pc
person_id  name phone1 phone2 phone3
-------------------------------------
P1         Abc  12345  23455
P2         Xyz  67897         89786

i.e., rows of contacts table are pivot-ed to form columns for the view(number of columns will be variable based on distinct values of 'phone_types' column).
Is there any way I can Pivot the contacts table but use dynamic pivot-in-clause, something like

SELECT *
 FROM (
    SELECT
        person_idd,
        phone_type,
        phone_no
    FROM contacts
 ) PIVOT (MAX(phone_no) FOR phone_type IN ('phone1','phone2','phone3'))

I also tried using XML clause in with pivot so use dynamic pivot-in-clause ,i.e., extracting result in XML and then recreating columns using XMLTABLE. But I am not able to reach the desired result.

A: You can use dynamic SQL (this assumes you have a bind variable v_cur of type SYS_REFCURSOR):
declare
  v_sql varchar2(32000);
  v_phonetypes varchar2(32000);
begin
  -- base SQL statement
  v_sql := 'SELECT *
    FROM (
      SELECT
        person_id,
        phone_type,
        phone_no
      FROM contacts
    ) PIVOT (MAX(phone_no) FOR phone_type IN (';

  -- comma-separated list of phone types
  select
    listagg('''' || phone_type || '''', ',') within group (order by phone_type)
  into v_phonetypes
  from (select distinct phone_type from contacts);

  v_sql := v_sql || v_phonetypes || '))';
  dbms_output.put_line(v_sql);
  -- execute query
  open :v_cur for v_sql;
end;

LISTAGG() requires 11gR2, but since you're using PIVOT, I guess you're using it anyway.

A: Why don't you try creating the view using dynamic SQL? Just engineer the CREATE statement in the same manner that Frank has created the PIVOT query above. Then execute both, CREATE statement first, PIVOT query later.


text:
Q: How to get this scaling boxes image and text in proportion when you resize the window to any size? See this example http://jsfiddle.net/37aMB/15/
If you resize the area at some points image will have have space at bottom and some time right side container will have space at bottom.
I want to make everything in proportion and with equality. Red backgeound should never be seen

A: You may try to set fixed size for this banner, and then manipulate zoom style attribute.
Here is modified example. It's not pixel perfect yet, but I have the impression it scales better.


text:
Q: Issue with data field selection using Docusign i am working on pdf in docusign, facing an issue while making selection between two data fields. Data fields have been marked as required, i have to make sure that if one enters some text in one field than other field should get disabled automatically and vice versa..
For example:
There are two data fields A and B and both are marked as required
If one enters some data in A then B should get disabled or B will no more be mandatory field and vice versa.
Can anybody suggest solutions for the same?
Thank you in advance


text:
Q: Got a list and need to match at least one to all entries in SQL Looking at this table:
+--------------+------------+
| DepartmentId | EmployeeId |
+--------------+------------+
|            2 | Franc      |
|            1 | Peter      |
|            1 | Franc      |
|            1 | Simon      |
|            2 | Peter      |
+--------------+------------+

I have a list of Persons, in this example :employees {Franc,Peter}. So I want to find out where those two guys working BUT if another person is working there like Simon. I don't want to know.
I tried
Select departmentId from employeeId in :employees.

This gives me {1,2}. From a logical standpoint i just wanna have:
Select  deparmentId from employeeId "exactly" in :employees

So I want to get DepartmentId:2, because Simon is also working at Department 1. And I just want to know where Franc, Peter work there alone.

A: Here is three different ways of doing this:
SELECT DepartmentId
FROM your_table
GROUP BY DepartmentId
HAVING
    SUM(CASE WHEN EmployeeId = 'Franc' THEN 1 ELSE 0 END) = 1
    AND
    SUM(CASE WHEN EmployeeId = 'Peter' THEN 1 ELSE 0 END) = 1
    AND
    COUNT(EmployeeId) = 2

The query should pretty self explaining; the having clause makes sure the department has both Franc and Peter, and that the count of employees is 2, meaning there can't be any other employees in that department.
The query below joins the set of departments where Franc works with the set of departments where Peter works and uses thenot inclause to remove all departments where someone who isn't Franc or Peter works.
SELECT t1.DepartmentId FROM your_table t1
JOIN your_table t2 ON t1.DepartmentId = t2.DepartmentId
WHERE t1.EmployeeId = 'Franc' AND t2.EmployeeId = 'Peter'
AND t1.DepartmentId NOT IN (
    SELECT DepartmentId
    FROM your_table
    WHERE EmployeeId NOT IN ('Franc', 'Peter')
    )

Sample SQL Fiddle
A third way is to use the SQL set operators unionand except(or minus):
(
SELECT DepartmentId FROM your_table WHERE EmployeeId = 'Franc'
UNION ALL
SELECT DepartmentId FROM your_table WHERE EmployeeId = 'Peter'
)
EXCEPT
SELECT DepartmentId FROM your_table WHERE EmployeeId NOT IN ('Franc', 'Peter')

A: Something like this should do the trick:
SELECT  *
FROM    employee e2
    INNER JOIN (
                SELECT  COUNT(1) Occs,
                        Name
                FROM    employee E1
                GROUP BY Name
                Having COUNT(1) = 1
                ) emps
        on e2.Name = emps.Name

Returns Simon, as he's the only one who works in only one department


text:
Q: C# Applying SOLID principles for loops with different conditions I'm having a hard time trying to implement a SOLID principle regarding conditions inside loops.
For example I have a List of objects inside an object.
public class ClassTwo{
      int id;
      string name;
      string quantity;
      bool markasDelete;
    }
public class SampleClass{
      string name;
      List<ClassTwo> listClassTwo;
      ///other initializations, props, method ,construct

      void Process(List<ClassTwo> newListOfClassTwo){
         foreach(ClassTwo c in newListOfClassTwo){
               if(c.id == 0)
               {
                  ///do other things
                  listClassTwo.Add(c);
               }
               else if(c.id > 0 && !markasDelete)
               {
                  ///do update things
               }
               else
               {
                  ///do delete things
               }
         }

      }
    }

As you can see from above my "Process" method is doing too much. I tried to reduce the work segragating each condition to a specific method but im very unhappy with it. My code now looks something like this.
void Process(List<ClassTwo> newListOfClassTwo){
   foreach(ClassTwo c in newListOfClassTwo){
       AddMethod(c);
       UpdateMethod(c);
       RemoveMethod(c);

   }
}

Can please someone help me on this?


text:
Q: CondorHT - Six idle Procs all creating snapshots continuously. Whats wrong? I inherited a CondorHT cluster that crunches cloud metrics.
One master controller node. Six worker nodes.
The cluster was running perfectly for months then suddenly it breaks.
The cluster normally takes 1 to 2 hrs to complete but now never completes and is shut down/cut off by a daily cron shutdown at midnight.
The CollectorLog on the master node updates with messages indicating some activity is occuring. The messages arrive about one every 20 seconds.
The ProcLog on the master node and worker nodes updates with messages about one every 20 seconds. "no methods have determined process xxxx to be in a monitored family....taking a snapshot...snapshot complete."
The condor_status on the master node shows all processes as IDLE.
How can I debug this?

A: Hmm. The way HTCondor works is that it schedules job on machines.  Sounds like the jobs are idle.  Or, maybe there aren't any jobs.  So, let's start there.  If you run condor_q, or maybe condor_q -all, depending on the version of condor, what does that say about the jobs?


text:
Q: Is there a CGAL function for finding all intersecting points between a 2D line (Line_2) and a set of 2D polygons with holes (Polygon_with_holes_2)? I have a line from 0, 0 to 1024, 0. Many polygons with holes lie between the two ends of the lines. I would like to know if there is any CGAL function that can tell me all the points of intersection between the line segment and all the polygons with holes.
Alternatively, a function for intersection between a line and a single polygon with holes would also suffice for the moment. This function would have to tell me all the points at which the line intersects with the polygon with holes.

A: The answer is no. Intersection functions for polygons work with two polygons only, and the meaning of the intersection is a piece of plane, consisting of points, lying inside both polygons. If you want to find intersection points for a segment and the polygon boundary - you need to extract all the boundary edges one by one and compute all the intersections one by one. The example is below:
#include <iostream>
#include <vector>

#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Polygon_2.h>

using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
using Polygon = CGAL::Polygon_2<Kernel>;
using Point = Polygon::Point_2;
using Segment = Polygon::Segment_2;

int main()
{
  // ------ define segment
  const Segment s{{-1000, 0}, {1000, 0}};
  // ------ define polygon
  const std::vector<Point> pts{{3, 3}, {-3, 3}, {-3, -3}, {3, -3}};
  const Polygon p(pts.cbegin(), pts.cend());
  // ------ find all intersections of the segment with polygon edges
  for (auto eit = p.edges_begin(); eit != p.edges_end(); ++eit)
  {
    const auto res = CGAL::intersection(s, *eit);
    if (res)
    {
      const auto pt = boost::get<Point>(&*res);
      std::cout << *pt << std::endl;
    }
  }
}

If you work with polygons with holes, then this process should be repeated for all the holes. The example above is a simplification of the intersections processing - more complete examples can be found here.


text:
Q: Azure DevOps - Pipeline CI/CD - PR automated Is it normally when creating a pull request manually in bitbucket, to see on Azure DevOps for the pipeline runs:
PR automated for branc_name like below:

I don't want that a pr will be created automatically. I want that the developer create a pr manually and only if the team leader merge, so the pipeline CI/CD is running.
Now what is happened is:

*

*I create a pr manually

*Azure DevOps displays that PR automated for branch-name

*The pipeline CI/CD is running automatically even i didn't merge the code in the dev branch.


text:
Q: Two dimension array to single dimension and back again I was trying to find information about transforming an index that has been converted from a 2 dimensional index , to a single one. Then turn the single index back to a 2 dimensional one. I don't even know what this method is called.
formula to single index
  int index = x + y * width;
   MyArray[index] ;

So my question is how do I turn it back into two dimensions?
int x = index ??? width;
int y = index ??? width;

Can't wrap my head around it for some reason.
Thanks

A: int x = index % width;
int y = index / width;

A: x = index % width;
y = index / width;


text: Q: HTML5 web Audio API CPU priority or prebuffer Is there a way to make priority for audio processing or a prebuffer using html5 audio API to avoid unsync, small breaks, when doing other non audio related processing? I rather have a continuous 500 ms latency than unsync. For example when I'm using lots of jQuery fadeIn/fadeOut simultaneously as having a cowbell at 128 bpm there can be small breaks/unsync on my iPhone. (Also on the iPhone when scrolling, zooming there is issues - but those I can solve by disabling that.)


text:
Q: Stellaris 6/8/9000 part libraries for Eagle? Someone pointed me at the freeware version of Eagle as a good starter dev tool. So I start playing around and I can't seem to find a part library for the chips I want to use. I found a library (the works) on the eagle site but it doesn't have the right parts and I found a library on the TI/Luminary Mico site (that I think has the right part) but it wont load (it has .src files and I seem to need .lbr) despite the fact it has files tagged specifically as for eagle.
Does anyone know where I can get files that will work? (Or how to make the files I have work?)

A: ftp://ftp.cadsoft.de/eagle/userfiles/libraries/luminary-arm.lbr
Symbols and footprints for:
LM3S101
LM3S102
LM3S301
LM3S310
LM3S315
LM3S316
LM3S328
LM3S601
LM3S610
LM3S613
LM3S615
LM3S628
LM3S6911
LM3S6918
LM3S6938
LM3S6950
LM3S6952
LM3S6965
LM3S801
LM3S811
LM3S812
LM3S815
LM3S828
LM3S8962


text:
Q: Search any element from a list in another list in MySQL I have a column called LocationsManaged specifying the location(s) which a person manages. e.g. Delhi,Kanpur,Patna for manager 1, Ajmer,Chandigarh,Jaipur for manager2 and Bhopal,Nagpur,Raipur for manager3. In another column called LocationsApplicable, I have the list of locations for which a scheme is applicable e.g. Chandigarh,Delhi,Jaipur,Kanpur. So, in this case, the scheme is applicable to Manager 1 & Manager2, but not Manager 3. Now I want to find out (preferably using a single non-nested query) the list of managers for whom the scheme is applicable. Is it possible in MySQL ?

A: Normalization is almost always the best option.
That being said, if your table is small you can use find_in_set as well.


text:
Q: Processing detecct whether mouse is inside a bouncing circle when clicked Trying to determine whether the mouse has been clicked within a certain ball and when it is clicked I want to display text that relates to that specific ball, this is what I have so far any help would be appreciated.
    int rad = 60;        // Width of the shape
float xpos1, ypos1;    // Starting position of shape
float xspeed = 4;  // Speed of the shape
float yspeed = 4;  // Speed of the shape
int xdirection = 1;  // Left or Right
int ydirection = 1;  // Top to Bottom
boolean overBox1 = false;
void setup()
{
  size(1200, 800);
  noStroke();
  frameRate(30);
  ellipseMode(RADIUS);
  // Set the starting position of the shape
  xpos1 = width/2;
  ypos1 = height/2;
}

void draw()
{

  background(102);

  circleone();

}
void circleone()
{
 xpos1 = xpos1 + ( xspeed * xdirection );
 ypos1 = ypos1 + ( yspeed * ydirection );
  if (xpos1 > width-rad || xpos1 < rad) {
    xdirection *= -1;
  }
  if (ypos1 > height-rad || ypos1 < rad) {
    ydirection *= -1;
  }
 ellipse(xpos1, ypos1, rad, rad);

}

 void mouseClick()
 {
   if (overCircle(xpos1,ypos1,rad)==true)
   {
     println("YO");
   }

 }
 boolean overCircle(float x, float y, int radius) {
  float disX = x - mouseX;
  float disY = y - mouseY;
  if (sqrt(sq(disX) + sq(disY)) <radius) {
    return true;
  } else {
    return false;
  }
}

A: This logic seems overcomplicated:
float disX = x - mouseX;
float disY = y - mouseY;
if (sqrt(sq(disX) + sq(disY)) <radius)

You could just use the dist() function instead:
return dist(x, y, mouseX, mouseY) < radius;

Then if you want to display some text when the ball is clicked, you're going to have to add more than a println() statement. You might set a boolean variable to true, and then in the draw() function you'd check that variable and draw something to the screen when it's true.
If you're trying to get many clickable balls on the screen, then you might think about creating classes that represent a ball and putting your logic in there.
But you haven't really asked a question. You've posted some code, haven't told us what you expect it to do, what it does instead, or how those two things are different. Stack Overflow isn't really designed for general "how do I do this" type questions. It's for more specific "I tried X, expected Y, but got Z instead" type questions. So you'll have much better luck if you post a MCVE instead of your entire project and ask a specific question about a specific line of code. Good luck.


text:
Q: how to generate sliding window features in sci kit learn? I have a data matrix where each row is measurement in time and each column is a feature.
time, feature 1, feature 2, feature 3
0, a, b, c
1, d, e, f
2, g, h, i
.
.
.

I would like to run some ML algorithms on this data (i also have with each row and associated label), regression, decision trees, but i want to add some time-sliding window features. That is for every measurement, say it has time i, i want to add the features of the measurement of time i-1 and i-2.
So the data matrix i want to end up with is:
time, feature 1, feature 2, feature 3, feature 1 time -1, feature 2 time -1, feature 3 time -3, feature 1 time -2, feature 2 time -2, feature 3 time -2
2, g, h, i, d, e, f, a, b, c
3, j, k, l, g, h, i, d, e, f
4, m, n, o, j, k, l, g, h, i
.
.
.

Notice that row with time 0 and 1 is missing, since they do not have enough historical data to add.
I figured that this was a common task and perhaps there was some way to do this in sci kit learn. Is there? I saw some plugins for creating sliding window features in images or text , but for a regular data matrix.


text:
Q: Gedit taking 20 seconds to start up on i3 I have installed i3 on my Ubuntu machine. Whenever I try to launch gedit, from command line or dmenu, there is a delay of precisely 20 seconds before it starts. During this time, it consumes no CPU so it is not doing anything. While gedit is running or quitting, there is no lag at all.
Uninstalling it and reinstalling it (using apt) did not help.
Why is gedit doing this and how do I stop it?

A: I figured it out.
Instead of having exec i3 in my ~/.xinitrc, I replaced it with dbus-launch --exit-with-session i3, that way dbus was correctly initialized.


text:
Q: Number of homomorphisms from $G = \langle x,y\mid x^{-1}yx=y^6\rangle$ to $S_5$ We are asked to find the number of homomorphisms from $G$ to $S_5$. We consider the homomorphisms from $F_2$ (with generators $x$ and $y$) to $S_5$ and then we say that if image of $x$ and $y$ satisfy the relations, then this can be factored by a normal subgroup containing the relation.
The question is how to formally find the number of such homomorphisms $\phi: F_2 \to S_5$ satisfying $x^{-1}yx=y^6$ (I understand that the idea is to observe the order of $y$ and determine if $y$ is a $2, 3, 4, 5$ - cycle, but what to do with $x$) and how to act if (for example) the number of cases to consider for the images of $x, y$ is large?

A: Here are some thoughts which should surely get you started. Conjugation in the symmetric group preserves the cycle type, because it has the effect of permuting the underlying symbols. Thus, the relation $x^{-1}yx = y^6$ tells you that $y$ and $y^6$ have the same cycle type. Then we see which cycle types this is possible for. Since the cycle decomposition breaks down into disjoint cycles, this can only happen when each cycle in the decomposition has an order coprime to $6$, else raising it to the sixth power will result in some trivial cycles appearing, or else modify the cycle type, which we can't have. Since $6 = 2 \cdot 3$, this forces $y$ to be either a trivial cycle or a cycle of length $5$, as no other orders can appear. If it's the trivial cycle, then you can send $x$ anywhere. So one family of maps comes from $y \mapsto e, x \mapsto \text{anything}$ and this finds us $5!$ uninteresting maps.
Can you handle the other case?


text:
Q: proving divergence I understand how to prove if a sequence is convergent, however I am having trouble proving whether or not a sequence is divergent.  I was wondering what the general method or proof would be to determine convergence.  For example obviously the sequence {n} is divergent, but how would you formally prove this?

A: If $a_n = n$ is convergent, then there is some limit $L$ to which it converges. This means that given $\epsilon > 0$, we can find a positive integer $N$ such that $|a_n - L| < \epsilon$ for all $n > N$. Plugging in $a_n = n$, the inequality becomes
$$|n - L| < \epsilon$$
which is true if and only if
$$-\epsilon < n-L < \epsilon$$
if and only if
$$-\epsilon + L < n < \epsilon + L$$
There is no way for this inequality to be satisfied for all sufficiently large $n$, because eventually $n$ will exceed $\epsilon + L$.
We conclude that $a_n$ cannot be convergent, hence it is divergent.

A: A sequence is divergent, if it is not convergent.
This might be because the sequence tends to infinity or it has more than one limit point.
Your example $x_n = n$ is of the first type:
$$
\lim_{n \to \infty} x_n = \lim_{n \to \infty} n = \infty
$$
You prove it by showing that for any number $K$ you can response with some index $N$ such that from that index on, the sequence surpasses the challenge. (See here).
Let $K \in \mathbb{R}$ then choose $N = \max(0, \lceil K \rceil) \in \mathbb{N}$ then for any $n$ with $n \ge N$ we have
$$
 n \ge \max(0, \lceil K \rceil) \ge K
\Rightarrow \\
x_n \ge K
$$
The maximum is added to deal with negative $K$ which might otherwise lead to invalid index values, e.g. if your sequence elements are indexed by natural numbers including $0$.

A: A general criterion is the following: A sequence $(a_n)_{n\geq0}$ is divergent iff it is not a Cauchy sequence, that is to say: Iff there are an $\epsilon_0>0$ and  arbitrarily large $n$, $m$ satisfying $|a_n-a_m|\geq\epsilon_0$.
An important case is if you can spot two different accumulation points $\alpha\ne\beta$.


text:
Q: Xcode-7, Could not build Module  I am facing an issue, related to cordova ios build using Xcode-7.
when I create fresh project on mac machine, I am able to build and run that on simulator ios 6s. But When I try to import the project built on windows machine to mac, I am not able to build it succesfully.
***Error:*

could not build module "IBMMobileFirstPlatformFoundation".

**
*Configuration on windows:
cordova 6.5.0
ionic 3.3.0
node 6.10.3
ios platform version is 4.4.0
npm version is 3.10.10
*
*configuration on mac machine
cordova 6.5.0
ionic 3.3.0
node 6.11
ios platform version is 4.4.0
npm version is 3.10.10
*
Xcode is 7.
thank you for kind attention, kindly suggest me what I doing wrong.
:)

A: After one week R&D, I found the the answer to the problem, there was the problem of Xcode version, I just updated the OS version and also the Xcode version. Later On I came to know that problem was cordova and ionic version also. I update the cordova version to 7.2.0 and ionic version to 3.4.0.
I have build the app and its running fine, with some UI issues.
also use ionic cordova build to build the project.
 thank you.


text:
Q: org.apache.http.NoHttpResponseException: The target server failed to respond import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.HttpProtocolParams;

public class JSONParser {

    static InputStream is = null;
    static JSONObject jObj = null;
    static String json = "";
    private final String TAG = "ACCESS";

    // constructor
    public JSONParser() {

    }

    // function get json from url
    // by making HTTP POST or GET mehtod
    public JSONObject makeHttpRequest(String url, String method,
        List<NameValuePair> params) {

        // Making HTTP request
        try {

            // check for request method
            if(method.equals("POST")){
            // request method is POST
            // defaultHttpClient
            DefaultHttpClient httpClient = new DefaultHttpClient();
            HttpPost httpPost = new HttpPost(url);
            httpPost.setEntity(new UrlEncodedFormEntity(params));

            HttpResponse httpResponse = httpClient.execute(httpPost);
            HttpEntity httpEntity = httpResponse.getEntity();
            is = httpEntity.getContent();

        }else if(method.equals("GET")){
            // request method is GET
            Log.e(TAG, "check1");
            DefaultHttpClient httpClient = new DefaultHttpClient();
            Log.e(TAG, "check2");
            HttpProtocolParams.setUseExpectContinue(httpClient.getParams(), false);
            Log.e(TAG, "check3");
            String paramString = URLEncodedUtils.format(params, "utf-8");
            Log.e(TAG, "check4");
            url += "?" + paramString;
            Log.e(TAG, "check5");
            HttpGet httpGet = new HttpGet(url);
            Log.e(TAG, "check6");

            HttpResponse httpResponse = httpClient.execute(httpGet); //getting exception here
            Log.e(TAG, "check7");
            HttpEntity httpEntity = httpResponse.getEntity();
            Log.e(TAG, "check8");
            is = httpEntity.getContent();
            Log.e(TAG, "check9");
        }

    }
    catch (UnsupportedEncodingException e) {

        Log.e(TAG, "e1"+e.toString());
        return null;
    }
    catch (ClientProtocolException e) {
        Log.e(TAG, "e2"+e.toString());
        return null;
    }
    catch (IOException e) {
        Log.e(TAG, "e3"+e.toString());//this exception occurs
        return null;
    }

    try {
        BufferedReader reader = new BufferedReader(new InputStreamReader(
                is, "iso-8859-1"), 8);
        StringBuilder sb = new StringBuilder();
        String line = null;
        while ((line = reader.readLine()) != null) {
            sb.append(line + "\n");
        }
        is.close();
        json = sb.toString();
    } catch (Exception e) {
        Log.e(TAG, "e4"+" Error converting result " + e.toString());
        return null;
    }

    // try parse the string to a JSON object
    try {
        jObj = new JSONObject(json);
    } catch (JSONException e) {
        Log.e(TAG, "e5"+" Error parsing data " + e.toString());
        return null;
    }

    // return JSON String
    return jObj;

  }
}

When I am calling the above code with an object jParser of above class, it gives exception.
private final String GET_ALL_MODEL_NAME = "http://10.0.0.2/android_connect/get_all_model_name.php";

List<NameValuePair> params = new ArrayList<NameValuePair>();

// getting JSON string from URL
JSONObject json = jParser.makeHttpRequest(GET_ALL_MODEL_NAME, "GET", params);

I am getting the exception. my logcat is
02-23 03:52:55.702: E/ACCESS(1603): check1
02-23 03:52:55.732: E/ACCESS(1603): check2
02-23 03:52:55.732: E/ACCESS(1603): check3
02-23 03:52:55.742: E/ACCESS(1603): check4
02-23 03:52:55.742: E/ACCESS(1603): check5
02-23 03:52:55.792: E/ACCESS(1603): check6
02-23 03:56:22.442: E/ACCESS(1603): e3org.apache.http.NoHttpResponseException: The target server failed to respond
Please help, as I googled but find nothing helpful

A: It's obvious it's not a router-firewall related problem as you are under the same net, so there are only a few possibilities:

*

*There's nothing listening on that port on that IP on the server-side

*There's a local firewall on the server-side that is blocking that connection attempt

*You are not using WIFI so you're not under the same net.

You should make sure you can open that service some ther way, that would help you debugging where the culprit is. If you've already done this, I'd suggest using some debugging tool to trace TCP packets (I don't know either what kind of operating system you use on the destination machine; if it's some linux distribution, tcpdump might help).
All that assuming you have the android.permission.INTERNET permission in your AndroidManifest.xml file.


text:
Q: Postgres update with replace I am doing  select which is:
SELECT replace(field_1, E'

publicidade

', '') FROM test

An that returns what I want, but when I try to update doing the same thing, It doesn't work as expected:
UPDATE test SET field_1 = replace(field_1, E'

publicidade

', '')

It doesn't update the column without the

publicidade

A: If the SELECT works as expected, so should your UPDATE. More: it should update all columns, which is most probably not what you want.
UPDATE test
SET    field_1 = replace(field_1, $$

publicidade

$$, '')
WHERE  field_1              LIKE $$%

publicidade

%$$

I added a WHERE clause to avoid expensive and pointless empty updates.
Related:

*

*Insert text with single quotes in PostgreSQL

*How do I (or can I) SELECT DISTINCT on multiple columns?


text:
Q: Control row spacing with kable / kableExtra booktabs (RMarkdown) By default, kable() with booktabs=T in R Markdown (kableExtra) leaves more space after every 5th row of a table. Is it possible to change / omit this spacing for a single table within a document? I like this feature for my larger tables in the document but when a table only has 7 or so rows, it looks funky.
Thanks!


text:
Q: Why are the points displayed incorrectly when searching for the corners of a rectangle? Using the Hough transform, I am looking for the boundaries of the any rectangle. Then I try to find the coordinates of the corners and draw points, but it turns out something is wrong. I found intersection using numpy.linalg.solve()
import cv2
import numpy as np
import matplotlib.pyplot as plt
from skimage.transform import hough_line, hough_line_peaks

image = cv2.imread('/rect_pics/5.png')
gray = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
gray = cv2.GaussianBlur(gray, (3, 3), 0)
cv2.imwrite("gray.png", gray)

edged = cv2.Canny(gray, 0, 10)
cv2.imwrite("edged.png", edged)

using_angles = np.linspace(-np.pi / 2, np.pi / 2, 1800)

halfspace, theta, dist = hough_line(edged, using_angles)

plt.figure(figsize=(15, 10))
plt.title('Hough Accumulator', size=30)
plt.imshow(halfspace, cmap='gray')
plt.savefig('accumulator.png')

angle_list = []

fig, axes = plt.subplots(1, 2, figsize=(20, 8))
ax = axes.ravel()

ax[0].imshow(edged, cmap='gray')
ax[0].set_title('Edged rectangle', size=30)
ax[0].set_axis_off()

ax[1].imshow(edged, cmap='gray')

origin = np.array((0, edged.shape[1]))
lines = []

def find_inter(k1, b1, k2, b2):
    A = np.array([[k1, -1], [k2, -1]])
    b = np.array(([-b1, -b2]))
    x = np.linalg.solve(A, b)
    return x[0], x[1]

for _, angle, dist in zip(*hough_line_peaks(halfspace, theta, dist)):
    y0, y1 = (dist - origin * np.cos(angle)) / np.sin(angle)
    ax[1].plot(origin, (y0, y1), '-r')
    lines += [(np.tan(angle), dist)]
    print(np.degrees(angle), dist)

inter = []

for i in range(len(lines)):
    for j in range(i+1, len(lines)):
        print(f"intersection of lines{lines[i]} and {lines[j]}:", end=' ')
        x, y = find_inter(lines[i][0], lines[i][1], lines[j][0], lines[j][1])
        if abs(x) > 1000 or abs(y) > 1000:
            print("NO INTERSECTION")
        else:
            print(x, y)
            inter += [(y, -x)]

ax[1].scatter([i[0] for i in inter], [i[1] for i in inter], color='b')
ax[1].set_xlim(origin)
ax[1].set_ylim((edged.shape[0], 0))
# ax[1].set_axis_off()
ax[1].set_title('Detected rectangle', size=30)
plt.savefig('detection.png')
plt.show()

example of a rectangle with wrong points
Please, help me to find a mistake. I'm confused about it


text:
Q: Reactive R/Shiny Example Fails after Parameterizing One Variable I have the following simple and working shiny-Rmarkdown document. It produces a slider and outputs a date below, which is adjusted based on the slider input.
---
runtime: shiny
output: html_document
---

```{r}
library(rmarkdown); library(ggvis); library(shiny);

sliderInput("sliderDays", "Days forward from 1/1/2014: ", min=0, max=45, value=1, step=1)

graphDate = reactive({as.Date("2014-01-01") + input$sliderDays})
renderPrint(graphDate())
```

However, if I replace graphDate = reactive({as.Date("2014-01-01") + input$sliderDays}) with
startDate <- as.Date("2014-04-01")
graphDate <- reactive({startDate + input$SliderDays})

then the output of renderPrint(graphDate()) goes from

1 "2014-04-01"  [this changes on slider input, but is always a date]

to

character(0)

I don't understand why the startDate would have to be created and used inside the graphDate reactive function, as opposed to defined right above it and referenced in the reactive function, for this to work.
sessionInfo()
## R version 3.2.0 (2015-04-16)
## Platform: i386-w64-mingw32/i386 (32-bit)
## Running under: Windows 7 x64 (build 7601) Service Pack 1
##
## locale:
## [1] LC_COLLATE=English_United States.1252
## [2] LC_CTYPE=English_United States.1252
## [3] LC_MONETARY=English_United States.1252
## [4] LC_NUMERIC=C
## [5] LC_TIME=English_United States.1252
##
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base
##
## other attached packages:
## [1] DT_0.0.52         shiny_0.12.0      knitr_1.10.5      ggvis_0.4.1.9000
## [5] rmarkdown_0.6.2.2
##
## loaded via a namespace (and not attached):
##  [1] Rcpp_0.11.6      digest_0.6.8     dplyr_0.4.1      assertthat_0.1
##  [5] mime_0.3         R6_2.0.1         xtable_1.7-4     jsonlite_0.9.16
##  [9] DBI_0.3.1        formatR_1.2      magrittr_1.5     evaluate_0.7
## [13] stringi_0.4-1    rstudioapi_0.3.1 tools_3.2.0      stringr_1.0.0
## [17] htmlwidgets_0.4  yaml_2.1.13      httpuv_1.3.2     parallel_3.2.0
## [21] htmltools_0.2.6

A: Seems to work for me. Did I understand the question right?

Version Info and Session Info:


text:
Q: onConfigurationChange does not get called I am trying to handle the case where i need to refresh my view after an inapp language change has occurred
However, the method onConfigurationChange does not get called at all.
i put in my manifest the following flags:
 android:configChanges="locale"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustResize|adjustPan"

public void onConfigurationChanged(android.content.res.Configuration newConfig) {
        LogUtils.d("configuration has changed:%s",newConfig); => this line never runs
        super.onConfigurationChanged(newConfig);
    };

what do i do to make the onConfigurationChanged method run ?

A: Android has an Intent registered to this task, ACTION_LOCALE_CHANGED. So I believe you will have to have a BroadcastReceiver registered to listen this Intent filter and then do the necessary steps when you listen it. I am not sure about the entire code but here is a link which might help. http://android.codota.com/scenarios/518914fada0a610ad0c274da/android.content.IntentFilter?tag=out_2013_05_05_07_19_34


text:
Q: The /bin/ prefix to kill command is getting rid of the error message I have Debian Stretch..
I thought that a regular user could kill root process as root. I was using the command /bin/kill 10733 as the user. There wasn't any error message.
Then, I typed out the similar command (without /bin/ prefix) and the error message got displayed.
Here, is the command history
deployer@deployer:~/blog$ kill 10733
-bash: kill: (10733) - Operation not permitted
deployer@deployer:~/blog$ /bin/kill 10733
deployer@deployer:~/blog$ ps aux|grep 10733
root     10733  0.0  0.6  92360  6404 ?        Ss   19:19   0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
deployer 10891  0.0  0.2  12732  2236 pts/0    S+   20:10   0:00 grep 10733
deployer@deployer:~/blog$ sudo kill 10733
deployer@deployer:~/blog$ ps aux|grep 10733
deployer 10900  0.0  0.2  12732  2232 pts/0    S+   20:10   0:00 grep 10733
deployer@deployer:~/blog$

In fact, I would prefer both the prefix and the message. How to get it? And why is it so?

A: In your example, the kill command is a shell internal (definitely in bash) and it allows for extensions such as %1 to be used to refer to background processes.
On the other hand, /bin/kill is an external command and doesn't have these extensions.  Since it's a different program it acts differently.  A failed /bin/kill may be silent, but sets $? (exit code) to indicate a failure.
When you run sudo kill you are implicitly running sudo /bin/kill.


text:
Q: Not able to add prod and test profiles in Spring boot When I create a new file and name is application-dev.properties, I am able to add configurations in there and then by using spring.profiles.active in default application.properties I am able to get dev profile configurations. But similarly if I create a test or a prod profile, it is not working.
enter image description here


text: Q: Ordinal numbers in dart/flutter internationalization Let's say I have a string like "Let's meet on the $n floor" and I want it internationalized. In English it should say "1st floor", "2nd floor", "3rd floor", "4th floor" and so on. In German it would be "1. Stock", "2. Stock", "3. Stock" and so on. How can I achieve this using the intl package as Intl.plural only supports zero, one, two, few and many?


text:
Q: Query on column other than primary key? I've a partial set up to bring in iTunes sales data I receive daily. I want to display on my product pages etc. My products all have a primary key but this is not present on the iTunes sales data table so I need to do my lookup using the UPC column as that the next best unique identifier. It's probably very simple but how would I go about doing that?
 <% render @product.itunes_datas %>

is referencing the following controller/method:
 @itunes_datas = ItunesData.find (:all)

Do I just define another method in the controller?
I need this to be flexible if possible as product level lookups will be by UPC, whereas track level lookups will be via ISRC code.
Thanks in advance.

A: I'm not sure how you get the UPC information from Apple, but as long as you have it, you can perform lookups on it using whichever of these methods you like the most:
ItunesData.where(:upc => 'UPC_Information_Here').all
ItunesData.find_all_by_upc('UPC_Information_Here')

They're exactly equivalent to each other and will find information based on the column you specify, rather than the primary key.


text:
Q: Custom error headings for form validation doesn't display properly My contact form uses ajax, however, when you try to validate the form without filling in any of the fields, only three out of the four error messages display. The 'last name', 'email address' and 'message' error headings display, but the 'first name' error heading does not.
When I take out the 'last name' error field and retest, the 'first name' field displays.
I have tried expanding the box to make it large, thinking there was simply no room for all four error headings to display, but I don't think that is the case. How can I correct this so that all four error messages (headings) display if a user does not fill out any of the fields?
Here is my code:
$(document).ready(function() {
    $('form #response').hide();

    $('.button').click(function(e) {

        e.preventDefault();

        var valid = '';
        var required = ' is required.';
        var first = $('form #first').val();
        var last = $('form #last').val();
        var email = $('form #email').val();
        var message = $('form #message').val();
        var tempt = $('form #tempt').val();
        var tempt2 = $('form #tempt2').val();

        if (first = '' || first.length <= 1) {
            valid = '
Your first name' + required + '
';
        }

        if (last = '' || last.length <= 1) {
            valid = '
Your last name' + required + '
';
        }

        if (!email.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)) {
            valid += '
Your email address' + required + '
';
        }

        if (message = '' || message.length <= 4) {
            valid += '
A message' + required + '
';
        }

        if (tempt != 'http://') {
            valid += '
We can\'t allow spam bots.
';
        }

        if (tempt2 != '') {
            valid += '
A human user' + required + '
';
        }

        if (valid != '') {
            $('form #response').removeClass().addClass('error')
                .html('' +valid).fadeIn('fast');
        }

        else {
            $('form #response').removeClass().addClass('processing').html('Sending...').fadeIn('fast');

            var formData = $('form').serialize();
            submitForm(formData);
        }

    });

});

function submitForm(formData) {

    $.ajax({

            type: 'POST',
            url: 'mail/mailform.php',
            data: formData,
            dataType: 'json',
            cache: false,
            timeout: 4000,
            success: function(data) {

                            $('form #response').removeClass().addClass((data.error === true) ? 'error' : 'success')
                                            .html(data.msg).fadeIn('fast');

                            if ($('form #response').hasClass('success')) {
                                setTimeout("$('form #response').fadeOut('fast')", 4000);
                        }
                    },
                    error: function(XMLHttpRequest, textStatus, errorThrown) {

                        $('form #response').removeClass().addClass('error')
                                    .html('
There was an ' + errorThrown +
                                        ' error due to an ' + textStatus +
                                        ' condition.
').fadeIn('fast');
                    },
                    complete: function(XMLHttpRequest, status) {

                        $('form')[0].reset();
                    }

          });

};

HTML ----------->>
<form class="contact-me" action="mail/mailform.php" method="post" name="contact-me">

<input name="First" class="required" title="Your First Name is Required" id="first" autofocus placeholder="First Name" type="text" maxlength="15"></input>

<input name="Last"  title="Your Last Name is Required" id="last" placeholder="Last Name" type="text" maxlength="15"></input>

<input name="E-Mail"  title="E-Mail Address is Required" id="email" placeholder="Email Address" type="email" maxlength="50"></input>

<textarea name="Message"  title="Comments are Required" placeholder="Comments" rows="1" cols="50" id="message" onKeyDown="textCounter(this.form.comments,this.form.countDisplay);"onKeyUp="textCounter(this.form.message,this.form.countDisplay);"></textarea>

<input type="hidden" name="tempt" id="tempt" value="http://" />
<input type="hidden" name="tempt2" id="tempt2" class="clear" value="" />
<input name="countDisplay" type="text" id="countdisplay" value="2000" size="4" maxlength="4" readonly></input>

<button class="button" ontouchstart="('touchstart');">SEND</button>
</form>

A: You should always type valid += "validation message" instead of valid = "validation message" for each validation. You forgot the += for the first name and last name validations.


text:
Q: Electron-redux share state between browser windows I am a relatively new programmer building an application using React, Electron, and now Redux. The app opens two windows when it loads, and these two windows have to share a bit of state. I previously was able to achieve this without Redux using localStorage - when one process would save state it would trigger the other one to update. The problem is, now that my app is growing larger, this process is getting tedious and difficult to abstract. There is also a ton of prop drilling, which is beginning to feel "wrong." I get the feeling that there must be a better way, especially with what Redux can offer.
I originally created my app using create-react-app using this article as a guide.
It seems like using electron-redux would be a great choice, except for the life of me, I can't understand how to make it work for my use case. I tried to mimic the creator's "timesheets" test app, but he is somehow able to use import ES6 module syntax in his main electron process, where doing so in mine breaks the app (it's not recognized by node as a module). Venturing down that troubleshooting path led to more breaks and frustration.
There have been other stack overflow posts, such as this and this, where others have had this exact problem and somehow figured it out. However, they neglected to answer exactly how they figured it out - just that they used electron-redux and made some adjustments - which they didn't bother to write up.
What I have now are two stores, as per the electron-redux guidelines:
mainStore.js
import rootReducer from './redux/reducers';
import { configureStore } from '@reduxjs/toolkit';
import {
    forwardToRenderer,
    triggerAlias,
    replayActionMain,
} from 'electron-redux';

const middlewares = [triggerAlias, forwardToRenderer];
const store = configureStore({
    reducer: rootReducer,
    middleware: [...middlewares],
    devTools: true,
});

replayActionMain(store);

export default store;

rendererStore.js
import rootReducer from './redux/reducers';
import { configureStore } from '@reduxjs/toolkit';
import {
    forwardToMain,
    getInitialStateRenderer,
    replayActionRenderer,
} from 'electron-redux';

export default function configureRendererStore(
    initialState = getInitialStateRenderer()
) {
    const middlewares = [forwardToMain];
    const store = configureStore({
        reducer: rootReducer,
        middleware: [...middlewares],
        devTools: true,
    });

    replayActionRenderer(store);
    return store;
}

I am importing those stores into the root components of the two windows of my app. As I said earlier, if I try to import a store into my electron main process, it errors out because it's not a module. The error I'm currently getting is TypeError: Cannot read property 'on' of undefined at the process called with replayActionMain(store);
Any help would be greatly appreciated!


text:
Q: systemd: restart service if any of the forked processes are killed Is there any way of auto-restart a systemd service if any of its forked processes are killed?
After creating a systemd unit file for Control-M
[Unit]

After       = network-online.target
After       = remote-fs.target
Description = Control-M agent
Wants       = network-online.target

[Service]

ExecStart   = /opt/ctmagent/ctm/scripts/start-ag -u ctmagent -p ALL
ExecStop    = /opt/ctmagent/ctm/scripts/shut-ag -u ctmagent -p ALL
Restart     = always
RestartSec  = 5
TimeoutSec  = 5min
Type        = forking

[Install]

WantedBy = multi-user.target

I noticed that it forks 3 different processes
# systemctl status ctmag.service

CGroup: /system.slice/ctmag.service
   ├─129041 /opt/ctmagent/ctm/exe/p_ctmag
   ├─129089 /opt/ctmagent/ctm/exe/p_ctmat
   └─129091 /opt/ctmagent/ctm/exe/p_ctmatw -ATW_NAME ATW000

If i kill p_ctmag, systemd restarts everything, however, if i kill p_ctmat it desn't
Or, since p_ctmat opens 127.0.0.1:7035 , can systemd monitor this port and restart the service if closed?

PS1: I do not have control over start-ag and shut-ag, so Systemd restart service if one of the processes in the control group fails won't help here.
PS2: Also, I can't add another script 'layer', wrapping the script in another one. Need pure systemd unit file solution.

A: The trouble you're running into is that BMC has not yet built a native systemd service file for Control-M/Agent. The installation guide for version 9.0.18.200) (login required), for systemd-systems directs you to use a service file with this template:
[Unit]
Description=Control-M Agent

[Service]
Type=forking
RemainAfterExit=yes
ExecStart=[agent_home_dir]/ctm/scripts/rc.agent_user start
ExecStop=[agent_home_dir]/ctm/scripts/rc.agent_user stop

[Install]
WantedBy=multi-user.target

... where the Exec lines are just wrappers around start-ag and shut-ag, which is what you're using. The trouble boils down to systemd being told that this is a forking Type of service, when in fact the "service" (start script) starts multiple processes. systemd considers the (forking) service to be successful when it sees the first child process after the initial script. That process ends up being p_ctmag, as you've seen. The systemctl status output makes it clear:

Process: 6519 ExecStart=/opt/ctmagent/ctm/scripts/start-ag -u ctmagent -p ALL (code=exited, status=0/SUCCESS)

... where pid 6519 was the start-ag script, which has since exited. This is followed by the remaining control-group processes you see.
I'd additionally point out here that the systemd docs say:

If this setting is used, it is recommended to also use the PIDFile= option, so that systemd can reliably identify the main process of the service.

... which the suggested BMC service file does not include, despite there being PID files for all three processes under $CONTROLM/pid/; though they're not real PID files, since the files are named for the pid instead of the pid being their contents.
This is why systemd is not restarting the p_ctmat process.
Short of rewriting a thousand-plus line vendor script to split the processes into individually-controlled ones (complete with the two handfuls of environment variables those scripts set) or waiting for BMC to provide a useful systemd script, my suggestion would be to change your agent configuration to set the WATCHDOG_ENABLED parameter to Y. In my testing, this enables the p_ctmag process to watch the p_ctmat process, which will restart it if necessary. The p_ctmatw process is a child of the p_ctmat process, which will restart p_ctmatw as needed.
From there, you're covered:

*

*p_ctmag will be restarted by systemd, as now

*p_ctmat will be restarted by p_ctmag (with WATCHDOG_ENABLED Y)

*p_ctmatw will be restarted by p_ctmat, as now


text:
Q: synthetic division question. Synthetic division is possible when the Divisior is in the form of $x+a$ or $x-a$. but what if the divisor is in the form of $x^2+a$, $x^2-a$, $x^3-a$,... and higher powers. how can we perform synthetic division in such cases.
Thanks

A: For the particular case of divisors in the form $x^n-a$ it is possible to replace the long division with $n$ synthetic divisions.
For a polynomial $P(x)$ being divided by $x^3-a$ for example, group the powers of $x$ in $P$ according to the remainder $\bmod 3$ and write it as:
$$
P(x) = P_0(x^3) + x P_1(x^3) + x^2P_2(x^3)
$$
Use synthetic division to calculate the quotients and remainders of the following:
$$
P_k(x) = (x-a)Q_k(x) + r_k \quad\quad \text{for} \;\; k=0,1,2
$$
Then:
$$
P(x)=(x^3-a)Q(x) + R(x)
$$
where $Q(x) = Q_0(x^3) + xQ_1(x^3)+x^2Q_2(x^3)$ and $R(x)=r_0+r_1x+r_2x^2\,$.

[ EDIT ] Following is a fully worked out example for $P(X)=x^4-6x^3+16x^2-25x+10$ (the polynomial was borrowed from another, unrelated question) being divided by $x^3-2$.

*

*Group the powers:

$$P(X)=x^4-6x^3+16x^2-25x+10= (-6x^3+10) + x\cdot (x^3-25) + x^2 \cdot 16$$
$$
\iff
\begin{cases}
\begin{align}
 P_0(x) & = -6x+10 \\
 P_1(x) & = x - 25 \\
 P_2(x) &= 16
\end{align}
\end{cases}
$$

*

*Divide $P_k$ by $x-2$ and determine $Q_k,r_k$ by synthetic division:

$$
\begin{cases}
\begin{alignat}{3}
 P_0(x) & = -6x+10 && = -6(x-2) - 2\\
 P_1(x) & = x - 25 && = (x-2) - 23\\
 P_2(x) & = 16 && = 16
\end{alignat}
\end{cases}
$$
$$
\iff
\begin{cases}
\begin{align}
 Q_0(x) & = -6 \,,\;\; r_0 = -2\\
 Q_1(x) & = 1  \,,\;\; r_1 = - 23\\
 Q_2(x) & = 0  \,,\;\; r_2 = 16
\end{align}
\end{cases}
$$

*

*Calculate $Q,R$:

$$
Q(x) = Q_0(x^3) + xQ_1(x^3)+x^2Q_2(x^3) = -6 +x+ x^2 \cdot 0 = x-6\\
R(x)=r_0+r_1x+r_2x^2=16x^2-23 x-2\,$$

*

*Verify that indeed:

$$x^4-6x^3+16x^2-25x+10=(x^3-2)(x-6)+ 16x^2-23 x -2$$


text:
Q: Efficiently and selectively combining columns in R I have the following data
countrycols = alljson[,c("country_gc_str","country_ipapi_str","country_tm_str")]

head(countrycols)
country_gc_str country_ipapi_str country_tm_str
1           <NA>                RU             RU
2           <NA>                CN             CN
3             US                US             US
4           <NA>                CD             CG
5           <NA>                DE             DE
6           <NA>              <NA>             NG

I want to create a new column country_final_str which gets filled with country data in order of following preference:
country_gc_str
country_ipapi_str
country_tm_str

I am also characterizing the country income level using the following:
wbURL <- "http://api.worldbank.org/countries?per_page=304"
xmlAPI <- xmlParse(wbURL)
xmlDF <- xmlToDataFrame(xmlAPI)
xmlDF$iso2CodeChar <- as.character(xmlDF$iso2Code)
xmlDF$incomeLevelChar <- as.character(xmlDF$incomeLevel)
incomexml <- xmlDF[,c("iso2CodeChar","incomeLevelChar")]
incomexmltable <- as.data.table(incomexml)

I have the following for-loop, but it is taking forever as I have over a million records:
  alljson$country_final_str <- alljson$country_gc_str
  alljson$income_level <- NA

  for (i in 1:length (alljson$country_final_str))
  {
    if (is.na(alljson$country_final_str [i]))
    {
      alljson$country_final_str [i] = alljson$country_ipapi_str [i];
    }
    if (is.na(alljson$country_final_str [i]))
    {
      alljson$country_final_str [i] = alljson$country_tm_str [i];
    }

    a<-incomexmltable[iso2CodeChar==alljson$country_final_str [i]]$incomeLevelChar

    if(length(a)==0)
    {
      alljson$income_level [i] <- NA
    } else {
      alljson$income_level [i] <- a
    }
  }

Any thoughts for improving the efficiency/getting rid of the for loop? I cannot think of a way to apply/lapply/tapply, and I am on Windows so my efforts to parallelize my code using doParallel and doSNOW have failed.
See below by @thelatemail for correct answer to the column question. For the country income level, I performed:
allcountries <- unique(alljson$country_final_str)

alljson$country_income_str <- NA
sum(!is.na(countrycode(allcountries, "iso2c", "country.name")))
for (i in 1:length(allcountries))
{
  a<-incomexmltable[iso2CodeChar==allcountries[i]]$incomeLevelChar
  if(length(a)==0)
  {
    alljson$country_income_str[which(alljson$country_final_str==allcountries[i])] <- NA
  } else {
    alljson$country_income_str[which(alljson$country_final_str==allcountries[i])] <- a
  }

  alljson$country_income_str
}

A: Here's an attempt using matrix indexing after picking the first non-missing value in the three variables:
countrycols[
  cbind(
    seq_len(nrow(countrycols)),
    max.col(replace( -col(countrycols), is.na(countrycols), -Inf))
  )
]
#[1] "RU" "CN" "US" "CD" "DE" "NG"

To explain the logic, break down each line:
-col(countrycols)
#     [,1] [,2] [,3]
#[1,]   -1   -2   -3
#[2,]   -1   -2   -3
#[3,]   -1   -2   -3
#[4,]   -1   -2   -3
#[5,]   -1   -2   -3
#[6,]   -1   -2   -3

replace( -col(countrycols), is.na(countrycols), -Inf)
#     [,1] [,2] [,3]
#[1,] -Inf   -2   -3
#[2,] -Inf   -2   -3
#[3,]   -1   -2   -3
#[4,] -Inf   -2   -3
#[5,] -Inf   -2   -3
#[6,] -Inf -Inf   -3

(colindex <- max.col(replace( -col(countrycols), is.na(countrycols), -Inf)) )
#[1] 2 2 1 2 2 3

cbind(rowindex=seq_len(nrow(countrycols)), colindex)
#     rowindex colindex
#[1,]        1        2
#[2,]        2        2
#[3,]        3        1
#[4,]        4        2
#[5,]        5        2
#[6,]        6        3

This final matrix is used to subset each row/col combination out of the original list.
Where countrycols was:
structure(list(country_gc_str = c(NA, NA, "US", NA, NA, NA),
    country_ipapi_str = c("RU", "CN", "US", "CD", "DE", NA),
    country_tm_str = c("RU", "CN", "US", "CG", "DE", "NG")), .Names = c("country_gc_str",
"country_ipapi_str", "country_tm_str"), row.names = c("1", "2",
"3", "4", "5", "6"), class = "data.frame")


text:
Q: Grafana not working for Message Hub on Bluemix I'm trying to monitor messages on Bluemix Messsage Hub using Grafana but both graphs 'Bytes In' and 'Bytes out' do not show anything and says 'no datapoint'.
The only graph that I'm able to view is 'randomWalk'....
Is there a way to see the number of messages, the offset, or something showing the activity of kafka in and out?
F.G.

A: This issue has been fixed. Let us know if you still have difficulties seeing your Message Hub metrics in Grafana.

A: There's currently a problem between the Message Hub metrics data collection and the Grafana system.
We're working to get it fixed as soon as possible.


text:
Q: How to setup Munin permissions? I've just installed munin on my CentOS server but I can't get it to output anything to the html directory I set in /etc/munin/munin.conf
    htmldir /home/mydir/munin
In /var/log/munin/munin-graph.log I get errors like:
    2011/09/23 12:35:30 [RRD ERROR] Unable to graph /home/mydir/munin/localhost/localhost/memory-year.png : Opening '/home/mydir/munin/localhost/localhost/memory-year.png' for write: Permission denied
permissions on /home/mydir/munin are:
    drwxrwxr-x 2 munin        munin  4096 Sep 23 12:31 munin

A: Also you need to check is SELinux running. Maybe SELinux ic blocking this writes.


text:
Q: Series Convergence What does this series converge to?
$$ \sqrt{3\sqrt {5\sqrt {3\sqrt {5\sqrt \cdots}}}} $$
and also this?
$$ \sqrt{6+\sqrt {6+\sqrt {6+\sqrt {6+\sqrt \cdots}}}} $$
And, generally speaking, how should one approach these kind of questions?

A: Here's for
$$
\sqrt{6+\sqrt{6+\sqrt{6+\sqrt{\cdots}}}}.
$$
First define a sequence recursively by $a_1 := \sqrt{6}$ and $a_n := \sqrt{6+a_{n-1}}$ ($n \geq 2)$. Then we wish to compute $\lim_{n \to \infty} a_n$. In order to find this limit, we need, of course, to know that it exists. But instead of trying to show right away that it does, we will assume that it does and try to obtain candidates for its value. This will help us to show convergence (as it is often the case... in fact, most of the time, when we want to show that a sequence converges to some limit $L$, we need to first guess the value of $L$, which is not always simple... Cauchy sequences are useful justly because we don't have to guess a limit in order to prove convergence).
So, assuming the limit exists, put $\lim_{n \to \infty} a_n := L$. Then by definition of $a_n$ we have
$$
\lim_{n \to \infty} a_{n+1} = \lim_{n \to \infty} \sqrt{6+a_n},
$$
which gives
$$
L = \sqrt{6+L}.
$$
In this case W.W. showed that $L \in \{-2, 3\}$ and correctly observed that $L = -2$ is impossible, since $a_n \geq 0$ $\forall n$. Thus, the only candidate for $L$ is $3$.
Now it is easily seen that $a_{n+1} \geq a_n$, so the sequence is increasing. In order to show convergence we know it suffices to exhibit an upper bound for $a_n$. But we might as well try to show that $a_n \leq 3$, in view of our candidate for $L$. This we can do by induction :

*

*Base step : Clearly $a_1 = \sqrt{6} \leq \sqrt{9} = 3$ is true.

*Induction step : Assume $a_{n-1} \leq 3$ for some $n \geq 2$. Then $a_n = \sqrt{6+a_{n-1}} \leq \sqrt{6+3} = 3$.

By the principle of mathematical induction, we have shown that $a_n \leq 3$ $\forall n$, which is what we were seeking.
We may conclude that $a_n$ converges and that its limit is 3.

A: Well, define
$$x=\sqrt{3\sqrt{5\sqrt3\ldots}}=\sqrt{3\sqrt{5x}}\stackrel{\text{square}}\implies x^2=3\sqrt{5x}\stackrel{\text{square again}}\implies x^4=45x\implies$$
$$x^3=45\iff x=\sqrt[3]{45}$$
But...the above follows at once from arithmetic of limits, on the sequence
$$\left\{\sqrt3\,,\,\sqrt{3\sqrt5}\,,\,\sqrt{3\sqrt{5\sqrt3}}\,\ldots\right\}$$
and we must first prove the above sequence converges finitely, so
Hints:
== Prove your sequence is monotone ascending
== Prove your sequence is bounded above

A: For $$\sqrt{6 + \sqrt{6 + \sqrt{6 +\dots}}}:$$
Let \begin{align*}
x &= \text{the given equation}\\
&= \sqrt{6 + \sqrt{6 + \sqrt{6 + \dots}}}
\end{align*}
Since the series is infinite, we can write
$x = \sqrt{6 + x}$,
or  $$x^2 - x - 6 = 0.$$
Therefore, $x = 3$ or $x = -2$
Since the answer cannot be negative, reject $x = -2$. Therefore, $x = 3$.
Do the same thing for the first series.


text:
Q: I got this Error from chokidar when running code with firebase I'm running my firebase project and got this error in the terminal
This dependency was not found:

*

*firebase in ./src/firebaseInit.js

To install it, you can run: npm install --save firebase
Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp
inside my firebaseInit.js
import firebase from 'firebase';

const firebaseConfig = {
    apiKey: "xxxxxxxxxxxxxx",
    authDomain: "xxxxxxxxxxxxxxxxxxx",
    projectId: "xxxxxxxxxxxxxxxxxxxxxxxx",
    storageBucket: "xxxxxxxxxxxxxxxxxx",
    messagingSenderId: "xxxxxxxxxxxxxxxxxxxxxx",
    appId: "xxxxxxxxxxxxxxxxxxxxxxxxxx",
    measurementId: "xxxxxxxxxxxxxxxxxx"
};

export default firebase.initializeApp(firebaseConfig);

and here's my package.json
{
"name": "mevnproject",
"version": "0.1.0",
"private": true,
"scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
},
"dependencies": {
    "axios": "^0.25.0",
    "core-js": "^3.6.5",
    "firebase": "9.6.11",
    "socket.io": "^4.4.1",
    "vue": "^2.6.11",
    "vue-chat-scroll": "^1.4.0",
    "vue-google-charts": "^0.3.3",
    "vue-router": "^3.5.3",
    "vue2-google-maps": "^0.10.7",
    "vuetify": "^2.6.2",
    "vuex": "^3.6.2",
    "vuex-persistedstate": "^4.1.0"
},
"devDependencies": {
    "@mdi/font": "^6.5.95",
    "@mdi/js": "^6.5.95",
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.2.2",
    "material-design-icons-iconfont": "^6.1.1",
    "vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
    "root": true,
    "env": {
        "node": true
    },
    "extends": [
        "plugin:vue/essential",
        "eslint:recommended"
    ],
    "parserOptions": {
        "parser": "babel-eslint"
    },
    "rules": {}
},
"browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
]

}
I tried to uninstall and reinstall the firebase but still got the same error.
edit: in my components i've the script looks like this
<script>
import { db } from "../../firebaseInit";

export default {
  data() {
    return {
      message: null,
    };
  },
  methods: {
    saveMessage() {
      db.firestore()
        .collection("chat")
        .add({
          message: this.message,
        })
        .then(() => {
          console.log("Document Written");
        })
        .catch((error) => {
          console.error(error);
        });
    },
  },
};
</script>

A: From your package.json file we can see that you use the Firebase SDK version 9. You therefore need to adapt your firebaseInit.js file. I recommend exporting only the services you need, i.e. Firestore in your case (see your comment below).
import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore";

const firebaseConfig = {
    apiKey: "xxxxxxxxxxxxxx",
    authDomain: "xxxxxxxxxxxxxxxxxxx",
    projectId: "xxxxxxxxxxxxxxxxxxxxxxxx",
    storageBucket: "xxxxxxxxxxxxxxxxxx",
    messagingSenderId: "xxxxxxxxxxxxxxxxxxxxxx",
    appId: "xxxxxxxxxxxxxxxxxxxxxxxxxx",
    measurementId: "xxxxxxxxxxxxxxxxxx"
};

const firebaseApp = initializeApp(firebaseConfig);
const db = getFirestore(firebaseApp);

export { db };

Then, in your component you do like:
import { db } from '../firebaseInit';
import {  collection, addDoc } from 'firebase/firestore';  // Example

export default {
  data() {
    return {
      message: null,
    };
  },
  methods: {
    saveMessage() {
      addDoc(collection(db, 'chat'),
      {
        message: this.message,
      })
        .then(() => {
          console.log("Document Written");
        })
        .catch((error) => {
          console.error(error);
        });
    },
  },
};

If you need to use several services, do as follows (for example):
import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore";
import { getAuth } from "firebase/auth";
import { getStorage } from "firebase/storage";

const firebaseConfig = {
    apiKey: "xxxxxxxxxxxxxx",
    authDomain: "xxxxxxxxxxxxxxxxxxx",
    projectId: "xxxxxxxxxxxxxxxxxxxxxxxx",
    storageBucket: "xxxxxxxxxxxxxxxxxx",
    messagingSenderId: "xxxxxxxxxxxxxxxxxxxxxx",
    appId: "xxxxxxxxxxxxxxxxxxxxxxxxxx",
    measurementId: "xxxxxxxxxxxxxxxxxx"
};

const firebaseApp = initializeApp(firebaseConfig);
const db = getFirestore(firebaseApp);
const auth = getAuth(firebaseApp);
const storage = getStorage(firebaseApp);

export { db, storage, auth };

and in the component
import { db, auth } from '../firebaseInit';
import { doc, getDoc } from 'firebase/firestore';  // Example
import { signInWithEmailAndPassword } from '@firebase/auth';  // Example

More details in the doc.


text:
Q: Connect to a server using SSH and a pem / key with golang I'm trying to connect to an amazon AWS linux server with a key using the [ssh][1] package of Go programming language. However the package documentation is a bit cryptic/confusing. Does anyone know how to connect through ssh using a key  or at least if it's possible ? What bothers me is that in the [Dial][3] example it says
// An SSH client is represented with a ClientConn. Currently only
// the "password" authentication method is supported.

I basically want to mimic the ssh -i x.pem root@server.com behavior and execute a command inside the server ( e.g. whoami )

A: You need to use ssh.PublicKeys to turn a list of ssh.Signers into an ssh.AuthMethod. You can use ssh.ParsePrivateKey to get a Signer from the pem bytes, or if you need to use an rsa, dsa or ecdsa private key, you can give those to ssh.NewSignerFromKey.
Here's an example fleshed out a bit with Agent support too (since using an agent is usually the next step after simply using a key file).
sock, err := net.Dial("unix", os.Getenv("SSH_AUTH_SOCK"))
if err != nil {
    log.Fatal(err)
}

agent := agent.NewClient(sock)

signers, err := agent.Signers()
if err != nil {
    log.Fatal(err)
}

// or get the signer from your private key file directly
// signer, err := ssh.ParsePrivateKey(pemBytes)
// if err != nil {
//     log.Fatal(err)
// }

auths := []ssh.AuthMethod{ssh.PublicKeys(signers...)}

cfg := &ssh.ClientConfig{
    User: "username",
    Auth: auths,
}
cfg.SetDefaults()

client, err := ssh.Dial("tcp", "aws-hostname:22", cfg)
if err != nil {
    log.Fatal(err)
}

session, err = client.NewSession()
if err != nil {
    log.Fatal(err)
}

log.Println("we have a session!")

...

A: Here is an example to run ls remotely using your "plain private key file".
    pemBytes, err := ioutil.ReadFile("/location/to/YOUR.pem")
    if err != nil {
        log.Fatal(err)
    }
    signer, err := ssh.ParsePrivateKey(pemBytes)
    if err != nil {
        log.Fatalf("parse key failed:%v", err)
    }
    config := &ssh.ClientConfig{
        User: "ubuntu",
        Auth: []ssh.AuthMethod{ssh.PublicKeys(signer)},
        HostKeyCallback: ssh.InsecureIgnoreHostKey(),
    }
    conn, err := ssh.Dial("tcp", "yourhost.com:22", config)
    if err != nil {
        log.Fatalf("dial failed:%v", err)
    }
    defer conn.Close()
    session, err := conn.NewSession()
    if err != nil {
        log.Fatalf("session failed:%v", err)
    }
    defer session.Close()
    var stdoutBuf bytes.Buffer
    session.Stdout = &stdoutBuf
    err = session.Run("ls -l")
    if err != nil {
        log.Fatalf("Run failed:%v", err)
    }
    log.Printf(">%s", stdoutBuf)


text:
Q: laravel is unable to get primericons from localhost I wanted to integrate primereact / primeicons in my Laravel project. But having a bit of a strange error.
The error shows in the console when I run the project:
http://localhost/fonts/vendor/primeicons/primeicons.woff?e61f3495a7ecd3d571a4c9a98797e955 net::ERR_ABORTED 404 (Not Found)

Here is the app.scss file
@import url('https://fonts.googleapis.com/css?family=Nunito');

// Variables
@import 'variables';

// Bootstrap
@import '~bootstrap/scss/bootstrap';

//primereact
@import 'primereact/resources/themes/saga-blue/theme.css';
@import 'primereact/resources/primereact.min.css';
@import 'primeicons/primeicons.css';

these primereact library also included in resources/js/src/Entryfile/Main.js
but still not working
here is the package.json file
{
"private": true,
"scripts": {
    "dev": "npm run development",
    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "npm run development -- --watch",
    "watch-poll": "npm run watch -- --watch-poll",
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
    "prod": "npm run production",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"keywords": [
    "reactjs",
    "filter",
    "sort",
    "DataTables",
    "jQuery",
    "table",
    "DataTables"
],
"files": [
    "js/*/.js"
],
"dependencies": {
    "@fortawesome/fontawesome-svg-core": "^1.2.30",
    "@fortawesome/free-brands-svg-icons": "^5.14.0",
    "@fortawesome/free-regular-svg-icons": "^5.14.0",
    "@fortawesome/free-solid-svg-icons": "^5.14.0",
    "@fortawesome/react-fontawesome": "^0.1.11",
    "@fullcalendar/daygrid": "^5.2.0",
    "@fullcalendar/interaction": "^5.2.0",
    "@fullcalendar/react": "^5.2.0",
    "@fullcalendar/timegrid": "^5.2.0",
    "antd": "^4.5.2",
    "bootstrap": "^4.5.0",
    "font-awesome": "^4.7.0",
    "fullcalendar": "^5.2.0",
    "jquery": "^3.5.1",
    "jquery-slimscroll": "^1.3.8",
    "jquery-sticky-kit": "^1.1.3",
    "line-awesome": "^1.3.0",
    "maskedinput": "^3.3.11",
    "moment": "^2.27.0",
    "popper.js": "^1.16.1",
    "primeicons": "^4.1.0",
    "primereact": "^6.0.1",
    "prop-types": "^15.7.2",
    "quill": "^1.3.7",
    "rc-footer": "^0.6.6",
    "react": "^16.13.1",
    "react-bootstrap": "^1.3.0",
    "react-countdown-circle-timer": "^3.0.9",
    "react-csv": "^2.0.3",
    "react-datepicker": "^3.4.1",
    "react-dom": "^16.13.1",
    "react-helmet": "^6.1.0",
    "react-hook-form": "^7.9.0",
    "react-input-mask": "^2.0.4",
    "react-loading-ui": "^1.2.3",
    "react-owl-carousel": "^2.3.1",
    "react-popper": "^2.2.3",
    "react-redux": "^7.2.1",
    "react-router-dom": "^5.2.0",
    "react-scripts": "3.4.1",
    "react-scrollspy-nav": "^1.2.4",
    "react-slick": "^0.27.7",
    "react-sticky": "^6.0.3",
    "react-sticky-box": "^0.9.3",
    "react-summernote": "^2.0.2",
    "react-toastify": "^7.0.3",
    "reactstrap": "^8.5.1",
    "recharts": "^1.8.5",
    "secure-ls": "^1.2.6",
    "slick-carousel": "^1.8.1",
    "sticky-kit": "^1.1.3",
    "sticky-sidebar": "^3.3.1",
    "theia-sticky-sidebar": "^1.7.0",
    "validator": "^13.7.0"
},
"devDependencies": {
    "@babel/core": "^7.10.5",
    "@babel/plugin-proposal-class-properties": "^7.10.4",
    "@babel/preset-env": "^7.10.4",
    "@babel/preset-react": "^7.10.4",
    "axios": "^0.19",
    "babel-loader": "^8.1.0",
    "bootstrap": "^4.0.0",
    "browser-sync-webpack-plugin": "^2.0.1",
    "clean-webpack-plugin": "^3.0.0",
    "cross-env": "^7.0",
    "css-loader": "^4.1.0",
    "csv-loader": "^3.0.3",
    "file-loader": "^6.0.0",
    "html-webpack-plugin": "^4.3.0",
    "jquery": "^3.2",
    "laravel-mix": "^5.0.1",
    "lodash": "^4.17.19",
    "mini-css-extract-plugin": "^0.9.0",
    "node-sass": "^6.0.0",
    "papaparse": "^5.2.0",
    "popper.js": "^1.12",
    "resolve-url-loader": "^3.1.0",
    "sass": "^1.49.7",
    "sass-loader": "^12.4.0",
    "style-loader": "^1.2.1",
    "uglifyjs-webpack-plugin": "^2.2.0",
    "url-loader": "^4.1.0",
    "webpack": "^4.44.0",
    "webpack-cli": "^3.3.12",
    "webpack-dev-server": "^3.11.0",
    "xml-loader": "^1.2.1"
},
"browser": {
    "fs": false,
    "child_process": false
}

}


text:
Q: Bypass Validation Rule because of After Insert Trigger I have two objects A__C and B__c where B__C is the child of A__C. we have a before inert,before trigger on A__c and all after triggers on B__c. Basically the after trigger is used to calculate or roll up the count of A__c which is also a lookup apart from parent.
Now there is a validation rule which restricts certain users to edit A__c except certain profiles and owner and alternate owner(Let's say u1__c) which is a lookup to user. However, when alternate owner tries to create child record B__c the after insert exception custom field validation error throws up.
I fixed it by setting a boolean flag(Skip__c) on A__C and made it true on before trigger present on A__c and add it in validation rule at the end like &&NOT(SKIP__c) which works now fine. However, i want the validation rule to work again and restrict other users to edit A__c in case where i tried to create a workflow rule to set the flag as false if it is true. However, it seems the validation rule does not work and even if the user does not satisfy any criteria in rule still he can edit the record A__c.
Could you please help?


text:
Q: Is source code from docker downloadable to local system? I have a source code which i want to make publicly available but the source code shouldn't be downloadable in their local systems.
1. Is this possible using VM or docker. Which one is better ?
2. Can changes to the code by any client be added to the version control system or git from docker.

A: Yes the source code will be available, and no it is not possible to directly prevent that. Anyone who has access to the VM or the docker image will be able to extract your source code from either of them. For the VM you can typically mount the disks directly and just view them, and for booth a VM and Docker you can't stop someone from directly logging into the running vm or container and initiating a transfer themselves.
If you're concerned about source code you'll want to use a compiler or obfuscation tool, and which one makes the most sense will depend on the language you're using.


text:
Q: Matrix determinant query Let $\{v_1,v_2, ..., v_n \}$ be an orthonormal basis for $\mathbb{R}^n$ where the determinant of the matrix with columns, $v_1, ..., v_n$ is $+1$. Let $x_1 = v_1$ and $x_i = $ (linear combination of $v_1,..., v_{i-1}$) $ + a_iv_i.$ Is it true (and why!) that $\det(x_1,x_2, ...,x_n) =\det(v_1,a_2v_2, ..., a_nv_n) = 1 \times a_2 \times \cdot \cdot \cdot \times a_n.$ Is it something to do with an upper triangular matrix?
Edit:
Let $X = (v_1, ..., v_n) $ be a matrix be a matrix with columns, $v_1,...,v_n$ and similarly define the matrix $Y = (v_1,a_2v_2 ..., a_nv_n).$ Then $X^TY$ is a matrix with main diagonal elements $1,a_2,..,a_n$ and non-main diagonal elements equal to zero. Thus the det($X^TY$) = $1 \times a_2 \times \cdot \cdot \cdot \times a_n$. Since $\det(X^T) = 1$, this implies that $\det(Y)= 1 \times a_2 \times \cdot \cdot \cdot \times a_n.$ Is this correct? Still don't know how to prove/disprove the part $\det(x_1,x_2, ...,x_n) =\det(v_1,a_2v_2, ..., a_nv_n).$

A: Only two basic properties of determinants need be known.
First, if one multiplies any column of a matrix by a scalar, the determinant of the resulting matrix is the determinant of the original matrix multiplied by that scalar.
$$
\begin{vmatrix}
a_{11} & ... & \alpha a_{1j} & ... & a_{1n}\\
a_{21} & ... &\alpha a_{2j} & ... & a_{2n}\\
a_{31} & ... &\alpha a_{3j} & ... & a_{3n}\\
\vdots \\
a_{n1} & ... &\alpha a_{nj} & ... & a_{nn}\\
\end{vmatrix}=
\alpha
\begin{vmatrix}
a_{11} & ... &a_{1j} & ... & a_{1n}\\
a_{21} & ... &a_{2j} & ... & a_{2n}\\
a_{31} & ... &a_{3j} & ... & a_{3n}\\
\vdots \\
a_{n1} & ... &a_{nj} & ... & a_{nn}\\
\end{vmatrix}
$$
This is obvious from the definition of determinants.
Second, if one adds any column to another column, the determinant of the resulting matrix is the same as that of the original matrix.
$$
\begin{vmatrix}
a_{11} & ... & a_{1j} + a_{1k} & ... & a_{1n}\\
a_{21} & ... & a_{2j} + a_{2k}& ... & a_{2n}\\
a_{31} & ... & a_{3j} + a_{3k}& ... & a_{3n}\\
\vdots \\
a_{n1} & ... & a_{nj} + a_{nk} & ... & a_{nn}\\
\end{vmatrix}
=
\begin{vmatrix}
a_{11} & ... &a_{1j} & ... & a_{1n}\\
a_{21} & ... &a_{2j} & ... & a_{2n}\\
a_{31} & ... &a_{3j} & ... & a_{3n}\\
\vdots \\
a_{n1} & ... &a_{nj} & ... & a_{nn}\\
\end{vmatrix}
$$
Because the additional column $k$ part in column $j$ is not linearly independent of the other columns, its contribution vanishes.


text:
Q: Publishing in Visual Studio 2017 failing for .NET Core projects I have a problem with publishing in Visual Studio 2017. For Web Deploy, in publishing, I fill all the fields out correctly, and when I press "Validate Connection", a green symbol appears and everything in Authentication is okay.
However, when I click the publish button for Web Deploy, publishing fails and Visual Studio says:

could not authorize, make sure you are using the correct username ..."

I have this problem only for .NET Core applications. How I can fix this problem?

Publish has encountered an error. Build failed. Check the Output window for more details. A diagnostic log has been written to the following location:
"C:\Users\Aminpour\AppData\Local\Temp\tmp5249.tmp"


text:
Q: PHP check if data and time more than date and time for this moment Hey i want to check if time and date more than time right now
ex
if ( date("Y:m:j:H:i:s") >  strtotime("2017:09:27:14:02:05") ) {
 // TODO
}

A: Check this:
$date = "2017:09:27:14:02:05";

if ( date("Y:m:j:H:i:s") >  date('Y:m:j:H:i:s', strtotime($date)) ) {

}

Good Luck!


text:
Q: If one thread is busy on I/O will the entire process be blocked In a multi-threaded process,If one thread is busy on I/O will the entire process be blocked?
AFAIK, it totally depends on programmer that how they manage the threads inside the programs.
If another thread is there with no I/O, processor will never sit idle & start executing this thread. However, process in split threads such that one thread waits for the result of the other, the the entire process will be blocked.
Please comment if more information needs to be added.
Does there exist any other explaination?

A: If the process has only one thread, then yes.
If the process has multiple threads, then normally no if the operating system supports multithreading.
This question can also be addressed in terms of the underlying implementation of user threads. There are different models for multithreading models, in order to implement user threads they have to be mapped to a kernel thread:

*

*Many-to-One: Many user threads to one kernel thread

*One-to-One: Each user thread is assigned to a kernel thread.

*Many-to-Many: Many user threads are split on different kernel threads.
In the many-to-one case, a single block-operation (system call) within the thread can block the whole process. This disadvantage is not present in the one-to-one model.


text:
Q: search key pagination issue where should use unset to destroy session when click any link or searching another key I am searching a key in search bar and then its session store in session_start();  now i wanted when i am clicking at any other page or link or refresh any page this search session is not leaving , then how to use to destroy search key session in my code and where should i put unset($_SESSION['search']); code in my page to destroy session here is page code
<?php unset($_SESSION['search']);
require_once('inc/top.php');?>

<?php require_once('inc/header.php');?>
<?php
                     $total_num_page=1;
                    if(isset($_GET['page']))
                    {
                    $page_id=$_GET['page'];
                    }
                    else
                    {
                       $page_id=1;
                    }
                  if(isset($_POST['submitSearch']) || $_SESSION['search'])
                    {
                        session_start();
                        if($_POST['submitSearch']){
                            $_SESSION['search']=$_POST['search'];
                        }
                        $all_post_query= "select * from files where recieved_by like '%". $_SESSION["search"]. "%' or processed_by like  '%".$_SESSION["search"]."%' or   purpose like  '%".$_SESSION["search"]."%' or file_name like  '%".$_SESSION["search"]."%' order by date desc";
                        $all_post_run=mysqli_query($con,$all_post_query);
                        $all_post=mysqli_num_rows( $all_post_run);
                        $total_page=ceil($all_post/$total_num_page);
                        $page_start_from=($page_id-1)*$total_num_page;
                     }
                 else
                 {
                   $all_post_query="select * from files order by date desc";
                   $all_post_run=mysqli_query($con,$all_post_query);
                   $all_post=mysqli_num_rows($all_post_run);
                   $total_page=ceil($all_post/$total_num_page);
                   $page_start_from=($page_id-1)*$total_num_page;
                  }

               ?>

 File List

                                <button type="button" style=" margin-left:190px; margin-top:-70px;"  class="btn btn-primary"> Case for Letter </button>

                                <button type="button" class="btn btn-default" style=" margin-left:210px; margin-top:-70px; background:#880E4F; "> Case for Call </button>

                                <button type="button" class="btn btn-danger" style=" margin-left:150px; margin-top:-70px;"> Filed Case</button>

                                        <form  action="index.php" class="search-form" method="post">

                                            Search:
                                            <input type="text" class="form-control" name="search" id="search" placeholder="Search Here" />
                                            <input type="submit" class="Goform" name="submitSearch" value="Go!"/>

                                        </form>

                                                Id
                                                File-name
                                                Purpose
                                                Recieved-By
                                                 Processed-By
                                                 Adress
                                                 Contact-No
                                                 Date
                                                 Update

                        <?php
                                            if(isset($_POST['submitSearch']))
                                            {
                                                $search=$_POST['search'];
                                                $p_query="select * from files where recieved_by like '%$search%' or processed_by like  '%$search%' or   purpose like  '%$search%' or file_name like '%$search%' order by date desc limit $page_start_from, $total_num_page";

                                            }
                                            else
                                            {

                    $p_query="select * from files order by date desc limit $page_start_from, $total_num_page";
                                            }
                          $p_run=mysqli_query($con,$p_query);
                            if(mysqli_num_rows($p_run)){
                             while($row=mysqli_fetch_array($p_run))
                             {
                                $c_id=$row['id'];
                                $file=$row['file_name'];
                                $purpose=$row['purpose'];
                                $recieve=$row['recieved_by'];
                                $processed=$row['processed_by'];
                                $address=$row['address'];
                                $contact=$row['contact_no'];
                                $date=$row['date'];

                            ?>

and here is pagination code for sending

                      <?php
                        for($i=1;$i<=$total_page;$i++)
                          echo "
$i
";
                      ?>

So where should i write the code to unset the session ,Help me please , i am new in php , and i know that this code is vulnerable to SQL injection

A: Use after which va\riable you want to destroy you session

unset($SESSION['key'])


text:
Q: Oozie Hive Action keeps failing due to parameter assignment? I'm trying to test out running a simple Hive script using Oozie, but I keep getting an error that I cannot make sense of.
Every time I submit a job, I get an error message that says "Job failed, error message[Parameter expression must contain an assignment: jobRequest]". However, I have this parameter defined and assign it a value when I originally submit the config.
The parameter in question is for an external hive table name that I'm trying to create. In the Oozie workflow, I define the table name parameter that is getting passed to the Hive script here:
<param>${hiveTableName}</param>

I then create a job.xml that I submit to oozie, where this parameter is assigned the value like so:
<property>
    <name>hiveTableName</name>
    <value>jobRequest</value>
</property>

Has anyone else ran into an issue like this or have any idea of what might be causing it? It seems like the parameter is properly defined and assigned, but the job keeps failing with the above error message. If it helps, the xml namespace that I'm using is:
<hive xmlns="uri:oozie:hive-action:0.2">

A:
I get an error message that says "Job failed, error message[Parameter expression must contain an assignment: jobRequest]"

Its complaining that the assignment operator is missing in the param tag. Check the documentation for more details https://oozie.apache.org/docs/3.3.1/DG_HiveActionExtension.html
First solution, using property tag Use like below
<property>
    <name>hiveTableName</name>
    <value>jobRequest</value>
</property>

Add param like this :
 <param>hiveTableName=${hiveTableName}</param>

Second solution via job.properties :
you want to pass the parameter with <param> tag, define the variable in your job.properties and then pass with the <param> tag.
e.g In job.properties add,
hiveTableName=jobRequest

then put <param>hiveTableName=${hiveTableName}</param> in the oozie workflow hive action


text:
Q: Problem with alpha blending in XNA Hi
i have a background and two png sprites
I want to make this effect using the provided background and sprites using XNA 3.1
I'm doing something wrong because i only get this As you noticed its not the effect i wanna do
It is possible do this effect with a few lines of code using alpha blending in XNA 3.1? A practical example would be really great!

A: First, render textures that contain the shapes that you want to be transparent to texture A.
The textures containing the shapes should contain black shapes, on a transparent background -- easily constructed with image editing software like Photoshop.
Then take texture A and draw it over top of your scene using an effect (an HLSL shader) that does:
output = float4(0, 0, 0, A.r);

Effectively making the output image's alpha lower where A is darker.
The image will have clear portions where you drew your shapes on A, and will be black everywhere else.
Here are the details of the shader code:
sampler TextureSampler : register(s0);

float4 PS(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
    float4 Color = tex2D(TextureSampler, texCoord);

    Color = float4(0, 0, 0, Color.r);

    return Color;
}

technique Vicky
{
    pass P0
    {
        PixelShader = compile ps_2_0 PS();
    }
}

A: If you want a solution without shader.
You first need your fog of war textures to be black with the transparent parts as White.

*

*Render your map and entity normally, to a RenderTarget2D

*Clear your background to black

*Start sprite batch with Additive blend

*Render you fog of war textures

*Start a new sprite batch with Multiply blend

*Render your map RenderTarget2D on top of the whole screen


text:
Q: Why doesn't PrintServer.GetPrintQueues get the correct PrintTicket while PrintServer.GetPrintQueue does? When I try to get all the printers and iterate through them with :
        Dim printServer As New PrintServer()
        For Each printer As PrintQueue In printServer.GetPrintQueues({EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Connections})
            ...
        Next

It looks like it's working fine only the UserPrintTicket for the returned printers is incorrect. If I set a printer in landscape mode in the printer settings and use this method, my printer.UserPrintTicket is still in portrait mode.
BUT (and that's the catch) if I do :
        printServer.GetPrintQueue(printerName)

Then my UserPrintTicket is correct. I would use this only I can't seem to find how to access network printers with this function (and I tried several ways to get it, no luck).
So here's my two questions :

*

*Why on earth are the UserPrintTicket different between two seemingly identical methods?

*How can I get network printers with GetPrintQueue?

A: Okay I tried to solve this issue most of the day yesterday and this morning I finally found the solution. I still don't know why 1) UserPrintTicket is different between GetPrintQueues and GetPrintQueue, but to list all of my printers and get the correct UserPrintTicket for each one you need to call GetPrintQueue on the printer's HostingPrintServer for it to work. So in other words :
        Dim printServer As New PrintServer()

        For Each printer As PrintQueue In printServer.GetPrintQueues({EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Connections})
              'Get the parent PrintServer and uses it to get the PrintQueue, seems like overkill but that's the only way I found to get the correct UserPrintTicket
              Dim currentPrinter As PrintQueue = printer.HostingPrintServer.GetPrintQueue(printer.Name)
              ...
        Next

Hope that helps someone!


text:
Q: why empty string is 0x20? Here is my solidity code.
contract TestLog {
    bytes constant internal EMPTY_BYTES = "";
    event Logempty(bytes data);
    function Log() public {
        emit Logempty(EMPTY_BYTES);
    }
}

so everythime I execute Log(),it print 0x20 in event log, why not 0x00 ?
I deployed it on Ropsten network. Here is the link:
https://ropsten.etherscan.io/address/0xb0723e0943b7b10c985365df6aef983bc6eeb6d6#events

A: Because the ASCII code of a blank space is actually 0x20. You can read more about those here.
To clarify:
What you are using there, "", is actually the empty string and in most programming languages is different from null. So being a string of length zero, as it's also stated here, there is also memory required to store it.
Hope that helps :)