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 |
|---|---|---|---|---|---|
643,662 | I'm fairly newbie to these concepts, so please try to give a simply answer.
Electric energy is often compared to gravitational energy. This analogy helps to understand the concept of voltage. With gravitation, there is a *potential difference* between two points (given that they're not in the same height), and this po... | 2021/06/06 | [
"https://physics.stackexchange.com/questions/643662",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/299695/"
] | Ever since the discovery of calculus mathematics, mathematical functions are used in order to model observations and special axioms are introduced in order to connect the pure numbers of mathematics with observable numbers.
Waves in water, the first waves to be observed are defined by their height and frequency in tim... | For the layman: The defining characteristic of a wave is that it takes time for an influence to travel from place to place. E.g. Throw a stone in the water, and the influence (ripples) takes time to travel across the pond.
Physics deals with abstract entities where the medium is not always physical, from water waves (... |
643,662 | I'm fairly newbie to these concepts, so please try to give a simply answer.
Electric energy is often compared to gravitational energy. This analogy helps to understand the concept of voltage. With gravitation, there is a *potential difference* between two points (given that they're not in the same height), and this po... | 2021/06/06 | [
"https://physics.stackexchange.com/questions/643662",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/299695/"
] | A wave is simply a function of space and time $F(\vec r, t)$ such that the value of $F$ at any point $\vec r$ and time $t$ depends on its values at nearby points and times in a deterministic way that is described mathematical by an equation called the [wave equation](https://en.wikipedia.org/wiki/Wave_equation).
What ... | Broadly, a wave is simply a quantity that changes in a periodic way over space and/or time.
In the case of a water wave, the changing quantity is the distance through which the surface is displaced- or, if you like, just the height of the surface.
With a wave on a string, the changing quantity is the displacement of ... |
643,662 | I'm fairly newbie to these concepts, so please try to give a simply answer.
Electric energy is often compared to gravitational energy. This analogy helps to understand the concept of voltage. With gravitation, there is a *potential difference* between two points (given that they're not in the same height), and this po... | 2021/06/06 | [
"https://physics.stackexchange.com/questions/643662",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/299695/"
] | A wave is simply a function of space and time $F(\vec r, t)$ such that the value of $F$ at any point $\vec r$ and time $t$ depends on its values at nearby points and times in a deterministic way that is described mathematical by an equation called the [wave equation](https://en.wikipedia.org/wiki/Wave_equation).
What ... | For the layman: The defining characteristic of a wave is that it takes time for an influence to travel from place to place. E.g. Throw a stone in the water, and the influence (ripples) takes time to travel across the pond.
Physics deals with abstract entities where the medium is not always physical, from water waves (... |
643,662 | I'm fairly newbie to these concepts, so please try to give a simply answer.
Electric energy is often compared to gravitational energy. This analogy helps to understand the concept of voltage. With gravitation, there is a *potential difference* between two points (given that they're not in the same height), and this po... | 2021/06/06 | [
"https://physics.stackexchange.com/questions/643662",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/299695/"
] | I assume that your question is about electromagnetic waves and light. This the same question that Huygens asked himself about light in the 17th century. He noticed that sound does not travel through vacuum whereas light does. Newton's solution we was that light consists of particles. This however does not explain the w... | Broadly, a wave is simply a quantity that changes in a periodic way over space and/or time.
In the case of a water wave, the changing quantity is the distance through which the surface is displaced- or, if you like, just the height of the surface.
With a wave on a string, the changing quantity is the displacement of ... |
643,662 | I'm fairly newbie to these concepts, so please try to give a simply answer.
Electric energy is often compared to gravitational energy. This analogy helps to understand the concept of voltage. With gravitation, there is a *potential difference* between two points (given that they're not in the same height), and this po... | 2021/06/06 | [
"https://physics.stackexchange.com/questions/643662",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/299695/"
] | I assume that your question is about electromagnetic waves and light. This the same question that Huygens asked himself about light in the 17th century. He noticed that sound does not travel through vacuum whereas light does. Newton's solution we was that light consists of particles. This however does not explain the w... | For the layman: The defining characteristic of a wave is that it takes time for an influence to travel from place to place. E.g. Throw a stone in the water, and the influence (ripples) takes time to travel across the pond.
Physics deals with abstract entities where the medium is not always physical, from water waves (... |
16,429,089 | I have 2 buttons.
Button A: A button.
Button B: Submit button.
What I am trying to do is, when user clicks on button A, it will send him a link.
But he won't be able to submit using button B until 8 seconds has passed since when he clicked on button A.
I am not to sure if its possible to do with PHP, is it?
If not, ... | 2013/05/07 | [
"https://Stackoverflow.com/questions/16429089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2352485/"
] | I managed to solve it by changing the default schema for the user name to dbo, in SQL Server Management Studio | What is the value set as DB objects schema in Site Manager -> Settings - > System?
This setting should match the DB schema and also, all the object should have it the same. I would recommend to unify the tables and views schema to have one and the same name. |
16,429,089 | I have 2 buttons.
Button A: A button.
Button B: Submit button.
What I am trying to do is, when user clicks on button A, it will send him a link.
But he won't be able to submit using button B until 8 seconds has passed since when he clicked on button A.
I am not to sure if its possible to do with PHP, is it?
If not, ... | 2013/05/07 | [
"https://Stackoverflow.com/questions/16429089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2352485/"
] | What is the value set as DB objects schema in Site Manager -> Settings - > System?
This setting should match the DB schema and also, all the object should have it the same. I would recommend to unify the tables and views schema to have one and the same name. | Have you same installation on both machines? This issue occur when you don't have installed all modules as on origin machine (even if you don't use them). Try to exlude all Ecommerce object of System tables when you configure Import. |
16,429,089 | I have 2 buttons.
Button A: A button.
Button B: Submit button.
What I am trying to do is, when user clicks on button A, it will send him a link.
But he won't be able to submit using button B until 8 seconds has passed since when he clicked on button A.
I am not to sure if its possible to do with PHP, is it?
If not, ... | 2013/05/07 | [
"https://Stackoverflow.com/questions/16429089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2352485/"
] | I managed to solve it by changing the default schema for the user name to dbo, in SQL Server Management Studio | Have you same installation on both machines? This issue occur when you don't have installed all modules as on origin machine (even if you don't use them). Try to exlude all Ecommerce object of System tables when you configure Import. |
17,356 | I have a limited amount of data included in my internet plan. If I exceed that limit I get charged extra. So, before signing up for Bitcoin, I'd like to know whether Bitcoin mining causes a lot of internet traffic. Does it involve a lot of downloading and uploading throughout the day? | 2013/11/27 | [
"https://bitcoin.stackexchange.com/questions/17356",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/9417/"
] | If you mine with a pool, your actual internet activity will be fairly small. I just took a look at my network statistics and BFGMiner used 9MBytes down and 11 MBytes up over the previous 24-hour period.
The Bitcoin-Qt application on the other hand maxes out my upload bandwidth since I always seem to get 2-3 peers who ... | If you use a light wallet like Electrum, definitely not. But even if you run a full node, it is unlikely. You could also use a web-based wallet like blockchain.info which would mean that nothing at all is running on your local computer and you can access it from anywhere. |
30,050,777 | I have a section of code as follows:
```
var percentageTemp =((parseInt(score)/parseInt(guesses))*100);
var percentage= percentageTemp.toFixed(2);
```
`score` and `guesses` are both set to *0* at the start of the code, and are altered as the user plays the game. The code works as it should, exept if I leave `score` ... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30050777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4129463/"
] | >
> The code works as it should, exept if I leave score variable 0, I get a NaN output.
>
>
>
You shouldn't do (examples from the Node.JS REPL):
>
>
> ```
> > var score = 0; var guesses = 1; var percentageTemp =((parseInt(score)/parseInt(guesses))*100); var percentage= percentageTemp.toFixed(2); console.log(per... | I'd advise using a radix. parseInt(score, 10) to ensure the value doesn't get converted to hexadecimal. Also, note that javascripts handling of decimal numbers is not accurate. Try putting this in your console - (0.1 + 0.2) and see an unusual value returned - 0.30000000000000004 |
54,405,955 | I want add a script code function in my html page, i'm tried using $(element).append('my script') but, this method has add like a text, no like code.
How i can do this?
I executed this code in my page console:
```
document.querySelector("body").append('<script> function validarValorElemento(e){ var xpathWay = "xpa... | 2019/01/28 | [
"https://Stackoverflow.com/questions/54405955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10802446/"
] | ***IF*** I understand your question correctly -- that is, if you want to inject code into an existing webpage where you don't have access to the source code -- then:
The simplest way to do this is with a browser extension called [TamperMonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejm... | Why don't you just add it inside the HTML directly?
However, you can insert any tag with content into your HTML via JavaScript like this:
```js
var htmlToInsert = '<div class="inserted">I am added dynamically</div>';
var target = document.querySelector('#container');
target.innerHTML += htmlToInsert;
```
```css
#... |
738,377 | My English may not be perfect since I'm not a native speaker, so please do point out the grammar mistakes if there are any.
I've been reading Conway's "Functions of One Complex Variable", and encountered following exercise in the book (p. 17). $X$ here is a metric space and $d$ is the metric of it.
Show that if $F\su... | 2014/04/03 | [
"https://math.stackexchange.com/questions/738377",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/92456/"
] | Here is an long alternative to Stefan's succinct proof:
If $a,b \in F$ and $\epsilon>0$, let an $\epsilon$-path be a finite sequence of points satisfying the condition in the question.
Suppose $F$ is connected. Let $a \in F$ and $\epsilon>0$. Let $U\_a(0) = B(a,\epsilon) \cap F$, and $U\_a(n+1) = \cup\_{x \in U\_a(n)... | Your approach seems correct. Your set contains the point $a$, so it's nonempty. For the openness pick any point and show that an open ball of radius $\varepsilon$ is contained in the set too. For the closedness pick a point in the closure and show there's a point from the set that is $\varepsilon$ close to it.
So your... |
738,377 | My English may not be perfect since I'm not a native speaker, so please do point out the grammar mistakes if there are any.
I've been reading Conway's "Functions of One Complex Variable", and encountered following exercise in the book (p. 17). $X$ here is a metric space and $d$ is the metric of it.
Show that if $F\su... | 2014/04/03 | [
"https://math.stackexchange.com/questions/738377",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/92456/"
] | The set $S$ should depend on a particular $ϵ$, so
$$S\_ϵ=\{b\in F\mid \exists\{z\_o,...,z\_n\}\subseteq F,\ z\_0=a,\ z\_n=b,\ d(z\_n,z\_{m+1})<ϵ\}$$
You can show that $S\_ϵ$ is open in $F$: If $b\in S\_ϵ$, and $(z\_0,...,z\_n)$ is the sequence from $a$ to $b$ in $F$, then the ball $B\_{ϵ-d(z\_n,z\_{n-1})}(b)$ is conta... | Your approach seems correct. Your set contains the point $a$, so it's nonempty. For the openness pick any point and show that an open ball of radius $\varepsilon$ is contained in the set too. For the closedness pick a point in the closure and show there's a point from the set that is $\varepsilon$ close to it.
So your... |
73,273,777 | List all the ways that 1, 2, and 3 can add up to 4, the order matters. For example, `[1, 1, 1, 1]` is one way. `[1,1,2]` is different from `[1,2,1]`
I have figured out one way it works on paper. But I still cannot write the code for it. Please help and Please check out this picture of [My Idea](https://i.stack.imgur.c... | 2022/08/08 | [
"https://Stackoverflow.com/questions/73273777",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17173084/"
] | You have three issues in the method:
1. `;` after declaration
2. method's arguments should not be *redeclared*
3. you should *return* `List<int>` from the method
Code:
```
static List<int> Merge(List<int> list_a, List<int> list_b) // no ; here
{
// You should not redclare list_a and list_b
L... | Your method should return a List value. Your method never returns anything.
Add `return combined;` at the end of your method or make your method a `void` |
19,938 | I'm currently trying to implement a simple file-upload form with CraftCMS.
However, even though there are no errors on submitting the form, no file actually seems to get uploaded.
This is the form:
```
<form action="" method="post" accept-charset="UTF-8" enctype="multipart/form-data">
<input type="hidden" na... | 2017/04/13 | [
"https://craftcms.stackexchange.com/questions/19938",
"https://craftcms.stackexchange.com",
"https://craftcms.stackexchange.com/users/5798/"
] | Have you tried enabling devMode in the craft/config/general.php file? You can do this by adding `'devMode' => true` to the array. You should then be able to see an error on submission.
If this fails to output anything then it could be that your input requires square brackets adding to the name, e.g. `name="useruploads... | Doesn't look like the field name is correct - you should be using the `fields` namespace for all the actual Entry fields. For the upload, for example, you should be using `fields[useruploads]`.
You can find more information about Asset uploads specifically [here](https://craftcms.com/docs/assets-fields#uploading-files... |
3,003,271 | Please tell me if there is a duplicate; I can't find any question that does answer me; If you find one, I'll remove my question. Thank you :)
---
>
> Prove that $2\cos36° = 2\sin18° +1$.
>
>
>
I saw people proving it by identities [here](https://www.quora.com/How-can-I-solve-cos-36-sin-18-1-2), or I can also pro... | 2018/11/18 | [
"https://math.stackexchange.com/questions/3003271",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/515374/"
] | You can pull it off with your diagram, but you will also need
$\color{blue}{\Phi^2=\Phi+1}$ (which is already implied in your diagram).
Take one of the isoceles triangles with sides $\Phi$, $\Phi$ and $1$; split it in half to obtain a right-angled triangle with sides $\Phi$, "something" and $1/2$; then you can comput... | Let the top vertex be called $A$, the left arm vertex be called $B$, the next line intersection on that very horizontal line be called $C$ the center point be called $D$, the next line intersection there be called $E$ and the right arm point be called $F$.
Then you already displayed that $AB=\Phi^2$. Thus from the tr... |
36,761,091 | I am not able to access function b(). How can I call function b() outside?
```
function a() {
function b() {
alert("I am in b function");
}
}
``` | 2016/04/21 | [
"https://Stackoverflow.com/questions/36761091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5917166/"
] | You can't, unless you modify `a` to make `b` available outside of `a`. As it stands now, `b` is completely private to `a`.
There are lots of ways `a` could make `b` available outside of itself:
1. Return it
2. Return an object that has `b` on one of its properties
3. Assign it to a variable `a` closes over
4. Assign ... | Can't you do the below thing
```
function a() {
b();
}
function b() {
alert("I am in b function");
}
``` |
36,761,091 | I am not able to access function b(). How can I call function b() outside?
```
function a() {
function b() {
alert("I am in b function");
}
}
``` | 2016/04/21 | [
"https://Stackoverflow.com/questions/36761091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5917166/"
] | You can't, unless you modify `a` to make `b` available outside of `a`. As it stands now, `b` is completely private to `a`.
There are lots of ways `a` could make `b` available outside of itself:
1. Return it
2. Return an object that has `b` on one of its properties
3. Assign it to a variable `a` closes over
4. Assign ... | Following @ArunPJohny's comment, you can do something like this:
```js
var a = (function a() {
function b() {
alert("I am in b function");
}
return {
b: b
}
})();
a.b();
```
The above is called the [revealing module pattern](https://addyosmani.com/resources/essentialjsdesignpatterns/b... |
59,610,380 | Is there a way to deserialize GenericRecord (which I just got from Kafka message) to nested POJO? I am actually tying to deserialize it to Scala's case class but I realize that's even harder. I searched through the internet and it seems everyone was doing it manually. Are you aware of any library which is able to do th... | 2020/01/06 | [
"https://Stackoverflow.com/questions/59610380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3045201/"
] | ```
Chart.helpers.each(Chart.instances, function(instance){
console.log(instance);
});
```
Update:
<https://jsfiddle.net/furd1L27/14/> | I would recommend to store all data sent to chart in arrays. Once the array is updated you can send:
>
> HTTP/AJAX/SOCKET.IO
>
>
>
indication to the client, and update the chart. |
59,610,380 | Is there a way to deserialize GenericRecord (which I just got from Kafka message) to nested POJO? I am actually tying to deserialize it to Scala's case class but I realize that's even harder. I searched through the internet and it seems everyone was doing it manually. Are you aware of any library which is able to do th... | 2020/01/06 | [
"https://Stackoverflow.com/questions/59610380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3045201/"
] | ChartJS API actually offers the [`getChart`](https://www.chartjs.org/docs/latest/developers/api.html#static-getchart-key) method to do what you want:
```js
let chart = Chart.getChart('chart-2'); // Select by canvas ID
// OR
let canvas = document.querySelector('#chart-2')
let chart = Chart.getChart(canvas); // Select u... | I would recommend to store all data sent to chart in arrays. Once the array is updated you can send:
>
> HTTP/AJAX/SOCKET.IO
>
>
>
indication to the client, and update the chart. |
45,456,182 | ```
typedef enum {my_false, my_true = 5, my_maybe = 3} my_bool;
my_bool f(){return 2;}
int g(){return my_true;}
int main (){
my_bool mb = f();
int i = f();
printf("%d--%d\n", mb==i, mb);
mb = g();
i = g();
printf("%d--%d\n", mb==i, mb);
return 0;
}
```
What is happening when a function... | 2017/08/02 | [
"https://Stackoverflow.com/questions/45456182",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3512538/"
] | Enums can take any value in their range. The range is defined by the bits needed to represent all enumerators. In your case, you need 3 bits for `my_true`, which gives a range 0-7.
Enumerators are essentially named constants, and there's no reason why you can't have two constants that happen to have the same value. P... | enums can be implemented as `char` ,`int` or `unsigned int` and it is left for the implementation. From the warning you get the information that your gcc compiler implements the `unsigned int`. |
311,836 | A charged particle $q$ enters a uniform magnetic field $\vec{B}$ with velocity $\vec{v}$ making an angle $\theta$ with it. Since the Lorentz force is perpendicular to the velocity, the particle will move along a circular path of radius $r$, which *my textbook* derives as follows:
$$\frac{mv^2}{r}=qvB \sin\theta$$
$$r=... | 2017/02/13 | [
"https://physics.stackexchange.com/questions/311836",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/112205/"
] | Your derivation is correct and your book is incorrect unless the $v$ in their equation is the component of velocity perpendicular to the magnetic field?
The diagram below assumes a positive charge.
[](https://i.stack.imgur.com/6GYqt.jpg)
The radiu... | .this is the ans for the question |
311,836 | A charged particle $q$ enters a uniform magnetic field $\vec{B}$ with velocity $\vec{v}$ making an angle $\theta$ with it. Since the Lorentz force is perpendicular to the velocity, the particle will move along a circular path of radius $r$, which *my textbook* derives as follows:
$$\frac{mv^2}{r}=qvB \sin\theta$$
$$r=... | 2017/02/13 | [
"https://physics.stackexchange.com/questions/311836",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/112205/"
] | Your derivation is correct and your book is incorrect unless the $v$ in their equation is the component of velocity perpendicular to the magnetic field?
The diagram below assumes a positive charge.
[](https://i.stack.imgur.com/6GYqt.jpg)
The radiu... | It is easy to see that the book answer r = mv/qBsin θ is correct.
Ask yourself what happens to the radius as the strength of the magnetic field decreases. Since the component of the magnetic field producing a force on the charge is smaller than 1.0 for any θ less than 90 degrees the book's formula correctly describes ... |
311,836 | A charged particle $q$ enters a uniform magnetic field $\vec{B}$ with velocity $\vec{v}$ making an angle $\theta$ with it. Since the Lorentz force is perpendicular to the velocity, the particle will move along a circular path of radius $r$, which *my textbook* derives as follows:
$$\frac{mv^2}{r}=qvB \sin\theta$$
$$r=... | 2017/02/13 | [
"https://physics.stackexchange.com/questions/311836",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/112205/"
] | It is easy to see that the book answer r = mv/qBsin θ is correct.
Ask yourself what happens to the radius as the strength of the magnetic field decreases. Since the component of the magnetic field producing a force on the charge is smaller than 1.0 for any θ less than 90 degrees the book's formula correctly describes ... | .this is the ans for the question |
26,607,435 | I want to upload users into lync by an xml file. is there any lync api or c# code to do it??
I have xml file like below
```
<ns1:LyncOnlineAcpUsers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://schemas.microsoft.com/online/mco/2011/02/acp">-<ns1:ACPUser><ns1:Username>first.las... | 2014/10/28 | [
"https://Stackoverflow.com/questions/26607435",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2369697/"
] | Hope so this will help you
```
public class RangingActivity extends Activity implements BeaconConsumer {
protected static final String TAG = "RangingActivity";
private static final String UUID = "XXXXXXXXXXXXXXXXXXXX";
private BeaconManager beaconManager = BeaconManager.getInstanceForApplication(this);
... | pass major and minor in place of null
```
Region region = new Region("myRangingUniqueId", uUID, major, minor);
``` |
2,339,560 | DTF does not call the second action if the custom action assembly has more than one action. It always calls only the first action. As a workaround, I am using one action in one assembly. It works perfectly always.
Do you have any idea on this issue?
```
public class CustomActions
{
[CustomAction]
public stat... | 2010/02/26 | [
"https://Stackoverflow.com/questions/2339560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281321/"
] | I've never seen this problem as I group custom actions together in a single assembly all the time. Each method will be exported as type 1 entry points and then you write a custom action for each exported function. Windows Installer calls the CA which calls the function which fires up the CLR and invokes the static meth... | It might seem an obvious thing, but still. When you define a custom actions in your wxs file, do you specify different values in "DllEntry" attribute? This attribute points out a method, which is actually your CA. If you copy/paste custom action definitions, you might just forget to change the DllEntry... |
2,339,560 | DTF does not call the second action if the custom action assembly has more than one action. It always calls only the first action. As a workaround, I am using one action in one assembly. It works perfectly always.
Do you have any idea on this issue?
```
public class CustomActions
{
[CustomAction]
public stat... | 2010/02/26 | [
"https://Stackoverflow.com/questions/2339560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281321/"
] | I've never seen this problem as I group custom actions together in a single assembly all the time. Each method will be exported as type 1 entry points and then you write a custom action for each exported function. Windows Installer calls the CA which calls the function which fires up the CLR and invokes the static meth... | Probably, it will be helpful for some searchers, especially for .Net novices: double check that class and static method of custom action entry is public! |
2,339,560 | DTF does not call the second action if the custom action assembly has more than one action. It always calls only the first action. As a workaround, I am using one action in one assembly. It works perfectly always.
Do you have any idea on this issue?
```
public class CustomActions
{
[CustomAction]
public stat... | 2010/02/26 | [
"https://Stackoverflow.com/questions/2339560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281321/"
] | Probably, it will be helpful for some searchers, especially for .Net novices: double check that class and static method of custom action entry is public! | It might seem an obvious thing, but still. When you define a custom actions in your wxs file, do you specify different values in "DllEntry" attribute? This attribute points out a method, which is actually your CA. If you copy/paste custom action definitions, you might just forget to change the DllEntry... |
1,310,843 | I use cron jobs to execute shell scripts which are very simple invocations of wget. Here's one such example:
```
#!/bin/sh
fileName="WRTI-"$(date +"%m-%d-%Y-%H%M")
directory=/volume1/multimedia/Internet\ Radio\ Recordings/WRTI/$1/
wget http://playerservices.streamtheworld.com/api/livestream-redirect/WRTI_JAZZ.mp3 -O ... | 2018/04/04 | [
"https://superuser.com/questions/1310843",
"https://superuser.com",
"https://superuser.com/users/366999/"
] | As C0deDaedalus wrote, `wget -c` means to resume downloading a partially downloaded file by sending the "Range" header. Since you're dealing with a live internet stream, this flag won't work as intended. At best, it may enable you to continue appending the stream into the same downloaded file, ignoring the fact that yo... | Well, To continue interrupted downloads with `wget` you can use **`-c`** option that means to continue.
```
wget -c http://playerservices.streamtheworld.com/api/livestream-redirect/WRTI_JAZZ.mp3 -O "$directory$fileName.mp3" -q
```
Some points here :
* It assumes that you have partial downloaded file on your local s... |
11,968,860 | Is this possible? It shouldn't be but sometimes its behavior is quite against ordinary programming sense. | 2012/08/15 | [
"https://Stackoverflow.com/questions/11968860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/27943/"
] | No, Matlab isn't affected by indentation.
They do have editors that will automatically indent the code for you, but it is for readability purposes only. Keeping your code readable with [smart-indenting](http://blogs.mathworks.com/community/2009/05/11/keep-your-code-readable-with-smart-indenting/) is always a good idea... | It'll give you warnings if you don't indent properly. If you make a if or for loop or something like that and the end block isn't inline with it you'll get a possible warning that says the statement might not be aligned with its end block. CRTL+A CTRL+I is easy enough though. |
11,947,858 | I am just starting out with Windows 8 development using HTML/JS. I've spent the last few months immersed in jQuery development for apps targeting vehicle head-units and televisions.
Jumping into this, I thought the transition would be simple. I have the design and structure of my site all figured out for the most part... | 2012/08/14 | [
"https://Stackoverflow.com/questions/11947858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/711596/"
] | I fixed by simply changing the line of jQuery that was causing the error.
jQuery-1.8.0, line 5566:
```
append: function () {
return this.domManip(arguments, true, function (elem) {
if (this.nodeType === 1 || this.nodeType === 11) {
self.appendChild(elem); // problem line
... | Depending on your app, if you are not intending to access any WinRT components, you can navigate your page to ms-appx-web which will change the security policy around the page, but you can't specify this from start up. You would have to do a navigate, and leverage that new securyt context.
The other option you have it... |
11,947,858 | I am just starting out with Windows 8 development using HTML/JS. I've spent the last few months immersed in jQuery development for apps targeting vehicle head-units and televisions.
Jumping into this, I thought the transition would be simple. I have the design and structure of my site all figured out for the most part... | 2012/08/14 | [
"https://Stackoverflow.com/questions/11947858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/711596/"
] | There is a "formal" way to do what you are seeking.
WinJS.Navigation is provided to support "single page apps". For example, the `default.html` would contain a markup that would represent where the dynamically loaded page content would go:
```
<div id="contenthost"
data-win-control="Application.PageControlNavi... | Depending on your app, if you are not intending to access any WinRT components, you can navigate your page to ms-appx-web which will change the security policy around the page, but you can't specify this from start up. You would have to do a navigate, and leverage that new securyt context.
The other option you have it... |
66,780 | I'm trying to categorize my knowledge. Can I place block ciphers and stream ciphers under *symmetric* with RSA/DH under *asymmetric*? | 2019/01/25 | [
"https://crypto.stackexchange.com/questions/66780",
"https://crypto.stackexchange.com",
"https://crypto.stackexchange.com/users/61031/"
] | This is almost correct and in general these two classes of algorithms are distinct.
However, Simon Shepherd published a paper called **Public Key Stream Ciphers** in the *IEE Colloquium on Security & Cryptography Applications to Radio Systems, London, 3 June 1994*.
It proposes to essentially use the RSA setup and in... | >
> Can I place block ciphers and stream ciphers under symmetric with RSA/DH under asymmetric?
>
>
>
This sounds like you are trying to categorize RSA/DH as block/stream ciphers, which is not accurate.
It is possible to model RSA encryption as a block cipher, but that's an uncommon notion. "Public-key encryption"... |
3,175,194 | Is it possible to use "tabs"(indenting) in textarea using javascript. When tab button is clicked, the next form element is focused. But, i need to indent the text in textarea.
I am currently working in a project and any code with javascript or jquery will help me. | 2010/07/04 | [
"https://Stackoverflow.com/questions/3175194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306961/"
] | What about something like this:
```
<input onkeypress="if(event.keyCode == 9) { this.value += ' '; return false; }">
```
Basically, when you press the keyCode 9 (which is the Tab key) I return false. This prevents from focusing another element on the page.
To mimic the Tab spaces I just add the spaces myself to ... | Try this: capture the tab key in keypress events and stop propagation. I m not sure if this will work consistently across browsers; give it a try! |
3,175,194 | Is it possible to use "tabs"(indenting) in textarea using javascript. When tab button is clicked, the next form element is focused. But, i need to indent the text in textarea.
I am currently working in a project and any code with javascript or jquery will help me. | 2010/07/04 | [
"https://Stackoverflow.com/questions/3175194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306961/"
] | The best plugin I've seen for this is the [Tabs in Textarea plugin](http://teddevito.com/demos/textarea.html). You can try a demo [on its page](http://teddevito.com/demos/textarea.html).
The setup is fairly simple, since it has a simple *effect*:
```
$("textarea").tabby();
```
The thing that annoyed me most about o... | Try this: capture the tab key in keypress events and stop propagation. I m not sure if this will work consistently across browsers; give it a try! |
3,175,194 | Is it possible to use "tabs"(indenting) in textarea using javascript. When tab button is clicked, the next form element is focused. But, i need to indent the text in textarea.
I am currently working in a project and any code with javascript or jquery will help me. | 2010/07/04 | [
"https://Stackoverflow.com/questions/3175194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306961/"
] | The best plugin I've seen for this is the [Tabs in Textarea plugin](http://teddevito.com/demos/textarea.html). You can try a demo [on its page](http://teddevito.com/demos/textarea.html).
The setup is fairly simple, since it has a simple *effect*:
```
$("textarea").tabby();
```
The thing that annoyed me most about o... | What about something like this:
```
<input onkeypress="if(event.keyCode == 9) { this.value += ' '; return false; }">
```
Basically, when you press the keyCode 9 (which is the Tab key) I return false. This prevents from focusing another element on the page.
To mimic the Tab spaces I just add the spaces myself to ... |
22,847,351 | I'm wanting to filter the list of registered users based on their roles. I've managed to do it so that it shows users of one certain role but what I want to achieve is the complete opposite and show only the users who are *not* in that user group
This is the code I have:
```
var users = UserManager.Users.ToListAsync(... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22847351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2287870/"
] | I've managed to filter out the super admins who have secondary roles, fairly simple really, just get a list of user ids of super admins and remove them from the list of non-super admin users to find and remove those with the secondary role
```
var users = UserManager.Users.ToList();
var roles = RoleManager.Roles.Wher... | ```
var roles = RoleManager.Roles.Where(r => r.Name != "Super Admin").ToList();
var users = new List<User>();
foreach(var role in roles) {
users.AddRange(role.Users.ToList());
}
// 'users'-List contains all the users which do not have the 'Super Admin' role
```
(For a better perfomance get all ids of the roles... |
116,747 | I generally do my own electrical work but needed to upgrade my service from 100A to 200A so I hired someone. I had them add some outlets to my garage while they were at it because I was feeling lazy.
Today I decided to add more outlets and noticed they used low voltage brackets rather than the enclosed junction boxes ... | 2017/06/18 | [
"https://diy.stackexchange.com/questions/116747",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/70992/"
] | What sort of joker did *that*?
------------------------------
Clearly, whichever joker did that needs to be sent back to their apprentice electrician's training, because line voltage connections need to be in a box! If you see them around again, be sure to thwap them upside the head with NEC 300.15 for me, OK? (P.S. n... | Honestly, I would make a beeline to the town office. (After discreetly removing my extension if unpermitted).
Because the electrical inspector/permit issuer needs to know about this. First, they need to know that this guy out there making messes, so to watch out for him.
And second, you have to ask *if he filed for... |
38,990,356 | I am working on creating an Android app and I am facing a problem while enabling location directly from my app. On the first launch, when location permission is allowed, the app works correctly, but when it is reopened, the app crashes.
Here is the source code for my app:
```
public class MapsActivity extends Fragmen... | 2016/08/17 | [
"https://Stackoverflow.com/questions/38990356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6518328/"
] | Don't use `String(format:...)`. Use `NSNumberFormatter`:
```
let f = NSNumberFormatter()
f.maximumFractionDigits = 0
let s = f.stringFromNumber(-27790.00)!
print(s) // Output "-27790"
``` | Swift 4.0 iOS 11.x
Converting an NSNumber into a string ...
```
let temp:NSNumber = 5
let tempString = temp.stringValue
``` |
3,507,993 | >
> Evaluate $$\int \_0^1\:\frac{2-x^2}{(1+x)\sqrt{1-x^2}}dx$$
>
>
>
$$
\int \_0^1\:\frac{2-x^2}{(1+x)\sqrt{1-x^2}} \, dx = \int\_0^1 \bigg[\sqrt{\frac{1+x}{1-x}}+\frac{1}{(1-x)^{3/2}\sqrt{1+x}}\bigg] \, dx=\int\_0^1[f(x)+f'(x)]\,dx
$$
Does making it into the above final form helps somehow solve the given definite... | 2020/01/13 | [
"https://math.stackexchange.com/questions/3507993",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/223599/"
] | Let $x=\sin t$. Then,
$$\int \_0^1 \frac{2-x^2}{\left(1+x\right)\sqrt{1-x^2}}dx
=\int \_0^1\left(\frac{1}{\left(1+x\right)\sqrt{1-x^2}}
+\frac{\sqrt{1-x^2}}{1+x}\right)dx$$
$$=\int\_0^{\pi/2} \left( \frac{dt}{1+\sin t}+1-\sin t\right)dt$$
$$=\left(-\frac{\cos t}{1+\sin t} + t + \cos t\right)\_0^{\pi/2}=\frac\pi2$$ | $$x=:\sin u\implies dx=\cos u\,du\implies\int\_0^1\frac{2-x^2}{(1+x)\sqrt{1-x^2}}dx=\int\_0^{\pi/2}\frac{2-\sin^2u}{(1+\sin u)}\,du=$$
$$=\int\_0^{\pi/2}\left(\frac1{1+\sin u}+1-\sin u\right)du=\int\_0^{\pi/2}\frac{1-\sin u}{\cos^2u}+\left.\frac\pi2+\cos u\right|\_0^{\pi/2}=$$
$$=\left.\left(\tan u-\frac1{\cos u}\rig... |
21,374,599 | Office timings: `10:00 am to 18:00` pm.
Office Policy: Actually, our office policy is to pay employees stipend for overtime so they calculate overtime only above than `18:00 pm` clock time, even if the person arrives at office at `17:00 pm` and has worked upto `18:54 pm` even then he would be paid for `54mins overtime... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21374599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207757/"
] | Your question says that you are working on client side then use
```
OnClientClick="course(); return false;"
```
. | asp.net web forms will always do a postback on a runat="server" button click. that is how it reaches the code behind (.cs file). for client side clicks you can either use aspx ajax or jQuery click or javascript onclick functions to prevent postbacks. For this very reason more and more asp.net developers are moving to a... |
21,374,599 | Office timings: `10:00 am to 18:00` pm.
Office Policy: Actually, our office policy is to pay employees stipend for overtime so they calculate overtime only above than `18:00 pm` clock time, even if the person arrives at office at `17:00 pm` and has worked upto `18:54 pm` even then he would be paid for `54mins overtime... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21374599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207757/"
] | if you want to call javascript method use OnClientclick()
and if you want call both the methods use onclick event to call the code behind method i.e method in aspx.cs and inside use this code
```
ClientScript.RegisterStartupScript(this.GetType(), "JSScript", course());
``` | If you don't want to call any server side event on button click its better to use normal `html` `button` control.
Replace
```
<asp:Button id="b1" Text="Submit" runat="server" />
```
With
```
<input type="button" value="Submit">Submit</input>
``` |
21,374,599 | Office timings: `10:00 am to 18:00` pm.
Office Policy: Actually, our office policy is to pay employees stipend for overtime so they calculate overtime only above than `18:00 pm` clock time, even if the person arrives at office at `17:00 pm` and has worked upto `18:54 pm` even then he would be paid for `54mins overtime... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21374599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207757/"
] | asp.net web forms will always do a postback on a runat="server" button click. that is how it reaches the code behind (.cs file). for client side clicks you can either use aspx ajax or jQuery click or javascript onclick functions to prevent postbacks. For this very reason more and more asp.net developers are moving to a... | In your addcourse javascript function always return false and asp:button OnClientClick="return addcourse();"
\*\* Example \*\*
```
<asp:button id="Add" runat="Server" OnClientClick="return addcourse();"/>
```
\*\* JQuery \*\*
```
function addcourse()
{
//your code here
return false;
}
``` |
21,374,599 | Office timings: `10:00 am to 18:00` pm.
Office Policy: Actually, our office policy is to pay employees stipend for overtime so they calculate overtime only above than `18:00 pm` clock time, even if the person arrives at office at `17:00 pm` and has worked upto `18:54 pm` even then he would be paid for `54mins overtime... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21374599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207757/"
] | if you want to call javascript method use OnClientclick()
and if you want call both the methods use onclick event to call the code behind method i.e method in aspx.cs and inside use this code
```
ClientScript.RegisterStartupScript(this.GetType(), "JSScript", course());
``` | In your addcourse javascript function always return false and asp:button OnClientClick="return addcourse();"
\*\* Example \*\*
```
<asp:button id="Add" runat="Server" OnClientClick="return addcourse();"/>
```
\*\* JQuery \*\*
```
function addcourse()
{
//your code here
return false;
}
``` |
21,374,599 | Office timings: `10:00 am to 18:00` pm.
Office Policy: Actually, our office policy is to pay employees stipend for overtime so they calculate overtime only above than `18:00 pm` clock time, even if the person arrives at office at `17:00 pm` and has worked upto `18:54 pm` even then he would be paid for `54mins overtime... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21374599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207757/"
] | Your question says that you are working on client side then use
```
OnClientClick="course(); return false;"
```
. | In your addcourse javascript function always return false and asp:button OnClientClick="return addcourse();"
\*\* Example \*\*
```
<asp:button id="Add" runat="Server" OnClientClick="return addcourse();"/>
```
\*\* JQuery \*\*
```
function addcourse()
{
//your code here
return false;
}
``` |
21,374,599 | Office timings: `10:00 am to 18:00` pm.
Office Policy: Actually, our office policy is to pay employees stipend for overtime so they calculate overtime only above than `18:00 pm` clock time, even if the person arrives at office at `17:00 pm` and has worked upto `18:54 pm` even then he would be paid for `54mins overtime... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21374599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207757/"
] | asp.net web forms will always do a postback on a runat="server" button click. that is how it reaches the code behind (.cs file). for client side clicks you can either use aspx ajax or jQuery click or javascript onclick functions to prevent postbacks. For this very reason more and more asp.net developers are moving to a... | If you don't want to call any server side event on button click its better to use normal `html` `button` control.
Replace
```
<asp:Button id="b1" Text="Submit" runat="server" />
```
With
```
<input type="button" value="Submit">Submit</input>
``` |
21,374,599 | Office timings: `10:00 am to 18:00` pm.
Office Policy: Actually, our office policy is to pay employees stipend for overtime so they calculate overtime only above than `18:00 pm` clock time, even if the person arrives at office at `17:00 pm` and has worked upto `18:54 pm` even then he would be paid for `54mins overtime... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21374599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207757/"
] | asp.net web forms will always do a postback on a runat="server" button click. that is how it reaches the code behind (.cs file). for client side clicks you can either use aspx ajax or jQuery click or javascript onclick functions to prevent postbacks. For this very reason more and more asp.net developers are moving to a... | Your button on Edit.aspx have a property **runat="server"** remove it and your post back stops |
21,374,599 | Office timings: `10:00 am to 18:00` pm.
Office Policy: Actually, our office policy is to pay employees stipend for overtime so they calculate overtime only above than `18:00 pm` clock time, even if the person arrives at office at `17:00 pm` and has worked upto `18:54 pm` even then he would be paid for `54mins overtime... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21374599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207757/"
] | If you don't want to call any server side event on button click its better to use normal `html` `button` control.
Replace
```
<asp:Button id="b1" Text="Submit" runat="server" />
```
With
```
<input type="button" value="Submit">Submit</input>
``` | Your button on Edit.aspx have a property **runat="server"** remove it and your post back stops |
21,374,599 | Office timings: `10:00 am to 18:00` pm.
Office Policy: Actually, our office policy is to pay employees stipend for overtime so they calculate overtime only above than `18:00 pm` clock time, even if the person arrives at office at `17:00 pm` and has worked upto `18:54 pm` even then he would be paid for `54mins overtime... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21374599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207757/"
] | if you want to call javascript method use OnClientclick()
and if you want call both the methods use onclick event to call the code behind method i.e method in aspx.cs and inside use this code
```
ClientScript.RegisterStartupScript(this.GetType(), "JSScript", course());
``` | Your button on Edit.aspx have a property **runat="server"** remove it and your post back stops |
21,374,599 | Office timings: `10:00 am to 18:00` pm.
Office Policy: Actually, our office policy is to pay employees stipend for overtime so they calculate overtime only above than `18:00 pm` clock time, even if the person arrives at office at `17:00 pm` and has worked upto `18:54 pm` even then he would be paid for `54mins overtime... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21374599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3207757/"
] | Your question says that you are working on client side then use
```
OnClientClick="course(); return false;"
```
. | If you don't want to call any server side event on button click its better to use normal `html` `button` control.
Replace
```
<asp:Button id="b1" Text="Submit" runat="server" />
```
With
```
<input type="button" value="Submit">Submit</input>
``` |
443,708 | Is there a way to pass a call back function in a Java method?
The behavior I'm trying to mimic is a .Net Delegate being passed to a function.
I've seen people suggesting creating a separate object but that seems overkill, however I am aware that sometimes overkill is the only way to do things. | 2009/01/14 | [
"https://Stackoverflow.com/questions/443708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20400/"
] | yet i see there is most preferred way which was what i was looking for.. it's basically derived from these answers but i had to manipulate it to more more redundant and efficient.. **and i think everybody looking for what i come up with**
### To the point::
first make an Interface *that simple*
```java
public interf... | This is very easy in Java 8 with lambdas.
```
public interface Callback {
void callback();
}
public class Main {
public static void main(String[] args) {
methodThatExpectsACallback(() -> System.out.println("I am the callback."));
}
private static void methodThatExpectsACallback(Callback callba... |
443,708 | Is there a way to pass a call back function in a Java method?
The behavior I'm trying to mimic is a .Net Delegate being passed to a function.
I've seen people suggesting creating a separate object but that seems overkill, however I am aware that sometimes overkill is the only way to do things. | 2009/01/14 | [
"https://Stackoverflow.com/questions/443708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20400/"
] | When I need this kind of functionality in Java, I usually use the [Observer pattern](http://en.wikipedia.org/wiki/Observer_pattern). It does imply an extra object, but I think it's a clean way to go, and is a widely understood pattern, which helps with code readability. | Create an Interface, and Create the Same Interface Property in Callback Class.
```
interface dataFetchDelegate {
void didFetchdata(String data);
}
//callback class
public class BackendManager{
public dataFetchDelegate Delegate;
public void getData() {
//Do something, Http calls/ Any other work
... |
443,708 | Is there a way to pass a call back function in a Java method?
The behavior I'm trying to mimic is a .Net Delegate being passed to a function.
I've seen people suggesting creating a separate object but that seems overkill, however I am aware that sometimes overkill is the only way to do things. | 2009/01/14 | [
"https://Stackoverflow.com/questions/443708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20400/"
] | A method is not (yet) a first-class object in Java; you can't pass a function pointer as a callback. Instead, create an object (which usually implements an interface) that contains the method you need and pass that.
Proposals for closures in Java—which would provide the behavior you are looking for—have been made, but... | Check the closures how they have been implemented in the lambdaj library. They actually have a behavior very similar to C# delegates:
<http://code.google.com/p/lambdaj/wiki/Closures> |
443,708 | Is there a way to pass a call back function in a Java method?
The behavior I'm trying to mimic is a .Net Delegate being passed to a function.
I've seen people suggesting creating a separate object but that seems overkill, however I am aware that sometimes overkill is the only way to do things. | 2009/01/14 | [
"https://Stackoverflow.com/questions/443708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20400/"
] | it's a bit old, but nevertheless... I found the answer of Peter Wilkinson nice except for the fact that it does not work for primitive types like int/Integer.
The problem is the `.getClass()` for the `parameters[i]`, which returns for instance `java.lang.Integer`, which on the other hand will not be correctly interpre... | ```
public class HelloWorldAnonymousClasses {
//this is an interface with only one method
interface HelloWorld {
public void printSomething(String something);
}
//this is a simple function called from main()
public void sayHello() {
//this is an object with interface reference followe... |
443,708 | Is there a way to pass a call back function in a Java method?
The behavior I'm trying to mimic is a .Net Delegate being passed to a function.
I've seen people suggesting creating a separate object but that seems overkill, however I am aware that sometimes overkill is the only way to do things. | 2009/01/14 | [
"https://Stackoverflow.com/questions/443708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20400/"
] | Check the closures how they have been implemented in the lambdaj library. They actually have a behavior very similar to C# delegates:
<http://code.google.com/p/lambdaj/wiki/Closures> | Simpliest and easiest way is by creating a reusable model and trigger.... <https://onecompiler.com/java/3wejrcby2?fbclid=IwAR0dHbGDChRUJoCZ3CIDW-JQu7Dz3iYGNGYjxYVCPCWfEqQDogFGTwuOuO8> |
443,708 | Is there a way to pass a call back function in a Java method?
The behavior I'm trying to mimic is a .Net Delegate being passed to a function.
I've seen people suggesting creating a separate object but that seems overkill, however I am aware that sometimes overkill is the only way to do things. | 2009/01/14 | [
"https://Stackoverflow.com/questions/443708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20400/"
] | Since Java 8, there are lambda and method references:
* [Oracle Docs: Lambda Expressions](http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html)
* [Oracle Docs: Method References](http://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html)
For example, if you want a functional interf... | I found the idea of implementing using the reflect library interesting and came up with this which I think works quite well. The only down side is losing the compile time check that you are passing valid parameters.
```
public class CallBack {
private String methodName;
private Object scope;
public CallBa... |
443,708 | Is there a way to pass a call back function in a Java method?
The behavior I'm trying to mimic is a .Net Delegate being passed to a function.
I've seen people suggesting creating a separate object but that seems overkill, however I am aware that sometimes overkill is the only way to do things. | 2009/01/14 | [
"https://Stackoverflow.com/questions/443708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20400/"
] | This is very easy in Java 8 with lambdas.
```
public interface Callback {
void callback();
}
public class Main {
public static void main(String[] args) {
methodThatExpectsACallback(() -> System.out.println("I am the callback."));
}
private static void methodThatExpectsACallback(Callback callba... | I've recently started doing something like this:
```
public class Main {
@FunctionalInterface
public interface NotDotNetDelegate {
int doSomething(int a, int b);
}
public static void main(String[] args) {
// in java 8 (lambdas):
System.out.println(functionThatTakesDelegate((a, ... |
443,708 | Is there a way to pass a call back function in a Java method?
The behavior I'm trying to mimic is a .Net Delegate being passed to a function.
I've seen people suggesting creating a separate object but that seems overkill, however I am aware that sometimes overkill is the only way to do things. | 2009/01/14 | [
"https://Stackoverflow.com/questions/443708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20400/"
] | If you mean somthing like .NET anonymous delegate, I think Java's anonymous class can be used as well.
```
public class Main {
public interface Visitor{
int doJob(int a, int b);
}
public static void main(String[] args) {
Visitor adder = new Visitor(){
public int doJob(int a, ... | I've recently started doing something like this:
```
public class Main {
@FunctionalInterface
public interface NotDotNetDelegate {
int doSomething(int a, int b);
}
public static void main(String[] args) {
// in java 8 (lambdas):
System.out.println(functionThatTakesDelegate((a, ... |
443,708 | Is there a way to pass a call back function in a Java method?
The behavior I'm trying to mimic is a .Net Delegate being passed to a function.
I've seen people suggesting creating a separate object but that seems overkill, however I am aware that sometimes overkill is the only way to do things. | 2009/01/14 | [
"https://Stackoverflow.com/questions/443708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20400/"
] | You also can do the`Callback` using the `Delegate` pattern:
Callback.java
```
public interface Callback {
void onItemSelected(int position);
}
```
PagerActivity.java
```
public class PagerActivity implements Callback {
CustomPagerAdapter mPagerAdapter;
public PagerActivity() {
mPagerAdapter =... | Simpliest and easiest way is by creating a reusable model and trigger.... <https://onecompiler.com/java/3wejrcby2?fbclid=IwAR0dHbGDChRUJoCZ3CIDW-JQu7Dz3iYGNGYjxYVCPCWfEqQDogFGTwuOuO8> |
443,708 | Is there a way to pass a call back function in a Java method?
The behavior I'm trying to mimic is a .Net Delegate being passed to a function.
I've seen people suggesting creating a separate object but that seems overkill, however I am aware that sometimes overkill is the only way to do things. | 2009/01/14 | [
"https://Stackoverflow.com/questions/443708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20400/"
] | Since Java 8, there are lambda and method references:
* [Oracle Docs: Lambda Expressions](http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html)
* [Oracle Docs: Method References](http://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html)
For example, if you want a functional interf... | For simplicity, you can use a **Runnable**:
```
private void runCallback(Runnable callback)
{
// Run callback
callback.run();
}
```
Usage:
```
runCallback(new Runnable()
{
@Override
public void run()
{
// Running callback
}
});
```
or with Java8 lambdas
```
runCallback(() -> {
... |
15,429,854 | So I have a `UITableView`. Its dataSource is an `NSArray` of custom objects beeing loaded after a search. When I scroll to bottom, everything works fine, the `scrollIndicator` scrolls to bottom as desired.
Now when I scroll back to top the scrollIndicator stops about 50pixel below my UINavigationbar.
I have no idea ... | 2013/03/15 | [
"https://Stackoverflow.com/questions/15429854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1067062/"
] | It looks like you might have set the `scrollIndicatorInsets` property of the scroll view wrongly. It might be the same for both bottom and top. Set it so that that you only have the margin for bottom.
i.e
use `UIEdgeInsetMake( <top> , <left>,<bottom>,<right>);` for this. i.e for your case
```
yourScrollView.scrollInd... | As `UITableView's` superclass is `UIScrollView`, its better to set `UIScrollView's` `scrollIndicatorInsets` property to required position. |
11,065,853 | I want to toggle element that id's *pg* when click link.
header:
```
<title>Example</title>
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript">
$(function() {
$("#link").click(function() {
$("#pg").toggle();
... | 2012/06/16 | [
"https://Stackoverflow.com/questions/11065853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1291078/"
] | You're missing the final `});` for the statement
```
<title>Example</title>
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript">
$(function() {
$("#link").click(function() {
$("#pg").toggle();
});
)}; //<-- Missing close bracket
</script>
```... | close click function by adding `});`:
```
$(function() {
$("#link").click(function() {
$("#pg").toggle();
});
});
``` |
46,257,648 | I'm using AWS API Gateway and its HTTP Proxy.
I need to pass the `CloudFront-Viewer-Country` header to my endpoint. I tried following the same setup outlined in the following question
[Access headers in AWS API Gateway using HTTP Proxy?](https://stackoverflow.com/questions/35017297/access-headers-in-aws-api-gateway-us... | 2017/09/16 | [
"https://Stackoverflow.com/questions/46257648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3970440/"
] | For the resource and method where you want the header, go to Method Request → HTTP Request Headers → Add Header and set the Name as `CloudFront-Viewer-Country`. Click the circled checkmark to add. This exposed the header to the remainder of the execution flow.
Then, in Integration Request → HTTP Headers → Add Header.
... | I solved the problem by simply creating a new integration header named `Accept-Encoding` with value equal to `'identity'`
And all the missing headers appeared !! |
53,327,745 | I'm trying to read a timeStamp from Firebase and append it to an array.
I have made some progress:
```
var orderDateHistoryArray = [String:Int]()
func getOrderDates() {
let uid = Auth.auth().currentUser!.uid
let orderDateHistoryRef = Database.database().reference().child("users/\(uid)/Orders/"... | 2018/11/15 | [
"https://Stackoverflow.com/questions/53327745",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7860375/"
] | Your code as it is will run into negative numbers with months as well. Using the datetime library that was suggested you can do the following:
```
from datetime import datetime, timedelta
list_of_spendings = []
# Month number
for day in [(datetime.now()-timedelta(x)) for x in range(7)]:
print('How many liters di... | This is how I figured it out. "Dia" and "mes" are previously defined.
Translations:
```
listaGastos = listOfSpendings
gastos = spendings
dia = day
mes = month
DuracMes = monthlenght
diaC = currentDay
mesC = currentMonth
```
Code:
```
DuracMes = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
listaGastos = []
x = ... |
9,027,521 | Here is a sample of what I am trying to accomplish:
```
public class BaseClass<T>
{
public static T GetByID(int ID)
{
// Need database name here that is determined at design time in the derived class.
var databaseName = "";
// do some stuff involving database name that gets me object by... | 2012/01/27 | [
"https://Stackoverflow.com/questions/9027521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1172518/"
] | it renders the view's in the controller spec. If you don't put render\_views, the views won't render, that means the controller is called but after it returns the views are not rendered. Controller tests will run faster, as they won't have to render the view, but you might miss bugs in the view. | It's about [isolation](http://www.rubydoc.info/gems/rspec-rails/file/README.md#Controller_Specs). The idea is that you don't want your controller specs failing because there is a syntax error in the view, which should cause a request spec or a view spec to fail. If you're not writing request specs or view specs, or Cuc... |
252,483 | In my writing, I find that although the level of detail in something I am writing is a spectrum, there are two distinct categories for which most instances fall into only one of the two.
The first category is what I call "close-up" (by analogy with cinematography) or "zoomed in" writing. For example:
>
> He opened t... | 2015/06/14 | [
"https://english.stackexchange.com/questions/252483",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/77160/"
] | Easily the best question ever posted on the site, and I adore your conception and description of prose as zoomed-in and zoomed-out, close-up v. wide shots. I and I'm sure all writers constantly think about this fundamental tension - should I write most fundamental tension - in writing, and you're very insightful to con... | So many good words! a) *Pedantic*, *florid*. b) *Prosaic*, *straightforward*, *hemingwayesque*... etc.
Anyways, since you're uninterested in all that, you might be looking for ***purple prose*** and ***beige prose***. They specifically describe prose that is too blahblahblah and too blah, respectively. |
252,483 | In my writing, I find that although the level of detail in something I am writing is a spectrum, there are two distinct categories for which most instances fall into only one of the two.
The first category is what I call "close-up" (by analogy with cinematography) or "zoomed in" writing. For example:
>
> He opened t... | 2015/06/14 | [
"https://english.stackexchange.com/questions/252483",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/77160/"
] | So many good words! a) *Pedantic*, *florid*. b) *Prosaic*, *straightforward*, *hemingwayesque*... etc.
Anyways, since you're uninterested in all that, you might be looking for ***purple prose*** and ***beige prose***. They specifically describe prose that is too blahblahblah and too blah, respectively. | The `close voice` and `distant voice` terminology comes somewhere near to what you are describing. People talk about `close first person` narrative, when the words are apparently written from inside the character's head, whereas the distant voice would be words spoken by an imaginary narrator who may know things indivi... |
252,483 | In my writing, I find that although the level of detail in something I am writing is a spectrum, there are two distinct categories for which most instances fall into only one of the two.
The first category is what I call "close-up" (by analogy with cinematography) or "zoomed in" writing. For example:
>
> He opened t... | 2015/06/14 | [
"https://english.stackexchange.com/questions/252483",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/77160/"
] | Easily the best question ever posted on the site, and I adore your conception and description of prose as zoomed-in and zoomed-out, close-up v. wide shots. I and I'm sure all writers constantly think about this fundamental tension - should I write most fundamental tension - in writing, and you're very insightful to con... | The `close voice` and `distant voice` terminology comes somewhere near to what you are describing. People talk about `close first person` narrative, when the words are apparently written from inside the character's head, whereas the distant voice would be words spoken by an imaginary narrator who may know things indivi... |
38,362,230 | I wonder why Scala compiler couldn't infer a type of my combiner function. Here is the code
```
object WordsCount extends App {
import java.io.File
import scala.io.Source.fromFile
type CombinerType = (((String, Int), (String, Int)) => ((String, Int)))
val src = fromFile(new File("/Users/finkel/test/src/main... | 2016/07/13 | [
"https://Stackoverflow.com/questions/38362230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3552363/"
] | I haven't written Access queries in years and do not have it to try now, but if I remember correctly DateTime values in the query need to be surrounded with hash marks (#).
```
Dim qHrsWorked As String = _
"SELECT SUM(Hrs_worked) FROM Work WHERE IdEmployee = " & idEmptxt.Text & _
" AND Date >= #" & firstDayDTP... | I suspect this is because you use Textbox.Text for your datepickers. You can only use that property when the control has focus. Try replacing those with .Value ? |
38,362,230 | I wonder why Scala compiler couldn't infer a type of my combiner function. Here is the code
```
object WordsCount extends App {
import java.io.File
import scala.io.Source.fromFile
type CombinerType = (((String, Int), (String, Int)) => ((String, Int)))
val src = fromFile(new File("/Users/finkel/test/src/main... | 2016/07/13 | [
"https://Stackoverflow.com/questions/38362230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3552363/"
] | In SQL you must use a formatted string expression for the date values:
```
Dim qHrsWorked As String = "SELECT SUM(Hrs_worked) FROM Work WHERE IdEmployee = " & idEmptxt.Text & " AND Date >= #" & firstDayDTP.Value.ToString("yyyy'/'MM'/'dd") & "# AND Date <= #" & lastDayDTP.Value.ToString("yyyy'/'MM'/'dd") & "#"
``` | I suspect this is because you use Textbox.Text for your datepickers. You can only use that property when the control has focus. Try replacing those with .Value ? |
14,095,495 | I wanted to plot the coordinates on a Google Map in the presence of point id:
Sample of data:
```
coordinates id
1 (7.1735, 45.8688) 2
2 (7.17254, 45.8689) 3
3 (7.17164, 45.8692) 4
4 (7.18018, 45.8716) 5
5 (7.17807, 45.8701) 6
6 (7.17723,... | 2012/12/30 | [
"https://Stackoverflow.com/questions/14095495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1678285/"
] | Rather than request a map of 'Switzerland' from google, you should request a map of a specific location by specifying a longitude/latitude and desired zoom (and maybe scale). Then you won't have to use `coord_map()` and blur your image.
Here are the basics, you can play around with colors and sizes as in any ggplot:
... | One of the problems with plotting of your points is that if you use `zoom=10` in function `get_map()` then your points are outside the map and they want be plotted, so I used `zoom=5` instead.
```
library(ggmap)
map <- get_map(location = 'Switzerland', zoom = 5,
maptype = "terrain", source = "google"... |
15,182,445 | I'm trying to get a simple PHP service to produce XML for an iPhone application, sourcing from an SQL database. The database has a variety of text sources and characters, some of which seem to be throwing off the script and producing the following encoding error:
error on line 1 at column 6232: Encoding error
The php... | 2013/03/03 | [
"https://Stackoverflow.com/questions/15182445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1923903/"
] | ```
mysql_connect($config['mysql_host'],$config['mysql_user'],$config['mysql_pass']);
mysql_set_charset('utf8');
mysql_select_db($config['db_name']);
``` | As you have described the XML format as utf8 thus all the character in the XML File must be utf8 characters.
You are getting the error as there are non UTF8 Characters. You have to change the Character to UFT8 format and there are two ways for checking UTF8 characters
Way 1
=====
```
if (mb_check_encoding(file_get_c... |
15,182,445 | I'm trying to get a simple PHP service to produce XML for an iPhone application, sourcing from an SQL database. The database has a variety of text sources and characters, some of which seem to be throwing off the script and producing the following encoding error:
error on line 1 at column 6232: Encoding error
The php... | 2013/03/03 | [
"https://Stackoverflow.com/questions/15182445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1923903/"
] | Your question is really broad, the best answer I can give is that you should use some existing library to encode the XML instead of writing your own one (as you obviously fail with the job hence the XML encoding error reported by the XML consument).
Using an existing library would also allow you to point out problems ... | ```
mysql_connect($config['mysql_host'],$config['mysql_user'],$config['mysql_pass']);
mysql_set_charset('utf8');
mysql_select_db($config['db_name']);
``` |
15,182,445 | I'm trying to get a simple PHP service to produce XML for an iPhone application, sourcing from an SQL database. The database has a variety of text sources and characters, some of which seem to be throwing off the script and producing the following encoding error:
error on line 1 at column 6232: Encoding error
The php... | 2013/03/03 | [
"https://Stackoverflow.com/questions/15182445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1923903/"
] | Your question is really broad, the best answer I can give is that you should use some existing library to encode the XML instead of writing your own one (as you obviously fail with the job hence the XML encoding error reported by the XML consument).
Using an existing library would also allow you to point out problems ... | As you have described the XML format as utf8 thus all the character in the XML File must be utf8 characters.
You are getting the error as there are non UTF8 Characters. You have to change the Character to UFT8 format and there are two ways for checking UTF8 characters
Way 1
=====
```
if (mb_check_encoding(file_get_c... |
994,168 | If I know that:
•$f(x)$ is an increasing function
•$x<x+a$
•$\lim\_{x\to +\infty}f(x)=\lim\_{x\to +\infty}f(x+a)$
Can I conclude that $\lim\_{x\to +\infty}f(x)=\infty$ ?
Sorry if the question is silly. | 2014/10/27 | [
"https://math.stackexchange.com/questions/994168",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Hint. If $\sqrt[3]{2}+\sqrt[3]{4}$ rational, so is $1+\sqrt[3]{2}+\sqrt[3]{4}$, and so is
$$
\frac{1}{1+\sqrt[3]{2}+\sqrt[3]{4}}=\frac{(\sqrt[3]{2})^3-1}{(\sqrt[3]{2})^2+\sqrt[3]{2}+1}=\sqrt[3]{2}-1
$$
and hence so is $\sqrt[3]{2}$. | Hint: Find a polynomial with integer coefficients for which $\alpha = \sqrt[3]{2} + \sqrt[3]{4}$ is a root. Then you can use the Rational Roots Theorem. |
994,168 | If I know that:
•$f(x)$ is an increasing function
•$x<x+a$
•$\lim\_{x\to +\infty}f(x)=\lim\_{x\to +\infty}f(x+a)$
Can I conclude that $\lim\_{x\to +\infty}f(x)=\infty$ ?
Sorry if the question is silly. | 2014/10/27 | [
"https://math.stackexchange.com/questions/994168",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Let us rewrite
$$\sqrt[3]2+\sqrt[3]4=\color{blue}{1+\sqrt[3]2+\sqrt[3]4}-1=\color{blue}{\frac{\left(\sqrt[3]2\right)^3-1}{\sqrt[3]2-1}}-1=\frac{1}{\sqrt[3]2-1}-1.$$
If the left side were rational, what could we say about $\sqrt[3]2$ ? | Hint: Find a polynomial with integer coefficients for which $\alpha = \sqrt[3]{2} + \sqrt[3]{4}$ is a root. Then you can use the Rational Roots Theorem. |
994,168 | If I know that:
•$f(x)$ is an increasing function
•$x<x+a$
•$\lim\_{x\to +\infty}f(x)=\lim\_{x\to +\infty}f(x+a)$
Can I conclude that $\lim\_{x\to +\infty}f(x)=\infty$ ?
Sorry if the question is silly. | 2014/10/27 | [
"https://math.stackexchange.com/questions/994168",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Hint: Find a polynomial with integer coefficients for which $\alpha = \sqrt[3]{2} + \sqrt[3]{4}$ is a root. Then you can use the Rational Roots Theorem. | Suppose the sum is a rational number $r$, then $\sqrt[3]{4} = -\sqrt[3]{2} + r$, and cubing both sides: $4 = r^3 - 3r^2a + 3ra^2 - 2$, with $a = \sqrt[3]{2}$. Thus: $6 - r^3 = -3r^2a + 3r(r-a) \to a = \dfrac{6-r^3-3r^2}{-3r^2-3r} \in \mathbb{Q}$. But it can be proved that $a = \sqrt[3]{2} \notin \mathbb{Q}$, a contradi... |
994,168 | If I know that:
•$f(x)$ is an increasing function
•$x<x+a$
•$\lim\_{x\to +\infty}f(x)=\lim\_{x\to +\infty}f(x+a)$
Can I conclude that $\lim\_{x\to +\infty}f(x)=\infty$ ?
Sorry if the question is silly. | 2014/10/27 | [
"https://math.stackexchange.com/questions/994168",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Hint: Find a polynomial with integer coefficients for which $\alpha = \sqrt[3]{2} + \sqrt[3]{4}$ is a root. Then you can use the Rational Roots Theorem. | Write $\sqrt[3]{2} + \sqrt[3]{4} = \alpha + \alpha^2$, with $\alpha=\sqrt[3]{2}$.
Suppose $\alpha + \alpha^2 = q \in \Bbb Q$. Then $\alpha^2 + \alpha^3 = q \alpha$. Since $\alpha^3=2$, we get
$\quad\alpha + \alpha^2 = q$
$\quad\alpha^2 + 2= q \alpha$
Subtracting these, we get $\alpha-2=q-q \alpha$, and so $\alpha=\... |
994,168 | If I know that:
•$f(x)$ is an increasing function
•$x<x+a$
•$\lim\_{x\to +\infty}f(x)=\lim\_{x\to +\infty}f(x+a)$
Can I conclude that $\lim\_{x\to +\infty}f(x)=\infty$ ?
Sorry if the question is silly. | 2014/10/27 | [
"https://math.stackexchange.com/questions/994168",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Let us rewrite
$$\sqrt[3]2+\sqrt[3]4=\color{blue}{1+\sqrt[3]2+\sqrt[3]4}-1=\color{blue}{\frac{\left(\sqrt[3]2\right)^3-1}{\sqrt[3]2-1}}-1=\frac{1}{\sqrt[3]2-1}-1.$$
If the left side were rational, what could we say about $\sqrt[3]2$ ? | Hint. If $\sqrt[3]{2}+\sqrt[3]{4}$ rational, so is $1+\sqrt[3]{2}+\sqrt[3]{4}$, and so is
$$
\frac{1}{1+\sqrt[3]{2}+\sqrt[3]{4}}=\frac{(\sqrt[3]{2})^3-1}{(\sqrt[3]{2})^2+\sqrt[3]{2}+1}=\sqrt[3]{2}-1
$$
and hence so is $\sqrt[3]{2}$. |
994,168 | If I know that:
•$f(x)$ is an increasing function
•$x<x+a$
•$\lim\_{x\to +\infty}f(x)=\lim\_{x\to +\infty}f(x+a)$
Can I conclude that $\lim\_{x\to +\infty}f(x)=\infty$ ?
Sorry if the question is silly. | 2014/10/27 | [
"https://math.stackexchange.com/questions/994168",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Hint. If $\sqrt[3]{2}+\sqrt[3]{4}$ rational, so is $1+\sqrt[3]{2}+\sqrt[3]{4}$, and so is
$$
\frac{1}{1+\sqrt[3]{2}+\sqrt[3]{4}}=\frac{(\sqrt[3]{2})^3-1}{(\sqrt[3]{2})^2+\sqrt[3]{2}+1}=\sqrt[3]{2}-1
$$
and hence so is $\sqrt[3]{2}$. | Suppose the sum is a rational number $r$, then $\sqrt[3]{4} = -\sqrt[3]{2} + r$, and cubing both sides: $4 = r^3 - 3r^2a + 3ra^2 - 2$, with $a = \sqrt[3]{2}$. Thus: $6 - r^3 = -3r^2a + 3r(r-a) \to a = \dfrac{6-r^3-3r^2}{-3r^2-3r} \in \mathbb{Q}$. But it can be proved that $a = \sqrt[3]{2} \notin \mathbb{Q}$, a contradi... |
994,168 | If I know that:
•$f(x)$ is an increasing function
•$x<x+a$
•$\lim\_{x\to +\infty}f(x)=\lim\_{x\to +\infty}f(x+a)$
Can I conclude that $\lim\_{x\to +\infty}f(x)=\infty$ ?
Sorry if the question is silly. | 2014/10/27 | [
"https://math.stackexchange.com/questions/994168",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Hint. If $\sqrt[3]{2}+\sqrt[3]{4}$ rational, so is $1+\sqrt[3]{2}+\sqrt[3]{4}$, and so is
$$
\frac{1}{1+\sqrt[3]{2}+\sqrt[3]{4}}=\frac{(\sqrt[3]{2})^3-1}{(\sqrt[3]{2})^2+\sqrt[3]{2}+1}=\sqrt[3]{2}-1
$$
and hence so is $\sqrt[3]{2}$. | Write $\sqrt[3]{2} + \sqrt[3]{4} = \alpha + \alpha^2$, with $\alpha=\sqrt[3]{2}$.
Suppose $\alpha + \alpha^2 = q \in \Bbb Q$. Then $\alpha^2 + \alpha^3 = q \alpha$. Since $\alpha^3=2$, we get
$\quad\alpha + \alpha^2 = q$
$\quad\alpha^2 + 2= q \alpha$
Subtracting these, we get $\alpha-2=q-q \alpha$, and so $\alpha=\... |
994,168 | If I know that:
•$f(x)$ is an increasing function
•$x<x+a$
•$\lim\_{x\to +\infty}f(x)=\lim\_{x\to +\infty}f(x+a)$
Can I conclude that $\lim\_{x\to +\infty}f(x)=\infty$ ?
Sorry if the question is silly. | 2014/10/27 | [
"https://math.stackexchange.com/questions/994168",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Let us rewrite
$$\sqrt[3]2+\sqrt[3]4=\color{blue}{1+\sqrt[3]2+\sqrt[3]4}-1=\color{blue}{\frac{\left(\sqrt[3]2\right)^3-1}{\sqrt[3]2-1}}-1=\frac{1}{\sqrt[3]2-1}-1.$$
If the left side were rational, what could we say about $\sqrt[3]2$ ? | Suppose the sum is a rational number $r$, then $\sqrt[3]{4} = -\sqrt[3]{2} + r$, and cubing both sides: $4 = r^3 - 3r^2a + 3ra^2 - 2$, with $a = \sqrt[3]{2}$. Thus: $6 - r^3 = -3r^2a + 3r(r-a) \to a = \dfrac{6-r^3-3r^2}{-3r^2-3r} \in \mathbb{Q}$. But it can be proved that $a = \sqrt[3]{2} \notin \mathbb{Q}$, a contradi... |
994,168 | If I know that:
•$f(x)$ is an increasing function
•$x<x+a$
•$\lim\_{x\to +\infty}f(x)=\lim\_{x\to +\infty}f(x+a)$
Can I conclude that $\lim\_{x\to +\infty}f(x)=\infty$ ?
Sorry if the question is silly. | 2014/10/27 | [
"https://math.stackexchange.com/questions/994168",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Let us rewrite
$$\sqrt[3]2+\sqrt[3]4=\color{blue}{1+\sqrt[3]2+\sqrt[3]4}-1=\color{blue}{\frac{\left(\sqrt[3]2\right)^3-1}{\sqrt[3]2-1}}-1=\frac{1}{\sqrt[3]2-1}-1.$$
If the left side were rational, what could we say about $\sqrt[3]2$ ? | Write $\sqrt[3]{2} + \sqrt[3]{4} = \alpha + \alpha^2$, with $\alpha=\sqrt[3]{2}$.
Suppose $\alpha + \alpha^2 = q \in \Bbb Q$. Then $\alpha^2 + \alpha^3 = q \alpha$. Since $\alpha^3=2$, we get
$\quad\alpha + \alpha^2 = q$
$\quad\alpha^2 + 2= q \alpha$
Subtracting these, we get $\alpha-2=q-q \alpha$, and so $\alpha=\... |
164,853 | I know what `chgrp` and `chown` do.
My question is since `chown` does the same thing as `chgrp` (and even more), what is the point of `chgrp`? | 2014/10/29 | [
"https://unix.stackexchange.com/questions/164853",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/89629/"
] | When you use `chgrp` you are using a simple tool to change one thing... group permissions. For many people this is preferred over using `chown`, especially when you run the risk of mistyping a character while using the `chown` command and completely breaking permissions to whatever files/folder you specified.
So inste... | Remember:
* A file is owned by exactly one group and one user. That file may have varying permissions depending on the user and/or group attempting to use it.
* `chown` changes ownership of files to specified user/group
* `chmod` changes permissions of files to specified user/group
* `chgrp` changes ownership of file... |
31,440,774 | I have the following data frame:
```
> head(newdat2)
i42 i35 i32 i31 i30 i29 i28 i27 i26
1 5 5 5 5 5 5 5 5 5
5 3 3 2 2 4 4 4 3 2
6 5 5 5 2 5 5 5 5 5
7 5 5 5 5 5 5 5 5 5
8 4 5 4 3 5 4 4 3 4
11 ... | 2015/07/15 | [
"https://Stackoverflow.com/questions/31440774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4941925/"
] | Here's a possible implementation of the `is.na<-` replacement function
```
df[] <- lapply(df, function(x) `is.na<-`(x, !x %in% 1:5))
# i42 i35 i32 i31 i30 i29 i28 i27 i26
# 1 5 5 5 5 5 5 5 5 5
# 5 3 3 2 2 4 4 4 3 2
# 6 5 5 5 2 5 5 5 5 5
# 7 5 5 5 5 ... | Your approach can be made to work, you just need to get the boolean logic right. David Arenburg's answer offers a cleaner approach anyway, but you may find it useful to understand "what went wrong" with your attempt.
Note that `(x!=1)|(x!=2)` will evaluate to true for both 1 and 2 (as well as any other number): when `... |
16,798,450 | i have the following rules and when implementing them with bison i get 5 shift/reduce warnings.
a part of the Rules are:
```
Type----> BOOL
| INT
| CHAR
| DOUBLE
| ID
| INT '['']'
;
rule: VarDec rule
| VarDec
;
VarDec: Type ID ';'
;
```
and the `Parse... | 2013/05/28 | [
"https://Stackoverflow.com/questions/16798450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1436099/"
] | The above example is not enough to reproduce the shift/reduce conflicts. You probably have an instance of `rule` somewhere else that is followed by `VarDec` or the tokens it starts with.
If I add the following rule, I can reproduce the conflicts:
```
decl : rule VarDec;
```
That rule is causing your problems. | The conflict occurs in a state where there is a VarDec on top of the parse stack, and the next token is a BOOL, INT, CHAR, DOUBLE, or ID. The parser would then need to look at least two tokens ahead to determine whether it's looking at another VarDec -- in which case the correct action right now is to shift in anticipa... |
18,095,144 | I took the following code from another webpage "<http://www.javascriptkit.com/script/cut10.shtml>".
```
<SCRIPT>
function passWord() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1) history.go(-1);
if (pass1.toLowerCase() == "letmein") {... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18095144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2659279/"
] | Your code appears to *work* when visiting the link.
I know you're learning. Still, you shouldn't be doing authentication like this though as you're not really protecting anything. Anyone can read the source code by using the "View Page Code" option in any browser (typically right click on the page). This means **anyon... | Try this.. Just add access denied prompt inside the false case...
```
function passWord()
{
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3)
{
if (!pass1)
{
... |
18,095,144 | I took the following code from another webpage "<http://www.javascriptkit.com/script/cut10.shtml>".
```
<SCRIPT>
function passWord() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1) history.go(-1);
if (pass1.toLowerCase() == "letmein") {... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18095144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2659279/"
] | ```
//Add this to you script
function run(){
var password = prompt("Password Please");
//Change to your own Password
if(password != 'Sameer'){
document.body.innerHTML = '';
document.body.innerHTML = 'Password Failed! Reload to Renter Password';
}else{
alert('Success');
}
}
run();
``` | Try this.. Just add access denied prompt inside the false case...
```
function passWord()
{
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3)
{
if (!pass1)
{
... |
18,095,144 | I took the following code from another webpage "<http://www.javascriptkit.com/script/cut10.shtml>".
```
<SCRIPT>
function passWord() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1) history.go(-1);
if (pass1.toLowerCase() == "letmein") {... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18095144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2659279/"
] | Your code appears to *work* when visiting the link.
I know you're learning. Still, you shouldn't be doing authentication like this though as you're not really protecting anything. Anyone can read the source code by using the "View Page Code" option in any browser (typically right click on the page). This means **anyon... | I used the same exact code that you have and the problem is the the first time for don't know what reason it added one space in front of the input. Just make sure that you don't have that and it will be fine. |
18,095,144 | I took the following code from another webpage "<http://www.javascriptkit.com/script/cut10.shtml>".
```
<SCRIPT>
function passWord() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1) history.go(-1);
if (pass1.toLowerCase() == "letmein") {... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18095144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2659279/"
] | Your code appears to *work* when visiting the link.
I know you're learning. Still, you shouldn't be doing authentication like this though as you're not really protecting anything. Anyone can read the source code by using the "View Page Code" option in any browser (typically right click on the page). This means **anyon... | If you use a library to render the UI, you can use this function:
```js
export function setPasswordToEnter({
password,
localStorageKey,
errorMessage,
}) {
if (
!password ||
(localStorageKey && localStorage.getItem(localStorageKey) === password)
) {
return;
}
const input = prompt('Enter the p... |
18,095,144 | I took the following code from another webpage "<http://www.javascriptkit.com/script/cut10.shtml>".
```
<SCRIPT>
function passWord() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1) history.go(-1);
if (pass1.toLowerCase() == "letmein") {... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18095144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2659279/"
] | ```
//Add this to you script
function run(){
var password = prompt("Password Please");
//Change to your own Password
if(password != 'Sameer'){
document.body.innerHTML = '';
document.body.innerHTML = 'Password Failed! Reload to Renter Password';
}else{
alert('Success');
}
}
run();
``` | I used the same exact code that you have and the problem is the the first time for don't know what reason it added one space in front of the input. Just make sure that you don't have that and it will be fine. |
18,095,144 | I took the following code from another webpage "<http://www.javascriptkit.com/script/cut10.shtml>".
```
<SCRIPT>
function passWord() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1) history.go(-1);
if (pass1.toLowerCase() == "letmein") {... | 2013/08/07 | [
"https://Stackoverflow.com/questions/18095144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2659279/"
] | ```
//Add this to you script
function run(){
var password = prompt("Password Please");
//Change to your own Password
if(password != 'Sameer'){
document.body.innerHTML = '';
document.body.innerHTML = 'Password Failed! Reload to Renter Password';
}else{
alert('Success');
}
}
run();
``` | If you use a library to render the UI, you can use this function:
```js
export function setPasswordToEnter({
password,
localStorageKey,
errorMessage,
}) {
if (
!password ||
(localStorageKey && localStorage.getItem(localStorageKey) === password)
) {
return;
}
const input = prompt('Enter the p... |
40,725,691 | I am doing a project in college which we are to create a java program to add golfers to a list of members. I am having trouble getting them added to the list!
This is my code so far:
```
*import java.util.*;
public class GolfClubTester {
/**
* @param args the command line arguments
*/
public static ... | 2016/11/21 | [
"https://Stackoverflow.com/questions/40725691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7019953/"
] | It seems that Sense plugin isn’t necessary because Kibana (for sure 5.0.1) is shipped with console available from DevTools menu.
If Kibana is installed locally open <http://localhost:5601> and choose “DevTools” from the left menu. | Seems, when you are installing locally by downloading complete file was not downloaded.
plz check on that. |
40,725,691 | I am doing a project in college which we are to create a java program to add golfers to a list of members. I am having trouble getting them added to the list!
This is my code so far:
```
*import java.util.*;
public class GolfClubTester {
/**
* @param args the command line arguments
*/
public static ... | 2016/11/21 | [
"https://Stackoverflow.com/questions/40725691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7019953/"
] | ```
bin/kibana plugin --install sense --url file:///<path of sense plugin>/sense-2.0.0-beta7.tar.gz
```
Above command works for me with out issues. | Seems, when you are installing locally by downloading complete file was not downloaded.
plz check on that. |
40,725,691 | I am doing a project in college which we are to create a java program to add golfers to a list of members. I am having trouble getting them added to the list!
This is my code so far:
```
*import java.util.*;
public class GolfClubTester {
/**
* @param args the command line arguments
*/
public static ... | 2016/11/21 | [
"https://Stackoverflow.com/questions/40725691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7019953/"
] | It seems that Sense plugin isn’t necessary because Kibana (for sure 5.0.1) is shipped with console available from DevTools menu.
If Kibana is installed locally open <http://localhost:5601> and choose “DevTools” from the left menu. | The second floor is correct .
I also have this problem. There are many huge differents among different versions . Under the version 5.4.1 even the
```
kibana plugin --install elastic/sense
```
is deprecated.
If you want install a plugin for kibana, need use the following command
```
./bin/kibana-plugin install ... |
40,725,691 | I am doing a project in college which we are to create a java program to add golfers to a list of members. I am having trouble getting them added to the list!
This is my code so far:
```
*import java.util.*;
public class GolfClubTester {
/**
* @param args the command line arguments
*/
public static ... | 2016/11/21 | [
"https://Stackoverflow.com/questions/40725691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7019953/"
] | It seems that Sense plugin isn’t necessary because Kibana (for sure 5.0.1) is shipped with console available from DevTools menu.
If Kibana is installed locally open <http://localhost:5601> and choose “DevTools” from the left menu. | ```
bin/kibana plugin --install sense --url file:///<path of sense plugin>/sense-2.0.0-beta7.tar.gz
```
Above command works for me with out issues. |
40,725,691 | I am doing a project in college which we are to create a java program to add golfers to a list of members. I am having trouble getting them added to the list!
This is my code so far:
```
*import java.util.*;
public class GolfClubTester {
/**
* @param args the command line arguments
*/
public static ... | 2016/11/21 | [
"https://Stackoverflow.com/questions/40725691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7019953/"
] | ```
bin/kibana plugin --install sense --url file:///<path of sense plugin>/sense-2.0.0-beta7.tar.gz
```
Above command works for me with out issues. | The second floor is correct .
I also have this problem. There are many huge differents among different versions . Under the version 5.4.1 even the
```
kibana plugin --install elastic/sense
```
is deprecated.
If you want install a plugin for kibana, need use the following command
```
./bin/kibana-plugin install ... |
17,720,594 | I've tried searching for about an hour through all the Foreign Key / Collation Questions but I can't find something even remotely close to my question.
I have 2 tables from two different software vendors sitting in the same database. One vendor hard codes their collations to Latin1\_General\_BIN while the other uses t... | 2013/07/18 | [
"https://Stackoverflow.com/questions/17720594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1538480/"
] | Yes, either you use javascript, or you send the form to the server, where a new html page with all the inputs is generated (e.g. with PHP). | Here's the **[FIDDLE](http://jsfiddle.net/vonDy2791/h5RTG/)**. Hope it helps. :)
html
```
<input type="text" size="3" maxlength="3" id="count" name="count" value="1">
<div id="container"></div>
```
script
```
$('#count').on('keyup', function () {
var $this = $(this);
var count = $this.val();
$('#contai... |
17,720,594 | I've tried searching for about an hour through all the Foreign Key / Collation Questions but I can't find something even remotely close to my question.
I have 2 tables from two different software vendors sitting in the same database. One vendor hard codes their collations to Latin1\_General\_BIN while the other uses t... | 2013/07/18 | [
"https://Stackoverflow.com/questions/17720594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1538480/"
] | Here's a simple javascript snippet that doesn't make use of any frameworks:
```
function addInputs() {
var count = parseInt(document.getElementById("count").value);
for (var i = 2; i <= count; i++) {
document.getElementById('moreinputs').innerHTML += '<input type="text" name="input_' + i + '" id="input... | Yes, either you use javascript, or you send the form to the server, where a new html page with all the inputs is generated (e.g. with PHP). |
17,720,594 | I've tried searching for about an hour through all the Foreign Key / Collation Questions but I can't find something even remotely close to my question.
I have 2 tables from two different software vendors sitting in the same database. One vendor hard codes their collations to Latin1\_General\_BIN while the other uses t... | 2013/07/18 | [
"https://Stackoverflow.com/questions/17720594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1538480/"
] | Yes, either you use javascript, or you send the form to the server, where a new html page with all the inputs is generated (e.g. with PHP). | This worked for me
```
function AddField() {
var count = $("#countetfield").val();
var i = 1;
var id = $("#container .testClass:last").attr('name');
var test = id.split("_");
id_name = test[1];
while (i <= count) {
id_name++;
var a = '<in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.