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 |
|---|---|---|---|---|---|
14,844,549 | I want to ask a question why this is not working?
<http://jsfiddle.net/2FMue/4/>
```
var a = $('input').attr('value').split(',');
if(a instanceof Array) alert(1);
if($.inArray($('#id').text(), a)) alert(2);
if($.inArray('United State', a)) alert(3);
// a is array but no return correct match.
```
I split a value... | 2013/02/13 | [
"https://Stackoverflow.com/questions/14844549",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1920368/"
] | ### It works perfectly well.
`$.inArray` returns index of the element found in the given array (or `-1` if not found).
As an example,
```
$.inArray("United State", ["United State", "America"]) === 0
$.inArray("Unknown", ["United State", "America"]) === -1
```
So, in order to check if the element exists in th... | >
> The $.inArray() method is similar to JavaScript's native .indexOf() method in that it returns -1 when it doesn't find a match. If the first element within the array matches value, $.inArray() returns 0.
>
>
> Because JavaScript treats 0 as loosely equal to false (i.e. 0 == false, but 0 !== false), if we're check... |
14,844,549 | I want to ask a question why this is not working?
<http://jsfiddle.net/2FMue/4/>
```
var a = $('input').attr('value').split(',');
if(a instanceof Array) alert(1);
if($.inArray($('#id').text(), a)) alert(2);
if($.inArray('United State', a)) alert(3);
// a is array but no return correct match.
```
I split a value... | 2013/02/13 | [
"https://Stackoverflow.com/questions/14844549",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1920368/"
] | ### It works perfectly well.
`$.inArray` returns index of the element found in the given array (or `-1` if not found).
As an example,
```
$.inArray("United State", ["United State", "America"]) === 0
$.inArray("Unknown", ["United State", "America"]) === -1
```
So, in order to check if the element exists in th... | From the DOCS :
>
> Because JavaScript treats 0 as loosely equal to false (i.e. 0 ==
> false, but 0 !== false), if we're checking for the presence of value
> within array, we need to check if it's not equal to (or greater than)
> -1.
>
>
>
so :
```
if( $.inArray($('#id').text(), a) != -1) alert(2);
``` |
14,844,549 | I want to ask a question why this is not working?
<http://jsfiddle.net/2FMue/4/>
```
var a = $('input').attr('value').split(',');
if(a instanceof Array) alert(1);
if($.inArray($('#id').text(), a)) alert(2);
if($.inArray('United State', a)) alert(3);
// a is array but no return correct match.
```
I split a value... | 2013/02/13 | [
"https://Stackoverflow.com/questions/14844549",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1920368/"
] | ### It works perfectly well.
`$.inArray` returns index of the element found in the given array (or `-1` if not found).
As an example,
```
$.inArray("United State", ["United State", "America"]) === 0
$.inArray("Unknown", ["United State", "America"]) === -1
```
So, in order to check if the element exists in th... | Is the search term the first element in your array by any chance? This would return 0, which javascript treats as false. Your if statement should be:
```
if($.inArray($('#id').text(), a) < 0) alert(2);
```
Read the documentation <http://api.jquery.com/jQuery.inArray/> |
14,844,549 | I want to ask a question why this is not working?
<http://jsfiddle.net/2FMue/4/>
```
var a = $('input').attr('value').split(',');
if(a instanceof Array) alert(1);
if($.inArray($('#id').text(), a)) alert(2);
if($.inArray('United State', a)) alert(3);
// a is array but no return correct match.
```
I split a value... | 2013/02/13 | [
"https://Stackoverflow.com/questions/14844549",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1920368/"
] | ### It works perfectly well.
`$.inArray` returns index of the element found in the given array (or `-1` if not found).
As an example,
```
$.inArray("United State", ["United State", "America"]) === 0
$.inArray("Unknown", ["United State", "America"]) === -1
```
So, in order to check if the element exists in th... | Arrays from a split are 0 based indexed, and the string you are asking for is the first one, so it returns a 0 value - which is falsy, so your alerts inside the conditional do not fire because you are getting the 0 index from the inArray.
change your input value to "fred,United State, America" and you will see it aler... |
14,844,549 | I want to ask a question why this is not working?
<http://jsfiddle.net/2FMue/4/>
```
var a = $('input').attr('value').split(',');
if(a instanceof Array) alert(1);
if($.inArray($('#id').text(), a)) alert(2);
if($.inArray('United State', a)) alert(3);
// a is array but no return correct match.
```
I split a value... | 2013/02/13 | [
"https://Stackoverflow.com/questions/14844549",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1920368/"
] | >
> The $.inArray() method is similar to JavaScript's native .indexOf() method in that it returns -1 when it doesn't find a match. If the first element within the array matches value, $.inArray() returns 0.
>
>
> Because JavaScript treats 0 as loosely equal to false (i.e. 0 == false, but 0 !== false), if we're check... | Arrays from a split are 0 based indexed, and the string you are asking for is the first one, so it returns a 0 value - which is falsy, so your alerts inside the conditional do not fire because you are getting the 0 index from the inArray.
change your input value to "fred,United State, America" and you will see it aler... |
14,844,549 | I want to ask a question why this is not working?
<http://jsfiddle.net/2FMue/4/>
```
var a = $('input').attr('value').split(',');
if(a instanceof Array) alert(1);
if($.inArray($('#id').text(), a)) alert(2);
if($.inArray('United State', a)) alert(3);
// a is array but no return correct match.
```
I split a value... | 2013/02/13 | [
"https://Stackoverflow.com/questions/14844549",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1920368/"
] | From the DOCS :
>
> Because JavaScript treats 0 as loosely equal to false (i.e. 0 ==
> false, but 0 !== false), if we're checking for the presence of value
> within array, we need to check if it's not equal to (or greater than)
> -1.
>
>
>
so :
```
if( $.inArray($('#id').text(), a) != -1) alert(2);
``` | Arrays from a split are 0 based indexed, and the string you are asking for is the first one, so it returns a 0 value - which is falsy, so your alerts inside the conditional do not fire because you are getting the 0 index from the inArray.
change your input value to "fred,United State, America" and you will see it aler... |
14,844,549 | I want to ask a question why this is not working?
<http://jsfiddle.net/2FMue/4/>
```
var a = $('input').attr('value').split(',');
if(a instanceof Array) alert(1);
if($.inArray($('#id').text(), a)) alert(2);
if($.inArray('United State', a)) alert(3);
// a is array but no return correct match.
```
I split a value... | 2013/02/13 | [
"https://Stackoverflow.com/questions/14844549",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1920368/"
] | Is the search term the first element in your array by any chance? This would return 0, which javascript treats as false. Your if statement should be:
```
if($.inArray($('#id').text(), a) < 0) alert(2);
```
Read the documentation <http://api.jquery.com/jQuery.inArray/> | Arrays from a split are 0 based indexed, and the string you are asking for is the first one, so it returns a 0 value - which is falsy, so your alerts inside the conditional do not fire because you are getting the 0 index from the inArray.
change your input value to "fred,United State, America" and you will see it aler... |
17,682,034 | I changed my windows. But I can not attach `mdf,ldf` files and cannot move or copy them.
My error is:
>
> Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)
>
> An exception occurred while executing a Transact-SQL statement or batch.
>
> CREATE FILE encountered operating syste... | 2013/07/16 | [
"https://Stackoverflow.com/questions/17682034",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1181998/"
] | I shared the mdf,ldf files and problem solved. | As another solution I came across this today and was able to resolve it by simply running SQL Server Management Studio as administrator. I am using SQL Server 2008 R2. |
9,643,370 | I am using generic code (from the iOS Fireworks demo) in a slightly changed way. I have the following in a subclass of UIView. What I want is to make the firework appear at the point the user touches (not hard) and play out for the length of the CAEmitterLayer/CAEmitterCells 'lifetime'. Instead, this is immediately sta... | 2012/03/10 | [
"https://Stackoverflow.com/questions/9643370",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/263028/"
] | The answer to this is, using CAEmitter, there is NO WAY -- delegate, etc -- to stop the emitter when it ends the cycle. The only thing you can do is gracefully remove it from the layer when you think it should be removed. | Ok, so I was able to sort of achieve this by creating an animation with delegate that fired along with the emitter. in the animationDidStop i made a for loop that went through my view hierarchy and looked for emitters and removed them. it's buggy and I still want a real solution, but this works for now.
```
for (CALay... |
3,019,427 | I know there are plenty of questions here already about this topic (I've read through as many as I could find), but I haven't yet been able to figure out how best to satisfy my particular criteria. Here are the goals:
1. The ASP.NET application will run on a few different web servers, including localhost workstations ... | 2010/06/11 | [
"https://Stackoverflow.com/questions/3019427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110871/"
] | Integrated authentication/windows authentication is a good option. No passwords, at least none that need be stored in the web.config. In fact, it's the option I prefer unless admins have explicity taken it away from me.
Personally, for anything that varies by machine (which isn't just connection string) I put in a ext... | 1. you can have multiple web servers with the same encrypted key. you would do this in machine config just ensure each key is the same.
..
one common practice, is to store first connection string encrypted somewhere on the machine such as registry. after the server connects using that string, it will than retrieve a... |
3,019,427 | I know there are plenty of questions here already about this topic (I've read through as many as I could find), but I haven't yet been able to figure out how best to satisfy my particular criteria. Here are the goals:
1. The ASP.NET application will run on a few different web servers, including localhost workstations ... | 2010/06/11 | [
"https://Stackoverflow.com/questions/3019427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/110871/"
] | Integrated authentication/windows authentication is a good option. No passwords, at least none that need be stored in the web.config. In fact, it's the option I prefer unless admins have explicity taken it away from me.
Personally, for anything that varies by machine (which isn't just connection string) I put in a ext... | (First, Wow, I think 2 or 3 "quick paragraphs" turned out a little longer than I'd thought! Here I go...)
I've come to the conclusion (perhaps you'll disagree with me on this) that the ability to "protect" the web.config whilst on the server (or by using aspnet\_iisreg) has only limited benefit, and is perhaps maybe n... |
8,855,880 | From [Wikipedia](https://commons.wikimedia.org/wiki/File:Git_data_flow_simplified.svg):

Where is said "Local repository" located **physically** (in the file system)? | 2012/01/13 | [
"https://Stackoverflow.com/questions/8855880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/586707/"
] | The Working Directory is wherever your files are on your local machine. The Local Repository is the `.git/` subdirectory inside the Working Directory. The Index is a conceptual place that also physically resides in the `.git/` subdirectory. | .git is a place where local repository is stored (not the working directory!)
Working directory usually is a directory where the .git directory is placed |
8,855,880 | From [Wikipedia](https://commons.wikimedia.org/wiki/File:Git_data_flow_simplified.svg):

Where is said "Local repository" located **physically** (in the file system)? | 2012/01/13 | [
"https://Stackoverflow.com/questions/8855880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/586707/"
] | The Working Directory is wherever your files are on your local machine. The Local Repository is the `.git/` subdirectory inside the Working Directory. The Index is a conceptual place that also physically resides in the `.git/` subdirectory. | Working directory is your code directory
Local repository is .git folder in Working directory
Remote repository is bare repository on server or in the filesystem |
8,855,880 | From [Wikipedia](https://commons.wikimedia.org/wiki/File:Git_data_flow_simplified.svg):

Where is said "Local repository" located **physically** (in the file system)? | 2012/01/13 | [
"https://Stackoverflow.com/questions/8855880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/586707/"
] | The Working Directory is wherever your files are on your local machine. The Local Repository is the `.git/` subdirectory inside the Working Directory. The Index is a conceptual place that also physically resides in the `.git/` subdirectory. | Working Directory is where your code resides on local machine.
Git Local repo is .git/ which is generally inside the Working Directory.
It contains HEAD and various useful info.
You can have a look of what it contains:
```
cd .git
ls -a
``` |
8,855,880 | From [Wikipedia](https://commons.wikimedia.org/wiki/File:Git_data_flow_simplified.svg):

Where is said "Local repository" located **physically** (in the file system)? | 2012/01/13 | [
"https://Stackoverflow.com/questions/8855880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/586707/"
] | The Working Directory is wherever your files are on your local machine. The Local Repository is the `.git/` subdirectory inside the Working Directory. The Index is a conceptual place that also physically resides in the `.git/` subdirectory. | Uttams-MBP:project uttamgc$ ls -al
drwxr-xr-x 9 uttamgc staff 288 Sep 28 14:19 .git
In the example above, project is the folder or directory [mkdir] once this folder is created I move into project directory [cd project] then I git init from the folder and create .git subdirectory. [the third row with .git is the loca... |
8,855,880 | From [Wikipedia](https://commons.wikimedia.org/wiki/File:Git_data_flow_simplified.svg):

Where is said "Local repository" located **physically** (in the file system)? | 2012/01/13 | [
"https://Stackoverflow.com/questions/8855880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/586707/"
] | Working directory is your code directory
Local repository is .git folder in Working directory
Remote repository is bare repository on server or in the filesystem | .git is a place where local repository is stored (not the working directory!)
Working directory usually is a directory where the .git directory is placed |
8,855,880 | From [Wikipedia](https://commons.wikimedia.org/wiki/File:Git_data_flow_simplified.svg):

Where is said "Local repository" located **physically** (in the file system)? | 2012/01/13 | [
"https://Stackoverflow.com/questions/8855880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/586707/"
] | .git is a place where local repository is stored (not the working directory!)
Working directory usually is a directory where the .git directory is placed | Working Directory is where your code resides on local machine.
Git Local repo is .git/ which is generally inside the Working Directory.
It contains HEAD and various useful info.
You can have a look of what it contains:
```
cd .git
ls -a
``` |
8,855,880 | From [Wikipedia](https://commons.wikimedia.org/wiki/File:Git_data_flow_simplified.svg):

Where is said "Local repository" located **physically** (in the file system)? | 2012/01/13 | [
"https://Stackoverflow.com/questions/8855880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/586707/"
] | .git is a place where local repository is stored (not the working directory!)
Working directory usually is a directory where the .git directory is placed | Uttams-MBP:project uttamgc$ ls -al
drwxr-xr-x 9 uttamgc staff 288 Sep 28 14:19 .git
In the example above, project is the folder or directory [mkdir] once this folder is created I move into project directory [cd project] then I git init from the folder and create .git subdirectory. [the third row with .git is the loca... |
8,855,880 | From [Wikipedia](https://commons.wikimedia.org/wiki/File:Git_data_flow_simplified.svg):

Where is said "Local repository" located **physically** (in the file system)? | 2012/01/13 | [
"https://Stackoverflow.com/questions/8855880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/586707/"
] | Working directory is your code directory
Local repository is .git folder in Working directory
Remote repository is bare repository on server or in the filesystem | Working Directory is where your code resides on local machine.
Git Local repo is .git/ which is generally inside the Working Directory.
It contains HEAD and various useful info.
You can have a look of what it contains:
```
cd .git
ls -a
``` |
8,855,880 | From [Wikipedia](https://commons.wikimedia.org/wiki/File:Git_data_flow_simplified.svg):

Where is said "Local repository" located **physically** (in the file system)? | 2012/01/13 | [
"https://Stackoverflow.com/questions/8855880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/586707/"
] | Working directory is your code directory
Local repository is .git folder in Working directory
Remote repository is bare repository on server or in the filesystem | Uttams-MBP:project uttamgc$ ls -al
drwxr-xr-x 9 uttamgc staff 288 Sep 28 14:19 .git
In the example above, project is the folder or directory [mkdir] once this folder is created I move into project directory [cd project] then I git init from the folder and create .git subdirectory. [the third row with .git is the loca... |
8,855,880 | From [Wikipedia](https://commons.wikimedia.org/wiki/File:Git_data_flow_simplified.svg):

Where is said "Local repository" located **physically** (in the file system)? | 2012/01/13 | [
"https://Stackoverflow.com/questions/8855880",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/586707/"
] | Working Directory is where your code resides on local machine.
Git Local repo is .git/ which is generally inside the Working Directory.
It contains HEAD and various useful info.
You can have a look of what it contains:
```
cd .git
ls -a
``` | Uttams-MBP:project uttamgc$ ls -al
drwxr-xr-x 9 uttamgc staff 288 Sep 28 14:19 .git
In the example above, project is the folder or directory [mkdir] once this folder is created I move into project directory [cd project] then I git init from the folder and create .git subdirectory. [the third row with .git is the loca... |
4,379,574 | ```
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Thread" inManagedObjectContext:managedObjectContext];
```
That line doesn't seem to work anymore (I'm pretty sure its that line).
I can't seem to work out whats the problem. The application worked perfectly on Xcode with iOS 4.1 and now crashes w... | 2010/12/07 | [
"https://Stackoverflow.com/questions/4379574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/414972/"
] | After having a quick look at your code I think I found a couple of parts that needed attention. I'll try and break them down below:
**SMSAppAppDelegate**
1) Notice that in your interface file, you declare your CoreData variables with an underscore at the end of the variable name. Then you create properties for each o... | I'm assuming you're doing something like:
```
[ClassName persistentStoreCoordinator]
```
Make sure `ClassName` is defined and has the `persistentStoreCoordinator` class method. Perhaps the file that did these things got deleted?
Matt |
4,379,574 | ```
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Thread" inManagedObjectContext:managedObjectContext];
```
That line doesn't seem to work anymore (I'm pretty sure its that line).
I can't seem to work out whats the problem. The application worked perfectly on Xcode with iOS 4.1 and now crashes w... | 2010/12/07 | [
"https://Stackoverflow.com/questions/4379574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/414972/"
] | After having a quick look at your code I think I found a couple of parts that needed attention. I'll try and break them down below:
**SMSAppAppDelegate**
1) Notice that in your interface file, you declare your CoreData variables with an underscore at the end of the variable name. Then you create properties for each o... | Your database might be corrupted, try resetting the iOS simulator
by clicking on iOS Simulator>Reset contents and settings.
**Edit**:
It looks like you're trying to call a selector that doesn't exist. Try figuring out which files were deleted, as it seems like you have a method that is called that can't be found at r... |
4,056,239 | Good night,
I have a method in which I need to select from an SQLite database a value obtained by querying the database with two strings. The strings are passed to the method and inside the method I make some string concatenation to build `SQLiteCommand.CommandText`. What surprises me is that even with string concaten... | 2010/10/29 | [
"https://Stackoverflow.com/questions/4056239",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/477505/"
] | The redirection operator (>) is a feature of the Windows command processor. You aren't actually invoking the command processor with Process.Start (unless you start "cmd.exe"). To use stdio redirection, you must read it from the StandardOutput stream. Here's an example that shows how to do it:
<http://msdn.microsoft.co... | You can't do redirection like that. Cmd.exe handles seeing the "> file.txt" and sets up the redirection before executing the process.
Remove the "> file.txt" from strArg. After starting the process you need to read the StandardOutput stream and write the data to the file. There is a simple example here: <http://msdn.m... |
2,438,750 | While I was trying to do at least some progress having to do with [this](https://math.stackexchange.com/questions/2433244/sum-of-digits-of-31000?newsletter=1&nlcode=812219%7cf4fc) awesome question I calculated digit sum in base $10$ of $3^a$ for $a=1,2,...,25$ and the pattern goes like this:
$3,9,9,9,9,18,18,18,27,27,... | 2017/09/21 | [
"https://math.stackexchange.com/questions/2438750",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | A proof of this conjecture is probably out of reach, but the fact that the digit sum of $3^{10^4}$ is $21\ 663$ and the digit sum of $3^{10^4+1}$ is $21\ 267$, so smaller, clearly indicates it. I will search even larger counterexamples for monotony.
UPDATE :
digit sum of $3^{10^7}$ is $\color \red {\ \ \ \ \ 21\ 469... | **Hint:**
The sum-of-digits function is itself non-monotonic (<https://oeis.org/A007953>). In the range $[10^k,10^{k+1})$ it varies from $1$ to $9k$, while there are on average $2.0959\cdots$ powers of $3$ that fall in that range, at somewhat "random" positions.
[ {
std::istringstream buffer(input);
std::vector<std::string> ret((std::istream_iterator<std::string>(buffer)),
... |
1,620,933 | Let $(X,d)$ be a metric space and let $F:A(\subset X)\to X$. We say $F$ is a *contraction* if there exists $\lambda$ where $0\leq\lambda<1$ such that
$$d(F(x),F(y))\leq\lambda d(x,y)$$
for all $x,y\in X$.
My question is:
I understand that the function $f(x)=x^2$ is a contraction on each interval on $[0,a], 0<a<0.5$... | 2016/01/21 | [
"https://math.stackexchange.com/questions/1620933",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/71346/"
] | Suppose by contradiction that $x^2$ is a contraction of $[0, 0.5]$ with some constant $0<c<1$ satisfying for all $x \neq y \in [0,0.5]$
$$|x^2-y^2|< c|x-y|$$
As a simple consequence of the MVT, $c > 0.5$.
But now,
$$c|x-y|>|x^2-y^2|=|x+y| \cdot |x-y|$$
which implies $c > |x+y|=x+y$. Now, take simply $x=0.5$ and $y= c ... | Let me add a point that might help for the understanding. In the other answers, we already have seen that
$$|x^2 - y^2| \le C \, |x - y| \quad\forall x,y\in [0,0.5]$$
implies $C \ge 1$.
Now, the OP correctly observed
"As we can see any distance on any interval on the horizontal axis is less than those on the vertical ... |
1,620,933 | Let $(X,d)$ be a metric space and let $F:A(\subset X)\to X$. We say $F$ is a *contraction* if there exists $\lambda$ where $0\leq\lambda<1$ such that
$$d(F(x),F(y))\leq\lambda d(x,y)$$
for all $x,y\in X$.
My question is:
I understand that the function $f(x)=x^2$ is a contraction on each interval on $[0,a], 0<a<0.5$... | 2016/01/21 | [
"https://math.stackexchange.com/questions/1620933",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/71346/"
] | A quick argument using derivatives: note that $f'(0.5) = 1$. So, for any $c < 1$, we have
$$
\lim\_{a \to 0.5^-} \frac{f(0.5) - f(a)}{0.5 - a}> c
$$
So, for any such $c$, there exists an $a \in (0,0.5)$ such that
$$
\frac{f(0.5) - f(a)}{0.5 - a} > c \implies\\
|f(0.5) - f(a)| > c|0.5 - a|
$$
The conclusion follows. | Let me add a point that might help for the understanding. In the other answers, we already have seen that
$$|x^2 - y^2| \le C \, |x - y| \quad\forall x,y\in [0,0.5]$$
implies $C \ge 1$.
Now, the OP correctly observed
"As we can see any distance on any interval on the horizontal axis is less than those on the vertical ... |
999,748 | I have a pickerView in a scollView, which would rotate if i sweep across it in sdk 2.2.1 according to <http://discussions.apple.com/thread.jspa?messageID=8284448>
but when i changed the target to sdk 3.0, it is only responding to tapping and rotate 1 row at a time. but for many values that way is tiresome.
can anyone... | 2009/06/16 | [
"https://Stackoverflow.com/questions/999748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Is SVN really such a bad option?
PROS:
* Can handle large repositories e.g. many linux distro's use it, also Apache, Sourceforge
* Has nice GUI front end with TortoiseSVN to keep your windows users happy
* Can be used with windows integrated authentication to keep admins happy
* Many different backup strategies can ... | Microsoft just released *Git Virtual File System* (GVFS) specifically to handle large code base with git. [More details here at msdn](https://blogs.msdn.microsoft.com/visualstudioalm/2017/02/03/announcing-gvfs-git-virtual-file-system/)
Also [Microsoft hosts the Windows source in a monstrous 300GB Git repository](http... |
999,748 | I have a pickerView in a scollView, which would rotate if i sweep across it in sdk 2.2.1 according to <http://discussions.apple.com/thread.jspa?messageID=8284448>
but when i changed the target to sdk 3.0, it is only responding to tapping and rotate 1 row at a time. but for many values that way is tiresome.
can anyone... | 2009/06/16 | [
"https://Stackoverflow.com/questions/999748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | First, I don't agree that Git is inappropriate for non-technical users. Yes, there are certain features that newbies won't use (e.g. git-send-email). But there are also GUIs like [TortoiseGit](http://code.google.com/p/tortoisegit/) to make simple things simple.
However, I think you're approaching things the wrong way.... | git does not scale for large repositories. It's not the space, it's the number of files. Please read my [blog article](http://web.archive.org/web/20090724190112/http://www.jaredoberhaus.com/tech_notes/2008/12/git-is-slow-too-many-lstat-operations.html) that I wrote a while back about this.
In my experience, if you wan... |
999,748 | I have a pickerView in a scollView, which would rotate if i sweep across it in sdk 2.2.1 according to <http://discussions.apple.com/thread.jspa?messageID=8284448>
but when i changed the target to sdk 3.0, it is only responding to tapping and rotate 1 row at a time. but for many values that way is tiresome.
can anyone... | 2009/06/16 | [
"https://Stackoverflow.com/questions/999748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | First, I don't agree that Git is inappropriate for non-technical users. Yes, there are certain features that newbies won't use (e.g. git-send-email). But there are also GUIs like [TortoiseGit](http://code.google.com/p/tortoisegit/) to make simple things simple.
However, I think you're approaching things the wrong way.... | Microsoft just released *Git Virtual File System* (GVFS) specifically to handle large code base with git. [More details here at msdn](https://blogs.msdn.microsoft.com/visualstudioalm/2017/02/03/announcing-gvfs-git-virtual-file-system/)
Also [Microsoft hosts the Windows source in a monstrous 300GB Git repository](http... |
999,748 | I have a pickerView in a scollView, which would rotate if i sweep across it in sdk 2.2.1 according to <http://discussions.apple.com/thread.jspa?messageID=8284448>
but when i changed the target to sdk 3.0, it is only responding to tapping and rotate 1 row at a time. but for many values that way is tiresome.
can anyone... | 2009/06/16 | [
"https://Stackoverflow.com/questions/999748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I just happened to be reading [this blog post](http://stevehanov.ca/blog/index.php?id=50) not one minute ago. It's a bit of a rant about the scalability of git.
Edit: Eight years later, and Git has [Large File Storage](https://git-lfs.github.com/) (LFS), and Microsoft is open sourcing [Git Virtual File System](https:/... | Is SVN really such a bad option?
PROS:
* Can handle large repositories e.g. many linux distro's use it, also Apache, Sourceforge
* Has nice GUI front end with TortoiseSVN to keep your windows users happy
* Can be used with windows integrated authentication to keep admins happy
* Many different backup strategies can ... |
999,748 | I have a pickerView in a scollView, which would rotate if i sweep across it in sdk 2.2.1 according to <http://discussions.apple.com/thread.jspa?messageID=8284448>
but when i changed the target to sdk 3.0, it is only responding to tapping and rotate 1 row at a time. but for many values that way is tiresome.
can anyone... | 2009/06/16 | [
"https://Stackoverflow.com/questions/999748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Is SVN really such a bad option?
PROS:
* Can handle large repositories e.g. many linux distro's use it, also Apache, Sourceforge
* Has nice GUI front end with TortoiseSVN to keep your windows users happy
* Can be used with windows integrated authentication to keep admins happy
* Many different backup strategies can ... | I used git only once for a school project (php site with Zend Framework).
We used git but the teacher needed to have the final release on a svn repo.
Comparing the checkout size:
git checkout was half the size of MB of the svn checkout.
My two cents. |
999,748 | I have a pickerView in a scollView, which would rotate if i sweep across it in sdk 2.2.1 according to <http://discussions.apple.com/thread.jspa?messageID=8284448>
but when i changed the target to sdk 3.0, it is only responding to tapping and rotate 1 row at a time. but for many values that way is tiresome.
can anyone... | 2009/06/16 | [
"https://Stackoverflow.com/questions/999748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Microsoft just released *Git Virtual File System* (GVFS) specifically to handle large code base with git. [More details here at msdn](https://blogs.msdn.microsoft.com/visualstudioalm/2017/02/03/announcing-gvfs-git-virtual-file-system/)
Also [Microsoft hosts the Windows source in a monstrous 300GB Git repository](http... | I used git only once for a school project (php site with Zend Framework).
We used git but the teacher needed to have the final release on a svn repo.
Comparing the checkout size:
git checkout was half the size of MB of the svn checkout.
My two cents. |
999,748 | I have a pickerView in a scollView, which would rotate if i sweep across it in sdk 2.2.1 according to <http://discussions.apple.com/thread.jspa?messageID=8284448>
but when i changed the target to sdk 3.0, it is only responding to tapping and rotate 1 row at a time. but for many values that way is tiresome.
can anyone... | 2009/06/16 | [
"https://Stackoverflow.com/questions/999748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | git does not scale for large repositories. It's not the space, it's the number of files. Please read my [blog article](http://web.archive.org/web/20090724190112/http://www.jaredoberhaus.com/tech_notes/2008/12/git-is-slow-too-many-lstat-operations.html) that I wrote a while back about this.
In my experience, if you wan... | I used git only once for a school project (php site with Zend Framework).
We used git but the teacher needed to have the final release on a svn repo.
Comparing the checkout size:
git checkout was half the size of MB of the svn checkout.
My two cents. |
999,748 | I have a pickerView in a scollView, which would rotate if i sweep across it in sdk 2.2.1 according to <http://discussions.apple.com/thread.jspa?messageID=8284448>
but when i changed the target to sdk 3.0, it is only responding to tapping and rotate 1 row at a time. but for many values that way is tiresome.
can anyone... | 2009/06/16 | [
"https://Stackoverflow.com/questions/999748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | First, I don't agree that Git is inappropriate for non-technical users. Yes, there are certain features that newbies won't use (e.g. git-send-email). But there are also GUIs like [TortoiseGit](http://code.google.com/p/tortoisegit/) to make simple things simple.
However, I think you're approaching things the wrong way.... | I used git only once for a school project (php site with Zend Framework).
We used git but the teacher needed to have the final release on a svn repo.
Comparing the checkout size:
git checkout was half the size of MB of the svn checkout.
My two cents. |
999,748 | I have a pickerView in a scollView, which would rotate if i sweep across it in sdk 2.2.1 according to <http://discussions.apple.com/thread.jspa?messageID=8284448>
but when i changed the target to sdk 3.0, it is only responding to tapping and rotate 1 row at a time. but for many values that way is tiresome.
can anyone... | 2009/06/16 | [
"https://Stackoverflow.com/questions/999748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I just happened to be reading [this blog post](http://stevehanov.ca/blog/index.php?id=50) not one minute ago. It's a bit of a rant about the scalability of git.
Edit: Eight years later, and Git has [Large File Storage](https://git-lfs.github.com/) (LFS), and Microsoft is open sourcing [Git Virtual File System](https:/... | git does not scale for large repositories. It's not the space, it's the number of files. Please read my [blog article](http://web.archive.org/web/20090724190112/http://www.jaredoberhaus.com/tech_notes/2008/12/git-is-slow-too-many-lstat-operations.html) that I wrote a while back about this.
In my experience, if you wan... |
999,748 | I have a pickerView in a scollView, which would rotate if i sweep across it in sdk 2.2.1 according to <http://discussions.apple.com/thread.jspa?messageID=8284448>
but when i changed the target to sdk 3.0, it is only responding to tapping and rotate 1 row at a time. but for many values that way is tiresome.
can anyone... | 2009/06/16 | [
"https://Stackoverflow.com/questions/999748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I just happened to be reading [this blog post](http://stevehanov.ca/blog/index.php?id=50) not one minute ago. It's a bit of a rant about the scalability of git.
Edit: Eight years later, and Git has [Large File Storage](https://git-lfs.github.com/) (LFS), and Microsoft is open sourcing [Git Virtual File System](https:/... | There's a utility script called [git-split](http://github.com/rjp/git-split/blob/master/git-split) that chops up a git repo to make it more efficient. |
71,976,826 | I'm a newbie flutter developer
I need some guidance regarding 2D scrolling where I can put widgets in the body and scroll 2D (vertical, horizontal AND diagonal scrolling)
I do not require the actual code but guidance as to which widgets or the logic I'm supposed to use.
figma has 2d scrolling which is an exact examp... | 2022/04/23 | [
"https://Stackoverflow.com/questions/71976826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10118901/"
] | The `InteractiveViewer` may be what you need:
```
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(ti... | You can use [SingleChildScrollView](https://api.flutter.dev/flutter/widgets/SingleChildS) or [listView](https://api.flutter.dev/flutter/widgets/ListView-class.html) for like static widgets.
if you have dynamic widgets than you can use [ListView.builder](https://docs.flutter.dev/cookbook/lists/long-lists) |
418,382 | I am trying to derive the Klein-Gordon equation for the case of GR using the action:
$$S\left[ {\varphi ,{g\_{\mu \nu }}} \right] = \int {\sqrt g {d^4}x\left( { - {1 \over 2}{g^{\mu \nu }}{\nabla \_\mu }\varphi {\nabla \_\nu }\varphi - {1 \over 2}{m^2}{\varphi ^2}} \right)} \tag{1}$$
So in the Euler - Lagrange equati... | 2018/07/19 | [
"https://physics.stackexchange.com/questions/418382",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/196090/"
] | It's probably more straightforward to express your action in terms of partial derivatives:
$$ S\left[ {\varphi ,{g\_{\mu \nu }}} \right] = \int {\sqrt g {d^4}x\left( { - {1 \over 2}{g^{\mu \nu }}{\partial\_\mu }\varphi \,{\partial\_\nu }\varphi - {1 \over 2}{m^2}{\varphi ^2}} \right)} \,, $$
since $\varphi$ is just a... | In order to derive the Klein-Gordon equation you must vary with respect to the scalar field $\phi$. The action reads:
$$S = \int d^{4}x\sqrt{-g}\left(-\cfrac{1}{2}g^{μν}\nabla\_{μ}\phi\nabla\_{ν}\phi - \cfrac{1}{2}m^{2}\phi ^{2}\right) $$
For the kinetic term you have:
\begin{align}
δ(g^{μν}\nabla\_{μ}\phi\nabla\_... |
418,382 | I am trying to derive the Klein-Gordon equation for the case of GR using the action:
$$S\left[ {\varphi ,{g\_{\mu \nu }}} \right] = \int {\sqrt g {d^4}x\left( { - {1 \over 2}{g^{\mu \nu }}{\nabla \_\mu }\varphi {\nabla \_\nu }\varphi - {1 \over 2}{m^2}{\varphi ^2}} \right)} \tag{1}$$
So in the Euler - Lagrange equati... | 2018/07/19 | [
"https://physics.stackexchange.com/questions/418382",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/196090/"
] | Note: technically, everywhere we've been using $\sqrt{g}$ it should be $\sqrt{|g|}$, but I'll let the former denote the latter in a slight abuse of notation like the rest of this page.
gj255 has already provided the textbook approach, in which we keep to partial derivatives. You can actually do it a different way; the... | In order to derive the Klein-Gordon equation you must vary with respect to the scalar field $\phi$. The action reads:
$$S = \int d^{4}x\sqrt{-g}\left(-\cfrac{1}{2}g^{μν}\nabla\_{μ}\phi\nabla\_{ν}\phi - \cfrac{1}{2}m^{2}\phi ^{2}\right) $$
For the kinetic term you have:
\begin{align}
δ(g^{μν}\nabla\_{μ}\phi\nabla\_... |
15,353,092 | I am trying to write a library that reads 5 variables, then sends them through the serial port to a bluetooth reciever, I am getting a number of errors and I am not sure where to go from here, do I need to implement pointers?
Here is the Arduino code....
```
#include <serialComms.h>
serialComms testing;
void setup()... | 2013/03/12 | [
"https://Stackoverflow.com/questions/15353092",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1424125/"
] | Frequently, using Fragments can help with this kind of problem. In your particular case, though I see that you want to use ListActivity, as well. That makes it harder
As you know, Java can't help you here. You can't inherit multiple implementations (List and MyBase). There is no simple answer. I can suggest two things... | Create an abstract class called `BaseActivity`. Implement `onCreate()` for it, which should cover the basics of activity operations. Create other classes that extend from `BaseActivity`, and allow them to override that method if and only if they do something slightly more special than `BaseActivity`.
The main idea her... |
28,806,025 | I am using this code to share user achievements on my app
```
if (FacebookDialog.canPresentShareDialog(getApplicationContext(),
FacebookDialog.ShareDialogFeature.SHARE_DIALOG)) {
// Publish the post using the Share Dialog
try {
FacebookDialog shareDialog = new FacebookDialog.S... | 2015/03/02 | [
"https://Stackoverflow.com/questions/28806025",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1535428/"
] | I think, that we haven't got the opportunities to solve this. Official Facebook docs says:
'If your app share contains a link to any app on Google Play or the App Store, the description and image included in the share will be ignored. Instead, we will scrape the store directly for that app's title and image (and if th... | It seems that the reason is some google restriction it does not allows to share a google play link and provide your own description etc.
The solution for this might be put the link from google play in share massage. |
71,538 | I’m not a native English speaker and want to get a better grip on the nuances of the term *science.*
In my native tongue, the word I’d use for *science* also refers to humanities and the social sciences. However, I’ve lately been getting the feeling that some people use the term only to refer to the natural sciences (... | 2016/06/19 | [
"https://academia.stackexchange.com/questions/71538",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/53401/"
] | [Merriam–Webster definition of *science*](http://www.merriam-webster.com/dictionary/science) reads (reflecting my experience with the usage of the term):
>
> **1 :** the state of knowing : knowledge as distinguished from ignorance or misunderstanding
>
>
> **2a :** a department of systematized knowledge as an objec... | Humanities cover everything that is not a "hard science" such arts and social sciences, as well as other fields, like history. The S in "STEM" is used to refer to "hard science"
Social sciences include fields that use empirical methods to consider society and human behavior, such as anthropology, archaeology, economic... |
71,538 | I’m not a native English speaker and want to get a better grip on the nuances of the term *science.*
In my native tongue, the word I’d use for *science* also refers to humanities and the social sciences. However, I’ve lately been getting the feeling that some people use the term only to refer to the natural sciences (... | 2016/06/19 | [
"https://academia.stackexchange.com/questions/71538",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/53401/"
] | The term "science" in English definitely does not include the humanities. There are ambiguous cases, where it is unclear how to draw the line between humanities and social sciences, but for example literature is never considered a science. If you wish to include the humanities, then you must use a broader term.
Social... | Humanities cover everything that is not a "hard science" such arts and social sciences, as well as other fields, like history. The S in "STEM" is used to refer to "hard science"
Social sciences include fields that use empirical methods to consider society and human behavior, such as anthropology, archaeology, economic... |
71,538 | I’m not a native English speaker and want to get a better grip on the nuances of the term *science.*
In my native tongue, the word I’d use for *science* also refers to humanities and the social sciences. However, I’ve lately been getting the feeling that some people use the term only to refer to the natural sciences (... | 2016/06/19 | [
"https://academia.stackexchange.com/questions/71538",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/53401/"
] | The term "science" in English definitely does not include the humanities. There are ambiguous cases, where it is unclear how to draw the line between humanities and social sciences, but for example literature is never considered a science. If you wish to include the humanities, then you must use a broader term.
Social... | [Merriam–Webster definition of *science*](http://www.merriam-webster.com/dictionary/science) reads (reflecting my experience with the usage of the term):
>
> **1 :** the state of knowing : knowledge as distinguished from ignorance or misunderstanding
>
>
> **2a :** a department of systematized knowledge as an objec... |
71,538 | I’m not a native English speaker and want to get a better grip on the nuances of the term *science.*
In my native tongue, the word I’d use for *science* also refers to humanities and the social sciences. However, I’ve lately been getting the feeling that some people use the term only to refer to the natural sciences (... | 2016/06/19 | [
"https://academia.stackexchange.com/questions/71538",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/53401/"
] | [Merriam–Webster definition of *science*](http://www.merriam-webster.com/dictionary/science) reads (reflecting my experience with the usage of the term):
>
> **1 :** the state of knowing : knowledge as distinguished from ignorance or misunderstanding
>
>
> **2a :** a department of systematized knowledge as an objec... | Does the term "science" include the humanities?
No.
===
Does the term "science" include the social sciences (sociology/economics)?
If you ask the physics department, no.
If you ask the economics department, yes. |
71,538 | I’m not a native English speaker and want to get a better grip on the nuances of the term *science.*
In my native tongue, the word I’d use for *science* also refers to humanities and the social sciences. However, I’ve lately been getting the feeling that some people use the term only to refer to the natural sciences (... | 2016/06/19 | [
"https://academia.stackexchange.com/questions/71538",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/53401/"
] | The term "science" in English definitely does not include the humanities. There are ambiguous cases, where it is unclear how to draw the line between humanities and social sciences, but for example literature is never considered a science. If you wish to include the humanities, then you must use a broader term.
Social... | Does the term "science" include the humanities?
No.
===
Does the term "science" include the social sciences (sociology/economics)?
If you ask the physics department, no.
If you ask the economics department, yes. |
15,409,983 | I'm having trouble with the ServiceStack Json client not deserialzing my results when I use POST. The get methods have no problems deserialzing the response into a UserCredentials object but when I use POST method, it returns an object with all null properties. If I change the type passed to the Post method to a dictio... | 2013/03/14 | [
"https://Stackoverflow.com/questions/15409983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/611750/"
] | Apparently Django looks for fixtures in apps specified in `INSTALLED_APPS` that have a `models.py` in them.
So if your app is missing one, create an empty `models.py` and Django won't skip looking for fixtures in that app. | `initial_data.yaml` should be picked up as long as:
* you have pyyaml installed
* it's located in `fixtures` directory of one of your apps listed in `INSTALLED_APPS` (in `settings.py`)
So, given you have pyyaml it's probably the latter. Please make sure your `fixtures` directory is inside one of the apps listed in `I... |
20,927,215 | How to blur an image(png) and then load it to image view using setBackgroundResource(R.drawable.*\**). It must work on API > 10
I have found some solutions, but i don't know how to take image from @drawable
and load it to imageview
Thanks in advance... | 2014/01/04 | [
"https://Stackoverflow.com/questions/20927215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3149274/"
] | HI you can simply write a code like this..
```
try{Class.forName("com.mysql.jdbc.Driver").newInstance();
username=asfksjfjs;
password=sflkaskfjhsjk;
url="jdbc:mysql://178.360.01:3306/demo01";
con = (Connection) DriverManager.getConnection(url,username,password);}
```
just copy those port no and host name from y... | I don't think you can use environment variables in a jdbc.properties file, I don't think they will get parsed (as answered here [Regarding application.properties file and environment variable](https://stackoverflow.com/questions/2263929/regarding-application-properties-file-and-environment-variable)). You MIGHT be able... |
20,927,215 | How to blur an image(png) and then load it to image view using setBackgroundResource(R.drawable.*\**). It must work on API > 10
I have found some solutions, but i don't know how to take image from @drawable
and load it to imageview
Thanks in advance... | 2014/01/04 | [
"https://Stackoverflow.com/questions/20927215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3149274/"
] | HI you can simply write a code like this..
```
try{Class.forName("com.mysql.jdbc.Driver").newInstance();
username=asfksjfjs;
password=sflkaskfjhsjk;
url="jdbc:mysql://178.360.01:3306/demo01";
con = (Connection) DriverManager.getConnection(url,username,password);}
```
just copy those port no and host name from y... | Activate phpmyadmin, and open it you will find the ip in the header, take it and replace it in the OPENSHIFT\_MYSQL\_DB\_HOST variable, the port is the default mysql : 3306. |
6,856,786 | Is it possible getting cookie from an external js with Php before generating HTML to the browser?
Something like
```
<?
//Get if i have some cookie information
if($_COOKIE["js_app"])
$cookie_js = $_COOKIE["js_app"];
//now, talk with some app.js
if($cookie_js)
$cookie = som... | 2011/07/28 | [
"https://Stackoverflow.com/questions/6856786",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/391721/"
] | We have settled on a process where "CompanyX" gives us an account to their iTunes connect so we can build, sign and upload to the App Store in their name.
Probably you can build it on your machine, send them the product and they sign and upload it themselves, however that would be more tedious, as Apple's toolchain wi... | AFAIK you have to sign the source code with the key you get from Apple to submit it. |
32,872,217 | Trying to install imagemagick ( to be used w PaperClip gem) on my mac ( Yosemite 10.10.5) raising error with 'libtool' what happen with it ?
```
$ brew update
$ brew install imagemagick
==> Installing dependencies for imagemagick: libtool, jpeg, libpng, libti
==> Installing imagemagick dependency: lib... | 2015/09/30 | [
"https://Stackoverflow.com/questions/32872217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Not sure if it's exactly what you're looking for, but what I do is just plop a trigger in the app.xaml to invoke using the `IsInDesignMode` property like;
Namespace (Thanks Tono Nam);
`xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=PresentationFramework"`
XAML;
```
<Style TargetType="{x:Type Use... | You can create a static class with an attached property for design mode:
```
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Helpers.Wpf
{
public static class DesignModeHelper
{
private stat... |
32,872,217 | Trying to install imagemagick ( to be used w PaperClip gem) on my mac ( Yosemite 10.10.5) raising error with 'libtool' what happen with it ?
```
$ brew update
$ brew install imagemagick
==> Installing dependencies for imagemagick: libtool, jpeg, libpng, libti
==> Installing imagemagick dependency: lib... | 2015/09/30 | [
"https://Stackoverflow.com/questions/32872217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can create a static class with an attached property for design mode:
```
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Helpers.Wpf
{
public static class DesignModeHelper
{
private stat... | In 2022 you actually can and almost guessed it:
```xml
d:Background="White"
```
Note you can set pretty much any other control properties differently for design-time when prefix them with `d:`, for example:
```xml
<TextBlock Text="{Binding TextFromViewModel}"
Foreground="{StaticResource PrimaryBrush}"
... |
32,872,217 | Trying to install imagemagick ( to be used w PaperClip gem) on my mac ( Yosemite 10.10.5) raising error with 'libtool' what happen with it ?
```
$ brew update
$ brew install imagemagick
==> Installing dependencies for imagemagick: libtool, jpeg, libpng, libti
==> Installing imagemagick dependency: lib... | 2015/09/30 | [
"https://Stackoverflow.com/questions/32872217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Not sure if it's exactly what you're looking for, but what I do is just plop a trigger in the app.xaml to invoke using the `IsInDesignMode` property like;
Namespace (Thanks Tono Nam);
`xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=PresentationFramework"`
XAML;
```
<Style TargetType="{x:Type Use... | In 2022 you actually can and almost guessed it:
```xml
d:Background="White"
```
Note you can set pretty much any other control properties differently for design-time when prefix them with `d:`, for example:
```xml
<TextBlock Text="{Binding TextFromViewModel}"
Foreground="{StaticResource PrimaryBrush}"
... |
14,142,011 | I'm trying to find the sum of input values within multiple sections. I've put my code so far below.
The HTML:
```
<div class="section">
<input type="radio" name="q1" value="2"/>
<input type="radio" name="q2" value="0"/>
<input type="radio" name="q3" value="1"/>
<input type="radio" name="q4" value="3"/>
</div>... | 2013/01/03 | [
"https://Stackoverflow.com/questions/14142011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3575029/"
] | Use [parseFloat()](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseFloat) or [parseInt()](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt)
```
var totalPoints = 0;
$('.section input').each(function(){
totalPoints = parseFloat($(this).val()) + tota... | The value is stored as a string, so calling `+=` is doing string concatenation. You want/need to treat it as a number, so it does addition. Use the [`parseInt()`](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt) function to convert it to a number:
```
totalPoints += parseInt($(thi... |
14,142,011 | I'm trying to find the sum of input values within multiple sections. I've put my code so far below.
The HTML:
```
<div class="section">
<input type="radio" name="q1" value="2"/>
<input type="radio" name="q2" value="0"/>
<input type="radio" name="q3" value="1"/>
<input type="radio" name="q4" value="3"/>
</div>... | 2013/01/03 | [
"https://Stackoverflow.com/questions/14142011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3575029/"
] | You are doing "1"+"1" and expect it to be 2 ( int)
it is not.
a very quick (and *not* fully correct) solution is :
```
$('.section').each(function(){
var totalPoints = 0;
$(this).find('input').each(function(){
totalPoints += parseInt($(this).val()); //<==== a catch in here !! read below
});
alert(totalP... | ```
Use eval instead of parseInt
var a = "1.5";
var b = "2";
var c = parseInt(a) + parseInt(b);
console.log(c); //result 3
var a = "1.5";
var b = "2";
var c = eval(a) + eval(b);
console.log(c); //result 3.5 this is accurate
``` |
14,142,011 | I'm trying to find the sum of input values within multiple sections. I've put my code so far below.
The HTML:
```
<div class="section">
<input type="radio" name="q1" value="2"/>
<input type="radio" name="q2" value="0"/>
<input type="radio" name="q3" value="1"/>
<input type="radio" name="q4" value="3"/>
</div>... | 2013/01/03 | [
"https://Stackoverflow.com/questions/14142011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3575029/"
] | You are doing "1"+"1" and expect it to be 2 ( int)
it is not.
a very quick (and *not* fully correct) solution is :
```
$('.section').each(function(){
var totalPoints = 0;
$(this).find('input').each(function(){
totalPoints += parseInt($(this).val()); //<==== a catch in here !! read below
});
alert(totalP... | You can also use `reduce()` method of Array to get the sum:
```
var arrayOfValues = $('.section input[type=radio]').map(function(index, input) {
return parseInt($(input).val());
}).toArray();
var sum = arrayOfValues.reduce(function(val1, val2) {
return val1 + val2;
});
``` |
14,142,011 | I'm trying to find the sum of input values within multiple sections. I've put my code so far below.
The HTML:
```
<div class="section">
<input type="radio" name="q1" value="2"/>
<input type="radio" name="q2" value="0"/>
<input type="radio" name="q3" value="1"/>
<input type="radio" name="q4" value="3"/>
</div>... | 2013/01/03 | [
"https://Stackoverflow.com/questions/14142011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3575029/"
] | You are doing "1"+"1" and expect it to be 2 ( int)
it is not.
a very quick (and *not* fully correct) solution is :
```
$('.section').each(function(){
var totalPoints = 0;
$(this).find('input').each(function(){
totalPoints += parseInt($(this).val()); //<==== a catch in here !! read below
});
alert(totalP... | The value is stored as a string, so calling `+=` is doing string concatenation. You want/need to treat it as a number, so it does addition. Use the [`parseInt()`](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt) function to convert it to a number:
```
totalPoints += parseInt($(thi... |
14,142,011 | I'm trying to find the sum of input values within multiple sections. I've put my code so far below.
The HTML:
```
<div class="section">
<input type="radio" name="q1" value="2"/>
<input type="radio" name="q2" value="0"/>
<input type="radio" name="q3" value="1"/>
<input type="radio" name="q4" value="3"/>
</div>... | 2013/01/03 | [
"https://Stackoverflow.com/questions/14142011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3575029/"
] | You are doing "1"+"1" and expect it to be 2 ( int)
it is not.
a very quick (and *not* fully correct) solution is :
```
$('.section').each(function(){
var totalPoints = 0;
$(this).find('input').each(function(){
totalPoints += parseInt($(this).val()); //<==== a catch in here !! read below
});
alert(totalP... | The javascript function parseInt() should achieve what you require, here's a fiddle:
<http://jsfiddle.net/k739M/>
And some formatted code:
```
$('.section').each(function(){
var totalPoints = 0;
$(this).find('input').each(function(){
totalPoints += parseInt($(this).val());
});
alert(totalPoi... |
14,142,011 | I'm trying to find the sum of input values within multiple sections. I've put my code so far below.
The HTML:
```
<div class="section">
<input type="radio" name="q1" value="2"/>
<input type="radio" name="q2" value="0"/>
<input type="radio" name="q3" value="1"/>
<input type="radio" name="q4" value="3"/>
</div>... | 2013/01/03 | [
"https://Stackoverflow.com/questions/14142011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3575029/"
] | Use [parseFloat()](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseFloat) or [parseInt()](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt)
```
var totalPoints = 0;
$('.section input').each(function(){
totalPoints = parseFloat($(this).val()) + tota... | ```
Use eval instead of parseInt
var a = "1.5";
var b = "2";
var c = parseInt(a) + parseInt(b);
console.log(c); //result 3
var a = "1.5";
var b = "2";
var c = eval(a) + eval(b);
console.log(c); //result 3.5 this is accurate
``` |
14,142,011 | I'm trying to find the sum of input values within multiple sections. I've put my code so far below.
The HTML:
```
<div class="section">
<input type="radio" name="q1" value="2"/>
<input type="radio" name="q2" value="0"/>
<input type="radio" name="q3" value="1"/>
<input type="radio" name="q4" value="3"/>
</div>... | 2013/01/03 | [
"https://Stackoverflow.com/questions/14142011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3575029/"
] | The value is stored as a string, so calling `+=` is doing string concatenation. You want/need to treat it as a number, so it does addition. Use the [`parseInt()`](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt) function to convert it to a number:
```
totalPoints += parseInt($(thi... | You can also use `reduce()` method of Array to get the sum:
```
var arrayOfValues = $('.section input[type=radio]').map(function(index, input) {
return parseInt($(input).val());
}).toArray();
var sum = arrayOfValues.reduce(function(val1, val2) {
return val1 + val2;
});
``` |
14,142,011 | I'm trying to find the sum of input values within multiple sections. I've put my code so far below.
The HTML:
```
<div class="section">
<input type="radio" name="q1" value="2"/>
<input type="radio" name="q2" value="0"/>
<input type="radio" name="q3" value="1"/>
<input type="radio" name="q4" value="3"/>
</div>... | 2013/01/03 | [
"https://Stackoverflow.com/questions/14142011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3575029/"
] | The value is stored as a string, so calling `+=` is doing string concatenation. You want/need to treat it as a number, so it does addition. Use the [`parseInt()`](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt) function to convert it to a number:
```
totalPoints += parseInt($(thi... | ```
Use eval instead of parseInt
var a = "1.5";
var b = "2";
var c = parseInt(a) + parseInt(b);
console.log(c); //result 3
var a = "1.5";
var b = "2";
var c = eval(a) + eval(b);
console.log(c); //result 3.5 this is accurate
``` |
14,142,011 | I'm trying to find the sum of input values within multiple sections. I've put my code so far below.
The HTML:
```
<div class="section">
<input type="radio" name="q1" value="2"/>
<input type="radio" name="q2" value="0"/>
<input type="radio" name="q3" value="1"/>
<input type="radio" name="q4" value="3"/>
</div>... | 2013/01/03 | [
"https://Stackoverflow.com/questions/14142011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3575029/"
] | You are doing "1"+"1" and expect it to be 2 ( int)
it is not.
a very quick (and *not* fully correct) solution is :
```
$('.section').each(function(){
var totalPoints = 0;
$(this).find('input').each(function(){
totalPoints += parseInt($(this).val()); //<==== a catch in here !! read below
});
alert(totalP... | Use [parseFloat()](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseFloat) or [parseInt()](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt)
```
var totalPoints = 0;
$('.section input').each(function(){
totalPoints = parseFloat($(this).val()) + tota... |
14,142,011 | I'm trying to find the sum of input values within multiple sections. I've put my code so far below.
The HTML:
```
<div class="section">
<input type="radio" name="q1" value="2"/>
<input type="radio" name="q2" value="0"/>
<input type="radio" name="q3" value="1"/>
<input type="radio" name="q4" value="3"/>
</div>... | 2013/01/03 | [
"https://Stackoverflow.com/questions/14142011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3575029/"
] | Use [parseFloat()](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseFloat) or [parseInt()](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt)
```
var totalPoints = 0;
$('.section input').each(function(){
totalPoints = parseFloat($(this).val()) + tota... | You can also use `reduce()` method of Array to get the sum:
```
var arrayOfValues = $('.section input[type=radio]').map(function(index, input) {
return parseInt($(input).val());
}).toArray();
var sum = arrayOfValues.reduce(function(val1, val2) {
return val1 + val2;
});
``` |
38,695 | Compare to [underscorejs](http://underscorejs.org/) if it pleases you. Once again, I hope this is well commented. Please let me know what comments/improvements I can add.
Please review all aspects of this code.
```
/***************************************************************************************************
**... | 2014/01/06 | [
"https://codereview.stackexchange.com/questions/38695",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/-1/"
] | The below code would be cleaner with object literal notation :
```
// a basic registry pattern with get/set and getMany/setMany
$P.Reg = (function () {
var publik = {},
register = {};
publik.get = function (key) {
return register[key];
};
publik.set = fun... | I agree [object notation would look cleaner](https://codereview.stackexchange.com/a/38697/2634) in this case.
I don't see why you need `Reg`. It's a very thin wrapper over an object.
There's no need to implement “registry pattern” in JS because every JS object already *is* a “registry”.
I'm not sure why you need a... |
118,406 | I am learning ML and facing confusion about data scaling. For example, I have the following data:
| Weight(KG) | Balance($) |
| --- | --- |
| 75 | 3401542 |
| 99 | 4214514 |
Now, if I use StandardScaler, I may get something like this:
| Weight(KG) | Balance($) |
| --- | --- |
| -0.23214788 | -0.73214788 |
| -0.25214... | 2023/02/09 | [
"https://datascience.stackexchange.com/questions/118406",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/136871/"
] | I like the initiative that you answered your own question.
In case you would like an additional answer:
What you are referring to in your question is the concept of hierarchical clustering, a great way to cluster since it is deterministic (meaning no matter how many times you run it, the groupings are the exact same, ... | I do not know if this is the smartest way to do it, but it seems to work for my study case.
To recap, I performed a top2vec algorithm:
```
import numpy as np
import pandas as pd
from top2vec import Top2Vec
df = pd.read_excel('Preprocessed2.xlsx')
documents = df_small_small['Translated Cleaned'].to_list()
model = To... |
10,666,415 | I want to get multiple dragged ids when i dropped to the certain div. `$(ui.draggable).attr('id');` only gets 1st id.
```
Drag <ul id="demo" >
<li id="1" ></li>
<li id="2" ></li>
<li id="3" ></li>
</ul>
<div class="drop"> drop here!! </div>
```
JQUERY
```
$(".drop").d... | 2012/05/19 | [
"https://Stackoverflow.com/questions/10666415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1383645/"
] | ```
var m_id = [];
$.each($(ui.draggable), function(i,e) {
m_id.push(e.id);
});
//gives array with all ID's, could be joined with join()
//for comma seperated list
``` | ```
$("li").draggable({ revert: true });
$(".drop").droppable({
drop: function(event, ui) {
var id = ui.draggable.attr("id");
alert(id);
}
});
``` |
25,344,950 | i have local repository, which has two version:
```
$git tag
v1.0.0
v1.0.4
```
in v.0.0 is only initial reposity, with two files:
`aa.txt` - content:
*it's my first file*
`bb.txt` - content:
*it's my second file*
```
$git commit -m 'first commit'
$git push
(...)
```
next time i added new file, names: `cc.txt`,... | 2014/08/16 | [
"https://Stackoverflow.com/questions/25344950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3810460/"
] | just use the tag name:
```
git checkout v1.0.0
```
see the [manual for checkout command](https://www.kernel.org/pub/software/scm/git/docs/git-checkout.html) | One way is on webside:
click the selected button:

`select tags, select your interested tag/version`
and the next step's to **Download.zip** |
170,291 | I would like to know the forces acting on an SHM, and how they effect the motion. For example, take the motion of a simple pendulum as in the given image.
Which are the forces acting on this motion?
For simplicity, lets divide the motion into four part... | 2015/03/14 | [
"https://physics.stackexchange.com/questions/170291",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/60846/"
] | In simple harmonic motion, the mass always oscillates about a stable equilibrium point. The point B is the point of stable equilibrium in this system. This means that the forces would act in such a manner, that the mass would always have a tendency to move to point B, if it is slightly displaced from that point.
If i... | Weight and Tension in the string are two important things to consider here. I can select my half-cone angle as $\theta$. Then, the tension T is balanced by the cosine component of weight i.e m $\times$ g and the $\sin\theta$ component is the one directed towards mean position. If the angle is small, we can approximate ... |
38,564,979 | I find myself quite often in the following situation:
I have a user control which is bound to some data. Whenever the control is updated, the underlying data is updated. Whenever the underlying data is updated, the control is updated. So it's quite easy to get stuck in a never ending loop of updates (control updates d... | 2016/07/25 | [
"https://Stackoverflow.com/questions/38564979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2092267/"
] | One option would be to stop the update in case the data didn't change since the last time. For example if the data were in form of a class, you could check if the data is the same instance as the last time the event was triggered and if that is the case, stop the propagation.
This is what many MVVM frameworks do to pr... | You should look into MVP - it is the preferred design pattern for Winforms UI.
<http://www.codeproject.com/Articles/14660/WinForms-Model-View-Presenter>
using that design pattern gives you a more readable code in addition to allowing you to avoid circular events.
in order to actually avoid circular events, your view ... |
38,564,979 | I find myself quite often in the following situation:
I have a user control which is bound to some data. Whenever the control is updated, the underlying data is updated. Whenever the underlying data is updated, the control is updated. So it's quite easy to get stuck in a never ending loop of updates (control updates d... | 2016/07/25 | [
"https://Stackoverflow.com/questions/38564979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2092267/"
] | What you're looking for is called [Data Binding](https://msdn.microsoft.com/en-us/library/ef2xyb33(v=vs.110).aspx). It allows you to connect two or more properties, so that when one property changes others will be updated auto-magically.
In WinForms it's a little bit ugly, but works like a charm in cases such as your... | You should look into MVP - it is the preferred design pattern for Winforms UI.
<http://www.codeproject.com/Articles/14660/WinForms-Model-View-Presenter>
using that design pattern gives you a more readable code in addition to allowing you to avoid circular events.
in order to actually avoid circular events, your view ... |
54,162 | I have a superior who often communicates incorrect statements during meetings. While I want this question to be more general, because I have been in this situation with many unique settings, I will say that the statements seem to be meant to steer decision making.
**As an example:**
It seems as though before I arr... | 2015/09/10 | [
"https://workplace.stackexchange.com/questions/54162",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/34165/"
] | How about a friendly chat with the Superior in question after the meeting?
Sounds odd? Hear me out.
The underlying goal here is that you have an idea that you believe would help the company. Unfortunately, a member of the current leadership does not believe that this idea would work. With this said, the superior's re... | Would you be prepared to back up your argument with specific sources? For example, while there are tons of possible ways to improve search rankings, which could you guarantee would work as that would likely be required for you to have a chance at winning the argument here.
I'd likely consider the question of whether o... |
54,162 | I have a superior who often communicates incorrect statements during meetings. While I want this question to be more general, because I have been in this situation with many unique settings, I will say that the statements seem to be meant to steer decision making.
**As an example:**
It seems as though before I arr... | 2015/09/10 | [
"https://workplace.stackexchange.com/questions/54162",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/34165/"
] | **Get on the same page before the meeting.**
Yes, the point is to steer decision making and your boss should let everyone know what direction he is going. There isn't time in many cases, but departments/groups/teams should have a meeting before they go into such meetings with outside members. At least the boss should ... | Would you be prepared to back up your argument with specific sources? For example, while there are tons of possible ways to improve search rankings, which could you guarantee would work as that would likely be required for you to have a chance at winning the argument here.
I'd likely consider the question of whether o... |
54,162 | I have a superior who often communicates incorrect statements during meetings. While I want this question to be more general, because I have been in this situation with many unique settings, I will say that the statements seem to be meant to steer decision making.
**As an example:**
It seems as though before I arr... | 2015/09/10 | [
"https://workplace.stackexchange.com/questions/54162",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/34165/"
] | Would you be prepared to back up your argument with specific sources? For example, while there are tons of possible ways to improve search rankings, which could you guarantee would work as that would likely be required for you to have a chance at winning the argument here.
I'd likely consider the question of whether o... | >
> Should I tell a superior [in a meeting] their statement is incorrect?
>
>
>
(I will not focus on how to prevent the situation, as this is not the question. But of course preventing a bad situation is better than trying to fix it.)
Let's try to approach this one methodically. Why would your superior make an in... |
54,162 | I have a superior who often communicates incorrect statements during meetings. While I want this question to be more general, because I have been in this situation with many unique settings, I will say that the statements seem to be meant to steer decision making.
**As an example:**
It seems as though before I arr... | 2015/09/10 | [
"https://workplace.stackexchange.com/questions/54162",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/34165/"
] | How about a friendly chat with the Superior in question after the meeting?
Sounds odd? Hear me out.
The underlying goal here is that you have an idea that you believe would help the company. Unfortunately, a member of the current leadership does not believe that this idea would work. With this said, the superior's re... | >
> Should I tell a superior [in a meeting] their statement is incorrect?
>
>
>
(I will not focus on how to prevent the situation, as this is not the question. But of course preventing a bad situation is better than trying to fix it.)
Let's try to approach this one methodically. Why would your superior make an in... |
54,162 | I have a superior who often communicates incorrect statements during meetings. While I want this question to be more general, because I have been in this situation with many unique settings, I will say that the statements seem to be meant to steer decision making.
**As an example:**
It seems as though before I arr... | 2015/09/10 | [
"https://workplace.stackexchange.com/questions/54162",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/34165/"
] | **Get on the same page before the meeting.**
Yes, the point is to steer decision making and your boss should let everyone know what direction he is going. There isn't time in many cases, but departments/groups/teams should have a meeting before they go into such meetings with outside members. At least the boss should ... | >
> Should I tell a superior [in a meeting] their statement is incorrect?
>
>
>
(I will not focus on how to prevent the situation, as this is not the question. But of course preventing a bad situation is better than trying to fix it.)
Let's try to approach this one methodically. Why would your superior make an in... |
74,007,260 | I am new to Solidity, I am trying to build a simple smart contract and explore solidity in the process. The following build can be compiled without putting a value but when i try to put some value in it it shows the following error.
>
> The transaction has been reverted to the initial state.
> Note: The called functi... | 2022/10/09 | [
"https://Stackoverflow.com/questions/74007260",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16230867/"
] | The other answer is correct, you have an error because you misspelled a keyword in your SQL query. But that's not the question you asked.
>
> I use MySQL, why MariaDB in the error message?
>
>
>
MySQL Server will not mention MariaDB in its error message. MySQL and MariaDB are different products. Therefore if your... | You have a typo in your query.
```sql
select * form category= ?
```
should be
```sql
select * from category= ?
``` |
40,034,673 | I realize this question has been asked many times before but I'm asking it now because the answers are quite old (compared to the new API).
I've used Location Manager before but I've found it very unreliable. For example in my app, using getLastKnownLocation and/or current location, it would instantly load with the c... | 2016/10/14 | [
"https://Stackoverflow.com/questions/40034673",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6490018/"
] | You can simply store the index to which you got in the previous processing run. After all, you *don't* want to iterate the array multiple times, you want to iterate it only once but in multiple steps.
```js
function process(arr, step, start) {
var take = Math.min(arr.length - start, Math.round(1 + Math.random() *... | ```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
getColorGroup();
});
function getColorGroup()
{
var colors = ['#FAEBD7', '#00FFFF', '#000000', '#0000FF', '#8A2BE2', '#A52A2A', '#D... |
21,974,718 | **Context**
I am writing an event-driven application server in C++. I want to use google protocol buffers for moving my data. Since the server is event driven, the connection handler API is basically a callback function letting me know when another buffer of N bytes has arrived from the client.
**Question**
My quest... | 2014/02/23 | [
"https://Stackoverflow.com/questions/21974718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1035897/"
] | No, this is not possible.
The Protobuf parser is a recursive descent parser, meaning quite a bit of its state is stored on the stack. This makes it fast, but it means there's no way to pause the parser in the middle except to pause the whole thread. If your app is non-blocking, you'll just have to buffer bytes until y... | Yes, this is possible, I've done it in Javascript, but the design could be ported to C++.
<https://github.com/chrisdew/protostream> |
24,072,833 | I have a 512x512 1.03 mb .ico picture and need to upload it to a website that only accepts pictures 1mb large(or smaller idk) Can somebody help me and tell me a way to reduce the size of the image. | 2014/06/06 | [
"https://Stackoverflow.com/questions/24072833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3712838/"
] | You can either compress/reduce the filesize of the icon (I recommend using ImageMagick to do this, you can download it [here](http://imagemagick.org)), or you can make the dimensions smaller. However, if you are putting an ico file on a website I recommend using a different image format, such as .png. You can convert i... | Take a look on [this page](http://zoompf.com/blog/2012/04/instagram-and-optimizing-favicons) specially compression of ICO files and 4-bit option. |
60,421,341 | I am using sql to calculate the average daily temperature and max daily temperature based on a date timestamp in an existing database. Is there a quick way to accomplish this?
I am using dBeaver to do all my data calculations and the following code is what I have used so far:
```
SELECT
convert(varchar, OBS_TIME_... | 2020/02/26 | [
"https://Stackoverflow.com/questions/60421341",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8071794/"
] | I am not sure if I understand what you need but I will try:
Your question: "**Is there a quick way to separate date and time from a time stamp in sql?**"
Answer:
```
select to_char(datec, 'hh24:mi')
, to_char(datec, 'yyyy-mm-dd')
from test;
```
Use `to_char` with format to select date part and time part. | You seem to want aggregation:
```
SELECT convert(date, OBS_TIME_LOCAL) AS datepart,
avg(temp), max(temp)
FROM APP_RSERVERLOAD.ONC_TMS_CUR_ONCOR_WEATHER
GROUP BY convert(date, OBS_TIME_LOCAL);
``` |
6,547,214 | I'm trying to encrypt data between my android application and a PHP webservice.
I found the next piece of code in this website: <http://schneimi.wordpress.com/2008/11/25/aes-128bit-encryption-between-java-and-php/>
But when I try to decrypt I get the Exception of the title "data not block size aligned"
This are the ... | 2011/07/01 | [
"https://Stackoverflow.com/questions/6547214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571353/"
] | At last! I made it work! Thanks for all your suggestion. I would like to share the code just in case somebody get stuck like me:
**JAVA**
```
import java.security.NoSuchAlgorithmException;
import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.c... | I'm guessing your `keyspec` and `ivspec` are not valid for decryption. I've typically transformed them into `PublicKey` and `PrivateKey` instances and then use the private key to decrypt. |
6,547,214 | I'm trying to encrypt data between my android application and a PHP webservice.
I found the next piece of code in this website: <http://schneimi.wordpress.com/2008/11/25/aes-128bit-encryption-between-java-and-php/>
But when I try to decrypt I get the Exception of the title "data not block size aligned"
This are the ... | 2011/07/01 | [
"https://Stackoverflow.com/questions/6547214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571353/"
] | At last! I made it work! Thanks for all your suggestion. I would like to share the code just in case somebody get stuck like me:
**JAVA**
```
import java.security.NoSuchAlgorithmException;
import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.c... | I looked at the comments in the other answer. I ran into a similar problem trying to encrypt a large block of text using open SSL in php (on both sides). I imagine the same issue would come up in Java.
If you have a 1024 bit RSA key, you must split the incoming text into 117 byte chunks (a char is a byte) and encrypt ... |
37,285,990 | Say I have two classes:
```
class ParentClass
{
public function getSomething()
{
return $this->variable_name;
}
}
class ChildClass extends ParentClass
{
private $variable_name = 'something specific to child class';
...
}
```
Then I call code to instantiate the `ChildClass` and call t... | 2016/05/17 | [
"https://Stackoverflow.com/questions/37285990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/331952/"
] | >
> Rule of thumb: if your parent class needs to know anything about child classes, then you do something wrong.
>
>
>
When you design classes or interfaces you should first think about `actions` (methods) which they can perform. Don't think about their `internal state` (variables).
To solve your particular probl... | Short answer: You can't.
Long answer: That's not how OO works. Parent classes doesn't know your childs.
What you can do is to use Reflection, but it's not the way to go, you need to rethink your project.
```
class Parent {
public function getSomething(Child $child) {
$reflection = new ReflectionObject($ch... |
37,285,990 | Say I have two classes:
```
class ParentClass
{
public function getSomething()
{
return $this->variable_name;
}
}
class ChildClass extends ParentClass
{
private $variable_name = 'something specific to child class';
...
}
```
Then I call code to instantiate the `ChildClass` and call t... | 2016/05/17 | [
"https://Stackoverflow.com/questions/37285990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/331952/"
] | >
> Rule of thumb: if your parent class needs to know anything about child classes, then you do something wrong.
>
>
>
When you design classes or interfaces you should first think about `actions` (methods) which they can perform. Don't think about their `internal state` (variables).
To solve your particular probl... | Just like you stated, the ChildClass inherits from the ParentClass, not the other way around. To the ParentClass, `$this->variable_name` is an unknown variable. A simple way that I would suggest would be to change the ParentClass method a bit and override it in the ChildClass as such:
```
class ParentClass
{
publi... |
70,475,907 | I don't understand why I'm getting this error:
>
> Argument of type '{ id: string; }' is not assignable to parameter of
> type 'never'.
>
>
>
... at the line `const index = state.sections.findIndex((section) => section.id === id);`
in the following portion of my Vue store:
```
import { MutationTree, ActionTree,... | 2021/12/24 | [
"https://Stackoverflow.com/questions/70475907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/871404/"
] | When you don't provide a type for a value -- your function's return value, in this case -- TypeScript tries to narrow it down to the most accurate type it can. Since your returned object's `sections`' item arrays are always empty, it infers them as `never[]` (`type[]` is an alias for `Array<type>`); an array that can't... | I think you need `state.sections.push(sectionItem)` instead of `state.sections[index].sectionItems.push(sectionItems)`. |
70,475,907 | I don't understand why I'm getting this error:
>
> Argument of type '{ id: string; }' is not assignable to parameter of
> type 'never'.
>
>
>
... at the line `const index = state.sections.findIndex((section) => section.id === id);`
in the following portion of my Vue store:
```
import { MutationTree, ActionTree,... | 2021/12/24 | [
"https://Stackoverflow.com/questions/70475907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/871404/"
] | When you don't provide a type for a value -- your function's return value, in this case -- TypeScript tries to narrow it down to the most accurate type it can. Since your returned object's `sections`' item arrays are always empty, it infers them as `never[]` (`type[]` is an alias for `Array<type>`); an array that can't... | I would say you probably need to type your sectionItems:
```
interface SectionItem {
id: string
}
interface Section {
id: string;
section_header: string;
section_body?: string;
sectionItems: SectionItem;
}
interface State {
sections: Section[]
}
export const state = (): State => ({
sections: [
{
... |
54,881,664 | I want to create a circle inside a circle like a donut, but it should be create dynamically. for eg. If I have a page width 500px and height 500px, it should fit.
or if I have some other width and height like 100px and 100px, it should fit in. I am creating a component in angular project using div and css.
I have gon... | 2019/02/26 | [
"https://Stackoverflow.com/questions/54881664",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2039996/"
] | This should help:
```css
.outerCircle{
width: 60px;
height: 60px;
border: 1px solid #000;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.innerCircle{
width: 32px;
height: 32px;
border: 1px solid #000;
border-radius: 50%;
}
```
```html
<div clas... | I made some changes in your code. Please check this
[Answer to "https://stackoverflow.com/questions/54881664/how-to-create-a-circle-inside-a-circle-dynamically-like-a-donut"](https://codepen.io/anon/pen/eXYXQb)
CSS :
```css
.empty-wheel-outer {
display: inline-block;
width: -webkit-fill-available;
height:... |
54,881,664 | I want to create a circle inside a circle like a donut, but it should be create dynamically. for eg. If I have a page width 500px and height 500px, it should fit.
or if I have some other width and height like 100px and 100px, it should fit in. I am creating a component in angular project using div and css.
I have gon... | 2019/02/26 | [
"https://Stackoverflow.com/questions/54881664",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2039996/"
] | height and width will be added dynamically for child items in % and it will be centered automatically by adding circle class
`Try changing child width and height it will stay in center`
Ping me if you need further explanation.
```css
.wraper {
width: 60px;
height: 60px;
}
.circle {
display: flex;
alig... | This should help:
```css
.outerCircle{
width: 60px;
height: 60px;
border: 1px solid #000;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.innerCircle{
width: 32px;
height: 32px;
border: 1px solid #000;
border-radius: 50%;
}
```
```html
<div clas... |
54,881,664 | I want to create a circle inside a circle like a donut, but it should be create dynamically. for eg. If I have a page width 500px and height 500px, it should fit.
or if I have some other width and height like 100px and 100px, it should fit in. I am creating a component in angular project using div and css.
I have gon... | 2019/02/26 | [
"https://Stackoverflow.com/questions/54881664",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2039996/"
] | height and width will be added dynamically for child items in % and it will be centered automatically by adding circle class
`Try changing child width and height it will stay in center`
Ping me if you need further explanation.
```css
.wraper {
width: 60px;
height: 60px;
}
.circle {
display: flex;
alig... | I made some changes in your code. Please check this
[Answer to "https://stackoverflow.com/questions/54881664/how-to-create-a-circle-inside-a-circle-dynamically-like-a-donut"](https://codepen.io/anon/pen/eXYXQb)
CSS :
```css
.empty-wheel-outer {
display: inline-block;
width: -webkit-fill-available;
height:... |
24,761,088 | I have downloaded the entire website from my server over an SSH connection and now I am unable to run it on my localhost.
The website works fine there on the server but not on my localhost, and throws me this error whenever I try to hit localhost/CPx
```
Fatal error: Using $this when not in object context in /var/ww... | 2014/07/15 | [
"https://Stackoverflow.com/questions/24761088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2647960/"
] | Start [reading about OOP in the php manual](http://php.net/manual/en/language.oop5.php) and then do the CakePHP blog tutorial, start here: <http://book.cakephp.org/2.0/en/index.html#getting-started>
Using a helper (that's what your line 25 does) in a controller is a clear proof that you don't know what you do and how ... | The fact issue is with a controller named "DashboardController" could suggest that dashboard may be on subdomain on the production environment? (eg I have seen some people put dashboard functionality onto subdomain) You'd have to address that in your dev environment. |
10,130,726 | >
> **Possible Duplicate:**
>
> [Ruby: Nils in an IF statement](https://stackoverflow.com/questions/5393974/ruby-nils-in-an-if-statement)
>
> [Is there a clean way to avoid calling a method on nil in a nested params hash?](https://stackoverflow.com/questions/5429790/is-there-a-clean-way-to-avoid-calling-a-method... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10130726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/585456/"
] | There are many approaches to this.
If you use Ruby 2.3 or above, you can use [dig](http://ruby-doc.org/core-2.3.0_preview1/Hash.html#method-i-dig)
```
my_hash.dig('key1', 'key2', 'key3')
```
Plenty of folks stick to plain ruby and chain the `&&` guard tests.
You could use stdlib [Hash#fetch](http://www.ruby-doc.or... | Conditions `my_hash['key1'] && my_hash['key1']['key2']` don't feel [DRY](http://en.wikipedia.org/wiki/Don%27t_repeat_yourself).
Alternatives:
1) [autovivification](http://t-a-w.blogspot.com/2006/07/autovivification-in-ruby.html) magic. From that post:
```
def autovivifying_hash
Hash.new {|ht,k| ht[k] = autovivify... |
10,130,726 | >
> **Possible Duplicate:**
>
> [Ruby: Nils in an IF statement](https://stackoverflow.com/questions/5393974/ruby-nils-in-an-if-statement)
>
> [Is there a clean way to avoid calling a method on nil in a nested params hash?](https://stackoverflow.com/questions/5429790/is-there-a-clean-way-to-avoid-calling-a-method... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10130726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/585456/"
] | There are many approaches to this.
If you use Ruby 2.3 or above, you can use [dig](http://ruby-doc.org/core-2.3.0_preview1/Hash.html#method-i-dig)
```
my_hash.dig('key1', 'key2', 'key3')
```
Plenty of folks stick to plain ruby and chain the `&&` guard tests.
You could use stdlib [Hash#fetch](http://www.ruby-doc.or... | You could also use [Object#andand](http://andand.rubyforge.org/).
```
my_hash['key1'].andand['key2'].andand['key3']
``` |
43,032,249 | Basically I have a txt file thats an ouput from a fortran model. The output looks a little like this:
```
Title:Model
Temp(K) Ionic str Rho Phi H2O Ice ...
273.15 4 1.003 1.21 1000 0.00
Species Ini Conc Final Conc Act ....
H 0.0 0.12032 0.59
NH4 ... | 2017/03/26 | [
"https://Stackoverflow.com/questions/43032249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7384359/"
] | Use templates. C++ version of generic programming.
--------------------------------------------------
Define your **linked list** `node` with a template:
```
template<class T>
class node<T>{
public:
node<T>();
T data;
node<T> *next;
};
```
This means that you can now have a `node` of any kind of d... | You could also NOT use generic programming/templates and make your `node` have specific data you want
-----------------------------------------------------------------------------------------------------
This will also impact your code less, because when adding templates you would probably have to add and change more ... |
35,836,158 | I'm setting up the remote connection to oracle database and it requires that the connection should be established through port 1521 by default.
However, i'm getting the error repeatly:
[Oracle JDBC Driver]Error establishing socket to host and port: :1521. Reason: Connection refused
Checking deeper, I realize that the... | 2016/03/07 | [
"https://Stackoverflow.com/questions/35836158",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6027407/"
] | This has nothing to do with Python, but modular arithmetic:
```
print(time[(14 - 1 + 59) % 24])
```
prints
```
1
``` | Use modulo to get the remainder of the index you want divided by the length of the tuple:
```
time = (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24)
print(time[(15+59) % len(time)])
``` |
35,836,158 | I'm setting up the remote connection to oracle database and it requires that the connection should be established through port 1521 by default.
However, i'm getting the error repeatly:
[Oracle JDBC Driver]Error establishing socket to host and port: :1521. Reason: Connection refused
Checking deeper, I realize that the... | 2016/03/07 | [
"https://Stackoverflow.com/questions/35836158",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6027407/"
] | This has nothing to do with Python, but modular arithmetic:
```
print(time[(14 - 1 + 59) % 24])
```
prints
```
1
``` | [np.roll](http://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.roll.html) shifts all of the values in your iterable, and thus answers your original question.
```
import datetime as dt
>>> dt.datetime(2016, + dt.timedelta(hours=59)
datetime.datetime(2016, 1, 4, 1, 0) # 1 a.m.
>>> np.roll(time, -59)[14 - ... |
7,228,988 | What I'm wondering is basically what (if any) browsers in iOS and Android allow events to trigger when the browser is inactive/in background/sleeping?
If any: What kind of events will this browser in that OS allow? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/761168/"
] | As far as I know, they do not. If you put the browser in the background, it unloads the page to free some memory for other apps. | If you've got a `<video>` or `<audio>` element with a playing media file in iOS Safari, the `ended` event will trigger, even if the browser is not open. This allows you to select a next media file and play it, sorta emulating the native iPod experience. |
7,228,988 | What I'm wondering is basically what (if any) browsers in iOS and Android allow events to trigger when the browser is inactive/in background/sleeping?
If any: What kind of events will this browser in that OS allow? | 2011/08/29 | [
"https://Stackoverflow.com/questions/7228988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/761168/"
] | In Android, you can accomplish this by writing an Activity whose sole UI component is a web view. Your activity receives many lifecycle events automatically (such as focus / loss of focus) and can request to receive more (such as screen-off, screen-on). You can easily pass these events into the underlying webkit's java... | If you've got a `<video>` or `<audio>` element with a playing media file in iOS Safari, the `ended` event will trigger, even if the browser is not open. This allows you to select a next media file and play it, sorta emulating the native iPod experience. |
11,627 | So tell me know, can you figure out,
The clues I'll give are all about
A subject many really quite hate,
The moment they hear it, from the gate.
It really is useful, as science would say,
Scientific conclusions use it every day.
The chances too are great, can you see
If you use it, or hear what the... | 2015/04/06 | [
"https://puzzling.stackexchange.com/questions/11627",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/9951/"
] | Is it
>
> Statistics?
>
>
>
So tell me know, can you figure out,
The clues I'll give are all about
A subject many really quite hate,
The moment they hear it, from the gate.
>
> Many people have a negative attitude towards statistics: there are lies, there are damned lies, and there is statistics.
> ... | Sounds like
>
> Math
>
>
>
A subject many really quite hate,
The moment they hear it, from the gate.
>
> Many people dislike math
>
>
>
It really is useful, as science would say,
Scientific conclusions use it every day.
>
> Math is useful in science!
>
>
>
The chances too are great, can you ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.