qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
1,849,245 | Python has [IPython](http://ipython.scipy.org/).. does OCaml have anything similar?
I'd very much like to have command history, although other features would be nice too. I've read that I could get command history by running it in Emacs, but I don't use Emacs.. | 2009/12/04 | [
"https://Stackoverflow.com/questions/1849245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149330/"
] | There's [utop](https://forge.ocamlcore.org/projects/utop/)! It has autocompletion, is emacs compatible and so on. | You can also use the online [toplevel](http://try.ocamlpro.com/). |
42,518,413 | I currently have replication configured such that my S3 documents on us-east-1 are replicated to a bucket on us-west-2. In light of today's *(gasp)* AWS outage, I considered failing over to us-west-2 (which appears to be online at the moment). So, I have several questions about this:
1. Would documents uploaded to us-... | 2017/02/28 | [
"https://Stackoverflow.com/questions/42518413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/192687/"
] | The issue with bi-directional replication always boils down to "who has the correct version" of data. It's not so hard right now when there is only one source of data but what about when there are two? If one process writes to one region and another writes the same thing to another, what adjudicates the conflict?
This... | Implementing Bi-Directional Cross-Region Replication for Amazon Simple Storage Service (Amazon S3)
<https://wellarchitectedlabs.com/Reliability/200_Bidirectional_Replication_for_S3/README.html> |
42,518,413 | I currently have replication configured such that my S3 documents on us-east-1 are replicated to a bucket on us-west-2. In light of today's *(gasp)* AWS outage, I considered failing over to us-west-2 (which appears to be online at the moment). So, I have several questions about this:
1. Would documents uploaded to us-... | 2017/02/28 | [
"https://Stackoverflow.com/questions/42518413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/192687/"
] | The issue with bi-directional replication always boils down to "who has the correct version" of data. It's not so hard right now when there is only one source of data but what about when there are two? If one process writes to one region and another writes the same thing to another, what adjudicates the conflict?
This... | We setup cross region mutual replication rules on both regions so that they could replicate each other. Seems to be working fine over the years.
The reason it does not do infinite loop is the `principal` is different for upload and replication. If you listen to your `s3 event` in *Lambda*, this is more obvious:
For o... |
42,518,413 | I currently have replication configured such that my S3 documents on us-east-1 are replicated to a bucket on us-west-2. In light of today's *(gasp)* AWS outage, I considered failing over to us-west-2 (which appears to be online at the moment). So, I have several questions about this:
1. Would documents uploaded to us-... | 2017/02/28 | [
"https://Stackoverflow.com/questions/42518413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/192687/"
] | We setup cross region mutual replication rules on both regions so that they could replicate each other. Seems to be working fine over the years.
The reason it does not do infinite loop is the `principal` is different for upload and replication. If you listen to your `s3 event` in *Lambda*, this is more obvious:
For o... | Implementing Bi-Directional Cross-Region Replication for Amazon Simple Storage Service (Amazon S3)
<https://wellarchitectedlabs.com/Reliability/200_Bidirectional_Replication_for_S3/README.html> |
8,390,796 | I'm doing an assignment where I am to consider two solutions for storing text used in a webpage.
Scenario: there is one webpage for one lecture, and several lectures for one subject.
The first alternative is a normal relational database, this one is ok.
The other alternative is a table with two "normal" attributes, ... | 2011/12/05 | [
"https://Stackoverflow.com/questions/8390796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713821/"
] | The only reason to store data in XML is if you are receiving the data in XML and wish to treat it as one continuous container of "stuff". Trying to query XML is a challenge sometimes, regardless of the ability to do so with all the fancy Oracle functions. I've done it, but the performace penalties can be rough, or you ... | In your first alternative you will have to use a `LOB` data type for the column storing the webpages. If you use `VARCHAR2`, you will loose the formatting.
In the second alternative for the `XMLTYPE` column you can choose `LOB/CLOB` storage or you can choose to break it up into object relational tables and views. `XM... |
8,390,796 | I'm doing an assignment where I am to consider two solutions for storing text used in a webpage.
Scenario: there is one webpage for one lecture, and several lectures for one subject.
The first alternative is a normal relational database, this one is ok.
The other alternative is a table with two "normal" attributes, ... | 2011/12/05 | [
"https://Stackoverflow.com/questions/8390796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713821/"
] | The only reason to store data in XML is if you are receiving the data in XML and wish to treat it as one continuous container of "stuff". Trying to query XML is a challenge sometimes, regardless of the ability to do so with all the fancy Oracle functions. I've done it, but the performace penalties can be rough, or you ... | A few reasons I can think of (off the top of my head):
1. If the data is not relational in nature but rather hierarchical and irregular, XML might be a more appropriate storage option than trying to force the data into tabular structures.
2. If you store the data as XML it may be easier to transform it to XHMTL for di... |
38,628,118 | I have an svg img I got from thenounproject.com (don't worry, I have a place on my site where I give credit to the creators of the images) which I have inside a div. I have set the CSS of the div to have `overflow: hidden;` however the img is stickout out of the bottom, changing the height of the containing div above t... | 2016/07/28 | [
"https://Stackoverflow.com/questions/38628118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6623517/"
] | This is called [union type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) in typescript.
>
> A union type describes a value that can be one of several types.
>
>
>
Pipe (`|`) is used to separate each type, so for example `number | string | boolean` is the type of a value that can... | The pipe represents 'or'. So in this context it says that either of the declared types is allowed. Perhaps it is easy to understand a union with primitive types:
```
let x: (string | number);
x = 1; //ok
x = 'myString'; //ok
x = true; //compilation error for a boolean
``` |
38,628,118 | I have an svg img I got from thenounproject.com (don't worry, I have a place on my site where I give credit to the creators of the images) which I have inside a div. I have set the CSS of the div to have `overflow: hidden;` however the img is stickout out of the bottom, changing the height of the containing div above t... | 2016/07/28 | [
"https://Stackoverflow.com/questions/38628118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6623517/"
] | This is called [union type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) in typescript.
>
> A union type describes a value that can be one of several types.
>
>
>
Pipe (`|`) is used to separate each type, so for example `number | string | boolean` is the type of a value that can... | Anytime that we use an OR operator on an argument, here's what is happening behind the scenes on that
operation to limit the number of properties that we can actually reference on unmatchable.
So any time we use this or operator type script is going to take a look at the two different types and
it's going to say you ca... |
38,628,118 | I have an svg img I got from thenounproject.com (don't worry, I have a place on my site where I give credit to the creators of the images) which I have inside a div. I have set the CSS of the div to have `overflow: hidden;` however the img is stickout out of the bottom, changing the height of the containing div above t... | 2016/07/28 | [
"https://Stackoverflow.com/questions/38628118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6623517/"
] | The pipe represents 'or'. So in this context it says that either of the declared types is allowed. Perhaps it is easy to understand a union with primitive types:
```
let x: (string | number);
x = 1; //ok
x = 'myString'; //ok
x = true; //compilation error for a boolean
``` | Anytime that we use an OR operator on an argument, here's what is happening behind the scenes on that
operation to limit the number of properties that we can actually reference on unmatchable.
So any time we use this or operator type script is going to take a look at the two different types and
it's going to say you ca... |
45,831,390 | Below is the explanation in detail
**I have setup the post data**
```js
var post_data = JSON.stringify({
"primaryContact": {
"id": 'contact_id'
},
"subject": "subject"
});
```
**Setup the https module options**
```js
var https_options_post = {
host: hostName,
method: 'POST',
... | 2017/08/23 | [
"https://Stackoverflow.com/questions/45831390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8310113/"
] | There is no data being written into the `request` stream and the server keeps expects `Content-Length` bytes of data. Writing `request.write(post_data)` before `request.end()` solved it | **Confluence with Node.js Example Reference:**
```
reqGet.write(jsonObject)
reqGet.end();
reqGet.on('error', function(e) {
console.error(e);
});
```
Code copied Ref & full example on,
<https://www.snippetbucket.com/confluence-nodejs-rest-api/> |
23,734,594 | When connect to remote DB and get encoding config get this:
in windows command line:
```
mysql> show variables like 'char%';
+--------------------------+----------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------+
| ... | 2014/05/19 | [
"https://Stackoverflow.com/questions/23734594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3447664/"
] | It's not entirely clear what your question is, but I assume you wonder why certain character sets are different comparing the command line client and MySQL Workbench.
If you look closer you will see the only differences are those that affect the client (resultset, client + connection charsets). So, it's quite obvious ... | I think you need to look at the `GLOBAL` variables
```
show global variables like 'char%';
```
You can find the file that workbench is using by going to `Edit connection`, and use tab `System Profile`.
Link with screenshot: [Is the file "my.ini" in the wrong place?](https://stackoverflow.com/questions/23262381/is-t... |
62,623,206 | I've been trying to build a basic tab system with vanilla JS.
I'm using a for loop in order to add the class **active** when a tab is clicked. That's working fine but now I need to display the respective tab-content element underneath.
I've tried using the same approach such as by adding the following to the switchClas... | 2020/06/28 | [
"https://Stackoverflow.com/questions/62623206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2592429/"
] | You need to find the index of the clicked tab, and then use that to display the content at the same index.
1. Use `querySelectorAll` instead of `querySelector` (this will only select one element)
2. The class is named `show-content` not `show`.
3. Remove the `show-content` class within the for loop.
4. Find the index ... | Your tabContents variable will be an array of elements. So you will need to access the specific element using the relevant index:
```
tabContents[0].classList.add("show-contents");
``` |
62,623,206 | I've been trying to build a basic tab system with vanilla JS.
I'm using a for loop in order to add the class **active** when a tab is clicked. That's working fine but now I need to display the respective tab-content element underneath.
I've tried using the same approach such as by adding the following to the switchClas... | 2020/06/28 | [
"https://Stackoverflow.com/questions/62623206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2592429/"
] | ```js
const tabs = document.querySelectorAll(".tab");
const contents = document.querySelectorAll(".tab-content");
tabs.forEach(tab => tab.addEventListener("click", function() {
tabs.forEach(tab => tab.classList.remove("active"));
contents.forEach(c => c.classList.remove("show-content"));
const contentId = this.... | Your tabContents variable will be an array of elements. So you will need to access the specific element using the relevant index:
```
tabContents[0].classList.add("show-contents");
``` |
62,623,206 | I've been trying to build a basic tab system with vanilla JS.
I'm using a for loop in order to add the class **active** when a tab is clicked. That's working fine but now I need to display the respective tab-content element underneath.
I've tried using the same approach such as by adding the following to the switchClas... | 2020/06/28 | [
"https://Stackoverflow.com/questions/62623206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2592429/"
] | you can use event delegation an get the current number of the clicked tab
```
const ulAllTabs = document.querySelector('ul#all-tabs')
, ulAllTabsLi = ulAllTabs.querySelectorAll('li')
, AllContentsDiv = document.querySelectorAll('#all-contents > div')
;
ulAllTabs.onclick=e=>
{
if (!e.target.matche... | Your tabContents variable will be an array of elements. So you will need to access the specific element using the relevant index:
```
tabContents[0].classList.add("show-contents");
``` |
62,623,206 | I've been trying to build a basic tab system with vanilla JS.
I'm using a for loop in order to add the class **active** when a tab is clicked. That's working fine but now I need to display the respective tab-content element underneath.
I've tried using the same approach such as by adding the following to the switchClas... | 2020/06/28 | [
"https://Stackoverflow.com/questions/62623206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2592429/"
] | You need to find the index of the clicked tab, and then use that to display the content at the same index.
1. Use `querySelectorAll` instead of `querySelector` (this will only select one element)
2. The class is named `show-content` not `show`.
3. Remove the `show-content` class within the for loop.
4. Find the index ... | ```js
const tabs = document.querySelectorAll(".tab");
const contents = document.querySelectorAll(".tab-content");
tabs.forEach(tab => tab.addEventListener("click", function() {
tabs.forEach(tab => tab.classList.remove("active"));
contents.forEach(c => c.classList.remove("show-content"));
const contentId = this.... |
62,623,206 | I've been trying to build a basic tab system with vanilla JS.
I'm using a for loop in order to add the class **active** when a tab is clicked. That's working fine but now I need to display the respective tab-content element underneath.
I've tried using the same approach such as by adding the following to the switchClas... | 2020/06/28 | [
"https://Stackoverflow.com/questions/62623206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2592429/"
] | You need to find the index of the clicked tab, and then use that to display the content at the same index.
1. Use `querySelectorAll` instead of `querySelector` (this will only select one element)
2. The class is named `show-content` not `show`.
3. Remove the `show-content` class within the for loop.
4. Find the index ... | you can use event delegation an get the current number of the clicked tab
```
const ulAllTabs = document.querySelector('ul#all-tabs')
, ulAllTabsLi = ulAllTabs.querySelectorAll('li')
, AllContentsDiv = document.querySelectorAll('#all-contents > div')
;
ulAllTabs.onclick=e=>
{
if (!e.target.matche... |
53,201,750 | This is the code snippet I'm using. The placeholder is not showing in UI. I am using antd controls.
```
<Select placeholder="Select A User Role" value={'RoleID'}>
<Option value='2'>Company Admin</Option>
<Option value='3'>Company User</Option>
</Select>
```
[](https://i.stack.imgur.com/eq3Dg.png)
Work... | The default class selector for `Select` component is `ant-select` (not `ant-select-dropdown` as in the code you provided). Giving the component a width using the correct class name should work.
Also as mentioned in @baitun's comment, you need to remove the `value` property in order to show the placeholder. |
53,201,750 | This is the code snippet I'm using. The placeholder is not showing in UI. I am using antd controls.
```
<Select placeholder="Select A User Role" value={'RoleID'}>
<Option value='2'>Company Admin</Option>
<Option value='3'>Company User</Option>
</Select>
```
[](https://i.stack.imgur.com/eq3Dg.png)
Work... | I don't if I am right but I think you must code it like below
```
<select>
<!-- Use an option being selected and disabled default -->
<option value="" selected disabled>Please select</option>
<option value="">A</option>
<option value="">B</option>
<option value="">C</option>
</select>
```
The abo... |
53,201,750 | This is the code snippet I'm using. The placeholder is not showing in UI. I am using antd controls.
```
<Select placeholder="Select A User Role" value={'RoleID'}>
<Option value='2'>Company Admin</Option>
<Option value='3'>Company User</Option>
</Select>
```
[. Giving the component a width using the correct class name should work.
Also as mentioned in @baitun's comment, you need to remove the `value` property in order to show the placeholder. | I don't if I am right but I think you must code it like below
```
<select>
<!-- Use an option being selected and disabled default -->
<option value="" selected disabled>Please select</option>
<option value="">A</option>
<option value="">B</option>
<option value="">C</option>
</select>
```
The abo... |
20,204,553 | this is part of my code my code:
```
Connection dbcon=null;
Statement stm;
ResultSet rs;
ResultSetMetaData metadata;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (java.lang.ClassNotFoundException e) {
System.out.print("ClassNotFoundException: ");
Sy... | 2013/11/25 | [
"https://Stackoverflow.com/questions/20204553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3034087/"
] | I would comment but I don't have enough reputation.
It shouldn't have to do with how many columns you are trying to print. It just doesn't like the format of at least one of the strings you are fetching. Try to print only the name column and see if it works. If not, then it's probably not being decoded correctly.
If... | this is a java bug, update to java 1.7.60 at least |
20,204,553 | this is part of my code my code:
```
Connection dbcon=null;
Statement stm;
ResultSet rs;
ResultSetMetaData metadata;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (java.lang.ClassNotFoundException e) {
System.out.print("ClassNotFoundException: ");
Sy... | 2013/11/25 | [
"https://Stackoverflow.com/questions/20204553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3034087/"
] | I would comment but I don't have enough reputation.
It shouldn't have to do with how many columns you are trying to print. It just doesn't like the format of at least one of the strings you are fetching. Try to print only the name column and see if it works. If not, then it's probably not being decoded correctly.
If... | I was having this issue with 64-bit Java 7 update 67. It's working for me on a different 32-bit machine using the same version of the JRE. It might work to switch to the 32 bit JRE.
The 32 bit Access 2010 ODBC driver cannot be installed if you have 64 bit Office installed, so I can't try the 32 bit JVM on the same mac... |
41,853,501 | I am trying return back results such as information about it after identifying certain words from google cloud API. I'm just doing a hard coded results return to the app.
For example, using google cloud text api, the app will return the string of the text on the boxes of Panadol. Within the string, they will identify... | 2017/01/25 | [
"https://Stackoverflow.com/questions/41853501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7469130/"
] | Got it solved.
It was solved by shifting this code within the controller just below the response. Thank all for helping :)
```
function contains(str,text) {
return str.indexOf(text) >= 0 ;
}
if (contains(me.image_description,'panadol')){
me.product_result = 'test';
}
``` | You have a syntax error in your contains function.
Try this :
```
function contains(str,text) {
return str.indexOf(text) >= 0;
}
``` |
289,662 | I salvaged a stepper motor from an old computer i had laying around, it has 6 wires. The problem is that when i try and measure the resistance between the wires i only get 1 Center tap where the resistance is halved. All other 5 wires are connected to the same coil. I thought this was weird so i opened the motor and tr... | 2017/03/01 | [
"https://electronics.stackexchange.com/questions/289662",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/140760/"
] | Interesting, looks like what you have there is a 5-phase STAR, 6 cable model like this one.
[](https://i.stack.imgur.com/kYywu.gif)
[](https://i.stack.imgur.com/xOH8i.jpg)
[DRIVER C... | You probably don't need a special driver -> the driving sequency for a typical 5/6 wire motor should work, adapted for your motor, obviously.
finding the windings' sequence would be tricky. |
1,771,551 | I'm currently trying to solve this problem:
Find the unique solution to the differential equation
$y''- y'- 6y = 18x$
With initial conditions $y'(0) = 0 , y(0) = 0$
My current solution is $y = -3x + 1/2 + Ae^{3x} + Be^{-2x}$ and I'm struggling at the last step of finding $A$ and $B$.
Any help would be greatly appreci... | 2016/05/04 | [
"https://math.stackexchange.com/questions/1771551",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/337009/"
] | Think about this: $\tau\_1=G\_1$, where $G\_1$ is Geometric with parameter $\frac 12$. Continue inductively:
$$\tau\_{n+1} = \tau\_n + G\_{n+1},$$
where $G\_{n+1}$ is Geometric with parameter $\frac 12$, independent of $\tau\_n$.
Therefore for each $n\ge 1$, $\tau\_n$ is the sum of $n$ independent Geometric with p... | It looks like you're overcounting... The sequence $(1, 1, \dots \text{ <<996 more "1"s>> } \dots, 1, 1, 0)$ is included in your $k=1$ count, even though that walk stopped when $k=0$. You actually require that the last $X\_i$ is $1$, so you only need to scatter $999$ $1$s in the preceding sequence. |
7,368,407 | I have a multidimentional array composed of latin and Berber strings that I want to use as a reference to replace input data:
```
var alphabet = Array ( Array( 'a', 'ⴰ' ), Array( 'b', 'ⴱ' ), Array( 'g', 'ⴳ' ), Array( 'gw', 'ⴳⵯ' ), Array( 'd', 'ⴷ' ), Array( 'ḍ', 'ⴹ' ), Array( 'e', 'ⴻ' ), Array( 'f', 'ⴼ' ), Array( 'k',... | 2011/09/09 | [
"https://Stackoverflow.com/questions/7368407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/232082/"
] | You need to use a regular expression with the global option set to replace all of the instances. But, you can also simplify this code a bit and get rid of the loop. Instead of Arrays, use an object:
```
var alphabet = {
'a': 'ⴰ',
'b': 'ⴱ',
'g': 'ⴳ',
'gw': 'ⴳⵯ',
'd': 'ⴷ',
'ḍ': 'ⴹ',
...
'... | If you change:
```
tifinaghized += word.replace(word_split, alphabet[i][1]);
```
to use [regular expressions](https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions):
```
tifinaghized += word.replace(new RegExp(word_split, 'g'), alphabet[i][1]);
```
the g will find all occurrences. |
118,104 | I looked up the above-mentioned collocations in different dictionaries and still don't know how to use them properly. The question is not about the meaning "to be helpful", but when to use which.Can we use them interchangeably? Thank you.
>
> Was he (any/a/of any/of much/ help to them?- No, he wasn't (a/much/any/of m... | 2017/02/02 | [
"https://ell.stackexchange.com/questions/118104",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/25687/"
] | >
> Was he any help to them? *(most common)*
>
> Was he much help to them?
>
> Was he of any help to them?
>
>
>
All ask the question was "he" able to offer help.
"Of any help", or "of much help" is used to ask if there was even a small bit of help provided where the expectation of the asker is there will ... | "Being a help" isn't really correct at all, so you can disregard that option. What I think you're having trouble with is the difference between being *of* help VS being (any, much, little) help. the former can be used by itself (e.g. "is there any way I could be of help?"), while the latter needs a describing word betw... |
161,399 | I have a control where I have to check in which page I am, so I can set a certain variable accordingly.
```
string pageName = this.Page.ToString();
switch (pageName)
{
case "ASP.foo_bar_aspx": doSomething(); break;
default: doSomethingElse(); break;
}
```
this works fine locally and on some developmentservers, howev... | 2008/10/02 | [
"https://Stackoverflow.com/questions/161399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15981/"
] | You cant rely on auto generated names. Use types instead, eg:
```
if (Page is FooBar) { ... }
``` | That seems like a really dodgy way of getting the current request. Have you tried using `HttpContext.Current.Request.FilePath` or another `HttpContext.Current.Request...` variable instead? |
59,795,796 | Let's say I'm constructing a set of Strings where each String is a prefix of the next one. For example, imagine I write a function:
```
public Set<String> example(List<String> strings) {
Set<String> result = new HashSet<>();
String incremental = "";
for (String s : strings) {
incremental = incremen... | 2020/01/17 | [
"https://Stackoverflow.com/questions/59795796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12734377/"
] | Since you have them in `.gitignore` you have nothing to worry about.
You can go ahead and do the following
```
git add foo
git status
```
This will list all the files that have been added. You can `grep` them if you want. If you see a file in there that you don't want, you can just `unstage` them, by doing the foll... | If git is showing `foo/` as an untracked folder, It will add all of it to staging.
It depends on the project `.gitignore` what will be added on staging. |
59,795,796 | Let's say I'm constructing a set of Strings where each String is a prefix of the next one. For example, imagine I write a function:
```
public Set<String> example(List<String> strings) {
Set<String> result = new HashSet<>();
String incremental = "";
for (String s : strings) {
incremental = incremen... | 2020/01/17 | [
"https://Stackoverflow.com/questions/59795796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12734377/"
] | To do this *before* adding the files:
```
git status -uall
```
or if you like the more verbose spelling:
```
git status --untracked-files=all
```
This will list all the files that Git sees as untracked, minus any files that are untracked but suppressed via a `.gitignore`. Add any missing names or patterns to the ... | If git is showing `foo/` as an untracked folder, It will add all of it to staging.
It depends on the project `.gitignore` what will be added on staging. |
59,795,796 | Let's say I'm constructing a set of Strings where each String is a prefix of the next one. For example, imagine I write a function:
```
public Set<String> example(List<String> strings) {
Set<String> result = new HashSet<>();
String incremental = "";
for (String s : strings) {
incremental = incremen... | 2020/01/17 | [
"https://Stackoverflow.com/questions/59795796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12734377/"
] | yet another option is to use `git add --interactive` to step through adding of each file
this will lead you through a prompt which will ask you to add each of the files that you specified
```
$ git add --interactive foo
*** Commands ***
1: status 2: update 3: revert 4: add untracked
5: patch ... | If git is showing `foo/` as an untracked folder, It will add all of it to staging.
It depends on the project `.gitignore` what will be added on staging. |
59,795,796 | Let's say I'm constructing a set of Strings where each String is a prefix of the next one. For example, imagine I write a function:
```
public Set<String> example(List<String> strings) {
Set<String> result = new HashSet<>();
String incremental = "";
for (String s : strings) {
incremental = incremen... | 2020/01/17 | [
"https://Stackoverflow.com/questions/59795796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12734377/"
] | To do this *before* adding the files:
```
git status -uall
```
or if you like the more verbose spelling:
```
git status --untracked-files=all
```
This will list all the files that Git sees as untracked, minus any files that are untracked but suppressed via a `.gitignore`. Add any missing names or patterns to the ... | Since you have them in `.gitignore` you have nothing to worry about.
You can go ahead and do the following
```
git add foo
git status
```
This will list all the files that have been added. You can `grep` them if you want. If you see a file in there that you don't want, you can just `unstage` them, by doing the foll... |
59,795,796 | Let's say I'm constructing a set of Strings where each String is a prefix of the next one. For example, imagine I write a function:
```
public Set<String> example(List<String> strings) {
Set<String> result = new HashSet<>();
String incremental = "";
for (String s : strings) {
incremental = incremen... | 2020/01/17 | [
"https://Stackoverflow.com/questions/59795796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12734377/"
] | To do this *before* adding the files:
```
git status -uall
```
or if you like the more verbose spelling:
```
git status --untracked-files=all
```
This will list all the files that Git sees as untracked, minus any files that are untracked but suppressed via a `.gitignore`. Add any missing names or patterns to the ... | yet another option is to use `git add --interactive` to step through adding of each file
this will lead you through a prompt which will ask you to add each of the files that you specified
```
$ git add --interactive foo
*** Commands ***
1: status 2: update 3: revert 4: add untracked
5: patch ... |
17,652,576 | Is there a way to send the fully generated html code of its own web page using javascript. For example, at a button click event, the current html code of the page is sent back to the server. How to do this? | 2013/07/15 | [
"https://Stackoverflow.com/questions/17652576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/855562/"
] | I know it's super frustrating and some what confusing to get this all to work. Been there, done that.
There are a couple things at play here, so take them one at a time (in fact. I'm just guessing some stuff so I'm happy to update this answer as you let me know more)
Let's start with:
`Warning: Experimental support ... | I recently tried the upgrade from 10.6 to 10.8 (to install rails, bundler, RVM) and had lots of the same problems with brew and RVM conflicting AND having their own separate problems (PATH, permissions/non-writable folders, old versions XCode etc). It went off without problems after i tripled backed up everything (TMac... |
59,675,974 | I have a ScreenA with 2 buttons. Button 1 pushes ScreenB(snapshot) and is received as ScreenB(this.snapshot). Button 2 pushes ScreenB(null). Depending on wether snapshot is null or not in ScreenB, different methods are triggered in ScreenB initState.
Now, If I first press Button 2, i.e. ScreenB(null), snapshot is ind... | 2020/01/10 | [
"https://Stackoverflow.com/questions/59675974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9926076/"
] | >
> I have just tried using the same migrations as yours. I do get the
> error when I run the both migrations at 1 go, some points to take care
> while you are creating the migrations above:
>
>
>
* Make sure that both the migrations are created individually
* Make sure the the migration for the answers is creat... | You are getting that error probably because you are trying to create `questions` table **before** `answers` table.
`questions` table **is dependent** on `answers` table.
So create `answers` first. |
59,675,974 | I have a ScreenA with 2 buttons. Button 1 pushes ScreenB(snapshot) and is received as ScreenB(this.snapshot). Button 2 pushes ScreenB(null). Depending on wether snapshot is null or not in ScreenB, different methods are triggered in ScreenB initState.
Now, If I first press Button 2, i.e. ScreenB(null), snapshot is ind... | 2020/01/10 | [
"https://Stackoverflow.com/questions/59675974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9926076/"
] | >
> I have just tried using the same migrations as yours. I do get the
> error when I run the both migrations at 1 go, some points to take care
> while you are creating the migrations above:
>
>
>
* Make sure that both the migrations are created individually
* Make sure the the migration for the answers is creat... | The solution is here:
First, you have to create an `answers` table, which means first create a migration that is not dependent on any other table.
Migrations must be created `Top-Down`.
As `best_answer_id` belongs to `answers` table, but `answer` table is not migrated yet.
Try to run this, your table will get migra... |
49,989 | I'm building a 3D printer and I'm using an ATmega2560 + RAMPS board.
The whole thing is powered by an ATX PSU (12v for motors and stuff, 5v for the Arduino), but when I plug in my USB cable, I can't shut the printer down, as it switches over to USB power.
Is there a way to make the Arduino never use the USB power, on... | 2018/02/19 | [
"https://arduino.stackexchange.com/questions/49989",
"https://arduino.stackexchange.com",
"https://arduino.stackexchange.com/users/7326/"
] | The best way of doing this, if you want your USB connection to still work, is to remove the P-channel MOSFET `T1` from the board.
[](https://i.stack.imgur.com/FWAXF.jpg)
You can't just disconnect the power from the USB port since that power connecti... | you could do this if you cut the trace for the 5V line from the USB connector to the rest of the board. if you place the mega underside up on a bench in front of you, with the USB facing towards you, i believe it should be the top left pin of the 4 USB pins, but you should double check that first. |
49,989 | I'm building a 3D printer and I'm using an ATmega2560 + RAMPS board.
The whole thing is powered by an ATX PSU (12v for motors and stuff, 5v for the Arduino), but when I plug in my USB cable, I can't shut the printer down, as it switches over to USB power.
Is there a way to make the Arduino never use the USB power, on... | 2018/02/19 | [
"https://arduino.stackexchange.com/questions/49989",
"https://arduino.stackexchange.com",
"https://arduino.stackexchange.com/users/7326/"
] | you could do this if you cut the trace for the 5V line from the USB connector to the rest of the board. if you place the mega underside up on a bench in front of you, with the USB facing towards you, i believe it should be the top left pin of the 4 USB pins, but you should double check that first. | Just modify your UBS cable to not provide power. |
49,989 | I'm building a 3D printer and I'm using an ATmega2560 + RAMPS board.
The whole thing is powered by an ATX PSU (12v for motors and stuff, 5v for the Arduino), but when I plug in my USB cable, I can't shut the printer down, as it switches over to USB power.
Is there a way to make the Arduino never use the USB power, on... | 2018/02/19 | [
"https://arduino.stackexchange.com/questions/49989",
"https://arduino.stackexchange.com",
"https://arduino.stackexchange.com/users/7326/"
] | The best way of doing this, if you want your USB connection to still work, is to remove the P-channel MOSFET `T1` from the board.
[](https://i.stack.imgur.com/FWAXF.jpg)
You can't just disconnect the power from the USB port since that power connecti... | Just modify your UBS cable to not provide power. |
17,645,877 | Is it possible to bind a model from both the Uri and Body?
For instance, given the following:
```
routes.MapHttpRoute(
name: "API Default",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
public class ProductsController : ApiController
{
public HttpResponseMe... | 2013/07/15 | [
"https://Stackoverflow.com/questions/17645877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386287/"
] | Alright, I came up with a way to do it. Basically, I made an action filter which will run after the model has been populated from JSON. It will then look at the URL parameters, and set the appropriate properties on the model. Full source below:
```
using System.ComponentModel;
using System.Linq;
using System.Net;
usin... | If I understood you, this should work out of the box, e.g. this works for me:
```
[HttpPost]
public ActionResult Test(TempModel model)
{
ViewBag.Message = "Test: " + model.Id +", " + model.Name;
return View("About");
}
public class TempModel
{
public int Id { get; set; }
publi... |
17,645,877 | Is it possible to bind a model from both the Uri and Body?
For instance, given the following:
```
routes.MapHttpRoute(
name: "API Default",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
public class ProductsController : ApiController
{
public HttpResponseMe... | 2013/07/15 | [
"https://Stackoverflow.com/questions/17645877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386287/"
] | You can define your own DefaultActionValueBinder. Then you can mix and match from body and uri. Here is a blog post with an example of an MvcActionValueBinder for Web Api. Making your own DefaultActionValueBinderis a preferred solution because it guarantees the binder will have finished before any other ActionFilterAtt... | If I understood you, this should work out of the box, e.g. this works for me:
```
[HttpPost]
public ActionResult Test(TempModel model)
{
ViewBag.Message = "Test: " + model.Id +", " + model.Name;
return View("About");
}
public class TempModel
{
public int Id { get; set; }
publi... |
17,645,877 | Is it possible to bind a model from both the Uri and Body?
For instance, given the following:
```
routes.MapHttpRoute(
name: "API Default",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
public class ProductsController : ApiController
{
public HttpResponseMe... | 2013/07/15 | [
"https://Stackoverflow.com/questions/17645877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386287/"
] | Here's an improved version of odyth's answer that:
1. Works for bodiless requests too, and
2. Gets parameters from the query string in addition to from route values.
For brevity I just post the ExecuteBindingAsyncCore method and a new auxiliary method, the rest of the class is the same.
```
private async Task Execut... | If I understood you, this should work out of the box, e.g. this works for me:
```
[HttpPost]
public ActionResult Test(TempModel model)
{
ViewBag.Message = "Test: " + model.Id +", " + model.Name;
return View("About");
}
public class TempModel
{
public int Id { get; set; }
publi... |
17,645,877 | Is it possible to bind a model from both the Uri and Body?
For instance, given the following:
```
routes.MapHttpRoute(
name: "API Default",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
public class ProductsController : ApiController
{
public HttpResponseMe... | 2013/07/15 | [
"https://Stackoverflow.com/questions/17645877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386287/"
] | Here's an improved version of odyth's answer that:
1. Works for bodiless requests too, and
2. Gets parameters from the query string in addition to from route values.
For brevity I just post the ExecuteBindingAsyncCore method and a new auxiliary method, the rest of the class is the same.
```
private async Task Execut... | Alright, I came up with a way to do it. Basically, I made an action filter which will run after the model has been populated from JSON. It will then look at the URL parameters, and set the appropriate properties on the model. Full source below:
```
using System.ComponentModel;
using System.Linq;
using System.Net;
usin... |
17,645,877 | Is it possible to bind a model from both the Uri and Body?
For instance, given the following:
```
routes.MapHttpRoute(
name: "API Default",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
public class ProductsController : ApiController
{
public HttpResponseMe... | 2013/07/15 | [
"https://Stackoverflow.com/questions/17645877",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386287/"
] | Here's an improved version of odyth's answer that:
1. Works for bodiless requests too, and
2. Gets parameters from the query string in addition to from route values.
For brevity I just post the ExecuteBindingAsyncCore method and a new auxiliary method, the rest of the class is the same.
```
private async Task Execut... | You can define your own DefaultActionValueBinder. Then you can mix and match from body and uri. Here is a blog post with an example of an MvcActionValueBinder for Web Api. Making your own DefaultActionValueBinderis a preferred solution because it guarantees the binder will have finished before any other ActionFilterAtt... |
7,454,694 | When I numerically solving a ode with the following code, warnings named "evfrf" prompted.
I am wondering how to force variables of differential equations to be Real numbers
```
NDSolve[{y''[t] + .1 y'[t] + Sin[y[t]] == 0, y'[0] == 1,
y[0] == 0}, y, {t, 0, 20},
Method -> {"EventLocator", "Event" -> y[t],
"EventCon... | 2011/09/17 | [
"https://Stackoverflow.com/questions/7454694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/755685/"
] | I don't think this is an issue of the answer genuinely being a complex number at those points.
The following does not give an error.
```
sol = NDSolve[{y''[t] + .1 y'[t] + Sin[y[t]] == 0, y'[0] == 1,
y[0] == 0}, y, {t, 0, 20}]
Plot[y[t] /. sol, {t, 0, 20}]
```
 to passages going up (y'[t]>0), you can replace that part with `"Direction" -> 1` which does the same.
Alternatively, you could simply swi... |
7,454,694 | When I numerically solving a ode with the following code, warnings named "evfrf" prompted.
I am wondering how to force variables of differential equations to be Real numbers
```
NDSolve[{y''[t] + .1 y'[t] + Sin[y[t]] == 0, y'[0] == 1,
y[0] == 0}, y, {t, 0, 20},
Method -> {"EventLocator", "Event" -> y[t],
"EventCon... | 2011/09/17 | [
"https://Stackoverflow.com/questions/7454694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/755685/"
] | The error message seems to be caused by the `"EventCondition" -> y'[t] >= 0` part only. I don't know what the problem is there, but given that you want to restrict events (y[t]==0) to passages going up (y'[t]>0), you can replace that part with `"Direction" -> 1` which does the same.
Alternatively, you could simply swi... | is it important to use the EventLocator? is it possible to solve for y' and then apply FindRoot on it? something like:
```
ndsolveOptions = {MaxSteps -> Infinity, Method -> {"StiffnessSwitching",
Method ->{"ExplicitRungeKutta", Automatic}}, AccuracyGoal -> 10,PrecisionGoal -> 10};
sol = First@NDSolve[{y''[t] + .1 ... |
139,613 | I'm using an iPhone, but I would imagine it's the same for other mobile devices as well. If you browse to any stack exchange site, you get a very well made mobile site. The only gripe that I have is that I can't find any way to view the number of visitors to my questions?
Am I missing something or could this possibly ... | 2012/07/13 | [
"https://meta.stackexchange.com/questions/139613",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/163813/"
] | Number of views is hidden on the mobile version of the site. Click on the *full site* link at the bottom of the page to view the desktop version of the site, then the number of views will be displayed on the right of the screen. Click on *mobile* in order to return to the mobile version. | What happens is that the browsers are detected whether if they were a mobile or a desktop browser, so that if it were a mobile device, the content downloaded will be smaller, less images and graphics to save you some bytes. This is important if you are using a mobile data plan.
The expected on any website that support... |
49,269,426 | I am working on an aframe project where runtime loading of 3D object is required. I have read A-Frame documentations, and aframe doesn't seem to support runtime assets loading at all.
I discovered this aframe-asset-on-demand-component by protyze (<https://github.com/protyze/aframe-asset-on-demand-component>) and it se... | 2018/03/14 | [
"https://Stackoverflow.com/questions/49269426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9489059/"
] | Ignore `<a-assets>` since that is for pre-runtime network preloading.
Just set the model component with setAttribute:
`el.setAttribute('gltf-model', 'path/to/model.gltf')`
or
`el.setAttribute('obj-model', {obj: 'path/to/model.obj'})` | You can create a custom component that will use one of the three.js loaders, to load the model when you want to:
```
// instantiate a loader
var loader = new THREE.OBJLoader();
// load a resource
loader.load(
// resource URL
'models/monster.obj',
// called when resource is loaded
function ( object ) {
sc... |
49,269,426 | I am working on an aframe project where runtime loading of 3D object is required. I have read A-Frame documentations, and aframe doesn't seem to support runtime assets loading at all.
I discovered this aframe-asset-on-demand-component by protyze (<https://github.com/protyze/aframe-asset-on-demand-component>) and it se... | 2018/03/14 | [
"https://Stackoverflow.com/questions/49269426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9489059/"
] | Ignore `<a-assets>` since that is for pre-runtime network preloading.
Just set the model component with setAttribute:
`el.setAttribute('gltf-model', 'path/to/model.gltf')`
or
`el.setAttribute('obj-model', {obj: 'path/to/model.obj'})` | @ngokevin, Great answer! I've created plunker demo for that.
>
> <https://plnkr.co/edit/yOmsxOSSfkVuX7c739Q1?p=info>
>
>
>
```
<a-scene embedded arjs="sourceType: webcam;">
<a-gltf-model id="lantern" src="#lantern" position="" 0 0 0"></a-gltf-model>
<a-marker-camera preset="hiro"></a-marker-camera... |
42,628,920 | This is my main application code:
```
package u.d.dip.rs.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
impo... | 2017/03/06 | [
"https://Stackoverflow.com/questions/42628920",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4595515/"
] | The error was because of an issue with gradle 3.4 I've changed my gradle distribution to 3.2 and everything is working fine now.
Please refer this for more information:
<https://github.com/gradle/gradle/issues/1335>
Hope this solves your problem. | I fix this error by change gradle3.4 to 3.2 |
42,628,920 | This is my main application code:
```
package u.d.dip.rs.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
impo... | 2017/03/06 | [
"https://Stackoverflow.com/questions/42628920",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4595515/"
] | The error was because of an issue with gradle 3.4 I've changed my gradle distribution to 3.2 and everything is working fine now.
Please refer this for more information:
<https://github.com/gradle/gradle/issues/1335>
Hope this solves your problem. | If you are using IntelliJ Idea, the new version 2016.3.6 solved this issue. |
42,628,920 | This is my main application code:
```
package u.d.dip.rs.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
impo... | 2017/03/06 | [
"https://Stackoverflow.com/questions/42628920",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4595515/"
] | The error was because of an issue with gradle 3.4 I've changed my gradle distribution to 3.2 and everything is working fine now.
Please refer this for more information:
<https://github.com/gradle/gradle/issues/1335>
Hope this solves your problem. | i encountered this problem too, just with another story.
i am using spring boot 2.2.5 and gradle 5.1.2.
run `gradle build -x test`, it will tell you what error it is.
in my case, it told me that `error: package org.jasig.cas.client.authentication does not exist`, but this package exists in fact.
then i remembered t... |
42,628,920 | This is my main application code:
```
package u.d.dip.rs.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
impo... | 2017/03/06 | [
"https://Stackoverflow.com/questions/42628920",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4595515/"
] | The error was because of an issue with gradle 3.4 I've changed my gradle distribution to 3.2 and everything is working fine now.
Please refer this for more information:
<https://github.com/gradle/gradle/issues/1335>
Hope this solves your problem. | I understand this is an old thread, but still adding an answer.
Spring Boot will add two jars under build\libs\ (once we execute ./gradlew clean build or equivalent) \*.jar(this will be jar with all dependencies) and \*-plain.jar(will not have any dependencies). Now \*-plain.jar is getting picked up and executed and c... |
42,628,920 | This is my main application code:
```
package u.d.dip.rs.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
impo... | 2017/03/06 | [
"https://Stackoverflow.com/questions/42628920",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4595515/"
] | If you are using IntelliJ Idea, the new version 2016.3.6 solved this issue. | I fix this error by change gradle3.4 to 3.2 |
42,628,920 | This is my main application code:
```
package u.d.dip.rs.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
impo... | 2017/03/06 | [
"https://Stackoverflow.com/questions/42628920",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4595515/"
] | I fix this error by change gradle3.4 to 3.2 | I understand this is an old thread, but still adding an answer.
Spring Boot will add two jars under build\libs\ (once we execute ./gradlew clean build or equivalent) \*.jar(this will be jar with all dependencies) and \*-plain.jar(will not have any dependencies). Now \*-plain.jar is getting picked up and executed and c... |
42,628,920 | This is my main application code:
```
package u.d.dip.rs.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
impo... | 2017/03/06 | [
"https://Stackoverflow.com/questions/42628920",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4595515/"
] | If you are using IntelliJ Idea, the new version 2016.3.6 solved this issue. | i encountered this problem too, just with another story.
i am using spring boot 2.2.5 and gradle 5.1.2.
run `gradle build -x test`, it will tell you what error it is.
in my case, it told me that `error: package org.jasig.cas.client.authentication does not exist`, but this package exists in fact.
then i remembered t... |
42,628,920 | This is my main application code:
```
package u.d.dip.rs.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
impo... | 2017/03/06 | [
"https://Stackoverflow.com/questions/42628920",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4595515/"
] | If you are using IntelliJ Idea, the new version 2016.3.6 solved this issue. | I understand this is an old thread, but still adding an answer.
Spring Boot will add two jars under build\libs\ (once we execute ./gradlew clean build or equivalent) \*.jar(this will be jar with all dependencies) and \*-plain.jar(will not have any dependencies). Now \*-plain.jar is getting picked up and executed and c... |
42,628,920 | This is my main application code:
```
package u.d.dip.rs.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
impo... | 2017/03/06 | [
"https://Stackoverflow.com/questions/42628920",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4595515/"
] | i encountered this problem too, just with another story.
i am using spring boot 2.2.5 and gradle 5.1.2.
run `gradle build -x test`, it will tell you what error it is.
in my case, it told me that `error: package org.jasig.cas.client.authentication does not exist`, but this package exists in fact.
then i remembered t... | I understand this is an old thread, but still adding an answer.
Spring Boot will add two jars under build\libs\ (once we execute ./gradlew clean build or equivalent) \*.jar(this will be jar with all dependencies) and \*-plain.jar(will not have any dependencies). Now \*-plain.jar is getting picked up and executed and c... |
29,228,305 | Is there any way to add page number to newly created slide with style inherited from previous slide?
```
XMLSlideShow slideShow = new XMLSlideShow(new FileInputStream("templateFile.pptx"));
final XSLFSlide[] slides = slideShow.getSlides();
XSLFSlideMaster defaultMaster = slideShow.getSlideMasters()[0];
XSL... | 2015/03/24 | [
"https://Stackoverflow.com/questions/29228305",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2764414/"
] | I think you need to create the new XSLFSlide using
```
slideShow.createSlide(layout);
```
where layout is the XSLFSlideLayout you can get from the master sheet
using
```
XSLFSlideMaster defaultMaster = slideShow.getSlideMasters()[0];
XSLFSlideLayout titleLayout = defaultMaster.getLayout(SlideLayout.TITLE);
```... | Okay, combined with @Andreas Kuhntopf answer, I came to solution. First i need to select correct style for slide and later I need to manually copy `spPr` element of type `numSld`
```
XSLFSlideMaster defaultMaster = slideShow.getSlideMasters()[0];
XSLFSlideLayout titleLayout = defaultMaster.getLayout(Sl... |
15,902,542 | I am trying to set time out value for:
```
CloudBlobClient cloudBlobClientUserData = cloudClientAccountUserData.createCloudBlobClient();
cloudBlobClientUserData.setTimeoutInMs(60000); //1 Minute
CloudBlobContainer container = cloudBlobClientUserData.getContainerReference(containerName);
CloudBlockBlob blob = contain... | 2013/04/09 | [
"https://Stackoverflow.com/questions/15902542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1083991/"
] | I went through the documentation of this functionality [here](https://github.com/WindowsAzure/azure-sdk-for-java/blob/master/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/ServiceClient.java) and one thing caught my eye is the last statement below:
>
> The server timeout interval b... | The timeout setting applies to a single storage service operation. I'm not sure how big your blob is, but I suspect it is being uploaded in smaller chunks. Each chunk that is uploaded is subject to the timeout. So, while the entire upload may be taking several minutes, each chunk is getting completed within the timeout... |
15,902,542 | I am trying to set time out value for:
```
CloudBlobClient cloudBlobClientUserData = cloudClientAccountUserData.createCloudBlobClient();
cloudBlobClientUserData.setTimeoutInMs(60000); //1 Minute
CloudBlobContainer container = cloudBlobClientUserData.getContainerReference(containerName);
CloudBlockBlob blob = contain... | 2013/04/09 | [
"https://Stackoverflow.com/questions/15902542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1083991/"
] | I went through the documentation of this functionality [here](https://github.com/WindowsAzure/azure-sdk-for-java/blob/master/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/core/storage/ServiceClient.java) and one thing caught my eye is the last statement below:
>
> The server timeout interval b... | I am not super familiar with the Android stuff, but can you trace the request? You should see the REST call on the wire and it will have a '&timeout=xxx' parameter if it is getting set. Usually this is per block and not per blob. What is your retry policy? Make sure you turn that off as well. |
3,222,342 | Greetings Everyone,
I'm currently using Wordpress as my CMS and leveraging Facebook's Graph API for the user account/registration "stuff".
My question is how do I use Facebook's PHP SDK (found here: <http://github.com/facebook/php-sdk/>), when Wordpress compiles several php files to output a single webpage? In other... | 2010/07/11 | [
"https://Stackoverflow.com/questions/3222342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253348/"
] | If you set `$facebook` in `header.php`, you **won't** be able to access it in `index.php` unless you globalise it.
This is because `header.php` is loaded in via the function `get_header()`, which narrows [the scope](http://php.net/manual/en/language.variables.scope.php) of all non-global variables.
So you could eithe... | Once you include the facebook client in your header.php file and create an instance of that:
```
$facebook = new Facebook('API', 'SECRET');
```
You can then access the facebook client instance `$facebook` from your index.php file or even footer.php file or anyother file on which header.php is included. |
3,222,342 | Greetings Everyone,
I'm currently using Wordpress as my CMS and leveraging Facebook's Graph API for the user account/registration "stuff".
My question is how do I use Facebook's PHP SDK (found here: <http://github.com/facebook/php-sdk/>), when Wordpress compiles several php files to output a single webpage? In other... | 2010/07/11 | [
"https://Stackoverflow.com/questions/3222342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253348/"
] | Once you include the facebook client in your header.php file and create an instance of that:
```
$facebook = new Facebook('API', 'SECRET');
```
You can then access the facebook client instance `$facebook` from your index.php file or even footer.php file or anyother file on which header.php is included. | Consider using the Wordpress Facebook Connect Plugin, which already implements this. |
3,222,342 | Greetings Everyone,
I'm currently using Wordpress as my CMS and leveraging Facebook's Graph API for the user account/registration "stuff".
My question is how do I use Facebook's PHP SDK (found here: <http://github.com/facebook/php-sdk/>), when Wordpress compiles several php files to output a single webpage? In other... | 2010/07/11 | [
"https://Stackoverflow.com/questions/3222342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253348/"
] | If you set `$facebook` in `header.php`, you **won't** be able to access it in `index.php` unless you globalise it.
This is because `header.php` is loaded in via the function `get_header()`, which narrows [the scope](http://php.net/manual/en/language.variables.scope.php) of all non-global variables.
So you could eithe... | PHP is processed in order, that is you need to make sure that `header.php` is included before the call happens in `index.php`. It's possible that overall you have something like this:
In index.php
```
<?php
// blah blah other code
$session = $facebook->getSession();
// blah blah more code
include('header.php');
```
... |
3,222,342 | Greetings Everyone,
I'm currently using Wordpress as my CMS and leveraging Facebook's Graph API for the user account/registration "stuff".
My question is how do I use Facebook's PHP SDK (found here: <http://github.com/facebook/php-sdk/>), when Wordpress compiles several php files to output a single webpage? In other... | 2010/07/11 | [
"https://Stackoverflow.com/questions/3222342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253348/"
] | PHP is processed in order, that is you need to make sure that `header.php` is included before the call happens in `index.php`. It's possible that overall you have something like this:
In index.php
```
<?php
// blah blah other code
$session = $facebook->getSession();
// blah blah more code
include('header.php');
```
... | Consider using the Wordpress Facebook Connect Plugin, which already implements this. |
3,222,342 | Greetings Everyone,
I'm currently using Wordpress as my CMS and leveraging Facebook's Graph API for the user account/registration "stuff".
My question is how do I use Facebook's PHP SDK (found here: <http://github.com/facebook/php-sdk/>), when Wordpress compiles several php files to output a single webpage? In other... | 2010/07/11 | [
"https://Stackoverflow.com/questions/3222342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253348/"
] | If you set `$facebook` in `header.php`, you **won't** be able to access it in `index.php` unless you globalise it.
This is because `header.php` is loaded in via the function `get_header()`, which narrows [the scope](http://php.net/manual/en/language.variables.scope.php) of all non-global variables.
So you could eithe... | Consider using the Wordpress Facebook Connect Plugin, which already implements this. |
17,408,795 | I've encountered problem trying to send a Post request and get result, here is my code:
```
function connect2($hostname,$method,$path,$data,$cookie){
$fp=fsockopen($hostname, 80, $errno, $errstr, 30);
if(!$fp) echo "$errstr($errno)<br>/>\n";
else{
$headers="$method $path HTTP/1.1\r\n";
$headers... | 2013/07/01 | [
"https://Stackoverflow.com/questions/17408795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1956641/"
] | Here you have a small code red-colouring the background when certain word ("anything") is written in a richtextbox. I hope that this will be enough to help you understand how to interact with a richtextbox at runtime. Bear in mind that it is pretty simplistic: it colours "anything" only if it is first word you introduc... | The following string: "One, Two, Three, Four" can be converted to a list of strings with the items "One" - "Two" - "Three" - "Four" with the following code:
```
string FullString = "One, Two, Three, Four";
Regex rx = new Regex(", ");
List<string> ListOfStrings = new List<string>();
foreach (string newString in rx.Spli... |
66,111,194 | I'm trying to set Primary Key on SAS and I keep getting the error mentioned below.
Any help would be great!
The first snippet is code and the next is the error.
```
/*Primary Key*/ /*Defines the unique key*/
Proc datasets lib=work;
modify WORK.FinAdvMaster;
ic create primary key(FinAdvID);
PROC PRINT DATA=WORK.FinAd... | 2021/02/09 | [
"https://Stackoverflow.com/questions/66111194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8741411/"
] | Remove `work.` from your modify statement. The `lib=` option specifies the library. It's a quirk of `proc datasets`.
```
proc datasets lib=work;
modify FinAdvMaster;
ic create primary key (FinAdvID);
quit;
```
Note that this key will be destroyed if you recreate the dataset. | You can use SQL to add a column constraint specifying `PRIMARY KEY`
Example:
```
proc sql;
create table work.class as select * from sashelp.class;
alter table work.class add constraint pk_name primary key(name);
```
In your case
```
alter table FinAdvMaster
add constraint
pk_FinAdvID primary key(FinAdvID... |
216,554 | I am currently working abroad and use my company's VPN for FTP and some browsing. This is a relatively slow connection and while it is suitable for those VPN necessities; much of my other internet usage can be done without the VPN at a much higher speed.
Is there a way to tell Safari and my FTP software to use the VPN... | 2010/11/30 | [
"https://superuser.com/questions/216554",
"https://superuser.com",
"https://superuser.com/users/57350/"
] | I would consider the use of VirtualBox/VMWare Player to run a small machine for your VPN connection requirements so you can leave your main internet connection of your computer free of customizations.
In this way, both connections are completely separated and you don't have to configure or customize your routing table... | This isn't exactly what you are looking for, but you can bypass the VPN's gateway so that anything outside the subnet will not use the VPN:
[How can I make the Windows VPN route selective traffic (by destination network)?](https://superuser.com/questions/12022/how-can-i-make-the-windows-vpn-route-selective-traffic-by-d... |
216,554 | I am currently working abroad and use my company's VPN for FTP and some browsing. This is a relatively slow connection and while it is suitable for those VPN necessities; much of my other internet usage can be done without the VPN at a much higher speed.
Is there a way to tell Safari and my FTP software to use the VPN... | 2010/11/30 | [
"https://superuser.com/questions/216554",
"https://superuser.com",
"https://superuser.com/users/57350/"
] | It looks like you know what network IPs and domain you are connecting to.
A way of achieving this would be to only use the VPN based on which IP/domain you are requesting.
You can do this by using the macOS built-in VPN with "Send all traffic through VPN" *unchecked*, and define routes.
For instance, if your FTP ser... | This isn't exactly what you are looking for, but you can bypass the VPN's gateway so that anything outside the subnet will not use the VPN:
[How can I make the Windows VPN route selective traffic (by destination network)?](https://superuser.com/questions/12022/how-can-i-make-the-windows-vpn-route-selective-traffic-by-d... |
216,554 | I am currently working abroad and use my company's VPN for FTP and some browsing. This is a relatively slow connection and while it is suitable for those VPN necessities; much of my other internet usage can be done without the VPN at a much higher speed.
Is there a way to tell Safari and my FTP software to use the VPN... | 2010/11/30 | [
"https://superuser.com/questions/216554",
"https://superuser.com",
"https://superuser.com/users/57350/"
] | I would consider the use of VirtualBox/VMWare Player to run a small machine for your VPN connection requirements so you can leave your main internet connection of your computer free of customizations.
In this way, both connections are completely separated and you don't have to configure or customize your routing table... | In the Advanced section of the VPN settings there is a setting that accomplishes what you want, with some possible caveats. It does what's described in another answer here, in that it sends internet traffic via your normal default gateway, and just adds a route to the VPN subnet to your routing table.
There may be som... |
216,554 | I am currently working abroad and use my company's VPN for FTP and some browsing. This is a relatively slow connection and while it is suitable for those VPN necessities; much of my other internet usage can be done without the VPN at a much higher speed.
Is there a way to tell Safari and my FTP software to use the VPN... | 2010/11/30 | [
"https://superuser.com/questions/216554",
"https://superuser.com",
"https://superuser.com/users/57350/"
] | It looks like you know what network IPs and domain you are connecting to.
A way of achieving this would be to only use the VPN based on which IP/domain you are requesting.
You can do this by using the macOS built-in VPN with "Send all traffic through VPN" *unchecked*, and define routes.
For instance, if your FTP ser... | In the Advanced section of the VPN settings there is a setting that accomplishes what you want, with some possible caveats. It does what's described in another answer here, in that it sends internet traffic via your normal default gateway, and just adds a route to the VPN subnet to your routing table.
There may be som... |
216,554 | I am currently working abroad and use my company's VPN for FTP and some browsing. This is a relatively slow connection and while it is suitable for those VPN necessities; much of my other internet usage can be done without the VPN at a much higher speed.
Is there a way to tell Safari and my FTP software to use the VPN... | 2010/11/30 | [
"https://superuser.com/questions/216554",
"https://superuser.com",
"https://superuser.com/users/57350/"
] | I would consider the use of VirtualBox/VMWare Player to run a small machine for your VPN connection requirements so you can leave your main internet connection of your computer free of customizations.
In this way, both connections are completely separated and you don't have to configure or customize your routing table... | It looks like you know what network IPs and domain you are connecting to.
A way of achieving this would be to only use the VPN based on which IP/domain you are requesting.
You can do this by using the macOS built-in VPN with "Send all traffic through VPN" *unchecked*, and define routes.
For instance, if your FTP ser... |
64,166,938 | Problem:
========
I have multiple `textarea`s that can be navigated using arrow keys. The `textarea`s are focused using `ref.focus()`.
When the `textarea`s are focused this way, the text selection is not cleared?
Screenshot
==========
[](https://i.... | 2020/10/02 | [
"https://Stackoverflow.com/questions/64166938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11460922/"
] | **Short Answer :**
`termios.h`, a POSIX-standard header file, allows you to get the tty into **raw mode** whereas it is generally in *cooked mode* .
Reading it's documentation/man pages is suggested.
A webpage that deals *step-by-step* with setting up raw mode with `termios.h` is linked [here](https://viewsourcecode... | As stated above, the quandry of losing vital layers of abstraction when taking a low-level approach to user input programming is very real. Another way to avoid re-implementing the functionality of readline, etc. is to read bytes into your program directly from the controlling tty, as raw or as cooked by termios.h as y... |
35,085,983 | I`ve got a dropdown list in my Symfony2 form like this:
```
$builder->add('categories','entity', array(
'class' => 'MyBundle:Myentity',
'property' => 'name',
'label' => 'Mylabel',
'expanded' => false,
'multiple' => false,
'label_attr' ... | 2016/01/29 | [
"https://Stackoverflow.com/questions/35085983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5413802/"
] | Since Symfony 2.7 you can set the option `choice_attr` to ChoiceType and set it a callable receiving the choice as an argument.
EntityType inherits this option and the choice in that case is the instantiated entity, so you can write something like :
```
$builder->add('categories','entity', array(
'class' => 'MyBu... | You can't do that in easy way.
But you can put more information in select label.
Look on
<http://symfony.com/doc/current/reference/forms/types/entity.html#choice-label>
Yout can put here more field details and get it from your javascript. |
20,457,077 | I have a class:
```
class Window(QtGui.QMainWindow):
def __init__(self, parent=None):
super(Window, self).__init__(parent)
self.USB
def setPort(self, text):
if text == 'ttyUSB0':
USB = serial.Serial(
port='/dev/ttyUSB0',\
... | 2013/12/08 | [
"https://Stackoverflow.com/questions/20457077",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2351645/"
] | You don't want to use a global variable here. In general, global variables are discouraged because they lead to messy spaghetti code.
In your `__init__` method you're trying to *access* the instance variable `USB`. It doesn't exist at that point so you have to set it:
```
class Window(QtGui.QMainWindow):
def __in... | define self.USB while defining the function **init**.
```
self.USB = "something"
``` |
20,457,077 | I have a class:
```
class Window(QtGui.QMainWindow):
def __init__(self, parent=None):
super(Window, self).__init__(parent)
self.USB
def setPort(self, text):
if text == 'ttyUSB0':
USB = serial.Serial(
port='/dev/ttyUSB0',\
... | 2013/12/08 | [
"https://Stackoverflow.com/questions/20457077",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2351645/"
] | define self.USB while defining the function **init**.
```
self.USB = "something"
``` | I have this code which is a very weird manner to play with namespaces.
Is it something like that you want to do ?
```
class A(object):
def __init__(self,x):
if x is None:
self.name = 'unknown'
else:
self.name = x
print 'class A created'
print 'y' in dir()
class Window(A... |
20,457,077 | I have a class:
```
class Window(QtGui.QMainWindow):
def __init__(self, parent=None):
super(Window, self).__init__(parent)
self.USB
def setPort(self, text):
if text == 'ttyUSB0':
USB = serial.Serial(
port='/dev/ttyUSB0',\
... | 2013/12/08 | [
"https://Stackoverflow.com/questions/20457077",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2351645/"
] | You don't want to use a global variable here. In general, global variables are discouraged because they lead to messy spaghetti code.
In your `__init__` method you're trying to *access* the instance variable `USB`. It doesn't exist at that point so you have to set it:
```
class Window(QtGui.QMainWindow):
def __in... | You should add this in the `__init__` method:
```
self.USB = None # or give it another initial value
```
Then, when you want to use this variable in other methods of the class, the usage is like this:
```
self.USB = xxx # some opertations
``` |
20,457,077 | I have a class:
```
class Window(QtGui.QMainWindow):
def __init__(self, parent=None):
super(Window, self).__init__(parent)
self.USB
def setPort(self, text):
if text == 'ttyUSB0':
USB = serial.Serial(
port='/dev/ttyUSB0',\
... | 2013/12/08 | [
"https://Stackoverflow.com/questions/20457077",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2351645/"
] | You should add this in the `__init__` method:
```
self.USB = None # or give it another initial value
```
Then, when you want to use this variable in other methods of the class, the usage is like this:
```
self.USB = xxx # some opertations
``` | I have this code which is a very weird manner to play with namespaces.
Is it something like that you want to do ?
```
class A(object):
def __init__(self,x):
if x is None:
self.name = 'unknown'
else:
self.name = x
print 'class A created'
print 'y' in dir()
class Window(A... |
20,457,077 | I have a class:
```
class Window(QtGui.QMainWindow):
def __init__(self, parent=None):
super(Window, self).__init__(parent)
self.USB
def setPort(self, text):
if text == 'ttyUSB0':
USB = serial.Serial(
port='/dev/ttyUSB0',\
... | 2013/12/08 | [
"https://Stackoverflow.com/questions/20457077",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2351645/"
] | You don't want to use a global variable here. In general, global variables are discouraged because they lead to messy spaghetti code.
In your `__init__` method you're trying to *access* the instance variable `USB`. It doesn't exist at that point so you have to set it:
```
class Window(QtGui.QMainWindow):
def __in... | I have this code which is a very weird manner to play with namespaces.
Is it something like that you want to do ?
```
class A(object):
def __init__(self,x):
if x is None:
self.name = 'unknown'
else:
self.name = x
print 'class A created'
print 'y' in dir()
class Window(A... |
56,939,942 | I am going to a URL endpoint that is rendering a JSON response, yet I see this error in my rails server logs:
>
> Started GET "/sw.js" for ::1 at 2019-07-08 22:39:43 +0530
>
>
> ActionController::RoutingError (No route matches [GET] "/sw.js"):
>
>
> actionpack (5.2.3) lib/action\_dispatch/middleware/debug\_except... | 2019/07/08 | [
"https://Stackoverflow.com/questions/56939942",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8572034/"
] | Service worker registrations persist across browser restarts, and it's unfortunately common to have an older registration retain control of a common localhost:port combination that's then reused for a different project.
You can unregister the current service worker controlling a page by running
```
navigator.serviceW... | FWIW I get this with every Rail 6.0.0 app I create. Not worked it out yet either. |
56,939,942 | I am going to a URL endpoint that is rendering a JSON response, yet I see this error in my rails server logs:
>
> Started GET "/sw.js" for ::1 at 2019-07-08 22:39:43 +0530
>
>
> ActionController::RoutingError (No route matches [GET] "/sw.js"):
>
>
> actionpack (5.2.3) lib/action\_dispatch/middleware/debug\_except... | 2019/07/08 | [
"https://Stackoverflow.com/questions/56939942",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8572034/"
] | FWIW I get this with every Rail 6.0.0 app I create. Not worked it out yet either. | simple (but dumb) solution is to add the redirect to 404 page into the `routes.rb`
```
get "/sw.js", to: redirect('/404.html')
``` |
56,939,942 | I am going to a URL endpoint that is rendering a JSON response, yet I see this error in my rails server logs:
>
> Started GET "/sw.js" for ::1 at 2019-07-08 22:39:43 +0530
>
>
> ActionController::RoutingError (No route matches [GET] "/sw.js"):
>
>
> actionpack (5.2.3) lib/action\_dispatch/middleware/debug\_except... | 2019/07/08 | [
"https://Stackoverflow.com/questions/56939942",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8572034/"
] | Service worker registrations persist across browser restarts, and it's unfortunately common to have an older registration retain control of a common localhost:port combination that's then reused for a different project.
You can unregister the current service worker controlling a page by running
```
navigator.serviceW... | simple (but dumb) solution is to add the redirect to 404 page into the `routes.rb`
```
get "/sw.js", to: redirect('/404.html')
``` |
126,826 | My postgresql 9.5 logs shows every minute the message:
>
> using stale statistics instead of current ones because stats collector is not responding
>
>
>
Except a [post on serverfault](https://serverfault.com/questions/694290/meaning-of-postgresql-log-using-stale-statistics-instead-of-current-ones-becaus) which i... | 2016/01/21 | [
"https://dba.stackexchange.com/questions/126826",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/84990/"
] | Disappeard when upgrading to 9.5.2.1 (<http://apt.postgresql.org/pub/repos/apt/>), but came back after server restart.
It seems that it was due to the service restart during installation
The workaround is to restart the service.
Closed question | This basically means your (virtual?) machine is too slow or overloaded, because the statistics collector background task is being starved. It is running with a lower priority by default, because you do not want it to disrupt normal database operations (too much).
If you can afford it, add some more CPUs to it and make... |
126,826 | My postgresql 9.5 logs shows every minute the message:
>
> using stale statistics instead of current ones because stats collector is not responding
>
>
>
Except a [post on serverfault](https://serverfault.com/questions/694290/meaning-of-postgresql-log-using-stale-statistics-instead-of-current-ones-becaus) which i... | 2016/01/21 | [
"https://dba.stackexchange.com/questions/126826",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/84990/"
] | This basically means your (virtual?) machine is too slow or overloaded, because the statistics collector background task is being starved. It is running with a lower priority by default, because you do not want it to disrupt normal database operations (too much).
If you can afford it, add some more CPUs to it and make... | This happened to me when I disabled IPv6 on the server without restarting Postgres. I came across a detailed explanation [here](https://www.cybertec-postgresql.com/en/stale-statistics-cause-table-bloat/) (search for "The statistics collector" in the page), but in short:
>
> PostgreSQL [...] will loop through all the ... |
126,826 | My postgresql 9.5 logs shows every minute the message:
>
> using stale statistics instead of current ones because stats collector is not responding
>
>
>
Except a [post on serverfault](https://serverfault.com/questions/694290/meaning-of-postgresql-log-using-stale-statistics-instead-of-current-ones-becaus) which i... | 2016/01/21 | [
"https://dba.stackexchange.com/questions/126826",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/84990/"
] | Disappeard when upgrading to 9.5.2.1 (<http://apt.postgresql.org/pub/repos/apt/>), but came back after server restart.
It seems that it was due to the service restart during installation
The workaround is to restart the service.
Closed question | To temporarily alleviate the problem until you find a solution, have you tried sending a SIGHUP to the server when it occurs?
I have a similar problem in a fairly different situation: the database runs on a windows desktop PC together with Apache and proprietary machine control software. My case fits in the "slow or o... |
126,826 | My postgresql 9.5 logs shows every minute the message:
>
> using stale statistics instead of current ones because stats collector is not responding
>
>
>
Except a [post on serverfault](https://serverfault.com/questions/694290/meaning-of-postgresql-log-using-stale-statistics-instead-of-current-ones-becaus) which i... | 2016/01/21 | [
"https://dba.stackexchange.com/questions/126826",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/84990/"
] | To temporarily alleviate the problem until you find a solution, have you tried sending a SIGHUP to the server when it occurs?
I have a similar problem in a fairly different situation: the database runs on a windows desktop PC together with Apache and proprietary machine control software. My case fits in the "slow or o... | This happened to me when I disabled IPv6 on the server without restarting Postgres. I came across a detailed explanation [here](https://www.cybertec-postgresql.com/en/stale-statistics-cause-table-bloat/) (search for "The statistics collector" in the page), but in short:
>
> PostgreSQL [...] will loop through all the ... |
126,826 | My postgresql 9.5 logs shows every minute the message:
>
> using stale statistics instead of current ones because stats collector is not responding
>
>
>
Except a [post on serverfault](https://serverfault.com/questions/694290/meaning-of-postgresql-log-using-stale-statistics-instead-of-current-ones-becaus) which i... | 2016/01/21 | [
"https://dba.stackexchange.com/questions/126826",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/84990/"
] | Disappeard when upgrading to 9.5.2.1 (<http://apt.postgresql.org/pub/repos/apt/>), but came back after server restart.
It seems that it was due to the service restart during installation
The workaround is to restart the service.
Closed question | This happened to me when I disabled IPv6 on the server without restarting Postgres. I came across a detailed explanation [here](https://www.cybertec-postgresql.com/en/stale-statistics-cause-table-bloat/) (search for "The statistics collector" in the page), but in short:
>
> PostgreSQL [...] will loop through all the ... |
13,064,624 | I use a multi module build file to trigger the build of a rather complex java project. Now I want to create the eclipse project files - but not for all modules. Is it possible to define on a pom, that it shall *ignore* the `eclipse:eclipse` goal?
The modules definition of the multi-module pom, that I call with `mvn ec... | 2012/10/25 | [
"https://Stackoverflow.com/questions/13064624",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105224/"
] | I don't believe there's a good way to just automatically remove trailing whitespace at commit time (and I don't believe it'd be a good idea to do it if you could).
I've used a hook before to reject commits that add trailing whitespace, which worked well for me; create/add the following to `.git/hooks/pre-commit` and m... | Git by default warns about trailing whitespace, and can be configured to reject commits that add whitespace errors.
Removing the whitespace works only by changing the files and redoing the `git-add` stage -- while it would be possible to do this automatically on add, this would leave a working tree that is different t... |
13,064,624 | I use a multi module build file to trigger the build of a rather complex java project. Now I want to create the eclipse project files - but not for all modules. Is it possible to define on a pom, that it shall *ignore* the `eclipse:eclipse` goal?
The modules definition of the multi-module pom, that I call with `mvn ec... | 2012/10/25 | [
"https://Stackoverflow.com/questions/13064624",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105224/"
] | I don't believe there's a good way to just automatically remove trailing whitespace at commit time (and I don't believe it'd be a good idea to do it if you could).
I've used a hook before to reject commits that add trailing whitespace, which worked well for me; create/add the following to `.git/hooks/pre-commit` and m... | Well, eventually I decided to write gitadd command for that.
```
#!/bin/bash
# Number of arguments passed
argc=$#
if [ $argc -eq 0 ]; then
argv=( $(git diff --name-only HEAD) )
else
argv=( $@ )
fi
for file in "$argv"; do
sed -i -e 's/^[[:blank:]]\+$//' $file
git add $file # stage ... |
58,695,612 | I created a class that takes a `typename` template variable and a `parameter pack`. In the next step i want to be able to pass two objects of that class to my function.
My main problem is, passing the template parameters and the objects correctly to be able to use my function.
My class implementation.
```
//auto as ... | 2019/11/04 | [
"https://Stackoverflow.com/questions/58695612",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7091177/"
] | When you call the function as
```
function<1,1, decltype(matrix1), decltype(matrix1)>(matrix1, matrix1);
```
you say that the template arguments `A` and `B` are `decltype(matrix1)`, meaning they are really `MatrixND<double, upper, lower, lower>`.
That in turn means that e.g. the argument `tensor1` will have the typ... | You need to add the parameter packs to the template parameters of `function`. Using
```
template<auto posT1, auto posT2, typename A, typename B, auto ...AIndicesN, auto ...BIndicesN>
auto constexpr function(const MatrixND<A, AIndicesN...> tensor1, const MatrixND<B, BIndicesN...> tensor2){
return 0;
}
```
Allows... |
15,357,366 | Its quite easy to convert a java object to XML by using Marshaller. But I need to convert a java object to JSON by using marshaller alone. I know its good to use gson or Xstream like things., but I need to do using Marshaller.How to achieve it?
Thanks in advance. | 2013/03/12 | [
"https://Stackoverflow.com/questions/15357366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1933756/"
] | **Note:** I'm the [**EclipseLink JAXB (MOXy)**](http://www.eclipse.org/eclipselink/moxy.php) lead and a member of the [**JAXB (JSR-222)**](http://jcp.org/en/jsr/detail?id=222) expert group,
Below is how this can be done if you are using MOXy as your JAXB provider.
* <http://blog.bdoughan.com/2011/08/json-binding-with... | JsonMarshaller is a Java 1.5 library that allows marshalling and unmarshalling of JSON objects to and from Java objects. This project's goal is above all ease of use, transparency and static type safety.
Example
If you have the following Java class:
JAVA:
```
@Entity
class Book {
@Value
private String title;
@Valu... |
211,998 | I have the following limit that I am trying to solve but apparently I am stuck in doing l'Hôpital's rule and going nowhere so any help would be appreciated
$$\lim\_{x\to 0} \frac{\arcsin {x}^2}{(\arcsin x)^2}$$
Thank you | 2012/10/13 | [
"https://math.stackexchange.com/questions/211998",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/44534/"
] | The numerator and denominator both tend to 0. Using L'Hopital's rule once, we get:
$\lim\_{x\to 0} \frac{\arcsin {x}^2}{(\arcsin x)^2} = \lim\_{x\to 0} \frac{x \sqrt{1-x^2}}{\sqrt{1-x^4} \text{ArcSin}[x]}$
Both the numerator and denominator tend to 0 as x approaches 0, so we use L'Hopital's rule again:
$\lim\_{x\to ... | $$\lim\_{x\to 0} \frac{\arcsin {x}^2}{(\arcsin x)^2}$$
$$=\lim\_{x\to 0} \frac{\frac{\arcsin {x}^2}{x^2}}{(\frac{\arcsin x}{x})^2}$$
$$=\lim\_{x\to 0} \frac{\arcsin {x}^2}{x^2}\cdot \left(\frac{x}{\arcsin x}\right)^2$$
If $\arcsin {x}^2=y,x^2=\sin y$ and $y\to 0$ as $x\to 0$
If $\arcsin {x}=z, x=\sin z$ and $z\to 0... |
68,610,235 | I want something like this:
```
**************************************************************************
* * div2 *
* * *
* ... | 2021/08/01 | [
"https://Stackoverflow.com/questions/68610235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5626375/"
] | try this code
```
import random
print("this is a game made by Sven")
print("you're supposed to guess the right number. it is between 0 & 101.")
print("lucky for you, you're getting hints.")
print("succes!")
rightnumber = (random.randint(1, 100))
print(rightnumber)
gok = int(input("type your guess here and press ent... | your `compareguess` functiuon
```
def compareguess():
if gok < rightnumber:
print("wrong! the right number is smaller :) ")
elif gok == rightnumber:
print("WOW! you guessed right!")
else:
print("wrong! the right number is bigger. ")
```
your `guessAgain` function
```
def guessAga... |
68,610,235 | I want something like this:
```
**************************************************************************
* * div2 *
* * *
* ... | 2021/08/01 | [
"https://Stackoverflow.com/questions/68610235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5626375/"
] | You can pass `gok` as a parameter to avoid global variables.
The problem is:
When you take the input again: `int(input("try again. type your guess and press enter."))`, you don't assign the value to anything. So `gok` remains the same and it is always bigger or smaller
```
import random
print("this is a game made b... | try this code
```
import random
print("this is a game made by Sven")
print("you're supposed to guess the right number. it is between 0 & 101.")
print("lucky for you, you're getting hints.")
print("succes!")
rightnumber = (random.randint(1, 100))
print(rightnumber)
gok = int(input("type your guess here and press ent... |
68,610,235 | I want something like this:
```
**************************************************************************
* * div2 *
* * *
* ... | 2021/08/01 | [
"https://Stackoverflow.com/questions/68610235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5626375/"
] | try this code
```
import random
print("this is a game made by Sven")
print("you're supposed to guess the right number. it is between 0 & 101.")
print("lucky for you, you're getting hints.")
print("succes!")
rightnumber = (random.randint(1, 100))
print(rightnumber)
gok = int(input("type your guess here and press ent... | You could use this.
It keeps asking until you type the correct number.
```
import random
print("this is a game made by Sven")
print("you're supposed to guess the right number. it is between 0 & 101.")
print("lucky for you, you're getting hints.")
print("succes!")
rightnumber = random.randint(1, 100)
print(rightnumbe... |
68,610,235 | I want something like this:
```
**************************************************************************
* * div2 *
* * *
* ... | 2021/08/01 | [
"https://Stackoverflow.com/questions/68610235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5626375/"
] | The problem is with the scope of the parameters. The first guess is stored globaly in `gok`. Whether it is smaller or bigger, `compareguess` will print a correct message.
But when you call `guessAgain` you don't save the new guess anywhere, so the value of `gok` is still the old one. Even if you would save it, the scop... | your `compareguess` functiuon
```
def compareguess():
if gok < rightnumber:
print("wrong! the right number is smaller :) ")
elif gok == rightnumber:
print("WOW! you guessed right!")
else:
print("wrong! the right number is bigger. ")
```
your `guessAgain` function
```
def guessAga... |
68,610,235 | I want something like this:
```
**************************************************************************
* * div2 *
* * *
* ... | 2021/08/01 | [
"https://Stackoverflow.com/questions/68610235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5626375/"
] | You can pass `gok` as a parameter to avoid global variables.
The problem is:
When you take the input again: `int(input("try again. type your guess and press enter."))`, you don't assign the value to anything. So `gok` remains the same and it is always bigger or smaller
```
import random
print("this is a game made b... | The problem is with the scope of the parameters. The first guess is stored globaly in `gok`. Whether it is smaller or bigger, `compareguess` will print a correct message.
But when you call `guessAgain` you don't save the new guess anywhere, so the value of `gok` is still the old one. Even if you would save it, the scop... |
68,610,235 | I want something like this:
```
**************************************************************************
* * div2 *
* * *
* ... | 2021/08/01 | [
"https://Stackoverflow.com/questions/68610235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5626375/"
] | The problem is with the scope of the parameters. The first guess is stored globaly in `gok`. Whether it is smaller or bigger, `compareguess` will print a correct message.
But when you call `guessAgain` you don't save the new guess anywhere, so the value of `gok` is still the old one. Even if you would save it, the scop... | You could use this.
It keeps asking until you type the correct number.
```
import random
print("this is a game made by Sven")
print("you're supposed to guess the right number. it is between 0 & 101.")
print("lucky for you, you're getting hints.")
print("succes!")
rightnumber = random.randint(1, 100)
print(rightnumbe... |
68,610,235 | I want something like this:
```
**************************************************************************
* * div2 *
* * *
* ... | 2021/08/01 | [
"https://Stackoverflow.com/questions/68610235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5626375/"
] | You can pass `gok` as a parameter to avoid global variables.
The problem is:
When you take the input again: `int(input("try again. type your guess and press enter."))`, you don't assign the value to anything. So `gok` remains the same and it is always bigger or smaller
```
import random
print("this is a game made b... | your `compareguess` functiuon
```
def compareguess():
if gok < rightnumber:
print("wrong! the right number is smaller :) ")
elif gok == rightnumber:
print("WOW! you guessed right!")
else:
print("wrong! the right number is bigger. ")
```
your `guessAgain` function
```
def guessAga... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.