text:
Q: Android - Context Menu - Exception due to MenuBuilder$MenuAdapter changing without AlertController$RecycleListView receiving a notification I've searched high and low to find an answer to why our application is crashing when a user will click on one Context Menu item and then repeatedly clicks on another.  Here is the stack trace I have, which is all on Android internal classes:
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): FATAL EXCEPTION: main
11-11 15:08:30.904: ERROR/AndroidRuntime(3489): java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(16908808, class com.android.internal.app.AlertController$RecycleListView) with Adapter(class com.android.internal.view.menu.MenuBuilder$MenuAdapter)]
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.widget.ListView.layoutChildren(ListView.java:1550)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.widget.AbsListView.onTouchEvent(AbsListView.java:2192)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.widget.ListView.onTouchEvent(ListView.java:3377)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.View.dispatchTouchEvent(View.java:3766)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1720)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1117)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.app.Dialog.dispatchTouchEvent(Dialog.java:642)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1704)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1794)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.os.Looper.loop(Looper.java:143)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at android.app.ActivityThread.main(ActivityThread.java:4701)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at java.lang.reflect.Method.invokeNative(Native Method)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at java.lang.reflect.Method.invoke(Method.java:521)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-11 15:08:30.904: ERROR/AndroidRuntime(3489):     at dalvik.system.NativeStart.main(Native Method)
11-11 15:08:30.912: WARN/ActivityManager(1261):   Force finishing activity com.pyxismobile.pyxWholesaler.ui.activity/.GNBActivity
11-11 15:08:30.943: WARN/WindowManager(1261): No window to dispatch pointer action 1
11-11 15:08:30.943: WARN/WindowManager(1261): No window to dispatch pointer action 0
11-11 15:08:30.943: WARN/WindowManager(1261): No window to dispatch pointer action 1

The basic design we have is on an Activity class we override the onCreateContextMenu and onContextMenuItem.  On the create, the code basically populate a collection of MyMenuItems where each item has a run method to execute whatever we need the menu item to do.  The onContextMenuItem basically takes the ID from the MenuItem passed in, looks up on the collection the given id, and then just runs that run method.
To try and narrow down what the cause is, I've commented out the run portion to do nothing.  This still causes the exception.  I didn't see anything special going between the creation and clicking where we would modify any data.  Everything is done once in the creation.
I tried to create a very simple test app, however I could not get this exception to occur.  I've also briefly looked at the internal Android source code to see if I could figure out anything, but nothing came to light.
If anyone has any suggestions on what I may be doing wrong, or what to look into it would be appreciated.
Edit: I've also determined for this to be device agnostic.  I have been able to recreate on multiple devices, however on rare occasion it does not happen.  My assumption is there is some sort of race condition.

A: Set up a myMenuAdapter.registerDataSetObserver(DataSetObserver observer) (API here) to log when the change occur and try to replicate the error with the phone connected to a PC running adb logcat. That may give you a clue for when it is being modified.
Can it be also that you are initializing again an adapter instead of reusing it?

A: Try not to change the adapter after you add it to ListView.
If you still need to change the contents of ListView during it's use, than set the visibility of your ListView to GONE during adapter update and back to VISIBLE after the update.


text:
Q: Rouché's Theorem with $h(z)=z^3+8z+23$ I've asked a similar question to this one, and got a nice answer, but now I am struggling with this one.
Rouché's Theorem: If $f(z)$ and $(g(z)$ are analytic on and inside the contour $C$ and $|f(z)|>|g(z)|$ for all $z$ on C, then $f(z)$ and $f(z)+g(z)$ have the same number of zeros.
I'm asked to show that $h(z)=z^3+8z+23$ has only one zero inside the contour $C_2(0)=\{z:|z-0|=3\}$. Here is some visual evidence that this is true.

Now, I've tried all kinds of choices for $f(z)$ and $g(z)$, but none of them have worked. For example, if I let $f(z)=8z+23$ and $g(z)=z^3$, then I can write
$$|f(z)|=|8z+23|\ge||8z|-|23||=1$$
for all $z$ on the contour $C_3(0)$. However,
$$|g(z)|=|z^3|=|z|^3=27$$
for all $z$ on the contour $C_3(0)$. Thus, I have not shown that $|f(z)|>|g(z)|$ for all $z$ on the contour $C_2(0)$. Here's another image that shows $|f(z)|$ is not greater that $|g(z)|$ for all $z$ on the contour $C_3(0)$.

So, can someone give me an $f(z)$ and a $g(z)$ such that $|f(z)|>|g(z)|$ for all $z$ on the contour $C_3(0)$? And if so, can you share the strategy you used to find them? Thanks.

A: EDIT: after writing the long proof using Rouché's theorem below, I would like to point out a far easier proof not using Rouché's theorem.
Note that $h(0) = 23$ and $h(-2) = -1$. So $h$ has a zero on $(-2,0)$. Denote it $\beta$. Taking the derivative of $h$ on $\mathbb{R}$, $h'(x) = 3x^2 + 8,$ we see that $h$ has at most one zero on $\mathbb{R}$.  As $h$ has real coefficients, the other two roots must be conjugate. Denote them $\alpha$ and $\overline{\alpha}$. The product of the zeros of $h$ is $-23$, so $|\beta \alpha \overline{\alpha}| = |\beta| |\alpha|^2 = 23$ and as $|\beta| <2$, this forces $|\alpha|^2 > 23/2$, hence $|\alpha| > 3$, completing the proof.

Original answer:
The bounding argument we'll need to do later is rather laborious and difficult to just stumble upon by mistake. So in finding this approach it is immensely helpful to know what we're trying to do before we try to make the bounding argument.
This approach is motivated by trying to shift the zero of $f$ on your graph to $-2$. On the picture, this is a very small shift, which hints to us that it might well be possible to make this shift with an application of Rouché's theorem. Another way of seeing the same motivation without explicitly graphing things is that the $z^3 + 8z$ terms in $z^3 + 8z + 23$ are both real and negative on the negative real axis and so directly cancel the $23$ there. So the negative real axis is a nice place to look to modify $z^3 + 8z + 23$ to get a concrete zero, with the intention of factoring out the zero and getting a manageable quadratic.
Trying out points there shows $(-2)^3 + 8(-2) = -24$. So if we can show that $|h(z)| > 1$ for all points $z = 3e^{i\theta}$, we can apply Rouche's theorem and do polynomial long division and to show that $z^3 + 8z + 23$ and $$z^3 + 8z + 24 = (z-2)(z^2 - 2z + 12)$$ have the same number of zeros in the disk of radius $3$. One can either then use the quadratic formula to find the zeros of $z^2 - 2z + 12$ and note that they're not in the region bounded by $C$ or just observe that as $z^2 -2z + 12$ is a real-coefficient polynomial, it has conjugate roots $\alpha$ and $\overline{\alpha}$ with $|\alpha|^2 = 12 > 9$, so that $|\alpha| > 3$. This will complete the proof once we prove our estimate above.
We show $|z^3 + 8z + 23| > 1$ for all $z \in C$ rather directly. This is tedious, but has no real major insights. By looking at real parts, we can put all points where the real part of $z^3 + 8z$ potentially cancels with $23$ problematically to three intervals spread evenly around the circle. On the intervals not containing $-1$, the real part of $8z$ is positive and $z^3$ has negative real part, eliminating concern there.
The interval of concern containing $\theta = \pi$ is given by $(\frac{8}{9}\pi, \frac{10}{9}\pi)$ and is trickier as the real parts do genuinely cancel out to be $0$ at some point there. On this interval, both $\cos(3\theta)$ and $\cos(\theta)$ are negative and $\sin(3\theta), \sin(\theta)$ always have the same sign. We use some first-order estimates on $\cos$ and $\sin$ coming from the fundamental theorem of calculus on the relevant intervals to give us the necessary bounds.
In particular, on $(\frac{8}{9}\pi, \frac{10}{9}\pi)$ one can quickly show $$| \cos(3(\theta-\pi)) | \geq 1 - 9|\theta-\pi|, \quad |\cos(\theta-\pi)| \geq 1 -|\theta-\pi|, \quad |\sin(3(\theta-\pi))| \geq \frac{3}{2}|\theta-\pi|, \quad |\sin(\theta-\pi)| \geq \frac{3}{4} |\theta-\pi|. $$ So we see that on our interval, \begin{align*} \text{Re}(z^3 + 8z) + 23 &\leq - [27(1- 9|\theta-\pi|) + 8(1-|\theta-\pi|)] +23 = -12 + 251 |\theta-\pi|, \\ |\text{Im}(z^3 + 8z + 23)| &\geq 27 (3/2|\theta-\pi|) + 24/4|\theta-\pi| = \left(\frac{81}{2} + 6\right)|\theta-\pi| \geq 46|\theta-\pi|.
\end{align*} Our first estimate shows us that the real part of $z^3 + 8z + 23$ for $z = 3e^{i\theta}$ in our problem interval has modulus at least $1$ for $|\theta - \pi| < 11/251$. The second estimate shows us that the imaginary part of $z^3 + 8z + 23$ has modulus at least $1$ for $z = r^{ei\theta}$ with $|\theta - \pi| > 1/46$ in our problem interval. As $1/46 < 11/251,$ we are assured that $|z^3 + 8z + 23| > 1$ on our whole problem interval, and the proof is complete.

redpajama_set_name: RedPajamaStackExchange


text:
Q: addressing jsps from jsp submit button changes the request URL i am devloping a Spring Mvc application where i am making a basic login app when i send it to controller it goes fine and display the error page when login fails now when i hit the relogin button which is a submit button i have to give the path as /jsps/Logn.jsp as my jsp are in jsps folder again submitting the request it creates a url as /jsps/Login.do and this does not reach to my controller as it is mapped to /Login.do which goes fine for the first time
can anyone please me with this?
This is my login page
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

    <form action="Login.do">
        Enter Login Details

        UserName::  <input type="text" name = "username">

        Password::  <input type="password" name = "password">

        <input type= "submit" value = "Login">
    </form>

this is my error page
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

Error While logging in please try again
`enter code here`
<form action = "jsps/Login.jsp">
<input type = "submit" value  = "try again">
</form>

this is my controller code
package controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("/Login.do")
public class LoginController {

    @RequestMapping("/Login.do")
    public ModelAndView checkLoginDetails(HttpServletRequest request , HttpServletResponse response){

        if(request.getParameter("username") != null && request.getParameter("password") != null){

        if(request.getParameter("username").equalsIgnoreCase("admin") && request.getParameter("password").equalsIgnoreCase("admin")){
            return new ModelAndView("Home" );
        }else{
            return new ModelAndView("Error" );
        }
        }else{
            return new ModelAndView("Error" );
        }

    }

}

URL Displayed are
when i first hit the login button the url is
localhost/SpringLoginExample/Login.do?username=&password=
when i hit try again buton on the error page it takes me back to login page then if i hit the login button the url generated is
localhost/SpringLoginExample/jsps/Login.do?username=&password=

A: Your XML configuration should look like this, if your jsps are located in war/jsps
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/jsps/" />
    <property name="suffix" value=".jsp" />
</bean>

You should avoid double annotation in your controller. There is a global annotation at class level, where all your @RequestMapping methods are mapped to, but you also use another method level mapping, which is redundant, as it is for the same url. I'd also differentiate between login checks and pure loading of the login page, by 2 different urls (as shown below) or by using a GET request for page display and a POST for credentials check.
@Controller
public class LoginController {
    @RequestMapping("/Login")
    public String loginPage(){
        return "Login"; // display a page that is named Login.jsp in your jsps folder
    }

    @RequestMapping("/Check")
    public ModelAndView checkLoginDetails(HttpServletRequest request , HttpServletResponse response){
    ...
    }
}

Now you can use <form action = "/Check"> ... to send a validation request to your controller. Not only from your Login page, but from every other page also. Though: Your way of doing a relogin is not the usual way to provide another possibility for a user to login, after a failed login.
I'd recommend 4 possibilities:

*

*Just provide a plain html link back to the login page  try again

*Also provide username and password field in your error page and use the same "action" as in the original login page <form action = "/Check">

*The best solution with plain Spring MVC would be to look into Form Validation provided by Spring, which would allow you to check your form attributes and return to the page before with a custom error message for each field (here username or password)

*In case of logins you do not have to reinvent the wheel. Take a look into Spring Security that is best suited for adding security/logins to your Spring web application

A: You should first see the xml configuration. Check for the following code in it.
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/jsps/" />
    <property name="suffix" value=".jsp" />
</bean>

if still it does not work let me know I'll give a different solution to deal with this.


text:
Q: Twillio call whispers and recordings I want to do the following in Twilio Studio:
I want an incoming call to be recorded and I want the person answering the call to hear a voice whisper - not the person calling. How do I set this up in Studio?
I'm not a coder and don't have a technical background. That's why I want to keep to the drag and drop features.

A: Twilio Studio doesn't currently support the capability to handle whisper (playing a text to speech message or mp3 to the dialed party before connecting the calls together. You should be able
to do this with the Studio TwiML Redirect Widget and a TwiML Bin or Twilio Function providing the necessary TwiML.
The TwiML Number noun has a URL attribute which provides this whisper functionality.


text:
Q: how to implement clustering in Sequelize? I have two mysql server both are (MASTER,MASTER). how could we implement clustering in sequelize. if one of sql server has stopped then all request goes to other mysql server without restarting node server.

A: They haven't implemented clustering feature or fallback. I have found a way around for the same.
var Sequelize = require("sequelize");

sequelize.connectionManager.connect = function(){
    return new Promise(function(resolve,reject){
       // create your connection and return its instance in promise
       resolve(connection);
    });
}

sequelize.connectionManager.disconnect = function(connection){
   // to disconnect the connection
   if (!connection._protocol._ended) {
       connection.release()
}
return Promise.resolve();

}

I can share code if above code is not enough.


text:
Q: Display FCKeditor input data in HTML format on same page, as user types? I am currently playing around with the FCKEditor, and I am trying to replicate how stack overflow shows exactly how your post will look in HTML as you type it up.  My FCKEditor creates just fine, I just don't know how to go about accessing the editor data once it is created.  What I want to do is get the html from the editor and then put it into the

. Trying to access it with jQuery using $("#fckEdtr") doesn't work, which I expect is because it's created on the fly with javascript.  I am aware of the IsDirty() method in the FCKeditor JavaScript API, I just haven't seen any solid examples of how to get the current instance of the editor and use the method.  Can anyone help?  My code is below:

<title>FCKeditor Test</title>

<form>

<input type="submit" value="Post" />

</form>

A: I just found the answer to this in another question on SO:
How can I enable live preview for FCKeditor in an ASP.Net site?
Also, when I use a div element instead of a paragraph element, it works.  Here's my final working code for anyone it might help:

<title>FCKeditor - Sample</title>

<form method="post" action="process.php">

<input type="submit" value="Post" />

</form>

A: It's good that you found the answer already, but I wonder why do you need preview window when you are dealing with WYSIWYG editor. My guess is that the look you are getting in the editor is different from the resulting look because of CSS applied to the latter. If I am wrong, disregard the advice that follows.
If that is the case, you may think of copying the most relevant parts of your CSS to \fckeditor\editor\css\fck_editorarea.css so that they are applied in the editor window. Of course, sometimes you do want the difference. For example, spoilers should be hidden when posted but visible in the editor.


text:
Q: TF400324: Team Foundation services are not available from server I have updated visual studio 2012 last night, this was Visual Studio 2012 Update 4. It was working fine before but now i am unable to connect with tfs server. Please let me know what i am doing wrong?
This is the error:
    TF400324: Team Foundation services are not available from server     https://myServer.visualstudio.com/defaultcollection.
Technical information (for administrator):
  Unable to connect to the remote server

A: I followed this steps to get rid of this issue:

*

*Close all instances of Visual Studio.

*Open the Task Manager and check if any TFS Services are running. Select each of them and click on End Process Tree.

*Browse to the folder below and delete all the contents and folders in
%LocalAppData%\Microsoft\Team Foundation\4.0\Cache

and in
%LocalAppData%\Microsoft\Team Foundation\5.0\Cache

*Restart Visual Studio and try triggering build.

*If you are switching from one version of TFS to another, you may require repeating this solution again.  If you are using older version of TFS, you may have to navigate to

%LocalAppData%\Microsoft\Team Foundation\
and find out the version folder instead of navigating directly. It would be
TFS3 if using VS2010, TFS4 if using VS2012, TFS5 if using VS2013.
Source: TF400324: Team Foundation Services are not available from server

A: try clearing your cache folder?
C:\Users\XXXX\AppData\Local\Microsoft\Team Foundation
TFS3 is VS2010, TFS4 is VS2012, TFS5 is VS2013

Stop all instances of Visual Studio.
Zip/Rar all the files as a backup, then delete all files except for the backup zip/rar.
Restart Visual Studio and it will recreate all the files and you should be able to connect as shown here:

A: In my case clearing of cache folders didn't work out.
What I also did is enabling SSL in IIS for Team Foundation Server.
Hopefully, StartSSL.com can offer it for free.
Step by step:
On server side:

*

*Cleare cache folders like it described above;

*Get the SSL following procedure described here;

*Enable SSL for Team foundation server in IIS (netmgr);

*Check if your TFS server is available over https (check link https://tfs.your-server, the certificate should be valid and page opened without any warnings);

On client side:

*

*Remove all TFS servers in Visual Studio;

*Add your TFS server connection with HTTPS (not HTTP).

Now you are able to work with VS-TFS link.

A: If the above methods don't work, and in the Output tab shows you have to contact the server administrator, then the TFS is actually down and you are disconnected to it.

A: I know this is an old thread but the problem still appeared in VS 2013 and TFS 2013.
In my case the IIS on the server side was not running. After starting it VS could immediate connect again.


text:
Q: How can I monitor changes in an NTFS filesystem? I'm looking for some way or a tool that will give me a report and statistics of all the changes that happen on the filesystem over a period of time. For example I'd like to see all the files that were changed in some way over the past 15 minutes/1 hour/24 hours, etc.
I would like to do this on Windows Server 2003 R2 through 2008 R2.

A: "Everything" from Voidtools.com is a great solution for this.  It attaches directly to the NTFS USN Journal and will see modifications that other utilities won't.  It displays results in real time.  Simply run it and go Search > Recent Changes > Last Hour (or Last 24 Hours).  You can sort results too.
PS: Check out build 451 beta in the support forum, its the most recent build with updates to this feature.

A: There are three possibilities:

*

*Online: Monitor the changes online

*Offline 1: Use a tool that collects all information about the available files into a log file (e.g. a checksum file) at the beginning of the period and again at the end. Afterwards the logfiles can be compared to see what changes

*As NTFS supports snapshots (aka Volume Shadow Copies) you could manually create a shadow copy at the beguinning of the period and and the end compare both versions

Online Monitoring
The one-in-all tool for online monitoring is Sysinternals Proces Monitor (free) - however you you only want to see what changes configuration can be a bit difficult and I am not sure how stable it is for long term usage.
Offline Monitoring by "Checksum file"
Even if the name shows that it's primary focus is monitoring the Registry RegShot (GPL) also includes file comparison. There are other alternatives like SpyMe Tools and SystemSherlock Lite.
Offline Monitoring by Shadow Volume Copy
I don't know of any tool that would allow something like this. May be a talented programmer reads this and takes it as an idea for his next project?


text:
Q: What should be rank of matrix with compositional data variables? I'm doing compositional data analysis on 'Baysite' dataset under 'compositions' package in r. Aim is to find nature of the relationship of its permeability to the mix of its four ingredients:
A:   short fibres,
B:   medium fibres,
C:   long fibres,
D:   binder
and response variable is permeability.
Under each column, proportion of each ingredient is given and they all sum up to 1 for each row(observation).
I tried to find rank of the matrix with columns as A,B,C and D(dropped response variable) in r with rankMM() in r. It is giving 4. How is this possible as by using values of other three columns we can exactly tell value under 4th column?


text:
Q: Make box in alignment mode I have written this equation in alignment mode. But now I want to box this whole expression. What command should I use? Any Idea?
\begin{align*}
I=&\frac{1}{|\mathrm{det \, \textbf{A}}|} \sum_{m_{s+1}\cdots m_{r}} \phi_{m_{s+1}\cdots m_{r}}\,\,\textbf{Res} \Big[ f(\Bar{n}_{1},\cdots,\Bar{n}_{s},n_{s+1}+m_{s+1},\cdots,n_{r}+m_{r})\Gamma(-\Bar{n}_{1})\dotsm\Gamma(-\Bar{n}_{s}) &\\ &\hspace{2.8cm}\cdot \frac{\Gamma(1-n_{s+1})\Gamma(1+n_{s+1})\dotsm\Gamma(1-n_{r})\Gamma(1+n_{r})\Gamma(1+m_{s+1})\cdots\Gamma(1+m_{r})}{n_{s+1}\cdots n_{r}\quad\Gamma(1+n_{s+1}+m_{s+1})\cdots\Gamma(1+n_{r}+m_{r})}\Big]
\end{align*}

A: Here are two solutions; one with empheq and a custom box, based on \fcolorbox, the other with the standard \boxed command from amsmath and the multlined environment (requires mathtools – which is loaded by empheq).
    \documentclass{article}
    \usepackage{geometry}
    \usepackage{empheq, amssymb}
    \usepackage[svgnames, table]{xcolor}
    \DeclareMathOperator{\Res}{\mathbf{Res}}
    \newcommand*\widefbox[2][black]{\setlength{\fboxrule}{0.8pt}\setlength{\fboxsep}{1.2ex}\fcolorbox{#1}{white}{\enspace #2\enspace}}

    \begin{document}

    \begin{empheq}[box={\widefbox[SeaGreen]}]{align*}
    I=\frac{1}{|\det \mathbf{A}|} \quad \smashoperator{\sum_{m_{s+1}\cdots m_{r}}} \phi_{m_{s+1}\cdots m_{r}}\Res\biggl[ f(\Bar{n}_{1},\dots,\Bar{n}_{s},n_{s+1}+m_{s+1},\dots,n_{r}+m_{r})\Gamma(-\Bar{n}_{1})\dotsm\Gamma(-\Bar{n}_{s}) & \\
    \cdot \frac{\Gamma(1-n_{s+1})\Gamma(1+n_{s+1})\dotsm\Gamma(1-n_{r})\Gamma(1+n_{r})\Gamma(1+m_{s+1})\cdots\Gamma(1+m_{r})}{n_{s+1}\cdots n_{r}\quad\Gamma(1+n_{s+1}+m_{s+1})\cdots\Gamma(1+n_{r}+m_{r})}\biggr] &
    \end{empheq}

    \[ \boxed{\begin{multlined}
    I=\frac{1}{|\det\mathbf{A}|}\quad \smashoperator{\sum_{m_{s+1}\cdots m_{r}}}\phi_{m_{s+1}\cdots m_{r}}\Res\biggl[ f(\Bar{n}_{1},\dots,\Bar{n}_{s},n_{s+1}+m_{s+1},\dots,n_{r}+m_{r})\Gamma(-\Bar{n}_{1})\dotsm\Gamma(-\Bar{n}_{s}) \\
     \frac{\Gamma(1-n_{s+1})\Gamma(1+n_{s+1})\dotsm\Gamma(1-n_{r})\Gamma(1+n_{r})\Gamma(1+m_{s+1})\cdots\Gamma(1+m_{r})}{n_{s+1}\cdots n_{r}\quad\Gamma(1+n_{s+1}+m_{s+1})\cdots\Gamma(1+n_{r}+m_{r})}\biggr]
    \end{multlined}} \]

    \end{document}


text:
Q: Convert basic PHP/MySql to ASP to query MS Sql database I have, what I would think, would be a very easy conversion....I have a database that has 1 table with 4 fields....I query the table to fill the webpage....I need to convert this PHP to .aspx  I've looked and it seems that most of what I find is much more advanced than i need.  I know NOTHING about asp.  Thank you very much.  Here is what I have:
<?php
include("config.php");

$result = mysql_query("SELECT * FROM TestMeas ORDER BY name ASC",$connect);
while($myrow = mysql_fetch_array($result))
         {
?>

<?php

echo "".$myrow['name']. "";  ?>

<?php echo $myrow['desc'];
        }
?>

A: For starters, there is a big difference between ASP and ASP.net.  In very simple terms, ASP is a scripting language whereas ASP.net is an application framework.  Since ASP and PHP are both scripting languages, the usage is fairly similar.  ASP.net is a whole different beast with almost no similarity.
Given the differences between working in a scripting language and working within the structure of the .Net framework, it's difficult to say "just do XYZ to convert your PHP to .Net".  The .Net framework is largely built around separating presentation from content, which is not a focus in PHP unless you use a framework like CakePHP or CodeIgniter (or others).
Hopefully the linked tutorial in the comments got you on your way.  There is also an MSDN article with a simple example of connecting to SQL Server.
Since this appears to be a "one-off" favor for a friend, your simplest option is probably to build a string in the code and pass it to your view.
string output = "";
using ( SqlConnection conn = new SqlConnection( connectionString ) )
{
    conn.Open();
    using( SqlCommand command = new SqlCommand( "SELECT url, name FROM TestMeas ORDER BY name ASC",
                                                conn ) )
    {
        using( SqlDataReader reader = command.ExecuteReader() )
        {
            if( reader.HasRows )
            {
                while ( reader.Read() )
                {
                    output += String.Format( "{1}",
                                             reader[ 0 ],
                                             reader[ 1 ] );
                }
            }
            reader.Close();
        }
    }
    conn.Close();
}

// Do something with output

You could do this in a code-behind, you could do it in a Controller if you're using MVC, you could do it right in the form/view/page if you want.


text:
Q: How to optimize calculating large numbers in Python When calculating a large number in Python such as 2^(2^1000000), the program would run out of memory. Is there a way to break this calculation into smaller chunks so not as much memory gets used?
EDIT:
I only want to display a module of this number so I really only want to calculate the last 10 or so digits of the number.

A: If you really want to compute all digits of this number, you will not just run out of memory, but run out of lifetime, even using all the computers in the universe.

A: What you are asking is to perform one million squarings of 2, modulo 10^10.
So it suffices to implement product modulo 10^10 (readily available with 64 bits arithmetic) and iterate.
If I am right, 7841627136.
P= 2
for i in range(1000000):
    P= (P * P) % 10000000000
print P


text:
Q: docker is not running as rootless i had install docker on arch Manjaro
had try
sudo usermod -aG docker $USER
it is added to the user
id arch
uid=1000(arch) gid=1001(arch) groups=1001(arch),998(wheel),991(lp),3(sys),90(network),98(power),1000(autologin),962(docker)

docker ps
Cannot connect to the Docker daemon at unix:///home/arch/.docker/desktop/docker.sock. Is the docker daemon running?

*i have to edit a file that present in docker but iam not able to *


text:
Q: Unity: Need help how to double click detection in c#? I wanna create mouse click that detect single click, hold click, and double click.
When I do single click, the character will faster (moveSpeed = 15), when I hold click and double click there is no action, the character still constant with it speed (moveSpeed = 3).
Here is my code:
private float t0, moveSpeed;
private bool longClick, shortClick;

void Start ()
{ t0 = 0f; longClick = false; shortClick = false; }

void update()
{
    // how to add the code for detect double click and where I write it?

    if (Input.GetMouseButtonDown (0))
    {
        t0 = 0; t0 += Time.deltaTime;
        longClick = false;  shortClick = false;
        moveSpeed = 0;
    }
    if (Input.GetMouseButton(0))
    {
        t0 += Time.deltaTime;
        if (t0 < 0.2)
        { moveSpeed = 15;longClick = false; shortClick = true; } // this is single click!
        if (t0 > 0.2)
        { moveSpeed = 3; longClick = true; shortClick = false; } // this is hold click!
    }
    if (Input.GetMouseButtonUp(0))
    {
         if (longClick == true)
         {    moveSpeed = 3;   }
         else if (shortClick = true)
         {    moveSpeed = 3;   }
    }
}

A: Have you tried googling? - See the second answer here: http://answers.unity3d.com/questions/331545/double-click-mouse-detection-.html
In C#:
private float lastClickTime;

public float catchTime = 0.25f;

void Update ()
{

    if(Input.GetButtonDown("Fire1"))
    {
        if(Time.time - lastClickTime < catchTime)
        {
            //double click
            print("Double click");
        }
        else
        {
            //normal click
        }
        lastClickTime = Time.time;
    }
}

A: I replied here: http://answers.unity3d.com/answers/1133702/view.html
Basically: create a new class with the doubleClicked checker inside. Then use it in an if clause.
class DoubleClickListener  {
  bool firstClick = false;
  float runningTimerSecond;

  float delay = 0.25F;

  public DoubleClickListener() { }

  public DoubleClickListener(float delay) {
    this.delay = delay;
  }

  public bool isDoubleClicked() {
    // If the time is too long we reset first click variable
    if (firstClick && (Time.time - runningTimerSecond) > delay) {
      firstClick = false;
    }

    if (!firstClick) {
      firstClick = true;
      runningTimerSecond = Time.time;
    } else {
      firstClick = false;
      return true;
    }

    return false;
  }
}

A: DoubleClickBehaviorBase is a base class that will take care of double click for you.
You inherit from DoubleClickBehaviorBase instead of MonoBehavior
All you need to do is override OnDoubleClickOverride in your class.
I've also included a MonoBehaviourExtension that makes it easier to call and
implement StartCoroutine:
namespace DoubleClick
{
    public static class MonoBehaviourExtension
    {
        public static void StartCoroutine(this MonoBehaviour mb, params Action[] funcs)
        {
            mb.StartCoroutine(CoroutineRunnerSimple(funcs));
        }
        private static System.Collections.IEnumerator CoroutineRunnerSimple(Action[] funcs)
        {
            foreach (var func in funcs)
            {
                if (func != null)
                    func();

                yield return new WaitForSeconds(.01f);
            }
        }
    }

    abstract public class DoubleClickBehaviorBase : MonoBehaviour
    {
        float _DoubleClickTimer = 0.0f;
        float _DoubleClickDelay = 0.5f;
        bool _WasClicked = false;

        // Update is called once per frame
        protected virtual void Update()
        {
            // this starts timing when a click occurs
            //
            if (this._WasClicked == true)
            {
                this._DoubleClickTimer += Time.deltaTime;
            }

            // this must be in update because it expires based on time and not clicks
            //
            if (this._DoubleClickTimer > this._DoubleClickDelay)
            {
                this._WasClicked = false;
                this._DoubleClickTimer = 0.0f;

            }
        }
        protected virtual void OnMouseDoubleClick()
        {
        }

        protected virtual void OnMouseDown()
        {
            if (this._WasClicked == false && this._DoubleClickTimer < _DoubleClickDelay)
            {
                this._WasClicked = true;
            }
            else if (this._WasClicked == true &&
                     this._DoubleClickTimer < this._DoubleClickDelay)
            {
                this.StartCoroutine(() => this.OnMouseDoubleClick());
            }
        }
    }
}


text:
Q: "Package inputenc Error: Invalid UTF-8 byte sequence" on the .bbl file Package inputenc Error: Invalid UTF-8 byte sequence. \bibinfo{author}{Budulan, �.}

I got the above error where it has something to do with the .bbl file.
Upon checking, the line has this error:
\bibinfo{author}{Budulan, �.}, \bibinfo{author}{Burceanu, E.},

The author's name is spelt as Budulan, Ştefania. See the letter S.
What does it mean and what should I do?

A: BibTeX cannot deal with Unicode characters outside the US-ASCII range. Often that does not become apparent when you just look at the output in the document, since BibTeX usually just passes the characters thorough as they are. But when you ask BibTeX to perform string manipulation or sorting it can become painfully obvious that BibTeX doesn't know how to deal with non-US-ASCII characters. Shortening of first names is one of those operations.
I did not manage to reproduce the exact error from your question, but here is an example of Ş misbehaving twice. In BibTeX you'll have to use the macro escape {\c S} instead. See also How to write "ä" and other umlauts and accented letters in bibliography?.
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage{natbib}
\bibliographystyle{abbrvnat}

\begin{filecontents}{\jobname.bib}
@article{budulan:bad,
  author  = {Budulan, Ştefania},
  title   = {Bad -- Unicode (Ş S)},
  year    = {1980},
}
@article{budulan:good,
  author  = {Budulan, {\c S}tefania},
  title   = {Good -- macro escape ({\c S} S)},
  year    = {1980},
}
\end{filecontents}

\begin{document}
\cite{budulan:bad,budulan:good}
\bibliography{\jobname}
\end{document}

With biblatex you could use Biber as a backend, which deals with Unicode out of the box.

As David points out in the comments, the symptoms in the question could be explained by using non-ASCII characters and a different (assumed) encoding for the .bib file and .tex file (latin2 for the .bib and UTF-8 for the .tex file). With BibTeX you need to make sure that the .bib and .tex file encodings match. But as I said before, BibTeX doesn't really accept anything but US-ASCII.
If your .bib file is written by a third-party tool, you need to configure that tool to use a compatible encoding, but you should also instruct the tool to use macro-escapes for non-ASCII characters.


text:
Q: How to minimize windows on double-click of the window frame? Is it possible with Xfce 4.8 (Xubuntu 12.04) to have windows minimized on double-clicking the window frames? So, for example, if File Manager is open, to just double-click on the window frame and the the window "disappears" (is minimized to the panel). It would be great if there was a "simple" solution not having to install heavy additional packages.

A: XFCE has the ability to minimize the window when double-clicking the window title bar.  I know this is not quite the same as double-clicking the frame, but its very simple without needing further packages or workarounds.
Use Settings --> Window Manager and change the double-click action for the title-bar as shown.


text:
Q: Assigning a dynamic id to a radio button in a loop in ruby on rails I have the following code:
<%1.upto(5) do |n|%>
<label class="label_radio" for="radio-0<%= n %>"><%= n.to_s %>
<%= radio_button_tag 'rating[attesa]', n, false, :class => "cuore_1 ratings_cuore", :id => "radio-N" %>
</label></p>
<%end%>

What i want to do is to dinamically assign an id to my radio buttons, so that i have my id like radio-1, radio-2, radio-3 and so on. I'm sure this one's easy :)
Thanks!

A: just interpolate the id in your :id field like this:
:id => "radio-#{n}"
where n is your variable which holds the id


text:
Q: Convolution between a Schwartz Function and a Tempered Distribution I'm learning about distribution theory and I have a trouble proving that the convolution between a tempered distribution and a schwartz function is a tempered distribution. Let $S$ be the schwartz space and $S'$, its dual, the tempered distribution space.
Let $\varphi\in S$, $\psi\in S'$. The convolution between $\varphi$ and $\psi$ is defined as follows:
$$(\psi*\varphi)(\phi) = \psi(\tilde{\varphi}*\phi) \text{ , for all } \phi\in S;$$
where $\tilde{\varphi}(x)=\varphi(-x)$. I want to prove that $\psi*\varphi\in S'$.
I have to see that $\psi*\varphi$ is well defined. As $\tilde{\varphi},\phi\in S\subset L^1$, $\tilde{\varphi}*\phi\in L^1$ and we can calculate its Fourier transform. In fact:
$$\widehat{\tilde{\varphi}*\phi} = \widehat{\tilde{\varphi}}\widehat{\phi}.$$
Now, as $\widehat{\tilde{\varphi}},\widehat{\phi}\in S$, we have that the product $\widehat{\tilde{\varphi}}\widehat{\phi}\in S$. Finally, in consequence of the Fourier Inverse Formula, $\tilde{\varphi}*\phi\in S$. I think that proves that the functional is well-defined.
Now, I should prove that it is linear and continuous. The linearity is inmediate because of the linearity of the convolution (respect to $\phi$). My problem is proving the continuity. Let $(\phi_m)$ be a sequence in $S$ which converges to $0$ in $S$. Then
$$\lim_{m\to\infty} \sup_{x\in\mathbb{R}^n} |x^{\beta}D^{\alpha}\phi_m(x)| = 0,$$
for all multi-index $\alpha, \beta$. I think I should prove that $(\tilde{\varphi}*\phi_m)$ also converges to $0$ and the continity will follow from the continuity of $\psi$.  I'm trying to see if $x^{\beta}D^{\alpha}(\tilde{\varphi}*\phi_m)(x)$ is bounded, but I only have that
$$|x^{\beta}D^{\alpha}(\tilde{\varphi}*\phi_m)(x)| = |x^{\beta}(\tilde{\varphi}*D^{\alpha}\phi_m)(x)|.$$
I'm trying to use the convergence of $(\phi_m)$ but I really don't know how to. Can someone please help with that? Thanks.

A: Hints:

*

*if $g$ is a Schwartz function, what is the Fourier transform of  $x^\beta D^\alpha g$?

*if $g_n \to 0$ in $S$ and $g\in S$, where does $g\cdot\hat g_n$ converge?


text:
Q: Irrelevant errors from the W3C Validator after a change to php I recently changed all of my website pages to php in order to add a menu that I don't have to update on every single page. Now, however, when I try to validate my pages with the w3c validator, I receive irrelevant errors such as 'stray start body tag' and the like. To convert to php, I changed the extension from html to php and put bits of php code where I wanted the menu (inside of the php tags of course). I think that the validator should still be able to validate my html now. What is going on? Thank you!

A: Those errors are right. Let's take a closer look on the first one:

Error Line 112, Column 15: Stray doctype.
<!DOCTYPE HTML>

This means that doctype was found somewhere where he shouldn't be.
In your example it's on the line 112:
function askfirstdisqus(){
</script>
<!DOCTYPE HTML> <-- Line 112
<html>
<head>

Just scroll down and in the source find the reported line and you'll see the problem.
You're probably using php's include to include some files and you end up with multiple meta datas.

A: Make sure the stray tags are only opened once. You usually see this error when embedding or including pages with full markup.
Example
Standard
<!DOCTYPE HTML>
<html>
  <body>
    <head>
    </head>
  </body>
</html>

However, you have a new DOCTYPE, body, etc tags (the stray tags) within the original, like so:
<!DOCTYPE HTML>
<html>
  <body>
    <head>
    </head>
    ....
    <!DOCTYPE HTML>
    <html>
      <body class="new_DOC">
      </body>
    </html>
    ....
  </body>
</html>


text:
Q: countifs formula returns #ref! after vba code changes one sheet I have built some code that draws data from another excel to the main one in sheet2 and in sheet1. I have some formulas, especially countifs, to calculate the data from sheet2, but whenever code runs the countifs formulas got #REF! error even if I select whole columns in it.
Is there any efficient way to solve this? I did that with countifs because I thought it would speed thins up (as i have 32 fields to calculate).
=countifs(Details!#REF!;Statictic!A14;Details!#REF!;Statictic!A17)

A: You can 'lock' the columns for COUNTIFS with INDIRECT. If you always want the second and fourth column for the ranges then,
=countifs(indirect("Details!B:B"); Statictic!A14; indirect("Details!D:D"); Statictic!A17)

Text that looks like a range reference will not change even if the columns are deleted but INDIRECT is required to convert the text to workable range references.
You can also use INDEX which is non-volatile.
=countifs(index(Details!A:XFD, 0, 2); Statictic!A14; index(Details!A:XFD, 0, 4); Statictic!A17)

Assuming that you don't delete Details!A:A, this will always reference the second and fourth column.


text:
Q: KDE accessibility applet respawned in my LXDE panel - how to get rid of it? For some strange reason, whenever I log in to my LXDE desktop, I see the KDE accessibility applet on the panel/taskbar. I can't figure out what's triggering it being run and how I can stop it from running.
So, what's the cause and what's the cure?
Notes:

*

*I can shut it down, but it respawns after a while.

*I'm using Debian Stretch on an x86_64 system.

A: A partial answer about the cause. It's amarok. When I don't run amarok after login - this doesn't happen. As soon as I bring amarok up, I get the accessibility icon. I would guess there are probably some other KDE apps which trigger this, but - not all of them. Probably not most of them.


text:
Q: What is the correct approach to maintain relationship between classes (tables) in the following example? In the following  typical example:
Country has one-to-many relationship with City.
Should Customer class have only a reference to City or to Country as well?
public class City
{
    public int CityId { get; set; }
    public int CountryId { get; set; }

    public virtual Country Country { get; set; }
    ...
}

public class Country
{
    public int CountryId { get; set; }

    public virtual ICollection<City> Cities { get; set; }
    ...
}

public class Customer
{
    public int CustomerId { get; set; }
    public int CityId { get; set; }
    public int CountryId { get; set; }

    public virtual City City { get; set; }
    public virtual Country Country { get; set; }
    ...
}

Normally even without defining the Customer-Country relationship we can access that via:
customer.city.country
and we can maintain the integrity as well.
However, I've mostly seen people add an explicit Customer-Country relationship because customer.city.country is weird and they want the simple customer.country.
Or in other cases, they create an Address class (value object) in between.
What is the correct approach?

A: In most cases, you will just want the customer to have a reference to a particular city. It will not be computationally heavy to access a customer's country by using their city, so that should not be a major concern.
The bigger concern would be your data integrity. What happens if a customer's city is Chicago, but their country is China? By having both references, you have to deal with more data validation.
In addition, having the single reference to the city follows the rules of database normalization. If a customer directly references the country, you will violate the 4th normal form (having attributes that can be derived from other attributes).
While we can debate the merits of having a normalized database, in this situation, the relationship between cities and countries is already defined, so there is no need to redefine that relationship by "shortcutting" a foreign key between customers and countries.


text:
Q: Merging attribute tables from feature classes into single table? I have a large number (approx. 1,100) polygon feature classes.
What I would like to do is to merge the attribute tables from each of these feature classes into a single table, in the simplest and fastest way possible.
This will be the first step in a script or model that then uses that table with all polygon values from all layers to perform some tabular joins and selections.  Each time I run this script, I will want to re-do the table merge, as the underlying polygon feature classes may change.  If it's possible to write the merged table into memory, for speed, that would be best.
I'm using ArcGIS 10.1.  I think I can do this easily enough in VBA/VB.net, but it might be simplest to set it up as a ModelBuilder model, so that it's easy to share with colleagues.

A: I think I would personally have the model run the Merge tool to generate a merged feature class stored in the in_memory workspace, and then use the Make Table View tool with that merged feature class as an input to create an in-memory version of the attribute table.
The Make Table View tool also provides the flexibility to apply an SQL query to filter the table.

A: If you have a set of fields that are the only ones you want, Append_management will copy only the fields with a name match. It may be more memory-efficient than Merge. If memory is still killing you, you can use a ModelBuilder 10.x iterator to append them one at a time. If you're writing to in_memory and the table doesn't get too big, that should work well.
One other thing, if you truly need a table (and not a feature class output) you can probably cut way down on the memory needed by creating table views from your input and appending them - so you can skip the (perhaps large) shape fields.


text:
Q: How to print the elements in odd positions in a list using an iterative function in Lisp? I have to make a recursive function in lisp which takes a list and makes another list with only the elements on odd position in the given list.
If I have (1 2 3 4 5) I have to output (1 3 5)
I have a code here:
(defun pozpar(lst) (do(
(l lst (cddr l))
(x '() (cons x (car l))))
((null l) x)))

This outputs:
(5 3 1)

I know cons adds the elements at the beginning and I tried with append or list but nothing worked.

A: I think this is a way easier solution:
(defun popzar (lst)
  (cond ((null lst) nil)
        (t (cons (car lst)
                 (popzar (cdr (cdr lst)))))))

It first checks if the list is empty and if not it creates a new list with the first element and the result of calling itself again with the rest of the list except for the second element.

A: The easiest way is to reverse the result:
(defun pozpar (lst)
  (do ((l lst (cddr l))
       (x '() (cons (car l) x)))
      ((null l)
       (nreverse x))))

(pozpar '(1 2 3 4 5))
==> (1 3 5)

Notes

*

*This returns, not outputs the value you want.

*Prepending values and reverting the result is a common Lisp coding pattern.

*Since append is linear in the length of its argument, using it in a loop produces quadratic code.

*I formatted the code in the standard Lisp way. If you use this style, lispers will have an easier time reading your code, and, consequently, more willing to help you.

A: With using loop it's very easy to get the elements in the order you processed them. It is also the most effective and the only one guaranteed to work with all length arguments:
(defun pozpar1 (lst)
  (loop :for e :in lst :by #'cddr
        :collect e)))

If you really want recursion I would have done it with an accumulator with a linear update reverse in the end:
(defun pozpar2 (lst)
  (labels ((helper (lst acc)
             (if (endp lst)
                 (nreverse acc)
                 (helper (cddr lst) (cons (car lst) acc)))))
    (helper lst '())))

However a classical not tail recursive version would look like this:
(defun pozpar3 (lst)
  (if (endp lst)
      '()
      (cons (car lst) (pozpar3 (cddr lst)))))


text:
Q: Delete Row from TableAdapter? I have to Delete one row from datagridview which is connected to database SQL but i dont know how to call method in Button_click(Delete).(ex. this.nameTableAdapter.DeleteQuery() ).

Error show: _ID, _KlID does now exist ??
And Sql Query is :
DELETE FROM Artikulli
WHERE (ID = @_ID) AND (KlID = @_KlID) OR
        (ID = @_ID) AND (KlID = @_KlID)

A: In your DataSet right click the TableAdapter then AddQuery and define your delete query. Then you can call the delete method via your table adapter.

Then

Now write your query, (use query builder if it is complicated).
Notice: your parameter names are prefixed with @. here I have one parameter named @Id


text:
Q: What is the exponential form gamma matrix for a general rotation and boost? It would be nice to have a cute method that uses Lorentz transformations of basis vectors by exponential transformation using gamma matrices. To avoid confusion, let's assume -+++ signature. Given $\gamma_\mu$ as gamma matrices that satisfy ${\rm tr}(\gamma_\mu\gamma_\nu) = 4\eta_{\mu\nu}$, then we have ${\rm tr}(\gamma'_\mu\gamma'_\nu) = 4\eta_{\mu\nu}$ if we put:
$\gamma'_\mu = \exp(-A)\gamma_\mu\exp(+A)$
where $A$ is any matrix.
Boosts and rotations use $A$ as a bivector. For example, with $\alpha$ a real number, $A=\alpha\gamma_0\gamma_3$ boosts in the z direction while $A=\alpha\gamma_1\gamma_2$ gives a rotation around the z axis.
Solving for the value of $\alpha$ that gives a boost with velocity $\beta = v/c$ appears to be straightforward. But how to do the rotations?
And by the way, what happens when you generalize $A$ to be something other than bivectors?

A: The most general Lorentz transformation that is connected to the identity is given by the conjugation by $\exp(-A)$ where
$$ A = \frac 12 \omega_{\mu\nu} \gamma^\mu \gamma^\nu $$
and $\omega_{\mu\nu}$ is an antisymmetric tensor containing $D(D-1)/2$ parameters. The group of all such transformations is isomorphic to $Spin(D-1,1)$. If $\omega$ only contains one component $0\mu$, then it is a boost, and the nonzero numerical value of $\omega$ is the rapidity - the "hyperbolic angle" $\eta$ such that $v/c=\tanh\eta$.
If only one doubly spatial component of $\omega$ is nonzero, then this component $\omega_{\mu\nu} = -\omega_{\nu\mu}$ is obviously the angle itself. Note that the spatial-spatial terms in $A$ are anti-Hermitean, producing unitary transformations; the mixed temporal-spatial terms in $A$ are Hermitean and they don't product unitary transformations on the 4-component space of spinors (but they become unitary if they're promoted to transformations of the full Hilbert space of quantum field theory).
In 4 dimensions, a general antisymmetric matrix $4\times 4$ contains 6 independent parameters and has eigenvalues $\pm i a, \pm  i b$, so in 3+1 dimensions, one can always represent a general Lorentz transformation as a rotation around an axis in the 4-dimensional space followed by a boost in the complementary transverse 2-plane. This is the counterpart of the statement that any $SU(2)$ rotations in 3 dimensions is a rotation around a particular axis by an angle.
If you allowed $A$ to contain something else than $\gamma^{\mu\nu}$ matrices which generate the Lorentz group, you could get other groups. Only for a properly chosen subset of allowed values of $\omega$, you would get a closed group from the resulting exponentials (under multiplication). In particular, if you allowed $A$ to be an arbitrary complex combination of any products of gamma matrices, well, then you would allow $A$ to be any complex $4\times 4$ matrix, and its exponentials would produce the full group $GL(4,C)$ - surprising, Carl? ;-) It's not a terribly useful groups in physics because actions are usually not invariant under this "full group", are they?
Also, there are not too many groups in between $Spin(3,1)$ and $GL(4,C)$ - I guess that there's no proper group of $GL(4,C)$ that has a proper $Spin(3,1)$ subgroup. Obviously, there are many subgroups of $Spin(3,1)$ - such as $Spin(3)$, $Spin(1,1)\times Spin(2)$, and others.


text:
Q: Issue with constructor in java I've started learning java just recently so forgive me if it's stupid problem, I have 3 classes in 3 files.
First one
package PLAYLIST1;

public class Utwor {
    private String tytul1;
    private String wykonawca2;
    private Integer rok3;

    Utwor(String x, String y, Integer z){
        x=tytul1;
        y=wykonawca2;
        z=rok3;
    }
    public String tytul(){
        return tytul1;
    }
    public String wykonawca(){
        return wykonawca2;
    }
    public Integer rok(){
        return rok3;
    }
    public void piosenka(){
         System.out.println(tytul1+" ("+wykonawca2+") ["+rok3+"]");
    }

}

Second
package PLAYLIST1;

import java.util.Arrays;

 class Playlist {
    //ArrayList<String> listaUtworow;
    Utwor[] listaU = new Utwor[3];
    private String lista;
    private int ileJuzJest = 0;

    Playlist(String nazwaListy) {
        //listaUtworow = new ArrayList<String>();
        lista = nazwaListy;
    }

    public String Nazwa() {
        return lista;
    }

    public void dodajUtwor(String tytul, String album, Integer rok) {
        listaU[ileJuzJest] = new Utwor(tytul,album ,rok);
        ileJuzJest++;
        System.out.println("Dodano utwór: '"+tytul+"' do listy: "+lista);
    }

    public void wyswietlListe() {
        if (ileJuzJest==0) {
            System.out.println("Lista jest pusta");
        }
        System.out.println("Utwory z listy "+lista+":");
        for (int i=0; i<ileJuzJest; i++) {
             listaU[i].piosenka();
        }
    }
}

And final with main
package PLAYLIST1;

public class ZarzadzaniePlaylistami {

    public static void main(String[] args) {
        Playlist p1 = new Playlist("Rock");
        Playlist p2 = new Playlist("Pop");

        System.out.println(p1.Nazwa());
        System.out.println(p2.Nazwa());
        p1.dodajUtwor("Stockholm Syndrome","Absolution",2004);
        p1.dodajUtwor("Absolution","Going to Hell",2014);
        p1.dodajUtwor("Loud Like Love","Loud Like Love",2013);
        p2.dodajUtwor("Blank Space","A",2014);
        p2.dodajUtwor("Sugar","B",2013);
        p2.dodajUtwor("Budapest","C",2012);
        p1.wyswietlListe();
        p2.wyswietlListe();

    }

}

As I run program the result is:
Rock
Pop
Dodano utwór: 'Stockholm Syndrome' do listy: Rock
Dodano utwór: 'Absolution' do listy: Rock
Dodano utwór: 'Loud Like Love' do listy: Rock
Dodano utwór: 'Blank Space' do listy: Pop
Dodano utwór: 'Sugar' do listy: Pop
Dodano utwór: 'Budapest' do listy: Pop
Utwory z listy Rock:
null (null) [null]
null (null) [null]
null (null) [null]
Utwory z listy Pop:
null (null) [null]
null (null) [null]
null (null) [null]

Why those variables doesn't save in Utwor class? I've been struggling with this for hour and I'm not going to solve it on my own, please help.

A: Backwards assignments in your Utwor constructor as you're assigning the fields (null) the parameter variables:
Utwor(String x, String y, Integer z){
    x=tytul1;
    y=wykonawca2;
    z=rok3;
}

instead, you should assign the parameters to the fields, and so it should be:
Utwor(String x, String y, Integer z){
    tytul1 = x;
    wykonawca2 = y;
    rok3 = z;
}

Interestingly, you get it right in your Playlist class.
Nicely asked question, by the way.


text:
Q: Change column type from varchar to text in all tables at once I am using Postgres. I would like to change column type in all tables where column name is "description" from varchar(255) to text.
If anyone knows that I would be very glad for your help.

A: I guess you don't want to manually run all the necessary ALTER TABLE statements.
You can use the following statement to generate the needed ALTER TABLE statements:
select 'alter table '||table_schema||'.'||table_name||' alter column '||column_name||' type text;'
from information_schema.columns
where table_schema = 'public'
  and column_name = 'description'
  and data_type = 'character varying'
  and character_maximum_length = 255;

replace 'public' with your schema if your tables are not located in the public schema.
Run the above statement, spool the output into a text file, then run the generated script.
Something like this:

psql (9.3.4)
Type "help" for help.
postgres=> \t
Showing only tuples.
postgres=> \o alter.sql
postgres=> select 'alter table '||table_schema||'.'||table_name||' alter column '||column_name||' type text;'
postgres-> from information_schema.columns
postgres-> where table_schema = 'public'
postgres->   and column_name = 'description'
postgres->   and data_type = 'character varying'
postgres->   and character_maximum_length = 255;
postgres=> \i alter.sql

A: You can use a DO statement to run a single dynamic command:
DO
$do$
BEGIN

RAISE NOTICE '%', (
-- EXECUTE (
   SELECT string_agg(format('ALTER TABLE %s ALTER COLUMN %I TYPE text'
                           , a.attrelid::regclass, a.attname), E';\n')
   FROM   pg_attribute a
   JOIN   pg_class     c ON c.oid = a.attrelid
   JOIN   pg_namespace n ON n.oid = c.relnamespace
   WHERE  a.attname = 'description'
   AND    a.atttypid = 'varchar'::regtype
   AND    NOT a.attisdropped                      -- no dropped columns
   AND    a.attnum > 0                            -- no system columns (redundant check)
   AND    format_type(a.atttypid, a.atttypmod) = 'character varying(255)'
   AND    n.nspname NOT LIKE ALL ('{pg_%, information_schema}'::text[])
   );

END
$do$;

Since the command is potentially hazardous I commented the EXECUTE and put a RAISE NOTICE there instead. After confirming the commands are sane, switch the comment characters -- to actually execute the DDL commands.
The manual on format_type().
This changes the type for all columns description varchar(255), except for those in system catalogs, temporary tables (both starting with 'pg_') and the information schema. I build command from the system catalogs. @a_horse demonstrates the other good option to use the information schema instead.
In your particular case, there can only be one column per table. If there can be multiple, it would be substantially cheaper to execute all type changes in a single ALTER TABLE statement per table. Commands of the form:
ALTER TABLE foo
    ALTER COLUMN col1 TYPE text
  , ALTER COLUMN col2 TYPE text
  , ALTER COLUMN col3 TYPE text;

More details in this related answer:
Dynamic UPDATE fails due to unwanted parenthesis around string in plpgsql

A: You need to use the ALTER TABLE / ALTER COLUMN feature.  A sample:
ALTER TABLE table_1
    ALTER COLUMN column_5 TYPE text,
    ALTER COLUMN column_10 TYPE text;

There is no global command to do this for you, but you could create a script to create all the ALTER TABLE / ALTER COLUMN commands and then run the script on your server.
Having said that, why do you want to change all of the 'description' columns to unlimited size? If a description should only be 100 characters (for example) it would be better to stick to a definition VARCHAR(100) that identifies what the limit should be.


text:
Q: What are 'weak references' in KiokuDB? What exactly are the weak references that KiokuDB tutorial  mentions?
How do they differ from 'normal' references?

A: A normal reference prevents the thing being referred to from being garbage collected.  A weak reference is like a normal reference, but does not prevent garbage collection.  When the last normal reference to an entity is removed, it gets garbage collected, and any weak references to it become undef.
This is useful if you have circular references.  A reference-count garbage collector (like Perl uses) cannot remove things with circular references, because their reference count never goes to 0.
For example, consider a tree structure, where parent nodes have references to their child nodes, and child nodes have a reference to their parent.  By making the child-to-parent references weak, the tree will be automatically garbage collected when there are no external references to it.
In Perl, weak references can be created with the weaken function in Scalar::Util.  Moose also allows you to mark attributes as weak_ref.


text:
Q: http put when user closes browser I'm trying to issue a put request to save some stuff when the user closes the browser.
I'm using angular and I've tried using the onbeforeunload and onunload events but not getting it to work the way I want. I have a Resource i want to update.
    $window.onbeforeunload = function(){
       myResource.foo = closingBrowser();
       myResource.$update();}

With fiddler running I see that this does not do a put request. Not when I use $window.onunloadeither. But if i enter a return statement to onbeforeunload the confirmation box pops up, and when I click OK, fiddler shows that the put request is done. Now I don't want this popup, I just want to PUT when the user closes the browser.
Is there a way for me to do this with these methods or must I solve it some other way (advise much appreciated)?
Update:
I did some more testing and found some inconsistent behavior. In Internet explorer (11): If I have the return statement, there is the classic popup. But it only sends the PUT if I press cancel and return to the page. If I press OK to leave, the PUT is not issued.
In chrome: It does not matter if I press cancel to return, or Ok to leave, the PUT is still sent. Another 'hack'(?) that worked in chrome but not ie, when not having a return (no popup, which is wanted behavior), was to have a loop after the $update(), something like: while(!myResource.$resolved){} (or just a for-loop iterating a few million times also worked, but it looked uglier,) chrome actually sends the PUT (IE did not).
How do you suppose this would be replicated in IE?
I did not do extensive test on firefox, but the little I did, it seemed more like chrome.

A: You can't escape this popup ("Do you want close this window bla bla bla...").
I think the best solution is next:

*

*If user close current tab, browser will show popup with your text

*You send http put request to server, when http request will call success callback you will, show custom popup("Your settings or something another was saved bla bla bla)

*Close window by using window.close


text:
Q: Is there a way to push only changed file to S3 using bitbucket pipeline? Here is an example of a pipeline, what changes are needed to complete this task??
        deployment: production
        script:
          - pipe: atlassian/aws-s3-deploy:0.3.8
            variables:
              AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
              AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
              AWS_DEFAULT_REGION: 'us-east-1'
              S3_BUCKET: 'bbci-example-s3-deploy'
              LOCAL_PATH: 'artifact'


text:
Q: UI tabs page showing all content at once I tried what was mentioned here jQuery ui tabs: all tabs show same content, but I just can't figure out what is wrong.
I have the tabs UI working fine locally, but can't get it to work online.
Any suggestions?
This is the page I'm trying to get it to work on.
http://www.connect4webdesign.com/test/

A: Colorbox.js is breaking your page.
it's a .js file, do not include  tags in the document.


text:
Q: Searching HTML5 data attributes using wildcards in JQuery I have the following list of elements that uses the HTML 5 data attributes.

What I would like to do is to get the list of all the elements that contains
data-element="INFO-*"
I tried $('[data-element="INFO-*"]') but this returns an empty object. How can I retrieve this list?

A: You can use
 $('[data-element^="INFO-"]')

which means find any element with attribute data-element with a value starting with INFO-
See more at http://www.w3.org/TR/selectors/#attribute-substrings

A: Use ^=, which means the «starting from»:
$('[data-element^="INFO-"]')


text:
Q: CE 1.9.2.1 - Extend RWD Menu I am working with a copy of the "new" RWD template and I want to extend the header with a new drop down menu left to the "user account" menu.
How can I do this?

A: Go to your template dir and copy/past the following dirs and file in your theme:

page/html/header.phtml

On line 67 you will see the div  that contains the account menu. You can customize code here.
For more detail see here


text:
Q: SplitApp is displayed not correct
I try to build a SplitApp, but cannot figure out what's wrong with my routing: the master page is displayed as details page, the details page is not displayed at all. It looks like I use not SplitApp, but App.
HERE how the application looks like.
Here is my App.view.xml:
<mvc:View controllerName="test.controller.App" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m">
    <SplitApp id="app"/>

</mvc:View>

Here is my routing and root view declaration from the Component.js (I use version 1.28.1):
"rootView": {
                viewName: "test.view.App",
                type: sap.ui.core.mvc.ViewType.XML
},
"routing": {
                "config": {
                    "routerClass": "sap.m.routing.Router",
                    "viewType": "XML",
                    "viewPath": "test.view",
                    "controlId": "app",
                    "controlAggregation": "detailPages",
                    "bypassed": {
                        "target": ["master", "notFound"]
                    }
                },

                "routes": [{
                    "pattern": "",
                    "name": "master",
                    "target": ["object", "master"]
                }, {
                    "pattern": "Details",
                    "name": "object",
                    "target": ["master", "object"]
                }],

                "targets": {
                    "master": {
                        "viewName": "Master",
                        "viewLevel": 1,
                        "viewId": "master",
                        "controlAggregation": "masterPages"

                    },
                    "object": {
                        "viewName": "Detail",
                        "viewId": "detail",
                        "viewLevel": 2
                    }
                }
            }

What do I miss?
Thanks.
UPDATE:
The SplitApp looks like I have described in this post on a Laptop with high resolution. The same app on another pc with a lower resolution display is shown as it should - with master and detail parts.
How this issue can be explaned and fixed?

A: Have you declared aggregations detailPages and masterPages for SplitApp control? They're used in routing, but I don't see them in the view.
I suppose you might want to try something like this:
<SplitApp id="app">
  <masterPages>
    <Page>
      ...
    </Page>
  </masterPages>
  <detailPages>
    <Page>
      ...
    </Page>
  </detailPages>
</SplitApp>

I think this is also a relevant example: https://sapui5.netweaver.ondemand.com/explored.html#/sample/sap.m.sample.SplitApp/code


text:
Q: Replacing value input by user with value assigned with state in React I have a reactstrap Input field
        <Input
          onChange={handlePriceInputChange}
          type="number"
          defaultValue={price}
          innerRef={register("price", { required: true })}
        ></Input>

which I am filling with a default "" state called price in defaultValue.
  const [price, setPrice] = useState("");

I set this value with a function in onChange

  const handlePriceInputChange = (ev) => {
    setPrice(parseInt(ev.target.value));
  };

and also clicking some div containers trigger a function handleSelectedBox
  const handleSelectedBox = (ev) => {
    setSelected(ev.target.getAttribute("data-boxprice"));
    setPrice(parseInt(ev.target.getAttribute("data-price")));
  };

When I fill the input field manually and then trigger the buttons that should trigger handleSelectedBox, the state price changes, but the value stays the same on the client-side.
How could I force handleSelectedBox to change the value within input even if such value was set manually?

A: So the answer is to use value instead of defaultValue :
        <Input
          onChange={handlePriceInputChange}
          type="number"
          value={price}
          innerRef={register("price", { required: true })}
        ></Input>


text:
Q: Getting an syntax error by using RasPiArduino for Raspberry Pi I am using an Raspberry Pi Zero with an L298n motor driver to control two motors. I was testing the motors using a Python script. That worked fine.
Now I wanted to use the Arduino software to program the motors. I was following this tutorial on how to archive that: https://www.youtube.com/watch?v=lZvhtfUlY8Y
Then I coded this into the Arduino software (v. 1.8.5)
void setup() {
  // put your setup code here, to run once:
  Console.println("Setup Einstellungen");
  pinMode(17, OUTPUT);
  delay(500);
  Console.println("Setup Einstellungen Ende");
}

void loop() {
  Console.println("Rechts Vorwärts");
  digitalWrite(17, HIGH);
  delay(1000);
  digitalWrite(17, LOW);
  delay(5000);
}

I compiled the file using "Export compiled Binary". I uploaded it on the Raspberry using FileZilla and tried to run it via SSH.
When I tried to run it with:
(sudo) sketch_feb28.ino.bplus.bin

I got the following error:

: -bash: syntax error near unexpected token `sketch_feb28.ino.bplus.bin'

Running file sketch_feb28.ino.bplus.bin
sketch_feb28a.ino.bplus.bin: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SY            SV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2            .0, BuildID[sha1]=a0260345a3700dca64c63fde8a10959214ce9b85, not stripped

I cannot solve this issue alone.

A: I'm still not sure, where the syntax error comes from.
Run the file with:
./sketch_feb28.ino.bplus.bin

This is the syntax for running a binary, that is not in PATH. Since the file is a valid executable, the error message should vanish.


text:
Q: Trying to teach myself RoR through building a simple app. where do I start? First of all, forgive the newbie question -- I won't begrudge downvoters.
What I have in mind is 3 views.
A main index page.
A sub index page where the user can drill down to a sub index and
A page that houses content relating to the particular item chosen from the sub-index

Should I create the models first or controllers or views?  As a very new programmer, should I use scaffolding?
The more concrete the answers to this question the better or if there are other resources with specific executable steps you can point me to, that would be great.

A: Go through this http://ruby.railstutorial.org/ (click on the book link at the top) by the time you get done you'll have what you want.


text:
Q: SoapServer behind Symfony 3 controller not calling wrapped method Overview
I'm trying to put a SOAP server inside a Symfony controller as described here: http://symfony.com/doc/current/controller/soap_web_service.html.
I'm using PHP2WSDL to generate the WSDL (after having failed to create a valid one by hand!). I have a service class with a bunch of methods that will be exposed via SOAP. And the Symfony controller will shovel the POST data into the SoapServer instance and barf out the yukky XML response back to the client.
But I'm pretty sure that SoapServer is not calling the methods on my service class. I can see from SoapServer::getFunctions that all the PHP2WSDL @soap annotated methods have been registered by my SoapServer instance, but nothing my methods are supposed to do seems to be happening; no logging, not even throw new \Exception('@#!?!'); on the first line.
The actual symptom I have is that, after the SoapClient tries to __soapCall a method (in the other application), it expects to have received some SoapHeaders (which my method might be setting; I just don't know) but the response headers are empty.
Code
Commented lines are things I've been using to try and debug.
Symfony controller
class DefaultController extends Controller
{
    const SERVICE_URI = 'http://example.com/api';

    public function wsdlAction()
    {
        $log = new Logger('api');

        $response = new Response();
        $response->headers->set('Content-Type', 'text/xml');
        $response->setContent($this->makeWsdl());

        // $log->debug(sprintf('[%s] WSDL response', __METHOD__));

        return $response;
    }

    public function operationAction(Request $request)
    {
        $log = new Logger('api');

        try {
            $wsdlFile = tmpfile();
            $wsdlPath = stream_get_meta_data($wsdlFile)['uri'];
            file_put_contents($wsdlPath, $this->makeWsdl());
        } catch (Exception $e) {
            $log->error(sprintf('[%s] Couldn\'t create the temporary WSDL file for SoapServer: "%s"', __METHOD__, $e->getMessage()));
            throw $e;
        }

        // $c = file_get_contents($wsdlPath);
        // $log->debug(sprintf('[%s] Created WSDL temporary file in %s: %s', __METHOD__, $wsdlPath, $c));

        $server = new SoapServer(
            $wsdlPath,
            [
                'soap_version' => SOAP_1_1,
                'encoding' => 'UTF-8',
            ]
        );

        // $log->debug(sprintf('[%s] Created server', __METHOD__));
        $server->setObject(new MyService($server, $log));
        // $log->debug(sprintf('[%s] Set server object', __METHOD__));
        // foreach ($server->getFunctions() as $f) {
        //     $log->debug(sprintf('[%s] SOAP function: %s', __METHOD__, (string) $f));
        // }

        $response = new Response();
        $response->headers->set('Content-Type', 'text/xml; charset=UTF-8');
        // $log->debug(sprintf('[%s] Create new response', __METHOD__));

        ob_start();
        // $log->debug(sprintf('[%s] Calling server->handle(%s)', __METHOD__, $request->getContent()));
        $server->handle($request->getContent());
        // $log->debug(sprintf('[%s] Setting response content', __METHOD__));
        $response->setContent(ob_get_clean());

        // $log->debug(sprintf('[%s] operate response', __METHOD__));

        return $response;
    }

    private function makeWsdl()
    {
        $wsdlGenerator = new PHP2WSDL\PHPClass2WSDL(MyService::class, self::SERVICE_URI);
        $wsdlGenerator->generateWSDL(true);

        return $wsdlGenerator->dump();
    }
}

This controller mostly "works". I mean, you can call the route for the WSDL and you get the WSDL. And you can call the route for the operations and it does all the work up to $server->handle($request->getContent()); where it throws an exception.
MyService
class MyService
{
    private $server;
    private $log;

    public function __construct(SoapServer $server, Logger $log)
    {
        $this->server = $server;
        $this->log = $log;
        // $this->log->debug(sprintf('[%s] __construct called', __METHOD__));
    }

    /**
     * @soap
     */
    public function Login(array $parameters = [])
    {
        // throw new \Exception('Login throws immediately');

        // $this->log->debug(sprintf('[%s] Login called: %s', __METHOD__, json_encode($parameters)));

        $this->server->addSoapHeader(new SoapHeader(
            'http://example.com/api',
            'AuthHeader',
            ['Token' => 'fake-token']
        ));

        return true;
    }
}

The WSDL is generated from this class by PHP2WSDL which seems to be working perfectly.
The external application that calls my controller is throwing an exception because it's expecting to get this AuthHeader SOAP header in the SOAP response that comes from my DefaultController. But it isn't finding one. But whether or not my attempt to use addSoapHeader here is correct, I can't see that this Login method is even being called.
The external application
$this->client = new SoapClient('http://example.com/api/wsdl', [
    'trace' => 1,
    'encoding' => 'UTF-8',
    'soap_version' => SOAP_1_1,
    'cache_wsdl' => WSDL_CACHE_NONE,
    'location' => 'http://example.com/api',
]);

...

$response = $this->client->__soapCall(
    'Login',
    ['username' => '', 'password' => ''],
    [],
    null,
    $outputHeaders
);

...

if ($outputHeaders['AuthHeader']) {
    ...

This is the code that ultimately throws the exception when $outputHeaders['AuthHeader'] is not set. From here, I can dump the SOAP requests and responses. Here's the request:
<?xml version="1.0" encoding="UTF-8"?>
<envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://example.com/api/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" soap-env:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/">
  <body>
    <login>
      <parameters xsi:type="ns2:Map">
        <item>
          <key xsi:type="xsd:string">username</key>
          <value xsi:type="xsd:string"></value>
        </item>
        <item>
          <key xsi:type="xsd:string">password</key>
          <value xsi:type="xsd:string"></value>
        </item>
      </parameters>
    </login>
  </body>
</envelope>

And the response, of course, is empty; as are the output headers.
This code is the "legacy" bit that I can't change. For a bit more background: it calls a real, third-party SOAP service and what I'm trying to do at the moment is build a mock of that service that can be used for testing.


text:
Q: Is there a way to specify an XML file in block comments in Kotlin class? I can't figure out a way to mention an XML file inside block comments in a Kotlin class. I know it is possible to tag a class or function but what about an XML file in an Android project.
Something like this where nav_graph.xml is the file to be tagged:

/**
 * For details check [nav_graph]
 */

A: It doesn't appear on their official documentation that you can actually link XML/Resources. Just classes, functions, and variables. KDocs is a simpler in features compared to javadocs.


text:
Q: How to pass the contents of a container to a variadic function in C++ Imagine we have a variadic function void foo(T args...) for an existing type T.
In Java (void foo(T... args)) and C# (void foo(params T[] args)) passing an array of type T T[] is a valid way to pass it's contents as arguments to foo.
In Scala (def foo(args: T*): Unit) I may pass a Seq[T].
How do I pass the contents of a container (array, vector, iterator, whatever) as arguments to a variadic function in C++? Is it even possible?

A: The varargs argument list in C++ is established at compile time, not at runtime, so if anything, you can only pass a fixed-length array of items in.
You can call a function with a tuple of arguments using std::apply(). You can create a tuple from a fixed size array.
Alternatively, you could also create your own apply-like template helper function which recursively assembles a parameter pack from the elements of an array and calls the function for you, or use one of the myriad of metaprogramming helpers from the standard library to do it for you.


text:
Q: How to change view after click? I do design. And i am not know how.

if I clik on the item, should appear red view  in right side.
I am use GridView  and my adapter public class BasketAdapter extends BaseAdapter
Item XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="142dp"
              android:layout_height="wrap_content"
              android:background="#eceff3"
              android:paddingBottom="1dp">

    <RelativeLayout
        android:orientation="vertical"
        android:layout_width="141.25dp"
        android:layout_height="138.75dp"
        android:background="#fff">

        <ImageView
            android:layout_width="65dp"
            android:layout_height="65dp"
            android:id="@+id/goodImage"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="10dp"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true" />

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="27dp"
            android:layout_below="@+id/goodImage"
            android:layout_marginTop="11dp"
            android:id="@+id/linearLayout3"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:layout_marginLeft="28.75dp"
            android:layout_marginRight="28.75dp">

            <TextView
                android:layout_width="match_parent"
                android:layout_height="fill_parent"
                android:text="bascetName"
                android:id="@+id/bascetName"
                android:textSize="12.50sp"
                android:textStyle="bold"
                android:textColor="#333333"
                android:ellipsize="end"
                android:singleLine="false"
                android:gravity="center_horizontal" />
        </LinearLayout>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="$1.23"
            android:id="@+id/bascetPrice"
            android:textSize="13.75sp"
            android:layout_gravity="center_horizontal"
            android:textColor="#ffc600"
            android:layout_below="@+id/linearLayout3"
            android:layout_centerHorizontal="true"
            android:layout_marginTop=" 8.75dp" />

        <ImageView
            android:layout_width="32dp"
            android:layout_height="38.50dp"
            android:id="@+id/countImage"
            android:src="@drawable/count"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="false" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="3"
            android:id="@+id/basketQuantity"
            android:textSize="12.50sp"
            android:textStyle="bold"
            android:layout_gravity="right"
            android:autoText="false"
            android:textColor="#ffffff"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:layout_marginBottom="5dp"
            android:layout_marginRight="5dp" />

    </RelativeLayout>

</LinearLayout>

adapter
public class BasketAdapter extends BaseAdapter implements View.OnClickListener {
    private List<ShoppingCart> items;
    private AnimateFirstDisplayListener animateFirstDisplayListener = new AnimateFirstDisplayListener();
    private DisplayImageOptions options = ILOptions.getOption();
    private Typeface font;

    public BasketAdapter(List<ShoppingCart> items) {
        this.items = items;
    }

    @Override
    public int getCount() {
        return items.size();
    }

    @Override
    public ShoppingCart getItem(int position) {
        return items.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;

        if (null == convertView) {
            LayoutInflater inflater = LayoutInflater.from(parent.getContext());
            font = Fonts.getBlockBertholdRegular(parent.getContext());
            convertView = inflater.inflate(R.layout.basket_item, parent, false);
            holder = new ViewHolder();
            holder.name = (TextView) convertView.findViewById(R.id.bascetName);
            holder.price = (TextView) convertView.findViewById(R.id.bascetPrice);
            holder.imageView = (ImageView) convertView.findViewById(R.id.goodImage);
            holder.imageCount = (ImageView) convertView.findViewById(R.id.countImage);
            holder.quantity = (TextView) convertView.findViewById(R.id.basketQuantity);

            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        holder.name.setText(items.get(position).getItem().getName().toUpperCase());
        holder.name.setTypeface(font, Typeface.BOLD);
        holder.price.setText("$" + items.get(position).getTotal());
        holder.price.setTypeface(font, Typeface.NORMAL);
        ImageLoader.getInstance().displayImage(items.get(position).getItem().getImage(), holder.imageView, options, animateFirstDisplayListener);
        if (items.get(position).getItemCount() == 1) {
            holder.imageCount.setVisibility(View.GONE);
            holder.quantity.setVisibility(View.GONE);
        } else {
            holder.quantity.setText(String.valueOf(items.get(position).getItemCount()));
            holder.quantity.setTypeface(font, Typeface.BOLD);
        }
        convertView.setOnClickListener(this);
        return convertView;
    }

    @Override
    public void onClick(View v) {
        Toast.makeText(v.getContext(),"cvcxvfdg",Toast.LENGTH_LONG).show();
    }

    private static class ViewHolder {
        TextView name;
        TextView price;
        ImageView imageView;
        ImageView imageCount;
        TextView quantity;
    }
}

I will add something else if necessary. may have a library ready?

A: Change your ImageView by click gridview item:
gridView.setOnItemClickListener(new OnItemClickListener() {

    @Override
    public void onItemClick(AdapterView<?> parent, View view,
            int position, long id) {
        ViewHolder holder = (ViewHolder)view.getTag();

        //set your new image here
        holder.imageview.setImageResource(R.id.yourImage);
        ... ...

        //maybe also update items content in 'position' if need
    }
});

Hope this help!


text:
Q: C# Handle GUI in MVC I am using the asp.net MVC Framework. IN my application a user has to log in. And when the combination of username and password is correct, the div (or panel?) with with the menu in it, must become visible. But how can I do this? When a name my panel pnlMenu, in my controller i cannot do something like:
pnlMenu.visible = true;

So, how do i have to do this?

A: What you should do is in your controller check to see if a user is logged in and set a value in the ViewData like this:
ViewData["IsLoggedIn"] = true;

Then in your view you can set the visibility of the method based on this value. This way if you change the view later, or decide to have multiple views, they can each use this value and there isn't any coupling between your view and your controller.

A: Create a method or property on your View that enables you to hide or show the appropriate controls ?
Then, in your Controller you can access that property or method of your View, can't you ?
You do not want to reference specific 'controls' on your View in your controller, since, one of the ideas of MVC is that you can just replace the UI with another implementation (web / win / ...) and make use of the same controllers and application logic.
Then, you just want to describe an operation that your View should support, so, in the interface that describes the 'contract' that your View must support, you should create a method which is called 'ChangeState( bool loggedIn )' for instance.
In the controller, you can call this method when the user has logged in.


text:
Q: JAI save byte[] to .tiff file I'm trying to save a byte[] of raw image data to a .tiff file on my harddrive with the help of the Java Advanced Imaging API.
There are some minor examples on the web but they didn't help me really because they don't match my exact problem.
I already managed to save the data from the byte[] to a .raw and can view the result with success so the source actually contains some data.
The method in question is executable without any exceptions but all I get is a black image whenever I view it with the Windows XP ImageViewer.
This is my method:
public void saveTif(byte[] imgData) {
    BufferedImage bufferedImage = new BufferedImage( 1280, 1024, BufferedImage.TYPE_BYTE_GRAY );
    bufferedImage.createGraphics().drawBytes(imgData, 0, 1280*1024, 0, 0);

    TIFFEncodeParam params = new TIFFEncodeParam();
    params.setCompression( TIFFEncodeParam.COMPRESSION_NONE );
    String filenametiff = path + File.separatorChar + new SimpleDateFormat("dd_MM_yyyy_HH_mm_ss'.tiff'").format(new Date());
    JAI.create("filestore", bufferedImage, filenametiff, "TIFF", params);
}

A: Graphics.drawBytes() is used for drawing text (and it's not very good for that, as it uses byte[], rather than char[] or String, thus not supporting charsets) onto the image.
Graphics.drawBytes() can't be used to draw raw pixels.
To get a correct representation of your image, you should rather create a new BufferedImage from your pixel data, or create a matching image and set the data onto it. Have a look at the Raster and DataBuffer classes.


text:
Q: HMM - which are possible hidden states and observational states in this scenario? I have read about HMMs including an weather example and how to apply them on credit card fraud detection. Now I want to apply HMMs to detect credit card fraud on an ATM transaction. I am confused as to which are hidden states and observations in my scenario.
The situation is as follows: A card holder is performing withdrawal transaction on an ATM, Now I want to use HMMs  to tell whether the transaction is fraudulent or not. I am considering features like:

*

*Withdrawal amount.

*Time to input PIN.

*Location of ATM
I have tried to model it as follows: Hidden states on transaction as :Suspicious and Non-Suspicious. The observation as : withdrawal amount, time to input PIN and Location but its not making sense to me.
Question:
Which can be my hidden states and observations?

A: Why doesn't it make sense ? I am not sure if your question is about how to model Markov dependencies.
If your concern is about how to model the all 3 observation together, you can stack 3 observations in to a vector. Then this is your observation vector (like in a Kalaman filter). You can assume given the hidden states those three observations are independent. (If you cannot make that assumption still you can model it, but with complex observation probability distribution.)
If $Z^T = [Z_1,Z_2,Z_3]$ is your observation vector and $X$ is the hidden states, you can write the observation probability as,
$P(Z\mid X) = \prod\limits_{i=1}^3P_i(Z_i\mid X)$.


text:
Q: Verilog bit shift by constant, how is it implemented? I have a line of code like
parameter [8:0] param1=8'd05, param2 = 8'd20;
A <= cond ? (1 << param1) : (1 << param2);

Will the compiler recognize 1 << param is a constant and replace that expression with a constant or will it try to implement some sort of bit shifter?

A: Parameters are evaluated at compile time and must be constants.
From IEEE Std 1364-2001:

3.11 Parameters Verilog HDL parameters do not belong to either the variable or the net group. Parameters are not variables, they are
  constants.

So it is really up to the Synthesis tool how it will decide to implement a shift by that constant, but any reasonable implementation will simply select the correct wires out of the vector.
In addition, since your examples are constants shifted by a constant, the whole expression reduces to a constant and the code will be equivalent to:
A <= cond ? 32'h20 : 32'h100000;


text:
Q: MFMailComposeViewController reacting to sent emails based on recipient I have a button that will allow a user to send an email to a support address. There is also the option to use an email to share content with other users.
In the latter case, the fact that user has shared via email is tracked for statistical analysis.
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error {

if (result == MFMailComposeResultSent){
    [[TrackingHelper sharedTracker] trackEvent:@"Product" action:@"SharedViaEmail" label:self.product.name];

}

[self dismissViewControllerAnimated:YES completion:NULL];

}
Since this will be called both when the user shares via email and when the user sends a support email, I was wondering if there was a way to differentiate between the two in the delegate? the MFMailComposeResult is not useful as it only returns wether it succeeded or not. I was hoping to make a determination by retrieving the recipients of the sent mail and matching it to the support address, but as far as I know there is no way to do this.
Does anyone know if there is a way to accomplish this?

A: The way I usually do it was to define a variable to track which option was activated.
When "support email" is selected, set a flag isSupportEmail = YES
else NO.
Then, in mailComposeController,
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
    if (result == MFMailComposeResultSent)
    {
        if(isSupportEmail)
            [[TrackingHelper sharedTracker] trackEvent:@"Support" action:@"SupportViaEmail" label:self.product.name];
        else
            [[TrackingHelper sharedTracker] trackEvent:@"Product" action:@"SharedViaEmail" label:self.product.name];
    }

    [self dismissViewControllerAnimated:YES completion:NULL];
}


text:
Q: ggplotly in r generates different legend from ggplot I have created the following dataframe in R. The first step is to import the necessary libraries
 library(ggplot2)
 library(plotly)
 library(dplyr)

We create the dataframe here as follows
  DF_1<-data.frame("A"= c(1:10))
  DF_1$B<-c("D", "C")
  DF_1$C<-DF_1$A^2

Next we create a plot as follows
  p2<-ggplot(DF_1, aes(x=A, y=C, group=B, fill=B)) +
  geom_line(size=.5) +  geom_ribbon(data=subset(DF_1),aes(x=A,ymax=C),ymin=0,alpha=0.3) +
  scale_fill_manual(name='Legend', values=c("green4",  "red"), labels=c("D", "C" ))+theme_bw()

When p2 is rendered, the legend displays correctly. When I nest p2 in ggplotly, the legend changes to two dark lines.
   p3<-ggplotly(p2, dynamicTicks = T)
   p3= layout(p3, xaxis = list(type = "log"))

Is it possible to retain the legends of p2 in p3. I request someone to take a look

A: Looks like ggplotly is a more sensible than ggplot2 in how one sets the aesthetics. Simply moving the fill aes from the global setup in ggplot into geom_ribbon gives the correct legend:
library(ggplot2)
library(plotly)
library(dplyr)

DF_1<-data.frame("A"= c(1:10))
DF_1$B<-c("D", "C")
DF_1$C<-DF_1$A^2

ggplot(DF_1, aes(x = A, y = C, group=B)) +
  geom_line(size=.5) +
  geom_ribbon(aes(x = A, ymin = 0, ymax = C, fill = B), alpha=0.3) +
  scale_fill_manual(name='Legend', values=c("green4",  "red"), labels=c("D", "C" ))+theme_bw()

ggplotly(dynamicTicks = T) %>%
  layout(xaxis = list(type = "log"))