text:
Q: Magnetic Field calculated from Magnetic vector potential Reference : $^{\prime\prime}$Physics of Atoms and Molecules$^{\prime\prime}$ by B.H.Bransden and C.J.Joachain, 1983 Edition.
In $\boldsymbol{\S}$4.1 The electromagnetic field and its interaction with charged particles we read :

\begin{align}
\mathscr{E}\!\!\!\!\mathscr{E} \left(\mathbf{r},t\right) & \boldsymbol{=}\boldsymbol{-}\boldsymbol{\nabla}\phi\left(\mathbf{r},t\right)\boldsymbol{-}\dfrac{\partial}{\partial t}\mathbf{A}\left(\mathbf{r},t\right)
\tag{4.1}\label{4.1}\\
\mathscr{B}\!\!\!\!\!\mathscr{B} \left(\mathbf{r},t\right) & \boldsymbol{=}\boldsymbol{\nabla}\boldsymbol{\times}\mathbf{A}\left(\mathbf{r},t\right)
\tag{4.2}\label{4.2}
\end{align}
\begin{align}
\boldsymbol{\nabla\cdot}\mathbf{A} & \boldsymbol{=}0
\tag{4.3}\label{4.3}\\
\nabla^2\mathbf{A} \boldsymbol{-}\dfrac{1}{c^2}\dfrac{\partial^2\mathbf{A}}{\partial t^2} & \boldsymbol{=0}
\tag{4.4}\label{4.4}
\end{align}
$\cdots\cdots\cdots\cdots$the most general solution of Maxwell's equations for a radiation field can always be expressed in terms of potentials such that $\boldsymbol{\nabla\cdot}\mathbf{A}\boldsymbol{=}0$ and $\phi\boldsymbol{=}0$.

A monochromatic plane wave solution of equations \eqref{4.3}-\eqref{4.4}
corresponding to the angular frequency $\omega$ (i.e. to the frequency $\nu=\omega/2\pi$) is one that represents a real vector potential $\mathbf{A}$ as
\begin{align}
\mathbf{A}\left(\omega;\mathbf{r},t\right) & \boldsymbol{=}2\mathbf{A}_{0}\left(\omega\right)\cos\left(\mathbf{k}\boldsymbol{\cdot}\mathbf{r}\boldsymbol{-}\omega t\boldsymbol{+}\delta_{\omega}\right)
\nonumber\\
&\boldsymbol{=}\hphantom{2}\mathbf{A}_{0}\left(\omega\right)\left[\exp\left[i\left(\mathbf{k}\boldsymbol{\cdot}\mathbf{r}\boldsymbol{-}\omega t\boldsymbol{+}\delta_{\omega}\right)\right]\boldsymbol{+}\text{c.c.}\right]
\tag{4.5}\label{4.5}
\end{align}
Here $\mathbf{A}_{0}$ is a vector which, as we shall see shortly, describes both the intensity and the polarisation of the radiation, $\mathbf{k}$ is the propagation vector, $\delta_{\omega}$ is a real phase and c.c. denotes the complex conjugate.We note that \eqref{4.3} is satisfied if
\begin{equation}
\mathbf{k}\boldsymbol{\cdot}\mathbf{A}_{0}\left(\omega\right)\boldsymbol{=}0
\tag{4.6}\label{4.6}
\end{equation}
so that $\mathbf{A}_{0}$ is perpendicular to $\mathbf{k}$ and the wave is transverse. Equation \eqref{4.4} is satisfied provided that $\omega\boldsymbol{=}k\,c$, where $k$ is the magnitude of the propagation vector $\mathbf{k}$.

$\cdots\cdots\cdots\cdots$

The electric and magnetic fields associated with the vector potential \eqref{4.5} are given respectively from \eqref{4.1} and \eqref{4.2} by
\begin{align}
\mathscr{E}\!\!\!\!\mathscr{E}  & \boldsymbol{=}\boldsymbol{-}2\omega A_{0}\left(\omega\right)\boldsymbol{\hat{\varepsilon}}\sin\left(\mathbf{k}\boldsymbol{\cdot}\mathbf{r}\boldsymbol{-}\omega t\boldsymbol{+}\delta_{\omega}\right)
\nonumber\\
\mathscr{B}\!\!\!\!\!\mathscr{B} & \boldsymbol{=}\boldsymbol{-}2 A_{0}\left(\omega\right)\left(\mathbf{k}\boldsymbol{\times}\boldsymbol{\hat{\varepsilon}}\right)\sin\left(\mathbf{k}\boldsymbol{\cdot}\mathbf{r}\boldsymbol{-}\omega t\boldsymbol{+}\delta_{\omega}\right)
\tag{4.7}\label{4.7}
\end{align}
where we have written $\mathbf{A}_{0}\left(\omega\right)\boldsymbol{=}A_{0}\left(\omega\right)\boldsymbol{\hat{\varepsilon}}$. The direction of the electric field $\mathscr{E}\!\!\!\!\mathscr{E}$ is along the real unit vector $\boldsymbol{\hat{\varepsilon}}$, which specifies the polarisation of the radiation, and is called the polarisation vector. From \eqref{4.6} we note that $\boldsymbol{\hat{\varepsilon}}$ must lie in a plane perpendicular to the propagation vector $\mathbf{k}$ and can therefore be specified by
giving its components along two linearly independent vectors lying in this plane.
We also see from \eqref{4.7} that both $\mathscr{E}\!\!\!\!\mathscr{E}$ and $\mathscr{B}\!\!\!\!\!\mathscr{B}$ are perpendicular to the direction of
propagation $\mathbf{k}$, and to each other.

$\boldsymbol{=\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!==\!=\!=\!=}$
Question : How the expression for $\mathscr{B}\!\!\!\!\!\mathscr{B}$ in \eqref{4.7} is derived  from \eqref{4.2} and \eqref{4.5} ?

A: Hint :
If $\psi\left(\mathbf{r}\right), \boldsymbol{\alpha}\left(\mathbf{r}\right)$ scalar and vector functions of $\mathbf{r}$ respectively then
\begin{equation}
\boldsymbol{\nabla}\boldsymbol{\times}\left(\psi\,\boldsymbol{\alpha}\right)\boldsymbol{=}\boldsymbol{\nabla}\psi\boldsymbol{\times}\boldsymbol{\alpha}\boldsymbol{+}\psi\boldsymbol{\nabla}\boldsymbol{\times}\boldsymbol{\alpha}
\tag{Fr-01}\label{Fr-01}
\end{equation}
So if $\boldsymbol{\alpha}$ is a constant vector independent of $\mathbf{r}$ then
\begin{equation}
\boldsymbol{\nabla}\boldsymbol{\times}\left(\psi\,\boldsymbol{\alpha}\right)\boldsymbol{=}\boldsymbol{\nabla}\psi\boldsymbol{\times}\boldsymbol{\alpha}\,,\qquad\boldsymbol{\alpha}\boldsymbol{=}\textbf{constant}
\tag{Fr-02}\label{Fr-02}
\end{equation}
Inserting in \eqref{Fr-02} $\boldsymbol{\alpha}\boldsymbol{=}2\mathbf{A}_{0}\left(\omega\right)\boldsymbol{=}2A_{0}\left(\omega\right)\boldsymbol{\hat{\varepsilon}}\boldsymbol{=}\textbf{constant}$ and  $\psi\left(\mathbf{r}\right)\boldsymbol{=}\cos\left(\mathbf{k}\boldsymbol{\cdot}\mathbf{r}\boldsymbol{-}\omega t\boldsymbol{+}\delta_{\omega}\right)$ the only thing you must try to do is to find the grad of a scalar function (more simple than the curl of a vector function).

A: The result given by the OP is off by a sign (v1). It should read
$$\vec{B}=-2{A_0}(\hat{k}\times\hat{\epsilon})\sin({\textbf{k.r}-\omega t+\delta_{\omega}}).$$
Let me do one component. If $\hat{\epsilon}=(\epsilon_x,\epsilon_y,\epsilon_z)$, then
\begin{align}
(\nabla\times\vec{A})_x&=\frac{\partial A_z}{\partial y}-\frac{\partial A_y}{\partial z}\\
&=2A_0\epsilon_z\left[-\sin(\mathbf{k}\cdot\mathbf{r}-\omega t+\delta_\omega)\right]k_y-2A_0\epsilon_y\left[-\sin(\mathbf{k}\cdot\mathbf{r}-\omega t+\delta_\omega)\right]k_z\\
&=2A_0\sin(\mathbf{k}\cdot\mathbf{r}-\omega t+\delta_\omega)[\epsilon_yk_z-\epsilon_zk_y]\\
&=2A_0\sin(\mathbf{k}\cdot\mathbf{r}-\omega t+\delta_\omega)(\hat{\epsilon}\times\hat{k})_x\\
&=-2A_0\sin(\mathbf{k}\cdot\mathbf{r}-\omega t+\delta_\omega)(\hat{k}\times\hat{\epsilon})_x.
\end{align}
To see this in a more general way, remember that the $i$-th component of a curl is
$$(\nabla\times\vec{A})_i=\sum_{j,k}\varepsilon_{ijk}\frac{\partial A_k}{\partial x_j},$$
and that the cross product can be written as
$$(\vec{k}\times\vec{\epsilon})_i=\sum_{j,k}\varepsilon_{ijk}k_j\epsilon_k.$$
By applying the chain rule we get
$$\frac{\partial A_k}{\partial x_j}=-2A_0\epsilon_k\sin(\mathbf{k}\cdot\mathbf{r}-\omega t+\delta_\omega)k_j.$$
It is immediate to get to the general result by making use of the last three equations.


text:
Q: Is there a way to make a bash script process messages that have been sent to it using the write command Is there a way to make a bash script process messages that have been sent to it using the "write" command? So for example, if a user wants to activate a feature in my script, could I make it so that they can send the script a command using the write command?
One possible method I thought of was to configure logging for a screen session and then have the bash script parse text through there, but I'm not sure if there would be a simpler or more efficient way to tackle this
EDIT: I was thinking as an alternative solution I could use a named pipe. I'm worried that it would break though if the tmp partition gets filled up completely (not sure if this would impact write as well?). I'm going to be running this script on a shared box, and every once in a while someone will completely fill up the /tmp partition and then just leave it like that until people start complaining

A: Hmm, you are trying to really circumvent a poor unix command to ask it something it was not specified for. From the man page (emphasize mine):

The write utility allows you to communicate with other users, by copying
       lines from your terminal to theirs

That means that write is intended to copy line directly on terminals. As soon as you say, I will dump terminal output with screen, and then parse the dump file, you loose the simplicity of write (and also need disk space, with the problem of removing old lines from a sequencial file)
Worse, as your script lives on its own, it could (should?) be a daemon script attached to no terminal
So if I have correctly understood your question, your requirements are:

*

*a script that does some tasks and should be able to respond to asynchronous requests - common usages are named pipes or network or unix domain sockets, less common are files in a dedicated folder with a optional signal to have immediate processing, adding lines to a sequential file while being possible is uncommon, because of a synchonization of access problem

*a simple and convivial way for users to pass requests. Ok write is nice for that part, but much too hard to interface IMHO

If you do not want to waste time on that part by using standard tools, I would recommend the mail system. It is trivial to alias a mail address to a program that will be called with the mail message as input. But I am not sure it is worth it, because the user could directly call the program with the request as input or command line parameter.
So the client part could be simply a program that:

*

*create a temporary file in a dedicated folder (mkstemp is your friend in C or C++, or mktemp in shell - but beware of race conditions)

*write the request to that file

*optionaly send a signal to a pid - provided the script write its own PID on startup to a dedicated file

redpajama_set_name: RedPajamaStackExchange


text:
Q: Dijkstra algorithm Java - find shorthest path I need to implement Dijsktra algorithm in my case:
From A to B time to reach destination is 5.
From A via C to B time to reach destination is 3. (from A to C (1) , from C to B (2) => its 3.
i try it below:
    public static void main(String[] args)
    {
        // mark all the vertices
        Vertex A = new Vertex("A");
        Vertex B = new Vertex("B");
        Vertex C = new Vertex("C");

        // set the edges and weight
      A.adjacencies = new Edge[]{ new Edge(B, 5) };
      C.adjacencies = new Edge[]{ new Edge(A, 1) };
      B.adjacencies = new Edge[]{ new Edge(C, 2) };

        computePaths(A); // run Dijkstra
        System.out.println("Distance to " + B + ": " + B.minDistance);
        List<Vertex> path = getShortestPathTo(B);
        System.out.println("Path: " + path);
    }

http://pastebin.com/jGynb3t8
Whats do i wrong? I need to find the shorthest Path to B.

A: You make the mistake with your edge class. In this part of computePaths
// Visit each edge exiting u
for (Edge e : u.adjacencies)
{
    Vertex v = e.target;

you assume that the edge always points along your shortest path. But for the edge e between A and C, it holds that e.target == A, since you created it as
C.adjacencies = new Edge[]{ new Edge(A, 1) };

You should change the line in computePaths to
Vertex v = (e.source == u ? e.target : e.source);


text:
Q: Group by or sum more column I would like to know if exist a method "automatic" for calculted more column in the same time.
library(dplyr)
abc <- iris %>%
      group_by(Species) %>%
      summarise(abc = sum(Petal.Width)) %>%
      ungroup()
abc2 <- iris %>%
      group_by(Species) %>%
      summarise(abc = sum(Sepal.Width)) %>%
      ungroup()

I can use this code for each column but if i need to do more column (in this dataset the first four), how can I do? And I need in the same dataset, it is possible?

A: Try this:
iris %>%
  group_by(Species) %>%
  summarise(across(Sepal.Length:Petal.Width, sum))

# A tibble: 3 x 5
  Species    Sepal.Length Sepal.Width Petal.Length Petal.Width
  <fct>             <dbl>       <dbl>        <dbl>       <dbl>
1 setosa             250.        171.         73.1        12.3
2 versicolor         297.        138.        213          66.3
3 virginica          329.        149.        278.        101.


text:
Q: Openshift - Cannot connect to mysql gear My app was stuck on connecting to Database gear for almost few day now.
I have tried almost 2 days to search, but it seem no luck.
Could anyone help!
What I have tried:

*

*ssh in to main gear (application gear) is ok, but fail when trying manually connect to mysql.
$mysql
ERROR 2003 (HY000): Can't connect to MySQL server on '559e8e625973cad7d10001b5-jobboardkh.rhcloud.com' (111)

*telnet
$telnet  559e8e625973cad7d10001b5-jobboardkh.rhcloud.com 48986
Trying 54.159.182.108...
telnet: connect to address 54.159.182.108: Connection refused

*port-forward on my local and I tried to connect as it worked before, but now it's not work

*ssh to mysql gear also not able to connect

A: If you can't ssh into the gear then the gear probably isn't running. Try restarting the MySQL gear via:
rhc cartridge restart -a {appName} -c mysql-5.1

A: I have waited to get the support from Openshift for several days, but at last I decided to remove out that database gear and recreated it. So all my data was lost.
resolution for preventing database gear is down and data will lost, is to have a daily backup schedule for database and store it in the main gear.


text:
Q: Android Pass String form Service to Service?And use at onCreate in Service? I Have two services.so here I am passing string form one service to another service
Here I used This to pass string value..
startService(new Intent(Service_A.this, Service_A.class).putExtra("svdata", url));

and this to receive the string
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    super.onStartCommand(intent, flags, startId);
    MyURL = intent.getExtras().getString("svdata");

    System.out.print("@@@@@@@@@@@@@@@@@@@@@@@@@"+MyURL+"$$$$$$$$$$$$$$$$$");

    return START_STICKY;
}

And at onCreate I am starting my webserive with that Url
but the url is missing,
@Override
public void onCreate() {
   try{
       new MyWebService(ServWeb.this).execute();
   }
   catch(Exception e){
       Toast.makeText(getApplicationContext(), "Failed to Connect Server", Toast.LENGTH_LONG).show();
   }

}

I am using this MyWebService() to get json data with that URL.
But URL is wokring and String in getting. The exact url value, But before that onCreate() method is running
But I have given String to onStartCommand()
can any one suggest me how to set the string as Url to my service.
or How to add string directly to onCreate. In Service
Update
My problem is..
I am starting Service at onCreate I have a Json service it will get json from url. But I am getting String(url) form another Service.
To pass String form Service to Service I used
startService(new Intent(Service_A.this, Service_A.class).putExtra("svdata", url));
But to Receive that string I need to write onStartCommand..
Here I am getting string, but I want to use the same string in onCreate...
is there any way to get that string at onCreate...IN SERVICE

A: Write a SyncManager (singleton class) for handling your service work.
in your oncreate method :
 supply sync credentials like url,user info, etc..
 public class SyncService extends IntentService {

     SyncManager syncManager;

     /**
      * Creates an IntentService.  Invoked by your subclass's constructor.
      *
      * @param name Used to name the worker thread, important only for debugging.
      */

     public SyncService(String name) {
      super(name);
     }

     public SyncService() {
      super("SyncService");
     }

     @Override
     protected void onHandleIntent(Intent intent) {
       syncManager = SyncManager.getInstance(getApplicationContext());
       syncManager.startSynchronisation();
      }
      /* The service is starting, due to a call to startService() */
     @Override
     public int onStartCommand(Intent intent, int flags, int startId) {
      return super.onStartCommand(intent, flags, startId);
     }

     @Override
     public void onDestroy() {
      super.onDestroy();
     }

    }


text:
Q: How to align ViewGroup to the bottom of the screen So, I have an activity that is launched as a dialog (Theme.Dialog). I use it to play a video, dimming the background, and looks pretty cool... but it's always centered on the screen and don't know how to move it to the bottom programmatically.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/lr_layout"
            android:background="#FF000000"
            android:padding="0dp" >

<RelativeLayout
    android:id="@+id/lr_progressContainer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FF000000">

    <ProgressBar android:id="@+id/lr_progress"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_centerInParent="true"
      android:background="@android:color/black"
      style="@android:style/Widget.ProgressBar.Large" />

    <View android:id="@+id/disableShape"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="0dp"
    android:visibility="gone"
    android:background="#CC000000"
    />
</RelativeLayout>

</RelativeLayout>

And then I add the video player programmatically (View from 3rd party).
I've tried this:
layout = (ViewGroup) findViewById(R.id.lr_layout);
layout.setY(0);

and this:
RelativeLayout.LayoutParams adViewLayoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
adViewLayoutParams.addRule(RelativeLayout.ALIGN_BOTTOM);
layout.addView(adView, adViewLayoutParams);

But the video is still in the center.
Any idea?
Thanks!

A: Try putting this in your onCreate method.
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.gravity = Gravity.BOTTOM;
getWindow().set attributes(lp);

A: if you want to align relativeLayout child to be at the bottom, you can set alignParentBottom = true
if you want to align dialog to bottom of screen, you can use popupWindow instead!


text:
Q: Windows path/environment variable doesn't change for vim When I write vim in powershell or cmd it say that "path/to/my/old/portable/vim80/vim.exe" does not exist. I have removed that vim long ago and have deleted its path from path variable.
I tried adding the path of the new portable vim to the path variable, but Windows still somehow finds the old path. I can't for the life of me figure out where Windows is reading that path. I looked under registry too to no avail. Even ran Ccleaner on the registry and still the problem persists.
Any help is appreciated.
Thank you very much
TLDR; Somehow windows cannot forget the path of my old vim. I added the new path, but still it picks up the old one, how do I replace the old path? How is windows still finding the old path?


text:
Q: XSLT: How to concatenate t-Elements within a p-Element I need to concatenate t-Elements within a p-Element. I tried it with a xsl:for-each-group and store the text from the t-elements in a variable. But i cant use this variable outside of the xsl:template.
Source:
<document>

        <pPr>
            <spacing line="286" lineRule="auto"/>
        </pPr>
        <r>
            <t>First:</t>
        </r>

        <pPr>
            <numPr>
                <ilvl val="0"/>
                <numId val="17"/>
            </numPr>
            <spacing line="286" lineRule="auto"/>
        </pPr>
        <r>
            <t>Second</t>
        </r>
        <r>
            <t space="preserve"> third</t>
        </r>
        <r>
            <t space="preserve"> </t>
        </r>
        <r>
            <t>last.</t>
        </r>

</document>

Desired outcome:
<document>

     <pPr>
        <spacing line="286" lineRule="auto"/>
     </pPr>
     <r>
        <t>First:</t>
     </r>

     <pPr>
        <numPr>
           <ilvl val="0"/>
           <numId val="17"/>
        </numPr>
        <spacing line="286" lineRule="auto"/>
     </pPr>
      <r>
        <t>Second third last.</t>
     </r>

</document>

My try so far:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mf="http://example.com/mf"
xmlns:w="www.wnamespace.com"
version="2.0"
exclude-result-prefixes="xs mf w">

<xsl:strip-space elements="*"/>
<xsl:preserve-space elements="t"/>
<xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>

<xsl:template match="@* | node()">
    <xsl:copy>
        <xsl:apply-templates select="@*, node()"/>
    </xsl:copy>
</xsl:template>

<xsl:template match="p">
   <xsl:for-each-group select="node()" group-adjacent="boolean(self::r)">
     <xsl:variable name="concat-t">
        <xsl:sequence select="current-group()[self::r]"></xsl:sequence>
    </xsl:variable>

    <xsl:choose>
      <xsl:when test="self::r">
      </xsl:when>
      <xsl:otherwise>

<xsl:copy-of select="current-group()"/>

      </xsl:otherwise>
    </xsl:choose>

    <t><xsl:value-of select="$concat-t"/></t>
  </xsl:for-each-group>
 </xsl:template>
 </xsl:stylesheet>

I am new to XSLT 2.0 and a little overwhelmed. Any help appriciated.
XsltFiddle: http://xsltfiddle.liberty-development.net/pNEj9dj

A: It seems the identity transformation plus two templates
  <xsl:template match="p/r[1]">

      <t>
        <xsl:value-of select="../r/t"/>
      </t>

  </xsl:template>

  <xsl:template match="p/r[position() gt 1]"/>

should do the job.


text:
Q: PermissionError: [Errno 13] Permission denied: 'file.mp3' The program runs only twice. Later, the error occurs. I don't know why it works twice and then stops.
import tkinter, sys, pygame
from tkinter import messagebox
from gtts import gTTS

soundfile="file.mp3"

def ex():
    sys.exit()

The main problem is there:
def read():
    t = e.get()
    tts = gTTS(text=t, lang="en")
    tts.save(soundfile)
    pygame.mixer.init(frequency=16000, size=-16, channels=2, buffer=4096)
    pygame.mixer.music.load(soundfile)
    pygame.mixer.music.set_volume(1.0)
    pygame.mixer.music.play(0,0.0)
    while pygame.mixer.music.get_busy()==True:
        continue
    pygame.quit()

Next is the code for the buttons.
def clear():
    e.delete(0, 'end')

main = tkinter.Tk()

e = tkinter.Entry(main, justify = "center")
l = tkinter.Label(main, text = "Write text")
b1 = tkinter.Button(main, text = "Read", command = read)
b2 = tkinter.Button(main, text = "Clear", command = clear)
b3 = tkinter.Button(main, text = "Exit", command = ex)

So, I don't have any idea to fix it.

A: from gtts import gTTS
import playsound
import os

x = ['sunny', 'sagar', 'akhil']
tts = 'tts'
for i in range(0,3):
    tts = gTTS(text= x[i], lang = 'en')
    file1 = str("hello" + str(i) + ".mp3")
    tts.save(file1)
    playsound.playsound(file1,True)
    os.remove(file1)

rename the file for every new save, that worked for me.


text:
Q: Does a content page always have a title area at the top? I am using a content page like this:
<ContentPage.Content>
    <StackLayout x:Name="phrasesStackLayout">
    </StackLayout>
</ContentPage.Content>

Inside this I add a tabbed page.
At the top of the content page there is a title area.  Is there a way I can have this not appear. I don't want to have a title and the top of the page is wasted.
Here's what I have now:
public MainPage()
{
    InitializeComponent();

    var phrasesPage = new NavigationPage(new PhrasesPage())
    {
        Title = "Pause",
        Icon = "pause.png",

    };

    ...
}

public partial class PhrasesPage : ContentPage
{
    public PhrasesFrame phrasesFrame;

    public PhrasesPage()
    {
        InitializeComponent();
        HasNavigationBar = "False"; // Doesn't work
        AS.phrasesPage = this;
    }

    ...
}

A: Your code seems incomplete, but you must do something like this:
public partial class PhrasesPage : ContentPage
{
    public PhrasesFrame phrasesFrame;

    public PhrasesPage()
    {
        InitializeComponent();
        NavigationPage.SetHasNavigationBar(this, false);
        AS.phrasesPage = this;
    }

    (...)

}


text:
Q: Closed Form for the Definite integral of the Modified Bessel Function of the First Kind? Can anyone help me on deriving the closed form expression for the following definite integral of the modified Bessel function of the first kind, zero order, involving power and exponential functions
$$I={\displaystyle\int\limits_0^{a } {{x^{b}} \cdot \exp \left( { - \frac{{{x^2}}}{2}} \right){I_0}\left( {c x} \right)dx} }$$
where $a$, $b$, and $c$ are constant.
Many thanks for your help!


text:
Q: Getting iScroll 4 to work with iFrames on Ipad iOS 4.3+ I am working on an iPad web application using standard HTML/CSS/JS. Eventually it will be wrapped in Phonegap, but for the time being it will live on the web.
The application delivers HTML5 content from Scribd (converted PDFs) via an iFrame embed. Due to the different orientations of the iPad, and readability of the content, it is necessary to have the content of the iFrame larger than the embedded iFrame.
The issue I've run into is that Apple in their infinite 'wisdom' have taken out the ability to scroll iFrames in iOS 4.3+ (both using 1 and 2 finger scrolls).
I've implemented iScroll 4 to get around this however it only seems to work if the user touches outside of the iFrame, even if the whole iFrame is inside the scrolling div.
Has anybody found a workaround / solution for this? Can I disable the iFrame scrolling somehow and give full control to iScroll?
Any help would be greatly appreciated, been hacking at this for days...


text: Q: Show that for any $\mathbf{u}$ and $\mathbf{v}$ in a normed vector space $| || \mathbf{u}|| - || \mathbf{v} || | \leq | \mathbf{u}-\mathbf{v} |$ The question self-explanatory, I think. I'm struggling a bit with this. Should I be able to get this just with the properties of normed vector spaces? Thanks.


text:
Q: EXCEPT clause in SOQL I would appreciate a little help.
How do I write EXCEPT clause in Salesforce SQL?
I would like to have query which excludes rows based on a few conditions from the same database.
Like this:
SELECT Email_address
FROM Database_1
EXCEPT
SELECT Email_address
FROM Database_1
WHERE Brand_country = 'xyz' AND Address_country = 'abc'

Is there another keyword?
Or maybe is there a better/easier way to do this?
Thanks in advance!

A: You can use aggregation:
SELECT Email_address
FROM Database_1
GROUP BY Email_address
HAVING SUM(CASE WHEN Brand_country = 'xyz' AND Address_country = 'abc' THEN 1 ELSE 0 END) = 0;


text:
Q: How to Add keys to array elements which are stateless functional components In a parent component I am populating a 2D array with a bunch of functional components. However, because I am putting it into an array, each element needs a unique key. What is best practice for doing this with stateless functional components?
var dim = this.props.dim;

    var cells = [];
    for (var i = 0; i < dim; i++) {
      var row = [];
      for (var j = 0; j < dim; j++) {
        row.push(Cell({dim:10, isAlive:this.state.matrix[i][j].isAlive}))
      }
      cells.push(row);
    };

A: You are not using your functional component (Cell) as a functional component.  You aren't suppose to call them like functions.  You are supposed to render them using React.
You can use JSX syntax:
var dim = this.props.dim;

var cells = [];
for (var i = 0; i < dim; i++) {
  var row = [];
  for (var j = 0; j < dim; j++) {
    row.push(<Cell key={`${i}-${j}`} dim={10}, isAlive={this.state.matrix[i][j].isAlive> />);
  }
  cells.push(row);
};

Or you can use React API
var dim = this.props.dim;

var cells = [];
for (var i = 0; i < dim; i++) {
  var row = [];
  for (var j = 0; j < dim; j++) {
    row.push(React.createElement(Cell, {key:`${i}-${j}`, dim:10, isAlive:this.state.matrix[i][j].isAlive}, null);
  }
  cells.push(row);
};

Both those forms allow you to pass in the key property and allow React to consume it.

A: You could add the index of that element, which is given by index = i * dim + j. This way it's unique for all items and consecutive.

A: here is an example that you should be able to work with:

// parent
const arr = ['i', 'like', 'cats']

const arrWithKeys = arr.map((item, i) => ({ key: i, item }))

console.log(arrWithKeys)

// child
arrWithKeys.forEach((thing) => console.log(`<Something key={${thing.key}} item={${thing.item}} />`))

pass arrWithKeys into the child like this:
<Component arrWithKeys={arrWithKeys} />

and access it inside the component as this.props.arrWithKeys

A: use jsx syntax only:
 class mat extend Component{
render(){
    return <div>
     {this.state.matrixCell.map((row, i)=>row.map((col, k)<Cell key={i*dim+k} dim={10} isAlive = {col.isAlive}))}
    </div>;
    }
}


text:
Q: Ignore a module during maven test build for multi module maven project Is it possible to run a maven test build (mvn clean test) in a multi module maven project and to skip/ignore a particular module's test? like -Dmaven.test.skip=true but for a particular module and not all the modules? I dont want to change the surefire <configuration> to include <skipTests>true</skipTests> for the module which I want to skip for tests. I wanted to know if this can be done from command line. I need this because in my project I've many modules and particular one or two takes really long to execute test, so when I want to test only couple of modules I'd like to skip these time taking modules to which I've not made any changes.

A: Is is really a problem for you to change the configuration of the surefire plugin ? Because you could change it one time only in your module ...
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.12</version>
            <configuration>
                <skipTests>${skip.foo.module.tests}</skipTests>
            </configuration>
        </plugin>
    </plugins>
</build>

... and delegate the true/false value of the skipTests tag to a maven property, activated by a dedicated profile :
<properties>
    <skip.foo.module.tests>false</skip.foo.module.tests>
</properties>

<profiles>
    <profile>
        <id>SKIP_FOO_MODULE_TESTS</id>
        <properties>
            <skip.foo.module.tests>true</skip.foo.module.tests>
        </properties>
    </profile>
</profiles>

So that you could deactivate the tests in Foo module with the command line :
mvn clean test -P SKIP_FOO_MODULE_TESTS

A: You could accomplish that with a profile that did the configuration of surefire to skip.  That'd allow you to keep the test running most of the time, but when you wanted to skip the tests for one of the modules sometime, you could invoke that profile.  You can then exclude all tests using skip tests or you could use the excludes option to only exclude the one or two tests that are long executing.


text:
Q: How to simulate "server down" situation using Burp suite proxy? I tried using Burp suite to simulate the above for a particular domain. I am a beginner on this and don't know how to set it up. I couldn't find a built-in option for this.
Also, if there is no option, will I need to forward the request to some random IP address so that the connection gets timed out?
Update
Actually I doubt if redirecting to some invalid IP will give a connection timeout. Or will it give a timeout? I just want to know what response will I get if the server is down.

A: There isn't a feature to simulate "server down" but you can redirect as you suggest. If you redirect to an unused IP address (perhaps 192.168.99.99) you will normally get a timeout.
You can configure this in Proxy > Options > Proxy Listeners > Edit > Request Handling

A: You can just edit the response code to be a server error. You can do this automatically using match and replace as well.


text:
Q: How can I achieve this effect using SVG and JS? I've already built the animation part, used JS to control the  in SVG element.
Now what I want to achieve is something like this:

I tried to use paths.getBoundingClientRect() to get the distance between viewport's border to the path's highest position, so I can make the whole background change when the peak reaches a certain position. (if (rect.top <= 100) {...})
But I don't know how to control irregularly shaped areas' attributes.
Any possible solution?
Thank you very much.

A: i have used http://d3js.org for that sort of thing. it is very good. It provides a simple library to help you draw the graphs you want using svg. I think the particular part you are looking for is called library.
This is the API call.

*

*https://github.com/mbostock/d3/wiki/SVG-Shapes#area
Some links below to examples and code for using d3js

*

*http://bl.ocks.org/mbostock/3894205

*http://bl.ocks.org/mbostock/3883195

*http://mbostock.github.io/d3/talk/20111018/area-gradient.html

*http://bl.ocks.org/NPashaP/113f7fea0751fa1513e1

*http://bl.ocks.org/mbostock/1667367


text:
Q: Remain constant Woocommerce prices regardless of tax rate - B2C Note - im new, so please be kind. If anything isnt clear please tell me, so i can improve my questioning!
As a person who lives in europe and sells products to end-consumers, the following problem is very ipmortant and in my opinion heavily under-prioritised.
There are a lot of conversation regarding this issue. In the following one @MikeJolley (owner of the wocommerce github repository) was also involved(github.com issues/4131) and linked to the site - How Taxes Work in WooCommerce where you can find the following filter to remain the prices constant regardless of the tax rate
add_filter( 'woocommerce_adjust_non_base_location_prices', '__return_false' )

By using the filter you can achieve the following:
Example 1: Selling from GB (with their 20% tax rate) to Germany. The price of the product is 9.99 including tax. GB based sellers do not need to charge tax for physical goods in Germany.
Price = 9.99 (the same)
Tax   = 0 (no tax is charged
The German would pay 9.99 for the product, the same as GB people.
Example 2: Let's take the same above example, but consider a digital good where tax would apply of the rate 19%.
Price = 9.99 (the same)
Tax   = 9.99 / 1.19 = 8.39 (slightly less than GB)
The German would again pay 9.99
The Problem:
For a few weeks i put the filter in my functions.php and solved the isse, unfortunately after the last Woocommerce update the mentioned filter triggers the following post call - wich executes in a infinite loop - again and again (see firebug network tab).
https://testsite.com/online-shop/?wc-ajax=get_refreshed_fragments

My request
Any idea how to solve this Problem - or any other way to remain the prices constant? Im not interested in heavy or paid Plugin solution wich slow down my site. Thank you so much
EDIT:
After some research i came across with the following:
Refresh fragments infinite loop #10940 and Fix for #10940 - wc_cart_hash
It seems there is woocommerce bug wich is still not resolved entirely. I closed my other windows and the problem is gone. What a waste of time...

A: After some research i found the problem. It is a woocommerce core problem - look at Refresh fragments infinite loop #10940 and Fix for #10940 - wc_cart_hash
wc_cart_hash was used as a key for localStorage
for all WooCommerce sites. If you were to load your
cart for two different sites in the same browser,
the two WooCommerce pages would contend over this key
and loop on trying to set this key in the localStorage
This commit prepends the site's ajax URL onto the wc_cart_hash
key name in localStorage, providing a unique key for each
WooCommerce site. This ends contention over the keys.
It seems the woocommerce bug is not resolved entirely...
I closed my other windows and the problem is gone. Hope this helps others with the same problem.
UPDATE:
The problem also happens if you open a new Tab where you view a live preview (under Appearance - Themes) of another woocommerce theme in the backend... In my case i checked a few changes of a earlier theme.


text:
Q: Batch Rename all PNG files in folders and subfolders I am trying to rename all PNG files within several subfolders. See below for my explanation on what I am doing:
What is currently in place:
COMPANY
     SERVER1
         (Random).png
COMPANY2
     SERVER32
         (Random).png

What I want:

COMPANY
     SERVER1
         Company - Server1 - (Date PNG Modified).png
COMPANY2
     SERVER32
         Company2 - Server32 - (Date PNG Modified).png

How can I accomplish this? The part that I am having trouble with is getting the First and second directory name as well as the date modified that I can stick into the file name.
The current script that i have is below:
@echo off
for /r %%D in (.) do (
  for /f "delims=" %%F in ('dir /b /A:-D "%%D\*.png"') do (
    echo ren "D:\FinalDir\%%F" "%%~nxD-VirtualBootTest-3-3-18.png"
)) >> "D:\FinalDir\RenameCommands.txt"

FOR /R "D:\OriginalDir" %%i IN (*.png) DO COPY "%%i" "D:\FinalDir"

What this is doing right now is gathering all of the PNG files in all directories in the folder that building a batch file to rename all of the files that it copies out into the FinalDir. The renaming end result will end up looking like SERVER1-VirtualBootTest-3-3-18.png. I cant figure out how to make the date change with the file and add what the directory is two directories above the file.

A: So this script should do the trick.  It is relatively simple.
$files = Get-ChildItem $basePath -File -Filter *.png -Recurse
foreach($file in $files){
    $pathParts = $file.fullName.split('\')
    $dateMod = $file.LastWriteTime.ToString("MM-dd-yyyy")
    $first = $pathParts[-3]
    $second = $pathParts[-2]
    $file | Rename-Item -NewName "$first - $second - $dateMod.txt"
}

Here is the breakdown part by part:
$files = Get-ChildItem $basePath -File -Filter *.png -Recurse

First it gets all the files starting from the base path (You'll have to set the $basepath variable to your path) recursively to the end of the structure.
foreach($file in $files){
    $pathParts = $file.fullName.split('\')
    $dateMod = $file.LastWriteTime.ToString("MM-dd-yyyy")
    $first = $pathParts[-3]
    $second = $pathParts[-2]
    $file | Rename-Item -NewName "$first - $second - $dateMod.txt"
}

Then for each file it:

*

*Splits the file's fullname (path and file name) based on the '\' character.
$pathParts = $file.fullName.split('\')

*Accesses the lastWriteTime and formats it to the format you want.
$dateMod = $file.LastWriteTime.ToString("MM-dd-yyyy")

*For the $first and $second variables it is accessing the path that has been split from the right side (-1 would be file name, -2 is parent, -3 is parent of that parent and so on).
$first = $pathParts[-3]
$second = $pathParts[-2]

*Takes all that information gathered and renames the file to those pieces of info collected.
$file | Rename-Item -NewName "$first - $second - $dateMod.txt"


text:
Q: VLC Server Media root When I run vlc like:
vlc -I http

I open up users to browse my whole system directory structure. This is too much.
For example at the page http://localhost:8080/vlm.html I can click Edit on the Input field, then click Browse. On the pop-up I can continue to click '..'.
I want to open this server up so that I can access it remotely, but I do not want to expose my whole system directory structure.
How can I restrict the browse functionality to a specific sub-tree?

A: Edit %ProgramFiles(x86)%\VideoLAN\VLC\http\requests\browse.xml as Admin (you don't have to restart VLC) like below. Add the 3 lines that are marked by a + (which you should no include).
 <root>
 <vlc id="if" param1="url_param 1 =" />
   <vlc id="rpn" param1="'dir' url_extract" />
+  <element type="directory" size="" date="" path="X:\\SomeFolder" name="Media Root" extension="" />
   <vlc id="foreach" param1="file" param2="directory" />
+    <vlc id="if" param1="file.name value 'X:\\SomeFolder' 13 strncmp 0 =" />
     <vlc id="if" param1="file.basename value '.' 1 strncmp 0 != file.basename value '..' 2 strncmp 0 = |" />
       <element type="<vlc id="value" param1="file.type" />" size="<vlc id="value" param1="file.size" />" date="<vlc id="value"  param1="file.date" />" path="<vlc id="value" param1="file.name value xml_encode" />" name="<vlc id="value" param1="file. basename value xml_encode" />" extension="<vlc id="value" param1="file.ext value xml_encode" />" />
     <vlc id="end" />
+    <vlc id="end" />
   <vlc id="end" />
 <vlc id="end" />
 </root>

Note that 'X:\\SomeFolder' 13 the 13 if the length of the string X:\SomeFolder (so as to compare only the beginning of the path.
The original post comes from http://forum.videolan.org/viewtopic.php?f=2&t=84663

A: As suggested by a developer in this forum, I have modified browse.xml to give the desired behavior.
I added a predicate to the browse.xml file to check if the current directory starts with /library/ (the path I want to make the root).
<vlc id="if" param1="file.name value '/library/' 9 strncmp 0 =" />
...
<vlc id="end" />

Where 9 is the length of the path (in my case '/library/'. Also, added an entry to every directory listing to link back to this desired root.
<element type="directory" size="" date="" path="/library/" name="Media Root" extension="" />

The full browse.xml file is now:
<vlc id="end" />

<root>
<vlc id="if" param1="url_param 1 =" />
  <vlc id="rpn" param1="'dir' url_extract" />
  <element type="directory" size="" date="" path="/library/" name="Media Root" extension="" />
  <vlc id="foreach" param1="file" param2="directory" />
    <vlc id="if" param1="file.name value '/library/' 9 strncmp 0 =" />
      <vlc id="if" param1="file.basename value '.' 1 strncmp 0 != file.basename value '..' 2 strncmp 0 = |" />
        <element type="<vlc id="value" param1="file.type" />" size="<vlc id="value" param1="file.size" />" date="<vlc id="value" param1="file.date" />" path="<vlc id="value" param1="file.name value xml_encode" />" name="<vlc id="value" param1="file.basename value xml_encode" />" extension="<vlc id="value" param1="file.ext value xml_encode" />" />
      <vlc id="end" />
    <vlc id="end" />
  <vlc id="end" />
<vlc id="end" />
</root>

If you have a better way, please suggest it. Another option for security is to edit the .hosts file so that only local traffic can interact with the VLC server. You can then setup point to point VPN server to encrypt, and password protect access. (Details are outside the scope of this answer.)


text:
Q: Unity can't reload scene properly I wanna restart the scene, I have a countdown timer in there.
I've tried to LoadScene() but the countdown timer is still in the current time before I restart the scene

  {
        TheTimer();

        if (stoptimer == true)
        {
            GetComponent<RandomSpawner>().enabled = false;

            textPoin.text = "Total Poin: " + playerObj.GetComponent<Player>().point.ToString();

            playerObj.GetComponent<Player>().enabled = false;
            Destroy(spawnHereObject);
            panelEnd.SetActive(true);
        }
    }

A: I found my problem, It's just because on Update Function and using Time.time instead Time.realtimeSinceStartup


text:
Q: Additional Refactoring for Eclipse CDT Is there any way to configure or are there any 3rd party plug-ins available for Eclipse CDT (any version) that provide a rich set of refactorings?  My refactoring menu only provides the following in Eclipse Indigo CDT:

*

*Rename

*Extract Constant

*Extract Local Variable

*Extract Function

*Toggle Function Definition

*Hide Method...

I am looking for something with the richness of either the Java refactorings:
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.user/concepts/concept-refactoring.htm
Or something like what DevExpress Refactor Pro offers:
http://www.devexpress.com/Products/Visual_Studio_Add-in/Refactoring/
Note that the DevExpress plug-in is not compatible with Eclipse.  I am more than willing to pay for a good 3rd party plug-in (it just needs to support C++ in Eclipse).

A: Most of the refactoring features in Eclipse CDT are developed by people working and studying at the HSR Hochschule für Technik in Rapperswil Switzerland. There are students working on new refactorings and enhancements. After they had been reviewed they will be integrated into the official CDT.
For more information of the ongoing development get in contact with the leader of this projects Peter Sommerlad at the IFS.
Beside from this projects I think there is no other plugin/extension on the CDT platform.

A: I miss the additional features, too, but I guess, they are currently not available as eclipse plugins: at least I did not found any, except for announcements.
C++ is hard to parse.

A:
Is there any way to configure or are there any 3rd party plug-ins
  available for Eclipse CDT (any version) that provide a rich set of
  refactorings?

Sure, it's possible.  For example:
http://www.eclipse.org/articles/article.php?file=Article-Unleashing-the-Power-of-Refactoring/index.html
As far as finding exactly what you're looking for (either commercial or open source software) - and finding it for Eclipse (as opposed to simply purchasing a different IDE) - well, that's "iffy".  For example, I make heavy use of Embarcadero Delphi at work.  It's refactoring capabilities run RINGS around Visual Studio.  Visual Studio, in turn, is far better than the default Eclipse.  But hey - I use "vi" and a makefile whenever possible, so it's no big deal.
Suggestion:
Try an eval version of a major vendor's C++ compiler, and see where it takes you.  Two suggestions:

*

*Intel
http://software.intel.com/en-us/articles/intel-compilers/

*IBM
http://www.ibm.com/developerworks/downloads/


text:
Q: Path-connected does not imply convex I'm trying to prove that A subset of the Complex numbers which is path-connected does not imply that it is convex.
Any help?

A: I interpret "does not imply" as "look for a counterexample".
Convex means that the straight line between any two points in a set in still in that set.
Path connected means that you can find a path in the set between any two points in that set, which does not have to be a straight line.
So you could look at $\mathbb{C}\backslash \{0\}$ for example and try out the definitions on the points $-1$ and $1$.

A:
Let $A,B$ and $C$ be the points inside the region ${A}$.

A: Hint:  (1) Is the unit circle (not disk) path connected?  (2) Is a deleted neighbourhood of a point convex?

A: Consider any path that isn't a straight line or line segment. This set is path connected but not convex.


text:
Q: CodeCoverage using SonarQube scanner and NET5 I have two NET5 xUnit tests projects. On the build server I am generating code coverage report using coverlet. These reports are  wired-up to SonarQube scanner based on the guidance  here
Here are the steps
begin step
dotnet "C:\SonarQubeScanners\sonar-scanner-msbuild-5.1.0.28487-net5.0\SonarScanner.MSBuild.dll" begin /k:"IM" /d:sonar.host.url="http://myhost.com" /d:sonar.login="xxxxxxx" /d:sonar.cs.opencover.reportsPaths="%WORKSPACE%\Tests\MyProject1.UnitTests\TestResults\**\coverage.cobertura.xml,%WORKSPACE%\Tests\MyProject2.UnitTests\TestResults\**\coverage.cobertura.xml"

build solution
dotnet build "%WORKSPACE%\My.sln" -nr:false

run unit tests for two projects and collect data
dotnet test "%WORKSPACE%\Tests\MyProject1.UnitTests\MyProject1.UnitTests.csproj" --collect:"XPlat Code Coverage"
dotnet test "%WORKSPACE%\Tests\MyProject2.UnitTests\MyProject2.UnitTests.csproj" --collect:"XPlat Code Coverage"

end step
dotnet "C:\SonarQubeScanners\sonar-scanner-msbuild-5.1.0.28487-net5.0\SonarScanner.MSBuild.dll" end /d:sonar.login="xxxxxxx"

Question

*

*Each time the unit test runs it create new folder (with Guid Name) under TestResults

*

*How do I tell SonarScanner to use latest report?

*Or how do I clean-up TestResult folder before every run, is there a parameter to dotnet test command?

*SonarScanner also throws error wile parsing the generated report

Could not import coverage report 'D:\Jenkins\im\workspace\Tests\MyProject1.UnitTests\TestResults\9c4d50ae-4113-4018-97bb-30d919a9b1e7\coverage.cobertura.xml' because 'Missing root element <CoverageSession> in D:\Jenkins\im\workspace\Tests\MyProject1.UnitTests\TestResults\9c4d50ae-4113-4018-97bb-30d919a9b1e7\coverage.cobertura.xml at line 2'

A: Here are the steps I did doing to get it working
1>First delete the testresult folder before the scanning begins
rmdir /s /q "%WORKSPACE%\Tests\MyProject1.UnitTests\TestResults"
2>Modified --collect parameters as below to generate coverage report in opencover format
dotnet "C:\sonar-scanner-msbuild-5.5.3.43281-net5.0\SonarScanner.MSBuild.dll" begin /k:"IM" /d:sonar.host.url="myhost.com" /d:sonar.login="xxxxxxx" /d:sonar.cs.opencover.reportsPaths="%WORKSPACE%\Tests\**\TestResults\*\coverage.opencover.xml"
dotnet build "%WORKSPACE%\IM.sln" -nr:false
dotnet test --no-build "%WORKSPACE%\Tests\MyProject1.UnitTests\MyProject.UnitTests.csproj" --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
dotnet "C:\sonar-scanner-msbuild-5.5.3.43281-net5.0\SonarScanner.MSBuild.dll" end /d:sonar.login="xxxxxxx"


text:
Q: JList size in JDialog I'm following the previous suggestion of adopting a JList and calling setVisibleRowCount() in my JDialog.
I tried to restrict the number of rows to 2; however the dialog is packed into a big, unscrolled JList. I expected it would show only 2 rows and the rest would be reached through scrolling, leaving space for a future third element in the design (the orders list).

Please take a look at the SSCCE.
TestDialog.java
package testdialog;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class TestDialog {
    private static void createAndShowGUI() {
        JFrame frame = new JFrame("Test");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JButton button = new JButton("Click me");
        button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new JDViewCustomer(frame, true).setVisible(true);
            }
        });

        frame.getContentPane().add(button, BorderLayout.CENTER);

        frame.pack();
        frame.setVisible(true);
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
            }
        });
    }
}

CustomerAddress.java
package testdialog;

public class CustomerAddress {

    private final String title;

    public CustomerAddress(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }
}

JDViewCustomer.java
package testdialog;

import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridBagLayout;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import javax.swing.BoxLayout;
import javax.swing.DefaultListModel;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;

public class JDViewCustomer extends javax.swing.JDialog {

    private static final long serialVersionUID = 1L;

    private final JPanel jPanelCustomerInfo;
    private final JPanel jPanelCustomerAddresses;
    private final JPanel jPanelCustomerOrders;
    private JTextField txtarea_1;
    private JPanel panelNomeDoCliente;
    private JPanel panelDadosDoCliente;
    private JPanel panelAbaixoDeCustomerAddresses;
    private JPanel panelTituloEnderecos;
    private JPanel panelContendoOsEnderecos;
    private JLabel lblEnderecos;
    private JPanel panel;
    private JScrollPane scrollPane;
    private JList<CustomerAddress> jListCustomerAddresses;

    public JDViewCustomer(java.awt.Frame parent, boolean modal) {
        super(parent, modal);

        getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));

                panel = new JPanel();

                getContentPane().add(panel);

                /*scrollPane = new JScrollPane(panel);
                getContentPane().add(scrollPane);*/

                panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));

                jPanelCustomerInfo = new JPanel();
                panel.add(jPanelCustomerInfo);
                jPanelCustomerInfo.setBackground(new Color(255, 255, 255));
                jPanelCustomerInfo.setBorder(new CompoundBorder(new LineBorder(new Color(0, 0, 0), 1, true), new EmptyBorder(10, 10, 10, 10)));

                jPanelCustomerInfo.setLayout(new BoxLayout(jPanelCustomerInfo, BoxLayout.Y_AXIS));

                panelNomeDoCliente = new JPanel();
                panelNomeDoCliente.setBorder(new CompoundBorder(new LineBorder(new Color(0, 0, 0), 1, true), new EmptyBorder(10, 10, 10, 10)));
                panelNomeDoCliente.setBackground(Color.LIGHT_GRAY);
                jPanelCustomerInfo.add(panelNomeDoCliente);
                GridBagLayout gbl_panelNomeDoCliente = new GridBagLayout();
                gbl_panelNomeDoCliente.columnWidths = new int[]{73, 376, 45, 53, 0};
                gbl_panelNomeDoCliente.rowHeights = new int[]{31, 0};
                gbl_panelNomeDoCliente.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
                gbl_panelNomeDoCliente.rowWeights = new double[]{0.0, Double.MIN_VALUE};
                panelNomeDoCliente.setLayout(gbl_panelNomeDoCliente);

                panelDadosDoCliente = new JPanel();
                panelDadosDoCliente.setBorder(new CompoundBorder(new LineBorder(new Color(0, 0, 0), 1, true), new EmptyBorder(10, 10, 10, 10)));
                panelDadosDoCliente.setBackground(Color.WHITE);
                jPanelCustomerInfo.add(panelDadosDoCliente);
                GridBagLayout gbl_panelDadosDoCliente = new GridBagLayout();
                gbl_panelDadosDoCliente.columnWidths = new int[]{58, 199, 38, 102, 27, 123, 0};
                gbl_panelDadosDoCliente.rowHeights = new int[]{0, 14, 0};
                gbl_panelDadosDoCliente.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
                gbl_panelDadosDoCliente.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
                panelDadosDoCliente.setLayout(gbl_panelDadosDoCliente);

                jPanelCustomerAddresses = new JPanel();

                scrollPane = new JScrollPane(jPanelCustomerAddresses);
                getContentPane().add(scrollPane);

                //panel.add(jPanelCustomerAddresses);
                jPanelCustomerAddresses.setBackground(new Color(255, 255, 255));
                jPanelCustomerAddresses.setBorder(new CompoundBorder(new LineBorder(new Color(0, 0, 0), 1, true), new EmptyBorder(10, 10, 10, 10)));
                jPanelCustomerAddresses.setLayout(new BoxLayout(jPanelCustomerAddresses, BoxLayout.Y_AXIS));

                panelAbaixoDeCustomerAddresses = new JPanel();
                panelAbaixoDeCustomerAddresses.setBorder(new LineBorder(new Color(0, 0, 0), 1, true));
                jPanelCustomerAddresses.add(panelAbaixoDeCustomerAddresses);
                panelAbaixoDeCustomerAddresses.setLayout(new BoxLayout(panelAbaixoDeCustomerAddresses, BoxLayout.Y_AXIS));

                panelTituloEnderecos = new JPanel();
                panelTituloEnderecos.setBorder(new LineBorder(new Color(0, 0, 0), 1, true));
                FlowLayout fl_panelTituloEnderecos = (FlowLayout) panelTituloEnderecos.getLayout();
                fl_panelTituloEnderecos.setAlignment(FlowLayout.LEFT);
                panelTituloEnderecos.setBackground(Color.LIGHT_GRAY);
                panelAbaixoDeCustomerAddresses.add(panelTituloEnderecos);

                lblEnderecos = new JLabel("Endereço");
                panelTituloEnderecos.add(lblEnderecos);

                        panelContendoOsEnderecos = new JPanel();
                        panelContendoOsEnderecos.setBorder(new CompoundBorder(new LineBorder(new Color(0, 0, 0), 1, true), new EmptyBorder(10, 10, 10, 10)));
                        panelContendoOsEnderecos.setBackground(Color.WHITE);
                        panelAbaixoDeCustomerAddresses.add(panelContendoOsEnderecos);
                        panelContendoOsEnderecos.setLayout(new BoxLayout(panelContendoOsEnderecos, BoxLayout.Y_AXIS));

                        jPanelCustomerOrders = new JPanel();
                        panel.add(jPanelCustomerOrders);

                        txtarea_1 = new JTextField();
                        txtarea_1.setText("Área 3");
                        jPanelCustomerOrders.add(txtarea_1);
                        txtarea_1.setColumns(10);

        initComponents();
        pack();
        setLocationRelativeTo(parent);

        LoadCustomerDataWorker worker = new LoadCustomerDataWorker(this);
        ExecutorService singleThreadPool = Executors.newSingleThreadExecutor();
        singleThreadPool.execute(worker);
    }

    public void addCustomerAddresses(List<CustomerAddress> customerAddresses) {
        Objects.requireNonNull(customerAddresses);

        DefaultListModel<CustomerAddress> listModel = new DefaultListModel<>();
        for (CustomerAddress customerAddress : customerAddresses) {
            listModel.addElement(customerAddress);
        }

        jListCustomerAddresses = new JList<>(listModel);
        jListCustomerAddresses.setCellRenderer(new PanelIndividualCustomerAddress());
        jListCustomerAddresses.setVisibleRowCount(2);
        panelContendoOsEnderecos.add(jListCustomerAddresses);

        pack();
    }

    private void initComponents() {
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Ver Cliente");
    }
}

LoadCustomerDataWorker.java
package testdialog;
import java.util.ArrayList;
import java.util.List;

import javax.swing.SwingWorker;

import testdialog.JDViewCustomer;
import testdialog.CustomerAddress;

public class LoadCustomerDataWorker extends SwingWorker<Void, Void> {

    private final JDViewCustomer dialog;
    private List<CustomerAddress> customerAddresses = null;

    public LoadCustomerDataWorker(JDViewCustomer dialog) {
        this.dialog = dialog;
    }

    @Override
    protected Void doInBackground() throws Exception {
        customerAddresses = new ArrayList<>();
        customerAddresses.add(new CustomerAddress("1. Casa"));
        customerAddresses.add(new CustomerAddress("2. Trabalho"));
        customerAddresses.add(new CustomerAddress("3. Casa"));
        customerAddresses.add(new CustomerAddress("4. Trabalho"));

        return null;
    }

    @Override
    protected void done() {
        if (customerAddresses != null && customerAddresses.size() > 0) {
            dialog.addCustomerAddresses(customerAddresses);
        }
    }
}

PanelIndividualCustomerAddress.java
package testdialog;

import java.awt.Color;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.ListCellRenderer;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;

import testdialog.CustomerAddress;

public class PanelIndividualCustomerAddress implements ListCellRenderer<CustomerAddress> {

    @Override
    public Component getListCellRendererComponent(JList<? extends CustomerAddress> list, CustomerAddress value, int index, boolean isSelected,
            boolean cellHasFocus) {

        JPanel panelEnderecoIndividual = new JPanel();
        panelEnderecoIndividual.setBorder(new CompoundBorder(new LineBorder(new Color(0, 0, 0), 1, true), new EmptyBorder(3, 3, 3, 3)));
        panelEnderecoIndividual.setBackground(Color.WHITE);
        panelEnderecoIndividual.setLayout(new BoxLayout(panelEnderecoIndividual, BoxLayout.Y_AXIS));

        JPanel panelTituloEndereco = new JPanel();
        panelTituloEndereco.setBorder(new CompoundBorder(new LineBorder(new Color(0, 0, 0), 1, true), new EmptyBorder(10, 10, 10, 10)));
        FlowLayout fl_panelTituloEndereco = (FlowLayout) panelTituloEndereco.getLayout();
        fl_panelTituloEndereco.setAlignment(FlowLayout.LEFT);
        panelTituloEndereco.setBackground(new Color(220, 220, 220));
        panelEnderecoIndividual.add(panelTituloEndereco);

        JLabel lblCasa = new JLabel(value.getTitle()); // "Casa"
        panelTituloEndereco.add(lblCasa);

        JPanel panelDadosDoEndereco = new JPanel();
        panelDadosDoEndereco.setBorder(new CompoundBorder(new LineBorder(new Color(0, 0, 0), 1, true), new EmptyBorder(10, 10, 10, 10)));
        panelDadosDoEndereco.setBackground(Color.WHITE);
        panelEnderecoIndividual.add(panelDadosDoEndereco);
        GridBagLayout gbl_panelDadosDoEndereco = new GridBagLayout();
        gbl_panelDadosDoEndereco.columnWidths = new int[]{83, 184, 68, 102, 65, 134, 0};
        gbl_panelDadosDoEndereco.rowHeights = new int[]{0, 0, 20, 0};
        gbl_panelDadosDoEndereco.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
        gbl_panelDadosDoEndereco.rowWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
        panelDadosDoEndereco.setLayout(gbl_panelDadosDoEndereco);

        JLabel lblEndereco = new JLabel("Endereço:");
        lblEndereco.setFont(new Font("Tahoma", Font.BOLD, 11));
        GridBagConstraints gbc_lblEndereo = new GridBagConstraints();
        gbc_lblEndereo.anchor = GridBagConstraints.WEST;
        gbc_lblEndereo.insets = new Insets(0, 0, 5, 5);
        gbc_lblEndereo.gridx = 0;
        gbc_lblEndereo.gridy = 0;
        panelDadosDoEndereco.add(lblEndereco, gbc_lblEndereo);

        JLabel lblNomeDaRua = new JLabel("Nome da rua");
        GridBagConstraints gbc_lblNomeDaRua = new GridBagConstraints();
        gbc_lblNomeDaRua.anchor = GridBagConstraints.WEST;
        gbc_lblNomeDaRua.gridwidth = 3;
        gbc_lblNomeDaRua.insets = new Insets(0, 0, 5, 5);
        gbc_lblNomeDaRua.gridx = 1;
        gbc_lblNomeDaRua.gridy = 0;
        panelDadosDoEndereco.add(lblNomeDaRua, gbc_lblNomeDaRua);

        JLabel lblNumero = new JLabel("Número:");
        lblNumero.setFont(new Font("Tahoma", Font.BOLD, 11));
        GridBagConstraints gbc_lblNumero = new GridBagConstraints();
        gbc_lblNumero.anchor = GridBagConstraints.WEST;
        gbc_lblNumero.insets = new Insets(0, 0, 5, 5);
        gbc_lblNumero.gridx = 4;
        gbc_lblNumero.gridy = 0;
        panelDadosDoEndereco.add(lblNumero, gbc_lblNumero);

        JLabel lblValorDoNumero = new JLabel("Valor do número");
        GridBagConstraints gbc_lblValorDoNumero = new GridBagConstraints();
        gbc_lblValorDoNumero.anchor = GridBagConstraints.WEST;
        gbc_lblValorDoNumero.insets = new Insets(0, 0, 5, 0);
        gbc_lblValorDoNumero.gridx = 5;
        gbc_lblValorDoNumero.gridy = 0;
        panelDadosDoEndereco.add(lblValorDoNumero, gbc_lblValorDoNumero);

        JLabel lblComplemento = new JLabel("Complemento:");
        lblComplemento.setFont(new Font("Tahoma", Font.BOLD, 11));
        GridBagConstraints gbc_lblComplemento = new GridBagConstraints();
        gbc_lblComplemento.anchor = GridBagConstraints.WEST;
        gbc_lblComplemento.insets = new Insets(0, 0, 5, 5);
        gbc_lblComplemento.gridx = 0;
        gbc_lblComplemento.gridy = 1;
        panelDadosDoEndereco.add(lblComplemento, gbc_lblComplemento);

        JLabel lblTextoDoComplemento = new JLabel("Texto do complemento");
        GridBagConstraints gbc_lblTextoDoComplemento = new GridBagConstraints();
        gbc_lblTextoDoComplemento.anchor = GridBagConstraints.WEST;
        gbc_lblTextoDoComplemento.insets = new Insets(0, 0, 5, 5);
        gbc_lblTextoDoComplemento.gridx = 1;
        gbc_lblTextoDoComplemento.gridy = 1;
        panelDadosDoEndereco.add(lblTextoDoComplemento, gbc_lblTextoDoComplemento);

        JLabel lblBairro = new JLabel("Bairro:");
        lblBairro.setFont(new Font("Tahoma", Font.BOLD, 11));
        GridBagConstraints gbc_lblBairro = new GridBagConstraints();
        gbc_lblBairro.anchor = GridBagConstraints.WEST;
        gbc_lblBairro.insets = new Insets(0, 0, 5, 5);
        gbc_lblBairro.gridx = 2;
        gbc_lblBairro.gridy = 1;
        panelDadosDoEndereco.add(lblBairro, gbc_lblBairro);

        JLabel lblNomeDoBairro = new JLabel("Nome do bairro");
        GridBagConstraints gbc_lblNomeDoBairro = new GridBagConstraints();
        gbc_lblNomeDoBairro.anchor = GridBagConstraints.WEST;
        gbc_lblNomeDoBairro.insets = new Insets(0, 0, 5, 5);
        gbc_lblNomeDoBairro.gridx = 3;
        gbc_lblNomeDoBairro.gridy = 1;
        panelDadosDoEndereco.add(lblNomeDoBairro, gbc_lblNomeDoBairro);

        JLabel lblCidade = new JLabel("Cidade:");
        lblCidade.setFont(new Font("Tahoma", Font.BOLD, 11));
        GridBagConstraints gbc_lblCidade = new GridBagConstraints();
        gbc_lblCidade.anchor = GridBagConstraints.WEST;
        gbc_lblCidade.insets = new Insets(0, 0, 5, 5);
        gbc_lblCidade.gridx = 4;
        gbc_lblCidade.gridy = 1;
        panelDadosDoEndereco.add(lblCidade, gbc_lblCidade);

        JLabel lblNomeDaCidade = new JLabel("Nome da cidade");
        GridBagConstraints gbc_lblNomeDaCidade = new GridBagConstraints();
        gbc_lblNomeDaCidade.anchor = GridBagConstraints.WEST;
        gbc_lblNomeDaCidade.insets = new Insets(0, 0, 5, 0);
        gbc_lblNomeDaCidade.gridx = 5;
        gbc_lblNomeDaCidade.gridy = 1;
        panelDadosDoEndereco.add(lblNomeDaCidade, gbc_lblNomeDaCidade);

        JLabel lblCep = new JLabel("CEP:");
        lblCep.setFont(new Font("Tahoma", Font.BOLD, 11));
        GridBagConstraints gbc_lblCep = new GridBagConstraints();
        gbc_lblCep.anchor = GridBagConstraints.WEST;
        gbc_lblCep.insets = new Insets(0, 0, 0, 5);
        gbc_lblCep.gridx = 0;
        gbc_lblCep.gridy = 2;
        panelDadosDoEndereco.add(lblCep, gbc_lblCep);

        JLabel lblNumeroDoCep = new JLabel("Número do CEP");
        GridBagConstraints gbc_lblNumeroDoCep = new GridBagConstraints();
        gbc_lblNumeroDoCep.anchor = GridBagConstraints.WEST;
        gbc_lblNumeroDoCep.insets = new Insets(0, 0, 0, 5);
        gbc_lblNumeroDoCep.gridx = 1;
        gbc_lblNumeroDoCep.gridy = 2;
        panelDadosDoEndereco.add(lblNumeroDoCep, gbc_lblNumeroDoCep);

        JLabel lblPontoRef = new JLabel("Ponto ref.:");
        lblPontoRef.setFont(new Font("Tahoma", Font.BOLD, 11));
        GridBagConstraints gbc_lblPontoRef = new GridBagConstraints();
        gbc_lblPontoRef.anchor = GridBagConstraints.WEST;
        gbc_lblPontoRef.insets = new Insets(0, 0, 0, 5);
        gbc_lblPontoRef.gridx = 2;
        gbc_lblPontoRef.gridy = 2;
        panelDadosDoEndereco.add(lblPontoRef, gbc_lblPontoRef);

        JLabel lblPertoDeTalLugar = new JLabel("Perto de tal lugar");
        GridBagConstraints gbc_lblPertoDeTalLugar = new GridBagConstraints();
        gbc_lblPertoDeTalLugar.anchor = GridBagConstraints.WEST;
        gbc_lblPertoDeTalLugar.gridwidth = 3;
        gbc_lblPertoDeTalLugar.gridx = 3;
        gbc_lblPertoDeTalLugar.gridy = 2;
        panelDadosDoEndereco.add(lblPertoDeTalLugar, gbc_lblPertoDeTalLugar);

        return panelEnderecoIndividual;
    }
}

A: setVisibleRowCount() only works if the JList is the view of a JScrollPane (that is, the main child of the JScrollPane). In your program, the JScrollPane's view is a JPanel, not a JList.


text:
Q: Sending Serialized Data Basically I am doing some networking with a client and server sending "packets" back and forth to each other. I have it working with basic variable data such as ints or strings passing back and forth, however now I want to pass an object.
So I know I have to serialize the data of the object to pass it through the socket. That is working as well (as I can get the correct information if I serialize then de-serialize right away) but the problem comes in when my server receives a packet.
My server interprets packet data based on the first 2 characters of the packet. So 01foobar is a type of packet correlating to whatever "01" is assigned to and 02foobar is a different packet as well. So I don't know the best way to do this with an object attached. What is mean is this...
The way I have tried to do it right now is, serialize my object and get it's string. Then append on 03 to the front. So basically I have a string that looks like 03[B@3e9513b7 (or whatever) then do getBytes() on that string which gives me another byte[] (so I can send it through the socket). Then when the server receives that information, I can append the 03 off and I'm left with just [B@3e9513b7. The problem is, [B@3e9513b7 is now a string, and not a byte[] and in order to deserialize I need to send it the same byte[] as it gave me when it serialized that data. So that got me looking into a way to make [B@3e9513b7 BE the byte[] (aka, so when I do toString() on that new byte[] it returns [B@3e9513b7) but was having issues assigning it like that because it would give me a new byte[] for [B@3e9513b7 as a string. So obviously then, when I send it to be deserialized it has a byte[] that it doesn't know what to do with and throws an error.
So I have to imagine there's a better way to do this, and I'm just making things more complicated than they should be. Any recommendations? I can provide code snippets if needed.
Thanks guys!
Edit: I guess I should mention that I am using Java with using UDP sockets.

A: If you are looking for a reliable and efficient solution for client-server communication, I would suggest to look at Netty.
Regarding how to serialize/deserialize your objects, you have many choices as Java serialization, XML, JSON ...
You would have to pass your serialized objects in UDP datagrams. However, be aware that UDP datagram size is limited. If you're exchanging big objects, you may want to switch to TCP transport which is more reliable.
You may also want to look at SOAP/REST web services.


text:
Q: I cannot solve the system of equations, using the solve function? f[x_]:=a*Sin[b*(x+c)]+d;
g[x_]:=-1/10125*Exp[4]*x^3+17/1350*Exp[4]*x^2-79/135*Exp[4]*x+90+Exp[1]+(1343/162+Log[2]-Log[3])*Exp[4];
h:=38;
Solve[{f[h]==g[h], f'[h]==g'[h], f''[h]==g''[h], f'''[h]==g'''[h]},{a,b,c,d}]

I want to use the functions defined at the top and evaluate it so that the derivatives match for both functions. I want to use those evaluated functions to solve for a,b,c and d in f(x).
It does not work, says something about being protected, and h:=38, doesn't work because it is "not a variable" apparently.
Could you please help me, I'm a beginner, and am supposed to use Wolfram Language for the assignment.
I'm using WolframCloud, could that be a problem?

A: First, you should simply type Quit[] and execute, then copy and paste the code you gave us in a new notepad. Generaly when you're getting "protected errors" a variable has been definied already as something else.
If all else fails and you're not sure what's going on, try restarting :)
f[x_] := a*Sin[b*(x + c)] + d;
g[x_] := -1/10125*Exp[4]*x^3 + 17/1350*Exp[4]*x^2 - 79/135*Exp[4]*x +
   90 + Exp[1] + (1343/162 + Log[2] - Log[3])*Exp[4];
h := 38;
Solve[{f[h] == g[h], f'[h] == g'[h], f''[h] == g''[h],
  f'''[h] == g'''[h]}, {a, b, c, d}]

Using this code exactly gives me a solution....albeit a huge one with conditionals.
$$ \left\{\left\{a\to \text{ConditionalExpression}\left[\frac{1}{250} (-21) i \sqrt{33} e^4,c_1\in \mathbb{Z}\right],b\to \text{ConditionalExpression}\left[-\frac{1}{3} i \sqrt{\frac{2}{21}},c_1\in \mathbb{Z}\right],c\to \text{ConditionalExpression}\left[\frac{126 i \pi  c_1-38 \sqrt{42}-126 \tanh ^{-1}\left(\frac{1}{3} \left(\sqrt{42}-\sqrt{33}\right)\right)}{\sqrt{42}},c_1\in \mathbb{Z}\right],d\to \text{ConditionalExpression}\left[\frac{21}{250} e^4 \sqrt{33} \sinh \left(\frac{1}{3} \sqrt{\frac{2}{21}} \left(38+\frac{126 i \pi  c_1-38 \sqrt{42}-126 \tanh ^{-1}\left(\frac{1}{3} \left(\sqrt{42}-\sqrt{33}\right)\right)}{\sqrt{42}}\right)\right)-\frac{887 e^4}{750}+e+90+e^4 \log (2)-e^4 \log (3),c_1\in \mathbb{Z}\right]\right\},\left\{a\to \text{ConditionalExpression}\left[\frac{1}{250} (-21) i \sqrt{33} e^4,c_1\in \mathbb{Z}\right],b\to \text{ConditionalExpression}\left[\frac{1}{3} i \sqrt{\frac{2}{21}},c_1\in \mathbb{Z}\right],c\to \text{ConditionalExpression}\left[\frac{-126 i \pi  c_1-38 \sqrt{42}+126 \tanh ^{-1}\left(\frac{1}{3} \left(-\sqrt{33}-\sqrt{42}\right)\right)}{\sqrt{42}},c_1\in \mathbb{Z}\right],d\to \text{ConditionalExpression}\left[-\frac{21}{250} \sqrt{33} e^4 \sinh \left(\frac{1}{3} \sqrt{\frac{2}{21}} \left(38+\frac{-126 i \pi  c_1-38 \sqrt{42}+126 \tanh ^{-1}\left(\frac{1}{3} \left(-\sqrt{33}-\sqrt{42}\right)\right)}{\sqrt{42}}\right)\right)-\frac{887 e^4}{750}+e+90+e^4 \log (2)-e^4 \log (3),c_1\in \mathbb{Z}\right]\right\},\left\{a\to \text{ConditionalExpression}\left[\frac{21}{250} i \sqrt{33} e^4,c_1\in \mathbb{Z}\right],b\to \text{ConditionalExpression}\left[-\frac{1}{3} i \sqrt{\frac{2}{21}},c_1\in \mathbb{Z}\right],c\to \text{ConditionalExpression}\left[\frac{126 i \pi  c_1-38 \sqrt{42}-126 \tanh ^{-1}\left(\frac{1}{3} \left(\sqrt{33}+\sqrt{42}\right)\right)}{\sqrt{42}},c_1\in \mathbb{Z}\right],d\to \text{ConditionalExpression}\left[-\frac{21}{250} \sqrt{33} e^4 \sinh \left(\frac{1}{3} \sqrt{\frac{2}{21}} \left(38+\frac{126 i \pi  c_1-38 \sqrt{42}-126 \tanh ^{-1}\left(\frac{1}{3} \left(\sqrt{33}+\sqrt{42}\right)\right)}{\sqrt{42}}\right)\right)-\frac{887 e^4}{750}+e+90+e^4 \log (2)-e^4 \log (3),c_1\in \mathbb{Z}\right]\right\},\left\{a\to \text{ConditionalExpression}\left[\frac{21}{250} i \sqrt{33} e^4,c_1\in \mathbb{Z}\right],b\to \text{ConditionalExpression}\left[\frac{1}{3} i \sqrt{\frac{2}{21}},c_1\in \mathbb{Z}\right],c\to \text{ConditionalExpression}\left[\frac{-126 i \pi  c_1-38 \sqrt{42}+126 \tanh ^{-1}\left(\frac{1}{3} \left(\sqrt{33}-\sqrt{42}\right)\right)}{\sqrt{42}},c_1\in \mathbb{Z}\right],d\to \text{ConditionalExpression}\left[\frac{21}{250} e^4 \sqrt{33} \sinh \left(\frac{1}{3} \sqrt{\frac{2}{21}} \left(38+\frac{-126 i \pi  c_1-38 \sqrt{42}+126 \tanh ^{-1}\left(\frac{1}{3} \left(\sqrt{33}-\sqrt{42}\right)\right)}{\sqrt{42}}\right)\right)-\frac{887 e^4}{750}+e+90+e^4 \log (2)-e^4 \log (3),c_1\in \mathbb{Z}\right]\right\}\right\}$$

A: It seems you have already defined function f[x] or g[x] somewhere. The "protected error" comes in set delayed form when it is already defined. The simplest solution is to Clear the variable you want to use in your code. You can simply use ClearAll["Global`*"] to clear all the variables. After that, your code will run. Updated code will be:
ClearAll["Global`*"]
f[x_] := a*Sin[b (x + c)] + d
g[x_] := -1/10125*Exp[4]*x^3 + 17/1350*Exp[4]*x^2 - 79/135*Exp[4]*x +
   90 + Exp[1] + (1343/162 + Log[2] - Log[3])*Exp[4];
h := 38;
Solve[{f[h] == g[h], f'[h] == g'[h], f''[h] == g''[h],
   f'''[h] == g'''[h]}, {a, b, c, d}];


text:
Q: Adding random number to uploaded file in PHP I have my upload php code where my intent is , obtained file from $_files,
add a random number between 0 and 9999 to the name of image like this:
image sent : image.jpg
before saving : image321.jpg
the image is saved in my upload folder but the filename are like
"php2983204tmp"
if ($file !== null) {
    $rand = rand(0000,9999);
    $path = "some_path";

    $file_name = $file->getClientOriginalName(); // file
    $extension = $file->getClientOriginalExtension(); // jpg

    $file->move($path, $file_name.$rand.$extension);

    $response = "File loaded successfully: " . $file_name.$extension;
    $response .= '
size: ' . filesize($path . '/' . $file->getClientOriginalName()) / 1024 . ' kb';

    return new Response($response);

any ideas to fix?

A: The filename in your example is php and your extension is tmp. None of them have the . that you are missing.
You need to add the dot . as a string after the $file_name and $rand, before the $extension like this:
$file->move($path, $file_name.$rand. "." .$extension);

A: You need add in the desired chars to the actual string.
$file->move($path, $file_name.$rand.".".$extension);

But I have to say, I am against how you've done this, you don't even check if the "newly" created string already exists in the directory. Its better to hash the time of upload with the original filename, rename the file to the new hash and use a database to point to the file as this way the filename collisions don't occur.
$fn = md5(microtime(true) . $extension  . $file_name);

$file->move($path, $fn);

A: TIME is always unique identity, use it as below (maybe helpful):
             if ($file !== null) {
                $rand = rand(0000,9999).time();
                $path = "some_path";
                $file_name = $file->getClientOriginalName(); // file
                $extension = $file->getClientOriginalExtension(); // jpg
                $file->move($path, $file_name.$rand.$extension);
                $response = "File loaded successfully: " . $file_name.$extension;
                $response .= '
size: ' . filesize($path . '/' . $file->getClientOriginalName()) / 1024 . ' kb';
            return new Response($response);


text:
Q: Animation in Canvas with React plays in an instant then vanishes I have a 320x40 .png file that I am trying to play each animation from inside of my canvas, for a total of 10 frames. Each individual animation frame is a 32x40 section of the png file. I'll cut to the chase and show the png animation code for the character:
export default function SpriteAni(ctx, charAnim, currentFrame) {

    const charSprite = new Image();
    charSprite.src = `./images/char_${charAnim}.png`

    const posx = 320;
    const posy = 200;
    const sheet_width = 32;
    const sheet_height = 40;
    const sprite_width = sheet_width * 1.5;
    const sprite_height = sheet_height * 1.5;

    ctx.drawImage(charSprite, currentFrame * sheet_width, 0, sheet_width, sheet_height, posx, posy, sprite_width * 1.5, sprite_height * 1.5);

}

Here's the relevant code for drawing this to the screen inside of my main Canvas.jsx file

import { useEffect, useRef, useState } from "react";
import SpriteAni from '../SpriteAni.jsx';

// Canvas and game logic for display

const Canvas = ({ width, height }) => {

    const canvasRef = useRef(null);
    const requestIdRef = useRef(null);

    let frame = 0;  // frames canvas is drawn to screen

    const [currentFrame, setCurrentFrame] = useState(0); // used to determine current frame for current Wario animation
    const [charAnim, setCharAnim] = useState('walk')

    // Char animation frame counts
    const walk_frames = 9;

    const drawFrame = () => {

        const ctx = canvasRef.current.getContext('2d');

        /// clear screen each frame
        ctx.clearRect(0,0,constants.CANVAS_WIDTH,constants.CANVAS_HEIGHT);

        // draw graphics
        handleBackground(ctx);
        SpriteAni(ctx, charAnim, currentFrame);

        if (currentFrame >= walk_frames) setCurrentFrame(0);
        else setCurrentFrame(currentFrame + 1);

    }

    const tick = () => {
        if (!canvasRef.current) return;
        drawFrame();
        frame++;
        requestAnimationFrame(tick)
    }

    useEffect(() => {

        requestIdRef.current = requestAnimationFrame(tick)

        return () => {
            cancelAnimationFrame(requestIdRef.current)
        };
    }, [])

    return (
        <canvas
            width={width}
            height={height}
            style={canvasStyle}
            ref={canvasRef}
             />
    )
}

export default Canvas

const canvasStyle = {
    border: "1px solid black",
    position: "absolute",
}

What I'm especially confused about is I can delete all of the "if (currentFrame >= ${charAnim}_frames)..." code underneath SpriteAni in the drawFrame function and nothing changes. It seems to all be acting independently of any of that and just races through all 10 frames before vanishing off of the screen within one second. I don't even understand how that's possible since the only function inside of SpriteAni is a drawImage of which the only variable that should be updating each frame is currentFrame.
How is it animating anything independently like that? I'm just baffled what's going on here! Any help greatly appreciated!


text:
Q: What is the conjugate function of products? Suppose I have following function $f(x) = \pi_{i=1}^nx_i$, that is the function is product of all $x_i$. For example, in 2d case, $f(x) = x_1x_2$. I am just wondering whether anyone can help me find the conjugate function of it.
calculating derivating of $y^tx-x_1x_2$ w.r. to $x_1$ and setting it zero gives me $x_2=y_1$ and similarly $x_1 = y_2$, and so my answer is $f^*=y_1y_2$, but don't know if I did it right.

A: Assuming your domain is $\mathbb{R}^n$.
Let's consider the case where $n=1$.
Let's consider optimization of $xy-x=x(y-1)$ where $y$ is fixed and $x$ is the variable. If $y \ne 1$, we let $x=k(y-1)$ and we can see that we can let $k$ be arbitrarily large.
Hence $$f^*(y)= \begin{cases} \infty &, y \ne 1 \\ 0 &, y=1\end{cases}$$
Now, suppose $n > 1$, $$f^*(y) = \sup_x \{\sum x_iy_i - \prod_{i=1} x_i \}$$
Suppose $y \ne 0$, in particular, we pick an index $j$, such that $y_j \ne 0$,
Let $$x_i = \begin{cases} 0 &, i\ne j \\ ky_j &, i=j\end{cases}$$
Then again, we can let $k$ be arbitarily large.
Also, if $y=0$, we can let $x=(-k, 1, \ldots, 1)$, and $k$ can be arbitrarily large.
$$f^*(y)=\infty$$


text:
Q: OpenLDAP: ACLs using sockname and DN? In OpenLDAP (2.4.45, on FreeBSD), I'm trying to constrain the access of a DN to an attribute, by giving a DN access only when the connection is made via a socket; but without success.
What I'm trying is
olcAccess: to attrs=userPassword
  by dn.base="uid=pwreset,ou=service,dc=example,dc=edu"
     sockname.exact="/var/run/openldap/ldapi"
  write

(the idea is that the pwreset DN can be used by an automatic password-reset script, but that that DN will have that access only when the script is running on the same machine as the LDAP server).
This by phrase appears to match the production in Sect. 8.3 of the OpenLDAP access control documentation, and the remark in slapd.access(5) that the items in the <who> field 'may be specified in combination'.  And indeed there are no syntax warnings generated.  I'm presuming that the combination implies an AND rather than an OR – this isn't made explicit in the documentation.  I can find no examples covering this in either OpenLDAP documentation or on the web.
This stanza works when the sockname element is absent, suggesting that the configuration is otherwise working as I expect.
When I try to write the userPassword attribute using this DN, I get an ldap_modify: Insufficient access (50) error.
The OpenLDAP documentation doesn't (somewhat surprisingly) explicitly state what the effect of this sockname element is, and the slapd.access(5) page says, rather obliquely, that:

The statements peername=<peername>, sockname=<sockname>, domain=<domain>, and sockurl=<sockurl> mean that the contacting host IP (in the form IP=<ip>:<port> for IPv4, or IP=[<ipv6>]:<port> for IPv6) or the contacting host named pipe file name (in the form PATH=<path> if connecting through a named pipe) for peername, the named pipe file name for sockname, the contacting host name for domain, and the contacting URL for sockurl are compared against pattern to determine access.

That doesn't actually say very much.
Have I completely misunderstood the point of this access specification, or is there another way to do this?

A: The correct syntax (for this version of OpenLDAP, at least) is:
olcAccess: to attrs=userPassword
  by dn.base="uid=pwreset,ou=service,dc=example,dc=edu"
     sockname.exact="PATH=/var/run/openldap/ldapi"
     write

Thanks to Quanah Gibson-Mount on the openldap-technical list for pointing to the solution.


text:
Q: Visual Studio Publish profile settings for Single Page App on Azure I want to publish my single page app to Azure. I have created the App Service, App Service Plan and downloaded the publish profile settings on my local. Now I can use FTP to publish it to Azure. But I am wondering if there is a way I can configure this in the my Visual Studio similar to what we do when publishing a .Net application (MVC or Web API) as shown below in the snapshot.

My single page application is not part of the solution. This is how the structure of my projects look like.

It has one .Net Core Web API project and one Single Page App created in Vue.js. I can publish the Web API project from the Visual Studio but not the SPA. Any help with this please?

A: Per my knowledge, it is impossible to publish it in Visual Studio similar to what we do when publishing a .Net application. There is no Publish... option for us to choose.
As a workaround, we can upload our SPA project to Azure web app via KuDu.
More information about KuDu, we can refer to: Using KUDU with Microsoft Azure Web Apps
We just need to drag the SPA project into KUDU under wwwroot folder as below:


text:
Q: maven surefire reports in default lifecyle How can i generate surefire reports in the maven's default lifecycle. We have jobs setup in teamcity with goals as
mvn clean install -Pprod

This job runs all the junits, i want to create HTML report of all the tests running in the project. I came across the sure-fire-reports plugin but it generates the report only in site phase it does not generates the report during the default clean install phase.
Can one please help how can i generate report default lifecycle
I tried including the surefire-reports plugin, in test phase as below but doesnot not works
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>report-only</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

A: If you need the very report generated by maven-surefire-report-plugin, I see no other way than execute mvn site, because a report is executed only within the site phase of the build lifecycle.
Instead, if you just need an HTML-readable report, I'd suggest you this walk-around:

*

*Take advantage of the XML files generated by the maven-surefire-plugin in the target/surefire-reports directory.

*Code your own transformation sheet (XSL) to transform them to the desired HTML format.

*In the pom, set a transformation in the next phase (for example, prepare-package) through the xml-maven-plugin.

If you put the XSL in the parent project and set this transformation in the parent pom, all the submodule projects should inherit it and produce the HTML reports during the corresponding build.
And last: How to browse the child HTML reports from the parent project? Hum... I'd say to code an Ant script to browse all the submodules and list the HTML files and produce an HTML index with them. This script should be executed only from the parent project.


text:
Q: How to check if a pointer still points to valid memory in C++? I have a pointer which equals to another pointer
I'd like to check if my pointer equals to a pointer which is not null.
int* ptr0 = new int(5);
int* ptr1 = ptr0;

delete ptr0;

if ( ?? )
{
    std::cout << "ptr1 equals to a null ptr" << std::endl;
}

What should I write in the condition ?
Knowing that:

*

*I don't want to set nullptr any of the ptr's after removal

*I don't have access to ptr0 in my condition

A: Use a shared_ptr<T> combined with a weak_ptr<T>.
For example,
int main() {
    std::tr1::shared_ptr<int> ptr0(new int);
    std::tr1::weak_ptr<int> ptr1_weak(ptr0);

    *ptr0 = 50;

    // Depending on if you reset or not the code below will execute
    //ptr0.reset();

    if (std::tr1::shared_ptr<int> ptr1 = ptr1_weak.lock()) {
        std::cout << "Changing value!" << std::endl;
        *ptr1 = 500;
    }
}

A: You can't. While in theory you could, depending on the implementation of new, check if the memory pointed to is currently in use there's no way to confirm that it's still the same object you were originally pointing to using only raw pointers.
You can use C++11 smart pointers to do something kinda like that, but I really don't think that's what you actually wanna do here.

A: delete does not result in a null pointer. It results in a dangling pointer, which is undetectable in general. So, you cannot.


text:
Q: sqldf in R generating an Error I am trying to merge two tables in R by using the following command:
library(gsubfn)
library(proto)
library(RSQLite)
library(sqldf)
sqldf("SELECT Gender, Pmu.try.Sat.Ltd, Online.Campus.Student, Residency,
           tutorial_avg_score
           FROM A JOIN B
           USING(userID)")

The system generates the following error:
Error in result_create(conn@ptr, statement) : near ".": syntax error

Could anyone kindly advise what could be the issue here? The column names are bit weird but they are very similar to the actual names that I have in the provided data.
I had a look at the following question:
Error in rsqlite_send_query(conn@ptr, statement) : near "(": syntax error
But it does not help me either.
Looking for your kind advice on this!

A: The following solutions resolved the error that I had been facing:
sqldf('SELECT Gender, "Pmu.try.Sat.Ltd", "Online.Campus.Student", Residency,
       tutorial_avg_score
       FROM A JOIN B
       USING(userID)')

OR
sqldf('SELECT Gender, `Pmu.try.Sat.Ltd`, `Online.Campus.Student`, Residency,
       tutorial_avg_score
       FROM A JOIN B
       USING(userID)')

OR
sqldf('SELECT Gender, [Pmu.try.Sat.Ltd], [Online.Campus.Student], Residency,
       tutorial_avg_score
       FROM A JOIN B
       USING(userID)')

Many thanks @G. Grothendieck for your kind comments!


text:
Q: How to filter rows in one table with values from joined table products
| id |
------
|  1 |
|  2 |

attributes
| product_id |           value |
--------------------------------
|          1 | Needed value #1 |
|          1 | Needed value #2 |
|          2 | Needed value #1 |

I need to select a product that has both Needed value #1 and Needed value #2. Can't get it with join and where clause. It selects every products or no product at all. Are there any method that more elegant than use multiple inner joins?
SELECT * FROM products
INNER JOIN attributes ON products.id = attributes.product_id
WHERE attributes.value IN ('Needed value #1', 'Needed value #2')

SELECT * FROM products
INNER JOIN attributes ON products.id = attributes.product_id
WHERE attributes.value = 'Needed value #1'
OR /* AND */ attributes.value = 'Needed value #2'

A: You cat do something like this:
SELECT * FROM products
INNER JOIN attributes AS a1 ON
    products.id = a1.product_id AND a1.value = 'Needed value #1'
INNER JOIN attributes AS a2 ON
    products.id = a2.product_id AND a2.value = 'Needed value #2'

A: You can do it by grouping by product_id the attributes table:
SELECT * FROM products
WHERE id IN (
  SELECT product_id FROM attributes
  WHERE value IN ('Needed value #1', 'Needed value #2')
  GROUP BY product_id
  HAVING COUNT(DISTINCT value) = 2
)

The condition COUNT(DISTINCT value) = 2 in the HAVING clause makes sure that both attributes exist for this product.


text:
Q: How to open a .csv file in Jupyter notebook from a diffrent path I'm absolute new to python 3. I have the problem that I have a .csv file that is in a different folder than the .ipynb in which I code.
Jupyter Notebook Python 3 location:
C:\Tools\Jupyter\test.ipynb
Data storage location
C:\Users\my.name\OneDrive\python\data\cars.csv
If I place the .csv file directly to the Jupyter location, then opening it with pandas works.
import pandas as pd

df = pd.read_csv("./cars.csv")

Now I tried the following code to use the other location as file path, but it didn't work: "FileNotFoundError:".
import pandas as pd
df = pd.read_csv("C:/Users/my.name/OneDrive/python/data/cars.csv")

How can I open the file?
Sorry for that absolute beginners stuff..
I apriciate your help!


text:
Q: Am I able jump to Kohana? I'm web developer. I'm using PHP! I don't know how many years of experience I have. Let's say - a few. x) I know object-oriented programming as well. So let me as you a question. =]
Can I go to Kohana web site, start to read the docs and, after some weeks of learning it, build my 1st web application using Kohana?
I know that Kohana is HMVC. I don't think that it is big problem, 'couse I just built my own super-simple MVC framework. It's very simple and a few kB's heavy, but I got the idea of MVC. =]
P.S. Just learned basics of PDO too. ^^

A: Yes you can! I've been developing websites as a hobby for only a few years and at work for only half a year. I'm now building my first site using Kohana and it still seems pretty easy.
I must admit I got some experience with other programming languagses, frameworks and design patterns in general, so that might help. ;)

A: depends, i came from php4 and didn't really touch the level of OOP needed for the php5 kohana framework, i've used classes and functions but the HMVC is a process on it's own to learn, when it comes to Kohana vs YII i'd have to say kohana is easier to pickup.
my only dislike of Kohana is that the documentation is all over the place and outdated and it's not till you try it do you realize you were looking at the version before, ie : 3.0 vs 3.1 is different.. alot.. i'm still getting my head around it

A: Based on the information you've provided (and the fact that each person's rate of learning is different), it's pretty impossible to meaningfully answer this question.
However, I'll go for "yes", as Kohana's a fairly compact framework from what I can recall.
That said, the only way you'll actually know is if you try, irrespective of whatever answers you get.


text:
Q: Blackberry application (sending GPS coordinate to server...) I need to develope a application to send GPS coordinates (each x time) to a server (using Gprs).
Is it a simple task? Is it possible to develope that only with Javascript ? How about MDS? I installed a Visual Studio plugin to MDS.

A: I have created a very similar application but I used the Blackberry JDE plugin for Eclipse rather than the MDS for Visual Studio.  With the JDE Plugin you get a LOT more functionality and access to the API, whereas the MDS is for RAD and doesn't allow you as much control over what's happening.
I'm unsure about doing it with Javascript tho, worth checking out.


text:
Q: What does the multiply sign mean in set A question about set notation. What does the multiply sign here mean?
$$\omega = \times_{i\in N}T_{i}$$

A: That is occasionally used as an alternative for $\prod$, meaning an indexed Cartesian product.
From the Wikipedia article on Cartesian products:

A: Whenever you see a usual symbol you know with a subscript telling you that a variable belongs to a set, it means to carry out that operation on everything with that variable as it's index. You have seen this before likely in the form of summation with big sigma notation. In this case, it means to take the Cartesian product (i.e. form ordered tuples by taking one element from each set) over each of the $T_i$'s.


text:
Q: New Thread.Sleep behaviour under Windows 10 October Update 20H2 So I have thrown together a quick repro to highlight the issue while helping myself to understand what on earth was going on in my main app, after receiving many user reports of sudden slow behaviour out of nowhere after more than a year without issue. An active user of my application pointed out that the problem only came about after a recent Windows update, it led me to verify that it was indeed caused by the October Update 20H2.
using System;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;

namespace SleepRepro
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void startButton_Click(object sender, EventArgs e)
        {
            Stopwatch sw = new Stopwatch();
            sw.Start();
            new Thread(() =>
            {
                Thread.Sleep(5);
                Log("Sleep took " + sw.ElapsedMilliseconds + "ms");
            }).Start();
        }

        public void Log(string str)
        {
            Invoke((MethodInvoker)delegate
            {
                logTextBox.Text += str + Environment.NewLine;
                logTextBox.SelectionStart = logTextBox.Text.Length;
                logTextBox.ScrollToCaret();
            });
        }
    }
}

It appears there is a new loss of precision in Thread.Sleep?

I guess my question is whether or not this is intended behaviour or a bug? Is there some documentation of it somewhere?
Thanks in advance.


text:
Q: How to run Dusk test form URL in Laravel 5.4 I tried to run Dusk from an URL:
Route::get('/test', function()
{

    $_SERVER['argv'] = [];
    Artisan::call('dusk');

});

And I did as suggested in this comment and still cannot run the test from URL.