qid int64 1 74.6M | question stringlengths 45 24.2k | date stringlengths 10 10 | metadata stringlengths 101 178 | response_j stringlengths 32 23.2k | response_k stringlengths 21 13.2k |
|---|---|---|---|---|---|
10,262,114 | I need to script my app (not a game) and I have a problem, choosing a script lang for this.
Lua looks fine (actually, it is ideal for my task), but it has problems with unicode strings, which will be used.
Also, I thought about Python, but I don't like It's syntax, and it's Dll is too big for me ( about 2.5 Mib).
Pytho... | 2012/04/21 | ['https://Stackoverflow.com/questions/10262114', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/684275/'] | There isn't really such a thing as a "unicode string". Strings are a sequence of bytes that can contain anything. Knowing the encoding of the data in the string matters, though.
I use Lua with [UTF-8 strings](http://en.wikipedia.org/wiki/UTF-8), which just works for all the operations I care about. I do not use any Un... | Take look at [Jim Tcl](http://jim.tcl.tk). It's small, easily embeddable and extendable, supports UTF-8 strings, and it's pretty powerful |
43,979,563 | We have code that loads html to div with class content. We have div element with link class which has data-href and some other data-\* properties. The code looks like:
```
$(document).on('click', '.link', linkClick);
linkClick: function (event) {
event.stopPropagation();
$('.content').load($(th... | 2017/05/15 | ['https://Stackoverflow.com/questions/43979563', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4930231/'] | Create a scoped reference to it before the load call:
```
function (event) {
event.stopPropagation();
var $that = $(this); // <- Like this
$('.content').load($(this).data('href'), function (response, status) {
// You can use $that here
if (status == 'error') {
$('.content').... | ```
$(document).on('click', '.link', linkClick);
var href = $(this).data('href');
linkClick: function (event) {
event.stopPropagation();
$('.content').load(href, function (response, status) {
if (status == 'error') {
$('.content').html("Something went wrong. Please try again later");
... |
43,979,563 | We have code that loads html to div with class content. We have div element with link class which has data-href and some other data-\* properties. The code looks like:
```
$(document).on('click', '.link', linkClick);
linkClick: function (event) {
event.stopPropagation();
$('.content').load($(th... | 2017/05/15 | ['https://Stackoverflow.com/questions/43979563', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4930231/'] | Create a scoped reference to it before the load call:
```
function (event) {
event.stopPropagation();
var $that = $(this); // <- Like this
$('.content').load($(this).data('href'), function (response, status) {
// You can use $that here
if (status == 'error') {
$('.content').... | You can use `event.target` to access clicked element. Most common way is to store it under *that* or *self* variable.
```
$(document).on('click', '.link', linkClick);
linkClick = function (event) {
event.stopPropagation();
var that = event.target;
$('.content').load($(that).data('href'), function (respons... |
14,465,060 | Ok so I have a map loaded with pins from a remote JSON feed which is loaded into the app. This all works fine.
Now from initial experimenting `regionDidChangeAnimated` gets called multiple times and so I moved my post request to a method that uses a drag map gesture recogniser which then performs a post request to get... | 2013/01/22 | ['https://Stackoverflow.com/questions/14465060', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/652028/'] | I have a similar problem: I want do distinguish if the displayed part of a map has been changed by program or by user interaction. Apparently, `MKMapView` objects do not tell me so, i.e. `regionDidChangeAnimated` is called in both cases without an indication why.
But since `MKMapView` is a subclass of `UIView`, and ... | I am such a plank sometimes writing problems can help. I simply removed the regionDidChangeAnimated as I have no need for it and the code that was present there I moved to my gesture which was to removeAnnotations before re-adding them doh! |
6,394,968 | Yet another template issue ! I'm trying to get a template method that will output an object if it has an overload for the operator <<.
I have pretty much everything working, and implemented an enable\_if in order to make g++ choose the intended specialization for each type of objects.
Thing is, with a non-overloaded o... | 2011/06/18 | ['https://Stackoverflow.com/questions/6394968', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/538377/'] | You'll get the ambiguity because in both cases you have a function that takes a stream followed by your type `T` as the first two arguments. This works though:
```
#include <iostream>
#include <boost/utility/enable_if.hpp>
#include <typeinfo>
template <class T>
struct CanPrint { enum { value = 0 }; };
template <>
st... | The ambiguity is because of the default parameter value.
Calling `Print(stream, whatever)` can be resolved to either the first version with the default third parameter or the second version with no third parameter.
Remove the default value, and the compiler will understand. Otherwise both of them can be chosen always... |
6,394,968 | Yet another template issue ! I'm trying to get a template method that will output an object if it has an overload for the operator <<.
I have pretty much everything working, and implemented an enable\_if in order to make g++ choose the intended specialization for each type of objects.
Thing is, with a non-overloaded o... | 2011/06/18 | ['https://Stackoverflow.com/questions/6394968', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/538377/'] | You'll get the ambiguity because in both cases you have a function that takes a stream followed by your type `T` as the first two arguments. This works though:
```
#include <iostream>
#include <boost/utility/enable_if.hpp>
#include <typeinfo>
template <class T>
struct CanPrint { enum { value = 0 }; };
template <>
st... | I believe this has nothing to do with templates. A free function overloaded in this fashion would give the same ambigious error.
check this simple code example, It is similar to what you are doing in your template example:
```
void doSomething(int i, int j, int k );
void doSomething(int i, int j, int k = 10);
void d... |
53,596,009 | I am trying to remove the last `","` of a string however i am getting an error stating that
>
> System.ArgumentOutOfRangeException: 'StartIndex cannot be less than zero.
>
>
>
the string is written to the file fine but it breaks when running with the above error. I'm unsure as to why this is happening, any sugge... | 2018/12/03 | ['https://Stackoverflow.com/questions/53596009', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5424254/'] | Appending `string` in a loop:
```
foreach (int s in connectionData)
{
writeUnEditedData += (s + ",");
}
```
is *not* a good idea. Put `Join`:
```
writeUnEditedData = string.Join(",", connectionData);
```
Having this done, you don't have to remove anything:
```
using (StreamWriter sw = ... | This usually means that the string is empty.
Try to put this guard code in:
```
string writeData = string.IsNullOrEmpty(writeUnEditedData)
? string.Empty
: writeUnEditedData.Remove(writeUnEditedData.Length - 1);
``` |
53,596,009 | I am trying to remove the last `","` of a string however i am getting an error stating that
>
> System.ArgumentOutOfRangeException: 'StartIndex cannot be less than zero.
>
>
>
the string is written to the file fine but it breaks when running with the above error. I'm unsure as to why this is happening, any sugge... | 2018/12/03 | ['https://Stackoverflow.com/questions/53596009', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5424254/'] | Add a check to see if writeUnEditedData is not an empty string before you do the Remove. An empty string will results in a Remove(-1) which I would assume would throw an error that the StartIndex cannot be less then 0. | This usually means that the string is empty.
Try to put this guard code in:
```
string writeData = string.IsNullOrEmpty(writeUnEditedData)
? string.Empty
: writeUnEditedData.Remove(writeUnEditedData.Length - 1);
``` |
53,596,009 | I am trying to remove the last `","` of a string however i am getting an error stating that
>
> System.ArgumentOutOfRangeException: 'StartIndex cannot be less than zero.
>
>
>
the string is written to the file fine but it breaks when running with the above error. I'm unsure as to why this is happening, any sugge... | 2018/12/03 | ['https://Stackoverflow.com/questions/53596009', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5424254/'] | Try `string.TrimEnd()`:
```
writeUnEditedData = writeUnEditedData.TrimEnd(',');
``` | This usually means that the string is empty.
Try to put this guard code in:
```
string writeData = string.IsNullOrEmpty(writeUnEditedData)
? string.Empty
: writeUnEditedData.Remove(writeUnEditedData.Length - 1);
``` |
53,596,009 | I am trying to remove the last `","` of a string however i am getting an error stating that
>
> System.ArgumentOutOfRangeException: 'StartIndex cannot be less than zero.
>
>
>
the string is written to the file fine but it breaks when running with the above error. I'm unsure as to why this is happening, any sugge... | 2018/12/03 | ['https://Stackoverflow.com/questions/53596009', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5424254/'] | Appending `string` in a loop:
```
foreach (int s in connectionData)
{
writeUnEditedData += (s + ",");
}
```
is *not* a good idea. Put `Join`:
```
writeUnEditedData = string.Join(",", connectionData);
```
Having this done, you don't have to remove anything:
```
using (StreamWriter sw = ... | Add a check to see if writeUnEditedData is not an empty string before you do the Remove. An empty string will results in a Remove(-1) which I would assume would throw an error that the StartIndex cannot be less then 0. |
53,596,009 | I am trying to remove the last `","` of a string however i am getting an error stating that
>
> System.ArgumentOutOfRangeException: 'StartIndex cannot be less than zero.
>
>
>
the string is written to the file fine but it breaks when running with the above error. I'm unsure as to why this is happening, any sugge... | 2018/12/03 | ['https://Stackoverflow.com/questions/53596009', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5424254/'] | Appending `string` in a loop:
```
foreach (int s in connectionData)
{
writeUnEditedData += (s + ",");
}
```
is *not* a good idea. Put `Join`:
```
writeUnEditedData = string.Join(",", connectionData);
```
Having this done, you don't have to remove anything:
```
using (StreamWriter sw = ... | Try `string.TrimEnd()`:
```
writeUnEditedData = writeUnEditedData.TrimEnd(',');
``` |
53,596,009 | I am trying to remove the last `","` of a string however i am getting an error stating that
>
> System.ArgumentOutOfRangeException: 'StartIndex cannot be less than zero.
>
>
>
the string is written to the file fine but it breaks when running with the above error. I'm unsure as to why this is happening, any sugge... | 2018/12/03 | ['https://Stackoverflow.com/questions/53596009', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5424254/'] | Appending `string` in a loop:
```
foreach (int s in connectionData)
{
writeUnEditedData += (s + ",");
}
```
is *not* a good idea. Put `Join`:
```
writeUnEditedData = string.Join(",", connectionData);
```
Having this done, you don't have to remove anything:
```
using (StreamWriter sw = ... | You can improve on this pattern:
```
string writeUnEditedData = "";
foreach (int s in connectionData)
{
writeUnEditedData += (s + ",");
}
```
to avoid adding the comma in the first place:
```
string delimiter = "";
string writeUnEditedData = "";
foreach (int s in connectionData)
{
writeUnEdi... |
53,596,009 | I am trying to remove the last `","` of a string however i am getting an error stating that
>
> System.ArgumentOutOfRangeException: 'StartIndex cannot be less than zero.
>
>
>
the string is written to the file fine but it breaks when running with the above error. I'm unsure as to why this is happening, any sugge... | 2018/12/03 | ['https://Stackoverflow.com/questions/53596009', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5424254/'] | Try `string.TrimEnd()`:
```
writeUnEditedData = writeUnEditedData.TrimEnd(',');
``` | Add a check to see if writeUnEditedData is not an empty string before you do the Remove. An empty string will results in a Remove(-1) which I would assume would throw an error that the StartIndex cannot be less then 0. |
53,596,009 | I am trying to remove the last `","` of a string however i am getting an error stating that
>
> System.ArgumentOutOfRangeException: 'StartIndex cannot be less than zero.
>
>
>
the string is written to the file fine but it breaks when running with the above error. I'm unsure as to why this is happening, any sugge... | 2018/12/03 | ['https://Stackoverflow.com/questions/53596009', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5424254/'] | Add a check to see if writeUnEditedData is not an empty string before you do the Remove. An empty string will results in a Remove(-1) which I would assume would throw an error that the StartIndex cannot be less then 0. | You can improve on this pattern:
```
string writeUnEditedData = "";
foreach (int s in connectionData)
{
writeUnEditedData += (s + ",");
}
```
to avoid adding the comma in the first place:
```
string delimiter = "";
string writeUnEditedData = "";
foreach (int s in connectionData)
{
writeUnEdi... |
53,596,009 | I am trying to remove the last `","` of a string however i am getting an error stating that
>
> System.ArgumentOutOfRangeException: 'StartIndex cannot be less than zero.
>
>
>
the string is written to the file fine but it breaks when running with the above error. I'm unsure as to why this is happening, any sugge... | 2018/12/03 | ['https://Stackoverflow.com/questions/53596009', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5424254/'] | Try `string.TrimEnd()`:
```
writeUnEditedData = writeUnEditedData.TrimEnd(',');
``` | You can improve on this pattern:
```
string writeUnEditedData = "";
foreach (int s in connectionData)
{
writeUnEditedData += (s + ",");
}
```
to avoid adding the comma in the first place:
```
string delimiter = "";
string writeUnEditedData = "";
foreach (int s in connectionData)
{
writeUnEdi... |
49,182 | The question goes:
Expand $(1-2x)^{1/2}-(1-3x)^{2/3}$ as far as the 4th term.
Ans: $x + x^2/2 + 5x^3/6 + 41x^4/24$
How should I do it? | 2011/07/03 | ['https://math.stackexchange.com/questions/49182', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/11103/'] | You can translate the inequality to $\frac{y^2 \cdot y'}{1+y^6} \leq x^{2011}$ and then integrate from $x\_00$ to $s$ with respect to $x$.
$$ \int\_{x\_0}^s \frac{y(x)^2 \cdot y(x)'}{1+y(x)^6} dx \leq \frac{s^{2012}}{2012}-\frac{x\_0^{2012}}{2012}$$
$$ \frac{1}{3} \arctan y^3(s) -\frac{1}{3}\arctan y^3(x\_0) \leq \f... | What you basically have is this:
\begin{align\*}
\frac{dy}{dx} & \leq \frac{x^{2011}\cdot (1+y^{6})}{y^{2}} \\ \Longrightarrow \int\frac{y^{2}}{1+y^{6}}\ dy &\leq \int x^{2011} \ dx
\end{align\*} |
52,074,170 | I've got two data frames: `zerowy_nazwa5`, `zatwierdzony_nazwa5`,
and working 2 lines:
```
setdiff(zatwierdzony_nazwa5, zerowy_nazwa5)
setdiff(zerowy_nazwa5, zatwierdzony_nazwa5)
```
how I implement this in PowerBi?
Thanks for help | 2018/08/29 | ['https://Stackoverflow.com/questions/52074170', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2298197/'] | If you remove the `seleniumAddress` from your protractor `conf.js`, protractor will start the selenium automatically. Example:
**With the `seleniumAddress` on the `conf.js`:**
```
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: [ 'spec.js' ]
};
```
**Removing the `seleniumAddress` on ... | You can archive your goal with npm packages: [concurrently](https://www.npmjs.com/package/concurrently) and [delay-cli](https://www.npmjs.com/package/delay-cli).
Add them as dependencies.
```
// package.json
"scripts": [
"wstart": "webdriver-manager update && webdriver-manager start",
"test": "concurrently --... |
12,803,508 | I have a program that recevice message in udp in visual studio.
sometime I miss a message.I want to use select to see udp buffer used size if udp rec buffer is full.
How I can use select for this purpose?
where can I see a example? | 2012/10/09 | ['https://Stackoverflow.com/questions/12803508', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/598470/'] | Post-fact discovery that your receive buffer is full will not do you any good - packets have already been dropped. Even more - you need to set your buffer sizes before `connect()` or `bind()`, they will not change after that.
What you should do is pre-set socket receive buffer to some large value that would accommodat... | I think one of the main properties of UDP (as opposed to TCP) is that you will sometimes lose messages. You have to design your protocol to account for that. I'm not an expert in UDP, but I don't understand how seeing the size of the buffer will help you, and I don't understand why you want to use `select` to do it. |
12,803,508 | I have a program that recevice message in udp in visual studio.
sometime I miss a message.I want to use select to see udp buffer used size if udp rec buffer is full.
How I can use select for this purpose?
where can I see a example? | 2012/10/09 | ['https://Stackoverflow.com/questions/12803508', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/598470/'] | Post-fact discovery that your receive buffer is full will not do you any good - packets have already been dropped. Even more - you need to set your buffer sizes before `connect()` or `bind()`, they will not change after that.
What you should do is pre-set socket receive buffer to some large value that would accommodat... | You can use [`getsockopt`](http://linux.die.net/man/3/getsockopt) to get socket options, including receive buffer size. Use [`setsockopt`](http://linux.die.net/man/3/setsockopt) to set the size.
Example of getting the size:
```
int size;
getsockopt(socket_fd, SOL_SOCKET, SO_RCVBUF, &size);
std::cout << "Buffer size i... |
1,569,238 | I am having performance problem when truing to fill typed list. Below is my simplified code:
```
public static List<Product> GetProducts()
{
List<Product> products = new List<Product>();
using (DbQuery query = new DbQuery()) //this is database access class
{
... | 2009/10/14 | ['https://Stackoverflow.com/questions/1569238', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/190204/'] | Have you tried to put an index on the fields you're filtering on? This will definitely speed up your queries versus not having indices. | I would be surprised if that is your bottleneck. I would try making a little test app that has a mock database connection.
You can usually do a little bit better if you can pre-size the list. If there is a reasonable minimum size for the query, or if you have some other way of knowing (or reasonably guessing) a good ... |
1,569,238 | I am having performance problem when truing to fill typed list. Below is my simplified code:
```
public static List<Product> GetProducts()
{
List<Product> products = new List<Product>();
using (DbQuery query = new DbQuery()) //this is database access class
{
... | 2009/10/14 | ['https://Stackoverflow.com/questions/1569238', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/190204/'] | Have you tried to put an index on the fields you're filtering on? This will definitely speed up your queries versus not having indices. | Just from the sounds of it, this has to be a database performance or latency issue (if connecting remotely.) |
1,569,238 | I am having performance problem when truing to fill typed list. Below is my simplified code:
```
public static List<Product> GetProducts()
{
List<Product> products = new List<Product>();
using (DbQuery query = new DbQuery()) //this is database access class
{
... | 2009/10/14 | ['https://Stackoverflow.com/questions/1569238', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/190204/'] | List insertion is very fast. Something else must be going on here. Try timing it with and without `products.Add(prd)` commented out. I suspect you'll find they're almost identical.
Here's how I'd solve this: comment out one line at a time until you see a big jump in performance-- then you'll have found your culprit. ... | I would be surprised if that is your bottleneck. I would try making a little test app that has a mock database connection.
You can usually do a little bit better if you can pre-size the list. If there is a reasonable minimum size for the query, or if you have some other way of knowing (or reasonably guessing) a good ... |
1,569,238 | I am having performance problem when truing to fill typed list. Below is my simplified code:
```
public static List<Product> GetProducts()
{
List<Product> products = new List<Product>();
using (DbQuery query = new DbQuery()) //this is database access class
{
... | 2009/10/14 | ['https://Stackoverflow.com/questions/1569238', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/190204/'] | List insertion is very fast. Something else must be going on here. Try timing it with and without `products.Add(prd)` commented out. I suspect you'll find they're almost identical.
Here's how I'd solve this: comment out one line at a time until you see a big jump in performance-- then you'll have found your culprit. ... | Just from the sounds of it, this has to be a database performance or latency issue (if connecting remotely.) |
1,569,238 | I am having performance problem when truing to fill typed list. Below is my simplified code:
```
public static List<Product> GetProducts()
{
List<Product> products = new List<Product>();
using (DbQuery query = new DbQuery()) //this is database access class
{
... | 2009/10/14 | ['https://Stackoverflow.com/questions/1569238', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/190204/'] | As Justin recommends, I personally would start commenting out sections of code until I found what was causing the bottleneck. For example, I might start by making the routine only run the database-centric code:
```
public static List<Product> GetProducts()
{
List<Product> products = new List<Produc... | I would be surprised if that is your bottleneck. I would try making a little test app that has a mock database connection.
You can usually do a little bit better if you can pre-size the list. If there is a reasonable minimum size for the query, or if you have some other way of knowing (or reasonably guessing) a good ... |
1,569,238 | I am having performance problem when truing to fill typed list. Below is my simplified code:
```
public static List<Product> GetProducts()
{
List<Product> products = new List<Product>();
using (DbQuery query = new DbQuery()) //this is database access class
{
... | 2009/10/14 | ['https://Stackoverflow.com/questions/1569238', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/190204/'] | As Justin recommends, I personally would start commenting out sections of code until I found what was causing the bottleneck. For example, I might start by making the routine only run the database-centric code:
```
public static List<Product> GetProducts()
{
List<Product> products = new List<Produc... | Just from the sounds of it, this has to be a database performance or latency issue (if connecting remotely.) |
9,866,679 | I came across `html>body` in one of the stylesheets and wanted to know as to why it is used.
```
html>body {
font-size: 16px;
font-size: 78.75%;
}
``` | 2012/03/26 | ['https://Stackoverflow.com/questions/9866679', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1184100/'] | It's called a [Child Selector](http://www.w3.org/TR/CSS2/selector.html#child-selectors).
The reason it's being used is likely because it's a hack to exclude IE6 and below. Those browsers don't understand the `>` selector.
**[More Information](http://en.wikipedia.org/wiki/CSS_filter#Child_selector_hack)** | Child selector, more info here: <http://www.w3.org/TR/CSS2/selector.html#child-selectors>
So in your code it would be any body child of html |
9,866,679 | I came across `html>body` in one of the stylesheets and wanted to know as to why it is used.
```
html>body {
font-size: 16px;
font-size: 78.75%;
}
``` | 2012/03/26 | ['https://Stackoverflow.com/questions/9866679', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1184100/'] | It's called a [Child Selector](http://www.w3.org/TR/CSS2/selector.html#child-selectors).
The reason it's being used is likely because it's a hack to exclude IE6 and below. Those browsers don't understand the `>` selector.
**[More Information](http://en.wikipedia.org/wiki/CSS_filter#Child_selector_hack)** | '> symbol indicates `child of`
Above code means
The style applies to all the tag body which is a child of html
```
#sample>div
```
above applies to all divs which are children of the element with id sample |
9,866,679 | I came across `html>body` in one of the stylesheets and wanted to know as to why it is used.
```
html>body {
font-size: 16px;
font-size: 78.75%;
}
``` | 2012/03/26 | ['https://Stackoverflow.com/questions/9866679', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1184100/'] | It's called a [Child Selector](http://www.w3.org/TR/CSS2/selector.html#child-selectors).
The reason it's being used is likely because it's a hack to exclude IE6 and below. Those browsers don't understand the `>` selector.
**[More Information](http://en.wikipedia.org/wiki/CSS_filter#Child_selector_hack)** | the '>' means that it is referencing on child elements of the parent (in this case 'html')
so for example I could have an arrangement of divs that look like so
```
<div id="outermost">
<div class="inner">
<div class="inner">
</div>
</div>
</div>
```
and i wrote some css like so
```
#outermost>.inner ... |
9,866,679 | I came across `html>body` in one of the stylesheets and wanted to know as to why it is used.
```
html>body {
font-size: 16px;
font-size: 78.75%;
}
``` | 2012/03/26 | ['https://Stackoverflow.com/questions/9866679', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1184100/'] | the '>' means that it is referencing on child elements of the parent (in this case 'html')
so for example I could have an arrangement of divs that look like so
```
<div id="outermost">
<div class="inner">
<div class="inner">
</div>
</div>
</div>
```
and i wrote some css like so
```
#outermost>.inner ... | Child selector, more info here: <http://www.w3.org/TR/CSS2/selector.html#child-selectors>
So in your code it would be any body child of html |
9,866,679 | I came across `html>body` in one of the stylesheets and wanted to know as to why it is used.
```
html>body {
font-size: 16px;
font-size: 78.75%;
}
``` | 2012/03/26 | ['https://Stackoverflow.com/questions/9866679', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1184100/'] | the '>' means that it is referencing on child elements of the parent (in this case 'html')
so for example I could have an arrangement of divs that look like so
```
<div id="outermost">
<div class="inner">
<div class="inner">
</div>
</div>
</div>
```
and i wrote some css like so
```
#outermost>.inner ... | '> symbol indicates `child of`
Above code means
The style applies to all the tag body which is a child of html
```
#sample>div
```
above applies to all divs which are children of the element with id sample |
124,342 | When a singer asks to tune a song a half step down from Gbm would that be Fminor or Gb? | 2022/08/12 | ['https://music.stackexchange.com/questions/124342', 'https://music.stackexchange.com', 'https://music.stackexchange.com/users/88138/'] | It means F minor.
Singers frequently change the key of (transpose) a song in order to best fit their vocal range.
Changing to Gb major would be a change of mode, which would entirely change the character of the music.
The below video is timed to a performance of the Beatles's "Here Comes the Sun", first in major, th... | I'd be surprised if the original key was G♭m - F♯m is far more the common way to call it. But you wouldn't change the key of any song from minor to major - or vice versa, just to suit someone's range. In fact, merely dropping a semitone is unusual. if it's that awkward to sing in G♭m, Em could be even better! (And prob... |
108,713 | I'm thinking of buying entry level DSLR Nikon D3500. I haven't used DSLR before, so I'm not sure if it is a good decision to buy DSLR. I would like to know if with this camera I can shoot portraits with blured background such as on the new smartphones with two cameras. Another thing I want to know if buying DSLR is goo... | 2019/06/05 | ['https://photo.stackexchange.com/questions/108713', 'https://photo.stackexchange.com', 'https://photo.stackexchange.com/users/85164/'] | If you read the other answers, it should be apparent that the qualities you seek such as (a) better portraits and (b) the desire to have a blurred background ... aren't really one thing, but a combination of many factors.
There are some nuances but the short answer is ... portraits do not require advanced DSLRs (so en... | I had an entry level for years (Canon 550D) and I have taken really good shots on it. Although lenses are important, I would like to enumerate a few other factors (sorted from the most important to the less important) that will influence on your results
1. **The subject**: This is by far the most important of all. You... |
108,713 | I'm thinking of buying entry level DSLR Nikon D3500. I haven't used DSLR before, so I'm not sure if it is a good decision to buy DSLR. I would like to know if with this camera I can shoot portraits with blured background such as on the new smartphones with two cameras. Another thing I want to know if buying DSLR is goo... | 2019/06/05 | ['https://photo.stackexchange.com/questions/108713', 'https://photo.stackexchange.com', 'https://photo.stackexchange.com/users/85164/'] | **It's not the camera, it's the lens.**
If you want a cheap and good option for shooting portrait pictures, you should definitely purchase in addition to a DSLR, a 50mm f/1.8 "nifty fifty" lens. Do expect to spend $100-$200 for the lens.
50mm is about optimal for portraits, because the relatively long 50mm focal leng... | A DX sensor has a crop factor of 2/3. You are presumably talking about the 18-55mm kit lens. For portrait work, you'd likely use it at its long end, giving you about 83mm equivalent focal length with an aperture of 1:5.6. That will give you the same depth of field as an 1:8 aperture setting on a 35mm film camera with t... |
108,713 | I'm thinking of buying entry level DSLR Nikon D3500. I haven't used DSLR before, so I'm not sure if it is a good decision to buy DSLR. I would like to know if with this camera I can shoot portraits with blured background such as on the new smartphones with two cameras. Another thing I want to know if buying DSLR is goo... | 2019/06/05 | ['https://photo.stackexchange.com/questions/108713', 'https://photo.stackexchange.com', 'https://photo.stackexchange.com/users/85164/'] | Is an entry level DSLR going to shoot nice portrait pictures? By itself, *no*, absolutely not.
It's easy to make the joke that the camera by itself just sits there and doesn't take pictures at all, being an inanimate object and all. Of course, we know what you actually mean, but there's really some truth to that. A DS... | Yes, low-end DSLRs can get you nice photos. But it depends a lot on the photographer, not just the camera.
The main thing to keep in mind for blurry backgrounds is the ratio between two distances:
* camera to the point of focus; and
* camera to background.
The further the background relative to the subject, the blur... |
108,713 | I'm thinking of buying entry level DSLR Nikon D3500. I haven't used DSLR before, so I'm not sure if it is a good decision to buy DSLR. I would like to know if with this camera I can shoot portraits with blured background such as on the new smartphones with two cameras. Another thing I want to know if buying DSLR is goo... | 2019/06/05 | ['https://photo.stackexchange.com/questions/108713', 'https://photo.stackexchange.com', 'https://photo.stackexchange.com/users/85164/'] | **It's not the camera, it's the lens.**
If you want a cheap and good option for shooting portrait pictures, you should definitely purchase in addition to a DSLR, a 50mm f/1.8 "nifty fifty" lens. Do expect to spend $100-$200 for the lens.
50mm is about optimal for portraits, because the relatively long 50mm focal leng... | Is an entry level DSLR going to shoot nice portrait pictures? By itself, *no*, absolutely not.
It's easy to make the joke that the camera by itself just sits there and doesn't take pictures at all, being an inanimate object and all. Of course, we know what you actually mean, but there's really some truth to that. A DS... |
108,713 | I'm thinking of buying entry level DSLR Nikon D3500. I haven't used DSLR before, so I'm not sure if it is a good decision to buy DSLR. I would like to know if with this camera I can shoot portraits with blured background such as on the new smartphones with two cameras. Another thing I want to know if buying DSLR is goo... | 2019/06/05 | ['https://photo.stackexchange.com/questions/108713', 'https://photo.stackexchange.com', 'https://photo.stackexchange.com/users/85164/'] | If you read the other answers, it should be apparent that the qualities you seek such as (a) better portraits and (b) the desire to have a blurred background ... aren't really one thing, but a combination of many factors.
There are some nuances but the short answer is ... portraits do not require advanced DSLRs (so en... | A DX sensor has a crop factor of 2/3. You are presumably talking about the 18-55mm kit lens. For portrait work, you'd likely use it at its long end, giving you about 83mm equivalent focal length with an aperture of 1:5.6. That will give you the same depth of field as an 1:8 aperture setting on a 35mm film camera with t... |
108,713 | I'm thinking of buying entry level DSLR Nikon D3500. I haven't used DSLR before, so I'm not sure if it is a good decision to buy DSLR. I would like to know if with this camera I can shoot portraits with blured background such as on the new smartphones with two cameras. Another thing I want to know if buying DSLR is goo... | 2019/06/05 | ['https://photo.stackexchange.com/questions/108713', 'https://photo.stackexchange.com', 'https://photo.stackexchange.com/users/85164/'] | Is an entry level DSLR going to shoot nice portrait pictures? By itself, *no*, absolutely not.
It's easy to make the joke that the camera by itself just sits there and doesn't take pictures at all, being an inanimate object and all. Of course, we know what you actually mean, but there's really some truth to that. A DS... | I had an entry level for years (Canon 550D) and I have taken really good shots on it. Although lenses are important, I would like to enumerate a few other factors (sorted from the most important to the less important) that will influence on your results
1. **The subject**: This is by far the most important of all. You... |
108,713 | I'm thinking of buying entry level DSLR Nikon D3500. I haven't used DSLR before, so I'm not sure if it is a good decision to buy DSLR. I would like to know if with this camera I can shoot portraits with blured background such as on the new smartphones with two cameras. Another thing I want to know if buying DSLR is goo... | 2019/06/05 | ['https://photo.stackexchange.com/questions/108713', 'https://photo.stackexchange.com', 'https://photo.stackexchange.com/users/85164/'] | Is an entry level DSLR going to shoot nice portrait pictures? By itself, *no*, absolutely not.
It's easy to make the joke that the camera by itself just sits there and doesn't take pictures at all, being an inanimate object and all. Of course, we know what you actually mean, but there's really some truth to that. A DS... | A DX sensor has a crop factor of 2/3. You are presumably talking about the 18-55mm kit lens. For portrait work, you'd likely use it at its long end, giving you about 83mm equivalent focal length with an aperture of 1:5.6. That will give you the same depth of field as an 1:8 aperture setting on a 35mm film camera with t... |
108,713 | I'm thinking of buying entry level DSLR Nikon D3500. I haven't used DSLR before, so I'm not sure if it is a good decision to buy DSLR. I would like to know if with this camera I can shoot portraits with blured background such as on the new smartphones with two cameras. Another thing I want to know if buying DSLR is goo... | 2019/06/05 | ['https://photo.stackexchange.com/questions/108713', 'https://photo.stackexchange.com', 'https://photo.stackexchange.com/users/85164/'] | **It's not the camera, it's the lens.**
If you want a cheap and good option for shooting portrait pictures, you should definitely purchase in addition to a DSLR, a 50mm f/1.8 "nifty fifty" lens. Do expect to spend $100-$200 for the lens.
50mm is about optimal for portraits, because the relatively long 50mm focal leng... | I had an entry level for years (Canon 550D) and I have taken really good shots on it. Although lenses are important, I would like to enumerate a few other factors (sorted from the most important to the less important) that will influence on your results
1. **The subject**: This is by far the most important of all. You... |
108,713 | I'm thinking of buying entry level DSLR Nikon D3500. I haven't used DSLR before, so I'm not sure if it is a good decision to buy DSLR. I would like to know if with this camera I can shoot portraits with blured background such as on the new smartphones with two cameras. Another thing I want to know if buying DSLR is goo... | 2019/06/05 | ['https://photo.stackexchange.com/questions/108713', 'https://photo.stackexchange.com', 'https://photo.stackexchange.com/users/85164/'] | If you read the other answers, it should be apparent that the qualities you seek such as (a) better portraits and (b) the desire to have a blurred background ... aren't really one thing, but a combination of many factors.
There are some nuances but the short answer is ... portraits do not require advanced DSLRs (so en... | Is an entry level DSLR going to shoot nice portrait pictures? By itself, *no*, absolutely not.
It's easy to make the joke that the camera by itself just sits there and doesn't take pictures at all, being an inanimate object and all. Of course, we know what you actually mean, but there's really some truth to that. A DS... |
108,713 | I'm thinking of buying entry level DSLR Nikon D3500. I haven't used DSLR before, so I'm not sure if it is a good decision to buy DSLR. I would like to know if with this camera I can shoot portraits with blured background such as on the new smartphones with two cameras. Another thing I want to know if buying DSLR is goo... | 2019/06/05 | ['https://photo.stackexchange.com/questions/108713', 'https://photo.stackexchange.com', 'https://photo.stackexchange.com/users/85164/'] | I had an entry level for years (Canon 550D) and I have taken really good shots on it. Although lenses are important, I would like to enumerate a few other factors (sorted from the most important to the less important) that will influence on your results
1. **The subject**: This is by far the most important of all. You... | A DX sensor has a crop factor of 2/3. You are presumably talking about the 18-55mm kit lens. For portrait work, you'd likely use it at its long end, giving you about 83mm equivalent focal length with an aperture of 1:5.6. That will give you the same depth of field as an 1:8 aperture setting on a 35mm film camera with t... |
11,967,306 | I am trying to use the package doBy, which requires an installation of the package lme4.
I have found the CRAN for it here <http://cran.r-project.org/web/packages/lme4//index.html>
However when I try download the .zip version I get the error "Object not found!".
From what I gather it is not an out of date package (wi... | 2012/08/15 | ['https://Stackoverflow.com/questions/11967306', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1545812/'] | try
```
install.packages("lme4",repos="http://r-forge.r-project.org")
``` | Do you use R Studio? I was having the same issue but then I used R Studio's tab "Packages" -> Install tab --> write lme4 from th CRAN repository. |
5,738,073 | I know from [this question](https://stackoverflow.com/questions/356846/c-var-vs-specific-type-performance) that `var i = 1` and `int i = 1` are exactly the same in IL. The compiler simply replaces `var` with the actual type at compile time. But, are there any instances where `var` could cause problem behavior (maybe th... | 2011/04/21 | ['https://Stackoverflow.com/questions/5738073', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/221061/'] | No, I don't think so. The only time it can't figure things out is if you try to do something like
```
var product = null;
```
Which makes sense, and in this case you get a compile error. | In addition to the ambiguous:
```
var x = null;
```
the compiler will also not infer the type of overloaded method groups:
```
var m = String.Equals;
```
nor will it infer the type of lambda expressions, which can be either `Func<>` or `Expression<Func<>>`:
```
var l = (int x) => x + 1;
```
All that said, Anth... |
5,738,073 | I know from [this question](https://stackoverflow.com/questions/356846/c-var-vs-specific-type-performance) that `var i = 1` and `int i = 1` are exactly the same in IL. The compiler simply replaces `var` with the actual type at compile time. But, are there any instances where `var` could cause problem behavior (maybe th... | 2011/04/21 | ['https://Stackoverflow.com/questions/5738073', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/221061/'] | I don't believe the compiler will *guess the wrong type.* However, it might *infer a type you didn't intend*, but that's not the same.
Consider the perfectly legal
```
decimal foo = 10;
decimal bar = 4;
decimal baz = foo / bar;
```
In the code, `baz` will very clearly be 2.5. The integer literals will be conver... | No, I don't think so. The only time it can't figure things out is if you try to do something like
```
var product = null;
```
Which makes sense, and in this case you get a compile error. |
5,738,073 | I know from [this question](https://stackoverflow.com/questions/356846/c-var-vs-specific-type-performance) that `var i = 1` and `int i = 1` are exactly the same in IL. The compiler simply replaces `var` with the actual type at compile time. But, are there any instances where `var` could cause problem behavior (maybe th... | 2011/04/21 | ['https://Stackoverflow.com/questions/5738073', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/221061/'] | No, I don't think so. The only time it can't figure things out is if you try to do something like
```
var product = null;
```
Which makes sense, and in this case you get a compile error. | ```
var x = 0
x = 0.10
```
`Cannot convert source type 'double' to target type 'int'`
An example:
```
double x = 0; //to initialize it
switch (something) {
case condition1:
x = 0.1;
break;
case condition2:
x = 0.2;
break;
}
```
Using `var` instead of `double` will give a co... |
5,738,073 | I know from [this question](https://stackoverflow.com/questions/356846/c-var-vs-specific-type-performance) that `var i = 1` and `int i = 1` are exactly the same in IL. The compiler simply replaces `var` with the actual type at compile time. But, are there any instances where `var` could cause problem behavior (maybe th... | 2011/04/21 | ['https://Stackoverflow.com/questions/5738073', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/221061/'] | It won't cause any "issues", regarding code however you could have a regression issue...
```
IObject1
{
void DoSomething();
}
IObject2
{
void DoSomething();
}
var result = SomeMethod();
result.DoSomething();
```
Now, if SomeMethod returned IObject1 and then was changed to return IObject2 this would still c... | In addition to the ambiguous:
```
var x = null;
```
the compiler will also not infer the type of overloaded method groups:
```
var m = String.Equals;
```
nor will it infer the type of lambda expressions, which can be either `Func<>` or `Expression<Func<>>`:
```
var l = (int x) => x + 1;
```
All that said, Anth... |
5,738,073 | I know from [this question](https://stackoverflow.com/questions/356846/c-var-vs-specific-type-performance) that `var i = 1` and `int i = 1` are exactly the same in IL. The compiler simply replaces `var` with the actual type at compile time. But, are there any instances where `var` could cause problem behavior (maybe th... | 2011/04/21 | ['https://Stackoverflow.com/questions/5738073', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/221061/'] | I don't believe the compiler will *guess the wrong type.* However, it might *infer a type you didn't intend*, but that's not the same.
Consider the perfectly legal
```
decimal foo = 10;
decimal bar = 4;
decimal baz = foo / bar;
```
In the code, `baz` will very clearly be 2.5. The integer literals will be conver... | It won't cause any "issues", regarding code however you could have a regression issue...
```
IObject1
{
void DoSomething();
}
IObject2
{
void DoSomething();
}
var result = SomeMethod();
result.DoSomething();
```
Now, if SomeMethod returned IObject1 and then was changed to return IObject2 this would still c... |
5,738,073 | I know from [this question](https://stackoverflow.com/questions/356846/c-var-vs-specific-type-performance) that `var i = 1` and `int i = 1` are exactly the same in IL. The compiler simply replaces `var` with the actual type at compile time. But, are there any instances where `var` could cause problem behavior (maybe th... | 2011/04/21 | ['https://Stackoverflow.com/questions/5738073', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/221061/'] | It won't cause any "issues", regarding code however you could have a regression issue...
```
IObject1
{
void DoSomething();
}
IObject2
{
void DoSomething();
}
var result = SomeMethod();
result.DoSomething();
```
Now, if SomeMethod returned IObject1 and then was changed to return IObject2 this would still c... | ```
var x = 0
x = 0.10
```
`Cannot convert source type 'double' to target type 'int'`
An example:
```
double x = 0; //to initialize it
switch (something) {
case condition1:
x = 0.1;
break;
case condition2:
x = 0.2;
break;
}
```
Using `var` instead of `double` will give a co... |
5,738,073 | I know from [this question](https://stackoverflow.com/questions/356846/c-var-vs-specific-type-performance) that `var i = 1` and `int i = 1` are exactly the same in IL. The compiler simply replaces `var` with the actual type at compile time. But, are there any instances where `var` could cause problem behavior (maybe th... | 2011/04/21 | ['https://Stackoverflow.com/questions/5738073', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/221061/'] | I don't believe the compiler will *guess the wrong type.* However, it might *infer a type you didn't intend*, but that's not the same.
Consider the perfectly legal
```
decimal foo = 10;
decimal bar = 4;
decimal baz = foo / bar;
```
In the code, `baz` will very clearly be 2.5. The integer literals will be conver... | In addition to the ambiguous:
```
var x = null;
```
the compiler will also not infer the type of overloaded method groups:
```
var m = String.Equals;
```
nor will it infer the type of lambda expressions, which can be either `Func<>` or `Expression<Func<>>`:
```
var l = (int x) => x + 1;
```
All that said, Anth... |
5,738,073 | I know from [this question](https://stackoverflow.com/questions/356846/c-var-vs-specific-type-performance) that `var i = 1` and `int i = 1` are exactly the same in IL. The compiler simply replaces `var` with the actual type at compile time. But, are there any instances where `var` could cause problem behavior (maybe th... | 2011/04/21 | ['https://Stackoverflow.com/questions/5738073', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/221061/'] | In addition to the ambiguous:
```
var x = null;
```
the compiler will also not infer the type of overloaded method groups:
```
var m = String.Equals;
```
nor will it infer the type of lambda expressions, which can be either `Func<>` or `Expression<Func<>>`:
```
var l = (int x) => x + 1;
```
All that said, Anth... | ```
var x = 0
x = 0.10
```
`Cannot convert source type 'double' to target type 'int'`
An example:
```
double x = 0; //to initialize it
switch (something) {
case condition1:
x = 0.1;
break;
case condition2:
x = 0.2;
break;
}
```
Using `var` instead of `double` will give a co... |
5,738,073 | I know from [this question](https://stackoverflow.com/questions/356846/c-var-vs-specific-type-performance) that `var i = 1` and `int i = 1` are exactly the same in IL. The compiler simply replaces `var` with the actual type at compile time. But, are there any instances where `var` could cause problem behavior (maybe th... | 2011/04/21 | ['https://Stackoverflow.com/questions/5738073', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/221061/'] | I don't believe the compiler will *guess the wrong type.* However, it might *infer a type you didn't intend*, but that's not the same.
Consider the perfectly legal
```
decimal foo = 10;
decimal bar = 4;
decimal baz = foo / bar;
```
In the code, `baz` will very clearly be 2.5. The integer literals will be conver... | ```
var x = 0
x = 0.10
```
`Cannot convert source type 'double' to target type 'int'`
An example:
```
double x = 0; //to initialize it
switch (something) {
case condition1:
x = 0.1;
break;
case condition2:
x = 0.2;
break;
}
```
Using `var` instead of `double` will give a co... |
4,138 | I'd like to know whether the messages delivered to the ethereum network by my wallet are encrypted such that any identifying information about the wallet is inaccessible to the ISP?
in other words, can ownership of the wallet be traced to me via knowledge of the IP address I'm using at the time of the communication?
... | 2016/05/21 | ['https://ethereum.stackexchange.com/questions/4138', 'https://ethereum.stackexchange.com', 'https://ethereum.stackexchange.com/users/2164/'] | ### No, they cannot trace your IP from the data stored in ethereum network.
Your wallet, if it is Mist, it is actually writing the transaction data to your wn private Ethereum node and then only publishes to the live ethereum network.
So, it is traceable back to you if and only if they are logging all the requests o... | The network is public, messages across it aren't encrypted and your ISP can see the transactions you're sending.
Edit: I'm wrong, see @dbryson's comment. |
4,138 | I'd like to know whether the messages delivered to the ethereum network by my wallet are encrypted such that any identifying information about the wallet is inaccessible to the ISP?
in other words, can ownership of the wallet be traced to me via knowledge of the IP address I'm using at the time of the communication?
... | 2016/05/21 | ['https://ethereum.stackexchange.com/questions/4138', 'https://ethereum.stackexchange.com', 'https://ethereum.stackexchange.com/users/2164/'] | ### No, they cannot trace your IP from the data stored in ethereum network.
Your wallet, if it is Mist, it is actually writing the transaction data to your wn private Ethereum node and then only publishes to the live ethereum network.
So, it is traceable back to you if and only if they are logging all the requests o... | You mention your ISP. If you use a VPN, Tor or I2P you ISP may be able to see that but they cannot see what you are doing on those private networks.
Encryption of your message and the metadata you ask about (ip address, etc) are two separate issues. |
71,493,412 | I have elasticsearch and Kibana are up and running and I want to read logs using logstash so for that I have passed csv file as an input in logstash.conf file but its not reading logs and shutting down automatically.
This is how I am running logstash command:
```
D:\logstash-8.1.0\bin>logstash -f "D:/logstash.conf"
... | 2022/03/16 | ['https://Stackoverflow.com/questions/71493412', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7780102/'] | It's actually very simple. Since you use `&&` as an operator, gcc can deduce that the condition always yields false.
If you use the bitwise and operator (`&`), gcc adds code for the if:
```
#include <stdio.h>
unsigned char c = 0xff;
int n = 1;
int main(){
if ((c & 0xc0) == 0xc0 ) {
n=0;
}
printf... | In C `&&` casts operands to `bool` which even though its an `int`, it is changed to 1 meaning true, if nonzero.
`&` is a bitwise and, which returns the bits that are the same. If you combine this with `&&` it returns true if there are any bits left.
If you compile with `-Wall` you will get a warning when something ge... |
33,264,891 | I'm a new baby in Dapper. Trying to incorporate CRUD operations with Dapper and Dapper.SimpleCRUD lib. Here is the sample code...
My Data Model Looks like
```
Class Product
{
public string prodId {get;set;}
public string prodName {get;set;}
public string Location {get;set;}
}
```
Dapper Implementation - Ins... | 2015/10/21 | ['https://Stackoverflow.com/questions/33264891', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2066540/'] | This is happening since you are using a Dapper Extension, which has implemented the `Insert` CRUD extension method. Ideally this can be achieved using simple
`con.Execute` in the Dapper, but since you want to pass an object and create an insert query automatically by the extension, you need to help it understand, whic... | Connecting to SQL Server 2016, I had this error with both Dapper.Contrib & Dapper.SimpleCRUD when I forgot to attach the Primary Key to the Id column of the table.
Primary Key added to the table, project rebuilt & published to clear cache and all is good with both [Key] & [ExplicitKey] ( the latter in DapperContrib). |
321,083 | I've got [DavMail](http://davmail.sourceforge.net/) running in Linux Mint so Thunderbird can access IMAP/SMTP/LDAP/CalDav. I've got everything working at this point except LDAP. Basically I can't figure out what the base DN should be. Where on my Windows XP box can I find this? I've tried a few things, and the address ... | 2011/08/09 | ['https://superuser.com/questions/321083', 'https://superuser.com', 'https://superuser.com/users/75269/'] | The "Base DN" when adding a new LDAP directory in Thunderbird should be `ou=people` as specified on [this page](http://davmail.sourceforge.net/thunderbirddirectorysetup.html) [davmail.sourceforge.net].
Contrary to what the screenshot in those instructions shows (in French, no less), your "Bind DN" should might actuall... | The `base object` for searches is something that your directory server administrator tells you. It might be possible to discover the `namingContext` of the directory server if you know the hostname and port upon which the server listens by querying the root DSE. See *[The root DSE](http://bit.ly/osZXFG)* for more infor... |
9,389,381 | In order to demonstrate the security feature of Oracle one has to call **OCIServerVersion()** or **OCIServerRelease()** when the user session has not yet been established.
While having the database parameter `sec_return_server_release_banner = false`.
I am using Python cx\_Oracle module for this, but I am not sure how... | 2012/02/22 | ['https://Stackoverflow.com/questions/9389381', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1224977/'] | If you want the snapshot, make sure you have the repository tags for it as well, for wherever you are getting that build from. Otherwise use the latest release, `3.0.0-beta3`.
If you are building your own local copies, or deploying to an internal repo, then 3.0.0-SNAPSHOT should work - make sure the jar can be found i... | GXT 3.0.1 is on maven central
```
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>3.0.1</version>
</dependency>
``` |
9,389,381 | In order to demonstrate the security feature of Oracle one has to call **OCIServerVersion()** or **OCIServerRelease()** when the user session has not yet been established.
While having the database parameter `sec_return_server_release_banner = false`.
I am using Python cx\_Oracle module for this, but I am not sure how... | 2012/02/22 | ['https://Stackoverflow.com/questions/9389381', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1224977/'] | If you want the snapshot, make sure you have the repository tags for it as well, for wherever you are getting that build from. Otherwise use the latest release, `3.0.0-beta3`.
If you are building your own local copies, or deploying to an internal repo, then 3.0.0-SNAPSHOT should work - make sure the jar can be found i... | Use these dependencies:
```
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupI... |
9,389,381 | In order to demonstrate the security feature of Oracle one has to call **OCIServerVersion()** or **OCIServerRelease()** when the user session has not yet been established.
While having the database parameter `sec_return_server_release_banner = false`.
I am using Python cx\_Oracle module for this, but I am not sure how... | 2012/02/22 | ['https://Stackoverflow.com/questions/9389381', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1224977/'] | Use these dependencies:
```
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupI... | GXT 3.0.1 is on maven central
```
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>3.0.1</version>
</dependency>
``` |
40,585,550 | i want a make a feed reader...i want load politics news from multiple data dource in one tableview synchronously.
what do i do?
i went to this link: [table view with multiple data sources/nibs](https://stackoverflow.com/questions/35960403/ios-swift-table-view-with-multiple-data-sources-nibs)
but this solution is not s... | 2016/11/14 | ['https://Stackoverflow.com/questions/40585550', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6856597/'] | you are sorting from the older to the newer date which is ok,
if you need upside down then do invert the comparation criteria by doing:
```
return date2.compareTo(date1);
```
another way to go is inverte the sorted list...
1st sort then do `Collections.reverse();`
Edit:
=====
I try your code and the reason is the... | In java 8 you can write it in this way..
Please note that I have used apache CompareToBuilder.
```
Collections.sort(opportunities,
Collections.reverseOrder((item1, item2) -> new CompareToBuilder()
.append(item1.getExpires(), item2.getExpires()).toComparison()));
``` |
40,585,550 | i want a make a feed reader...i want load politics news from multiple data dource in one tableview synchronously.
what do i do?
i went to this link: [table view with multiple data sources/nibs](https://stackoverflow.com/questions/35960403/ios-swift-table-view-with-multiple-data-sources-nibs)
but this solution is not s... | 2016/11/14 | ['https://Stackoverflow.com/questions/40585550', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6856597/'] | Because format "YYYY" in your `DateFormat`
Change `MM/DD/YYYY` to `MM/DD/yyyy` will work | you are sorting from the older to the newer date which is ok,
if you need upside down then do invert the comparation criteria by doing:
```
return date2.compareTo(date1);
```
another way to go is inverte the sorted list...
1st sort then do `Collections.reverse();`
Edit:
=====
I try your code and the reason is the... |
40,585,550 | i want a make a feed reader...i want load politics news from multiple data dource in one tableview synchronously.
what do i do?
i went to this link: [table view with multiple data sources/nibs](https://stackoverflow.com/questions/35960403/ios-swift-table-view-with-multiple-data-sources-nibs)
but this solution is not s... | 2016/11/14 | ['https://Stackoverflow.com/questions/40585550', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6856597/'] | Because format "YYYY" in your `DateFormat`
Change `MM/DD/YYYY` to `MM/DD/yyyy` will work | In java 8 you can write it in this way..
Please note that I have used apache CompareToBuilder.
```
Collections.sort(opportunities,
Collections.reverseOrder((item1, item2) -> new CompareToBuilder()
.append(item1.getExpires(), item2.getExpires()).toComparison()));
``` |
61,689,419 | I am trying to find the max and min of a line of text from a data file. Though there is plenty of lines of text in this data file.
**DATA**
```
-99 1 2 3 4 5 6 7 8 9 10 12345
10 9 8 7 6 5 4 3 2 1 -99
10 20 30 40 50 -11818 40 30 20 10
32767
255 255
9 10 -88 100 -555 1000
10 10 10 11 456
-111 1 2 3 9 11 20 30
9 8 7 6 ... | 2020/05/08 | ['https://Stackoverflow.com/questions/61689419', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11991346/'] | You can compare using int
```
public static String getMax(String[] inputArray) {
int maxValue = Integer.MIN_VALUE;
for(int i = 0; i < inputArray.length; i++) {
if(maxValue < Integer.parseInt(inputArray[i])){
maxValue = Integer.parseInt(inputArray[i]);
}
... | You should use: Integer.pharseToInt()
Then when you'll have an array of integers and you can find the max value easily:
```
int getMax(int [] array){
int max = INTEGER.MIN_VALUE;
for (int i=0: i<array.length; i++)
if (array[i]>max)
max = array[i];
return max;
}
```
Totally symetric functi... |
61,689,419 | I am trying to find the max and min of a line of text from a data file. Though there is plenty of lines of text in this data file.
**DATA**
```
-99 1 2 3 4 5 6 7 8 9 10 12345
10 9 8 7 6 5 4 3 2 1 -99
10 20 30 40 50 -11818 40 30 20 10
32767
255 255
9 10 -88 100 -555 1000
10 10 10 11 456
-111 1 2 3 9 11 20 30
9 8 7 6 ... | 2020/05/08 | ['https://Stackoverflow.com/questions/61689419', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11991346/'] | Compact solution with comments and explanations:
```
public static void main(String[] args) {
// Create an input stream
try (Stream<String> stream = Files.lines(Paths.get("average.dat"))) {
// Get each line from the stream
stream.forEach(line -> {
// Cut the line into peaces
... | You should use: Integer.pharseToInt()
Then when you'll have an array of integers and you can find the max value easily:
```
int getMax(int [] array){
int max = INTEGER.MIN_VALUE;
for (int i=0: i<array.length; i++)
if (array[i]>max)
max = array[i];
return max;
}
```
Totally symetric functi... |
61,689,419 | I am trying to find the max and min of a line of text from a data file. Though there is plenty of lines of text in this data file.
**DATA**
```
-99 1 2 3 4 5 6 7 8 9 10 12345
10 9 8 7 6 5 4 3 2 1 -99
10 20 30 40 50 -11818 40 30 20 10
32767
255 255
9 10 -88 100 -555 1000
10 10 10 11 456
-111 1 2 3 9 11 20 30
9 8 7 6 ... | 2020/05/08 | ['https://Stackoverflow.com/questions/61689419', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11991346/'] | Actually, you don't need to compute the max and min separately. Consider the following:
* set the max and min to the first value.
* Check to see if the value is a `max`, if so, assign it to `max`.
* other wise, just compare to min and assign as appropriate.
```
while (file.hasNextLine()) {
// Storing the ints fro... | You should use: Integer.pharseToInt()
Then when you'll have an array of integers and you can find the max value easily:
```
int getMax(int [] array){
int max = INTEGER.MIN_VALUE;
for (int i=0: i<array.length; i++)
if (array[i]>max)
max = array[i];
return max;
}
```
Totally symetric functi... |
14,576 | for typesetting tables with design of experiments, I have to typeset strings like "+ - + +", - - - +", etc. in a column of a table to represent the so called pattern of the experimental run (sometimes they also contain "a", "A" and "0" (zero)).
However, the width of the "+" and "-" sign are very different in the used ... | 2011/03/30 | ['https://tex.stackexchange.com/questions/14576', 'https://tex.stackexchange.com', 'https://tex.stackexchange.com/users/4009/'] | Make sure you typeset them it **math-mode**, i.e. `$-$` and `$+$`.
Be aware that it makes a difference if you use a single math-mode or separate ones for them. The last sign has different spacing in the first case because it
is taken as an unary sign but the others are operators.
Compare the following:
```
\documen... | one possible form to typeset your table would be to use a table column for each character:
```
\documentclass[11pt, a4paper]{scrreprt}
\usepackage{booktabs}
\newcommand\Pl{${}+{}$}
\newcommand\Mi{${}-{}$}
\begin{document}
\begin{tabular}{cc@{\hspace{-2pt}}c@{\hspace{-2pt}}c}
\toprule
1 & \Pl & \Pl & \Mi \\
4 ... |
14,576 | for typesetting tables with design of experiments, I have to typeset strings like "+ - + +", - - - +", etc. in a column of a table to represent the so called pattern of the experimental run (sometimes they also contain "a", "A" and "0" (zero)).
However, the width of the "+" and "-" sign are very different in the used ... | 2011/03/30 | ['https://tex.stackexchange.com/questions/14576', 'https://tex.stackexchange.com', 'https://tex.stackexchange.com/users/4009/'] | An easy way to achieve this would be to typeset the plusses and minuses in a monospace font with `\verb|+-+-|`
There are however [issues](https://tex.stackexchange.com/q/203/215) with verbatim text which you might run into...
Another solution might be to use `\texttt` and macros for your plusses etc. Here's an exampl... | A quick and dirty solution might be to enclose the symbols in braces: `${-}{+}{+}{+}$` looks better than `$-+++$`, as LaTeX won't try to interpret each `+` or `-` as a binary operator. |
14,576 | for typesetting tables with design of experiments, I have to typeset strings like "+ - + +", - - - +", etc. in a column of a table to represent the so called pattern of the experimental run (sometimes they also contain "a", "A" and "0" (zero)).
However, the width of the "+" and "-" sign are very different in the used ... | 2011/03/30 | ['https://tex.stackexchange.com/questions/14576', 'https://tex.stackexchange.com', 'https://tex.stackexchange.com/users/4009/'] | Make sure you typeset them it **math-mode**, i.e. `$-$` and `$+$`.
Be aware that it makes a difference if you use a single math-mode or separate ones for them. The last sign has different spacing in the first case because it
is taken as an unary sign but the others are operators.
Compare the following:
```
\documen... | An easy way to achieve this would be to typeset the plusses and minuses in a monospace font with `\verb|+-+-|`
There are however [issues](https://tex.stackexchange.com/q/203/215) with verbatim text which you might run into...
Another solution might be to use `\texttt` and macros for your plusses etc. Here's an exampl... |
14,576 | for typesetting tables with design of experiments, I have to typeset strings like "+ - + +", - - - +", etc. in a column of a table to represent the so called pattern of the experimental run (sometimes they also contain "a", "A" and "0" (zero)).
However, the width of the "+" and "-" sign are very different in the used ... | 2011/03/30 | ['https://tex.stackexchange.com/questions/14576', 'https://tex.stackexchange.com', 'https://tex.stackexchange.com/users/4009/'] | ```
\documentclass{minimal}
\begin{document}
\setlength{\parindent}{0pt}
\newlength{\stretchlen}\setlength{\stretchlen}{1em}
\def\splitterm{\_}
\newcommand{\stretchit}[1]{\leavevmode\realstretch#1\_}
\def\realstretch#1{%
\def\temp{#1}%
\ifx\temp\splitterm
\else
\hbox to \stretchlen{\hss#1\hss}\expandaft... | Make sure you typeset them it **math-mode**, i.e. `$-$` and `$+$`.
Be aware that it makes a difference if you use a single math-mode or separate ones for them. The last sign has different spacing in the first case because it
is taken as an unary sign but the others are operators.
Compare the following:
```
\documen... |
14,576 | for typesetting tables with design of experiments, I have to typeset strings like "+ - + +", - - - +", etc. in a column of a table to represent the so called pattern of the experimental run (sometimes they also contain "a", "A" and "0" (zero)).
However, the width of the "+" and "-" sign are very different in the used ... | 2011/03/30 | ['https://tex.stackexchange.com/questions/14576', 'https://tex.stackexchange.com', 'https://tex.stackexchange.com/users/4009/'] | ```
\documentclass{minimal}
\begin{document}
\setlength{\parindent}{0pt}
\newlength{\stretchlen}\setlength{\stretchlen}{1em}
\def\splitterm{\_}
\newcommand{\stretchit}[1]{\leavevmode\realstretch#1\_}
\def\realstretch#1{%
\def\temp{#1}%
\ifx\temp\splitterm
\else
\hbox to \stretchlen{\hss#1\hss}\expandaft... | one possible form to typeset your table would be to use a table column for each character:
```
\documentclass[11pt, a4paper]{scrreprt}
\usepackage{booktabs}
\newcommand\Pl{${}+{}$}
\newcommand\Mi{${}-{}$}
\begin{document}
\begin{tabular}{cc@{\hspace{-2pt}}c@{\hspace{-2pt}}c}
\toprule
1 & \Pl & \Pl & \Mi \\
4 ... |
14,576 | for typesetting tables with design of experiments, I have to typeset strings like "+ - + +", - - - +", etc. in a column of a table to represent the so called pattern of the experimental run (sometimes they also contain "a", "A" and "0" (zero)).
However, the width of the "+" and "-" sign are very different in the used ... | 2011/03/30 | ['https://tex.stackexchange.com/questions/14576', 'https://tex.stackexchange.com', 'https://tex.stackexchange.com/users/4009/'] | Make sure you typeset them it **math-mode**, i.e. `$-$` and `$+$`.
Be aware that it makes a difference if you use a single math-mode or separate ones for them. The last sign has different spacing in the first case because it
is taken as an unary sign but the others are operators.
Compare the following:
```
\documen... | Michel's solution is nice, but I'd like to present some improvements.
```
\newlength{\stretchlen}
\settowidth{\stretchlen}{+}
\newcommand{\stretchit}[1]{\realstretch#1\_}
\newcommand\realstretch[1]{%
\ifx#1\_%
\else
\makebox[\stretchlen]{\ifx#1-$-$\else#1\fi}%
%\hbox to \stretchlen{\hss\ifx#1-$-$\else#1\fi... |
14,576 | for typesetting tables with design of experiments, I have to typeset strings like "+ - + +", - - - +", etc. in a column of a table to represent the so called pattern of the experimental run (sometimes they also contain "a", "A" and "0" (zero)).
However, the width of the "+" and "-" sign are very different in the used ... | 2011/03/30 | ['https://tex.stackexchange.com/questions/14576', 'https://tex.stackexchange.com', 'https://tex.stackexchange.com/users/4009/'] | one possible form to typeset your table would be to use a table column for each character:
```
\documentclass[11pt, a4paper]{scrreprt}
\usepackage{booktabs}
\newcommand\Pl{${}+{}$}
\newcommand\Mi{${}-{}$}
\begin{document}
\begin{tabular}{cc@{\hspace{-2pt}}c@{\hspace{-2pt}}c}
\toprule
1 & \Pl & \Pl & \Mi \\
4 ... | A quick and dirty solution might be to enclose the symbols in braces: `${-}{+}{+}{+}$` looks better than `$-+++$`, as LaTeX won't try to interpret each `+` or `-` as a binary operator. |
14,576 | for typesetting tables with design of experiments, I have to typeset strings like "+ - + +", - - - +", etc. in a column of a table to represent the so called pattern of the experimental run (sometimes they also contain "a", "A" and "0" (zero)).
However, the width of the "+" and "-" sign are very different in the used ... | 2011/03/30 | ['https://tex.stackexchange.com/questions/14576', 'https://tex.stackexchange.com', 'https://tex.stackexchange.com/users/4009/'] | ```
\documentclass{minimal}
\begin{document}
\setlength{\parindent}{0pt}
\newlength{\stretchlen}\setlength{\stretchlen}{1em}
\def\splitterm{\_}
\newcommand{\stretchit}[1]{\leavevmode\realstretch#1\_}
\def\realstretch#1{%
\def\temp{#1}%
\ifx\temp\splitterm
\else
\hbox to \stretchlen{\hss#1\hss}\expandaft... | A quick and dirty solution might be to enclose the symbols in braces: `${-}{+}{+}{+}$` looks better than `$-+++$`, as LaTeX won't try to interpret each `+` or `-` as a binary operator. |
14,576 | for typesetting tables with design of experiments, I have to typeset strings like "+ - + +", - - - +", etc. in a column of a table to represent the so called pattern of the experimental run (sometimes they also contain "a", "A" and "0" (zero)).
However, the width of the "+" and "-" sign are very different in the used ... | 2011/03/30 | ['https://tex.stackexchange.com/questions/14576', 'https://tex.stackexchange.com', 'https://tex.stackexchange.com/users/4009/'] | ```
\documentclass{minimal}
\begin{document}
\setlength{\parindent}{0pt}
\newlength{\stretchlen}\setlength{\stretchlen}{1em}
\def\splitterm{\_}
\newcommand{\stretchit}[1]{\leavevmode\realstretch#1\_}
\def\realstretch#1{%
\def\temp{#1}%
\ifx\temp\splitterm
\else
\hbox to \stretchlen{\hss#1\hss}\expandaft... | An easy way to achieve this would be to typeset the plusses and minuses in a monospace font with `\verb|+-+-|`
There are however [issues](https://tex.stackexchange.com/q/203/215) with verbatim text which you might run into...
Another solution might be to use `\texttt` and macros for your plusses etc. Here's an exampl... |
14,576 | for typesetting tables with design of experiments, I have to typeset strings like "+ - + +", - - - +", etc. in a column of a table to represent the so called pattern of the experimental run (sometimes they also contain "a", "A" and "0" (zero)).
However, the width of the "+" and "-" sign are very different in the used ... | 2011/03/30 | ['https://tex.stackexchange.com/questions/14576', 'https://tex.stackexchange.com', 'https://tex.stackexchange.com/users/4009/'] | Make sure you typeset them it **math-mode**, i.e. `$-$` and `$+$`.
Be aware that it makes a difference if you use a single math-mode or separate ones for them. The last sign has different spacing in the first case because it
is taken as an unary sign but the others are operators.
Compare the following:
```
\documen... | A quick and dirty solution might be to enclose the symbols in braces: `${-}{+}{+}{+}$` looks better than `$-+++$`, as LaTeX won't try to interpret each `+` or `-` as a binary operator. |
6,628,452 | I want Django to send an email to user email-address with Login details once admin adds a new user to admin site.So I tried using Django signals for that but just becoz django user registration is a two step process signals get notified in first step only and called email function without email address(which comes in s... | 2011/07/08 | ['https://Stackoverflow.com/questions/6628452', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/632467/'] | If you look in django.contrib.auth admin.py, you'll see that the UserAdmin class specifies the add\_form as UserCreationForm.
UserCreationForm only includes the 'username' field from the User model.
Since you're providing your own UserAdmin, you can just override the add\_form to a custom UserCreationForm that includ... | From [this example](http://jessenoller.com/blog/2011/12/19/quick-example-of-extending-usercreationform-in-django) try defining email in your custom UserCreationForm as required=True:
```
class MyUserCreationForm(UserCreationForm):
email = forms.EmailField(required=True)
class Meta:
model = User
... |
224,643 | It says:
>
> Please list up to three projects (in order of preference) you are
> interested in.
>
>
>
So I am not sure: Do I have to put in exactly three projects or can I also just put in two? | 2015/01/30 | ['https://english.stackexchange.com/questions/224643', 'https://english.stackexchange.com', 'https://english.stackexchange.com/users/108012/'] | You can put in three or fewer projects, since up to is a limiting factor, but does not require a minimum, so by this grammar, two projects would be an acceptable response. | Yes. You can put two.
You can put one, two, or three. |
62,993,565 | I'm using `logging.config.dictconfig()` and my formatter is:
```
'formatters': {
'logfileFormat': {
'format': '%(asctime)s %(name)-12s: %(levelname)s %(message)s'
}
}
```
When there's an exception, I would like the formatter to show the error message, a... | 2020/07/20 | ['https://Stackoverflow.com/questions/62993565', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1724926/'] | For me working nice if assign back output, but very similar method [`DataFrame.update`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.update.html) working inplace:
```
df = df1.combine_first(df2)
print (df)
Gen1 Gen2
0 5.0 1.0
1 4.0 2.0
2 3.0 3.0
3 2.0 4.0
4 1.0 5.0... | `combine_first` returns a dataframe which has the change and not updating the existing dataframe so you should get the return dataframe
```
df1=df1.combine_first(df2)
``` |
66,027,931 | I have table like:
```
name | timeStamp | previousValue | newValue
--------+---------------+-------------------+------------
Mark | 13.12.2020 | 123 | 155
Mark | 12.12.2020 | 123 | 12
Tom | 14.12.2020 | 123 | 534
Mark ... | 2021/02/03 | ['https://Stackoverflow.com/questions/66027931', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/15133478/'] | `LAST_VALUE` is a windowed function, so you'll need to get that value first, and then aggregate:
```sql
WITH CTE AS(
SELECT [name],
[timeStamp], --This is a poor choice for a column's name. timestamp is a (deprecated) synonym of rowversion, and a rowversion is not a date and time value
previo... | I got a solution that works, but here's another one:
```
SELECT
[name], COUNT([name]), [lastValue]
FROM (
SELECT
[name], FIRST_VALUE([newValue]) OVER (PARTITION BY [name] ORDER BY TimeStamp DESC ROWS UNBOUNDED PRECEDING) AS [lastValue]
FROM [table]
) xyz GROUP BY [name], [lastValue]
```
Ke... |
73,659,886 | I have a JSON file with a category structure of unknown depth. I want to make sure all pages can be accessed. I established three nested calls, but I think it would be better to recursion here. Unfortunately, I have no experience with Typescript regarding recursion. Can someone be so kind as to help me put the logic in... | 2022/09/09 | ['https://Stackoverflow.com/questions/73659886', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/558120/'] | Can I suggest that you use an f-string if you're on a version of python that supports them.
```
sqlcuery=f"insert into position ('position'), values('{position}')"
``` | Try this:
```
"insert into position ('position'), values('"+str(position)+"')"
```
To transform the integer or float to a string.
You can do this more elegantly with a f-string:
```
f"insert into position ('position'), values('{position}')"
``` |
73,659,886 | I have a JSON file with a category structure of unknown depth. I want to make sure all pages can be accessed. I established three nested calls, but I think it would be better to recursion here. Unfortunately, I have no experience with Typescript regarding recursion. Can someone be so kind as to help me put the logic in... | 2022/09/09 | ['https://Stackoverflow.com/questions/73659886', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/558120/'] | Personally, I'd recommend using an f-string. These allow you to input variables of any type within your code without too much issue. Wrap your variables in {}, like I've shown below.
```
sqlcuery=f"insert into position {position}"
``` | Try this:
```
"insert into position ('position'), values('"+str(position)+"')"
```
To transform the integer or float to a string.
You can do this more elegantly with a f-string:
```
f"insert into position ('position'), values('{position}')"
``` |
73,659,886 | I have a JSON file with a category structure of unknown depth. I want to make sure all pages can be accessed. I established three nested calls, but I think it would be better to recursion here. Unfortunately, I have no experience with Typescript regarding recursion. Can someone be so kind as to help me put the logic in... | 2022/09/09 | ['https://Stackoverflow.com/questions/73659886', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/558120/'] | Personally, I'd recommend using an f-string. These allow you to input variables of any type within your code without too much issue. Wrap your variables in {}, like I've shown below.
```
sqlcuery=f"insert into position {position}"
``` | Can I suggest that you use an f-string if you're on a version of python that supports them.
```
sqlcuery=f"insert into position ('position'), values('{position}')"
``` |
43,310,947 | I'm trying to replace all full stops in an email with an x character - for example "my.email@email.com" would become "myxemail@emailxcom". Email is set to a string.
My problem is it's not replacing just full stops, it's replacing every character, so I just get a string of x's.
I can get it working with just one f... | 2017/04/09 | ['https://Stackoverflow.com/questions/43310947', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7232648/'] | Your second example is the closest. The first problem is your variable name, **`new`**, which happens to be one of JavaScript's [reserved keywords](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords) (and is instead used to construct objects, like `new RegExp` or `new Set`). This... | You can try `split()` and `join()` method that was work for me. (For normal string text)
It was short and simple to implement and understand.
Below is an example.
```
let email = "my.email@email.com";
email.split('.').join('x');
```
So, it will replace all your `.` with `x`. So, after the above example, `email` vari... |
43,310,947 | I'm trying to replace all full stops in an email with an x character - for example "my.email@email.com" would become "myxemail@emailxcom". Email is set to a string.
My problem is it's not replacing just full stops, it's replacing every character, so I just get a string of x's.
I can get it working with just one f... | 2017/04/09 | ['https://Stackoverflow.com/questions/43310947', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7232648/'] | Your second example is the closest. The first problem is your variable name, **`new`**, which happens to be one of JavaScript's [reserved keywords](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords) (and is instead used to construct objects, like `new RegExp` or `new Set`). This... | You may just use `replaceAll()` String function, described here:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll>
If you are getting
**Property 'replaceAll' does not exist on type 'string'**
error - go to `tsconfig.json` and within "lib" change or add "es2021".
Like... |
43,310,947 | I'm trying to replace all full stops in an email with an x character - for example "my.email@email.com" would become "myxemail@emailxcom". Email is set to a string.
My problem is it's not replacing just full stops, it's replacing every character, so I just get a string of x's.
I can get it working with just one f... | 2017/04/09 | ['https://Stackoverflow.com/questions/43310947', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7232648/'] | You can try `split()` and `join()` method that was work for me. (For normal string text)
It was short and simple to implement and understand.
Below is an example.
```
let email = "my.email@email.com";
email.split('.').join('x');
```
So, it will replace all your `.` with `x`. So, after the above example, `email` vari... | You may just use `replaceAll()` String function, described here:
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll>
If you are getting
**Property 'replaceAll' does not exist on type 'string'**
error - go to `tsconfig.json` and within "lib" change or add "es2021".
Like... |
38,740,587 | How do I make sure that a file is not branchable across different projects in UCM ?
It should always be picked from `/main/LATEST/` for all the parallel projects | 2016/08/03 | ['https://Stackoverflow.com/questions/38740587', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3119109/'] | Did you read the JavaDocs on `isDirectory()` etc.? For `isDirectory()` it says:
>
> returns true if and only if the file denoted by this abstract pathname exists and is a directory; false otherwise
>
>
>
So if the directory doesn't exist you get false and don't create one. Then you continue trying to write and c... | ```
private boolean createFile(File file) {
if(!file.exists()) {
if(file.getParentFile().exists()) {
// ...
} else { // In this case, neither file nor its parent exist
if(this.createDirectory(file)) {
this.createFile(file); // HERE, you're calling the same met... |
38,740,587 | How do I make sure that a file is not branchable across different projects in UCM ?
It should always be picked from `/main/LATEST/` for all the parallel projects | 2016/08/03 | ['https://Stackoverflow.com/questions/38740587', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3119109/'] | Did you read the JavaDocs on `isDirectory()` etc.? For `isDirectory()` it says:
>
> returns true if and only if the file denoted by this abstract pathname exists and is a directory; false otherwise
>
>
>
So if the directory doesn't exist you get false and don't create one. Then you continue trying to write and c... | Your `createFileMain` only creates files which already exist.
You don't need to create a file to write to it, all you need is the directory you want to write it into.
```
public void writeInFile(String path, List<String> content) {
File file = new File(path);
File parent = file.getParentFile();
if (paren... |
38,740,587 | How do I make sure that a file is not branchable across different projects in UCM ?
It should always be picked from `/main/LATEST/` for all the parallel projects | 2016/08/03 | ['https://Stackoverflow.com/questions/38740587', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3119109/'] | Your `createFileMain` only creates files which already exist.
You don't need to create a file to write to it, all you need is the directory you want to write it into.
```
public void writeInFile(String path, List<String> content) {
File file = new File(path);
File parent = file.getParentFile();
if (paren... | ```
private boolean createFile(File file) {
if(!file.exists()) {
if(file.getParentFile().exists()) {
// ...
} else { // In this case, neither file nor its parent exist
if(this.createDirectory(file)) {
this.createFile(file); // HERE, you're calling the same met... |
384,030 | So we have realtime events and they are great but the issue we are having is very often we don't need the full "hosepipe" of events only events related to a specific record or user where based on some method they are marked as high risk. Is there any way to filter these events before they are sent to us as 99% of all o... | 2022/08/27 | ['https://salesforce.stackexchange.com/questions/384030', 'https://salesforce.stackexchange.com', 'https://salesforce.stackexchange.com/users/94095/'] | With winter 23 one can easily filter platform event by defining a filter expression via the metadata or the tooling API!
Check out the details [here](https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_filters.htm)
Read more about the General Availability of the [fea... | You can use [PushTopic](https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/pushtopic_events_intro.htm) to listen for specific updates, assuming you can define those updates in a SOQL statement. Each client can create a PushTopic to listen for specific events, then cancel them when they s... |
35,455,315 | I have a problem outputting the date which is created within my `PHP` file.
I've been following a tutorial on how to make a really Basic-CMS Platform to help me understand some of the basics for `databases` and `PHP`, everything has been going well up until I was trying to output the date of when the page was created.... | 2016/02/17 | ['https://Stackoverflow.com/questions/35455315', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5006451/'] | This is because no timezone has set in php configuration.
Add the following line of code to top of your php.ini file
```
date.timezone = "US/Central"
```
And restart web server
**OR**
you can set it via php script also by using following function:
```
date_default_timezone_set('America/Los_Angeles');
```
Dont ... | **If you're using a database to hold the page details when its created:**
You can actually just add a DateTime Column in your database and then when the page is created and you Insert whatever you need to add, make the Column a default TimeStamp and it should automatically add the time and date the page was created fo... |
55,641,172 | I'm having some trouble getting the correct output when printing an array. Essentially what I'm trying to do is set up an array in the main method, then send that array to another method that would print out something like this:
```
89 12 33 7 72 42 76 49
69 85 61 23
```
With it being 3 spa... | 2019/04/11 | ['https://Stackoverflow.com/questions/55641172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11167410/'] | If you insist on using loops, take @Dason's comment and do the following:
```
for(i in 1:length(Letters)) {
for(j in 1:length(Letters)) {
Combined <- paste0(Letters[i], ' vs ', Letters[j])
print(Combined)
}
}
``` | We can either use `expand.grid` or `CJ` (from `data.table`) and then do a `paste`
```
library(data.table)
CJ(Letters, Letters)[, paste(V1, 'vs', V2)]
``` |
19,940,038 | Is there any way to disable auto-save for `UIManagedDocument` ?
I present `NSManagedObjects` in a controller where the user can add and delete them. But I just want to save those changes when the user explicitly fires a save action. Otherwise I want to discard the changes.
Thanks for your help! | 2013/11/12 | ['https://Stackoverflow.com/questions/19940038', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1263739/'] | Can't you override the method below in the `UIManagedDocument` subclass
```
- (void)autosaveWithCompletionHandler:(void (^)(BOOL success))completionHandler
```
EDIT: Here are some additional methods you might want to include. I use the first one to confirm if and when auto-saves were happening and the second to debu... | See [this SO answer](https://stackoverflow.com/a/8425546/953105) for the details, but unless you explicitly save your `NSManagedObjectContext`, you can call `[managedObjectContext rollback]` to undo any changes the user made. |
861,911 | Is it 32 bit, or 64 bit or 128 bit or bigger? | 2009/05/14 | ['https://Stackoverflow.com/questions/861911', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/106866/'] | I would go with 88 bytes. If you look at the ASP.NET state database, that is how it is defined. | Because it's generated as a [System.Guid](http://msdn.microsoft.com/en-us/library/system.guid(VS.90).aspx) Valuetype, it's a 128-bit integer, which is 16 bytes. |
861,911 | Is it 32 bit, or 64 bit or 128 bit or bigger? | 2009/05/14 | ['https://Stackoverflow.com/questions/861911', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/106866/'] | It's neither int nor guid; from the [MSDN help file](http://msdn.microsoft.com/en-us/library/system.web.sessionstate.sessionidmanager.aspx)...
>
> The ASP.NET session identifier is a randomly generated number encoded into a 24-character string consisting of lowercase characters from a to z and numbers from 0 to 5.
> ... | Because it's generated as a [System.Guid](http://msdn.microsoft.com/en-us/library/system.guid(VS.90).aspx) Valuetype, it's a 128-bit integer, which is 16 bytes. |
861,911 | Is it 32 bit, or 64 bit or 128 bit or bigger? | 2009/05/14 | ['https://Stackoverflow.com/questions/861911', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/106866/'] | The reason for the extra 8 characters in the database vs what you get in code is the application id. In the database the session is appended with the tempApplicationID from ASPStateTempApplications table. This is why you get 24 characters in code, and 32 in the db. | Because it's generated as a [System.Guid](http://msdn.microsoft.com/en-us/library/system.guid(VS.90).aspx) Valuetype, it's a 128-bit integer, which is 16 bytes. |
861,911 | Is it 32 bit, or 64 bit or 128 bit or bigger? | 2009/05/14 | ['https://Stackoverflow.com/questions/861911', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/106866/'] | It's neither int nor guid; from the [MSDN help file](http://msdn.microsoft.com/en-us/library/system.web.sessionstate.sessionidmanager.aspx)...
>
> The ASP.NET session identifier is a randomly generated number encoded into a 24-character string consisting of lowercase characters from a to z and numbers from 0 to 5.
> ... | I would go with 88 bytes. If you look at the ASP.NET state database, that is how it is defined. |
861,911 | Is it 32 bit, or 64 bit or 128 bit or bigger? | 2009/05/14 | ['https://Stackoverflow.com/questions/861911', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/106866/'] | The reason for the extra 8 characters in the database vs what you get in code is the application id. In the database the session is appended with the tempApplicationID from ASPStateTempApplications table. This is why you get 24 characters in code, and 32 in the db. | I would go with 88 bytes. If you look at the ASP.NET state database, that is how it is defined. |
861,911 | Is it 32 bit, or 64 bit or 128 bit or bigger? | 2009/05/14 | ['https://Stackoverflow.com/questions/861911', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/106866/'] | It's neither int nor guid; from the [MSDN help file](http://msdn.microsoft.com/en-us/library/system.web.sessionstate.sessionidmanager.aspx)...
>
> The ASP.NET session identifier is a randomly generated number encoded into a 24-character string consisting of lowercase characters from a to z and numbers from 0 to 5.
> ... | The reason for the extra 8 characters in the database vs what you get in code is the application id. In the database the session is appended with the tempApplicationID from ASPStateTempApplications table. This is why you get 24 characters in code, and 32 in the db. |
56,888 | At work we make websites for other companies. One of our client wanted us to make a e-commerce website for them. Nothing out of the ordinary until we realized they had 50 000+ products to sell and their classification is inexistant. In other words, we don't have ay categories to work with. They just told us to "Put a s... | 2014/05/07 | ['https://ux.stackexchange.com/questions/56888', 'https://ux.stackexchange.com', 'https://ux.stackexchange.com/users/47784/'] | I would recommend a [masonry-like](http://masonry.desandro.com/) experience as Pinterest implements. Infinite scrolling of all 50k products and have a details page for each one. Keep track of which products are viewed the most on a weekly basis and display those towards the top.
It sounds like this client wants an adv... | Your client might not be able to assign categories to products, but there is noting stopping them assigning categories to *sellers*.
The kind of sellers using a resale ecommerce site are likely to be specialists in certain categories already, rather than having a diverse range of products (e.g. there will likely be s... |
56,888 | At work we make websites for other companies. One of our client wanted us to make a e-commerce website for them. Nothing out of the ordinary until we realized they had 50 000+ products to sell and their classification is inexistant. In other words, we don't have ay categories to work with. They just told us to "Put a s... | 2014/05/07 | ['https://ux.stackexchange.com/questions/56888', 'https://ux.stackexchange.com', 'https://ux.stackexchange.com/users/47784/'] | I would recommend a [masonry-like](http://masonry.desandro.com/) experience as Pinterest implements. Infinite scrolling of all 50k products and have a details page for each one. Keep track of which products are viewed the most on a weekly basis and display those towards the top.
It sounds like this client wants an adv... | If there is no way of categorizing the products then search must be the primary method of traversing the catalog. But as a previous answer suggests you should guide the user with top products sold for a search, top products viewed for a search etc. The other users behavior should help guide them, consider adding a meth... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.