text:
Q: Parameterized pipeline job to start parallel builds I am trying the below code for my parameterized pipeline job. i want to start job names taken from parameter to run parallel.
And those jobs also parameterized jobs. how to start parameterized pipeline job to trigger parallel builds. I also tried by using list , but it didnt work. can anyone suggest me where am i going wrong
def stepsForParallel = [:]
node {
     JOBS=JOB_NAMES.split(',');
     for (job in JOBS) {
         def stepName = "running_${job}"
         stepsForParallel[stepName] = { ->  build job: "runnning_$job", parameters: [string(name: 'BRANCH',value: $BRANCH),string(name: 'CHANGE_NUMBER',value: $CHANGE_NUMBER)] }
     }

parallel stepsForParallel

}
I got output like :
[Pipeline] parallel
[Pipeline] [running_a] { (Branch: running_a)
[Pipeline] [running_b] { (Branch: running_b)
[Pipeline] [running_a] }
[running_a] Failed in branch running_a
[Pipeline] [running_b }
[running_b] Failed in branch running_b
[Pipeline] }
[Pipeline] End of Pipeline

an exception which occurred:

in field itr
in field target
in field continue_
in field parent
in field parent
in field parent
in field parent
in field parent
in field parent
in field capture
in field def
in field locals
in field capture
in field def
in field closures
in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@5e5624f3
Caused: java.io.NotSerializableException: java.util.AbstractList$Itr
at      org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)

how to start parameterized pipeline job to trigger parallel builds. I also tried by using list , but it didnt work. can anyone suggest me where am i going wrong

A: It is related to JENKINS-34645  .
Try to remove node {} around for loop and move iteration into @NonCPS function. Something like this
@NonCPS
def stepsForParallel(def jobsName) {
    def steps = [:]
    jobs = jobsName.split(',')
    for (job in jobs) {
        def stepName = "running_${job}"
        steps[stepName] = { ->
            build job: "runnning_$job", parameters: [string(name: 'BRANCH', value: BRANCH), string(name: 'CHANGE_NUMBER', value: CHANGE_NUMBER)]
        }
    }
    return steps
}

parallel stepsForParallel(JOB_NAMES)


text:
Q: Sum of an infinite series $(1 - \frac 12) + (\frac 12 - \frac 13) + \cdots$ - not geometric series? I'm a bit confused as to this problem:
Consider the infinite series:
$$\left(1 - \frac 12\right) + \left(\frac 12 - \frac 13\right) + \left(\frac 13 - \frac 14\right) \cdots$$
a) Find the sum $S_n$ of the first $n$ terms.
b) Find the sum of this infinite series.
I can't get past part a) - or rather I should say I'm not sure how to do it anymore.
Because the problem asks for a sum of the infinite series, I'm assuming the series must be Geometric, so I tried to find the common ratio based on the formula
$$r = S_n / S_{n-1} = \frac{\frac 12 - \frac 13}{1 - \frac 12} = \frac 13$$
Which is fine, but when I check the ratio of the 3rd and the 2nd terms:
$$r = \frac{\frac 13 - \frac 14}{\frac 12 - \frac 13} =\frac 12$$
So the ratio isn't constant... I tried finding a common difference instead, but the difference between 2 consecutive terms wasn't constant either.
I feel like I must be doing something wrong or otherwise missing something, because looking at the problem, I notice that the terms given have a pattern:
$$\left(1 - \frac 12\right) + \left(\frac 12 - \frac 13\right) + \left(\frac 13 - \frac 14\right) + \cdots + \left(\frac 1n - \frac{1}{n+1}\right)$$
Which is reminiscent of the textbook's proof of the equation that yields the sum of the first $n$ terms of a geometric sequence, where every term besides $a_1$ and $a_n$ cancel out and yield
$$a_1 \times \frac{1 - r^n}{1 - r}.$$
But I don't know really know how to proceed at this point, since I can't find a common ratio or difference.

A: This is not a geometric series, this is a telescoping series.
$$a_{n}=\left(\frac{1}{n}-\frac{1}{n+1}\right)$$
Note that
$$\sum_{j=1}^{n}a_{j}=1-\frac{1}{n+1}$$
You can begin to see the pattern with
$$\left(1-\frac{1}{2}\right)+\left(\frac{1}{2}-\frac{1}{3}\right)=1-\frac{1}{3}$$
Now taking the limit of the sequence of finite sums
$$\lim_{n\rightarrow\infty}\sum_{j=1}^{n}a_{j}=1$$

A: Firstly, it matters what you consider a 'term' in this series.  Let's use consider that the elements in parenthesis constitute the terms.
You are given the sequence: $\{1-\tfrac 1 2, \tfrac 1 2-\tfrac 1 3, \tfrac 1 3-\tfrac 1 4, \ldots, \tfrac 1 n-\tfrac 1{n+1},\ldots\}$
This is equivalently $\{\tfrac 1 2, \tfrac 1{6}, \tfrac 1 {12}, \ldots, \tfrac 1{n(n+1)}, \ldots\}$
So the partial sum is: $S_n = \sum_{k=1}^n \tfrac 1 {k(k+1)} = \tfrac n{n+1}$
$$\{S_n\} = \{\tfrac 1 2, \tfrac 2{3}, \tfrac 3{4}, \ldots, \tfrac n{n+1}, \ldots\}$$
Can you evaluate $S_\infty = \lim_{n\to\infty} S_n$ ?

PS: Also notice that $$\require{cancel} 1 \cancel{-\tfrac 1 2+\tfrac 12} \cancel{- \tfrac 1 3 + \tfrac 1 3} \cancel{- \tfrac 1 4 + \tfrac 14} - \ldots = 1$$

A: Tee general term $a_k$ is $a_k=\frac{1}{k}-\frac{1}{k+1}$.  So, for example, for $k=1$ the first term is $a_1=\frac{1}{1}-\frac{1}{2}$.  The next term is $k=2$ is $a_2=\frac12-\frac13$.  To sum the first $n$ terms, we have
$$\sum_{k=1}^n\frac{1}{k}-\frac{1}{k+1}=1-\frac{1}{n+1}$$
We can see that as $n\to \infty$, the series approaches $1$.

A: $$\left(1-\frac12\right)+\left(\frac12-\frac13\right)+\left(\frac13-\frac14\right) +\cdots +\left(\frac{1}{n} - \frac{1}{n+1}\right) $$
$$ = 1-\frac12+\frac12-\frac13+\frac13-\frac14+\frac14 -\cdots +\frac{1}{n} - \frac{1}{n+1}$$
$$ = 1-\left(\frac12-\frac12\right)-\left(\frac13-\frac13\right)-\left(\frac14-\frac14\right)-\space \cdots \space - \left(\frac{1}{n}-\frac{1}{n}\right)-\frac{1}{n+1}$$
Notice how each of the terms in parentheses is zero, so we are left with: $$\boxed{\text{Sum of first n terms:  }1-\frac{1}{n+1}}$$
If we want the infinite sum we must take the limit as $n \to \infty$ because $n$ is the number of terms in the sequence. So as $n$ becomes arbitrarily large, $\dfrac{1}{n}$ tends towards $0$ so we get that the sequence of finite sums approaches: $$1-0 = \boxed{1}$$

Not all infinite series need to be arithmetic or geometric! This special one is called a telescoping series.

A: Given infinite series, $$\left(1-\frac{1}{2}\right)+\left(\frac{1}{2}-\frac{1}{3}\right)+\left(\frac{1}{3}-\frac{1}{4}\right)+\ldots $$ The $n$th term say $T_{n}$ of the above series can be given as $$T_{n}=\left(\frac{1}{n}-\frac{1}{n+1}\right)$$  Hence, we have

*

*The sum $S_{n}$ of $n$ terms as follows $$S_{n}=\sum_{n=1}^n T_{n}$$$$=\sum_{n=1}^n\left(\frac{1}{n}-\frac{1}{n+1}\right)$$ $$=\left(1-\frac{1}{2}\right)+\left(\frac{1}{2}-\frac{1}{3}\right)+\left(\frac{1}{3}-\frac{1}{4}\right)+\ldots+\left(\frac{1}{n-1}-\frac{1}{n}\right)+\left(\frac{1}{n}-\frac{1}{n+1}\right)$$ $$=\left(1-\frac{1}{n+1}\right)=\color{blue}{\frac{n}{n+1}}$$

*The sum $S_{\infty}$ of infinite terms is calculated by taking the limit of $S_n$ at $n\to \infty$ as follows $$S_{\infty}=\lim_{n\to \infty}S_{n}$$ $$=\lim_{n\to \infty}\left(\frac{n}{n+1}\right)$$ $$=\lim_{n\to \infty}\left(\frac{1}{1+\frac{1}{n}}\right)$$ Now, let $\frac{1}{n}=t \implies t\to 0 \ as \ n\to \infty$ $$=\lim_{t\to 0}\left(\frac{1}{1+t}\right)$$ $$=\left(\frac{1}{1+0}\right)=\color{blue}{1}$$

redpajama_set_name: RedPajamaStackExchange


text:
Q: iOS7 status bar and inappbrowser (Phonegap Build) Apple requires, that no text scrolls through their transparent status bar.
I am using the inAppBrowser Plugin in my Phonegap Build app, which runs into exactly this problem. For some reason, the inAppbrowser ignores the background I set for my App, and just shows the website behind the status bar objects.
I am using the StatusBarPlugin to control my Status Bar
Javascript:
document.addEventListener("deviceready", onDeviceReady, false);

    // Global InAppBrowser reference
    var iabRef = null;
    function iabLoadStart(event) {
        StatusBar.hide();
    }
    function iabLoadStop(event) {
    }
    function iabClose(event) {
         StatusBar.show();
         iabRef.removeEventListener('loadstart', iabLoadStart);
         iabRef.removeEventListener('loadstop', iabLoadStop);
         iabRef.removeEventListener('exit', iabClose);
    }
    function openPage(url) {
    window.open(url, '_blank', 'location=yes,enableViewportScale=yes,');
    }
    // STATUS Bar
    function setStatusBar() {
    StatusBar.show();
    StatusBar.overlaysWebView(false);
    StatusBar.backgroundColorByHexString("#C8DB2F");
    }
    // Cordova is ready
    //
    function onDeviceReady() {
         checkConnection();
         setStatusBar();
         iabRef.addEventListener('loadstart', iabLoadStart);
         iabRef.addEventListener('loadstop', iabLoadStop);
         iabRef.addEventListener('exit', iabClose);
    }

I have seen similar questions coming up here, but the answers didn't solve my problem.

A: Yes, that's correct. On iPhone the inAppbrowser ignores the definitions made for the app itself (Cordova 3.4 / IOS 7).
Furthermore, it erases it when it returns to the app (in my definitions I defined the status bar to be transparent and stay on top of the application body).

A: I found a way to solve this problem: you edit the CDVInAppBrowser.m file and in this block:
if (self = [super init]) {
    // default values
    self.location = YES;
    self.toolbar = YES;
    self.closebuttoncaption = nil;
    self.toolbarposition = kInAppBrowserToolbarBarPositionBottom;

change the Bottom to Top :-)
There are other things that can be done but this kills the problem in a simple way.

A: When you open the InAppBrowser, your app and all of it's JS are paused, so no matter how much scripting you try to put in your app to control the IAB none of it will matter once it's actually open.
However, if you set the tool bar position option to top, it will move the browser controls from the bottom of the screen to the top. The browser chrome will account for the status bar and when you scroll content up, it will be sufficiently hidden underneath the controls.
It's kind of a hacky solution, but it works without intense coding or re-writing the plugin.
How to do it:
In your config.xml file, make sure you're specifying the InAppBrowser plugin:
<gap:plugin name="org.apache.cordova.core.inappbrowser" />
Then wherever you are opening the browser:
window.open('YOUR-URL-HERE', '_blank', 'toolbarposition=top');
You can find more customizable options in the InAppBrowser GitHub readme.

A: I'm using cordova-plugin-inappbrowser and had these exact same issues with the statusbar in iOS. I tried a few of the suggestions here, as well as trying to insertCSS() to adjust the margin at the top and none seemed to work. In the end, installing the org.apache.cordova.statusbar plugin and simply calling StatusBar.overlaysWebView(false); corrected the issue.
You can read more about the statusbar plugin here. Solution courtesy of neilsteventon.

A: To further expand on @alexkb, the solution is to hook into the exit event of the InAppBrowser so that after you return to the page the statusBar will show correctly.
myinapp = window.open('YOUR-URL-HERE', '_blank', 'toolbarposition=top');
myinapp.addEventListener('exit', function (event) {
    StatusBar.overlaysWebView(true);
    StatusBar.overlaysWebView(false);
});

A: This fixed the issue for me hide and show the statusbar when the in app browser is closed
var ref = window.open('http://google.com', '_blank');
ref.addEventListener('exit', function(event) {
    StatusBar.hide();
    StatusBar.show();
});


text:
Q: eTag support using Alamofire 4 I am trying to enable eTag support in my app.
I am using Alamofire 4 in my swift 3 project.
It seems that eTag is transparently handled by URLRequest which Alamofire uses:
NSURLCache and ETags
But it doesn't work.
Here is http header sent by web server:
headers {
    Connection = "keep-alive";
    "Content-Length" = 47152;
    "Content-Type" = "application/json";
    Date = "Tue, 06 Dec 2016 22:43:18 GMT";
    Etag = "\"ecf38288be2f23f6710cafeb1f344b8c\"";
} })

Do yo have any hint?
Thanks a lot.

A: By default, caching is ON. If you log HTTP traffic inside your app, you might see cached responses, without the app making requests to server this time.
In case when URLSession decides to return cached response instead of going to server you will see same Date HTTP response header.
To ensure caching is working, you should inspect network packets between your app and server.

A: This is the default cache policy when using an URLRequest.
If you want to change this behavior and see the "real" response from the network, so that you can handle the eTag and the statusCode by yourself, you just need to change the cache policy to reloadIgnoringCacheData:
var exampleRequest = try! URLRequest(url: route, method: .post, headers: headers)
// This is the important line.
exampleRequest?.cachePolicy = .reloadIgnoringCacheData

Hope this helps someone!


text:
Q: Get rid of button border in WPF? i am trying to get rid of button border and only display text, however a thin line around the text gets displayed even though i set borderThickness to 0 and borderbrush to transparent.

my xaml code for save button:
<Button Content="save" Name="btnSaveEditedText"
                Background="Transparent"
                Foreground="White"
                FontFamily="Tw Cen MT Condensed"
                FontSize="30"
                Margin="-280,0,0,10"
                Width="60"
                BorderBrush="Transparent"
                BorderThickness="0"/>

Is there anyway i can get rid of the button border?

A: You need to override the ControlTemplate of the Button:
<Button Content="save" Name="btnSaveEditedText"
                Background="Transparent"
                Foreground="White"
                FontFamily="Tw Cen MT Condensed"
                FontSize="30"
                Margin="-280,0,0,10"
                Width="60"
                BorderBrush="Transparent"
                BorderThickness="0">
    <Button.Template>
        <ControlTemplate TargetType="Button">
             <ContentPresenter Content="{TemplateBinding Content}"/>
        </ControlTemplate>
    </Button.Template>
</Button>

A: You need to create a new Template for your buttons.
The easiest way to do this is open your project in Expression Blend, select the button and then right click and select "Edit Template > Edit a Copy..". This copies the existing template into one you can modify. It's easier if you create it in a resource dictionary.
Then select the template and on the Resource tab (on the right of the UI) select the ButtonFocusVisual. Select the Properties tab and expand the Miscellaneous section. This has BorderStyle and BorderThickness fields (among others). Set the style to None.

A: The method that I recently found to be most useful for this was to have your button use the style of a toolbars.  This will only use the image or text while only showing button borders on mouse over.
<Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
        Content="save"
        Name="btnSaveEditedText"
        Background="Transparent"
        Foreground="White"
        FontFamily="Tw Cen MT Condensed"
        FontSize="30"
        Margin="-280,0,0,10"
        Width="60"
        BorderBrush="Transparent"
        BorderThickness="0" />

A: Templates will not solve this problem, your only course of action is to modify the WPF control. The solution is here:
How to remove ButtonChrome border (when defining the template of a border)?


text:
Q: How do I uninstall a service installed using install4j My installer has a "install service" action, which installs a bundled binary as as a service. However, I can't find an "uninstall service" action despite the fact that the manual references it:

On Windows it is expected that there is a special program that
  installs an uninstalls the service. This is done by the "Install a
  service" and "Uninstall a service" actions in install4j.

A: After looking for a while, if found that elsewhere in the manual (actually, the reference), under "install a service" they state that:

"This action will be automatically reverted by the 'Uninstall files'
  action."

So it turns out that the "uninstall a service" action doesn't exist.


text:
Q: May 20th Annular Eclipse - Duration from Vancouver? On May 20th, there's an annular eclipse.
It's technically visible towards the end from Vancouver.  In the middle, the duration is just under 6 minutes.  What I want to know is what the duration is expected to be for a viewer located in Vancouver?

A: NASA has a wonderful web page set up that gives you great maps and information on each individual eclipse.  The one you are asking about is located at http://eclipse.gsfc.nasa.gov/OH/OH2012.html#SE2012May20A.  In terms of a description, this is probably the part you are interested in:

The shadow passes just south of Alaska's Aleutian Islands as the central track slowly curves to the southeast. After a 7000 kilometre-long ocean voyage lasting nearly 2 hours, the antumbra finally reaches land again along the rugged coastlines of southern Oregon and northern California (Figure 2) at 01:23 UT (May 20 local time).
Redding, CA lies 30 kilometres south of the central line. Nevertheless, it still experiences an annular phase lasting 4 1/2 minutes beginning at 01:26 UT. It is already late afternoon along this section of the eclipse path. The Sun's altitude is 20° during the annular phase and decreasing as the track heads southeast. Central Nevada, southern Utah, and northern Arizona are all within the annular path.
By the time the antumbra reaches Albuquerque, NM (01:34 UT), the central duration is still 4 1/2 minutes, but the Sun's altitude has dropped to 5°. As its leading edge reaches the Texas Panhandle, the shadow is now an elongated ellipse extending all the way to Nevada. Seconds later, the antumbra begins its rise back into space above western Texas as the track and the annular eclipse end.

The main page is at this URL:  http://eclipse.gsfc.nasa.gov/eclipse.html  I know I am using it to plan my 2017 trip to Kentucky.  :)
As for your specific location, here is a web page that gives you a picture and animation for your specific location.


text:
Q: free(): invalid next size (fast): I've been struggling over this strange bug for the past hour. The code has been minimized as much as possible and I'm still getting the following error at runtime:
*** glibc detected *** ./a.out: free(): invalid next size (fast): 0x0000000001823010 ***

This is the what I'm compiling.
    #include<stdio.h>
    #include<stdlib.h>
    #include<time.h>

    void random_fill(unsigned int * to_fill, unsigned int len) {
        srand(time(NULL));
        for( unsigned int i = 0; i < len; i++) {
            to_fill[i] = (float)rand() / RAND_MAX * 100;
        }
    }

    #define SEQ_SIZE 2048
    int main(void) {
        printf("Sequence Size: %i\n", SEQ_SIZE);
        unsigned int * sequence = 0;
        sequence = (unsigned int *) calloc(0, sizeof(unsigned int) * SEQ_SIZE);

        random_fill(sequence, SEQ_SIZE);

        for(int i = 0; i < SEQ_SIZE; i++) {
            printf("%u ", sequence[i]);
        }
        printf("\n");

        free((void *)sequence);

        return 0;
    }

The command that I've been using to compile the code is gcc -std=c99 main.c and my gcc version is 4.4.7 20120313 (running on Red Hat 4.4.7). To confirm that it wasn't a bug in gcc I also compiled it with gcc 4.8.2 and still got the same error. Finally, I compiled this and ran it on my laptop and it worked worked without any issues!
Why am I getting this error? Is there something wrong with the machine or my OS?

A: As Petesh notes in the comments:
sequence = (unsigned int *) calloc(0, sizeof(unsigned int) * SEQ_SIZE);

That line will allocate 0 elements of some non-zero size. You're likely looking for:
sequence = calloc(1, sizeof(unsigned int) * SEQ_SIZE);

Which works, but doesn't fix some potential overflow issues. So you should actually write:
sequence = calloc(SEQ_SIZE, sizeof(unsigned int));

Or, even better:
sequence = calloc(SEQ_SIZE, sizeof(*sequence));

Other thoughts:
You should only call srand() once in a given program. Normally people just call it as the first line in main().


text:
Q: Detect if DivX and MKV codecs are installed or not? How can we detect, within a program, whether DivX and MKV codecs are already installed or not?
For my apps, I need to check user OS (Windows) for some requirements. Are there any specific registry keys that I can check? Or should I check for file association of these types? What's the best solution?

A: Include a dummy video in your resources that is similar to the video content you want to play, then try to load it off-screen; if it works, you know that the codecs are correctly installed for the format you care about (i.e. both the container and video/audio codecs are there, and they are working)


text:
Q: What is a simple example of dependent jointly continuous random variables? Most examples of dependent random variables I've seen are not jointly continuous.  And most examples of jointly continuous random variables I've seen are independent.
So my question is, what is a simple example of dependent random variables which are jointly continuous?  I've seen some complicated examples, but I just want some simple examples to build my intuition.


text:
Q: Converting Robot Framework XML to JUnit XML I want a Robot Framework report XML in JUnit format.
Is there a way to produce a JUnit XML from the Robot run itself, or do I need to convert the Robot XML to follow the format of JUnit?
I'm running the Robot script on Python. Apparently the JUnit XML report is only possible if I use Java.
Thanks.

A:
Is there a way to produce a JUnit XML from the Robot run itself

Yes, during the execution or even afterwards, by converting RF's native output.xml to xunit format - the latter is through the built-in tool rebot:
reboot -x xunitOut.xml output.xml

The switch -x /--xunit (link to the guide) can be used both during run, or in post processing.

I'm running the Robot script on Python. Apparently the JUnit XML report is only possible if I use Java.

I don't think that's the case, it's just a format of the execution report xml :)
Keep in mind the xUnit looses some of the meta info that's available in the native format - due to their different nature.


text:
Q: How to convert scalar array to 2d array? I am new to machine learning and facing some issues in converting scalar array to 2d array.
I am trying to implement polynomial regression in spyder. Here is my code, Please help!
# Polynomial Regression

# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

# Importing the dataset
dataset = pd.read_csv('Position_Salaries.csv')
X = dataset.iloc[:, 1:2].values
y = dataset.iloc[:, 2].values

# Fitting Linear Regression to the dataset
from sklearn.linear_model import LinearRegression
lin_reg = LinearRegression()
lin_reg.fit(X, y)

# Fitting Polynomial Regression to the dataset
from sklearn.preprocessing import PolynomialFeatures
poly_reg = PolynomialFeatures(degree = 4)
X_poly = poly_reg.fit_transform(X)
poly_reg.fit(X_poly, y)
lin_reg_2 = LinearRegression()
lin_reg_2.fit(X_poly, y)

# Predicting a new result with Linear Regression
lin_reg.predict(6.5)

# Predicting a new result with Polynomial Regression
lin_reg_2.predict(poly_reg.fit_transform(6.5))

ValueError: Expected 2D array, got scalar array instead: array=6.5.
  Reshape your data either using array.reshape(-1, 1) if your data has a
  single feature or array.reshape(1, -1) if it contains a single sample.

A: You get this issue in Jupyter only.
To resolve in jupyter make the value into np array using below code.
lin_reg.predict(np.array(6.5).reshape(1,-1))
lin_reg_2.predict(poly_reg.fit_transform(np.array(6.5).reshape(1,-1)))

For spyder it work same as you expected:
lin_reg.predict(6.5)
lin_reg_2.predict(poly_reg.fit_transform(6.5))

A: The issue with your code is linreg.predict(6.5).
If you read the error statement it says that the model requires a 2-d array , however 6.5 is scalar.
Why? If you see your X data is having 2-d so anything that you want to predict with your model should also have two 2d shape.
This can be achieved either by using .reshape(-1,1) which creates a column vector (feature vector) or .reshape(1,-1) If you have single sample.
Things to remember in order to predict I need to prepare my data in the same way as my original training data.
If you need any more info let me know.

A: You have  to give the input as 2D array, Hence try this!
lin_reg.predict([6.5])
lin_reg_2.predict(poly_reg.fit_transform([6.5]))


text:
Q: Is there a way to shuffle series' in VLC or some type of video player, to play series at random but episodes in order? I am hopefully trying to figure out if their is a script or a way to program VLC/ multimedia player to randomly shuffle series of shows, but when it hits the same show it will play it in order. So I guess what I aim to do is have a video player shuffle random shows,  it in chronological order for that show.
Ex.: Lost S01E01, The Office S01E01, Game of Thrones S01E01, etc. Then if it shuffles and is playing the same series it would go Game of Thrones S01E02, The Office S01E02, Lost S01E02, etc.
Is this possible?

A: As I've moved over from VLC to GOM Player a couple years ago, I cannot vouch for the ealier anymore, but I'd say the easiest solution would be creating a simple playlist with whatever episodes you like. Such lists, as you probably know, since the old days of audio playlists only, can be put on shuffle mode at the press of a button and there you go: you'll have episodes being played randomly according to your request!

A: have you tried kodi smart playlist? supposedly it does what you ask for?


text:
Q: Give EC2 access to a ELB Elastic Beanstalk system I have a database server on a EC2 instance, I want it to accessible by Elastic Load Balancer cluster.
I tried adding the subnet of the Load Balancer security groups of database EC2.
There must be some way to give whole cluster of EC2 instance created ELB and autoscalling, access to single EC2.

A: Your question isn't too clear, but it appears your scenario is:
Internet -> ELB -> EC2 fleet -> Database (on EC2 instance)

*

*You have a database running on a single EC2 instance

*You have multiple EC2 instances running an application that connect to the database

*You have an Elastic Load Balancer that accepts traffic from the Internet and distributes it to the EC2 instances running the application

You should configure the following Security Groups:

*

*ELB-SG: Configure this security group to allow incoming web traffic from the Internet (0.0.0.0/0). Associate the security group to the Load Balancer.

*App-SG: Configure this security group to allow incoming web traffic from ELB-SG. Associate the security group with every instance in the application fleet. If the EC2 instances are launched via Auto Scaling, then associate the security group with the Launch Configuration.

*DB-SG: Configure this security group to allow incoming traffic from App-SG. Associate the security group to the EC2 instance running the database.

When I say "allow incoming traffic from xxx-SG", I mean that you should enter the name of the incoming security group in the Source field when configuring the security group. This will automatically insert the unique name of the security group (sg-xxxx). It means that any resource associated with the referenced security group will be allowed incoming access on the nominated port.
You should avoid using an IP address or CIDR range in a security group, because they can change (eg if you launch another EC2 instance). By referencing a security group by name, it will automatically update as instances are added/removed.


text:
Q: Add to array element I have an array, the value of the first element is 1.
Every time a user clicks a button, I want it to increase by 1.
I have this written, but it's making the array element go from 1, to 11, to 111... and so on. How do I just get it to increase by 1. Like 1, 2, 3...
function addCake (){
    quantityArray[0] += 1;
    var cost= quantityArray[0] * 1.49;
    document.getElementById("cart").innerHTML += "
"+quantityArray[0]+"	Cake Donut	"+"$"+cost+"	";
}

A: Change your code as below :
function addCake (){
    quantityArray[0]=parseInt(quantityArray[0]) + 1;
    var cost= parseInt(quantityArray[0]) * 1.49;
    document.getElementById("cart").innerHTML += "
"+quantityArray[0]+"	Cake Donut	"+"$"+cost+"	";
}

A: Try to convert it to int
quantityArray[0] = parseInt(quantityArray[0]);
quantityArray[0] += 1;

The problem I see is that you are initalizating the array items as "".
Why? if you set as 0, you can avoid the problem: http://jsfiddle.net/rgvaT/2/
quantityArray[0]=0;

A: You could try:
quantityArray[0]++;

This will also add 1 to your counter.

A: No need to call parseInt etc. Just initialize your quantityArray array properly:
var quantityArray = [];
quantityArray[0] = 0;

function addCake (){
    quantityArray[0]++;
    var cost = quantityArray[0] * 1.49;
    document.getElementById("cart").innerHTML += "
"+quantityArray[0]+"	Cake Donut	"+"$"+cost+"	";
}

A: Try this
quantityArray[0]=parseInt(quantityArray[0]) + 1;

A: var test = new Array();
    test[0] = 1;
    test[0] += 1;
    test[0] += 1;
alert(test[0]); // output is 3. Its working fine.

What you are doing is concatenating the "String" 1 with previous value of array.
To avoid that cast the value to int, using parseInt(). Something like this.
function addCake (){
    quantityArray[0] += parseInt(1, 10); // To decimal. It is very important
    var cost= quantityArray[0] * 1.49;
    document.getElementById("cart").innerHTML += "
"+quantityArray[0]+"	Cake Donut	"+"$"+cost+"	";
}

A: I guess you have initialized the array element as string.
use below code to increment the element .
quantityArray[0] = parseInt(quantityArray[0]) + 1;

A: Here The Problem is with They datatype
In JavaScript, when you declare a variable by var x;  It stores the variable as an object of type var.That is what causing the problem.

You need to Convert the object ( var ) to an integer to do
  mathematical operations by type casting. You can typecast using
  (Number) function. In other cases it consider + as an append
  operator and variables as String do append function.

The code will looks like this.
function addCake (){
    quantityArray[0] =(Number)quantityArray[0]+1;
    var cost= quantityArray[0] * 1.49;
    document.getElementById("cart").innerHTML += "
"+quantityArray[0]+"	Cake Donut	"+"$"+cost+"	";
}


text:
Q: How to add two adjacent columns together then display the new value in the leftmost column I need to add two adjacent columns together then display that value in the first of the two columns, clear the values in the second column, and repeat whenever a new number is added to the second column. I don't mind if this is linked to a button or just straight from an input.
I tried this:
function doTest() {
var ss = SpreadsheetApp.getActiveSheet();
var num1 = ss.getRange("D7:D116").getValue();
var num2 = ss.getRange("E7:E116").getValue();

ss.getRange("D7:D116").setValue(num1+num2);
ss.getRange("E7:E116").clearContent();
}

It's the basic idea but it only prints the very first sum value into every cell, instead of applying the formula into every row values.
I've lurked on a few similar posts but they seem to be about reprinting data from one column to another in a different sheet or into a different workbook.
An array formula may work but I'm stuck using 2 columns and i cant lose the values.
An array formula I looked at was
=ArrayFormula( IF( ROW( B:B ) < 1 , "" , IF( LEN( C:C ) * LEN( B:B ) , B:B + C:C & Clear C:C, IFERROR( 1/0 ) ) ) )

I got this off Stack Overflow and it works the first time. However, it requires 3 columns and it won't add the values cumulatively. I also don't understand enough about arrays/java to fix it.
Any help would be amazing. I'd ask that you add comments to each action so I can follow along with any script.
An example of the sheet I'm working on =>>
https://docs.google.com/spreadsheets/d/1X1oGwWda8p0AJjAGxALZ1F5cJPzszqPxv6UnBlH0KwA/edit?usp=sharing

A: *

*Use getValues() and setValues()

*Loop over each row to find the sum

function doTest() {
  //@OnlyCurrentDoc
  var ss = SpreadsheetApp.getActiveSheet();
  var rng = ss.getRange("D7:E116");
  var val = rng.getValues(); //getRangeValues
  //Loop over each row
  for(row=0;row&LTval.length;row++) {
    val[row][0] = val[row][0]+val[row][1];// Current row's First Column[0] value = first column+ second column
    val[row][1] =''; //set Second Column value null
  }
  rng.setValues(val)
}


text:
Q: Limit for Related Look-up Lists Suppose let's say I have 100 custom objects, and they all have a look up relation with Contacts. Are so many related lists supported? If so, can anyone give the max number of look-up lists supported in Sales force?

A: You can have as many custom objects as you want, you just can't reference them in your workflow, formula fields and validation rules during the same execution context by spanning more than 10 objects. As an aside, there's a similar limit of 10 when it comes to namespaces.
According to the documentation there is a maximum number of 10 object references on ObjectName. This number can be increased to 15 by filing a case with Salesforce. Determining Spanning relationship numbers can be complex and isn't as straightforward as it might seem on the surface.
Understanding Spanning Relationships goes into the subject in depth, including different ways of trying to work around this limit and how relationships of objects with another object can affect the spanning calculation. No more than 10 different objects can be referenced in a combination of formulas, validation rules and workflow in the same execution context.
As an example: You have a validation rule that references 3 unique objects, a field update that references 4 other objects and a formula field that references 3 other objects. That would put you over the limit 10 (original object + 10 = 11).
As a workaround, triggers and junction objects can be used to reduce the references. This is explained in the documentation I've cited.

A: I suppose there can be as many as 40 Look-up relationships between two objects. However, am not sure about the maximum an object can refer to.

A: a child object can have at max 25 lookup master

A: I believe is 12 and can be increased to 15 by contacting SF support - according to the following issues/ideas:
https://success.salesforce.com/ideaView?id=08730000000gKsbAAE
https://communities.bmc.com/docs/DOC-25906


text:
Q: Do I need to use RecordSet.CancelUpdate when rolling back a transaction? Please see the code below:
GenErr:
    If Err = -2147217871 Then
        'rs.CancelUpdate
        objCon.RollbackTransaction
        Resume AfterNes
    ElseIf Err = 3219 Then
        'rs.CancelUpdate
        objCon.RollbackTransaction
        Resume
    ElseIf Err = 9 Then
        Resume Next
    End If
           ImportUSNs = Error$
    Exit Function
    Resume

I have added a transaction today.  If I am rolling back the transaction (when there is an error) then do I need to call: rs.cancelupdate? rs is an ADO.Recordset.

A: According to MSDN:

Use the CancelUpdate method to cancel any changes made to the current
  row or to discard a newly added row. You cannot cancel changes to the
  current row or a new row after you call the Update method, unless the
  changes are either part of a transaction that you can roll back with
  the RollbackTrans method, or part of a batch update.

Since RollbackTransaction is going to roll everything back, CancelUpdate is unnecessary.


text:
Q: Stacking cells in a table by pairs in responsive layout A lot of examples show how to stack cells one on one in a responsive design (it's enough to just apply display:block to all cells). What if I want the cells to stack by pairs? Let's say I have a row with 4 cells:
A B C D
And in responsive design I want something like this:
A B
C D
How could I approach this?

A: If you don't have to support old browsers (like IE9), use flex-basis.
HTML

    A
    B
    C
    D

CSS
tr {
    display: flex;
    flex-wrap:wrap;
}

td {
  /* makes every cell at least 34% of the total width, thus
     preventing more than two cells from getting on the same row */
  flex-basis: 34%;
}

Here is a jsfiddle https://jsfiddle.net/0thg1j7h/.
See browser support for flex at http://caniuse.com/#feat=flexbox.
If you DO need to support older browsers, try this solution:
HTML

    A
    B

    C
    D

CSS
/* all cells on one line */
/*tr {
  float: left;
}*/

/* two cells per row */
/* do nothing */

/* one cell per row */
/*td {
  display: block;
}*/

Here is the jsfiddle https://jsfiddle.net/3183v90w/1/


text:
Q: Perform secondary validation on a form Im using asp.net webforms. c#
I want to validate a form. In the codebehind im just doing a if(Page.isValid).
Once the form fields are valid i want to perform one more validation.
The reason I want this separate is because it actually costs money to perform this validation, so I only want to perform it once the other fields are all valid.
Can I programatically add a validation error to a Validation summary? after checking Page.isValid?
Not sure how to tackle this.
Any suggestions welcome.

A: You could place a CustomValidator with no ControlToValidate attribute onto the page and set its IsValid property by hand after all the other validation is done. This should make it show up in the summary.

A: If you are interested in a little more control over validation, you should look at FluentValidation. It is a very powerful and intuitive alternative to the standard webforms validation and you are able to keep your DTO classes clean of attributes. It also works very nicely in tandem with JQuery validation.


text:
Q: What does it mean that x $\in$ a and x $\notin$ $\emptyset$? I am given a problem where I have to prove that A + $\emptyset$ = A, where operation
A + B = (A - B) $\cup$ (B - A).
I have A + $\emptyset$ = (A - $\emptyset$) $\cup$ ($\emptyset$ - A). This means that x $\in$ A and x $\notin$ $\emptyset$ or x $\in$ $\emptyset$ and x $\notin$ A.
But I don't understand what it means for x to be an element and not to be an element of empty set. Could you please explain it ?

A: $x\in A$ and $x\notin\emptyset$ or $x\in\emptyset$ and $x\notin A$
means $x\in A $ and $x\notin\emptyset$ (since we can't have $x\in\emptyset$).
But, for all $x$, $x\notin\emptyset$, so this means $x\in A$.


text:
Q: Is it possible to access the current indices during a Numpy vectorized broadcasting operation? I would like to speed up a function on a single array in Numpy using fancy indexing, vectorization, and/or broadcasting. For each value in my array, I need to do a calculation that involves adjacent values. Therefore, in my vectorized operation, I need to have access to the current index so that I can grab indices around it. Consider the following simple array operation:
x = np.arange(36).reshape(6, 6)
y = np.zeros((6, 6))
y[:] = x + 1

I'd like to use similar syntax, but rather than a simple increment, I'd like to do something like add all values at adjacent indices to the current value in the vectorized loop. For instance if the region around index [i, j] == 7 looks like
3 2 5
2 7 6
5 5 5

I'd like the calculated value for [i, j] to be 3 + 2 + 5 + 2 + 7 + 6 + 5 + 5 + 5, and I want to do that for all indices [i, j].
This is a straightforward nested for loop (or a single for loop using np.sum for each index)... but I want to use broadcasting and/or fancy indexing if possible. This may be too complex of a problem for the Numpy syntax, but I feel like it should be possible.
Essentially, it comes down to this: how do I reference the current index during a broadcasting operation?

A: Start with a 1D example:
x = np.arange(10)

There is a choice you have to make: do you discard the edges or not, since they don't have two neighbors? If you do, you can create your output array in esentially one step:
result = x[:-2] + x[1:-1] + x[2:]

Notice that all three addends are views because they use simple indexing. You want to avoid fancy indexing as much as you can because it generally involves making copies.
If you prefer to retain the edges, you can pre-allocate the output buffer and add directly into it:
result = x.copy()
result[:-1] += x[1:]
result[1:] += x[:-1]

The fundamental idea in both cases is that to apply an operation to all neighboring elements, you just shift the array by +/-1. You don't need to know any indices, or do anything fancy. The simpler the better.
Hopefully you can see how how to generalize this to the 2D case. Rather than a single index shifting between -1, 0, 1, you have two indices in every possible combination of -1, 0, 1 between the two of them.
Appendix
Here's the generalized approach for a no-egde result:
from itertools import product
def sum_shifted(a):
    result = np.zeros(tuple(x - 2 for x in a.shape), dtype=a.dtype)
    for index in product([slice(0, -2), slice(1, -1), slice(2, None)], repeat=a.ndim):
        result += a[index]
    return result

This implementation is somewhat rudimentary because it doesn't check for inputs with no dimensions or shapes < 2, but it does work for arbitrary numbers of dimensions.
Notice that for a 1D case, the loop will run exactly three times, for 2D nine times and for ND 3N. This is one case where I find an explicit for loop to be appropriate with numpy. The loop is very small compared to the work done on a large array, fast enough for a small array, and certainly better than writing all 27 possibilities out by hand for the 3D case.
One more thing to pay attention to is how the successive indices are generated. In Python an index with a colon, like x[1:2:3] is converted to the relatively unknown slice object: slice(1, 2, 3). Since (almost) everything with commas gets interpreted as a tuple, an index like in the expression x[1:2, ::-1, :2] is exactly equivalent to (slice(1, 2), slice(None, None, -1), slice(None, 2)). The loop generates exactly such an expression, with one element for each dimension. So the result is actually simple indexing across all dimensions.
A similar approach is possible if you want to retain edges. The only significant difference is that you need to index both the input and the output arrays:
from itertools import product
def sum_shifted(a):
    result = np.zeros_like(a)
    for r_index, a_index in zip(product([slice(0, -1), slice(None), slice(1, None)], repeat=a.ndim),
                                product([slice(1, None), slice(None), slice(0, -1)], repeat=a.ndim)):
        result[r_index] += a[a_index]
    return result

This works because itertools.product guarantees the order of the iteration, so the two zipped iterators will stay in lockstep.

A: try this:
x = np.arange(36).reshape(6, 6)
y = np.zeros((6, 6))
for i in range(x.shape[0]):
    for j in range(x.shape[1]):
        if i>0 and i<x.shape[0]-1 and j>0 and j<x.shape[1]-1:
            y[i,j]=x[i,j]+x[i-1,j]+x[i,j-1]+x[i-1,j-1]+x[i+1,j]+x[i,j+1]+x[i+1,j+1]+x[i-1,j+1]+x[i+1,j-1]
        if j==0:
            if i==0:
                y[i,j]=x[i,j]+x[i,j+1]+x[i+1,j+1]+x[i+1,j]
            elif i==x.shape[0]-1:
                y[i,j]=x[i,j]+x[i,j+1]+x[i-1,j+1]+x[i-1,j]
            else:
                y[i,j]=x[i,j]+x[i,j+1]+x[i+1,j+1]+x[i+1,j]+x[i-1,j]+x[i-1,j+1]

        if j==x.shape[1]-1:
            if i==0:
                y[i,j]=x[i,j]+x[i,j-1]+x[i+1,j-1]+x[i+1,j]
            elif i==x.shape[0]-1:
                y[i,j]=x[i,j]+x[i,j-1]+x[i-1,j-1]+x[i-1,j]
            else:
                y[i,j]=x[i,j]+x[i,j-1]+x[i-1,j-1]+x[i+1,j]+x[i-1,j]+x[i+1,j-1]
        if i==0 and j in range(1,x.shape[1]-1):
            y[i,j]=x[i,j]+x[i,j-1]+x[i+1,j-1]+x[i+1,j]+x[i+1,j+1]+x[i,j+1]
        if i==x.shape[0]-1 and j in range(1,x.shape[1]-1):
            y[i,j]=x[i,j]+x[i,j-1]+x[i-1,j-1]+x[i-1,j]+x[i-1,j+1]+x[i,j+1]
print(y)


text:
Q: si necesito sacar solo los números enteros de un array ya hecha, lo hago con modulo para que me arroje solo aquellos que dan === 0 tengo un ejercicio que no logro completar su sintaxis, entiendo que para sacar de una lista solo los números enteros tengo efectuar una operación por ejemplo modulo, la cual solo es efectiva si el tipo de dato es un numero, si no llega a serlo lo descarta, basando esta lógica hice un función:
como verán lo que hice fue crear una variable donde guardare mi codigo nuevo, creo un ciclo for para  iterar en cada elemento y usando mi logica conclui que si diviendo en el mismo elemento da 0 es porque es un numero, porque si fuera un string no se efectuaria la operación, Bueno esta es mi pregunta, creo que hay un metodo simple pero bueno por lo que estudie esta es mi idea pero no se efectu así que agradezco su ayuda.
function soloNumeros(array) {
  // La funcion llamada 'soloNumeros' recibe como argumento un arreglo de enteros y strings llamado 'array'.
  // Debe devolver un arreglo con solo los enteros.
  // Ej:
  // soloNumeros([1, 'hola', 2]) debe retornar [1, 2]

  // Tu código aca:
var soloenteros = [];
 for (var i = 0; i < array.length; i++) {
   if (array[i] / array[i === 0) { soloenteros = array[i]};
 }
  return soloenteros;
}

A: Partiendo de la solución ya propuesta podemos:

*

*Ahorrarnos el recorrido (al menos de forma visible) usando a filter

*Tampoco necesitamos un vector vacío que llenar pues filter nos retornará un vector con los elementos que cumplan la condición

*Las condiciones para el filtro las comparto enteramente con quién respondió, te invito a leer sobre Number
Propuesta
let numeros = [true, 1, 6.8];

let filtrados = numeros.filter(numero =>  Number.isInteger(numero));

 console.log(filtrados);

Observación de Mauricio Contreras

El uso de typeof no es técnicamente necesario. Puedes usar solo isInteger() ya que todo valor analizado que no sea entero (numérico o no) retornará false

A: Solo faltaria un par de detalles para entender mejor:

*

*Una forma comun de identificar que el elemento sea un numero cualquiera  (entero o decimal) es usando if (typeof(variable) == "number") {}, si especificamente espera solo enteros (sin decimales) entonces puedes usar if (isInteger(variable)) {} . Para solo decimales (no enteros) puedes usar if (variable % 1 != 0) {}

*para llenar un array sin necesidad de saber el indice donde agregar (simplemente agregar al final) se puede usar soloenteros.push(array[i]). Tambien puede servir usar soloenteros[i] = array[i] pero el indice quedara desfasado

var input = [1 ,'hola', 2];

function soloNumeros(array){
  var soloenteros = [];
  for (var i = 0; i < array.length; i++) {
    if (typeof(array[i])=="number") {
//       soloenteros[i] = array[i];
       soloenteros.push(array[i]);
    };
  }
 return soloenteros;
}

console.log(soloNumeros(input));


text:
Q: Angular file upload - return name uploaded file I'm using an angular-file-upload directive. When I uploading file I getting file's name before upload on callback.
$$hashKey: "object:19"_file: FilelastModified: 1429780959000lastModifiedDate: Thu Apr 23 2015 12:22:39 GMT+0300 (MSK)name: "av_1.png"size: 1278type: "image/png"webkitRelativePath: "" trueisUploading: falsemethod: "POST"progress: 100removeAfterUpload: false

name: "av_1.png" - name before upload

But I need to get name of file after upload. Name turns in 16 bit encoding and looks like 68b714b12c6a4336500a4c5a4b53c60e.png for example.
How can I return file's name after upload?


text:
Q: Custom delegate methods in a NSTextView subclass - compiler warnings Long story short (please stop me if I'm doing this wrong): I want to have an NSTextView accept a custom drag type, and upon receipt of such a drag change the content to match.
To do this, I subclass NSTextView to implement the custom drag type, and (from the subclass) send a message to the NSTextView delegate when done. This works just fine, but I get a familiar compiler warning (though everything works fine):

Method '-dragReceivedWithTrack:' not found (return type defaults to 'id')

Some code:
@interface LyricTextView : NSTextView {
}

@end

@interface NSObject (CustomDragging)
-(BOOL)dragReceivedWithTrack:(NSDictionary *)track;
@end

@implementation LyricTextView
-(BOOL)performDragOperation:(id<NSDraggingInfo>)sender {
    NSData *data = [[sender draggingPasteboard] dataForType:kMyType];
    NSDictionary *track = [NSKeyedUnarchiver unarchiveObjectWithData:data];

    if ([[self delegate] respondsToSelector:@selector(dragReceivedWithTrack:)]) {
        return ([[self delegate] dragReceivedWithTrack:track]); // gives a warning, but works
    }

    return NO;
}

Shouldn't the informal protocol take care of the warning?
What am I doing wrong?

A: You have not declared a protocol, you have declared a category on NSObject. You could probably remove its definition without affecting the compiler warning.
Since you have a subclass, you are stuck with the delegate as it is (which is an id ).
To quelch the compiler warning, you should be able to simply cast it to id, like so:
id delegate = (id)[self delegate]
if ((delegate respondsToSelector:...]) {...}


text:
Q: Google map is not centered correctly while presenting viewController i was just adding GMSMapView to a view inside viewcontroller but it is not centered as in CLLocation is giving right coordinates, the blue dot is coming on the right spot but just the map is slightly shifted to down right i don't know why. I tried running it directly as in the first page to open after the launch of app then it works fine but when i present my VC the map gets shifted. Please can anyone help.
This happens only when i present viewcontroller not when i push viewcontroller
As you can see the the correct location is where the blue dot is coming:

A: I had the same problem. What worked for me was moving the code to center from viewDidLoad to viewDidAppear
override func viewDidAppear(_ animated: Bool) {

    super.viewDidAppear(animated)
    mapView.camera = GMSCameraPosition.camera(withLatitude: LocationConstants.defaultLat, longitude: LocationConstants.defaultLong, zoom: 15.0)
}

Interestingly enough the same code works in another UIViewController in viewDidLoad.

A: try this
let camera = GMSCameraPosition.camera(withLatitude: -33.8683,
                                          longitude: 151.2086,
                                          zoom: 16)
    let mapView = GMSMapView.map(withFrame: self.view.bounds, camera: camera)
let mapView = GMSMapView(frame: self.view.bounds)


text:
Q: How can I prove a simple eta-conversion? I would like to prove the following:
$$\lambda x.\ \lambda y.\ f\ z\ x\ y \overset{\eta}{=} \lambda x.\ f\ z\ x$$
Definitions
Free variables
$x \in FV(f) :\Leftrightarrow$ $x$ is a variable used within a function $f$ and $x$ is neither a formal parameter of $f$ nor defined in the body of $f$.
$\alpha$-equivalence
Two terms $T_1, T_2$ are called $\alpha$-equivalent, if $T_1$ can be obtained from $T_2$ by consistant renaming.
$\beta$-equivalence
A $\beta$-reduction is function application on a redex:
$$(\lambda x. t_1)\ t_2 \Rightarrow t_1 [x \mapsto t_2]$$
$\eta$-equivalence
Two terms $\lambda x. f~x$ and $f$ are called $\eta$-equivalent, if $x \notin FV(f)$.
Some thoughts
I can make $\alpha$ conversions to get this:
$$\lambda y.\ \lambda x.\ g\ z\ y\ x \overset{\eta}{=} \lambda y.\ g\ z\ y$$
Then I could define $f := \lambda y.\ g\ z\ y$ so I had
$$\lambda y.\ \lambda x.\ g\ z\ y\ x \overset{\eta}{=} f$$
But now I have a problem. It seems as if I have to switch $\lambda y.\ \lambda x.\ \dots$ to $\lambda x.\ \lambda y.\ \dots$
May I do that? Is there a rule that tells me that this is a valid transformation?

A: First of all, you can simplify the equation like this:
\begin{align*}
\lambda x.\ \lambda y.\ f\ z\ x\ y &\overset{!}{=} \lambda x.\ f\ z\ x\\
\overset{*}{\Leftrightarrow} \lambda y.\ f\ z\ x\ y &\overset{!}{=} f\ z\ x\\
\end{align*}
* is valid, because you may apply the rules to subterms. (Could somebody please go into detail here?)
Then you can make $\alpha$-conversions:
\begin{align*}
\lambda y.\ f\ z\ x\ y &\overset{!}{=} f\ z\ x\\
\overset{\alpha}{\Leftrightarrow} \lambda x.\ g\ z\ y\ x &\overset{!}{=} g\ z\ y
\end{align*}
Then you can define $f := g\ z\ y$:
\begin{align*}
\lambda x.\ g\ z\ y\ x &\overset{!}{=} g\ z\ y\\
\overset{f}{\Leftrightarrow} \lambda x.\ f\ x &\overset{!}{=} f
\end{align*}
The last line is true, because that's how $\eta$-conversion is defined. As we've used only equivalences, the other equations are true, too.

A: Let us consider $G=f\ z\ x$. Whence, $\lambda x.\lambda y. f\ z\ x\ y$ is syntactically the same as $\lambda x.\lambda y. G\ y$.
Now, $FV(G)=\{f,z,x\}$, so $y\notin FV(G)$. Therefore, $\lambda y. G\ y =_\eta G$. Therefore, $\lambda x.\lambda y. G\ y =_\eta \lambda x. G$.
If your trouble has to do with $G\ y$ being a subterm of $\lambda x. G\ y$, recall the definition of the $=_\eta$ relation:

*

*$(\lambda x. M\ x) =_\eta M$, if $x\notin FV(M)$

*$M=_\eta M$

*$N=_\eta M$, if $M=_\eta N$

*$M=_\eta P$, if $M=_\eta N$ and $N=_\eta P$

*$\lambda x. M =_\eta \lambda x.N$, if $M=_\eta N$

*$MN =_\eta M'N$, if $M=_\eta M'$

*$MN = _\eta MN'$, if $N=_\eta N'$

A: The main problem seems to be that your definition descriptions are too narrow. For example, every lambda term is $\eta$-equivalent to itself (by the axiom of reflexivity), but your definition of $\eta$-equivalence only takes the $\eta$-axiom into account. The same criticism applies to your definition of $\beta$-equivalence, but this is not relevant here.
There are really only two rules in $\lambda\eta$ you need to use here. First of all, by axiom $\eta$ we have:
$$(\lambda y.fzx y) = fzx \tag{1}$$
since $y \notin FV(fzx)$.
From both (1) and the rule of weak extensionality $\xi$ (a rule in $\lambda\eta$), defined as:
\begin{align}
M &\;= M' \\
\hline
(\lambda x.M) &\;= (\lambda x.M')
\tag{$\xi$}
\end{align}
we can then infer $(\lambda x.\lambda y.fzxy) = (\lambda x. fzx)$.


text:
Q: Scroll in a specific div Selenium Java I want to scroll a specific division in selenium java

As you can see in the picture there are two divs, by default the left one has the scroll thing so if u scroll it scrolls in that
I want to scroll in the division on the left but I cant set focus to it by clicking something in it cause that makes it go to another page.
Thanks

A: Please try following code,
/*
 * By
 * scroll to the element and wait
 */
public void scroll(By element) {
    JavascriptExecutor js = (JavascriptExecutor) driver;
    js.executeScript("arguments[0].scrollIntoView(true);", driver.findElement(element));
    log.info("Scrolling down");
    wait_for_("scroll");
}


text:
Q: Enable/disable button on contentEditable keyup I have a couple of divs on my website that utilize the HTML5 contentEditable attribute. The goal is for the user to be able to start writing a journal entry, and have the save button change from disabled to enabled.
Here's the HTML I have so far:

Write anything

  <button type="button" id="create-entry" class="btn" disabled="true">Save</button>

And here's the jQuery:
$(document).ready(function(){
    $('#title-create-partial').keyup(function(){
        if ($(this).value == '') {
            $('#create-entry').attr('disabled', 'disabled');
        } else {
            $('#create-entry').attr('disabled', false);
        }
    });
});

While this does work, it only checks on the first keyup; if the user backspaces and deletes everything they typed, the button doesn't disable itself again. Does anyone know why?

A: It's a
 element not an <input>, so use text() instead of val() (and be sure to trim so it isn't enabled on whitespace). Also could use prop() to set the property instead of attr().
$('#title-create-partial').keyup(function(){
    if ($.trim($(this).text()) === '') {
        $('#create-entry').prop('disabled', true);
    } else {
        $('#create-entry').prop('disabled', false);
    }
});

jsFiddle here.


text:
Q: How to set up boost for Visual studio code So I basically built the entire boost library and put them in C:\boost\include\boost-1_73. But I got a feeling that I have to include more steps before I can use this library. I followed this guide up until setting it up for visual studio code. So now I am scouring the internet to search how to set it up. Here is the guide that I followed. But I didnt include it in the program_files directory like in the guide.
https://gist.github.com/sim642/29caef3cc8afaa273ce6
In my Task.Json I have
{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "C/C++: g++.exe build active file",
            "command": "C:\\new\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\g++.exe",
            "args": [
                "-g",
                "${fileDirname}\\**.cpp",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe",
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

In my main settings.json I have
{
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
    "code-runner.saveFileBeforeRun": true,
    "code-runner.saveAllFilesBeforeRun": true,
    "code-runner.fileDirectoryAsCwd": true,
    "code-runner.ignoreSelection": true,
    "haskelly.exec.reuseTerminal": true,
    "C_Cpp.updateChannel": "Insiders",
    "r.rterm.windows": "C:\\Program Files\\R\\R-3.6.1\\bin\\R",
    "vsicons.dontShowNewVersionMessage": true,
    "files.autoSave": "onWindowChange",
    "workbench.colorCustomizations": {},
    "editor.tokenColorCustomizations": null,
    "php.validate.executablePath": "",
    "code-runner.executorMap": {
                        "cpp": "cd $dir && g++ *.cpp -o $fileNameWithoutExt -I C:/boost/include/boost-1_73 -L C:/boost/lib && $fileNameWithoutExt.exe"

    },
    "code-runner.executorMapByFileExtension": {},
    "cmake.configureOnOpen": true,
    "explorer.confirmDelete": false,
    "editor.formatOnSave": true,
    "workbench.statusBar.visible": true,
    "workbench.iconTheme": "material-icon-theme",
    "workbench.colorTheme": "Better Solarized Light",
    "code-runner.clearPreviousOutput": true,
    "code-runner.runInTerminal": true,
    "C_Cpp.loggingLevel": "Debug",
    "explorer.sortOrder": "type",
    "C_Cpp.default.forcedInclude": [],
    "C_Cpp.default.includePath": [
        "C:\\boost\\include\\boost-1_73",
    ],
}

How would I include the linker as well(do I even to include the linker?) or if I am doing it properly it all? Will I need to include the path of boost inside Task? It seems to me that the only I did was include it in the intellisense and I am a bit lost now on how to use it. I would greatly appreciate the help.
Edit I made the changes with the following code modified  and I created a CPP file to test the lambda header file
#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>

int main()
{
    using namespace boost::lambda;
    typedef std::istream_iterator<int> in;

    std::for_each(
        in(std::cin), in(), std::cout << (_1 * 3) << " ");
}

And apparently the file doesnt exist:
fatal error: boost/lambda/lambda.hpp: No such file or directory
#include <boost/lambda/lambda.hpp>

Note that I am running everything with the visual studio code runner extension.

A: Some parts of Boost are header-only, some should be linked against.
You should specify Boost include directory both for compiler (add -I to args in tasks.jsons) and for IntelliSense (in settings.json). If you don't use parts of Boost that are not header-only, that's basically all you need. Otherwise, you'll have to add -l and -L options in tasks.json to specify which Boost libraries to link against and where to find them.
If g++ is run by some extension, you should add -I, -L and -l options there, too.


text:
Q: Calculate the height reached when 1/3 of original Kinetic Energy is lost I am sorry for asking this low level question but there is a confusion, I am not overcoming from hours.
My book asks me to solve the following problem:

When an object is thrown upward, it rises to a height $h$. How high is the object in terms of $h$ when it has lost $\frac{1}{3}$ of its original kinetic energy?

My book give me the answer $\frac{1}{3}h$
and I think it should be $\frac{2h}{3}$ because if we divide the $h$ by $3$ then every single segment would be covered by object due to $\frac{1}{3}$ of Kinetic energy. Now if I throw the body upward such that the its kinetic energy is $\frac{2}{3}$ of the previous kinetic energy than it will reach a height $\frac{2h}{3}$.
How to solve it in correct way?

A: Your thought about dividing the length in segments is fine. But be careful to interpret this correctly.
Think about how high the object is if it has 0/3 and 3/3 of the original kinetic energy. That should help you understand why 1/3 is the correct answer.


text:
Q: Serving features of mixed transparency levels from ArcGIS Server map service? I'm using a dynamic map service layer that is shown in a semi transparent way overlaid on a tiled map service.
There are a few polygon layers in the dynamic map service layer that cover the whole mapped area in different solid colors. Those layers are set as transparent in the MXD, but when the map is served out from ArcGIS server, it displays differently from in ArcMap. The layers blend down with the background MXD itself, making them turn %50 white, and making the basemap behind them as difficult to read as if they were solid.
Is there a way to serve features of mixed transparency levels from an arcgis server service?

A:
Is there a way to serve features of mixed transparency levels from an
  arcgis server service?

Yes.  Please read this whitepaper from Esri:
Work with transparencies in an ArcGIS Server Web mapping application
From your description, I believe you should:

*

*Analyze the map using Map Service Publishing tools.

*Convert layer transparency to color transparency.

*Publish to ArcGIS server as a MSD.


text:
Q: flattened pom is not being used? It is a multi-module maven project.  I have included flatten-maven-plugin in my parent pom
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>flatten-maven-plugin</artifactId>
    <version>1.0.0-beta-2</version>
    <configuration>
    </configuration>

defined a property scl_version in parent pom and used ${scl_version} in  of child pom. Value is 0.0.1 .
when i run mvn flatten:flatten
It generates a warning :
[WARNING] 'version' contains an expression but should be a constant.
A flattened pom is created in all modules including parent and all the childs.
Flattened pom has value of the property in version tag of child pom. But when i give, mvn install it still gives warning that version should be constant but it is an expression.
http://mojo.codehaus.org/flatten-maven-plugin/plugin-info.html
But documentation says:

This MOJO realizes the goal flatten that generates the flattened POM
  and potentially updates the POM file so that the current
  MavenProject's file points to the flattened POM instead of the
  original pom.xml file. The flattened POM is a reduced version of the
  original POM with the focus to contain only the important information
  for consuming it. Therefore information that is only required for
  maintenance by developers and to build the project artifact(s) are
  stripped.

so when i do mvn install it should not generate warning.
mvn install and mvn flatten:flatten both generates this warning:
[WARNING] 'version' contains an expression but should be a constant.
Am i missing something, is it not using flattened-pom.xml.
Do i need to specify something.
PARENT POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.a.b</groupId>
<artifactId>ABC</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>
<name>ABC</name>
<modules>
    <module>Resources</module>
    <module>ResourceTree</module>
    <module>Service</module>
    <module>Transport</module>
<module>Branding</module>

properties tag starts here
<scl_version>0.0.1</scl_version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
<karaf.deploy.build.folder>${env.KARAF_BASE}/deploy</karaf.deploy.build.folder>

property tag ends here
<profiles>
    <profile>
        <id>code_coverage</id>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.7.0.201403182114</version>
                    <executions>
                        <execution>
                            <id>default-instrument</id>
                            <goals>
                                <goal>instrument</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.12.2</version>
                    <configuration>
                        <systemPropertyVariables>
                            <jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

<build>
    <plugins>
    <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>flatten-maven-plugin</artifactId>
    <version>1.0.0-beta-2</version>
    <configuration>
    <flattenMode>ossrh</flattenMode>
    <updatePomFile>true</updatePomFile>
    </configuration>
    <executions>
      <!-- enable flattening -->
      <execution>
        <id>flatten</id>
        <phase>process-resources</phase>
        <goals>
          <goal>flatten</goal>
        </goals>
      </execution>
      <!-- ensure proper cleanup -->
      <execution>
        <id>flatten.clean</id>
        <phase>clean</phase>
        <goals>
          <goal>clean</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven-compiler-plugin.version}</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
    </dependency>
    <dependency>
        <groupId>org.jacoco</groupId>
        <artifactId>org.jacoco.agent</artifactId>
        <classifier>runtime</classifier>
        <version>0.7.0.201403182114</version>
        <scope>test</scope>
    </dependency>
</dependencies>
</project>

generated flattened pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.a.b</groupId>
  <artifactId>ABC</artifactId>
  <version>0.0.1</version>
  <packaging>pom</packaging>
  <name>ABC</name>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>Maven Repository Switchboard</name>
      <url>http://repo1.maven.org/maven2</url>
    </repository>
  </repositories>
</project>

property is used in grand grand child pom ( for trail, if successfull without warning, i can iuse it everywhere):
<groupId>org.a.b</groupId>
<artifactId>CD<artifactId>
<version>${scl_version}</version>
<packaging>bundle</packaging>

<name>CD</name>
<description>OSGi bundle project.</description>

Apart from this, it has bundle plugin dependency plugin and some dependencies. In flattened pom ofthis child this version is resolved to 0.0.1

A: I mailed to developer of this plugin and his response is:

The warning is coming from Maven, based on the original pom.xml
  Before Maven starts executing, a buildplan is created and the pom.xml
  is analyzed, causing this warning. The flatten-maven plugin kicks in
  later in the process generating the flattened pom.xml and making sure
  that's the file being installed/deployed. Your issue can't be fixed by
  the flatten-maven-plugin and won't be fixed in Maven Core (the warning
  is there for a good reason).

So, it answers the question very well.


text:
Q: Error: invalid string value (arg="_name", coderType="string", value=null) I am trying to parse a persons information from a UI to a smart contract, the problem I seem to be having is the example I followed parses int's and I'm not sure what to change in order to parse strings across? This code is just trying to get the player name and birthday.
Here is my smart contract code:
pragma solidity 0.6.6;

contract Athlete_contract4{
    string public playerName;
    string public playerBirthday;
    string public playerAddress;
    string public playerNationality;

 function setData(string memory _name, string memory _birthday) public{
        playerName = _name;
        playerBirthday = _birthday;
       // playerAddress = _address;
       // playerNationality = _nationality;

}

}

And my code for my UI:

Athlete Details

        <input type="text" id="name" placeholder="Name">

        <input type="date" id="birthday">

        <input type="text" id="address" placeholder="Address">

        <input type="text" id="nationality" placeholder="Nationality">

        <button id='submit'>Submit</button>

When I deploy this to a local host using http-server in visual studio code I get this error:

Is there a parse string code that has to be used? Or have I just missed a line of code somewhere?

A: In your submit function - you are casting your "name" and "birthday" fields to an integer (where solidity is expecting a string).
Try removing the parseInt function.
name = parseInt($('#name').val());

to
name = $('#name').val();


text:
Q: How to change xml values from a excel file I am doing a project where i need to change the values of XML tags. I need to replace them from the excel file provided to me.
I have tried to use import xml.etree.ElementTree and successfully able to change the values manually for tag UTHNMA like for eg:
import xml.etree.ElementTree as ET

for form in root.iter('UTHNMA'):
    form.text = 'id_case=12111'

tree.write('asdf1.xml', xml_declaration=True, method="xml", encoding="UTF-8")

I need the code of how to fetch data row wise from the excel and put it as per the tags. For eg : If the case ID is 12345 in the excel row=1, col=2, then change it.

A: The answer to it is :
import xml.etree.ElementTree as ET
import xlrd
wb=xlrd.open_workbook
(r'C:\Users\Desktop\xml\xml.xlsx')
sheet = wb.sheet_by_index(0)

tree=ET.parse
(r'C:\Users\aniksinh\Desktop\xml\MRO57.xml')
root = tree.getroot()
data = [[sheet.cell_value(r, c) for c in
range(sheet.ncols)] for r in range(1,sheet.nrows)]

for i in range(sheet.ncols):
    UTHNMA=int(data[i][0])
    for form in root.iter(tag[0]):
        form.text = str(UTHNMA)
tree.write(r'C:\Users\Desktop\xml\new\asdf1'+'
('+str(i)+')'+'.xml', xml_declaration=True,
method="xml", encoding="UTF-8")


text:
Q: Keras Output Dimensions of VGG19 Conv4-1 Layer doesn't match up with model output import numpy as np
from PIL import Image
from keras.preprocessing import image
from keras.applications.vgg19 import preprocess_input

To create the VGG19 model I use:
img = Input(shape=(256,256,3))
vgg = VGG19(weights="imagenet")
vgg.outputs = [vgg.get_layer('block4_conv1').output]
model = Model(inputs=img, outputs=vgg(img))

Then in the model.summary() I see that:
block4_conv1 (Conv2D)        (None, 28, 28, 512)       1180160
My expected dimensions are (28,28,512).
To load the image into the network I use:
img = image.load_img("./path-to-image.jpeg", target_size=(256, 256))
img = preprocess_input(np.array(img))

However, when I put my image through the model, my output dimension is (1, 32, 32, 512) and it makes no sense as to why this happens!
To get output dimensions I run:
img_out = \
    model.predict(
        np.expand_dims(img, 0),
        batch_size=1
    )

img_out.shape
>>> (1, 32, 32, 512) != (28,28,512)

A: VGG19 takes input (224, 224, 3) by default. If you apply 3 max-pooling layers to it, you will get (28,28, num_kernels).
But, your input is (256, 256, 3). So, if you apply 3 max-pooling layers to this, you will end up getting (32, 32, num_kernels).
After 1st max-pool layer - (128, 128, num_kernels)
After 2nd max-pool layer - (64, 64, num_kernels)
After 3rd max-pool layer - (32, 32, num_kernels)


text:
Q: Creating Bitmap Indexes on a Materialized View I've been reading this article, discussing the benefits, tradeoffs, and potential problems with Bitmapped Indexes. It is mentioned:

Also, remember that bitmap indexes are only suitable for static tables and materialized views which are updated at night and rebuilt after batch row loading.  If your tables are not read-only during query time, DO NOT consider using bitmap indexes!

Most of our Materialized Views are updated nightly using the fast refresh method. Does the above quote mean that the MV should be rebuilt, or that the indexes should be rebuilt?

A: The key phrase is "after batch row loading".  If your process does not meet this criteria then you do not need to drop/rebuild the bitmap indexes.
Jonathan Lewis has an excellent article on this.  A key point he gives is

You can get lucky -- but in general you should start with the
assumption that even a serialized batch update will be most effective
if you drop the bitmap  indexes before the batch and rebuild them
afterwards.

The whole article is good and ends with some key facts to remember about bitmap indexes:

*

*If a B*tree index is not an efficient mechanism for accessing data, it is  unlikely to become more efficient simply because you convert it to a bitmap  index.

*Bitmap indexes can usually be built quickly, and tend to be surprisingly  small.

*The size of the bitmap index varies dramatically with the distribution of  the data.

*Bitmap indexes are typically useful only for queries that can use several  such indexes at once.

*Updates to bitmapped columns, and general insertion/deletion of data can  cause serious lock contention.

*Updates to bitmapped columns, and general insertion/deletion of data can  degrade the quality of the indexes quite dramatically.


text:
Q: Application Pool failling with client_reset errors in httperr followed by 503 2 Disabled errors On our server running Server 2008 R2 using IIS 7.5 we have one of our sites that stops responding to requests and eventually produces 503 errors. The site is also running Coldfusion 10. These failures are occurring every few days.
When the problem occurs I start seeing client_reset errors for requests to the site in the httperr log file. These will continue and request made to the site will not respond. No error is displayed the request just hangs. After about ten minutes I will see 503 2 Disabled errors in the httperr log file and attempts to reach the site will also return 503 errors to the end user.
During our attempts to resolve this issue we have also noticed queue is full errors in the httperr log and have increased the Application Pool Queue Length from 1000 to 3000 over time. We have also increased the appConcurrentRequestLimit from 5000 to 10000.
Our workers.properties file for the IIS Connector has the following settings:
worker.cfusion.type=ajp13
worker.cfusion.host=localhost
worker.cfusion.port=8012
worker.cfusion.max_reuse_connections=900
worker.cfusion.connection_pool_size=900
worker.cfusion.connection_pool_timeout=60

When we look at the successful requests in the general IIS log leading up to an application pool failure we will typically see high requests in short amount of time from a single or similar ip addresses. These appear to be bots of some type, most likely comment spam bots.
At this point, I'm unsure if this is a problem with the Connecter between Coldfusion and IIS, an IIS tuning issue, or a code issue that is causing the client_reset errors to start and the eventual failure of the application pool.
What would be causing the client reset errors and the eventual failure of the application pool? Stopping and starting the application pool in question resolves the issue.

A: We just had similar issues, where the App Pool would randomly start and need to be restarted... detailed at this bug - https://bugbase.adobe.com/index.cfm?event=bug&id=3490112
the latest CF10 update 18 includes a fix for this, if your problem is the same one. So far this update (And redoing all the connectors after updating) has solved the problem for us, only time will tell if it ever comes back.


text:
Q: remmina desktop client not working properly,shows login failed I have used a desktop client in windows and it works fine.
I could not find what the problem is.
Simply shows login failed.

A: try the following methods

ssh user@domain

from the terminal
or

sftp://user@dommain/home/

and try to connect the server
This will verify the login, if it works then your desktop client must also work.
I these attempts fail,then it simply means that your password is wrong ,contact your admin to resolve the issue

A: In my previous encounters with this problem, I do the following and my problem was solved:

*

*I deleted the entry from ~/.freerdp/known_hosts (or somewhere else that your remmina config is stored.)

*Click Advanced tab in my Remote Desktop Preferences and choose RDP in Security drop down menu and save.
Hope this help you


text:
Q: How to fetch detail from image I am working on a android app that show the details of a book from server.
Now i have to add a new feature :- when user scans any image of the book from app. So open the details of the image in app
Is their is any way to store index in book image and fetch from app.
I did not find any possible solution of this problem if any one have idea how to done this. Please help me


text:
Q: How to cast a scala.xml.NodeSeq to a Elem? I'm trying to reduce a list of elements
List(1, 2, 3).map{n => {n}}.reduce{(a,b)=> a ++ b}

But I get this error
<console>:8: error: type mismatch;
 found   : scala.xml.NodeSeq
 required: scala.xml.Elem
       List(1, 2, 3).map{n => {n}}.reduce{(a,b)=> a ++ b}

How do I cast a NodeSeq to a Elem?

A: I wouldn't use reduce in this case.  Instead, try foldLeft:
List(1, 2, 3).map{n => {n}}.foldLeft(NodeSeq.Empty){(a,b)=> a ++ b}

I have a whole blog post on map, reduce, and fold that may help if you're new to functional programming.

A: In addition to joescii's answer, you don't even need to use foldLeft to generate a sequence of nodes. Since List is already a sequence and Seq[Node] which is implicitly converted to NodeSeq you can just write the following:
val x : NodeSeq = List(1, 2, 3).map{n => {n}}

In addition, since the sequence of nodes is not a valid XML document (breaks single root element contract), you'd probably use this as a interim step in generating XML and subsequently wrap those nodes with some parent element.
If that's the case, than the explicit conversion to NodeSeq is unnecessary as it will be done implicitly as the example below demonstrates:
val x = List(1, 2, 3).map{n => {n}}
{x}

A: In addition to other answer, the simplest way to convert NodeSeq to Elem is:
val elemVar = nodeSeqVal(0)

It works if you are definitely sure that there are always the only Node in your NodeSeq, otherwise you lost the rest of the data.


text:
Q: Need Help Downloading Albow Library I am trying to download a library called Albow. I tried using pip to install it, but it didn't work, so I went to the Albow website and it linked to a .zip file. Basically what I want to do is to make it so that when I type:
import albow

Python recognizes it.
I'm using Python 3.5.3, on a Debian Linux VM. My PC's OS is using ChromeOS.
If I missed something that I should explain, I will edit the question.

A: The Albow website you linked to (or this other one from the Pygame projects) only supports Python 2. It's not available in PyPi so pip install would not work.
Since you tagged this python3.5, I assume you want Python 3 support.
There is a ported version available from PyPi: https://pypi.org/project/python3-albow/.

This project is a port of Gregory Ewing's Albow project (https://www.pygame.org/project/338/4687) that is only compatible with Python 2 and is unsupported since 2014.

You should be able to install it using standard pip install
$ python3.5 -m pip install --user python3-albow
...
Installing collected packages: pygame, python3-albow
Successfully installed pygame-1.9.6 python3-albow-2.7.8

$ python3.5
Python 3.5.9 (default, Nov 24 2019, 01:35:13)
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import albow
>>> albow.__path__
['/home/gino/.local/lib/python3.5/site-packages/albow']
>>>

Or, preferably, setup a virtual environment and install it there.


text:
Q: want to design bootstrap horizontal form with addons I want to design horizontal form with Bootstrap

*

*want to add addons on left side of input field.

*responsive but labels stay stable.

*some fields on 2 coloumns.

  <form class="form-horizontal">
  <fieldset class="col-xs-6">
    <legend>Portfolio A</legend>

      Label A1

          <input type="text" class="form-control" placeholder="control1" />

        label A2

          <input type="text" class="form-control" placeholder="control2" />

     </fieldset>
   <fieldset class="col-xs-6">
    <legend>Portfolio B</legend>

      Label B1

        <input type="text" class="form-control" placeholder="control1" />

           label B2

      <input type="text" class="form-control"    placeholder="control2" />

     </fieldset>
    </form>

A: Check the Docs: you can use text, font icons etc. Bootstrap 3 Input groups

#soForm .form-control {
  height: 50px;
  font-size: 16px;
  -webkit-border-radius: 0;
  border-radius: 0;
}
#soForm .input-group-addon {
  height: 50px;
  font-size: 13px;
  -webkit-border-radius: 0;
  border-radius: 0;
}
@media (min-width: 768px) {
  #soForm .soForm {
    margin: 10px auto;
  }
  #soForm .control-label {
    margin-top: 25px;
  }
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />

  <form id="soForm" name="soForm">

      Label 1

        <input type="email" class="form-control soForm" id="text1" placeholder="Text" />

      Label 2

          <input type="text" class="form-control" id="text2" placeholder="Text" />

      Label 3

          <input type="text" class="form-control" id="text3" placeholder="Text" />

      Label 4

          <input type="text" class="form-control" id="text4" placeholder="Text" />

      Label 5

        <input type="email" class="form-control soForm" id="text5" placeholder="Text" />

  </form>

A:

#soForm .form-control {
  height: 50px;
  font-size: 16px;
  -webkit-border-radius: 0;
  border-radius: 0;
}
#soForm .input-group-addon {
  height: 50px;
  font-size: 13px;
  -webkit-border-radius: 0;
  border-radius: 0;
}
@media (min-width: 768px) {
  #soForm .soForm {
    margin: 10px auto;
  }
  #soForm .control-label {
    margin-top: 25px;
  }
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />

  <form id="soForm" name="soForm">

      Label 1

        <input type="email" class="form-control soForm" id="text1" placeholder="Text" />

      Label 2

          <input type="text" class="form-control" id="text2" placeholder="Text" />

      Label 3

          <input type="text" class="form-control" id="text3" placeholder="Text" />

      Label 4

          <input type="text" class="form-control" id="text4" placeholder="Text" />

      Label 5

        <input type="email" class="form-control soForm" id="text5" placeholder="Text" />

  </form>


text:
Q: How to get `material-dropdown-select` to show current model value Using AngularDart + Angular Components
I need to create a dropdown that is populated with a small list of items (got this to work), and gets automatically set to the current selection for an object in the model (haven't got this to work).
I have an array of strings in the component called types. There is a model object (selected) whose field (type) corresponds to the list in types.
<form class="form">
   //other stuff
   <material-dropdown-select>
     <material-select-item *ngFor="let type of types" [selected] = "selected.type == type">
        {{type}}
     </material-select-item>
   </material-dropdown-select>
</form>

Despite the [selected] attribute, this doesn't sync the current value selected.type to the dropdown's default value. What am I doing wrong here?
Thanks in advance.
EDIT
Interestinglt even in this state the dropdown doesn't work as expected - i select a value from the dropdown and nothing happens.

A: The best place to see how widgets are used is probably going to be the angular_components_examples. For material-dropdown-select you can see the see the examples here
In particular for this bracket syntax [] in angular only propagates a value down, not up. So if you want to get an update on a value you would need to use parenthesis (). Or the special syntax [()].
Since this is a form I'd also suggest using the ControlValueAccessor to get the value in the form automatically:
<form class="form">
   //other stuff
   <material-dropdown-select [(ngModel)]="selected.type">
     <material-select-item *ngFor="let type of types" [selected] = "selected.type == type">
        {{type}}
     </material-select-item>
   </material-dropdown-select>
</form>

you'll also need to add DropdownSelectValueAccessor to your directives list.


text:
Q: Bootstrap accordion not working in angular 9 I am working with Angular 9
Installed bootstrap and jquery following is entry in my package.json

    "bootstrap": "^4.4.1",
    "jquery": "^3.5.0",

imported css and js files in angular.json like below
 "styles": [
          "./node_modules/bootstrap/dist/css/bootstrap.min.css",
          "src/styles.css"
        ],
 "scripts": [
          "./node_modules/jquery/dist/jquery.js",
          "./node_modules/bootstrap/dist/js/bootstrap.js"
        ]

And added following code in my html body

          <button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseOne"
            aria-expanded="false" aria-controls="collapseOne">
            Collapsible Group Item #1
          </button>

          Body1

          <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo"
            aria-expanded="false" aria-controls="collapseTwo">
            Collapsible Group Item #2
          </button>

          Body2

          <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseThree"
            aria-expanded="false" aria-controls="collapseThree">
            Collapsible Group Item #3
          </button>

          Body 3

But when i click Accordion i am getting following error in console
Uncaught TypeError: Cannot convert object to primitive value
at RegExp.test (<anonymous>)
at HTMLDivElement.<anonymous> (bootstrap.js:1509)
at Function.each (jquery.js:381)
at jQuery.fn.init.each (jquery.js:203)
at jQuery.fn.init._jQueryInterface [as collapse] (bootstrap.js:1503)
at HTMLDivElement.<anonymous> (bootstrap.js:1563)
at Function.each (jquery.js:381)
at jQuery.fn.init.each (jquery.js:203)
at HTMLButtonElement.<anonymous> (bootstrap.js:1558)
at HTMLDocument.dispatch (jquery.js:5429)

I am not able to figure out what is the issue Pls help.
Error Screen Shot

A: It's an issue with "jquery": "^3.5.0"
Downgrading to "jquery": "3.4.1" fixes it (make sure you remove ^).
If you must use 3.5.0, try modifying manually:
node_modules/bootsrap/dist/js/bootstrap.js line 1509

change
if (!data && _config.toggle && /show|hide/.test(config))

to
if (!data && _config.toggle && /show|hide/.test(_config))

A: please check with Bootstrap CDN. if that works then something wrong in your node_modules.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

copy above CDN to index.html  tag should work.


text:
Q: DriveInfo Class How to I execute the following code in silverlight 3.
    DriveInfo[] drives = DriveInfo.GetDrives();
    foreach (DriveInfo drive in drives)
    {
       if (drive.IsReady)
       { }
    }

As it is giving me error and when I try to add the reference for the system.IO I can't fine any reference for that Dll.Thanks in advance

A: Silverlight is executing in the browser, and can execute on platforms as diverse as Windows, OSX, Linux, etc.
I'd be really surprised is something as low-level as drive info would operate as it would on a Windows native forms app.


text:
Q: Calculate 45 degree to point to left top corner of the page Im trying to point the red div towards the corner of the window using transform rotate.

The Yellow is 45deg fixed, just for reference.
The Blue points to the left top corner using the innerHeight and innerWidth as points.
And the Red trys to mimic the Blue by calculating 45 + some offset, it must aways have the same rotation as the Blue but without using innerHeight and innerWidth as points.
This is the closest i got of makeing it work was using this code:

window.onresize = () => calcAngle()
var calcAngle = () => {
    console.clear()
    var x1 = 0, y1 = 0;
    var x2 = window.innerWidth, y2 = window.innerHeight;

    var a = (Math.atan2((y2 - x1), (x2 - y1)) * (180 / Math.PI));
    document.querySelectorAll(".pointer")[1].style.transform = "translate(50%, -50%) rotate("+a+"deg)"

    var of = x2/y2;
    var ang = 45;
    var calc = ang - (ang*of-ang)

    document.querySelectorAll(".pointer")[2].style.transform = "translate(50%, -50%) rotate("+(calc)+"deg)"
    console.log(a, calc)
}
calcAngle();
body {
    overflow: hidden;
}
.pointer {
    width: 200px;
    height: 20px;
    opacity: .7;
    background: blue;
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    clip-path: polygon(100% 0%, 100% 100%, 0% 50%);
}
.pointer:nth-child(1){
    background: yellow;
    transform: translate(50%, -50%) rotate(45deg);
}
.pointer:nth-child(3){
    background: red;
}

Using the code as example, calc must always have the same value of a but using 45 deg as reference.

A: Of course as you show in your question, the simplest approach is to use the atan(y/x) * 180 / PI to get the entire angle. This is reflected below as refAngle.
Since your condition requires that it be an offset of 45 degrees, this requires more advanced math, using the law of sines in addition to basic trigonometry. We have enough information based on the ratio of width/height of the screen to find the information, but it ends up being a very complex formula. This is reflected below in two steps, first sinOff to get the sine of the offset angle relative to 45 degrees, and then off once we've done the asin and conversion from radians to degrees.
This snippet demonstrates that the two angles agree, no matter how the browser window is resized.

const x = window.innerWidth;
const y = window.innerHeight;

const { sin, atan, asin, sqrt, PI } = Math;
const sinOff = sin(atan(y/x)) / (sqrt(2)*y) * (x-y);
const off = asin(sinOff) * 180 / PI;
const angle = 45 - off;

const refAngle = atan(y/x) * 180 / PI;
console.log(angle, refAngle);

Note, since the formula is so complex, I'm using destructuring to reduce the Math. clutter.


text:
Q: Retrieve Name value from ColumnAttribute for Entity Framework batch deletes I want to implement batch delete (for performance reasons) in Entity framework like this:
context.ExecuteStoreCommand("DELETE FROM {0} WHERE {1} = {2}", tableName, columnName, columnValue);

I want to know how to get the column's name from the property.
[Column("ColumnName")]
public int PropertyName { get; set; }

I Also use EF5 with Oracle provider.

A: You use Reflection.
public class MyClass
{
  [Column("ColumnName")]
  public int PropertyName { get; set; }
}

Using Reflection:
public static string GetColumnName<T>(string propertyName)
{
    string result = null;

    if (string.IsNullOrWhiteSpace(propertyName))
    {
        throw new ArgumentNullException();
    }

    var tableType = typeof(T);
    var properties = tableType.GetProperties(BindingFlags.GetProperty
                                             | BindingFlags.Instance
                                             | BindingFlags.Public);

    var property = properties
      .Where(p => p.Name.Equals(propertyName,
                               StringComparison.CurrentCultureIgnoreCase))
      .FirstOrDefault();

    if (property == null)
    {
      throw new Exception("PropertyName not found."); // bad example
    }
    else
    {
      result = property.Name;  //if no column attribute exists;

      var attributes = property.GetCustomAttributes();

      var attribute = attributes
        .Where(a => a is ColumnAttribute)
        .FirstOrDefault() as ColumnAttribute;

      if (attribute != null)
      {
        result = attribute.Name;
      }
    }
    return result;
}

For example:
public class MyClass
{
  [Column("ColumnName")]
  public int PropertyName { get; set; }
}

var result = GetColumnName<MyClass>("PropertyName");
Console.WriteLine(result);

Result:

ColumnName


text:
Q: Converting string to numpy array and vice versa in python I am having a numpy array which is the image read by open cv and saving it as a string. So I have converted the np array to string and stored the same. Now I wanted to retrieve the value(which is a string) and convert to original numpy array dimension. Could you all please help me in how to do that?
My code is as below:
img = cv2.imread('9d98.jpeg',0)
img.shape    # --> (149,115)
img_str=np.array2string(img,precision=2,separator=',') # to string length 197? which I dont know how
img_numpy=np.fromstring(img_str,dtype=np.uint8) # shape (197,) since this is returning only 1D array

Please help me in resolving the same

A: The challenge is to save not only the data buffer, but also the shape and dtype.  np.fromstring reads the data buffer, but as a 1d array; you have to get the dtype and shape from else where.
In [184]: a=np.arange(12).reshape(3,4)

In [185]: np.fromstring(a.tostring(),int)
Out[185]: array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11])

In [186]: np.fromstring(a.tostring(),a.dtype).reshape(a.shape)
Out[186]:
array([[ 0,  1,  2,  3],
       [ 4,  5,  6,  7],
       [ 8,  9, 10, 11]])

A: Is going to json an option?
Following the answer here:
import numpy as np
import json

img = np.ones((10, 20))
img_str = json.dumps(img.tolist())
img_numpy = numpy.array(json.loads(img_str))