qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
27,174 | In the month of June I am looking to take my lead climbing from indoors into the outdoors. To bridge the gap between my gym skills and whats required in the "wild", I've decided to go on Youtube and look up [some training videos](https://www.youtube.com/watch?v=7U6tdEevJgs). However most videos begin with something lik... | 2021/06/01 | [
"https://outdoors.stackexchange.com/questions/27174",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/12593/"
] | I was a tennis instructor for about 10 years. Here are a few things from my experience that can become problems for you with learning through videos.
1). You have to retain everything that you watched on a video. If you forget something you won't be able to call yourself out on it. And being a beginner you won't have ... | These are physical activities that you need to learn by doing. A high-quality avalanche class will have to bring you into contact with snow. A high-quality climbing class that teaches skills like ascending the rope or placing trad gear can't possibly teach those skills without having you actually do those things under ... |
27,174 | In the month of June I am looking to take my lead climbing from indoors into the outdoors. To bridge the gap between my gym skills and whats required in the "wild", I've decided to go on Youtube and look up [some training videos](https://www.youtube.com/watch?v=7U6tdEevJgs). However most videos begin with something lik... | 2021/06/01 | [
"https://outdoors.stackexchange.com/questions/27174",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/12593/"
] | [@AnoE's answer](https://outdoors.stackexchange.com/a/27179/15558) is pretty much bang on, but there are two main elements that you can't learn by watching videos; stress management and improvisation.
I've taught numerous people to climb outside, and one thing I've always tried to install in them is that, at some poin... | These are physical activities that you need to learn by doing. A high-quality avalanche class will have to bring you into contact with snow. A high-quality climbing class that teaches skills like ascending the rope or placing trad gear can't possibly teach those skills without having you actually do those things under ... |
1,264,953 | I'm having trouble knowing when to use the ANOVA method for analysing variances. For example this question:
$1.$ In an investigation of the effect of large amounts of lime on marigolds, the numbers of plants per pot were:
Control: $140$, $142$, $36$, $129$, $49$, $37$, $114$, $125$.
Treated: $117$, $137$, $137$, $14... | 2015/05/03 | [
"https://math.stackexchange.com/questions/1264953",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/118725/"
] | ANOVA should only be run on homoscedastic data. The first test you reference above is a test for heteroscedasticity. The test should be run prior to the ANOVA, which tests for a difference in means.
Since the first test is a prerequisite to the second test, they do not fall in the same category. Prior to running the ... | you can use ANOVA for two categories. ANOVA is generally used when we have more than two categories and we want to know if there is a difference between (or among) them. If there are only 2 categories, the usually a means test like the t-test is used. sometimes there are only two categories, but one needs to know if th... |
21,785,734 | I have a web service which I have registered via "add service reference" that requires HTTPS and a certificate. Below is my code for instantiating my service:
```
service = new MyReferencedWebService();
X509Certificate2 cert = new X509Certificate2();
var stream = Assembly.GetExecutingAssembly... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21785734",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1252601/"
] | What is your plan here? In other words:
Who is going to be entering the PIN? Who is going to be inserting a smart card?
You cannot establish the secure channel between the ASP.NET web server and the web service without the smart card and the pin, because the client (i.e. the ASP.NET web server) must access the privat... | Is the certificate's root certificate accessible? If you imported it yourself it was imported to your user's certificate store which iis can't access (import it to the machine store instead)
The documentation for the class' constructor says that the class will access a CSP to store the certificate's (for pfx) private ... |
21,785,734 | I have a web service which I have registered via "add service reference" that requires HTTPS and a certificate. Below is my code for instantiating my service:
```
service = new MyReferencedWebService();
X509Certificate2 cert = new X509Certificate2();
var stream = Assembly.GetExecutingAssembly... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21785734",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1252601/"
] | What is your plan here? In other words:
Who is going to be entering the PIN? Who is going to be inserting a smart card?
You cannot establish the secure channel between the ASP.NET web server and the web service without the smart card and the pin, because the client (i.e. the ASP.NET web server) must access the privat... | **Configuration of Your WCF Client**
Just in case, ensure the address of your end point is of the form:
```
"https://hostname[:port]/ServiceDirectory/MyService.svc"
```
Assuming the configuration of your service is correct, the binding configuration of your ASP.NET application should be:
```
<system.serviceModel>
... |
35,668,421 | i have a service as follows
```
angular.module('starter.service')
.factory('authService', function($http) {
var service = {};
service.GetByUsername = function() {
return $http.get('/js/user.json');
}
return service;
})
```
i just need to know two things,
1. why its is declaring a ... | 2016/02/27 | [
"https://Stackoverflow.com/questions/35668421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5861745/"
] | You cannot change variables outside of a function by assigning to the name of the parameter inside the function. The only thing this does is change the local variable in question. So the assignment to `m` in `method1` sets the local variable `m` correctly, but that does not effect the variable `m` in `method2`.
The so... | Return `m` in `method1`:
```
public OntModel method1(OntModel m) { //for ontologyCreation
m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
/*-----*/
return m;
}
```
And in `method2`, the call should be:
```
m = method1(m);
```
Java passes references by value, meaning `method1` receives ... |
35,668,421 | i have a service as follows
```
angular.module('starter.service')
.factory('authService', function($http) {
var service = {};
service.GetByUsername = function() {
return $http.get('/js/user.json');
}
return service;
})
```
i just need to know two things,
1. why its is declaring a ... | 2016/02/27 | [
"https://Stackoverflow.com/questions/35668421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5861745/"
] | You cannot change variables outside of a function by assigning to the name of the parameter inside the function. The only thing this does is change the local variable in question. So the assignment to `m` in `method1` sets the local variable `m` correctly, but that does not effect the variable `m` in `method2`.
The so... | You `m` variable isn't being instantiated before `method2`is called.
Therefore it has the value `null` associated.
Even though you're calling `method1`, that attribution will only be valid on the method's scope.
You ought to do `OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);` before `ont.method... |
35,668,421 | i have a service as follows
```
angular.module('starter.service')
.factory('authService', function($http) {
var service = {};
service.GetByUsername = function() {
return $http.get('/js/user.json');
}
return service;
})
```
i just need to know two things,
1. why its is declaring a ... | 2016/02/27 | [
"https://Stackoverflow.com/questions/35668421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5861745/"
] | If you use the `OntModel` more than once with the `OntologyCreation` instance, you could use a field to store the variable:
```
private OntModel m;
public void method1() {
this.m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
}
public ArrayList<String> method2(String ontoClass) {
method1();
th... | You cannot change variables outside of a function by assigning to the name of the parameter inside the function. The only thing this does is change the local variable in question. So the assignment to `m` in `method1` sets the local variable `m` correctly, but that does not effect the variable `m` in `method2`.
The so... |
35,668,421 | i have a service as follows
```
angular.module('starter.service')
.factory('authService', function($http) {
var service = {};
service.GetByUsername = function() {
return $http.get('/js/user.json');
}
return service;
})
```
i just need to know two things,
1. why its is declaring a ... | 2016/02/27 | [
"https://Stackoverflow.com/questions/35668421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5861745/"
] | If you use the `OntModel` more than once with the `OntologyCreation` instance, you could use a field to store the variable:
```
private OntModel m;
public void method1() {
this.m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
}
public ArrayList<String> method2(String ontoClass) {
method1();
th... | Return `m` in `method1`:
```
public OntModel method1(OntModel m) { //for ontologyCreation
m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
/*-----*/
return m;
}
```
And in `method2`, the call should be:
```
m = method1(m);
```
Java passes references by value, meaning `method1` receives ... |
35,668,421 | i have a service as follows
```
angular.module('starter.service')
.factory('authService', function($http) {
var service = {};
service.GetByUsername = function() {
return $http.get('/js/user.json');
}
return service;
})
```
i just need to know two things,
1. why its is declaring a ... | 2016/02/27 | [
"https://Stackoverflow.com/questions/35668421",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5861745/"
] | If you use the `OntModel` more than once with the `OntologyCreation` instance, you could use a field to store the variable:
```
private OntModel m;
public void method1() {
this.m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
}
public ArrayList<String> method2(String ontoClass) {
method1();
th... | You `m` variable isn't being instantiated before `method2`is called.
Therefore it has the value `null` associated.
Even though you're calling `method1`, that attribution will only be valid on the method's scope.
You ought to do `OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);` before `ont.method... |
15,637,112 | I'm using Microsoft.Office.Interop.MailItem to strip attachements from email, save them to disk, print them out and then delete them from disk. I'm having problems deleting JPG attachements, the file seems to have a lock,
Here is my code for saving each attachement,
```
foreach (Attachment attachment in outLookMessag... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15637112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1678539/"
] | I would try using `attachment.Dispose()` before deleting them. | The most likely cause is that the file already exists there (and is being held) or that you don't have permission to perform the action. The first is almost assuredly the case
If the file exists, *why* are you writing over it? This is probably not what you want to do.
Better to check if the file exists and if it is lo... |
63,683,736 | What would be the regex emulating [GitHub's autolinked references](https://docs.github.com/en/github/writing-on-github/autolinked-references-and-urls)?
It takes Markdown on input and outputs enriched Markdown where strings like `#123` are converted to `[#123](https://github.com/owner/repo/issues/123)`.
These are some... | 2020/09/01 | [
"https://Stackoverflow.com/questions/63683736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21728/"
] | I found solution.
I used cordova-plugin-geolocation. But it is not working well on android.
It shows error
'getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS.'
After spending much time to res... | I am using this package and it works very well.
<https://www.npmjs.com/package/@ionic-native/geolocation>
This API is based on the W3C Geolocation API Specification, and only executes on devices that don't already provide an implementation.
```
<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUs... |
26,417,419 | I have a table that I have set to `display:none`. I want the table to change to `display:block` when a particular radio button is clicked. Using `onlick=""` within the radio tag didn't work so I implemented the following code:
```
window.onload = function() {
var adminbutton = document.getElementById('adminstatus'... | 2014/10/17 | [
"https://Stackoverflow.com/questions/26417419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2670137/"
] | [**Demo**](http://jsfiddle.net/ianwong/wq2jm2tw/ "http://jsfiddle.net/ianwong/wq2jm2tw/")
```js
var adminbutton = document.getElementById('adminstatus');
adminbutton.onclick = show;
function show() {
document.getElementById('brokerform').style.display = 'block';
}
```
```html
<table id="adminstatus">
<t... | Try this...
```
account.getElementById('brokerform').show();
```
or this:
```
account.getElementById('brokerform').css("display", "block");
``` |
29,287 | I have a custom component(named myComponent) which has an attribute value. I want to change the value of this attribute using javascript. How to do that ?
```
<apex:component >
<apex:attribute name="value" description="The value of picklist"
type="String[]" />
<script>
//change value... | 2014/03/04 | [
"https://salesforce.stackexchange.com/questions/29287",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/731/"
] | Are you trying to send a value modified into your component to your controller ?
If so, check this:
1. You should set the action to call in your `apex:commandButton`
2. You should set the component attribute to an `apex:inputField` in order to
sent it using an standard apex:form to the controller.
3. Instead that you... | You can use a merge field for accessing the value:
```
<apex:component >
<apex:attribute name="value" description="The value of picklist"
type="String[]" />
<script>
var x = {!JSENCODE(value)};
console.log(x);
</script>
</apex:component >
```
For sending the new value to... |
29,287 | I have a custom component(named myComponent) which has an attribute value. I want to change the value of this attribute using javascript. How to do that ?
```
<apex:component >
<apex:attribute name="value" description="The value of picklist"
type="String[]" />
<script>
//change value... | 2014/03/04 | [
"https://salesforce.stackexchange.com/questions/29287",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/731/"
] | Are you trying to send a value modified into your component to your controller ?
If so, check this:
1. You should set the action to call in your `apex:commandButton`
2. You should set the component attribute to an `apex:inputField` in order to
sent it using an standard apex:form to the controller.
3. Instead that you... | The value won't be sent back to the controller, as all you have done is create a JavaScript property that takes its initial value from the component and updated the property to a different value. This is disconnected from the attribute, as by the time the page is delivered to the browser `{!value}` is simply some text ... |
44,229,521 | Hey guys so I was working on this code that finds the same numbers and display them and so far the result is just random numbers I need help.
```
int main(void){
int arr[10] = {1, 2, 3, 4, 5, 4, 8 ,8, 9, 10};
int i;
int j;
int same[10];
int ctr = 0;
for(i = 0; i < 10; i++){
for(j = 10; j > 0;j--){
if(arr[... | 2017/05/28 | [
"https://Stackoverflow.com/questions/44229521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7486377/"
] | You're contradicting yourself. For the same array, you're using two different indexing scheme!!
* In outer loop (*ascending index*), you're indexing from `0` to `9`
* In inner loop (*decending index*), you're indexing `10` from `1`.
The inner loop indexing is [off-by-one](https://en.wikipedia.org/wiki/Off-by-one_erro... | Start your second loop (the `j` loop) at 9 and go to 0. |
44,229,521 | Hey guys so I was working on this code that finds the same numbers and display them and so far the result is just random numbers I need help.
```
int main(void){
int arr[10] = {1, 2, 3, 4, 5, 4, 8 ,8, 9, 10};
int i;
int j;
int same[10];
int ctr = 0;
for(i = 0; i < 10; i++){
for(j = 10; j > 0;j--){
if(arr[... | 2017/05/28 | [
"https://Stackoverflow.com/questions/44229521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7486377/"
] | You're contradicting yourself. For the same array, you're using two different indexing scheme!!
* In outer loop (*ascending index*), you're indexing from `0` to `9`
* In inner loop (*decending index*), you're indexing `10` from `1`.
The inner loop indexing is [off-by-one](https://en.wikipedia.org/wiki/Off-by-one_erro... | I ran your code on codechef compiler, it was giving a run time error. Because in your ctr++ step , value of ctr exceeded the size of the array same[].
Moreover, in your code you are comparing one element with itself so every number will be printed in the list(since i==j may be a possible case)
It will be better if yo... |
53,574,008 | I passed validationType for first input but 'onInputBlur' method in login-form-row component prints that FormControl is valid no matter what i type in input even though i set Validators.pattern. I'm really stuck in here. Please help.
login-form.component.html
```
<app-login-form-row
[label]="'Username'"
[da... | 2018/12/01 | [
"https://Stackoverflow.com/questions/53574008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10719745/"
] | Not possible to create foreign key from composite key. Should be refer from parent key is primary key and should be not of column in reference key also..as per your share screen not possible to create this.. If you want to achieve this business let me reply will give suggestion to you.. | I had my composite key the wrong way round. I switched the 'UniqueCode' to act as the parent key and managed to link fine |
5,406,427 | I am working on a web application which is deployed in Tomcat. We are using Spring, Hibernate, GWT at the client side).
One of the functionality of this application is to send alerts ( emails ) to Users when any entity is created, updated or deleted. ( Alerts can be added by Users on the fly, so there is some process... | 2011/03/23 | [
"https://Stackoverflow.com/questions/5406427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470403/"
] | The restriction on creating threads in a container was really just a suggestion to keep inexperienced developers from shooting themselves in the foot. No container actually prohibits you from doing this. With java.util.concurrent classes, creating threads should be less error prone and I wouldn't worry about this restr... | You could use a scheduler to run jobs regularly or use the Spring equivalent of Message Driven Beans ([some documentation on JMS and Spring](http://static.springsource.org/spring/docs/2.5.x/reference/jms.html)) which are executed by the container which does the queue polling for you. |
5,406,427 | I am working on a web application which is deployed in Tomcat. We are using Spring, Hibernate, GWT at the client side).
One of the functionality of this application is to send alerts ( emails ) to Users when any entity is created, updated or deleted. ( Alerts can be added by Users on the fly, so there is some process... | 2011/03/23 | [
"https://Stackoverflow.com/questions/5406427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470403/"
] | You could use a scheduler to run jobs regularly or use the Spring equivalent of Message Driven Beans ([some documentation on JMS and Spring](http://static.springsource.org/spring/docs/2.5.x/reference/jms.html)) which are executed by the container which does the queue polling for you. | There are ways of doing it, the simplest (besides simply creating an unmanaged thread) is to use the [commonj WorkManager](https://stackoverflow.com/questions/533783/why-spawning-threads-in-j2ee-container-is-discouraged/533847#533847). Certainly you can go the simple thread route, but it does have shortcomings in the e... |
5,406,427 | I am working on a web application which is deployed in Tomcat. We are using Spring, Hibernate, GWT at the client side).
One of the functionality of this application is to send alerts ( emails ) to Users when any entity is created, updated or deleted. ( Alerts can be added by Users on the fly, so there is some process... | 2011/03/23 | [
"https://Stackoverflow.com/questions/5406427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470403/"
] | The restriction on creating threads in a container was really just a suggestion to keep inexperienced developers from shooting themselves in the foot. No container actually prohibits you from doing this. With java.util.concurrent classes, creating threads should be less error prone and I wouldn't worry about this restr... | There are ways of doing it, the simplest (besides simply creating an unmanaged thread) is to use the [commonj WorkManager](https://stackoverflow.com/questions/533783/why-spawning-threads-in-j2ee-container-is-discouraged/533847#533847). Certainly you can go the simple thread route, but it does have shortcomings in the e... |
5,406,427 | I am working on a web application which is deployed in Tomcat. We are using Spring, Hibernate, GWT at the client side).
One of the functionality of this application is to send alerts ( emails ) to Users when any entity is created, updated or deleted. ( Alerts can be added by Users on the fly, so there is some process... | 2011/03/23 | [
"https://Stackoverflow.com/questions/5406427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470403/"
] | The restriction on creating threads in a container was really just a suggestion to keep inexperienced developers from shooting themselves in the foot. No container actually prohibits you from doing this. With java.util.concurrent classes, creating threads should be less error prone and I wouldn't worry about this restr... | You can try using Spring 3.x asynchronous method invocation. Caller method will return immediately and the actual execution happens asynchronously
applicationContext:
```
<task:annotation-driven executor="asyncExecutor" mode="aspectj"/>
<task:executor id="asyncExecutor" pool-size="${executor.poolSize}"/>
```
On yo... |
5,406,427 | I am working on a web application which is deployed in Tomcat. We are using Spring, Hibernate, GWT at the client side).
One of the functionality of this application is to send alerts ( emails ) to Users when any entity is created, updated or deleted. ( Alerts can be added by Users on the fly, so there is some process... | 2011/03/23 | [
"https://Stackoverflow.com/questions/5406427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470403/"
] | You can try using Spring 3.x asynchronous method invocation. Caller method will return immediately and the actual execution happens asynchronously
applicationContext:
```
<task:annotation-driven executor="asyncExecutor" mode="aspectj"/>
<task:executor id="asyncExecutor" pool-size="${executor.poolSize}"/>
```
On yo... | There are ways of doing it, the simplest (besides simply creating an unmanaged thread) is to use the [commonj WorkManager](https://stackoverflow.com/questions/533783/why-spawning-threads-in-j2ee-container-is-discouraged/533847#533847). Certainly you can go the simple thread route, but it does have shortcomings in the e... |
28,997,220 | I have a $\_POST array with a single variable 'listing\_type'. The form submits to a page containing the code below which redirects them to another page with more forms dependent on their initial choice. Is there a slicker way to do this? It works fine but feels clunky...
```
<?php // listing-type.php
if ((isset($_POS... | 2015/03/11 | [
"https://Stackoverflow.com/questions/28997220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1890243/"
] | It's fine except there is no need to have two location calls, and you don't need the else:
```
$url = "index.php";
if ((isset($_POST['listing_type'])) && (!empty($_POST['listing_type']))) {
// Switch statement
}
header("Location: $url");
``` | Yes, you can do it. I think is a good way, you can improving your code a litle bit but is a good way.
Anyway, I think if you can do it this one with js during sending the form, o perhaps in you html code, you don't have to make a redirection and don't spent time, improving the speed of your website. |
28,997,220 | I have a $\_POST array with a single variable 'listing\_type'. The form submits to a page containing the code below which redirects them to another page with more forms dependent on their initial choice. Is there a slicker way to do this? It works fine but feels clunky...
```
<?php // listing-type.php
if ((isset($_POS... | 2015/03/11 | [
"https://Stackoverflow.com/questions/28997220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1890243/"
] | It's fine except there is no need to have two location calls, and you don't need the else:
```
$url = "index.php";
if ((isset($_POST['listing_type'])) && (!empty($_POST['listing_type']))) {
// Switch statement
}
header("Location: $url");
``` | Here's an alternate using an array:
```
$urls = array("index.php",
"events/new-event.php",
"restaurants/new-restaurant.php",
"bars/new-bar.php",
"attractions/new-attraction.php",);
$url = $urls[!empty($_POST['listing_type']) ? $_POST['listing_type'] : 0];
heade... |
28,997,220 | I have a $\_POST array with a single variable 'listing\_type'. The form submits to a page containing the code below which redirects them to another page with more forms dependent on their initial choice. Is there a slicker way to do this? It works fine but feels clunky...
```
<?php // listing-type.php
if ((isset($_POS... | 2015/03/11 | [
"https://Stackoverflow.com/questions/28997220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1890243/"
] | Here's an alternate using an array:
```
$urls = array("index.php",
"events/new-event.php",
"restaurants/new-restaurant.php",
"bars/new-bar.php",
"attractions/new-attraction.php",);
$url = $urls[!empty($_POST['listing_type']) ? $_POST['listing_type'] : 0];
heade... | Yes, you can do it. I think is a good way, you can improving your code a litle bit but is a good way.
Anyway, I think if you can do it this one with js during sending the form, o perhaps in you html code, you don't have to make a redirection and don't spent time, improving the speed of your website. |
11,447,548 | Where can I find RSA PKCS#1 V2.1 implementation in C++?
I've found an implementation [here](http://code.google.com/p/rsa/), but I'm not sure it fits with that standard.
Can anybody also explain major differences between various implementations of RSA algorithm which may cause inconsistency in action? | 2012/07/12 | [
"https://Stackoverflow.com/questions/11447548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/183652/"
] | The RSA algorithm is a *primitive* you can use for two purposes:
* Confidentiality (that is, public key encryption), or
* Proof of origin (that is, digital signature when combined with a cryptographic hash)
PKCS#1 is **THE** standard mostly everybody refers to nowadays for RSA based encryption and signatures. More in... | Don't use studentware libraries for cryptography. They are ill maintained and likely to cause errors. Use well known cryptographic frameworks such as [Crypto++](http://www.cryptopp.com/) instead. They should claim compatability with standards. You could check if they test against the reference test vectors of the stand... |
40,687,041 | i dont know how to find the index of minimum value in matrix, can you help me? i didnt find anythin on the internet about this
```
def printMatrix(matrix):
for i in matrix:
for j in i:
print(j, end=' ')
print()
m=[ [1, 1, 2, 5, 6, 1] , [5, 6, 8, 5, 6, 7] , [10, 12, 10, 12, 11, 11] , [8, 10... | 2016/11/18 | [
"https://Stackoverflow.com/questions/40687041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7180476/"
] | Use a format the allows for space in unexpected places. And check results.
```
// v v v v v v v v
if (scanf(" a =%lf , b =%lf , c =%lf", &a, &b, &c) == 3) Oh_Happy_day();
```
A space is not *needed* before `"%lf"` as that specifier will scan through leading white-space. Some like to be explicit
```
//... | there is no way to fix this problem; this is actually a problem with the function scanf(); itself. Alternately, you can use fgets(); instead.
try replacing
```
double a=0.,b=0.,c=0.;
printf("Enter a polynomial:\n");
scanf("a=%lf,b=%lf,c=%lf",&a,&b,&c);
```
with
```
double a=0.0,b=0.0,c=0.0;
printf("Enter a polynomi... |
40,687,041 | i dont know how to find the index of minimum value in matrix, can you help me? i didnt find anythin on the internet about this
```
def printMatrix(matrix):
for i in matrix:
for j in i:
print(j, end=' ')
print()
m=[ [1, 1, 2, 5, 6, 1] , [5, 6, 8, 5, 6, 7] , [10, 12, 10, 12, 11, 11] , [8, 10... | 2016/11/18 | [
"https://Stackoverflow.com/questions/40687041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7180476/"
] | Use a format the allows for space in unexpected places. And check results.
```
// v v v v v v v v
if (scanf(" a =%lf , b =%lf , c =%lf", &a, &b, &c) == 3) Oh_Happy_day();
```
A space is not *needed* before `"%lf"` as that specifier will scan through leading white-space. Some like to be explicit
```
//... | Because the space is **not** part of the formatting string you used in scanf.
You should add the leading space in the formatting string:
```
scanf(" a=%lf, b=%lf, c=%lf", &a, &b, &c);
``` |
15,150,719 | I am using Display tag in my jsp file for the use to export the list or table contents. I am alright with exporting all the table details except my caption that i have mentioned..
pls do the needful that how to export my caption in excel or pdf format.
I have pasted my code below..
```
<display:table name="requestSc... | 2013/03/01 | [
"https://Stackoverflow.com/questions/15150719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2122203/"
] | From getting out of this error, u have to add the following jars:
```
commons-beanutils
commons-fileupload-1.0
jakarta-jstl-1.1.2
jakarta-oro
jcl104-over-slf4j-1.4.2
log4j-1.2.13
poi-3.2-FINAL
slf4j-log4j12-1.4.2
struts
displaytag-1.2
displaytag-export-poi1.2
displaytag-portlet-1.2
```
Also u must create a property... | You will be able to export you caption too but to do that you need to give some labor for that.
For any kind of customization (which you don't get normally) you will need to create you own `ExportView` by implementing the `ExportView` interface.
[This answer will give some explanation](https://stackoverflow.com/quest... |
22,087,861 | I have an activity and an asynctask. I want the progress result in the async task to the activity text view and final result in activity text view. Am stuck in final point that how to send result from both `onProgressUpdate()` and `onPostExecute()`. Help me out in solving this issue
**MainActivity.java**
```
public c... | 2014/02/28 | [
"https://Stackoverflow.com/questions/22087861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2816540/"
] | There are two possibilities:
1. Implement the `AsyncTask` as a inner class:
You would be able to access `MainActivity.this` from within `onProgressUpdate()` or `onPostUpdate()`. You would be able to call somthing like this.
```
@Override
protected void onPostExecute(Integer result) {
MainActivity.this.tv.setTe... | What ever you do in onProgressUpdate and onPostUpdate, will be posted directly to UIThread. Just write your logic inside these two functions and you can access any component of UI thread in these two functions. |
18,036,843 | While building a page to serve back to the user, I'd like to submit a background script to do some numerical analysis of data in the database and send the result to the user in an email. This process may take a minute or so, so I don't want to delay the page serve while it runs.
Is there a way to trigger another PHP ... | 2013/08/03 | [
"https://Stackoverflow.com/questions/18036843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1287188/"
] | Have you checked out the example in the [OpenCV doc](http://docs.opencv.org/modules/imgproc/doc/feature_detection.html?highlight=houghline#houghlinesp)? If you use the function `HoughLinesP` you get the 4 coordinates of the lines, so that drawing the lines is quite easy. I copy the example from the doc:
```
vector<Vec... | Regarding your question which point is e end point of a line:
A line is a connection between two points. A point is described through its x,y coordinates.
The HoughLines Detection has as result parameter: vector lines;
Vec4i is a Vector of 4 integers (x1,y1,x2,y2) representing the two points of a line (start point and... |
3,713,523 | Currently I have a section of code that needs to make about 7 web service calls to various providers for data. Each call takes a several seconds to execute, so I would like to run them in parallel to speed things up.
I have wrapped my 7 calls in a Parallel.Invoke which works great at running a couple things at the sam... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3713523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/89593/"
] | >
> but on a 2 core server, it will only execute 2 at a time, one per core
>
>
>
I would question this - Parallel.Invoke will typically run many more tasks than cores in your system.
That being said, if you're using asynchronous method call invocations, I would recommend using [Task.Factory.FromAsync(...)](http:/... | You can specify [`ParallelOptions`](http://msdn.microsoft.com/en-us/library/dd783747.aspx) to increase the concurrency level. The default is reasonable for CPU-bound tasks, but you're dealing with I/O-bound ones, so it makes sense to override that behavior. |
3,713,523 | Currently I have a section of code that needs to make about 7 web service calls to various providers for data. Each call takes a several seconds to execute, so I would like to run them in parallel to speed things up.
I have wrapped my 7 calls in a Parallel.Invoke which works great at running a couple things at the sam... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3713523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/89593/"
] | There's no real need to use `Parallel.Invoke` for this. You can go ahead and issue the multiple asynchronous requests (i.e. `HttpWebRequest.BeginGetResponse()`). As for being notified when they all complete, you have several options. A simple way would be to initialize a [CountdownEvent](http://msdn.microsoft.com/en-us... | You can specify [`ParallelOptions`](http://msdn.microsoft.com/en-us/library/dd783747.aspx) to increase the concurrency level. The default is reasonable for CPU-bound tasks, but you're dealing with I/O-bound ones, so it makes sense to override that behavior. |
3,713,523 | Currently I have a section of code that needs to make about 7 web service calls to various providers for data. Each call takes a several seconds to execute, so I would like to run them in parallel to speed things up.
I have wrapped my 7 calls in a Parallel.Invoke which works great at running a couple things at the sam... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3713523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/89593/"
] | >
> but on a 2 core server, it will only execute 2 at a time, one per core
>
>
>
I would question this - Parallel.Invoke will typically run many more tasks than cores in your system.
That being said, if you're using asynchronous method call invocations, I would recommend using [Task.Factory.FromAsync(...)](http:/... | There's no real need to use `Parallel.Invoke` for this. You can go ahead and issue the multiple asynchronous requests (i.e. `HttpWebRequest.BeginGetResponse()`). As for being notified when they all complete, you have several options. A simple way would be to initialize a [CountdownEvent](http://msdn.microsoft.com/en-us... |
3,713,523 | Currently I have a section of code that needs to make about 7 web service calls to various providers for data. Each call takes a several seconds to execute, so I would like to run them in parallel to speed things up.
I have wrapped my 7 calls in a Parallel.Invoke which works great at running a couple things at the sam... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3713523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/89593/"
] | >
> but on a 2 core server, it will only execute 2 at a time, one per core
>
>
>
I would question this - Parallel.Invoke will typically run many more tasks than cores in your system.
That being said, if you're using asynchronous method call invocations, I would recommend using [Task.Factory.FromAsync(...)](http:/... | I'm going to copy [a response that I made to another question](https://stackoverflow.com/questions/3046061/practical-differences-between-using-tpl-and-async-pattern/3695211#3695211) verbatim because it's equally, if not more, applicable here.
---
You simply cannot beat the Asynchronous Programming Model (APM) when it... |
3,713,523 | Currently I have a section of code that needs to make about 7 web service calls to various providers for data. Each call takes a several seconds to execute, so I would like to run them in parallel to speed things up.
I have wrapped my 7 calls in a Parallel.Invoke which works great at running a couple things at the sam... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3713523",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/89593/"
] | There's no real need to use `Parallel.Invoke` for this. You can go ahead and issue the multiple asynchronous requests (i.e. `HttpWebRequest.BeginGetResponse()`). As for being notified when they all complete, you have several options. A simple way would be to initialize a [CountdownEvent](http://msdn.microsoft.com/en-us... | I'm going to copy [a response that I made to another question](https://stackoverflow.com/questions/3046061/practical-differences-between-using-tpl-and-async-pattern/3695211#3695211) verbatim because it's equally, if not more, applicable here.
---
You simply cannot beat the Asynchronous Programming Model (APM) when it... |
571,918 | One of the examples that shows that Newtonian mechanics is non-deterministic is that of a "space invader" ([see here](https://plato.stanford.edu/entries/determinism-causal/#ClaMec)) which comes in from an infinite distance at a given time (or with time reversed, shoots off to an infinite distance in finite time):
[![e... | 2020/08/08 | [
"https://physics.stackexchange.com/questions/571918",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/162720/"
] | This issue is interesting to me. Here a subtle point with the notion of *determinism* in *classical physics* shows up. There are two distinct notions.
1. Determinism means that if we know positions and velocities of all material points of a system at time $t\_0$ (with respect to some reference frame), and we know the ... | The energy is conserved (until the singularity).
Note, however, that it is not easy to construct a system in which the action of the forces will create such a singularity. This was an open problem (posed by Painlevé and Poincaré) for a very long time. It was solved in [this paper](https://www.jstor.org/stable/2946572?... |
2,738,303 | I currently use Cufon accross our site with something similar to `Cufon.set('fontFamily', 'DIN Medium').replace('h1');` Now for a single H1 tag i would like Cufon to be disabled, this is without changing the H1 tag to any other tag, it must remain as it is.
I can add classes etc to the H1 tag if required, and can do a... | 2010/04/29 | [
"https://Stackoverflow.com/questions/2738303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/104934/"
] | Depending on which selector engine you use, you can:
* add a class to your exception h1 element
* you can use the :not selector to only apply cufon to the h1's that don't have the aforementioned class (with jQuery and classname 'clean' it would be something like `Cufon.replace('h1:not(.clean)');` | by single h1 you mean?
```
$('h1').each(function(){
if($(this).siblings('h1').length)
Cufon.set('fontFamily', 'DIN Medium').replace(this);
});
``` |
2,738,303 | I currently use Cufon accross our site with something similar to `Cufon.set('fontFamily', 'DIN Medium').replace('h1');` Now for a single H1 tag i would like Cufon to be disabled, this is without changing the H1 tag to any other tag, it must remain as it is.
I can add classes etc to the H1 tag if required, and can do a... | 2010/04/29 | [
"https://Stackoverflow.com/questions/2738303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/104934/"
] | ```
function remove_cufon(selector) {
$(selector).html( cufon_text(selector) );
return true;
}
function cufon_text(selector) {
var g = '';
$(selector +' cufon cufontext').each(function() {
g = g + $(this).html();
});
return $.trim(g);
}
```
Usage:
```
remove_cufon('#name');
``` | by single h1 you mean?
```
$('h1').each(function(){
if($(this).siblings('h1').length)
Cufon.set('fontFamily', 'DIN Medium').replace(this);
});
``` |
2,738,303 | I currently use Cufon accross our site with something similar to `Cufon.set('fontFamily', 'DIN Medium').replace('h1');` Now for a single H1 tag i would like Cufon to be disabled, this is without changing the H1 tag to any other tag, it must remain as it is.
I can add classes etc to the H1 tag if required, and can do a... | 2010/04/29 | [
"https://Stackoverflow.com/questions/2738303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/104934/"
] | Using jQuery: Use the css class to h1 and specify in the selector...
```
$('h1.noCufon').each(function(){
var cufonText = '';
$('cufontext',$(this)).each(function(){
cufonText+=$(this).html();
});
if(cufonText!=''){
$(this).html(cufonText);
}
})
``` | by single h1 you mean?
```
$('h1').each(function(){
if($(this).siblings('h1').length)
Cufon.set('fontFamily', 'DIN Medium').replace(this);
});
``` |
2,738,303 | I currently use Cufon accross our site with something similar to `Cufon.set('fontFamily', 'DIN Medium').replace('h1');` Now for a single H1 tag i would like Cufon to be disabled, this is without changing the H1 tag to any other tag, it must remain as it is.
I can add classes etc to the H1 tag if required, and can do a... | 2010/04/29 | [
"https://Stackoverflow.com/questions/2738303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/104934/"
] | Depending on which selector engine you use, you can:
* add a class to your exception h1 element
* you can use the :not selector to only apply cufon to the h1's that don't have the aforementioned class (with jQuery and classname 'clean' it would be something like `Cufon.replace('h1:not(.clean)');` | ```
function remove_cufon(selector) {
$(selector).html( cufon_text(selector) );
return true;
}
function cufon_text(selector) {
var g = '';
$(selector +' cufon cufontext').each(function() {
g = g + $(this).html();
});
return $.trim(g);
}
```
Usage:
```
remove_cufon('#name');
``` |
2,738,303 | I currently use Cufon accross our site with something similar to `Cufon.set('fontFamily', 'DIN Medium').replace('h1');` Now for a single H1 tag i would like Cufon to be disabled, this is without changing the H1 tag to any other tag, it must remain as it is.
I can add classes etc to the H1 tag if required, and can do a... | 2010/04/29 | [
"https://Stackoverflow.com/questions/2738303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/104934/"
] | Depending on which selector engine you use, you can:
* add a class to your exception h1 element
* you can use the :not selector to only apply cufon to the h1's that don't have the aforementioned class (with jQuery and classname 'clean' it would be something like `Cufon.replace('h1:not(.clean)');` | Using jQuery: Use the css class to h1 and specify in the selector...
```
$('h1.noCufon').each(function(){
var cufonText = '';
$('cufontext',$(this)).each(function(){
cufonText+=$(this).html();
});
if(cufonText!=''){
$(this).html(cufonText);
}
})
``` |
2,738,303 | I currently use Cufon accross our site with something similar to `Cufon.set('fontFamily', 'DIN Medium').replace('h1');` Now for a single H1 tag i would like Cufon to be disabled, this is without changing the H1 tag to any other tag, it must remain as it is.
I can add classes etc to the H1 tag if required, and can do a... | 2010/04/29 | [
"https://Stackoverflow.com/questions/2738303",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/104934/"
] | ```
function remove_cufon(selector) {
$(selector).html( cufon_text(selector) );
return true;
}
function cufon_text(selector) {
var g = '';
$(selector +' cufon cufontext').each(function() {
g = g + $(this).html();
});
return $.trim(g);
}
```
Usage:
```
remove_cufon('#name');
``` | Using jQuery: Use the css class to h1 and specify in the selector...
```
$('h1.noCufon').each(function(){
var cufonText = '';
$('cufontext',$(this)).each(function(){
cufonText+=$(this).html();
});
if(cufonText!=''){
$(this).html(cufonText);
}
})
``` |
54,743,078 | A quick thought experiment before getting to the question. Imagine someone is implementing std::malloc (say, one of the JEMalloc or TCMalloc folks). One of the very basic things they would need is the ability to know that the program will not call back into malloc once execution has entered the implementation of std::m... | 2019/02/18 | [
"https://Stackoverflow.com/questions/54743078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5501675/"
] | The implementation is required to use a signal-safe allocator for its stack frames. This follows from the fact that function calls (to non-library functions) in signal handlers are permitted. The implementation can use `malloc` or `operator new`, but only if those allocators are themselves signal-safe. | Under the logic of the C++ Standard, the implementation is considered as a whole. In particular, any part of an implementation may assume anything about any other part of the implementation.
That means for this question that `std::malloc` and the signal handler may assume things about each other. Some implementations... |
60,298,504 | I created a controller that returns a pdf, my problem is that I can't recall it from javascript, by pressing the button with the click action.
I have tried with ajax.rpc and rpc.query but to no avail. If I go to the url I can download the file.
Is there any way to get the file that the controller returns? | 2020/02/19 | [
"https://Stackoverflow.com/questions/60298504",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9850681/"
] | Looks like you never actually installed pytest.
Try adding a *pip install* to your pytest section:
```
- name: Test with pytest
run: |
pip install pytest
pytest
``` | Why not learning from how pytest is doing itself? Most python projects use tox as an orchestrator for running tests in various environments, including pytest.
This is an important aspect because you do not want to build-up too much code inside your github actions which are useless for local testing. tox works with bot... |
7,932,418 | I'm developing C++ with Visual Studio 2010. How is code stepping designed to deal with creation of new threads?
If I am stepping through code and I spawn a new thread with `CreateThread()`, will I enter that thread? If not, why not?
**Edit:**
I am getting unpredictable results, even with breakpoints in the thread fun... | 2011/10/28 | [
"https://Stackoverflow.com/questions/7932418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264970/"
] | This depends.
If the method called by `CreateThread` ever hits a breakpoint while you are stepping through the code that called `CreateThread` then the debugger will switch to that breakpoint and thread. From then on (until you hit F5 again) doing step over instructions (F10) will occasionally alternate between the or... | No I do not think so. You will continue on the current thread until a breakpoint is hit in the other thread. |
7,932,418 | I'm developing C++ with Visual Studio 2010. How is code stepping designed to deal with creation of new threads?
If I am stepping through code and I spawn a new thread with `CreateThread()`, will I enter that thread? If not, why not?
**Edit:**
I am getting unpredictable results, even with breakpoints in the thread fun... | 2011/10/28 | [
"https://Stackoverflow.com/questions/7932418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264970/"
] | No I do not think so. You will continue on the current thread until a breakpoint is hit in the other thread. | The execution will continue in the current thread until a breakpoint is hit. This breakpoint can be in a separate thread and execution will continue in that thread following the same rule. |
7,932,418 | I'm developing C++ with Visual Studio 2010. How is code stepping designed to deal with creation of new threads?
If I am stepping through code and I spawn a new thread with `CreateThread()`, will I enter that thread? If not, why not?
**Edit:**
I am getting unpredictable results, even with breakpoints in the thread fun... | 2011/10/28 | [
"https://Stackoverflow.com/questions/7932418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264970/"
] | No I do not think so. You will continue on the current thread until a breakpoint is hit in the other thread. | No, you are not calling your thread method directly (that would defeat the purpose of the thread). You are requesting that the runtime execute your thread function in parallel with the current thread, starting as soon as possible.
If you don't have predefined breakpoints in all threads, I have seen MS debuggers bounce... |
7,932,418 | I'm developing C++ with Visual Studio 2010. How is code stepping designed to deal with creation of new threads?
If I am stepping through code and I spawn a new thread with `CreateThread()`, will I enter that thread? If not, why not?
**Edit:**
I am getting unpredictable results, even with breakpoints in the thread fun... | 2011/10/28 | [
"https://Stackoverflow.com/questions/7932418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264970/"
] | No I do not think so. You will continue on the current thread until a breakpoint is hit in the other thread. | >
> If I am stepping through code and I spawn a new thread with CreateThread(), will I enter that thread?
>
>
>
No, single stepping means you're stepping through the execution context of a particular thread. The debugger has several ways to switch which thread you're viewing. There's a Threads window which shows y... |
7,932,418 | I'm developing C++ with Visual Studio 2010. How is code stepping designed to deal with creation of new threads?
If I am stepping through code and I spawn a new thread with `CreateThread()`, will I enter that thread? If not, why not?
**Edit:**
I am getting unpredictable results, even with breakpoints in the thread fun... | 2011/10/28 | [
"https://Stackoverflow.com/questions/7932418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264970/"
] | This depends.
If the method called by `CreateThread` ever hits a breakpoint while you are stepping through the code that called `CreateThread` then the debugger will switch to that breakpoint and thread. From then on (until you hit F5 again) doing step over instructions (F10) will occasionally alternate between the or... | The execution will continue in the current thread until a breakpoint is hit. This breakpoint can be in a separate thread and execution will continue in that thread following the same rule. |
7,932,418 | I'm developing C++ with Visual Studio 2010. How is code stepping designed to deal with creation of new threads?
If I am stepping through code and I spawn a new thread with `CreateThread()`, will I enter that thread? If not, why not?
**Edit:**
I am getting unpredictable results, even with breakpoints in the thread fun... | 2011/10/28 | [
"https://Stackoverflow.com/questions/7932418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264970/"
] | This depends.
If the method called by `CreateThread` ever hits a breakpoint while you are stepping through the code that called `CreateThread` then the debugger will switch to that breakpoint and thread. From then on (until you hit F5 again) doing step over instructions (F10) will occasionally alternate between the or... | No, you are not calling your thread method directly (that would defeat the purpose of the thread). You are requesting that the runtime execute your thread function in parallel with the current thread, starting as soon as possible.
If you don't have predefined breakpoints in all threads, I have seen MS debuggers bounce... |
7,932,418 | I'm developing C++ with Visual Studio 2010. How is code stepping designed to deal with creation of new threads?
If I am stepping through code and I spawn a new thread with `CreateThread()`, will I enter that thread? If not, why not?
**Edit:**
I am getting unpredictable results, even with breakpoints in the thread fun... | 2011/10/28 | [
"https://Stackoverflow.com/questions/7932418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264970/"
] | This depends.
If the method called by `CreateThread` ever hits a breakpoint while you are stepping through the code that called `CreateThread` then the debugger will switch to that breakpoint and thread. From then on (until you hit F5 again) doing step over instructions (F10) will occasionally alternate between the or... | >
> If I am stepping through code and I spawn a new thread with CreateThread(), will I enter that thread?
>
>
>
No, single stepping means you're stepping through the execution context of a particular thread. The debugger has several ways to switch which thread you're viewing. There's a Threads window which shows y... |
34,287,522 | In `tcl` I am giving this as:-
```
set promptInfo [oBOTANDROID2 launchVapiEiCmd getinfo]
```
and getting the output as"-
`VAPIEI Cmd Rcvd: {state inservice} {type dmc} {description {BOTSP2,10.77.41.154,tcp;(dmc)}} {lines 2} {calls 2} {streams 4} {{primary cm} 10.77.41.11} {{backup cm} } {status {}} {id dmc2} {useri... | 2015/12/15 | [
"https://Stackoverflow.com/questions/34287522",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4315510/"
] | You can leverage the following code:
```
set a {VAPIEI Cmd Rcvd: {state inservice} {type dmc} {description {BOTSP2,10.77.41.154,tcp;(dmc)}} {lines 2} {calls 2} {streams 4} {{primary cm} 10.77.41.11} {{backup cm} } {status {}} {id dmc2} {userid } {{last error} {}} {{delay offer} false} {{Voice Mail client status} {inac... | The output you are getting can very well be interpreted as a Tcl list, and thus you can use [`lsearch`](https://www.tcl.tk/man/tcl/TclCmd/lsearch.htm):
```
% lsearch -regexp -inline $promptInfo "BOTSP2"
description {BOTSP2,10.77.41.154,tcp;(dmc)}
% lsearch -regexp -inline $promptInfo "ipv4address"
{ipv4address} {10.77... |
23,109 | I have to admit I don't fully understand the Bitcoin protocol. But from what I do understand, transactions are traceable -- it is the main reason decentralization works: the world can watch and confirm that a transaction is legit.
Why then can't we observe when a thief tries to cash out or otherwise exchange a Bitcoin... | 2014/03/05 | [
"https://bitcoin.stackexchange.com/questions/23109",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/5290/"
] | Transactions can occur very quickly and the stolen coins can exchange hands, split up and be mixed with other coins multiple times before the theft is discovered. Many innocent parties (whether it is merchants, exchanges or other individuals) could be affected. Who is going to be holding the bag? | I want to comment this 7 years later. In the meantime it's not difficult anymore to trace bitcoin to exchanges in the most cases. It doesn't mean that people get the stolen coins back. But it's not a question of possibilities, it's a question of too few specialists able to do so.
Successfull scammers have to manage a l... |
23,109 | I have to admit I don't fully understand the Bitcoin protocol. But from what I do understand, transactions are traceable -- it is the main reason decentralization works: the world can watch and confirm that a transaction is legit.
Why then can't we observe when a thief tries to cash out or otherwise exchange a Bitcoin... | 2014/03/05 | [
"https://bitcoin.stackexchange.com/questions/23109",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/5290/"
] | you can't trace stolen bitcoins. when you move the stolen bitcoins into exchange and say exchange into dogecoin or litecoin then exchange back to bitcoins then everything would screwed all up, it's untraceable. also exchange like btc-e or bter which are not base in the u.s so the u.s can't do anything or even try to cl... | I want to comment this 7 years later. In the meantime it's not difficult anymore to trace bitcoin to exchanges in the most cases. It doesn't mean that people get the stolen coins back. But it's not a question of possibilities, it's a question of too few specialists able to do so.
Successfull scammers have to manage a l... |
23,109 | I have to admit I don't fully understand the Bitcoin protocol. But from what I do understand, transactions are traceable -- it is the main reason decentralization works: the world can watch and confirm that a transaction is legit.
Why then can't we observe when a thief tries to cash out or otherwise exchange a Bitcoin... | 2014/03/05 | [
"https://bitcoin.stackexchange.com/questions/23109",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/5290/"
] | The answer to the first question about why stolen bitcoins can not be easily traced like regular bitcoin transactions. This is because the exchanges like btc-e magically move the coins so that tracing becomes impossible. For example yesterday I moved 15 dollars worth of bitcoins in to btc-e and traded it to litecoins, ... | I want to comment this 7 years later. In the meantime it's not difficult anymore to trace bitcoin to exchanges in the most cases. It doesn't mean that people get the stolen coins back. But it's not a question of possibilities, it's a question of too few specialists able to do so.
Successfull scammers have to manage a l... |
23,109 | I have to admit I don't fully understand the Bitcoin protocol. But from what I do understand, transactions are traceable -- it is the main reason decentralization works: the world can watch and confirm that a transaction is legit.
Why then can't we observe when a thief tries to cash out or otherwise exchange a Bitcoin... | 2014/03/05 | [
"https://bitcoin.stackexchange.com/questions/23109",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/5290/"
] | Several great reasons: (1) off chain transactions do not have a public ledger (2) tumbling - repeatedly moving through different addresses quickly makes tracking difficult (3) fragmenting - your BTC gets broken up into tiny tiny pieces and spread around (4) TOR or similar IP hiding can cloak the owner of an address (5)... | I want to comment this 7 years later. In the meantime it's not difficult anymore to trace bitcoin to exchanges in the most cases. It doesn't mean that people get the stolen coins back. But it's not a question of possibilities, it's a question of too few specialists able to do so.
Successfull scammers have to manage a l... |
2,656,985 | I'm not sure, that my steps are valid, so $ln(f(x))=ln \cdot (2 \cdot ln(x))^{x/2}=x^{2} \cdot ln \cdot(ln(x))$ so I get $\frac{1}{f(x)} \cdot f'(x)$ and I have to multiply both sides with $f(x)$, am I right? | 2018/02/19 | [
"https://math.stackexchange.com/questions/2656985",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/188749/"
] | apply $$e^{x}$$ to both side you will have:
$$e^{f^{}(x)}=e^{2(x/2)lnx}=e^{x}.e^{lnx}=e^{x}.x$$. now get derevative from both side:
$$e^{f^{}(x)}.f^{′}(x)=e^{x}x+e^{x}$$
$$f^{′}(x)=e^{-f(x)}(e^{x}x+e^{x})$$
$$f^{′}(x)=e^{-2lnx^{x/2}}(e^{x}x+e^{x})$$ | **HINT**
Let consider
$$2 (\ln (x))^{x/2}=2e^{(x/2)\ln x}$$
then use
$$(e^{f(x)})'=e^{f(x)}f'(x)$$ |
22,475,658 | I'm quite new to programming so I'm trying to learn good programming practices now from the start, I have a question regarding classes and source files in C#. Is the convention to always define each class in a seperate source file? Or is it dependant on the inheritance of the class? Let's say I have `Class Vehicle`, `C... | 2014/03/18 | [
"https://Stackoverflow.com/questions/22475658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3205941/"
] | The convention is to create separate file for each class. | Having known what @Ehsan says, you can then use the same `namespace` for any one hierarchy of inheritance and thus different `namespaces` for different hierarchies to distinguish between the parent classes or interfaces.
e.g.
Hierarchy 1:
```
Interface1
|- class1
|- class2
```
For this hierarchy, you can set name... |
19,381,009 | I have used the following code to get the response from .Net web service(asmx).
```
try{
SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet =true;
AndroidHttpTransport httpTransport ... | 2013/10/15 | [
"https://Stackoverflow.com/questions/19381009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1142397/"
] | Try :
```
SoapObject result = (SoapObject)envelope.bodyIn;
String Result = result.getProperty(0).toString();
``` | The result like a multidimension array. You need parse the result until you get the last element: `Result=Assigned;`
First time: (`array` with 2 elements)
```
SoapObject result = (SoapObject)envelope.bodyIn;
SoapObject first = (SoapObject) result.getProperty(0);
```
you will get as your comment:
>
> anyType{schem... |
4,359,504 | I'm very confused about minimal sets, particularly with graphs. According to Wolfram Mathworld, a [minimal set](https://mathworld.wolfram.com/MinimalSet.html) is "a member set that is not a proper subset of another member set is called a minimal set." However I'm confused because doesn't that mean that it can contain p... | 2022/01/18 | [
"https://math.stackexchange.com/questions/4359504",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/990727/"
] | "Minimality" (or dually, "maximality") is usually spoken of with respect to certain properties. For instance, in topology: a set $A$ has closure $\mathrm{cl}({A})$ which can be defined to be the smallest closed set containing $A$. Sometimes we even write this formally as an intersection:
$$\mathrm{cl}({A}) = \bigcap \... | The term "minimal" is defined only with respect to some ordering. It refers to a member for which there is no smaller member, where "smaller" is defined in terms of that order. Given the set $\{2,3,4,5,6,7,8,9\}$, $2$ is the sole minimal number given the ordinary order. However, if we use the order of "can divide", the... |
4,359,504 | I'm very confused about minimal sets, particularly with graphs. According to Wolfram Mathworld, a [minimal set](https://mathworld.wolfram.com/MinimalSet.html) is "a member set that is not a proper subset of another member set is called a minimal set." However I'm confused because doesn't that mean that it can contain p... | 2022/01/18 | [
"https://math.stackexchange.com/questions/4359504",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/990727/"
] | You are right to be confused. "Proper subset" should read "proper superset" for [Minimal Set](https://mathworld.wolfram.com/MinimalSet.html), [Minimal Dominating Set](http://mathworld.wolfram.com/MinimalDominatingSet.html), [Minimal Vertex Cover](https://mathworld.wolfram.com/MinimalVertexCover.html), and [Minimal Edge... | The term "minimal" is defined only with respect to some ordering. It refers to a member for which there is no smaller member, where "smaller" is defined in terms of that order. Given the set $\{2,3,4,5,6,7,8,9\}$, $2$ is the sole minimal number given the ordinary order. However, if we use the order of "can divide", the... |
15,359 | Regarding this command:
```
f{char} To [count]'th occurrence of {char} to the right. The
cursor is placed on {char} |inclusive|.
{char} can be entered as a digraph |digraph-arg|.
When 'encoding' is set to Unicode, composing
... | 2018/02/26 | [
"https://vi.stackexchange.com/questions/15359",
"https://vi.stackexchange.com",
"https://vi.stackexchange.com/users/7960/"
] | this is not the expected behavior - perhaps you have something mapped in such a way that it causes this behavior.
try starting vim using
vim -u /dev/null -U /dev/null --noplugin
then, assuming the expected behavior, you can divide and conquer in your .vimrc, .gvimrc and plugins. | Try to paste the copied lines with `P` instead of `p`
For example, duplicate all lines: `ggVG` `y` `P` works for me.
If I use `p`, it only duplicates the first line, not sure why.
I am using the Vim extension in VSCode, could it be a reason why? |
15,359 | Regarding this command:
```
f{char} To [count]'th occurrence of {char} to the right. The
cursor is placed on {char} |inclusive|.
{char} can be entered as a digraph |digraph-arg|.
When 'encoding' is set to Unicode, composing
... | 2018/02/26 | [
"https://vi.stackexchange.com/questions/15359",
"https://vi.stackexchange.com",
"https://vi.stackexchange.com/users/7960/"
] | I had this issue as well. My problem is that I was using `yy` to yank the lines instead of just a single `y`.
Highlighting a block and then hitting `yy` followed by `p` where I wanted to paste reproduced this problem (ie only pasted two lines).
Again, the fix is to only use a single `y` after selecting with `V`, and ... | Try to paste the copied lines with `P` instead of `p`
For example, duplicate all lines: `ggVG` `y` `P` works for me.
If I use `p`, it only duplicates the first line, not sure why.
I am using the Vim extension in VSCode, could it be a reason why? |
25,529,309 | I have a `C` Program that generate or fill vector of char with a string like :
```
.........................
char value[160]
double* d = NULL;
char * pEnd = NULL;
......................................
```
After filling value with for rx: 551.54 455.61 98
I would to get this double value ,
here what I've tried ... | 2014/08/27 | [
"https://Stackoverflow.com/questions/25529309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1563123/"
] | You need to allocate space for `d`.
Try
```
double d[3] = {0}; // double *d = NULL;
```
If you want to keep using `d` as a pointer, allocate space before assigning
```
double *d = NULL;
d = malloc(3 * sizeof *d);
if (d != NULL) {
// ... your code using d
free(d);
} else {
fprintf(stderr, "Unable to all... | Neither `d` nor `pEnd` appears to have been allocated. Also, you've initialized `i` to `o`, which if it isn't a typo (for `0`?), is an undeclared variable (which would prevent your code form compiling). |
25,529,309 | I have a `C` Program that generate or fill vector of char with a string like :
```
.........................
char value[160]
double* d = NULL;
char * pEnd = NULL;
......................................
```
After filling value with for rx: 551.54 455.61 98
I would to get this double value ,
here what I've tried ... | 2014/08/27 | [
"https://Stackoverflow.com/questions/25529309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1563123/"
] | You need to allocate space for `d`.
Try
```
double d[3] = {0}; // double *d = NULL;
```
If you want to keep using `d` as a pointer, allocate space before assigning
```
double *d = NULL;
d = malloc(3 * sizeof *d);
if (d != NULL) {
// ... your code using d
free(d);
} else {
fprintf(stderr, "Unable to all... | Note this-
```
char * pEnd = = NULL; // you should not use '==' here
```
First fix this to-
```
char * pEnd = NULL;
```
Then try to allocate memory for `d` and `pEnd` and try it. |
15,798,411 | I've got two binary files. They look something like this, but the data is more random:
File A:
```
FF FF FF FF 00 00 00 00 FF FF 44 43 42 41 FF FF ...
```
File B:
```
41 42 43 44 00 00 00 00 44 43 42 41 40 39 38 37 ...
```
What I'd like is to call something like:
```
>>> someDiffLib.diff(file_a_data, file_b_dat... | 2013/04/03 | [
"https://Stackoverflow.com/questions/15798411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/184068/"
] | You can use [`itertools.groupby()`](http://docs.python.org/3.3/library/itertools.html#itertools.groupby) for this, here is an example:
```
from itertools import groupby
# this just sets up some byte strings to use, Python 2.x version is below
# instead of this you would use f1 = open('some_file', 'rb').read()
f1 = by... | The provided `itertools.groupby` [solution](https://stackoverflow.com/a/15798718/2789762) works fine, but it's pretty slow.
I wrote a pretty naive attempt using `numpy` and tested it versus the other solution on a particular 16MB file I happened to have, and it was about 42x faster on my machine. Someone familiar with... |
19,268,625 | How do I configure Excel to open a new instance of Excel each time I open an existing spreadsheet. I am using Office 2010 on Windows 7. | 2013/10/09 | [
"https://Stackoverflow.com/questions/19268625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/995364/"
] | To resolve this, go to 'excel options' > click on the 'advanced' tab > scroll down to general > check the ignore other applications that use 'Dyanamic Data Exchange (DDE)' | Freddy, in some cases this does not work. It comes up with error dialog box and sheets cannot be opened. Suppose it might depend on LAN configuration among other things.
Elsewhere on web there are instructions about changing registry but if you on a locked down LAN you have to resort to opening separate Excel from des... |
19,268,625 | How do I configure Excel to open a new instance of Excel each time I open an existing spreadsheet. I am using Office 2010 on Windows 7. | 2013/10/09 | [
"https://Stackoverflow.com/questions/19268625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/995364/"
] | To resolve this, go to 'excel options' > click on the 'advanced' tab > scroll down to general > check the ignore other applications that use 'Dyanamic Data Exchange (DDE)' | File > Options > Advanced > General > [CHECK] Ignore other applications that use Dynamic Data Exchange (DDE) > OK
Opening new Excel files will now open a new instance each time. |
19,268,625 | How do I configure Excel to open a new instance of Excel each time I open an existing spreadsheet. I am using Office 2010 on Windows 7. | 2013/10/09 | [
"https://Stackoverflow.com/questions/19268625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/995364/"
] | Freddy, in some cases this does not work. It comes up with error dialog box and sheets cannot be opened. Suppose it might depend on LAN configuration among other things.
Elsewhere on web there are instructions about changing registry but if you on a locked down LAN you have to resort to opening separate Excel from des... | File > Options > Advanced > General > [CHECK] Ignore other applications that use Dynamic Data Exchange (DDE) > OK
Opening new Excel files will now open a new instance each time. |
50,426 | I run a coupons and deals website in a niche market, and I'm in the process of adding a questions and answers section to it.
Based on my research, I found popular websites that use either subdomains or subdirectories for the Q & A forum section of their site. What I want to know is, which is a better option, and if t... | 2013/07/05 | [
"https://webmasters.stackexchange.com/questions/50426",
"https://webmasters.stackexchange.com",
"https://webmasters.stackexchange.com/users/29400/"
] | Subdomains do make it a little clearer for users which part of the site they're on (apart from breadcrumbs). For example, compare:
`answers.example.com`
with:
`example.com/answers/`
With Google, you won't see any advantage in SEO with one over the other as of late. See this for more about that: [Subdomains vs. subd... | You should use a subdirectory rather if you want the SEO benefits for your main domain, and if the keywords you have in your Q & A will bring you the right traffic.
Because subdomains are now seen as seperate domains by Google, you will have no SERP benefit to your main domain from your subdomain.
If the content and p... |
171,705 | I have a small MVC framework I've been working on. It's code base definitely isn't big, but it's not longer just a couple of classes. I finally decided to take the plunge and start writing tests for it(yes, I know I should've been doing that all along, but it's API was super unstable up until now)
Anyway, my plan is t... | 2012/10/29 | [
"https://softwareengineering.stackexchange.com/questions/171705",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/483/"
] | What is important in any test strategy, is Test Coverage - ie being able to show that all functionality is being tested.
I general, and unless you have specific requirements to the contrary (eg DO178 Level A, IEC61508 SIL 4 etc) which does not appear to be the case in your situation, then if you can test the full func... | When I have small projects I just pop all the tests into the same project. Since a bigger project would have these split I just ensure that it would be possible to tease them apart should it be necessary.
With unit tests I typically only test one class (SUT) in a file. |
171,705 | I have a small MVC framework I've been working on. It's code base definitely isn't big, but it's not longer just a couple of classes. I finally decided to take the plunge and start writing tests for it(yes, I know I should've been doing that all along, but it's API was super unstable up until now)
Anyway, my plan is t... | 2012/10/29 | [
"https://softwareengineering.stackexchange.com/questions/171705",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/483/"
] | **Integration vs. unit tests**
You should keep your unit tests and your integration tests completely separated. Your unit tests should test one thing and one thing only and in complete isolation of the rest of your system. A unit is loosely defined but it usually boils down to a method or a function.
It makes sense ... | When I have small projects I just pop all the tests into the same project. Since a bigger project would have these split I just ensure that it would be possible to tease them apart should it be necessary.
With unit tests I typically only test one class (SUT) in a file. |
171,705 | I have a small MVC framework I've been working on. It's code base definitely isn't big, but it's not longer just a couple of classes. I finally decided to take the plunge and start writing tests for it(yes, I know I should've been doing that all along, but it's API was super unstable up until now)
Anyway, my plan is t... | 2012/10/29 | [
"https://softwareengineering.stackexchange.com/questions/171705",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/483/"
] | **Integration vs. unit tests**
You should keep your unit tests and your integration tests completely separated. Your unit tests should test one thing and one thing only and in complete isolation of the rest of your system. A unit is loosely defined but it usually boils down to a method or a function.
It makes sense ... | What is important in any test strategy, is Test Coverage - ie being able to show that all functionality is being tested.
I general, and unless you have specific requirements to the contrary (eg DO178 Level A, IEC61508 SIL 4 etc) which does not appear to be the case in your situation, then if you can test the full func... |
20,779,245 | Am writing an Android App where am generating a PDF. On clicking a button, PDF generation is done. But even after the PDF is completely generated and the method returns, the button remains in highlighted (blue) state. I even tried mentioning 'button.clearFocus()' at the end of the method which generates the PDF, but in... | 2013/12/26 | [
"https://Stackoverflow.com/questions/20779245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2903200/"
] | Each framework is really just a directory - not even like a package directory, but a plain directory you can browse directly into with Finder. Go into the .framework folder, at the top level you'll find a file with the same name as the framework (for older frameworks that file may be located under a folder called `Vers... | Check below command in Terminal
`lipo -info yourlib.a`
Output like :
`Architectures in the fat file: yourlib.a are: i386 x86_64 armv7 arm64`
In case Framework.framework
Go to inside framework like below
`cd /Your_Path_/CocoaLumberjack.framework`
then run command
`lipo -info CocoaLumberjack` |
5,965,580 | In my app, when I click on a text field, the keyboard hides it. Please help me -- how can I move my view up when I click on the text field. I'm using this code in `textFieldDidBeginEditing:`
```
self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 216, 0);
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, ... | 2011/05/11 | [
"https://Stackoverflow.com/questions/5965580",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1014728/"
] | You should not trust `textFieldDidBeginEditing:` to adjust for the keyboard, since this method will be called even if the user is typing using a physical keyboard where an onscreen keyboard will not be displayed.
Instead listen to the `UIKeyboardWillShowNotification`, that is only triggered when the keyboard will actu... | You can do the following, but first make sure you've set the UITextField delegate to your self and
```
#define kOFFSET_FOR_KEYBOARD 350;
```
at the top. This is how far you want the view to be shifted
```
//method to move the view up/down whenever the keyboard is shown/dismissed
-(void)setViewMovedUp:(BOOL)movedU... |
5,823,229 | i'm struggling to compare user input with the file contents. Basically i created a function that updates employee details that first prompts for the name of the employee and then it compares the name entered with those in the file. I tried doing this:
```
void update(EMPLOYEE *details)
{
FILE *file;
char searc... | 2011/04/28 | [
"https://Stackoverflow.com/questions/5823229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/728970/"
] | You are comparing a single character, `search` with (I assume) an entire string, `details->name`.
The method signature for [`strcmp`](http://www.cplusplus.com/reference/clibrary/cstring/strcmp/) is:
```
int strcmp (const char *str1, const char *str2);
```
You are calling it as:
```
int strcmp (const char str1, con... | `strcmp` takes a string (`char *`) not a single letter. As others have mentioned in the comments, you need to update the `getc` process to read more than the single letter. |
5,823,229 | i'm struggling to compare user input with the file contents. Basically i created a function that updates employee details that first prompts for the name of the employee and then it compares the name entered with those in the file. I tried doing this:
```
void update(EMPLOYEE *details)
{
FILE *file;
char searc... | 2011/04/28 | [
"https://Stackoverflow.com/questions/5823229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/728970/"
] | `strcmp` takes a string (`char *`) not a single letter. As others have mentioned in the comments, you need to update the `getc` process to read more than the single letter. | a hint:
```
EMPLOYEE fileData;
while ( fread( &fileData, sizeof( fileData ), 1, file ) == sizeof( fileData )
{
...
}
```
EDIT: changed read to fread since it is a FILE\*
hth |
5,823,229 | i'm struggling to compare user input with the file contents. Basically i created a function that updates employee details that first prompts for the name of the employee and then it compares the name entered with those in the file. I tried doing this:
```
void update(EMPLOYEE *details)
{
FILE *file;
char searc... | 2011/04/28 | [
"https://Stackoverflow.com/questions/5823229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/728970/"
] | You are comparing a single character, `search` with (I assume) an entire string, `details->name`.
The method signature for [`strcmp`](http://www.cplusplus.com/reference/clibrary/cstring/strcmp/) is:
```
int strcmp (const char *str1, const char *str2);
```
You are calling it as:
```
int strcmp (const char str1, con... | a hint:
```
EMPLOYEE fileData;
while ( fread( &fileData, sizeof( fileData ), 1, file ) == sizeof( fileData )
{
...
}
```
EDIT: changed read to fread since it is a FILE\*
hth |
4,034,214 | Here is a question in my book
>
> Find the order and degree of the differential equation $$y=1+\frac{dy}{dx}+\frac{1}{2!}{\left(\frac{dy}{dx}\right)}^2+\frac{1}{3!}{\left(\frac{dy}{dx}\right)}^3+\cdots$$
>
>
>
At first sight we can conclude that the order is $1$ and the degree is undefined as as the power of $\fr... | 2021/02/21 | [
"https://math.stackexchange.com/questions/4034214",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/769226/"
] | The book is indeed incorrect, when you do such modifications on the equation, the order and degree changes. You must read the order and degree of the equation you are given without any simplification. To illustrate what I mean, suppose I give you:
$$ y' =y$$
I could square the above and get:
$$(y')^2 = y^2$$
Now, l... | Your intuition about the order of given ODE is correct as writing the RHS into closed form function never changes it. But the degree of an ODE is a parameter which is something vague to talk about as one can always disturb it just by squaring both sides.
Though if you constraint yourself to the topic linear ODE (*whic... |
26,932,932 | I am writing an AuditLog based on the changes tracked in the Context object in Entity Framework.
I need to be able to intercept calls to `Context.SaveChanges()`, as I then iterate through `Context.ChangeTracker.Entries()` and log these to my AuditLog.
I need to be able to do this on the `DbContext` itself as I both ... | 2014/11/14 | [
"https://Stackoverflow.com/questions/26932932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3303949/"
] | What you are doing seems quite right to me. The only way to 'intercept' the call to `SaveChanges` is by overriding that method; it is virtual. For instance:
```
public class MyDbContext : DbContext
{
public event Action<MyDbContext> SavingChanges = _ => { };
public override int SaveChanges()
{
// ... | You're calling `SaveChanges()` on the wrong `DbContext`.
Instead of :
```
var changes = base.SaveChanges();
```
You should be using:
```
var changes = _context.SaveChanges();
```
Since `_context` is the `DbContext` that you're trying to track, you need to do the save on that one, instead of on your decorator obj... |
12,826 | I'm interested in an estimator of the standard deviation in a Poisson regression. So the variance is
$$Var(y)=\phi\cdot V(\mu)$$
where $\phi=1$ and $V(\mu)=\mu$. So the variance should be $Var(y)=V(\mu)=\mu$. (I'm just interested in how the variance should be, so if overdispersion occurs ($\widehat{\phi}\neq 1$), I ... | 2011/07/09 | [
"https://stats.stackexchange.com/questions/12826",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/4496/"
] | Poisson regression finds a value $\hat{\beta}$ maximizing the likelihood of the data. For any value of $x$, you would then suppose $Y$ has a Poisson($\exp(x \hat{\beta})$) distribution. The standard deviation of that distribution equals $\exp(x \hat{\beta}/2)$. This appears to be what you mean by $\sqrt{\widehat{\mu}}$... | You are thinking too much in terms of "normally distributed" here. For a normal distribution, you have two parameters then mean $\mu$ and the variance, $\sigma^2$. So you require two pieces of information to characterize the probability distribution for the normal case.
However, in the Poisson distributed case, there ... |
6,569,183 | I am developping an input method on Mac OS. Now I have a problem.
I need to switch the input mode to english if the current input text field is for password. But I do not know how to do the check. How can I know the current input field is a password field? | 2011/07/04 | [
"https://Stackoverflow.com/questions/6569183",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/827782/"
] | As squeeks mentioned, you need not to do anything because NSSecureTextFieldCells are supposed to allow merely Roman keyboards. However, Mac OS X 10.6 has a bug, If your Input Method's Info.plist file does not contain the TISIntendedLanguage setting, the secure text fields are not able to tell your Input Method is not a... | [NSSecureTextFieldCells](http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSSecureTextFieldCell_Class/Reference/Reference.html) handle text input differently than regular text fields, and by default is set only to allow Roman characters. When a user brings this field into foc... |
6,569,183 | I am developping an input method on Mac OS. Now I have a problem.
I need to switch the input mode to english if the current input text field is for password. But I do not know how to do the check. How can I know the current input field is a password field? | 2011/07/04 | [
"https://Stackoverflow.com/questions/6569183",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/827782/"
] | As squeeks mentioned, you need not to do anything because NSSecureTextFieldCells are supposed to allow merely Roman keyboards. However, Mac OS X 10.6 has a bug, If your Input Method's Info.plist file does not contain the TISIntendedLanguage setting, the secure text fields are not able to tell your Input Method is not a... | Append below content to a Input Method App's Info.plist, then the Input Method can be used in password textfield:
```
<key>tsInputMethodCharacterRepertoireKey</key>
<array>
<string>Latn</string>
</array>
``` |
51,030,372 | I've been playing with Symfony 4 for a while now and I've created a twig extension for one of my webpages recently, which is responsible for translating any given string based on data in database. Unfortunately, I've faced with a weird problem which I cannot resolve. I'll try to write down what happens chronologically,... | 2018/06/25 | [
"https://Stackoverflow.com/questions/51030372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3142408/"
] | Seems like you're looking to use pd.concat instead of pd.join (seeing as you even called your variable fx\_news\_concatenate!).
Try:
```
fx_news_concatenate = pd.concat([macronews,fx_date],axis=1,join='inner')
```
The "axis=1" indicates you want to concatenate column-wise (not row-wise) and "join=inner" specifies h... | Try using concat instead
fx\_news\_concanate = pd.concat([macronews, fx\_data], axis=1, join='inner')
Documentation is [here](https://pandas.pydata.org/pandas-docs/stable/merging.html) |
262,320 | I have marketing cloud with a parent and two child business units. **Multi-Org is not enabled**. The parent business unit is connected to CRM and I could created journeys based on Salesforce Data Event. However when I tried to create a journey using Salesforce Data Event in child business units, I get the error "**Ther... | 2019/05/14 | [
"https://salesforce.stackexchange.com/questions/262320",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/11657/"
] | I would postulate that the auth token being created is being created for API calls to your parent business unit. While the user may have permission to the child BU, authorization calls to Marketing Cloud provide tokens for a specific BU only.
Without knowing the inner workings of Marketing Cloud Connect, I can only s... | I see that you have mentioned about having Multi-org enabled.Have you actually went into the Child and Setup>Apps>Salesforce Integration to connect the Child with the Salesforce org. Multi org does not inherit from parent. |
262,320 | I have marketing cloud with a parent and two child business units. **Multi-Org is not enabled**. The parent business unit is connected to CRM and I could created journeys based on Salesforce Data Event. However when I tried to create a journey using Salesforce Data Event in child business units, I get the error "**Ther... | 2019/05/14 | [
"https://salesforce.stackexchange.com/questions/262320",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/11657/"
] | If scope by user is selected, and logged in MC with the wrong username, you can get the error message "There was a problem retrieving the Integration Status" | I see that you have mentioned about having Multi-org enabled.Have you actually went into the Child and Setup>Apps>Salesforce Integration to connect the Child with the Salesforce org. Multi org does not inherit from parent. |
7,771,473 | I am learning how to use code igniter and following tutorials. As this is my first time to use MVC, I'm having some trouble implementing the send function. I am doing a tutorial on how send a newsletter sign up form.
For some reason when I hit submit with or without the info, its giving me a 404 page not found with t... | 2011/10/14 | [
"https://Stackoverflow.com/questions/7771473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/302093/"
] | Is not send that is failing but you missed something in your config.
<http://codeigniter.com/user_guide/general/urls.html>
You should set up your .htaccess according to the guide above. | Did you setup the [CodeIgniter rewrite rules](http://codeigniter.com/wiki/mod_rewrite) in your .htaccess? |
7,771,473 | I am learning how to use code igniter and following tutorials. As this is my first time to use MVC, I'm having some trouble implementing the send function. I am doing a tutorial on how send a newsletter sign up form.
For some reason when I hit submit with or without the info, its giving me a 404 page not found with t... | 2011/10/14 | [
"https://Stackoverflow.com/questions/7771473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/302093/"
] | Did you setup the [CodeIgniter rewrite rules](http://codeigniter.com/wiki/mod_rewrite) in your .htaccess? | Apart from the htaccess possible problem, there are a couple of things wrong in the file you posted:
1) the html `<title>HEY<title>` before the php class, but I hope that's a typo, right? you don't have html in your controller file, right?
2) You're getting the POST variable wrong; or better, you're confusing and mix... |
7,771,473 | I am learning how to use code igniter and following tutorials. As this is my first time to use MVC, I'm having some trouble implementing the send function. I am doing a tutorial on how send a newsletter sign up form.
For some reason when I hit submit with or without the info, its giving me a 404 page not found with t... | 2011/10/14 | [
"https://Stackoverflow.com/questions/7771473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/302093/"
] | Is not send that is failing but you missed something in your config.
<http://codeigniter.com/user_guide/general/urls.html>
You should set up your .htaccess according to the guide above. | Apart from the htaccess possible problem, there are a couple of things wrong in the file you posted:
1) the html `<title>HEY<title>` before the php class, but I hope that's a typo, right? you don't have html in your controller file, right?
2) You're getting the POST variable wrong; or better, you're confusing and mix... |
315,221 | I am in an introduction to Electricity and Magnetism class and we are using Griffiths. In example 7.8 on page 318, his solution says that the "changing magnetic field induces an electric field". But I solved this example by claiming that the changing magnetic field induces a *current*. Which is more correct?
**The exa... | 2017/02/27 | [
"https://physics.stackexchange.com/questions/315221",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/145072/"
] | An electric field, and the electric field can induce a current.
Faraday's law states that
$$ \nabla \times E = -\frac{\partial B}{\partial t}$$
meaning that a change in $B$ induces $E$.
Electromagnetic waves are possible because of this:
an alternating current induces an alternating magnetic field which induces an ... | Just try to re-use your approach in the following modified setup and you will see why it is best to go with the direct approach ("changing magnetic field induces electric field and the charges interact with electric fields - attracted or repelled; they feel the force!").
Modified setup:
The wheel is **fixed** and **can... |
315,221 | I am in an introduction to Electricity and Magnetism class and we are using Griffiths. In example 7.8 on page 318, his solution says that the "changing magnetic field induces an electric field". But I solved this example by claiming that the changing magnetic field induces a *current*. Which is more correct?
**The exa... | 2017/02/27 | [
"https://physics.stackexchange.com/questions/315221",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/145072/"
] | An electric field, and the electric field can induce a current.
Faraday's law states that
$$ \nabla \times E = -\frac{\partial B}{\partial t}$$
meaning that a change in $B$ induces $E$.
Electromagnetic waves are possible because of this:
an alternating current induces an alternating magnetic field which induces an ... | A changing magnetic field creates a non-conservative electric field in the vicinity. This electric field drives the current in a conductor.
While both the statements are correct, the statement that a changing magnetic field induces an electric current is a special case of the statement that a changing magnetic field i... |
14,925,679 | I have built a simple test API for a CakePHP application that will let a user login from a mobile device (or any device for that matter) and get a JSON response. This API could be used for a mobile app built in PhoneGap.
The login method looks like so:
```
public function login()
{
if($this->request->is('post'))
... | 2013/02/17 | [
"https://Stackoverflow.com/questions/14925679",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/302533/"
] | **edit**
For the sake of clarity, I am not a supporter of REST, I AM a supporter of RESTful/RESTlike services. If you look at all of the API's on the internet, very few actually stick to one standard. Whatever scheme you choose will depend on your specific problem-space. Just try to be secure and use intuitive desig... | Restful API restricts using sessions and saving system state at all. Each request must log-in user.
Access tokes are great but also require additional handling.
The easiest way is to send authorisation data via HTTP Basic Auth ("Authorization" HTTP header)
<http://www.httpwatch.com/httpgallery/authentication/> ... |
14,925,679 | I have built a simple test API for a CakePHP application that will let a user login from a mobile device (or any device for that matter) and get a JSON response. This API could be used for a mobile app built in PhoneGap.
The login method looks like so:
```
public function login()
{
if($this->request->is('post'))
... | 2013/02/17 | [
"https://Stackoverflow.com/questions/14925679",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/302533/"
] | Restful API restricts using sessions and saving system state at all. Each request must log-in user.
Access tokes are great but also require additional handling.
The easiest way is to send authorisation data via HTTP Basic Auth ("Authorization" HTTP header)
<http://www.httpwatch.com/httpgallery/authentication/> ... | To answer your questions
1. Its not a bad practice as long as you close their session on app close and recreate it when needed. it is same as if they were logged in on a browser they would know and have facility to log out however the same should be available on the app as well otherwise they might have closed the app... |
14,925,679 | I have built a simple test API for a CakePHP application that will let a user login from a mobile device (or any device for that matter) and get a JSON response. This API could be used for a mobile app built in PhoneGap.
The login method looks like so:
```
public function login()
{
if($this->request->is('post'))
... | 2013/02/17 | [
"https://Stackoverflow.com/questions/14925679",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/302533/"
] | **edit**
For the sake of clarity, I am not a supporter of REST, I AM a supporter of RESTful/RESTlike services. If you look at all of the API's on the internet, very few actually stick to one standard. Whatever scheme you choose will depend on your specific problem-space. Just try to be secure and use intuitive desig... | Make your app login everytime, but not with login-pass pair as Swayok lastly suggested. When you login, server generates a token and returns it back to the client. Client then uses this token whenever it makes a request. On each request, server checks whether the token is valid and if so, executes the request.
This is... |
14,925,679 | I have built a simple test API for a CakePHP application that will let a user login from a mobile device (or any device for that matter) and get a JSON response. This API could be used for a mobile app built in PhoneGap.
The login method looks like so:
```
public function login()
{
if($this->request->is('post'))
... | 2013/02/17 | [
"https://Stackoverflow.com/questions/14925679",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/302533/"
] | Make your app login everytime, but not with login-pass pair as Swayok lastly suggested. When you login, server generates a token and returns it back to the client. Client then uses this token whenever it makes a request. On each request, server checks whether the token is valid and if so, executes the request.
This is... | To answer your questions
1. Its not a bad practice as long as you close their session on app close and recreate it when needed. it is same as if they were logged in on a browser they would know and have facility to log out however the same should be available on the app as well otherwise they might have closed the app... |
14,925,679 | I have built a simple test API for a CakePHP application that will let a user login from a mobile device (or any device for that matter) and get a JSON response. This API could be used for a mobile app built in PhoneGap.
The login method looks like so:
```
public function login()
{
if($this->request->is('post'))
... | 2013/02/17 | [
"https://Stackoverflow.com/questions/14925679",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/302533/"
] | **edit**
For the sake of clarity, I am not a supporter of REST, I AM a supporter of RESTful/RESTlike services. If you look at all of the API's on the internet, very few actually stick to one standard. Whatever scheme you choose will depend on your specific problem-space. Just try to be secure and use intuitive desig... | To answer your questions
1. Its not a bad practice as long as you close their session on app close and recreate it when needed. it is same as if they were logged in on a browser they would know and have facility to log out however the same should be available on the app as well otherwise they might have closed the app... |
38,249,548 | I've the following input tag
```
<input name="PostBack.Contract.ID" type="hidden" value="foo" />
```
and I need to change the value. I'm trying using the following statement but it doesn't work
```
$("input[type=hidden].PostBack.Contract.ID");
```
I get the following result
```
[]
```
What I'm doing wrong? | 2016/07/07 | [
"https://Stackoverflow.com/questions/38249548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/810328/"
] | Change
```
$("input[type=hidden].PostBack.Contract.ID");
```
To:
```
$('input[name="PostBack.Contract.ID"]');
```
Here is the [**DEMO**](https://jsfiddle.net/ak5s5msn/)
Note that I have changed the input type to 'text' for demonstration. | You can use jquery [**hidden-selector**](https://api.jquery.com/hidden-selector/)
```
$( "input:hidden[name='PostBack.Contract.ID']" ).val() // Note the quotes
```
[**JSFIDDLE**](https://jsfiddle.net/7k1p0bmL/) |
38,249,548 | I've the following input tag
```
<input name="PostBack.Contract.ID" type="hidden" value="foo" />
```
and I need to change the value. I'm trying using the following statement but it doesn't work
```
$("input[type=hidden].PostBack.Contract.ID");
```
I get the following result
```
[]
```
What I'm doing wrong? | 2016/07/07 | [
"https://Stackoverflow.com/questions/38249548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/810328/"
] | Select the element by `name` using [attribute selectors](https://developer.mozilla.org/en/docs/Web/CSS/Attribute_selectors). Check out following code ( I have changed input type to `text` so output can be seen easily ):
```js
$(document).ready(function(){
$("input[name='PostBack.Contract.ID']").val("bar");
});//
`... | You can use jquery [**hidden-selector**](https://api.jquery.com/hidden-selector/)
```
$( "input:hidden[name='PostBack.Contract.ID']" ).val() // Note the quotes
```
[**JSFIDDLE**](https://jsfiddle.net/7k1p0bmL/) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.