yii – how to upload a file from the server to the local machine using php

Just save to a file share or upload it to an ftp site on your machine.

Presumably, the reason you are having this problem is that generally a "local machine" will not have a public static IP address or will run software that will accept incoming connections.

It is probably easier for your local computer to call the site and download the files it needs.

Problem in React Native shadow animation on the answering machine

I want to apply animation in the shadow, like when the user is trying to scroll down at that time, the shadow should be dark when the user is trying to scroll upwards at that time, the shadow should be clear on the responder effect.

  minAnimatedView: {
shadowColor: "rgba(81, 84, 92, 0.2)",
shadowOffset: {
  width: 0,
  height: 1
},
shadowRadius: 8,
shadowOpacity: 1,
elevation:12
},

fullAnimatedView: {
shadowColor: "rgba(81, 84, 92, 0.57)",
shadowOffset: {
  width: 0,
  height: 2
},
shadowRadius: 14,
shadowOpacity: 1,
elevation:12
},

 teeBookAnimatedView: {
 borderRadius: 4,
 backgroundColor: colors.white,
 marginLeft: 15,
 marginRight: 15,
 marginTop: 10,
 paddingBottom: 3,
 },

 imageBGView: {
 width: "100%",
 height: 124,
 overflow: "hidden",
 borderTopRightRadius: 5,
 borderTopLeftRadius: 5,
 backgroundColor: colors.white,
},

iamgeView: {
width: "100%",
height: 124,

},

panelDraggedShadow: {
 height: 50,
 alignItems: "center",
 justifyContent: "flex-end",
 position: 'absolute',
 borderWidth: null
 },

teeTimeCourseBorderView: {
borderColor: colors.whiteGrayWithAlpha,
width: globals.screenWidth * 0.10,
borderWidth: 2,
borderRadius: 5,
bottom: 7
},

User interface view

 return (
        
            
                
                        
                            
                        
                    
            
            {this.renderDraggedView()}
        
    )

renderPanelDraggeView() {
    return (
        
            
        
    );
}

PanResponder code:

this._panResponder = PanResponder.create({
        onStartShouldSetPanResponder: (evt, gestureState) => true,
        onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
        onMoveShouldSetPanResponder: (evt, gestureState) => true,
        onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,
        onPanResponderGrant: (evt, gestureState) => {
        },
        onPanResponderMove: (evt, gestureState) => {
            this.setState({ isKeyboardScrollEnable: false, isPanelMove: true })
            this.state.animatedHeight.setValue(gestureState.moveY)
        },
        onPanResponderTerminationRequest: (evt, gestureState) => true,
        onPanResponderRelease: (evt, gestureState) => {
            if (gestureState.dy > 0) {
                this.setState({ isKeyboardScrollEnable: true })
                LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
                Animated.timing(this.state.animatedHeight, {
                    toValue: globals.screenHeight - 100,
                    timing: 500
                }).start(() => {
                    this.setState({
                        isFullView: true
                    })
                })
            } else if (gestureState.dy < 0) {
                this.setState({ isKeyboardScrollEnable: true })
                LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);

                Animated.timing(this.state.animatedHeight, {
                    toValue: this.state.viewHeight,
                    timing: 500
                }).start(() => {
                    this.setState({
                        isFullView: false
                    })
                })
            }
        },
        onPanResponderTerminate: (evt, gestureState) => {
        },
        onShouldBlockNativeResponder: (evt, gestureState) => {
            return true;
        },
    });

I want to show the increase in the shadow of my view when the user scrolls down and when the user scrolls the shade up must be clear. How can I get there, all your suggestions are welcome.

machine learning – Calculate the probability in a graphical model

I have the following graphical model, in which I want to calculate $ p (Intelligence = 1 | Letter = 1, SAT = 1) $

enter description of image here

I tried to use Bayes, and also just without Bayes as
$ p (D, I, G, L, S) = p (D) p (I) p (G | D, I) p (S | I) p (L | G) $
but I'm stuck here when I sort for example to calculate $ p (G | D, I) $.

python – How to prepare datasets for machine learning (Tensorflow 2.x)

I am working on my first Machine Learning project using the TensorFlow 2.0 library. The project tries to predict your personality type from the 16 personality types of the Myers-Briggs test.

When I use my own data, I don't know how to prepare the datasets: use csv or txt, and how to separate test_data from test_label.

As an example, the information to be prepared should be as follows:

tipo_de_personalidad | descripción
      INTJ           | Los de tipo de personalidad intj son (...)
      ENTP           | Los de tipo de personalidad entp son (...)
      ...            | ...

I want to prepare this type of information to create datasets (test_data, test_labels, train_data, train_labels) to use them correctly in a sequential model.

I understand that you must have this data as np.array, perform preprocessing and perform word_index tokenization.

If it is possible to enlighten me with the steps, this would be ideal.

I just installed webmin on a Centos 8 machine and when I try to connect to localhost: 10000 I get a timeout

I just installed webmin on a Centos 8 machine and when I try to connect to localhost: 10000 I get a timeout.

Any idea why this could be?

virtual machine – Hypervisor for Windows 10 that works like Parallels on macOS

Coming from Parallels on a macOS host and running a Windows 10 Pro guest gives the impression that you are running it in native mode. There is practically no lag – it works perfectly. I do not have Boot Camp as it was not necessary.

I'm trying to find something similar for Windows 10 as a host and Linux as a guest. Hyper-V is supposed to work better than VirtualBox or VMware Player, and frankly, it really isn't. About as laggy.

I could probably learn to live with it, but quite boring at the moment and I can see that it becomes a problem when I'm working on animations. Consider making a partition for Linux. This presents other problems, such as the loss of the advantage of using the same VPN connection and the automatic mapping of these remote network drives to the host from the host. host.

Anyway, what works like Parallels on macOS, but for Windows 10?

machine learning – Comparison of characteristic importance values ​​in logistic regression and random forest in scikitlearn

I am trying to classify the entities for binary classification, according to their importance using an ensemble method by combining the importance of the entities estimated by random forest and logistic regression. I know that the logistic regression coefficients and the random feture_importances of the forest are different values ​​and I am looking for a method to make them comparable. Here is what I have in mind:

X=features
y=lablels
rf=RandomForestClassifier()
rf.fit(X,y)
RFfitIMP=rf.feature_importances_/rf.feature_importances_.sum() #normalizing feature importances to sum up to 1
lr=LogisticRegression()
lr.fit(X,y)
lrfitIMP=np.absolute(lr.coef_)/np.absolute(lr.coef_).sum() #Taking absolute values and normalizing coefficient values to sum up to 1
ensembleFitIMP = np.mean((featIMPs for featIMPs in (RFfitIMP,lrfitIMP)), axis=0)

What I think the code does is take the relative importance of the two models, standardize them and return the importance of functionality on average over two models. I was wondering if this was a correct approach to this end or not?

Strange Azure virtual machine performance issues

We have 5 virtual machines on Azure for a client. All the virtual machines went well.

Since Monday, the virtual machine of one of the users has been losing performance every day at 4 p.m. UTC + 1 (+ -1 h). When we have these performance issues, the processor runs around 100% randomly.

All other VMs work fine while the software stack is exactly the same on all VMs.

We have been in contact with Microsoft support for more than 24 hours. In the meantime, we have redeployed the virtual machine 2 times, once out of a snapshot and once completely from scratch. The problem returns, however.

All other VMs run under the same circumstances at around 5-30% CPU.

The problem is not reproducible at all. It comes and goes for a few hours at a time.

We now have four experienced engineers on this and we cannot understand the problem.

Do you have any idea what it could be? I am happy for any contribution. We soon go crazy here …

What we do on the machines:

  • Office O365
  • Adobe reader
  • Avast Antivirus
  • Firefox / Chrome
  • 2 specialized software tools for mechanics
  • onedrive
  • ScreenConnect

What we have already done to discover / solve the problem:

  • Performance diagnosis (no specific process provokes it)
  • compare Windows versions
  • compare all installed software
  • compare all Azure settings
  • recreated the VM from scratch
  • check disk speed
  • check memory usage
  • full AV verification
  • remove Veeam from all virtual machines due to a suggestion from Microsoft support (SQL express was installed via Veeam)
  • check all event logs -> nothing special

I will edit it here when I remember more things that we have tried

machine learning – probability of error for a Bayesian classifier with P (x | c 1) = P (x | c 2) and P (c 1) = P (c 2)

Thank you for providing a response to Computer Science Stack Exchange!

  • Make sure you respond to the question. Give details and share your research!

But to avoid

  • Ask for help, clarification or respond to other responses.
  • Make statements based on opinion; save them with references or personal experience.

Use MathJax to format the equations. Reference MathJax.

For more information, see our tips on writing correct answers.

CN = can localhost be used on a server which has to run on any machine [duplicate]

You have a question about self-signed certificates for which, after doing several searches, I don't think I have a concrete answer.

Suppose I generated a self-signed server certificate with CN=localhost. Does that mean i can use this certificate on a server and be able to run this server on all machine in a local network, where any client on the network with the public certificate key can communicate with the server (i.e. the server listens to any IP address)?

As an example, I used the following script to generate certificates for use in a mutual TLS scenario (based on this answer):

echo Generate CA key:
openssl genrsa -passout pass:1111 -aes256 -out ca.key 4096

echo Generate CA certificate:
openssl req -passin pass:1111 -new -x509 -days 36500 -key ca.key -out ca.crt -subj  "/C=UK/ST=UK/L=London/O=YourCompany/OU=YourApp/CN=MyRootCA"

echo Generate server key:
openssl genrsa -passout pass:1111 -aes256 -out server.key 4096

echo Generate server signing request:
openssl req -passin pass:1111 -new -key server.key -out server.csr -subj  "/C=UK/ST=UK/L=London/O=YourCompany/OU=YourApp/CN=localhost"

echo Self-sign server certificate:
openssl x509 -req -passin pass:1111 -days 36500 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt

echo Remove passphrase from server key:
openssl rsa -passin pass:1111 -in server.key -out server.key

echo Generate client key
openssl genrsa -passout pass:1111 -aes256 -out client.key 4096

echo Generate client signing request:
openssl req -passin pass:1111 -new -key client.key -out client.csr -subj  "/C=UK/ST=UK/L=London/O=YourCompany/OU=YourApp/CN=localhost"

echo Self-sign client certificate:
openssl x509 -passin pass:1111 -req -days 36500 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out client.crt

echo Remove passphrase from client key:
openssl rsa -passin pass:1111 -in client.key -out client.key

What I find is that the server loads properly on some machines, but on other machines it doesn't start up, signaling that it could not bind to Harbor. I have verified that the port is definitely not used by anything. In addition, the server starts correctly if I am not using any certificate.

Am I doing something wrong in the script, or is it impossible to have a certificate with CN=localhost on a server that should be able to get it wrong on any machine on a local network and accept connections from any client on the network that trusts the public key?