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 |
|---|---|---|---|---|---|
6,181,706 | I'm looking for some OLAP data preferably in star schema (or snowflake) for testing a new tool. I've already got the Foodmart database that Mondrian provides. Type of data is not important as long as it has dimensions and associated facts. The larger the size the better for load testing. Anybody knows where I can downl... | 2011/05/30 | [
"https://Stackoverflow.com/questions/6181706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Apologies for being MS SQL focussed, but the [Adventure Works DWH](http://technet.microsoft.com/en-us/library/ms124623.aspx) is not bad as far as an snowflake schema design. Not not huge as far as data volumes. With some clever SQL you would be able to generate extra rows in the database.
Alternatively try [Project Re... | This article give a pretty clear description of a Star Schema:-
[IBM (nee Informix) red brick warehouse](http://publib.boulder.ibm.com/infocenter/rbhelp/v6r3/index.jsp?topic=/com.ibm.redbrick.doc6.3/wag/wag35.htm) |
25,148,782 | If I fetch the following object from the server via Ajax:
```
$.get('/product/10', function (response) {
product = response;
// product:
// {
// name: "Product X",
// stock: 20
// }
});
```
And then output it to HTML using an Underscore.js template like this:
```
<input type="number" value... | 2014/08/05 | [
"https://Stackoverflow.com/questions/25148782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2792897/"
] | You don't need to escape integers obviously. It may be in a good habit to escape everything in general and to print the raw versions of what you intend to. However you can also say you should trust what comes from the server- not what comes from the client. In the end it only matters what you want to get in the habit o... | If the input is of type `number` then you're guaranteed to get a number or nothing in that input.
As a test, try adding the string `drop database` to an input of type number. **Spoiler Alert**: The input will stay empty.
Inputs of type `text` can be more dangerous. |
25,148,782 | If I fetch the following object from the server via Ajax:
```
$.get('/product/10', function (response) {
product = response;
// product:
// {
// name: "Product X",
// stock: 20
// }
});
```
And then output it to HTML using an Underscore.js template like this:
```
<input type="number" value... | 2014/08/05 | [
"https://Stackoverflow.com/questions/25148782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2792897/"
] | If you want to be completely on the safe side, escape everything. Code may change and you may decide to use a string where you previously used a number. If you escape everything, you won't have a problem.
However, that is just being cautious. If you can guarantee that it will always be a number, even when the AJAX req... | You don't need to escape integers obviously. It may be in a good habit to escape everything in general and to print the raw versions of what you intend to. However you can also say you should trust what comes from the server- not what comes from the client. In the end it only matters what you want to get in the habit o... |
25,148,782 | If I fetch the following object from the server via Ajax:
```
$.get('/product/10', function (response) {
product = response;
// product:
// {
// name: "Product X",
// stock: 20
// }
});
```
And then output it to HTML using an Underscore.js template like this:
```
<input type="number" value... | 2014/08/05 | [
"https://Stackoverflow.com/questions/25148782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2792897/"
] | If you want to be completely on the safe side, escape everything. Code may change and you may decide to use a string where you previously used a number. If you escape everything, you won't have a problem.
However, that is just being cautious. If you can guarantee that it will always be a number, even when the AJAX req... | If the input is of type `number` then you're guaranteed to get a number or nothing in that input.
As a test, try adding the string `drop database` to an input of type number. **Spoiler Alert**: The input will stay empty.
Inputs of type `text` can be more dangerous. |
25,148,782 | If I fetch the following object from the server via Ajax:
```
$.get('/product/10', function (response) {
product = response;
// product:
// {
// name: "Product X",
// stock: 20
// }
});
```
And then output it to HTML using an Underscore.js template like this:
```
<input type="number" value... | 2014/08/05 | [
"https://Stackoverflow.com/questions/25148782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2792897/"
] | JavaScript is dynamically typed, so there is no way to ensure that `product.stock` is really a number by the time it gets to the template. Any code written in the future using the template (possibly written by someone else) could pass any value for `product`, so `stock` could be of any type.
Best to always escape, exc... | If the input is of type `number` then you're guaranteed to get a number or nothing in that input.
As a test, try adding the string `drop database` to an input of type number. **Spoiler Alert**: The input will stay empty.
Inputs of type `text` can be more dangerous. |
25,148,782 | If I fetch the following object from the server via Ajax:
```
$.get('/product/10', function (response) {
product = response;
// product:
// {
// name: "Product X",
// stock: 20
// }
});
```
And then output it to HTML using an Underscore.js template like this:
```
<input type="number" value... | 2014/08/05 | [
"https://Stackoverflow.com/questions/25148782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2792897/"
] | If you want to be completely on the safe side, escape everything. Code may change and you may decide to use a string where you previously used a number. If you escape everything, you won't have a problem.
However, that is just being cautious. If you can guarantee that it will always be a number, even when the AJAX req... | JavaScript is dynamically typed, so there is no way to ensure that `product.stock` is really a number by the time it gets to the template. Any code written in the future using the template (possibly written by someone else) could pass any value for `product`, so `stock` could be of any type.
Best to always escape, exc... |
26,623,807 | minimal number of privileged instructions?
Say we want to write a OS with minimal number of privileged instruction.
I think it should be 1, only MMU register. But what about other things? i.e mode bit, trap | 2014/10/29 | [
"https://Stackoverflow.com/questions/26623807",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4163332/"
] | It's a typo it should be:
```
var currentLight = document.getElementById('light'); //Not ID
``` | It should be `Id` not `ID`:
```
document.getElementById('light');
```
Also note that you don't have element with id `light` on your page. It probably should be
```
document.getElementById('pumpkin');
``` |
26,623,807 | minimal number of privileged instructions?
Say we want to write a OS with minimal number of privileged instruction.
I think it should be 1, only MMU register. But what about other things? i.e mode bit, trap | 2014/10/29 | [
"https://Stackoverflow.com/questions/26623807",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4163332/"
] | Incorrect capitalisation on
```
var currentLight = document.getElementByID('light')
```
Should be:
```
var currentLight = document.getElementById('pumpkin')
```
I have attached a working fiddle:
<http://jsfiddle.net/11csf4k2/> | It should be `Id` not `ID`:
```
document.getElementById('light');
```
Also note that you don't have element with id `light` on your page. It probably should be
```
document.getElementById('pumpkin');
``` |
159,252 | I have set up a network as such:
Set up host-only networking on VirtualBox. The first adapter is configured with NAT, the second with host-only networking
HOST: Windows
GUEST: CentOS VM1, CentOS VM2 (clone of VM1)
When executing ifconfig -a on both VMs, I noticed that the MAC addresses are exactly the same. My qu... | 2014/10/04 | [
"https://unix.stackexchange.com/questions/159252",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/44594/"
] | This is one of those things that surprises people because it goes against what they've been taught.
2 machines with the same hardware mac address on the same broadcast domain can talk to each other just fine as long as they have different IP addresses (and the switching gear plays nice).
Lets start with a test setu... | The effects of a duplicate MAC address can be subtle in some cases.
Switches distribute traffic to hosts based on "seen MAC" addresses. When you turn on your computer and it sends its first packet out on the network, your switch will log in its MAC table that "MAC address X came from port Y". Conversely then, in the f... |
40,399,435 | I have created a procedure to input value and filter information from `Inventory_view_03` table and insert those data in to `Trn_note_header` but procedure is running properly.
When I insert one one value to the input if I enter two or more i doesn't work, but doesn't showing erros.
Can you tell me what was the probl... | 2016/11/03 | [
"https://Stackoverflow.com/questions/40399435",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6108217/"
] | Plug these two functions below into a pascal class. I tested it and it works. That link that Prateek Darmwal posted is pretty much the same thing.
```java
public void nonRecursivePrint() {
nonRecursivePrint(n, true);
}
public void nonRecursivePrint(int n, boolean upsideDown) {
if (!upsideDown) {
for (... | Go through this link you will find your answer explained in detail
<http://www.geeksforgeeks.org/pascal-triangle/> |
27,742,763 | Usually when I'm getting some data async way I would do it like
```
var promise = $http.get('/api/v1/movies/avengers');
promise.then(
function(payload) {
$scope.movieContent = payload;
});
```
In fact the scenario is very common - I send some request and when it's ready, I assing EVERYTHING it returns to so... | 2015/01/02 | [
"https://Stackoverflow.com/questions/27742763",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2446799/"
] | You can design your service so that it returns an empty reference and populates itself when the service call returns successfully. Use `angular.copy` to preserve the reference:
**Service**
```
app.factory('avengersService', function($http) {
return {
getAvengers: function() {
var avengers = [];
... | You could wrap the async call in a function:
```
function load(cb, model){
cb.then(function(payload){
model = payload;
});
}
```
\*But I would not recommend you doing this. Often, you want to perform specific tasks in the callback function (like handling loading indicators, ...). |
27,742,763 | Usually when I'm getting some data async way I would do it like
```
var promise = $http.get('/api/v1/movies/avengers');
promise.then(
function(payload) {
$scope.movieContent = payload;
});
```
In fact the scenario is very common - I send some request and when it's ready, I assing EVERYTHING it returns to so... | 2015/01/02 | [
"https://Stackoverflow.com/questions/27742763",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2446799/"
] | You can design your service so that it returns an empty reference and populates itself when the service call returns successfully. Use `angular.copy` to preserve the reference:
**Service**
```
app.factory('avengersService', function($http) {
return {
getAvengers: function() {
var avengers = [];
... | Not exactly what you asked for, but you can generate these callbacks "on-the-fly":
```
function assignToScope(propName) {
return function (data) { $scope[propName] = data; };
}
$http.get('/api/v1/movies/avengers').then(assignToScope('movieContent'));
```
or (if you like this syntax more):
```
function assignTo... |
1,395,707 | I implemented a Save As dialog in Java that prompts the user if the file already exists, and I want the No option to be selected by default. How do I do this?
Here is my current code:
```
JFileChooser chooser = new JFileChooser()
{
public void approveSelection()
{
File selectedFile = getSelectedFile()... | 2009/09/08 | [
"https://Stackoverflow.com/questions/1395707",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46635/"
] | Use this constructor:
```
JOptionPane(Object message, int messageType, int optionType,
Icon icon, Object[] options, Object initialValue)
```
where `options` specifies the buttons, and have `initialValue` (one of the `options` values) specify what the default is.
**Update:** You can call `showOptionDialo... | If you don't want to hardcode "Yes" and "No" (for instance when your app is localized for other languages), you can use UIManager resources:
```
UIManager.getString("OptionPane.yesButtonText", l)
UIManager.getString("OptionPane.noButtonText", l)
``` |
1,395,707 | I implemented a Save As dialog in Java that prompts the user if the file already exists, and I want the No option to be selected by default. How do I do this?
Here is my current code:
```
JFileChooser chooser = new JFileChooser()
{
public void approveSelection()
{
File selectedFile = getSelectedFile()... | 2009/09/08 | [
"https://Stackoverflow.com/questions/1395707",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46635/"
] | Use this constructor:
```
JOptionPane(Object message, int messageType, int optionType,
Icon icon, Object[] options, Object initialValue)
```
where `options` specifies the buttons, and have `initialValue` (one of the `options` values) specify what the default is.
**Update:** You can call `showOptionDialo... | For the above example, it is `JOptionPane.showOptionDialog`
Those arguments can no be passed to `showConfirmDialog` because it does not have them.
More people might be looking for this so why not offer a "working" solution. |
1,395,707 | I implemented a Save As dialog in Java that prompts the user if the file already exists, and I want the No option to be selected by default. How do I do this?
Here is my current code:
```
JFileChooser chooser = new JFileChooser()
{
public void approveSelection()
{
File selectedFile = getSelectedFile()... | 2009/09/08 | [
"https://Stackoverflow.com/questions/1395707",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46635/"
] | Use this constructor:
```
JOptionPane(Object message, int messageType, int optionType,
Icon icon, Object[] options, Object initialValue)
```
where `options` specifies the buttons, and have `initialValue` (one of the `options` values) specify what the default is.
**Update:** You can call `showOptionDialo... | This is my solution:
```
import java.awt.Component;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
public class NegativeDefaultButtonJOptionPane {
public static int showC... |
1,395,707 | I implemented a Save As dialog in Java that prompts the user if the file already exists, and I want the No option to be selected by default. How do I do this?
Here is my current code:
```
JFileChooser chooser = new JFileChooser()
{
public void approveSelection()
{
File selectedFile = getSelectedFile()... | 2009/09/08 | [
"https://Stackoverflow.com/questions/1395707",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46635/"
] | That's the first thing that comes to my mind.
```
//Custom button text
Object[] options = {"Yes",
"No"};
JOptionPane.showOptionDialog(this, "The file " + selectedFile.getName() +
" already exists. Do you want to replace the existing file?",
getDialogTitle(),
... | If you don't want to hardcode "Yes" and "No" (for instance when your app is localized for other languages), you can use UIManager resources:
```
UIManager.getString("OptionPane.yesButtonText", l)
UIManager.getString("OptionPane.noButtonText", l)
``` |
1,395,707 | I implemented a Save As dialog in Java that prompts the user if the file already exists, and I want the No option to be selected by default. How do I do this?
Here is my current code:
```
JFileChooser chooser = new JFileChooser()
{
public void approveSelection()
{
File selectedFile = getSelectedFile()... | 2009/09/08 | [
"https://Stackoverflow.com/questions/1395707",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46635/"
] | That's the first thing that comes to my mind.
```
//Custom button text
Object[] options = {"Yes",
"No"};
JOptionPane.showOptionDialog(this, "The file " + selectedFile.getName() +
" already exists. Do you want to replace the existing file?",
getDialogTitle(),
... | For the above example, it is `JOptionPane.showOptionDialog`
Those arguments can no be passed to `showConfirmDialog` because it does not have them.
More people might be looking for this so why not offer a "working" solution. |
1,395,707 | I implemented a Save As dialog in Java that prompts the user if the file already exists, and I want the No option to be selected by default. How do I do this?
Here is my current code:
```
JFileChooser chooser = new JFileChooser()
{
public void approveSelection()
{
File selectedFile = getSelectedFile()... | 2009/09/08 | [
"https://Stackoverflow.com/questions/1395707",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46635/"
] | That's the first thing that comes to my mind.
```
//Custom button text
Object[] options = {"Yes",
"No"};
JOptionPane.showOptionDialog(this, "The file " + selectedFile.getName() +
" already exists. Do you want to replace the existing file?",
getDialogTitle(),
... | This is my solution:
```
import java.awt.Component;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
public class NegativeDefaultButtonJOptionPane {
public static int showC... |
1,395,707 | I implemented a Save As dialog in Java that prompts the user if the file already exists, and I want the No option to be selected by default. How do I do this?
Here is my current code:
```
JFileChooser chooser = new JFileChooser()
{
public void approveSelection()
{
File selectedFile = getSelectedFile()... | 2009/09/08 | [
"https://Stackoverflow.com/questions/1395707",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46635/"
] | If you don't want to hardcode "Yes" and "No" (for instance when your app is localized for other languages), you can use UIManager resources:
```
UIManager.getString("OptionPane.yesButtonText", l)
UIManager.getString("OptionPane.noButtonText", l)
``` | For the above example, it is `JOptionPane.showOptionDialog`
Those arguments can no be passed to `showConfirmDialog` because it does not have them.
More people might be looking for this so why not offer a "working" solution. |
1,395,707 | I implemented a Save As dialog in Java that prompts the user if the file already exists, and I want the No option to be selected by default. How do I do this?
Here is my current code:
```
JFileChooser chooser = new JFileChooser()
{
public void approveSelection()
{
File selectedFile = getSelectedFile()... | 2009/09/08 | [
"https://Stackoverflow.com/questions/1395707",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46635/"
] | This is my solution:
```
import java.awt.Component;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
public class NegativeDefaultButtonJOptionPane {
public static int showC... | For the above example, it is `JOptionPane.showOptionDialog`
Those arguments can no be passed to `showConfirmDialog` because it does not have them.
More people might be looking for this so why not offer a "working" solution. |
50,850,079 | I need to make a predicate called *fAtomPairs* so that given an atom (first argument), and a list of pairs (each pair is in turn a list of two atoms), unify a third parameter with the *filtered* list of pairs by selecting only those pairs that have as their first component the atom which is the first argument.
For exa... | 2018/06/14 | [
"https://Stackoverflow.com/questions/50850079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9062852/"
] | ```
:- use_module(library(reif)). % [SICStus](http://www.complang.tuwien.ac.at/ulrich/Prolog-inedit/sicstus/reif.pl)|[SWI](http://www.complang.tuwien.ac.at/ulrich/Prolog-inedit/swi/reif.pl)
:- use_module(library(lambda)). % [SICStus](http://www.complang.tuwien.ac.at/ulrich/Prolog-inedit/sicstus/lambda.pl)|[SWI](http:... | You can use a version of [tfilter/3](https://stackoverflow.com/questions/297996/prolog-filtering-a-list) and [if\_/3](https://stackoverflow.com/questions/27358456/prolog-union-for-a-u-b-u-c/27358600#27358600).
I also changed the representation from lists of two elements to pairs.
```
fAtomPairs(sA,[basA-absAb,ab-bbsA... |
24,711,074 | I have this is my config file:
```
CKEDITOR.stylesSet.add( 'custom_styles', [
{ name: 'Paragraph', element: 'p' },
{ name: 'Heading 3', element: 'h3' },
{ name: 'Heading 4', element: 'h4' },
{ name: 'Marker: Yellow', element: 'span', styles: { 'background-color': 'Yellow' } },
{ name: 'Custom Image... | 2014/07/12 | [
"https://Stackoverflow.com/questions/24711074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3819158/"
] | Images in ckeditor now use a widget system. I'm not sure why this is not really documented yet but the solution is to specify:
* type: widget
* widget: image
So the following should work:
```
{ name: 'Custom Image', type: 'widget', widget: 'image', attributes: { 'class': 'myClass' } }
``` | Not 100% sure where you are fuzzy but if you are asking why the option isn't always in the ***styles*** drop-down menu: It's because the behaviour is context-sensitive depending on where the caret is and/or what is currently selected. Selecting an image allows you to retrospectively apply styles to it via this menu, bu... |
26,007,902 | I am trying to use the [Countries Gem](https://github.com/hexorx/countries), but had some basic questions on how to incorporate this gem after I've bundle-installed it.
1. Do I need to create a new controller/model to access the countries?
2. How do I create a simple select drop-down to show a list of countries for a ... | 2014/09/24 | [
"https://Stackoverflow.com/questions/26007902",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4072856/"
] | 1) You don't need a new controller/model to access the countries
2) There is an [example app on the README page](https://github.com/scudco/country_select_test/blob/master/app/views/welcome/_simple_form_form.html.erb) which shows you how to use forms and dropdowns.
3) The countries are stores within the app. I believe... | You do not need to create a new controller/model to work with the gem.
In order for you to create dropdown, just install the `country_select` gem (as stated in the doc)
Then to use it, just do that in your views:
```
country_select(:your_model_name, :your_attribute_name)
```
To integrate it in a `form_for` with so... |
2,377,412 | $$\lim\limits\_{x\to\infty} \ \frac{\ln \ x}{x} = 0$$
How can I know this without looking at the graph? What's the easiest way to equate that expression to 0?
I understand that an integer over x approaches 0 as x approaches 0, but since ln x is an increasing function as x approaches infinity, how do we know which eff... | 2017/07/31 | [
"https://math.stackexchange.com/questions/2377412",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/140396/"
] | By L'Hospital rule
$$\lim\_{x \rightarrow \infty}\frac{\ln x}{x}=\lim\_{x \rightarrow \infty}\frac{\frac{1}{x}}{1}$$
$$\lim\_{x \rightarrow \infty}\frac{\frac{1}{x}}{1}=\lim\_{x \rightarrow \infty}\frac{1}{x}$$
$$\lim\_{x \rightarrow \infty}\frac{1}{x}=0$$ | With $x=e^t$ we have to investigate $\lim\_{t\to \infty} \frac{t}{e^t} $. For $t>0$ we have
$0<\frac{t}{e^t}=\frac{t}{1+t+\frac{t^2}{2}+...} \le \frac{t}{\frac {t^2}{2}}=\frac{2}{t}$.
Your turn ! |
2,377,412 | $$\lim\limits\_{x\to\infty} \ \frac{\ln \ x}{x} = 0$$
How can I know this without looking at the graph? What's the easiest way to equate that expression to 0?
I understand that an integer over x approaches 0 as x approaches 0, but since ln x is an increasing function as x approaches infinity, how do we know which eff... | 2017/07/31 | [
"https://math.stackexchange.com/questions/2377412",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/140396/"
] | $$\lim\_{x\to \infty} {\ln x \over x} =\lim\_{x\to \infty} \ln x^{1/x} = \ln\left( \lim\_{x\to \infty} x^{1/x}\right) = \ln 1 = 0$$
Limit used : [How to show that $\lim\_{n \to +\infty} n^{\frac{1}{n}} = 1$?](https://math.stackexchange.com/questions/115822/how-to-show-that-lim-n-to-infty-n-frac1n-1) | By L'Hospital rule
$$\lim\_{x \rightarrow \infty}\frac{\ln x}{x}=\lim\_{x \rightarrow \infty}\frac{\frac{1}{x}}{1}$$
$$\lim\_{x \rightarrow \infty}\frac{\frac{1}{x}}{1}=\lim\_{x \rightarrow \infty}\frac{1}{x}$$
$$\lim\_{x \rightarrow \infty}\frac{1}{x}=0$$ |
2,377,412 | $$\lim\limits\_{x\to\infty} \ \frac{\ln \ x}{x} = 0$$
How can I know this without looking at the graph? What's the easiest way to equate that expression to 0?
I understand that an integer over x approaches 0 as x approaches 0, but since ln x is an increasing function as x approaches infinity, how do we know which eff... | 2017/07/31 | [
"https://math.stackexchange.com/questions/2377412",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/140396/"
] | By L'Hospital rule
$$\lim\_{x \rightarrow \infty}\frac{\ln x}{x}=\lim\_{x \rightarrow \infty}\frac{\frac{1}{x}}{1}$$
$$\lim\_{x \rightarrow \infty}\frac{\frac{1}{x}}{1}=\lim\_{x \rightarrow \infty}\frac{1}{x}$$
$$\lim\_{x \rightarrow \infty}\frac{1}{x}=0$$ | A high school proof, using only basic properties of the integral:
For $t\ge 1$, we have $\sqrt t\le t$, so $\dfrac1t\le\dfrac 1{\sqrt t}$ and hence, if $x\ge 1$,
$$ \ln x=\int\_1^x\frac{\mathrm d\mkern1mut}{t}\le\int\_1^x\frac{\mathrm d\mkern1mut}{\sqrt t}=2(\sqrt x-1)<2\sqrt x$$
from which we deduce at once
$$0\le\fr... |
2,377,412 | $$\lim\limits\_{x\to\infty} \ \frac{\ln \ x}{x} = 0$$
How can I know this without looking at the graph? What's the easiest way to equate that expression to 0?
I understand that an integer over x approaches 0 as x approaches 0, but since ln x is an increasing function as x approaches infinity, how do we know which eff... | 2017/07/31 | [
"https://math.stackexchange.com/questions/2377412",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/140396/"
] | Since $\ln t \le t$, for $t = \sqrt{x}$ we would have
$$\ln \sqrt{x}=\dfrac{1}{2}\ln x \leq \sqrt{x} \iff \ln x \leq 2\sqrt{x}$$
and, for $x>1$,
$$0\le\ln x\leq 2\sqrt{x}\iff 0\le\dfrac{\ln x}{x}\leq \dfrac{2}{\sqrt{x}}$$
With the squeeze theorem we have $\dfrac{\ln x}{x} \underset{x\to +\infty}{\longrightarrow}0$ | With $x=e^t$ we have to investigate $\lim\_{t\to \infty} \frac{t}{e^t} $. For $t>0$ we have
$0<\frac{t}{e^t}=\frac{t}{1+t+\frac{t^2}{2}+...} \le \frac{t}{\frac {t^2}{2}}=\frac{2}{t}$.
Your turn ! |
2,377,412 | $$\lim\limits\_{x\to\infty} \ \frac{\ln \ x}{x} = 0$$
How can I know this without looking at the graph? What's the easiest way to equate that expression to 0?
I understand that an integer over x approaches 0 as x approaches 0, but since ln x is an increasing function as x approaches infinity, how do we know which eff... | 2017/07/31 | [
"https://math.stackexchange.com/questions/2377412",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/140396/"
] | $$\lim\_{x\to \infty} {\ln x \over x} =\lim\_{x\to \infty} \ln x^{1/x} = \ln\left( \lim\_{x\to \infty} x^{1/x}\right) = \ln 1 = 0$$
Limit used : [How to show that $\lim\_{n \to +\infty} n^{\frac{1}{n}} = 1$?](https://math.stackexchange.com/questions/115822/how-to-show-that-lim-n-to-infty-n-frac1n-1) | With $x=e^t$ we have to investigate $\lim\_{t\to \infty} \frac{t}{e^t} $. For $t>0$ we have
$0<\frac{t}{e^t}=\frac{t}{1+t+\frac{t^2}{2}+...} \le \frac{t}{\frac {t^2}{2}}=\frac{2}{t}$.
Your turn ! |
2,377,412 | $$\lim\limits\_{x\to\infty} \ \frac{\ln \ x}{x} = 0$$
How can I know this without looking at the graph? What's the easiest way to equate that expression to 0?
I understand that an integer over x approaches 0 as x approaches 0, but since ln x is an increasing function as x approaches infinity, how do we know which eff... | 2017/07/31 | [
"https://math.stackexchange.com/questions/2377412",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/140396/"
] | $$\lim\_{x\to \infty} {\ln x \over x} =\lim\_{x\to \infty} \ln x^{1/x} = \ln\left( \lim\_{x\to \infty} x^{1/x}\right) = \ln 1 = 0$$
Limit used : [How to show that $\lim\_{n \to +\infty} n^{\frac{1}{n}} = 1$?](https://math.stackexchange.com/questions/115822/how-to-show-that-lim-n-to-infty-n-frac1n-1) | Since $\ln t \le t$, for $t = \sqrt{x}$ we would have
$$\ln \sqrt{x}=\dfrac{1}{2}\ln x \leq \sqrt{x} \iff \ln x \leq 2\sqrt{x}$$
and, for $x>1$,
$$0\le\ln x\leq 2\sqrt{x}\iff 0\le\dfrac{\ln x}{x}\leq \dfrac{2}{\sqrt{x}}$$
With the squeeze theorem we have $\dfrac{\ln x}{x} \underset{x\to +\infty}{\longrightarrow}0$ |
2,377,412 | $$\lim\limits\_{x\to\infty} \ \frac{\ln \ x}{x} = 0$$
How can I know this without looking at the graph? What's the easiest way to equate that expression to 0?
I understand that an integer over x approaches 0 as x approaches 0, but since ln x is an increasing function as x approaches infinity, how do we know which eff... | 2017/07/31 | [
"https://math.stackexchange.com/questions/2377412",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/140396/"
] | Since $\ln t \le t$, for $t = \sqrt{x}$ we would have
$$\ln \sqrt{x}=\dfrac{1}{2}\ln x \leq \sqrt{x} \iff \ln x \leq 2\sqrt{x}$$
and, for $x>1$,
$$0\le\ln x\leq 2\sqrt{x}\iff 0\le\dfrac{\ln x}{x}\leq \dfrac{2}{\sqrt{x}}$$
With the squeeze theorem we have $\dfrac{\ln x}{x} \underset{x\to +\infty}{\longrightarrow}0$ | A high school proof, using only basic properties of the integral:
For $t\ge 1$, we have $\sqrt t\le t$, so $\dfrac1t\le\dfrac 1{\sqrt t}$ and hence, if $x\ge 1$,
$$ \ln x=\int\_1^x\frac{\mathrm d\mkern1mut}{t}\le\int\_1^x\frac{\mathrm d\mkern1mut}{\sqrt t}=2(\sqrt x-1)<2\sqrt x$$
from which we deduce at once
$$0\le\fr... |
2,377,412 | $$\lim\limits\_{x\to\infty} \ \frac{\ln \ x}{x} = 0$$
How can I know this without looking at the graph? What's the easiest way to equate that expression to 0?
I understand that an integer over x approaches 0 as x approaches 0, but since ln x is an increasing function as x approaches infinity, how do we know which eff... | 2017/07/31 | [
"https://math.stackexchange.com/questions/2377412",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/140396/"
] | $$\lim\_{x\to \infty} {\ln x \over x} =\lim\_{x\to \infty} \ln x^{1/x} = \ln\left( \lim\_{x\to \infty} x^{1/x}\right) = \ln 1 = 0$$
Limit used : [How to show that $\lim\_{n \to +\infty} n^{\frac{1}{n}} = 1$?](https://math.stackexchange.com/questions/115822/how-to-show-that-lim-n-to-infty-n-frac1n-1) | A high school proof, using only basic properties of the integral:
For $t\ge 1$, we have $\sqrt t\le t$, so $\dfrac1t\le\dfrac 1{\sqrt t}$ and hence, if $x\ge 1$,
$$ \ln x=\int\_1^x\frac{\mathrm d\mkern1mut}{t}\le\int\_1^x\frac{\mathrm d\mkern1mut}{\sqrt t}=2(\sqrt x-1)<2\sqrt x$$
from which we deduce at once
$$0\le\fr... |
20,523,485 | I have a single activity controlling many fragments. When i perform certain fragment transactions I add the transaction to the back stack and enable the app icon in the action bar to navigate up, i.e., `setDisplayHomeAsUpEnabled(true)`. However, I'd like to change the text alongside the app icon (currently defaulting t... | 2013/12/11 | [
"https://Stackoverflow.com/questions/20523485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1501327/"
] | Use
```
setTitle("title text")
```
...within an Activity to change the text shown in the title bar next to the icon. | Two ways, dynamically:
```
ActionBar bar = getActionBar();
bar.setTitle("Title");
bar.setSubtitle("subtitle");
```
In manifest.xml:
```
<application
android:label="@string/app_name" >
```
In Fragment:
```
(FragmentActivity) getActivity()).getActionBar().setTitle(R.string.title);
```
There is a lot o... |
41,359,459 | I am using C#
I got a string which looks something like this :
```
myString = "User1:John&User2:Bob'More text"
```
I used
```
var parsed = HttpUtility.ParseQueryString(myString);
```
and then i use `parsed["User1"]` and `parsed["User2"]` to get the data.
My problem is that `parsed["User2"]` returns me not on... | 2016/12/28 | [
"https://Stackoverflow.com/questions/41359459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3603579/"
] | The form begin has two purposes.
```
1. To sequence the evaluation of expressions
2. To "splice" sequences together (used by macros)
```
The first one is what is used most often:
```
(begin e0 e1 ...)
```
will evaluate the expressions e0 e1 ... in order.
The second is used when a macro expands to multiple defin... | The answer I posted [here](https://stackoverflow.com/a/44835725/5544472) about `(begin ())` is another acceptable reason to use begin in `(if () )` statements. |
38,380,121 | I wrote a typeclass to avoid having to write a duplicate function for a different type as below:
```
import Statistics.Distribution.Normal
import Data.Random
d1 :: Double -> Double -> Double -> Double -> Double -> Double
d1 s k r v t = ( log ( s / k ) + ( ( v * v ) / 2 ) * t ) / ( v * sqrt t )
d2 :: Double -> Double... | 2016/07/14 | [
"https://Stackoverflow.com/questions/38380121",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3248346/"
] | I think I would just make the the argument to `Option` be a phantom type:
```
data Option a = Option Price Type Style Strike
data Future
data Forward
price :: Option a -> Double -> Double -> Double
price (Option s Call European k t) r v = call s k r t v
price (Option s Put European k t) r v = put s k r t v
```
Mu... | How about this?
```
data Option = Option ForFut Type Style Strike Expiration deriving (Show)
data ForFut = Forward Price | Future Price deriving (Show)
type Barrier = Double
type Expiration = Double
type Price = Double
type Strike = Double
type Value = Double
type Dividend = Double
type Rate = Double
data Type = Ca... |
70,827,267 | After installing `TensorFlow` in `Anaconda`, I tried to test it :
```
import tensorflow as tf
```
In `Jupyter`, I get this error :
```
ModuleNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_13080/3793406994.py in <module>
----> 1 import tensorflow as tf
ModuleNot... | 2022/01/23 | [
"https://Stackoverflow.com/questions/70827267",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7954210/"
] | Open your terminal, then switch to your env directory and run:
```
conda activate virtual_env_name
```
now try again | You can reinstall tensorflow.
```
pip install tensorflow
```
or
```
conda install tensorflow
``` |
15,895,610 | I cannot get the following chart to display. The following is the jQuery. I've tried other examples by replacing the jQuery and it works. I have all my files in the same folder, including data.csv.
```
$(document).ready(function () {
var options = {
chart: {
renderTo: 'container',
... | 2013/04/09 | [
"https://Stackoverflow.com/questions/15895610",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1119779/"
] | In Chrome you are not allowed to use AJAX to get local files. If you want do such thing use XAMPP or WAMP to create local server. Firefox doens't have such limits. | I was able to use this Chrome switch as a temporary fix to allow local file usage: --allow-file-access-from-files |
178,406 | Am planing to run a business and i have two option to choose between Magento or Php custom build (both of them will have the same functionality) so am considering about **STABILITY** and about **SECURITY**.
impatiently waiting for your advice. | 2017/06/10 | [
"https://magento.stackexchange.com/questions/178406",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/55193/"
] | Here is 2 ways to add you custom styles in your theme.
**1.** Backend
==============
Navigate to Content > Design > Configuration > Select Theme > HTML Head section > Scripts and Style Sheets field
**2.** Less processor.
======================
here is your theme directory
>
> app / design / frontend / [vendor] / ... | after deploy please Confirm your custom css is created in your theme
>
> pub/static/frontend/Magento/[theme]/en\_us
>
>
>
if it is not created confirm you are follow the step
Can you please confirm did you created the below step.
>
>
> ```
> app / design / frontend / [vendor] / [theme] / Magento_Theme / layo... |
236,226 | I have 2 user accounts in the same organization.
I have created an installed package with the "Marketing Cloud Component" that gives access to login, redirect, logout urls.
In the app exchange menu, there is a link to the following page:
<https://mc.s10.exacttarget.com/cloud/#app/>
But it is only accessible to the ... | 2018/10/16 | [
"https://salesforce.stackexchange.com/questions/236226",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/61173/"
] | To allow other users to view the app you need to:
Administration (top right) > Installed Packages > Click your app > LICENSES > License to everyone in org | You need to configure the app per business unit. Once the app is installed for that business unit, users in that business unit will see the link under the AppExchange menu, provided that they have the permissions. |
17,491,042 | I'm working with PCL and a Mesh editor (MeshLab). I'm interested in importing my meshes to PCL to do some 3D processing.
I've a mesh model in ply format. When I load the model with the code:
```
PointCloud<PointXYZRGBA>::Ptr cloud (new PointCloud<PointXYZRGBA> ());
pcl::io::loadPLYFile<pcl::PointXYZRGBA>(argv[1], *... | 2013/07/05 | [
"https://Stackoverflow.com/questions/17491042",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1719607/"
] | If someone is interested, here's the answer:
```
PointCloud<PointXYZRGBA>::Ptr cloud (new PointCloud<PointXYZRGBA> ());
pcl::PolygonMesh triangles;
pcl::io::loadPolygonFilePLY(argv[1], triangles);
pcl::fromROSMsg(triangles.cloud, *cloud);
```
This code opens a PLY file and converts it to a point cloud with the corre... | I'm quite sure that it's a bug of PCL before 1.7.2, as disclaimed in the release notes and proved by my own experience:
>
> Fixed a bug in PLYReader which lead to deformation of point clouds when displayed in CloudViewer or PCLVisualizer [#879](https://github.com/PointCloudLibrary/pcl/pull/879)
>
>
>
If you don't... |
73,303,683 | I would like to get the record where one column has the same value and the other column has different value. See table below:
| Name | Type |
| --- | --- |
| XX01 | Table |
| XX01 | Chair |
| XX02 | Box |
| XX02 | Box |
My end results will show XX01 since the column Name is the same but the column Type is different. ... | 2022/08/10 | [
"https://Stackoverflow.com/questions/73303683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16966969/"
] | I do this with an expression that truncates any date expression to the preceding Sunday.
This gets Sunday of the current week.
```sql
CAST(DATEADD(DAY, 1-DATEPART(WEEKDAY, GETDATE()), GETDATE()) AS DATE);
```
This gets Sunday of the previous week.
```sql
CAST(DATEADD(DAY, (1-DATEPART(WEEKDAY, GETDATE()))-7, GETDAT... | You can use `DATEADD(WEEK, -1, DateTimePrinted)` to get the date -1 week.
Then just use that in your DATEPART to get the week number.
```
DATEPART(WEEK, DATEADD(WEEK, -1, DateTimePrinted))
``` |
73,303,683 | I would like to get the record where one column has the same value and the other column has different value. See table below:
| Name | Type |
| --- | --- |
| XX01 | Table |
| XX01 | Chair |
| XX02 | Box |
| XX02 | Box |
My end results will show XX01 since the column Name is the same but the column Type is different. ... | 2022/08/10 | [
"https://Stackoverflow.com/questions/73303683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16966969/"
] | I do this with an expression that truncates any date expression to the preceding Sunday.
This gets Sunday of the current week.
```sql
CAST(DATEADD(DAY, 1-DATEPART(WEEKDAY, GETDATE()), GETDATE()) AS DATE);
```
This gets Sunday of the previous week.
```sql
CAST(DATEADD(DAY, (1-DATEPART(WEEKDAY, GETDATE()))-7, GETDAT... | I found the answer.
```
Where
DATEPART(WEEK, DateTimePrinted) = cast(dateadd(w,-1,cast(DATEname(WW,getdate()) as int)) as int)
```
I had to cast the data due to some errors on our date records. |
10,519 | If it matters any I have an HTC Desire Z with the original Sense install.
We have this monitoring service at work that keeps an eye on the various servers and starts frantically SMS'ing me whenever things aren't working right.
I'd like to set a separate notification tone for SMS's from that one contact. How do you d... | 2011/06/17 | [
"https://android.stackexchange.com/questions/10519",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/1070/"
] | Another option is Ringo ([Play Store](http://play.google.com/store/apps/details?id=com.electricpocket.ringopro), [developer's site](http://epckt.com/ringo/)), which I've been using for over a year and it works great for just this purpose (I have a server that yells at me too). The free version has everything I need, th... | You cannot change the notification tone for a single user, only the Ringtone. You may be able to find a 3rd party SMS that will allow you to set up different notification sounds for specific users, but I am not aware of any. |
10,519 | If it matters any I have an HTC Desire Z with the original Sense install.
We have this monitoring service at work that keeps an eye on the various servers and starts frantically SMS'ing me whenever things aren't working right.
I'd like to set a separate notification tone for SMS's from that one contact. How do you d... | 2011/06/17 | [
"https://android.stackexchange.com/questions/10519",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/1070/"
] | Another option is Ringo ([Play Store](http://play.google.com/store/apps/details?id=com.electricpocket.ringopro), [developer's site](http://epckt.com/ringo/)), which I've been using for over a year and it works great for just this purpose (I have a server that yells at me too). The free version has everything I need, th... | If you don't want to download a new messenger app, you can try using [Contact Alert](https://play.google.com/store/apps/details?id=com.rsminsmith.omnialert.app). It allows you to set custom notification sounds per contact and runs parallel to whatever messaging app you currently use. You will have to turn off sounds in... |
10,519 | If it matters any I have an HTC Desire Z with the original Sense install.
We have this monitoring service at work that keeps an eye on the various servers and starts frantically SMS'ing me whenever things aren't working right.
I'd like to set a separate notification tone for SMS's from that one contact. How do you d... | 2011/06/17 | [
"https://android.stackexchange.com/questions/10519",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/1070/"
] | Another option is Ringo ([Play Store](http://play.google.com/store/apps/details?id=com.electricpocket.ringopro), [developer's site](http://epckt.com/ringo/)), which I've been using for over a year and it works great for just this purpose (I have a server that yells at me too). The free version has everything I need, th... | Use [Go SMS Pro](https://play.google.com/store/apps/details?id=com.jb.gosms&hl=en) to change individual customization for notification. |
10,519 | If it matters any I have an HTC Desire Z with the original Sense install.
We have this monitoring service at work that keeps an eye on the various servers and starts frantically SMS'ing me whenever things aren't working right.
I'd like to set a separate notification tone for SMS's from that one contact. How do you d... | 2011/06/17 | [
"https://android.stackexchange.com/questions/10519",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/1070/"
] | Ryan is correct and I would recommend [SMS Popup](https://play.google.com/store/apps/details?id=net.everythingandroid.smspopup). Been using it since my G1 days. Lots of options like quick replies, custom vibration, and alert repetition to complement the custom message tones. You will need to turn off the native message... | this is what I did without any 3rd party apps.. for a long time I used go sms.. but.. if you go into and make your own file folders by coopying and pasting.. voile'!
1. Open My Files application (The default file manager on Samsung devices)
2. Under Local Storage, open the Device Storage option
3. Browse the audio fil... |
10,519 | If it matters any I have an HTC Desire Z with the original Sense install.
We have this monitoring service at work that keeps an eye on the various servers and starts frantically SMS'ing me whenever things aren't working right.
I'd like to set a separate notification tone for SMS's from that one contact. How do you d... | 2011/06/17 | [
"https://android.stackexchange.com/questions/10519",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/1070/"
] | Use [Go SMS Pro](https://play.google.com/store/apps/details?id=com.jb.gosms&hl=en) to change individual customization for notification. | If you don't want to download a new messenger app, you can try using [Contact Alert](https://play.google.com/store/apps/details?id=com.rsminsmith.omnialert.app). It allows you to set custom notification sounds per contact and runs parallel to whatever messaging app you currently use. You will have to turn off sounds in... |
10,519 | If it matters any I have an HTC Desire Z with the original Sense install.
We have this monitoring service at work that keeps an eye on the various servers and starts frantically SMS'ing me whenever things aren't working right.
I'd like to set a separate notification tone for SMS's from that one contact. How do you d... | 2011/06/17 | [
"https://android.stackexchange.com/questions/10519",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/1070/"
] | If you don't want to download a new messenger app, you can try using [Contact Alert](https://play.google.com/store/apps/details?id=com.rsminsmith.omnialert.app). It allows you to set custom notification sounds per contact and runs parallel to whatever messaging app you currently use. You will have to turn off sounds in... | this is what I did without any 3rd party apps.. for a long time I used go sms.. but.. if you go into and make your own file folders by coopying and pasting.. voile'!
1. Open My Files application (The default file manager on Samsung devices)
2. Under Local Storage, open the Device Storage option
3. Browse the audio fil... |
10,519 | If it matters any I have an HTC Desire Z with the original Sense install.
We have this monitoring service at work that keeps an eye on the various servers and starts frantically SMS'ing me whenever things aren't working right.
I'd like to set a separate notification tone for SMS's from that one contact. How do you d... | 2011/06/17 | [
"https://android.stackexchange.com/questions/10519",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/1070/"
] | Use [Go SMS Pro](https://play.google.com/store/apps/details?id=com.jb.gosms&hl=en) to change individual customization for notification. | this is what I did without any 3rd party apps.. for a long time I used go sms.. but.. if you go into and make your own file folders by coopying and pasting.. voile'!
1. Open My Files application (The default file manager on Samsung devices)
2. Under Local Storage, open the Device Storage option
3. Browse the audio fil... |
10,519 | If it matters any I have an HTC Desire Z with the original Sense install.
We have this monitoring service at work that keeps an eye on the various servers and starts frantically SMS'ing me whenever things aren't working right.
I'd like to set a separate notification tone for SMS's from that one contact. How do you d... | 2011/06/17 | [
"https://android.stackexchange.com/questions/10519",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/1070/"
] | Go into your contacts. Open the contact you want to personalize the message tone. Click "edit". Then scroll down to the bottom and click on "ADD ANOTHER FIELD". Tap to put a check mark beside "Message tone" then tap "OK". Then tap on "Message tone" and your options should come up e.g. Media storage, Zedge, etc. Tap whi... | this is what I did without any 3rd party apps.. for a long time I used go sms.. but.. if you go into and make your own file folders by coopying and pasting.. voile'!
1. Open My Files application (The default file manager on Samsung devices)
2. Under Local Storage, open the Device Storage option
3. Browse the audio fil... |
10,519 | If it matters any I have an HTC Desire Z with the original Sense install.
We have this monitoring service at work that keeps an eye on the various servers and starts frantically SMS'ing me whenever things aren't working right.
I'd like to set a separate notification tone for SMS's from that one contact. How do you d... | 2011/06/17 | [
"https://android.stackexchange.com/questions/10519",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/1070/"
] | Another option is Ringo ([Play Store](http://play.google.com/store/apps/details?id=com.electricpocket.ringopro), [developer's site](http://epckt.com/ringo/)), which I've been using for over a year and it works great for just this purpose (I have a server that yells at me too). The free version has everything I need, th... | this is what I did without any 3rd party apps.. for a long time I used go sms.. but.. if you go into and make your own file folders by coopying and pasting.. voile'!
1. Open My Files application (The default file manager on Samsung devices)
2. Under Local Storage, open the Device Storage option
3. Browse the audio fil... |
10,519 | If it matters any I have an HTC Desire Z with the original Sense install.
We have this monitoring service at work that keeps an eye on the various servers and starts frantically SMS'ing me whenever things aren't working right.
I'd like to set a separate notification tone for SMS's from that one contact. How do you d... | 2011/06/17 | [
"https://android.stackexchange.com/questions/10519",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/1070/"
] | You cannot change the notification tone for a single user, only the Ringtone. You may be able to find a 3rd party SMS that will allow you to set up different notification sounds for specific users, but I am not aware of any. | Use [Go SMS Pro](https://play.google.com/store/apps/details?id=com.jb.gosms&hl=en) to change individual customization for notification. |
31,162,128 | I have a menu here:
```
<header></header>
<a class="back">Back</a>
<ul>
<li>
<a href="#">Something</a>
</li>
<li>
<a href="#">Something1</a>
</li>
<li>
<a href="#">Something2</a>
</li>
<li>
<a href="#">Something3</a>
</li>
</ul>
```
When a user clicks on a link within ... | 2015/07/01 | [
"https://Stackoverflow.com/questions/31162128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2547971/"
] | There are number of working examples for your context in SO. Its very simple in jquery and you asking very hard. Please look through [API Jquery](http://api.jquery.com/)
```
$("ul li a").click(function(e) {
e.preventDefault();
$('header').text($(this).text());
});
```
[**Fiddle**](http://jsfiddle.net/0xrxeuf... | ```
$("ul > li > a").click(function(e) {
var element = document.getElementById("header");
element.innerHTML = $(this).text();
});
```
You can try something like this to modify the header text whenever a link is clicked. |
31,162,128 | I have a menu here:
```
<header></header>
<a class="back">Back</a>
<ul>
<li>
<a href="#">Something</a>
</li>
<li>
<a href="#">Something1</a>
</li>
<li>
<a href="#">Something2</a>
</li>
<li>
<a href="#">Something3</a>
</li>
</ul>
```
When a user clicks on a link within ... | 2015/07/01 | [
"https://Stackoverflow.com/questions/31162128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2547971/"
] | There are number of working examples for your context in SO. Its very simple in jquery and you asking very hard. Please look through [API Jquery](http://api.jquery.com/)
```
$("ul li a").click(function(e) {
e.preventDefault();
$('header').text($(this).text());
});
```
[**Fiddle**](http://jsfiddle.net/0xrxeuf... | try this:-
```
$('ul li a').click(function(){
$('header').html($(this).text());
});
```
[Demo](http://jsfiddle.net/tm6SH/59/) |
31,162,128 | I have a menu here:
```
<header></header>
<a class="back">Back</a>
<ul>
<li>
<a href="#">Something</a>
</li>
<li>
<a href="#">Something1</a>
</li>
<li>
<a href="#">Something2</a>
</li>
<li>
<a href="#">Something3</a>
</li>
</ul>
```
When a user clicks on a link within ... | 2015/07/01 | [
"https://Stackoverflow.com/questions/31162128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2547971/"
] | There are number of working examples for your context in SO. Its very simple in jquery and you asking very hard. Please look through [API Jquery](http://api.jquery.com/)
```
$("ul li a").click(function(e) {
e.preventDefault();
$('header').text($(this).text());
});
```
[**Fiddle**](http://jsfiddle.net/0xrxeuf... | I have set up a fiddle with the following (also takes care of the back button): <https://jsfiddle.net/0dLy3xwq/2/>
HTML:
```
<header id="linkLabel"></header>
<a href="#" id="backButton">Back</a>
<ul id="navigationList">
<li>
<a href="#">Something</a>
</li>
<li>
<a href="#">Something1</a>
<... |
11,871,805 | Here is the scenario: I am getting data from database through web server. Based on that data page sends another request to the same server to perform some action. Simplified structure is the following:
```
var datacon;
$.post('method',function(data){
datacon = data;
// populating some tags;
}) // end of post
//s... | 2012/08/08 | [
"https://Stackoverflow.com/questions/11871805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1254285/"
] | Use the CSS [`max-width`](http://quirksmode.org/css/width.html) property on the div.
Something like this should work:
```
$('#Div').css({display:'block',
position: 'absolute',
top: offset.top,
left:offset.left,
max-width: '200px'
}).... | Constrain it with a max-height, or a max-width. |
11,871,805 | Here is the scenario: I am getting data from database through web server. Based on that data page sends another request to the same server to perform some action. Simplified structure is the following:
```
var datacon;
$.post('method',function(data){
datacon = data;
// populating some tags;
}) // end of post
//s... | 2012/08/08 | [
"https://Stackoverflow.com/questions/11871805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1254285/"
] | You can constrain the image by way of the div, or the image. Here's a jsfiddle of constraining the image by setting a width on the div, and having the image fill the div as best possible: <http://jsfiddle.net/LELns/> | Use the CSS [`max-width`](http://quirksmode.org/css/width.html) property on the div.
Something like this should work:
```
$('#Div').css({display:'block',
position: 'absolute',
top: offset.top,
left:offset.left,
max-width: '200px'
}).... |
11,871,805 | Here is the scenario: I am getting data from database through web server. Based on that data page sends another request to the same server to perform some action. Simplified structure is the following:
```
var datacon;
$.post('method',function(data){
datacon = data;
// populating some tags;
}) // end of post
//s... | 2012/08/08 | [
"https://Stackoverflow.com/questions/11871805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1254285/"
] | You can constrain the image by way of the div, or the image. Here's a jsfiddle of constraining the image by setting a width on the div, and having the image fill the div as best possible: <http://jsfiddle.net/LELns/> | Constrain it with a max-height, or a max-width. |
11,783,280 | I am using cURL to try to download all files in a certain directory.
here's what my list of files looks like:

I have tried to do in bash script: `iiumlabs.[].csv.pgp` and `iiumlabs*` and I guess curl is not big on wildcards.
```
curl -u login:pass... | 2012/08/02 | [
"https://Stackoverflow.com/questions/11783280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/117700/"
] | You can use script like this for mac:
```
for f in $(curl -s -l -u user:pass ftp://your_ftp_server_ip/folder/)
do curl -O -u user:pass ftp://your_ftp_server_ip/folder/$f
done
``` | Oh, I have just the thing you need!
```
$host = "ftp://example.com/dir/";
$savePath = "downloadedFiles";
if($check = isFtpUp($host)){
echo $ip." -is alive<br />";
$check = trim($check);
$files = explode("\n",$check);
foreach($files as $n=>$file){
$file = trim($file);
if($file !== "."... |
11,783,280 | I am using cURL to try to download all files in a certain directory.
here's what my list of files looks like:

I have tried to do in bash script: `iiumlabs.[].csv.pgp` and `iiumlabs*` and I guess curl is not big on wildcards.
```
curl -u login:pass... | 2012/08/02 | [
"https://Stackoverflow.com/questions/11783280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/117700/"
] | OK, considering that you are using Windows, the most simple way to do that is to use the standard `ftp` tool bundled with it. I base the following solution on Windows XP, hoping it'll work as well (or with minor modifications) on other versions.
First of all, you need to create a batch (script) file for the `ftp` prog... | You can use script like this for mac:
```
for f in $(curl -s -l -u user:pass ftp://your_ftp_server_ip/folder/)
do curl -O -u user:pass ftp://your_ftp_server_ip/folder/$f
done
``` |
11,783,280 | I am using cURL to try to download all files in a certain directory.
here's what my list of files looks like:

I have tried to do in bash script: `iiumlabs.[].csv.pgp` and `iiumlabs*` and I guess curl is not big on wildcards.
```
curl -u login:pass... | 2012/08/02 | [
"https://Stackoverflow.com/questions/11783280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/117700/"
] | If you're not bound to curl, you might want to use [wget](https://www.gnu.org/software/wget/manual/wget.html) in recursive mode but restricting it to one level of recursion, try the following;
```
wget --no-verbose --no-parent --recursive --level=1\
--no-directories --user=login --password=pass ftp://ftp.myftpsite.com... | Here is how I did to download quickly with cURL (I'm not sure how many files it can download though) :
```
setlocal EnableDelayedExpansion
cd where\to\download
set STR=
for /f "skip=2 delims=" %%F in ('P:\curl -l -u user:password ftp://ftp.example.com/directory/anotherone/') do set STR=-O "ftp://ftp.example.com/dire... |
11,783,280 | I am using cURL to try to download all files in a certain directory.
here's what my list of files looks like:

I have tried to do in bash script: `iiumlabs.[].csv.pgp` and `iiumlabs*` and I guess curl is not big on wildcards.
```
curl -u login:pass... | 2012/08/02 | [
"https://Stackoverflow.com/questions/11783280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/117700/"
] | What about something like this:
```
for /f %%f in ('curl -s -l -u user:pass ftp://ftp.myftpsite.com/') do curl -O -u user:pass ftp://ftp.myftpsite.com/%%f
``` | Oh, I have just the thing you need!
```
$host = "ftp://example.com/dir/";
$savePath = "downloadedFiles";
if($check = isFtpUp($host)){
echo $ip." -is alive<br />";
$check = trim($check);
$files = explode("\n",$check);
foreach($files as $n=>$file){
$file = trim($file);
if($file !== "."... |
11,783,280 | I am using cURL to try to download all files in a certain directory.
here's what my list of files looks like:

I have tried to do in bash script: `iiumlabs.[].csv.pgp` and `iiumlabs*` and I guess curl is not big on wildcards.
```
curl -u login:pass... | 2012/08/02 | [
"https://Stackoverflow.com/questions/11783280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/117700/"
] | What about something like this:
```
for /f %%f in ('curl -s -l -u user:pass ftp://ftp.myftpsite.com/') do curl -O -u user:pass ftp://ftp.myftpsite.com/%%f
``` | Here is how I did to download quickly with cURL (I'm not sure how many files it can download though) :
```
setlocal EnableDelayedExpansion
cd where\to\download
set STR=
for /f "skip=2 delims=" %%F in ('P:\curl -l -u user:password ftp://ftp.example.com/directory/anotherone/') do set STR=-O "ftp://ftp.example.com/dire... |
11,783,280 | I am using cURL to try to download all files in a certain directory.
here's what my list of files looks like:

I have tried to do in bash script: `iiumlabs.[].csv.pgp` and `iiumlabs*` and I guess curl is not big on wildcards.
```
curl -u login:pass... | 2012/08/02 | [
"https://Stackoverflow.com/questions/11783280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/117700/"
] | If you're not bound to curl, you might want to use [wget](https://www.gnu.org/software/wget/manual/wget.html) in recursive mode but restricting it to one level of recursion, try the following;
```
wget --no-verbose --no-parent --recursive --level=1\
--no-directories --user=login --password=pass ftp://ftp.myftpsite.com... | You can use script like this for mac:
```
for f in $(curl -s -l -u user:pass ftp://your_ftp_server_ip/folder/)
do curl -O -u user:pass ftp://your_ftp_server_ip/folder/$f
done
``` |
11,783,280 | I am using cURL to try to download all files in a certain directory.
here's what my list of files looks like:

I have tried to do in bash script: `iiumlabs.[].csv.pgp` and `iiumlabs*` and I guess curl is not big on wildcards.
```
curl -u login:pass... | 2012/08/02 | [
"https://Stackoverflow.com/questions/11783280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/117700/"
] | If you're not bound to curl, you might want to use [wget](https://www.gnu.org/software/wget/manual/wget.html) in recursive mode but restricting it to one level of recursion, try the following;
```
wget --no-verbose --no-parent --recursive --level=1\
--no-directories --user=login --password=pass ftp://ftp.myftpsite.com... | OK, considering that you are using Windows, the most simple way to do that is to use the standard `ftp` tool bundled with it. I base the following solution on Windows XP, hoping it'll work as well (or with minor modifications) on other versions.
First of all, you need to create a batch (script) file for the `ftp` prog... |
11,783,280 | I am using cURL to try to download all files in a certain directory.
here's what my list of files looks like:

I have tried to do in bash script: `iiumlabs.[].csv.pgp` and `iiumlabs*` and I guess curl is not big on wildcards.
```
curl -u login:pass... | 2012/08/02 | [
"https://Stackoverflow.com/questions/11783280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/117700/"
] | OK, considering that you are using Windows, the most simple way to do that is to use the standard `ftp` tool bundled with it. I base the following solution on Windows XP, hoping it'll work as well (or with minor modifications) on other versions.
First of all, you need to create a batch (script) file for the `ftp` prog... | What about something like this:
```
for /f %%f in ('curl -s -l -u user:pass ftp://ftp.myftpsite.com/') do curl -O -u user:pass ftp://ftp.myftpsite.com/%%f
``` |
11,783,280 | I am using cURL to try to download all files in a certain directory.
here's what my list of files looks like:

I have tried to do in bash script: `iiumlabs.[].csv.pgp` and `iiumlabs*` and I guess curl is not big on wildcards.
```
curl -u login:pass... | 2012/08/02 | [
"https://Stackoverflow.com/questions/11783280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/117700/"
] | You can use script like this for mac:
```
for f in $(curl -s -l -u user:pass ftp://your_ftp_server_ip/folder/)
do curl -O -u user:pass ftp://your_ftp_server_ip/folder/$f
done
``` | Here is how I did to download quickly with cURL (I'm not sure how many files it can download though) :
```
setlocal EnableDelayedExpansion
cd where\to\download
set STR=
for /f "skip=2 delims=" %%F in ('P:\curl -l -u user:password ftp://ftp.example.com/directory/anotherone/') do set STR=-O "ftp://ftp.example.com/dire... |
11,783,280 | I am using cURL to try to download all files in a certain directory.
here's what my list of files looks like:

I have tried to do in bash script: `iiumlabs.[].csv.pgp` and `iiumlabs*` and I guess curl is not big on wildcards.
```
curl -u login:pass... | 2012/08/02 | [
"https://Stackoverflow.com/questions/11783280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/117700/"
] | If you're not bound to curl, you might want to use [wget](https://www.gnu.org/software/wget/manual/wget.html) in recursive mode but restricting it to one level of recursion, try the following;
```
wget --no-verbose --no-parent --recursive --level=1\
--no-directories --user=login --password=pass ftp://ftp.myftpsite.com... | What about something like this:
```
for /f %%f in ('curl -s -l -u user:pass ftp://ftp.myftpsite.com/') do curl -O -u user:pass ftp://ftp.myftpsite.com/%%f
``` |
70,782,592 | I'm new to React and just started working with state so please bare with me. I also found a lot of similar questions but nothing that really addresses the following:
I have a reactstrap form that has disabled FormControls. When the user clicks the 'edit' button the FormControls need to be enabled. According to my know... | 2022/01/20 | [
"https://Stackoverflow.com/questions/70782592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13848021/"
] | For enabling the FormControl,
```
<Form.Control disabled={!this.state.editToggle} type="text" value={this.state.accTier} onChange={this.onValueChange} className='user-info' />
``` | Try replacing "disabled" with this line: disabled={this.state.editToggle ? "true" : "false"} |
860,966 | Imagine the following table (called `TestTable`):
```
id somedate somevalue
-- -------- ---------
45 01/Jan/09 3
23 08/Jan/09 5
12 02/Feb/09 0
77 14/Feb/09 7
39 20/Feb/09 34
33 02/Mar/09 6
```
I would like a query that returns a running total in date order, like:
``... | 2009/05/13 | [
"https://Stackoverflow.com/questions/860966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22194/"
] | **Update**, if you are running SQL Server 2012 see: <https://stackoverflow.com/a/10309947>
The problem is that the SQL Server implementation of the Over clause is [somewhat limited](http://wayback.archive.org/web/20090625062153/http://www.mydatabasesupport.com/forums/sqlserver-programming/189015-tsql-accmulations.html... | If you are using Sql server 2008 R2 above. Then, It would be shortest way to do;
```
Select id
,somedate
,somevalue,
LAG(runningtotal) OVER (ORDER BY somedate) + somevalue AS runningtotal
From TestTable
```
[LAG](https://learn.microsoft.com/en-us/sql/t-sql/functions/lag-transact-sql) is use to get previous ... |
860,966 | Imagine the following table (called `TestTable`):
```
id somedate somevalue
-- -------- ---------
45 01/Jan/09 3
23 08/Jan/09 5
12 02/Feb/09 0
77 14/Feb/09 7
39 20/Feb/09 34
33 02/Mar/09 6
```
I would like a query that returns a running total in date order, like:
``... | 2009/05/13 | [
"https://Stackoverflow.com/questions/860966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22194/"
] | Using join
Another variation is to use join. Now the query could look like:
```
SELECT a.id, a.value, SUM(b.Value)FROM RunTotalTestData a,
RunTotalTestData b
WHERE b.id <= a.id
GROUP BY a.id, a.value
ORDER BY a.id;
```
for more you can visite this link
<http://askme.indianyouth.info/details/ca... | ```
BEGIN TRAN
CREATE TABLE #Table (_Id INT IDENTITY(1,1) ,id INT , somedate VARCHAR(100) , somevalue INT)
INSERT INTO #Table ( id , somedate , somevalue )
SELECT 45 , '01/Jan/09', 3 UNION ALL
SELECT 23 , '08/Jan/09', 5 UNION ALL
SELECT 12 , '02/Feb/09', 0 UNION ALL
SELECT 77 , '14/Feb/09', 7 UNION ALL
SELECT... |
860,966 | Imagine the following table (called `TestTable`):
```
id somedate somevalue
-- -------- ---------
45 01/Jan/09 3
23 08/Jan/09 5
12 02/Feb/09 0
77 14/Feb/09 7
39 20/Feb/09 34
33 02/Mar/09 6
```
I would like a query that returns a running total in date order, like:
``... | 2009/05/13 | [
"https://Stackoverflow.com/questions/860966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22194/"
] | **Update**, if you are running SQL Server 2012 see: <https://stackoverflow.com/a/10309947>
The problem is that the SQL Server implementation of the Over clause is [somewhat limited](http://wayback.archive.org/web/20090625062153/http://www.mydatabasesupport.com/forums/sqlserver-programming/189015-tsql-accmulations.html... | Using join
Another variation is to use join. Now the query could look like:
```
SELECT a.id, a.value, SUM(b.Value)FROM RunTotalTestData a,
RunTotalTestData b
WHERE b.id <= a.id
GROUP BY a.id, a.value
ORDER BY a.id;
```
for more you can visite this link
<http://askme.indianyouth.info/details/ca... |
860,966 | Imagine the following table (called `TestTable`):
```
id somedate somevalue
-- -------- ---------
45 01/Jan/09 3
23 08/Jan/09 5
12 02/Feb/09 0
77 14/Feb/09 7
39 20/Feb/09 34
33 02/Mar/09 6
```
I would like a query that returns a running total in date order, like:
``... | 2009/05/13 | [
"https://Stackoverflow.com/questions/860966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22194/"
] | If you are using Sql server 2008 R2 above. Then, It would be shortest way to do;
```
Select id
,somedate
,somevalue,
LAG(runningtotal) OVER (ORDER BY somedate) + somevalue AS runningtotal
From TestTable
```
[LAG](https://learn.microsoft.com/en-us/sql/t-sql/functions/lag-transact-sql) is use to get previous ... | Though best way is to get it done will be using a window function, it can also be done using a simple **correlated sub-query**.
```
Select id, someday, somevalue, (select sum(somevalue)
from testtable as t2
where t2.id = t1.id
... |
860,966 | Imagine the following table (called `TestTable`):
```
id somedate somevalue
-- -------- ---------
45 01/Jan/09 3
23 08/Jan/09 5
12 02/Feb/09 0
77 14/Feb/09 7
39 20/Feb/09 34
33 02/Mar/09 6
```
I would like a query that returns a running total in date order, like:
``... | 2009/05/13 | [
"https://Stackoverflow.com/questions/860966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22194/"
] | While Sam Saffron did great work on it, he still didn't provide **recursive common table expression** code for this problem. And for us who working with SQL Server 2008 R2 and not Denali, it's still fastest way to get running total, it's about 10 times faster than cursor on my work computer for 100000 rows, and it's al... | ```
SELECT TOP 25 amount,
(SELECT SUM(amount)
FROM time_detail b
WHERE b.time_detail_id <= a.time_detail_id) AS Total FROM time_detail a
```
You can also use the ROW\_NUMBER() function and a temp table to create an arbitrary column to use in the comparison on the inner SELECT statement. |
860,966 | Imagine the following table (called `TestTable`):
```
id somedate somevalue
-- -------- ---------
45 01/Jan/09 3
23 08/Jan/09 5
12 02/Feb/09 0
77 14/Feb/09 7
39 20/Feb/09 34
33 02/Mar/09 6
```
I would like a query that returns a running total in date order, like:
``... | 2009/05/13 | [
"https://Stackoverflow.com/questions/860966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22194/"
] | **Update**, if you are running SQL Server 2012 see: <https://stackoverflow.com/a/10309947>
The problem is that the SQL Server implementation of the Over clause is [somewhat limited](http://wayback.archive.org/web/20090625062153/http://www.mydatabasesupport.com/forums/sqlserver-programming/189015-tsql-accmulations.html... | Assuming that windowing works on SQL Server 2008 like it does elsewhere (that I've tried), give this a go:
```
select testtable.*, sum(somevalue) over(order by somedate)
from testtable
order by somedate;
```
[MSDN](http://msdn.microsoft.com/en-us/library/ms189461.aspx) says it's available in SQL Server 2008 (and may... |
860,966 | Imagine the following table (called `TestTable`):
```
id somedate somevalue
-- -------- ---------
45 01/Jan/09 3
23 08/Jan/09 5
12 02/Feb/09 0
77 14/Feb/09 7
39 20/Feb/09 34
33 02/Mar/09 6
```
I would like a query that returns a running total in date order, like:
``... | 2009/05/13 | [
"https://Stackoverflow.com/questions/860966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22194/"
] | ```
SELECT TOP 25 amount,
(SELECT SUM(amount)
FROM time_detail b
WHERE b.time_detail_id <= a.time_detail_id) AS Total FROM time_detail a
```
You can also use the ROW\_NUMBER() function and a temp table to create an arbitrary column to use in the comparison on the inner SELECT statement. | You can also denormalize - store running totals in the same table:
<http://sqlblog.com/blogs/alexander_kuznetsov/archive/2009/01/23/denormalizing-to-enforce-business-rules-running-totals.aspx>
Selects work much faster than any other solutions, but modifications may be slower |
860,966 | Imagine the following table (called `TestTable`):
```
id somedate somevalue
-- -------- ---------
45 01/Jan/09 3
23 08/Jan/09 5
12 02/Feb/09 0
77 14/Feb/09 7
39 20/Feb/09 34
33 02/Mar/09 6
```
I would like a query that returns a running total in date order, like:
``... | 2009/05/13 | [
"https://Stackoverflow.com/questions/860966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22194/"
] | The APPLY operator in SQL 2005 and higher works for this:
```
select
t.id ,
t.somedate ,
t.somevalue ,
rt.runningTotal
from TestTable t
cross apply (select sum(somevalue) as runningTotal
from TestTable
where somedate <= t.somedate
) as rt
order by t.somedate... | Use a correlated sub-query. Very simple, here you go:
```
SELECT
somedate,
(SELECT SUM(somevalue) FROM TestTable t2 WHERE t2.somedate<=t1.somedate) AS running_total
FROM TestTable t1
GROUP BY somedate
ORDER BY somedate
```
The code might not be exactly correct, but I'm sure that the idea is.
The GROUP BY is in ca... |
860,966 | Imagine the following table (called `TestTable`):
```
id somedate somevalue
-- -------- ---------
45 01/Jan/09 3
23 08/Jan/09 5
12 02/Feb/09 0
77 14/Feb/09 7
39 20/Feb/09 34
33 02/Mar/09 6
```
I would like a query that returns a running total in date order, like:
``... | 2009/05/13 | [
"https://Stackoverflow.com/questions/860966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22194/"
] | If you are using Sql server 2008 R2 above. Then, It would be shortest way to do;
```
Select id
,somedate
,somevalue,
LAG(runningtotal) OVER (ORDER BY somedate) + somevalue AS runningtotal
From TestTable
```
[LAG](https://learn.microsoft.com/en-us/sql/t-sql/functions/lag-transact-sql) is use to get previous ... | The following will produce the required results.
```
SELECT a.SomeDate,
a.SomeValue,
SUM(b.SomeValue) AS RunningTotal
FROM TestTable a
CROSS JOIN TestTable b
WHERE (b.SomeDate <= a.SomeDate)
GROUP BY a.SomeDate,a.SomeValue
ORDER BY a.SomeDate,a.SomeValue
```
Having a clustered index on SomeDate will g... |
860,966 | Imagine the following table (called `TestTable`):
```
id somedate somevalue
-- -------- ---------
45 01/Jan/09 3
23 08/Jan/09 5
12 02/Feb/09 0
77 14/Feb/09 7
39 20/Feb/09 34
33 02/Mar/09 6
```
I would like a query that returns a running total in date order, like:
``... | 2009/05/13 | [
"https://Stackoverflow.com/questions/860966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22194/"
] | While Sam Saffron did great work on it, he still didn't provide **recursive common table expression** code for this problem. And for us who working with SQL Server 2008 R2 and not Denali, it's still fastest way to get running total, it's about 10 times faster than cursor on my work computer for 100000 rows, and it's al... | Assuming that windowing works on SQL Server 2008 like it does elsewhere (that I've tried), give this a go:
```
select testtable.*, sum(somevalue) over(order by somedate)
from testtable
order by somedate;
```
[MSDN](http://msdn.microsoft.com/en-us/library/ms189461.aspx) says it's available in SQL Server 2008 (and may... |
36,244,384 | I'm trying to filter results on an HTML page by having the users select multiple options through dropdowns and text boxes.
One example is filtering results within a 10 mile radius of a user.
I have all the mechanics working but I'm not sure if I'm doing it right.
So I have something like:
<http://slickdeals.net/deal... | 2016/03/27 | [
"https://Stackoverflow.com/questions/36244384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923236/"
] | ```
dict1={'a':1, 'b':'banana'}
```
To list the dictionary in Python 2.x:
```
for k,v in dict1.iteritems():
print k,v
```
In Python 3.x use:
```
for k,v in dict1.items():
print(k,v)
# a 1
# b banana
```
Finally, as others have indicated, if you want a running index, you can have that too:
```
... | ```py
d = {0: 'zero', '0': 'ZERO', 1: 'one', '1': 'ONE'}
print("List of enumerated d= ", list(enumerate(d.items())))
```
output:
```
List of enumerated d= [(0, (0, 'zero')), (1, ('0', 'ZERO')), (2, (1, 'one')), (3, ('1', 'ONE'))]
``` |
36,244,384 | I'm trying to filter results on an HTML page by having the users select multiple options through dropdowns and text boxes.
One example is filtering results within a 10 mile radius of a user.
I have all the mechanics working but I'm not sure if I'm doing it right.
So I have something like:
<http://slickdeals.net/deal... | 2016/03/27 | [
"https://Stackoverflow.com/questions/36244384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923236/"
] | That sure must seem confusing. So this is what is going on. The first value of enumerate (in this case i) returns the next index value starting at 0 so 0, 1, 2, 3, ... It will always return these numbers regardless of what is in the dictionary. The second value of enumerate (in this case j) is returning the values in y... | ```py
d = {0: 'zero', '0': 'ZERO', 1: 'one', '1': 'ONE'}
print("List of enumerated d= ", list(enumerate(d.items())))
```
output:
```
List of enumerated d= [(0, (0, 'zero')), (1, ('0', 'ZERO')), (2, (1, 'one')), (3, ('1', 'ONE'))]
``` |
36,244,384 | I'm trying to filter results on an HTML page by having the users select multiple options through dropdowns and text boxes.
One example is filtering results within a 10 mile radius of a user.
I have all the mechanics working but I'm not sure if I'm doing it right.
So I have something like:
<http://slickdeals.net/deal... | 2016/03/27 | [
"https://Stackoverflow.com/questions/36244384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923236/"
] | Since you are using `enumerate` hence your `i` is actually the index of the key rather than the key itself.
So, you are getting `3` in the first column of the row `3 4`even though there is no key `3`.
`enumerate` iterates through a data structure(be it list or a dictionary) while also providing the current iteration ... | ```py
d = {0: 'zero', '0': 'ZERO', 1: 'one', '1': 'ONE'}
print("List of enumerated d= ", list(enumerate(d.items())))
```
output:
```
List of enumerated d= [(0, (0, 'zero')), (1, ('0', 'ZERO')), (2, (1, 'one')), (3, ('1', 'ONE'))]
``` |
36,244,384 | I'm trying to filter results on an HTML page by having the users select multiple options through dropdowns and text boxes.
One example is filtering results within a 10 mile radius of a user.
I have all the mechanics working but I'm not sure if I'm doing it right.
So I have something like:
<http://slickdeals.net/deal... | 2016/03/27 | [
"https://Stackoverflow.com/questions/36244384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923236/"
] | ```
dict1={'a':1, 'b':'banana'}
```
To list the dictionary in Python 2.x:
```
for k,v in dict1.iteritems():
print k,v
```
In Python 3.x use:
```
for k,v in dict1.items():
print(k,v)
# a 1
# b banana
```
Finally, as others have indicated, if you want a running index, you can have that too:
```
... | `enumerate()` when working on list actually gives the index and the value of the items inside the list.
For example:
```
l = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i, j in enumerate(list):
print(i, j)
```
gives
```
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
```
where the first column denotes the index of the item and 2nd c... |
36,244,384 | I'm trying to filter results on an HTML page by having the users select multiple options through dropdowns and text boxes.
One example is filtering results within a 10 mile radius of a user.
I have all the mechanics working but I'm not sure if I'm doing it right.
So I have something like:
<http://slickdeals.net/deal... | 2016/03/27 | [
"https://Stackoverflow.com/questions/36244384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923236/"
] | `enumerate()` when working on list actually gives the index and the value of the items inside the list.
For example:
```
l = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i, j in enumerate(list):
print(i, j)
```
gives
```
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
```
where the first column denotes the index of the item and 2nd c... | 1. Iterating over a Python dict means to iterate over its keys exactly the same way as with `dict.keys()`
2. The order of the keys is determined by the implementation code and you cannot expect some specific order:
>
> Keys and values are iterated over in an arbitrary order which is
> non-random, varies across Pytho... |
36,244,384 | I'm trying to filter results on an HTML page by having the users select multiple options through dropdowns and text boxes.
One example is filtering results within a 10 mile radius of a user.
I have all the mechanics working but I'm not sure if I'm doing it right.
So I have something like:
<http://slickdeals.net/deal... | 2016/03/27 | [
"https://Stackoverflow.com/questions/36244384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923236/"
] | Just thought I'd add, if you'd like to enumerate over the index, key, and values of a dictionary, your for loop should look like this:
```
for index, (key, value) in enumerate(your_dict.items()):
print(index, key, value)
``` | ```
dict1={'a':1, 'b':'banana'}
```
To list the dictionary in Python 2.x:
```
for k,v in dict1.iteritems():
print k,v
```
In Python 3.x use:
```
for k,v in dict1.items():
print(k,v)
# a 1
# b banana
```
Finally, as others have indicated, if you want a running index, you can have that too:
```
... |
36,244,384 | I'm trying to filter results on an HTML page by having the users select multiple options through dropdowns and text boxes.
One example is filtering results within a 10 mile radius of a user.
I have all the mechanics working but I'm not sure if I'm doing it right.
So I have something like:
<http://slickdeals.net/deal... | 2016/03/27 | [
"https://Stackoverflow.com/questions/36244384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923236/"
] | ```
dict1={'a':1, 'b':'banana'}
```
To list the dictionary in Python 2.x:
```
for k,v in dict1.iteritems():
print k,v
```
In Python 3.x use:
```
for k,v in dict1.items():
print(k,v)
# a 1
# b banana
```
Finally, as others have indicated, if you want a running index, you can have that too:
```
... | Python3:
One solution:
```
enumm = {0: 1, 1: 2, 2: 3, 4: 4, 5: 5, 6: 6, 7: 7}
for i, k in enumerate(enumm):
print("{}) d.key={}, d.value={}".format(i, k, enumm[k]))
```
---
```
Output:
0) enumm.key=0, enumm.value=1
1) enumm.key=1, enumm.value=2
2) enumm.key=2, enumm.value=3
3) enumm.key=4, enumm.value=4
4) enu... |
36,244,384 | I'm trying to filter results on an HTML page by having the users select multiple options through dropdowns and text boxes.
One example is filtering results within a 10 mile radius of a user.
I have all the mechanics working but I'm not sure if I'm doing it right.
So I have something like:
<http://slickdeals.net/deal... | 2016/03/27 | [
"https://Stackoverflow.com/questions/36244384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923236/"
] | Just thought I'd add, if you'd like to enumerate over the index, key, and values of a dictionary, your for loop should look like this:
```
for index, (key, value) in enumerate(your_dict.items()):
print(index, key, value)
``` | Since you are using `enumerate` hence your `i` is actually the index of the key rather than the key itself.
So, you are getting `3` in the first column of the row `3 4`even though there is no key `3`.
`enumerate` iterates through a data structure(be it list or a dictionary) while also providing the current iteration ... |
36,244,384 | I'm trying to filter results on an HTML page by having the users select multiple options through dropdowns and text boxes.
One example is filtering results within a 10 mile radius of a user.
I have all the mechanics working but I'm not sure if I'm doing it right.
So I have something like:
<http://slickdeals.net/deal... | 2016/03/27 | [
"https://Stackoverflow.com/questions/36244384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923236/"
] | The first column of output is the index of each item in `enumm` and the second one is its keys. If you want to iterate your dictionary then use .items():
```
for k, v in enumm.items():
print(k, v)
```
And the output should look like:
```
0 1
1 2
2 3
4 4
5 5
6 6
7 7
``` | You may find it useful to include index inside key:
```
d = {'a': 1, 'b': 2}
d = {(i, k): v for i, (k, v) in enumerate(d.items())}
```
Output:
```
{(0, 'a'): True, (1, 'b'): False}
``` |
36,244,384 | I'm trying to filter results on an HTML page by having the users select multiple options through dropdowns and text boxes.
One example is filtering results within a 10 mile radius of a user.
I have all the mechanics working but I'm not sure if I'm doing it right.
So I have something like:
<http://slickdeals.net/deal... | 2016/03/27 | [
"https://Stackoverflow.com/questions/36244384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2923236/"
] | Just thought I'd add, if you'd like to enumerate over the index, key, and values of a dictionary, your for loop should look like this:
```
for index, (key, value) in enumerate(your_dict.items()):
print(index, key, value)
``` | Python3:
One solution:
```
enumm = {0: 1, 1: 2, 2: 3, 4: 4, 5: 5, 6: 6, 7: 7}
for i, k in enumerate(enumm):
print("{}) d.key={}, d.value={}".format(i, k, enumm[k]))
```
---
```
Output:
0) enumm.key=0, enumm.value=1
1) enumm.key=1, enumm.value=2
2) enumm.key=2, enumm.value=3
3) enumm.key=4, enumm.value=4
4) enu... |
55,801,112 | I saw the following CSS code with what appears to be a triple greater than selector.
```
.b-table >>> .table-wrapper {
overflow-x: auto;
}
```
I know it's referencing a Buefy table component and applying a specific style to elements that have a `table-wrapper` class, but what does the `>>>`operator mean exactly? ... | 2019/04/22 | [
"https://Stackoverflow.com/questions/55801112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7932229/"
] | `>>>` operator is Vue.js specific feature and called [**deep selector**](https://vue-loader.vuejs.org/guide/scoped-css.html#child-component-root-elements). In scoped CSS, you cannot apply CSS to child components without deep selector.
As your example, these two selector won't be applied.
```
<style scoped>
.table-wra... | It is **shadow-piercing descendant combinator**. In Angular, `>>>`, `/deep/` and `::ng-deep` are the same (source: <https://angular.io/guide/component-styles#deprecated-deep--and-ng-deep>). It is deprecated and support has ben removed from major browsers. For example, it has been removed since Chrome version 63, around... |
2,078,914 | Is it possible to achieve the following code? I know it doesn't work, but I'm wondering if there is a workaround?
```
Type k = typeof(double);
List<k> lst = new List<k>();
``` | 2010/01/16 | [
"https://Stackoverflow.com/questions/2078914",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251985/"
] | Yes, there is:
```
var genericListType = typeof(List<>);
var specificListType = genericListType.MakeGenericType(typeof(double));
var list = Activator.CreateInstance(specificListType);
``` | A cleaner way might be to use a generic method. Do something like this:
```
static void AddType<T>()
where T : DataObject
{
Indexes.Add(typeof(T), new Dictionary<int, T>());
}
``` |
914,558 | I would like to show a div based on the Onclick event of an link.
First Click - Show div1
Second Click - Hide remaining div's and Show div2
Third Click - Hide remaining div's and show div3
Fourth Click - Hide remaining div's and show div1 => repeat the loop and goes on..
>
> ***Code Follows:***
>
>
>... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98807/"
] | I'll try my shot.
---
EDIT:
After second though, to avoid global variable use it's better to do the following
```
$(document).ready(function() {
$("#toggle_value").click((function(){
var counter = 0;
return function()
{
$("#div" + counter).hide("fast");
counter =... | The .toggle function in jQuery takes any number of argument functions, so the problem is already solved. See the docs under Events. |
914,558 | I would like to show a div based on the Onclick event of an link.
First Click - Show div1
Second Click - Hide remaining div's and Show div2
Third Click - Hide remaining div's and show div3
Fourth Click - Hide remaining div's and show div1 => repeat the loop and goes on..
>
> ***Code Follows:***
>
>
>... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98807/"
] | You should add a counter in the function.
```
$(document).ready(function() {
var count = 0;
$("#toggle_value").click(function(){
if (count == 0) {
$("#div1").show("fast");
$('#div2').hide();
count++;
}
else if (count == 1) {
$("#div2").sh... | ```
<div id="div_<%=id>">
</div>
<div id="Hide_<%=id>" style="display:none;">
</div>
<div id="div_<%=id>">
</div>
<div id="Hide_<%=id>" style="display:none;">
</div>
<div id="div_<%=id>">
</div>
<div id="Hide_<%=id>" style="display:none;">
</div>
<div id="div_<%=id>">
</div>
<div id="Hide_<%=id>" style="display:none;">... |
914,558 | I would like to show a div based on the Onclick event of an link.
First Click - Show div1
Second Click - Hide remaining div's and Show div2
Third Click - Hide remaining div's and show div3
Fourth Click - Hide remaining div's and show div1 => repeat the loop and goes on..
>
> ***Code Follows:***
>
>
>... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98807/"
] | How about this
**[Working Example here](http://jsbin.com/ozape)** - add **/edit** to URL to edit the code
```
$('html').addClass('js'); // prevent hiding divs on DOM ready from 'flashing'
$(function() {
var counter = 1;
$('#toggle_value').click(function() {
$('div','#container')
// to stop current an... | My solution is a little different - I'd do it dependant on the state of the divs at the current time (on click). See below for what I mean by this.
```
$(document).ready(function() {
$("#toggle_value").click(function(){
if ($("#div1).is(':visible')) { // Second click
// Hide all divs and show d2... |
914,558 | I would like to show a div based on the Onclick event of an link.
First Click - Show div1
Second Click - Hide remaining div's and Show div2
Third Click - Hide remaining div's and show div3
Fourth Click - Hide remaining div's and show div1 => repeat the loop and goes on..
>
> ***Code Follows:***
>
>
>... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98807/"
] | I'll try my shot.
---
EDIT:
After second though, to avoid global variable use it's better to do the following
```
$(document).ready(function() {
$("#toggle_value").click((function(){
var counter = 0;
return function()
{
$("#div" + counter).hide("fast");
counter =... | You should add a counter in the function.
```
$(document).ready(function() {
var count = 0;
$("#toggle_value").click(function(){
if (count == 0) {
$("#div1").show("fast");
$('#div2').hide();
count++;
}
else if (count == 1) {
$("#div2").sh... |
914,558 | I would like to show a div based on the Onclick event of an link.
First Click - Show div1
Second Click - Hide remaining div's and Show div2
Third Click - Hide remaining div's and show div3
Fourth Click - Hide remaining div's and show div1 => repeat the loop and goes on..
>
> ***Code Follows:***
>
>
>... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98807/"
] | How about this
**[Working Example here](http://jsbin.com/ozape)** - add **/edit** to URL to edit the code
```
$('html').addClass('js'); // prevent hiding divs on DOM ready from 'flashing'
$(function() {
var counter = 1;
$('#toggle_value').click(function() {
$('div','#container')
// to stop current an... | First You have to add query basic file:
```
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
```
Then you have to add the following code:
```
<script type="text/javascript">
$(document).ready(function () {
$("#hide").click(function(){
$(".slider_area").... |
914,558 | I would like to show a div based on the Onclick event of an link.
First Click - Show div1
Second Click - Hide remaining div's and Show div2
Third Click - Hide remaining div's and show div3
Fourth Click - Hide remaining div's and show div1 => repeat the loop and goes on..
>
> ***Code Follows:***
>
>
>... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98807/"
] | How about this
**[Working Example here](http://jsbin.com/ozape)** - add **/edit** to URL to edit the code
```
$('html').addClass('js'); // prevent hiding divs on DOM ready from 'flashing'
$(function() {
var counter = 1;
$('#toggle_value').click(function() {
$('div','#container')
// to stop current an... | The .toggle function in jQuery takes any number of argument functions, so the problem is already solved. See the docs under Events. |
914,558 | I would like to show a div based on the Onclick event of an link.
First Click - Show div1
Second Click - Hide remaining div's and Show div2
Third Click - Hide remaining div's and show div3
Fourth Click - Hide remaining div's and show div1 => repeat the loop and goes on..
>
> ***Code Follows:***
>
>
>... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98807/"
] | I'll try my shot.
---
EDIT:
After second though, to avoid global variable use it's better to do the following
```
$(document).ready(function() {
$("#toggle_value").click((function(){
var counter = 0;
return function()
{
$("#div" + counter).hide("fast");
counter =... | I would probably do something like: (The following assumes all your `<div>`s are in a container with id "container")
```
$(document).ready(function() {
var $allDivs = $("#container > div");
var counter = 0;
$("#container > div").click(function(){
counter = counter < $allDivs.length - 1 ? counter + 1 : 0;
... |
914,558 | I would like to show a div based on the Onclick event of an link.
First Click - Show div1
Second Click - Hide remaining div's and Show div2
Third Click - Hide remaining div's and show div3
Fourth Click - Hide remaining div's and show div1 => repeat the loop and goes on..
>
> ***Code Follows:***
>
>
>... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98807/"
] | How about this
**[Working Example here](http://jsbin.com/ozape)** - add **/edit** to URL to edit the code
```
$('html').addClass('js'); // prevent hiding divs on DOM ready from 'flashing'
$(function() {
var counter = 1;
$('#toggle_value').click(function() {
$('div','#container')
// to stop current an... | ```
$("#toggle_value").click(function()
{
$("#div" + (++c) % 3).show().siblings().hide();
}
``` |
914,558 | I would like to show a div based on the Onclick event of an link.
First Click - Show div1
Second Click - Hide remaining div's and Show div2
Third Click - Hide remaining div's and show div3
Fourth Click - Hide remaining div's and show div1 => repeat the loop and goes on..
>
> ***Code Follows:***
>
>
>... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98807/"
] | I'll try my shot.
---
EDIT:
After second though, to avoid global variable use it's better to do the following
```
$(document).ready(function() {
$("#toggle_value").click((function(){
var counter = 0;
return function()
{
$("#div" + counter).hide("fast");
counter =... | My solution is a little different - I'd do it dependant on the state of the divs at the current time (on click). See below for what I mean by this.
```
$(document).ready(function() {
$("#toggle_value").click(function(){
if ($("#div1).is(':visible')) { // Second click
// Hide all divs and show d2... |
914,558 | I would like to show a div based on the Onclick event of an link.
First Click - Show div1
Second Click - Hide remaining div's and Show div2
Third Click - Hide remaining div's and show div3
Fourth Click - Hide remaining div's and show div1 => repeat the loop and goes on..
>
> ***Code Follows:***
>
>
>... | 2009/05/27 | [
"https://Stackoverflow.com/questions/914558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98807/"
] | I'll try my shot.
---
EDIT:
After second though, to avoid global variable use it's better to do the following
```
$(document).ready(function() {
$("#toggle_value").click((function(){
var counter = 0;
return function()
{
$("#div" + counter).hide("fast");
counter =... | ```
var c = 1;
$("#toggle_value").click(function()
{
$("#div" + c).hide("fast");
$("#div" + ++c).show("fast");
if (c > 3) c=1;
});
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.