qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
6,475,959 | I hate how .NET Programs want you to download the .NET Framework to run them , so I was thinking of embedding the MONO Runtime with my program. Is there any third party software for doing it easily or would I need to do it by hand or by C/C++? Also , how much extra hard drive space would it need and are there any disad... | 2011/06/25 | [
"https://Stackoverflow.com/questions/6475959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/753341/"
] | You can distribute the Microsoft .NET Framework 4 redistributable package alongside your application.
Have a look at [smallestdotnet.com](http://www.hanselman.com/smallestdotnet/). | This question is an old one. But it's the first link to the StackOverflow that Google gave me.
So for anyone else who lands here after googling:
* Take a look at the [mkbundle](http://www.mono-project.com/archived/guiderunning_mono_applications/#bundles) utility that is a part of the Mono project's SDK.
* And see thi... |
18,448,291 | I just created a table within a huge database and saved it. I've tried to refresh the database to see if my new table appears and I closed & reopened the Management Studio but don't see my new table. I was wondering if there is a way to search for my new created table? I'm using SQL Server 2005.
Thanks a lot. | 2013/08/26 | [
"https://Stackoverflow.com/questions/18448291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2711316/"
] | You can try this:-
```
SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[table_name_here]')
```
or try this:-
```
USE YourDBName
GO
SELECT *
FROM sys.Tables
where name like '%tablename%'
GO
``` | ```
Select * from sys.tables where name like '%tablename%'
``` |
18,448,291 | I just created a table within a huge database and saved it. I've tried to refresh the database to see if my new table appears and I closed & reopened the Management Studio but don't see my new table. I was wondering if there is a way to search for my new created table? I'm using SQL Server 2005.
Thanks a lot. | 2013/08/26 | [
"https://Stackoverflow.com/questions/18448291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2711316/"
] | ```
Select * from sys.tables where name like '%tablename%'
``` | If table doesn't appear, check under different schema.
select \* from sys.all\_objects where name like '%tableName%' and type = 'U' |
18,448,291 | I just created a table within a huge database and saved it. I've tried to refresh the database to see if my new table appears and I closed & reopened the Management Studio but don't see my new table. I was wondering if there is a way to search for my new created table? I'm using SQL Server 2005.
Thanks a lot. | 2013/08/26 | [
"https://Stackoverflow.com/questions/18448291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2711316/"
] | You can try this:-
```
SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[table_name_here]')
```
or try this:-
```
USE YourDBName
GO
SELECT *
FROM sys.Tables
where name like '%tablename%'
GO
``` | If table doesn't appear, check under different schema.
select \* from sys.all\_objects where name like '%tableName%' and type = 'U' |
11,066,705 | i am trying a develop a application..following is a snippet
```
class metro_nodes {
public String station;
public GeoPoint point; }
public class mainscreen extends MapActivity {
/** Called when the activity is first created. */
MapController controller;
double latitude,longitude;
LocationManager loc;
Location lastk... | 2012/06/16 | [
"https://Stackoverflow.com/questions/11066705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1461071/"
] | You have class field declarations there, and the second last line is a statement that does not belong in the variable declaration section - has to be done as part of a method/constructor.
By enclosing it in curly braces you are actually creating a class initialization block, however trying to access anand\_nagar varia... | Null Pointer expiation is as you have not crated the instance of metro\_nodes for variable anand\_nagar using new
```
metro_nodes anand_nagar;
anand_nagar = new metro_nodes();//<----------------need this line to avoid NPE
anand_nagar.station = "anand_nagar";
```
and Please also follow standards like Class name sho... |
11,066,705 | i am trying a develop a application..following is a snippet
```
class metro_nodes {
public String station;
public GeoPoint point; }
public class mainscreen extends MapActivity {
/** Called when the activity is first created. */
MapController controller;
double latitude,longitude;
LocationManager loc;
Location lastk... | 2012/06/16 | [
"https://Stackoverflow.com/questions/11066705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1461071/"
] | You haven't posted the code that gives you the syntax error...but I'm guessing you're getting the null pointer exception because you never initialized any "metro\_nodes" objects.
For example:
```
// This is a helper class
class MetroNode {
public String station;
public GeoPoint point;
public MetroNode (String... | Null Pointer expiation is as you have not crated the instance of metro\_nodes for variable anand\_nagar using new
```
metro_nodes anand_nagar;
anand_nagar = new metro_nodes();//<----------------need this line to avoid NPE
anand_nagar.station = "anand_nagar";
```
and Please also follow standards like Class name sho... |
24,533,192 | What would be the easiest way to send previously used command, from bash
history to preffered editor, say VIM.
Right now I am using `fc -l` to see which command I am interested in, then I
isolate it by that line `fc -l lineno lineno | vim -` specifying two times `lineno` to
pick only that line, and send it to VIM.
Ho... | 2014/07/02 | [
"https://Stackoverflow.com/questions/24533192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2434479/"
] | How about moving more of the work to Vim? Say you are interested in the last 50 commands and run the following command:
```
fc -nl -50 | sed 's/^\t //' | vim -
```
Now you see all history items and can search through them with `/` or filter out with `:g/bad-line-pattern/d` and `:v/good-line-pattern/d`. If you're use... | just do this to put previous command in vim, without re-executing it after save the buffer:
```
fc -ln -1|vim -
```
or
```
history -n -1|vim -
``` |
41,317,009 | I am aware of [this existing question](https://stackoverflow.com/questions/17781472/how-to-get-a-subset-of-a-javascript-objects-properties) however I am interested in only plain javascript solutions (with no external libs like lodash).
What would be **the cleanest way** (including all ES6 goodness and beyond - like ob... | 2016/12/24 | [
"https://Stackoverflow.com/questions/41317009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2137653/"
] | You could use an IIFE with a destruction.
```js
const source = { foo: 1, bar: 2, baz: 3 },
target = (({ foo, bar, baz }) => ({ foo, bar, baz }))(source);
console.log(target);
``` | If you've got an object that contains many properties you need, and and a small amount you don't, you can use the [object rest syntax](https://github.com/sebmarkbage/ecmascript-rest-spread):
```js
const source = { foo: 1, bar: 2, baz: 3, whatever: 4 };
const { whatever, ...target } = source;
console.log(target);
`... |
41,317,009 | I am aware of [this existing question](https://stackoverflow.com/questions/17781472/how-to-get-a-subset-of-a-javascript-objects-properties) however I am interested in only plain javascript solutions (with no external libs like lodash).
What would be **the cleanest way** (including all ES6 goodness and beyond - like ob... | 2016/12/24 | [
"https://Stackoverflow.com/questions/41317009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2137653/"
] | If you've got an object that contains many properties you need, and and a small amount you don't, you can use the [object rest syntax](https://github.com/sebmarkbage/ecmascript-rest-spread):
```js
const source = { foo: 1, bar: 2, baz: 3, whatever: 4 };
const { whatever, ...target } = source;
console.log(target);
`... | You can use destructuring assignment
```js
const source = {foo: 1, bar:2, baz:3, abc: 4, def: 5};
const result = {};
({foo:result.foo, bar:result.bar, baz:result.baz} = source);
console.log(result);
```
Alternatively you can set property names as elements of an array, use `for..of` loop with destructuring assig... |
41,317,009 | I am aware of [this existing question](https://stackoverflow.com/questions/17781472/how-to-get-a-subset-of-a-javascript-objects-properties) however I am interested in only plain javascript solutions (with no external libs like lodash).
What would be **the cleanest way** (including all ES6 goodness and beyond - like ob... | 2016/12/24 | [
"https://Stackoverflow.com/questions/41317009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2137653/"
] | You could use an IIFE with a destruction.
```js
const source = { foo: 1, bar: 2, baz: 3 },
target = (({ foo, bar, baz }) => ({ foo, bar, baz }))(source);
console.log(target);
``` | You can use destructuring assignment
```js
const source = {foo: 1, bar:2, baz:3, abc: 4, def: 5};
const result = {};
({foo:result.foo, bar:result.bar, baz:result.baz} = source);
console.log(result);
```
Alternatively you can set property names as elements of an array, use `for..of` loop with destructuring assig... |
37,912 | If someone who is not a lawyer is giving out legal advice, does it make any difference if they include a disclaimer along the lines of "this is not legal advice"?
For the purposes of this question, I assume legal advice means one party instructing another party on how to comply with laws (like a consultant might do).
... | 2019/03/07 | [
"https://law.stackexchange.com/questions/37912",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/22331/"
] | >
> If someone who is not a lawyer is giving out legal advice, does it make any difference if they include a disclaimer along the lines of "this is not legal advice"?
>
>
>
The purpose of this disclaimer is to prevent someone from unreasonably relying on the advice while thinking that they are reasonably relying o... | In many jurisdictions, there is a general legal principle that people are entitled to trust certain kinds of professional opinion absent they have a particular reason not to. Someone who, e.g., build a balcony without hiring an engineer would have a duty to know what the structural requirements would be. If such a balc... |
37,912 | If someone who is not a lawyer is giving out legal advice, does it make any difference if they include a disclaimer along the lines of "this is not legal advice"?
For the purposes of this question, I assume legal advice means one party instructing another party on how to comply with laws (like a consultant might do).
... | 2019/03/07 | [
"https://law.stackexchange.com/questions/37912",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/22331/"
] | If you're talking with a friend, a disclaimer like this should not be necessary, as they know you're not a lawyer, and you're just expressing lay opinion, personal anecdotes, etc.
But if you're in a context where the audience doesn't know who you are, there's a possibility that they might assume you're qualified to di... | It is as simple as, if you represent yourself as a lawyer or law professional, but are not one, you can potentially get in a lot of trouble. It is considered a form of Practicing Law Without a License. This also includes giving actual legal advice, thus the disclaimer is to defend oneself from potential suits.
Actual ... |
37,912 | If someone who is not a lawyer is giving out legal advice, does it make any difference if they include a disclaimer along the lines of "this is not legal advice"?
For the purposes of this question, I assume legal advice means one party instructing another party on how to comply with laws (like a consultant might do).
... | 2019/03/07 | [
"https://law.stackexchange.com/questions/37912",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/22331/"
] | This is not legal advice.
If I say "this is not legal advice", and you rely on what I say, and try to sue me if everything goes pear shaped, then a judge will laugh you out of court.
If I don't say "this is not legal advice", there is a 99% chance that the judge will laugh you out of court. I'll cover the one perce... | In many jurisdictions, there is a general legal principle that people are entitled to trust certain kinds of professional opinion absent they have a particular reason not to. Someone who, e.g., build a balcony without hiring an engineer would have a duty to know what the structural requirements would be. If such a balc... |
37,912 | If someone who is not a lawyer is giving out legal advice, does it make any difference if they include a disclaimer along the lines of "this is not legal advice"?
For the purposes of this question, I assume legal advice means one party instructing another party on how to comply with laws (like a consultant might do).
... | 2019/03/07 | [
"https://law.stackexchange.com/questions/37912",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/22331/"
] | This is not legal advice.
If I say "this is not legal advice", and you rely on what I say, and try to sue me if everything goes pear shaped, then a judge will laugh you out of court.
If I don't say "this is not legal advice", there is a 99% chance that the judge will laugh you out of court. I'll cover the one perce... | If you're talking with a friend, a disclaimer like this should not be necessary, as they know you're not a lawyer, and you're just expressing lay opinion, personal anecdotes, etc.
But if you're in a context where the audience doesn't know who you are, there's a possibility that they might assume you're qualified to di... |
37,912 | If someone who is not a lawyer is giving out legal advice, does it make any difference if they include a disclaimer along the lines of "this is not legal advice"?
For the purposes of this question, I assume legal advice means one party instructing another party on how to comply with laws (like a consultant might do).
... | 2019/03/07 | [
"https://law.stackexchange.com/questions/37912",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/22331/"
] | In most jurisdictions, practicing law without a bar license is a serious offence, which, inter alia, is the primary reason why a non-lawyer would use this disclaimer.
Lawyers also use this disclaimer to avoid any 'constructive implication' of attorney-client relationship. | This is not legal advice.
If I say "this is not legal advice", and you rely on what I say, and try to sue me if everything goes pear shaped, then a judge will laugh you out of court.
If I don't say "this is not legal advice", there is a 99% chance that the judge will laugh you out of court. I'll cover the one perce... |
37,912 | If someone who is not a lawyer is giving out legal advice, does it make any difference if they include a disclaimer along the lines of "this is not legal advice"?
For the purposes of this question, I assume legal advice means one party instructing another party on how to comply with laws (like a consultant might do).
... | 2019/03/07 | [
"https://law.stackexchange.com/questions/37912",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/22331/"
] | In most jurisdictions, practicing law without a bar license is a serious offence, which, inter alia, is the primary reason why a non-lawyer would use this disclaimer.
Lawyers also use this disclaimer to avoid any 'constructive implication' of attorney-client relationship. | In many jurisdictions, there is a general legal principle that people are entitled to trust certain kinds of professional opinion absent they have a particular reason not to. Someone who, e.g., build a balcony without hiring an engineer would have a duty to know what the structural requirements would be. If such a balc... |
37,912 | If someone who is not a lawyer is giving out legal advice, does it make any difference if they include a disclaimer along the lines of "this is not legal advice"?
For the purposes of this question, I assume legal advice means one party instructing another party on how to comply with laws (like a consultant might do).
... | 2019/03/07 | [
"https://law.stackexchange.com/questions/37912",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/22331/"
] | In most jurisdictions, practicing law without a bar license is a serious offence, which, inter alia, is the primary reason why a non-lawyer would use this disclaimer.
Lawyers also use this disclaimer to avoid any 'constructive implication' of attorney-client relationship. | It is as simple as, if you represent yourself as a lawyer or law professional, but are not one, you can potentially get in a lot of trouble. It is considered a form of Practicing Law Without a License. This also includes giving actual legal advice, thus the disclaimer is to defend oneself from potential suits.
Actual ... |
37,912 | If someone who is not a lawyer is giving out legal advice, does it make any difference if they include a disclaimer along the lines of "this is not legal advice"?
For the purposes of this question, I assume legal advice means one party instructing another party on how to comply with laws (like a consultant might do).
... | 2019/03/07 | [
"https://law.stackexchange.com/questions/37912",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/22331/"
] | In most jurisdictions, practicing law without a bar license is a serious offence, which, inter alia, is the primary reason why a non-lawyer would use this disclaimer.
Lawyers also use this disclaimer to avoid any 'constructive implication' of attorney-client relationship. | If you're talking with a friend, a disclaimer like this should not be necessary, as they know you're not a lawyer, and you're just expressing lay opinion, personal anecdotes, etc.
But if you're in a context where the audience doesn't know who you are, there's a possibility that they might assume you're qualified to di... |
37,912 | If someone who is not a lawyer is giving out legal advice, does it make any difference if they include a disclaimer along the lines of "this is not legal advice"?
For the purposes of this question, I assume legal advice means one party instructing another party on how to comply with laws (like a consultant might do).
... | 2019/03/07 | [
"https://law.stackexchange.com/questions/37912",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/22331/"
] | This is not legal advice.
If I say "this is not legal advice", and you rely on what I say, and try to sue me if everything goes pear shaped, then a judge will laugh you out of court.
If I don't say "this is not legal advice", there is a 99% chance that the judge will laugh you out of court. I'll cover the one perce... | It is as simple as, if you represent yourself as a lawyer or law professional, but are not one, you can potentially get in a lot of trouble. It is considered a form of Practicing Law Without a License. This also includes giving actual legal advice, thus the disclaimer is to defend oneself from potential suits.
Actual ... |
37,912 | If someone who is not a lawyer is giving out legal advice, does it make any difference if they include a disclaimer along the lines of "this is not legal advice"?
For the purposes of this question, I assume legal advice means one party instructing another party on how to comply with laws (like a consultant might do).
... | 2019/03/07 | [
"https://law.stackexchange.com/questions/37912",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/22331/"
] | In most jurisdictions, practicing law without a bar license is a serious offence, which, inter alia, is the primary reason why a non-lawyer would use this disclaimer.
Lawyers also use this disclaimer to avoid any 'constructive implication' of attorney-client relationship. | >
> If someone who is not a lawyer is giving out legal advice, does it make any difference if they include a disclaimer along the lines of "this is not legal advice"?
>
>
>
The purpose of this disclaimer is to prevent someone from unreasonably relying on the advice while thinking that they are reasonably relying o... |
69,046 | Why does $\ce{N(CH\_3)\_3^+}$ have a larger $-I$ effect than $\ce{NH\_3^+}$?
Since the methyl group is good at donating electrons it would stabilize the charge on nitrogen atom, decreasing its potential to withdraw electrons hence its $-I$ effect.
I can't figure out why its the other way around. Can someone help me ... | 2017/02/22 | [
"https://chemistry.stackexchange.com/questions/69046",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/30246/"
] | $\ce{N(CH3)3+}$ has more -I than $\ce{NH3+}$
, this irony happens because if you consider
$\ce{N-CH3}$ bond and $\ce{N-H}$ bond, which is more polar?
Of course $\ce{N-H}$ bond will be more polar due to more difference in electronegativity value, so that implies electron density will be more on $\ce{N}$ in $\ce{NH3+}$ ... | The reason is that the methyl though gives electron via +I effect in case of H it is easy to cleave the N-H bond for nitrogen and release proton and take the electron pair from hydrogen but with C it being more electronegative than H the same is not possible . |
61,622,826 | Like many people I'm in the habit of writing new string functions as functions of `const std::string &`. The advantages are efficiency (you can pass existing `std::string` objects without incurring overhead for copying/moving) and flexibility/readability (if all you have is a `const char *` you can just pass it and hav... | 2020/05/05 | [
"https://Stackoverflow.com/questions/61622826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3019689/"
] | >
> It strikes me that, because everything is const, copying is not
> necessary—a thin STL wrapper around the existing pointer is all that's
> needed
>
>
>
I don't think this assumption is correct. Just because you have a pointer to const, it does not imply that the underlying value cannot change. It only implie... | If you pass a `const char*` to something that takes a `std::string`, reference or not, a string will be constructed. A compiler might even complain if you send it to a reference with a warning that there is an implicit temporary object.
Now this may be optimized by the compiler and also some implementations will not ... |
61,622,826 | Like many people I'm in the habit of writing new string functions as functions of `const std::string &`. The advantages are efficiency (you can pass existing `std::string` objects without incurring overhead for copying/moving) and flexibility/readability (if all you have is a `const char *` you can just pass it and hav... | 2020/05/05 | [
"https://Stackoverflow.com/questions/61622826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3019689/"
] | >
> It strikes me that, because everything is const, copying is not
> necessary—a thin STL wrapper around the existing pointer is all that's
> needed
>
>
>
I don't think this assumption is correct. Just because you have a pointer to const, it does not imply that the underlying value cannot change. It only implie... | If you don't want copying, then `string_view` is what you want.
However, with this benefit comes problems. Specifically, you have to ensure that the storage that you pass lasts "long enough".
For string literals, that's no problem. For `argv[0]`, that's almost certainly not a problem. For arbitrary sequences of chara... |
15,648,283 | I was successful in exporting to a flat file using bcp with the help of [Break up a SQL Server 2008 query into batches](https://stackoverflow.com/questions/4729697/break-up-a-sql-server-2008-query-into-batches/15645434#15645434).
Now I would like to add one (or two) rows to each batch. This is needed to "offset" the t... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15648283",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/546347/"
] | Looks like you should insert the new record after each batch is created. And, one more suggestion, the post you linked is using 'insert into table...select...', it is slower than 'select ... into table'. And 'select into table' will automatically create table for you. After each batch bcp out successfully, you can drop... | So, here is what I came up with following Ijh's suggestion and code I 'lifted' from the previously linked post :
```
-- Set up some variables
declare
@batchsize int = 900,
@bcpTargetDir varchar(10) = 'c:\tempFolder\',
@csvQueryServer varchar(15) = 'SQLserverName',
@rowcount integer,
@nowstring v... |
32,832,976 | I try to play sound with Swift 2.0
If I write 'try' without '!' I got error
"Errors thrown from here are not handled"
And AVAudioPlayer is not Optional why Xcode request 'try!'
If I write 'try!' my app crash
"unexpectedly found nil while unwrapping an Optional value"
```
class TouchViewController: UIViewController {... | 2015/09/28 | [
"https://Stackoverflow.com/questions/32832976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2236673/"
] | Here's a one liner that matches your output. It builds a string `$ARGS` containing as many process substitutions as there are unique values in the first column. Then, `$ARGS` is used as the argument for the `paste` command:
```
HEADERS=$(cut -f 1 file.txt | sort -n | uniq); ARGS=""; for h in $HEADERS; do ARGS+=" <(gre... | @Jose Ricardo Bustos M. - thanks for your answer! I unfortunately couldn't install on my Mac the gnu-awk, but based on your suggestive answer I've performed something similar using awk:
```
HEADERS=$(cut -f 1 try.txt | awk '!x[$0]++');
H=( ${HEADERS// / });
MAXUNIQNUM=$(cut -f 1 try.txt |uniq -c|awk '{print $1}'|sort ... |
32,832,976 | I try to play sound with Swift 2.0
If I write 'try' without '!' I got error
"Errors thrown from here are not handled"
And AVAudioPlayer is not Optional why Xcode request 'try!'
If I write 'try!' my app crash
"unexpectedly found nil while unwrapping an Optional value"
```
class TouchViewController: UIViewController {... | 2015/09/28 | [
"https://Stackoverflow.com/questions/32832976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2236673/"
] | Here's a one liner that matches your output. It builds a string `$ARGS` containing as many process substitutions as there are unique values in the first column. Then, `$ARGS` is used as the argument for the `paste` command:
```
HEADERS=$(cut -f 1 file.txt | sort -n | uniq); ARGS=""; for h in $HEADERS; do ARGS+=" <(gre... | This is using an array to keep track of the column headings, using them to name temporary files and `paste` everything together in the end:
```
#!/bin/bash
infile=$1
filenames=()
idx=0
while read -r key value; do
if [[ "${filenames[$idx]}" != "$key" ]]; then
(( ++idx ))
filenames[$idx]="$key"
... |
32,832,976 | I try to play sound with Swift 2.0
If I write 'try' without '!' I got error
"Errors thrown from here are not handled"
And AVAudioPlayer is not Optional why Xcode request 'try!'
If I write 'try!' my app crash
"unexpectedly found nil while unwrapping an Optional value"
```
class TouchViewController: UIViewController {... | 2015/09/28 | [
"https://Stackoverflow.com/questions/32832976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2236673/"
] | You can use `gnu-awk`
```
awk '
BEGIN{max=0;}
{
d[$1][length(d[$1])+1] = $2;
if(length(d[$1])>max)
max = length(d[$1]);
}
END{
PROCINFO["sorted_in"] = "@ind_num_asc";
line = "";
flag = 0;
for(j in d){
line = line (flag?"\t|\t":"") j;
flag = 1;
}
print line;
... | @Jose Ricardo Bustos M. - thanks for your answer! I unfortunately couldn't install on my Mac the gnu-awk, but based on your suggestive answer I've performed something similar using awk:
```
HEADERS=$(cut -f 1 try.txt | awk '!x[$0]++');
H=( ${HEADERS// / });
MAXUNIQNUM=$(cut -f 1 try.txt |uniq -c|awk '{print $1}'|sort ... |
32,832,976 | I try to play sound with Swift 2.0
If I write 'try' without '!' I got error
"Errors thrown from here are not handled"
And AVAudioPlayer is not Optional why Xcode request 'try!'
If I write 'try!' my app crash
"unexpectedly found nil while unwrapping an Optional value"
```
class TouchViewController: UIViewController {... | 2015/09/28 | [
"https://Stackoverflow.com/questions/32832976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2236673/"
] | You can use `gnu-awk`
```
awk '
BEGIN{max=0;}
{
d[$1][length(d[$1])+1] = $2;
if(length(d[$1])>max)
max = length(d[$1]);
}
END{
PROCINFO["sorted_in"] = "@ind_num_asc";
line = "";
flag = 0;
for(j in d){
line = line (flag?"\t|\t":"") j;
flag = 1;
}
print line;
... | This is using an array to keep track of the column headings, using them to name temporary files and `paste` everything together in the end:
```
#!/bin/bash
infile=$1
filenames=()
idx=0
while read -r key value; do
if [[ "${filenames[$idx]}" != "$key" ]]; then
(( ++idx ))
filenames[$idx]="$key"
... |
32,832,976 | I try to play sound with Swift 2.0
If I write 'try' without '!' I got error
"Errors thrown from here are not handled"
And AVAudioPlayer is not Optional why Xcode request 'try!'
If I write 'try!' my app crash
"unexpectedly found nil while unwrapping an Optional value"
```
class TouchViewController: UIViewController {... | 2015/09/28 | [
"https://Stackoverflow.com/questions/32832976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2236673/"
] | @Jose Ricardo Bustos M. - thanks for your answer! I unfortunately couldn't install on my Mac the gnu-awk, but based on your suggestive answer I've performed something similar using awk:
```
HEADERS=$(cut -f 1 try.txt | awk '!x[$0]++');
H=( ${HEADERS// / });
MAXUNIQNUM=$(cut -f 1 try.txt |uniq -c|awk '{print $1}'|sort ... | This is using an array to keep track of the column headings, using them to name temporary files and `paste` everything together in the end:
```
#!/bin/bash
infile=$1
filenames=()
idx=0
while read -r key value; do
if [[ "${filenames[$idx]}" != "$key" ]]; then
(( ++idx ))
filenames[$idx]="$key"
... |
3,265,313 | Let's say I'm making an `Use Case` for a game that has a scoring system. Each action you do in the game will increase/decrease your score in the game.
Here is a sketch of my `Use Case`:
```
1. ...
2. ...
...
8. The Player makes (some move).
9. The System registers the play and calculates his new score.
```
There is... | 2010/07/16 | [
"https://Stackoverflow.com/questions/3265313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130758/"
] | Algorithms are *not* interaction between user and system to create something of value.
They're a footnote or an appendix to the use case.
They're often important, but they're not interaction. Hence putting them in an appendix.
---
Also. All use cases are initiated by the Actor. They actor wants to play they game; t... | Algorithms don't belong in use cases. Extract them to a business rules section or document. |
3,265,313 | Let's say I'm making an `Use Case` for a game that has a scoring system. Each action you do in the game will increase/decrease your score in the game.
Here is a sketch of my `Use Case`:
```
1. ...
2. ...
...
8. The Player makes (some move).
9. The System registers the play and calculates his new score.
```
There is... | 2010/07/16 | [
"https://Stackoverflow.com/questions/3265313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130758/"
] | Algorithms don't belong in use cases. Extract them to a business rules section or document. | I suggest you to use Activity Diagram to represent algorithms and leave your Use Case steps simple in this case.
I also agree with "Johann Strydom" in his position.
Leo |
3,265,313 | Let's say I'm making an `Use Case` for a game that has a scoring system. Each action you do in the game will increase/decrease your score in the game.
Here is a sketch of my `Use Case`:
```
1. ...
2. ...
...
8. The Player makes (some move).
9. The System registers the play and calculates his new score.
```
There is... | 2010/07/16 | [
"https://Stackoverflow.com/questions/3265313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130758/"
] | Algorithms are *not* interaction between user and system to create something of value.
They're a footnote or an appendix to the use case.
They're often important, but they're not interaction. Hence putting them in an appendix.
---
Also. All use cases are initiated by the Actor. They actor wants to play they game; t... | I suggest you to use Activity Diagram to represent algorithms and leave your Use Case steps simple in this case.
I also agree with "Johann Strydom" in his position.
Leo |
7,309,112 | I started playing around with Celery and RabbitMQ this morning and defined some basic tasks to see how the performance will improve on my server.
I have added my rabbitmq user, vhosts and set my permissions.
Started my RabbitMQ server
In a very detailed tutorial I found these guys use celerybeat and celeryd to see th... | 2011/09/05 | [
"https://Stackoverflow.com/questions/7309112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/348869/"
] | Well, you'll need to have some sort of celery process running in order to handle tasks in the queue. The celeryd process listens on the queue, and executes tasks according to your settings. If you don't have a celeryd process running, you'll just be adding tasks to the queue, but never emptying it.
If you're just int... | <http://ask.github.com/celery/getting-started/introduction.html>
1. Start your RabbitMQ server
2. Define your celeryconfig.py
3. Start your celery daemon: celeryd
RabbitMQ has a guest login, so that's a faster way to get started. Put this in celeryconfig.py:
```
import sys
sys.path.append('.')
BROKER_HOST = "localh... |
37,192,193 | I want to calculate the average of the prime numbers between 1 to 10 and I have written a program which is as follows:
```
#include <stdio.h>
int main()
{
int i, j, sum = 0, count = 0;
loop1:
for(i = 2; i <= 10; i++)
{
for(j = i - 1; j > 1; j--)
{
if(i ... | 2016/05/12 | [
"https://Stackoverflow.com/questions/37192193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6035676/"
] | Simple answer for you:
```
#include <stdio.h>
int main() {
float sum = 0, count = 0, average;
for(int i=2; i<11; i++){
for(int j=2; j<=i; j++){
if(j==i){
sum+=i;
count++;
}else if(i%j==0){
break;
}
}
}
... | What do you mean by "Correct" ?
If correct to you means that it works: well that's easy to verify for yourself.
If correct means that you are hitting the best practices, well then, nope, you missed them I'm afraid.
goto: about the most easy of all "do not use that" signs.
A "better" approach would be to write a fun... |
37,192,193 | I want to calculate the average of the prime numbers between 1 to 10 and I have written a program which is as follows:
```
#include <stdio.h>
int main()
{
int i, j, sum = 0, count = 0;
loop1:
for(i = 2; i <= 10; i++)
{
for(j = i - 1; j > 1; j--)
{
if(i ... | 2016/05/12 | [
"https://Stackoverflow.com/questions/37192193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6035676/"
] | Please ensure you do not make a habit of using`goto:` statements. Your program is incorrect. Here, when the statement
```
if(i % j == 0)
```
returns true, the`goto:` statement takes control to the beginning of the parent `for` loop and the loop will run from start again. This way, you will never get your desired out... | What do you mean by "Correct" ?
If correct to you means that it works: well that's easy to verify for yourself.
If correct means that you are hitting the best practices, well then, nope, you missed them I'm afraid.
goto: about the most easy of all "do not use that" signs.
A "better" approach would be to write a fun... |
37,192,193 | I want to calculate the average of the prime numbers between 1 to 10 and I have written a program which is as follows:
```
#include <stdio.h>
int main()
{
int i, j, sum = 0, count = 0;
loop1:
for(i = 2; i <= 10; i++)
{
for(j = i - 1; j > 1; j--)
{
if(i ... | 2016/05/12 | [
"https://Stackoverflow.com/questions/37192193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6035676/"
] | Simple answer for you:
```
#include <stdio.h>
int main() {
float sum = 0, count = 0, average;
for(int i=2; i<11; i++){
for(int j=2; j<=i; j++){
if(j==i){
sum+=i;
count++;
}else if(i%j==0){
break;
}
}
}
... | Please ensure you do not make a habit of using`goto:` statements. Your program is incorrect. Here, when the statement
```
if(i % j == 0)
```
returns true, the`goto:` statement takes control to the beginning of the parent `for` loop and the loop will run from start again. This way, you will never get your desired out... |
6,301 | I've been reading example leases and was surprised to see how much power the landlord has in the US, at least compared to Canada. For example, at least in BC, landlords must allow tenants to sublet or assign their room and cannot charge a fee. I've seen leases in California that say if a tenant wishes to sublet they wi... | 2016/01/10 | [
"https://law.stackexchange.com/questions/6301",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/3985/"
] | Different jurisdictions have different attitudes and histories. The difference is probably more cultural than legal and both leases are quite likely legal in both jurisdictions.
In general, US jurisdictions tend towards laissez-faire capitalism and contracts have a buyer beware slant. Civil-law European countries are ... | In many jurisdictions, the law is overwhelmingly in favor of the tenant. Just getting a tenant evicted to non-payment of rent is a major exercise (for a graphic illustration, watch the movie Pacific Heights). Landlord compensate by using contractual provisions. |
33,789,316 | I know there are answers on atomic vs. non-atomic answers, but they mostly seem to be fairly old (2011 and earlier), so I'm hoping for updated advice. My understanding is that non-atomic properties are faster but not thread safe. Does this mean that any property that might be accessed from multiple threads at the same ... | 2015/11/18 | [
"https://Stackoverflow.com/questions/33789316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4995876/"
] | Declaring a property as atomic does not necessarily make it thread safe.
Atomic is the default and involves some extra overhead compared to nonatomic. If thread A is halfway through the getter for that property and thread B changes the value in the setter, using atomic will ensure that a viable, whole value is return... | There are no other concerns. Yes, any property that can be accessed on multiple threads should be atomic or you can end up with unexpected results. |
33,789,316 | I know there are answers on atomic vs. non-atomic answers, but they mostly seem to be fairly old (2011 and earlier), so I'm hoping for updated advice. My understanding is that non-atomic properties are faster but not thread safe. Does this mean that any property that might be accessed from multiple threads at the same ... | 2015/11/18 | [
"https://Stackoverflow.com/questions/33789316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4995876/"
] | In most situations it is unimportant, whether a property is atomic or not in a multithreaded environment.
What?
In most situations it is unimportant, whether a property is atomic or not in a multithreaded environment.
The reason for this is that making a property "thread-safe" by turning atomicity on does *not* ma... | There are no other concerns. Yes, any property that can be accessed on multiple threads should be atomic or you can end up with unexpected results. |
33,789,316 | I know there are answers on atomic vs. non-atomic answers, but they mostly seem to be fairly old (2011 and earlier), so I'm hoping for updated advice. My understanding is that non-atomic properties are faster but not thread safe. Does this mean that any property that might be accessed from multiple threads at the same ... | 2015/11/18 | [
"https://Stackoverflow.com/questions/33789316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4995876/"
] | Declaring a property `atomic` makes compiler generate additional code that prevents concurrent access to the property. This additional code locks a **semaphore**, then gets or sets the property, and then unlock the semaphore. Compared to setting or getting a primitive value or a pointer, locking and unlocking a semapho... | There are no other concerns. Yes, any property that can be accessed on multiple threads should be atomic or you can end up with unexpected results. |
33,789,316 | I know there are answers on atomic vs. non-atomic answers, but they mostly seem to be fairly old (2011 and earlier), so I'm hoping for updated advice. My understanding is that non-atomic properties are faster but not thread safe. Does this mean that any property that might be accessed from multiple threads at the same ... | 2015/11/18 | [
"https://Stackoverflow.com/questions/33789316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4995876/"
] | Declaring a property `atomic` makes compiler generate additional code that prevents concurrent access to the property. This additional code locks a **semaphore**, then gets or sets the property, and then unlock the semaphore. Compared to setting or getting a primitive value or a pointer, locking and unlocking a semapho... | Declaring a property as atomic does not necessarily make it thread safe.
Atomic is the default and involves some extra overhead compared to nonatomic. If thread A is halfway through the getter for that property and thread B changes the value in the setter, using atomic will ensure that a viable, whole value is return... |
33,789,316 | I know there are answers on atomic vs. non-atomic answers, but they mostly seem to be fairly old (2011 and earlier), so I'm hoping for updated advice. My understanding is that non-atomic properties are faster but not thread safe. Does this mean that any property that might be accessed from multiple threads at the same ... | 2015/11/18 | [
"https://Stackoverflow.com/questions/33789316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4995876/"
] | Declaring a property `atomic` makes compiler generate additional code that prevents concurrent access to the property. This additional code locks a **semaphore**, then gets or sets the property, and then unlock the semaphore. Compared to setting or getting a primitive value or a pointer, locking and unlocking a semapho... | In most situations it is unimportant, whether a property is atomic or not in a multithreaded environment.
What?
In most situations it is unimportant, whether a property is atomic or not in a multithreaded environment.
The reason for this is that making a property "thread-safe" by turning atomicity on does *not* ma... |
13,775,510 | I'm attempting to implement soft shadows in my raytracer. To do so, I plan to shoot multiple shadow rays from the intersection point towards the area light source. I'm aiming to use a spherical area light--this means I need to generate random points on the sphere for the direction vector of my ray (recall that ray's ar... | 2012/12/08 | [
"https://Stackoverflow.com/questions/13775510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | *Graphics Gems III*, page 126:
```
void random_unit_vector(double v[3]) {
double theta = random_double(2.0 * PI);
double x = random_double(2.0) - 1.0;
double s = sqrt(1.0 - x * x);
v[0] = x;
v[1] = s * cos(theta);
v[2] = s * sin(theta);
}
```
(This is the second of four methods given in M... | A lot of good formulae for random distributions are found in the [Global Illumination Compendium](http://people.cs.kuleuven.be/~philip.dutre/GI/TotalCompendium.pdf). Part **4.B.** has formulae for generating points on a (hemi) sphere. It's a great reference for sampling, integration, etc. |
55,245,100 | I need to do the following loop in python (in pseudo-code, I'm learning python)
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
for i = 1 to 2
averagesOfNumbers [i] = (listOfNumbers [i] + listOfNumbers[i + 1]) / 2
end i
```
averageOfNumbers will look like [1.5, 2.5, 0].
How do I do this in Python? | 2019/03/19 | [
"https://Stackoverflow.com/questions/55245100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10873207/"
] | See the code if this is what you're looking for:
```
List=[1,2,3]
avg=[0]*len(List)
for i in range(len(List)-1):
avg[i]=(List[i]+List[i+1])/2
print(avg)
```
Hope you got the code.
Output:
[1.5,2.5,0] | I guess you want to do the following:
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
for i in range(len(listOfNumbers)-1):
averagesOfNumbers[i] = (listOfNumbers[i] + listOfNumbers[i+1]) / 2
``` |
55,245,100 | I need to do the following loop in python (in pseudo-code, I'm learning python)
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
for i = 1 to 2
averagesOfNumbers [i] = (listOfNumbers [i] + listOfNumbers[i + 1]) / 2
end i
```
averageOfNumbers will look like [1.5, 2.5, 0].
How do I do this in Python? | 2019/03/19 | [
"https://Stackoverflow.com/questions/55245100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10873207/"
] | This is how you would do it in Python:
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
# In Python, range function generates a range of numbers
# starting from 0 if number range is not provided.
# So, range(2) means 0 and 1 in total, that
# is 2 numbers.
for i in range(2):
averagesOfNumbers[i] = (listOf... | I guess you want to do the following:
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
for i in range(len(listOfNumbers)-1):
averagesOfNumbers[i] = (listOfNumbers[i] + listOfNumbers[i+1]) / 2
``` |
55,245,100 | I need to do the following loop in python (in pseudo-code, I'm learning python)
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
for i = 1 to 2
averagesOfNumbers [i] = (listOfNumbers [i] + listOfNumbers[i + 1]) / 2
end i
```
averageOfNumbers will look like [1.5, 2.5, 0].
How do I do this in Python? | 2019/03/19 | [
"https://Stackoverflow.com/questions/55245100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10873207/"
] | Wow this is so cool. I never used stackoverflow before. I've always wondered how to get the smart people to help me !!
Here is what gives me the right answer to my homework.
calculate average change, greatest increase, greatest decrease.
```
i = 0
while (i < rowCount - 1):
diffPL.append(PL[i+1] - PL[i])
i = i... | I guess you want to do the following:
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
for i in range(len(listOfNumbers)-1):
averagesOfNumbers[i] = (listOfNumbers[i] + listOfNumbers[i+1]) / 2
``` |
55,245,100 | I need to do the following loop in python (in pseudo-code, I'm learning python)
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
for i = 1 to 2
averagesOfNumbers [i] = (listOfNumbers [i] + listOfNumbers[i + 1]) / 2
end i
```
averageOfNumbers will look like [1.5, 2.5, 0].
How do I do this in Python? | 2019/03/19 | [
"https://Stackoverflow.com/questions/55245100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10873207/"
] | See the code if this is what you're looking for:
```
List=[1,2,3]
avg=[0]*len(List)
for i in range(len(List)-1):
avg[i]=(List[i]+List[i+1])/2
print(avg)
```
Hope you got the code.
Output:
[1.5,2.5,0] | ```
list_of_numbers = [1, 2, 3]
averages_of_numbers = [0, 0, 0]
for i in range(0, 2): # this will take indexes 0 and 1
averages_of_numbers[i] = (list_of_numbers[i] + list_of_numbers[i+1]) / 2
print(averages_of_numbers)
``` |
55,245,100 | I need to do the following loop in python (in pseudo-code, I'm learning python)
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
for i = 1 to 2
averagesOfNumbers [i] = (listOfNumbers [i] + listOfNumbers[i + 1]) / 2
end i
```
averageOfNumbers will look like [1.5, 2.5, 0].
How do I do this in Python? | 2019/03/19 | [
"https://Stackoverflow.com/questions/55245100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10873207/"
] | This is how you would do it in Python:
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
# In Python, range function generates a range of numbers
# starting from 0 if number range is not provided.
# So, range(2) means 0 and 1 in total, that
# is 2 numbers.
for i in range(2):
averagesOfNumbers[i] = (listOf... | ```
list_of_numbers = [1, 2, 3]
averages_of_numbers = [0, 0, 0]
for i in range(0, 2): # this will take indexes 0 and 1
averages_of_numbers[i] = (list_of_numbers[i] + list_of_numbers[i+1]) / 2
print(averages_of_numbers)
``` |
55,245,100 | I need to do the following loop in python (in pseudo-code, I'm learning python)
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
for i = 1 to 2
averagesOfNumbers [i] = (listOfNumbers [i] + listOfNumbers[i + 1]) / 2
end i
```
averageOfNumbers will look like [1.5, 2.5, 0].
How do I do this in Python? | 2019/03/19 | [
"https://Stackoverflow.com/questions/55245100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10873207/"
] | Wow this is so cool. I never used stackoverflow before. I've always wondered how to get the smart people to help me !!
Here is what gives me the right answer to my homework.
calculate average change, greatest increase, greatest decrease.
```
i = 0
while (i < rowCount - 1):
diffPL.append(PL[i+1] - PL[i])
i = i... | ```
list_of_numbers = [1, 2, 3]
averages_of_numbers = [0, 0, 0]
for i in range(0, 2): # this will take indexes 0 and 1
averages_of_numbers[i] = (list_of_numbers[i] + list_of_numbers[i+1]) / 2
print(averages_of_numbers)
``` |
55,245,100 | I need to do the following loop in python (in pseudo-code, I'm learning python)
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
for i = 1 to 2
averagesOfNumbers [i] = (listOfNumbers [i] + listOfNumbers[i + 1]) / 2
end i
```
averageOfNumbers will look like [1.5, 2.5, 0].
How do I do this in Python? | 2019/03/19 | [
"https://Stackoverflow.com/questions/55245100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10873207/"
] | See the code if this is what you're looking for:
```
List=[1,2,3]
avg=[0]*len(List)
for i in range(len(List)-1):
avg[i]=(List[i]+List[i+1])/2
print(avg)
```
Hope you got the code.
Output:
[1.5,2.5,0] | What is the most pythonic way here is to make use of [`zip`](https://docs.python.org/3.7/library/functions.html#zip). This avoids having indexes that you don't really use:
```py
>>> numbers = [1,2,3]
>>> [sum(pair)/2 for pair in zip(numbers, numbers[1:])]
[1.5, 2.5]
```
If you really need to have a zero at the end,... |
55,245,100 | I need to do the following loop in python (in pseudo-code, I'm learning python)
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
for i = 1 to 2
averagesOfNumbers [i] = (listOfNumbers [i] + listOfNumbers[i + 1]) / 2
end i
```
averageOfNumbers will look like [1.5, 2.5, 0].
How do I do this in Python? | 2019/03/19 | [
"https://Stackoverflow.com/questions/55245100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10873207/"
] | This is how you would do it in Python:
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
# In Python, range function generates a range of numbers
# starting from 0 if number range is not provided.
# So, range(2) means 0 and 1 in total, that
# is 2 numbers.
for i in range(2):
averagesOfNumbers[i] = (listOf... | What is the most pythonic way here is to make use of [`zip`](https://docs.python.org/3.7/library/functions.html#zip). This avoids having indexes that you don't really use:
```py
>>> numbers = [1,2,3]
>>> [sum(pair)/2 for pair in zip(numbers, numbers[1:])]
[1.5, 2.5]
```
If you really need to have a zero at the end,... |
55,245,100 | I need to do the following loop in python (in pseudo-code, I'm learning python)
```
listOfNumbers = [1,2,3]
averagesOfNumbers = [0,0,0]
for i = 1 to 2
averagesOfNumbers [i] = (listOfNumbers [i] + listOfNumbers[i + 1]) / 2
end i
```
averageOfNumbers will look like [1.5, 2.5, 0].
How do I do this in Python? | 2019/03/19 | [
"https://Stackoverflow.com/questions/55245100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10873207/"
] | Wow this is so cool. I never used stackoverflow before. I've always wondered how to get the smart people to help me !!
Here is what gives me the right answer to my homework.
calculate average change, greatest increase, greatest decrease.
```
i = 0
while (i < rowCount - 1):
diffPL.append(PL[i+1] - PL[i])
i = i... | What is the most pythonic way here is to make use of [`zip`](https://docs.python.org/3.7/library/functions.html#zip). This avoids having indexes that you don't really use:
```py
>>> numbers = [1,2,3]
>>> [sum(pair)/2 for pair in zip(numbers, numbers[1:])]
[1.5, 2.5]
```
If you really need to have a zero at the end,... |
32,147,416 | When I catch an exception in php and try to output some details, getMessage() invariably returns nothing. If I do a var\_dump(), I see the message that I would like to display. What am I doing wrong?
```
try
{
...
}
catch (Exception $e... | 2015/08/21 | [
"https://Stackoverflow.com/questions/32147416",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/68936/"
] | The e-trade exception class is a mess. It implements its own constructor and does not set the correct values for the standard `Exception`. It expects you to use `$e->getErrorMessage()` to get the message.
```
<?php
/**
* E*TRADE PHP SDK
*
* @package PHP-SDK
* @version 1.1
* @copyright Copyright (c) 2012... | ```
["message":protected]=> string(0) ""
```
Is your issue
```
get_class_methods($e)
```
may expose some more |
32,147,416 | When I catch an exception in php and try to output some details, getMessage() invariably returns nothing. If I do a var\_dump(), I see the message that I would like to display. What am I doing wrong?
```
try
{
...
}
catch (Exception $e... | 2015/08/21 | [
"https://Stackoverflow.com/questions/32147416",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/68936/"
] | There are a couple issues here. First, if you look at the var\_dump of $e, the message index is empty. Thus, you are getting nothing back when you use getMessage. Second, the exception thrown is not a standard PHP exception. It is written by the API you are using and you need to read its documentation to figure out how... | ```
["message":protected]=> string(0) ""
```
Is your issue
```
get_class_methods($e)
```
may expose some more |
32,147,416 | When I catch an exception in php and try to output some details, getMessage() invariably returns nothing. If I do a var\_dump(), I see the message that I would like to display. What am I doing wrong?
```
try
{
...
}
catch (Exception $e... | 2015/08/21 | [
"https://Stackoverflow.com/questions/32147416",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/68936/"
] | The e-trade exception class is a mess. It implements its own constructor and does not set the correct values for the standard `Exception`. It expects you to use `$e->getErrorMessage()` to get the message.
```
<?php
/**
* E*TRADE PHP SDK
*
* @package PHP-SDK
* @version 1.1
* @copyright Copyright (c) 2012... | There are a couple issues here. First, if you look at the var\_dump of $e, the message index is empty. Thus, you are getting nothing back when you use getMessage. Second, the exception thrown is not a standard PHP exception. It is written by the API you are using and you need to read its documentation to figure out how... |
32,610,270 | How can use AJAX to load a complete partial view rendered in html (so I just set the div.html)
I need the ajax call to call controller action that will render a complete partial view (red) and append it at the end of the currently loaded one?
[I know how to append to DOM and how to make AJAX calls]
I need to know ... | 2015/09/16 | [
"https://Stackoverflow.com/questions/32610270",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1744780/"
] | There is built-in ajax helpers in ASP.NET MVC which can cover the basic scenarios.
You need to install and refer `jquery.unobtrusive-ajax` JavaScript library ( + jQuery dependency). Then in your main view (let's say index.cshtml) put following code:
**Index.cshtml**
```
@Ajax.ActionLink("Load More Posts", "MorePost... | I recommend getting the `Westwind.Web.Mvc` library from NUGET and you can run any of your views to a string to return back as a JSON result
```
public JsonResult GetPosts()
{
string postsHtml = ViewRenderer.RenderPartialView("~/views/yourcontroller/_PostsPartial.cshtml",model);
return Json(new { html = postsH... |
431,010 | I would like to ask for a reccomended solution for this:
We have a list of Competitions.
Each competition has defined fee that a participatior has to pay
We have Participators
I have to know has a Participator that is on a Competition paid the fee or not. I am thinking about 2 solutions and the thing is it has to... | 2009/01/10 | [
"https://Stackoverflow.com/questions/431010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/46739/"
] | The way I would handle this is to have Competitions, Participants, and Registrations. A Participant would register for a Competition, creating a Registration. A Registration would consist of the Competition id, Participant id, a flag indicating whether the fee was paid or not, and any other registration-specific data (... | sounds like a typical many to many relationship. i would model it with an Entry association class as follows:
```
class Participator {
}
class Competition {
Currency fee
}
class Entry {
Competition competition
Participator participator
Boolean feePaid
}
``` |
10,792,115 | I'm trying to run a script of matlab in BASH in the background the following way:
```
echo "matlab -nojvm -r p=setpath(/mydirectory/);addpath(p);myscript;exit" |sh &
```
the error I get is:
```
sh: line 1: syntax error near unexpected token '('
sh: line 1: 'matlab -nojvm -r p=setpath(/mydirectory/);addpath(p);myscr... | 2012/05/29 | [
"https://Stackoverflow.com/questions/10792115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1420894/"
] | found the solution thanks to the next website of the OHIO state Uni
```
matlab -nodesktop -nodisplay < file.m &> file.out &
```
it works without any bypassing route
for further explanation go to
<http://www.stat.osu.edu/computer-support/programming/background-jobs> | Try this:
```
echo 'matlab -nojvm -r "p=setpath(/mydirectory/);addpath(p);myscript;exit"' |sh &
```
The outer single quotes protect the inner double quotes so `sh` doesn't see the parentheses.
Is there any reason you can't just:
```
matlab -nojvm -r "p=setpath(/mydirectory/);addpath(p);myscript;exit" &
```
or pe... |
31,504 | Are there any tricks I can use to connect a QFP (or similar) package component to a stripboard (veroboard), without the hassle of setting up a personal PCB fabrication kit to make a breakout board?
I've seen TQFP-to-DIP adapters on places like Farnell, but they tend to be extortionate - some are over £80. | 2012/05/09 | [
"https://electronics.stackexchange.com/questions/31504",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/6585/"
] | Farnell *is* expensive, and we only use it because of its overnight delivery.
There are cheaper options. [EZPrototypes](http://www.ezprototypes.com/DipAdaptersMain.php) has for instance a QFP64 to DIL adapter for 10 dollar.
**edit**
Since you're in the UK, [HobbyTronics](http://www.hobbytronics.co.uk/tqfp-dip-ad... | Buy a breakout board, such as those made by Schmartboard:
<http://www.schmartboard.com/>
I'd make my own, it's quite easy. |
31,504 | Are there any tricks I can use to connect a QFP (or similar) package component to a stripboard (veroboard), without the hassle of setting up a personal PCB fabrication kit to make a breakout board?
I've seen TQFP-to-DIP adapters on places like Farnell, but they tend to be extortionate - some are over £80. | 2012/05/09 | [
"https://electronics.stackexchange.com/questions/31504",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/6585/"
] | If you are patient or desperate, there is another solution, called "dead bug":

This requires no additional materials except some wires and maybe some glue to fix the chip on the board but extraordinary soldering skill. | Buy a breakout board, such as those made by Schmartboard:
<http://www.schmartboard.com/>
I'd make my own, it's quite easy. |
31,504 | Are there any tricks I can use to connect a QFP (or similar) package component to a stripboard (veroboard), without the hassle of setting up a personal PCB fabrication kit to make a breakout board?
I've seen TQFP-to-DIP adapters on places like Farnell, but they tend to be extortionate - some are over £80. | 2012/05/09 | [
"https://electronics.stackexchange.com/questions/31504",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/6585/"
] | Farnell *is* expensive, and we only use it because of its overnight delivery.
There are cheaper options. [EZPrototypes](http://www.ezprototypes.com/DipAdaptersMain.php) has for instance a QFP64 to DIL adapter for 10 dollar.
**edit**
Since you're in the UK, [HobbyTronics](http://www.hobbytronics.co.uk/tqfp-dip-ad... | If you are patient or desperate, there is another solution, called "dead bug":

This requires no additional materials except some wires and maybe some glue to fix the chip on the board but extraordinary soldering skill. |
13,722,125 | I'd like to keep running my unit tests in strict mode so that I'm aware of any exceptionally long tests easily, but at the same time the default timeout of 1s is not enough. Can I change it for all tests? I know I can set timeout for each class (and individual tests) using `@short / @medium / @long` annotations, but is... | 2012/12/05 | [
"https://Stackoverflow.com/questions/13722125",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1102633/"
] | The option can be enabled by setting wanted times in phpunit.xml. The times are in seconds.
Example:
```
<phpunit
strict="true"
timeoutForSmallTests="1"
timeoutForMediumTests="5"
timeoutForLargeTests="10"
>
// test suites
</phpunit>
```
Tests can be marked to be medium or large by marking actual te... | Alternatively you can set them also in your setUp() method like this:
```
$this->getTestResultObject()->setTimeoutForSmallTests(1);
$this->getTestResultObject()->setTimeoutForMediumTests(5);
$this->getTestResultObject()->setTimeoutForLargeTests(10);
``` |
12,104,737 | I want to send image through iOS devices by BSD Socket.
As we know, an image is divided into several packages to be sent out, So the receiver needs the size of the image.
So I want to insert the size to the beginning of the images's binary data.
```
NSData* image = UIImagePNGRepresentation(screenShot);
NSUInteger le... | 2012/08/24 | [
"https://Stackoverflow.com/questions/12104737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1618548/"
] | Check your apache error log, maybe the execution is being blocked and have PHP set to hide errors.
Also, try (just as an experiment) using full paths - both far java and the .jar file. | Do you call your php script from another script with `include` or `require`?
Make a system call to pwd to ensure the correct working path. It should be the same as the path to the jar file
```
system('pwd');
```
Other ways you could fail:
The apache/php user is not allowed to run the jar file. Try to set a file per... |
12,104,737 | I want to send image through iOS devices by BSD Socket.
As we know, an image is divided into several packages to be sent out, So the receiver needs the size of the image.
So I want to insert the size to the beginning of the images's binary data.
```
NSData* image = UIImagePNGRepresentation(screenShot);
NSUInteger le... | 2012/08/24 | [
"https://Stackoverflow.com/questions/12104737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1618548/"
] | Check your apache error log, maybe the execution is being blocked and have PHP set to hide errors.
Also, try (just as an experiment) using full paths - both far java and the .jar file. | After checking your log, you may find your PHP.ini is blocking commands with something like:
```
disable_functions =exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
```
Remove 'system' and 'exec' to allow these functions in PHP. |
12,104,737 | I want to send image through iOS devices by BSD Socket.
As we know, an image is divided into several packages to be sent out, So the receiver needs the size of the image.
So I want to insert the size to the beginning of the images's binary data.
```
NSData* image = UIImagePNGRepresentation(screenShot);
NSUInteger le... | 2012/08/24 | [
"https://Stackoverflow.com/questions/12104737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1618548/"
] | Check your apache error log, maybe the execution is being blocked and have PHP set to hide errors.
Also, try (just as an experiment) using full paths - both far java and the .jar file. | Please look into your domain configuration whether safe mode is on or not for your domain. That will block the exec function |
193,000 | Recently I started fiddling around with pathfinding. I created a WayPoint component to determin a possible way to another actor which is defined over other waypoints. My grid is looking somewhat like this:
[](https://i.stack.imgur.com/R1fFQ.png)
The ... | 2018/04/26 | [
"https://codereview.stackexchange.com/questions/193000",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/72825/"
] | Invalid C code
--------------
OP’s C compiler may support various language extensions, but `int &amount` is not supported in standard C [@Ben Steffan](https://codereview.stackexchange.com/questions/192995/calculate-how-many-coins-coin-values-are-50-20-10-and-5/193018#comment370797_192995). This makes the code less por... | [I cannot offer much C experience](https://codereview.stackexchange.com/questions/192995/calculate-how-many-coins-coin-values-are-50-20-10-and-5/193018?noredirect=1#comment370842_193018), but I think the code is very well structured.
The output part is encapsulated in a own functions and also the other tasks.
* The ... |
131,077 | I am inserting the opportunity line item based on the values of custom object.
I am able to achieve this if I add the soql query inside for loop.But that is not an optimized solution. Can anyone suggest me how to do it with out adding inside for loop ?
Apex Class:
```
List<PricebookEntry> PBList = new List<PricebookE... | 2016/07/12 | [
"https://salesforce.stackexchange.com/questions/131077",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/34322/"
] | Here is one approach.
1. First get a set of the products you're going to need
2. Get all the PBEntry records at once and put them on a map (key = the product name) so you can retrieve them easily later
3. In your loop, check for the existence of records with that product name and, if they do, then retrieve the record... | You can try something like this:
```
List<PricebookEntry> PBList = new List<PricebookEntry>();
List<String> somelIst = new List<String>();
for(Pricing__c prices: priceList){
someList.add(prices.name__C);
}
PBList=[SELECT Id, IsActive, CurrencyIsoCode FROM PricebookEntry
WHERE Product2.Name IN som... |
32,277,698 | This program declares an 8x8 character array and then uses a loop to store the following data into the array(one character per array element). Then it prints this array to the screen:
BRBRBRBR
RBRBRBRB
BRBRBRBR
RBRBRBRB
BRBRBRBR
RBRBRBRB
BRBRBRBR
RBRBRBRB
The program works fine. However, I am having trouble u... | 2015/08/28 | [
"https://Stackoverflow.com/questions/32277698",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4400293/"
] | `(i+j) & 1` will evaluate to `true` when `i+j` is odd and `false` when `i+j` is even.
The `&` in that expression is the bitwise AND operator, not the logical AND operator.
The code would be so much more readable if written as:
```
int is_odd(int n)
{
return ((n&1) == 1);
}
...
if ( is_odd(i+j) )
``` | There's a pattern here - the last bit of the value is constantly flipped:
```
i = 0, j = 0 --> i + j = 0 --> 2'b00
i = 0, j = 1 --> i + j = 1 --> 2'b01
i = 0, j = 2 --> i + j = 2 --> 2'b10
...and so on
```
The `&` operator then does a bit-wise `and` operation on the bits of the value:
```
//this evaluates to false,... |
9,433,969 | I have a table that I need to render some vertical text in one of the columns.
My understanding is that the following style should achieve the effect across browsers:
```
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform:... | 2012/02/24 | [
"https://Stackoverflow.com/questions/9433969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1022228/"
] | In order to Rotate in those older browsers, you'll have to use Microsoft's proprietary filters:
```
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=VALUE);
```
Replace Value with an integer, 0-4.
0 = 0 degrees
1 = 90 degrees
2 = 180 degrees
3 = 270 degrees
4 = 360 degrees
I do not believe you can do ... | CSS3 transforms - not supported on IE 7 and 8.
See: <http://caniuse.com/#feat=transforms2d> |
9,433,969 | I have a table that I need to render some vertical text in one of the columns.
My understanding is that the following style should achieve the effect across browsers:
```
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform:... | 2012/02/24 | [
"https://Stackoverflow.com/questions/9433969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1022228/"
] | In order to Rotate in those older browsers, you'll have to use Microsoft's proprietary filters:
```
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=VALUE);
```
Replace Value with an integer, 0-4.
0 = 0 degrees
1 = 90 degrees
2 = 180 degrees
3 = 270 degrees
4 = 360 degrees
I do not believe you can do ... | IE8 and below do not support transforms.
According to [this tutorial](http://www.thecssninja.com/css/real-text-rotation-with-css) you can use writing-mode instead |
9,433,969 | I have a table that I need to render some vertical text in one of the columns.
My understanding is that the following style should achieve the effect across browsers:
```
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform:... | 2012/02/24 | [
"https://Stackoverflow.com/questions/9433969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1022228/"
] | In order to Rotate in those older browsers, you'll have to use Microsoft's proprietary filters:
```
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=VALUE);
```
Replace Value with an integer, 0-4.
0 = 0 degrees
1 = 90 degrees
2 = 180 degrees
3 = 270 degrees
4 = 360 degrees
I do not believe you can do ... | As an extra gotcha, notice in IE9 the rotation can only be applied to block elements (such as paragraph and not span).
Here is a [a fiddle](http://jsfiddle.net/agentfitz/5QLce/) |
208,166 | It was about a person who had no physical body of their own. Every day, they became different people and were able to act as that person for the day. They had no control of who they could be, and couldn't be the same person twice, or for longer than a day. | 2019/03/29 | [
"https://scifi.stackexchange.com/questions/208166",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/113478/"
] | This is [*Every Day*](https://en.wikipedia.org/wiki/Every_Day_(novel)) (2012) by David Levithan.
>
> Every Day is about the story of A, a person who wakes up occupying a different body each day. As described by Frank Bruni of The New York Times, "A. doesn't have a real name, presumably because they don't have a real ... | Your question seems to have prompted DavidW to ask [a similar question](https://scifi.stackexchange.com/q/208172/104486), but with more details. DavidW is obviously thinking of "The Safe-Deposit Box" in Greg Egan's short-story collection "Axiomatic" (1995), but your question is too vague to be sure of this. |
40,883,974 | Is it possible to exclude a **package** from an Android Gradle dependency so it does not end up inside the APK?
As:
```
dependencies {
compile('com.facebook.android:facebook-android-sdk:4.17.0') {
exclude package 'com.facebook.share'
}
}
```
but then different, because "package" is not a valid comm... | 2016/11/30 | [
"https://Stackoverflow.com/questions/40883974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1310343/"
] | You can't exclude some specific parts of the artifact because Gradle doesn't know anything about what is inside it. To Gradle it's monolithic: you either include the artifact with whatever is inside it, or not.
It may be possible to achieve what you want using ProGuard. This is a common step when building a release ve... | in this way , u can exclude few packages from the library,
this is just a example of concept
```
compile ('com.github.ganfra:material-spinner:1.1.1'){
exclude group: 'com.nineoldandroids', module: 'library'
exclude group: 'com.android.support', module: 'appcompat-v7'
}
``` |
40,883,974 | Is it possible to exclude a **package** from an Android Gradle dependency so it does not end up inside the APK?
As:
```
dependencies {
compile('com.facebook.android:facebook-android-sdk:4.17.0') {
exclude package 'com.facebook.share'
}
}
```
but then different, because "package" is not a valid comm... | 2016/11/30 | [
"https://Stackoverflow.com/questions/40883974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1310343/"
] | in this way , u can exclude few packages from the library,
this is just a example of concept
```
compile ('com.github.ganfra:material-spinner:1.1.1'){
exclude group: 'com.nineoldandroids', module: 'library'
exclude group: 'com.android.support', module: 'appcompat-v7'
}
``` | You can use sourceSets inside your build.gradle to filter the packages or classes you don't want to bundle in your apk or aab. For example -
```
android {
sourceSets {
main {
java {
exclude 'com/a/b/helper/**'
exclude 'com/a/ext/util/TestUtils.java'
}
... |
40,883,974 | Is it possible to exclude a **package** from an Android Gradle dependency so it does not end up inside the APK?
As:
```
dependencies {
compile('com.facebook.android:facebook-android-sdk:4.17.0') {
exclude package 'com.facebook.share'
}
}
```
but then different, because "package" is not a valid comm... | 2016/11/30 | [
"https://Stackoverflow.com/questions/40883974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1310343/"
] | in this way , u can exclude few packages from the library,
this is just a example of concept
```
compile ('com.github.ganfra:material-spinner:1.1.1'){
exclude group: 'com.nineoldandroids', module: 'library'
exclude group: 'com.android.support', module: 'appcompat-v7'
}
``` | Updated answer for excluding reference libraries from your dependency groups
```
implementation (group: 'net.sf.jasperreports', name: 'jasperreports', version: '6.1.0'){
//example : org.olap4j:olap4j:0.9.7.309-JS-3
exclude group: 'org.olap4j', module: 'olap4j'
}
``` |
40,883,974 | Is it possible to exclude a **package** from an Android Gradle dependency so it does not end up inside the APK?
As:
```
dependencies {
compile('com.facebook.android:facebook-android-sdk:4.17.0') {
exclude package 'com.facebook.share'
}
}
```
but then different, because "package" is not a valid comm... | 2016/11/30 | [
"https://Stackoverflow.com/questions/40883974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1310343/"
] | You can't exclude some specific parts of the artifact because Gradle doesn't know anything about what is inside it. To Gradle it's monolithic: you either include the artifact with whatever is inside it, or not.
It may be possible to achieve what you want using ProGuard. This is a common step when building a release ve... | You can use sourceSets inside your build.gradle to filter the packages or classes you don't want to bundle in your apk or aab. For example -
```
android {
sourceSets {
main {
java {
exclude 'com/a/b/helper/**'
exclude 'com/a/ext/util/TestUtils.java'
}
... |
40,883,974 | Is it possible to exclude a **package** from an Android Gradle dependency so it does not end up inside the APK?
As:
```
dependencies {
compile('com.facebook.android:facebook-android-sdk:4.17.0') {
exclude package 'com.facebook.share'
}
}
```
but then different, because "package" is not a valid comm... | 2016/11/30 | [
"https://Stackoverflow.com/questions/40883974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1310343/"
] | You can't exclude some specific parts of the artifact because Gradle doesn't know anything about what is inside it. To Gradle it's monolithic: you either include the artifact with whatever is inside it, or not.
It may be possible to achieve what you want using ProGuard. This is a common step when building a release ve... | Updated answer for excluding reference libraries from your dependency groups
```
implementation (group: 'net.sf.jasperreports', name: 'jasperreports', version: '6.1.0'){
//example : org.olap4j:olap4j:0.9.7.309-JS-3
exclude group: 'org.olap4j', module: 'olap4j'
}
``` |
30,598,126 | I am working on a project with Adobe LiveCyle Workbench ES4. I have been tasked with automating our deployment to produciton. This is for the entire project which includes LiveCycle, but I have very little LiveCycle experience.
In our current manual process we copy the XDP (right-click->copy) file from TEST and paste ... | 2015/06/02 | [
"https://Stackoverflow.com/questions/30598126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1617407/"
] | You should not have to redeploy an application for changes to form only to occur. Only changes in processes require a redeploy.
Normally the way we deploy is by exporting the application to an LCA through Workbench, and importing that LCA through the admin console to the desired environment. You can choose to make a ... | I have used Livecycle a lot, and in our environments we did not use workbench to make deployments and passages between environments.
The deploys were made by copying the xdp files to the destination folder. With some script (linux or windows) you can easily automate daily deployments, or whatever you are after.
I am ... |
30,598,126 | I am working on a project with Adobe LiveCyle Workbench ES4. I have been tasked with automating our deployment to produciton. This is for the entire project which includes LiveCycle, but I have very little LiveCycle experience.
In our current manual process we copy the XDP (right-click->copy) file from TEST and paste ... | 2015/06/02 | [
"https://Stackoverflow.com/questions/30598126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1617407/"
] | You should not have to redeploy an application for changes to form only to occur. Only changes in processes require a redeploy.
Normally the way we deploy is by exporting the application to an LCA through Workbench, and importing that LCA through the admin console to the desired environment. You can choose to make a ... | An application does **not** need to be redeployed for XDP changes to takes effect. You only need to check-in the new asset(s) into the application for them to be picked up with the following requests. You are most likely un-deploying/redeploying only because the check-in process is automatically triggered when deployin... |
63,212,797 | I've been creating this bot for 2 months then I stopped for 1 month. When I tried to run my bot again I always get this error (In the real code, I replace 'TOKEN' with real token.):
```
File "main.py", line 10, in <module>
bot.run('TOKEN')
File "venv\lib\site-packages\discord\client.py", line 640, in run
r... | 2020/08/02 | [
"https://Stackoverflow.com/questions/63212797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13515087/"
] | `Pipeline` objects have a [`get_params()`](https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html#sklearn.pipeline.Pipeline.get_params) method which returns the parameters of the pipeline. This includes the parameters of the individual steps as well. Based on your example, the command
```
CV.... | Since your `param_grid` is a list of dictionaries, each such dictionary gives a separate grid, and the search takes place over the disjoint union of those grids. So the `best_estimator_` and `best_params_` in your case correspond to the single-point grid with `combiner=None` and everything else as defined in the origin... |
57,741,885 | Hi there I'm looking for advice from someone who is good at IBM db2 performance.
I have a situation in which many batch tasks are massively inserting rows in the same db2 table, at the same time.
This situation looks potentially bad. I don't think db2 is able to resolve the many requests quickly enough, causing the ... | 2019/08/31 | [
"https://Stackoverflow.com/questions/57741885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2568276/"
] | This error message...
```
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (203, 530). Other element would receive the click: ... (Session info: chrome=76.0.3809.132)
```
...implies that the `click()` on the desired element was interce... | I looked at the exact element that was causing it and it was a banner about consent/cookies. So at first, I made sure it clicked "OK" on the consent banner and then I clicked the other button that I needed. Hope it helps someone. |
57,741,885 | Hi there I'm looking for advice from someone who is good at IBM db2 performance.
I have a situation in which many batch tasks are massively inserting rows in the same db2 table, at the same time.
This situation looks potentially bad. I don't think db2 is able to resolve the many requests quickly enough, causing the ... | 2019/08/31 | [
"https://Stackoverflow.com/questions/57741885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2568276/"
] | If the path of the *xpath* is right, maybe you can try this method to solve this problem. Replace the old code with the following code:
```
button = driver.find_element_by_xpath("xpath")
driver.execute_script("arguments[0].click();", button)
```
I solved this problem before, but to be honestly, I don't know the reas... | i faced similar issues, the .click() always returns a Not clickable exception. the
```
driver.execute_script('arguments[0].click()', button)
```
does the magic. You can also use it to execute any other js script this way
```
script = 'your JavaScript goes here'
element = driver.find_element_by_*('your element ident... |
57,741,885 | Hi there I'm looking for advice from someone who is good at IBM db2 performance.
I have a situation in which many batch tasks are massively inserting rows in the same db2 table, at the same time.
This situation looks potentially bad. I don't think db2 is able to resolve the many requests quickly enough, causing the ... | 2019/08/31 | [
"https://Stackoverflow.com/questions/57741885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2568276/"
] | This error message...
```
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (203, 530). Other element would receive the click: ... (Session info: chrome=76.0.3809.132)
```
...implies that the `click()` on the desired element was interce... | >
> "selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable ... "
>
>
>
This exception occurs when element is not found on a web page (When the element we are looking for is at bottom part of the page which is not loaded yet)
So we you can scroll ... |
57,741,885 | Hi there I'm looking for advice from someone who is good at IBM db2 performance.
I have a situation in which many batch tasks are massively inserting rows in the same db2 table, at the same time.
This situation looks potentially bad. I don't think db2 is able to resolve the many requests quickly enough, causing the ... | 2019/08/31 | [
"https://Stackoverflow.com/questions/57741885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2568276/"
] | If the path of the *xpath* is right, maybe you can try this method to solve this problem. Replace the old code with the following code:
```
button = driver.find_element_by_xpath("xpath")
driver.execute_script("arguments[0].click();", button)
```
I solved this problem before, but to be honestly, I don't know the reas... | I faced a similar issue and I observed something that might help to understand the root cause of the issue. In my case, I was able to click at an element being in PC view mode of the website but failed to do so in mobile view (in which I needed my script to run). I found out that in mobile view, ordering of elements (l... |
57,741,885 | Hi there I'm looking for advice from someone who is good at IBM db2 performance.
I have a situation in which many batch tasks are massively inserting rows in the same db2 table, at the same time.
This situation looks potentially bad. I don't think db2 is able to resolve the many requests quickly enough, causing the ... | 2019/08/31 | [
"https://Stackoverflow.com/questions/57741885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2568276/"
] | i faced similar issues, the .click() always returns a Not clickable exception. the
```
driver.execute_script('arguments[0].click()', button)
```
does the magic. You can also use it to execute any other js script this way
```
script = 'your JavaScript goes here'
element = driver.find_element_by_*('your element ident... | I looked at the exact element that was causing it and it was a banner about consent/cookies. So at first, I made sure it clicked "OK" on the consent banner and then I clicked the other button that I needed. Hope it helps someone. |
57,741,885 | Hi there I'm looking for advice from someone who is good at IBM db2 performance.
I have a situation in which many batch tasks are massively inserting rows in the same db2 table, at the same time.
This situation looks potentially bad. I don't think db2 is able to resolve the many requests quickly enough, causing the ... | 2019/08/31 | [
"https://Stackoverflow.com/questions/57741885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2568276/"
] | This error message...
```
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (203, 530). Other element would receive the click: ... (Session info: chrome=76.0.3809.132)
```
...implies that the `click()` on the desired element was interce... | This solution worked for me :
```
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Firefox(executable_path="")
driver.get("https://UrlToOpen")
action = ActionChains(driver)
firstLevelMenu = driver.find_element_by_id("menu")
firstLevelMenu.click()
... |
57,741,885 | Hi there I'm looking for advice from someone who is good at IBM db2 performance.
I have a situation in which many batch tasks are massively inserting rows in the same db2 table, at the same time.
This situation looks potentially bad. I don't think db2 is able to resolve the many requests quickly enough, causing the ... | 2019/08/31 | [
"https://Stackoverflow.com/questions/57741885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2568276/"
] | i faced similar issues, the .click() always returns a Not clickable exception. the
```
driver.execute_script('arguments[0].click()', button)
```
does the magic. You can also use it to execute any other js script this way
```
script = 'your JavaScript goes here'
element = driver.find_element_by_*('your element ident... | You could try:
```
driver.execute_script("arguments[0].click();", button)
```
This solution solved my problems when I faced similar issues. |
57,741,885 | Hi there I'm looking for advice from someone who is good at IBM db2 performance.
I have a situation in which many batch tasks are massively inserting rows in the same db2 table, at the same time.
This situation looks potentially bad. I don't think db2 is able to resolve the many requests quickly enough, causing the ... | 2019/08/31 | [
"https://Stackoverflow.com/questions/57741885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2568276/"
] | This error message...
```
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (203, 530). Other element would receive the click: ... (Session info: chrome=76.0.3809.132)
```
...implies that the `click()` on the desired element was interce... | It look's like there are some other elements which are having the same xpath try changing the xpath something like this
```
Next = driver.find_element_by_xpath("//input[@id='PersonalDetailsButton']");
Next.Click();
```
or
```
Next = driver.find_element_by_xpath(//input[@value='Next' and @id='PersonalDetailsButton... |
57,741,885 | Hi there I'm looking for advice from someone who is good at IBM db2 performance.
I have a situation in which many batch tasks are massively inserting rows in the same db2 table, at the same time.
This situation looks potentially bad. I don't think db2 is able to resolve the many requests quickly enough, causing the ... | 2019/08/31 | [
"https://Stackoverflow.com/questions/57741885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2568276/"
] | This error message...
```
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (203, 530). Other element would receive the click: ... (Session info: chrome=76.0.3809.132)
```
...implies that the `click()` on the desired element was interce... | I faced a similar issue and I observed something that might help to understand the root cause of the issue. In my case, I was able to click at an element being in PC view mode of the website but failed to do so in mobile view (in which I needed my script to run). I found out that in mobile view, ordering of elements (l... |
57,741,885 | Hi there I'm looking for advice from someone who is good at IBM db2 performance.
I have a situation in which many batch tasks are massively inserting rows in the same db2 table, at the same time.
This situation looks potentially bad. I don't think db2 is able to resolve the many requests quickly enough, causing the ... | 2019/08/31 | [
"https://Stackoverflow.com/questions/57741885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2568276/"
] | i faced similar issues, the .click() always returns a Not clickable exception. the
```
driver.execute_script('arguments[0].click()', button)
```
does the magic. You can also use it to execute any other js script this way
```
script = 'your JavaScript goes here'
element = driver.find_element_by_*('your element ident... | This solution worked for me :
```
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Firefox(executable_path="")
driver.get("https://UrlToOpen")
action = ActionChains(driver)
firstLevelMenu = driver.find_element_by_id("menu")
firstLevelMenu.click()
... |
18,982,585 | I am new to LINQ. I am confusing to query it. Please any one tell me how to convert the below query in LINQ
```
select * from tbldev
where iddevice not in(select a.iddevice from
tblUDMap a join tbldev d
on a.iddevice=d.iddevice )
``` | 2013/09/24 | [
"https://Stackoverflow.com/questions/18982585",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2695893/"
] | A literal and naive word to word translation would be something like this:
```
var result = from dev in context.tbldev
where (from udmap in context.tblUDMap join dev2 in context.tbldev on udmap.iddevice equals dev2.iddevice select udmap.iddevice)
.Contains(dev.iddevice) == f... | try this:
```
from res in tbldev
where !(from a in tblUDMap
join b in tbldev on a.Iddevice equals b.iddvice
into c
select c)
select res
```
The important part is the negated `where`-clause. the join syntax in this might not be correct, from the top of my head. |
18,982,585 | I am new to LINQ. I am confusing to query it. Please any one tell me how to convert the below query in LINQ
```
select * from tbldev
where iddevice not in(select a.iddevice from
tblUDMap a join tbldev d
on a.iddevice=d.iddevice )
``` | 2013/09/24 | [
"https://Stackoverflow.com/questions/18982585",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2695893/"
] | There's no need for nested queries here:
```
from x in tbldev
join y in tblUDMap
on x.iddevice equals y.iddevice
into grp
where !grp.Any()
select x
```
This will select all records from `tbldev` for which there are no corresponding records in `tblUDMap`. | try this:
```
from res in tbldev
where !(from a in tblUDMap
join b in tbldev on a.Iddevice equals b.iddvice
into c
select c)
select res
```
The important part is the negated `where`-clause. the join syntax in this might not be correct, from the top of my head. |
18,982,585 | I am new to LINQ. I am confusing to query it. Please any one tell me how to convert the below query in LINQ
```
select * from tbldev
where iddevice not in(select a.iddevice from
tblUDMap a join tbldev d
on a.iddevice=d.iddevice )
``` | 2013/09/24 | [
"https://Stackoverflow.com/questions/18982585",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2695893/"
] | You could simplify your query to something like this
```
var query = tbldev.Where(e => !tblUDMap.Any(a => a.iddevice == e.iddevice))
``` | try this:
```
from res in tbldev
where !(from a in tblUDMap
join b in tbldev on a.Iddevice equals b.iddvice
into c
select c)
select res
```
The important part is the negated `where`-clause. the join syntax in this might not be correct, from the top of my head. |
22,618 | I am trying to sort a wrapper class list. But I am getting an error of "One or more of the items in this list is not Comparable". My sorting function is right and there is no issue but not understanding how this error coming. Any help is appreciated.
```
public Integer compareTo(Object compareTo)
{
... | 2013/12/19 | [
"https://salesforce.stackexchange.com/questions/22618",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/4422/"
] | This error occurs because one or more of them items in your list is not comparable (a key requirement for the sort feature). It is likely an instance of an Apex Class of your own or someone else's creation does not implement the [Comparable interface](http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_co... | I know its not the answer to this issue, but I ran into the same error and found out that "Comparable" need to be on the class implementation and not only on the Interface.
You can't do this:
```
public interface IEmployee extends Comparable {}
public class Employee implements IEmployee {
public Integer compareTo(... |
22,618 | I am trying to sort a wrapper class list. But I am getting an error of "One or more of the items in this list is not Comparable". My sorting function is right and there is no issue but not understanding how this error coming. Any help is appreciated.
```
public Integer compareTo(Object compareTo)
{
... | 2013/12/19 | [
"https://salesforce.stackexchange.com/questions/22618",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/4422/"
] | This error occurs because one or more of them items in your list is not comparable (a key requirement for the sort feature). It is likely an instance of an Apex Class of your own or someone else's creation does not implement the [Comparable interface](http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_co... | I have this error
```
One or more of the items in this list is not Comparable.
```
when I had actually all the items in the list implementing Comparable interface. However, in some cases the compare function wasn't returning 1, -1 or 0.
So we need implement the Comparable interface method in such a way that it alwa... |
22,618 | I am trying to sort a wrapper class list. But I am getting an error of "One or more of the items in this list is not Comparable". My sorting function is right and there is no issue but not understanding how this error coming. Any help is appreciated.
```
public Integer compareTo(Object compareTo)
{
... | 2013/12/19 | [
"https://salesforce.stackexchange.com/questions/22618",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/4422/"
] | I know its not the answer to this issue, but I ran into the same error and found out that "Comparable" need to be on the class implementation and not only on the Interface.
You can't do this:
```
public interface IEmployee extends Comparable {}
public class Employee implements IEmployee {
public Integer compareTo(... | I have this error
```
One or more of the items in this list is not Comparable.
```
when I had actually all the items in the list implementing Comparable interface. However, in some cases the compare function wasn't returning 1, -1 or 0.
So we need implement the Comparable interface method in such a way that it alwa... |
13,332,778 | I am looking to generate programmaticaly a list of concrete nouns, an associated picture and if possible a sentence describing the proper noun.
I have tried various dictionary APIs - but the first part of the problem - getting a list of concrete nouns has caused me difficulty. Can anybody think of a good way of achiev... | 2012/11/11 | [
"https://Stackoverflow.com/questions/13332778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/265683/"
] | [NLTK](http://answers.oreilly.com/topic/1091-how-to-use-an-nltk-part-of-speech-tagger/) has a part of speech tagger. You could run it on a piece of text and store all the nouns it identifies as your list.
If you want a list of all nouns, you might be in for a long hunt - you'd have to run through every dictionary, enc... | **If you want to do in Java**
You can use HashMap to store the data; where key can be proper noun and value an object which has other details
```
HashMap<String, ProperNounObj> obj = new HashMap<String, ProperNounObj>();
where ProperNounObj class has attributes like picutureUrl and description
```
List of p... |
88,784 | I know, that the command line tool for magento 2 is very useful, but when in development,we need to perform some common tasks like clear the cache, deploy static content, upgrade db, enable extension to name a few, but for that we need to run command manually, is there any possibility to create a GUI tool for the same? | 2015/11/04 | [
"https://magento.stackexchange.com/questions/88784",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16246/"
] | Yes, you can do it using Batch program to delete it. Its to much faster than manually deletion of files.
Create a `batch` file in your magento root dir [you can place it another location too].
You can create batch file using `.bat` extension.
Right click on batch file and select `edit` [Open it into notepad] and
Ty... | `bin/magento cache:flush` looks like what you need. See more in [official documentation](http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli.html) |
88,784 | I know, that the command line tool for magento 2 is very useful, but when in development,we need to perform some common tasks like clear the cache, deploy static content, upgrade db, enable extension to name a few, but for that we need to run command manually, is there any possibility to create a GUI tool for the same? | 2015/11/04 | [
"https://magento.stackexchange.com/questions/88784",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16246/"
] | Yes, you can do it using Batch program to delete it. Its to much faster than manually deletion of files.
Create a `batch` file in your magento root dir [you can place it another location too].
You can create batch file using `.bat` extension.
Right click on batch file and select `edit` [Open it into notepad] and
Ty... | If you want to use magento 2 cli in windows you can execute:
```
php bin\magento
```
So, you need:
```
php bin\magento cache:flush
``` |
88,784 | I know, that the command line tool for magento 2 is very useful, but when in development,we need to perform some common tasks like clear the cache, deploy static content, upgrade db, enable extension to name a few, but for that we need to run command manually, is there any possibility to create a GUI tool for the same? | 2015/11/04 | [
"https://magento.stackexchange.com/questions/88784",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16246/"
] | If you want to use magento 2 cli in windows you can execute:
```
php bin\magento
```
So, you need:
```
php bin\magento cache:flush
``` | `bin/magento cache:flush` looks like what you need. See more in [official documentation](http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli.html) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.