qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
21,806,534 | How would you go from...
```
FirstName|LastName|Description|Sum of Payment Types
Stone |Striclan|FICA |-4001.56
Stone |Striclan|Cost of Lab|20000.78
```
to
```
FirstName|LastName|Total Pay
Stone |Striclan|15,999.22
```
Basically I'm just trying to add up all of the sum of payments for each name i... | 2014/02/16 | [
"https://Stackoverflow.com/questions/21806534",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2943626/"
] | This is a basic aggregation query:
```
select FirstName, LastName, sum([Sum of Payment Types]) as [Total Pay]
from YourTable
group by FirstName, LastName ;
``` | ```
SELECT firstname,lastname,sum(total_field_name) FROM table ORDER BY firstname,lastname;
``` |
278,674 | Say I use a font "foo" in my TeX document.
>
> \setmainfont{foo}
>
>
>
This font is not free or not widely available on other systems.
Will my PDF document will look same in other computers where this font is not available / installed?
And if not what can I do about it to make sure that it looks same in other co... | 2015/11/17 | [
"https://tex.stackexchange.com/questions/278674",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/63140/"
] | Fonts are embedded by default when you compile TeX to PDF. To be sure, you may wish to upload your PDF to a cloud, say, GoogleDrive (free) and see, how it looks there in another previewer. | I'm not an expert on PDF, but the whole idea of PDF in opposite to Word is that the viewer displays the same picture and the printer prints the same glyphs on the paper.
Well, more or less. It obviously does not depend on the installation of fonts on the computer you use to display the PDF, but there are differences ... |
2,665,566 | I have to render some text to a web page. The text is coming from sources outside my control and it is formatted using newlines and tab characters.
New lines `(\n)` can be replaced by `br` tags, but what about preserving tabs? A brief search reveals there is no way to directly render tab characters in HTML. | 2010/04/19 | [
"https://Stackoverflow.com/questions/2665566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9425/"
] | An alternative to the non-breaking space would be the em space (` ` or ` `). It is usually rendered as a longer space, if that is an advantage. | If you're already replacing line breaks, why not do the same for tabs...?
```
str_replace("\t", ' ', $text);
``` |
2,665,566 | I have to render some text to a web page. The text is coming from sources outside my control and it is formatted using newlines and tab characters.
New lines `(\n)` can be replaced by `br` tags, but what about preserving tabs? A brief search reveals there is no way to directly render tab characters in HTML. | 2010/04/19 | [
"https://Stackoverflow.com/questions/2665566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9425/"
] | An alternative to the non-breaking space would be the em space (` ` or ` `). It is usually rendered as a longer space, if that is an advantage. | **` `**, **` `**, **` `** or **` `** can be used.
W3 says little about this...
```
The character entities   and   denote an en space and an em space respectively, where an en space is half the point size and an em space is equal to the point size of the current font.
```
[Read More... |
2,665,566 | I have to render some text to a web page. The text is coming from sources outside my control and it is formatted using newlines and tab characters.
New lines `(\n)` can be replaced by `br` tags, but what about preserving tabs? A brief search reveals there is no way to directly render tab characters in HTML. | 2010/04/19 | [
"https://Stackoverflow.com/questions/2665566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9425/"
] | An alternative to the non-breaking space would be the em space (` ` or ` `). It is usually rendered as a longer space, if that is an advantage. | A Quick & Dirty Way
-------------------
For a quick fix, you can use the [`xmp`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/xmp) tag to stop the browser from collapsing whitespace. The `xmp` tag contains text that should be rendered uninterpreted (and in a monospaced font).
The problem is that `xmp` ta... |
2,665,566 | I have to render some text to a web page. The text is coming from sources outside my control and it is formatted using newlines and tab characters.
New lines `(\n)` can be replaced by `br` tags, but what about preserving tabs? A brief search reveals there is no way to directly render tab characters in HTML. | 2010/04/19 | [
"https://Stackoverflow.com/questions/2665566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9425/"
] | A Quick & Dirty Way
-------------------
For a quick fix, you can use the [`xmp`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/xmp) tag to stop the browser from collapsing whitespace. The `xmp` tag contains text that should be rendered uninterpreted (and in a monospaced font).
The problem is that `xmp` ta... | If you're already replacing line breaks, why not do the same for tabs...?
```
str_replace("\t", ' ', $text);
``` |
2,665,566 | I have to render some text to a web page. The text is coming from sources outside my control and it is formatted using newlines and tab characters.
New lines `(\n)` can be replaced by `br` tags, but what about preserving tabs? A brief search reveals there is no way to directly render tab characters in HTML. | 2010/04/19 | [
"https://Stackoverflow.com/questions/2665566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9425/"
] | replace `\t` with ` `.
Each space you want will be a ` `
*As pointed out this isn't completely correct as it only pretends to be a tab as HTML doesn't actually output format a tab as you would expect.* | If you're already replacing line breaks, why not do the same for tabs...?
```
str_replace("\t", ' ', $text);
``` |
2,665,566 | I have to render some text to a web page. The text is coming from sources outside my control and it is formatted using newlines and tab characters.
New lines `(\n)` can be replaced by `br` tags, but what about preserving tabs? A brief search reveals there is no way to directly render tab characters in HTML. | 2010/04/19 | [
"https://Stackoverflow.com/questions/2665566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9425/"
] | Why not just wrap the content in a `<pre>` tag? This will handle the `\n` as well as the `\t` characters. | A Quick & Dirty Way
-------------------
For a quick fix, you can use the [`xmp`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/xmp) tag to stop the browser from collapsing whitespace. The `xmp` tag contains text that should be rendered uninterpreted (and in a monospaced font).
The problem is that `xmp` ta... |
2,665,566 | I have to render some text to a web page. The text is coming from sources outside my control and it is formatted using newlines and tab characters.
New lines `(\n)` can be replaced by `br` tags, but what about preserving tabs? A brief search reveals there is no way to directly render tab characters in HTML. | 2010/04/19 | [
"https://Stackoverflow.com/questions/2665566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9425/"
] | replace `\t` with ` `.
Each space you want will be a ` `
*As pointed out this isn't completely correct as it only pretends to be a tab as HTML doesn't actually output format a tab as you would expect.* | **` `**, **` `**, **` `** or **` `** can be used.
W3 says little about this...
```
The character entities   and   denote an en space and an em space respectively, where an en space is half the point size and an em space is equal to the point size of the current font.
```
[Read More... |
2,665,566 | I have to render some text to a web page. The text is coming from sources outside my control and it is formatted using newlines and tab characters.
New lines `(\n)` can be replaced by `br` tags, but what about preserving tabs? A brief search reveals there is no way to directly render tab characters in HTML. | 2010/04/19 | [
"https://Stackoverflow.com/questions/2665566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9425/"
] | Why not just wrap the content in a `<pre>` tag? This will handle the `\n` as well as the `\t` characters. | An alternative to the non-breaking space would be the em space (` ` or ` `). It is usually rendered as a longer space, if that is an advantage. |
2,665,566 | I have to render some text to a web page. The text is coming from sources outside my control and it is formatted using newlines and tab characters.
New lines `(\n)` can be replaced by `br` tags, but what about preserving tabs? A brief search reveals there is no way to directly render tab characters in HTML. | 2010/04/19 | [
"https://Stackoverflow.com/questions/2665566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9425/"
] | Why not just wrap the content in a `<pre>` tag? This will handle the `\n` as well as the `\t` characters. | replace `\t` with ` `.
Each space you want will be a ` `
*As pointed out this isn't completely correct as it only pretends to be a tab as HTML doesn't actually output format a tab as you would expect.* |
2,665,566 | I have to render some text to a web page. The text is coming from sources outside my control and it is formatted using newlines and tab characters.
New lines `(\n)` can be replaced by `br` tags, but what about preserving tabs? A brief search reveals there is no way to directly render tab characters in HTML. | 2010/04/19 | [
"https://Stackoverflow.com/questions/2665566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9425/"
] | Why not just wrap the content in a `<pre>` tag? This will handle the `\n` as well as the `\t` characters. | If you're already replacing line breaks, why not do the same for tabs...?
```
str_replace("\t", ' ', $text);
``` |
3,368,866 | I have a string `"abc=14,22 xyz=33, tdc=48"` in a file. How can I separate it into strings and their corresponding values in C++?
like--
```
abc = 14,22
xyz = 33
tdc = 48
``` | 2010/07/30 | [
"https://Stackoverflow.com/questions/3368866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/406430/"
] | ```
char * astr = "abc=14,22 xyz=33, tdc=48";
int abc1, abc2,xyz,tdc;
sscanf(astr,"abc=%d,%d xyz=%d, tdc=%d",&abc1,&abc2,&xyz,&tdc);
``` | If you need to read a string from a file you could use `std::ifstream`:
```
std::ifstream fs( "some_file.txt" );
std::string input_string;
while ( getline(fs, input_string) ) {
// parse a string
}
```
Then, just for fun, a version with regular expressions how you could parse an input string:
```
#include <iostrea... |
27,828,270 | When I return from my service call I seem unable to update my view. Why does **'not broken'** never get out putted to the console?
the services returns **[{test: 'service workies'}]**
```
app.controller('foo-controller', ['fooService','$scope', function (fooService,$scope) {
var ctrl = this;
ctrl.Results = [{... | 2015/01/07 | [
"https://Stackoverflow.com/questions/27828270",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/525672/"
] | I see a few issues in your code. I don't see anywhere inside `fooService` where `GetFoos()` is declared, so that's one issue. Try the following:
```
app.controller('MainCtrl', ['$scope', 'BookQueryService',
function($scope, BookQueryService) {
$scope.search = function() {
BookQueryService.getBooks().then(... | Is anything inside the `fooService.GetFoos().then(function(result){...})` being run? If the code you posted is all there is for `fooService`, then it looks like there is no `.GetFoos` method & therefore nothing inside the following `.then` would get run.
Try adding a `.error` after the original `.then` that is chained... |
4,319,615 | I'm stuck at the end of a script I am working on where a file is emailed out before being deleted. Except.. the file seems to be still be opened, likely by the SMTP client, so I get an error when I try to delete it. Of course restarting a shell will let me delete it, thats not the point. ;-) Point is I'd like to create... | 2010/11/30 | [
"https://Stackoverflow.com/questions/4319615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/261317/"
] | Dispose the attachment and email objects
```
$att.Dispose();
$msg.Dispose();
```
doing a GC won't help, as you still have root refs | Powershell v2 ships the `Send-MailMessage` Cmdlet which automaticly disposes references.
```
SYNTAX
Send-MailMessage [-To] <string[]> [-Subject] <string> -From <string>
[[-Body] <string>] [[-SmtpServer] <string>] [-Attachments <string[]>]
[-Bcc <string[]>] [-BodyAsHtml] [-Cc <string[]>] [-Credential <PSCr... |
19,126 | Imagine I have data describing something, i.e. a person
```
Name Ander
Id 123123
tel 1313333333
some_other_unusual_id 1212
```
And I store it in a XML. The structure of the data (4 fields, those ones specifically) is unique and my company only uses it, but the data itself its stored in something common, such as XML... | 2018/02/12 | [
"https://patents.stackexchange.com/questions/19126",
"https://patents.stackexchange.com",
"https://patents.stackexchange.com/users/3264/"
] | This kind of thing was previously considered patent eligible (and some examples were found to be novel and non-obvious and granted patents) but they aren't considered patent eligible any longer.
A somewhat well known patent 6,128,415 of Polaroid's - "Device profiles for use in a digital image processing system", that ... | I am not a lawyer, but my opinion is that the data structure, as you describe it, would not be patentable. One requirement of a patent is inventiveness. I can see nothing inventive about storing data in a common data storage format. I suppose if you use the data or storage format in some unexpected way and gain an unex... |
2,248,529 | I need to reload a Person NSManagedObject before I pass it onto the next View.
This is because the fetchedResultsController I'm using is only returning a subset of attributes and I need the full set in the next view.
Thus far I'm trying something like:
```
- (void)tableView:(UITableView *)tableViewPassed didSelectRo... | 2010/02/11 | [
"https://Stackoverflow.com/questions/2248529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84431/"
] | You just need to access the attributes that are not faulted and they will get faulted automatically. You do not need to refetch the object at all.
Update
------
Storing images or any binary data in Core Data has some basic rules to follow:
```
< 100kb store it in the same entity
< 1 mb store it in a separate entity... | Why you need to refetch partialPerson?
Simply pass it to the next view and you are done!!! You can do all you want with partialPerson variable on the next view. I don't see any reason why you need to refetch it.
```
myViewController.myPartialPerson = partialPerson;
``` |
231,255 | I set my username without spaces but it still says 'Server white-listed'. What should I do to join the server? | 2015/08/09 | [
"https://gaming.stackexchange.com/questions/231255",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/120753/"
] | When a server is white-listed, it means that only the players on the white-list can access the server. This option is normally used if the owner of the server wants to limit which players can access their server.
The list of white-listed players can be found under `white-list.txt` in the root server directory. If you ... | Since Mojang supports name changes, whitelisted players and their UUIDs are stored in `whitelist.json`.
If it's your server and you have access to the server console, use the command `whitelist add <YourMinecraftName>` or if you want to disable it, use `whitelist off`.
If it's not your server, try to contact the ... |
35,399 | I just want to confirm whether this is correct or not:
>
> The covariance of $X$ and $Y$ is equal to the standard deviation of $X$ times the standard deviation of $Y$.
>
>
>
or, in mathematical notation,
$$
\mathrm{Cov}(X,Y) = \sqrt{\mathrm{Var(X)}}\sqrt{\mathrm{Var}(Y)}
$$ | 2011/04/27 | [
"https://math.stackexchange.com/questions/35399",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/10128/"
] | This is false in general. In fact, it is true **if and only if** $X=aY+b$ (almost surely) for some fixed constants $a \geq 0$ and $b \in \mathbb{R}$. That is $X$ and $Y$ must be positively linearly related for this to hold. [Wikipedia](http://en.wikipedia.org/wiki/Covariance) also has a decent page on this.
For a coun... | While cardinal has answered the question, I wanted to add a little something extra.
The Cauchy-Schwarz inequality shows that $\left|\operatorname{Cov}(X,Y)\right|\leq \sqrt{\operatorname{Var}(X)\operatorname{Var}(Y)}$, with equality if and only if $X$ and $Y$ are linearly dependent. In general, you can take the ratio ... |
8,657,776 | How to print a particular member of a structure using pointer arithmetic? I have a structure with 2 members. I want to print out member `j` by manipulating the memory of the pointer to that structure.
```
#include <stdio.h>
#include <conio.h>
typedef struct ASD
{
int i;
int j;
}asd;
void main (void)
{
as... | 2011/12/28 | [
"https://Stackoverflow.com/questions/8657776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/958967/"
] | Use the `offsetof` macro provided in `stddef.h`:
```
#include<stddef.h>
main()
{
asd foo = {100, 200};
unsigned char* bar = (void*)&foo;
printf("%d\n", *(int*)(bar+offsetof(asd, j)));
}
```
Any other way runs into padding/alignment issues. | The pointer type needs to be right so that the increment adds the correct size:
```
printf("%d",*( ((int*)ptr) +1));
```
**Edit:** As any C programmer should know, using pointer arithmetic to access struct members is useless and dangerous. Useless because the `->` operation is much more concise and precise in access... |
1,510,948 | >
> Proposition 1: The number of occurrences of an event within a unit of
> time has a Poisson distribution with parameter $\lambda $ if and only
> if the time elapsed between two successive occurrences of the event
> has an exponential distribution with parameter $\lambda $ and it is
> independent of previous occ... | 2015/11/03 | [
"https://math.stackexchange.com/questions/1510948",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/192929/"
] | The $\text{“ if ''}$ assertion is correct; the $\text{“ only if ''}$ is not.
**If** the interarrival times are independent and exponentially distributed with rate $\lambda$ (and therefore with expected value $1/\lambda$), then the number of arrivals between time $0$ and time $1$ has a Poisson distribution with expecte... | Assumptions: $X$ is the number of arrivals in the time interval $(0,1]$
(note the endpoints), and the time of
the $n$-th arrival is $\tau\_1+\tau\_2+\cdots+\tau\_n$. Note that $\tau\_k$ is
the $k$-th *interarrival* time.
Then, if the event $\{X \geq n\}$ has occurred, then there are *at least* $n$ arrivals in $(0,1]$,... |
4,560,671 | **Theorem 4** of this blog [entry](https://terrytao.wordpress.com/2008/02/04/254a-lecture-9-ergodicity/#more-252) of Terrence Tao states that:
>
> Let $X$ be a compact metric space, $\mathcal X$ its Borel $\sigma$-algebra, and $\mu$ a Borel probability measure on $X$. Let $(Y, \mathcal Y)$ a measurable space, $\pi:X\... | 2022/10/24 | [
"https://math.stackexchange.com/questions/4560671",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1019043/"
] | Applying $(\star)$ with $f(g\circ\pi)$ in place of $f$ and $h$ in place of $g$, $$\int\_Y\left(\int\_X f(g \circ \pi)\, d\mu\_y\right) h(y)\, d \nu(y)=\int\_X f(g\circ \pi)(h\circ\pi)\, d\mu = \int\_X f((gh)\circ \pi)\, d\mu.$$ Applying $(\star)$ again, this time to $f$ and $gh$, this also is equal to $$\int\_Y\left(\i... | Now let $f:X \to \mathbb C$ and $g,h:Y \to \mathbb C$ be bounded and measurable. We apply $(\star)$ with $(f(g\circ\pi), h)$ in place of $(f, g)$ and get
$$
\int\_Y\left(\int\_X f(g \circ \pi)\mathrm d\mu\_y\right) h(y)\mathrm d \nu(y) = \int\_X f((gh)\circ \pi)\mathrm d\mu.
$$
We apply $(\star)$ with $(f, gh)$ in plac... |
69,122,732 | Is it possible to import and extend the bootstrap-icons.css in the scss file like importing the bootstrap.scss?
What I've tried so far without success:
```css
@import "../node_modules/bootstrap-icons/font/bootstrap-icons";
.right-square-icon{
font-size: 4rem;
@extend .bi;
@extend .bi-caret-right-square;
@ext... | 2021/09/09 | [
"https://Stackoverflow.com/questions/69122732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11999287/"
] | You can import the "bootstrap-icons.scss" file and edit the font files' location variable like this -
```
$bootstrap-icons-font-src: url("../webfonts/bootstrap-icons.woff2?30af91bf14e37666a085fb8a161ff36d") format("woff2"), url("../webfonts/bootstrap-icons.woff?30af91bf14e37666a085fb8a161ff36d") format("woff");
@impo... | Yes it is possible to import bootstrap-icons via scss.
```
@import "~bootstrap-icons/font/bootstrap-icons.css";
``` |
37,588,742 | I'm trying to connect my neo4J DB with Python using py2neo.
I'm following the example extracted from py2neo 2 API but there's no way to get it work.
My code:
```
from py2neo import Graph
graph = Graph("http://neo4j:1234@localhost:7474/C:/Users/htilmatine/Documents/Neo4j/default.graphdb")
```
The error:
```
Traceb... | 2016/06/02 | [
"https://Stackoverflow.com/questions/37588742",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2238244/"
] | The connection docs are [here](http://py2neo.org/2.0/essentials.html#the-graph).
If you're just using a default install and default graph data directory, you should be able to connect with:
```
graph = Graph("http://neo4j:1234@localhost:7474/db/data")
```
or
```
from py2neo import ServiceRoot
graph = ServiceRoot(... | I'm concerned about seeing `py2neo-2.0a0` in your path name. I'd strongly recommend using a more up-to-date version of py2neo, specifically not an alpha release. |
8,670,941 | I ve got this table:
```
CREATE TABLE IF NOT EXISTS `test1_nopart` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`idAccount` int(10) unsigned NOT NULL,
`data` mediumint(8) unsigned NOT NULL,
`date` date NOT NULL,
PRIMARY KEY (`id`),
KEY `date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```
I fill... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8670941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/919844/"
] | The MySQL Query Optimizer sees that the Index Traversal of the date index includes a dive into the Clustered Index (known internally as [gen\_clust\_index](https://serverfault.com/questions/238845/what-is-gen-clust-index-used-for-in-mysql)). In light of this, the MySQL Query Optimizer figured that it is easier to perfo... | Just a hunch - maybe it has something to do with the word `date`.
Try to give some hints to MySQL that you want to use the field, not the reserved word:
```
SELECT date FROM `test1_nopart` WHERE `test1_nopart`.`date` = "2014-03-04"
``` |
8,670,941 | I ve got this table:
```
CREATE TABLE IF NOT EXISTS `test1_nopart` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`idAccount` int(10) unsigned NOT NULL,
`data` mediumint(8) unsigned NOT NULL,
`date` date NOT NULL,
PRIMARY KEY (`id`),
KEY `date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```
I fill... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8670941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/919844/"
] | The MySQL Query Optimizer sees that the Index Traversal of the date index includes a dive into the Clustered Index (known internally as [gen\_clust\_index](https://serverfault.com/questions/238845/what-is-gen-clust-index-used-for-in-mysql)). In light of this, the MySQL Query Optimizer figured that it is easier to perfo... | Here is my thoughts.
In the first case when we tries to get `data` by `date` MySQL doesn't use index on `date` because of very low cardinality. And optimizer use the following:
- secondary index
- clustered to access to row
- table to get data.
In the second case when we tries to get `date` by `date` it easier to go ... |
8,670,941 | I ve got this table:
```
CREATE TABLE IF NOT EXISTS `test1_nopart` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`idAccount` int(10) unsigned NOT NULL,
`data` mediumint(8) unsigned NOT NULL,
`date` date NOT NULL,
PRIMARY KEY (`id`),
KEY `date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```
I fill... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8670941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/919844/"
] | The MySQL Query Optimizer sees that the Index Traversal of the date index includes a dive into the Clustered Index (known internally as [gen\_clust\_index](https://serverfault.com/questions/238845/what-is-gen-clust-index-used-for-in-mysql)). In light of this, the MySQL Query Optimizer figured that it is easier to perfo... | It is not a problem of cardinality.
I made a lot of test and I made another post describing the problem.
<https://stackoverflow.com/questions/8679940/primary-key-index-with-a-datetime-as-first-part-of-the-compound-key-is-never-use>
The problem occured ONLY when the first key is a datetime... |
14,328,373 | I am displaying data pulled from the Android OS sqlite database. I am successfully getting the items to delete when I click on them. However I am having an issue refreshing, or updating the listview after the operation.
Below is the code where I delete the contact.
```
deleteBtn = (Button)v.findViewById(R.id.deleteBt... | 2013/01/14 | [
"https://Stackoverflow.com/questions/14328373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1732515/"
] | I'm not sure if this is possible. It looks as though Word is in fact treating presses of the enter key (I am treating this action as a sort of programmatic equivalent of "\r\n" and "\n") as the creation of a new paragraph.
---
If I record a macro in Word that consists of:
1. Typing the text "One"
2. Pressing the ent... | As of v0.7.2, python-docx translates '\n' and '\r' characters in a string to `<w:br/>` elements, which provides the behavior you describe. It also translates '\t' characters into `<w:tab/>` elements.
This behavior is available for strings provided to:
* `Document.add_paragraph()`
* `Paragraph.add_run()`
and for stri... |
14,328,373 | I am displaying data pulled from the Android OS sqlite database. I am successfully getting the items to delete when I click on them. However I am having an issue refreshing, or updating the listview after the operation.
Below is the code where I delete the contact.
```
deleteBtn = (Button)v.findViewById(R.id.deleteBt... | 2013/01/14 | [
"https://Stackoverflow.com/questions/14328373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1732515/"
] | I'm not sure if this is possible. It looks as though Word is in fact treating presses of the enter key (I am treating this action as a sort of programmatic equivalent of "\r\n" and "\n") as the creation of a new paragraph.
---
If I record a macro in Word that consists of:
1. Typing the text "One"
2. Pressing the ent... | You can achieve your carriage return using python-docx by calling `add_break()` on your run. For example:
```
doc = Document()
p = doc.add_paragraph()
run = p.add_run()
run.add_break()
```
[python-docx reference](http://python-docx.readthedocs.org/en/latest/dev/analysis/features/text/breaks.html#candidate-protocol-r... |
14,328,373 | I am displaying data pulled from the Android OS sqlite database. I am successfully getting the items to delete when I click on them. However I am having an issue refreshing, or updating the listview after the operation.
Below is the code where I delete the contact.
```
deleteBtn = (Button)v.findViewById(R.id.deleteBt... | 2013/01/14 | [
"https://Stackoverflow.com/questions/14328373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1732515/"
] | You can achieve your carriage return using python-docx by calling `add_break()` on your run. For example:
```
doc = Document()
p = doc.add_paragraph()
run = p.add_run()
run.add_break()
```
[python-docx reference](http://python-docx.readthedocs.org/en/latest/dev/analysis/features/text/breaks.html#candidate-protocol-r... | As of v0.7.2, python-docx translates '\n' and '\r' characters in a string to `<w:br/>` elements, which provides the behavior you describe. It also translates '\t' characters into `<w:tab/>` elements.
This behavior is available for strings provided to:
* `Document.add_paragraph()`
* `Paragraph.add_run()`
and for stri... |
238,968 | I'm asked to find force on square loop (side a) carrying current $I$, flowing counter clockwise, when we look down x-axis, lying in yz plane. the loop is centered at the origin. The magnetic field is given as:
$\vec{B} = kz\hat{x}$
Its solution states that force on left an right cancel each other .The force on top is... | 2016/02/22 | [
"https://physics.stackexchange.com/questions/238968",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/104146/"
] | I'm not sure I understand how the loop is set but your case must be similar to the left and right side of the loop below.Since the current is flowing in a loop, on the left side it will flow the opposite direction of the way it does on the other side.Using the right-hand rule you will now see that the forces are equal ... | first you take the direction of current vector and start turning /rotating screw from I towards the B vector ;if the rotation of the screw is clockwise screw movement will be perpendicular to the plane containing Current and Field vector and it will give you direction of the force .
if the screw rotates anticlockwise ... |
238,968 | I'm asked to find force on square loop (side a) carrying current $I$, flowing counter clockwise, when we look down x-axis, lying in yz plane. the loop is centered at the origin. The magnetic field is given as:
$\vec{B} = kz\hat{x}$
Its solution states that force on left an right cancel each other .The force on top is... | 2016/02/22 | [
"https://physics.stackexchange.com/questions/238968",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/104146/"
] | The minus is coming from the value of z. Note that the loop is *centered* at the origin on the *yz plane*, and the value of B is *dependent on the value of z*.
The forces on the left and right arms of the loop cancel out, the forces on the top and bottom arm are also opposite but due to the nature of the B field (depe... | first you take the direction of current vector and start turning /rotating screw from I towards the B vector ;if the rotation of the screw is clockwise screw movement will be perpendicular to the plane containing Current and Field vector and it will give you direction of the force .
if the screw rotates anticlockwise ... |
238,968 | I'm asked to find force on square loop (side a) carrying current $I$, flowing counter clockwise, when we look down x-axis, lying in yz plane. the loop is centered at the origin. The magnetic field is given as:
$\vec{B} = kz\hat{x}$
Its solution states that force on left an right cancel each other .The force on top is... | 2016/02/22 | [
"https://physics.stackexchange.com/questions/238968",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/104146/"
] | I'm not sure I understand how the loop is set but your case must be similar to the left and right side of the loop below.Since the current is flowing in a loop, on the left side it will flow the opposite direction of the way it does on the other side.Using the right-hand rule you will now see that the forces are equal ... | You are correct, and the "solution" is apparently in error. The force on the top leg is equal and opposite to the force on the bottom leg. They cancel just as the forces on the left and right legs do. There is no net force on the loop. |
238,968 | I'm asked to find force on square loop (side a) carrying current $I$, flowing counter clockwise, when we look down x-axis, lying in yz plane. the loop is centered at the origin. The magnetic field is given as:
$\vec{B} = kz\hat{x}$
Its solution states that force on left an right cancel each other .The force on top is... | 2016/02/22 | [
"https://physics.stackexchange.com/questions/238968",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/104146/"
] | I'm not sure I understand how the loop is set but your case must be similar to the left and right side of the loop below.Since the current is flowing in a loop, on the left side it will flow the opposite direction of the way it does on the other side.Using the right-hand rule you will now see that the forces are equal ... | This problem is given in griffith book of electrodynamics. Here minus sign comes from the negative z direction because loop is placed at centre half of which in positive axis and remaining half lies in negative axis. |
238,968 | I'm asked to find force on square loop (side a) carrying current $I$, flowing counter clockwise, when we look down x-axis, lying in yz plane. the loop is centered at the origin. The magnetic field is given as:
$\vec{B} = kz\hat{x}$
Its solution states that force on left an right cancel each other .The force on top is... | 2016/02/22 | [
"https://physics.stackexchange.com/questions/238968",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/104146/"
] | The minus is coming from the value of z. Note that the loop is *centered* at the origin on the *yz plane*, and the value of B is *dependent on the value of z*.
The forces on the left and right arms of the loop cancel out, the forces on the top and bottom arm are also opposite but due to the nature of the B field (depe... | You are correct, and the "solution" is apparently in error. The force on the top leg is equal and opposite to the force on the bottom leg. They cancel just as the forces on the left and right legs do. There is no net force on the loop. |
238,968 | I'm asked to find force on square loop (side a) carrying current $I$, flowing counter clockwise, when we look down x-axis, lying in yz plane. the loop is centered at the origin. The magnetic field is given as:
$\vec{B} = kz\hat{x}$
Its solution states that force on left an right cancel each other .The force on top is... | 2016/02/22 | [
"https://physics.stackexchange.com/questions/238968",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/104146/"
] | The minus is coming from the value of z. Note that the loop is *centered* at the origin on the *yz plane*, and the value of B is *dependent on the value of z*.
The forces on the left and right arms of the loop cancel out, the forces on the top and bottom arm are also opposite but due to the nature of the B field (depe... | This problem is given in griffith book of electrodynamics. Here minus sign comes from the negative z direction because loop is placed at centre half of which in positive axis and remaining half lies in negative axis. |
24,424,562 | I have a form that shows users results based on location.
When the page loads, the PHP shows the results based on the userIP location which comes from my geoIP script which works fine. This ip location gets stored in the `$location` variable.
But, What I also want is to allow the user to change this location based on... | 2014/06/26 | [
"https://Stackoverflow.com/questions/24424562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3529959/"
] | You just need to rearrange based on what should logically be tested first:
```
$location = ''; // assume the worst
if (isset($_POST['location'])) {
// location given, use that
$location = $_POST['location'];
} else {
// location not given, find it based on IP address if possible
$geo = geoCheckIP($_SER... | try
```
if (isset($_POST['location']) && !empty($_POST['location'])) {
$location = $_POST['location'];
}
else {
$geo = geoCheckIP($_SERVER['REMOTE_ADDR']);
$location = (!empty($geo) && $geo != "not found, not found" ? $geo : '');
}
``` |
17,208,486 | I have an interface as below:
```
public interface IInterface
{
void Open();
void Open(bool flag);
void Open(bool flag, bool otherFlag);
}
```
Now when implementing the interface I have the following:
```
public class IClass : IInterface
{
void IInterface.Open()
{
Open(false, false);
... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17208486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001854/"
] | Explicit implementations require using a reference of the interface type directly, even inside the implementing class:
```
void IInterface.Open()
{
(this as IInterface).Open(false, false);
}
void IInterface.Open(bool flag)
{
(this as IInterface).Open(flag, false);
}
```
Anoth... | You can do:
```
((IInterface)this).Open(false, false);
```
One thing you might consider is making the other overloads extension methods on `IInterface` instead of re-implementing them each time:
```
public static void Open(this IInterface iface, bool flag)
{
iface.Open(flag, false);
}
``` |
17,208,486 | I have an interface as below:
```
public interface IInterface
{
void Open();
void Open(bool flag);
void Open(bool flag, bool otherFlag);
}
```
Now when implementing the interface I have the following:
```
public class IClass : IInterface
{
void IInterface.Open()
{
Open(false, false);
... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17208486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001854/"
] | You can do:
```
((IInterface)this).Open(false, false);
```
One thing you might consider is making the other overloads extension methods on `IInterface` instead of re-implementing them each time:
```
public static void Open(this IInterface iface, bool flag)
{
iface.Open(flag, false);
}
``` | Just ensure that you treat the `this` object explicitly as an interface by casting it first:
```
void IInterface.Open(bool flag)
{
((IInterface)this).Open(flag, false);
}
``` |
17,208,486 | I have an interface as below:
```
public interface IInterface
{
void Open();
void Open(bool flag);
void Open(bool flag, bool otherFlag);
}
```
Now when implementing the interface I have the following:
```
public class IClass : IInterface
{
void IInterface.Open()
{
Open(false, false);
... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17208486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001854/"
] | You can do:
```
((IInterface)this).Open(false, false);
```
One thing you might consider is making the other overloads extension methods on `IInterface` instead of re-implementing them each time:
```
public static void Open(this IInterface iface, bool flag)
{
iface.Open(flag, false);
}
``` | ```
void IInterface.Open()
{
(this as IInterface).Open(false, false);
}
``` |
17,208,486 | I have an interface as below:
```
public interface IInterface
{
void Open();
void Open(bool flag);
void Open(bool flag, bool otherFlag);
}
```
Now when implementing the interface I have the following:
```
public class IClass : IInterface
{
void IInterface.Open()
{
Open(false, false);
... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17208486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001854/"
] | Explicit implementations require using a reference of the interface type directly, even inside the implementing class:
```
void IInterface.Open()
{
(this as IInterface).Open(false, false);
}
void IInterface.Open(bool flag)
{
(this as IInterface).Open(flag, false);
}
```
Anoth... | Just ensure that you treat the `this` object explicitly as an interface by casting it first:
```
void IInterface.Open(bool flag)
{
((IInterface)this).Open(flag, false);
}
``` |
17,208,486 | I have an interface as below:
```
public interface IInterface
{
void Open();
void Open(bool flag);
void Open(bool flag, bool otherFlag);
}
```
Now when implementing the interface I have the following:
```
public class IClass : IInterface
{
void IInterface.Open()
{
Open(false, false);
... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17208486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001854/"
] | Explicit implementations require using a reference of the interface type directly, even inside the implementing class:
```
void IInterface.Open()
{
(this as IInterface).Open(false, false);
}
void IInterface.Open(bool flag)
{
(this as IInterface).Open(flag, false);
}
```
Anoth... | ```
void IInterface.Open()
{
(this as IInterface).Open(false, false);
}
``` |
10,553,200 | I'm attempting to change the innerHTML of a div from the ready function of an iframe's src. Code below. The innerHtml will not change, but the color works fine. Ideas on why this is happening and/or how to fix it?
Page
```
<html><head></head><body>
<script type="text/javascript" src="Javascript/Import_Subprocess_Cont... | 2012/05/11 | [
"https://Stackoverflow.com/questions/10553200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1223595/"
] | What database are you using? The capabilities of the database are important. Second, this suggests a data structure issue. Things that need to be sorted would normally be separate entities . . . that is, separate rows in a table. The rest of this post answers the question.
If the database supports pivot/unpivot you ca... | You can use pivot function of sql server to convert the row in column. Apply the sorting there and again convert column to row using unpivot. |
10,553,200 | I'm attempting to change the innerHTML of a div from the ready function of an iframe's src. Code below. The innerHtml will not change, but the color works fine. Ideas on why this is happening and/or how to fix it?
Page
```
<html><head></head><body>
<script type="text/javascript" src="Javascript/Import_Subprocess_Cont... | 2012/05/11 | [
"https://Stackoverflow.com/questions/10553200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1223595/"
] | What database are you using? The capabilities of the database are important. Second, this suggests a data structure issue. Things that need to be sorted would normally be separate entities . . . that is, separate rows in a table. The rest of this post answers the question.
If the database supports pivot/unpivot you ca... | Here is a good example using PIVOT, you should be able to adapt this to meet your needs
<http://blogs.msdn.com/b/spike/archive/2009/03/03/pivot-tables-in-sql-server-a-simple-sample.aspx> |
5,077,298 | I have three yellow bars and each of them needs to come from left to right. For that, I have produced this code, but it only works on the last one. Can anyone correct this code; I need to work with pure JavaScript. I am not using any framework. Thanks.
```
window.onload = function(){
var yellowTitles = document... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5077298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/218349/"
] | Here's how I'd solve the problem:
```
var yellows = document.getElementById('magazine-brief').getElementsByTagName('h2');
// this will force the header number to be bound correctly
// also animates the div across the page by tracking the current position of x
function createMotion(num){
var currPos = 0;//current x ... | ```
var yellows = document.getElementById('magazine-brief').getElementsByTagName('h2');
for (var i = 0; i < yellows.length; i++)
{
(function(idx, el){
window.setTimeout(function(){
var interval = window.setInterval(function(){
el.style.left = parseInt(el.style.left) + 10; // adju... |
5,077,298 | I have three yellow bars and each of them needs to come from left to right. For that, I have produced this code, but it only works on the last one. Can anyone correct this code; I need to work with pure JavaScript. I am not using any framework. Thanks.
```
window.onload = function(){
var yellowTitles = document... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5077298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/218349/"
] | Shouldn't you be incrementing your CSS left value instead of just setting it to 0? Why have a timeout at all if you're just going to set the value without gradually incrementing or decrementing?
If you do actually want to use a gradual animation, look at this tutorial : <http://www.schillmania.com/content/projects/jav... | ```
var yellows = document.getElementById('magazine-brief').getElementsByTagName('h2');
for (var i = 0; i < yellows.length; i++)
{
(function(idx, el){
window.setTimeout(function(){
var interval = window.setInterval(function(){
el.style.left = parseInt(el.style.left) + 10; // adju... |
5,077,298 | I have three yellow bars and each of them needs to come from left to right. For that, I have produced this code, but it only works on the last one. Can anyone correct this code; I need to work with pure JavaScript. I am not using any framework. Thanks.
```
window.onload = function(){
var yellowTitles = document... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5077298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/218349/"
] | Here's how I'd solve the problem:
```
var yellows = document.getElementById('magazine-brief').getElementsByTagName('h2');
// this will force the header number to be bound correctly
// also animates the div across the page by tracking the current position of x
function createMotion(num){
var currPos = 0;//current x ... | By the time your timeout function runs, `header` refers to your last `h2`.
Try editing your timeout function to this:
```
function animeYellowBar(){
var thisheader=header;
thisheader.style.left= "0";
}
``` |
5,077,298 | I have three yellow bars and each of them needs to come from left to right. For that, I have produced this code, but it only works on the last one. Can anyone correct this code; I need to work with pure JavaScript. I am not using any framework. Thanks.
```
window.onload = function(){
var yellowTitles = document... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5077298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/218349/"
] | Shouldn't you be incrementing your CSS left value instead of just setting it to 0? Why have a timeout at all if you're just going to set the value without gradually incrementing or decrementing?
If you do actually want to use a gradual animation, look at this tutorial : <http://www.schillmania.com/content/projects/jav... | By the time your timeout function runs, `header` refers to your last `h2`.
Try editing your timeout function to this:
```
function animeYellowBar(){
var thisheader=header;
thisheader.style.left= "0";
}
``` |
5,077,298 | I have three yellow bars and each of them needs to come from left to right. For that, I have produced this code, but it only works on the last one. Can anyone correct this code; I need to work with pure JavaScript. I am not using any framework. Thanks.
```
window.onload = function(){
var yellowTitles = document... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5077298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/218349/"
] | Here's how I'd solve the problem:
```
var yellows = document.getElementById('magazine-brief').getElementsByTagName('h2');
// this will force the header number to be bound correctly
// also animates the div across the page by tracking the current position of x
function createMotion(num){
var currPos = 0;//current x ... | Shouldn't you be incrementing your CSS left value instead of just setting it to 0? Why have a timeout at all if you're just going to set the value without gradually incrementing or decrementing?
If you do actually want to use a gradual animation, look at this tutorial : <http://www.schillmania.com/content/projects/jav... |
17,699,072 | I'm using pydev in Classic Eclipse 4.2.2 with Python2.7. Please consider the code and result below as you read.
Suppose I create an object with a variable of a predefined value. Now, suppose I change this value and create a new object of the same name (i.e., old name points to a new object). I would expect the old na... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17699072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1936134/"
] | I'm still not quite sure what you're asking, but based on your comment
>
> @PeterGibson by closest I meant, 192.168.1.101 is closer to
> 192.168.56.1 than to 172.30.130.66 . And 192.168.1.254 is closer to 192.168.1.240 than to 192.168.2.1
>
>
>
You could try the following python code for a distance function:
``... | I'd start by dividing array into groups, considering reserved ip-addresses (<http://en.wikipedia.org/wiki/Reserved_IP_addresses#Reserved_IPv4_addresses>). Then i'd separate them by regions. Maybe some tree structure would suffice: root nodes are top level regions and then, closing to leafs it goes for smaller regions. |
17,699,072 | I'm using pydev in Classic Eclipse 4.2.2 with Python2.7. Please consider the code and result below as you read.
Suppose I create an object with a variable of a predefined value. Now, suppose I change this value and create a new object of the same name (i.e., old name points to a new object). I would expect the old na... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17699072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1936134/"
] | I'm still not quite sure what you're asking, but based on your comment
>
> @PeterGibson by closest I meant, 192.168.1.101 is closer to
> 192.168.56.1 than to 172.30.130.66 . And 192.168.1.254 is closer to 192.168.1.240 than to 192.168.2.1
>
>
>
You could try the following python code for a distance function:
``... | Not the prettiest of the approaches, but since very high performance is not required, it does the job.
```
<?php
$ip = isset($argv[1]) ? $argv[1] : '192.168.1.254';
printf("Input => %s => %u\n", $ip, ip2long($ip));
var_dump(
net_distance(
$ip,
array(
'87.86.85.84',
'173.19... |
431,626 | Normally when you want left quotation marks in LaTeX, you type the following:
```
``
```
However, in RMarkdown, you will trigger a block of R code to run when you type two pairs of backticks on the same line, causing the LaTeX to render incorrectly.
For example,
```
``Sticks and stones may break my bones,'' he sai... | 2018/05/15 | [
"https://tex.stackexchange.com/questions/431626",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/131080/"
] | First of all, you need to be aware of this fact:
>
> Markdown is not LaTeX.
>
>
>
So in general you should not expect LaTeX syntax to work in Markdown documents. The correct way to write quotes in Markdown is to just write quotes literally, i.e., use `" "`. They will be converted to the correct LaTeX code (i.e., ... | ### The R-side fix:
It's a bit hairy, because you could do escaped regex in `R` to redefine what is interpreted as R-code. However, there is an "easy" way out:
Redefining how `knitr` parses you file:
A little depending on how the file is knited. The idea here is to define the pattern right before it's knited.
If y... |
2,624 | There are many questions in philosophy of the following kind:
* Does my friend have a soul, or is my friend a zombie?
* Is the mind separate from the body, or is it the same?
* Where does the universe come from?
These questions have the property that, whatever the hypothetical answer would be, every one of your perce... | 2012/04/18 | [
"https://philosophy.stackexchange.com/questions/2624",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/1370/"
] | >
> These questions have the property that, whatever the hypothetical answer would be, every one of your perceptions of **the world** is exactly the same.
>
>
>
(emphasis mine).
You have imported an assumption here that, I think, explains why all of your examples are problematic.
What precisely do you mean by *t... | **"no perceptible difference one way or another"**
To the senses, "no perceptible difference". To the intellect? **Profound** perceptible differences!
Nothing to be shocked about. |
2,624 | There are many questions in philosophy of the following kind:
* Does my friend have a soul, or is my friend a zombie?
* Is the mind separate from the body, or is it the same?
* Where does the universe come from?
These questions have the property that, whatever the hypothetical answer would be, every one of your perce... | 2012/04/18 | [
"https://philosophy.stackexchange.com/questions/2624",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/1370/"
] | It ***can*** be very meaningful, and just *how* meaningful will vary depending on the person and the question. **Even if it doesn't alter the observable (physical) world** ("your perceptions of the world"), **it is still meaningful if it alters *human behavior*.** In fact, it is strange to me that you don't seem to con... | **"no perceptible difference one way or another"**
To the senses, "no perceptible difference". To the intellect? **Profound** perceptible differences!
Nothing to be shocked about. |
2,624 | There are many questions in philosophy of the following kind:
* Does my friend have a soul, or is my friend a zombie?
* Is the mind separate from the body, or is it the same?
* Where does the universe come from?
These questions have the property that, whatever the hypothetical answer would be, every one of your perce... | 2012/04/18 | [
"https://philosophy.stackexchange.com/questions/2624",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/1370/"
] | >
> These questions have the property that, whatever the hypothetical answer would be, every one of your perceptions of **the world** is exactly the same.
>
>
>
(emphasis mine).
You have imported an assumption here that, I think, explains why all of your examples are problematic.
What precisely do you mean by *t... | It ***can*** be very meaningful, and just *how* meaningful will vary depending on the person and the question. **Even if it doesn't alter the observable (physical) world** ("your perceptions of the world"), **it is still meaningful if it alters *human behavior*.** In fact, it is strange to me that you don't seem to con... |
2,624 | There are many questions in philosophy of the following kind:
* Does my friend have a soul, or is my friend a zombie?
* Is the mind separate from the body, or is it the same?
* Where does the universe come from?
These questions have the property that, whatever the hypothetical answer would be, every one of your perce... | 2012/04/18 | [
"https://philosophy.stackexchange.com/questions/2624",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/1370/"
] | I think that methaphysical theories (non testable in principle) are necessary and important to scientific research because they may be capable of becoming physical (testable in principle) theories.
Of course, if you understand clearly that your answers are completely equivalent experimentally, then you are saying just... | **"no perceptible difference one way or another"**
To the senses, "no perceptible difference". To the intellect? **Profound** perceptible differences!
Nothing to be shocked about. |
2,624 | There are many questions in philosophy of the following kind:
* Does my friend have a soul, or is my friend a zombie?
* Is the mind separate from the body, or is it the same?
* Where does the universe come from?
These questions have the property that, whatever the hypothetical answer would be, every one of your perce... | 2012/04/18 | [
"https://philosophy.stackexchange.com/questions/2624",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/1370/"
] | Logical Positivism, seems to me a philosophy that evolved by taking the scientific viewpoint as the only legitimate way to ask meaningful questions. Its greatest failing is that its not very imaginative. Its an interesting perspective to hold for a while, but to hold it exclusively feels severely limiting.
Also, histo... | I think that methaphysical theories (non testable in principle) are necessary and important to scientific research because they may be capable of becoming physical (testable in principle) theories.
Of course, if you understand clearly that your answers are completely equivalent experimentally, then you are saying just... |
2,624 | There are many questions in philosophy of the following kind:
* Does my friend have a soul, or is my friend a zombie?
* Is the mind separate from the body, or is it the same?
* Where does the universe come from?
These questions have the property that, whatever the hypothetical answer would be, every one of your perce... | 2012/04/18 | [
"https://philosophy.stackexchange.com/questions/2624",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/1370/"
] | >
> These questions have the property that, whatever the hypothetical answer would be, every one of your perceptions of the world is exactly the same.
>
>
>
That is absolutely untrue. My perception of the world might be profoundly different if I knew with certainty information regarding the existence of souls, or ... | I think that methaphysical theories (non testable in principle) are necessary and important to scientific research because they may be capable of becoming physical (testable in principle) theories.
Of course, if you understand clearly that your answers are completely equivalent experimentally, then you are saying just... |
2,624 | There are many questions in philosophy of the following kind:
* Does my friend have a soul, or is my friend a zombie?
* Is the mind separate from the body, or is it the same?
* Where does the universe come from?
These questions have the property that, whatever the hypothetical answer would be, every one of your perce... | 2012/04/18 | [
"https://philosophy.stackexchange.com/questions/2624",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/1370/"
] | It ***can*** be very meaningful, and just *how* meaningful will vary depending on the person and the question. **Even if it doesn't alter the observable (physical) world** ("your perceptions of the world"), **it is still meaningful if it alters *human behavior*.** In fact, it is strange to me that you don't seem to con... | I think that methaphysical theories (non testable in principle) are necessary and important to scientific research because they may be capable of becoming physical (testable in principle) theories.
Of course, if you understand clearly that your answers are completely equivalent experimentally, then you are saying just... |
2,624 | There are many questions in philosophy of the following kind:
* Does my friend have a soul, or is my friend a zombie?
* Is the mind separate from the body, or is it the same?
* Where does the universe come from?
These questions have the property that, whatever the hypothetical answer would be, every one of your perce... | 2012/04/18 | [
"https://philosophy.stackexchange.com/questions/2624",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/1370/"
] | Logical Positivism, seems to me a philosophy that evolved by taking the scientific viewpoint as the only legitimate way to ask meaningful questions. Its greatest failing is that its not very imaginative. Its an interesting perspective to hold for a while, but to hold it exclusively feels severely limiting.
Also, histo... | **"no perceptible difference one way or another"**
To the senses, "no perceptible difference". To the intellect? **Profound** perceptible differences!
Nothing to be shocked about. |
2,624 | There are many questions in philosophy of the following kind:
* Does my friend have a soul, or is my friend a zombie?
* Is the mind separate from the body, or is it the same?
* Where does the universe come from?
These questions have the property that, whatever the hypothetical answer would be, every one of your perce... | 2012/04/18 | [
"https://philosophy.stackexchange.com/questions/2624",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/1370/"
] | >
> These questions have the property that, whatever the hypothetical answer would be, every one of your perceptions of the world is exactly the same.
>
>
>
That is absolutely untrue. My perception of the world might be profoundly different if I knew with certainty information regarding the existence of souls, or ... | **"no perceptible difference one way or another"**
To the senses, "no perceptible difference". To the intellect? **Profound** perceptible differences!
Nothing to be shocked about. |
2,624 | There are many questions in philosophy of the following kind:
* Does my friend have a soul, or is my friend a zombie?
* Is the mind separate from the body, or is it the same?
* Where does the universe come from?
These questions have the property that, whatever the hypothetical answer would be, every one of your perce... | 2012/04/18 | [
"https://philosophy.stackexchange.com/questions/2624",
"https://philosophy.stackexchange.com",
"https://philosophy.stackexchange.com/users/1370/"
] | >
> These questions have the property that, whatever the hypothetical answer would be, every one of your perceptions of **the world** is exactly the same.
>
>
>
(emphasis mine).
You have imported an assumption here that, I think, explains why all of your examples are problematic.
What precisely do you mean by *t... | Logical Positivism, seems to me a philosophy that evolved by taking the scientific viewpoint as the only legitimate way to ask meaningful questions. Its greatest failing is that its not very imaginative. Its an interesting perspective to hold for a while, but to hold it exclusively feels severely limiting.
Also, histo... |
11,463,023 | I'm having trouble in compiling the following code. The compiler states:
```
Assigning to 'RawChunk::Ptr' (aka 'unsigned char (*)[128][16]') from incompatible type 'RawChunk::Chunk *' (aka 'unsigned char (*)[16][128][16]');
```
Does anyone know what I'm doing wrong? It seems like a simple mistake but I'm not sure wh... | 2012/07/13 | [
"https://Stackoverflow.com/questions/11463023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/256062/"
] | Without a further explanation of what you intend on doing, I cannot be really sure, but it seems that you might have used the incorrect types for the member variables. In particular, the member variable window is of type:
window: Array of size `dim` of array of size `dim` of pointers to array of `MAX_Y` arrays of `MAX... | From your code snipped in the constructor of `RawChunkWindow`, it looks like your `Ptr` types should be pointers to `Chunk` types, but your `typedef` declarations don't reflect that. Instead `Ptr` is a pointer to a two-dimensional array of `char` types, not a pointer to a three-dimensional array.
So change this:
```
... |
11,463,023 | I'm having trouble in compiling the following code. The compiler states:
```
Assigning to 'RawChunk::Ptr' (aka 'unsigned char (*)[128][16]') from incompatible type 'RawChunk::Chunk *' (aka 'unsigned char (*)[16][128][16]');
```
Does anyone know what I'm doing wrong? It seems like a simple mistake but I'm not sure wh... | 2012/07/13 | [
"https://Stackoverflow.com/questions/11463023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/256062/"
] | From your code snipped in the constructor of `RawChunkWindow`, it looks like your `Ptr` types should be pointers to `Chunk` types, but your `typedef` declarations don't reflect that. Instead `Ptr` is a pointer to a two-dimensional array of `char` types, not a pointer to a three-dimensional array.
So change this:
```
... | To eliminate the error the way you currently have it, you need to change the line:
window[i][j] = &payload[i][j];
to
window[i][j] = &payload[i][j][x];
for some "x" less than "ChunkDimensions::MAX\_X". It's not clear to me what you're trying to do however, and the above fix almost certainly isn't it (probably). In s... |
11,463,023 | I'm having trouble in compiling the following code. The compiler states:
```
Assigning to 'RawChunk::Ptr' (aka 'unsigned char (*)[128][16]') from incompatible type 'RawChunk::Chunk *' (aka 'unsigned char (*)[16][128][16]');
```
Does anyone know what I'm doing wrong? It seems like a simple mistake but I'm not sure wh... | 2012/07/13 | [
"https://Stackoverflow.com/questions/11463023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/256062/"
] | Without a further explanation of what you intend on doing, I cannot be really sure, but it seems that you might have used the incorrect types for the member variables. In particular, the member variable window is of type:
window: Array of size `dim` of array of size `dim` of pointers to array of `MAX_Y` arrays of `MAX... | To eliminate the error the way you currently have it, you need to change the line:
window[i][j] = &payload[i][j];
to
window[i][j] = &payload[i][j][x];
for some "x" less than "ChunkDimensions::MAX\_X". It's not clear to me what you're trying to do however, and the above fix almost certainly isn't it (probably). In s... |
28,126,540 | I have a UIView that I want to fill with multiple rectangles stacked on top of each other horizontally at 100% width. They all need to have their own name and need to work for any iOS device regardless of size.
Here's a simple diagram showing what I would like to accomplish:
 (It's a subsampling of the real file in term of lign but the number of column is the real one) :
```
1,test,test2,55.2,test3
1,test,test2,96.3,test3
1,test,test2,64.2,test3
1,test,test2,97.2,test3
```
And a main file `main.tsv` (field separato... | 2021/07/06 | [
"https://unix.stackexchange.com/questions/657188",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/416180/"
] | The unavoidable GNU `sed` one-liner:
```
sed '1n;h;s/\([[:alnum:]]\).*/sed -E "89!d;s_([^,]*,){3}__;s_,.*__" \1_bla.csv/e;G;s/\(.*\)\n\(.*\)wrongdata/\2\1/' main.tsv
```
What's the magic? We use the `e`xecute option to the `s`ubstitute command to extract the 4th field of the 89th line with another `sed` command. In ... | You can do using the awk utility. Must run from the directory where the csv files are.
```
awk -v OFS='\t' '
FS=="," && FNR==89 {
split(FILENAME, a, "_")
h[substr(a[1],3)] = $4
}
f=FS=="\t" {
$2 = FNR>1&&($1 in h) ? h[$1] : $2
};f
' FS=, ./*_bla.csv FS="\t" ./main.tsv
id coverage clade
A 35.8 ... |
657,188 | I have several file like `A_bla.csv`(i.e `B_bla.csv` `C_bla.csv` etc ...) (It's a subsampling of the real file in term of lign but the number of column is the real one) :
```
1,test,test2,55.2,test3
1,test,test2,96.3,test3
1,test,test2,64.2,test3
1,test,test2,97.2,test3
```
And a main file `main.tsv` (field separato... | 2021/07/06 | [
"https://unix.stackexchange.com/questions/657188",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/416180/"
] | The unavoidable GNU `sed` one-liner:
```
sed '1n;h;s/\([[:alnum:]]\).*/sed -E "89!d;s_([^,]*,){3}__;s_,.*__" \1_bla.csv/e;G;s/\(.*\)\n\(.*\)wrongdata/\2\1/' main.tsv
```
What's the magic? We use the `e`xecute option to the `s`ubstitute command to extract the 4th field of the 89th line with another `sed` command. In ... | ```none
awk -F',|\t' '
FILENAME != "main.tsv" && FNR == 89 {
sub(/_.*$/, "", FILENAME)
A[FILENAME]=$4
}
FILENAME != "main.tsv" {next}
A[$1] {$2 = A[$1]}
{print}
' *bla.csv OFS='\t' main.tsv
```
I see tha... |
26,982,870 | So I'm trying to set up a custom alert in Microsoft SQL, 2014.
I want to send my team an e-mail whenever something has been sitting in the queue for longer than 30 minutes.
I promise I've researched it quite a bit, but the issues other people posted similar to this on here didn't help.
I set up the database mail pro... | 2014/11/17 | [
"https://Stackoverflow.com/questions/26982870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4100050/"
] | I wanted to share how I worked around this problem before I close this question. I ended up using a different method to solve this problem instead of the one I was trouble-shooting for. Gordon Linoff's critique of my script was helpful anyways, and I think Rajesh had the right idea as well but I found a way that was ea... | You might have other problems, but your `if` code doesn't make sense. You are executing a query that creates a result set and then you have an `if`. This should do what you want in that part of the code:
```
declare @WaitTime datetime;
Select @WaitTime = [ITIME]
From ______________
where Status='WAITING' ;
IF (GETDA... |
26,982,870 | So I'm trying to set up a custom alert in Microsoft SQL, 2014.
I want to send my team an e-mail whenever something has been sitting in the queue for longer than 30 minutes.
I promise I've researched it quite a bit, but the issues other people posted similar to this on here didn't help.
I set up the database mail pro... | 2014/11/17 | [
"https://Stackoverflow.com/questions/26982870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4100050/"
] | I wanted to share how I worked around this problem before I close this question. I ended up using a different method to solve this problem instead of the one I was trouble-shooting for. Gordon Linoff's critique of my script was helpful anyways, and I think Rajesh had the right idea as well but I found a way that was ea... | You are using the wrong namespace, the [`CIM_DataFile`](http://msdn.microsoft.com/en-us/library/aa387236.aspx) WMI class is part of the `\root\CIMV2` namespace and not of `\root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER`
The Query Used in [SQL Server Alert using WMI Event ERROR](https://stackoverflow.com/questions/... |
7,197,553 | Is it possible to get Hibernate to lazy load a property on an entity? We have a few clobs in a project I've inherited that are being loaded by default. I am hoping to modify the XML as a stop-gap before we convert the mappings to Annotations. | 2011/08/25 | [
"https://Stackoverflow.com/questions/7197553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/210559/"
] | Yes. See ["Using lazy property fetching"](http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/#performance-fetching-lazyproperties). | With Hibernate 5, [this can be done as follows:](https://vladmihalcea.com/how-to-lazy-load-entity-properties-with-hibernate/).
First, you need to add the following Maven plugin:
```
<plugin>
<groupId>org.hibernate.orm.tooling</groupId>
<artifactId>hibernate-enhance-maven-plugin</artifactId>
<version>${hi... |
6,614 | What would be the formal equivalents of:
```
Dove vi siete conosciuti?
Stavo parlando con voi.
```
I read everywhere that `Loro` as plural formal 'you' is restricted only to very formal written work. What would be the spoken equivalent, and which verb conjugation would that pronoun take? | 2016/02/12 | [
"https://italian.stackexchange.com/questions/6614",
"https://italian.stackexchange.com",
"https://italian.stackexchange.com/users/-1/"
] | Short answer: it's really uncommon to use `loro` in this case. You may want to use `voi` even in a formal conversation.
Why? I don't really know. Perhaps, because `voi` was used in the past for the `plurale maestatis`, hence it already contains this formal meaning.
However, even if it's uncommon, you could use lo... | In modern Italian language "voi" means you (plural). The pronoun "loro" means they and is used even as honorific plural form.
However in northern Italy old people used "voi" as honorific form when they talked to their parents. |
37,929,290 | I am in the process of factoring my code. I have a Car class as a base class. Extending car class are SUV and Sedan. Potentially, I will have to add a lot more type of cars. They will all have the exact same Run method. I wonder if it is possible to remove Run method from all derived classes, and keep Run method in Car... | 2016/06/20 | [
"https://Stackoverflow.com/questions/37929290",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4087031/"
] | >
> I wonder if it is possible to remove Run method from all derived classes, and keep Run method in Car class which reference the ignition created in derived classes
>
>
>
Yes, but only if you get rid of the `static` methods and properties. If you make them *instance* methods and properties then they will be inhe... | You don't need to implement `Run()` in each derived class, and in fact I would argue you do NOT want to for this example. Each of the derived may provide their own `Ignition`, great, but just have `Run()` by only on your base class.
Also, is there any reason `Ignition` is static, instead of given to the base `Car` cla... |
34,950,667 | I'm using Eric Hynds' awesome drop down plugin, but I need to use the enable/disable function on multiple dropdowns. The form I will be building is very complex, and multiple dropdowns will be enable by nice Jquery sliders.
<http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/#enabledisable>
The code... | 2016/01/22 | [
"https://Stackoverflow.com/questions/34950667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5742054/"
] | It's difficult to understand what you're trying to do with your code.
You want the text input to change its value only if the select box has "IT" selected?
Why are you setting a `change` handler on the text input?
Why iterate through a select box's options if it's a single select? Just set the text input with the s... | You have two problems:
1. `input` tag does not have `onchange` event; you should use `onkeydown` instead;
2. you should assign events before `if` conditions. |
34,950,667 | I'm using Eric Hynds' awesome drop down plugin, but I need to use the enable/disable function on multiple dropdowns. The form I will be building is very complex, and multiple dropdowns will be enable by nice Jquery sliders.
<http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/#enabledisable>
The code... | 2016/01/22 | [
"https://Stackoverflow.com/questions/34950667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5742054/"
] | It's difficult to understand what you're trying to do with your code.
You want the text input to change its value only if the select box has "IT" selected?
Why are you setting a `change` handler on the text input?
Why iterate through a select box's options if it's a single select? Just set the text input with the s... | If I understand the problem correctly, you want to update input field with the value entered only when drop down selection is "IT". If that is the case, you need to watch input field event and invoke FieldCheck function from with in input field events. |
34,950,667 | I'm using Eric Hynds' awesome drop down plugin, but I need to use the enable/disable function on multiple dropdowns. The form I will be building is very complex, and multiple dropdowns will be enable by nice Jquery sliders.
<http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/#enabledisable>
The code... | 2016/01/22 | [
"https://Stackoverflow.com/questions/34950667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5742054/"
] | You have two problems:
1. `input` tag does not have `onchange` event; you should use `onkeydown` instead;
2. you should assign events before `if` conditions. | If I understand the problem correctly, you want to update input field with the value entered only when drop down selection is "IT". If that is the case, you need to watch input field event and invoke FieldCheck function from with in input field events. |
34,950,667 | I'm using Eric Hynds' awesome drop down plugin, but I need to use the enable/disable function on multiple dropdowns. The form I will be building is very complex, and multiple dropdowns will be enable by nice Jquery sliders.
<http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/#enabledisable>
The code... | 2016/01/22 | [
"https://Stackoverflow.com/questions/34950667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5742054/"
] | I would add a span and put the text in there so on subsequent change you can fix it:
```
<select id="billing_country">
<option value="FR">FR</option>
<option value="IT">IT</option>
</select>
<input type="text" id="woocommerce_cf_piva" /><span id="afterit"></span>
```
Note that this is still pretty verbose:
```
... | You have two problems:
1. `input` tag does not have `onchange` event; you should use `onkeydown` instead;
2. you should assign events before `if` conditions. |
34,950,667 | I'm using Eric Hynds' awesome drop down plugin, but I need to use the enable/disable function on multiple dropdowns. The form I will be building is very complex, and multiple dropdowns will be enable by nice Jquery sliders.
<http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/#enabledisable>
The code... | 2016/01/22 | [
"https://Stackoverflow.com/questions/34950667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5742054/"
] | I would add a span and put the text in there so on subsequent change you can fix it:
```
<select id="billing_country">
<option value="FR">FR</option>
<option value="IT">IT</option>
</select>
<input type="text" id="woocommerce_cf_piva" /><span id="afterit"></span>
```
Note that this is still pretty verbose:
```
... | If I understand the problem correctly, you want to update input field with the value entered only when drop down selection is "IT". If that is the case, you need to watch input field event and invoke FieldCheck function from with in input field events. |
27,117,449 | How can I set the collection cell view to dynamically stretch to iphone screen width (e.g. iphone 5s, iphone 6 plus)?
I tried:
```
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView
cellForItemAtIndexPath:(NSIndexPath *)indexPath {
(ResultCell *)[collectionView dequeu... | 2014/11/25 | [
"https://Stackoverflow.com/questions/27117449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/286802/"
] | I had the same issue with the same use case. I finally ended up doing
```
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return CGSizeMake(collectionView.bounds.size.width, 150);
}
```
This change... | The size of the cells are specified by the layout object of the collection view. Are you using a `UICollectionViewFlowLayout`? Try either setting the `itemSize` property of the layout object or implementing the delegate method: `collectionView:layout:sizeForItemAtIndexPath:`
You will be able to specify the size of the... |
20,316,005 | I have this code <http://jsfiddle.net/8dFVU/> and not sure why it triggers twice when you click on the "show price" I guess it is because the checkbox and label but, why? Thanks.
here is the code
```
(function($){
$(".selector").on('click', function() {
console.log( $(this) );
$("... | 2013/12/01 | [
"https://Stackoverflow.com/questions/20316005",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2360754/"
] | Delete .\_LunchList.java (\*all files starting with .\_xyz.java\*) file in the src folder or your package folder. These files are **hidden** so you have to mark option to show hidden files in your file explorer. | Try to fix project properties by right clicking on the project > Android Tools > Fix Project Properties
After that clean your project.
If it doesn't work then try to delete the project and then re-import it.
Check its libraries they could be broken or corrupted. |
95,755 | This is the HackerRank problem [Algorithmic Crush](https://www.hackerrank.com/contests/w4/challenges/crush):
>
> You are given a list of size `N`, initialized with zeroes. You have to perform `M` operations on the list and output the maximum of final values of all the `N` elements in the list. For every operation, yo... | 2015/07/04 | [
"https://codereview.stackexchange.com/questions/95755",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/77157/"
] | >
> **Constraints**
>
>
> \$3 ≤ N ≤ 10^7\$
>
> \$1 ≤ M ≤ 2 \cdot 10^5\$
>
> \$1 ≤ a ≤ b ≤ N\$
>
> \$0 ≤ k ≤ 10^9\$
>
>
>
You should verify that every value you read from the user is a valid value in your program.
As far as complexity goes, a suffix tree with a complexity of \$O(N\log{}N)\$ compared ... | A few general coding style suggestions:
* Rather than assigning `M` and `N` on separate lines, you can use tuple unpacking:
```
N, M = tempArray
```
* I'd use different variable names for the first input line, and all subsequent lines. For example:
```
init_line = [int(n) for n in input().split()] # split() defaul... |
95,755 | This is the HackerRank problem [Algorithmic Crush](https://www.hackerrank.com/contests/w4/challenges/crush):
>
> You are given a list of size `N`, initialized with zeroes. You have to perform `M` operations on the list and output the maximum of final values of all the `N` elements in the list. For every operation, yo... | 2015/07/04 | [
"https://codereview.stackexchange.com/questions/95755",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/77157/"
] | A few general coding style suggestions:
* Rather than assigning `M` and `N` on separate lines, you can use tuple unpacking:
```
N, M = tempArray
```
* I'd use different variable names for the first input line, and all subsequent lines. For example:
```
init_line = [int(n) for n in input().split()] # split() defaul... | Allow me to cite my answer from the Hackerrank [discussion](https://www.hackerrank.com/challenges/crush/forum/comments/395339).
**Explanation:**
A straight forward implementation would start with an array \$s[i] = 0\$ for \$i \in \{ 1, \dotsc, n \}\$ and perform \$m\$ modifications, where the elements \$s[j]\$ for
\... |
95,755 | This is the HackerRank problem [Algorithmic Crush](https://www.hackerrank.com/contests/w4/challenges/crush):
>
> You are given a list of size `N`, initialized with zeroes. You have to perform `M` operations on the list and output the maximum of final values of all the `N` elements in the list. For every operation, yo... | 2015/07/04 | [
"https://codereview.stackexchange.com/questions/95755",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/77157/"
] | A few general coding style suggestions:
* Rather than assigning `M` and `N` on separate lines, you can use tuple unpacking:
```
N, M = tempArray
```
* I'd use different variable names for the first input line, and all subsequent lines. For example:
```
init_line = [int(n) for n in input().split()] # split() defaul... | Trying to explain @Snowhawk's answer in even simpler terms,
The solution can be handled using prefix sum.
Prefix sum calculates the summ of all integers before it and store the result in same or different array.
For the query a b k (a = left edge, b = right edge, k = no. to add)
Here, we'll add the 3rd no of query, k... |
95,755 | This is the HackerRank problem [Algorithmic Crush](https://www.hackerrank.com/contests/w4/challenges/crush):
>
> You are given a list of size `N`, initialized with zeroes. You have to perform `M` operations on the list and output the maximum of final values of all the `N` elements in the list. For every operation, yo... | 2015/07/04 | [
"https://codereview.stackexchange.com/questions/95755",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/77157/"
] | A few general coding style suggestions:
* Rather than assigning `M` and `N` on separate lines, you can use tuple unpacking:
```
N, M = tempArray
```
* I'd use different variable names for the first input line, and all subsequent lines. For example:
```
init_line = [int(n) for n in input().split()] # split() defaul... | Constraints-
3≤≤10^7
1≤≤2⋅10^5
1≤≤≤
0≤≤10^9
**Why your brute force solution will not work?**
Today generation system can perform 10^8 operation in one second. keep this in mind you have to process N=10^7 input per query in worse case. so if you use your solution with O(NM) complexity it has to handle (10^7 \*10 ^... |
95,755 | This is the HackerRank problem [Algorithmic Crush](https://www.hackerrank.com/contests/w4/challenges/crush):
>
> You are given a list of size `N`, initialized with zeroes. You have to perform `M` operations on the list and output the maximum of final values of all the `N` elements in the list. For every operation, yo... | 2015/07/04 | [
"https://codereview.stackexchange.com/questions/95755",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/77157/"
] | >
> **Constraints**
>
>
> \$3 ≤ N ≤ 10^7\$
>
> \$1 ≤ M ≤ 2 \cdot 10^5\$
>
> \$1 ≤ a ≤ b ≤ N\$
>
> \$0 ≤ k ≤ 10^9\$
>
>
>
You should verify that every value you read from the user is a valid value in your program.
As far as complexity goes, a suffix tree with a complexity of \$O(N\log{}N)\$ compared ... | Allow me to cite my answer from the Hackerrank [discussion](https://www.hackerrank.com/challenges/crush/forum/comments/395339).
**Explanation:**
A straight forward implementation would start with an array \$s[i] = 0\$ for \$i \in \{ 1, \dotsc, n \}\$ and perform \$m\$ modifications, where the elements \$s[j]\$ for
\... |
95,755 | This is the HackerRank problem [Algorithmic Crush](https://www.hackerrank.com/contests/w4/challenges/crush):
>
> You are given a list of size `N`, initialized with zeroes. You have to perform `M` operations on the list and output the maximum of final values of all the `N` elements in the list. For every operation, yo... | 2015/07/04 | [
"https://codereview.stackexchange.com/questions/95755",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/77157/"
] | >
> **Constraints**
>
>
> \$3 ≤ N ≤ 10^7\$
>
> \$1 ≤ M ≤ 2 \cdot 10^5\$
>
> \$1 ≤ a ≤ b ≤ N\$
>
> \$0 ≤ k ≤ 10^9\$
>
>
>
You should verify that every value you read from the user is a valid value in your program.
As far as complexity goes, a suffix tree with a complexity of \$O(N\log{}N)\$ compared ... | Trying to explain @Snowhawk's answer in even simpler terms,
The solution can be handled using prefix sum.
Prefix sum calculates the summ of all integers before it and store the result in same or different array.
For the query a b k (a = left edge, b = right edge, k = no. to add)
Here, we'll add the 3rd no of query, k... |
95,755 | This is the HackerRank problem [Algorithmic Crush](https://www.hackerrank.com/contests/w4/challenges/crush):
>
> You are given a list of size `N`, initialized with zeroes. You have to perform `M` operations on the list and output the maximum of final values of all the `N` elements in the list. For every operation, yo... | 2015/07/04 | [
"https://codereview.stackexchange.com/questions/95755",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/77157/"
] | >
> **Constraints**
>
>
> \$3 ≤ N ≤ 10^7\$
>
> \$1 ≤ M ≤ 2 \cdot 10^5\$
>
> \$1 ≤ a ≤ b ≤ N\$
>
> \$0 ≤ k ≤ 10^9\$
>
>
>
You should verify that every value you read from the user is a valid value in your program.
As far as complexity goes, a suffix tree with a complexity of \$O(N\log{}N)\$ compared ... | Constraints-
3≤≤10^7
1≤≤2⋅10^5
1≤≤≤
0≤≤10^9
**Why your brute force solution will not work?**
Today generation system can perform 10^8 operation in one second. keep this in mind you have to process N=10^7 input per query in worse case. so if you use your solution with O(NM) complexity it has to handle (10^7 \*10 ^... |
95,755 | This is the HackerRank problem [Algorithmic Crush](https://www.hackerrank.com/contests/w4/challenges/crush):
>
> You are given a list of size `N`, initialized with zeroes. You have to perform `M` operations on the list and output the maximum of final values of all the `N` elements in the list. For every operation, yo... | 2015/07/04 | [
"https://codereview.stackexchange.com/questions/95755",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/77157/"
] | Allow me to cite my answer from the Hackerrank [discussion](https://www.hackerrank.com/challenges/crush/forum/comments/395339).
**Explanation:**
A straight forward implementation would start with an array \$s[i] = 0\$ for \$i \in \{ 1, \dotsc, n \}\$ and perform \$m\$ modifications, where the elements \$s[j]\$ for
\... | Constraints-
3≤≤10^7
1≤≤2⋅10^5
1≤≤≤
0≤≤10^9
**Why your brute force solution will not work?**
Today generation system can perform 10^8 operation in one second. keep this in mind you have to process N=10^7 input per query in worse case. so if you use your solution with O(NM) complexity it has to handle (10^7 \*10 ^... |
95,755 | This is the HackerRank problem [Algorithmic Crush](https://www.hackerrank.com/contests/w4/challenges/crush):
>
> You are given a list of size `N`, initialized with zeroes. You have to perform `M` operations on the list and output the maximum of final values of all the `N` elements in the list. For every operation, yo... | 2015/07/04 | [
"https://codereview.stackexchange.com/questions/95755",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/77157/"
] | Trying to explain @Snowhawk's answer in even simpler terms,
The solution can be handled using prefix sum.
Prefix sum calculates the summ of all integers before it and store the result in same or different array.
For the query a b k (a = left edge, b = right edge, k = no. to add)
Here, we'll add the 3rd no of query, k... | Constraints-
3≤≤10^7
1≤≤2⋅10^5
1≤≤≤
0≤≤10^9
**Why your brute force solution will not work?**
Today generation system can perform 10^8 operation in one second. keep this in mind you have to process N=10^7 input per query in worse case. so if you use your solution with O(NM) complexity it has to handle (10^7 \*10 ^... |
1,311 | I want a writing panel for a custom field called 'Sub-title' and would like it to appear in its logical place in the Page editor (that is, between the title and the Page content). Is that possible?
I would like to avoid having to create a custom post type, since a Page + custom fields is all I really need. | 2010/09/03 | [
"https://wordpress.stackexchange.com/questions/1311",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/106/"
] | I am wondering why my first answer was down-voted. :)
I think the only way to do is to add a meta box below the post content field and use javascript to move it above.
This is the way it is done with the slug field in the WordPress core (the slug field is were you edit the page or post url). Disable javascript in you... | You can add it below the content area and use javascript code to move it above it. |
1,311 | I want a writing panel for a custom field called 'Sub-title' and would like it to appear in its logical place in the Page editor (that is, between the title and the Page content). Is that possible?
I would like to avoid having to create a custom post type, since a Page + custom fields is all I really need. | 2010/09/03 | [
"https://wordpress.stackexchange.com/questions/1311",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/106/"
] | I'd like to also suggest the use of [WPAlchemy Meta Box](http://farinspace.com/wpalchemy-metabox/) for creating your meta boxes ...
Then do something like:
```
$custom_metabox = new WPAlchemy_MetaBox(array
(
'id' => '_custom_meta',
'title' => 'My Custom Meta',
'template' => TEMPLATEPATH . '/custom/meta.ph... | You can add it below the content area and use javascript code to move it above it. |
1,311 | I want a writing panel for a custom field called 'Sub-title' and would like it to appear in its logical place in the Page editor (that is, between the title and the Page content). Is that possible?
I would like to avoid having to create a custom post type, since a Page + custom fields is all I really need. | 2010/09/03 | [
"https://wordpress.stackexchange.com/questions/1311",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/106/"
] | I am wondering why my first answer was down-voted. :)
I think the only way to do is to add a meta box below the post content field and use javascript to move it above.
This is the way it is done with the slug field in the WordPress core (the slug field is were you edit the page or post url). Disable javascript in you... | You could have a look at the excellent qTranslate. That should provide you with an example of everything you need since it adds a.o. multiple Title boxes. |
1,311 | I want a writing panel for a custom field called 'Sub-title' and would like it to appear in its logical place in the Page editor (that is, between the title and the Page content). Is that possible?
I would like to avoid having to create a custom post type, since a Page + custom fields is all I really need. | 2010/09/03 | [
"https://wordpress.stackexchange.com/questions/1311",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/106/"
] | I'd like to also suggest the use of [WPAlchemy Meta Box](http://farinspace.com/wpalchemy-metabox/) for creating your meta boxes ...
Then do something like:
```
$custom_metabox = new WPAlchemy_MetaBox(array
(
'id' => '_custom_meta',
'title' => 'My Custom Meta',
'template' => TEMPLATEPATH . '/custom/meta.ph... | You could have a look at the excellent qTranslate. That should provide you with an example of everything you need since it adds a.o. multiple Title boxes. |
1,311 | I want a writing panel for a custom field called 'Sub-title' and would like it to appear in its logical place in the Page editor (that is, between the title and the Page content). Is that possible?
I would like to avoid having to create a custom post type, since a Page + custom fields is all I really need. | 2010/09/03 | [
"https://wordpress.stackexchange.com/questions/1311",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/106/"
] | I am wondering why my first answer was down-voted. :)
I think the only way to do is to add a meta box below the post content field and use javascript to move it above.
This is the way it is done with the slug field in the WordPress core (the slug field is were you edit the page or post url). Disable javascript in you... | To the best of my knowledge the priority of a meta box is limited to: Low, Default and High. Which is unlike admin menus that let you specify a value and put it anywhere. I'd try "High."
You can change the order of all your meta boxes by dragging and dropping so where ever High puts the subtitle you can drag it to be... |
1,311 | I want a writing panel for a custom field called 'Sub-title' and would like it to appear in its logical place in the Page editor (that is, between the title and the Page content). Is that possible?
I would like to avoid having to create a custom post type, since a Page + custom fields is all I really need. | 2010/09/03 | [
"https://wordpress.stackexchange.com/questions/1311",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/106/"
] | I'd like to also suggest the use of [WPAlchemy Meta Box](http://farinspace.com/wpalchemy-metabox/) for creating your meta boxes ...
Then do something like:
```
$custom_metabox = new WPAlchemy_MetaBox(array
(
'id' => '_custom_meta',
'title' => 'My Custom Meta',
'template' => TEMPLATEPATH . '/custom/meta.ph... | To the best of my knowledge the priority of a meta box is limited to: Low, Default and High. Which is unlike admin menus that let you specify a value and put it anywhere. I'd try "High."
You can change the order of all your meta boxes by dragging and dropping so where ever High puts the subtitle you can drag it to be... |
1,311 | I want a writing panel for a custom field called 'Sub-title' and would like it to appear in its logical place in the Page editor (that is, between the title and the Page content). Is that possible?
I would like to avoid having to create a custom post type, since a Page + custom fields is all I really need. | 2010/09/03 | [
"https://wordpress.stackexchange.com/questions/1311",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/106/"
] | I am wondering why my first answer was down-voted. :)
I think the only way to do is to add a meta box below the post content field and use javascript to move it above.
This is the way it is done with the slug field in the WordPress core (the slug field is were you edit the page or post url). Disable javascript in you... | I'd like to also suggest the use of [WPAlchemy Meta Box](http://farinspace.com/wpalchemy-metabox/) for creating your meta boxes ...
Then do something like:
```
$custom_metabox = new WPAlchemy_MetaBox(array
(
'id' => '_custom_meta',
'title' => 'My Custom Meta',
'template' => TEMPLATEPATH . '/custom/meta.ph... |
20,516,487 | I have a form\_for, which has an input text field, the inputed text is sent to a controller which is doing a search on a table from db.
But I would like to do something different, instead of inputing the text in a text field, I want to create default search queries. Which will be buttons with text, and based on that t... | 2013/12/11 | [
"https://Stackoverflow.com/questions/20516487",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2839522/"
] | Why not use HTML and Javascript:
```
<!-- in your view -->
<%= form_tag pos_project(@project), method: :get, id: "your_search_form" do %>
<p>
<%= hidden_field_tag :query, params[:query] %>
<%= submit_tag "Search", name: nil %>
</p>
<% for value in your_preset_values do %>
<%= link_to(value, '#', data: { search_qu... | You can use "commit" from parameter to find which button is pressed.
So in controller you will get
```
params[:commit]="button1" # or
params[:commit]="button2" # or
params[:commit]="button3" # based on which button you pressed
``` |
3,699,159 | Hi there i am creating some classes and methods for my project so that it can be used over and over
now the problem is this that is has lots of functions in these dlls. i want to give them some name as alias name so that user can easily find and call these function as per their requirements ..
is there any way to cal... | 2010/09/13 | [
"https://Stackoverflow.com/questions/3699159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264586/"
] | In what language?
In C#, creating an alias to a method is as easy as:
```
public class Demo
{
public int SomeMethodHere(string argument)
{
// Code here.
}
public int AliasToSomeMethod(string argument)
{
return this.SomeMethodHere(argument);
}
}
``` | Do the functions need to be overridable?
If not just have another function call the alias that calls the main function. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.