text:
Q: Cant allow app to control computer anymore I'm developing app now, and when I debug it - I open debug folder and drag app into Preferences->Privacy->Accessibility->List. When I want to show demo, I drag this app to applications folder and remove old app from accessibility and add new one from applications.
Today I can't drag nor add by + this app.
So, I open console. Drag again - nothing. Add via +, see next messages:
25/12/14 16:27:21,228 WindowServer[143]: window 103 is already attached to window a0
25/12/14 16:27:21,824 WindowServer[143]: window 103 is already attached to window a0
25/12/14 16:27:21,837 WindowServer[143]: window 103 is already attached to window a0
25/12/14 16:27:23,602 com.apple.xpc.launchd[1]: (com.apple.quicklook[868]) Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.quicklook
25/12/14 16:27:25,072 WindowServer[143]: _CGXGetWindowOrderingGroup: Operation on a window 0x103 requiring rights 0x5 by caller System Preferences

In accessibility I already have Automator, Script editor (not checked), Xcode (probably they was meaned in first three lines).
I worry about last one - have no idea what it talks about? Are my rights has been gone somehow? Funny, but I am able to add any other product to that list...

A: According to this answer I made a select query to Tcc.db, and I see myApp there, despite that I don't see them in window. Actually, I have tried to delete database before writing my question, but still problems have been occured, so I desided then app has no access to mac.
But, when I delete from DB myApp, then select query - all gone, OK.
Then drag again, then select query execute - myApp appeared with same settings as other apps, but still invisible in in privacy.


text:
Q: Mocking private method with Mockito I'm trying to find an article about mocking private methods. Actually we use mockito in our project, but it is so poor test coverage. So I tried to write with Mockito and PowerMock butI cann't find any good examples and so on. Can anybody explain me this?

A: I think this is a job for PowerMock.  I doubt Mockito can do it.  The PowerMock documentation explains how to do it.  And, it uses this as an example:
@Test
public void testReplaceData() throws Exception {
        final String modifyDataMethodName = "modifyData";
        final byte[] expectedBinaryData = new byte[] { 42 };
        final String expectedDataId = "id";

        // Mock only the modifyData method
        DataService tested = createPartialMock(DataService.class, modifyDataMethodName);

        // Expect the private method call to "modifyData"
        expectPrivate(tested, modifyDataMethodName, expectedDataId,
                        expectedBinaryData).andReturn(true);

        replay(tested);

        assertTrue(tested.replaceData(expectedDataId, expectedBinaryData));

        verify(tested);
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Apply a list of Functions to a Java stream's .map() method I map a stream of NameValuePairs with a lookupFunction (which returns a Function), like this:
List<NameValuePair> paramPairs = getParamPairs();
List<NameValuePair> newParamPairs = paramPairs.stream()
                .map((NameValuePair nvp) -> lookupFunction(nvp.getName()).apply(nvp))
                .flatMap(Collection::stream)
                .collect(toList());

But what if lookupFunction returned a Collection<Function> instead, and I wanted to perform a .map() with each of the returned Functions.  How would I do that?

A: If lookupFunction(nvp.getName()) returns a Collection of functions, you can get a Stream of that Collection and map each function to the result of applying it to the NameValuePair :
List<NameValuePair> newParamPairs = paramPairs.stream()
            .flatMap((NameValuePair nvp) -> lookupFunction(nvp.getName()).stream().map(func -> func.apply(nvp)))
            .flatMap(Collection::stream)
            .collect(toList());

A: I'd use a function that composes the Collections of functions into one function. And use that instead of lookupFunction in my code
Function<String, Function<NameValuePair, NameValuePair>> composedFun =
     x -> lookupFunctions(x)
             .stream()
             .reduce((fun1, fun2) -> fun1.andThen(fun2))
             .orElse(y -> y);
...
  .map(nvp -> composedFun.apply(nvp.getName()).apply(nvp))
...


text:
Q: How do I create a Lua Table in C++, and pass it to a Lua function? In C++, I have a map<string, string>, containing an unknown number of entries.  How can I pass this to a Lua function, so that the Lua function can use the data as a table?

A: A couple options...

*

*Copy the map into a new Lua table, and pass the Lua table.

*Create a proxy table that directs reads and writes through a metatable's __index and __newindex metamethods
The drawback to (1) is all the copying, of course.
The drawback to (2) is that pairs() won't work on the proxy table
A discussion of fixes to Lua for generalized pairs is in the wiki and this mailing list thread. Generalized pairs is expected for Lua 5.2

A: if you want a real lua table:
lua_newtable(L);
int top = lua_gettop(L);

for (std::map::iterator it = mymap.begin(); it != mymap.end(); ++it) {
    const char* key = it->first.c_str();
    const char* value = it->second.c_str();
    lua_pushlstring(L, key, it->first.size());
    lua_pushlstring(L, value, it->second.size());
    lua_settable(L, top);
}

with the right types for your map substituted in..


text:
Q: Error when importing Tensorflow - Failed to load the native TensorFlow runtime Here's the full error:
Traceback (most recent call last):

File "C:\Users\richa\Documents\_Projects_\Astr0loger\interface.py", line 26, in <module>
    from controller import choose_best_stocks
  File "C:\Users\richa\Documents\_Projects_\Astr0loger\controller.py", line 10, in <module>
    from trainer import get_data, train_model, test_model
  File "C:\Users\richa\Documents\_Projects_\Astr0loger\trainer.py", line 12, in <module>
    import tensorflow as tf
  File "C:/Users/richa/Documents/_Projects_/Astr0loger/astrology_env/Lib/site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:/Users/richa/Documents/_Projects_/Astr0loger/astrology_env/Lib/site-packages\tensorflow\python\__init__.py", line 40, in <module>
    from tensorflow.python.eager import context
  File "C:/Users/richa/Documents/_Projects_/Astr0loger/astrology_env/Lib/site-packages\tensorflow\python\eager\context.py", line 35, in <module>
    from tensorflow.python import pywrap_tfe
  File "C:/Users/richa/Documents/_Projects_/Astr0loger/astrology_env/Lib/site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:/Users/richa/Documents/_Projects_/Astr0loger/astrology_env/Lib/site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:/Users/richa/Documents/_Projects_/Astr0loger/astrology_env/Lib/site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: The specified module could not be found.

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

Apparently there are three common causes/fixes to the problem:

*

*Python is 32 bit while the system is 64 bit, or vice versa. I checked, that is not the case.

*cpu doesn't support AVX2 instructions - I tried tensorflow-gpu, same issue, so I don't think that's it

*You need to install the MSVC 2019 redistributable - I checked, I have it

AAAAAAAAAAH What do I do?

A: Well, turns out the error was fixed by installing an older version of Tensorflow; 2.0.0. If you're having the same issue, try several versions of tensorflow.


text:
Q: PHP Amazon API Signature does not Match I am trying to get a Signature for the Amazon API. I have tryied many ways, but everything is not working.
This is the output when I load the site:

SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.a0276c00-dab6-4993-bfba-f1c9e431be72

The Link:
http://webservices.amazon.de/onca/xml?AWSAccessKeyId=AKIAIAPOZFMTWW53XW3A&AssociateTag=myAssociateTag&ItemId=B017M5OTU2&Operation=ItemLookup&ResponseGroup=Images&Service=AWSECommerceService&Timestamp=2016-09-22T15%3A37%3A01Z&Version=2011-08-01&IdType=ASIN&Signature=t4n0BqQBsSBu8PVLJaWHSVNo4BmDLtWmlv%2Fmaekapbw%3Dh
The Code:

function aws_signed_request($region, $params, $public_key, $private_key, $associate_tag=NULL, $version='2011-08-01')
{
    /*
    Copyright (c) 2009-2012 Ulrich Mierendorff

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/

/*
Parameters:
    $region - the Amazon(r) region (ca,com,co.uk,de,fr,co.jp)
    $params - an array of parameters, eg. array("Operation"=>"ItemLookup",
                    "ItemId"=>"B000X9FLKM", "ResponseGroup"=>"Small")
    $public_key - your "Access Key ID"
    $private_key - your "Secret Access Key"
    $version (optional)
*/

// some paramters
$method = 'GET';
$host = 'webservices.amazon.'.$region;
$uri = '/onca/xml';

// additional parameters
$params['Service'] = 'AWSECommerceService';
$params['AWSAccessKeyId'] = $public_key;
// GMT timestamp
$params['Timestamp'] = gmdate('Y-m-d\TH:i:s\Z');
// API version
$params['Version'] = $version;
if ($associate_tag !== NULL) {
    $params['AssociateTag'] = $associate_tag;
}

// sort the parameters
ksort($params);

// create the canonicalized query
$canonicalized_query = array();
foreach ($params as $param=>$value)
{
    $param = str_replace('%7E', '~', rawurlencode($param));
    $value = str_replace('%7E', '~', rawurlencode($value));
    $canonicalized_query[] = $param.'='.$value;
}
$canonicalized_query = implode('&', $canonicalized_query);

// create the string to sign
$string_to_sign = $method."\n".$host."\n".$uri."\n".$canonicalized_query;

// calculate HMAC with SHA256 and base64-encoding
$signature = base64_encode(hash_hmac('sha256', $string_to_sign, $private_key, TRUE));

// encode the signature for the request
$signature = str_replace('%7E', '~', rawurlencode($signature));

// create request
$request = 'http://'.$host.$uri.'?'.$canonicalized_query.'&IdType=ASIN&Signature='.$signature;

return $request;
}
?>

The Request file:
    <?php
require('aws_signed_request.php');
  $amazon = aws_signed_request('de',array('Operation'=>'ItemLookup','ItemId'=>'B017M5OTU2', 'ResponseGroup'=>'Images'),"AKIAIAPOZFMTWW53XW3A","OKguH77p2VnCHK5D+6Z4WnEIn18gpKuzoliZZRpe","My Associate Tag");
    echo($amazon);
?>

I hope you can help me or have a another resolution!
Greetings


text:
Q: Beamer, philex and \hfill I'm using the package philex for linguistic examples, and I try to put a textual element at the end of the line (right centered). I tried to use the \hfillcommand, but as the MWE will show you, it does not provide a coherent alignment.
\documentclass[12pt]{beamer}
\usepackage[francais]{babel}
\usepackage{philex}

\begin{document}

\begin{frame}{The syntactic ambiguity}
    \lb{}{
        \lba{}{Fred eats an apple. \hfill (a)}
        \lbz{}{Fred eats an apple. \hfill (a)}
    }
\end{frame}

\end{document}

Can someone help me fix this odd behavior?

A: You should avoid philex for the reasons egreg gives in his answer. The most commonly used packages for typesetting linguistic examples are gb4e, expex, and linguex (which is loaded by philex). See Alan Munn's excellent comparison of these packages for more details.
Many of the features that philex adds to linguex (cross-referencing, repeating examples, label customization, etc.) are available in expex.
All of these packages allow you to have a right-aligned comment. See the answers to Labeling linguistic examples with language information for code that illustrates how to do this in each package. expex is the only one that provide a native command for these right-aligned comments: \rightcomment.

A: The reason is that the philex package is written in a terrible way and doesn't protect end-of-lines in definitions. The space you see is caused mainly by these unprotected spaces.
See When is it harmful to add percent character at end of lines in a \newcommand, or similar for more information.
They are too many unprotected end-of-lines for proposing a fix; there's also the problem that the macro definitions are very big and don't use modularity.
You can "fix" the issue by using a wild hack; this may however give unexpected results if a space was really needed at some point of a definition.
\documentclass{article}
\usepackage{showframe}

\endlinechar=-1
\usepackage{philex}
\endlinechar=13

\begin{document}

\lb{y}{%
   \lba{y1}{Fred eats an apple. \hfill (a)}%
   \lbz{y2}{Fred eats an apple. \hfill (a)}%
}

\end{document}

Note that end of lines must be protected also in the input. The showframe package is just for demonstrate the alignment to the margin.

The real fix is not using the package and ask its maintainer to correct the bad code.
Just to show an example, here is the definition of \lb (line numbers added for convenience)
 95 \newcommand{\lb}[3][n]{
 96 \ifdim\lastskip=\Extopsep\vspace\Exredux\else \fi
 97 \immediate\write\@auxout{\unexpanded{\expandafter\gdef\csname#2r\endcsname{#3}\expandafter\gdef\csname#2\endcsname{\ref{#2}}
 98 \expandafter\gdef\csname#2p\endcsname{\MakeLowercase#3}}}
 99 \expandafter\providecommand\expandafter{\csname#2r\endcsname}{#3}
100 \expandafter\providecommand\expandafter{\csname#2\endcsname}{\ref{#2}}\expandafter\providecommand\expandafter{\csname#2p\endcsname}{\MakeLowercase#3}
101 \ifhyperref%
102 \renewcommand{\theFnExNo}{\roman{FnExNo}}
103 \ex. \label{#2} \if#1c \setlength{\abovedisplayskip}{1ex}
104 \setlength{\belowdisplayskip}{2ex}%
105 \parbox{\centro}{\centering \hypertarget{#2}{#3}\philpunct}\else \hypertarget{#2}{#3}\philpunct\fi\par
106 \else
107 \ex. \label{#2} \if#1c \setlength{\abovedisplayskip}{1ex}\setlength{\belowdisplayskip}{2ex}%
108 \parbox{\centro}{\centering #3\philpunct}\else #3\philpunct\fi\par%
109 \fi}

There are missing % at the end of lines 95, 97, 98, 99, 100, 102, and 103. The % at the end of lines 101 and 108 are redundant (the line ends with a control word). The only correctly placed % characters are at the end of lines 104 and 107.
The definition of \lba is similarly flawed.


text:
Q: Perform different calls (in sequence) using Backbone.Collection and jQuery Deferred I'm using a code like the following.
var firstCollection = new FirstCollection();
$.when( firstCollection.fetch( params1 )).done(function() {

    // here firstCollection has been enriched. It contains the actual data.
    // params2 will depends on firstCollection attirbutes

    var secondCollection = new SecondCollection();
    $.when( secondCollection.fetch( params2 ) ).done(function() {

        // here secondCollection has been enriched. It contains the actual data.
        // move to another screen

    }).fail( function() {

    } );

}).fail(function() {

}).always(function() {

});

My goal is to perform two calls in sequence, i.e. perform the fetch of the firstCollection and then the fetch of secondCollection. The motivation is that second fetch depends on firstCollection attributes.
So my question is the following. Is there any better alternative to achieve this with jQuery Deferred or the solution I'm using is correct?

A: Maybe something as this:
var firstCollection = new FirstCollection();
var secondCollection = new SecondCollection();

this.listenTo(firstCollection, 'reset', scndfetch);

firstColllection.fetch(params1).then(function(data){  })

scndfetch = function(){
secondCollection.fetch(params2).then(function(data){
    //data has model/collection
});
}

When a collection gets loaded an sync/reset event happens. Listen to that and the secondCollection can start loading..


text:
Q: FOLDERID_RoamingAppData equivalent in linux I'm working to port some windows applications to Linux. I find it difficult to port the changes that are related to finding SHGetKnownFolderPath equivalent in Linux. I'm interested to find out how to detect the path based on the current user.
I stumbled upon this link while surfing but I'm not sure how to exactly match the windows folders with Linux.


text:
Q: Integral $\int_0^\infty e^{imx^2}dx$ In evaluating an integral in path integrals in QFT, I am stuck with this integral (that came up from evaluating a functional integral),
$$I = \bigg( \frac{m}{2\pi i\tau}\bigg) \int dx_1e^{\frac{im\tau}{2} \bigg((x_{2} - x_1)^2+(x_{1} - x_0)^2\bigg)}$$
After some manipulation, I end up with an integral of the form (apart from some constants)
$$\int_{0}^{\infty} e^{iax^2}\;dx$$
And on further evaluation using the substitution $s= -iax^2 $, I get
$$ \int_{0}^{i\infty} \frac{ds}{\sqrt{-ias}} e^{-s} $$
what kind of contour can we choose for evaluating this one. A diagram would be really helpful.

A: I will calculate your integral
$$
I=\int_{-\infty}^\infty e^{i\alpha x^2}=2\int_0^\infty e^{i\alpha x^2}dx
$$
by using some residue methods.  This will be a general proof for you, you can put in the constant factors at the end where you need them.
\begin{equation}
F(\alpha)\equiv C(\alpha)+iS(\alpha)=\int_{-\infty}^{\infty} e^{i\alpha x^2}dx
\end{equation}
for real $\alpha$.  These are the Fresnel integrals, S($\alpha$) and C($\alpha$) which are two transcendental functions.  The integral is even so we can write
$$
F(\alpha)= 2\int_{0}^\infty {e^{i\alpha x^2}} dx.
$$
Consider the complex function $f(z)= e^{i\alpha z^2}$, $z=re^{i\theta}$, $f(z=re^{i\theta})=e^{i\alpha r^2 e^{2i\theta}}.$  If we stare at
$$
f(z=re^{i\theta})=e^{i\alpha r^2 e^{2i\theta}}
$$
we notice an amazing result, for $\theta=\pi/4$, this is just a real Gaussian integral ($\alpha >0$)!!  If $\theta =0$ we have $f(re^{i\theta})=e^{i\alpha r^2}$.
Thus our contour is split up into three contours making an angle between imaginary and real axis of $45^o$.  The contour I am using is shown here http://en.wikipedia.org/wiki/File:Fresnel_Integral_Contour.svg. We know there are no poles inside and $f(z)$ is holomorphic, thus by the Cauchy-Goursat theorem we know
\begin{equation}
0=\oint f(z) dz=\int_{0}^{\infty} e^{i\alpha x^2} dx +\int_{0}^{\pi/4} ire^{i\theta}  d\theta e^{i\alpha r^2(\cos(2\theta)+i\sin(2\theta))}+\int_{\infty}^{0}e^{-\alpha r^2}e^{i\pi/4}dr
\end{equation}
where the integral is broken up into three contours shown in the illustration and I used $z=re^{i\theta}, \ dz= e^{i\theta }dr$.  The difficult integral to evaluate is
$$
\int_{0}^{\pi/4} ire^{i\theta}  d\theta e^{i\alpha r^2(\cos(2\theta)+i\sin(2\theta))},
$$
however it vanishes as $r \to \infty$.  We need to show that it vanishes, it is similar to Jordan's inequality, but that just places an upper bound on the integral,
$$
\int_{0}^{\pi} e^{-r\sin\theta}d\theta \ < \frac{\pi}{r} \ (r >0).
$$
We will prove this now by showing that
$$
\lim_{r\to \infty} \bigg| \int_{0}^{\pi/4} e^{i\alpha r^2 e^{2i\theta}} ir e^{i\theta }d\theta \bigg|=0.
$$
We know that
$$
\bigg| \int_{0}^{\pi/4} e^{i\alpha r^2 e^{2i\theta}} ir e^{i\theta }d\theta \bigg| \leq \int_{0}^{\pi/4} \big|e^{i\alpha r^2 e^{2i\theta}}\big| \big|ir e^{i\theta}d\theta\big|=\int_{0}^{\pi/4} rd\theta \big| e^{i\alpha r^2\cos(2\theta)-\alpha r^2\sin(2\theta)} \big|=\int_{0}^{\pi/4}rd\theta \big|e^{i \alpha r^2\cos(2\theta)}\big|\big|e^{-\alpha r^2 \sin(2\theta)}\big|
$$
where I used $e^{2i\theta}=\cos 2\theta +i\sin 2\theta$.  We can simplify this to obtain
$$
\int_{0}^{\pi/4} r d\theta \big|e^{i \alpha r^2\cos(2\theta)}\big|\big|e^{-\alpha r^2\sin(2\theta)}\big|=\int_{0}^{\pi/4} rd\theta e^{-\alpha r^2\sin(2\theta)}.
$$
Thus we need to show that this vanishes as $r \to \infty.$  If we make the substitution $\xi=2\theta , d\theta=d\xi/2$ and changing the bounds of integration we obtain
$$
\int_{0}^{\pi/2} \frac{r}{2}d\xi e^{-\lambda r^2\sin \xi}.
$$
We can see that for $\xi \in [0,\pi/2]$, $\sin\xi \geq 2\xi/\pi$.  Since $e^{-\alpha r^2\cdot 2\xi/\pi} \geq e^{-\alpha r^2 \sin \xi} $ (since exponential is bigger for a smaller exponent), we can write
$$
\int_{0}^{\pi/2} \frac{r}{2}d\xi e^{-\alpha r^2\sin \xi} \leq \int_{0}^{\pi/2} \frac{r}{2}d\xi e^{-\alpha r^2 \cdot 2/\pi}=\frac{\pi}{4 \alpha r}(1-e^{-\alpha r^2}).
$$
Thus it is clear that
$$
\lim_{r\to \infty}\frac{\pi}{4 \alpha r}(1-e^{-\alpha r^2})=0,
$$
thus we have shown that
$$
\lim_{r\to \infty} \bigg| \int_{0}^{\pi/4} e^{i\alpha r^2 e^{2i\theta}} ir e^{i\theta }d\theta \bigg|=0.
$$
We are left with
$$
0=\int_{0}^{\infty} e^{i\alpha x^2} dx +\int_{\infty}^{0}e^{-\alpha r^2}e^{i\pi/4}dr.
$$
Re-arranging this expression we obtain
$$
\int_{0}^{\infty} e^{i\alpha x^2} dx=-\int_{\infty}^{0}e^{-\alpha r^2}e^{i\pi/4}dr=\int_{0}^{\infty}e^{-\alpha r^2}e^{i\pi/4}dr
$$
where I switched the bounds of integration to remove the minus sign.  This is a fabulous result, we have reduced the Fresnel integral to a real Gaussian integral which is trivial, the result is
$$
\int_{0}^{\infty} e^{i\alpha x^2} dx=\int_{0}^{\infty}e^{-\alpha r^2}e^{i\pi/4}dr=\frac{1}{2}e^{i\pi/4} \sqrt{\frac{\pi}{\alpha}}
$$
for $\alpha> 0.$(proof at end of this part.)
Thus using the property that the integrand is even, we revert back to the original integral in  to obtain the desired result given by
\begin{equation}
\int_{-\infty}^{\infty} e^{i\alpha x^2}dx=e^{i\pi/4} \sqrt{\frac{\pi}{\alpha}} , \ \  \alpha>0.
\end{equation}
Now we notice that $F(-\alpha)={F}^*(\alpha)$, thus we can write
$$
F(\alpha)=e^{-i\pi/4} \sqrt{\frac{\pi}{\alpha}}, \ \ \alpha<0.
$$
For $\alpha=0$, the integral is divergent since
$$
\int_{-\infty}^{\infty} dx=\infty.
$$
We can now calculate $C(\alpha)$ and $S(\alpha)$ by writing
$$
F(\alpha=C(\alpha)+iS(\alpha)=e^{\pm i\pi/4}\sqrt{\frac{\pi}{\alpha}}=\sqrt{\frac{\pi}{\alpha}}\bigg( \frac{1}{\sqrt{2}}\pm \frac{i}{\sqrt{2}}\bigg).
$$
Thus we conclude that
\begin{equation}
{\boxed{
F(\alpha)=\sqrt{\frac{\pi}{\alpha}}\cdot
\left\{
\begin{array}{ll}
e^{i\pi/4} \ ,\  \alpha > 0 \\
e^{-i\pi/4}  \ , \ \alpha < 0.\\
\end{array}
\right., \
C(\alpha)=\sqrt{\frac{\pi}{2\alpha}}, \ \alpha \neq 0, \ S(\alpha)=\sqrt{\frac{\pi}{\alpha}}\cdot
\left\{
\begin{array}{ll}
\frac{1}{\sqrt{2}} \ ,\  \alpha > 0 \\
-\frac{1}{\sqrt{2}} \ , \ \alpha < 0.\\
\end{array}
\right.
}}
\end{equation}

A: To compute the integral
$$
\int_0^\infty e^{i\alpha x^2}\,\mathrm{d}x
$$
we will consider the contour integral
$$
\int_\gamma e^{i\alpha z^2}\,\mathrm{d}z=0
$$
where $\gamma=[0,R]\cup Re^{i[0,\pi/4]}\cup e^{i\pi/4}[R,0]$ as $R\to\infty$.
$\hspace{3cm}$
There are no singularities of the integrand inside this contour, so the integral is $0$. Since the integral along the arc of the contour tends to $0$
$$
\begin{align}
\left|\int_{Re^{i[0,\pi/4]}}e^{i\alpha z^2}\,\mathrm{d}z\right|
&\le\int_0^{\pi/4}e^{-\alpha R^2\sin(2x)}R\,\mathrm{d}x\\
&\le\int_0^\infty e^{-\alpha R^24x/\pi}R\,\mathrm{d}x\\
&=\frac{\pi}{4\alpha R}
\end{align}
$$
the integrals along the two line segments must cancel. Therefore,
$$
\begin{align}
\overbrace{\int_0^\infty e^{i\alpha x^2}\,\mathrm{d}x}^{[0,R]}
&=\overbrace{\int_0^\infty e^{i\alpha(xe^{i\pi/4})^2}\,\mathrm{d}xe^{i\pi/4}}^{e^{i\pi/4}[0,R]}\\
&=e^{i\pi/4}\int_0^\infty e^{-\alpha x^2}\,\mathrm{d}x\\
&=\color{#C00000}{\frac{1+i}{\sqrt2}\frac12\sqrt{\frac\pi\alpha}}
\end{align}
$$

Correcting and Continuing the Answer in the Question
Substituting $s=-i\alpha x^2$ gives
$$
\frac12\int_0^{-i\infty}\frac{e^{-s}}{\sqrt{-i\alpha s}}\,\mathrm{d}s
$$
note the factor of $\frac12$ and the upper limit of integration.
To compute the integral above, consider the integral
$$
\frac12\int_\gamma\frac{e^{-z}}{\sqrt{-i\alpha z}}\,\mathrm{d}z=0
$$
where $\gamma=-i[0,R]\cup Re^{-i[\pi/2,0]}\cup[R,0]$.
$\hspace{3.8cm}$
There are no singularities of the integrand inside this contour, so the integral is $0$. Again, the integral along the arc vanishes as $R\to\infty$
$$
\begin{align}
\left|\frac12\int_{Re^{-i[\pi/2,0]}}\frac{e^{-z}}{\sqrt{-i\alpha z}}\,\mathrm{d}z\right|
&\le\left|\frac12\int_{-\pi/2}^0\frac{e^{-R\cos(x)}}{\sqrt{\alpha R}}R\,\mathrm{d}x\right|\\
&=\left|\frac12\int_0^{\pi/2}\frac{e^{-R\sin(x)}}{\sqrt{\alpha R}}R\,\mathrm{d}x\right|\\
&\le\frac12\int_0^\infty\frac{e^{-2Rx/\pi}}{\sqrt{\alpha R}}R\,\mathrm{d}x\\[5pt]
&=\frac\pi{4\sqrt{\alpha R}}
\end{align}
$$
the integrals along the two line segments must cancel. Therefore,
$$
\begin{align}
\overbrace{\frac12\int_0^{-i\infty}\frac{e^{-s}}{\sqrt{-i\alpha s}}\,\mathrm{d}s}^{-i[0,R]}
&=\overbrace{\frac{1+i}{\sqrt{2\alpha}}\int_0^\infty\frac{e^{-x}}{2\sqrt{x}}\,\mathrm{d}x}^{[0,R]}\\
&=\frac{1+i}{\sqrt{2\alpha}}\int_0^\infty e^{-x^2}\,\mathrm{d}x\\
&=\color{#C00000}{\frac{1+i}{\sqrt{2\alpha}}\frac{\sqrt\pi}2}
\end{align}
$$


text:
Q: Jsoup get div contents
*

*Hi,

I can't get the "src" content of this div class :

I use
Els1 = doc1.getElementsByClass("myclass");
el=Els1.get(i)

but el.attr("src") or any other attributes returns emmpty
Conversely,
el.html() is ok :

Tried also
doc1 = Jsoup.parseBodyFragment(el.outerHtml());
print (doc1.getElementsByAttribute("src").text());

with no success.
How can I get this src value ?
Thanks for any help,
Olivier

A: From the Jsoup Doc it should look somehow like this:
Element image = document.select("img").first();
String url = image.absUrl("src");

You also could use String url = image.attr("abs:src"); instead of absUrl.
I can't test your case on my system right now, so i hope you ll handle it somehow with the Jsoup Docs (URL part)
Jsoup Docs Working with URLs

A: Here is what you should be doing, if you are using class attribute.
Elements elements = doc.getElementsByClass("myclass");
String imageUrl = elements.attr("src");

And this one, if you are using id,
Element element = doc.getElementById("myid");
String imageUrl = element.attr("src");

This should just work fine.


text:
Q: How to open port in client side in windows using my own pptp vpn server on linux? I had been setup my own pptpd server in my vultr ubuntu server and i connect on it using my client built in in windows and i success to access the internet and when i check my ip i see the vps ip instead of my real ip, but my problem is when i try to open port in my windows client using simple tool called portlistener and start listening to port 80 i went to checkport tool but i see the port 80 is closed. So does anyone know how to use this port on my client side?
my ifconfig command show this:
root@vultr:~# ifconfig
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 104.238.191.125  netmask 255.255.254.0  broadcast 104.238.191.255
        inet6 fe80::5400:2ff:feec:61e8  prefixlen 64  scopeid 0x20<link>
        ether 56:00:02:ec:61:e8  txqueuelen 1000  (Ethernet)
        RX packets 3383  bytes 984017 (960.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3470  bytes 897643 (876.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens7: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet 10.24.96.3  netmask 255.255.0.0  broadcast 10.24.255.255
        inet6 fe80::5800:2ff:feec:61e8  prefixlen 64  scopeid 0x20<link>
        ether 5a:00:02:ec:61:e8  txqueuelen 1000  (Ethernet)
        RX packets 3  bytes 370 (370.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 225  bytes 9910 (9.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1396
        inet 10.24.96.3  netmask 255.255.255.255  destination 10.24.96.5
        ppp  txqueuelen 3  (Point-to-Point Protocol)
        RX packets 340  bytes 45323 (44.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 183  bytes 47486 (46.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

iptables -L command show:
root@vultr:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     gre  --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:1723 state NEW

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
TCPMSS     tcp  --  10.0.0.0/24          anywhere             tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

A: Found the solution here:
Port forwarding for iptables (DMZ)
iptables -A PREROUTING -t nat -i eth1 -p tcp --dport 80 -j DNAT --to 192.168.1.50:80
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i eth1 -j ACCEPT


text:
Q: Use :nth-child to style certain words Can I use :nth-child to select (and style) particular words in given HTML element? For example:

Four word long title

I'd like to change style -- change font-size and font-style of the first two words and make two following word wrap to another line -- without need to change HTML, to which I don't have access.
Is this possible with :nth-child?
If this is completely bad approach, then is there any other option to achieve this?

A: No it wont work with  :nth-child
Because nth-child works only on child tags not on characters of string
if you cant change html try with jquery -
or refer this
Change color of selected text in a div using bootstrap & color picker
You can try this if you can edit html:
Separate the characters with span and apply css on that spans
Hope Helps

A: nth-child is applying on an html tag.
here you only have one html tags.
The possible would be to create a small js function or add a html tags for each of the words.
I would use the javascript solution.
Otherwise you could look with http://letteringjs.com/ if you are willing to accept another library.


text:
Q: .htaccess передать путь к файлу Сейчас при переходе на сайт по ссылки http://site.ru/blog/129560.html в фаил index.php передается переменная "q" равная "blog/129560.html".
Как сделать чтобы "дерево" сайта передавалась в разные параметры, т.е. к примеру:
http://site.ru/company/sprinthost/blog/129560.html
q[0] = company; q[1] = sprinthost; q[2] = blog; q[3] = 129560.html;
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
</IfModule>

A: Конечно можно, только это будет неудобно, т.к. нужно будет продумать правила для любого кол-ва q, для трёх например:

RewriteRule ^([a-z0-9\-\_]+)/([a-z0-9\-\_]+)/([a-z0-9\-\_]+)$ index.php?q1=$1&q2=$2&q3=$3 [L, QSA]

Но намного лучше просто с помощью PHP разобрать:
$q = $_GET['q'];
$q = explode('/', $q);

В итоге $q будет массивом, как раз таким, который вы хотели видеть


text:
Q: Crystal Report in Visual Studio 2012 wont show in Browser The Crystal Report version i use is
SAP Crystal Reports, developer version for Microsoft Visual Studio SP5
I downloaded it from http://scn.sap.com/docs/DOC-35074
HTML CODE
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />

CODE BEHIND
        conn.Open();
        palce dss = new palce();
        string sql = "Select * FROM [Places]";
        SqlDataAdapter adp = new SqlDataAdapter(sql,conn);
        adp.Fill(dss.PlaceView);
        myCrystalReport report = new myCrystalReport();
        report.SetDataSource(dss);
        CrystalReportViewer1.ReportSource = report;

There is no runtime error but the Crystal report just wont show up in any of my browser
google chrome Version 31.0.1650.57
IE 10
I am also using built in IIS express in VS 2012

A: You never load the report in code-behind
report.Load(Server.MapPath("ReportName.rpt"));

and do you have your report source in aspx?
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
        <Report FileName="FilePath\ReportName.rpt">
        </Report>
    </CR:CrystalReportSource>

A: I just find out the cause
Crystal Reports WebForm Viewer will not work on IIS Express ( VS 2012 inproc WEB Server )
I found it from SAP official website
http://search.sap.com/notes?id=0001810196&boj=/sap/bc/bsp/spn/scn_bosap/notes.do?access=69765F6D6F64653D3939382669765F7361706E6F7465735F6E756D6265723D30303031383130313936
too bad for me :(


text:
Q: jqGrid sorting on dropdown column when column is filtered In my jqGrid, I have columns which have dropdown options(nexus:yes, no; shipping:yes, no). Sorting and filtering work by itself, however if I filter my grid by nexus(yes is selected from the dropdown) and try sorting my result by stateid or name, my grid does not do anything. I debugged the code and I saw that jqGrid makes an ajax call and query returns correctly, however when I look at the response, I see that it is HTTP 200 OK, but the result does not contain any data. All sorting and filtering happens in the code behind. Any help will be greatly appreciated.
Thank you


text:
Q: Error after converting to Swift 3 ( AnyObject is not a subtype of UIFontDescriptor ) after converting my swift code to swift 3. I got the following mistake:
( AnyObject is not a subtype of UIFontDescriptor ) in my code
 public init(controller : UIViewController) {
    super.init()

    addResponderFromView(controller.view)
}

deinit {

    for infoDict in textFieldInfoCache {

        let view : AnyObject = (infoDict as AnyObject).object(forKey: kIQTextField)!

        if let textField = view as? UITextField {

            let returnKeyTypeValue = infoDict[kIQTextFieldReturnKeyType] as! NSNumber
            textField.returnKeyType = UIReturnKeyType(rawValue: returnKeyTypeValue.intValue)!

            textField.delegate = infoDict[kIQTextFieldDelegate] as! UITextFieldDelegate?
        } else if let textView = view as? UITextView {

            textView.returnKeyType = UIReturnKeyType(rawValue: (infoDict[kIQTextFieldReturnKeyType] as! NSNumber).intValue)!

            let returnKeyTypeValue = infoDict[kIQTextFieldReturnKeyType] as! NSNumber
            textView.returnKeyType = UIReturnKeyType(rawValue: returnKeyTypeValue.intValue)!

            textView.delegate = infoDict[kIQTextFieldDelegate] as! UITextViewDelegate?
        }
    }

    textFieldInfoCache.removeAllObjects()
}

please take a look at the picture. Any ideas how to fix that?

A: My guess is that in Swift 3, UIFontDescriptor is a struct.
A struct is a value type, not an object type. (Any, not AnyObject.) Try casting it to Any instead of AnyObject.


text:
Q: Force Cmake to use system include path first Im tring to build sources for unit testing with are part of bigger project.
Im using CmakeList inside which i point to directories where include headers are placed.
Somehow side by side with proper include header is placed string.h header made by someone with is causing problems.
How can i force Cmake to use string.h from /user/include first instead string.h from someModule/include?
When i delete string.h from someModule/include everything builds successfully.


text:
Q: Moving to Maven from GNUMake I've been a long time user of the Make build system, but I have decided to begin learning the Maven build system. While I've read through most of the online docs, none seem to give me the analogies I'm looking for. I understand the system's lifecycle, but I have not see one reference to compile step dependencies. For example, I want to generate a JFlex grammar as part of the compile lifecycle step. Currently, I see no way of making that step a pre-compile phase step. Documentation seems to be limited on this. In general, the concept of step dependencies seem to be baked into Maven and require a plugin for any alteration. Is this the case? What am I missing, because currently the Maven build system seems very limited in how you can setup compilation steps.

A: You can do anything in Maven. It generally has a default way to do each thing, and then you can hook in and override if you want to do something special. Sometimes it takes a lot of Stack Overflowing and head scratching to figure it out.
There is even an official JFlex Maven plugin.
Whenever possible, find someone who has made a Maven plugin do what you want. Even if it isn't 100% right, it may at least give you an idea on how to make maven do something.
Minimal configuration
This configuration generates java code of a parser for all grammar files (.jflex , *.jlex , *.lex , .flex ) found in src/main/jflex/ and its sub-directories. The name and package of the generated Java source code are the ones defined in the grammar. The generated Java source code is placed in target/generated-source/jflex , in sub-directories following the Java convention on package names.
pom.xml
<project>
  <!-- ... -->
  <build>
    <plugins>
      <plugin>
        <groupId>de.jflex</groupId>
        <artifactId>jflex-maven-plugin</artifactId>
        <version>1.6.0</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <!-- ... -->
  </build>
  <!-- ... -->
</project>

This feels like the maven way to do things. Put your stuff in the right folders (src/main/flex), and this plugin will automatically build it into your project. If you want to do fancier custom stuff, there are some options. but Maven is all about favoring convention over configuration.

A: To be frank I think that your current mindset maps much better to ant than to maven, and I would suggest starting with that.


text:
Q: How to add gradient in the background except a specific box in css I have tried to create a box for my specific content and I want a white background in that. On the other hand, I want a gradient background on the whole screen except that box.
After I tried it, I only got white background on the whole screen.
Here is the related HTML and CSS.

.div1{
  position: absolute;
    top: 46%;
    left: 50%;
    margin-top: -50px;
    margin-left: -100px;`enter code here`
  border: 1px solid red;
  border-radius: 25px;
}

Weather App

  <form method="post" action="/" class="">
    City Name :
    <input id="cityInput" type="text" name="cityName">
    <button class="btn-lg btn-outline-primary" type="submit">Go</button>
  </form>

A: You could give the gradient background to body so it can fill the whole screen except that box. Something like that:
 body {
    background: linear-gradient(
    171deg,
    rgba(0, 0, 0, 1) 40%,
    rgba(110, 110, 110, 1) 100%
  )
};

A: The body has the gradient on it.
The div has a background of white.
I would also recommend using a fieldset tag around the form to indicate semantically that everything inside it is related.
Here is a codepen showing the outcome. Codepen
Alternatively, this is the code

body{
  width: 100vw;
  max-width: 1800px;
  height: 100vh;
//This is the Background we set
  background-image: radial-gradient(circle at center center, transparent,rgb(33,33,33)),repeating-linear-gradient(135deg, rgb(33,33,33) 0px, rgb(33,33,33) 2px,transparent 2px, transparent 10px,rgb(33,33,33) 10px, rgb(33,33,33) 11px,transparent 11px, transparent 21px),repeating-linear-gradient(45deg, rgb(47,47,47) 0px, rgb(47,47,47) 4px,transparent 4px, transparent 8px),linear-gradient(90deg, rgb(33,33,33),rgb(33,33,33));
}
.div1{
  position: absolute;
  display: flex;
  left: 25vw;
  top: 25vh;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 25vw;
  height: 25vh;
  padding: 1.5rem 0.5rem;
  border-radius: 25px;
  background: white;
}
fieldset{

  border: 1px solid rgb(92, 84, 62);
  border-radius: 25px;
  padding: 1rem;
  width: 80%;
  height: 90%;

}
legend{
  font-size: 1.4rem;
  font-weight: bold;
  background: white;
  border-radius: 25px;
  padding: 5px 10px;
  border: 1px solid rgb(92, 84, 62);
}
input:focus{
  background: rgb(212, 255, 254);
}

    <fieldset>
    <legend class="heading">Weather App</legend>
    <form method="post" action="/" class="">
        City Name :
            <input id="cityInput" type="text" name="cityName">

        <button class="btn-lg btn-outline-primary" type="submit">Go</button>
    </form>
    </fieldset>


text:
Q: The point probability of a random variable I'm trying to understand the following integral:
$\begin{align*}
\mathcal P(draw \mid \boldsymbol \mu, \boldsymbol \Sigma)
&=
\lim_{{ \epsilon}\rightarrow 0}
\int_{-\epsilon \mathbf 1}^{\epsilon \mathbf 1}
\mathcal N \left(
\mathbf z;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right) d\mathbf z
\\&=
\mathcal N \left(
0;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right)
\end{align*}$
Which appears in J. Moser, "The Math Behind TrueSkill".
To clarify, this is the integration of a multivariate Gaussian distribution. The vector $\mathbf z$ between the bounds $-\epsilon\mathbf 1$ and $-\epsilon\mathbf 1$, where $\mathbf 1$ is just a vector of same dimension as $\mathbf z$ filled with $1$ meaning the elements of $\mathbf z$ individually all are bounded from $-\epsilon$ to $\epsilon$.
Clearly the normal distribution is being written as $\mathcal N(variable; mean, variance)$ which is more commonly in my experience seen as $\mathcal N(variable \mid mean, variance)$.
This integral of course is of a Normal PDF, and thus is the CDF, or calculating the probability that all the elements of $\mathbf z$ fall between $-\epsilon$ and $\epsilon$. I'm good with that. We could of course also be tempted to write this integral as:
$\Phi\left(
\mathbf \epsilon\mathbf 1;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right) -
\Phi\left(
\mathbf -\epsilon\mathbf 1;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right)$
If we lean on fairly ordinary CDF notation, but would be mistaken as is clearly spelled out for the 2D case here:
http://orfe.princeton.edu/~rvdb/245/Fall14/lectures/chap3.pdf
The details of the mean and variance aren't immediately relevant to my question (I understand what they all are, whence they stem and what they mean).
The problem I am grappling with is how to understand the limit. As $\epsilon$ tends to $0$ I expect the integral too to diminish to zero, as the $\mathcal P(-\epsilon)$ and $\mathcal P(\epsilon)$ converge toward the same value of $\mathcal P(0)$
But the stated result is not $0$, it is $\mathcal P(0)$.
I'm confused on two fronts I think. Firstly how it is that this limit does not yield $0$, but secondly how the integral (a CDF) becomes a point probability (PDF).
And lastly I guess, central to my confusion is how $\mathcal P(x)$ is not equal to $0$ for any given x for a continuous random variable. It translates to the probability of getting exactly one specific value in the real number space and one might intuit that to be effectively $0$.
To wit, I conclude that there is something I am not understanding about the interpretation of a PDF and the probability of a given point in the real number space.

A: The first quoted equation is certainly wrong -- that limit is zero, as you expected. However, apparently the source article actually uses the following "normalized match quality":
$$\begin{align}
q_{\text draw}(\mathbf{ \mu,\Sigma,\beta,A}):&=\lim_{{ \epsilon}\rightarrow 0}{
\int_{-\epsilon \mathbf 1}^{\epsilon \mathbf 1}
\mathcal N \left(
\mathbf z;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right) d\mathbf z
\over
\int_{-\epsilon \mathbf 1}^{\epsilon \mathbf 1}
\mathcal N \left(
\mathbf z;
\mathbf 0,
\mathbf  \beta^2 \mathbf A^\intercal\mathbf A
\right) d\mathbf z
}\tag{1a}\\[2ex]
&=\lim_{{ \epsilon}\rightarrow 0}{{1\over (2\epsilon)^d}
\int_{-\epsilon \mathbf 1}^{\epsilon \mathbf 1}
\mathcal N \left(
\mathbf z;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right) d\mathbf z
\over {1\over (2\epsilon)^d}
\int_{-\epsilon \mathbf 1}^{\epsilon \mathbf 1}
\mathcal N \left(
\mathbf z;
\mathbf 0,
\mathbf  \beta^2 \mathbf A^\intercal\mathbf A
\right) d\mathbf z
}\tag{1b}\\[2ex]
&={\lim_{{ \epsilon}\rightarrow 0}{1\over (2\epsilon)^d}
\int_{-\epsilon \mathbf 1}^{\epsilon \mathbf 1}
\mathcal N \left(
\mathbf z;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right) d\mathbf z
\over \lim_{{ \epsilon}\rightarrow 0}{1\over (2\epsilon)^d}
\int_{-\epsilon \mathbf 1}^{\epsilon \mathbf 1}
\mathcal N \left(
\mathbf z;
\mathbf 0,
\mathbf  \beta^2 \mathbf A^\intercal\mathbf A
\right) d\mathbf z
}\tag{1c}\\[2ex]
&={
\mathcal N \left(
\mathbf 0;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right)
\over
\mathcal N \left(
\mathbf 0;
\mathbf 0,
\mathbf  \beta^2 \mathbf A^\intercal\mathbf A
\right)\tag{1d}
}\end{align}
$$
where $\mathcal N$ is the PDF of a $d$-dimensional multivariate Normal distribution.
Note that (1c) is because the limit of a ratio is the ratio of limits (the denominator being nonzero), and (1d) is a consequence of the Mean Value Theorem for Multiple Integrals, one version of which is as follows (see $^*$ below for links to proofs):

If $f:S\to\mathbb{R}$ is a continuous Riemann integrable function on a connected Jordan measurable set $S\subset\mathbb{R}^d$, then there exists $\mathbf z_0\in S$ such that $$\int_{S}f\mathbf{\,dz}=f(\mathbf{z_0})\,\int_{S}\mathbf{\,dz} $$

This applies to the numerators of (1), for example, with $f(\mathbf{z})=\mathcal N \left(
\mathbf{z}\ ;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right),$ and with $S=S_\epsilon$ (now depending on $\epsilon$) a $d$-dimensional cube of edge-length $2\epsilon$ centered on the origin $\mathbf{0}$. For all $\epsilon>0$ as $\epsilon\to 0,$ the theorem ensures that there exists a $\mathbf z_\epsilon\in S_\epsilon$ such that
$$\begin{align}
\int_{-\epsilon \mathbf 1}^{\epsilon \mathbf 1}
\mathcal N \left(
\mathbf z;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right) d\mathbf z
&=
\mathcal N \left(
\mathbf z_\epsilon;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right)\,\int_{-\epsilon \mathbf 1}^{\epsilon \mathbf 1} d\mathbf z
\\[2ex] &=
\mathcal N \left(
\mathbf z_\epsilon;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right)\,(2\epsilon)^d .\end{align}$$
Then, since $S_\epsilon\to\{\mathbf{0}\}$ (and hence $\mathbf z_\epsilon\to\mathbf 0$) as $\epsilon\to 0,$
$$\lim_{{ \epsilon}\rightarrow 0}{1\over (2\epsilon)^d}
\int_{-\epsilon \mathbf 1}^{\epsilon \mathbf 1}
\mathcal N \left(
\mathbf z;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right) d\mathbf z\\ =\lim_{{ \epsilon}\rightarrow 0}{1\over (2\epsilon)^d}\ \mathcal N \left(
\mathbf z_\epsilon;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right)\,(2\epsilon)^d\\
=\lim_{{ \epsilon}\rightarrow 0} \mathcal N \left(
\mathbf z_\epsilon;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right)\\
=\mathcal N \left(
\mathbf 0;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right) $$
and similarly for the denominators in (1).
Here's a Wolfram Alpha link for the one-dimensional version.

$^*$ Here are some links to proofs of various versions of the theorem (I used Apostol's):
Mathematical Analysis (Apostol, Theorem 14.16, p.401)
Is there a mean-value theorem for volume integrals?
The Mean Value Theorem for Multiple Integrals

NB: The following is too long for a comment: You wrote ...

We could of course also write this integral as:$$\Phi\left(
\mathbf \epsilon\mathbf 1;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right) -
\Phi\left(
\mathbf -\epsilon\mathbf 1;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right)$$ If we lean on fairly ordinary CDF notation.

To see that's not correct, see here for a nice graphical demonstration in the two-dimensional case. E.g., if we have $\mathbf{z}=(z_1,z_2)$, and define
$$F(z_1,z_2):=\Phi\left(
\mathbf z;
\mathbf A^\intercal\boldsymbol \mu,
\mathbf A^\intercal (\beta^2\mathbf I+\boldsymbol \Sigma)\mathbf A
\right)$$
 then the probability of the square $(-\epsilon,\epsilon)\times(-\epsilon,\epsilon)$ is not generally $F(\epsilon,\epsilon)-F(-\epsilon,-\epsilon)$, but rather $$F(\epsilon,\epsilon)+F(-\epsilon,-\epsilon)-F(-\epsilon,\epsilon)-F(\epsilon,-\epsilon).$$


text:
Q: How to insert a value from a React component into textarea value I'm trying to insert a value of a component inside a textarea value, I'm pulling the data from a backend and using it in the GetAboutApp component, it works fine inside other elements like <div> or <p> for example, but when using it in the textarea value property it gives me [object Object]
my GetAboutApp component code:
import { useState, useEffect } from 'react';
import Axios from 'axios';

const GetAboutApp = () => {
  const [appDesc, setAppDesc] = useState('');

  useEffect(() => {
    const getAppDesc = async () => {
      const getAppDescUrl = 'http://dev.com:3001/getAppDesc';

      try {
        const response = await Axios.get(getAppDescUrl);
        setAppDesc(response.data);
      } catch (err) {
        console.error(err);
      }
    };
    getAppDesc();

    return () => setAppDesc(''); // cleanup: set the value to nothing
  }, []);

  return (
    <>
      {appDesc.DescRetrieved === 1
        ? appDesc.result[0].rest_app_about.length > DescLen
          ? appDesc.result[0].rest_app_about.slice(0, DescLen) + '...'
          : appDesc.result[0].rest_app_about
        : appDesc.message}
    </>
  );
};

export default GetAboutApp;

My textarea element:
<textarea
                    name='aboutDescription'
                  id='aboutDescription'
                  defaultvalue={<GetAboutApp />}
                  minLength={MIN_DESC_LENGTH}
                  maxLength={MAX_DESC_LENGTH}
                  onChange={(e) => setAppDesc(e.target.value.trim())}
                  onKeyUp={(e) => {
                    const target = e.target.value.trim();

                    if (target.length > 0 && target.length < MIN_DESC_LENGTH) {
                      if (descErr)
                          descErr.textContent = `desc can't be less than ${MIN_DESC_LENGTH}`;
                      } else if (target.length > MAX_DESC_LENGTH) {
                        if (descErr)
                          descErr.textContent = `desc can't be more than ${MAX_DESC_LENGTH} character`;
                      } else {
                        if (descErr) descErr.textContent = '';
                      }
                    }}
                    required
                  ></textarea>

My question is how to render the content returned from  component inside the textarea, or if there's any way around or trick to achieve this?

A: You need to add value in <Textarea value={ data }>
Data is variable which will have incoming textarea data from API.

A: Is there a reason why you want to do this in a seperate component?
The reason why this isn't working is that you actually need a string for the "default value" but you're having a react Component (which is an Object, that's why it's giving you the [Object, Object])
You've got two options now. The easier but less "nice" way would be to directly call the API in the useEffect of the component where your text area actually is.
--> Then you would have direct access to your "getAccess" state, which is a string
The more beautiful way would be to write a custom hook. This is a component which gives you direct access to states. You also can use useEffect in custom hooks.
--> Also here you would have direct access to your state-variable. And you have it "outsourced" in the hook.
You can read more about custom hooks here: React Custom Hooks


text:
Q: BeanCreationException on Spring TestNG PowerMock test I'm getting BeanCreationException when using @AutoWired (Spring Annotation) and @PrepareForTest (PowerMock) and running my Spring enabled TestNG test.
I have a Spring controller, picked up via component scan.
I'm testing with TestNG, Mockito, and PowerMock.
I'm trying to spy on an auto wired controller thats autowired into the test, via: @AutoWired annotation.
Here's the beginning of the test class:
@PowerMockIgnore("*")
@WebAppConfiguration
@ContextConfiguration(locations = { "classpath:applicationContext-test.xml" })
@PrepareForTest(IWantAHamburgerController.class)
public class IWantAHamburgerControllerTest extends AbstractTestNGSpringContextTests {

    @Autowired
    private WebApplicationContext wac;
    @Autowired
    private MockHttpSession session;
    @Autowired
    private MockHttpServletRequest request;
    @Autowired
    private IWantAHamburgerController iWantAHamburgerController;

    private MockMvc mockMvc;

    @ObjectFactory
    public IObjectFactory getObjectFactory() {
        return new org.powermock.modules.testng.PowerMockObjectFactory();
    }

     @BeforeClass
     public void setup() {
         this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();

         // see the note at the bottom of this post about this line
         //iWantAHamburgerController = (IWantAHamburgerController) applicationContext.getBean("iWantAHamburgerController");
     }

I'm trying to test a GET method on IWantAHamburgerController. This is what the test looks like:
    @Test
    public void testGetHamburgerAfterAskingThisQuestion() throws Exception {
        Principal p = PowerMockito.mock(Principal.class);
        PowerMockito.when(p.getName()).thenReturn("oneofthefiveguys");

        IWantAHamburgerController spy = PowerMockito.spy(iWantAHamburgerController);

        PowerMockito.doReturn("oneofthefiveguys").when(spy).getUserName("oneofthefiveguys");

        mockMvc.perform(get("/hamburgers/everythinghamburger.html")).andExpect(status().isOk())
                .andExpect(view().name("jsp/hamburger/everythinghamburger"))
                .andExpect(forwardedUrl("jsp/hamburger/everythinghamburger"));

        PowerMockito.verifyPrivate(spy).invoke("initGrill", "oneofthefiveguys");

        new org.mockito.internal.debugging.MockitoDebuggerImpl().printInvocations(spy);
    }

Inside the test I want to spy on the autowired iWantAHamburgerController in order to verify that initGrill was called by the GET method on the controller.
If I remove @PrepareForTest(IWantAHamburgerController.class) I do not get a BeanCreationException, but then PowerMock doesn't work.
Note: I've tried to manually set the iWantAHamburgerController bean, but when I do, I get a ClassCastException.
Here's the full stack:

org.springframework.beans.factory.BeanCreationException: Error
  creating bean with name
  'com.fiveguys.controllers.IWantAHamburgerControllerTest': Injection of
  autowired dependencies failed; nested exception is
  org.springframework.beans.factory.BeanCreationException: Could not
  autowire field: private
  com.fiveguys.controllers.IWantAHamburgerController
  com.fiveguys.controllers.IWantAHamburgerControllerTest.iWantAHamburgerController;
  nested exception is
  org.springframework.beans.factory.NoSuchBeanDefinitionException: No
  qualifying bean of type
  [com.fiveguys.controllers.IWantAHamburgerController] found for
  dependency: expected


text:
Q: Where to store secret key of the c# application There are similar questions
How to Manage Key in a Symmetric Algorithm
Where to store a secret key to use in a SHA-1 hash?
My question is same, But I want to ask it differently
I have C# application. I am encrypting some data in the application. For encryption I am using secret key or password. This same thing is needed for decryption.
Where/how to store this secret  key or password in application? its easy to view string password from reflection. I may use some combination to generate password, but some smart guys can guess that with some efforts.
Is there any secured way to store or manage secret password which is used in application to encrypt data?

A: I doubt there is any guaranteed secure way to store the key. Ultimately your program has to get access to the key, and a cracker could easily work out how that is happening via reverse engineering and redirect that string to wherever they want to.
Your best options are to:

*

*Obfuscate the key as much as possible. This makes it more difficult to access the "secret key" but does not make it impossible (see above). Rather than storing it as a string, generate it using a function, or use a seed and pass that through a function to get the secret string.

*If your use case allows it, use a public/private key pair. It only works if you want your application to encrypt the data, send it to your servers, and then you want to decrypt it. In this case, you embed the public key into the application (doesn't matter if crackers discover that), and keep the private key to yourself or your server.

A: If you store the key as an app-setting, and encrypt the app-settings, then I think you're pretty save.
You can use the following code to encrypt sections of the app.config.
using System;
using System.Configuration;

public static class ConfigurationEncryptor {
    [Flags]
    public enum ConfigurationSectionType {
        ConnectionStrings = 1,
        ApplicationSettings = 2
    }

    /// <summary>
    /// Encrypts the given sections in the current configuration.
    /// </summary>
    /// <returns>True is the configuration file was encrypted</returns>
    public static bool Encrypt(ConfigurationSectionType section) {
        bool result = false;

        Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
        if (config == null)
            throw new Exception("Cannot open the configuration file.");

        if (section.HasFlag(ConfigurationSectionType.ConnectionStrings)) {
            result = result || EncryptSection(config, "connectionStrings");
        }

        if (section.HasFlag(ConfigurationSectionType.ApplicationSettings)) {
            result = result || EncryptSection(config, "appSettings");
        }

        return result;
    }

    /// <summary>
    /// Encrypts the specified section.
    /// </summary>
    /// <param name="config">The config.</param>
    /// <param name="section">The section.</param>
    private static bool EncryptSection(Configuration config, string section) {
        ConfigurationSection currentSection = config.GetSection(section);
        if (currentSection == null)
            throw new Exception("Cannot find " + section + " section in configuration file.");
        if (!currentSection.SectionInformation.IsProtected) {
            currentSection.SectionInformation.ProtectSection("DataProtectionConfigurationProvider");
            config.Save();

            // Refresh configuration
            ConfigurationManager.RefreshSection(section);

            return true;
        }
        return false;
    }
}

And use it like this (e.g. in your Main() method):
ConfigurationEncryptor.Encrypt(
    ConfigurationEncryptor.ConfigurationSectionType.ApplicationSettings |
    ConfigurationEncryptor.ConfigurationSectionType.ConnectionStrings
);


text:
Q: SNMP agent configuration windows/linux i need to retrieve information via snmp and then use this information to create some sort of graphic application in Unity.
I find the SnmpSharp library
http://www.snmpsharpnet.com/
i create a little program in unity using this library and then i installed the snmp on my windows machine(using windows official guide) , on localhost it works!
Now my problem is
how can i connect to other agent on my lan network ?
How can install agent on my other device example a linux pc ?
i'm a little confused beacuse i try to install snmp on an other windows pc but i can't retrieve snmp information from it ; i try to install the snmp agent on a linux pc but i don't understand how to correctly install an agent that have to communicate across my lan
This is the code that work on localhost
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using SnmpSharpNet;
using System.Net;

public class SNMP_walk : MonoBehaviour {

[SerializeField] public InputField community_str;
[SerializeField] public InputField agent_ip_address;
[SerializeField] public Button MyButton ;
string str_community  = null;
string ip  = null;
void Start () {
    //test button

    MyButton.onClick.AddListener (() => {
        str_community = community_str.text;
        ip = agent_ip_address.text;
        Debug.Log (str_community);
        Debug.Log(ip);
        snmp_walk (str_community, ip);
    });
}

// Update is called once per frame
void Update () {

}

void snmp_walk(string str_community, string ip){

    OctetString community = new OctetString (str_community);
    // Define agent parameters class
    AgentParameters param = new AgentParameters (community);
    // Set SNMP version to 1 (or 2)
    // settare in base alla versione usata
    param.Version = SnmpVersion.Ver1;
    // Construct the agent address object
    // IpAddress class is easy to use here because
    //  it will try to resolve constructor parameter if it doesn't *
    //  parse to an IP address
    IpAddress agent = new IpAddress (ip);

    // Construct target
    // IP, port,timeout,retry
    UdpTarget target = new UdpTarget ((IPAddress)agent, 161, 4000, 2);
    //necessario per tutte le richieste
    Pdu pdu = new Pdu (PduType.Get);

    pdu.VbList.Add ("1.3.6.1.2.1.1.1.0"); //sysDescr
    pdu.VbList.Add("1.3.6.1.2.1.1.2.0"); //sysObjectID
    pdu.VbList.Add("1.3.6.1.2.1.1.3.0"); //sysUpTime
    pdu.VbList.Add("1.3.6.1.2.1.1.4.0"); //sysContact
    pdu.VbList.Add("1.3.6.1.2.1.1.5.0"); //sysName
    pdu.VbList.Add ("1.3.6.1.2.1.25.2.2.0"); //Load for one core
    //pdu.VbList.Add ("1.3.6.1.2.1.25.6.3.1.1.11"); //Memory ? occupata
    //pdu.VbList.Add ("1.3.6.1.2.1.25.3.3.1.2.4"); //CPU ?

    SnmpV1Packet result = (SnmpV1Packet)target.Request (pdu, param);

    // If result is null then agent didn't reply or we couldn't parse the reply.
    if (result != null) {
        // ErrorStatus other then 0 is an error returned by
        // the Agent - see SnmpConstants for error definitions
        if (result.Pdu.ErrorStatus != 0) {
            // agent reported an error with the request
            Debug.Log ("Error in SNMP reply. Error {"+result.Pdu.ErrorStatus+"} " +
                       "index {"+result.Pdu.ErrorIndex+"}");

        } else {
            // Reply variables are returned in the same order as they were added
            //  to the VbList
            Debug.Log ("sysDescr({"+result.Pdu.VbList [0].Oid.ToString ()+"}) " +
                "({"+SnmpConstants.GetTypeName (result.Pdu.VbList [0].Value.Type)+"}): " +
                "{"+result.Pdu.VbList [0].Value.ToString ()+"}");

            Debug.Log("sysObjectID({"+result.Pdu.VbList [1].Oid.ToString ()+"}) " +
                      "({"+SnmpConstants.GetTypeName (result.Pdu.VbList [1].Value.Type)+"}): " +
                      "{"+result.Pdu.VbList [1].Value.ToString ()+"}");

            Debug.Log("sysUpTime(({"+result.Pdu.VbList [2].Oid.ToString ()+"}) " +
                      "({"+SnmpConstants.GetTypeName (result.Pdu.VbList [2].Value.Type)+"}): " +
                      "{"+result.Pdu.VbList [2].Value.ToString ()+"}");

            Debug.Log("sysContact(({"+result.Pdu.VbList [3].Oid.ToString ()+"}) " +
                      "({"+SnmpConstants.GetTypeName (result.Pdu.VbList [3].Value.Type)+"}): " +
                      "{"+result.Pdu.VbList [3].Value.ToString ()+"}");

            Debug.Log("sysName(({"+result.Pdu.VbList [4].Oid.ToString ()+"}) " +
                      "({"+SnmpConstants.GetTypeName (result.Pdu.VbList [4].Value.Type)+"}): " +
                      "{"+result.Pdu.VbList [4].Value.ToString ()+"}");

            Debug.Log("Total Mem ({"+result.Pdu.VbList [5].Oid.ToString ()+"}) " +
                      "({"+SnmpConstants.GetTypeName (result.Pdu.VbList [5].Value.Type)+"}): " +
                      "{"+result.Pdu.VbList [5].Value.ToString ()+"}");

        /*  Debug.Log("CPU ? " + result.Pdu.VbList[6].Oid.ToString()+
                      SnmpConstants.GetTypeName(result.Pdu.VbList[6].Value.Type)+
                      result.Pdu.VbList[6].Value.ToString());*/

        }
    } else {
        Debug.Log ("No response received from SNMP agent.");
    }
    target.Close ();
}

}
Thanks for your help and sorry for my english !

A: By default, once installed, SNMP Agent on Windows only allows queries from localhost.
To allow remote SNMP queries, you need to setup the SNMP Service :

*

*Open Windows Services Manager

*Right Click on SNMP Service and edit Properties

*Select Security tab

From here, add remote host(s) allowed to query your SNMP Agent.

Edit:
I am aware that this could just answer a part of your question :
Cannot query Windows SNMP Agent from hosts other than localhost.
How to install/configure SNMP Agent on Linux would be a full other question, describing what you have tried and what is not working.
C# code review/debug shoud be posted on SF sister site : stackoverflow


text:
Q: Parallel add and displaced transitions in ListView In ListView when I add new item with long add transition inserting new items before that item cause displace of that item and stop its add transition processing. How can I workaround this?
import QtQuick 2.0
import QtQuick.Controls 1.0

Item
{
    width: 500
    height: 500

    property ListModel model: ListModel {}

    Button
    {
        id: button
        text: "insert: " + model.count

        onClicked:
        {
            model.insert(Math.round(Math.random() * model.count), {"name": model.count});
        }
    }

    ListView
    {
        model: parent.model
        anchors.top: button.bottom
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.bottom: parent.bottom

        delegate: Text {
            text: name
        }

        add: Transition {
            NumberAnimation { properties: "opacity"; from: 0.0; to: 1.0; duration: 1000 }
        }
    }
}

A: This problem is clearly discussed in this nice tutorial which is really a good read about transitions and their handling. I highly recommend reading it.
Citing it directly from the Handling interrupted animations section:

Each newly added item undergoes an add transition, but before the transition can finish, another item is added, displacing the previously added item. Because of this, the add transition on the previously added item is interrupted and a displaced transition is started on the item instead. Due to the interruption, the opacity and scale animations have not completed, thus producing items with opacity and scale that are below 1.0.

Hence, what you need is a transition for the displacement. Adding the following code to the ListView should solve your issue:
displaced: Transition {
    NumberAnimation { properties: "opacity"; to: 1.0; duration: 1000}
}

The duration can be omitted. It can help to tweak the animation so that speed-ups are avoided (or at least limited). Possibly we can also write:
displaced: Transition {
        NumberAnimation { properties: "opacity"; to: 1.0; duration: 1000 * (1 - from)}
}


text:
Q: Copy code with full package names Sometimes I want to copy a random block of my code that uses 3rd party libraries and share it with others.  e.g., Put it on a blog or something.  If I paste what I copy, a lot of context is lost because you can't see the packages of the 3rd party libraries.
The solution I use is to reduce this code into a small class and then share the whole class, import statements and all.  This is a lot of manual work, especially if it's just for a simple email to someone.  Is there a way I can copy a snippet of code and have it include the full package paths?

A: You probably can use Scratch File (Ctrl-Alt-Shift-Insert) and copy-paste to it so imports should be copied too. It's a bit faster than copy-paste to new file.


text:
Q: Text file as data source in SSRS I need to use text files as data source in SSRS. I tried accessing this with 'OLEDB provider for Microsoft directory services' connection. But I could not. The query is given below.
Also let me know how to query the data

A: I know this thread is old, but as it came up in my search results this may help other people.
There are two 'sort of' workarounds for this.  See the following:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=130650
So basically you should use OLEDB as the data source, then in the connection string type:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=xxxx;Extended Properties="text;HDR=No;FMT=Delimited"
Then make sure your file is saved in .txt format, with comma delimiters.  Where I've put xxxx you need to put the FOLDER directory - so C:\Temp - don't go down to the individual file level, just the folder it's in.
In the query you write for the dataset, you specify the file name as though it were a table - essentially your folder is your database, and the files in it are tables.
Thanks

A: I have had great success creating linked servers in SQL to link to disparate text files for creating SSRS reports. Below is sample SQL to link to your txt files:
EXEC master.dbo.sp_addlinkedserver @server = N'', @srvproduct=N'', @provider=N'Microsoft.Jet.OLEDB.4.0', @datasrc=N'', @provstr=N'text'
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'YourLinkedServerName',@useself=N'False',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL

A: I simply used BULK INSERT command to load the flat file into a temporary table in SSRS, like this:
CREATE TABLE #FlatFile
(
    Field1 int,
    Field2 varchar(10),
    Field3 varchar(15),
    Field4 varchar(20),
    Field5 varchar(50)
)

BEGIN TRY
BULK INSERT #FlatFile
   FROM 'C:\My_Path\My_File.txt'
   WITH
      (
         FIELDTERMINATOR ='\t',   -- TAB delimited
         ROWTERMINATOR ='\n',     -- or '0x0a' (whatever works)
         FIRSTROW = 2,            -- has 1 header row
         ERRORFILE = 'C:\My_Path\My_Error_File.txt',
         TABLOCK
      );
END TRY
BEGIN CATCH
  -- do nothing (prevent the query from aborting on errors...)
END CATCH

SELECT * FROM #FlatFile

A: I don't think you can
Data Sources Supported by Reporting Services. In the table, your only chance would be "Generic ODBC data source", however a text file is not ODBC compliant AFAIK. No types, no structure etc.
Why not just display the text files? It seems a bit strange to query text files to bloat them into formatted HTML...

A: I'm not of the mind that you can, but a workaround for this, if your text files are CSVs or the like, is to create an SSIS package which brings that data into a table in SQL Server, which you can then query like there's no tomorrow. SSIS does Flat File Sources with ease.
You can even automate this by right clicking the database in SSMS, doing Tasks->Import Data. Walk through the wizard, and you can then save off the package at the end.


text:
Q: Having a copy of an object instead of a locked one Is there a way of, instead of locking an object, show a temporary copy of it, to the one who is accessing it?

A: Wrap the code that uses that object which in your case is a critical resource, with a TransactionScope and set the IsolationLevel to Snapshot.
That way, anyone trying to access the same object should see the value from before editing the object, until the transaction is complete.

A: You can avoid temporary copies if you use volatile modifier.

The system always reads the current value of a volatile object at the point it is requested, even if the previous instruction asked for a value from the same object. Also, the value of the object is written immediately on assignment.
  The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock statement to serialize access. Using the volatile modifier ensures that one thread retrieves the most up-to-date value written by another thread.


text:
Q: jQuery slider help on hiding and showing div elements I'm pretty rusty on jQuery and front end in general, I am trying to get a slide left effect to:
1) effectively hide a div element an image, then show a form in it's place
2) swiping right hides the form and brings back the image.
I am using basic code at the moment to get a better understanding how the hide/show works in relation to swipe left and right.
HTML:

jQuery code:
 $(function(){
    $("div.box").on("swipeleft", swipeleftHandler);
    $("div.box").on("swiperight", swiperightHandler);

    function swipeleftHandler(event){
        $(event.target).addClass("swipeleft");
        $(this).hide();
    }

    function swiperightHandler(event){
        $(event.target).addClass("swiperight");
        $(this).show();
    }
});

This is the basic code on jsfiddle: https://jsfiddle.net/avas9eb3/
The problem I'm having is, swiping left to hide works, but swiping right to show does nothing.
And it only works once and requires a page refresh.

A: After you've hidden it with the swipe left, it'll be hidden, so you couldn't capture the swipe right anyway.
Therefore, I would probably consider putting the handler on the parent element of the box that you are hooking into. Then you can find the descendant element in the handler.
$(function(){
    $("div.box").parent().on("swipeleft", swipeleftHandler);
    $("div.box").parent().on("swiperight", swiperightHandler);

    function swipeleftHandler(event){
        $(event.target).addClass("swipeleft");
        $(this).find("div.box").hide();
    }

    function swiperightHandler(event){
        $(event.target).addClass("swiperight");
        $(this).find("div.box").show();
    }
});

Note: You might need to adjust your "find" logic to be more specific if needs be depending on what siblings your box has.


text:
Q: Get the value of  I want my application to skip some logic if the user had added these lines to their config file:
<system.net>
  <defaultProxy useDefaultCredentials="true" />
</system.net>

I was thinking this would do the trick
System.Net.Configuration.DefaultProxySection dps = new System.Net.Configuration.DefaultProxySection();
if (!dps.UseDefaultCredentials)
{
    //Do stuff
}

but it still just returns false, despite my config value. I could be totally wrong in my thinking here... Any ideas?

A: Your code is creating the object from fresh, not from the config file. Instead, do this:
var dps = System.Configuration.ConfigurationManager.GetSection("system.net/defaultProxy")
              as System.Net.Configuration.DefaultProxySection;
if (!dps.UseDefaultCredentials)
{
    //Do stuff
}

Also, you probably want to do a check to ensure dps is not null before blindly reading it's properties.


text:
Q: How can I create parent entity only once, when multiple child are created in the hibernate? I have one User class and one Note class defined as below:
@Entity
@Table(name = "notes")
public class Note {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    @Column
    private String title;
    @Column
    private String content;
    @ManyToOne
    @JoinColumn(name = "user_id")
    private User user;

// getters and setters
}

@Entity
@Table(name="users")
public class User {
    @Id
    @Column
    private int id;
    @Column
    private String name;
    @Column
    private String userName;

 //getters and setters
}

I'm trying to create a "Note" and what I want to achieve is, as part of my request payload, I'll pass my user details, with id, as below:
[{
    "title": "Mynote",
    "content": "This is another note",
    "user": {
        "id": 4,
        "name": "user_1",
        "userName": "S"
    }
}]

I want that, if "User" is already there it should not update the users table with new entry, and if user with given id is not there it should create a new one and link that one to the notes.
For this I used @ManyToOne(cascade = CascadeType.ALL), above private User user field in "Notes" class.
It works for one request, but for next request it throws
java.sql.SQLIntegrityConstraintViolationException:
   Duplicate entry '5' for key 'PRIMARY'

This is expected as it is trying to insert same row twice.
Can I achieve this using some annotation in spring or od I have to handle this in my own code as: while creating note, I have to check if the user exists or not and if it does not exist, then create a new one, and then save the note.
(Basically, this is what I want to achieve using hibernate/spring-data-jpa, if some support is there).

A: For more technical details, please take a look at the link provided by @Chinthaka Dinadasa under your question.
For a quick and easier solution, think of it from a different side. Let's add notes to a user and save this user (not note).
User entity
@Entity
@Table(name = "users")
public class User {

    @Id
    private Integer id;

    @OneToMany(mappedBy = "user", cascade = CascadeType.ALL) // !!! add "cascade"
    private List<Note> notes = new ArrayList<Note>();

Note entity
@Entity
@Table(name = "note_table")
public class Note {

    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private Integer id;

    @ManyToOne
    @JoinColumn(name = "user_id")
    private User user;

now if you try to call twice the following method in some @Service, you'll have one user and 2 notes for this user:
@Service
public class MyService {
    @Autowired
    private UserRepository userRepository;

    @Transactional
    public void acceptNewNote() {
        User user = new User();
        user.setId(0L);
        Note note = new Note();
        user.setNotes(Arrays.asList(note));

        userRepository.save(user);

where UserRepository is:
public interface UserRepository extends CrudRepository<User, Integer>


text:
Q: "It may be inaccessible due to protection level" I am trying to add collision with some picture boxes and the error explaining that this is inaccessible shows up. I am quite garbage at code and it may be obvious to some but not to me.
Here be my code
Public Sub Panel1_Paint(sender As Object, e As PaintEventArgs) Handles Panel1.Paint
    If Panel1.Bounds.IntersectsWith(P1Character.Bounds) Then
        collision = True
    Else : collision = False
    End If
End Sub

The two collision's is the part being said that it is inaccessible due to protection level.


text:
Q: Lower bound on P(Y > 3/2 E(Y)) where Y = # of triangles in graph Context
This is exercise 1.7.1 of Tao/Vu's Additive Combinatorics, generally considered a graduate level math textbook.
My question is not "How do I solve this exercise?"
My question is "What is this exercise even looking for?"
Definition
We define a graph $G(n,p)$ as follows: for each pair of nodes, we independently decide, with probability $p=n^{-1+\epsilon}$, whether to assign edge between the pair of nodes.
Let $Y$ be the number of triangles in the graph.
Problem:
Provide upper and lower bonds for $P(Y > 3/2 E(Y))$.
What I have so far (the upper bound):
Proving $P(Y > 3/2 E(Y)) < ... $ is fairly easy. This is a matter of calculating $E(Y)$, $E_1(Y)$, $E_2(Y)$, ... and applying theorem 1.37 (bounds on correlation of polynomials.) To avoid ruining the exercise, more will not be said about the upper bound.
What I'm stuck on (the lower bound):
I can't figure out what $...$ should look like in $P(Y > 3/2E(Y)) > ... $.
Everything I've seen in the book so far deals with proving statements of the form:
$P( | Y - E(Y) | > ... ) < ... $ -- it provides an upper bound on deviation from the mean.
Now, however, I want to prove a lower bound on deviation from the mean.
Question:
What types of inequalities should I be looking into?
Is there some trivial way to "flip" the bounds that I'm not seeing?
Thanks!


text:
Q: how do you combine the weak models in gradient boosted tree? In this article
https://www.analyticsvidhya.com/blog/2015/11/quick-introduction-boosting-algorithms-machine-learning/
The author indicates you combine 3 weak models into a final one using gradient boosting, but gave no detail how to combine them. Could someone explain how that's done?

A: The author explicitly state the three algorithms which combine weak learners to a more powerfull boosted model; AdaBoost, GradientBoosting and XGBoost with the python codes relevant to each boosting. XGboost is in his next article.

A: Apparently, the result is weighted average of the weak learners, where the weight is the same as the learning rate.


text:
Q: How to properly initialize a lambda expression's parameter where the lambda is a method parameter? I have found an example here https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-3.1&tabs=windows:
            static void Main(string[] args)
            {
                var host = new HostBuilder();
                host.ConfigureAppConfiguration((hostContext, builder) =>
                 {
                    // Add other providers for JSON, etc.

                    if (hostContext.HostingEnvironment.IsDevelopment())
                     {
                         //builder.AddUserSecrets<Program>();
                     }
                 })
                 .Build();
            }

When this code starts in debugging mode the hostContext and builder variables already have some values. How I can write my own method in this way like the described above? E.g. when I pass a lambda expression as a parameter to my method then my class, that owns this method, can initialize the parameters of this lambda expression by some customized objects?

A: The lambda here is simply an Action<T1, T2>
So you can write your method like so:
public static void DoMyWork(Action<Something, Else> action) {
   var something = new Something();
   var else = new Else();
   action(something, else);
}

And then call it like so:
MyClass.DoMyWork((something, else) => {
   Console.WriteLine($"{something} is not null and neither is {else}");
});


text:
Q: Write Log Messages to Third Party REST service with NLog Looking for a way to send messages with NLog to a third party REST api.
Most of the examples I have seen how to post log messages to a service in which the endpoint can be modified to fit what NLog wants.
For some context to the problem.  We are using Octopus deploy.  One of the components to our app is SSRS reports that are surfaced through the app.  The RDL files deployed to the SSRS server require dependent data to be written to the app database.
We have a command line tool that handles that - but it requires someone to run the tool.
I want to add the tool as a the last step in the deployment process of the RDL files.  All simple enough.
The challenge is the tool writes problems / exceptions to a log file.  What I want to do is put another target in the NLog config so that I can post those messages back to the Octopus server - this way the Release Engineers deploying don't have to log in to the remote server to diagnose problems.
Octopus has a very robust REST api (they even have .NET client already written).  Is there a way to wrap this client in a NLog ServiceTarget extension?


text:
Q: Check on Create Table I have this:
create table airport
(idairport varchar(1),
name varchar(1),
city varchar(1),
primary key(idairport));

Is it possible to check that one city doesn't have more than 3 airports?
Edited:
The exercise is:

Translate to the relational model a conceptual schema. We want to know, for each airport, the aircrafts that have been there and the possible destinations. If the model is not normalized, normalize it avoiding the existence of null values.
Constraints:

*

*There is not any flight leaving an airport and landing in the same
airport.

*A city has, at most, three airports.

The solution must be a set of "CREATE TABLE" sentences. Express as many integrity constraints as you can. Specify all "NOT NULL" due to the relational translation and only these. Furthermore, you shouldn't forget to define the necessary foreign and alternative keys (UNIQUE+NOT NULL).
After translation(If I'm not wrong):
create table aircraft
(idaircraft varchar(1),
seating varchar(1),
primary key(idaircraft));

create table destination
(idairportorigin varchar(1) references airport(idairport),
idairportdestination varchar(1) references airport(idairport),
idaircraft varchar(1),
check(idairportorigin <> idairportdestination),
primary key(idairportorigin, idairportdestination, idaircraft),
foreign key (idaircraft) references aircraft(idaircraft));

A: Something like this will tell you.
 select city, count(city) citycount
 from airport
 group by city
 having count(city) >=3

A: "Is it possible to check that one city doesn't have more than 3 airports?"
Not with a normalised data model, using only create table statements.
Even using triggers alone is not sufficient due to read consistency preventing transactions from seeing other uncommited transactions.
The only safe way of doing this is to use an on-commit materialised view that stores the count, with a constraint placed on the MV table's count column to prevent it from exceeding 3.

A: If you write trigger in your db then the following sql will give you count of airport-
select count(idairport) from airport where city = 'entered city',
and then you can discard addition of any airport from the city in your pre-insert or pre-update trigger.
and also if you use some programming api like jdbc etc -
then also by above sql you will have count of airport before entering/updating any data and then you can discard the addition/updation from this point of coding.


text:
Q: GWT: How to set text-align on com.google.gwt.dom.client.Style How to set text-align on com.google.gwt.dom.client.Style object?

A: You can use setProperty (note property name is camel case):
style.setProperty("textAlign", "left");


text:
Q: How do i put a logo on the left but not all the way left just in the middle? i tried using this code
<div id="logo" style="background-image:
url('http://comprogroup2ict2b.rf.gd/logo.png');
width: 100px; height: 50px; background-size: contain;
background-repeat:no-repeat; float: left">
</div>
but i cant seem to make it semi center left

A: you should try some margining like margin-top:50%


text:
Q: ERROR: could not get unknown property 'plugin' for root project I am trying to build LineageOS' trebuchet launcher. After updating protobuf plugin I managed to get rid of some errors. But after several tries I can not handle this error:

Could not get unknown property 'plugin' for root project
'android_packages_apps_Trebuchet-lineage-16.0' of type
org.gradle.api.Project.

This is my first time editing code from Github. Please help.
buildscript {

    repositories {
        mavenCentral()
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.2'
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.13'
    }
}
apply plugin 'com.android.application'
apply plugin 'com.google.protobuf' version '0.8.13'

final String SUPPORT_LIBS_VERSION = '28.0.0'

android {

    defaultConfig {
        compileSdkVersion 28
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        debug {
            minifyEnabled false
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

There is a lot more code after this, didn't seem important so didn't add. Let me know if it's needed

A: It should be:
apply plugin: 'com.android.application'

with a colon.


text:
Q: Angular universal not rendering once deployed, ok in local I'm a bit mystified as to what's wrong with my app. After building it I can run it locally and the server side rendering works, but once it has been deployed to the server ssr stops working.
Normally you see some sort of error on the express app if there's issue, but  I'm not getting one.
The only thing I can determine is only content from my api that's not rendering. Just doesn't make any sense why it works locally and not on the server.
Does anyone have any suggestions as to what I need to look at as I'm stumped.

A: Add the API URL inside your host file to resolve.
edit /etc/hosts to the following:
127.0.0.1 localhost
127.0.0.1 api.example.com

Note that API domain should also be in this VM box.


text:
Q: Borel subalgebras contain solvable radical
Let $L$ be a Lie algebra and let $B$ be a Borel subalgebra (a maximal solvable subalgebra) of $L$. I want to understand why $\operatorname{Rad} L \subseteq B$.

In his proof, Humphreys (Introduction to Lie Algebras and Representation Theory - pag 83) says that, since $B$ is a solvable subalgebra and $\operatorname{Rad}L$ is a solvable ideal of $L$, then $B+\operatorname{Rad}L$ is a solvable subalgebra.
Why should it be true? I know in general that the sum of two solvable ideal is a solvable ideal, but I don't know how to apply this in my situation. Thanks.

A:
Take the commutator of this stuff with itself again and its an induction argument on the length of the derived series (the longer one of the two).

I just want to make this step in Ravi's answer clearer, since I don't think it is obvious (well, at least to me...).
Using the fact that $\text{Rad }L$ is an ideal, we have $$[B+\text{Rad }L,B+\text{Rad }L]\subset [B,B]+\text{Rad }L.\hspace{1cm}(*)$$ If we use the notation $L^{(0)}=L$, $L^{(n)}=[L^{(n-1)},L^{(n-1)}]$, then $(*)$ implies that for each $n$, $$[B^{(n-1)}+\text{Rad }L,B^{(n-1)}+\text{Rad }L]\subset B^{(n)}+\text{Rad }L.$$ So we can prove by induction that $$\begin{aligned}(B+\text{Rad }L)^{(n)}&\subset B^{(n)}+\text{Rad }L.\end{aligned}$$ Now, since $B$ is solvable, $B^{(n)}=0$ for some $n$, so $(B+\text{Rad }L)^{(n)}\subset \text{Rad }L$. Since $\text{Rad }L$ is solvable, we conclude that $(B+\text{Rad }L)^{(n)}$ is solvable. Thus $B+\text{Rad }L$ is solvable.

A: We have $$[B+\text {Rad} L, B+\text {Rad} L] = [B,B]+[B,\text{Rad} L]+[\text{Rad} L,B]+[\text{Rad} L,\text{Rad}L].$$
The first term in in the commutator of B, the second two terms are in Rad L and the last one is in the commutator of Rad $L$. Take the commutator of this stuff with itself again and its an induction argument on the length of the derived series (the longer one of the two).


text:
Q: run php on html link click and stay on same page after refresh I have a table of data that I want to allow users to remove rows from by clicking a link in the table. I'm looking to have the page refresh and the row that the user selects removed from the table. This is done based on calling a php function which alters the table's database. What I have so far is

    <?php echo $the_title?>
    <?php echo $val1?>
    <?php echo $val2 ?>
    <a href='?remove_now=<?php echo $row?>' name=''>Remove Now

<?php

if (isset($_GET['remove_now'])){
    $row_to_remove=$_GET['remove_now'];
    my_func ($row_to_remove);}

?>

When I click the Remove Now link it changes the page, because I'm already on a hashed page, which I don't want it to do. It also doesn't run my_func.
Any thoughts? Thanks

A: PHP runs on the server side, where a page update runs on the client (browser). If you want to execute php code, either the page has to be refreshed, or you need to use a javascript ajax call that will actually access the "page" on the server you're looking for, grab its data, and make it available to the current page (that made the ajax call).
If you just want to manipulate the page and don't need any data from the server, just use javascript. Javascript is for dom manipulation, not php.

A: Well, you cannot do what you are trying to do with php.  You need to use javascript to do what you want.
Here are some ways you can accomplish what you want
1) use javascript to manipulate the table that is already rendered on your page
or
2) use php to render the table without the desired row when the page initially loads
if you need to use php as part of the row removal process, you should look into ajax.
based on you comment, try something like this:

    <?php echo $the_title?>
    <?php echo $val1?>
    <?php echo $val2 ?>
<?php
$maxnumrows = 10;
for($i=0;$i<$maxnumrows;$i++){
    if (    (!isset($_GET['remove_now'])) || ( (isset($_GET['remove_now'])) && ($_GET['remove_now']!=$i) ) ){
        ?>
        <a href='?remove_now='<?php echo $i?> name=''>Remove Now
<?php
    }
}
?>

A: Closing quote on href attribute is wrong. It should be after closing php tag like this.
<a href='?remove_now=<?php echo $row?>' name=''>Remove Now
And yes .. javascript and ajax will work as well as just clicking the link and display same page. If you don't want url to be changed put header("Location ....") after my_func call
Cheers

A: It sounds like you're trying to delete entries from the database, and you're just thinking a little backwards. Here's a simplified piece of logic that may help you understand how to go about this:

// See if they just deleted something
// If so we will delete the data and reload the page
if(isset($_GET['delete_id']))){
  // Run the code that deletes the entry from the database
  deleteFromDatabase($_GET['delete_id']);
  // Now that we've done that just cleanly reload the page
  header('Location: '.$_SERVER['PHP_SELF']); // This refers to the current page without the $_GET query string - there must not be any page output before you call this
  die(); // Always kill the script after reloading the location header
}

// Here's your normal output (whatever you would normally do for output)
getTableData();
outputTable();
echo '
Whatever etc...';
?>


text:
Q: sending specific array value to email php I am using this code to output multiple specific values from array and sending these values to email.
If i write this:
print_r( $products[1]['Notes'], true )

Then it is displaying 1 value off course I have put "[1]" to just targeting 1 row.
and If i write this:
print_r( $products, true )

Then it is outputting all the values and all the rows.
Is there anyway i can output just multiple values of "Notes"?

A: There's an array_column() function that could help you here.
<?php
$data = [
    ['Notes' => 'test1'],
    ['Notes' => 'test2'],
    ['Notes' => 'test3'],
    ['Notes' => 'test4'],
    ['Notes' => 'test5'],
    ];

$notes = array_column($data, 'Notes');
print_r($notes);

Output:
Array
(
    [0] => test1
    [1] => test2
    [2] => test3
    [3] => test4
    [4] => test5
)

https://3v4l.org/Mp24S

A: If your php is 5.5 and more - use array_column function:
print_r(array_column($products, 'Notes'), true);

Otherwise, you need to select required columns with a foreach and print'em:
$columns = [];
foreach ($products as $prod) {
    $columns[] = $prod['Notes'];
}
print_r($columns, true);

A: $notes = array();
$i = 0;
while($i<count($products)){
  $notes[] = $products[$i]['Notes'];
  $i++;
}
print_r($notes);


text:
Q: Access to a class only in framework I'm creating a framework for iOS with this tool and I want to manage the visibility of my classes. Of course, I put my headers in corrects sections in my Build Phases > Copy Headers .
But when I add my framework in a new project, I still can access to classes (and their functions) stored in the Private section. I want my class "public" in my framework but "private" outside.
Is it possible ?
Thanks.
Tom

A: In the Objective-C runtime, everything is in the same global namespace. You can hide things by not including them in public headers, but they're still there and can be discovered and accessed using the lower level runtime APIs.


text:
Q: MSP and Custom Actions Suppose that MSI has custom action as part of the installation and custom action for the uninstall.
What should happen if I build MSP for that MSI -
if I instal the MSP, will it re-run the custom action?
What happen if the custom action itself is changed?

A: Applying or uninstalling a patch will run the InstallExecuteSequence similar to maintenance mode, so an action will run depending on its sequence conditions. With the exception of the actions with the MSI 4.5 patch-uninstall flag, the current version of the custom action (the patched version when installing the patch, and the previous version when uninstalling the patch) is used.


text:
Q: Knockout changing data-bind based on user selection I have some knockout code that consists of a list object and item object. There could be multiple lists and each list has an array of objects. I made this fiddle to demonstrate what I am trying to explain. What I want to be able to do is have a select box where the user can select a list and then the items from that list will be loaded. Currently I have my data-bind set up like this data-bind="foreach: lists[0].items". The index of the list is hard codded into the bind. Is there some way that I could dynamically assign the index of the list I wish to use?

A: Just put an observable instead of 0:
data-bind="foreach: lists[selectedIndex()].items"

With selectedIndex: self.selectedIndex = ko.observable(0);