qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
154,695 | There are two worlds of more or less equivalent technological level, say a difference of only a few decades and no more than 50 years. A first contact event occurs and after the hoopla dies down trading starts.
Initially, barter is the primary form of trade but this quickly becomes cumbersome.
How would the two econ... | 2019/09/07 | [
"https://worldbuilding.stackexchange.com/questions/154695",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/5101/"
] | Why have an exchange rate?
Just deal in the local currency on whichever end of the trip I am at, and carry my wealth in the form of goods that will sell well at my next stop. Freight carriers don't like to run with empty holds, it is a waste of resources to sit still longer than necessary to unload and reload, and an ... | As bitcoin history shows, currency exchanges will emerge very quickly as soon as the currency is considered to have some nonzero value, despite exchange rate fluctuations. The rates on all these exchanges tend to quickly converge, and are used as a basis even for other people who trade directly. Even after failures of ... |
7,349,907 | I'm developing software that will utilize a config file. I don't know many syntaxes or formats of config files. Here are the two I know:
(common with .conf files)
```
[section]
key=value
#comment
```
or (common with .ini)
```
key value
; comment
```
My interest is something versatile that's almost a language. Le... | 2011/09/08 | [
"https://Stackoverflow.com/questions/7349907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425380/"
] | As of 2015, xml is no longer the de facto standard. Here are options.
[TOML](https://github.com/toml-lang/toml)
```
# This is a TOML document.
title = "TOML Example"
[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00
[servers]
# tabs / spaces ok but not required
[servers.alpha]
ip = "10.0.0... | This once-valid answer is being voted down in 2020, so I edited it.
In 2011, I suggested you use an xml format. This was the de-facto standard then.
The configuration document could have looked like this:
```
<?xml version="1.0" encoding="utf-8">
<configuraton>
<default>
<start>0</start>
<end>10<... |
30,537 | ***In Jeremiah, which dreams is God saying to not listen to?***
>
> **NKJV, Jeremiah 29:8** - For thus says the Lord of hosts, the God of Israel: Do not let your prophets and your diviners who are in your midst deceive you, nor listen to your dreams which you cause to be dreamed.
>
>
>
In Hebrew, is God saying f... | 2017/11/19 | [
"https://hermeneutics.stackexchange.com/questions/30537",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/6338/"
] | >
> Should "have dreamed" be translated in 2nd, or 3rd Person Plural? "... you all have dreamed" ... or, "... they have dreamed"?
>
>
>
The word is מַחְלְמִים, which is a masculine plural participle (which might be translated as "dream" in the present, or "dreamer," but certainly not "have dreamed" - on the exact ... | I think this verse may actually have to do with lucid dreaming. People recreationally did it in older times, and didn't have all of the odious New Age yoga alien content that a lot of people try to add to it nowadays. Lucid dreaming may have been something common amongst people from this certain time period as well, an... |
30,537 | ***In Jeremiah, which dreams is God saying to not listen to?***
>
> **NKJV, Jeremiah 29:8** - For thus says the Lord of hosts, the God of Israel: Do not let your prophets and your diviners who are in your midst deceive you, nor listen to your dreams which you cause to be dreamed.
>
>
>
In Hebrew, is God saying f... | 2017/11/19 | [
"https://hermeneutics.stackexchange.com/questions/30537",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/6338/"
] | >
> Should "have dreamed" be translated in 2nd, or 3rd Person Plural? "... you all have dreamed" ... or, "... they have dreamed"?
>
>
>
The word is מַחְלְמִים, which is a masculine plural participle (which might be translated as "dream" in the present, or "dreamer," but certainly not "have dreamed" - on the exact ... | I suggest the answer is to be found in the previous chapter, when the false prophet Hananiah the son of Azzur was proclaiming as follows;
"Thus says the Lord of hosts, the God of Israel; I have broken the yoke of the king of Babylon. Within two years I will bring back to this place all the vessels of the Lord's house,... |
4,672,619 | Yahoo blocks emails from our website. We've written them to reverse that decision without much luck. So we block site registrations from @yahoo.com emails. Our problem is Yahoo has other email domains besides @yahoo.com. For instance @ymail.com, @rocketmail.com, @btinternet.com, and I'm sure many more. Plus internation... | 2011/01/12 | [
"https://Stackoverflow.com/questions/4672619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/401019/"
] | Definitive list is probably the best way to go. You don't want to have to do some kind of lookup every time someone registers for your site. But if you really don't want to use a static list, you should be able to use `getmxrr()` and see if the MX record is from yahoo. | ymail.com and rocketmail.com both list yahoo.com as their DNS MX servers, so that's an obvious giveaway. btinternet.com, however, doesn't.
You can use [`getmxrr()`](http://php.net/manual/en/function.getmxrr.php) to retrieve the MX list |
52,335,378 | I'm new to RxJS observables and I'm trying to resolve a rather simple use case.
In a service, I first make a http call that returns an item (as an observable). The item contains an array of ids, some of them repeated. For each distinct id, I need to call another http service (again returns an observable), and add its ... | 2018/09/14 | [
"https://Stackoverflow.com/questions/52335378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/463893/"
] | I believe you need something like this:
```
import { from, forkJoin } from 'rxjs';
import { switchMap } from 'rxjs/operators';
itemWithSubItems$ = from(HttpGetMainItem()).pipe(
switchMap(item => {
const promises = _.uniq(item.subItems).map(item => HttpGetSubItem(item.sid));
return forkJoin(promise... | Maybe you could use a lib like async.each -> <https://caolan.github.io/async/docs.html#each> (eachSeries maybe).
would be something like :
```
async.each(array, (obj, cb) => {
observable with obj in parameter and with subscriber result :
cb(err, subscriberRes);
}, (err, res) => {
console.log(res);
}
``` |
52,335,378 | I'm new to RxJS observables and I'm trying to resolve a rather simple use case.
In a service, I first make a http call that returns an item (as an observable). The item contains an array of ids, some of them repeated. For each distinct id, I need to call another http service (again returns an observable), and add its ... | 2018/09/14 | [
"https://Stackoverflow.com/questions/52335378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/463893/"
] | Here's one way you can accomplish the above with rxjs.
1. Convert the promise to an observable using `from`.
2. In the outer pipe call `switchMap` so that you can call another observable and return that as the result of the outer observable. You're switching execution contexts.
3. Inside the switchMap do the map of su... | Maybe you could use a lib like async.each -> <https://caolan.github.io/async/docs.html#each> (eachSeries maybe).
would be something like :
```
async.each(array, (obj, cb) => {
observable with obj in parameter and with subscriber result :
cb(err, subscriberRes);
}, (err, res) => {
console.log(res);
}
``` |
52,335,378 | I'm new to RxJS observables and I'm trying to resolve a rather simple use case.
In a service, I first make a http call that returns an item (as an observable). The item contains an array of ids, some of them repeated. For each distinct id, I need to call another http service (again returns an observable), and add its ... | 2018/09/14 | [
"https://Stackoverflow.com/questions/52335378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/463893/"
] | Here's one way you can accomplish the above with rxjs.
1. Convert the promise to an observable using `from`.
2. In the outer pipe call `switchMap` so that you can call another observable and return that as the result of the outer observable. You're switching execution contexts.
3. Inside the switchMap do the map of su... | I believe you need something like this:
```
import { from, forkJoin } from 'rxjs';
import { switchMap } from 'rxjs/operators';
itemWithSubItems$ = from(HttpGetMainItem()).pipe(
switchMap(item => {
const promises = _.uniq(item.subItems).map(item => HttpGetSubItem(item.sid));
return forkJoin(promise... |
20,628,700 | I have the following (working) XAML for a ComboBox:
```
<ComboBox SelectedValue="{Binding SelectedItem}" ItemsSource="{Binding Items}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource MyEnumToStringConverter}}"/>
</DataTemplate>
</ComboBox.... | 2013/12/17 | [
"https://Stackoverflow.com/questions/20628700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/617658/"
] | It is not necessary to set the `ItemTemplate` of each ComboBox, either in a Style or not.
Instead you could simply create a default DataTemplate for the enum type by setting its [DataType](http://msdn.microsoft.com/en-us/library/system.windows.datatemplate.datatype.aspx) property
```
<Window.Resources>
<local:MyE... | You can create a new `MyEnumText` string based property that returns the `Description` attribute value of the enum value and bound your `TextBlock.Text` property to it as follows:
```
<ComboBox SelectedValue="{Binding SelectedItem}" ItemsSource="{Binding Items}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Tex... |
20,628,700 | I have the following (working) XAML for a ComboBox:
```
<ComboBox SelectedValue="{Binding SelectedItem}" ItemsSource="{Binding Items}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource MyEnumToStringConverter}}"/>
</DataTemplate>
</ComboBox.... | 2013/12/17 | [
"https://Stackoverflow.com/questions/20628700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/617658/"
] | OP here. I reformulated the question [here](https://stackoverflow.com/questions/20635329/specify-converter-inside-datatemplate-in-usercontrol) and [got an answer](https://stackoverflow.com/questions/20635329/specify-converter-inside-datatemplate-in-usercontrol/#20638111) that applies also to this question. | You can create a new `MyEnumText` string based property that returns the `Description` attribute value of the enum value and bound your `TextBlock.Text` property to it as follows:
```
<ComboBox SelectedValue="{Binding SelectedItem}" ItemsSource="{Binding Items}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Tex... |
1,818,862 | ```
public AddressBookApp(){
frame = new JFrame("Address Book");
frame.setSize(500, 400);
frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
panel = new JPanel();
panel.setBackground(Color.gray);
panel.setLayout(null);
frame.add(panel);
frame.setVisible(true);
JMenuBar menubar ... | 2009/11/30 | [
"https://Stackoverflow.com/questions/1818862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/221246/"
] | From the code I see no reason, why it should export data after pressing the next or previous button. Don't forget to close the streams after reading.
Just for curiosity - I've seen a lot of partial solutions to this assignment from various new SO users - and they have in common, that the assignees *seems* to lack some... | Your problem is the semicolon at the end of this line:
```
else if (e.getActionCommand().equals("Export"));
``` |
57,512 | I plan on building a web based room booking application for meeting rooms at a company. The requirements are not set in stone and are pretty much left to me, as long as these core ones are met:
1. Users can view monthly schedule for meeting room, so see what days and times there are bookings for a particular room.
2. ... | 2014/01/24 | [
"https://dba.stackexchange.com/questions/57512",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/20381/"
] | I agree with Wiggler Jtag's recommendation. Here's why:
Describe the relationship between `USER` and `ROOM`. If it is "a user can have zero, one, or more rooms booked" then you have a one to many relationship.
Describe the relationship between `ROOM` and `USER`. If it is "a room can have zero, one, or more bookings ... | The problem with the current design is that we are unable to uniquely identify which room a user has booked if he has booked more than 1 room .
To solve the problem , we should add another column : **Room Number** to the TABLE ROOM
This allows the **composite key** : Room Number& ID to form a **primary key** which ... |
57,512 | I plan on building a web based room booking application for meeting rooms at a company. The requirements are not set in stone and are pretty much left to me, as long as these core ones are met:
1. Users can view monthly schedule for meeting room, so see what days and times there are bookings for a particular room.
2. ... | 2014/01/24 | [
"https://dba.stackexchange.com/questions/57512",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/20381/"
] | How do you know how long a room is booked for? Your model indicates when a booking starts, but when does it end?
Also, your ERD shows foreign keys from `BOOKING` to `USER` and `ROOM` but these columns aren't acknowledged in your `BOOKING` table. Some other answers have interpreted that as the columns being missing. Yo... | I agree with Wiggler Jtag's recommendation. Here's why:
Describe the relationship between `USER` and `ROOM`. If it is "a user can have zero, one, or more rooms booked" then you have a one to many relationship.
Describe the relationship between `ROOM` and `USER`. If it is "a room can have zero, one, or more bookings ... |
57,512 | I plan on building a web based room booking application for meeting rooms at a company. The requirements are not set in stone and are pretty much left to me, as long as these core ones are met:
1. Users can view monthly schedule for meeting room, so see what days and times there are bookings for a particular room.
2. ... | 2014/01/24 | [
"https://dba.stackexchange.com/questions/57512",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/20381/"
] | How do you know how long a room is booked for? Your model indicates when a booking starts, but when does it end?
Also, your ERD shows foreign keys from `BOOKING` to `USER` and `ROOM` but these columns aren't acknowledged in your `BOOKING` table. Some other answers have interpreted that as the columns being missing. Yo... | The problem with the current design is that we are unable to uniquely identify which room a user has booked if he has booked more than 1 room .
To solve the problem , we should add another column : **Room Number** to the TABLE ROOM
This allows the **composite key** : Room Number& ID to form a **primary key** which ... |
16,976,335 | Assume we constructed a quicksort and the pivot value takes linear time. Find the recurrence for worst-case running time.
My answer:
T(n)= T(n-1) + T(1) + theta(n)
Worst case occurs when the subarrays are completely unbalanced.
There is 1 element in one subarray and (n-1) elements in the other subarray.
theta(n) beca... | 2013/06/07 | [
"https://Stackoverflow.com/questions/16976335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1855045/"
] | Your recurrence is mostly correct, but you don't actually have two recursive calls made. In the worst-case for quicksort, the pivot will be the largest or smallest element in the array, so you'll recur on one giant array of size n - 1. The other subarray has length 0, so no recursive calls are made. To top everything o... | you cannot observe, because according to my research T(N)= T(N-K)+T(K-1)+n
we cannot observe exact value until we have
value of k, |
16,976,335 | Assume we constructed a quicksort and the pivot value takes linear time. Find the recurrence for worst-case running time.
My answer:
T(n)= T(n-1) + T(1) + theta(n)
Worst case occurs when the subarrays are completely unbalanced.
There is 1 element in one subarray and (n-1) elements in the other subarray.
theta(n) beca... | 2013/06/07 | [
"https://Stackoverflow.com/questions/16976335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1855045/"
] | Your recurrence is mostly correct, but you don't actually have two recursive calls made. In the worst-case for quicksort, the pivot will be the largest or smallest element in the array, so you'll recur on one giant array of size n - 1. The other subarray has length 0, so no recursive calls are made. To top everything o... | T(n) = T(an/(a+b)) + T(bn/(a+b)) + n
Where a/(a+b) and b/(a+b) are fractions of array under consideration |
16,976,335 | Assume we constructed a quicksort and the pivot value takes linear time. Find the recurrence for worst-case running time.
My answer:
T(n)= T(n-1) + T(1) + theta(n)
Worst case occurs when the subarrays are completely unbalanced.
There is 1 element in one subarray and (n-1) elements in the other subarray.
theta(n) beca... | 2013/06/07 | [
"https://Stackoverflow.com/questions/16976335",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1855045/"
] | you cannot observe, because according to my research T(N)= T(N-K)+T(K-1)+n
we cannot observe exact value until we have
value of k, | T(n) = T(an/(a+b)) + T(bn/(a+b)) + n
Where a/(a+b) and b/(a+b) are fractions of array under consideration |
18,393,312 | I have a simple button, and I want to use CSS to make it onhover, bring up a dropdown of a few more buttons with links, and when the button is pressed I want the button to stay at the onhover state. How can this be accomplished? For example a games button that when hovered over it drops down to buttons that have differ... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18393312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2565624/"
] | When you make those two synchronized, the getter and setter themselves are thread-safe. More specifically:
- When you call the setter, you are guaranteed that the value of the variable is what you set it to when the method finishes.
- When you call the getter, you are guaranteed that the return value is the value of t... | `synchronized` in Java is an object-wide lock. Only one `synchronized` method of any given object can be executed on any given thread at a time. Let's have this class:
```
class Foo
{
private int bar;
public synchronized void SetBar() { ... }
public synchronized int GetBar() { ... }
}
```
* Thread 1 cal... |
18,393,312 | I have a simple button, and I want to use CSS to make it onhover, bring up a dropdown of a few more buttons with links, and when the button is pressed I want the button to stay at the onhover state. How can this be accomplished? For example a games button that when hovered over it drops down to buttons that have differ... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18393312",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2565624/"
] | >
> I figured the class could not be made thread-safe since even if you synchronize both methods, you could have a situation that Thread1 would invoke the setter and before Thread1 could invoke the getter, Thread2 might execute and invoke the setter, so that when Thread1 went and retrieved the result it would get the ... | `synchronized` in Java is an object-wide lock. Only one `synchronized` method of any given object can be executed on any given thread at a time. Let's have this class:
```
class Foo
{
private int bar;
public synchronized void SetBar() { ... }
public synchronized int GetBar() { ... }
}
```
* Thread 1 cal... |
65,743,711 | I'm building an app that detects sensors and shows the user information about the sensors automatically.
So I created a main page with a single tab to show a label saying "detecting", and when the system detects a sensor, a new page is opened with three tabs containing information about the sensor.
But I'm having som... | 2021/01/15 | [
"https://Stackoverflow.com/questions/65743711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6596416/"
] | According to you the `heavyModule` is not a React component
>
> I have a very heavy raw file **parsed as string** (around 10 mb) and I would like to lazy load it
>
>
>
So you cannot use `React.lazy()`. Instead i would recommend to import the raw file only where you require it and then render that particular compo... | The official doc states that "In the future we plan to let Suspense handle more scenarios such as data fetching. You can read about this in our roadmap.". The Roadmap mentioned an update to expect in late 2019. But it still is not implemented. This is detailed in this recent issue <https://github.com/reactjs/reactjs.or... |
4,287,814 | If the joint frequency function of random variables $X$ and $Y$ is given by:
$f\_{X,Y}(x,y)=\alpha \beta e^{-\alpha x-\beta y}$ $\,\,\,\,x\geq 0$ $\,\,\,\,y\geq 0$
then to get, for example, the marginal density function of $Y$ we would integrate the joint frequency function with respect to $X$.
This would give $f\_Y... | 2021/10/26 | [
"https://math.stackexchange.com/questions/4287814",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/904065/"
] | $P(c<Y<d)=\int\_c^{d}\int\_{-\infty}^{\infty} f\_{X,Y}(x,y) dxdy$ | The marginal density is defined as $$f\_Y(y) = \int f(x, y) dx$$. In this case, you treat $y$ as a constant, giving you $$\int\_0^\infty \alpha \beta e^{-\alpha x - \beta y} dx = \beta e^{-\beta y} \int\_0^\infty \alpha e^{-\alpha x} dx = \beta e^{-\beta y}$$ |
4,287,814 | If the joint frequency function of random variables $X$ and $Y$ is given by:
$f\_{X,Y}(x,y)=\alpha \beta e^{-\alpha x-\beta y}$ $\,\,\,\,x\geq 0$ $\,\,\,\,y\geq 0$
then to get, for example, the marginal density function of $Y$ we would integrate the joint frequency function with respect to $X$.
This would give $f\_Y... | 2021/10/26 | [
"https://math.stackexchange.com/questions/4287814",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/904065/"
] | the given density can be rewritten in the following way
$$f\_{XY}(x,y)=\alpha e^{-\alpha x}\times \beta e^{-\beta x}=f\_X(x)\times f\_Y(y)$$
thus you immediately get your marginals as independent exponentials | The marginal density is defined as $$f\_Y(y) = \int f(x, y) dx$$. In this case, you treat $y$ as a constant, giving you $$\int\_0^\infty \alpha \beta e^{-\alpha x - \beta y} dx = \beta e^{-\beta y} \int\_0^\infty \alpha e^{-\alpha x} dx = \beta e^{-\beta y}$$ |
4,287,814 | If the joint frequency function of random variables $X$ and $Y$ is given by:
$f\_{X,Y}(x,y)=\alpha \beta e^{-\alpha x-\beta y}$ $\,\,\,\,x\geq 0$ $\,\,\,\,y\geq 0$
then to get, for example, the marginal density function of $Y$ we would integrate the joint frequency function with respect to $X$.
This would give $f\_Y... | 2021/10/26 | [
"https://math.stackexchange.com/questions/4287814",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/904065/"
] | $P(c<Y<d)=\int\_c^{d}\int\_{-\infty}^{\infty} f\_{X,Y}(x,y) dxdy$ | the given density can be rewritten in the following way
$$f\_{XY}(x,y)=\alpha e^{-\alpha x}\times \beta e^{-\beta x}=f\_X(x)\times f\_Y(y)$$
thus you immediately get your marginals as independent exponentials |
69,395 | In the context of the scholarly apparatus package [`ednotes`](http://www.ctan.org/pkg/ednotes) I would like to create a customized `\Bnote` which behaves like a normal LaTeX footnote; i.e., I would like to enter into the body of the text something like
```
blah blah.\Bnote{a}{This is the footnote text.} Blah blah blah... | 2012/08/30 | [
"https://tex.stackexchange.com/questions/69395",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/17054/"
] | I suspect that it is possible to create a hack that puts "normal" footnotes below the "apparatus" notes of `ednotes`. As I don't know how to do that, here's a second-best solution that
* removes the line numbers from and changes the mark format of `\Bnote`;
* defines a new macro `\Bfootnote` that tinkers with the `foo... | In the meantime I (`ednotes`'s author) have told by mail: `ednotes` uses `manyfoot` as "footnote engine". `ednotes`'s setup of footnote layers uses `manyfoot`'s setup to create layers of footnotes without footnote marks. To get the footnote marks "back", I think one should not try from within `ednotes`, better use `man... |
69,395 | In the context of the scholarly apparatus package [`ednotes`](http://www.ctan.org/pkg/ednotes) I would like to create a customized `\Bnote` which behaves like a normal LaTeX footnote; i.e., I would like to enter into the body of the text something like
```
blah blah.\Bnote{a}{This is the footnote text.} Blah blah blah... | 2012/08/30 | [
"https://tex.stackexchange.com/questions/69395",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/17054/"
] | I suspect that it is possible to create a hack that puts "normal" footnotes below the "apparatus" notes of `ednotes`. As I don't know how to do that, here's a second-best solution that
* removes the line numbers from and changes the mark format of `\Bnote`;
* defines a new macro `\Bfootnote` that tinkers with the `foo... | Following up on Uwe's suggestion, here is another approach that produces the same output as lockstep's (though without the automatic counters):
```
\documentclass{article}
\usepackage{ednotes}
\linenumbers
\newfootnote{Z}
\newcommand\footnoteZ[2]{\Footnotemark{#1}\FootnotetextZ{}{#2}}
\begin{document}
\null\vfill... |
69,395 | In the context of the scholarly apparatus package [`ednotes`](http://www.ctan.org/pkg/ednotes) I would like to create a customized `\Bnote` which behaves like a normal LaTeX footnote; i.e., I would like to enter into the body of the text something like
```
blah blah.\Bnote{a}{This is the footnote text.} Blah blah blah... | 2012/08/30 | [
"https://tex.stackexchange.com/questions/69395",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/17054/"
] | In the meantime I (`ednotes`'s author) have told by mail: `ednotes` uses `manyfoot` as "footnote engine". `ednotes`'s setup of footnote layers uses `manyfoot`'s setup to create layers of footnotes without footnote marks. To get the footnote marks "back", I think one should not try from within `ednotes`, better use `man... | Following up on Uwe's suggestion, here is another approach that produces the same output as lockstep's (though without the automatic counters):
```
\documentclass{article}
\usepackage{ednotes}
\linenumbers
\newfootnote{Z}
\newcommand\footnoteZ[2]{\Footnotemark{#1}\FootnotetextZ{}{#2}}
\begin{document}
\null\vfill... |
22,487,520 | Tested with TRAC v 1.0
I stumbled with users can see projects, they don't have access to. I did not wanted them to see only "no permission" on these projects, I simply wanted to hide it completely, when a user don't have the permission to see the project.
Here's a q'n'd "solution", by just moving two lines of code to... | 2014/03/18 | [
"https://Stackoverflow.com/questions/22487520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1478230/"
] | Well, after a while messing around with this "solution" i ran into a few problems when setting different filters. After looking again into the script, I saw that there just 2 lines needed to be changed.
This is my new and better solution:
Just replace the code above with this one.
```
for project_name in sorted(p... | Meanwhile this question is completely outdated and obsolete since the code has completely changed over the years. Please close your question or accept this as answer. |
46,666,293 | I want to list the VPC id's which have a particular tag (Name=MyVPC).
I am aware that I can use `--filter` and run:
```
aws ec2 describe-vpcs --filters Name=tag:Name,Values=MyVPC --query 'Vpcs[].VpcId'
```
This works completely fine.
Is there a way I can achieve this without using `--filter` and only use JMESPat... | 2017/10/10 | [
"https://Stackoverflow.com/questions/46666293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6775514/"
] | ```
aws ec2 describe-vpcs --query 'Vpcs[?Tags[?Key==`Name`]|[?Value==`MyVPC`]].VpcId' --output text
``` | Try this command:
```
aws ec2 describe-vpcs --query 'Vpcs[?contains(Tags[?Key==`Name`].Value[], `MyVPC`) == `true`].[VpcId]' --output text
``` |
333,165 | I'm trying to use find & rsync to back up specific files from a remote machine, and getting nowhere.
Here's the setup: I want to use rsync to back up all files containing `*state*` or `*srm` on the remote machine into a local directory. I specifically want to run this from my local machine, rather than running it with... | 2016/12/28 | [
"https://unix.stackexchange.com/questions/333165",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/207451/"
] | There are a couple of ways of skinning this cat
You can use another `ssh` invocation to generate the list of files, and pipe that into your `rsync`. This version requires the GNU extension `find -print0` to handle filenames that might contain whitespace, newlines, or other non-printing characters.
```
ssh -nq pi find... | The `find` has to run on the remote machine, which looks like what you are trying to do except your syntax isn't right. Backticks can only run commands on the local machine. You must `ssh` into the remote machine to run `find`.
```
ssh pi@retropie find ... >./filelist
rsync -v -files-from ./filelist pi@retropie: retro... |
27,277,713 | I have this query:
```
Select
DescFornecedor, DescUsuario, Classificacao,
Sum(Tempo) as Tempo,
Case Classificacao
When 'Agendamento' Then 2
When 'Aguardando cadastro' Then 3
When 'Descarte' Then 8
When 'Desistência' Then 7
When 'Em Pausa' Then 4
... | 2014/12/03 | [
"https://Stackoverflow.com/questions/27277713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4210181/"
] | add height to `<td rowspan="2" height="100px">`
<http://jsfiddle.net/p55czapy/24/> | ```
<table>
<tr>
<td><input type="button" class="button" value="1"></td>
<td><input type="button" class="button" value="2"></td>
<td><input type="button" class="button" value="3"></td>
<td rowspan="2" style="height: 100%;"><input type="button" class="button" value="-" style="height:100%;"></td>
<td rowspan="2" style="h... |
19,121,105 | I have long running code, that gets battered with requests, it causes higher resource usage and unneeded concurrency problems. My solution is to have like a waiting area, where each thread waits for some predefined time. If there is no new request while the thread is waiting, it goes ahead with the operation. Any new r... | 2013/10/01 | [
"https://Stackoverflow.com/questions/19121105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/577334/"
] | >
> I have long running code, that gets battered with requests, it causes higher resource usage and unneeded concurrency problems.
>
>
>
Sounds to me that you should be using a throttled `ExecutorService`. You should have a fixed number of threads and *not* let new threads be created whenever a new request comes ... | The tidiest way of keeping control is to use a queue. The modern `BlockingQueue` classes do an excellent job. You can then throttle by varying the length of the queue.
Instead of actually doing the work yourself you post a `Job` into the queue and have one or more threads sitting at the other end of the queue doing al... |
37,666,573 | I have the HTML below:
```
<div id="div_2_1_3" class="Button CoachView CoachView_show"
data-type="com.ibm.bpm.coach.Snapshot_5b0cf92e_d5be_41c3_b0d3_f101b717826c.Button"
data-binding="" data-bindingtype="" data-config="config3"
data-viewid="Button3" data-eventid="boundaryEvent_4">
<button type="butt... | 2016/06/06 | [
"https://Stackoverflow.com/questions/37666573",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5150025/"
] | Try something like this:
```
Sub html
Dim div, botoes, bt
'edit - added missing .document
Set div = ie.document.getElementById("div_2_1_3")
Set botoes = div.getElementsByTagName("BUTTON")
For Each bt In botoes
Debug.Print bt.ClassName
If bt.ClassName = "BPMButton BPMButtonBorder" Th... | Tim, I believe that was missing **document** after **ie.**.
It works with this code:
```
Set botoes = ie.Document.getElementsByTagName("button")
For Each bt In botoes
Debug.Print bt.innertext
If bt.innertext = "Run Now" Then
bt.Click
Exit For
End If
Next bt
``` |
23,860,945 | I have an `AJAX` script updating a database via `PHP`.
I am then trying to return two variables back to the `AJAX` success function.
Currently, when alerting the data returned they are showing `UNDEFINED`.
When I return the `JSON` without stating the part of the array I require, the array displays in full. But only... | 2014/05/25 | [
"https://Stackoverflow.com/questions/23860945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1459692/"
] | Just change `dataType: 'html'` to `dataType: 'json'` :) | Make sure that `$query` is true. I would also do `die()` so nothing else is in output:
```
if ($query) {
die(json_encode(array("toUpdate" => $toUpdate, "quant" => $quant)));
}
```
You can always check what you get from **PHP**:
```
success: function(data) {
alert(data);
$('#'+data.toUpdate).htm... |
23,860,945 | I have an `AJAX` script updating a database via `PHP`.
I am then trying to return two variables back to the `AJAX` success function.
Currently, when alerting the data returned they are showing `UNDEFINED`.
When I return the `JSON` without stating the part of the array I require, the array displays in full. But only... | 2014/05/25 | [
"https://Stackoverflow.com/questions/23860945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1459692/"
] | Just change `dataType: 'html'` to `dataType: 'json'` :) | FYI.
I found this problem when using WordPress (4.3.1) and tried to load json data to D3.json function inside WordPress. json\_encode(some\_array) did not work but returned undefined. It returned a single integer value but not any array. UTF-8 check or anything else did not help.
Then incidently I closed the php ajax ... |
39,836,839 | I have an array of objects with three properties each (year, total, per\_capita).
Example:
```
0: Object
per_capita: "125.8"
total: "1007.2"
year: "2009"
```
Those properties are strings and I want to create a loop that goes through the array and converts them to int.
I tried the following loop:
```
for (i=0;... | 2016/10/03 | [
"https://Stackoverflow.com/questions/39836839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4876564/"
] | [parseInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) does not mutate objects but parses a string and returns a integer. You have to re-assign the parsed values back to the object properties.
```
for (i=0; i<data.length; i++){
data[i].year = parseInt(data[i].year, 1... | All you did was the conversion, but you missed the assignment:
```
for (i=0; i<data.length; i++){
data[i].year = parseInt(data[i].year, 10)
data[i].total = parseInt(data[i].total, 10)
data[i].per_capita = parseInt(data[i].per_capita, 10)
}
```
The `parseInt` function returns the int value, it doesn't ch... |
39,836,839 | I have an array of objects with three properties each (year, total, per\_capita).
Example:
```
0: Object
per_capita: "125.8"
total: "1007.2"
year: "2009"
```
Those properties are strings and I want to create a loop that goes through the array and converts them to int.
I tried the following loop:
```
for (i=0;... | 2016/10/03 | [
"https://Stackoverflow.com/questions/39836839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4876564/"
] | [parseInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) does not mutate objects but parses a string and returns a integer. You have to re-assign the parsed values back to the object properties.
```
for (i=0; i<data.length; i++){
data[i].year = parseInt(data[i].year, 1... | You could iterate the array and the object amd assign the integer value of the properties, you want.
```
data.forEach(function (a) {
['year', 'total', 'per_capita'].forEach(function (k) {
a[k] = Math.floor(+a[k]);
});
});
``` |
39,836,839 | I have an array of objects with three properties each (year, total, per\_capita).
Example:
```
0: Object
per_capita: "125.8"
total: "1007.2"
year: "2009"
```
Those properties are strings and I want to create a loop that goes through the array and converts them to int.
I tried the following loop:
```
for (i=0;... | 2016/10/03 | [
"https://Stackoverflow.com/questions/39836839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4876564/"
] | This should help!
```js
var a = {
per_capita: "125.8",
total: "1007.2",
year: "2009",
}
Object.keys(a).forEach(function(el){
a[el] = parseInt(a[el])
})
console.log(a)
console.log(typeof a.total)
``` | All you did was the conversion, but you missed the assignment:
```
for (i=0; i<data.length; i++){
data[i].year = parseInt(data[i].year, 10)
data[i].total = parseInt(data[i].total, 10)
data[i].per_capita = parseInt(data[i].per_capita, 10)
}
```
The `parseInt` function returns the int value, it doesn't ch... |
39,836,839 | I have an array of objects with three properties each (year, total, per\_capita).
Example:
```
0: Object
per_capita: "125.8"
total: "1007.2"
year: "2009"
```
Those properties are strings and I want to create a loop that goes through the array and converts them to int.
I tried the following loop:
```
for (i=0;... | 2016/10/03 | [
"https://Stackoverflow.com/questions/39836839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4876564/"
] | This should help!
```js
var a = {
per_capita: "125.8",
total: "1007.2",
year: "2009",
}
Object.keys(a).forEach(function(el){
a[el] = parseInt(a[el])
})
console.log(a)
console.log(typeof a.total)
``` | You could iterate the array and the object amd assign the integer value of the properties, you want.
```
data.forEach(function (a) {
['year', 'total', 'per_capita'].forEach(function (k) {
a[k] = Math.floor(+a[k]);
});
});
``` |
56,094,484 | I am using MathJax and I have the following scenario:
>
> I want to run some code when the page contains some Math that MathJax will process and render properly
>
>
>
Consider this example:
```html
<p>
This is a page containing an equation: $b^2 - 4ac$.
</p>
```
Here the function, or whatever it is I can use, ... | 2019/05/11 | [
"https://Stackoverflow.com/questions/56094484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/519836/"
] | A possible workaround is to create your own class, then test if this class is present in the DOM, then embed mathjax dynamically if needed
Snippet with math :
```js
var test = document.querySelectorAll('.math2Process');
if(test.length>0){
var mathJax_config = document.createElement('script');
mathJax_config.... | The following code will check if the current page requires MathJax, and only load in the script if it is needed:
```html
<script>
document.addEventListener('DOMContentLoaded', () => {
const skipHtmlTags = ['script', 'noscript', 'style', 'textarea', 'pre', 'code', 'annotation', 'annotation-xml'].map((v) => `:not(${v}... |
17,292,630 | I have a mysql query.
The idea is to select the records between a date range. The dates are stored as unix timestamps. With the query below, I end up with far more records than I should (out of the date range).
I have picked my brain and I cant see where the query is going wrong. The other fields look correct, its ju... | 2013/06/25 | [
"https://Stackoverflow.com/questions/17292630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1882752/"
] | AFAIK, the svc is useless if you are not working with IIS. Outside of IIS, the so called self hosted approach, needs you to write a something like this, where HelloWorldWcfServiceMessage is your type implementing the service contract. Additionaly, don't forget to configure an endpoint for the server and to make sure yo... | I think there is some confusion with the names.
In the SVC you wrote:
CodeBehind="Service1.svc.cs"
But you say your file name is Service.svc.cs (without the 1). |
17,292,630 | I have a mysql query.
The idea is to select the records between a date range. The dates are stored as unix timestamps. With the query below, I end up with far more records than I should (out of the date range).
I have picked my brain and I cant see where the query is going wrong. The other fields look correct, its ju... | 2013/06/25 | [
"https://Stackoverflow.com/questions/17292630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1882752/"
] | AFAIK, the svc is useless if you are not working with IIS. Outside of IIS, the so called self hosted approach, needs you to write a something like this, where HelloWorldWcfServiceMessage is your type implementing the service contract. Additionaly, don't forget to configure an endpoint for the server and to make sure yo... | **Solved this**
This is all about Publishing a WCF service on IIS 8
All the credits goes to György Balássy
WCF services don’t run on IIS 8 with the default conჁguration, because the webserver doesn’t know, how to handle incoming requests targeting .svc Ⴡles. You can teach it in two steps:
Please check the same answ... |
47,117,924 | So, im new to coding and trying to get into c++. I was trying to get through the second problem on Project Euler and thought i had a good grasp on how to approach it. Hours later, i gave up and decided to look it up.
```
int x = 0;
int y = 1;
int z = x + y;
int sumeven = 0;
while (z < 4000000)
{
x = y;
y = z;... | 2017/11/05 | [
"https://Stackoverflow.com/questions/47117924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8887805/"
] | You can also use [Regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) with `i` modifier to perform case-insensitive matching and the method [RegExp.prototype.test()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test)
* It is... | Array.prototype.filter() also works as well:
```
const includesQuery = (value) => {
return value['SOME_KEY'].toLowerCase().includes(query.toLowerCase());
}
const filtered = this.myArray.filter(includesQuery);
console.log(filtered);
``` |
47,117,924 | So, im new to coding and trying to get into c++. I was trying to get through the second problem on Project Euler and thought i had a good grasp on how to approach it. Hours later, i gave up and decided to look it up.
```
int x = 0;
int y = 1;
int z = x + y;
int sumeven = 0;
while (z < 4000000)
{
x = y;
y = z;... | 2017/11/05 | [
"https://Stackoverflow.com/questions/47117924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8887805/"
] | If we assume that all properties are strings, then you might do in the following way
```
const people = [
// ...
]
const searchString = 'Bob'
const filterBy = (term) => {
const termLowerCase = term.toLowerCase()
return (person) =>
Object.keys(person)
.some(prop => person[prop].toLowerCase().indexOf(t... | You should give fusejs a shot. <http://fusejs.io/>
It has some interesting settings such as threshold, which allow some typo error (0.0 = perfect, 1.0 = match anything) and `keys` to specify any keys you want to search in.
```
const people = [
{ firstName: 'Bob', lastName: 'Smith', status: 'single' },
{ firstName:... |
47,117,924 | So, im new to coding and trying to get into c++. I was trying to get through the second problem on Project Euler and thought i had a good grasp on how to approach it. Hours later, i gave up and decided to look it up.
```
int x = 0;
int y = 1;
int z = x + y;
int sumeven = 0;
while (z < 4000000)
{
x = y;
y = z;... | 2017/11/05 | [
"https://Stackoverflow.com/questions/47117924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8887805/"
] | You should give fusejs a shot. <http://fusejs.io/>
It has some interesting settings such as threshold, which allow some typo error (0.0 = perfect, 1.0 = match anything) and `keys` to specify any keys you want to search in.
```
const people = [
{ firstName: 'Bob', lastName: 'Smith', status: 'single' },
{ firstName:... | Array.prototype.filter() also works as well:
```
const includesQuery = (value) => {
return value['SOME_KEY'].toLowerCase().includes(query.toLowerCase());
}
const filtered = this.myArray.filter(includesQuery);
console.log(filtered);
``` |
47,117,924 | So, im new to coding and trying to get into c++. I was trying to get through the second problem on Project Euler and thought i had a good grasp on how to approach it. Hours later, i gave up and decided to look it up.
```
int x = 0;
int y = 1;
int z = x + y;
int sumeven = 0;
while (z < 4000000)
{
x = y;
y = z;... | 2017/11/05 | [
"https://Stackoverflow.com/questions/47117924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8887805/"
] | If we assume that all properties are strings, then you might do in the following way
```
const people = [
// ...
]
const searchString = 'Bob'
const filterBy = (term) => {
const termLowerCase = term.toLowerCase()
return (person) =>
Object.keys(person)
.some(prop => person[prop].toLowerCase().indexOf(t... | You can use [`Array.prototype.find()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).
```js
const people = [
{ firstName: 'Bob', lastName: 'Smith', status: 'single' },
{ firstName: 'bobby', lastName: 'Suxatcapitalizing', status: 'single' },
{ firstName: 'Jim', lastN... |
47,117,924 | So, im new to coding and trying to get into c++. I was trying to get through the second problem on Project Euler and thought i had a good grasp on how to approach it. Hours later, i gave up and decided to look it up.
```
int x = 0;
int y = 1;
int z = x + y;
int sumeven = 0;
while (z < 4000000)
{
x = y;
y = z;... | 2017/11/05 | [
"https://Stackoverflow.com/questions/47117924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8887805/"
] | you need to filter the array, then filter each key in the objects to match a regular expression. This example breaks down the problem into single responsibility funcitons and connects them with functional concepts eg.
Performance tests are included, in chrome this is consistently faster than Dmitry's example. I have n... | If the entire matched object is expected result you can use `for..of` loop, `Object.values()`, `Array.prototype.find()`
```
consy searchString = "Bob";
const re = new RegExp(searchString, "i");
let res = [];
for (const props of Object.values(people))
Object.values(props).find(prop => re.test(prop)) && res.push(props... |
47,117,924 | So, im new to coding and trying to get into c++. I was trying to get through the second problem on Project Euler and thought i had a good grasp on how to approach it. Hours later, i gave up and decided to look it up.
```
int x = 0;
int y = 1;
int z = x + y;
int sumeven = 0;
while (z < 4000000)
{
x = y;
y = z;... | 2017/11/05 | [
"https://Stackoverflow.com/questions/47117924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8887805/"
] | If we assume that all properties are strings, then you might do in the following way
```
const people = [
// ...
]
const searchString = 'Bob'
const filterBy = (term) => {
const termLowerCase = term.toLowerCase()
return (person) =>
Object.keys(person)
.some(prop => person[prop].toLowerCase().indexOf(t... | If the entire matched object is expected result you can use `for..of` loop, `Object.values()`, `Array.prototype.find()`
```
consy searchString = "Bob";
const re = new RegExp(searchString, "i");
let res = [];
for (const props of Object.values(people))
Object.values(props).find(prop => re.test(prop)) && res.push(props... |
47,117,924 | So, im new to coding and trying to get into c++. I was trying to get through the second problem on Project Euler and thought i had a good grasp on how to approach it. Hours later, i gave up and decided to look it up.
```
int x = 0;
int y = 1;
int z = x + y;
int sumeven = 0;
while (z < 4000000)
{
x = y;
y = z;... | 2017/11/05 | [
"https://Stackoverflow.com/questions/47117924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8887805/"
] | You should give fusejs a shot. <http://fusejs.io/>
It has some interesting settings such as threshold, which allow some typo error (0.0 = perfect, 1.0 = match anything) and `keys` to specify any keys you want to search in.
```
const people = [
{ firstName: 'Bob', lastName: 'Smith', status: 'single' },
{ firstName:... | You can use [`Array.prototype.find()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).
```js
const people = [
{ firstName: 'Bob', lastName: 'Smith', status: 'single' },
{ firstName: 'bobby', lastName: 'Suxatcapitalizing', status: 'single' },
{ firstName: 'Jim', lastN... |
47,117,924 | So, im new to coding and trying to get into c++. I was trying to get through the second problem on Project Euler and thought i had a good grasp on how to approach it. Hours later, i gave up and decided to look it up.
```
int x = 0;
int y = 1;
int z = x + y;
int sumeven = 0;
while (z < 4000000)
{
x = y;
y = z;... | 2017/11/05 | [
"https://Stackoverflow.com/questions/47117924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8887805/"
] | you need to filter the array, then filter each key in the objects to match a regular expression. This example breaks down the problem into single responsibility funcitons and connects them with functional concepts eg.
Performance tests are included, in chrome this is consistently faster than Dmitry's example. I have n... | You can use [`Array.prototype.find()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).
```js
const people = [
{ firstName: 'Bob', lastName: 'Smith', status: 'single' },
{ firstName: 'bobby', lastName: 'Suxatcapitalizing', status: 'single' },
{ firstName: 'Jim', lastN... |
47,117,924 | So, im new to coding and trying to get into c++. I was trying to get through the second problem on Project Euler and thought i had a good grasp on how to approach it. Hours later, i gave up and decided to look it up.
```
int x = 0;
int y = 1;
int z = x + y;
int sumeven = 0;
while (z < 4000000)
{
x = y;
y = z;... | 2017/11/05 | [
"https://Stackoverflow.com/questions/47117924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8887805/"
] | If we assume that all properties are strings, then you might do in the following way
```
const people = [
// ...
]
const searchString = 'Bob'
const filterBy = (term) => {
const termLowerCase = term.toLowerCase()
return (person) =>
Object.keys(person)
.some(prop => person[prop].toLowerCase().indexOf(t... | You can also use [Regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) with `i` modifier to perform case-insensitive matching and the method [RegExp.prototype.test()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test)
* It is... |
47,117,924 | So, im new to coding and trying to get into c++. I was trying to get through the second problem on Project Euler and thought i had a good grasp on how to approach it. Hours later, i gave up and decided to look it up.
```
int x = 0;
int y = 1;
int z = x + y;
int sumeven = 0;
while (z < 4000000)
{
x = y;
y = z;... | 2017/11/05 | [
"https://Stackoverflow.com/questions/47117924",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8887805/"
] | You can use [`Array.prototype.find()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).
```js
const people = [
{ firstName: 'Bob', lastName: 'Smith', status: 'single' },
{ firstName: 'bobby', lastName: 'Suxatcapitalizing', status: 'single' },
{ firstName: 'Jim', lastN... | Array.prototype.filter() also works as well:
```
const includesQuery = (value) => {
return value['SOME_KEY'].toLowerCase().includes(query.toLowerCase());
}
const filtered = this.myArray.filter(includesQuery);
console.log(filtered);
``` |
173,176 | What is a Journaling file system?
Even wikipedia doesn't give much information. Apart from NTFS which other file systems(on Windows / Linux) support journaling and how does it give a performance boost? | 2010/08/22 | [
"https://serverfault.com/questions/173176",
"https://serverfault.com",
"https://serverfault.com/users/23923/"
] | A journaling filesystem records changes to the filesystem before it actually performs them. In this way it is able to recover after a failure (e.g. power fail) with minimal loss of data.
The [Features](http://en.wikipedia.org/wiki/Comparison_of_file_systems#Features) section of Wikipedia's comparison of filesystems gi... | The wikipedia article on [Journaling file system](http://en.wikipedia.org/wiki/Journaling_file_system) contains a lot more details on what it is, how it works, and why. |
173,176 | What is a Journaling file system?
Even wikipedia doesn't give much information. Apart from NTFS which other file systems(on Windows / Linux) support journaling and how does it give a performance boost? | 2010/08/22 | [
"https://serverfault.com/questions/173176",
"https://serverfault.com",
"https://serverfault.com/users/23923/"
] | A journaling filesystem records changes to the filesystem before it actually performs them. In this way it is able to recover after a failure (e.g. power fail) with minimal loss of data.
The [Features](http://en.wikipedia.org/wiki/Comparison_of_file_systems#Features) section of Wikipedia's comparison of filesystems gi... | In essence, what a journaling file system does is add an extra level of abstraction between the hard drive and the operating system. Rather than perform operations directly on the disk, it keeps track of what it's trying to do first, then whether or not it succeeds.
For example, if you wanted to move a file from one d... |
173,176 | What is a Journaling file system?
Even wikipedia doesn't give much information. Apart from NTFS which other file systems(on Windows / Linux) support journaling and how does it give a performance boost? | 2010/08/22 | [
"https://serverfault.com/questions/173176",
"https://serverfault.com",
"https://serverfault.com/users/23923/"
] | A journaling filesystem records changes to the filesystem before it actually performs them. In this way it is able to recover after a failure (e.g. power fail) with minimal loss of data.
The [Features](http://en.wikipedia.org/wiki/Comparison_of_file_systems#Features) section of Wikipedia's comparison of filesystems gi... | A journaling filesystem is a term being misused widely for filesystems that are not, after all, journaling.
What "journaling" means in the context of filesystems is that the filesystem is capable of recovering from crashes and power losses to a consistent state. It does not mean a performance boost, it doesn't mean th... |
173,176 | What is a Journaling file system?
Even wikipedia doesn't give much information. Apart from NTFS which other file systems(on Windows / Linux) support journaling and how does it give a performance boost? | 2010/08/22 | [
"https://serverfault.com/questions/173176",
"https://serverfault.com",
"https://serverfault.com/users/23923/"
] | In essence, what a journaling file system does is add an extra level of abstraction between the hard drive and the operating system. Rather than perform operations directly on the disk, it keeps track of what it's trying to do first, then whether or not it succeeds.
For example, if you wanted to move a file from one d... | The wikipedia article on [Journaling file system](http://en.wikipedia.org/wiki/Journaling_file_system) contains a lot more details on what it is, how it works, and why. |
173,176 | What is a Journaling file system?
Even wikipedia doesn't give much information. Apart from NTFS which other file systems(on Windows / Linux) support journaling and how does it give a performance boost? | 2010/08/22 | [
"https://serverfault.com/questions/173176",
"https://serverfault.com",
"https://serverfault.com/users/23923/"
] | In essence, what a journaling file system does is add an extra level of abstraction between the hard drive and the operating system. Rather than perform operations directly on the disk, it keeps track of what it's trying to do first, then whether or not it succeeds.
For example, if you wanted to move a file from one d... | A journaling filesystem is a term being misused widely for filesystems that are not, after all, journaling.
What "journaling" means in the context of filesystems is that the filesystem is capable of recovering from crashes and power losses to a consistent state. It does not mean a performance boost, it doesn't mean th... |
12,020,855 | Is it dangerous to cast "(NSInteger)self"?
I need to distinguish two views, not using tag value.
If It is dangerous, any ideas? | 2012/08/18 | [
"https://Stackoverflow.com/questions/12020855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1410800/"
] | You mean you have two `UIView` pointers and you want to know if they are pointing to the same object? Just use `==`. No need to cast them. If you mean something else, you'll need to provide more details on what you mean by "distinguishing two views". | Ignoring what convulsions ARC may go through, it's not dangerous to cast `self` (or any other pointer) to `integer`. It is exceedingly dangerous, however, to cast the other direction.
And Objective-C has enough odd corners and dark hallways that it's difficult to say with great confidence that `self` cast to an intege... |
12,020,855 | Is it dangerous to cast "(NSInteger)self"?
I need to distinguish two views, not using tag value.
If It is dangerous, any ideas? | 2012/08/18 | [
"https://Stackoverflow.com/questions/12020855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1410800/"
] | Ignoring what convulsions ARC may go through, it's not dangerous to cast `self` (or any other pointer) to `integer`. It is exceedingly dangerous, however, to cast the other direction.
And Objective-C has enough odd corners and dark hallways that it's difficult to say with great confidence that `self` cast to an intege... | The `NSObject` protocol declares an [`isEqual:`](http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Protocols/NSObject_Protocol/Reference/NSObject.html#//apple_ref/doc/uid/20000052-BBCCECDG) method for comparing objects. A class can override this to define its instances as equal if their co... |
12,020,855 | Is it dangerous to cast "(NSInteger)self"?
I need to distinguish two views, not using tag value.
If It is dangerous, any ideas? | 2012/08/18 | [
"https://Stackoverflow.com/questions/12020855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1410800/"
] | You mean you have two `UIView` pointers and you want to know if they are pointing to the same object? Just use `==`. No need to cast them. If you mean something else, you'll need to provide more details on what you mean by "distinguishing two views". | The `NSObject` protocol declares an [`isEqual:`](http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Protocols/NSObject_Protocol/Reference/NSObject.html#//apple_ref/doc/uid/20000052-BBCCECDG) method for comparing objects. A class can override this to define its instances as equal if their co... |
38,830,828 | I have pushed to heroku but the application will not run. I see that it is due to the dotenv gem. Is there a way around this? I need the dot-env gem in order to encrypt the basic auth user name and password. I'd prefer not to use devise or anything of that complexity as this is a simple application.
Below is my herok... | 2016/08/08 | [
"https://Stackoverflow.com/questions/38830828",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2026178/"
] | You configured the `dotenv` gem to be enabled only for the `development` and `test` environments:
```
gem 'dotenv-rails', :groups => [:development, :test]
```
However, the application is started in `production` environment in Heroku. Therefore, the Rails application will crash because it tries to load the gem but it... | `dotenv` gem is used for load environment variables from .env into ENV in `development`.
and heroku used `production` environment. So, you need to just put this on `Gemfile`
```
gem 'dotenv-rails', :groups => [:development, :test]
```
Hope, this will helps you. |
38,830,828 | I have pushed to heroku but the application will not run. I see that it is due to the dotenv gem. Is there a way around this? I need the dot-env gem in order to encrypt the basic auth user name and password. I'd prefer not to use devise or anything of that complexity as this is a simple application.
Below is my herok... | 2016/08/08 | [
"https://Stackoverflow.com/questions/38830828",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2026178/"
] | You configured the `dotenv` gem to be enabled only for the `development` and `test` environments:
```
gem 'dotenv-rails', :groups => [:development, :test]
```
However, the application is started in `production` environment in Heroku. Therefore, the Rails application will crash because it tries to load the gem but it... | dotenv is for managing your environment variables in your development environment. YOu need to manually create these variables on heroku. |
3,683,445 | My statement:
```
string sqlCommandText = "SELECT * FROM ForumThread WHERE";
```
How can I read `*` from it?
I'm trying like this but its doesnt work:
```
if (reader["*"] != DBNull.Value)
{
result.TextContent = Convert.ToString(reader["*"]);
}
``` | 2010/09/10 | [
"https://Stackoverflow.com/questions/3683445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291120/"
] | `*` is not a column, it's a instruction to `SELECT` to just grab every column it can find.
The columns will appear individually though, so you need to iterate through the columns one by one and grab their contents.
To get the column contents, you can do this:
```
StringBuilder sb = new StringBuilder();
for (int inde... | Additionally, you can use this method to retrieve the associated field name:
```
reader.GetName( /* index of the column */);
``` |
3,683,445 | My statement:
```
string sqlCommandText = "SELECT * FROM ForumThread WHERE";
```
How can I read `*` from it?
I'm trying like this but its doesnt work:
```
if (reader["*"] != DBNull.Value)
{
result.TextContent = Convert.ToString(reader["*"]);
}
``` | 2010/09/10 | [
"https://Stackoverflow.com/questions/3683445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291120/"
] | `*` is not a column, it's a instruction to `SELECT` to just grab every column it can find.
The columns will appear individually though, so you need to iterate through the columns one by one and grab their contents.
To get the column contents, you can do this:
```
StringBuilder sb = new StringBuilder();
for (int inde... | Suppose your **ForumThread** table contains the **ThreadResponse** column, and you actually want to read the **ThreadResponse** column, you can use the next code:
```
//calculates the column ordinal based on column name
int ThreadResponseColumnIdx = reader.GetOrdinal("ThreadResponse");
//If there is a line in the res... |
3,683,445 | My statement:
```
string sqlCommandText = "SELECT * FROM ForumThread WHERE";
```
How can I read `*` from it?
I'm trying like this but its doesnt work:
```
if (reader["*"] != DBNull.Value)
{
result.TextContent = Convert.ToString(reader["*"]);
}
``` | 2010/09/10 | [
"https://Stackoverflow.com/questions/3683445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291120/"
] | Additionally, you can use this method to retrieve the associated field name:
```
reader.GetName( /* index of the column */);
``` | Suppose your **ForumThread** table contains the **ThreadResponse** column, and you actually want to read the **ThreadResponse** column, you can use the next code:
```
//calculates the column ordinal based on column name
int ThreadResponseColumnIdx = reader.GetOrdinal("ThreadResponse");
//If there is a line in the res... |
65,255,620 | So i prepared a keras model including USE4 using the below link :
<https://tfhub.dev/google/universal-sentence-encoder-large/4>
Using tensorflow 2.3, i added it to my model and saved the model
```
tf.saved_model.save(
model,
export_dir= '/directory/model/1',
)
```
Once served in docker, I'm able to get the metadata... | 2020/12/11 | [
"https://Stackoverflow.com/questions/65255620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11278414/"
] | I'd change the functions to accept a single argument as an object, which gets destructured, so that all functions can be called with the same argument:
```
mainFunction() {
let name = something;
let address = something;
let date = something;
....
let height = something;
const paramsObj = { name, address, d... | After a lot of testing and benchmarking, the fastest method we've come up with is this (using @certainPerformance 's solution as a starting point):
1. Store functions in an array of objects. This allows a user to insert new custom functions anywhere in the list (insert before 'taskA', etc.) and is *much* faster than a... |
65,255,620 | So i prepared a keras model including USE4 using the below link :
<https://tfhub.dev/google/universal-sentence-encoder-large/4>
Using tensorflow 2.3, i added it to my model and saved the model
```
tf.saved_model.save(
model,
export_dir= '/directory/model/1',
)
```
Once served in docker, I'm able to get the metadata... | 2020/12/11 | [
"https://Stackoverflow.com/questions/65255620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11278414/"
] | ```js
const if_then = (if_fn, then_fn) => (params_object) =>
if_fn(params_object) ? then_fn(params_object) : null;
const apply_params = (fn, arg_keys, write_to_key = false) => (params_object) => {
const result = fn(...arg_keys.map((v) => params_object[v]));
if(write_to_key)
params_object[write_to_key] = resu... | After a lot of testing and benchmarking, the fastest method we've come up with is this (using @certainPerformance 's solution as a starting point):
1. Store functions in an array of objects. This allows a user to insert new custom functions anywhere in the list (insert before 'taskA', etc.) and is *much* faster than a... |
15,861,808 | Hi im developping an ssis package that imports excel files (.xlsx) from an ftp server to a local folder then they are imported to a sql server table . I'm using a `foreach` mapping to the name of files. The import from the ftp server to local work fine, but the import from the local folder to the sql table failed.
It ... | 2013/04/07 | [
"https://Stackoverflow.com/questions/15861808",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2254347/"
] | I don't have any experience with **vmware**, but assuming you can use any VM, here's a solution for [VirtualBox](https://www.virtualbox.org/):
* Setup a network interface on your VM, that's visible to the host
system only ([reference](http://www.virtualbox.org/manual/ch06.html#network_hostonly)):
>
> Host-only netwo... | yes it is possible. Just give correct IPs. |
13,961,840 | >
> **Possible Duplicate:**
>
> [Embedding extra styles with noscript](https://stackoverflow.com/questions/218162/embedding-extra-styles-with-noscript)
>
> [Define css if javascript is not enabled](https://stackoverflow.com/questions/4665748/define-css-if-javascript-is-not-enabled)
>
>
>
I am trying to defi... | 2012/12/19 | [
"https://Stackoverflow.com/questions/13961840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1279133/"
] | Try something like this:
```
<html class="nojs">
<head>
<script type="text/javascript">
document.getElementByTagName("html")[0].className="";
</script>
<style>
html#nojs {
/* do something */
}
</style>
```
This removes a class while loading the page. If javascript is not activated the class won't be removed. | You can get around this by having those classes in your default stylesheet and have JavaScript get rid of them when the page loads. This will only work if JavaScript is enabled otherwise it would load the desired styles. |
13,961,840 | >
> **Possible Duplicate:**
>
> [Embedding extra styles with noscript](https://stackoverflow.com/questions/218162/embedding-extra-styles-with-noscript)
>
> [Define css if javascript is not enabled](https://stackoverflow.com/questions/4665748/define-css-if-javascript-is-not-enabled)
>
>
>
I am trying to defi... | 2012/12/19 | [
"https://Stackoverflow.com/questions/13961840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1279133/"
] | `<noscript>` tags are "body" tags and `<style>` tags are "head" tags. Therefor you get an error.
You should make non-javascript style default and then use js to change your style. See here for more details:
<https://stackoverflow.com/a/218917/1068167> | Try something like this:
```
<html class="nojs">
<head>
<script type="text/javascript">
document.getElementByTagName("html")[0].className="";
</script>
<style>
html#nojs {
/* do something */
}
</style>
```
This removes a class while loading the page. If javascript is not activated the class won't be removed. |
13,961,840 | >
> **Possible Duplicate:**
>
> [Embedding extra styles with noscript](https://stackoverflow.com/questions/218162/embedding-extra-styles-with-noscript)
>
> [Define css if javascript is not enabled](https://stackoverflow.com/questions/4665748/define-css-if-javascript-is-not-enabled)
>
>
>
I am trying to defi... | 2012/12/19 | [
"https://Stackoverflow.com/questions/13961840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1279133/"
] | Try something like this:
```
<html class="nojs">
<head>
<script type="text/javascript">
document.getElementByTagName("html")[0].className="";
</script>
<style>
html#nojs {
/* do something */
}
</style>
```
This removes a class while loading the page. If javascript is not activated the class won't be removed. | You could for example do it the other way around and disable some css file via javascript which doesn' t happen if it's not activated. |
13,961,840 | >
> **Possible Duplicate:**
>
> [Embedding extra styles with noscript](https://stackoverflow.com/questions/218162/embedding-extra-styles-with-noscript)
>
> [Define css if javascript is not enabled](https://stackoverflow.com/questions/4665748/define-css-if-javascript-is-not-enabled)
>
>
>
I am trying to defi... | 2012/12/19 | [
"https://Stackoverflow.com/questions/13961840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1279133/"
] | `<noscript>` tags are "body" tags and `<style>` tags are "head" tags. Therefor you get an error.
You should make non-javascript style default and then use js to change your style. See here for more details:
<https://stackoverflow.com/a/218917/1068167> | You can get around this by having those classes in your default stylesheet and have JavaScript get rid of them when the page loads. This will only work if JavaScript is enabled otherwise it would load the desired styles. |
13,961,840 | >
> **Possible Duplicate:**
>
> [Embedding extra styles with noscript](https://stackoverflow.com/questions/218162/embedding-extra-styles-with-noscript)
>
> [Define css if javascript is not enabled](https://stackoverflow.com/questions/4665748/define-css-if-javascript-is-not-enabled)
>
>
>
I am trying to defi... | 2012/12/19 | [
"https://Stackoverflow.com/questions/13961840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1279133/"
] | Seems very similar to this [question](https://stackoverflow.com/questions/218162/embedding-extra-styles-with-noscript)
>
> "To clear up the validation issue: noscript is only allowed in the
> body element, style only allowed in the head. Therefore, the latter is
> not allowed within the former."
>
>
>
It might ... | You can get around this by having those classes in your default stylesheet and have JavaScript get rid of them when the page loads. This will only work if JavaScript is enabled otherwise it would load the desired styles. |
13,961,840 | >
> **Possible Duplicate:**
>
> [Embedding extra styles with noscript](https://stackoverflow.com/questions/218162/embedding-extra-styles-with-noscript)
>
> [Define css if javascript is not enabled](https://stackoverflow.com/questions/4665748/define-css-if-javascript-is-not-enabled)
>
>
>
I am trying to defi... | 2012/12/19 | [
"https://Stackoverflow.com/questions/13961840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1279133/"
] | `<noscript>` tags are "body" tags and `<style>` tags are "head" tags. Therefor you get an error.
You should make non-javascript style default and then use js to change your style. See here for more details:
<https://stackoverflow.com/a/218917/1068167> | Seems very similar to this [question](https://stackoverflow.com/questions/218162/embedding-extra-styles-with-noscript)
>
> "To clear up the validation issue: noscript is only allowed in the
> body element, style only allowed in the head. Therefore, the latter is
> not allowed within the former."
>
>
>
It might ... |
13,961,840 | >
> **Possible Duplicate:**
>
> [Embedding extra styles with noscript](https://stackoverflow.com/questions/218162/embedding-extra-styles-with-noscript)
>
> [Define css if javascript is not enabled](https://stackoverflow.com/questions/4665748/define-css-if-javascript-is-not-enabled)
>
>
>
I am trying to defi... | 2012/12/19 | [
"https://Stackoverflow.com/questions/13961840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1279133/"
] | `<noscript>` tags are "body" tags and `<style>` tags are "head" tags. Therefor you get an error.
You should make non-javascript style default and then use js to change your style. See here for more details:
<https://stackoverflow.com/a/218917/1068167> | You could for example do it the other way around and disable some css file via javascript which doesn' t happen if it's not activated. |
13,961,840 | >
> **Possible Duplicate:**
>
> [Embedding extra styles with noscript](https://stackoverflow.com/questions/218162/embedding-extra-styles-with-noscript)
>
> [Define css if javascript is not enabled](https://stackoverflow.com/questions/4665748/define-css-if-javascript-is-not-enabled)
>
>
>
I am trying to defi... | 2012/12/19 | [
"https://Stackoverflow.com/questions/13961840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1279133/"
] | Seems very similar to this [question](https://stackoverflow.com/questions/218162/embedding-extra-styles-with-noscript)
>
> "To clear up the validation issue: noscript is only allowed in the
> body element, style only allowed in the head. Therefore, the latter is
> not allowed within the former."
>
>
>
It might ... | You could for example do it the other way around and disable some css file via javascript which doesn' t happen if it's not activated. |
869,154 | I really wonder if an IP Address with all its bits off can be used or not. Please do answer if you know where its used or it can not be used. | 2015/01/25 | [
"https://superuser.com/questions/869154",
"https://superuser.com",
"https://superuser.com/users/411506/"
] | **Reference** [IP Addresses With Special Meanings](http://www.tcpipguide.com/free/t_IPAddressesWithSpecialMeanings-2.htm) :
>
> **0.0.0.0**
>
>
> “Me”: (Alternately, “this host”, or “the current/default host”). Used by a device to refer to itself when it doesn't know its
> own IP address. **The most common use is ... | Thanks for looking into it but i found the answer.
For your knowledge and mine as well, i would like to tell that 0.0.0.0 IP address is used when a new network is formed and the DHCP server is on in that network, so as it a new network none of the workstations is having its own IP , so to configure and get the IP compu... |
33,087,071 | Every time I try to run the create.sql file I have, it says there is a syntax error near "buy\_price". The rest of the tables work fine, though.
```
create table Item (itemID string PRIMARY KEY,
name string,
currently string,
buy_price string,
first_bid string,
started string,
ends string... | 2015/10/12 | [
"https://Stackoverflow.com/questions/33087071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2852231/"
] | The check constraint needs to be enclosed in parentheses:
```
create table item
(
itemid string primary key,
name string,
currently_ string,
buy_price string,
first_bid string,
started string,
ends string,
userid string references user,
description ... | You are getting the error because you can not refer first\_bid(table column) in check constraint(**Column check constraint cannot reference other column**).If you want to have a check for this use triggers. |
2,697,152 | I'm looking for a decent WPF or Winform time range selector, much like a home central heating system, where a time range is selectable.
<http://lhill.com.au/l%20hill%20web%20page%20pictures/time%20clock%202.jpg>
Is there any GUI libraries or examples available to fulfill this need? | 2010/04/23 | [
"https://Stackoverflow.com/questions/2697152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271200/"
] | You are mixing up variables, references and objects.
Doing `delete y;` removes the variable y. As the variable no longer exists, it will naturally no longer have a value. Thus the reference that the variable contained is gone.
Removing the variable will however not in itself remove the object that it was referencing.... | That's not how `delete` works. It will delete the object reference you pass to it - not any other references to the same object. You're looking for something like a "weak reference" here and I'm not aware of any ways of implementing those in JavaScript. |
2,697,152 | I'm looking for a decent WPF or Winform time range selector, much like a home central heating system, where a time range is selectable.
<http://lhill.com.au/l%20hill%20web%20page%20pictures/time%20clock%202.jpg>
Is there any GUI libraries or examples available to fulfill this need? | 2010/04/23 | [
"https://Stackoverflow.com/questions/2697152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271200/"
] | You are mixing up variables, references and objects.
Doing `delete y;` removes the variable y. As the variable no longer exists, it will naturally no longer have a value. Thus the reference that the variable contained is gone.
Removing the variable will however not in itself remove the object that it was referencing.... | Would this help?
`Var x=[{}];
var y=x[0];`
Edit:
Sorry, I was a bit brief in my first attempt at answering. What I'd start asking is: why does y need to "exist" outside of the array in the first place? Can't you just create an array of objects and use delete or array.splice() to remove the object when you need to?
S... |
2,697,152 | I'm looking for a decent WPF or Winform time range selector, much like a home central heating system, where a time range is selectable.
<http://lhill.com.au/l%20hill%20web%20page%20pictures/time%20clock%202.jpg>
Is there any GUI libraries or examples available to fulfill this need? | 2010/04/23 | [
"https://Stackoverflow.com/questions/2697152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/271200/"
] | You are mixing up variables, references and objects.
Doing `delete y;` removes the variable y. As the variable no longer exists, it will naturally no longer have a value. Thus the reference that the variable contained is gone.
Removing the variable will however not in itself remove the object that it was referencing.... | >
> This doesnt work:
>
> ```
> x.push(y);
> ```
>
>
>
>
Of course it does, it will work exactly as intended - pushing the value of y to the array you created.
The [`delete`](https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/delete_Operator) operator is specifically for... |
6,125,353 | I have three tabs (div- enabled on click) in my view, In tab3 I have a delete functionality. When I click "Ok" in the confirmation box, the record is deleted and redirected to my view, which is tab1 enable.
My controller:
```
public ActionResult DeleteAccount(int? id)
{
if(id.HasValue)
... | 2011/05/25 | [
"https://Stackoverflow.com/questions/6125353",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/760845/"
] | Start with this:
```
return RedirectToAction("ManageCompanies", new { showThirdTab = true });
```
And in your ManageCompanies Action, take in a bool parameter called showThirdTab. Pass that to your view and if it's true, set a class or some value to tell your javascript to switch to that tab.
Off topic a bit, but m... | I have listed below ways, there might be more!
1.All the operations in tabs should be done with ajax call.
2.With Html and model data manipulation.
**Steps:**
a). Create a property in the model, "ActiveTab" type integer
b). In the view,
```
@{
//We can also use the array
string activeTabCss1 =Model.ActiveT... |
138,562 | **Warning:** Massive spoilers ahead for those who haven't read *A Dance With Dragons*. Don't proceed if you do not wish to be spoiled.
---
In *A Dance With Dragons* Epilogue, we see the following conversation between Kevan Lannister and Varys:
>
> "Aegon?" For a moment he did not understand. Then he remembered. A
... | 2016/08/22 | [
"https://scifi.stackexchange.com/questions/138562",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/54887/"
] | There's a plethora of reasons that Varys could have said to convince people that Rhaenys wasn't able to be saved. I don't think there is canon evidence for the reasoning he may have given, but we can speculate:
* **She wasn't as important**
As you said in the question, male heirs are preferred over their female count... | Why doesn't he explain why he didn't save her?
----------------------------------------------
No-one asks. Why doesn't anyone ask? Well, the story about saving Aegon on it's own is already audacious and daring enough. As Tyrion said in your quote:
>
> It does make for a splendid story, and the singers will make much... |
49,363,411 | I have strings similar to the following:
```
4123499-TESCO45-123
every99999994_54
```
And I want to extract the largest numeric sequence in each string, respectively:
```
4123499
99999994
```
I have previously tried regex (I am using VB6)
```
Set rx = New RegExp
rx.Pattern = "[^\d]"
rx.Global = True
St... | 2018/03/19 | [
"https://Stackoverflow.com/questions/49363411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3326321/"
] | You cannot get the result by just a regex. You will have to extract all numeric chunks and get the longest one using other programming means.
Here is an example:
```
Dim strPattern As String: strPattern = "\d+"
Dim str As String: str = "4123499-TESCO45-123"
Dim regEx As New RegExp
Dim matches As MatchCollection
Dim... | That's not solvable with an RE on its own.
Instead you can simply walk along the string tracking the longest consecutive digit group:
```
For i = 1 To Len(StringText)
If IsNumeric(Mid$(StringText, i, 1)) Then
a = a & Mid$(StringText, i, 1)
Else
a = ""
End If
If Len(a) > Len(longest) Th... |
49,363,411 | I have strings similar to the following:
```
4123499-TESCO45-123
every99999994_54
```
And I want to extract the largest numeric sequence in each string, respectively:
```
4123499
99999994
```
I have previously tried regex (I am using VB6)
```
Set rx = New RegExp
rx.Pattern = "[^\d]"
rx.Global = True
St... | 2018/03/19 | [
"https://Stackoverflow.com/questions/49363411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3326321/"
] | You cannot get the result by just a regex. You will have to extract all numeric chunks and get the longest one using other programming means.
Here is an example:
```
Dim strPattern As String: strPattern = "\d+"
Dim str As String: str = "4123499-TESCO45-123"
Dim regEx As New RegExp
Dim matches As MatchCollection
Dim... | If the two examples you gave, are of a standard where:
1. `<long_number>-<some_other_data>-<short_number>`
2. `<text><long_number>_<short_number>`
Are the two formats that the strings come in, there are some solutions.
However, if you are searching any string in any format for the longest number, these will not work... |
49,363,411 | I have strings similar to the following:
```
4123499-TESCO45-123
every99999994_54
```
And I want to extract the largest numeric sequence in each string, respectively:
```
4123499
99999994
```
I have previously tried regex (I am using VB6)
```
Set rx = New RegExp
rx.Pattern = "[^\d]"
rx.Global = True
St... | 2018/03/19 | [
"https://Stackoverflow.com/questions/49363411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3326321/"
] | You cannot get the result by just a regex. You will have to extract all numeric chunks and get the longest one using other programming means.
Here is an example:
```
Dim strPattern As String: strPattern = "\d+"
Dim str As String: str = "4123499-TESCO45-123"
Dim regEx As New RegExp
Dim matches As MatchCollection
Dim... | Please, try.
Pure VB. **No external libs or objects.**
No brain-breaking regexp's patterns.
No string manipulations, so - speed. **Superspeed. ~30 times faster** than [regexp](https://stackoverflow.com/a/49363651/6698332) :)
Easy transform on variouse needs.
For example, concatenate all digits from the s... |
49,363,411 | I have strings similar to the following:
```
4123499-TESCO45-123
every99999994_54
```
And I want to extract the largest numeric sequence in each string, respectively:
```
4123499
99999994
```
I have previously tried regex (I am using VB6)
```
Set rx = New RegExp
rx.Pattern = "[^\d]"
rx.Global = True
St... | 2018/03/19 | [
"https://Stackoverflow.com/questions/49363411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3326321/"
] | That's not solvable with an RE on its own.
Instead you can simply walk along the string tracking the longest consecutive digit group:
```
For i = 1 To Len(StringText)
If IsNumeric(Mid$(StringText, i, 1)) Then
a = a & Mid$(StringText, i, 1)
Else
a = ""
End If
If Len(a) > Len(longest) Th... | If the two examples you gave, are of a standard where:
1. `<long_number>-<some_other_data>-<short_number>`
2. `<text><long_number>_<short_number>`
Are the two formats that the strings come in, there are some solutions.
However, if you are searching any string in any format for the longest number, these will not work... |
49,363,411 | I have strings similar to the following:
```
4123499-TESCO45-123
every99999994_54
```
And I want to extract the largest numeric sequence in each string, respectively:
```
4123499
99999994
```
I have previously tried regex (I am using VB6)
```
Set rx = New RegExp
rx.Pattern = "[^\d]"
rx.Global = True
St... | 2018/03/19 | [
"https://Stackoverflow.com/questions/49363411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3326321/"
] | That's not solvable with an RE on its own.
Instead you can simply walk along the string tracking the longest consecutive digit group:
```
For i = 1 To Len(StringText)
If IsNumeric(Mid$(StringText, i, 1)) Then
a = a & Mid$(StringText, i, 1)
Else
a = ""
End If
If Len(a) > Len(longest) Th... | Please, try.
Pure VB. **No external libs or objects.**
No brain-breaking regexp's patterns.
No string manipulations, so - speed. **Superspeed. ~30 times faster** than [regexp](https://stackoverflow.com/a/49363651/6698332) :)
Easy transform on variouse needs.
For example, concatenate all digits from the s... |
50,042,755 | I want to execute two keywords in a test-case out of which, one keyword has to be executed only once and the other has to be executed multiple times. Please find the code below to understand the logic of the execution:
```
*** Settings ***
Test Setup OPEN CHROME BROWSER
Test Teardown CLOSE CHROME BROWSE... | 2018/04/26 | [
"https://Stackoverflow.com/questions/50042755",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9044468/"
] | ```
*** Settings ***
Test Setup KEYWORD1 ${reg_userid} ${reg_userpass}
Test Teardown CLOSE CHROME BROWSER
Test Template KEYWORD2 ${content}
Force Tags Smoke
*** Test Cases *** content
VALID CREDENTIAL CONTENT A
CONTENT B
CONTENT C
*** K... | You can create another keyword like below
```
Execute Keyword Multiple Times
[Arguments] ${keyword_name} @{params}
FOR ${i} IN @{params}
Run Keyword ${keyword_name} ${i}
END
```
and you can call it
```
Execute Keyword Multiple Times KEYWORD 2 CONTENT A CONTENT B ...... |
50,042,755 | I want to execute two keywords in a test-case out of which, one keyword has to be executed only once and the other has to be executed multiple times. Please find the code below to understand the logic of the execution:
```
*** Settings ***
Test Setup OPEN CHROME BROWSER
Test Teardown CLOSE CHROME BROWSE... | 2018/04/26 | [
"https://Stackoverflow.com/questions/50042755",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9044468/"
] | What you need is the [Repeat Keyword](http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Repeat%20Keyword) from the [BuildIn](http://robotframework.org/robotframework/latest/libraries/BuiltIn.html) library.
>
> Examples:
>
>
>
> ```robot
> Repeat Keyword 5 times Go Back
> Repeat... | You can create another keyword like below
```
Execute Keyword Multiple Times
[Arguments] ${keyword_name} @{params}
FOR ${i} IN @{params}
Run Keyword ${keyword_name} ${i}
END
```
and you can call it
```
Execute Keyword Multiple Times KEYWORD 2 CONTENT A CONTENT B ...... |
44,516,613 | I had just been having problems with creating new records as posted here [Can't create new record via form in Rails 5 app](https://stackoverflow.com/questions/44505042/cant-create-new-record-via-form-in-rails-5-app), so not sure if this could be related.
The issue is that when I edit an existing record, the changes a... | 2017/06/13 | [
"https://Stackoverflow.com/questions/44516613",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/240241/"
] | You need to be more precise when defining the regex. `.*` is too greedy and matches across commas and other stuff.
I suggest using
```
var latencyPattern = regexp.MustCompile(`(round-trip|rtt)\s+\S+\s*=\s*([0-9.]+)/([0-9.]+)/([0-9.]+)/([0-9.]+)\s*ms`)
```
See the [regex demo](https://regex101.com/r/B2ESZj/1).
[Go ... | Personally, I would simplify this as much as possible, especially since you aren't trying to pull out all the data, just a couple parts - which are conveniently in the same format in both versions! Essentially, in that string, you only care about `min/avg/max/stddev = 0.019/0.034/0.044/0.010`:
```
re := regexp.MustCom... |
2,698,662 | Here's an interesting problem, and result, that I wish to share with the math community here at Math SE. I think I've found a proof without words...
[](https://i.stack.imgur.com/rcIcf.jpg)
I came across this problem sometime back, and here's a possib... | 2018/03/19 | [
"https://math.stackexchange.com/questions/2698662",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/425395/"
] | **This is a hint, not a solution.**
Hint: Let's call your set $X$, just to give it a name.
1. Can you show that $\Bbb Q$ is disconnected by exhibiting nonempty open sets $U$ and $V$ with $\Bbb Q = U \cup V$ and $U \cap V = \emptyset$?
2. If you can, then $U\_1 = U \times \Bbb R$ and $V\_1 = V \times \Bbb R$ are both... | Looking over the comments to John Hughes' answer, I see that you were advised to study how the definitions and properties of connected\subspace\product play out together.
With that as the background, the problem can be tackled by finding a nonempty and proper subset of $D = \mathbb{Q}×[0,1]$ that is both open and clos... |
1,188,407 | Relevant questions are:
[Where Linux places the messages of boot?](https://superuser.com/questions/176165/where-linux-places-the-messages-of-boot)
[Name of log file where boot process is logged](https://superuser.com/questions/132496/name-of-log-file-where-boot-process-is-logged?rq=1)
However, these do not answer th... | 2017/03/14 | [
"https://superuser.com/questions/1188407",
"https://superuser.com",
"https://superuser.com/users/280044/"
] | So your console has two types of messages:
* generated by the kernel (via printk);
* generated by userspace (usually your init system).
Kernel messages are always stored in the kmsg buffer, visible via `dmesg`. They're also often copied to your syslog. (This also applies to userspace messages written to `/dev/kmsg`, ... | Grawity's answer is must better described than I would have been able to accomplish for that stage in the boot.
On the physical redirection method, your BIOS has to support it. Server geared boards usually do. The Intel, IBM, and SuperMicro systems typically have a Console Redirection option under the main heading of ... |
1,188,407 | Relevant questions are:
[Where Linux places the messages of boot?](https://superuser.com/questions/176165/where-linux-places-the-messages-of-boot)
[Name of log file where boot process is logged](https://superuser.com/questions/132496/name-of-log-file-where-boot-process-is-logged?rq=1)
However, these do not answer th... | 2017/03/14 | [
"https://superuser.com/questions/1188407",
"https://superuser.com",
"https://superuser.com/users/280044/"
] | So your console has two types of messages:
* generated by the kernel (via printk);
* generated by userspace (usually your init system).
Kernel messages are always stored in the kmsg buffer, visible via `dmesg`. They're also often copied to your syslog. (This also applies to userspace messages written to `/dev/kmsg`, ... | One suggestion is to have another laptop film the boot screen with high resolution and frame rates then slow play the resulting (**MOV - MP4 - AVI**) - maybe not the best solution but simply to deploy and its for debugging anyway right ? Just an Idea ... |
1,188,407 | Relevant questions are:
[Where Linux places the messages of boot?](https://superuser.com/questions/176165/where-linux-places-the-messages-of-boot)
[Name of log file where boot process is logged](https://superuser.com/questions/132496/name-of-log-file-where-boot-process-is-logged?rq=1)
However, these do not answer th... | 2017/03/14 | [
"https://superuser.com/questions/1188407",
"https://superuser.com",
"https://superuser.com/users/280044/"
] | So your console has two types of messages:
* generated by the kernel (via printk);
* generated by userspace (usually your init system).
Kernel messages are always stored in the kmsg buffer, visible via `dmesg`. They're also often copied to your syslog. (This also applies to userspace messages written to `/dev/kmsg`, ... | OpenRC Logging
"OpenRC doesn't log anything by default. To log OpenRC's output during boot, uncomment and set the `rc_logger` option in `/etc/rc.conf`. The log will be saved at `/var/log/rc.log` by default."
```
rc_logger="Yes"
```
then
```
cat /var/log/rc.log # After reboot
```
Gentoo Wiki
OpenRC
Chapter 3 C... |
1,188,407 | Relevant questions are:
[Where Linux places the messages of boot?](https://superuser.com/questions/176165/where-linux-places-the-messages-of-boot)
[Name of log file where boot process is logged](https://superuser.com/questions/132496/name-of-log-file-where-boot-process-is-logged?rq=1)
However, these do not answer th... | 2017/03/14 | [
"https://superuser.com/questions/1188407",
"https://superuser.com",
"https://superuser.com/users/280044/"
] | One suggestion is to have another laptop film the boot screen with high resolution and frame rates then slow play the resulting (**MOV - MP4 - AVI**) - maybe not the best solution but simply to deploy and its for debugging anyway right ? Just an Idea ... | Grawity's answer is must better described than I would have been able to accomplish for that stage in the boot.
On the physical redirection method, your BIOS has to support it. Server geared boards usually do. The Intel, IBM, and SuperMicro systems typically have a Console Redirection option under the main heading of ... |
1,188,407 | Relevant questions are:
[Where Linux places the messages of boot?](https://superuser.com/questions/176165/where-linux-places-the-messages-of-boot)
[Name of log file where boot process is logged](https://superuser.com/questions/132496/name-of-log-file-where-boot-process-is-logged?rq=1)
However, these do not answer th... | 2017/03/14 | [
"https://superuser.com/questions/1188407",
"https://superuser.com",
"https://superuser.com/users/280044/"
] | Grawity's answer is must better described than I would have been able to accomplish for that stage in the boot.
On the physical redirection method, your BIOS has to support it. Server geared boards usually do. The Intel, IBM, and SuperMicro systems typically have a Console Redirection option under the main heading of ... | OpenRC Logging
"OpenRC doesn't log anything by default. To log OpenRC's output during boot, uncomment and set the `rc_logger` option in `/etc/rc.conf`. The log will be saved at `/var/log/rc.log` by default."
```
rc_logger="Yes"
```
then
```
cat /var/log/rc.log # After reboot
```
Gentoo Wiki
OpenRC
Chapter 3 C... |
1,188,407 | Relevant questions are:
[Where Linux places the messages of boot?](https://superuser.com/questions/176165/where-linux-places-the-messages-of-boot)
[Name of log file where boot process is logged](https://superuser.com/questions/132496/name-of-log-file-where-boot-process-is-logged?rq=1)
However, these do not answer th... | 2017/03/14 | [
"https://superuser.com/questions/1188407",
"https://superuser.com",
"https://superuser.com/users/280044/"
] | One suggestion is to have another laptop film the boot screen with high resolution and frame rates then slow play the resulting (**MOV - MP4 - AVI**) - maybe not the best solution but simply to deploy and its for debugging anyway right ? Just an Idea ... | OpenRC Logging
"OpenRC doesn't log anything by default. To log OpenRC's output during boot, uncomment and set the `rc_logger` option in `/etc/rc.conf`. The log will be saved at `/var/log/rc.log` by default."
```
rc_logger="Yes"
```
then
```
cat /var/log/rc.log # After reboot
```
Gentoo Wiki
OpenRC
Chapter 3 C... |
63,574,728 | I've an AWS API gateway in front of a REST API service. I would like to remove one/some HTTP headers when I forward the request to the origin.
I know how to do this using a lambda but I'm just wondering is there is something built in. | 2020/08/25 | [
"https://Stackoverflow.com/questions/63574728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1803148/"
] | I think the simpler approach is boolean logic:
```
SELECT `id`, `title`, `body`, `created_on`
FROM `fcm_messages`
WHERE
(`city` = :city AND `street` = :street AND `building` = :building)
OR (`city` = :city AND `street` = :street AND `building` = '-')
OR (`city` = :city AND `street` = '-' AND `building` ... | You can build a query simply by putting each condition into brackets and combine them by a logical OR for each one.
```
$query = "SELECT `id`, `title`, `body`, `created_on` FROM `fcm_messages` WHERE ";
$conditions[] = "(`city`='$city' AND `street`='$street' AND `building`='$building')";
$conditions[] = "(`city`='$cit... |
63,574,728 | I've an AWS API gateway in front of a REST API service. I would like to remove one/some HTTP headers when I forward the request to the origin.
I know how to do this using a lambda but I'm just wondering is there is something built in. | 2020/08/25 | [
"https://Stackoverflow.com/questions/63574728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1803148/"
] | I think the simpler approach is boolean logic:
```
SELECT `id`, `title`, `body`, `created_on`
FROM `fcm_messages`
WHERE
(`city` = :city AND `street` = :street AND `building` = :building)
OR (`city` = :city AND `street` = :street AND `building` = '-')
OR (`city` = :city AND `street` = '-' AND `building` ... | In MySQL, you can take advantage of tuples:
```
SELECT `id`, `title`, `body`, `created_on`
FROM `fcm_messages`
WHERE (city, street, building) in ( (:city, :street, :building), (:city, :street, '-'), (:city, '-', '-'), ('-', '-', '-') )
```
Note: In many cases, the "generic" value would be stored as `NULL`. That wo... |
2,448,804 | Sophomore's dream is the identity that states
\begin{equation}
\int\_0^1 x^x dx = \sum\limits\_{n=1}^\infty (-1)^{n+1}n^{-n}
\end{equation}
The proof is found using the series expansion for $e^{-x\log(x)}$ and switching the integral and the sum. But I have a problem : I don't understand why I can replace $x^x$ in th... | 2017/09/28 | [
"https://math.stackexchange.com/questions/2448804",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/397986/"
] | Let $$I(k,n)=\int\limits\_0^1x^k\ln^nxdx.$$
Thus, $$I(k,n)=\int\limits\_0^1x^k\ln^nxdx=\frac{x^{k+1}\ln^nx}{k+1}\big|\_0^1-\frac{n}{k+1}\int\limits\_0^1x^k\ln^{n-1}xdx=-\frac{nI(k,n-1)}{k+1}.$$
Thus,
$$I(k,n)\prod\_{i=2}^{n}I(k,i-1)=I(k,n)\prod\_{i=1}^{n-1}I(k,i)=\prod\_{i=1}^nI(k,i)=$$
$$=\prod\_{i=1}^{n}\left(-\frac... | Define
$$ f(x) = \begin{cases} x^x & 0 < x \leq 1, \\
1 & x = 0. \end{cases},
g(x) = \begin{cases} x \ln x & 0 < x \leq 1, \\
0 & x = 0. \end{cases} $$
Both $f,g$ are continuous on $[0,1]$ and we have $f(x) = e^{g(x)}$ for all $x \in [0,1]$. The image of $g$ is a compact subset of $\mathbb{R}$ so it lies in some inte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.