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
52,780,276
As per the MISRA rule The controlling expression of an if statement and the controlling expression of an iteration-statement shall have essentially Boolean type ``` #include <stdbool.h> #include <stdlib.h> void foo(void){ int i = 0; if(i){} /* Non-compliant - int32_t is not boolean */ if(i...
2018/10/12
[ "https://Stackoverflow.com/questions/52780276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7590993/" ]
> > Why with if only adding a boolean expression is treated as good practise? > > > *"MISRA-C introduces a strong typing model to help users avoid unexpected issues which occur in the C typing model. The rule prevents the accidental use of integer expression when a boolean expression was intended. "* as [stated in...
I can't think of a particular reason. I was thinking in the line of type conversions, where e.g. with a double `d` things could go wrong, but the double will be evaluated to be/not be 0.0 and so still is a valid expression for an if or iteration statement. Or a pointer to a character (string), but there too it will yi...
52,780,276
As per the MISRA rule The controlling expression of an if statement and the controlling expression of an iteration-statement shall have essentially Boolean type ``` #include <stdbool.h> #include <stdlib.h> void foo(void){ int i = 0; if(i){} /* Non-compliant - int32_t is not boolean */ if(i...
2018/10/12
[ "https://Stackoverflow.com/questions/52780276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7590993/" ]
The rationale is provided with the rule: strong typing. The controlling expression should be essentially boolean type. The result of the equality, relational etc operators is to be regarded as essentially boolean, whereas showing in an `int` or pointer without an operator means that the expression is of the used type. ...
I can't think of a particular reason. I was thinking in the line of type conversions, where e.g. with a double `d` things could go wrong, but the double will be evaluated to be/not be 0.0 and so still is a valid expression for an if or iteration statement. Or a pointer to a character (string), but there too it will yi...
52,780,276
As per the MISRA rule The controlling expression of an if statement and the controlling expression of an iteration-statement shall have essentially Boolean type ``` #include <stdbool.h> #include <stdlib.h> void foo(void){ int i = 0; if(i){} /* Non-compliant - int32_t is not boolean */ if(i...
2018/10/12
[ "https://Stackoverflow.com/questions/52780276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7590993/" ]
> > Why with if only adding a boolean expression is treated as good practise? > > > *"MISRA-C introduces a strong typing model to help users avoid unexpected issues which occur in the C typing model. The rule prevents the accidental use of integer expression when a boolean expression was intended. "* as [stated in...
One other possible reason could be to identify potential bugs like this: ``` #include <stdbool.h> #include <stdlib.h> void foo(void){ int i = 0; if(i){} /* Non-compliant - int32_t is not boolean */ if(i |= 0){} /* Non-compliant - type is still int32_t */ } ``` or the more obviou...
52,780,276
As per the MISRA rule The controlling expression of an if statement and the controlling expression of an iteration-statement shall have essentially Boolean type ``` #include <stdbool.h> #include <stdlib.h> void foo(void){ int i = 0; if(i){} /* Non-compliant - int32_t is not boolean */ if(i...
2018/10/12
[ "https://Stackoverflow.com/questions/52780276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7590993/" ]
The rationale is provided with the rule: strong typing. The controlling expression should be essentially boolean type. The result of the equality, relational etc operators is to be regarded as essentially boolean, whereas showing in an `int` or pointer without an operator means that the expression is of the used type. ...
> > Why with if only adding a boolean expression is treated as good practise? > > > *"MISRA-C introduces a strong typing model to help users avoid unexpected issues which occur in the C typing model. The rule prevents the accidental use of integer expression when a boolean expression was intended. "* as [stated in...
52,780,276
As per the MISRA rule The controlling expression of an if statement and the controlling expression of an iteration-statement shall have essentially Boolean type ``` #include <stdbool.h> #include <stdlib.h> void foo(void){ int i = 0; if(i){} /* Non-compliant - int32_t is not boolean */ if(i...
2018/10/12
[ "https://Stackoverflow.com/questions/52780276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7590993/" ]
The rationale is provided with the rule: strong typing. The controlling expression should be essentially boolean type. The result of the equality, relational etc operators is to be regarded as essentially boolean, whereas showing in an `int` or pointer without an operator means that the expression is of the used type. ...
One other possible reason could be to identify potential bugs like this: ``` #include <stdbool.h> #include <stdlib.h> void foo(void){ int i = 0; if(i){} /* Non-compliant - int32_t is not boolean */ if(i |= 0){} /* Non-compliant - type is still int32_t */ } ``` or the more obviou...
10,263,778
I've been struggling with an issue of programmatic checking of a RadioButton, which is situated in a RadioGroup. It seems that a single `check()` call raises three events - once for the first RadioButton and twice for the second, which is my target. At the same time clicking on the second RadioButton in the interface c...
2012/04/21
[ "https://Stackoverflow.com/questions/10263778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > So, is there a way to avoid multiple event raising ? > > > Call `b.setChecked(true);` instead. --- A quick look through the [source code](http://www.grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.1.1_r1/android/widget/RadioGroup.java#RadioGroup.check%28int%29) confirms that `...
Simply post your `r.setOnCheckedChangeListener(onPromobuttonsClick);` line in `onResume()` method. It is works for me.
10,263,778
I've been struggling with an issue of programmatic checking of a RadioButton, which is situated in a RadioGroup. It seems that a single `check()` call raises three events - once for the first RadioButton and twice for the second, which is my target. At the same time clicking on the second RadioButton in the interface c...
2012/04/21
[ "https://Stackoverflow.com/questions/10263778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > So, is there a way to avoid multiple event raising ? > > > Call `b.setChecked(true);` instead. --- A quick look through the [source code](http://www.grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.1.1_r1/android/widget/RadioGroup.java#RadioGroup.check%28int%29) confirms that `...
So this is an old one but I also got a similar behavior. A workaround that I found was to call the `toggle()` method of `RadioButton` instead of the `check()` method of `RadioGroup`. So in this example, you woulod just need to swap ``` r.check(R.id.radio1); ``` with ``` b.toggle(); ``` since `b` is already the v...
10,263,778
I've been struggling with an issue of programmatic checking of a RadioButton, which is situated in a RadioGroup. It seems that a single `check()` call raises three events - once for the first RadioButton and twice for the second, which is my target. At the same time clicking on the second RadioButton in the interface c...
2012/04/21
[ "https://Stackoverflow.com/questions/10263778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > So, is there a way to avoid multiple event raising ? > > > Call `b.setChecked(true);` instead. --- A quick look through the [source code](http://www.grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.1.1_r1/android/widget/RadioGroup.java#RadioGroup.check%28int%29) confirms that `...
I had this problem when I wanted to log analytics for radio button presses, but the way the radio groups calls were being handled with `.check()` caused `onCheckedChangeListener` to get called multiple times (which sent too many events). I handled it the following way to only get one event per click: ``` // create li...
10,263,778
I've been struggling with an issue of programmatic checking of a RadioButton, which is situated in a RadioGroup. It seems that a single `check()` call raises three events - once for the first RadioButton and twice for the second, which is my target. At the same time clicking on the second RadioButton in the interface c...
2012/04/21
[ "https://Stackoverflow.com/questions/10263778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > So, is there a way to avoid multiple event raising ? > > > Call `b.setChecked(true);` instead. --- A quick look through the [source code](http://www.grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.1.1_r1/android/widget/RadioGroup.java#RadioGroup.check%28int%29) confirms that `...
This is a old question but I didn't found a complete answer yet that cover my issue. But thanks to #Hellojeffy suggestion I figured a way to handle the situation when RadioButton trigger multipletimes when using `setOnCheckedChangeListener()`. The idea is to add a click on each view inside the `RadioGroup` and trigger ...
10,263,778
I've been struggling with an issue of programmatic checking of a RadioButton, which is situated in a RadioGroup. It seems that a single `check()` call raises three events - once for the first RadioButton and twice for the second, which is my target. At the same time clicking on the second RadioButton in the interface c...
2012/04/21
[ "https://Stackoverflow.com/questions/10263778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Simply post your `r.setOnCheckedChangeListener(onPromobuttonsClick);` line in `onResume()` method. It is works for me.
So this is an old one but I also got a similar behavior. A workaround that I found was to call the `toggle()` method of `RadioButton` instead of the `check()` method of `RadioGroup`. So in this example, you woulod just need to swap ``` r.check(R.id.radio1); ``` with ``` b.toggle(); ``` since `b` is already the v...
10,263,778
I've been struggling with an issue of programmatic checking of a RadioButton, which is situated in a RadioGroup. It seems that a single `check()` call raises three events - once for the first RadioButton and twice for the second, which is my target. At the same time clicking on the second RadioButton in the interface c...
2012/04/21
[ "https://Stackoverflow.com/questions/10263778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Simply post your `r.setOnCheckedChangeListener(onPromobuttonsClick);` line in `onResume()` method. It is works for me.
I had this problem when I wanted to log analytics for radio button presses, but the way the radio groups calls were being handled with `.check()` caused `onCheckedChangeListener` to get called multiple times (which sent too many events). I handled it the following way to only get one event per click: ``` // create li...
10,263,778
I've been struggling with an issue of programmatic checking of a RadioButton, which is situated in a RadioGroup. It seems that a single `check()` call raises three events - once for the first RadioButton and twice for the second, which is my target. At the same time clicking on the second RadioButton in the interface c...
2012/04/21
[ "https://Stackoverflow.com/questions/10263778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Simply post your `r.setOnCheckedChangeListener(onPromobuttonsClick);` line in `onResume()` method. It is works for me.
This is a old question but I didn't found a complete answer yet that cover my issue. But thanks to #Hellojeffy suggestion I figured a way to handle the situation when RadioButton trigger multipletimes when using `setOnCheckedChangeListener()`. The idea is to add a click on each view inside the `RadioGroup` and trigger ...
10,263,778
I've been struggling with an issue of programmatic checking of a RadioButton, which is situated in a RadioGroup. It seems that a single `check()` call raises three events - once for the first RadioButton and twice for the second, which is my target. At the same time clicking on the second RadioButton in the interface c...
2012/04/21
[ "https://Stackoverflow.com/questions/10263778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
So this is an old one but I also got a similar behavior. A workaround that I found was to call the `toggle()` method of `RadioButton` instead of the `check()` method of `RadioGroup`. So in this example, you woulod just need to swap ``` r.check(R.id.radio1); ``` with ``` b.toggle(); ``` since `b` is already the v...
This is a old question but I didn't found a complete answer yet that cover my issue. But thanks to #Hellojeffy suggestion I figured a way to handle the situation when RadioButton trigger multipletimes when using `setOnCheckedChangeListener()`. The idea is to add a click on each view inside the `RadioGroup` and trigger ...
10,263,778
I've been struggling with an issue of programmatic checking of a RadioButton, which is situated in a RadioGroup. It seems that a single `check()` call raises three events - once for the first RadioButton and twice for the second, which is my target. At the same time clicking on the second RadioButton in the interface c...
2012/04/21
[ "https://Stackoverflow.com/questions/10263778", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I had this problem when I wanted to log analytics for radio button presses, but the way the radio groups calls were being handled with `.check()` caused `onCheckedChangeListener` to get called multiple times (which sent too many events). I handled it the following way to only get one event per click: ``` // create li...
This is a old question but I didn't found a complete answer yet that cover my issue. But thanks to #Hellojeffy suggestion I figured a way to handle the situation when RadioButton trigger multipletimes when using `setOnCheckedChangeListener()`. The idea is to add a click on each view inside the `RadioGroup` and trigger ...
30,760,384
I am new to iOS automation using Appium. I can access elements and do automation using XPath like this ``` driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[2]/UIASecureTextField[3]")).click(); ``` I would like to access elements using the accessibility label name given. When using the Appium inspector I ca...
2015/06/10
[ "https://Stackoverflow.com/questions/30760384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/623401/" ]
You should be able to use the findElementByAccessibilityId(String using) method in Java. More info on it here: <http://appium.github.io/java-client/io/appium/java_client/FindsByAccessibilityId.html>
getAttribute will return the all the information about the element, you just need to filter what you want, Following code will return the value of the element. > > driver.findElement(By.name("Sign in")).getAttribute("value") > > >
2,232,863
> > Show $(1+x\_1)(1+x\_2)...(1+x\_n)\geq2^n$ given $x\_1x\_2...x\_n=1$ and that all $x\_i $ are positive reals. > > > I think simple AM-GM-HM must work, but I am missing on something trivial.
2017/04/13
[ "https://math.stackexchange.com/questions/2232863", "https://math.stackexchange.com", "https://math.stackexchange.com/users/242402/" ]
By AM-GM inequality, $$(1+x\_i) \geq 2 \sqrt x\_i$$ Taking product from $i=1$ to $n$, we get the desired result.
$$LHS \geqslant 2\sqrt{x\_1}\cdot 2\sqrt{x\_2}\cdots 2\sqrt{x\_n}=2^n.$$
2,232,863
> > Show $(1+x\_1)(1+x\_2)...(1+x\_n)\geq2^n$ given $x\_1x\_2...x\_n=1$ and that all $x\_i $ are positive reals. > > > I think simple AM-GM-HM must work, but I am missing on something trivial.
2017/04/13
[ "https://math.stackexchange.com/questions/2232863", "https://math.stackexchange.com", "https://math.stackexchange.com/users/242402/" ]
$$LHS \geqslant 2\sqrt{x\_1}\cdot 2\sqrt{x\_2}\cdots 2\sqrt{x\_n}=2^n.$$
The brute force approach is: $$(1+x\_1)(1+x\_2)\cdots(1+x\_n)=\sum\_{S\subseteq \{1,\dots,n\}}\prod\_{i\in S}x\_i$$ But by AM/GM, since there are $2^n$ subsets of $\{1,\dots,n\}$, you get: $$\frac{1}{2^n}\sum\_{S\subseteq \{1,\dots,n\}}\prod\_{i\in S}x\_i \geq \sqrt[2^n]{x\_1^{2^{n-1}}\cdots x\_n^{2^{n-1}}}=1$$ Thi...
2,232,863
> > Show $(1+x\_1)(1+x\_2)...(1+x\_n)\geq2^n$ given $x\_1x\_2...x\_n=1$ and that all $x\_i $ are positive reals. > > > I think simple AM-GM-HM must work, but I am missing on something trivial.
2017/04/13
[ "https://math.stackexchange.com/questions/2232863", "https://math.stackexchange.com", "https://math.stackexchange.com/users/242402/" ]
$$LHS \geqslant 2\sqrt{x\_1}\cdot 2\sqrt{x\_2}\cdots 2\sqrt{x\_n}=2^n.$$
By Holder $$(1+x\_1)(1+x\_2)...(1+x\_n)\geq\left(1+\sqrt[n]{x\_1x\_2...x\_n}\right)^n=2^n$$
2,232,863
> > Show $(1+x\_1)(1+x\_2)...(1+x\_n)\geq2^n$ given $x\_1x\_2...x\_n=1$ and that all $x\_i $ are positive reals. > > > I think simple AM-GM-HM must work, but I am missing on something trivial.
2017/04/13
[ "https://math.stackexchange.com/questions/2232863", "https://math.stackexchange.com", "https://math.stackexchange.com/users/242402/" ]
By AM-GM inequality, $$(1+x\_i) \geq 2 \sqrt x\_i$$ Taking product from $i=1$ to $n$, we get the desired result.
Not substantially different form other answers, but perhaps an interesting manipulation: multiply the LHS by $$1=1^{-1/2}=\prod\_{k=1}^{n}x\_k^{-1/2}$$ obtaining $$\prod\_{j=1}^k(1+x\_j)=\prod\_{j=1}\left(\frac1{x\_j^{1/2}}+x\_j^{1/2}\right)$$ And then use the fact that (for the reason you prefer) $$\min\left\{ \frac1...
2,232,863
> > Show $(1+x\_1)(1+x\_2)...(1+x\_n)\geq2^n$ given $x\_1x\_2...x\_n=1$ and that all $x\_i $ are positive reals. > > > I think simple AM-GM-HM must work, but I am missing on something trivial.
2017/04/13
[ "https://math.stackexchange.com/questions/2232863", "https://math.stackexchange.com", "https://math.stackexchange.com/users/242402/" ]
By AM-GM inequality, $$(1+x\_i) \geq 2 \sqrt x\_i$$ Taking product from $i=1$ to $n$, we get the desired result.
The brute force approach is: $$(1+x\_1)(1+x\_2)\cdots(1+x\_n)=\sum\_{S\subseteq \{1,\dots,n\}}\prod\_{i\in S}x\_i$$ But by AM/GM, since there are $2^n$ subsets of $\{1,\dots,n\}$, you get: $$\frac{1}{2^n}\sum\_{S\subseteq \{1,\dots,n\}}\prod\_{i\in S}x\_i \geq \sqrt[2^n]{x\_1^{2^{n-1}}\cdots x\_n^{2^{n-1}}}=1$$ Thi...
2,232,863
> > Show $(1+x\_1)(1+x\_2)...(1+x\_n)\geq2^n$ given $x\_1x\_2...x\_n=1$ and that all $x\_i $ are positive reals. > > > I think simple AM-GM-HM must work, but I am missing on something trivial.
2017/04/13
[ "https://math.stackexchange.com/questions/2232863", "https://math.stackexchange.com", "https://math.stackexchange.com/users/242402/" ]
By AM-GM inequality, $$(1+x\_i) \geq 2 \sqrt x\_i$$ Taking product from $i=1$ to $n$, we get the desired result.
By Holder $$(1+x\_1)(1+x\_2)...(1+x\_n)\geq\left(1+\sqrt[n]{x\_1x\_2...x\_n}\right)^n=2^n$$
2,232,863
> > Show $(1+x\_1)(1+x\_2)...(1+x\_n)\geq2^n$ given $x\_1x\_2...x\_n=1$ and that all $x\_i $ are positive reals. > > > I think simple AM-GM-HM must work, but I am missing on something trivial.
2017/04/13
[ "https://math.stackexchange.com/questions/2232863", "https://math.stackexchange.com", "https://math.stackexchange.com/users/242402/" ]
Not substantially different form other answers, but perhaps an interesting manipulation: multiply the LHS by $$1=1^{-1/2}=\prod\_{k=1}^{n}x\_k^{-1/2}$$ obtaining $$\prod\_{j=1}^k(1+x\_j)=\prod\_{j=1}\left(\frac1{x\_j^{1/2}}+x\_j^{1/2}\right)$$ And then use the fact that (for the reason you prefer) $$\min\left\{ \frac1...
The brute force approach is: $$(1+x\_1)(1+x\_2)\cdots(1+x\_n)=\sum\_{S\subseteq \{1,\dots,n\}}\prod\_{i\in S}x\_i$$ But by AM/GM, since there are $2^n$ subsets of $\{1,\dots,n\}$, you get: $$\frac{1}{2^n}\sum\_{S\subseteq \{1,\dots,n\}}\prod\_{i\in S}x\_i \geq \sqrt[2^n]{x\_1^{2^{n-1}}\cdots x\_n^{2^{n-1}}}=1$$ Thi...
2,232,863
> > Show $(1+x\_1)(1+x\_2)...(1+x\_n)\geq2^n$ given $x\_1x\_2...x\_n=1$ and that all $x\_i $ are positive reals. > > > I think simple AM-GM-HM must work, but I am missing on something trivial.
2017/04/13
[ "https://math.stackexchange.com/questions/2232863", "https://math.stackexchange.com", "https://math.stackexchange.com/users/242402/" ]
Not substantially different form other answers, but perhaps an interesting manipulation: multiply the LHS by $$1=1^{-1/2}=\prod\_{k=1}^{n}x\_k^{-1/2}$$ obtaining $$\prod\_{j=1}^k(1+x\_j)=\prod\_{j=1}\left(\frac1{x\_j^{1/2}}+x\_j^{1/2}\right)$$ And then use the fact that (for the reason you prefer) $$\min\left\{ \frac1...
By Holder $$(1+x\_1)(1+x\_2)...(1+x\_n)\geq\left(1+\sqrt[n]{x\_1x\_2...x\_n}\right)^n=2^n$$
25,614,635
I have a built an email form in a modal instance using AngularJS that contains the field sending email, recipient email, subject, and email content. The form uses input boxes and ng-models to keep track of the data. When the user hits the send button on this form, I would like to send all of the information collected b...
2014/09/02
[ "https://Stackoverflow.com/questions/25614635", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3735746/" ]
At the node side you can create a REST end point in order to recieve a POST request from the server for the form submission of email in the modal box. The REST end-point will look like this if you have an express server. ``` var express = require('express'); var router = express.Router(); var app = express(); app.pos...
Angular code: ``` angular.module('sendmailApp', []) .controller('MailController', function ($scope,$http) { $scope.loading = false; $scope.send = function (mail){ $scope.loading = true; $http.post('/sendemail', { to: mail.to, subject: 'Message from AngularCode', ...
47,719,716
I get the following error in the Jmeter response ``` ?xml version="1.0" encoding="UTF-8"?>soap:ServerThese policy alternatives can not be satisfied: {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702} AsymmetricBinding: Received Timestamp does not match the requirements {http://docs.oasis-open.org...
2017/12/08
[ "https://Stackoverflow.com/questions/47719716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4335309/" ]
In your ft\_strnew function you malloc a new string but you never free it. I would suggest that you free line before returning status in your get\_next\_line function!
There is a couple of possibilities. Firstly in your `while` loop, if you get certain values of `status` you exit without freeing `line_read`. That will only cause one block to be lost though. Secondly, you overwrite the value of `*line` with this code ``` *line = ft_strcpy(*line, fd_array[fd]) ``` which looks like ...
4,451,176
This has been driving me nuts for 3 hours. Anybody see a reason why this isn't working? ``` struct sortByPropRev { bool operator()(const cust_type &a, const cust_type &b) const { return a.prop > b.prop; } }; ... priority_queue<cust_type, vector<cust_type>, sortByPropRev> x; ``` I get compile erro...
2010/12/15
[ "https://Stackoverflow.com/questions/4451176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/331785/" ]
You should be able to get this to work using the OVERLAPPED structure. You're on the right track: the system is preventing you from writing asynchronously because every WriteFile extends the size of the file. However, you're doing the file size extension wrong. Simply calling SetFileSize will not actually reserve spac...
I don't see why you would want to write asynchronously. Doing things in parallel does not make them faster in all cases. If you write two file at the same time to the same disk, it will almost always be a lot faster. If that is the case, just write them one after another. If you have some fancy drive like SSD or a vir...
4,451,176
This has been driving me nuts for 3 hours. Anybody see a reason why this isn't working? ``` struct sortByPropRev { bool operator()(const cust_type &a, const cust_type &b) const { return a.prop > b.prop; } }; ... priority_queue<cust_type, vector<cust_type>, sortByPropRev> x; ``` I get compile erro...
2010/12/15
[ "https://Stackoverflow.com/questions/4451176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/331785/" ]
Another option that you did not consider is a memory mapped file. Those are available on Windows and Linux. There is a handy Boost abstraction that you could use. With a memory mapped file, every thread in your process could write its output to the file on its own time, assuming that the record sizes are known and eac...
I don't see why you would want to write asynchronously. Doing things in parallel does not make them faster in all cases. If you write two file at the same time to the same disk, it will almost always be a lot faster. If that is the case, just write them one after another. If you have some fancy drive like SSD or a vir...
4,451,176
This has been driving me nuts for 3 hours. Anybody see a reason why this isn't working? ``` struct sortByPropRev { bool operator()(const cust_type &a, const cust_type &b) const { return a.prop > b.prop; } }; ... priority_queue<cust_type, vector<cust_type>, sortByPropRev> x; ``` I get compile erro...
2010/12/15
[ "https://Stackoverflow.com/questions/4451176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/331785/" ]
You should be able to get this to work using the OVERLAPPED structure. You're on the right track: the system is preventing you from writing asynchronously because every WriteFile extends the size of the file. However, you're doing the file size extension wrong. Simply calling SetFileSize will not actually reserve spac...
Another option that you did not consider is a memory mapped file. Those are available on Windows and Linux. There is a handy Boost abstraction that you could use. With a memory mapped file, every thread in your process could write its output to the file on its own time, assuming that the record sizes are known and eac...
63,022,647
I have a DataGridView that is populated with data pulled from several tables (I'm using SQLite but I don't think that's relevant here). One of the columns (11) may have a value or may be empty. I want to colour the row green if there is a value and do nothing if there isn't. I have this code in CellFormatting to do thi...
2020/07/21
[ "https://Stackoverflow.com/questions/63022647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13972037/" ]
I will assume that is what you want is that “IF” the value of the cell in column 11 is NOT empty, then color that row green, AND if the value of the cell in column 11 IS empty, then do not color it green. The problem (I see) in the posted code is that the back color is NEVER getting set back to white if the value in c...
A null-conditional operator "?" may help in this instance. Add ? after Value (see the code snippet below which I've updated). ``` if(!String.IsNullOrEmpty(dgv.Rows[e.RowIndex].Cells[e.ColumnIndex].Value?.ToString())) { dgv.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Green; } ```
546,544
I right-click a DLL, select Properties and click on then the Details tab. As you can see in the following screenshots, long strings are clipped (...) and there does not seem to be a way to resize the window or copy the value. How can I get the full strings from this dialog? ![enter image description here](https://i.s...
2013/02/04
[ "https://superuser.com/questions/546544", "https://superuser.com", "https://superuser.com/users/184092/" ]
**Two ways** 1. While holding the `Ctrl-key` press on the `+` key if you have a numpad. This should resize the widths of the column so that they are all readable. ***OR*** 2. Go to the vertical line as shown in the picture below and as you hover over it, you cursor should change to the `horizontal resize` cursor. Pull...
Use this DLL from Codeproject, which restores the old XP dialog: **[Windows 7 File-properties "Version" Tab Shell Extension](http://www.codeproject.com/Articles/118909/Windows-7-File-properties-Version-Tab-Shell-Extens)** ![enter image description here](https://i.stack.imgur.com/1AREJ.jpg) Here you can copy the data...
482,281
Is there a rule or something I can use to calculate a good number for `max_connections`, `default_pool_size` and `max_client_conn`? The defaults are odd. PostgreSQL defaults to max\_connections=100 while pgbouncer defaults to default\_pool\_size=20. Shouldn't default\_pool\_size always be higher than max\_connections?...
2013/02/25
[ "https://serverfault.com/questions/482281", "https://serverfault.com", "https://serverfault.com/users/130929/" ]
> > First, please [read our canonical question on Capacity Planning](https://serverfault.com/questions/384686/can-you-help-me-with-my-capacity-planning). > > The specific advice you're asking for is capacity planning advice, and you're going to have to work that out on your own, for your particular environment. > ...
Notice [the documentation's definition of `default_pool_size`](https://pgbouncer.github.io/config.html) > > How many server connections to allow per user/database pair. > > > So if the default config is a pool size of 20, out of a 100 connections total, this implies 5 distinct user/database pairs will have to eac...
412,560
I am trying to use `gparted` to make my ntfs system/boot partition larger. I expanded the disk in ESX, providing an extra 60 GB or so of free space. I confirmed that this free space is available in `gparted`: ![gparted main screen](https://i.stack.imgur.com/qHSry.png) ![unallocated space](https://i.stack.imgur.com/qW...
2012/07/30
[ "https://serverfault.com/questions/412560", "https://serverfault.com", "https://serverfault.com/users/88876/" ]
First you need to move `/dev/sda3` to the right, so that the unallocated space is *before* it instead of *after* it. Then you should be able to resize `/dev/sda2`.
to be more specific read the following <http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1007266> also read the hotfix info to see if it applies.
412,560
I am trying to use `gparted` to make my ntfs system/boot partition larger. I expanded the disk in ESX, providing an extra 60 GB or so of free space. I confirmed that this free space is available in `gparted`: ![gparted main screen](https://i.stack.imgur.com/qHSry.png) ![unallocated space](https://i.stack.imgur.com/qW...
2012/07/30
[ "https://serverfault.com/questions/412560", "https://serverfault.com", "https://serverfault.com/users/88876/" ]
First you need to move `/dev/sda3` to the right, so that the unallocated space is *before* it instead of *after* it. Then you should be able to resize `/dev/sda2`.
We had this grief too. In the end we found it easier to make a new virtual machine with a sufficiently large boot disk to allow for future growth. And all of our machines are cloned off this and get a second disk. C: is reserved for OS and essential programs. D: is where all user data goes and large programs (in our c...
2,150,898
My background is in computer science, and I'm keeping the [Java implementation](https://en.wikipedia.org/wiki/Java_(programming_language)) in my mind as a model. Included in the Java language is the notion of [sets](https://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true). Now I understand that t...
2017/02/19
[ "https://math.stackexchange.com/questions/2150898", "https://math.stackexchange.com", "https://math.stackexchange.com/users/109927/" ]
On the contrary, Russell's set - interpreted *in* your computer-programming model - is not easily implemented (let alone possible). Actual "containment" is not an issue - in principle, mathematicians would be perfectly happy with a set that contained itself. The issue is this: consider a (Java) `Set` that contains in ...
Let me present a different perspective. Instead of modeling a set using a container object consisting of pointers/references, which can be limiting, suppose we choose to model sets as a function which * will accept any set, and * always returns a boolean. How this is to be implemented in any specific language, such a...
2,150,898
My background is in computer science, and I'm keeping the [Java implementation](https://en.wikipedia.org/wiki/Java_(programming_language)) in my mind as a model. Included in the Java language is the notion of [sets](https://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true). Now I understand that t...
2017/02/19
[ "https://math.stackexchange.com/questions/2150898", "https://math.stackexchange.com", "https://math.stackexchange.com/users/109927/" ]
On the contrary, Russell's set - interpreted *in* your computer-programming model - is not easily implemented (let alone possible). Actual "containment" is not an issue - in principle, mathematicians would be perfectly happy with a set that contained itself. The issue is this: consider a (Java) `Set` that contains in ...
While the answers by *Reese* and *Dustan* have explained the set-theoretic paradox in terms of Java, they do not answer the part of the question about how exactly Set data structures (not just in Java) avoid the paradox, nor do they show how the paradox **can** be avoided in a manner consistent with programming. First...
2,150,898
My background is in computer science, and I'm keeping the [Java implementation](https://en.wikipedia.org/wiki/Java_(programming_language)) in my mind as a model. Included in the Java language is the notion of [sets](https://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true). Now I understand that t...
2017/02/19
[ "https://math.stackexchange.com/questions/2150898", "https://math.stackexchange.com", "https://math.stackexchange.com/users/109927/" ]
Let me present a different perspective. Instead of modeling a set using a container object consisting of pointers/references, which can be limiting, suppose we choose to model sets as a function which * will accept any set, and * always returns a boolean. How this is to be implemented in any specific language, such a...
While the answers by *Reese* and *Dustan* have explained the set-theoretic paradox in terms of Java, they do not answer the part of the question about how exactly Set data structures (not just in Java) avoid the paradox, nor do they show how the paradox **can** be avoided in a manner consistent with programming. First...
45,964,047
I'm trying to figure out the best way to recursively go through a `[string]int` map in Go. I'm building a game in which multiple countries are involved, and grouped together by teams of two in the end. The goal is to match the first two countries with the lowest 'score' into its own group of two, and add it back to th...
2017/08/30
[ "https://Stackoverflow.com/questions/45964047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8537167/" ]
Your problem can "easy" be solved using a [heap data structure](https://en.wikipedia.org/wiki/Heap_(data_structure)). ``` package main import ( "container/heap" "fmt" ) // Something that has a score type Scoreable interface { fmt.Stringer Score() int } // A country has a name and a score type Countr...
``` package main import ( "container/heap" "fmt" ) //Recursive data structure may looks something like type Group struct { Score int Left *Group Right *Group Country string } //You can use slice to hold them organized in tree type GrHeap []Group //To implement your logic you can use s...
45,964,047
I'm trying to figure out the best way to recursively go through a `[string]int` map in Go. I'm building a game in which multiple countries are involved, and grouped together by teams of two in the end. The goal is to match the first two countries with the lowest 'score' into its own group of two, and add it back to th...
2017/08/30
[ "https://Stackoverflow.com/questions/45964047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8537167/" ]
Your problem can "easy" be solved using a [heap data structure](https://en.wikipedia.org/wiki/Heap_(data_structure)). ``` package main import ( "container/heap" "fmt" ) // Something that has a score type Scoreable interface { fmt.Stringer Score() int } // A country has a name and a score type Countr...
You can try `map[string]interface{}` with `Type assertion`。 Here is the demo ``` package main import "fmt" const total = "total" func GetValue(i interface{}) int { value, ok := i.(int) if ok { return value } return i.(map[string]interface{})[total].(int) } func main() { score := map[str...
45,964,047
I'm trying to figure out the best way to recursively go through a `[string]int` map in Go. I'm building a game in which multiple countries are involved, and grouped together by teams of two in the end. The goal is to match the first two countries with the lowest 'score' into its own group of two, and add it back to th...
2017/08/30
[ "https://Stackoverflow.com/questions/45964047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8537167/" ]
``` package main import ( "container/heap" "fmt" ) //Recursive data structure may looks something like type Group struct { Score int Left *Group Right *Group Country string } //You can use slice to hold them organized in tree type GrHeap []Group //To implement your logic you can use s...
You can try `map[string]interface{}` with `Type assertion`。 Here is the demo ``` package main import "fmt" const total = "total" func GetValue(i interface{}) int { value, ok := i.(int) if ok { return value } return i.(map[string]interface{})[total].(int) } func main() { score := map[str...
6,416,153
Consider a class `OriginalClass` that might or might not be available on runtime. `OriginalClass` has a method `doSomething` which should be executed if its class is available. A way of solving this is creating a class that also has a `doSomething` method that calls the `OriginalClass.doSomething` using reflection. So...
2011/06/20
[ "https://Stackoverflow.com/questions/6416153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/143378/" ]
I'd say it's the [**proxy pattern**](http://en.wikipedia.org/wiki/Proxy_pattern). You've create a proxy class that wraps the gory reflection stuff and delegates the method call to a different object. > > *A proxy, in its most general form, is a class functioning as an interface to something else. The proxy could int...
Smells like proxy to me. But aren't you better off using [Java's default Dynamic Proxy API](http://www.javaworld.com/javaworld/jw-11-2000/jw-1110-proxy.html)? Definition of proxy: > > A proxy forces object method calls to > occur indirectly through the proxy > object, which acts as a surrogate or > delegate for t...
6,416,153
Consider a class `OriginalClass` that might or might not be available on runtime. `OriginalClass` has a method `doSomething` which should be executed if its class is available. A way of solving this is creating a class that also has a `doSomething` method that calls the `OriginalClass.doSomething` using reflection. So...
2011/06/20
[ "https://Stackoverflow.com/questions/6416153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/143378/" ]
I'd say it's the [**proxy pattern**](http://en.wikipedia.org/wiki/Proxy_pattern). You've create a proxy class that wraps the gory reflection stuff and delegates the method call to a different object. > > *A proxy, in its most general form, is a class functioning as an interface to something else. The proxy could int...
Simple explanation: * **Adapter**: when you have two classes (A and B) that are semantically equivalent/similar, but have different interfaces. Adapter implements interface of A but delegates to B or vice-versa so A and B can be used interchangeably * **Bridge** - typically used with whole inheritance tree (I never us...
6,416,153
Consider a class `OriginalClass` that might or might not be available on runtime. `OriginalClass` has a method `doSomething` which should be executed if its class is available. A way of solving this is creating a class that also has a `doSomething` method that calls the `OriginalClass.doSomething` using reflection. So...
2011/06/20
[ "https://Stackoverflow.com/questions/6416153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/143378/" ]
Smells like proxy to me. But aren't you better off using [Java's default Dynamic Proxy API](http://www.javaworld.com/javaworld/jw-11-2000/jw-1110-proxy.html)? Definition of proxy: > > A proxy forces object method calls to > occur indirectly through the proxy > object, which acts as a surrogate or > delegate for t...
Simple explanation: * **Adapter**: when you have two classes (A and B) that are semantically equivalent/similar, but have different interfaces. Adapter implements interface of A but delegates to B or vice-versa so A and B can be used interchangeably * **Bridge** - typically used with whole inheritance tree (I never us...
659,835
I have two Windows 2012 R2 Domain Controllers and will be implementing 7 Windows 2008 R2 remote desktop servers once their setup and testing is complete (I have one built now that is my test server). I've set up a group policy that redirects the users' My Documents, Music, Pictures, Videos, and Downloads folders to a f...
2015/01/15
[ "https://serverfault.com/questions/659835", "https://serverfault.com", "https://serverfault.com/users/265190/" ]
It is possible with Group Policy. Those folders are `Known Folders` and you can disable them through Group Policy. Have a read at these links: <http://msdn.microsoft.com/en-us/library/windows/desktop/bb776911(v=vs.85).aspx> <http://technet.microsoft.com/en-us/library/dd744697(v=ws.10).aspx#WS_DisableKnownFolders> <h...
Libraries are XML documents stored in `%APPDATA%\Roaming\Microsoft\Windows\Libraries`. You can create a policy to delete those files, or replace with libraries configured per your requirements.
659,835
I have two Windows 2012 R2 Domain Controllers and will be implementing 7 Windows 2008 R2 remote desktop servers once their setup and testing is complete (I have one built now that is my test server). I've set up a group policy that redirects the users' My Documents, Music, Pictures, Videos, and Downloads folders to a f...
2015/01/15
[ "https://serverfault.com/questions/659835", "https://serverfault.com", "https://serverfault.com/users/265190/" ]
Libraries are XML documents stored in `%APPDATA%\Roaming\Microsoft\Windows\Libraries`. You can create a policy to delete those files, or replace with libraries configured per your requirements.
Change the NTFS permissions on C:\Users\Public. That will make it non-writable regardless of whether the users have the subfolders in their libraries or they navigate to it directly. While you're at it, make sure they can't create folders in C:\ or the root of any other drives. To customize libraries for better UX,...
659,835
I have two Windows 2012 R2 Domain Controllers and will be implementing 7 Windows 2008 R2 remote desktop servers once their setup and testing is complete (I have one built now that is my test server). I've set up a group policy that redirects the users' My Documents, Music, Pictures, Videos, and Downloads folders to a f...
2015/01/15
[ "https://serverfault.com/questions/659835", "https://serverfault.com", "https://serverfault.com/users/265190/" ]
It is possible with Group Policy. Those folders are `Known Folders` and you can disable them through Group Policy. Have a read at these links: <http://msdn.microsoft.com/en-us/library/windows/desktop/bb776911(v=vs.85).aspx> <http://technet.microsoft.com/en-us/library/dd744697(v=ws.10).aspx#WS_DisableKnownFolders> <h...
Change the NTFS permissions on C:\Users\Public. That will make it non-writable regardless of whether the users have the subfolders in their libraries or they navigate to it directly. While you're at it, make sure they can't create folders in C:\ or the root of any other drives. To customize libraries for better UX,...
40,055,382
i have tried this: ``` function stickyheaddsadaer() { $("#page-header-inner").addClass("sticky"); } <input type="checkbox" name="TT_sticky_header" id="TT_sticky_header_function" value="{TT_sticky_header}" onclick="stickyheaddsadaer()"/> ``` so when i click checkbox, it just nothing happens.... ...
2016/10/15
[ "https://Stackoverflow.com/questions/40055382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2497800/" ]
**Better to use `onchange` event and check inside function if checked or not** ```js function stickyheaddsadaer(obj) { if($(obj).is(":checked")){ alert("Yes checked"); //when checked $("#page-header-inner").addClass("sticky"); }else{ alert("Not checked"); //when not checked } } ``` ```html <...
HTML ```html <input type="checkbox" id="switch" onclick="change()"> ``` JS ```js function change() { var decider = document.getElementById('switch'); if(decider.checked){ alert('check'); } else { alert('unchecked'); } } ```
40,055,382
i have tried this: ``` function stickyheaddsadaer() { $("#page-header-inner").addClass("sticky"); } <input type="checkbox" name="TT_sticky_header" id="TT_sticky_header_function" value="{TT_sticky_header}" onclick="stickyheaddsadaer()"/> ``` so when i click checkbox, it just nothing happens.... ...
2016/10/15
[ "https://Stackoverflow.com/questions/40055382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2497800/" ]
**Better to use `onchange` event and check inside function if checked or not** ```js function stickyheaddsadaer(obj) { if($(obj).is(":checked")){ alert("Yes checked"); //when checked $("#page-header-inner").addClass("sticky"); }else{ alert("Not checked"); //when not checked } } ``` ```html <...
```js function checkFluency(){ var checkbox = document.getElementById('fluency'); if (checkbox.checked != false) { alert("Checkbox checked") }else{ alert("Not Checked") } } ``` ```html <input type="checkbox" onclick="checkFluency()" id="fluency" /> ```
40,055,382
i have tried this: ``` function stickyheaddsadaer() { $("#page-header-inner").addClass("sticky"); } <input type="checkbox" name="TT_sticky_header" id="TT_sticky_header_function" value="{TT_sticky_header}" onclick="stickyheaddsadaer()"/> ``` so when i click checkbox, it just nothing happens.... ...
2016/10/15
[ "https://Stackoverflow.com/questions/40055382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2497800/" ]
HTML ```html <input type="checkbox" id="switch" onclick="change()"> ``` JS ```js function change() { var decider = document.getElementById('switch'); if(decider.checked){ alert('check'); } else { alert('unchecked'); } } ```
```js function checkFluency(){ var checkbox = document.getElementById('fluency'); if (checkbox.checked != false) { alert("Checkbox checked") }else{ alert("Not Checked") } } ``` ```html <input type="checkbox" onclick="checkFluency()" id="fluency" /> ```
41,892
I have some local tiles that were generated from OpenStreetMaps using Maperitive. I've tried going through the docs and tests but the map is not loading. I'm not getting any errors in chrome's js console either. I think OpenLayers has access to my images because previous errors stated that some tiles could not be foun...
2012/11/22
[ "https://gis.stackexchange.com/questions/41892", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/13035/" ]
It seems that you're trying to restrict the extent of a spherical mercator map (projection EPSG:900913) using bounds in lat/lon coordinates (EPSG:4326). That won't do I'm afraid, you have to create a bounds object using spherical mercator coordinates. You can do that with the coordinates you already have, like this: ...
Are you committed to using OpenLayers only? Is Leaflet an option? I found the Leaflet code a lot simpler in the local-tiles use case. Here's the code (get the full .js and .css paths from leaflet website.. I've localized everything here as this is going to be operated offline) ``` <html> <head> <link rel="stylesheet" ...
15,824,780
I have a fragment. In this fragment, I have a Timer that run a timertask periodically. I override `onPause` so when switch fragment, TimerTask and timer will stop its work. ``` @Override public void onPause() { super.onPause(); timerTask.cancel(); timer.cancel(); ...
2013/04/05
[ "https://Stackoverflow.com/questions/15824780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1192728/" ]
It seems like [onHiddenChanged(boolean hidden)](http://developer.android.com/reference/android/app/Fragment.html#onHiddenChanged%28boolean%29) is what you need. From the `Fragment` `onPause()` documentation: > > This is generally tied to Activity.onPause of the containing > Activity's lifecycle. > > > So `onPaus...
Your fragment may not go into the background simply by switching the displayed fragment. It's lifecycle is dependent on the Activity's. I think if you add `Log.d("yourFragment", "onPause()");` to the onPause() method you'll find this to be true. The fragment lifecycle can be found here: <http://developer.android.com/...
15,824,780
I have a fragment. In this fragment, I have a Timer that run a timertask periodically. I override `onPause` so when switch fragment, TimerTask and timer will stop its work. ``` @Override public void onPause() { super.onPause(); timerTask.cancel(); timer.cancel(); ...
2013/04/05
[ "https://Stackoverflow.com/questions/15824780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1192728/" ]
Your fragment may not go into the background simply by switching the displayed fragment. It's lifecycle is dependent on the Activity's. I think if you add `Log.d("yourFragment", "onPause()");` to the onPause() method you'll find this to be true. The fragment lifecycle can be found here: <http://developer.android.com/...
Put your `timer`.cancle as a statement just above this as: ``` timer.cancel(); OrderFragment fragment2 = new OrderFragment(); fragment2.setArguments(arguments); getSupportFragmentManager().beginTransaction().replace(R.id.item_detail_container, fragment2).commit(); Declare private Timer timer; ...
15,824,780
I have a fragment. In this fragment, I have a Timer that run a timertask periodically. I override `onPause` so when switch fragment, TimerTask and timer will stop its work. ``` @Override public void onPause() { super.onPause(); timerTask.cancel(); timer.cancel(); ...
2013/04/05
[ "https://Stackoverflow.com/questions/15824780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1192728/" ]
It seems like [onHiddenChanged(boolean hidden)](http://developer.android.com/reference/android/app/Fragment.html#onHiddenChanged%28boolean%29) is what you need. From the `Fragment` `onPause()` documentation: > > This is generally tied to Activity.onPause of the containing > Activity's lifecycle. > > > So `onPaus...
Put your `timer`.cancle as a statement just above this as: ``` timer.cancel(); OrderFragment fragment2 = new OrderFragment(); fragment2.setArguments(arguments); getSupportFragmentManager().beginTransaction().replace(R.id.item_detail_container, fragment2).commit(); Declare private Timer timer; ...
20,312
I've read that Z3, first electromechanical general purpose computer operated at a frequency of about 5–10 Hz, and the ENIAC had a 100 kHz clock, though each instruction took 20 cycles. What microprocessor has the lowest clock speed? I'm curious about fixed speed processors and the lowest minimum and maximums on device...
2021/07/03
[ "https://retrocomputing.stackexchange.com/questions/20312", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/22295/" ]
Any CPU that is [fully-static](https://en.wikipedia.org/wiki/Static_core) can be clocked down to 0 Hz and still function. Such CPUs are in wide use today. Here are some examples: * [RCA 1802](https://en.wikipedia.org/wiki/RCA_1802) Used in a few early micros, as an embedded processor, and in space applications such...
Other answers are correct about other microprocessors that can run at very low speeds and still be functional. For example, I have a RocketChip for my Apple II which is a 6502 that can be controlled via software to run at the default 1MHz or accelerated 5MHz, but can also be tuned down to 50kHz. However, I think the n...
20,312
I've read that Z3, first electromechanical general purpose computer operated at a frequency of about 5–10 Hz, and the ENIAC had a 100 kHz clock, though each instruction took 20 cycles. What microprocessor has the lowest clock speed? I'm curious about fixed speed processors and the lowest minimum and maximums on device...
2021/07/03
[ "https://retrocomputing.stackexchange.com/questions/20312", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/22295/" ]
Any CPU that is [fully-static](https://en.wikipedia.org/wiki/Static_core) can be clocked down to 0 Hz and still function. Such CPUs are in wide use today. Here are some examples: * [RCA 1802](https://en.wikipedia.org/wiki/RCA_1802) Used in a few early micros, as an embedded processor, and in space applications such...
Going with the spirit of the question. A quick glance at Wikipedia's [Microprocessor Chronology](https://en.wikipedia.org/wiki/Microprocessor_chronology) we find: * PPS-4 from Rockwell at 200 kHz * PPS-8 from Rockwell at 256 kHz * TMS 1000 from TI at 400 kHz * PPS-25 from Fairchild at 400 kHz * IMP-4 from National at...
20,312
I've read that Z3, first electromechanical general purpose computer operated at a frequency of about 5–10 Hz, and the ENIAC had a 100 kHz clock, though each instruction took 20 cycles. What microprocessor has the lowest clock speed? I'm curious about fixed speed processors and the lowest minimum and maximums on device...
2021/07/03
[ "https://retrocomputing.stackexchange.com/questions/20312", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/22295/" ]
Any CPU that is [fully-static](https://en.wikipedia.org/wiki/Static_core) can be clocked down to 0 Hz and still function. Such CPUs are in wide use today. Here are some examples: * [RCA 1802](https://en.wikipedia.org/wiki/RCA_1802) Used in a few early micros, as an embedded processor, and in space applications such...
Not the slowest in clock speeds (a whopping 1MHz), but probably the simplest and slowest in raw performance of its time may be the Motorola MC14500 CPU - It only has a 1-bit data bus and only 16 instructions. Given that not all (especially industry control) applications need more than "on" and "off" as inputs and outp...
20,312
I've read that Z3, first electromechanical general purpose computer operated at a frequency of about 5–10 Hz, and the ENIAC had a 100 kHz clock, though each instruction took 20 cycles. What microprocessor has the lowest clock speed? I'm curious about fixed speed processors and the lowest minimum and maximums on device...
2021/07/03
[ "https://retrocomputing.stackexchange.com/questions/20312", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/22295/" ]
Going with the spirit of the question. A quick glance at Wikipedia's [Microprocessor Chronology](https://en.wikipedia.org/wiki/Microprocessor_chronology) we find: * PPS-4 from Rockwell at 200 kHz * PPS-8 from Rockwell at 256 kHz * TMS 1000 from TI at 400 kHz * PPS-25 from Fairchild at 400 kHz * IMP-4 from National at...
Other answers are correct about other microprocessors that can run at very low speeds and still be functional. For example, I have a RocketChip for my Apple II which is a 6502 that can be controlled via software to run at the default 1MHz or accelerated 5MHz, but can also be tuned down to 50kHz. However, I think the n...
20,312
I've read that Z3, first electromechanical general purpose computer operated at a frequency of about 5–10 Hz, and the ENIAC had a 100 kHz clock, though each instruction took 20 cycles. What microprocessor has the lowest clock speed? I'm curious about fixed speed processors and the lowest minimum and maximums on device...
2021/07/03
[ "https://retrocomputing.stackexchange.com/questions/20312", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/22295/" ]
Not the slowest in clock speeds (a whopping 1MHz), but probably the simplest and slowest in raw performance of its time may be the Motorola MC14500 CPU - It only has a 1-bit data bus and only 16 instructions. Given that not all (especially industry control) applications need more than "on" and "off" as inputs and outp...
Other answers are correct about other microprocessors that can run at very low speeds and still be functional. For example, I have a RocketChip for my Apple II which is a 6502 that can be controlled via software to run at the default 1MHz or accelerated 5MHz, but can also be tuned down to 50kHz. However, I think the n...
20,312
I've read that Z3, first electromechanical general purpose computer operated at a frequency of about 5–10 Hz, and the ENIAC had a 100 kHz clock, though each instruction took 20 cycles. What microprocessor has the lowest clock speed? I'm curious about fixed speed processors and the lowest minimum and maximums on device...
2021/07/03
[ "https://retrocomputing.stackexchange.com/questions/20312", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/22295/" ]
Going with the spirit of the question. A quick glance at Wikipedia's [Microprocessor Chronology](https://en.wikipedia.org/wiki/Microprocessor_chronology) we find: * PPS-4 from Rockwell at 200 kHz * PPS-8 from Rockwell at 256 kHz * TMS 1000 from TI at 400 kHz * PPS-25 from Fairchild at 400 kHz * IMP-4 from National at...
Not the slowest in clock speeds (a whopping 1MHz), but probably the simplest and slowest in raw performance of its time may be the Motorola MC14500 CPU - It only has a 1-bit data bus and only 16 instructions. Given that not all (especially industry control) applications need more than "on" and "off" as inputs and outp...
6,304,183
I have written PhoneStateListener which listens for telephony events through broadcast receiver. I am receiving following error on `TelephonyManager.CALL_STATE_IDLE` > > 06-10 13:50:48.360: > VERBOSE/ERROR(4686): URI: > content://com.android.contacts/phone\_lookup/, > calling user: com.emergency.alert, > calling ...
2011/06/10
[ "https://Stackoverflow.com/questions/6304183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340002/" ]
I think that your problem is that when you're receiving CALL\_STATE\_IDLE, the incomingNumber variable is not set because there isn't an active or ringing call, and therefore no phone number associated with the current phone state. You're then doing a contacts lookup which is failing because you are not including a val...
Ah I've seen this error before, your URI is malformed as you are setting it to the default ringtone ``` prev_ringtone = RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE); ``` However the default ringtone has not been set so your getting back a blank string / null or some other err...
16,253
![enter image description here](https://i.stack.imgur.com/Am53g.png) I apply an FIR filter passing the band around 50/1000 and attenuating the other three frequency components 30/1000, 70/1000 and 110/1000. Both filters are generated using the Remez algorithm. The first filter is of length 300 and the second is of le...
2014/05/14
[ "https://dsp.stackexchange.com/questions/16253", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/7507/" ]
The filter you designed is a linear phase filter, therefore, response of the filter will start at $N/2$th sample, where $N $ is the filter order. As $N$ increases so does the delay of the response. You can find this delay value by computing group delay of the filter. In case you want to reduce the delay, you can desi...
For a $N$th order FIR filter, the first $N$ outputs are not valid, since they are the *transient response* of the filter. Check the "Steady State and Transient Response" section in this page: <http://www.music.mcgill.ca/~gary/618/week1/signals.html>
16,253
![enter image description here](https://i.stack.imgur.com/Am53g.png) I apply an FIR filter passing the band around 50/1000 and attenuating the other three frequency components 30/1000, 70/1000 and 110/1000. Both filters are generated using the Remez algorithm. The first filter is of length 300 and the second is of le...
2014/05/14
[ "https://dsp.stackexchange.com/questions/16253", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/7507/" ]
The filter you designed is a linear phase filter, therefore, response of the filter will start at $N/2$th sample, where $N $ is the filter order. As $N$ increases so does the delay of the response. You can find this delay value by computing group delay of the filter. In case you want to reduce the delay, you can desi...
I think, if you have a ``` Xn[n] = {X0.x0, X1.x1,..,Xn.xn} //X0 Integer part, x0 fractional ``` and you have a ``` Hn[m] = {H0.h0, H1.h1,..,Hm.hm} ``` Then ``` Yn[i] = Hi.hi*Xi.xi + Hi+1.hi+1*Xi-1.xi-1 + .. +Hi+m.hi+m*Xi-m.xi-m ``` But when you begins multiplyng you don't have before to X0.x0, ``` Yn[0] = ...
16,253
![enter image description here](https://i.stack.imgur.com/Am53g.png) I apply an FIR filter passing the band around 50/1000 and attenuating the other three frequency components 30/1000, 70/1000 and 110/1000. Both filters are generated using the Remez algorithm. The first filter is of length 300 and the second is of le...
2014/05/14
[ "https://dsp.stackexchange.com/questions/16253", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/7507/" ]
For a $N$th order FIR filter, the first $N$ outputs are not valid, since they are the *transient response* of the filter. Check the "Steady State and Transient Response" section in this page: <http://www.music.mcgill.ca/~gary/618/week1/signals.html>
I think, if you have a ``` Xn[n] = {X0.x0, X1.x1,..,Xn.xn} //X0 Integer part, x0 fractional ``` and you have a ``` Hn[m] = {H0.h0, H1.h1,..,Hm.hm} ``` Then ``` Yn[i] = Hi.hi*Xi.xi + Hi+1.hi+1*Xi-1.xi-1 + .. +Hi+m.hi+m*Xi-m.xi-m ``` But when you begins multiplyng you don't have before to X0.x0, ``` Yn[0] = ...
204,374
The 'to infinitive' has the structure *to* + verb as in *to go, to eat, to ride,* etc. The word 'to' is thought to be a preposition. However, since a preposition needs an object and a verb cannot be an object, can 'to' be more of an adverb, since it modifies a verb in the structure? An adverb modifies a verb. W R T: ...
2014/10/24
[ "https://english.stackexchange.com/questions/204374", "https://english.stackexchange.com", "https://english.stackexchange.com/users/95529/" ]
The *to* in the full infinitive is considered a [grammatical particle](https://en.wikipedia.org/wiki/Grammatical_particle), i.e., a word that does not serve a part-of-speech function by itself, but only in combination with another word in the sentence.
You are all correct. The key is to not think of the infinitive as a standalone part of speech, but a functioning unit of language. Look at the phrase's function, and it will show the part of speech. It will be a noun, adjective, or adverb. Examples: Noun --> "His job was *to help me*." (*What* was his job?) Adjective...
28,681,240
I'm trying to solve an algorithm for extracting a subsequence from an array. It should display the longest subsequence of prime numbers. I have written the whole algorithm but I still get an infinite cycle and I can't figure out where and why. I'm incrementing both indices and modifying the first index at the end, but ...
2015/02/23
[ "https://Stackoverflow.com/questions/28681240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4237029/" ]
Probably just one of many issues with that code: ``` while(i<=n-1) { if(prim(x[i])==0 && prim(x[i+1])==0) i++; } j=i+1; while(j<=n-1) if(prim(x[j])==0 && prim(x[j+1])==0) j++; ``` There are two potential infinite loops here. If the conditions in the while don't return true on the ...
This is a better way to verify if a number is prime or not ``` bool IsPrime(int number) { int primeStep = 2; double stepLimit = sqrt(number); while(primeStep <= stepLimit) { if(number % primeStep == 0) return false; primeStep += 1; } return true; } ``` And nou you can apply that function for each num...
28,681,240
I'm trying to solve an algorithm for extracting a subsequence from an array. It should display the longest subsequence of prime numbers. I have written the whole algorithm but I still get an infinite cycle and I can't figure out where and why. I'm incrementing both indices and modifying the first index at the end, but ...
2015/02/23
[ "https://Stackoverflow.com/questions/28681240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4237029/" ]
With a slight change in your code, you make it work, and one thing, you don't need to start array with index 1. you can always start with index zero. ``` for(int i=1;i<=n;i++) { cout<<"Da un nr: "; cin>>x[i]; } ``` try to check for a case when no prime subsequence is found, while printing. ``` void detSecv(...
This is a better way to verify if a number is prime or not ``` bool IsPrime(int number) { int primeStep = 2; double stepLimit = sqrt(number); while(primeStep <= stepLimit) { if(number % primeStep == 0) return false; primeStep += 1; } return true; } ``` And nou you can apply that function for each num...
453,506
A notebook Sony Vaio with the following requirements * CPU Intel Core 2 Duo T5500 1.66GHz * Memory 2GB DDR2 SDRAM (533MHz) * HDD 320GB * Screen 15.4" WXGA (1280x800) * Graphics NVIDIA GeForce Go 7400 (suporting 256MB) supports Ubuntu 14.04 LTS?
2014/04/23
[ "https://askubuntu.com/questions/453506", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
The system requirements vary among Ubuntu products. For the main Ubuntu desktop product, the official Ubuntu Documentation recommends a 1 GHz Pentium 4 processor with 1 GB of RAM[44] and 5.9 gigabytes of hard drive space, or better.[45] For less powerful computers, there are other Ubuntu distributions such as Lubuntu a...
To run Ubuntu Unity the requirements are: * 1 GHz processor (for example Intel Celeron or better) * 1 GB RAM (system memory) * 5 GB of free hard drive space for installation * 3D Acceleration Capable Videocard with at least 256 MB According to your spec, your laptop can run Ubuntu. Source: <https://help.ubuntu.com/...
52,912,509
When I try to create an app using **create-react-app** that give an error > > error eslint@5.6.0: The engine "node" is incompatible with this > module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". > > > error Found incompatible module info Visit > <https://yarnpkg.com/en/docs/cli/add> for documentation abo...
2018/10/21
[ "https://Stackoverflow.com/questions/52912509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8240910/" ]
**Update** your nodejs version from <https://nodejs.org/en/>
As you can see, you need to update your version of Node To do that, please run: `npm install npm@latest -g`
52,912,509
When I try to create an app using **create-react-app** that give an error > > error eslint@5.6.0: The engine "node" is incompatible with this > module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". > > > error Found incompatible module info Visit > <https://yarnpkg.com/en/docs/cli/add> for documentation abo...
2018/10/21
[ "https://Stackoverflow.com/questions/52912509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8240910/" ]
I had this issue because my node package wasn't up-to-date. I got this error message: ``` error eslint@6.3.0: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "11.10.0" ``` After some Googling around I stumbled upon this... <https://www.surrealcms.com/blog/...
As you can see, you need to update your version of Node To do that, please run: `npm install npm@latest -g`
52,912,509
When I try to create an app using **create-react-app** that give an error > > error eslint@5.6.0: The engine "node" is incompatible with this > module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". > > > error Found incompatible module info Visit > <https://yarnpkg.com/en/docs/cli/add> for documentation abo...
2018/10/21
[ "https://Stackoverflow.com/questions/52912509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8240910/" ]
The problem is clearly due to incompatible node version. Install a program called n that will let you switch between Node versions. ``` sudo npm install -g n ``` Update to the latest stable version of Node. ``` sudo n stable ``` Now use create-react-app ``` npm install create-react-app create-react-app myapp ...
As you can see, you need to update your version of Node To do that, please run: `npm install npm@latest -g`
52,912,509
When I try to create an app using **create-react-app** that give an error > > error eslint@5.6.0: The engine "node" is incompatible with this > module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". > > > error Found incompatible module info Visit > <https://yarnpkg.com/en/docs/cli/add> for documentation abo...
2018/10/21
[ "https://Stackoverflow.com/questions/52912509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8240910/" ]
**Update** your nodejs version from <https://nodejs.org/en/>
The problem is clearly due to incompatible node version. Install a program called n that will let you switch between Node versions. ``` sudo npm install -g n ``` Update to the latest stable version of Node. ``` sudo n stable ``` Now use create-react-app ``` npm install create-react-app create-react-app myapp ...
52,912,509
When I try to create an app using **create-react-app** that give an error > > error eslint@5.6.0: The engine "node" is incompatible with this > module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". > > > error Found incompatible module info Visit > <https://yarnpkg.com/en/docs/cli/add> for documentation abo...
2018/10/21
[ "https://Stackoverflow.com/questions/52912509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8240910/" ]
**Update** your nodejs version from <https://nodejs.org/en/>
You can try this cms: ``` yarn config set ignore-engines true ```
52,912,509
When I try to create an app using **create-react-app** that give an error > > error eslint@5.6.0: The engine "node" is incompatible with this > module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". > > > error Found incompatible module info Visit > <https://yarnpkg.com/en/docs/cli/add> for documentation abo...
2018/10/21
[ "https://Stackoverflow.com/questions/52912509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8240910/" ]
I had this issue because my node package wasn't up-to-date. I got this error message: ``` error eslint@6.3.0: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "11.10.0" ``` After some Googling around I stumbled upon this... <https://www.surrealcms.com/blog/...
The problem is clearly due to incompatible node version. Install a program called n that will let you switch between Node versions. ``` sudo npm install -g n ``` Update to the latest stable version of Node. ``` sudo n stable ``` Now use create-react-app ``` npm install create-react-app create-react-app myapp ...
52,912,509
When I try to create an app using **create-react-app** that give an error > > error eslint@5.6.0: The engine "node" is incompatible with this > module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". > > > error Found incompatible module info Visit > <https://yarnpkg.com/en/docs/cli/add> for documentation abo...
2018/10/21
[ "https://Stackoverflow.com/questions/52912509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8240910/" ]
I had this issue because my node package wasn't up-to-date. I got this error message: ``` error eslint@6.3.0: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "11.10.0" ``` After some Googling around I stumbled upon this... <https://www.surrealcms.com/blog/...
You can try this cms: ``` yarn config set ignore-engines true ```
52,912,509
When I try to create an app using **create-react-app** that give an error > > error eslint@5.6.0: The engine "node" is incompatible with this > module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". > > > error Found incompatible module info Visit > <https://yarnpkg.com/en/docs/cli/add> for documentation abo...
2018/10/21
[ "https://Stackoverflow.com/questions/52912509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8240910/" ]
The problem is clearly due to incompatible node version. Install a program called n that will let you switch between Node versions. ``` sudo npm install -g n ``` Update to the latest stable version of Node. ``` sudo n stable ``` Now use create-react-app ``` npm install create-react-app create-react-app myapp ...
You can try this cms: ``` yarn config set ignore-engines true ```
20,487,402
I am displaying data as per product specification or as per it's configuration. Configuration display left side of page. When user select configuration the related data should be filtered. I have made category of attribute like Screen Size, RAM, HDD, Color, Size, Processor, optical drive etc. And under it I am display...
2013/12/10
[ "https://Stackoverflow.com/questions/20487402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2659972/" ]
Change your If condition as below ``` if(adata != null) { %> <%-- <a><%= aname %></a> &nbsp; --%> <a><%= aval %></a> &nbsp; <a><%= adata %></a> <% } ``` Put your `aname` printing inside your if clause. Also to remove `acname` printing add if condition as below...
not sure if I got this correct, but if you need to omit blank\null values, you can use the ``` <c:if test="${CONDITION}"> </c:if> ``` tag
20,487,402
I am displaying data as per product specification or as per it's configuration. Configuration display left side of page. When user select configuration the related data should be filtered. I have made category of attribute like Screen Size, RAM, HDD, Color, Size, Processor, optical drive etc. And under it I am display...
2013/12/10
[ "https://Stackoverflow.com/questions/20487402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2659972/" ]
I suggest that you try logic this way .. to solve your issue.. ``` for( int i=0;i<acIDList.size();i++) { int acid=acIDList.get(i); acname=acNAMEList.get(i); //Print Category int i = getIndex(acid); if(i != -1) { a...
not sure if I got this correct, but if you need to omit blank\null values, you can use the ``` <c:if test="${CONDITION}"> </c:if> ``` tag
20,487,402
I am displaying data as per product specification or as per it's configuration. Configuration display left side of page. When user select configuration the related data should be filtered. I have made category of attribute like Screen Size, RAM, HDD, Color, Size, Processor, optical drive etc. And under it I am display...
2013/12/10
[ "https://Stackoverflow.com/questions/20487402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2659972/" ]
I suggest that you try logic this way .. to solve your issue.. ``` for( int i=0;i<acIDList.size();i++) { int acid=acIDList.get(i); acname=acNAMEList.get(i); //Print Category int i = getIndex(acid); if(i != -1) { a...
Change your If condition as below ``` if(adata != null) { %> <%-- <a><%= aname %></a> &nbsp; --%> <a><%= aval %></a> &nbsp; <a><%= adata %></a> <% } ``` Put your `aname` printing inside your if clause. Also to remove `acname` printing add if condition as below...
4,997,304
What is the proper (or a good) design if I need to have a class that loads its data from a file (while keeping the load functions in a different class)? This is what I have now. Can't help but think there is a better way to structure it all though. The part that is tripping me up is when Loader has to call a method in...
2011/02/14
[ "https://Stackoverflow.com/questions/4997304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/204855/" ]
If you're using Linux, you can put your entire project on an FTP site and manipulate the files directly without having to sync it. For Windows, check out a little utility called [WebDrive](http://www.southrivertechnologies.com/products/webdrive/winindex.html), which can map FTP locations (among others) to a drive lette...
TL;DR - Install Aptana I struggled with this for like 3 hours. We are a team working on the same webserver (thus, same files) using sftp (no version control) and Netbeans. The problem is, Netbeans doesn't warns you when you are writing over an old version of the remote file nor downloads the latest version of the rem...
44,801
Given a positive and increasing sequence $\{a\_n\}$, what is the meaning of $a\_n$ grows as for example $O(n\log n)$ or $O(n^2)$. I have read this in some books but the google search did not yield anything.
2011/06/11
[ "https://math.stackexchange.com/questions/44801", "https://math.stackexchange.com", "https://math.stackexchange.com/users/2987/" ]
Differentiation is easy! Once you have calculated an integral, **differentiate** your "answer" and see whether you get the right thing. Of course you have to remember the $+{}C$, since if you differentiate, you will get the same thing as if you had remembered it. You can even use the idea as a "technique of integrati...
[Integration by parts](http://en.wikipedia.org/wiki/Integration_by_parts) would be of great help. Let $u = x$, and let $dv = \cos{3x} \:\rm{dx}$. Then you have $du = dx$ and $v = \frac{\sin{3x}}{3}$. Using the formula we have $$I = \int x \cos{3x} \ \text{dx} = uv - \int v \ \text{du} = \frac{x \cdot\sin{3x}}{3} - \fra...
47,945,008
I know that there are previous questions that ask the same but I still couldn't find the right solution. I am getting: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. I am using a Tomcat server. Could someone please help me, the following i...
2017/12/22
[ "https://Stackoverflow.com/questions/47945008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7784665/" ]
I was stuck into this problem for a month. Finally, I figured out that in **Eclipse**, "*Build Automatically*" was not set, and I was trying to run my `servlet.java` file without any `servlet.class` file, since I wasn't building my project. The thing which worked for me is to > > first build the project => restart...
I was running into a similar problem, where my package name was wrong. I fixed the package name and fixed the problem. Please check your configuration snippet in the web.xml file. Also, for a cleaner structure, you can create a new folder "jsps" under WEB\_INF and move the .jsp files into the same.
47,945,008
I know that there are previous questions that ask the same but I still couldn't find the right solution. I am getting: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. I am using a Tomcat server. Could someone please help me, the following i...
2017/12/22
[ "https://Stackoverflow.com/questions/47945008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7784665/" ]
I was running into a similar problem, where my package name was wrong. I fixed the package name and fixed the problem. Please check your configuration snippet in the web.xml file. Also, for a cleaner structure, you can create a new folder "jsps" under WEB\_INF and move the .jsp files into the same.
here is the solution for your query, Simply follow these steps: go to project properties settings type demployment and assembly settings then click on **add folder** then and add the webcontent folder to your project, click **apply and close** then run the project I hope your problem will be solved.
47,945,008
I know that there are previous questions that ask the same but I still couldn't find the right solution. I am getting: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. I am using a Tomcat server. Could someone please help me, the following i...
2017/12/22
[ "https://Stackoverflow.com/questions/47945008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7784665/" ]
I was stuck into this problem for a month. Finally, I figured out that in **Eclipse**, "*Build Automatically*" was not set, and I was trying to run my `servlet.java` file without any `servlet.class` file, since I wasn't building my project. The thing which worked for me is to > > first build the project => restart...
here is the solution for your query, Simply follow these steps: go to project properties settings type demployment and assembly settings then click on **add folder** then and add the webcontent folder to your project, click **apply and close** then run the project I hope your problem will be solved.
47,945,008
I know that there are previous questions that ask the same but I still couldn't find the right solution. I am getting: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. I am using a Tomcat server. Could someone please help me, the following i...
2017/12/22
[ "https://Stackoverflow.com/questions/47945008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7784665/" ]
I was stuck into this problem for a month. Finally, I figured out that in **Eclipse**, "*Build Automatically*" was not set, and I was trying to run my `servlet.java` file without any `servlet.class` file, since I wasn't building my project. The thing which worked for me is to > > first build the project => restart...
The following scenario is explained with the name of the project as **abcd**, and the port as **8080**. The folder **WebContent** will be inside folder **abcd**. In **application.properties**, add your path > > **upload.path=C:/.........../abcd/WebContent/** > > > If the last slash after WebContent is ignored, t...
47,945,008
I know that there are previous questions that ask the same but I still couldn't find the right solution. I am getting: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. I am using a Tomcat server. Could someone please help me, the following i...
2017/12/22
[ "https://Stackoverflow.com/questions/47945008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7784665/" ]
I was stuck into this problem for a month. Finally, I figured out that in **Eclipse**, "*Build Automatically*" was not set, and I was trying to run my `servlet.java` file without any `servlet.class` file, since I wasn't building my project. The thing which worked for me is to > > first build the project => restart...
I faced this issue once when there was a runtime exception in the code block of **ContextLoaderListener**. ``` public class YourApplicationContenxtLoaderListener extends ContextLoaderListener{ @Override public void contextInitialized(ServletContextEvent event){ /* There should not be any exception/error in...
47,945,008
I know that there are previous questions that ask the same but I still couldn't find the right solution. I am getting: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. I am using a Tomcat server. Could someone please help me, the following i...
2017/12/22
[ "https://Stackoverflow.com/questions/47945008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7784665/" ]
I was stuck into this problem for a month. Finally, I figured out that in **Eclipse**, "*Build Automatically*" was not set, and I was trying to run my `servlet.java` file without any `servlet.class` file, since I wasn't building my project. The thing which worked for me is to > > first build the project => restart...
I encountered this problem on an Azure WebApp running on Java 11 and Tomcat 9.0. I changed the Java Web Server version from **Apache Tomcat 9.0 (auto update)** to **Apache Tomcat 9.0.20**, and then the server worked. [![enter image description here](https://i.stack.imgur.com/GzUKf.png)](https://i.stack.imgur.com/GzUK...
47,945,008
I know that there are previous questions that ask the same but I still couldn't find the right solution. I am getting: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. I am using a Tomcat server. Could someone please help me, the following i...
2017/12/22
[ "https://Stackoverflow.com/questions/47945008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7784665/" ]
The following scenario is explained with the name of the project as **abcd**, and the port as **8080**. The folder **WebContent** will be inside folder **abcd**. In **application.properties**, add your path > > **upload.path=C:/.........../abcd/WebContent/** > > > If the last slash after WebContent is ignored, t...
here is the solution for your query, Simply follow these steps: go to project properties settings type demployment and assembly settings then click on **add folder** then and add the webcontent folder to your project, click **apply and close** then run the project I hope your problem will be solved.
47,945,008
I know that there are previous questions that ask the same but I still couldn't find the right solution. I am getting: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. I am using a Tomcat server. Could someone please help me, the following i...
2017/12/22
[ "https://Stackoverflow.com/questions/47945008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7784665/" ]
I faced this issue once when there was a runtime exception in the code block of **ContextLoaderListener**. ``` public class YourApplicationContenxtLoaderListener extends ContextLoaderListener{ @Override public void contextInitialized(ServletContextEvent event){ /* There should not be any exception/error in...
here is the solution for your query, Simply follow these steps: go to project properties settings type demployment and assembly settings then click on **add folder** then and add the webcontent folder to your project, click **apply and close** then run the project I hope your problem will be solved.
47,945,008
I know that there are previous questions that ask the same but I still couldn't find the right solution. I am getting: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. I am using a Tomcat server. Could someone please help me, the following i...
2017/12/22
[ "https://Stackoverflow.com/questions/47945008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7784665/" ]
I encountered this problem on an Azure WebApp running on Java 11 and Tomcat 9.0. I changed the Java Web Server version from **Apache Tomcat 9.0 (auto update)** to **Apache Tomcat 9.0.20**, and then the server worked. [![enter image description here](https://i.stack.imgur.com/GzUKf.png)](https://i.stack.imgur.com/GzUK...
here is the solution for your query, Simply follow these steps: go to project properties settings type demployment and assembly settings then click on **add folder** then and add the webcontent folder to your project, click **apply and close** then run the project I hope your problem will be solved.
5,260,907
I’m using Google Test to test my C++ project. Some cases, however, require access to argc and argv to load the required data. In the `main()` method, when initializing, argc and argv are passed to the constructor of testing. ``` testing::InitGoogleTest(&argc, argv); ``` How can I access them later in a test? ``` T...
2011/03/10
[ "https://Stackoverflow.com/questions/5260907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44232/" ]
I don't know google's test framework, so there might be a better way to do this, but this should do: ``` //--------------------------------------------- // some_header.h extern int my_argc; extern char** my_argv; // eof //--------------------------------------------- //--------------------------------------------- /...
The command line arguments to your test executable are for the *test framework*, not for your tests. With them, you set stuff like `--gtest_output`, `--gtest_repeat` or `--gtest_filter`. A test should first and foremost be *reproducable*, which it isn't if it is depending on someone using the "right" parameters. What ...
5,260,907
I’m using Google Test to test my C++ project. Some cases, however, require access to argc and argv to load the required data. In the `main()` method, when initializing, argc and argv are passed to the constructor of testing. ``` testing::InitGoogleTest(&argc, argv); ``` How can I access them later in a test? ``` T...
2011/03/10
[ "https://Stackoverflow.com/questions/5260907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44232/" ]
If running on Windows using Visual Studio, those are available in \_\_argc and \_\_argv.
The command line arguments to your test executable are for the *test framework*, not for your tests. With them, you set stuff like `--gtest_output`, `--gtest_repeat` or `--gtest_filter`. A test should first and foremost be *reproducable*, which it isn't if it is depending on someone using the "right" parameters. What ...
5,260,907
I’m using Google Test to test my C++ project. Some cases, however, require access to argc and argv to load the required data. In the `main()` method, when initializing, argc and argv are passed to the constructor of testing. ``` testing::InitGoogleTest(&argc, argv); ``` How can I access them later in a test? ``` T...
2011/03/10
[ "https://Stackoverflow.com/questions/5260907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44232/" ]
I don't know google's test framework, so there might be a better way to do this, but this should do: ``` //--------------------------------------------- // some_header.h extern int my_argc; extern char** my_argv; // eof //--------------------------------------------- //--------------------------------------------- /...
If running on Windows using Visual Studio, those are available in \_\_argc and \_\_argv.
1,627,392
How to send MMS in J2ME?
2009/10/26
[ "https://Stackoverflow.com/questions/1627392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193091/" ]
See [JSR 205](http://jcp.org/en/jsr/detail?id=205). Here's a [sample code](http://www.java-tips.org/java-me-tips/midp/sending-and-recieving-mms-on-j2me-devices-4.html) at Java Tips. Obviously the handset and service provider have to support MMS... Last link, a [more descriptive piece](http://java.sys-con.com/node/44...
Martin Clayton's answer is correct except it's actually [JSR 205](http://jcp.org/en/jsr/detail?id=205) you need for MMS.
1,627,392
How to send MMS in J2ME?
2009/10/26
[ "https://Stackoverflow.com/questions/1627392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193091/" ]
See [JSR 205](http://jcp.org/en/jsr/detail?id=205). Here's a [sample code](http://www.java-tips.org/java-me-tips/midp/sending-and-recieving-mms-on-j2me-devices-4.html) at Java Tips. Obviously the handset and service provider have to support MMS... Last link, a [more descriptive piece](http://java.sys-con.com/node/44...
As with all good things in Java Mobile remember to test on your target handsets, some over achieving device manufacturers have limited the payload to a max size of 32kb, which you might find tricky if you are sending images or video
1,627,392
How to send MMS in J2ME?
2009/10/26
[ "https://Stackoverflow.com/questions/1627392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193091/" ]
Martin Clayton's answer is correct except it's actually [JSR 205](http://jcp.org/en/jsr/detail?id=205) you need for MMS.
As with all good things in Java Mobile remember to test on your target handsets, some over achieving device manufacturers have limited the payload to a max size of 32kb, which you might find tricky if you are sending images or video
1,786,216
I have a table named `activity` with 2 columns: ``` when as datetime // last time i saw a user guid as varchar // a unique identifier for each user ``` This tables is used to track usage in a certain resource. Guid are created by the clients. I want to be able to query how many new users I have in the last day/wee...
2009/11/23
[ "https://Stackoverflow.com/questions/1786216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173437/" ]
``` SELECT COUNT(DISTINCT guid) FROM activity WHERE guid NOT IN ( SELECT DISTINCT guid FROM activity WHERE when < CURDATE() - INTERVAL 7 DAYS ) AND when BETWEEN CURDATE() AND CURDATE() - INTERVAL 7 DAYS; ``` change the 7 days to how ever long.
Need claraification. If when is not populated on creation, then just SELECT \* FROM activity WHERE when IS null. But I'm not sure if that's what you mean.
1,786,216
I have a table named `activity` with 2 columns: ``` when as datetime // last time i saw a user guid as varchar // a unique identifier for each user ``` This tables is used to track usage in a certain resource. Guid are created by the clients. I want to be able to query how many new users I have in the last day/wee...
2009/11/23
[ "https://Stackoverflow.com/questions/1786216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173437/" ]
``` select count(guid)as total_new_users from activity where when >= {last day/week/month} and guid not in(select guid from activity where when < {last day/week/month}) ```
Need claraification. If when is not populated on creation, then just SELECT \* FROM activity WHERE when IS null. But I'm not sure if that's what you mean.
1,786,216
I have a table named `activity` with 2 columns: ``` when as datetime // last time i saw a user guid as varchar // a unique identifier for each user ``` This tables is used to track usage in a certain resource. Guid are created by the clients. I want to be able to query how many new users I have in the last day/wee...
2009/11/23
[ "https://Stackoverflow.com/questions/1786216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173437/" ]
I think what you want is: ``` select count(*) from ( select guid,min(when) as first from activity group by guid having first between curdate()-interval 7 day and curdate() ) ``` You have to query the entire table because otherwise people will be counted as new for their first visit during the time period in que...
Need claraification. If when is not populated on creation, then just SELECT \* FROM activity WHERE when IS null. But I'm not sure if that's what you mean.
1,786,216
I have a table named `activity` with 2 columns: ``` when as datetime // last time i saw a user guid as varchar // a unique identifier for each user ``` This tables is used to track usage in a certain resource. Guid are created by the clients. I want to be able to query how many new users I have in the last day/wee...
2009/11/23
[ "https://Stackoverflow.com/questions/1786216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173437/" ]
``` select count(guid)as total_new_users from activity where when >= {last day/week/month} and guid not in(select guid from activity where when < {last day/week/month}) ```
``` SELECT COUNT(DISTINCT guid) FROM activity WHERE guid NOT IN ( SELECT DISTINCT guid FROM activity WHERE when < CURDATE() - INTERVAL 7 DAYS ) AND when BETWEEN CURDATE() AND CURDATE() - INTERVAL 7 DAYS; ``` change the 7 days to how ever long.
1,786,216
I have a table named `activity` with 2 columns: ``` when as datetime // last time i saw a user guid as varchar // a unique identifier for each user ``` This tables is used to track usage in a certain resource. Guid are created by the clients. I want to be able to query how many new users I have in the last day/wee...
2009/11/23
[ "https://Stackoverflow.com/questions/1786216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173437/" ]
``` SELECT COUNT(DISTINCT guid) FROM activity WHERE guid NOT IN ( SELECT DISTINCT guid FROM activity WHERE when < CURDATE() - INTERVAL 7 DAYS ) AND when BETWEEN CURDATE() AND CURDATE() - INTERVAL 7 DAYS; ``` change the 7 days to how ever long.
``` SELECT COUNT(DISTINCT guid) FROM ACTIVITY WHERE when BETWEEN CURDATE() AND CURDATE() - INTERVAL 7 DAYS AND guid NOT IN (SELECT distinct GUID FROM ACTIVITY WHERE when < (CURDATE() -7 DAYS)) ``` That should do it.
1,786,216
I have a table named `activity` with 2 columns: ``` when as datetime // last time i saw a user guid as varchar // a unique identifier for each user ``` This tables is used to track usage in a certain resource. Guid are created by the clients. I want to be able to query how many new users I have in the last day/wee...
2009/11/23
[ "https://Stackoverflow.com/questions/1786216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173437/" ]
I think what you want is: ``` select count(*) from ( select guid,min(when) as first from activity group by guid having first between curdate()-interval 7 day and curdate() ) ``` You have to query the entire table because otherwise people will be counted as new for their first visit during the time period in que...
``` SELECT COUNT(DISTINCT guid) FROM activity WHERE guid NOT IN ( SELECT DISTINCT guid FROM activity WHERE when < CURDATE() - INTERVAL 7 DAYS ) AND when BETWEEN CURDATE() AND CURDATE() - INTERVAL 7 DAYS; ``` change the 7 days to how ever long.