text:
Q: Unable to configure json with spring - Request method 'GET' not supported I'm not able to correctly configure json support with Spring 4.0.4. A json request results in:
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.getHandlerInternal(246):  - Looking up handler method for path /equipments/datatable.json
org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver.resolveException(134):  - Resolving exception from handler [null]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'GET' not supported
org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver.resolveException(134):  - Resolving exception from handler [null]:             org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'GET' not supported
org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver.resolveException(134):  - Resolving exception from handler [null]:      org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'GET' not supported
org.springframework.web.servlet.PageNotFound.handleHttpRequestMethodNotSupported(198):  - Request method 'GET' not supported

I have an applicationContext.xml and a my-servlet.xml:
web.xml
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/conf/applicationContext.xml
        /WEB-INF/conf/my-security.xml
    </param-value>
</context-param>

<servlet>
    <servlet-name>losap</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/conf/my-servlet.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

applicationContext.xml
<mvc:annotation-driven />
<task:annotation-driven />
<tx:annotation-driven />

<context:component-scan base-package="com.htg.*">
   <context:exclude-filter type="regex" expression="com\.htg\.myapp\.mvc"/>
</context:component-scan>

<bean id="messageAdapter"
    class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
    <property name="messageConverters">
        <util:list>
            <bean
                class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" />
        </util:list>
    </property>
</bean>

my-servlet.xml
<mvc:annotation-driven/>
<context:component-scan base-package="com.htg.myspp.mvc" />

pom.xml
<dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.13</version>
</dependency>

Controller
@Controller()
@RequestMapping(value = "/equipments")
public class EquipmentController extends BaseController {

    @RequestMapping(value = "/datatable.json", method = RequestMethod.GET, headers = "Accept:*/*", produces = "application/json")
    public @ResponseBody Equipment getEquipmentsDatatable(Model model) {
        Equipment e = new Equipment();
        e.setEquipmentName("Lathe 123");
        e.setEquipmentNumber("12345TTY");
        e.setId(89L);
        return e;
    }
}

jQuery
$.getJSON($('#ctxtrelurl').val() + 'equipments/datatable.json', function(e) {
    console.log(e.equipmentName);
});

Chrome Dev. Tools output

I have a feeling it has something to do with having two separate context config. files. Any pointers will be greatly appreciated.

A: ok, my guess is, that spring doesn't map /datatable.json properly because of the "." I had similar problem at mapping this:
@RequestMapping(value="/somestuff/{fileName:.+}"

i had to put :.+ so spring can properly map the url.
spring seems to truncate ".something" in this case. I actually don't know if it's the case on regular mapping, without @PathVariable. But you could try to map your URL without the dot and check if it will help
And that's why spring try to call the {equipId} function, that is waiting for PUT request. That's why in the response header you see : allow:PUT


text:
Q: Unbiased estimator for $p^2$. Bernoulli distribution. Let $X_{1},...,X_{n}$ be a random sample from Bernoulli (p), find an unbiased estimator for $p^{2}$.
I think It's the same estimator for $\mathrm{Bin}(n,p)$ so:
$${V}(X) = np(1-p) = np - np^2 \\
p^2 =\frac{1}{n}(np - {V}(X)) =\frac{1}{n}({E}[X] - {V}(X)) \\
\hat{p}^2=\frac{1}{n} \left(\hat{p} - \frac{\hat{p}(1-\hat{p})}{n} \right) $$
$\hat{p}^2$ is unbiased because
a linear combination of unbiased estimators for two quantities will be an unbiased estimator for the same linear combination of these quantities
Is correct?

A: Your notation is confusing.  $\hat p^2$ could either mean $(\hat p)^2$, or it could mean $\widehat{p^2}$.  You also don't define $\hat p$ itself.
The question asks for an unbiased estimator of $p^2$.  Naturally, an unbiased estimator of $p$ is $$\hat p = \bar X = \frac{1}{n}\sum_{i=1}^n X_i,$$ the sample mean of observations.  We can confirm this by computing $$\operatorname{E}[\hat p] = \operatorname{E}\left[\frac{1}{n} \sum_{i=1}^n X_i\right] = \frac{1}{n} \sum_{i=1}^n \operatorname{E}[X_i] = \frac{1}{n} \sum_{i=1}^n p = \frac{1}{n} \cdot np = p.$$
What if we simply took as our estimator for $p^2$ $$(\hat p)^2 = (\bar X)^2 = \left(\frac{1}{n} \sum_{i=1}^n X_i\right)^2?$$  What is the expectation of this value?  Well, there are a few ways we can compute it.  The naive way is to perform the expansion; i.e. $$\operatorname{E}\left[\left(\frac{1}{n} \sum_{i=1}^n X_i \right)^2\right] = \frac{1}{n^2} \sum_{i=1}^n \sum_{j=1}^n \operatorname{E}[X_i X_j].$$  When $i \ne j$, $\operatorname{E}[X_i X_j] = \operatorname{E}[X_i]\operatorname{E}[X_j]$ because they are independent; but when $X_i = X_j$, we have $$X_i X_j = X_i^2,$$ hence $$\operatorname{E}[X_i^2] = \operatorname{Var}[X_i] + \operatorname{E}[X_i]^2 = p(1-p) + p^2 = p.$$  Since in our double sum we have $n$ instances where $i = j$ and $n^2$ terms in total, it follows that $$(\hat p)^2 = \frac{1}{n^2} \left( (n^2-n) p^2 + n p\right) = \frac{p(1-p)}{n} + p^2.$$  So the bias here is $p(1-p)/n$.  To rid ourselves of it, we should collect like terms in $p$ to get $$(\hat p)^2 = \frac{p}{n} + \frac{n-1}{n} p^2,$$ from which we see from linearity of expectation that $$(\hat p)^2 - \frac{\hat p}{n} = \frac{n-1}{n} p^2.$$  Notice while it looks like we simply replaced $p$ with $\hat p$ and rearranged the equation, this is not what we actually did.  What actually happened is $$\operatorname{E}\left[(\hat p)^2 - \frac{\hat p}{n}\right] = \operatorname{E}[(\hat p)^2] - \frac{1}{n}\operatorname{E}[\hat p] = \left(\frac{p}{n} + \frac{n-1}{n} p^2\right) - \left(\frac{p}{n}\right) = \frac{n-1}{n} p^2.$$  Therefore, our unbiased estimator should be $$\widehat{p^2} = \frac{n}{n-1}\left((\hat p)^2 - \frac{\hat p}{n}\right).$$

A: Interesting, buy my mistake was to take the Bernoulli as Binomial distribution, absolutely wrong. We'll show that $p^2$ is not estimable. Suppose there was a function g of X that satisfied the equation
$E_pg(X) = p^2$ for all possible $p ∈ (0,1)$
To hold for all p, one must have
$g(1)p+g(0)(1− p) = p^2$ for all $p ∈ (0,1)$
If this equation holds for all p, then we would have a function $f$, namely
$f(p) = p^2 +(g(0)−g(1))p−g(0)$,
that is quadratic in the variable $p$ and is equal to zero for all $p$ in the interval (0,1). But there can be no such quadratic function, as quadratic functions (whose graphs are parabolic) can have at most two real roots, that is, can have at most two values of $p$ for which $f(p)=0$. It follows that a function $g$ satisfying the property $E_pg(X) = p^2$ does not exist.

redpajama_set_name: RedPajamaStackExchange


text:
Q: "To" or without "to" Is first one incorrect? If so, then and why there should be to?
And what respond would be?

Where did you disappear?

Where did you disappear to?

A: *

*Where did he disappear?

Answer: He disappeared in the woods.

*

*Where did you disappear to? [meaning: where did you go? I didn't see you]

Answer: I went out jogging
disappear to is used in colloquial spoken language to mean: go, when it seems that a person has "disappeared". Indeed, they have disappeared from the view of the speaker.


text:
Q: AndEngine Physics Box2D Extension I'm using AndEngine for my android game, I downloaded the master AndEngine from github,but there is no Physics Box2D Extension for master. I don't know where to download it or which version of it could I use?

A: If you are using nicolas' copy of AndEngine, look at his account on GitHub. All the extensions are listed under his repositories: https://github.com/nicolasgramlich
The Box2DExtension is here: https://github.com/nicolasgramlich/AndEnginePhysicsBox2DExtension
If you are like me using RealMayo's fork of AndEngine however you will have to also use his copy of the PhysicsBox2DExtension which is located here: https://github.com/RealMayo/AndEnginePhysicsBox2DExtension


text:
Q: ValueError: operands could not be broadcast together (not being able to print the line charts) I have tried the following
(mydata/mydata.iloc[0]*100).plot(figsize = (50,5));
plt.show()

But got the error

ValueError: operands could not be broadcast together (1004, ) (4,)

A: Tried to recreate your dataset and it looks like your columns are all of type object
mydata.dtypes

PG      object
MSFT    object
GE      object
F       object
dtype: object

so you'll need to convert it to float before performing the division:
import pandas_datareader.data as wb

tickers = ['PG','MSFT','GE','F']
mydata = pd.DataFrame()
for t in tickers:
    mydata[t] = wb.DataReader(t,data_source = 'robinhood',start = '2006-01-04', end = '2010-01-01')['close_price'].values

((mydata.astype(float)/mydata.astype(float).iloc[0])*100).plot(figsize = (50,5));
plt.show()


text:
Q: How to reinstall Snow Leopard on my MBP? I've been installing some applications and some things are not working properly. I want to reset my MBP to factory settings. How do I do a clean installation so I can start from scratch?

A: Just put in the Install DVD.
You can do that with the computer running and run the installer from the disc.
You can also boot directly to the disc by turning off the computer, putting it in, holding down the c key, and turning the computer on.
Follow the directions, and you'll have a clean install. Your personal files and preferences will be saved, but system files will be replaced.


text:
Q: How to use conditional compile to sniff IE8 I want to sniff the current version of IE8 (and I'm so sorry, but no other way, I have to do that). I know that feature sniffing should be used instead of browser sniffing, but hey, my boss doesn't know that, right?
Now I used this conditional compiling code:
var ie8 = false/*@cc_on @_jscript_version == 8@*/

But seems that it also includes IE7. Any idea?

A: Without using conditional compiles, you could use conditional comments to set a class on the html element for each IE you want to test for, like:
<!--[if lt IE 7 ]> <html lang="en" class="ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->

(from http://initializr.com/)
Then it would be a simple matter of testing for the class in JS:
var ie8 = !!document.getElementsByTagName("html")[0].className.match(/ie8/);

A: The following presumes you are using Internet Explorer...
Firstly, it is extremely abnormal to test for the browser version - the document.documentMode is what should be tested for (because a page can be in IE8 mode even if using IE9 or IE10):
if (document.documentMode == 8) { ...

If you have some really strange requirement, then you can reliably detect the JScript version e.g. _jscript_version is 5.8 for IE8 (see http://en.wikipedia.org/wiki/Conditional_comment ):
var ieJsVer = Function('return/*@cc_on @_jscript_version @*/;')();
var isIE8 = (ieJsVer == 5.8);

The conditional comment is put inside a string so that it won't be removed by any JavaScript compression that might occur (which may strip out comments).
Important Internet Explorer 11 edit:

*

*Added ; at end of Function() string - otherwise IE11 in EDGE mode throws an exception - arrrgh!

*IE11 in EDGE mode then ieJsVer is undefined

*IE11 in docMode <= 10 then ieJsVer is 11

*IE11 in EDGE mode returns undefined for document.documentMode

A: Why not use conditional comments to toggle a script that sets the variable?  Like:
<head>
    <script>
        window.ie8 = false;
    </script>
    <!--[if IE 8]>
        <script>
            window.ie8 = true;
        </script>
    <![endif]-->
</head>

Granted it's a bit verbose, but perhaps it's also more reliable.


text:
Q: How To Convert a Bitmap to a Collection of Paths in WPF (in code not XAML) I have an occupancy grid that has 3 states - Occupied, Free, Unknown.  Occupancy grid is a simple 2 dimensional array of states.  The grid represents a floor plan where Occupied=Wall, Free=Open Floor, Unknown=what's behind the wall or not mapped.  This grid is say 800x800 wide with each cell representing 5cm of the real world.
I want to take this and make it into a WPF Path Shape.  Then I can then manipulate on the screen, Allow a user to add walls (by drawing lines), and eventually export to some form of CAD standard/SVG/etc.
I started playing with writable bitmaps and can create a perfect picture of the grid, how ever a bitmp isn't a path, and some of my lines are jagged or unconnected.
I am looking for ideas on how to translate this grid, or thebitmap, into clean wpf shapes.  Lines, Polygons, Polylines, or Paths would all make me very happy becuase once I have those I can do anything.  Any ideas?

A: If your walls are only in some basic geometrical shapes (lines, others like circles get much more complicated) you might want to use Hough transform or some other transform, depending how your images look like. If I understand it correctly that your images have only three colours you might not have to use some edge detection algorithm.
Edit: If the Occupied state represents only thin surfaces of walls that is all you need. You would get lines for your walls (delimiting free/unknown areas)


text:
Q: How to get a C++17 environment on macOS High Sierra? macOS High Sierra and Xcode 9 come with an old version of LLVM. It's not obvious which version of LLVM it is because of version number mangling. However, it's apparent it's old as the latest version of LLVM supports C++17 but features like std::optional are not available.
I'd like to write some C++17 code using a Mac. What toolchains are available and what has the fewest complications to get working? My thoughts so far:

*

*LLVM via Homebrew -- interference with/by Xcode?

*GCC via Homebrew

*Above compiled from source

Any preferred method?

A: This 'answer' is not an answer to your question.  These are the handy bookmarks I use.
I'd use Homebrew to install clang++ (see link below).  But if you really want Xcode to interop with it, I'd suggest the "bad news" of wait for Apple, or try out their latest beta.  And keep in mind that Apple's "Objective-C++" (*.mm) probably requires Apple's secret sauce, if you have some sort of C++ / Cocoa project.
C++17 implementation status:

*

*https://clang.llvm.org/cxx_status.html
Xcode -to- CLang version:

*

*https://gist.github.com/yamaya/2924292
Homebrew to get CLang (clang++):

*

*https://apple.stackexchange.com/questions/227026/how-to-install-recent-clang-with-homebrew


text:
Q: Getting more context about a a latex error I'm trying to run Beamer to get a listing in a presentation.
I'm getting a mysterious error message that looks like:
! Missing number, treated as zero.
<to be read again>
               \let
l.221 \end{frame}

? H
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
 look up `weird error' in the index to The TeXbook.)

Part of my problem is that \let is not in my code, this must be the expansion of a macro.  My immediate question is "How can I get TeX to give me information about what macros it was expanding when it encountered the error?"  That might give me a clue about what to do next.
More context:
I'm trying to use an algorithm listing of json objects in Beamer.
I have the following defined in my header:
\usepackage{algorithmicx}
\usepackage{algorithm}
\floatname{algorithm}{Example}
%--------------------------------------------
%JSON listing mode, from
% https://tex.stackexchange.com/questions/83085/how-to-improve-listings-display-of-json-files#83100

\usepackage{listings}
\usepackage{xcolor}

\colorlet{punct}{red!60!black}
\definecolor{background}{HTML}{EEEEEE}
\definecolor{delim}{RGB}{20,105,176}
\colorlet{numb}{magenta!60!black}

\lstdefinelanguage{json}{
  basicstyle=\normalfont\ttfamily,
  numbers=left,
  numberstyle=\scriptsize,
  stepnumber=1,
  numbersep=8pt,
  showstringspaces=false,
  breaklines=true,
  frame=lines,
  backgroundcolor=\color{background},
  literate=
   *{0}{{{\color{numb}0}}}{1}
    {1}{{{\color{numb}1}}}{1}
    {2}{{{\color{numb}2}}}{1}
    {3}{{{\color{numb}3}}}{1}
    {4}{{{\color{numb}4}}}{1}
    {5}{{{\color{numb}5}}}{1}
    {6}{{{\color{numb}6}}}{1}
    {7}{{{\color{numb}7}}}{1}
    {8}{{{\color{numb}8}}}{1}
    {9}{{{\color{numb}9}}}{1}
    {:}{{{\color{punct}{:}}}}{1}
    {,}{{{\color{punct}{,}}}}{1}
    {\{}{{{\color{delim}{\{}}}}{1}
    {\}}{{{\color{delim}{\}}}}}{1}
    {[}{{{\color{delim}{[}}}}{1}
    {]}{{{\color{delim}{]}}}}{1},
}

The code for the frame in the Beamer file is:
\begin{frame}{Proc4 Messages}
  \begin{columns}
    \begin{column}{0.5\textwidth}
      \begin{algorithm}
    \begin{lstlisting}[language=json]
      {
        app:"ecd://coe.fsu.edu/EPLS/AssessmentName",
        uid:"Student/User ID",
        timestamp:"Time at which event occurred",
        verb:"Action Keyword",
        object:"Object Keyword",
        data:{
          field1:"Value",
          field2:["list","of","values"],
          field3:{part1:"complex",part2:"object"}
        }
      }
  \end{lstlisting}
      \end{algorithm}
    \end{column}
    \begin{column}{0.5\textwidth}
      \begin{itemize}
       \item Application header defines vocabulary used in other
          fields.
       \item ...
        \item Data field can hold any number/kind of object.
      \end{itemize}
    \end{column}
  \end{columns}
\end{frame}

The same listing runs fine in another document that uses article rather than beamer style, and the rest of the frame is pretty standard.

A: This turns out to be related to another issue found in
https://stackoverflow.com/questions/2981008/latex-issue-with-beamer-and-listings
If I change \begin{frame}{title...} to \begin{frame}[containsverbatim]{title...} it works as expected.


text:
Q: How to deal with a mix of binary and continuous inputs in neural networks? I'm using the nnet package in R to attempt to build an ANN to predict real estate prices for condos (personal project). I am new to this and don't have a math background so please bare with me.
I have input variables that are both binary and continuous. For example some binary variables which were originally yes/no were converted to 1/0 for the neural net. Other variables are continuous like Sqft.
Sample of input data
I have normalized all values to be on a 0-1 scale. Maybe Bedrooms and Bathrooms shouldn't be normalized since their range is only 0-4?
Do these mixed inputs present a problem for the ANN? I've gotten okay results, but upon closer examination the weights the ANN has chosen for certain variables don't seem to make sense. My code is below, any suggestions?
ANN <- nnet(Price ~ Sqft + Bedrooms + Bathrooms + Parking2 + Elevator +
            Central.AC + Terrace + Washer.Dryer + Doorman + Exercise.Room +
            New.York.View,data[1:700,], size=3, maxit=5000, linout=TRUE, decay=.0001)

UPDATE:
Based on the comments below regarding breaking out the binary inputs into separate fields for each value class, my code now looks like:
ANN <- nnet(Price ~ Sqft + Studio + X1BR + X2BR + X3BR + X4BR + X1Bath
        + X2Bath + X3Bath + X4bath + Parking.Yes + Parking.No + Elevator.Yes + Elevator.No
        + Central.AC.Yes + Central.AC.No + Terrace.Yes + Terrace.No + Washer.Dryer.Yes
        + Washer.Dryer.No + Doorman.Yes + Doorman.No + Exercise.Room.Yes + Exercise.Room.No
        + New.York.View.Yes + New.York.View.No + Healtch.Club.Yes + Health.Club.No,
    data[1:700,], size=12, maxit=50000, decay=.0001)

The hidden nodes in the above code are 12, but I've tried a range of hidden nodes from 3 to 25 and all give worse results than the original parameters I had above in the original code posted. I've also tried it with linear output = true/false.
My guess is that I need to feed the data to nnet in a different way because it's not interpreting the binary input properly. Either that, or I need to give it different parameters.
Any ideas?

A: One way to handle this situation is to rescale the inputs so that their variances are on roughly the same scale. This advice is generally given for regression modeling, but it really applies to all modeling situations that involve variables measured on different scales. This is because the variance of a binary variable is often quite different from the variance of a continuous variable. Gelman and Hill (2006) recommend rescaling continuous inputs by two standard deviations to obtain parity with (un-scaled) binary inputs. This recommendation is also reflected in a paper and blog post.
A more specific recommendation for neural networks is to use "effect coding" for binary inputs (that is, -1 and 1) instead of "dummy coding" (0 and 1), and to take the additional step of centering continuous variables. These recommendations come from an extensive FAQ by Warren Sarle, in particular the sections "Why not code binary inputs as 0 and 1?" and "Should I standardize the input variables?" The gist, though, is the same:

The contribution of an input will depend heavily on its variability relative to other inputs.

As for unordered categorical variables -- you must break them out into binary indicators. They simply are not meaningful otherwise.


text:
Q: Why blame the Australians? I noticed the following comments under a hot meta post: Downvoting questions from new users

*

*I agree this is horribly bad form. I blame the Australians. – Andrew

*But @Andrew, as you yourself pointed out, there are no Australians here. – StoneyB

*@StoneyB No, actually I said I never see them. They could be all around us, waiting in the trees like downvoting drop-bears,
  whispering, "Strewth, she's a beaut isn't she!" when they see their
  next victim. – Andrew

At first, I thought these comments to be rude and offensive, yet the upvotes suggest that they are not. I guess it's a well-known joke, but searching "blame the Australians" online didn't give me any useful information.
My question is: Why are Australians blamed?

A: What you are seeing is a common construct that ridicules the blame of unrelated groups by sarcastically laying blame when it's understood to be sarcasm. The poster is not seriously blaming Australians.
The 'Thanks, Obama' meme is a similar construct that is a response to the American right-wing blaming things on Obama that are difficult to link directly to him, such as the mortgage crisis. In response, the left-wing ridicules it by attaching 'Thanks, Obama' (in a sense: blaming Obama) for silly things like spilling your drink.

http://knowyourmeme.com/memes/thanks-obama
However, this isn't new and didn't start during Obama's presidency. One of the themes of the South Park movie released in 1999 is 'Blame Canada', where the residents of South Park refuse to see that they are the proximate cause of their children's use of bad language, and so they blame the country of Canada instead for a TV Show their kids watch.

Blame Canada song: https://www.youtube.com/watch?v=DBpgcZ1zYJs

A: This is a fairly common turn of phrase in the US -- don't know about England or Australia.
"I blame it on Fred" is said when "Fred" obviously had nothing to do with it.  It's mainly just an attempt at humor, to help alleviate an unpleasant situation. (Successful or not, you be the judge.)
For the past eight years, if someone got a flat tire they were likely to tell a companion "I blame it on Obama", even though President Obama obviously had nothing to do with the problem.  Starting tomorrow it will be "I blame it on Trump."
There is a bit of a social/political commentary involved, in that the blamee is typically someone who does do certain things for which he might (or might not) bear culpability.  The use of the trope suggests that the person is something of a scapegoat for every bad thing that happens.

A: It's not a well known joke, nor are you missing any nuance of the English language. Presumably Andrew was alluding to an earlier meta thread of his - How come I never see any Aussies on here?, where he put a humorous slant on a genuine question.
This would be known as an in-joke - a private joke that can only be understood by a limited group of people who have a special knowledge of something that is referred to in the joke.

A: Specifically this joke is probably based on the fact that Australia is on the opposite hemisphere of where most English-speaking countries are, leading to a running joke of everything in Australia being upside-down.
In this joke, the well-meaning Australian wants to upvote a post, but because they are "upside-down", they downvote it instead.

A: The reference to drop bears was the first clue this was meant as a joke.  The first couple trips to Australia I was warned about drop bears and hoop snakes.  Since almost everything in Australia can kill you I took heed... under every tree I'd be looking and the guys would just be grinning the whole time.  The reason it was funny is because there is no such thing as a drop bear or a hoop snake.  Joke was on me... Once I got it, it was pretty funny... it was clearly meant as a joke from someone very aware of Australian humor in in no way offensive.


text:
Q: Mean.IO + Heroku Build Failing Error: ENOENT, no such file or directory '/app/bower_components/jquery/dist/jquery.min.map' I have an app written using Mean.IO and deployed to Heroku (Buildpack https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt).
It's been fine up until my latest deploy this morning and has broken for no apparent reason. Bower seems to be running fine
2015-01-06T00:09:50.851963+00:00 app[web.1]: Error: ENOENT, no such file or directory '/app/bower_components/jquery/dist/jquery.min.map'
2015-01-06T00:09:50.851967+00:00 app[web.1]:     at Object.fs.openSync (fs.js:439:18)
2015-01-06T00:09:50.851969+00:00 app[web.1]:     at Object.fs.readFileSync (fs.js:290:15)
2015-01-06T00:09:50.851979+00:00 app[web.1]:     at Promise.<anonymous> (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:177:8)
2015-01-06T00:09:50.851984+00:00 app[web.1]:     at Promise.fulfill (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:97:20)
2015-01-06T00:09:50.851982+00:00 app[web.1]:     at Promise.emit (/app/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)
2015-01-06T00:09:50.851985+00:00 app[web.1]:     at Object.cb (/app/node_modules/mongoose/lib/query.js:1146:30)
2015-01-06T00:09:50.851981+00:00 app[web.1]:     at Promise.emit (events.js:95:17)
2015-01-06T00:09:50.851976+00:00 app[web.1]:     at Config.onPackageRead (/app/node_modules/meanio/lib/config.js:101:25)
2015-01-06T00:09:50.869507+00:00 app[web.1]: Worker 11 died :(

Relevant deploy code here
-----> Installing dependencies
       npm WARN package.json karma-chrome-launcher@0.1.7 No README data
       npm WARN package.json karma-coffee-preprocessor@0.2.1 No README data
       npm WARN package.json karma-coverage@0.2.7 No README data
       npm WARN package.json karma-phantomjs-launcher@0.1.4 No README data

       > mean@0.4.2 postinstall /tmp/build_f7b66ed6667be26db9cf377edd6379ea
       > node node_modules/meanio/node_modules/mean-cli/bin/mean-postinstall

       Installing Bower dependencies
       Auto installing package dependencies
       Auto installing package dependencies
       Installing module: mean-admin:
       git clone --branch master https://git.mean.io/linnovate/mean-admin.git packages/contrib/mean-admin
           Dependencies installed for package access
           Dependencies installed for package articles
           Dependencies installed for package system
           Dependencies installed for package theme
           Dependencies installed for package users
           Dependencies installed for package dashboard
           Dependencies installed for package linktexting

       > mean-health@0.1.7 postinstall /tmp/build_f7b66ed6667be26db9cf377edd6379ea/packages/contrib/mean-admin/node_modules/mean-health
       > node ./postinstall.js

       Error: ENOENT, open '.bower-cache/fe2fe255e91d251051d543998aa8327a-1.11.2.lock'
       gridfs-stream@0.5.3 node_modules/gridfs-stream

       mean-health@0.1.7 node_modules/mean-health

       request@2.51.0 node_modules/request
           Dependencies installed for package mean-admin
-----> Caching node_modules directory for future builds
-----> Cleaning up node-gyp and npm artifacts
-----> Building runtime environment
-----> Exporting config vars to environment
grunt-cli@0.1.13 node_modules/grunt-cli
├── resolve@0.3.1
├── nopt@1.0.10 (abbrev@1.0.5)
└── findup-sync@0.1.3 (glob@3.2.11)
grunt@0.4.5 node_modules/grunt
-----> Found Gruntfile, running grunt heroku:development task
Running "cssmin:core" (cssmin) task
>> Destination not written because minified CSS was empty.

Running "uglify:core" (uglify) task
>> Destination bower_components/build/js/dist.min.js not written because src files were empty.

Done, without errors.

I see the line
Error: ENOENT, open '.bower-cache/fe2fe255e91d251051d543998aa8327a-1.11.2.lock'

But I'm not sure what that means heroku wise. Any ideas?

A: Try running bower update it will install the missing jQuery dependencies

A: From the documentation
http://learn.mean.io/#m-e-a-n-stack-more-information
**Update NPM, Bower or Grunt**

Sometimes you may find there is a weird error during install
like npm's Error: ENOENT. Usually updating those tools to
the latest version solves the issue.

Updating NPM:
$ npm update -g npm

Updating Grunt:
$ npm update -g grunt-cli

Updating Bower:
$ npm update -g bower


text:
Q: Android specific words speech recognition I am trying to have the app recognize certain words said by the user using the code below, but for some reason it isn't working at all. Please review this and tell me what is wrong with it. Thank you
The app is simply suppose to display a toast message if the words "orange" or "apple" is said but nothing happens when using the code below.
//button onclick to trigger RecognizerIntent
public void OnClick_Speed_Detector(View v)
{
    Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    i.putExtra(RecognizerIntent.EXTRA_LANGUAGE, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    i.putExtra(RecognizerIntent.EXTRA_PROMPT, "speak up");
    startActivityForResult(i, 1);

}

protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
    if(requestCode == 1 && resultCode == RESULT_OK)
    {
        ArrayList<String> result =
                data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);

                if(((result).equals("orange")))
                {
                  Toast.makeText(getApplicationContext(), "orange", Toast.LENGTH_LONG).show();

                }
                else
                    if (((result).equals("apple")))
                {
                  Toast.makeText(getApplicationContext(), "apple", Toast.LENGTH_LONG).show();
                }

    }
}

A: Your issue is that you are testing if an ArrayList == a String, when it can't possibly (an ArrayList of type String contains multiple strings)
Instead of:
if ((result).equals("orange")) {}

Try:
if ((result).contains("orange")) {}

This code will look through every index of the ArrayList and determine if any of the indexes of it equal "orange". If any do then it will return
true

...and it will execute the if statement!
Hope this helps!


text:
Q: Simple method to calculate output impedance of source follower Output impedance of source follower without Rs would be 1/gm. However, if you add Rs the expression becomes a little complex and the result is as in the image below. I know how to get the result with brute-force method. However, is the a simple way to get that expression taking advantage that we already know the output impedance of the circuit without Rs is 1/gm?

A: With R_s = 0, an M1 impedance contribution and an C_gs impedance are connected in parallel; the output impedance is
$$
Z_0 = {1\over{g_m}} || {1\over{s·C_{gs}}}
$$
Neglecting C_ds, an R_s contribution is in series, only it should be scaled down. Common drain stage is a non-inverting current amplifier. Given a common drain stage's AC current gain
$$
A_{cd} = {1 + g_m\over{s·C_{gs}}}
$$
we can calculate a current thru R_s and a scaled-down R_s contribution R_sScaled into the output impedance
$$
R_{sScaled} = {R_s\over{A_{cd}}} = {R_s\over{1 + g_m\over{s·C_{gs}}}} = {R_s·s·C_{gs}\over{s·C_{gs} + g_m}}
$$
The total output impedance is
$$
Z = Z_0 + R_{sScaled}
$$
$$
Z = {1\over{s·C_{gs} + g_m}} + {R_s·s·C_{gs}\over{s·C_{gs} + g_m}} = {{1+R_s·s·C_{gs}}\over{s·C_{gs} + g_m}}
$$
The only problem with this derivation is that it is only trustworthy for those who knows how to get the result with brute force method. For someone who has never analyzed an AC small-signal equivalent circuit of common drain configuration, it may be difficult to see a Thevenin behind the above equations.

A: anhnha - perhaps you like my approach?
From system theory (and from the classical feedback model) we know that - in case of feedback - the open-loop output impedance Zol without feedback must be divided by the expression (1-LG) with LG=loop gain. (We have a minus sign due to positive feedback)
This opens the way to a relatively simple and straight-forward calculation of the closed-loop output impedance Zout=Zol/(1 - LG).
1.) Disconnecting the gate from the rest of the circuit, the open-loop gain is
Aol=(Rs+1/sC)/(1/gm + 1/sC + Rs)
2.) If we open the loop at the gate node, the loop gain is
LG=Aol*Rs/(Rs+1/sC)=Rs/(1/gm + Rs + 1/sC)
3.) Without feeedback, the open-loop output impedance is
Zol=(1/gm)||(Rs+1/sC) = (Rs + 1/sC)/(1 + gmRs + gm/sC)
4.) Inserting these expressions into Zout=Zol/(1-LG) leads to
Zout=(1 + sRsC)/(gm + sC).


text:
Q: Confused with voltage divider I'm confused with voltage divider..For the voltage going into Base, do I use the formula A or B to calculate? After searching some infos on google, I assume A is the right formula?
What's confusing me is that in my book, it says Voltage XY = 40/50, and Voltage YZ = 10/50.

A: All voltages are relative to something; if you're not specifying, it's usually ground, which is 'Z' in this schematic.
Thus, 'voltage XY' is the voltage across the 40 kiloohm resistor, which is the difference between the positive supply voltage and the base. 'voltage YZ' is the voltage across the 10 kiloohm resistor, which is the difference between the ground and the base.
Since you're usually talking about voltage relative to ground, the latter is what you want if you just want to know 'the voltage on the base'.

A: What is the name of this book ?
If we remove transistor from the circuit the voltage at point Y (the voltage difference between point Y and Z) is equal to : $$ V_Y = V_X *\frac{10k\Omega}{40k\Omega + 10k\Omega}= V_X\frac{10}{50} $$
But if you connect the BJT back into the circuit the voltage at Vy will now be equal to Vbe.

A: I think, you asked for the voltage \$V_{YZ}\$ in the DC steady state.
The voltage \$V_{YZ}\$ not only depends on the resistor values and the voltage \$V_{XZ}\$, but also on the current \$I_B\$ flowing into the transistor base. That is because the BJT is connected as a load to the voltage divider.
Applying Kirchoff's current law at node Y gives $$I_1 = I_B + I_2$$ where

*

*\$I_1\$ is the current through the upper resistor \$R_1 = 40k\Omega\$ flowing from X to Y, and

*\$I_2\$ is the current through the lower resistor \$R_2=10k\Omega\$ flowing from Y to Z.
If you replace the currents through the resistors by the voltages across them (same direction!) using Ohm's law and Kirchoff's voltage law, you get:
$$\frac{V_{XZ}-V_{YZ}}{R_1} = I_B + \frac{V_{YZ}}{R_2}$$
Now, just transpose the equation to \$V_{YZ}\$.
EDIT: There is also a dependency between the base current \$I_B\$ and the base-emitter voltage \$V_{BE}=V_{YZ}\$ of the BJT. It is analog to the diode equation. But this depends on transistor parameters. For collector currents in the milli ampere range, \$V_{BE}\$ will be in the range 0.6 ... 0.7 volts.


text:
Q: Show that $f(x)$ is surjective or not
Prove/disprove: $f(x)$ is surjective if $f(x) = \frac{5x + 1}{x - 2}$ and $f: \mathbb{R} -\{ 2\} \to  \mathbb{R} -\{ 5\}$

Discovery:
Solving for $y$, I get $x = \frac{2y + 1}{y - 5}$.
PROOF:
Let $x = \frac{2y + 1}{y - 5}$, $y \ne 5$
Then $f(x) = y$ for $y \ne 5, x\ne 2$. Thus $f$ is surjective.
correct?

A: we have
$f(x)=5+\frac{11}{x-2}$
let $y\in \mathbb R$
we look for $x$ such that
$5+\frac{11}{x-2}=y$ or
$\frac{11}{x-2}=y-5$
so if $y\neq 5$ then
$x=2+\frac{11}{y-5}$
so $f$ is a surjection from $\mathbb R-\{2\}$ to
$\mathbb R-\{5\}$  and since
$x$ is unique,
$f$ is a bijection from $ \mathbb R-\{2\}$
to $\mathbb R-\{5\}$.


text:
Q: can't block IP that is attacking one of my sites with xmlrpc.php attack I'm at my wits end right now. I have a wordpress site that thankfull is still just a blank template. Last week I saw it was being hammered by an IP 185.130.5.180 from Lithuania and has been flagged multiple times for spamming. I can't seem to block the damn thing for accessing my site. Should note I have a few sites on this server but it's only attack 1 of them.
My apache 2.4.10 vhost access logs are just flooding with this over and over each second:
sitename.com:80 185.130.5.180 - - [06/Feb/2016:01:38:59 -0500] "POST /xmlrpc.php HTTP/1.0" 301 523 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
If I delete the file, it just turns into it saying its a 404 instead of 301. I even deleted the entire site for a few days and it's still hammering away.
Here is what I have tried:
Blocking it with my Debian firewall which is UFW. Didn't work.
Blocking it with Cloudflare firewall. Didn't work. Cloudflare told me they are attacking my IP directly.
Adding deny from 185.130.5.180 into my sites htaccess file. Didn't work.
Fail2Ban using the Apache-postflood config doesn't work.
I'm not sure how else to get this thing ip to bugger off and start hammering my site.
Please any suggestions would be great.

A: Given how utterly trivial it is to redirect an IP to null with iptables - my advice would be:

*

*Either learn to use your operating system or

*Hire a professional.

THAT being said, on top I would change your IP and then make sure it never gets published and all traffic is running through cloudflare ;)


text:
Q: Grab a String from a file at a line? Currently, to find the line I want from the file, I am reading the file line by line until the string I'm looking for matches the current line.
This is seems like bad coding practice as my files are 1000+ lines; is there a way to tell either a scanner or buffered reader, (or something else?), to create a string from characters AT a given line?
EDIT: it appears that this isn't physically possible as ajb pointed out.
I suppose the best solution would be to read the entire file into a String[] of lines.

A: Yes, you can set an offset at which the reading or writing of the file will occur.
Use RandomAccessFile API for the same. Including a sample code below.
import java.io.*;

public class RandomAccessFileDemo {

   public static void main(String[] args) {
      try {
         // create a new RandomAccessFile with filename test
         RandomAccessFile raf = new RandomAccessFile("F:/test.txt", "r");

         System.out.println("Output without setting offset, i.e. from start of file");
         // print the lines
         String temp="";
         while((temp = raf.readLine()) != null)
            System.out.println(temp);

            System.out.println();
         // set the file pointer at 20 position
         raf.seek(20);
            System.out.println("Output using seek and setting offset to 20");
         // print the line
         while((temp = raf.readLine()) != null)
            System.out.println(temp);

      } catch (IOException ex) {
         ex.printStackTrace();
      }
   }
}

This is my sample test.txt placed in F drive
This is an example
Hello World
Trying RandomAccessFile

And this is the output of the program
Output without setting offset, i.e. from start of file
This is an example
Hello World
Trying RandomAccessFile

Output using seek and setting offset to 20
Hello World
Trying RandomAccessFile

A: Try using mutli-threading concept since the number of line/rows in your file are more.
private void multiThreadRead(int num){

    for(int i=1; i<= num; i++) {
        new Thread(readIndivColumn(i),""+i).start();
     }
}

private Runnable readIndivColumn(final int colNum){
    return new Runnable(){
        @Override
        public void run() {
            // TODO Auto-generated method stub
            try {

                long startTime = System.currentTimeMillis();
                System.out.println("From Thread no:"+colNum+" Start time:"+startTime);

                RandomAccessFile raf = new RandomAccessFile("./src/test/test1.csv","r");
                String line = "";
                //System.out.println("From Thread no:"+colNum);

                while((line = raf.readLine()) != null){
                    //System.out.println(line);
                    //System.out.println(StatUtils.getCellValue(line, colNum));
                }

                long elapsedTime = System.currentTimeMillis() - startTime;

                String formattedTime = String.format("%d min, %d sec",
                        TimeUnit.MILLISECONDS.toMinutes(elapsedTime),
                        TimeUnit.MILLISECONDS.toSeconds(elapsedTime) -
                        TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(elapsedTime))
                    );

                System.out.println("From Thread no:"+colNum+" Finished Time:"+formattedTime);
            }
            catch (Exception e) {
                // TODO Auto-generated catch block
                System.out.println("From Thread no:"+colNum +"===>"+e.getMessage());

                e.printStackTrace();
            }
        }
    };
}

private void sequentialRead(int num){
    try{
        long startTime = System.currentTimeMillis();
        System.out.println("Start time:"+startTime);

        for(int i =0; i < num; i++){
            RandomAccessFile raf = new RandomAccessFile("./src/test/test1.csv","r");
            String line = "";

            while((line = raf.readLine()) != null){
                //System.out.println(line);
            }
        }

        long elapsedTime = System.currentTimeMillis() - startTime;

        String formattedTime = String.format("%d min, %d sec",
                TimeUnit.MILLISECONDS.toMinutes(elapsedTime),
                TimeUnit.MILLISECONDS.toSeconds(elapsedTime) -
                TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(elapsedTime))
            );

        System.out.println("Finished Time:"+formattedTime);
    }
    catch (Exception e) {
        e.printStackTrace();
        // TODO: handle exception
    }

}
    public TesterClass() {

    sequentialRead(1);
    this.multiThreadRead(1);

}

A: Java NIO has a lot of new methods and simple ways of doing exactly what you want:
public List<String> getLinesInFile(File f){
    return Files.readAllLines(f.toPath());
}

Or you can parse it as one massive string and search it using the contains method:
     /**
     * Uses static methods in the Files class of NIO
     * Reads everything in a file, and puts it in a String
     * @param file the file to read
     * @return a String representing the contents of the file
     * @throws IOException "if an I/O error occurs reading from the stream" (Files.readAllBytes javadoc)
     */
    public String readFileContents(File file) throws IOException {
        String filecontents = "";
        filecontents = new String(Files.readAllBytes(Paths.get(file.toURI())));
        return filecontents;
    }

     /**
     * Checks if a string contains another string, ignoring case
     * @param word the string to look for
     * @param contents the string to look for the other string in
     * @return If it does contain the word, returns true. Otherwise returns false. Ignoring case.
     */
    private boolean containsIgnoreCase(String word, String contents) {
        String w = word.toLowerCase();
        String c = contents.toLowerCase();
        return c.contains(w);
    }


text:
Q: How to use list of pages from graph.facebook.com/me/accounts https://graph.facebook.com/me/accounts?access_token=USERS_AUTH_TOKEN

returns a list of pages the user has admin status in (in JSON format).
I would like to list all the pages in a dropdownlist, and make the user choose which facebook page he wants to use (on my webapp), so I can obtain the specific access token for that facebook page.
My question is - whats the easiest and best way to do that. Ive never worked with JSON before, but I guess theres a pretty easy was to do this through the facebook-sdk.

A: Since you're using the C# SDK, just take the array of objects and convert them into a IList<IDictionary>() array using the pageId as the key and the value being the page name.
This is not fully compilable, but you get the idea:
private void IList<IDictionary<long,string>> ConvertToList(dynamic meAccounts)
{

  foreach(var acc in meAccounts.data)
  {
    yield return new Dictionary((long)acc.id, (string)acc.name);
  }

{

A: Okay figured out a way to do it. But I have no idea ifs the right way or the most optimal.
Would very much like inputs on it.
 [DataContract]
 internal class FacebookObj
 {
    [DataMember]
    public List<FacebookAccount> data;
    [DataMember]
    public FacebookNext paging;
 }

    [DataContract]
    internal class FacebookAccount
    {
        [DataMember]
        public string name;
        [DataMember]
        public string category;
        [DataMember]
        public string id;
        [DataMember]
        public string access_token;
    }

    [DataContract]
    internal class FacebookNext
    {
        [DataMember]
        public string next;
    }

public void ShowPages(string authToken) {

 WebRequest webRequest = WebRequest.Create("https://graph.facebook.com/me/accounts?access_token=" + authToken);

            WebResponse webResponse = webRequest.GetResponse();

            Stream sr = webResponse.GetResponseStream();

            if (sr != null)
            {
                jsonSer = new DataContractJsonSerializer(typeof(FacebookObj));
                FacebookObj o = (FacebookObj)jsonSer.ReadObject(sr2);

                foreach (FacebookAccount s in o.data)
                {
                    //Do stuff
                    Response.Write(s.id + " - " + s.name + "<br />");
                }

            }
}


text:
Q: Doesn't "What I have personally found that really relaxes me" violate that-trace effect? The following is a part of a Japanese university's entrance exam:
Andrea:

I was just reading an article on how the things that you do right before bed can have a big impact on your life.

Erica:

That's so true. I've heard that it is such a great time of the day to actually start a daily routine because the day is winding down so you're not rushing around to get stuff done.

Andrea:

I've often tried to do that but have never been that successful at it, to tell you the truth. What I have personally found that really relaxes me though is doing some nighttime reading before I doze off.

Isn't "What I have personally found that really relaxes me" ungrammatical because it violates That-trace effect? My assumption is that "that" is a complementizer and "what" was moved from the subject position of the verb "relaxes". Or is this assummtion wrong?

A: The sentence is grammatical.
You appear to be parsing this with an underlying "I have found that X really relaxes me"; but in this case that introduces a relative clause modifying the (nominally employed) fused relative clause introduced by what. Parse it like this:
      I have found  X   that really relaxes me
                    ↓
       ←    ←      what
   ↓
 What I have found      that really relaxes me is . . .

You may paraphrase

The thing I have found which really relaxes me is . . .


text:
Q: Linq select into model and set properties In .NET Core 2.X, I was able to use this code below:
var bookings = await db.Tasks
        .Where(c => c.ClientId == clientId && c.IsDeleted == false && c.Start > startOfThisMonth && c.End < endOfThisMonth)
        .OrderBy(x => x.Start)
        .Select(x => new SpecialTaskVm(new TaskViewModel(x, null))
        {
            client = x.Client,
            carer = x.Booking.SingleOrDefault(b => b.SlotNumber == 1).Carer,
            carer2 = x.Booking.SingleOrDefault(bk => bk.SlotNumber == 2).Carer
        })
        .ToListAsync();

However the same code in .net core 3.X results in this error:

System.InvalidOperationException: When called from 'VisitMemberInit', rewriting a node of type 'System.Linq.Expressions.NewExpression' must return a non-null value of the same type. Alternatively, override 'VisitMemberInit' and change it to not visit children of this type.

I could really do with selecting in the way I do above as each model does some modification to some properties and each model is used elsewhere separately.
I am also trying to avoid a foreach as it seems that would be inefficient.
I have tried passing the properties I need to set, into the model and setting them in the model like that. Same error occurs.
//This action method will return data for current month.
var startOfThisMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
var endOfThisMonth = new DateTime(DateTime.Now.Year, DateTime.Now.AddMonths(1).Month, 1);

var bookings = await db.Tasks
        .Where(c => c.ClientId == clientId && c.IsDeleted == false && c.Start > startOfThisMonth && c.End < endOfThisMonth)
        .OrderBy(x => x.Start)
        .Select(x => new SpecialTaskVm(new TaskViewModel(x, null))
        {
            client = x.Client,
            carer = x.Booking.SingleOrDefault(b => b.SlotNumber == 1).Carer,
            carer2 = x.Booking.SingleOrDefault(bk => bk.SlotNumber == 2).Carer
        })
        .ToListAsync();

I expect for the list of tasks to be returned in the form of List<SpecialTaskVm> with Client, Carer and Carer2 set.

A: It's a bit unusual to use a constructor and object initialisation syntax in the same code, to me that's already a code smell.
If I were you, I would create an intermediate list that only gets values from the database, then project that data into your SpecialTaskVm objects. For example:
// First get the data from the database in a simple form we can parse through later
var bookingData = await db.Tasks
        .Where(c => c.ClientId == clientId && c.IsDeleted == false && c.Start > startOfThisMonth && c.End < endOfThisMonth)
        .OrderBy(x => x.Start)
        .Select(x => new // Use an anonymous type
        {
            Client = x.Client,
            Carer = x.Booking.SingleOrDefault(b => b.SlotNumber == 1).Carer,
            Carer2 = x.Booking.SingleOrDefault(bk => bk.SlotNumber == 2).Carer
        })
        .ToListAsync();

// Now we massage the data into a format we can use
var bookings = bookingData
        .Select(x => new SpecialTaskVm(new TaskViewModel(x, null))
        {
            client = x.Client,
            carer = x.Carer,
            carer2 = x.Carer2
        })
        .ToList();

Additionally, I would potentially recommend changing the SpecialTaskVm constructor (or add a new one) to include the new fields.


text:
Q: WildFly scripting tool Есть ли в WildFly какой-либо аналог wsadmin из WAS?
Где можно найти информацию?

A: Если я правильно понял, то вас интересует управление и настройка WildFly через консоль.
Для этого нужно использовать jboss-cli.sh
Пример для одной команды:
/jboss-cli.sh -c command="/subsystem=ejb3/thread-pool=default :read-resource(include-runtime=true, recursive=true)"

или
./jboss-cli.sh -c "/subsystem=ejb3/thread-pool=default :read-resource(include-runtime=true, recursive=true)"

Если нужно сразу несколько из файла, то так:
./jboss-cli.sh -c --file=myfile.cli

myfile.cli - простой текстовый файл, где каждая строка это команда.


text:
Q: Extract data from Chrome website without using Selenium Driver in Excel VBA I was trying to download a file from a website that is password protected, I have a username and password. Once logged in I need to download a specific file which is in my excel file.
URL : https://drive.internxt.com/login
I saw we could achieve using Selenium, but we can't install any application in our office. Is that possible without a Selenium driver?
My Code using Selenium :
Sub test2()
Dim driver As New WebDriver
Dim rowc, cc, columnC As Integer
rowc = 2
Application.ScreenUpdating = False
driver.Start "chrome"
driver. Get "http://demo.guru99.com/test/web-table-element.php"
For Each th In
driver.FindElementByClass("dataTable").FindElementByTag("thead").FindElementsByTag("tr")
cc = 1
For Each t In th.FindElementsByTag("th")
Sheet2.Cells(1, cc).Value = t.Text
cc = cc + 1
Next t
Next th


text:
Q: Compare Products Sidebar Item Doesn't Show Products When I click "Add to Compare" on a product, a message stating that "such-and-such product successfully added to compare list" appears, however the compare products sidebar shows "You have no items to compare." If I do a print_r($this->helper('catalog/product_compare')->getItemCount()) in template/catalog/product/compare/sidebar.phtml, "0" is returned.
Why won't the sidebar show the products to compare?
Info: Magento version 1.4.0.1
Sessions appear to work for I can add products to the cart and they will stay in the cart as I navigate around the site.
Thank you,
Ben

A: I've made the changes on this file:

app\code\core\Mage\Catalog\Helper\Product\Compare.php

from line 215. I've commented the if statement out.
/*
if (!$this->_getSession()->hasCatalogCompareItemsCount()) {
    $count = 0;
} else {
*/

and on line 235. Commented the closing bracket out:
/*}*/

It worked for me.
I think thats the solution.

A: Found the solution after several hours of searching:
One or more of the indexes needed to be rebuilt.
In case anyone else encounters this issue, the option to trigger index rebuilding is found in the admin interface by going to the System menu and selecting Index Management.

A: The other reason that compare tools may be broken are some site optimizations like disabling certain events like
controller_action_predispatch
controller_action_postdispatch
Check etc/local.xml
<frontend>
    <events>
        <controller_action_predispatch>
            <observers><log><type>disabled</type></log></observers>
        </controller_action_predispatch>
        <controller_action_postdispatch>
            <observers><log><type>disabled</type></log></observers>
        </controller_action_postdispatch>
    </events>
</frontend>

and remove
        <controller_action_predispatch>
            <observers><log><type>disabled</type></log></observers>
        </controller_action_predispatch>
        <controller_action_postdispatch>
            <observers><log><type>disabled</type></log></observers>
        </controller_action_postdispatch>

A: app\code\core\Mage\Catalog\Helper\Product\Compare.php at line 257

comment if statement doesn't work on magento community v 1.7.0.2
/**
 * Retrieve count of items in compare list
 *
 * @return int
 */
public function getItemCount()
{

   if (!$this->_getSession()->hasCatalogCompareItemsCount()) {
        $this->calculate();
    }

    return $this->_getSession()->getCatalogCompareItemsCount();
}

A: I have the same problem and it was because of my browser (chrome), I switch to firefox and the 'Add to Compare' option work fine.


text:
Q: What is a Razor Host Section and a Razor Pages section in Web.config As someone relearning .net + Web API 2, I'm unsure what these entries in my Web.config file are for. Should requirePermission be set to true? Are there any tutorials about this. (I'm currently piecing together the whole process of .net+webapi+azure emulator+ deploying to the cloud).
 <configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.1.1.0, Culture=neutral, PublicKeyToken=XXXXXXXXX">

    </sectionGroup>
  </configSections>

A: What is <configSections>?
The <configSections> element defines configuration elements that you'll fill out later. For example, this line:

...means that further down in your configuration file, you define a <pages> section internally handled by RazorPagesSection. The requirePermission attribute is related to trust-level security, and you don't need to worry about it unless your app runs in partial-trust scenarios (e.g. on a traditional shared host).
This is boilerplate configuration — it's auto-configured and you generally don't need to change it unless something goes wrong.
What are Razor, <pages>, and <host>?
These sections configure Razor, which is the new syntax used in ASP.NET MVC views. The default values are fine when you're starting out.
The <pages> element configures your MVC views — you can configure which namespaces are referenced by default and add or override the helper methods available in your views.
The <host> element configures how your application is served. The only property is factoryType, which I think tells the server how to build your views. You never need to change this unless you're doing something particularly fancy.


text:
Q: Expo keep on breaking without any warning or error after build I am a beginner at react-native stuff pardon me if the issue is not complex. I set up the environment of react-native in the expo app but the app keeps on breaking without any warning or error. It was working before in my smartphone but after using an android studio it keeps on breaking. Now, both in the emulator and smartphone. Thank you in advance!
During Build:

After Build:


text:
Q: How to access values from NSSet? I am using CoreData and it's returning a NSMangedObject. I have taken it into NSSet and now i want to take the value out and display it. Here's the code snippets:
NSManagedObject *financialsData = [serverResult valueForKey:@"financials"];
    NSSet *financiers = [financialsData valueForKey:@"planFinanciers"];
    for (NSManagedObject *financier in financiers)
    {

    }

Please help.

A: You haven't told us anything about the attributes and relationships that a particular financier has, but in general you can use accessors or KVC to get the data from each object:
NSManagedObject *financialsData = [serverResult valueForKey:@"financials"];
NSSet *financiers = [financialsData valueForKey:@"planFinanciers"];
for (NSManagedObject *financier in financiers)
{
    // Assuming there are 'name' and 'netWorth' attributes...
    NSLog(@"Name: %@\tNet Worth:%.2f", financier.name, financier.netWorth);

    // ...or...
    NSLog(@"Name: %@\tNet Worth:%.2f", [financier valueForKey:@"name"], [[financier valueForKey@"netWorth"] floatValue]);
}

Don't take my word for it, though... read Managed Object Accessor Methods.


text:
Q: How to test if an SVG element is contained by another element I want to know how I can extract the information if one element in the SVG DOM tree contained in a different element of the same tree.
In my case I want to execute onClick events on the different elements of the SVG tree. Since the SVG graph is issued by a server and contains several thousand elements I thought it is not feasible to register a distinct event with each node. So my idea was to register the event with the root node of the SVG and then determine from the target of the event which element was clicked on. This works fine so far.
In the next step I want to open a pop-up frame to display information about the SVG element I clicked on. The frame shouldn't open when the event came from an area of the SVG image where no element is placed.
After reading the documentation I thought it would be a good idea to use the jQuery method contains (http://api.jquery.com/contains-selector/) however it yields false as a result all the time and I don't know what is wrong. The ($(svgRoot).find(svgElement).length method also does not work. Does someone has an idea what is wrong?
Here is an example of the problem in jsfiddle: https://jsfiddle.net/gjvaz346/1/
Here is the SVG graph:
<svg id="svg-element" currentScale="1" viewBox="0 0 100 100">
    <g id="svg-root" transform="scale(0.5)">
        <rect id="blue-rectangle" style='fill:blue;opacity:1' x='10' y='10' width='70' height='40' />
        <rect id="green-rectangle" style='fill:green;opacity:1' x='60' y='30' width='40' height='40' />
    </g>
</svg>

Here is the event handler method:
function svgCanvasClicked(evt) {

    var target = evt.target;
    var svgElement = $(target.id);
    var svgRoot = $('#svg-root');

    console.log(target.id);
    console.log(svgRoot.id);

    console.log($(svgRoot).find(svgElement).length);
    console.log($.contains(svgRoot, svgElement));
}

Greetings

A: Easiest way is to bind click event on rect element but delegating it to svg element, so only one event would be bound:
$('#svg-element').on('click', 'rect', handler);

Then inside handler method, this will refer to the clicked rect;
Updated jsFiddle


text:
Q: How to item in list view and display a new GUI in another page which shows description?
String[] price ={
        "RM9.50",
        "RM6.50",
        "RM10.80",
        "RM80.20",
        "RM100.60",
        "RM50.10",
        "RM12.30",
        "RM90.50"
};
    String[] itemname ={
            "Safari",
            "Camera",
            "Global",
            "FireFox",
            "UC Browser",
            "Android Folder",
            "VLC Player",
            "Cold War"
    };

Integer[] imgid={
        R.drawable.pic1,
        R.drawable.pic2,
        R.drawable.pic3,
        R.drawable.pic4,
        R.drawable.pic5,
        R.drawable.pic6,
        R.drawable.pic7,
        R.drawable.pic8,
};
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_activity);
    inputSearch = (EditText) findViewById(R.id.inputSearch);

    CustomListAdapter adapter=new CustomListAdapter(this, itemname, imgid, price);
    list=(ListView)findViewById(R.id.list);
    list.setAdapter(adapter);

    list.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view,
                                int position, long id) {
            // TODO Auto-generated method stub
            String Slecteditem = itemname[+position];
            Toast.makeText(getApplicationContext(), Slecteditem, Toast.LENGTH_SHORT).show();

        }
    });
}  //main actiivty

This is the custom list adapter that the main function call. The code shows a list of all the item. However i want to click into one of the list item to display a new page with a more detail description. The first picture shows the list view, the second picture is a more detail description.
public CustomListAdapter(Activity context, String[] itemname, Integer[] imgid, String[] price) {
    super(context, R.layout.mylist, itemname);
    // TODO Auto-generated constructor stub

    this.context=context;
    this.itemname=itemname;
    this.imgid=imgid;
    this.price=price;
}

public View getView(int position,View view,ViewGroup parent) {
    LayoutInflater inflater=context.getLayoutInflater();
    View rowView=inflater.inflate(R.layout.mylist, null,true);

    TextView txtTitle = (TextView) rowView.findViewById(R.id.item);
    ImageView imageView = (ImageView) rowView.findViewById(R.id.icon);
    TextView extratxt = (TextView) rowView.findViewById(R.id.textView1);

    txtTitle.setText(itemname[position]);
    imageView.setImageResource(imgid[position]);
    extratxt.setText(price[position]);
    return rowView;

};

}

A: You can override the method onListItemClick and start a new class.You can also pass data to new Activity using putExtra()
@Override
public void onListItemClick(ListView parent, View v, int position, long id) {
 if (position == appropriate_condition) {
    Intent intent = new Intent(this, DetailActivity.class);
    startActivity(intent);
 }
}


text:
Q: Perl Crons Jobs = High Server Load? I have multiple cron jobs written in Perl and they appear to be causing a high server load.
When I run top through SSH it shows that Perl is using the most CPU and memory.  However, since there's multiple cron jobs, I need to know specifically which one is using the most resources.
Is there any way to check which of the Perl files is using the most resources?

A: Well, if you look at ps -ef you should see which script maps to that process id. You could also use strace -fTt -p <pid> to attach a debugger to a specific process id to see what it's doing.
Or you could modify the script to change $0 to something meaningful that tells you which script is which.
But it's hard to say without a bit more detail. Is there any chance the script is taking longer to run than you cron job takes to 'fire'? Because if you start backlogging a cron job you'll slowly get worse as more and more start piling up behind it.

A: Note the PID of the process top shows is using cpu. Then do a
ps -ef | grep perl

Match the PID to one listed and you'll see the full commandline of the perl process for the high cpu job.


text:
Q: git grep showing absolute paths I would like to use git grep from outside the repository, for example editing a file in vim. This works:
git -C /path/to/gitrepo/ grep 'my search'

The problem is that the results show relative path from /path/to/gitrepo. So, I cannot open them directly.
Is there any way to generate the full file path to the matches? From git would be great, but a hacky solution to prepend and build the absolute path will do too.

A: The usual output is just one line per match (though this does depend on options). In this case, a simple git -C $path grep pattern | sed s,^,$path, does the trick (assuming no "," in paths).
                    – torek

A: [alias]
        egrep = "!f1() { git grep --line-number \"$1\" | sed \"s,^,$PWD/,g\"  | sed \"s/^\\(.*:[0-9]\\{1,10\\}\\):/\\1 /g\" ; }; f1"

This is my git alias config.
Usage: git egrep 'my search' .
This would give you filenames with fullpath and line number.


text:
Q: Can't generate APK in android studio I have an android application ready to release. I'm trying to generate the APK in the android studio in the section 'build apk'. I'm using some externals libraries. However, I'm getting errors related to bytecode to dex. I already search for solutions, but no success.
This is the errors:

Information:Gradle tasks [:app:assembleDebug]
Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lcom/loopj/android/http/AsyncHttpResponseHandler;
Error:com.android.dex.DexException: Multiple dex files define Lcom/loopj/android/http/AsyncHttpResponseHandler;
Error:  at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
Error:  at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
Error:  at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
Error:  at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
Error:  at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
Error:  at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
Error:  at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
Error:  at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
Error:  at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
Error:  at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
Error:  at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
Error:  at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lcom/loopj/android/http/BaseJsonHttpResponseHandler;
Error:com.android.dex.DexException: Multiple dex files define Lcom/loopj/android/http/BaseJsonHttpResponseHandler;
Error:  at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
Error:  at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
Error:  at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
Error:  at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
Error:  at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
Error:  at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
Error:  at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
Error:  at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
Error:  at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
Error:  at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
Error:  at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
Error:  at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error:Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lcom/loopj/android/http/BaseJsonHttpResponseHandler;

And this is build.gradle :
apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '26.0.2'
    defaultConfig {
        applicationId "com.NanoStima.AndroidClient"
        minSdkVersion 19
        targetSdkVersion 22
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
    compile 'com.android.support:appcompat-v7:25.1.1'
    testCompile 'junit:junit:4.12'
    compile files('libs/activation.jar')
    compile files('libs/additionnal.jar')
    compile files('libs/mail.jar')
}

dependencies {
    compile 'com.google.android.gms:play-services:9.2.0'
    compile 'com.google.android.gms:play-services-location:9.2.0'
    compile 'com.facebook.android:facebook-android-sdk:4.26.0'
    compile 'com.android.support:multidex:1.0.1'
}

 dependencies {
    //   compile 'com.github.scribejava:scribejava-apis:3.2.0'
    compile 'com.loopj.android:android-async-http:1.4.4'
    compile group: 'org.mindrot', name: 'jbcrypt', version: '0.3m'
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:design:25.0.1'
}

Can anyone help?
WARNING NEW: I was testing some of your sugestions and the project just dont run anymore. I made a reroll for the initial gradle, and still have this error :
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

I already clean the project, delete .gradle, restart android studio. Just dont run anymore :\

A: I noticed you use the full google play services library in your dependencies and I suspect its the root cause of the bytecode to dex problem. Instead of using the whole library you should try using only the specific ones you need. e.g.
instead of:
compile 'com.google.android.gms:play-services:10.2.0

you could use:
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.google.android.gms:play-services-location:10.2.0'

or consider using multi dex. ref:Android multi-dex

A: If you read the error messages you will see that the problem is caused by:
compile 'com.loopj.android:android-async-http:1.4.4'
In your build.gradle (project level) add this :
allprojects {
    repositories {
        jcenter()
        google()
        maven {
            url 'https://maven.google.com/'
        }
    }
}

And your problem will probably be resolved (in this case by jcenter()).
Notice:
It is google() or maven {url 'https://maven.google.com'} depends on your Gradle version. If you have Gradle version 4.1 then you use google(), in the other case the maven part.
You can find some more explanation here Remote repositories

A: I finaly get there. I reverse gradle from last version to:
classpath 'com.android.tools.build:gradle:2.3.3'


text:
Q: Error trying to manually create Gaussian Filter in Python I created a Python code based on a MATLAB code I already had to implement the Gaussian Filter. But when I run the project, I get the following error:
Traceback (most recent call last):
  File "C:\Users\gisla\Scilab_PDI\gaussianFilter.py", line 37, in <module>
    conv = np.multiply(temp, mascara);
ValueError: operands could not be broadcast together with shapes (4,4,7) (5,5)

The code is this below. The image 'result.jpg' is simply a color image that I am trying to filter on. It has no noise because it was just testing if the code would actually modify the image.
import cv2
import matplotlib as plt
from math import e;

img = cv2.imread("result.jpg");
I = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

sigma = 1;
# Máscara 5x5
mascara = np.zeros((5,5));
W = 0;

def getExp(n):
  return e**n

#Filter
for i in range (1, 5):
    for j in range (1, 5):
        sq_dist = (i-3)^2+(j-3)^2;
        mascara[i,j] = getExp(-1*(sq_dist)/(2*sigma*sigma));
        W = W + mascara[i,j];

mascara = mascara/W;

[m,n] = np.shape(I);
saida = np.zeros((m,n), dtype=np.uint8);
Im = np.pad(img, [2,2]);

for i in range(1, m):
    for j in range(1, n):
        temp = Im[i:i+4, j:j+4];
        temp = np.double(temp);
        conv = np.multiply(temp, mascara);
        saida[i,j] = np.sum(conv[:])

cv2.imwrite('resultado.jpg', img)

I don't know much about Python, so the changes made so far didn't solve the problem.

A: Python has "Zero-based numbering" so your Mask currently looks like this:

You can see that the first row and column are empty and that you need to start (probably all 4) for-loops from 0.
The second problem is using "^" (XOR operator) for squaring (when calculation "sq_dist"). Use "**" instead.

Use:
import matplotlib.pyplot as plt
plt.imshow(mascara, "gray")

to visualize your kernel.
You also get the multiplication error from beginning the third and fourth for-loop from 1.
Also don't use semi-columns at the end of line in python :)

A: In the line Im = np.pad(img, [2,2]) you use the padding on the img variable, which is your color image with shape (X, Y, 3) (3 dimensions for R, G and B). If greyscale images is what you want to work with, I think instead you probably want to use your I variable with shape (X, Y), so Im = np.pad(I, [2,2]).
Also please also note that Python indexing works different than Matlab indexing. Indexing starts at 0, you have to change the lines
for i in range(1, m):
    for j in range(1, n):
        temp = Im[i:i+4, j:j+4]

to
for i in range(0, m):
    for j in range(0, n):
        temp = Im[i:i+5, j:j+5]


text:
Q: How correctly built an object graph based on multi level join in Slick? I have a model structure as following:
Group -> Many Parties -> Many Participants

In on of the API calls I need to get single groups with parties and it's participants attached.
This whole structure is built on 4 tables:

*

*group

*party

*party_participant

*participant

Naturally, with SQL it's a pretty straight forward join that combines all of them. And this is exactly what I am trying to do with slick.
Mu method is dao class looks something like this:
def findOneByKeyAndAccountIdWithPartiesAndParticipants(key: UUID, accountId: Int): Future[Option[JourneyGroup]] = {
    val joins = JourneyGroups.groups join
                Parties.parties on (_.id === _.journeyGroupId) joinLeft
                PartiesParticipants.relations on (_._2.id === _.partyId) joinLeft
                Participants.participants on (_._2.map(_.participantId) === _.id)

    val query = joins.filter(_._1._1._1.accountId === accountId).filter(_._1._1._1.key === key)

    val q = for {
      (((journeyGroup, party), partyParticipant), participant) <- query
    } yield (journeyGroup, party, participant)

    val result = db.run(q.result)

    result ????
  }

The problem here, is that the result is type of Future[Seq[(JourneyGroup, Party, Participant)]]
However, what I really need is Future[Option[JourneyGroup]]
Note: case classes of JourneyGroup and Party have sequences for there children defined:
case class Party(id: Option[Int] = None,
                 partyType: Parties.Type.Value,
                 journeyGroupId: Int,
                 accountId: Int,
                 participants: Seq[Participant] = Seq.empty[Participant])

and
case class JourneyGroup(id: Option[Int] = None,
                        key: UUID,
                        name: String,
                        data: Option[JsValue],
                        accountId: Int,
                        parties: Seq[Party] = Seq.empty[Party])

So they both can hold the descendants.
What is the correct way to convert to the result I need? Or am I completely in a wrong direction?
Also, is this statement is correct:
Participants.participants on (_._2.map(_.participantId) === _.id) ?

A: I ended up doing something like this:
journeyGroupDao.findOneByKeyAndAccountIdWithPartiesAndParticipants(key, account.id.get) map { data =>

      val groupedByJourneyGroup = data.groupBy(_._1)

      groupedByJourneyGroup.map { case (group, rows) =>

        val parties = rows.map(_._2).distinct map { party =>
          val participants = rows.filter(r => r._2.id == party.id).flatMap(_._3)

          party.copy(participants = participants)

        }

          group.copy(parties = parties)

      }.headOption

    }

where DAO method's signature is:
def findOneByKeyAndAccountIdWithPartiesAndParticipants(key: UUID, accountId: Int): Future[Seq[(JourneyGroup, Party, Option[Participant])]]


text:
Q: How can I find a closed form for this sum $\sum_{k=1}^n{n \choose k}p^{k+1}(1-p)^{n-1}$? Based on some guess and check I think that
$$\sum_{k=1}^n{n \choose k}p^{k+1}(1-p)^{n-1}=p(1-p)^{n-1}((p+1)^n-1)$$
Where $0\leq p \leq 1$
but I'm not sure how to get from one to the other, or if it is truly correct.

A: By the Binomial Theorem, we have that
$$\begin{align}
\sum_{k=1}^{n}\binom{n}{k}p^{k+1}(1-p)^{n-1}&=p(1-p)^{n-1}\sum_{k=1}^{n}\binom{n}{k}p^{k}\\
&=p(1-p)^{n-1}\sum_{k=1}^{n}\binom{n}{k}p^{k}(1)^{n-k}\\
&=p(1-p)^{n-1}\left[\sum_{k=0}^{n}\binom{n}{k}p^{k}(1)^{n-k}-1\right] \quad \text{ since }\binom{n}{0}p^{0}(1)^{n-0}=1 \\
&= p(1-p)^{n-1}[(1+p)^{n}-1]\text{.}
\end{align}$$


text:
Q: Paypal Handshake failure - IBM WCS/WAS we have updated the SSL protocol to use SSL_TLSv2 (which should allow TLSv1, TLSv1.1 and TLSv1.2) and we are using https://api.sandbox.paypal.com/2.0/ endpoint URL to connect to paypal. We have added VeriSign Class 3 Public Primary Certification Authority - G5 certificate to our keystore. But still we are getting handshake failure.
Error LOG:
javax.xml.ws.soap.SOAPFaultException: javax.net.ssl.SSLException: Received fatal alert: handshake_failure". javax.xml.ws.soap.SOAPFaultException: javax.net.ssl.SSLException: Received fatal alert: handshake_failure
    at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.createSystemException(MethodMarshallerUtils.java:1363)
    at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.demarshalFaultResponse(MethodMarshallerUtils.java:1089)
    at org.apache.axis2.jaxws.marshaller.impl.alt.DocLitBareMethodMarshaller.demarshalFaultResponse(DocLitBareMethodMarshaller.java:417)
    at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.getFaultResponse(JAXWSProxyHandler.java:626)
    at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.createResponse(JAXWSProxyHandler.java:566)
    at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:432)
    at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:213)
    at com.sun.proxy.$Proxy62.setExpressCheckout(Unknown Source)

Please find the logs below (After enabling SSL Debug)
[6/29/16 12:17:29:389 IST] 00000211 WSChannelFram A   CHFW0019I: The Transport Channel Service has started chain HttpsOutboundChain:web-proxy.corp.hp.com:8088:706802748:api.sandbox.paypal.com:-1.
adding as trusted cert:
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O   Subject: CN=localhost, OU=Root Certificate, OU=localhost, OU=localhost, O=IBM, C=US
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O   Issuer:  CN=localhost, OU=Root Certificate, OU=localhost, OU=localhost, O=IBM, C=US
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O   Algorithm: RSA; Serial number: 0x9256ccd0f74
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O   Valid from Mon Mar 28 18:05:23 IST 2016 until Tue Mar 25 18:05:23 IST 2031
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O adding as trusted cert:
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O   Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G5, OU="(c) 2006 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O   Issuer:  OU=Class 3 Public Primary Certification Authority, O="VeriSign, Inc.", C=US
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O   Algorithm: RSA; Serial number: 0x250ce8e030612e9f2b89f7054d7cf8fd
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O   Valid from Wed Nov 08 05:30:00 IST 2006 until Mon Nov 08 05:29:59 IST 2021
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O adding as trusted cert:
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O   Subject: CN=Symantec Class 3 Secure Server CA - G4, OU=Symantec Trust Network, O=Symantec Corporation, C=US
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O   Issuer:  CN=VeriSign Class 3 Public Primary Certification Authority - G5, OU="(c) 2006 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O   Algorithm: RSA; Serial number: 0x513fb9743870b73440418d30930699ff
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O   Valid from Thu Oct 31 05:30:00 IST 2013 until Tue Oct 31 05:29:59 IST 2023
[6/29/16 12:17:30:016 IST] 00000211 SystemOut     O
[6/29/16 12:17:30:019 IST] 00000211 SystemOut     O ***
[6/29/16 12:17:30:019 IST] 00000211 SystemOut     O found key for : default
[6/29/16 12:17:30:020 IST] 00000211 SystemOut     O chain [0] = [
[
  Version: V3
  Subject: CN=localhost, OU=localhost, OU=localhost, O=IBM, C=US
  Signature Algorithm: SHA256withRSA, OID = 1.2.840.113549.1.1.11

  Key:  IBMJCE RSA Public Key:
modulus:
26167541711086627791578871564616365051862711740169857710554547535189479149908374929516177090517001379910396688828760654542434329119238956286945379132186129759458751111248999650559731436488161569437501148312306505875762201215861268858168483037657932583161029509501700884430074843289607373839133072877375577360636060242737127872859949426685225542431385914834039901653766669062129732208534425904601424824899456065980585969976422194265319042002149984018361515399815820913269930221749561374832898783792638898537082727405570885654709258468168429473416388030507181343754356665510039104609297653873247510424200394843741361793
public exponent:
65537

  Validity: [From: Mon Mar 28 18:05:24 IST 2016,
               To: Tue Mar 28 18:05:24 IST 2017]
  Issuer: CN=localhost, OU=Root Certificate, OU=localhost, OU=localhost, O=IBM, C=US
  SerialNumber: [10056828754800]

Certificate Extensions: 2
[1]: ObjectId: 2.5.29.17 Criticality=false
SubjectAlternativeName [
[RFC822Name: ProfileUUID:WCDE80_180144-BASE-8a713340-a4f8-4abe-ae41-aaedf50c06bd]]

[2]: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 41 79 84 39 4f 6c 37 6f                           Ay.9Ol7o
]
]

]
  Algorithm: [SHA256withRSA]
  Signature:
0000: 16 f9 9f a4 29 1d f4 17  7d 80 6e 34 e7 47 5b b2  ..........n4.G..
0010: 1c fd 5b 08 92 b8 24 e7  51 04 67 71 0a 91 1c 88  ........Q.gq....
0020: 63 c4 02 99 94 dd a2 21  93 0e 58 f0 5b 94 54 27  c.........X...T.
0030: 02 d1 fe 65 8d 05 78 4d  35 02 c4 28 f9 d5 3b 11  ...e..xM5.......
0040: 95 28 d4 87 b2 2c e2 e5  77 f8 06 55 f4 f3 72 ec  ........w..U..r.
0050: c9 95 6f 1e 9c a4 02 f5  41 8d 50 c0 c0 5c df 5f  ..o.....A.P.....
0060: 2f dd 90 2f 8c a1 53 f3  8b a4 5f 25 37 30 06 b9  ......S.....70..
0070: 2d a2 24 7b 4c bb 60 56  0b a4 b3 6e 73 a0 71 12  ....L..V...ns.q.
0080: ab 30 df 4d 27 3c 2b 8c  66 c5 b1 b5 56 e5 3c 41  .0.M....f...V..A
0090: 65 42 d4 d6 c2 8a ec 4e  ec cc c1 62 49 75 ed 1c  eB.....N...bIu..
00a0: 1d c3 f6 d0 dd 79 d4 a0  9c 1e ce 1a a8 ac 0b 68  .....y.........h
00b0: b4 50 cb 6b 92 8b 9e 99  96 2c ff 5b f8 63 2e a4  .P.k.........c..
00c0: fa 4c 82 13 8d 6d 5c 49  6b 32 49 41 4d 3f 8a eb  .L...m.Ik2IAM...
00d0: 16 77 60 3e 84 af 7d 38  ed 06 7d 7c b9 69 0c 50  .w.....8.....i.P
00e0: f6 59 10 d4 70 76 8c 0d  23 40 68 66 7c be d0 a7  .Y..pv....hf....
00f0: 5d 43 55 c7 5e 31 6c ef  25 cc ec 6b d3 05 4f e8  .CU..1l....k..O.

]
[6/29/16 12:17:30:020 IST] 00000211 SystemOut     O chain [1] = [
[
  Version: V3
  Subject: CN=localhost, OU=Root Certificate, OU=localhost, OU=localhost, O=IBM, C=US
  Signature Algorithm: SHA256withRSA, OID = 1.2.840.113549.1.1.11

  Key:  IBMJCE RSA Public Key:
modulus:
19904753990009309220640490407026050840230290478827945495559467830914675305969718816314697475824624971015421979520946317273041884889483490534710677359598087244263711680653006429506370864649858288482237624045812419537775828964539312096597139584695395163230244568608219831591052376071824331577827894488085049089178639843811986500484212726449214616765323493684584926518468131402057026630937301877109272783156174698101767247279976634672974959576739431097029244885330417865240554525368272023593234999310504632854754949649989504797724839753383392964247687587360456802376083021433419450872358735106842206689297528583371429329
public exponent:
65537

  Validity: [From: Mon Mar 28 18:05:23 IST 2016,
               To: Tue Mar 25 18:05:23 IST 2031]
  Issuer: CN=localhost, OU=Root Certificate, OU=localhost, OU=localhost, O=IBM, C=US
  SerialNumber: [10056343818100]

Certificate Extensions: 3
[1]: ObjectId: 2.5.29.19 Criticality=true
BasicConstraints:[
CA:true
PathLen:2147483647
]

[2]: ObjectId: 2.5.29.17 Criticality=false
SubjectAlternativeName [
[RFC822Name: ProfileUUID:WCDE80_180144-BASE-8a713340-a4f8-4abe-ae41-aaedf50c06bd]]

[3]: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 40 c3 48 d5 8e 43 b9 e0                           ..H..C..
]
]

]
  Algorithm: [SHA256withRSA]
  Signature:
0000: 87 17 da 78 ef 39 12 f0  d2 1b f0 11 70 9d 83 96  ...x.9......p...
0010: 00 70 6f bd 2d 19 6c 5b  64 3f 75 8b cf 61 ae b9  .po...l.d.u..a..
0020: 2c 6c b4 cd da b7 6e 6f  03 1b 9f f0 ff 07 6f ff  .l....no......o.
0030: a1 79 a7 4a 08 e6 2a 1c  4e 5b 13 75 03 9d ab 88  .y.J....N..u....
0040: 79 be ca e3 e7 c5 66 ab  f9 49 96 06 b4 81 2b 3a  y.....f..I......
0050: 33 5b c1 bd c9 e4 c7 07  10 61 5c 38 0f 5d a6 b1  3........a.8....
0060: 40 93 bf ec 37 34 34 d2  ec 30 3d ae 9a 80 6b ca  ....744..0....k.
0070: 1b 43 58 73 be ec 1b 41  70 3f 11 1c f3 42 a0 e6  .CXs...Ap....B..
0080: ce d5 a3 a5 37 a7 c9 46  34 3e ac a1 32 bd c3 6e  ....7..F4...2..n
0090: 07 49 e0 e3 2e 85 f4 04  6b 68 80 58 a3 32 58 1c  .I......kh.X.2X.
00a0: 06 90 e2 64 1a 8d 68 20  e4 a2 28 56 cf d6 06 76  ...d..h....V...v
00b0: eb 53 4f d1 90 3b 82 b0  fc 61 47 3d 3d 4b dd 03  .SO......aG..K..
00c0: 59 e4 03 7e 7e 00 47 51  2f f4 f2 17 f8 34 d1 bd  Y.....GQ.....4..
00d0: 24 b9 12 8c 8e b9 18 32  4e 89 a3 fe 6e ec 3f 9b  .......2N...n...
00e0: 33 0d a0 f3 45 4c 88 04  97 3d 31 07 33 81 5a 11  3...EL....1.3.Z.
00f0: e8 1d d1 68 2e 50 66 8a  4e f7 77 3c 64 82 60 a8  ...h.Pf.N.w.d...

]
[6/29/16 12:17:30:020 IST] 00000211 SystemOut     O ***
[6/29/16 12:17:30:022 IST] 00000211 SystemOut     O ***
[6/29/16 12:17:30:022 IST] 00000211 SystemOut     O found key for : paypal
[6/29/16 12:17:30:022 IST] 00000211 SystemOut     O chain [0] = [
[
  Version: V3
  Subject: C=US, ST=CA, L=Santa Clara, O=HP, CN=hpbiztest_api1.hp.com
  Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5

  Key:  IBMJCE RSA Public Key:
modulus:
167767787854827133772476094878602356419059997517346374275255466537187831576020199052607407432097460847863697600517067858769595716996015976450736236072075948148640801631718329787519229056273024787589358929246179803681154066413328089574908636575846498188850427968011672902341432046713914611785901831874548450751
public exponent:
65537

  Validity: [From: Tue Jan 10 01:00:44 IST 2012,
               To: Fri Jan 07 01:00:44 IST 2022]
  Issuer: EMAILADDRESS=re@paypal.com, CN=sandbox_camerchapi, OU=sandbox_certs, O="PayPal, Inc.", L=San Jose, ST=California, C=US
  SerialNumber: [1049731]

Certificate Extensions: 1
[1]: ObjectId: 2.5.29.19 Criticality=false
BasicConstraints:[
CA:false
PathLen: undefined
]

]
  Algorithm: [SHA1withRSA]
  Signature:
0000: 2a 5c 68 2b fd 0a 5f 62  71 32 51 2b 25 66 cf 65  ..h....bq2Q..f.e
0010: a4 ca 06 2a d3 f1 ae 58  6d d0 bf a3 c4 e2 2e a4  .......Xm.......
0020: 98 5b 4a 01 c1 09 aa ba  e9 d3 91 a0 09 d8 bf c1  ..J.............
0030: 28 17 b8 9c 7c 15 7a 08  1b ff 92 71 98 2c 28 11  ......z....q....
0040: c4 97 6f 23 fc d7 4f 3f  09 b1 5a c9 06 f2 49 6d  ..o...O...Z...Im
0050: 11 d5 87 fc d4 3e 25 1d  91 fe ff 4d 67 a8 ec a4  ...........Mg...
0060: b2 4d 5e 39 5d ef 7e 6b  e8 f7 86 b7 2b 35 d6 d5  .M.9...k.....5..
0070: f0 24 6c 7a 0f bc 15 9e  e2 84 3c f5 80 81 d2 01  ..lz............

]
[6/29/16 12:17:30:022 IST] 00000211 SystemOut     O ***
[6/29/16 12:17:30:023 IST] 00000211 SystemOut     O SSLContextImpl:  Using X509ExtendedKeyManager com.ibm.ws.ssl.core.WSX509KeyManager
[6/29/16 12:17:30:023 IST] 00000211 SystemOut     O SSLContextImpl:  Using X509TrustManager com.ibm.ws.ssl.core.WSX509TrustManager
[6/29/16 12:17:30:023 IST] 00000211 SystemOut     O JsseJCE:  Using SecureRandom IBMSecureRandom from provider IBMJCE version 1.7
[6/29/16 12:17:30:023 IST] 00000211 SystemOut     O trigger seeding of SecureRandom
[6/29/16 12:17:30:023 IST] 00000211 SystemOut     O done seeding SecureRandom
[6/29/16 12:17:30:023 IST] 00000211 SystemOut     O Using SSLEngineImpl.
[6/29/16 12:17:30:023 IST] 00000211 SystemOut     O SSLv3 protocol was requested but was not enabled
[6/29/16 12:17:30:025 IST] 00000211 SystemOut     O SSLv3 protocol was requested but was not enabled
[6/29/16 12:17:30:027 IST] 00000211 SystemOut     O IBMJSSE2 will not allow unsafe server certificate change during renegotiation per jdk.tls.allowUnsafeServerCertChange set to FALSE or default
[6/29/16 12:17:30:027 IST] 00000211 SystemOut     O
Is initial handshake: true
[6/29/16 12:17:30:027 IST] 00000211 SystemOut     O Ignoring unsupported cipher suite: SSL_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
[6/29/16 12:17:30:027 IST] 00000211 SystemOut     O Ignoring unsupported cipher suite: SSL_DHE_RSA_WITH_AES_128_CBC_SHA256 for TLSv1
[6/29/16 12:17:30:027 IST] 00000211 SystemOut     O Ignoring unsupported cipher suite: SSL_DHE_DSS_WITH_AES_128_CBC_SHA256 for TLSv1
[6/29/16 12:17:30:027 IST] 00000211 SystemOut     O Ignoring unsupported cipher suite: SSL_RSA_WITH_AES_128_CBC_SHA256
[6/29/16 12:17:30:027 IST] 00000211 SystemOut     O Ignoring unsupported cipher suite: SSL_DHE_RSA_WITH_AES_128_CBC_SHA256
[6/29/16 12:17:30:027 IST] 00000211 SystemOut     O Ignoring unsupported cipher suite: SSL_DHE_DSS_WITH_AES_128_CBC_SHA256
[6/29/16 12:17:30:027 IST] 00000211 SystemOut     O Ignoring unsupported cipher suite: SSL_RSA_WITH_AES_128_GCM_SHA256
[6/29/16 12:17:30:029 IST] 00000211 SystemOut     O Ignoring unsupported cipher suite: SSL_DHE_RSA_WITH_AES_128_GCM_SHA256
[6/29/16 12:17:30:029 IST] 00000211 SystemOut     O Ignoring unsupported cipher suite: SSL_DHE_DSS_WITH_AES_128_GCM_SHA256
[6/29/16 12:17:30:029 IST] 00000211 SystemOut     O %% No cached client session
[6/29/16 12:17:30:030 IST] 00000211 SystemOut     O *** ClientHello, TLSv1
[6/29/16 12:17:30:030 IST] 00000211 SystemOut     O RandomCookie:  GMT: 1467182850 bytes = { 165, 170, 151, 64, 41, 40, 119, 74, 254, 115, 32, 213, 78, 45, 52, 66, 73, 224, 116, 255, 176, 137, 93, 27, 30, 166, 193, 21 }
[6/29/16 12:17:30:030 IST] 00000211 SystemOut     O Session ID:  {}
[6/29/16 12:17:30:030 IST] 00000211 SystemOut     O Cipher Suites: [SSL_RSA_WITH_AES_128_CBC_SHA, SSL_DHE_RSA_WITH_AES_128_CBC_SHA, SSL_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA]
[6/29/16 12:17:30:030 IST] 00000211 SystemOut     O Compression Methods:  { 0 }
[6/29/16 12:17:30:030 IST] 00000211 SystemOut     O Extension renegotiation_info, ri_length: 0, ri_connection_data: { null }
[6/29/16 12:17:30:030 IST] 00000211 SystemOut     O Extension server_name, server_name: [host_name: web-proxy.corp.hp.com]
[6/29/16 12:17:30:030 IST] 00000211 SystemOut     O ***
[6/29/16 12:17:30:030 IST] 00000211 SystemOut     O [write] MD5 and SHA1 hashes:  len = 92
[6/29/16 12:17:30:031 IST] 00000211 SystemOut     O 0000: 01 00 00 58 03 01 57 73  6f 02 a5 aa 97 40 29 28  ...X..Wso.......
0010: 77 4a fe 73 20 d5 4e 2d  34 42 49 e0 74 ff b0 89  wJ.s..N.4BI.t...
0020: 5d 1b 1e a6 c1 15 00 00  0c 00 2f 00 33 00 32 00  ............3.2.
0030: 0a 00 16 00 13 01 00 00  23 ff 01 00 01 00 00 00  ................
0040: 00 1a 00 18 00 00 15 77  65 62 2d 70 72 6f 78 79  .......web.proxy
0050: 2e 63 6f 72 70 2e 68 70  2e 63 6f 6d              .corp.hp.com

[6/29/16 12:17:30:031 IST] 00000211 SystemOut     O WebContainer : 4, WRITE: TLSv1 Handshake, length = 92
[6/29/16 12:17:30:031 IST] 00000211 SystemOut     O [Raw write]: length = 97
[6/29/16 12:17:30:031 IST] 00000211 SystemOut     O 0000: 16 03 01 00 5c 01 00 00  58 03 01 57 73 6f 02 a5  ........X..Wso..
0010: aa 97 40 29 28 77 4a fe  73 20 d5 4e 2d 34 42 49  .....wJ.s..N.4BI
0020: e0 74 ff b0 89 5d 1b 1e  a6 c1 15 00 00 0c 00 2f  .t..............
0030: 00 33 00 32 00 0a 00 16  00 13 01 00 00 23 ff 01  .3.2............
0040: 00 01 00 00 00 00 1a 00  18 00 00 15 77 65 62 2d  ............web.
0050: 70 72 6f 78 79 2e 63 6f  72 70 2e 68 70 2e 63 6f  proxy.corp.hp.co
0060: 6d                                                 m

[6/29/16 12:17:30:371 IST] 00000211 SystemOut     O [Raw read]: length = 5
[6/29/16 12:17:30:371 IST] 00000211 SystemOut     O 0000: 15 03 01 00 02                                     .....

[6/29/16 12:17:30:371 IST] 00000211 SystemOut     O [Raw read]: length = 2
[6/29/16 12:17:30:371 IST] 00000211 SystemOut     O 0000: 02 28                                              ..

[6/29/16 12:17:30:371 IST] 00000211 SystemOut     O WebContainer : 4, READ: TLSv1 Alert, length = 2
[6/29/16 12:17:30:371 IST] 00000211 SystemOut     O WebContainer : 4, RECV TLSv1 ALERT:  fatal, handshake_failure
[6/29/16 12:17:30:373 IST] 00000211 SystemOut     O WebContainer : 4, fatal: engine already closed.  Rethrowing javax.net.ssl.SSLException: Received fatal alert: handshake_failure
[6/29/16 12:17:30:373 IST] 00000211 SystemOut     O WebContainer : 4, fatal: engine already closed.  Rethrowing javax.net.ssl.SSLException: Received fatal alert: handshake_failure