qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
66,624,195 | I need to print a String letter by letter with a \* between each letter.
I want to find a recursive solution and not an iterative one. The signature must be :
```java
public static String allStar(String a);
``` | 2021/03/14 | [
"https://Stackoverflow.com/questions/66624195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15393507/"
] | Beshambher's answer is a neat and easy way to do it. But if you want to do it recursively then :
```java
public static String allStar(String a) {
if(a == null || a.isEmpty()) {
return "";
}
if(a.length() == 1) {
return a;
}
return a.charAt(0) + "*" + allStar(a.subs... | try this code :
```
public class Main {
static String Answer = "" ;
public static void main(String[] args) {
Main.SetStarAfterEachLetter("hello!");
System.out.println(Answer);
}
public static void SetStarAfterEachLetter(String letter){
Answer = Answer + letter.charAt(0);
Answer =... |
66,624,195 | I need to print a String letter by letter with a \* between each letter.
I want to find a recursive solution and not an iterative one. The signature must be :
```java
public static String allStar(String a);
``` | 2021/03/14 | [
"https://Stackoverflow.com/questions/66624195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15393507/"
] | Beshambher's answer is a neat and easy way to do it. But if you want to do it recursively then :
```java
public static String allStar(String a) {
if(a == null || a.isEmpty()) {
return "";
}
if(a.length() == 1) {
return a;
}
return a.charAt(0) + "*" + allStar(a.subs... | Solution for recursive **print** a string
```
public static void allStar(String a) {
if (a != null && !a.isEmpty()) {
System.out.print(a.charAt(0));
if (a.length() > 1) {
System.out.print('*');
allStar(a.substring(1));
}
}
}
```
Solution for recursive **build**... |
66,624,195 | I need to print a String letter by letter with a \* between each letter.
I want to find a recursive solution and not an iterative one. The signature must be :
```java
public static String allStar(String a);
``` | 2021/03/14 | [
"https://Stackoverflow.com/questions/66624195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15393507/"
] | Try this where first the string is split into array of strings of each character and then joined together with a `*` character in between them.
```
System.out.println(String.join("*", a.split("")));
``` | Example implementation using overloaded functions `addStar(String str)` and `addStar(int pos, String str)`:
```
public static String addStar(String str) {
if (null == str || str.isEmpty()) {
return str;
}
return addStar(0, str);
}
static String addStar(int pos, String str) {
if (pos == str.len... |
1,214 | I manage a support forum for software that changes pretty rapidly. Content therefore ages out in usefulness.
We are currently trying to figure out how to address this... and if we should. Does anyone here have best practices around labeling/archiving/removing older content? Heck, even going through and locating what i... | 2015/06/30 | [
"https://moderators.stackexchange.com/questions/1214",
"https://moderators.stackexchange.com",
"https://moderators.stackexchange.com/users/502/"
] | It's difficult to give a single answer as to when these times would be, but if your target audience is school students then they are more likely to be online just after school (~4pm - depending on exactly when they finish school) and at weekends, whereas if you are targeting working adults then lunchtimes and later eve... | It really depends on what kind of content you're posting (B2B or B2C) and what your CTA (call-to-action) is.
My recommendation would be posting around 11 a.m. - 1 p.m. (when people are on their lunch and typically looking at their phones or checking their social media) or around 4 p.m. - 6 p.m. (when they're probably... |
59,910,611 | ```
import React from "react";
import shortid from "shortid";
export default class App extends React.Component {
state = {
items: [],
text: ""
};
handleTextChange = event => {
this.setState({
text: event.target.value
});
};
addItem = event => {
event.preventDefault();
const ne... | 2020/01/25 | [
"https://Stackoverflow.com/questions/59910611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12777169/"
] | Update your items render code to following:
```
const items = this.state.items.map(item => {
return (
<li onClick={this.deleteItem} key={item.key}>
{item.text}
</li>
);
});
```
Notice the change from function to ES6 arrow syntax usage. For your case: `this` inside function won't be referring ... | The issue is you're using a normal function inside `.map` which don't have access to component `this`. So you're `onClick` is not invoking delete function if you replace with an arrow function it works.
something like this:
```
const items = this.state.items.map(item => {
return (
<li onClick={this.dele... |
4,883,414 | Is it possible to call a web url from mysql trigger?
for example: I created a trigger for on insert. At that time, I want call a web url like <http://www.example.com/>. | 2011/02/03 | [
"https://Stackoverflow.com/questions/4883414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/280349/"
] | Not directly -- you have to create a [user-defined function](http://dev.mysql.com/doc/refman/5.0/en/adding-udf.html) and hook it in.
P.S.: This sounds like a **terrible** way to use a database. | I hope that this article will be useful for you
source: <http://vorachet.blogspot.com/2013/03/how-to-install-mysql-udf-on-centos.html>
```
How to install MySQL UDF on CENTOS
How to install MySQL UDF on CENTOS
Step1. Download the MYSQL UDF at https://github.com/mysqludf/lib_mysqludf_sys
Step2. Run make script
The de... |
36,813,984 | I am currently building a website as part of my course. The website is an eCommerce site. I am storing the products in an SQL database, then echoing each row out into a table using a php script. I have managed to do this fine, however, I now wish to add a button on each product that will contain a href which adds that ... | 2016/04/23 | [
"https://Stackoverflow.com/questions/36813984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6245131/"
] | This is tricky because you want to convert all the objects to xml, and might be dealing with large objects that you do not want to explicitly add to the dataweave. To get around this I did the following;
```
%dw 2.0
%input payload application/json
%output application/xml skipNullOn="everywhere"
---
{
abc: {
... | The XML for element `"ggg"` is expecting an `object`, not an `array`. Removing the square brackets `[]` from `[{"aaa":"a","bbb":"b"}]` should solve the issue and the resulting XML should look like the following:
```
<abc>
<ccc>ddd</ccc>
<eee>fff</eee>
<ggg>
<aaa>a</aaa>
<bbb>b</bbb>
</ggg>
</abc>
``` |
17,760 | I've read a post on this topic, but really not sure of the difference when applied to something like this:
>
> 私は朝飯のみ**に**茶を飲む
>
> 私は朝飯のみ**で**茶を飲む
>
>
>
From what I read, I'm guessing one of them is incorrect, as に is used for specific times and で for ranges of time in which an action happened. So I'm guessin... | 2014/07/10 | [
"https://japanese.stackexchange.com/questions/17760",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/5423/"
] | Both means *today*, but the meaning depends on the pronunciation.
きょう refers to the day after yesterday, the day before tomorrow.
>
> 今日【きょう】は雨【あめ】が降【ふ】っています。 It's raining today.
>
>
>
こんにち means *present age*, *nowadays*, or *these days*.
>
> 今日【こんにち】の若者【わかもの】は新聞【しんぶん】を読【よ】まない。 Young people of today do not re... | To see that 今日{きょう} is a special reading, you need to look in a kanji dictionary.
[「きょ」 is not listed as a possible reading of 「今」.](http://jisho.org/kanji/details/%E4%BB%8A)
[「う」 is not listed as a possible reading of 「日」.](http://jisho.org/kanji/details/%E6%97%A5)
「今日」 is a 熟字訓{じゅくじくん} which is best explained [... |
62,482,226 | For example, this piece of code:
```
Number("") + Number("")
```
I expect to return "" (aka nothing)
so I created this function
```
function addthese(x, y){
if (x != ""){
asdf = Number(x) + Number(y)
return Number(asdf)
} else {
return ""
}
}
```... | 2020/06/20 | [
"https://Stackoverflow.com/questions/62482226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13436156/"
] | Perhaps, you might be calling the function without passing in parameters. I did some quick tests and that's the only way i managed to reproduce the "NaN" returning.
If that's the case, the function will "parse" an undefined value, which is not possible and you'll get that ugly NaN you got. | if you want to cache all cases related to undefined, null, false or "" please use the following code:
```
function addthese(x, y){
return isNaN(x) || isNaN(y) ? "" : Number(x) + Number(y)
}
``` |
62,482,226 | For example, this piece of code:
```
Number("") + Number("")
```
I expect to return "" (aka nothing)
so I created this function
```
function addthese(x, y){
if (x != ""){
asdf = Number(x) + Number(y)
return Number(asdf)
} else {
return ""
}
}
```... | 2020/06/20 | [
"https://Stackoverflow.com/questions/62482226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13436156/"
] | Perhaps, you might be calling the function without passing in parameters. I did some quick tests and that's the only way i managed to reproduce the "NaN" returning.
If that's the case, the function will "parse" an undefined value, which is not possible and you'll get that ugly NaN you got. | Even though the `Number` function can convert an empty string to 0, for any non-number string, it doesn't have a clue. So, `NaN` is returned.
```js
console.log(Number(""));
console.log(Number(undefined));
console.log(Number("foo"));
``` |
72,488,037 | I am trying to get the count of records and return the result number to my ajax success function to print it or get the value on the textbox.
the controller function is:
```
public function get_subaccount_count($id){
$data = $this->accounts_model->get_count($id);
echo json_encode($data);
}
```
and the mode... | 2022/06/03 | [
"https://Stackoverflow.com/questions/72488037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11543561/"
] | Your controller only needs to call the model method and print the returned integer.
```
public function get_subaccount_count(int $id): void
{
echo $this->accounts_model->get_count($id);
}
```
Your model doesn't benefit from the `$sql` declaration.
```
public function get_count(int $id): int
{
return $this-... | Change like this:
```
$.ajax({
type: 'GET',
url: "<?php echo base_url();?>index.php/accounts/get_subaccount_count/"+$('#main_code').val(),
data: {},
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
... |
23,448 | I have been trying to make a subdomain from a directory (made by *.htaccess*) to be used as the main page starting like `http://domain.com/sub/2/3/4.html` and turning into `http://sub.domain.com/2/3/4.html`.
The folder system goes like:
```
www\sub\2\3\
```
in `www` there is a `index.html` and in the sub folder the... | 2011/12/14 | [
"https://webmasters.stackexchange.com/questions/23448",
"https://webmasters.stackexchange.com",
"https://webmasters.stackexchange.com/users/12450/"
] | I have found some fantastic code for the .htaccess
that converts any folder in the main www directory into sub-domains
e.g. www/somefolder turns into somefolder.domain.com
you can also set it so that any directory inside a certain directory becomes a subdomain
e.g. www/folder/somefolder turns into somefolder.domain.com... | You need to configure a apache virtual host for `sub.domain.com` with `www/sub` as its DirectoryRoot. |
2,874,657 | Which is the book one should start with in the domain of spiking neural networks? I know about Gerstner's ["Spiking Neuron Models"](https://rads.stackoverflow.com/amzn/click/com/0521890799), published in 2002. Is there a more recent book, or maybe a more suitable one? I have a background in maths and artificial neural ... | 2010/05/20 | [
"https://Stackoverflow.com/questions/2874657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11464/"
] | Spiking Neural Networks (SNNs) or Pulsed Neural Networks (PNNs) are artificial neural networks (ANNs) that more closely emulate the behaviours of natural neural mechanisms. I would like to advise you following fundamental books:
* Fundamentals of Computational Neuroscience by Thomas Trappenberg
* Theoretical Neuroscie... | Don't forget [BindsNet](https://github.com/BindsNET/bindsnet): Best choice. And trending. |
28,679,540 | I'm trying to compile code from a backtrace project <https://code.google.com/p/backtrace-mingw/> which is written for MinGW, but using MinGW-w64.
My old install and fresh install of MinGW-w64 produce the same problem. Path is set in path variables, and also in command prompt:
*C:\mingw-w64\i686-4.9.2-win32-sjlj-rt\_... | 2015/02/23 | [
"https://Stackoverflow.com/questions/28679540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4507670/"
] | That path is definetely missing from gcc include paths in mingw. I don't know why. You have to add it yourself in any way you like: cmake recipe, autoconf recipe, [CFLAGS](https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html), [CPATH](https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html),... | add this to the end of the compile statement:
```
-I./mingw32/include
```
so the whole compile statement would be:
```
gcc -g -Wall -o $@ $^ -I./mingw32/include
```
so the compiler knows where to find the include files |
13,794,313 | I've created the following script that searches the page for any instances of "Two words" and replaces the space with a non-breaking space:
```
var search = $('body').html();
search = search.replace(/Two words/g, function($1) {
return ('<span class="no-break">' + $1 + '</span>');
});
$('body').html(search);
$(do... | 2012/12/10 | [
"https://Stackoverflow.com/questions/13794313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/597768/"
] | This line:
```
$('body').html(search);
```
**recreates every element** in the body, **minus any event handlers** that may or may not have already been bound. So if you're going to use that technique you need to be one-hundred percent sure that you do it *before* you create any event handlers (except for handlers bou... | Here's another way of writing it.
Since you didn't post an error messages, then I'm sure if this fixes your problem.
```
$(function(){
$('body').html(function(){
return $(this).html().replace(/Two words/g, '<span class="no-break">Two words</span>');
});
$('.no-break').each(function () {
$(... |
13,794,313 | I've created the following script that searches the page for any instances of "Two words" and replaces the space with a non-breaking space:
```
var search = $('body').html();
search = search.replace(/Two words/g, function($1) {
return ('<span class="no-break">' + $1 + '</span>');
});
$('body').html(search);
$(do... | 2012/12/10 | [
"https://Stackoverflow.com/questions/13794313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/597768/"
] | Here's another way of writing it.
Since you didn't post an error messages, then I'm sure if this fixes your problem.
```
$(function(){
$('body').html(function(){
return $(this).html().replace(/Two words/g, '<span class="no-break">Two words</span>');
});
$('.no-break').each(function () {
$(... | I think it's better if you separate your text from your javascripts. You could mark every block of text in your page using a Class
```
<div class="text">abcxyz...Two words...</div>
```
and then call
```
$('.text').each(function(){
var search = $(this).html();
search = search.replace(/Two words/g, functi... |
13,794,313 | I've created the following script that searches the page for any instances of "Two words" and replaces the space with a non-breaking space:
```
var search = $('body').html();
search = search.replace(/Two words/g, function($1) {
return ('<span class="no-break">' + $1 + '</span>');
});
$('body').html(search);
$(do... | 2012/12/10 | [
"https://Stackoverflow.com/questions/13794313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/597768/"
] | This line:
```
$('body').html(search);
```
**recreates every element** in the body, **minus any event handlers** that may or may not have already been bound. So if you're going to use that technique you need to be one-hundred percent sure that you do it *before* you create any event handlers (except for handlers bou... | I think it's better if you separate your text from your javascripts. You could mark every block of text in your page using a Class
```
<div class="text">abcxyz...Two words...</div>
```
and then call
```
$('.text').each(function(){
var search = $(this).html();
search = search.replace(/Two words/g, functi... |
9,044,770 | I have a Silverlight app with a textbox whose input I want to limit to decimal numbers only. Searching the web I came across the following possible solution (curiously in different places with different people claiming authorship of the same lines of code)
It appears to work well except that after at least 1 numeral h... | 2012/01/28 | [
"https://Stackoverflow.com/questions/9044770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/995689/"
] | You could try the following:
1. Replace the `else` with `else if (e.Key != Key.D)` or
2. set the `Handled` property like this:
```
e.Handled = !r.IsMatch(s) || string.IsNullOrEmpty(thisKeyStr);
// also possible:
e.Handled = !r.IsMatch(s) || e.Key == Key.D;
``` | here is a easier code optimized. NO object creation; NO string comparision and NO regex validation
```
private static void TextBox_KeyDown(object sender, KeyEventArgs e)
{
//platform code for Hyphen which is not same as Subtract symbol but in our case both give same meaning
const int KEYCODE_Hyphen... |
9,044,770 | I have a Silverlight app with a textbox whose input I want to limit to decimal numbers only. Searching the web I came across the following possible solution (curiously in different places with different people claiming authorship of the same lines of code)
It appears to work well except that after at least 1 numeral h... | 2012/01/28 | [
"https://Stackoverflow.com/questions/9044770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/995689/"
] | You could try the following:
1. Replace the `else` with `else if (e.Key != Key.D)` or
2. set the `Handled` property like this:
```
e.Handled = !r.IsMatch(s) || string.IsNullOrEmpty(thisKeyStr);
// also possible:
e.Handled = !r.IsMatch(s) || e.Key == Key.D;
``` | ```
private void TextBox_KeyDown(object sender, KeyEventArgs e)
{
bool isDigit = e.Key >= Key.D0 && e.Key < Key.D9 || e.Key == Key.NumPad0 || e.Key == Key.NumPad1 || e.Key == Key.NumPad2 || e.Key == Key.NumPad3 || e.Key == Key.NumPad4 || e.Key == Key.NumPad5 || e.Key == Key.NumPad6 ||
e.Key ==... |
9,044,770 | I have a Silverlight app with a textbox whose input I want to limit to decimal numbers only. Searching the web I came across the following possible solution (curiously in different places with different people claiming authorship of the same lines of code)
It appears to work well except that after at least 1 numeral h... | 2012/01/28 | [
"https://Stackoverflow.com/questions/9044770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/995689/"
] | here is a easier code optimized. NO object creation; NO string comparision and NO regex validation
```
private static void TextBox_KeyDown(object sender, KeyEventArgs e)
{
//platform code for Hyphen which is not same as Subtract symbol but in our case both give same meaning
const int KEYCODE_Hyphen... | ```
private void TextBox_KeyDown(object sender, KeyEventArgs e)
{
bool isDigit = e.Key >= Key.D0 && e.Key < Key.D9 || e.Key == Key.NumPad0 || e.Key == Key.NumPad1 || e.Key == Key.NumPad2 || e.Key == Key.NumPad3 || e.Key == Key.NumPad4 || e.Key == Key.NumPad5 || e.Key == Key.NumPad6 ||
e.Key ==... |
46,469 | How can I solve this indefinite integral for an arbitrary integer $n>0$?
$$ \int{x^n e^x dx}$$
I could partially integrate it for small $n$, but that's not really a solution.
---
**Edit:** (TB) This question is closely related to: [Is there a closed form solution for $\int x^n e^{cx}$?](https://math.stackexchange.c... | 2011/06/20 | [
"https://math.stackexchange.com/questions/46469",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/12344/"
] | Hint: Use integration by parts.
EDIT: Try several values of $n$.
$$
\int {x e^x dx} = (x - 1)e^x + C
$$
$$
\int {x^2 e^x dx} = (x^2 - 2x + 2)e^x + C.
$$
$$
\int {x^3 e^x dx} = (x^3 - 3x^2 + 6x - 6)e^x + C.
$$
$$
\int {x^4 e^x dx} = (x^4 - 4x^3 + 12x^2 - 24x + 24)e^x + C.
$$
$$
\int {x^5 e^x dx} = (x^5 - 5x^4 ... | I find it a little difficult for me to guess the solution by trying several $n$. I would like to do it as following:
$$\begin{align}\int x^ne^xdx&=x^ne^x+(-1)n\int x^{n-1}e^xdx,\qquad n\geq 1\\
\int x^0e^xdx&=e^x\end{align}$$
Then you get the recurrence relation:
$$\begin{align}a\_n(x)&=x^ne^x+(-1)na\_{n-1}(x),\qqua... |
46,469 | How can I solve this indefinite integral for an arbitrary integer $n>0$?
$$ \int{x^n e^x dx}$$
I could partially integrate it for small $n$, but that's not really a solution.
---
**Edit:** (TB) This question is closely related to: [Is there a closed form solution for $\int x^n e^{cx}$?](https://math.stackexchange.c... | 2011/06/20 | [
"https://math.stackexchange.com/questions/46469",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/12344/"
] | Hint: Use integration by parts.
EDIT: Try several values of $n$.
$$
\int {x e^x dx} = (x - 1)e^x + C
$$
$$
\int {x^2 e^x dx} = (x^2 - 2x + 2)e^x + C.
$$
$$
\int {x^3 e^x dx} = (x^3 - 3x^2 + 6x - 6)e^x + C.
$$
$$
\int {x^4 e^x dx} = (x^4 - 4x^3 + 12x^2 - 24x + 24)e^x + C.
$$
$$
\int {x^5 e^x dx} = (x^5 - 5x^4 ... | You could use the generating function approach.
$$ \eqalign{\int\_0^X e^{tx} e^x \ dx &= \frac{e^{(1+t)X} - 1}{1+t}\cr
&= \sum\_{k=0}^\infty (-1)^k t^k \left(e^X -1 + \sum\_{j=1}^\infty e^X \,\frac{X^j}{j!} t^j\right)\cr
&= \sum\_{n=1}^\infty \left((-1)^n (e^X - 1) + \sum\_{j=1}^n (-1)^{n-j} \frac{X^j}{j!} e^X \... |
46,469 | How can I solve this indefinite integral for an arbitrary integer $n>0$?
$$ \int{x^n e^x dx}$$
I could partially integrate it for small $n$, but that's not really a solution.
---
**Edit:** (TB) This question is closely related to: [Is there a closed form solution for $\int x^n e^{cx}$?](https://math.stackexchange.c... | 2011/06/20 | [
"https://math.stackexchange.com/questions/46469",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/12344/"
] | Hint: Use integration by parts.
EDIT: Try several values of $n$.
$$
\int {x e^x dx} = (x - 1)e^x + C
$$
$$
\int {x^2 e^x dx} = (x^2 - 2x + 2)e^x + C.
$$
$$
\int {x^3 e^x dx} = (x^3 - 3x^2 + 6x - 6)e^x + C.
$$
$$
\int {x^4 e^x dx} = (x^4 - 4x^3 + 12x^2 - 24x + 24)e^x + C.
$$
$$
\int {x^5 e^x dx} = (x^5 - 5x^4 ... | $ \int{x^ne^xdx}=e^x\sum^n\_{k=0}{{\left(-1\right)}^{n-k}\frac{n!}{k!}x^k}+C$
Solution:
$ \int{xe^xdx}=\ ?$
$ u=x\to \ \frac{du}{dx}=1\to du=dx$
$ dv=e^xdx\to \frac{dv}{dx}=e^x\to \ \int{\frac{dv}{dx}dx}=\int{e^xdx}+C{{\stackrel{C=0}{\longrightarrow}}}v=e^x$
$ \frac{duv}{dx}=v\frac{du}{dx}+u\frac{dv}{dx}\to \ \int... |
46,469 | How can I solve this indefinite integral for an arbitrary integer $n>0$?
$$ \int{x^n e^x dx}$$
I could partially integrate it for small $n$, but that's not really a solution.
---
**Edit:** (TB) This question is closely related to: [Is there a closed form solution for $\int x^n e^{cx}$?](https://math.stackexchange.c... | 2011/06/20 | [
"https://math.stackexchange.com/questions/46469",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/12344/"
] | You could use the generating function approach.
$$ \eqalign{\int\_0^X e^{tx} e^x \ dx &= \frac{e^{(1+t)X} - 1}{1+t}\cr
&= \sum\_{k=0}^\infty (-1)^k t^k \left(e^X -1 + \sum\_{j=1}^\infty e^X \,\frac{X^j}{j!} t^j\right)\cr
&= \sum\_{n=1}^\infty \left((-1)^n (e^X - 1) + \sum\_{j=1}^n (-1)^{n-j} \frac{X^j}{j!} e^X \... | I find it a little difficult for me to guess the solution by trying several $n$. I would like to do it as following:
$$\begin{align}\int x^ne^xdx&=x^ne^x+(-1)n\int x^{n-1}e^xdx,\qquad n\geq 1\\
\int x^0e^xdx&=e^x\end{align}$$
Then you get the recurrence relation:
$$\begin{align}a\_n(x)&=x^ne^x+(-1)na\_{n-1}(x),\qqua... |
46,469 | How can I solve this indefinite integral for an arbitrary integer $n>0$?
$$ \int{x^n e^x dx}$$
I could partially integrate it for small $n$, but that's not really a solution.
---
**Edit:** (TB) This question is closely related to: [Is there a closed form solution for $\int x^n e^{cx}$?](https://math.stackexchange.c... | 2011/06/20 | [
"https://math.stackexchange.com/questions/46469",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/12344/"
] | I find it a little difficult for me to guess the solution by trying several $n$. I would like to do it as following:
$$\begin{align}\int x^ne^xdx&=x^ne^x+(-1)n\int x^{n-1}e^xdx,\qquad n\geq 1\\
\int x^0e^xdx&=e^x\end{align}$$
Then you get the recurrence relation:
$$\begin{align}a\_n(x)&=x^ne^x+(-1)na\_{n-1}(x),\qqua... | $ \int{x^ne^xdx}=e^x\sum^n\_{k=0}{{\left(-1\right)}^{n-k}\frac{n!}{k!}x^k}+C$
Solution:
$ \int{xe^xdx}=\ ?$
$ u=x\to \ \frac{du}{dx}=1\to du=dx$
$ dv=e^xdx\to \frac{dv}{dx}=e^x\to \ \int{\frac{dv}{dx}dx}=\int{e^xdx}+C{{\stackrel{C=0}{\longrightarrow}}}v=e^x$
$ \frac{duv}{dx}=v\frac{du}{dx}+u\frac{dv}{dx}\to \ \int... |
46,469 | How can I solve this indefinite integral for an arbitrary integer $n>0$?
$$ \int{x^n e^x dx}$$
I could partially integrate it for small $n$, but that's not really a solution.
---
**Edit:** (TB) This question is closely related to: [Is there a closed form solution for $\int x^n e^{cx}$?](https://math.stackexchange.c... | 2011/06/20 | [
"https://math.stackexchange.com/questions/46469",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/12344/"
] | You could use the generating function approach.
$$ \eqalign{\int\_0^X e^{tx} e^x \ dx &= \frac{e^{(1+t)X} - 1}{1+t}\cr
&= \sum\_{k=0}^\infty (-1)^k t^k \left(e^X -1 + \sum\_{j=1}^\infty e^X \,\frac{X^j}{j!} t^j\right)\cr
&= \sum\_{n=1}^\infty \left((-1)^n (e^X - 1) + \sum\_{j=1}^n (-1)^{n-j} \frac{X^j}{j!} e^X \... | $ \int{x^ne^xdx}=e^x\sum^n\_{k=0}{{\left(-1\right)}^{n-k}\frac{n!}{k!}x^k}+C$
Solution:
$ \int{xe^xdx}=\ ?$
$ u=x\to \ \frac{du}{dx}=1\to du=dx$
$ dv=e^xdx\to \frac{dv}{dx}=e^x\to \ \int{\frac{dv}{dx}dx}=\int{e^xdx}+C{{\stackrel{C=0}{\longrightarrow}}}v=e^x$
$ \frac{duv}{dx}=v\frac{du}{dx}+u\frac{dv}{dx}\to \ \int... |
18,400,487 | Following link [Jquery for pass selected radio button value on button click](https://stackoverflow.com/questions/18394988/jquery-for-pass-selected-radio-button-value-on-button-click) .It is working properly for me.
In the above question i want to pass the values(and display in dropdown box and textbox) in radio button... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18400487",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/609219/"
] | try this
```
"<input type="radio" name="joblist" onclick="myfunc(this);" id= ' + value.jobid + 'value=' + value.jobid + '/>"
function myfunc(ele){
var $tr=$(ele).parent().parent(); ....
//the rest of the code
}
```
to select the one you want.
```
$("#OS option").each(function(){
if($(this).val()==os)
... | **[DEMO](http://jsfiddle.net/nmzmp/)**
Try this
```
$(document).ready(function() {
$("input[type='radio']").click(function () {
alert($(this).val());
});
});
```
and the radio button HTML
```
<input type="radio" value="male" name="sex" />male
<input type="radio" value="female" name="sex" />fe... |
31,161,111 | I'm working with Apache Camel to create route between dynamic endpoints. I was working with a Main which works but now I need to deploy the application on an Apache Tomcat server. The problem his that my camel-context doesn't found my route builder. Here is my applicationContext :
```
<bean id="myRoute" class="com.it... | 2015/07/01 | [
"https://Stackoverflow.com/questions/31161111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3691317/"
] | Several suggestions:
1. Check if the `RouteBuilder` bean is actually being created in the container.
2. Does your `MyRouteBuilder` extend `RouteBuilder` from camel?
Just for more clarification, please provide the full code for `MyRouteBuilder` and full stacktrace. | The problem came from an error with a SimpleRegistry bean just before the RouteBuilder. |
74,651,609 | I am using the directive to validate the mobile number input
```
import { Directive, ElementRef, HostListener, Input } from '@angular/core';
@Directive({
selector: '[mobileNumber]'
})
export class MobileNumberDirective {
@Input()
public value: any;
constructor(private el: ElementRef) { }
@HostListener('k... | 2022/12/02 | [
"https://Stackoverflow.com/questions/74651609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14390338/"
] | The `{{#each patient}}` in your template anticipates that the data that you pass to your template function has a property named `patient` and that the value of this property is iterable - like an Array.
However, it appears that you are simply passing an Array directly to your template function, and that Array does not... | Ultimately, the problem was that the data was seen Handlebars as a Sequelizer Object. It was unable to access the prototype due to a security update in Handlebars 4.6.0.
Rather than using "allowInsecurePrototypeAccess" which is a widely suggested fix but one that seems like unsound advice, I made a deep copy of the da... |
5,233,078 | i am running an third party RMI-Server app providing exactly one method `("getImage()" returns an image as byte[]).` The implementation of this method (getting the image via a SOAP-WS) is provide by me.
The problem on running this RMI-Server is the high CPU consumption (measured with jvisualvm): 65% of cpu time go int... | 2011/03/08 | [
"https://Stackoverflow.com/questions/5233078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/447426/"
] | If you are using DOM then you need to create a CDATA node instead of setting the block in a text node.
```
document.createCDATASection("foo");
```
* <http://download.oracle.com/javase/6/docs/api/org/w3c/dom/Document.html#createCDATASection(java.lang.String>) | It did exactly what you wanted. The stored data represents the String `"<![CDATA[test]]>"`!
If you use a API to create XML, just don't care for the way the XML is generated, since any parser will be able to parse it correctly. Just store the String `"test"` and be happy :). |
5,233,078 | i am running an third party RMI-Server app providing exactly one method `("getImage()" returns an image as byte[]).` The implementation of this method (getting the image via a SOAP-WS) is provide by me.
The problem on running this RMI-Server is the high CPU consumption (measured with jvisualvm): 65% of cpu time go int... | 2011/03/08 | [
"https://Stackoverflow.com/questions/5233078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/447426/"
] | If you are using DOM then you need to create a CDATA node instead of setting the block in a text node.
```
document.createCDATASection("foo");
```
* <http://download.oracle.com/javase/6/docs/api/org/w3c/dom/Document.html#createCDATASection(java.lang.String>) | Use API [Document.createCDATASection](http://download.oracle.com/javase/1.4.2/docs/api/org/w3c/dom/Document.html#createCDATASection%28java.lang.String%29) to create the CDATA. |
14,020,284 | We had some (lots of) classes in .NET. We used [protobuf-net](http://code.google.com/p/protobuf-net/) to mark them up, and generate .proto wrappers for C++ code side via [google original library](https://code.google.com/p/protobuf/).
So I have a message (C++ DebugString() on some EventBase class (in .NET `EventCharact... | 2012/12/24 | [
"https://Stackoverflow.com/questions/14020284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1056328/"
] | Edit; this should be fixed in r616 and above.
---
I've finally had chance to look at this (apologies for delay, but social seasonal holiday demands intervened). I understand what is happening now.
Basically, the data is theoretically identical; what this actually comes down to is field-ordering. Technically, fields ... | This looks pretty similar to the problems noted in <http://code.google.com/p/protobuf-net/issues/detail?id=299> and <http://code.google.com/p/protobuf-net/issues/detail?id=331> which were allegedly fixed by <http://code.google.com/p/protobuf-net/source/detail?r=595>
Is the version of .NET protobuf you're using new eno... |
48,769,009 | At work we currently use a program that outputs product number combinations in a single cell. For example, in cell C2 there will be "1 4 6" to show the customer ordered products 1, 4 and 6. These numbers are separated by a single space. Is there any if() type formula I could use that would detect if the products were o... | 2018/02/13 | [
"https://Stackoverflow.com/questions/48769009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9355397/"
] | Offtopic-start
This is weird. About 1 hour ago I was [checking this question](https://stackoverflow.com/questions/48767395/how-to-find-coefficients-of-exponential-formula-from-given-pairs-of-numbers), thus I have decided to mimic the input and see what happens. In order to mimic the input, I have built probably what y... | Following is IF based formula built using LOOKUP (same as what imaginaryhuman said)
Source cell containing data like `1 4 6` is assumed to be A2. Not tested heavily.
`=IF(LOOKUP(9E+307,-((MID(SUBSTITUTE(" "&A2," ",REPT(" ",99)),ROW($A$1:INDEX(A:A,(LEN(A2)-LEN(SUBSTITUTE(A2," ","")))+1))*99,99)+0)-(MID(SUBSTITUTE(" 0 ... |
48,769,009 | At work we currently use a program that outputs product number combinations in a single cell. For example, in cell C2 there will be "1 4 6" to show the customer ordered products 1, 4 and 6. These numbers are separated by a single space. Is there any if() type formula I could use that would detect if the products were o... | 2018/02/13 | [
"https://Stackoverflow.com/questions/48769009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9355397/"
] | Here is a VBA function which will test if a string of numbers is in ascending order:
```
Function InOrder(nums As String) As Boolean
Dim numbers As Variant
Dim i As Long
numbers = Split(Trim(nums))
For i = LBound(numbers) To UBound(numbers) - 1
If Val(numbers(i)) > Val(numbers(i + 1)) Then
... | Following is IF based formula built using LOOKUP (same as what imaginaryhuman said)
Source cell containing data like `1 4 6` is assumed to be A2. Not tested heavily.
`=IF(LOOKUP(9E+307,-((MID(SUBSTITUTE(" "&A2," ",REPT(" ",99)),ROW($A$1:INDEX(A:A,(LEN(A2)-LEN(SUBSTITUTE(A2," ","")))+1))*99,99)+0)-(MID(SUBSTITUTE(" 0 ... |
12,141,853 | I need to show a more button on my `UILabel` when `UILineBreakModeTailTruncation` starts. ie whenever the "`...`" appears, I need to display my more button with some actions.
What I am doing is
```
float textWidth = [myString sizeWithFont:myLabel.font].width;
if (textWidth > myLabel.frame.size.width)
{
[moreButton s... | 2012/08/27 | [
"https://Stackoverflow.com/questions/12141853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1095022/"
] | Since you don't have year in your date string, default will be current year, something like this :
```
DateTime dt = DateTime.ParseExact(dateString, "MM-ddTHH:mm", CultureInfo.InvariantCulture);
``` | If the string is formatted correctly, **DateTime.Parse()** is what you're looking for. But I think the 'date' part of that string is incomplete for it to work. |
44,190,652 | I'm currently building a tutorial for a game.
I'm trying to cycle through prewritten text using a switch statement. The switch statement is controlled by a counter, which is incremented when you click the "next" button. The code for the switch is below:
```
public void tutMGR(){
switch (nextCount) {
cas... | 2017/05/25 | [
"https://Stackoverflow.com/questions/44190652",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8067510/"
] | It may be that the text is changing; but, the object doesn't know that it has changed; so, it is not redrawing the screen.
Calling 'tutText.Update()' could solve your problem.
Another thing to consider is the use of a [Dictionary](https://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.110).aspx) rather than a switch... | I ended up fixing it! All I had to do was put the switch statements in the button function itself, so it ended up looking like this:
```
public void nextCnt(){
nextCount++;
switch (nextCount) {
case 1:
tutText.text = "1";
break;
case 2:
tutText.text = "2";
miniMap... |
57,301,662 | We use latest WP (5.2.2). We have a custom post type called Stories (slug: `stories`) with the following capabilities during setup.
```
Public: true
Publicly Queryable: true
Show UI: true
Has Archive: true
Exclude From Search: false
Hierarchical: false
Rewrite: true
Custom Rewrite Slug... | 2019/08/01 | [
"https://Stackoverflow.com/questions/57301662",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3901258/"
] | I am the author of Permalink Manager. It looks like you posted the same question here, but did not respond after:
<https://wordpress.org/support/topic/custom-post-type-pagination-issue/>
The problem in your case is that you are using the wrong pagination slug. For single posts, pages and custom post type items you sho... | I´m not sure if its going to solve your problem but you could try to set offset within your $args
```
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$posts_per_page = 10;
$offset = ( $paged - 1 ) * $posts_per_page;
$args = array(
'post_type' => 'stories',
'orderby' => 'date'... |
666,306 | I've made a quite big domain model with entity framework. I wanted to know if it is possible to map it so i create automaticly the tables in the database wanted?
I've looked up edmgen.exe but still couldn't find the right command.
thank's for helping!
Edit1: I know the tool LightSpeed from Mindscape ofer this featur... | 2009/03/20 | [
"https://Stackoverflow.com/questions/666306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60561/"
] | currently this is not available but i thing this feature will be shipped with vs2010 | My guess is that the answer is "no." The Entity Framework isn't necessarily meant to map 1-1 to the database, it's actually supposed to be a business object representation of how you want to use data stored in the database. Therefore it would be very, very difficult to write something that created a database from your ... |
666,306 | I've made a quite big domain model with entity framework. I wanted to know if it is possible to map it so i create automaticly the tables in the database wanted?
I've looked up edmgen.exe but still couldn't find the right command.
thank's for helping!
Edit1: I know the tool LightSpeed from Mindscape ofer this featur... | 2009/03/20 | [
"https://Stackoverflow.com/questions/666306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60561/"
] | According to this [blog entry](http://blog.nakedobjects.net/?p=58), it's currently (v1) not possible to create the database from an entity model.
About half way down, under the heading of "2. Process and tooling issues", you'll find:
>
> * It is not currently possible to create the database schema
> automatically f... | My guess is that the answer is "no." The Entity Framework isn't necessarily meant to map 1-1 to the database, it's actually supposed to be a business object representation of how you want to use data stored in the database. Therefore it would be very, very difficult to write something that created a database from your ... |
666,306 | I've made a quite big domain model with entity framework. I wanted to know if it is possible to map it so i create automaticly the tables in the database wanted?
I've looked up edmgen.exe but still couldn't find the right command.
thank's for helping!
Edit1: I know the tool LightSpeed from Mindscape ofer this featur... | 2009/03/20 | [
"https://Stackoverflow.com/questions/666306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60561/"
] | currently this is not available but i thing this feature will be shipped with vs2010 | According to this [blog entry](http://blog.nakedobjects.net/?p=58), it's currently (v1) not possible to create the database from an entity model.
About half way down, under the heading of "2. Process and tooling issues", you'll find:
>
> * It is not currently possible to create the database schema
> automatically f... |
380,130 | Which of these verbs would you choose to insert?
The survey on the wall stretches present in the burg, along with the subsequent comparison with the masonry of the medieval tower, have contributed to **hypothesize/guess** the evolution of the wall belt and therefore the possible expansion of the burg. | 2017/03/25 | [
"https://english.stackexchange.com/questions/380130",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/223668/"
] | **Neither**, because a noun rather than a verb is needed.
The structure of the sentence you are asking about seems to be:
>
> The survey and other things have contributed to…
>
>
>
+
>
> *Insert missing verb — hypothesize or guess*
>
>
>
+
>
> …the development of the archaelogical site (or whatever).
>
... | If you are writing this at the beginning of a paper I would choose ***'hypothesise'***, as *'guess'* is very informal and suggests a lack of empirical evidence.
If this is at the end of the writing, like a conclusion, I would use **"Theorise"** as a hypothesis is usually stated at the beginning of a paper to be tested... |
22,893,723 | I've got a little problem here. I have category\_id for every product in DB. I also have a category table in DB for categories and their ID. Now i need to put in into view together. I've made add, edit and delete action, also show action, where is category showed with the rest of product description. But now I have a p... | 2014/04/06 | [
"https://Stackoverflow.com/questions/22893723",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1999739/"
] | It's massively inefficient to be calling a query to get the category names for each product individually, instead, write a method which will return an array of category names keyed by id in your CategoryTable class
```
public function getCategoryNames()
{
// query to get list of names and ids
// return arra... | Everything is working, but i would add for others, when I used your example, it threw error:
>
> cant use object type as array
>
>
>
This happened, cause my query did not returned me `$result['id']` and `$result['name']`
because i was using TableGateway and it did return `$result->id` and `$result->name` So fina... |
22,893,723 | I've got a little problem here. I have category\_id for every product in DB. I also have a category table in DB for categories and their ID. Now i need to put in into view together. I've made add, edit and delete action, also show action, where is category showed with the rest of product description. But now I have a p... | 2014/04/06 | [
"https://Stackoverflow.com/questions/22893723",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1999739/"
] | It's massively inefficient to be calling a query to get the category names for each product individually, instead, write a method which will return an array of category names keyed by id in your CategoryTable class
```
public function getCategoryNames()
{
// query to get list of names and ids
// return arra... | well I think that you can render your result directly to your view since we are all working with MVC doing that is a little bit unclean since all of the logic is used on controllers and sometimes you need to slice your work on independent component well for that you create a function and like my friends, before me, the... |
58,526,721 | I am iterating through monthly weather station data. I can concatenate the files as follows:
```
path = r"D:\NOAA\output\TEST"
all_files = glob.glob(path + "/*.csv")
for filename in all_files:
print filename # prints D:\NOAA\output\TEST\189501.tave.conus.csv
df = (pd.read_csv(f) for f in all_files)
conca... | 2019/10/23 | [
"https://Stackoverflow.com/questions/58526721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4150630/"
] | You can merge two columns and set suffixes for others:
```
temp = df1.merge(df2, on=['lat','lon'], suffixes=('185901','185902'))
lat lon temp185901 temp185902
0 24.5625 -81.8125 21.06 17.08
1 24.5625 -81.7708 21.06 17.08
2 24.5625 -81.7292 21.06 17.08
3 24.5625 -8... | this appends new data to the concatenated dataframe as new rows with a column 'date' to indicate which file the data came from. Amend the logic to get the date from the filename.
```py
import pandas as pd
import glob
path = r'D:\NOAA\output\TEST'
all_files = glob.glob(path + '/*.csv')
df_concat = pd.DataFrame()
for... |
4,052,070 | I need to draw a Pie Arc in Java with start angle 350 and end angle 20.The cordinate system I follow is as follows:-
```
|0
|
270-----------90
|
|180
```
The problem here is that the start angle is greater than the end angle.For the other way round I have managed to draw the arc.An... | 2010/10/29 | [
"https://Stackoverflow.com/questions/4052070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306855/"
] | You will have a start angle and an 'extent' angle and not an end angle. So, I don't think you would be having problem drawing an arc.
```
import java.awt.Graphics;
import javax.swing.JFrame;
public class Test extends JFrame{
public static void main(String[] args){
new Test();
}
public Test(){
... | Use **(450 - angle) % 360** to switch angles. Concept 450 = 180 + 270; |
4,052,070 | I need to draw a Pie Arc in Java with start angle 350 and end angle 20.The cordinate system I follow is as follows:-
```
|0
|
270-----------90
|
|180
```
The problem here is that the start angle is greater than the end angle.For the other way round I have managed to draw the arc.An... | 2010/10/29 | [
"https://Stackoverflow.com/questions/4052070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306855/"
] | You will have a start angle and an 'extent' angle and not an end angle. So, I don't think you would be having problem drawing an arc.
```
import java.awt.Graphics;
import javax.swing.JFrame;
public class Test extends JFrame{
public static void main(String[] args){
new Test();
}
public Test(){
... | Extending on what @bragbog 's working code, I had to navigate through a similar situation where I had to transpose the co-ordinate system similar to that of the OP to the Java co-ordinate system.
This is what I came up with:
```
float coordChangeOffset = ((arcDegree % 180) - 45) * 2;
filterPanel.setArc(absModAngle(ar... |
4,052,070 | I need to draw a Pie Arc in Java with start angle 350 and end angle 20.The cordinate system I follow is as follows:-
```
|0
|
270-----------90
|
|180
```
The problem here is that the start angle is greater than the end angle.For the other way round I have managed to draw the arc.An... | 2010/10/29 | [
"https://Stackoverflow.com/questions/4052070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306855/"
] | Use **(450 - angle) % 360** to switch angles. Concept 450 = 180 + 270; | Extending on what @bragbog 's working code, I had to navigate through a similar situation where I had to transpose the co-ordinate system similar to that of the OP to the Java co-ordinate system.
This is what I came up with:
```
float coordChangeOffset = ((arcDegree % 180) - 45) * 2;
filterPanel.setArc(absModAngle(ar... |
64,876,680 | Hello I want to read a file.csv that contains word pairs like this
```
1 AA 9877.88,BY US,SA 6785.66,....
```
I want to split that data in below format
```
9877.88,US,6785.66,.........
```
I have written below lines of code to read csv file
```
do{
currentline = br.readline()
if(currentline != null)
... | 2020/11/17 | [
"https://Stackoverflow.com/questions/64876680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14655312/"
] | I have got this working in laravel with the following:
add the following 'use'at the top of the controller
```
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
use ClickSend\Configuration;
use ClickSend\Api\SMSApi;
```
then the following (as an example) in your function:
```
$con... | The vendor ClickSend appears to have very lame support and none functional code and examples.
So I investigated Twilio (other providers are available !!).
Cheaper and the support is actually exemplary.
The support guide actually got what I wanted as a demo in about 10 minutes exactly as the example code stated.
```
... |
64,876,680 | Hello I want to read a file.csv that contains word pairs like this
```
1 AA 9877.88,BY US,SA 6785.66,....
```
I want to split that data in below format
```
9877.88,US,6785.66,.........
```
I have written below lines of code to read csv file
```
do{
currentline = br.readline()
if(currentline != null)
... | 2020/11/17 | [
"https://Stackoverflow.com/questions/64876680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14655312/"
] | After installing via composer, I added `use ClickSend;` at the top of my controller.
I also adjusted `new GuzzleHttp\Client()` calls to `new \GuzzleHttp\Client()` (adding a '\' at the front)
That's all I had to do to get it working on my end. | The vendor ClickSend appears to have very lame support and none functional code and examples.
So I investigated Twilio (other providers are available !!).
Cheaper and the support is actually exemplary.
The support guide actually got what I wanted as a demo in about 10 minutes exactly as the example code stated.
```
... |
59,392 | I have a data set with a set of features. Some of them are binary $(1=$ active or fired, $0=$ inactive or dormant), and the rest are real valued, e.g. $4564.342$.
I want to feed this data to a machine learning algorithm, so I $z$-score all the real-valued features. I get them between ranges $3$ and $-2$ approximately.... | 2013/05/18 | [
"https://stats.stackexchange.com/questions/59392",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/7255/"
] | A binary variable with values 0, 1 can (usually) be scaled to (value - mean) / SD, which is presumably your z-score.
The most obvious constraint on that is that if you happen to get all zeros or all ones then plugging in SD blindly would mean that the z-score is undefined. There is a case for assigning zero too in so ... | Standardizing binary variables does not make any sense. The values are arbitrary; they don't mean anything in and of themselves. There may be a rationale for choosing some values like 0 & 1, with respect to numerical stability issues, but that's it. |
59,392 | I have a data set with a set of features. Some of them are binary $(1=$ active or fired, $0=$ inactive or dormant), and the rest are real valued, e.g. $4564.342$.
I want to feed this data to a machine learning algorithm, so I $z$-score all the real-valued features. I get them between ranges $3$ and $-2$ approximately.... | 2013/05/18 | [
"https://stats.stackexchange.com/questions/59392",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/7255/"
] | A binary variable with values 0, 1 can (usually) be scaled to (value - mean) / SD, which is presumably your z-score.
The most obvious constraint on that is that if you happen to get all zeros or all ones then plugging in SD blindly would mean that the z-score is undefined. There is a case for assigning zero too in so ... | What do you want to standardize, a binary random variable, or a proportion?
It makes no sense to standardize a binary random variable. A random variable is a function that assigns a real value to an event $Y:S\rightarrow \mathbb{R} $. In this case 0 for failure and 1 to success, i.e. $Y\in \lbrace 0,1\rbrace$.
In the... |
59,392 | I have a data set with a set of features. Some of them are binary $(1=$ active or fired, $0=$ inactive or dormant), and the rest are real valued, e.g. $4564.342$.
I want to feed this data to a machine learning algorithm, so I $z$-score all the real-valued features. I get them between ranges $3$ and $-2$ approximately.... | 2013/05/18 | [
"https://stats.stackexchange.com/questions/59392",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/7255/"
] | A binary variable with values 0, 1 can (usually) be scaled to (value - mean) / SD, which is presumably your z-score.
The most obvious constraint on that is that if you happen to get all zeros or all ones then plugging in SD blindly would mean that the z-score is undefined. There is a case for assigning zero too in so ... | In logistic regression binary variables may be standardise for combining them with continuos vars when you want to give to all of them a non informative prior such as N~(0,5) or Cauchy~(0,5).
The standardisation is adviced to be as follows:
Take the total count and give
1 = proportion of 1's
0 = 1 - proportion of 1's... |
59,392 | I have a data set with a set of features. Some of them are binary $(1=$ active or fired, $0=$ inactive or dormant), and the rest are real valued, e.g. $4564.342$.
I want to feed this data to a machine learning algorithm, so I $z$-score all the real-valued features. I get them between ranges $3$ and $-2$ approximately.... | 2013/05/18 | [
"https://stats.stackexchange.com/questions/59392",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/7255/"
] | A binary variable with values 0, 1 can (usually) be scaled to (value - mean) / SD, which is presumably your z-score.
The most obvious constraint on that is that if you happen to get all zeros or all ones then plugging in SD blindly would mean that the z-score is undefined. There is a case for assigning zero too in so ... | One nice example where it can be useful to standardize in a slightly different way is given in section 4.2
of Gelman and Hill (<http://www.stat.columbia.edu/~gelman/arm/>). This is mostly when the interpretation of the coefficients is of interest, and perhaps when there are not many predictors.
There, they standardize... |
59,392 | I have a data set with a set of features. Some of them are binary $(1=$ active or fired, $0=$ inactive or dormant), and the rest are real valued, e.g. $4564.342$.
I want to feed this data to a machine learning algorithm, so I $z$-score all the real-valued features. I get them between ranges $3$ and $-2$ approximately.... | 2013/05/18 | [
"https://stats.stackexchange.com/questions/59392",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/7255/"
] | Standardizing binary variables does not make any sense. The values are arbitrary; they don't mean anything in and of themselves. There may be a rationale for choosing some values like 0 & 1, with respect to numerical stability issues, but that's it. | What do you want to standardize, a binary random variable, or a proportion?
It makes no sense to standardize a binary random variable. A random variable is a function that assigns a real value to an event $Y:S\rightarrow \mathbb{R} $. In this case 0 for failure and 1 to success, i.e. $Y\in \lbrace 0,1\rbrace$.
In the... |
59,392 | I have a data set with a set of features. Some of them are binary $(1=$ active or fired, $0=$ inactive or dormant), and the rest are real valued, e.g. $4564.342$.
I want to feed this data to a machine learning algorithm, so I $z$-score all the real-valued features. I get them between ranges $3$ and $-2$ approximately.... | 2013/05/18 | [
"https://stats.stackexchange.com/questions/59392",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/7255/"
] | Standardizing binary variables does not make any sense. The values are arbitrary; they don't mean anything in and of themselves. There may be a rationale for choosing some values like 0 & 1, with respect to numerical stability issues, but that's it. | In logistic regression binary variables may be standardise for combining them with continuos vars when you want to give to all of them a non informative prior such as N~(0,5) or Cauchy~(0,5).
The standardisation is adviced to be as follows:
Take the total count and give
1 = proportion of 1's
0 = 1 - proportion of 1's... |
59,392 | I have a data set with a set of features. Some of them are binary $(1=$ active or fired, $0=$ inactive or dormant), and the rest are real valued, e.g. $4564.342$.
I want to feed this data to a machine learning algorithm, so I $z$-score all the real-valued features. I get them between ranges $3$ and $-2$ approximately.... | 2013/05/18 | [
"https://stats.stackexchange.com/questions/59392",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/7255/"
] | Standardizing binary variables does not make any sense. The values are arbitrary; they don't mean anything in and of themselves. There may be a rationale for choosing some values like 0 & 1, with respect to numerical stability issues, but that's it. | One nice example where it can be useful to standardize in a slightly different way is given in section 4.2
of Gelman and Hill (<http://www.stat.columbia.edu/~gelman/arm/>). This is mostly when the interpretation of the coefficients is of interest, and perhaps when there are not many predictors.
There, they standardize... |
59,392 | I have a data set with a set of features. Some of them are binary $(1=$ active or fired, $0=$ inactive or dormant), and the rest are real valued, e.g. $4564.342$.
I want to feed this data to a machine learning algorithm, so I $z$-score all the real-valued features. I get them between ranges $3$ and $-2$ approximately.... | 2013/05/18 | [
"https://stats.stackexchange.com/questions/59392",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/7255/"
] | What do you want to standardize, a binary random variable, or a proportion?
It makes no sense to standardize a binary random variable. A random variable is a function that assigns a real value to an event $Y:S\rightarrow \mathbb{R} $. In this case 0 for failure and 1 to success, i.e. $Y\in \lbrace 0,1\rbrace$.
In the... | In logistic regression binary variables may be standardise for combining them with continuos vars when you want to give to all of them a non informative prior such as N~(0,5) or Cauchy~(0,5).
The standardisation is adviced to be as follows:
Take the total count and give
1 = proportion of 1's
0 = 1 - proportion of 1's... |
59,392 | I have a data set with a set of features. Some of them are binary $(1=$ active or fired, $0=$ inactive or dormant), and the rest are real valued, e.g. $4564.342$.
I want to feed this data to a machine learning algorithm, so I $z$-score all the real-valued features. I get them between ranges $3$ and $-2$ approximately.... | 2013/05/18 | [
"https://stats.stackexchange.com/questions/59392",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/7255/"
] | One nice example where it can be useful to standardize in a slightly different way is given in section 4.2
of Gelman and Hill (<http://www.stat.columbia.edu/~gelman/arm/>). This is mostly when the interpretation of the coefficients is of interest, and perhaps when there are not many predictors.
There, they standardize... | What do you want to standardize, a binary random variable, or a proportion?
It makes no sense to standardize a binary random variable. A random variable is a function that assigns a real value to an event $Y:S\rightarrow \mathbb{R} $. In this case 0 for failure and 1 to success, i.e. $Y\in \lbrace 0,1\rbrace$.
In the... |
59,392 | I have a data set with a set of features. Some of them are binary $(1=$ active or fired, $0=$ inactive or dormant), and the rest are real valued, e.g. $4564.342$.
I want to feed this data to a machine learning algorithm, so I $z$-score all the real-valued features. I get them between ranges $3$ and $-2$ approximately.... | 2013/05/18 | [
"https://stats.stackexchange.com/questions/59392",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/7255/"
] | One nice example where it can be useful to standardize in a slightly different way is given in section 4.2
of Gelman and Hill (<http://www.stat.columbia.edu/~gelman/arm/>). This is mostly when the interpretation of the coefficients is of interest, and perhaps when there are not many predictors.
There, they standardize... | In logistic regression binary variables may be standardise for combining them with continuos vars when you want to give to all of them a non informative prior such as N~(0,5) or Cauchy~(0,5).
The standardisation is adviced to be as follows:
Take the total count and give
1 = proportion of 1's
0 = 1 - proportion of 1's... |
42,899,411 | I am getting error like below
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? | 2017/03/20 | [
"https://Stackoverflow.com/questions/42899411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7657035/"
] | If you already runs GUI Synaptic Package Manager, and try to run "sudo apt-get install" from Terminal console, this error will occur. | Finally I got answer
Before typing sudo apt-get install terminal
type the following on terminal
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock |
42,899,411 | I am getting error like below
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? | 2017/03/20 | [
"https://Stackoverflow.com/questions/42899411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7657035/"
] | This worked for me:
---
Put in terminal...
```
chown root:root `which sudo`
```
then
```
chwon root:root /usr/bin/sudo
```
then
```
chmod 4755 /usr/bin/sudo
```
then type
```
reboot
```
---
Source:
* <https://www.linuxquestions.org/questions/linux-software-2/sudo-must-be-setuid-root-854117/>
---
Hope ... | Finally I got answer
Before typing sudo apt-get install terminal
type the following on terminal
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock |
53,784,587 | I have the following code to create a view with a table programmatically
```
- (void) createView:(UIViewController*)viewController{
_thisViewController = viewController;
CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width;
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
UILa... | 2018/12/14 | [
"https://Stackoverflow.com/questions/53784587",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7237735/"
] | You need to implement the `dataSource` and `delegate` methods of `UITableView` in your class,
```
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1; // number of sections
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 10; // shoul... | Firstly, you should set the following:
```
UITableView(your tableview name).delegate = self;
UITableView(your tableview name).dataSource = self;
```
Secondly, you need to implement the delegate methods and datasource methods
such as:
[](ht... |
24,293,660 | Are these both codes same? These statements inside of for loop are written in same line separated by comma. Will they be evaluated for left to right?
Also i wanted to ask can i use as many as statements inside of for loop separated by comma. Like for(i=0, j=0, k=0; .......) ?
```
for(i=0, j= strlen(s)-1; i<j; i++, j... | 2014/06/18 | [
"https://Stackoverflow.com/questions/24293660",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3740831/"
] | The C comma operator evaluates each of the two operands, discarding the result of the first and returning the second. With more than one comma, the operator is left associative so the effect is an evaluation from left to right.
Your second example will thus do the same thing as your first example. However it is poor s... | `,` operator is evaluated left to right and there is a sequence point between the evaluation of the left and the right operand, so it means both codes are equivalent. |
8,332,183 | I am creating a very simple EF4 code first project with one entity.
```
public class Activity
{
public Guid Id { get; set; }
public string Description { get; set; }
public List<DateTime> DateDone { get; set; }
<snip>
public Activity()
{
if(DateDone==null)
DateDone = new Lis... | 2011/11/30 | [
"https://Stackoverflow.com/questions/8332183",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18821/"
] | Entity Framework does not support collections of primitive types.
You need to define a separate class to hold the DateTimes. | DateTime is not an entity. You need to create a model class if you want code first to create data structures for you. I assume your activity table has a DateDone Column? |
8,332,183 | I am creating a very simple EF4 code first project with one entity.
```
public class Activity
{
public Guid Id { get; set; }
public string Description { get; set; }
public List<DateTime> DateDone { get; set; }
<snip>
public Activity()
{
if(DateDone==null)
DateDone = new Lis... | 2011/11/30 | [
"https://Stackoverflow.com/questions/8332183",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18821/"
] | Entity Framework does not support collections of primitive types.
You need to define a separate class to hold the DateTimes. | While Entity Framework does not support this natively, you can make it work quite nicely.
Please see this answer for the additional code(PersistableScalarCollection) and original idea: <https://stackoverflow.com/a/11990836/1742393>
```
/// <summary>
/// ALlows persisting of a simple DateTime collection.
/// </sum... |
8,332,183 | I am creating a very simple EF4 code first project with one entity.
```
public class Activity
{
public Guid Id { get; set; }
public string Description { get; set; }
public List<DateTime> DateDone { get; set; }
<snip>
public Activity()
{
if(DateDone==null)
DateDone = new Lis... | 2011/11/30 | [
"https://Stackoverflow.com/questions/8332183",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18821/"
] | DateTime is not an entity. You need to create a model class if you want code first to create data structures for you. I assume your activity table has a DateDone Column? | While Entity Framework does not support this natively, you can make it work quite nicely.
Please see this answer for the additional code(PersistableScalarCollection) and original idea: <https://stackoverflow.com/a/11990836/1742393>
```
/// <summary>
/// ALlows persisting of a simple DateTime collection.
/// </sum... |
32,763,365 | I am exploring neo4j for a large scale optimization application. Basically, I have uploaded a graph of locations to neo4j DB. The use case is to find the shortest path between two nodes. I am able to do this using neo4jclient, however, I have to find the shortest paths between several nodes for each request and I was l... | 2015/09/24 | [
"https://Stackoverflow.com/questions/32763365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5372419/"
] | Try it out and see for yourself...
(If nothing is displayed that is because you are [using a browser that doesn't support `let`](http://caniuse.com/#search=let).)
```js
"use strict";
let x = 20;
var z = 20;
document.write(x === z);
```
Read [this answer](https://stackoverflow.com/a/11444416/2039244) for details... | `===` does not compare variables - it does compare values. Given that both your variables hold the same value (`20`), they will be "equal".
It does not matter for the equality [how those variables were declared](https://stackoverflow.com/q/762011/1048572), only that both of them are in scope and have that value assign... |
209,433 | I used this synthax to get list Items
```
http://server/site/_api/lists/getbytitle('listname')/items
```
I get a list repeating today's date but not items .
EDIT: I notice that the number of lines that the REST Query print is equal to the number of elements in the list
[/items
``` | You are missing the `web` in URL. It should be :
```
http://server/site/_api/web/lists/getbytitle('listname')/items
``` |
209,433 | I used this synthax to get list Items
```
http://server/site/_api/lists/getbytitle('listname')/items
```
I get a list repeating today's date but not items .
EDIT: I notice that the number of lines that the REST Query print is equal to the number of elements in the list
[/items
``` |
209,433 | I used this synthax to get list Items
```
http://server/site/_api/lists/getbytitle('listname')/items
```
I get a list repeating today's date but not items .
EDIT: I notice that the number of lines that the REST Query print is equal to the number of elements in the list
[/items
``` |
30,117,967 | This is my design code. Problem is I have slider in which Image sizes I have set according to screen size. But my problem is content below slider is overlapping on slider part. What should happen is in any screen below slider that content should come. If I specify the min-image size then when screen size gets reduce it... | 2015/05/08 | [
"https://Stackoverflow.com/questions/30117967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2866996/"
] | I was able to reproduce the behavior. This is what seems to be happening:
1. The task looks in the specified folder (`spec` in your case) for files with *spec* in the name.
2. Then it looks again in *every* folder in the whole project for files with *spec* in the name.
What it ends up with is 2 overlapping sets of te... | This grunt plugin ( <https://github.com/jasmine-contrib/grunt-jasmine-node> ) seems to be dead ( <https://github.com/jasmine-contrib/grunt-jasmine-node/issues/60> ).
Maybe it is a better to switch to <https://github.com/onury/grunt-jasmine-nodejs> ? |
30,117,967 | This is my design code. Problem is I have slider in which Image sizes I have set according to screen size. But my problem is content below slider is overlapping on slider part. What should happen is in any screen below slider that content should come. If I specify the min-image size then when screen size gets reduce it... | 2015/05/08 | [
"https://Stackoverflow.com/questions/30117967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2866996/"
] | I was able to reproduce the behavior. This is what seems to be happening:
1. The task looks in the specified folder (`spec` in your case) for files with *spec* in the name.
2. Then it looks again in *every* folder in the whole project for files with *spec* in the name.
What it ends up with is 2 overlapping sets of te... | I have the same issue using grunt-jasmine-node, and as aeryaguzov points out, that project is no longer maintained. Switching to grunt-jasmine-node-new solves the issue for me.
grunt-jasmine-node-new is a fork of grunt-jasmine-node that is actively maintained, and can be found here: <https://www.npmjs.com/package/grun... |
30,117,967 | This is my design code. Problem is I have slider in which Image sizes I have set according to screen size. But my problem is content below slider is overlapping on slider part. What should happen is in any screen below slider that content should come. If I specify the min-image size then when screen size gets reduce it... | 2015/05/08 | [
"https://Stackoverflow.com/questions/30117967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2866996/"
] | I was able to reproduce the behavior. This is what seems to be happening:
1. The task looks in the specified folder (`spec` in your case) for files with *spec* in the name.
2. Then it looks again in *every* folder in the whole project for files with *spec* in the name.
What it ends up with is 2 overlapping sets of te... | The current up voted answer isn't the solution. You simply modify the expression that's going to match your tests. The answer is as follows:
```
module.exports = function(grunt) {
grunt.initConfig({
jasmine_node: {
options: {
forceExit: true
},
all: ['spec/*spec.js']
}
});
g... |
30,117,967 | This is my design code. Problem is I have slider in which Image sizes I have set according to screen size. But my problem is content below slider is overlapping on slider part. What should happen is in any screen below slider that content should come. If I specify the min-image size then when screen size gets reduce it... | 2015/05/08 | [
"https://Stackoverflow.com/questions/30117967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2866996/"
] | The [jasmine-node](https://github.com/mhevery/jasmine-node) project is pretty old. The latest [commit](https://github.com/mhevery/jasmine-node/commit/6c6099b6a33ae65b5b3c9a141e75ea797fa95a69) is from July of 2014. The [grunt-jasmine-node](https://github.com/jasmine-contrib/grunt-jasmine-node) plugin appears to be activ... | This grunt plugin ( <https://github.com/jasmine-contrib/grunt-jasmine-node> ) seems to be dead ( <https://github.com/jasmine-contrib/grunt-jasmine-node/issues/60> ).
Maybe it is a better to switch to <https://github.com/onury/grunt-jasmine-nodejs> ? |
30,117,967 | This is my design code. Problem is I have slider in which Image sizes I have set according to screen size. But my problem is content below slider is overlapping on slider part. What should happen is in any screen below slider that content should come. If I specify the min-image size then when screen size gets reduce it... | 2015/05/08 | [
"https://Stackoverflow.com/questions/30117967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2866996/"
] | This grunt plugin ( <https://github.com/jasmine-contrib/grunt-jasmine-node> ) seems to be dead ( <https://github.com/jasmine-contrib/grunt-jasmine-node/issues/60> ).
Maybe it is a better to switch to <https://github.com/onury/grunt-jasmine-nodejs> ? | I have the same issue using grunt-jasmine-node, and as aeryaguzov points out, that project is no longer maintained. Switching to grunt-jasmine-node-new solves the issue for me.
grunt-jasmine-node-new is a fork of grunt-jasmine-node that is actively maintained, and can be found here: <https://www.npmjs.com/package/grun... |
30,117,967 | This is my design code. Problem is I have slider in which Image sizes I have set according to screen size. But my problem is content below slider is overlapping on slider part. What should happen is in any screen below slider that content should come. If I specify the min-image size then when screen size gets reduce it... | 2015/05/08 | [
"https://Stackoverflow.com/questions/30117967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2866996/"
] | The [jasmine-node](https://github.com/mhevery/jasmine-node) project is pretty old. The latest [commit](https://github.com/mhevery/jasmine-node/commit/6c6099b6a33ae65b5b3c9a141e75ea797fa95a69) is from July of 2014. The [grunt-jasmine-node](https://github.com/jasmine-contrib/grunt-jasmine-node) plugin appears to be activ... | I have the same issue using grunt-jasmine-node, and as aeryaguzov points out, that project is no longer maintained. Switching to grunt-jasmine-node-new solves the issue for me.
grunt-jasmine-node-new is a fork of grunt-jasmine-node that is actively maintained, and can be found here: <https://www.npmjs.com/package/grun... |
30,117,967 | This is my design code. Problem is I have slider in which Image sizes I have set according to screen size. But my problem is content below slider is overlapping on slider part. What should happen is in any screen below slider that content should come. If I specify the min-image size then when screen size gets reduce it... | 2015/05/08 | [
"https://Stackoverflow.com/questions/30117967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2866996/"
] | The [jasmine-node](https://github.com/mhevery/jasmine-node) project is pretty old. The latest [commit](https://github.com/mhevery/jasmine-node/commit/6c6099b6a33ae65b5b3c9a141e75ea797fa95a69) is from July of 2014. The [grunt-jasmine-node](https://github.com/jasmine-contrib/grunt-jasmine-node) plugin appears to be activ... | The current up voted answer isn't the solution. You simply modify the expression that's going to match your tests. The answer is as follows:
```
module.exports = function(grunt) {
grunt.initConfig({
jasmine_node: {
options: {
forceExit: true
},
all: ['spec/*spec.js']
}
});
g... |
30,117,967 | This is my design code. Problem is I have slider in which Image sizes I have set according to screen size. But my problem is content below slider is overlapping on slider part. What should happen is in any screen below slider that content should come. If I specify the min-image size then when screen size gets reduce it... | 2015/05/08 | [
"https://Stackoverflow.com/questions/30117967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2866996/"
] | The current up voted answer isn't the solution. You simply modify the expression that's going to match your tests. The answer is as follows:
```
module.exports = function(grunt) {
grunt.initConfig({
jasmine_node: {
options: {
forceExit: true
},
all: ['spec/*spec.js']
}
});
g... | I have the same issue using grunt-jasmine-node, and as aeryaguzov points out, that project is no longer maintained. Switching to grunt-jasmine-node-new solves the issue for me.
grunt-jasmine-node-new is a fork of grunt-jasmine-node that is actively maintained, and can be found here: <https://www.npmjs.com/package/grun... |
22,382,818 | Is there a flexible framework for fuzzy testing in Java?
The [Wikipedia article on Fuzz testing](http://en.wikipedia.org/wiki/Fuzz_testing) defines fuzz testing as follows:
>
> Fuzz testing or fuzzing is a software testing technique, often automated or semi-automated, that involves providing invalid, unexpected, or... | 2014/03/13 | [
"https://Stackoverflow.com/questions/22382818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/844177/"
] | You may want to look into JQF:
<https://github.com/rohanpadhye/jqf> | Looks like there is a [Java port of Quickcheck](https://bitbucket.org/blob79/quickcheck).
>
> The goal of QuickCheck is to replace manually picked values with generated values. A QuickCheck-based test tries to cover the laws of a domain whereas classical testing can only test the validity for distinct values.
>
>
>... |
24,034,841 | I am developing an app which has a `FragmentActivity` in which I have an `ActionBar` with 3 tabs at the top. In each tab I am loading a particular Fragment.
The thing I want to know is when my application is in foreground and suppose user was seeing the third tab and then he presses the `home` button, the application ... | 2014/06/04 | [
"https://Stackoverflow.com/questions/24034841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1651015/"
] | The way i accomplished this is as suggested by @Omer using the `onResume()` method.
Inside the `onResume()` method I have written the following code
```
ViewPager pager = (ViewPager)findViewById(R.id.pager);
int DefaultTabToBeSelected = vGetValueForDefaultTab();
pager.setCurrentItem(DefaultTabToBeSelected);
... | Use the onResume() method. this method gets called whenever the user comes back into your application after leaving it (but not killing it entirly)
 |
29,564,525 | When using ctrlp, I can open a selected file in a new vertical split using ctlr-v
However, the new file open in the left split and the already opened one goes to the right split. I'd like the opposite to happen : opening the new file in the right split.
Workaround : Using ctrl-w + ctrl-r afer opening the file to inve... | 2015/04/10 | [
"https://Stackoverflow.com/questions/29564525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/93163/"
] | If you create the setting in your vimrc:
```
set splitright
```
it will open every file you open in a vertical split on the right side (not only CtrlP). | I'm a few years late here, but from the plugin :help docs, it says that you can configure the new tab position:
***a** - after.
**b** - before.
**c** - the current tab page.
**l** - the last tab page.
**f** - the first tab page.*
For your desired behaviour, you should include this in your .vimrc or the co... |
29,564,525 | When using ctrlp, I can open a selected file in a new vertical split using ctlr-v
However, the new file open in the left split and the already opened one goes to the right split. I'd like the opposite to happen : opening the new file in the right split.
Workaround : Using ctrl-w + ctrl-r afer opening the file to inve... | 2015/04/10 | [
"https://Stackoverflow.com/questions/29564525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/93163/"
] | You can also use `<c-v>` to open file in vertical split. | I'm a few years late here, but from the plugin :help docs, it says that you can configure the new tab position:
***a** - after.
**b** - before.
**c** - the current tab page.
**l** - the last tab page.
**f** - the first tab page.*
For your desired behaviour, you should include this in your .vimrc or the co... |
55,936,407 | I was seeing the Coin Change problem. In general, the input is *n* (the change to be returned) and the denominations (values of coins in cents) available, *v1 < v2 < v1 < ... < vk*; the goal is to make the change for *n* cents with the minimum number of coins.
I was reading [this pdf](http://www.columbia.edu/~cs2035/c... | 2019/05/01 | [
"https://Stackoverflow.com/questions/55936407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11390672/"
] | `C[p]` indicates the minimum number of coins you to build denomination p from your available coins array d.
So to create such sum you must pick coins `d[i]` such that `d[i]<p`.
Let's assume that you picked a coin d[i] from d. Which means you coin count now is one.
Now to make the sum p, collect more coins for a sum ... | Suppose my denominations look like this: `d = [1, 5, 10, 25]`. Let's also suppose n, the change to be returned, is 26. This means that:
`C[26] = min{C[26 - d[i]] + 1}`
which can be expressed as:
`C[26] = min{C[25], C[21], C[16], C[1]} + 1`.
The "+1" here is just the coin you need to add to one of the previously-sol... |
16,461,180 | In one of my test I need to create a SQL Express database and then populate it.
It's run fine on my machine but when TeamCity tries to run the very same test it throws the following exception:
```
Test(s) failed. System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
... | 2013/05/09 | [
"https://Stackoverflow.com/questions/16461180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/163514/"
] | Your JSON structure is a list of a dictionary. So, you have to write:
```
data[0]["cat1"]
``` | To get the values associated with the key `cat1`, try:
```
cat1 = [dct['cat1'] for dct in data]
```
Notice that `data` is a *list* of dicts, not a `dict` itself.
So you have to iterate through the items in the list (i.e. dicts) before you can access the values associated with the key `cat1`. |
61,892,306 | Currently I'm using Altair to upload files (in my case it's just for images) to my GraphQL API. However, all my other routes are stored in postman and it'd be nice if I could use just one application - Postman - for everything.
In Altair I can simply select an image and store that as a variable that I put as the value... | 2020/05/19 | [
"https://Stackoverflow.com/questions/61892306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12069343/"
] | You can use Form-Data to do this.
Key: Operations (this is for the query / mutation )
```
{"query":"mutation updateAvatar($avatar:Upload!) {\n updateAvatar(avatar: $avatar)\n}"}
```
Key: map ( this is to map the files to your query / mutation )
```
{"0": ["variables.avatar"]}
```
Key: 0 ( upload your image/file... | Answer from @Brad Larson is correct. But contains a typo:
You should have `{"0":["variables.file"]}` instead of `"[variables.file]"`
(Sorry I don't have enough reputation to comment) |
61,892,306 | Currently I'm using Altair to upload files (in my case it's just for images) to my GraphQL API. However, all my other routes are stored in postman and it'd be nice if I could use just one application - Postman - for everything.
In Altair I can simply select an image and store that as a variable that I put as the value... | 2020/05/19 | [
"https://Stackoverflow.com/questions/61892306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12069343/"
] | Answer from @Brad Larson is correct. But contains a typo:
You should have `{"0":["variables.file"]}` instead of `"[variables.file]"`
(Sorry I don't have enough reputation to comment) | Postman was unable to do this, but I found another one called [`Altair`](https://altairgraphql.dev/). See [this](https://www.xkoji.dev/blog/working-with-file-uploads-using-altair-graphql/) blog that describes how to use it for file uploads. You can even see a glimpse of how it is done in the screenshot below:
[![scree... |
61,892,306 | Currently I'm using Altair to upload files (in my case it's just for images) to my GraphQL API. However, all my other routes are stored in postman and it'd be nice if I could use just one application - Postman - for everything.
In Altair I can simply select an image and store that as a variable that I put as the value... | 2020/05/19 | [
"https://Stackoverflow.com/questions/61892306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12069343/"
] | The above solution didn't work for me but helped as a base.
I've inspected other GraphQL server requests in my browser and tried emulating them.
This is how it works for me:
[](https://i.stack.imgur.com/mETkj.png)
My server runs Django with Graphene, the dif... | you can use form-data for the same
[](https://i.stack.imgur.com/OzHAk.png)
you have add the below line to your graphql schema file
```
scalar Upload
type Mutation {
uploadFloorMap(floorMapImage: Upload!) : String
}
```
please add the below maven ... |
61,892,306 | Currently I'm using Altair to upload files (in my case it's just for images) to my GraphQL API. However, all my other routes are stored in postman and it'd be nice if I could use just one application - Postman - for everything.
In Altair I can simply select an image and store that as a variable that I put as the value... | 2020/05/19 | [
"https://Stackoverflow.com/questions/61892306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12069343/"
] | You can use Form-Data to do this.
Key: Operations (this is for the query / mutation )
```
{"query":"mutation updateAvatar($avatar:Upload!) {\n updateAvatar(avatar: $avatar)\n}"}
```
Key: map ( this is to map the files to your query / mutation )
```
{"0": ["variables.avatar"]}
```
Key: 0 ( upload your image/file... | The above solution didn't work for me but helped as a base.
I've inspected other GraphQL server requests in my browser and tried emulating them.
This is how it works for me:
[](https://i.stack.imgur.com/mETkj.png)
My server runs Django with Graphene, the dif... |
61,892,306 | Currently I'm using Altair to upload files (in my case it's just for images) to my GraphQL API. However, all my other routes are stored in postman and it'd be nice if I could use just one application - Postman - for everything.
In Altair I can simply select an image and store that as a variable that I put as the value... | 2020/05/19 | [
"https://Stackoverflow.com/questions/61892306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12069343/"
] | You can use Form-Data to do this.
Key: Operations (this is for the query / mutation )
```
{"query":"mutation updateAvatar($avatar:Upload!) {\n updateAvatar(avatar: $avatar)\n}"}
```
Key: map ( this is to map the files to your query / mutation )
```
{"0": ["variables.avatar"]}
```
Key: 0 ( upload your image/file... | I ran into this issue using `graphene-file-upload==1.2.2` as the upload handler and found it extremely complex to prepare the correct payload as the request included additional parameters to the upload file, so I hope this helps:[](https://i.stack.imgu... |
61,892,306 | Currently I'm using Altair to upload files (in my case it's just for images) to my GraphQL API. However, all my other routes are stored in postman and it'd be nice if I could use just one application - Postman - for everything.
In Altair I can simply select an image and store that as a variable that I put as the value... | 2020/05/19 | [
"https://Stackoverflow.com/questions/61892306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12069343/"
] | You can use Form-Data to do this.
Key: Operations (this is for the query / mutation )
```
{"query":"mutation updateAvatar($avatar:Upload!) {\n updateAvatar(avatar: $avatar)\n}"}
```
Key: map ( this is to map the files to your query / mutation )
```
{"0": ["variables.avatar"]}
```
Key: 0 ( upload your image/file... | Postman was unable to do this, but I found another one called [`Altair`](https://altairgraphql.dev/). See [this](https://www.xkoji.dev/blog/working-with-file-uploads-using-altair-graphql/) blog that describes how to use it for file uploads. You can even see a glimpse of how it is done in the screenshot below:
[![scree... |
61,892,306 | Currently I'm using Altair to upload files (in my case it's just for images) to my GraphQL API. However, all my other routes are stored in postman and it'd be nice if I could use just one application - Postman - for everything.
In Altair I can simply select an image and store that as a variable that I put as the value... | 2020/05/19 | [
"https://Stackoverflow.com/questions/61892306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12069343/"
] | Answer from @Brad Larson is correct. But contains a typo:
You should have `{"0":["variables.file"]}` instead of `"[variables.file]"`
(Sorry I don't have enough reputation to comment) | I ran into this issue using `graphene-file-upload==1.2.2` as the upload handler and found it extremely complex to prepare the correct payload as the request included additional parameters to the upload file, so I hope this helps:[](https://i.stack.imgu... |
61,892,306 | Currently I'm using Altair to upload files (in my case it's just for images) to my GraphQL API. However, all my other routes are stored in postman and it'd be nice if I could use just one application - Postman - for everything.
In Altair I can simply select an image and store that as a variable that I put as the value... | 2020/05/19 | [
"https://Stackoverflow.com/questions/61892306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12069343/"
] | Answer from @Brad Larson is correct. But contains a typo:
You should have `{"0":["variables.file"]}` instead of `"[variables.file]"`
(Sorry I don't have enough reputation to comment) | you can use form-data for the same
[](https://i.stack.imgur.com/OzHAk.png)
you have add the below line to your graphql schema file
```
scalar Upload
type Mutation {
uploadFloorMap(floorMapImage: Upload!) : String
}
```
please add the below maven ... |
61,892,306 | Currently I'm using Altair to upload files (in my case it's just for images) to my GraphQL API. However, all my other routes are stored in postman and it'd be nice if I could use just one application - Postman - for everything.
In Altair I can simply select an image and store that as a variable that I put as the value... | 2020/05/19 | [
"https://Stackoverflow.com/questions/61892306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12069343/"
] | The above solution didn't work for me but helped as a base.
I've inspected other GraphQL server requests in my browser and tried emulating them.
This is how it works for me:
[](https://i.stack.imgur.com/mETkj.png)
My server runs Django with Graphene, the dif... | I ran into this issue using `graphene-file-upload==1.2.2` as the upload handler and found it extremely complex to prepare the correct payload as the request included additional parameters to the upload file, so I hope this helps:[](https://i.stack.imgu... |
61,892,306 | Currently I'm using Altair to upload files (in my case it's just for images) to my GraphQL API. However, all my other routes are stored in postman and it'd be nice if I could use just one application - Postman - for everything.
In Altair I can simply select an image and store that as a variable that I put as the value... | 2020/05/19 | [
"https://Stackoverflow.com/questions/61892306",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12069343/"
] | The above solution didn't work for me but helped as a base.
I've inspected other GraphQL server requests in my browser and tried emulating them.
This is how it works for me:
[](https://i.stack.imgur.com/mETkj.png)
My server runs Django with Graphene, the dif... | Postman was unable to do this, but I found another one called [`Altair`](https://altairgraphql.dev/). See [this](https://www.xkoji.dev/blog/working-with-file-uploads-using-altair-graphql/) blog that describes how to use it for file uploads. You can even see a glimpse of how it is done in the screenshot below:
[![scree... |
1,357 | Mine is simple. I up vote any answer I think will be of value to the OP and to others with a similar problem. If I think the answer will only be of use to the OP (this usually stems from the question being very localized), I will up vote the answer when the answer takes a broad view of the question and goes sufficientl... | 2014/07/27 | [
"https://mathematica.meta.stackexchange.com/questions/1357",
"https://mathematica.meta.stackexchange.com",
"https://mathematica.meta.stackexchange.com/users/3066/"
] | I suppose I should answer this because:
* According to [the records](https://mathematica.stackexchange.com/users?tab=Voters&filter=all) I have cast more votes in total than anyone else
* I am also one of the "very high rep members" that m\_goldberg refers to
* As a Community Moderator my conduct should be held to a hi... | I wasn't around when this was asked, but I feel I should also be putting in my take.
My upvoting criterion is capriciously arbitrary: if I "enjoyed" reading the answer, or learned something genuinely new, or it is an answer that I would have written myself (also counting the case where it was written in a far better s... |
1,357 | Mine is simple. I up vote any answer I think will be of value to the OP and to others with a similar problem. If I think the answer will only be of use to the OP (this usually stems from the question being very localized), I will up vote the answer when the answer takes a broad view of the question and goes sufficientl... | 2014/07/27 | [
"https://mathematica.meta.stackexchange.com/questions/1357",
"https://mathematica.meta.stackexchange.com",
"https://mathematica.meta.stackexchange.com/users/3066/"
] | I wasn't around when this was asked, but I feel I should also be putting in my take.
My upvoting criterion is capriciously arbitrary: if I "enjoyed" reading the answer, or learned something genuinely new, or it is an answer that I would have written myself (also counting the case where it was written in a far better s... | I think of my voting policy as very conservative. Every vote must be justified (at least ideally). Nonetheless, there's a lot of good content on the site, so it's not hard for even a conservative voter to have cast a lot of votes in aggregate. My voting is also very subjective, although it has become less so over time ... |
1,357 | Mine is simple. I up vote any answer I think will be of value to the OP and to others with a similar problem. If I think the answer will only be of use to the OP (this usually stems from the question being very localized), I will up vote the answer when the answer takes a broad view of the question and goes sufficientl... | 2014/07/27 | [
"https://mathematica.meta.stackexchange.com/questions/1357",
"https://mathematica.meta.stackexchange.com",
"https://mathematica.meta.stackexchange.com/users/3066/"
] | I suppose I should answer this because:
* According to [the records](https://mathematica.stackexchange.com/users?tab=Voters&filter=all) I have cast more votes in total than anyone else
* I am also one of the "very high rep members" that m\_goldberg refers to
* As a Community Moderator my conduct should be held to a hi... | My approach is subjective. I upvote answers from which I learn something new and unexpected. I sometimes downvote an answer when I have the impression that it too heavily relies on comments or answers already given. Sometimes I downvote questions if the OP doesn't participate ("Do my homework but don't bother me with q... |
1,357 | Mine is simple. I up vote any answer I think will be of value to the OP and to others with a similar problem. If I think the answer will only be of use to the OP (this usually stems from the question being very localized), I will up vote the answer when the answer takes a broad view of the question and goes sufficientl... | 2014/07/27 | [
"https://mathematica.meta.stackexchange.com/questions/1357",
"https://mathematica.meta.stackexchange.com",
"https://mathematica.meta.stackexchange.com/users/3066/"
] | I wasn't around when this was asked, but I feel I should also be putting in my take.
My upvoting criterion is capriciously arbitrary: if I "enjoyed" reading the answer, or learned something genuinely new, or it is an answer that I would have written myself (also counting the case where it was written in a far better s... | This is a Q & A page.
When I need answers to specific questions, I search with keywords and usually find fair questions but even better answers. If a Q / A element solves my question or brings me a good bit closer to the solution I rate also old solutions positive.
I do upvote "old" responses.
One time "Questioner... |
1,357 | Mine is simple. I up vote any answer I think will be of value to the OP and to others with a similar problem. If I think the answer will only be of use to the OP (this usually stems from the question being very localized), I will up vote the answer when the answer takes a broad view of the question and goes sufficientl... | 2014/07/27 | [
"https://mathematica.meta.stackexchange.com/questions/1357",
"https://mathematica.meta.stackexchange.com",
"https://mathematica.meta.stackexchange.com/users/3066/"
] | I suppose I should answer this because:
* According to [the records](https://mathematica.stackexchange.com/users?tab=Voters&filter=all) I have cast more votes in total than anyone else
* I am also one of the "very high rep members" that m\_goldberg refers to
* As a Community Moderator my conduct should be held to a hi... | I think of my voting policy as very conservative. Every vote must be justified (at least ideally). Nonetheless, there's a lot of good content on the site, so it's not hard for even a conservative voter to have cast a lot of votes in aggregate. My voting is also very subjective, although it has become less so over time ... |
1,357 | Mine is simple. I up vote any answer I think will be of value to the OP and to others with a similar problem. If I think the answer will only be of use to the OP (this usually stems from the question being very localized), I will up vote the answer when the answer takes a broad view of the question and goes sufficientl... | 2014/07/27 | [
"https://mathematica.meta.stackexchange.com/questions/1357",
"https://mathematica.meta.stackexchange.com",
"https://mathematica.meta.stackexchange.com/users/3066/"
] | My policy is simple too: Try to act, **always**. It is important that this doesn't automatically means an up-vote. It includes down-votes, close-votes, reopen-votes or comments. The idea behind this is simple, if I take the time click on a post to read a question, I have already spend some of my time. Usually, I do thi... | This is a Q & A page.
When I need answers to specific questions, I search with keywords and usually find fair questions but even better answers. If a Q / A element solves my question or brings me a good bit closer to the solution I rate also old solutions positive.
I do upvote "old" responses.
One time "Questioner... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.