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 |
|---|---|---|---|---|---|
62,236,233 | So I have an application, the user uploads the file and after doing some operations on the backend I send back a list of JSON Object.And I have generated a material table to show the contents, now what's happening is that my material table dataSource doesn't get updated. Like when I upload the file and I am viewing the... | 2020/06/06 | [
"https://Stackoverflow.com/questions/62236233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13535767/"
] | try : `this.props.history.push('/tickets', rowIndex[0]):`
the syntax should be : `push(route, params)` | You can use 'useHistory' from the library 'react-router-dom'if using functional component.
First initialize as below.
```
const history = useHistory();
```
Then you can call whenever wanted
```
history.push('Path')
```
For example when clicking a button
```
onClick{()=>{history.push('/ticket')}}
``` |
62,236,233 | So I have an application, the user uploads the file and after doing some operations on the backend I send back a list of JSON Object.And I have generated a material table to show the contents, now what's happening is that my material table dataSource doesn't get updated. Like when I upload the file and I am viewing the... | 2020/06/06 | [
"https://Stackoverflow.com/questions/62236233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13535767/"
] | Alternatively, if you don't want to show your data in the URL, you can pass it in state:
```
this.props.history.push('/tickets', { data: rowIndex[0] })
```
or
```
this.props.history.push({
pathname: '/tickets',
state: {
data: rowIndex[0],
},
})
```
And in the Component, to get the data:
```
const data ... | try : `this.props.history.push('/tickets', rowIndex[0]):`
the syntax should be : `push(route, params)` |
62,236,233 | So I have an application, the user uploads the file and after doing some operations on the backend I send back a list of JSON Object.And I have generated a material table to show the contents, now what's happening is that my material table dataSource doesn't get updated. Like when I upload the file and I am viewing the... | 2020/06/06 | [
"https://Stackoverflow.com/questions/62236233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13535767/"
] | Why don't you simple fetch the param ID using match.
Example:
**Your Route**
```
<Route path="/tickets/:id" component={Tickets} />
```
**onClick**
```
this.props.history.push(`/tickets/${rowIndex[0]}`);
```
And then in the Tickets Component, fetch the param Id using match
**Tickets Component**
```
console.lo... | try : `this.props.history.push('/tickets', rowIndex[0]):`
the syntax should be : `push(route, params)` |
62,236,233 | So I have an application, the user uploads the file and after doing some operations on the backend I send back a list of JSON Object.And I have generated a material table to show the contents, now what's happening is that my material table dataSource doesn't get updated. Like when I upload the file and I am viewing the... | 2020/06/06 | [
"https://Stackoverflow.com/questions/62236233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13535767/"
] | Alternatively, if you don't want to show your data in the URL, you can pass it in state:
```
this.props.history.push('/tickets', { data: rowIndex[0] })
```
or
```
this.props.history.push({
pathname: '/tickets',
state: {
data: rowIndex[0],
},
})
```
And in the Component, to get the data:
```
const data ... | You can use 'useHistory' from the library 'react-router-dom'if using functional component.
First initialize as below.
```
const history = useHistory();
```
Then you can call whenever wanted
```
history.push('Path')
```
For example when clicking a button
```
onClick{()=>{history.push('/ticket')}}
``` |
62,236,233 | So I have an application, the user uploads the file and after doing some operations on the backend I send back a list of JSON Object.And I have generated a material table to show the contents, now what's happening is that my material table dataSource doesn't get updated. Like when I upload the file and I am viewing the... | 2020/06/06 | [
"https://Stackoverflow.com/questions/62236233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13535767/"
] | Why don't you simple fetch the param ID using match.
Example:
**Your Route**
```
<Route path="/tickets/:id" component={Tickets} />
```
**onClick**
```
this.props.history.push(`/tickets/${rowIndex[0]}`);
```
And then in the Tickets Component, fetch the param Id using match
**Tickets Component**
```
console.lo... | You can use 'useHistory' from the library 'react-router-dom'if using functional component.
First initialize as below.
```
const history = useHistory();
```
Then you can call whenever wanted
```
history.push('Path')
```
For example when clicking a button
```
onClick{()=>{history.push('/ticket')}}
``` |
62,236,233 | So I have an application, the user uploads the file and after doing some operations on the backend I send back a list of JSON Object.And I have generated a material table to show the contents, now what's happening is that my material table dataSource doesn't get updated. Like when I upload the file and I am viewing the... | 2020/06/06 | [
"https://Stackoverflow.com/questions/62236233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13535767/"
] | Why don't you simple fetch the param ID using match.
Example:
**Your Route**
```
<Route path="/tickets/:id" component={Tickets} />
```
**onClick**
```
this.props.history.push(`/tickets/${rowIndex[0]}`);
```
And then in the Tickets Component, fetch the param Id using match
**Tickets Component**
```
console.lo... | Alternatively, if you don't want to show your data in the URL, you can pass it in state:
```
this.props.history.push('/tickets', { data: rowIndex[0] })
```
or
```
this.props.history.push({
pathname: '/tickets',
state: {
data: rowIndex[0],
},
})
```
And in the Component, to get the data:
```
const data ... |
10,240,489 | I am attempting to create an Activity which contains some TextViews at the top and then two Fragments below, side to side. The left Fragment contains a LinearLayout with clickable TextViews which are used to allow the user to determine which Fragment is displayed on the right. How can I reserve the Fragment space on th... | 2012/04/20 | [
"https://Stackoverflow.com/questions/10240489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/423519/"
] | A work around in my opinion is making the unwanted fragments invisible.
Like below,
```
<LinearLayout>
<FrameLyout>
//fragment 1 here
</FrameLyout>
<FrameLyout>
//fragment 2 here
</FrameLyout>
</LinearLayout>
```
Now you can hide the fragment by making it's parent frame layout ... | Just add a layout to your xml to act as a container for the fragments.
```
<LinearLayout ...>
<!-- Dynamic fragments go here -->
</LinearLayout>
``` |
1,244,713 | I have a 2048 bits RSA privateKey.pem and I see it has already generated few 1024 bits certificate requests starting:
```
-----BEGIN CERTIFICATE REQUEST-----
-----END CERTIFICATE REQUEST-----
```
I thought it was not possible to generate 1024 bits certificates from a 2048 bits private key. So I got confirmed [here:... | 2017/08/26 | [
"https://superuser.com/questions/1244713",
"https://superuser.com",
"https://superuser.com/users/765410/"
] | You must have been mistaken when you thought those CSRs contained a 1024-bit public key that matched the fingerprint of a 2048-bit key pair.
When you generate a key pair, both keys in the pair are always the same length. The crypto algorithms wouldn't work otherwise.
After generating a key pair, one key is deemed t... | It looks like you are using two different keys. I'm guessing you crossed your wires somewhere along the lines when you were preparing your request.
If we take your private key and convert it to a public key, then we can see the modulus in the private key (and public key we converted) does not match the modulus in the ... |
18,553,310 | I am stuck on a problem in Skiena's Design on Algorithms.I don't know if my solution is right.
5-18. Consider a set of movies M\_1, M\_2,.. M\_k. There is a set of customers, each one of which indicates the two movies they would like to see this weekend. Movies are shown on Saturday evening and Sunday evening. Multipl... | 2013/08/31 | [
"https://Stackoverflow.com/questions/18553310",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2177314/"
] | Create a graph from movies M1, M2, ..., Mk. If Mi and Mj is indicated by a customer, we put an edge between Mi and Mj. Repeat this for all customers. Then use two-color algorithm to bipartite movies into two sets, one is Saturday and the other is Sunday. | The question mentions that we can show movies at the same time. Take two sets Sat and Sun. For each customer check if the movies he want to see are in different sets, if they aren't put one at random in Sat and one in Sun and continue. In case they are in the same set, put any one of them in the other Set. In worst cas... |
4,891,380 | I have a list like this:
```
<ul id="recipes">
<li><a href='xxx'>Apple Pie</a></li>
<li><a href='xxx'>Almond Slice</a></li>
<li><a href='xxx'>Banana Cake</a></li>
<li><a href='xxx'>Carrot Cake</a></li>
</ul>
```
That I need to convert to a list grouped alphabetically like this:
```
<h3>A<h3>
<ul>
<li><a href='xxx'>... | 2011/02/03 | [
"https://Stackoverflow.com/questions/4891380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/24109/"
] | How about something like this?
```
var headings = 'abcdefghijklmnopqrstuvwxyz';
var $recipes = $('#recipes').detach();
$.each(headings, function(){
$('body').append('<h3>' + this + '</h3>');
$('body').append($('<ul/>').append($recipes.find('.' + this)));
});
```
example on [jsfiddle](http://jsfiddle.net/Y8k... | Another solution I figured out which works similarly:
```
var letters = [ "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z" ];
$.each(letters, function(idx,val) {
$("li." + val).wrapAll("<div><h3>" + val.toUpperCase() + "</h3><ul></ul></div>");
});
``` |
136,256 | Google Analytics use some query parameters to identify campaigns and to do cookie control. This is all handled by javascript code. Take a look at the following example:
```
http://www.example.com/?utm_source=newsletter&utm_medium=email&utm_ter m=October%2B2008&utm_campaign=promotion
```
This will set cookies via Jav... | 2010/04/27 | [
"https://serverfault.com/questions/136256",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | Fiddling with the cache is not the right way to go about this.
The "right" way to handle URLs with this sort of tracking is to send a 301 redirect to your canonical URL (after actually doing any necessary tracking, of course). | Not sure I entirely follow you, but:
With squid I believe you would create a url regex ACL and then use the cache directive to tell it not to cache those requests. |
136,256 | Google Analytics use some query parameters to identify campaigns and to do cookie control. This is all handled by javascript code. Take a look at the following example:
```
http://www.example.com/?utm_source=newsletter&utm_medium=email&utm_ter m=October%2B2008&utm_campaign=promotion
```
This will set cookies via Jav... | 2010/04/27 | [
"https://serverfault.com/questions/136256",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | Fiddling with the cache is not the right way to go about this.
The "right" way to handle URLs with this sort of tracking is to send a 301 redirect to your canonical URL (after actually doing any necessary tracking, of course). | In varnish, in the vcl\_recv function
```
set req.url = regsub(req.url, "\?.*", "");
```
You would really need to evaluate whether you wanted to do that though. If it is served from Varnish rather than your backend, are you altering any of your stat collection processes? |
43,950,910 | I want to define some of my configuration in one file.
I want to put in `config/app.php` `define("PATH", "path/to/uploaded/files");`
and use it in `config/filesystems`
```
'local' => [
'driver' => 'local',
'root' => PATH,
],
``` | 2017/05/13 | [
"https://Stackoverflow.com/questions/43950910",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1846087/"
] | It's a bad idea to put this data into `app.php` and then use it in `filesystems.php`. You should add PATH to the [`.env` file](https://laravel.com/docs/5.4/configuration#environment-configuration), because PATH will be different for each machine:
```
PATH=path/to/uploaded/files
```
And then use this variable in the ... | Certainly you can , in your config/filesystems just include /config/app.php, then you can use variables defied in config/app.php like they are in config/filesystems. |
63,101,866 | I am writing a `Rest` application using `Spring-Boot`, `MVC`, `Jpa (Hibernate)`. I have reference classes that store, for example, the names of `countries`, `manufacturers`, `types of coffee`, etc. They all inherit from `GeneralCatalog` via inheritance *@MappedSuperClass*. It turns out to be too much code and interface... | 2020/07/26 | [
"https://Stackoverflow.com/questions/63101866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12091152/"
] | i made methods to make simple jpa things, you can see more at <https://github.com/fajaralmu/base_web_app>
example :
```
public List<Page> getAllPages() {
List<Page> allPages = entityRepository.findAll(Page.class);
return allPages;
}
```
[.list()` |
856,780 | I am learning plug able architecture in .Net using Managed Extensibility Framework (MEF.)
I saw sample code on the net, but when I tried to implement it I got stuck at one point.
The code was using:
```
var catalog = new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
var container = new Composition... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/101314/"
] | Variables in C# are still strongly typed. `var` is implicit typing - see the [MSDN](http://msdn.microsoft.com/en-us/library/bb383973.aspx).
In most cases it just means you have to type less, but there are cases where it's necessary - in the second example on the page I've linked to:
>
> `var` must be used because th... | MEF uses LINQ, so it requires .NET 3.5. You won't have any luck trying to use it on .NET 2.0. |
856,780 | I am learning plug able architecture in .Net using Managed Extensibility Framework (MEF.)
I saw sample code on the net, but when I tried to implement it I got stuck at one point.
The code was using:
```
var catalog = new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
var container = new Composition... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/101314/"
] | This is the use of type inference in C# 3.0.
When using the keyword
```
var
```
in c# 3.0 the compiler infers the type. See [scott guthries explanation](http://weblogs.asp.net/scottgu/archive/2007/05/15/new-orcas-language-feature-anonymous-types.aspx)
In c# 2.0 you have to declare the type of the variable the sam... | Variables in C# are still strongly typed. `var` is implicit typing - see the [MSDN](http://msdn.microsoft.com/en-us/library/bb383973.aspx).
In most cases it just means you have to type less, but there are cases where it's necessary - in the second example on the page I've linked to:
>
> `var` must be used because th... |
856,780 | I am learning plug able architecture in .Net using Managed Extensibility Framework (MEF.)
I saw sample code on the net, but when I tried to implement it I got stuck at one point.
The code was using:
```
var catalog = new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
var container = new Composition... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/101314/"
] | Variables in C# are still strongly typed. `var` is implicit typing - see the [MSDN](http://msdn.microsoft.com/en-us/library/bb383973.aspx).
In most cases it just means you have to type less, but there are cases where it's necessary - in the second example on the page I've linked to:
>
> `var` must be used because th... | *var* is a C# 3.0 keyword and does nothing other than inferring the strong type from the initialization value.
In the absence of var, you manually do what the compiler is doing behind the scenes; you specify the type of the variable in the declaration.
Hence;
```
AttributedAssemblyPartCatalog catalog = new
Attr... |
856,780 | I am learning plug able architecture in .Net using Managed Extensibility Framework (MEF.)
I saw sample code on the net, but when I tried to implement it I got stuck at one point.
The code was using:
```
var catalog = new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
var container = new Composition... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/101314/"
] | Basically, `var` forces the compiler to determine (infer) the *compile-time* type of a variable based on it's "initializer" -- effectively, an expression to the right from `=` sign. Here the types are obvious:
```
AttributedAssemblyPartCatalog catalog =
new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssem... | This is the use of type inference in C# 3.0.
When using the keyword
```
var
```
in c# 3.0 the compiler infers the type. See [scott guthries explanation](http://weblogs.asp.net/scottgu/archive/2007/05/15/new-orcas-language-feature-anonymous-types.aspx)
In c# 2.0 you have to declare the type of the variable the sam... |
856,780 | I am learning plug able architecture in .Net using Managed Extensibility Framework (MEF.)
I saw sample code on the net, but when I tried to implement it I got stuck at one point.
The code was using:
```
var catalog = new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
var container = new Composition... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/101314/"
] | ```
AttributedAssemblyPartCatalog catalog = new
AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
CompositionContainer container = new
CompositionContainer(catalog.CreateResolver());
``` | *var* is a C# 3.0 keyword and does nothing other than inferring the strong type from the initialization value.
In the absence of var, you manually do what the compiler is doing behind the scenes; you specify the type of the variable in the declaration.
Hence;
```
AttributedAssemblyPartCatalog catalog = new
Attr... |
856,780 | I am learning plug able architecture in .Net using Managed Extensibility Framework (MEF.)
I saw sample code on the net, but when I tried to implement it I got stuck at one point.
The code was using:
```
var catalog = new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
var container = new Composition... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/101314/"
] | ```
AttributedAssemblyPartCatalog catalog = new
AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
CompositionContainer container = new
CompositionContainer(catalog.CreateResolver());
``` | MEF uses LINQ, so it requires .NET 3.5. You won't have any luck trying to use it on .NET 2.0. |
856,780 | I am learning plug able architecture in .Net using Managed Extensibility Framework (MEF.)
I saw sample code on the net, but when I tried to implement it I got stuck at one point.
The code was using:
```
var catalog = new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
var container = new Composition... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/101314/"
] | Basically, `var` forces the compiler to determine (infer) the *compile-time* type of a variable based on it's "initializer" -- effectively, an expression to the right from `=` sign. Here the types are obvious:
```
AttributedAssemblyPartCatalog catalog =
new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssem... | Variables in C# are still strongly typed. `var` is implicit typing - see the [MSDN](http://msdn.microsoft.com/en-us/library/bb383973.aspx).
In most cases it just means you have to type less, but there are cases where it's necessary - in the second example on the page I've linked to:
>
> `var` must be used because th... |
856,780 | I am learning plug able architecture in .Net using Managed Extensibility Framework (MEF.)
I saw sample code on the net, but when I tried to implement it I got stuck at one point.
The code was using:
```
var catalog = new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
var container = new Composition... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/101314/"
] | This is the use of type inference in C# 3.0.
When using the keyword
```
var
```
in c# 3.0 the compiler infers the type. See [scott guthries explanation](http://weblogs.asp.net/scottgu/archive/2007/05/15/new-orcas-language-feature-anonymous-types.aspx)
In c# 2.0 you have to declare the type of the variable the sam... | MEF uses LINQ, so it requires .NET 3.5. You won't have any luck trying to use it on .NET 2.0. |
856,780 | I am learning plug able architecture in .Net using Managed Extensibility Framework (MEF.)
I saw sample code on the net, but when I tried to implement it I got stuck at one point.
The code was using:
```
var catalog = new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
var container = new Composition... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/101314/"
] | Basically, `var` forces the compiler to determine (infer) the *compile-time* type of a variable based on it's "initializer" -- effectively, an expression to the right from `=` sign. Here the types are obvious:
```
AttributedAssemblyPartCatalog catalog =
new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssem... | *var* is a C# 3.0 keyword and does nothing other than inferring the strong type from the initialization value.
In the absence of var, you manually do what the compiler is doing behind the scenes; you specify the type of the variable in the declaration.
Hence;
```
AttributedAssemblyPartCatalog catalog = new
Attr... |
856,780 | I am learning plug able architecture in .Net using Managed Extensibility Framework (MEF.)
I saw sample code on the net, but when I tried to implement it I got stuck at one point.
The code was using:
```
var catalog = new AttributedAssemblyPartCatalog(Assembly.GetExecutingAssembly());
var container = new Composition... | 2009/05/13 | [
"https://Stackoverflow.com/questions/856780",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/101314/"
] | This is the use of type inference in C# 3.0.
When using the keyword
```
var
```
in c# 3.0 the compiler infers the type. See [scott guthries explanation](http://weblogs.asp.net/scottgu/archive/2007/05/15/new-orcas-language-feature-anonymous-types.aspx)
In c# 2.0 you have to declare the type of the variable the sam... | *var* is a C# 3.0 keyword and does nothing other than inferring the strong type from the initialization value.
In the absence of var, you manually do what the compiler is doing behind the scenes; you specify the type of the variable in the declaration.
Hence;
```
AttributedAssemblyPartCatalog catalog = new
Attr... |
63,620,309 | How can I get second largest column value and its name?
My current query gives it mostly correct but in cases where largest and second largest values are same I am getting wrong values.
```sql
select item_code, A, B, C,
greatest(A, B, C) as largest1,
greatest(case when largest1 = A then 0 else A... | 2020/08/27 | [
"https://Stackoverflow.com/questions/63620309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2641569/"
] | It sounds like what you need here is a derived "users that have non-empty SSH keys" map. You can use the `if` clause of a [`for` expression](https://www.terraform.io/docs/language/expressions/for.html) to derive a new collection from an existing one while filtering out some of the elements:
```
resource "aws_iam_user_... | You can use a for loop to exclude those blanks.
For example, you can do it on local:
```
variable "users" {
default = {
"testterform" = {
path = "/"
force_destroy = true
tags = { department : "test" }
ssh_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAA4l7"
}
"test... |
14,114,843 | My program is having some methods and some of them are call some other methods my problem is that i want to use some data that a method is generating in a previous method and i dont know how im supposed to do that.
```
namespace MyProg
{
public partial class MyProg: Form
{
public static void method1(stri... | 2013/01/01 | [
"https://Stackoverflow.com/questions/14114843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1059912/"
] | Just use return values:
```
public partial class MyProg: Form
{
public static void method1(string text)
{
string letter = method2("some text");
// Here i want to use the value from string letter from method2.
}
public static string method2(string text)
{
string letter = "A"; ... | You can either store the value in a member variable of the class (which in this case must be static since the method referring to it is static), or you can return the value from method2, and call method2 from inside method1 where you want to use it.
I'll leave it up to you to figure out how to code it. |
6,333,822 | I'm a little confused on the difference between IntentService and Service. I understand that IntentService has a worker queue, but is there any benefit to using multiple IntentService over one Service?
Here's an example of what I mean. Let's say I want my application to pull data from 3 sources. Should I start a servi... | 2011/06/13 | [
"https://Stackoverflow.com/questions/6333822",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/667769/"
] | IntentService is just a convenient class to write services that are workers in the producer-consumer pattern. They are services designed to execute various tasks in a row and then stop. Services are not necessarily IntentServices such as services that must stay alive such as daemons.
So you should wonder if you servic... | Its my understanding that the difference between intentService and Service is that an intentService will spawn a worker thread to run it, while a Service runs in the main thread of it's hosting process. In addition, an intentService will stop itself when the work is done, while a Service will continue running until sto... |
6,333,822 | I'm a little confused on the difference between IntentService and Service. I understand that IntentService has a worker queue, but is there any benefit to using multiple IntentService over one Service?
Here's an example of what I mean. Let's say I want my application to pull data from 3 sources. Should I start a servi... | 2011/06/13 | [
"https://Stackoverflow.com/questions/6333822",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/667769/"
] | IntentService is just a convenient class to write services that are workers in the producer-consumer pattern. They are services designed to execute various tasks in a row and then stop. Services are not necessarily IntentServices such as services that must stay alive such as daemons.
So you should wonder if you servic... | To allow multiple tasks to run at the same time off the main thread, you need to provide a managed collection of threads. Use a ThreadPoolExecutor to manage multiple threads at the same time:
<http://developer.android.com/training/multiple-threads/create-threadpool.html> |
6,333,822 | I'm a little confused on the difference between IntentService and Service. I understand that IntentService has a worker queue, but is there any benefit to using multiple IntentService over one Service?
Here's an example of what I mean. Let's say I want my application to pull data from 3 sources. Should I start a servi... | 2011/06/13 | [
"https://Stackoverflow.com/questions/6333822",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/667769/"
] | Its my understanding that the difference between intentService and Service is that an intentService will spawn a worker thread to run it, while a Service runs in the main thread of it's hosting process. In addition, an intentService will stop itself when the work is done, while a Service will continue running until sto... | To allow multiple tasks to run at the same time off the main thread, you need to provide a managed collection of threads. Use a ThreadPoolExecutor to manage multiple threads at the same time:
<http://developer.android.com/training/multiple-threads/create-threadpool.html> |
6,907 | I would like to insert a clearfix div after every third category listing. I have used this method successfully when outputting from `{exp:channel:entries}` tag pairs, but it appears that the `{switch}` variable is not available for `{exp:channel:categories}` tag pairs.
Is there another way to accomplish this (perhaps... | 2013/03/01 | [
"https://expressionengine.stackexchange.com/questions/6907",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/496/"
] | The [**GWcode Alternate addon**](http://devot-ee.com/add-ons/gwcode-alternate) will accomplish what you need.
>
> This simple plugin for ExpressionEngine 1 and 2 lets you rotate
> through any number of values to create alternations, for CSS classes
> for example.
>
>
> You can use this plugin to rotate through an... | If you know the exact number of categories that will be displayed, you can use conditionals in combination with the {count} variable. |
6,907 | I would like to insert a clearfix div after every third category listing. I have used this method successfully when outputting from `{exp:channel:entries}` tag pairs, but it appears that the `{switch}` variable is not available for `{exp:channel:categories}` tag pairs.
Is there another way to accomplish this (perhaps... | 2013/03/01 | [
"https://expressionengine.stackexchange.com/questions/6907",
"https://expressionengine.stackexchange.com",
"https://expressionengine.stackexchange.com/users/496/"
] | The [**GWcode Alternate addon**](http://devot-ee.com/add-ons/gwcode-alternate) will accomplish what you need.
>
> This simple plugin for ExpressionEngine 1 and 2 lets you rotate
> through any number of values to create alternations, for CSS classes
> for example.
>
>
> You can use this plugin to rotate through an... | I see this has already been answered, but there is a jQuery option that might be better for you. At least it won't matter how many categories there are:
```
$('.selector:nth-child(3n)').after($('<div />').addClass('clearfix'));
```
This will select every 3rd element that matches `.selector` and insert `<div class="c... |
52,178,831 | Hi guys am facing the issue that in bootstarp modal when i click submit button or form it not insert the data in database but using the ok button in form i need to submit the data into database at time the bootstrap modal should close automatically.any help thanks in advance guys.
code:
```
<button type="button" cla... | 2018/09/05 | [
"https://Stackoverflow.com/questions/52178831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9196406/"
] | Yes you can do it in O(n) time using a [Suffix tree](https://en.wikipedia.org/wiki/Suffix_tree), in particular see the [generalized suffix tree](https://en.wikipedia.org/wiki/Suffix_tree#Generalized_suffix_tree). You first create the Suffix tree of all the keys, after that you can iterate over each key and for each one... | This is probably a bit better than O(n^2) but big O notation is not my strong suit. Have a look:
```
count_dict = {
'apple':2,
'pie': 1,
'pi':1,
'applepie':1
}
keys = list(count_dict.keys())
res_dict = {}
for i, k1 in enumerate(keys):
res_dict[k1] = res_dict.setdefault(k1, count_dict[k1])
for ... |
46,362,251 | Let's say I have a `Basket` model and I want to validate that no more than `5` `Item`s can be added to it:
```
class Basket(models.Model):
items = models.ManyToManyField('Item')
def save(self, *args, **kwargs):
self.full_clean()
super(Basket, self).save(*args, **kwargs)
def clean(self):
... | 2017/09/22 | [
"https://Stackoverflow.com/questions/46362251",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3120489/"
] | You can *never* validate relationships in the clean method of the model. This is because at clean time, the model may not yet exist, as is the case with your Basket. Something that does not exist, can also not have relationships.
You either need to do your validation on the [form data](https://stackoverflow.com/questi... | I've been discussing this on the Django Developers list and have in fact tabled a method of doing this for consideration in the Django core in one form or another. The method is not fully tested nor finalised but results for now are very encouraging and I'm employing it on a site of mine with success.
In principle it... |
9,706,020 | I’m currently developing an app which supports in-app audio recording. The user can get a standard tableview of locally saved audio files he/she have already recorded through the app, or press a button to go to a new recording view, from where it is possible to record a new audio session, which will automatically get s... | 2012/03/14 | [
"https://Stackoverflow.com/questions/9706020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/532939/"
] | Before the recording is started an audio session should be initialized:
```
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *err = nil;
[audioSession setCategory :AVAudioSessionCategoryPlayAndRecord error:&err];
if(err){
NSLog(@"audioSession: %@ %d %@", [err domain], [err code], [[err userIn... | Is contentURL always the same or do you generate a new one each time?
Also could you try explicitly calling prepareToRecord before record and checking whether it succeeds or not? |
46,555,065 | Here is the critical logic of my codebase:
```
addLogicToEquation(newLogic) {
let equation = this.state.equation
console.log(parseFloat(equation))
if(newLogic==="10%"){
let newEquation = Number(equation) + (Number(equation) * 0.10)
console.log(newEquation)
this.setState({equation: Num... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46555065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3787253/"
] | You could use the same method as in the link
[Excel VBA Performance - 1 million rows - Delete rows containing a value, in less than 1 min](https://stackoverflow.com/questions/30959315/excel-vba-performance-1-million-rows-delete-rows-containing-a-value-in-less?rq=1)
---
The code bellow (Module 2) sets up test data - ... | I think your biggest performance anchor is that you're deleting so frequently and Excel is having to move around so much data. You might consider clearing contents first and/or using a UNION function to do the delete all in one effort. So here's an example of how both approaches would be written:
```
Sub UnionExample(... |
46,555,065 | Here is the critical logic of my codebase:
```
addLogicToEquation(newLogic) {
let equation = this.state.equation
console.log(parseFloat(equation))
if(newLogic==="10%"){
let newEquation = Number(equation) + (Number(equation) * 0.10)
console.log(newEquation)
this.setState({equation: Num... | 2017/10/03 | [
"https://Stackoverflow.com/questions/46555065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3787253/"
] | You could use the same method as in the link
[Excel VBA Performance - 1 million rows - Delete rows containing a value, in less than 1 min](https://stackoverflow.com/questions/30959315/excel-vba-performance-1-million-rows-delete-rows-containing-a-value-in-less?rq=1)
---
The code bellow (Module 2) sets up test data - ... | Using [The SpreadSheetGuru's Timer](https://www.thespreadsheetguru.com/the-code-vault/2015/1/28/vba-calculate-macro-run-time) I removed a total of 1,599,992 from 4 Worksheets in 13.53 seconds.
[](https://i.stack.imgur.com/ArKiO.png)[![enter image desc... |
33,136,411 | I need to create custom directive
```
<my-input id="myInputElementId1"
label="My Label 1"
ng-model="myInputElementModel1"
ng-change="resetFormFieldErrors(form.myInputElementId1)"
ng-required="true"></my-input>
```
which should work like the following:
```
<div>
<label for... | 2015/10/14 | [
"https://Stackoverflow.com/questions/33136411",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/384365/"
] | I believe you'll need to call `$eval` on the parent scope, so something like `scope.$parent.$eval();`
This is necessary because the `scope` in your directive creates an isolated scope, but `attrs.ngChange` is referencing the parent scope. | Not sure what exactly your intention to use scope.$eval, instead I would suggest you the following way which would be the most appropriate way to do based on your above requirement.
```
module.exports =
function myInput() {
return {
require: "ngModel",
scope: {
model... |
40,765,596 | I am using maven-scr-plugin to generate component and metatype descriptions. I am migrating from org.apache.felix.scr annotations to org.osgi.service.component annotations.
Carsten Ziegeler has written an excellent blog on how to do this migration [here](http://blog.osoco.de/2016/05/migrating-from-the-apache-felix-sc... | 2016/11/23 | [
"https://Stackoverflow.com/questions/40765596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2878204/"
] | Metatype is generated when you use the `@Designate` annotation. (At least in the bnd implementation.)
```
@Designate( ocd=Config.class, factory=true )
@Component
public class SomeComponent {
@ObjectClassDefinition
@interface Config {
int port();
}
@Activate
void activate( Config config) {... | As far as I know you need a separate configuration @interface for each component. It is also not possible to generate the meta type from the @Component annotations as they do not describe configurations. |
41,829,195 | `ExecutingMethodName` is intended to print the method name of the caller. For example:
* `static void Main(string[] args){Auxiliary.ExecutingMethodName();}` should print Main.
* `static void Foo(){Auxiliary.ExecutingMethodName();}` should print Foo.
```
static class Auxiliary
{
public static void ExecutingMethodN... | 2017/01/24 | [
"https://Stackoverflow.com/questions/41829195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/397524/"
] | Just change 0 to 1 in stackframe call in your method (`StackFrame(0)` is your currrent position in call stack and you need to go one step back):
```
public static void ExecutingMethodName()
{
Console.WriteLine(new StackFrame(1).GetMethod().Name);
}
``` | Use the below code. You have to use `StackFrame(1)`, `StackFrame(2)` will always be the `ExecutingMethodName`, actually you have to print the caller of `ExecutingMethodName`.
```
public static void ExecutingMethodName()
{
Console.WriteLine(new StackFrame(1).GetMethod().Name);
}
```
You ca... |
41,829,195 | `ExecutingMethodName` is intended to print the method name of the caller. For example:
* `static void Main(string[] args){Auxiliary.ExecutingMethodName();}` should print Main.
* `static void Foo(){Auxiliary.ExecutingMethodName();}` should print Foo.
```
static class Auxiliary
{
public static void ExecutingMethodN... | 2017/01/24 | [
"https://Stackoverflow.com/questions/41829195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/397524/"
] | Just change 0 to 1 in stackframe call in your method (`StackFrame(0)` is your currrent position in call stack and you need to go one step back):
```
public static void ExecutingMethodName()
{
Console.WriteLine(new StackFrame(1).GetMethod().Name);
}
``` | You have to skip the first entry in the stack frame (which belongs to `ExecutingMethodName`):
```
public static void ExecutingMethodName()
{
Console.WriteLine(new StackFrame(1).GetMethod().Name);
}
``` |
41,829,195 | `ExecutingMethodName` is intended to print the method name of the caller. For example:
* `static void Main(string[] args){Auxiliary.ExecutingMethodName();}` should print Main.
* `static void Foo(){Auxiliary.ExecutingMethodName();}` should print Foo.
```
static class Auxiliary
{
public static void ExecutingMethodN... | 2017/01/24 | [
"https://Stackoverflow.com/questions/41829195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/397524/"
] | Just change 0 to 1 in stackframe call in your method (`StackFrame(0)` is your currrent position in call stack and you need to go one step back):
```
public static void ExecutingMethodName()
{
Console.WriteLine(new StackFrame(1).GetMethod().Name);
}
``` | Use the [CallerMemberNameAttribute](https://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.callermembernameattribute(v=vs.110).aspx) instead using something from the stackframe. Much cleaner way.
```
public static void ExecutingMethodName([CallerMemberName]string callerName= null)
{
Console.Write... |
138,162 | I manage a team of software developers. I have an employee who is unusually antisocial. It's not just that he's quiet, he won't even nod to you if you pass him in the hall. On the other hand, he is extremely productive. He's been with us for a few years and it's not an exaggeration to say that he does the work of three... | 2019/06/08 | [
"https://workplace.stackexchange.com/questions/138162",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/68680/"
] | **Non-expert opinion:**
Be direct about wanting to keep him and your willingness to be supportive. Don't address the worrying behaviour directly.
This allows you to communicate the information quickly, clearly, and with minimum fuss.
Something like...
>
> "Hi, I've brought you in for a quick one on one because we ... | Is there actually a problem for your company? He is "snippy" and "seems unhappy", but is that actually a problem? People are unhappy sometimes. He might be snippy and unhappy because his cat died. There is no indication that he is unhappy with his work.
If he has a problem that is in no way work related, and you try ... |
138,162 | I manage a team of software developers. I have an employee who is unusually antisocial. It's not just that he's quiet, he won't even nod to you if you pass him in the hall. On the other hand, he is extremely productive. He's been with us for a few years and it's not an exaggeration to say that he does the work of three... | 2019/06/08 | [
"https://workplace.stackexchange.com/questions/138162",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/68680/"
] | Is there actually a problem for your company? He is "snippy" and "seems unhappy", but is that actually a problem? People are unhappy sometimes. He might be snippy and unhappy because his cat died. There is no indication that he is unhappy with his work.
If he has a problem that is in no way work related, and you try ... | >
> "Do you feel too much is being expected from you? I really don't know you, but it seems to me your productivity is off the charts. So I'm actually concerned, really just guessing for the moment, that it will be very tough, and even unnecessary, to keep up that pace for the long term.
>
>
> So if this, or somethi... |
138,162 | I manage a team of software developers. I have an employee who is unusually antisocial. It's not just that he's quiet, he won't even nod to you if you pass him in the hall. On the other hand, he is extremely productive. He's been with us for a few years and it's not an exaggeration to say that he does the work of three... | 2019/06/08 | [
"https://workplace.stackexchange.com/questions/138162",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/68680/"
] | **Non-expert opinion:**
Be direct about wanting to keep him and your willingness to be supportive. Don't address the worrying behaviour directly.
This allows you to communicate the information quickly, clearly, and with minimum fuss.
Something like...
>
> "Hi, I've brought you in for a quick one on one because we ... | >
> "Do you feel too much is being expected from you? I really don't know you, but it seems to me your productivity is off the charts. So I'm actually concerned, really just guessing for the moment, that it will be very tough, and even unnecessary, to keep up that pace for the long term.
>
>
> So if this, or somethi... |
138,162 | I manage a team of software developers. I have an employee who is unusually antisocial. It's not just that he's quiet, he won't even nod to you if you pass him in the hall. On the other hand, he is extremely productive. He's been with us for a few years and it's not an exaggeration to say that he does the work of three... | 2019/06/08 | [
"https://workplace.stackexchange.com/questions/138162",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/68680/"
] | **Non-expert opinion:**
Be direct about wanting to keep him and your willingness to be supportive. Don't address the worrying behaviour directly.
This allows you to communicate the information quickly, clearly, and with minimum fuss.
Something like...
>
> "Hi, I've brought you in for a quick one on one because we ... | You're probably correct that he doesn't want to talk about whatever it is. But that doesn't mean you can't still broach the topic. Just be careful not to pry, and be as supportive as you can be.
* Thank him for his stellar work.
* Tell him that you noticed a recent change in his behaviour. (He probably realizes people... |
138,162 | I manage a team of software developers. I have an employee who is unusually antisocial. It's not just that he's quiet, he won't even nod to you if you pass him in the hall. On the other hand, he is extremely productive. He's been with us for a few years and it's not an exaggeration to say that he does the work of three... | 2019/06/08 | [
"https://workplace.stackexchange.com/questions/138162",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/68680/"
] | You're probably correct that he doesn't want to talk about whatever it is. But that doesn't mean you can't still broach the topic. Just be careful not to pry, and be as supportive as you can be.
* Thank him for his stellar work.
* Tell him that you noticed a recent change in his behaviour. (He probably realizes people... | >
> "Do you feel too much is being expected from you? I really don't know you, but it seems to me your productivity is off the charts. So I'm actually concerned, really just guessing for the moment, that it will be very tough, and even unnecessary, to keep up that pace for the long term.
>
>
> So if this, or somethi... |
227,054 | [The definition of ABtest](https://en.wikipedia.org/wiki/A/B_testing)
Goal:
For input data, each pair row is a group such as 0 and 1, 2 and 3. I want to test whether each group is significant using chi-square.
* If result is significant and any value in group is more than or equals 5 , it returns p-value, else it r... | 2019/08/29 | [
"https://codereview.stackexchange.com/questions/227054",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/157955/"
] | The question could benefit from some context. You don't need to answer every one of the following, but it would be helpful for reviewers.
1. Why have you written a morse code converter?
2. Is this going to be used by anyone else or is it a personal project? Is it a homework question? From this we can tell if the revie... | ```
if __name__ == '__main__':
```
use this guard that allows you to import from this script without running the code.
```
if __name__ == '__main__':
print(convert_to_morse_code('HI MICHAEL'))
print(convert_to_word('.... .. -- .. -.-. .... .- . .-..'))
```
Style
=====
check PEP0008 <https://www.python.o... |
8,082,318 | Hello i am trying to run the sample app from link bellow
<https://github.com/pangyre/apv>
it uses c libraries to read pdf file
but i am facing the following error
```
java.lang.UnsatisfiedLinkError: Library pdfview2 not found
```
please tell me if there is any other settings in eclipse to use native libraries
... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8082318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/782299/"
] | <https://www.alljoyn.org/forums/developers/unsatisfied-link-error-android-221-device-emulator#comment-745>
please click the link and follow the procedure.
before that i have the same error.now i got the output.try this.there is a problem in android native compiler. | I used the same library in an Android app. And i got the same error.
As far as I remember the mistake was that I renamed the packages in the Java code. I also had to rename the native methods in the C code to match the new package.
Did you rename the package? |
8,082,318 | Hello i am trying to run the sample app from link bellow
<https://github.com/pangyre/apv>
it uses c libraries to read pdf file
but i am facing the following error
```
java.lang.UnsatisfiedLinkError: Library pdfview2 not found
```
please tell me if there is any other settings in eclipse to use native libraries
... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8082318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/782299/"
] | \*\*apv0.3dev13.tar.xz pdf viewer source code problem:
native code library coulndt not load:\*\*
```
Thread [<3> main] (Suspended (exception UnsatisfiedLinkError))
Runtime.loadLibrary(String, ClassLoader) line: 489
System.loadLibrary(String) line: 557
PDF.<clinit>() line: 15
OpenFileActivity.... | I used the same library in an Android app. And i got the same error.
As far as I remember the mistake was that I renamed the packages in the Java code. I also had to rename the native methods in the C code to match the new package.
Did you rename the package? |
8,082,318 | Hello i am trying to run the sample app from link bellow
<https://github.com/pangyre/apv>
it uses c libraries to read pdf file
but i am facing the following error
```
java.lang.UnsatisfiedLinkError: Library pdfview2 not found
```
please tell me if there is any other settings in eclipse to use native libraries
... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8082318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/782299/"
] | <https://www.alljoyn.org/forums/developers/unsatisfied-link-error-android-221-device-emulator#comment-745>
please click the link and follow the procedure.
before that i have the same error.now i got the output.try this.there is a problem in android native compiler. | Open up a terminal / command prompt. Navigate to the root of your Android project. Run ndk-build.
For more information please visit <http://developer.android.com/tools/sdk/ndk/index.html> |
8,082,318 | Hello i am trying to run the sample app from link bellow
<https://github.com/pangyre/apv>
it uses c libraries to read pdf file
but i am facing the following error
```
java.lang.UnsatisfiedLinkError: Library pdfview2 not found
```
please tell me if there is any other settings in eclipse to use native libraries
... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8082318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/782299/"
] | \*\*apv0.3dev13.tar.xz pdf viewer source code problem:
native code library coulndt not load:\*\*
```
Thread [<3> main] (Suspended (exception UnsatisfiedLinkError))
Runtime.loadLibrary(String, ClassLoader) line: 489
System.loadLibrary(String) line: 557
PDF.<clinit>() line: 15
OpenFileActivity.... | Open up a terminal / command prompt. Navigate to the root of your Android project. Run ndk-build.
For more information please visit <http://developer.android.com/tools/sdk/ndk/index.html> |
3,009,533 | I downloaded the latest version of Boost and I'm trying to get the Boost.python tutorial up and running on Ubuntu 10.04: <http://www.boost.org/doc/libs/1_43_0/libs/python/doc/tutorial/doc/html/python/hello.html>
I navigated to the correct directory, ran "bjam" and it compiled using default settings. I did not yet crea... | 2010/06/09 | [
"https://Stackoverflow.com/questions/3009533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234933/"
] | I have no experience with the the Boost Python libraries but as the error states, it is unable to find the libboost\_python shared object.
You have several options here (there may be more):
1. Place the .so in /usr/local/lib.
2. Place the .so in /usr/lib. This is probably a bad idea.
3. Run `export LD_LIBRARY_PATH=/p... | Did you install boost? Just compiling it isn't sufficient to install the libraries where they need to be to run programs. |
3,009,533 | I downloaded the latest version of Boost and I'm trying to get the Boost.python tutorial up and running on Ubuntu 10.04: <http://www.boost.org/doc/libs/1_43_0/libs/python/doc/tutorial/doc/html/python/hello.html>
I navigated to the correct directory, ran "bjam" and it compiled using default settings. I did not yet crea... | 2010/06/09 | [
"https://Stackoverflow.com/questions/3009533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234933/"
] | How did you install boost ?
Assuming you have use the following: <http://www.boost.org/doc/libs/1_43_0/more/getting_started/unix-variants.html#easy-build-and-install>
liboost\_python shard library will be install in /usr/local/lib
To run the hello.py example, try the following:
```
LD_LIBRARY_PATH=/usr/local/lib pyt... | Did you install boost? Just compiling it isn't sufficient to install the libraries where they need to be to run programs. |
3,009,533 | I downloaded the latest version of Boost and I'm trying to get the Boost.python tutorial up and running on Ubuntu 10.04: <http://www.boost.org/doc/libs/1_43_0/libs/python/doc/tutorial/doc/html/python/hello.html>
I navigated to the correct directory, ran "bjam" and it compiled using default settings. I did not yet crea... | 2010/06/09 | [
"https://Stackoverflow.com/questions/3009533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/234933/"
] | How did you install boost ?
Assuming you have use the following: <http://www.boost.org/doc/libs/1_43_0/more/getting_started/unix-variants.html#easy-build-and-install>
liboost\_python shard library will be install in /usr/local/lib
To run the hello.py example, try the following:
```
LD_LIBRARY_PATH=/usr/local/lib pyt... | I have no experience with the the Boost Python libraries but as the error states, it is unable to find the libboost\_python shared object.
You have several options here (there may be more):
1. Place the .so in /usr/local/lib.
2. Place the .so in /usr/lib. This is probably a bad idea.
3. Run `export LD_LIBRARY_PATH=/p... |
450,937 | I have a database in which there are company names each matched with the company post code. However there are duplicates since the company names are written multiple ways, like this:
```
Company Name Zip Code
Sabuncu Ltd 55200
Sabuncu L.t.d. 55200
```
I would like to get rid of duplicates and ha... | 2012/07/19 | [
"https://superuser.com/questions/450937",
"https://superuser.com",
"https://superuser.com/users/147081/"
] | The slightly less obvious answer won out-`Cut & Paste`.
`Copy & Paste` created duplicate everything and didn't fix the problem. However, `Cut & Paste` carried all of the associated links to the new location. Got a brief error on a page with linked charts and formulas, but it caught up in a few seconds and showed the ... | you can move sheet whereever you want by Right clicking on sheet name in workbook, click on Move or Copy and don't forget to select create a copy check box |
450,937 | I have a database in which there are company names each matched with the company post code. However there are duplicates since the company names are written multiple ways, like this:
```
Company Name Zip Code
Sabuncu Ltd 55200
Sabuncu L.t.d. 55200
```
I would like to get rid of duplicates and ha... | 2012/07/19 | [
"https://superuser.com/questions/450937",
"https://superuser.com",
"https://superuser.com/users/147081/"
] | The slightly less obvious answer won out-`Cut & Paste`.
`Copy & Paste` created duplicate everything and didn't fix the problem. However, `Cut & Paste` carried all of the associated links to the new location. Got a brief error on a page with linked charts and formulas, but it caught up in a few seconds and showed the ... | There is a new Excel add-on called Power Query that allows you to copy tables.
From the target file, use the Power Query to load from the source file. The add-on will allow you to select which table(s) you wish to select.
Once moved, the Refresh button will read from the original source file, allowing the source file... |
450,937 | I have a database in which there are company names each matched with the company post code. However there are duplicates since the company names are written multiple ways, like this:
```
Company Name Zip Code
Sabuncu Ltd 55200
Sabuncu L.t.d. 55200
```
I would like to get rid of duplicates and ha... | 2012/07/19 | [
"https://superuser.com/questions/450937",
"https://superuser.com",
"https://superuser.com/users/147081/"
] | There is a new Excel add-on called Power Query that allows you to copy tables.
From the target file, use the Power Query to load from the source file. The add-on will allow you to select which table(s) you wish to select.
Once moved, the Refresh button will read from the original source file, allowing the source file... | you can move sheet whereever you want by Right clicking on sheet name in workbook, click on Move or Copy and don't forget to select create a copy check box |
54,844,974 | I've created a `Nuxt` app with Bulma included and would like to access/override the Bulma variables in my `.vue` files. I've followed the instructions [here](https://github.com/tetreault/nuxt-bulma-sass) which seem to match what I found in several other locations but I'm still getting an error when trying to access the... | 2019/02/23 | [
"https://Stackoverflow.com/questions/54844974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/836023/"
] | Okay, I wasn't able to get it working with nuxt-sass-resources-loader but I did get it working with style-resources-module from here <https://github.com/nuxt-community/style-resources-module>. Once I installed style-resources-module, I just added it to my nuxt.config.js modules section and added the appropriate styleRe... | This config options provides to load any scss/sass file that specified by you before other files via webpack. You can interfere webpack config via [these options](https://nuxtjs.org/api/configuration-build#loaders) that provide by nuxt. To experience more sass loader configuration you can check [webpack sass loader sec... |
17,484,964 | I need to assign window.setTimeout to dynamically made GLOBAL vars or objects, something like:
```
$n = 1
var variable[$n] = window.setTimeout( function () { /*somecode*/ },2000)
```
This isn't working.
Also not working:
```
var eval(variable+$n) = window.setTimeout( function () { /*somecode*/ },2000)
```
But ... | 2013/07/05 | [
"https://Stackoverflow.com/questions/17484964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2553066/"
] | You can achieve that like this
```
variable = [];
variable[1] = window.setTimeout( function () { alert('hi') }, 2000);
// This will alert 'hi' in 2 seconds
```
or if you want to be able to call the `setTimeout` like a `function` you can do this
```
variable = [];
variable[1] = function(){ window.setTimeout( f... | **To address a global variable, you should not use `var`**. Using `var` redefines the variable in that scope.
Let me explain to you with a different example:
```
var i = 2;
function show() {
alert(i); // This will show 2
}
```
But in this example:
```
var i = 2;
function show() {
var i = 4; //This defines... |
17,484,964 | I need to assign window.setTimeout to dynamically made GLOBAL vars or objects, something like:
```
$n = 1
var variable[$n] = window.setTimeout( function () { /*somecode*/ },2000)
```
This isn't working.
Also not working:
```
var eval(variable+$n) = window.setTimeout( function () { /*somecode*/ },2000)
```
But ... | 2013/07/05 | [
"https://Stackoverflow.com/questions/17484964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2553066/"
] | You can achieve that like this
```
variable = [];
variable[1] = window.setTimeout( function () { alert('hi') }, 2000);
// This will alert 'hi' in 2 seconds
```
or if you want to be able to call the `setTimeout` like a `function` you can do this
```
variable = [];
variable[1] = function(){ window.setTimeout( f... | Not sure if you want to reference setTimeout or execute setTimeout with code, maybe this will give you an idea:
```
window.myvar = function(){window.setTimeout( function () { alert("hi"); },2000)};
myvar();// will alert hi after 2 seconds
```
if you need to pass a variable:
```
window.myvar = function(message){
w... |
33,341,873 | I have a base controller with the method `OnActionExecuted` which has some code.
I want to move that filter checking on the method `OnActionExecuting`.
Will the change provide any performance issue? | 2015/10/26 | [
"https://Stackoverflow.com/questions/33341873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5375719/"
] | Firstly, (regardless of performance) you should use the [method that is appropriate to your situation](http://forums.asp.net/t/2062472.aspx?Difference%20between%20OnActionExecuted%20and%20OnActionExecuting). If you want execution to be performed before the execution of the action method then use `OnActionExecuting`. If... | No, it's just a metter of when the operations are executed: before or after the action method is invoked |
457,191 | у вас задолженность аренды в 2 месяца. | 2019/12/06 | [
"https://rus.stackexchange.com/questions/457191",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/195501/"
] | ***Из-за сопротивления** напряжение уменьшается по мере удаления от места, где ток попадает в землю.*
Обстоятельственные обороты обособляются факультативно, с учетом влияния различных факторов. См.: [ОБСТОЯТЕЛЬСТВА, ВЫРАЖЕННЫЕ СУЩЕСТВИТЕЛЬНЫМИ](http://old-rozental.ru/punctuatio.php?sid=114#pp114) (Розенталь).
Нераспр... | Здесь минимальная распространённость оборота (ср. "из-за этого") в начале предложения, поэтому обособления (оно в общем случае предложных сочетаний с существительным факультативно, <http://old-rozental.ru/punctuatio.php?sid=114#pp114>) не требуется. |
32,548,753 | I have in each books directory `/books/{book_id}/` a couple of xml documents.
`/books/{book_id}/basic.xml` and `/books/{book_id}/formats.xml`.
First one is
```
<document book_id="{book_id}">
<title>The book</title>
</document>
```
and the second is
```
<document book_id="{book_id}">
<format>... | 2015/09/13 | [
"https://Stackoverflow.com/questions/32548753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1492634/"
] | Maybe stating the obvious, the best approach would be to change the model so the format is in the same document as the title and can be matched by a single query.
If that's not possible, one alternative would be to turn on the uri lexicon in the database configuration (if it's not enabled already).
Assuming that the ... | >
> How can I find all books in /books/ directory with format eq 'a' and title eq *'book'* by one query?
>
>
>
Try:
```
doc('basic.xml')/document[@book_id='X']/title[contains(., 'book')]]
[doc('format.xml')/document[@book_id='X'][format = 'a']
```
The last predicate, if it turns empty, will result in the `title... |
32,548,753 | I have in each books directory `/books/{book_id}/` a couple of xml documents.
`/books/{book_id}/basic.xml` and `/books/{book_id}/formats.xml`.
First one is
```
<document book_id="{book_id}">
<title>The book</title>
</document>
```
and the second is
```
<document book_id="{book_id}">
<format>... | 2015/09/13 | [
"https://Stackoverflow.com/questions/32548753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1492634/"
] | This question is listed as MarkLogic as well as xQuery. For completeness, I have included a MarkLogic solution that is a single statement:
```
let $res := cts:search(doc(), cts:and-query(
(
cts:element-word-query(xs:QName("title"), '*book*', ('wildcarded'))
,
cts:element-attribute-ran... | >
> How can I find all books in /books/ directory with format eq 'a' and title eq *'book'* by one query?
>
>
>
Try:
```
doc('basic.xml')/document[@book_id='X']/title[contains(., 'book')]]
[doc('format.xml')/document[@book_id='X'][format = 'a']
```
The last predicate, if it turns empty, will result in the `title... |
32,548,753 | I have in each books directory `/books/{book_id}/` a couple of xml documents.
`/books/{book_id}/basic.xml` and `/books/{book_id}/formats.xml`.
First one is
```
<document book_id="{book_id}">
<title>The book</title>
</document>
```
and the second is
```
<document book_id="{book_id}">
<format>... | 2015/09/13 | [
"https://Stackoverflow.com/questions/32548753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1492634/"
] | This question is listed as MarkLogic as well as xQuery. For completeness, I have included a MarkLogic solution that is a single statement:
```
let $res := cts:search(doc(), cts:and-query(
(
cts:element-word-query(xs:QName("title"), '*book*', ('wildcarded'))
,
cts:element-attribute-ran... | Maybe stating the obvious, the best approach would be to change the model so the format is in the same document as the title and can be matched by a single query.
If that's not possible, one alternative would be to turn on the uri lexicon in the database configuration (if it's not enabled already).
Assuming that the ... |
32,548,753 | I have in each books directory `/books/{book_id}/` a couple of xml documents.
`/books/{book_id}/basic.xml` and `/books/{book_id}/formats.xml`.
First one is
```
<document book_id="{book_id}">
<title>The book</title>
</document>
```
and the second is
```
<document book_id="{book_id}">
<format>... | 2015/09/13 | [
"https://Stackoverflow.com/questions/32548753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1492634/"
] | Maybe stating the obvious, the best approach would be to change the model so the format is in the same document as the title and can be matched by a single query.
If that's not possible, one alternative would be to turn on the uri lexicon in the database configuration (if it's not enabled already).
Assuming that the ... | I think I found better solution
```
let $book_ids := cts:values(
cts:element-attribute-reference(xs:QName("document"), xs:QName("book_id") ),
(),
("map"),
cts:and-query((
cts:directory-query(("/books/"), "infinity"),
cts:element-query(xs:QName("title"),"book")
))
)
return
cts:search(
/,
... |
32,548,753 | I have in each books directory `/books/{book_id}/` a couple of xml documents.
`/books/{book_id}/basic.xml` and `/books/{book_id}/formats.xml`.
First one is
```
<document book_id="{book_id}">
<title>The book</title>
</document>
```
and the second is
```
<document book_id="{book_id}">
<format>... | 2015/09/13 | [
"https://Stackoverflow.com/questions/32548753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1492634/"
] | This question is listed as MarkLogic as well as xQuery. For completeness, I have included a MarkLogic solution that is a single statement:
```
let $res := cts:search(doc(), cts:and-query(
(
cts:element-word-query(xs:QName("title"), '*book*', ('wildcarded'))
,
cts:element-attribute-ran... | I think I found better solution
```
let $book_ids := cts:values(
cts:element-attribute-reference(xs:QName("document"), xs:QName("book_id") ),
(),
("map"),
cts:and-query((
cts:directory-query(("/books/"), "infinity"),
cts:element-query(xs:QName("title"),"book")
))
)
return
cts:search(
/,
... |
2,795,693 | How does XNA maintain a consistent and precise 60 FPS frame rate? Additionally, how does it maintain such precise timing without pegging the CPU at 100%? | 2010/05/08 | [
"https://Stackoverflow.com/questions/2795693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123432/"
] | I don't know specifically how XNA does it but when playing around with OpenGL a few years ago I accomplished the same thing using some very simple code.
at the core of it i assume XNA has some sort of rendering loop, it may or may not be integrated with a standard even processing loop but for the sake of example lets ... | games should run at 60fps but that doesn't mean that they will. That's actually an upper limit for a released game.
If you run a game in debug mode you could get much higher frames per second - for example a blank starter template on my laptop in debug mode runs well over 1,000fps.
That being said the XNA framework i... |
2,795,693 | How does XNA maintain a consistent and precise 60 FPS frame rate? Additionally, how does it maintain such precise timing without pegging the CPU at 100%? | 2010/05/08 | [
"https://Stackoverflow.com/questions/2795693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123432/"
] | I don't know specifically how XNA does it but when playing around with OpenGL a few years ago I accomplished the same thing using some very simple code.
at the core of it i assume XNA has some sort of rendering loop, it may or may not be integrated with a standard even processing loop but for the sake of example lets ... | While luke’s code above is theoretical right the used methods and properties are not the best choices:
* As the precision of `DateTime.Now` is only about 30ms (see [C# DateTime.Now precision](https://stackoverflow.com/questions/2143140/c-datetime-now-precision) and give or take 20ms) its use for high performance timin... |
2,795,693 | How does XNA maintain a consistent and precise 60 FPS frame rate? Additionally, how does it maintain such precise timing without pegging the CPU at 100%? | 2010/05/08 | [
"https://Stackoverflow.com/questions/2795693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123432/"
] | I don't know specifically how XNA does it but when playing around with OpenGL a few years ago I accomplished the same thing using some very simple code.
at the core of it i assume XNA has some sort of rendering loop, it may or may not be integrated with a standard even processing loop but for the sake of example lets ... | You can read all about how the XNA timer was implemented here [Game timing in XNA Game Studio](http://blogs.msdn.com/shawnhar/archive/2007/11/23/game-timing-in-xna-game-studio-2-0.aspx) but basicly it would try and wiat 1/60 of a second before continuing the loop again, also note that update can be called multiple time... |
2,795,693 | How does XNA maintain a consistent and precise 60 FPS frame rate? Additionally, how does it maintain such precise timing without pegging the CPU at 100%? | 2010/05/08 | [
"https://Stackoverflow.com/questions/2795693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123432/"
] | While luke’s code above is theoretical right the used methods and properties are not the best choices:
* As the precision of `DateTime.Now` is only about 30ms (see [C# DateTime.Now precision](https://stackoverflow.com/questions/2143140/c-datetime-now-precision) and give or take 20ms) its use for high performance timin... | games should run at 60fps but that doesn't mean that they will. That's actually an upper limit for a released game.
If you run a game in debug mode you could get much higher frames per second - for example a blank starter template on my laptop in debug mode runs well over 1,000fps.
That being said the XNA framework i... |
2,795,693 | How does XNA maintain a consistent and precise 60 FPS frame rate? Additionally, how does it maintain such precise timing without pegging the CPU at 100%? | 2010/05/08 | [
"https://Stackoverflow.com/questions/2795693",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/123432/"
] | While luke’s code above is theoretical right the used methods and properties are not the best choices:
* As the precision of `DateTime.Now` is only about 30ms (see [C# DateTime.Now precision](https://stackoverflow.com/questions/2143140/c-datetime-now-precision) and give or take 20ms) its use for high performance timin... | You can read all about how the XNA timer was implemented here [Game timing in XNA Game Studio](http://blogs.msdn.com/shawnhar/archive/2007/11/23/game-timing-in-xna-game-studio-2-0.aspx) but basicly it would try and wiat 1/60 of a second before continuing the loop again, also note that update can be called multiple time... |
29,619,418 | I wanted to cerate a message window on top of `root window` which looks similar from this [link](http://www.prasannatech.net/2009/05/python-tkinter-tkmessagebox-widget.html). A message window with a message and an inactive button untill some portion of the code are done and then to display a message with an active butt... | 2015/04/14 | [
"https://Stackoverflow.com/questions/29619418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3869739/"
] | Read this => it's helps you alot :)
[learn-to-love-auto-layout](http://www.thinkandbuild.it/learn-to-love-auto-layout/)
**OR**
if you want to [LOVE AUTO LAYOUT… PROGRAMMATICALLY](http://www.thinkandbuild.it/learn-to-love-auto-layout-programmatically/)

![2 i/p image]... | Rather than giving trailing and leading space, apply this simple constraints.
1. Make your height constant (If you want to!)
2. Put UIView in center of the container
3. Give "Horizontal Center in Container" constraint
4. Apply appropriate "top space" and "bottom space"
That's it! You're done. |
9,341,759 | What i want to do is take particular values from a list of strings and store them into variables for that particular index.
Com317,subject,1,20,M,year1
the example is what is contained in each index of the list of strings. I want to select the 1 and the 20 from this list and store them into 2 variables. Been trying ... | 2012/02/18 | [
"https://Stackoverflow.com/questions/9341759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/987691/"
] | The answers to [this question](https://stackoverflow.com/questions/1508975/why-is-list-size0-slower-than-list-isempty-in-java) could give you the answer. Basically, in implementations of some lists the method `isEmpty()` checks if the size is zero (and therefore from the point of view of performance they are practicall... | No, there's no reason. `isEmpty()` expresses the intent more clearly, and should be preferred. PMD even has [a rule](https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#usecollectionisempty) for that. It doesn't matter much, though. |
9,341,759 | What i want to do is take particular values from a list of strings and store them into variables for that particular index.
Com317,subject,1,20,M,year1
the example is what is contained in each index of the list of strings. I want to select the 1 and the 20 from this list and store them into 2 variables. Been trying ... | 2012/02/18 | [
"https://Stackoverflow.com/questions/9341759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/987691/"
] | No, there's no reason. `isEmpty()` expresses the intent more clearly, and should be preferred. PMD even has [a rule](https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#usecollectionisempty) for that. It doesn't matter much, though. | While `isEmpty()` may express the intent better as JB Nizet suggests. If you are an old school programer, your style may lean towards expressions like `.size() > 0` etc. So if the answer can be an opinion on ones intent, the answer can also be do what your muscle memory tells you.
In many cases `size()` and `isEmpty` ... |
9,341,759 | What i want to do is take particular values from a list of strings and store them into variables for that particular index.
Com317,subject,1,20,M,year1
the example is what is contained in each index of the list of strings. I want to select the 1 and the 20 from this list and store them into 2 variables. Been trying ... | 2012/02/18 | [
"https://Stackoverflow.com/questions/9341759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/987691/"
] | The answers to [this question](https://stackoverflow.com/questions/1508975/why-is-list-size0-slower-than-list-isempty-in-java) could give you the answer. Basically, in implementations of some lists the method `isEmpty()` checks if the size is zero (and therefore from the point of view of performance they are practicall... | `.size()` can be O(1) or O(N), depending on the data structure; `.isEmpty()` is never O(N). |
9,341,759 | What i want to do is take particular values from a list of strings and store them into variables for that particular index.
Com317,subject,1,20,M,year1
the example is what is contained in each index of the list of strings. I want to select the 1 and the 20 from this list and store them into 2 variables. Been trying ... | 2012/02/18 | [
"https://Stackoverflow.com/questions/9341759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/987691/"
] | The answers to [this question](https://stackoverflow.com/questions/1508975/why-is-list-size0-slower-than-list-isempty-in-java) could give you the answer. Basically, in implementations of some lists the method `isEmpty()` checks if the size is zero (and therefore from the point of view of performance they are practicall... | While `isEmpty()` may express the intent better as JB Nizet suggests. If you are an old school programer, your style may lean towards expressions like `.size() > 0` etc. So if the answer can be an opinion on ones intent, the answer can also be do what your muscle memory tells you.
In many cases `size()` and `isEmpty` ... |
9,341,759 | What i want to do is take particular values from a list of strings and store them into variables for that particular index.
Com317,subject,1,20,M,year1
the example is what is contained in each index of the list of strings. I want to select the 1 and the 20 from this list and store them into 2 variables. Been trying ... | 2012/02/18 | [
"https://Stackoverflow.com/questions/9341759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/987691/"
] | `.size()` can be O(1) or O(N), depending on the data structure; `.isEmpty()` is never O(N). | While `isEmpty()` may express the intent better as JB Nizet suggests. If you are an old school programer, your style may lean towards expressions like `.size() > 0` etc. So if the answer can be an opinion on ones intent, the answer can also be do what your muscle memory tells you.
In many cases `size()` and `isEmpty` ... |
8,176,277 | Is it possible to find out which properties were saved on a managed object after the save occurs? For example, I have someone listening for managed object context saves, (NSManagedObjectContextDidSaveNotification) and I want to know which properties on the objects were saved. | 2011/11/18 | [
"https://Stackoverflow.com/questions/8176277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/389890/"
] | The `NSManagedObjectContextDidSaveNotification` does contain all three bits of information you would need to sync with a server. Check the `[notification userInfo]` and you will find three sets inside: `NSInsertedObjectsKey`, `NSUpdatedObjectsKey`, and `NSDeletedObjectsKey`
If you want to know what properties on an en... | Why don't you get them when they are about to be saved. Subscribe to NSManagedObjectContextWillSaveNotification and check `insertedObjects`, `updatedObjects` and `deletedObjects` of the `NSManagedObjectContext`.
Update:
Even easier, get the user info of the `NSManagedObjectContextDidSaveNotification`
From the docum... |
8,176,277 | Is it possible to find out which properties were saved on a managed object after the save occurs? For example, I have someone listening for managed object context saves, (NSManagedObjectContextDidSaveNotification) and I want to know which properties on the objects were saved. | 2011/11/18 | [
"https://Stackoverflow.com/questions/8176277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/389890/"
] | The `NSManagedObjectContextDidSaveNotification` does contain all three bits of information you would need to sync with a server. Check the `[notification userInfo]` and you will find three sets inside: `NSInsertedObjectsKey`, `NSUpdatedObjectsKey`, and `NSDeletedObjectsKey`
If you want to know what properties on an en... | Here's the solution I settled with. I have one singleton class that is notified when a context saves. The NSManagedObjectContextWillSave notification tells me which things have changed so I store them in a dictionary with the key being the context that saved. Then when I get the NSManagedObjectContextDidSave notificati... |
30,042,889 | I have XML that looks roughly as follows:
```
<Dispatch ID = "JJJJ">
<Log ID = "150504BCFSP00072">
<LogTime>"May 4 2015 5:48PM"</LogTime>
<LogType>"1125-KKKK"</LogType>
<LogDetails>
<details>
<DetailTime>"May 4 2015 5:48PM"</DetailTime>
<Incid... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30042889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4864484/"
] | The condition
```
Choice != "NEW GAME" or Choice != "QUIT"
```
will always be `True`. Any value of `Choice` will be either not `"NEW GAME"` or not `"QUIT"`. Instead, use:
```
Choice != "NEW GAME" and Choice != "QUIT":
``` | I guess you want a `and` there, not a `or`…
Because `Choice` can't be at the same time **not** different from `"NEW GAME"` and from `"QUIT"`. In other words, your loop condition is always `True` whatever the value of `Choice` is. |
30,042,889 | I have XML that looks roughly as follows:
```
<Dispatch ID = "JJJJ">
<Log ID = "150504BCFSP00072">
<LogTime>"May 4 2015 5:48PM"</LogTime>
<LogType>"1125-KKKK"</LogType>
<LogDetails>
<details>
<DetailTime>"May 4 2015 5:48PM"</DetailTime>
<Incid... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30042889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4864484/"
] | I think you are looking for
`while Choice not in ["New Game", "Continue", "Quit"]`
or better to allow for alternative capitalization:
`while Choice.upper() not in ["NEW GAME", "CONTINUE", "QUIT"]`
Also please uncapitalize the variable `Choice`. When other Python programmers see a variable that starts with a capita... | I guess you want a `and` there, not a `or`…
Because `Choice` can't be at the same time **not** different from `"NEW GAME"` and from `"QUIT"`. In other words, your loop condition is always `True` whatever the value of `Choice` is. |
30,042,889 | I have XML that looks roughly as follows:
```
<Dispatch ID = "JJJJ">
<Log ID = "150504BCFSP00072">
<LogTime>"May 4 2015 5:48PM"</LogTime>
<LogType>"1125-KKKK"</LogType>
<LogDetails>
<details>
<DetailTime>"May 4 2015 5:48PM"</DetailTime>
<Incid... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30042889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4864484/"
] | The condition
```
Choice != "NEW GAME" or Choice != "QUIT"
```
will always be `True`. Any value of `Choice` will be either not `"NEW GAME"` or not `"QUIT"`. Instead, use:
```
Choice != "NEW GAME" and Choice != "QUIT":
``` | I think you are looking for
`while Choice not in ["New Game", "Continue", "Quit"]`
or better to allow for alternative capitalization:
`while Choice.upper() not in ["NEW GAME", "CONTINUE", "QUIT"]`
Also please uncapitalize the variable `Choice`. When other Python programmers see a variable that starts with a capita... |
27,260 | Let us consider the conventions on names used in the theoretical derivation of Metropolis-Hastings Monte Carlo as outlined [here](https://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm#Formal_derivation), for the sake of common nomenclature.
What we are building is a step-by-step Markov Chain Monte Carlo... | 2017/06/27 | [
"https://scicomp.stackexchange.com/questions/27260",
"https://scicomp.stackexchange.com",
"https://scicomp.stackexchange.com/users/24691/"
] | In an extreme case, if $g(x^\prime | x) = P(x^\prime | x)$ then $A(x^\prime | x) = 1$ for all $x$ and $x^\prime$. This means that the proposal coincides with the conditional probability of the desired distribution. It is tempting to think that by choosing $g(x^\prime | x)$ close (in some sense) to $P(x^\prime, x)$, we ... | It's less a question of physical meaning, and more a question of computational efficiency. The closer the proposal density is matched to the desired probability density, the faster the chain will converge to the probability distribution. I do not know of the proof of this, but it is straightforward to examine the end p... |
49,890 | I did not notice any difference between them.
I was hoping "completely remove" will remove all hidden configuration files in the home directories, but it is not doing that.
So, what actually is the difference between them? And is it possible to remove also all configuration files when uninstalling an application?
T... | 2011/06/21 | [
"https://askubuntu.com/questions/49890",
"https://askubuntu.com",
"https://askubuntu.com/users/3087/"
] | To add a little bit to what Rinzwind and nickguletskii said, `completely remove` will remove configuration files in `/etc` directory, but never touch personal configuration files in your home folder, that can only be removed by hand. | Removal will remove the package. Complete removal will remove the package and also remove configurations associated with the package.
So if you remove and then install a package, your settings will still be there. If you completely remove and install a package, your settings will be kept.
However, this will only remo... |
49,890 | I did not notice any difference between them.
I was hoping "completely remove" will remove all hidden configuration files in the home directories, but it is not doing that.
So, what actually is the difference between them? And is it possible to remove also all configuration files when uninstalling an application?
T... | 2011/06/21 | [
"https://askubuntu.com/questions/49890",
"https://askubuntu.com",
"https://askubuntu.com/users/3087/"
] | To add a little bit to what Rinzwind and nickguletskii said, `completely remove` will remove configuration files in `/etc` directory, but never touch personal configuration files in your home folder, that can only be removed by hand. | The 'complete removal' option instructs Synaptic to remove any configuration files *associated with the package* as well.
Source: [community wiki](https://help.ubuntu.com/community/SynapticHowto#Remove%20or%20Uninstall%20Packages)
Normal removal is equivalent to `sudo apt-get remove application` using terminal.
Com... |
20,060,445 | I'm using [google-api-php-client](https://code.google.com/p/google-api-php-client/)
Here's the bit where I upload a .jpg image.
```
$postbody = array("data" => $imgData);
$gso = new Google_StorageObject();
$gso->setName($imageName);
$contentType = 'image/jpg';
$gso->setContentType($contentType);
$resp = $objects->i... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20060445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1373110/"
] | Try this, it worked for me:
```
$postbody = array('mimeType' => 'image/jpeg', "data" => $imgData);
$gso = new Google_StorageObject();
$gso->setName($imageName);
$resp = $objects->insert('bucket-name', $gso, $postbody);
```
It seems 'mimeType' its a parameter.
Take a look at line 39 in <https://code.google.com/p/goo... | That sounds like a bug. I'd suggest filing it with google-api-php-client.
In the meanwhile, there is a workaround. Google Cloud Storage treats the Content Type like any other metadata. You can change the content type of an object after you upload it by by using the `$objects->update()` method. |
89,701 | I'm trying to build a setting in which humankind would have no other choice than to live underwater to survive.
Suppose there was a nuclear war in which a huge part of the human population died, and it renders the surface of the earth uninhabitable for several centuries. But people survived because they were conducti... | 2017/08/22 | [
"https://worldbuilding.stackexchange.com/questions/89701",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41847/"
] | You didn't specify what the nuclear fallout is from, so I'm going to assume it is from nuclear bombs instead of reactor meltdowns.
[Water is very good at shielding radiation](https://what-if.xkcd.com/29/) (I know that isn't a great source, but it illustrates the point). It is unlikely that life under the water will e... | **Radioactive material**
It depends in the most common radiactive material used during the conflict. This material could maintaint his radiation level for a few seconds and then dissipate totally or million of years still keep emanating radiation.
Since this radiation is in the air, raining would bring it to the ocea... |
89,701 | I'm trying to build a setting in which humankind would have no other choice than to live underwater to survive.
Suppose there was a nuclear war in which a huge part of the human population died, and it renders the surface of the earth uninhabitable for several centuries. But people survived because they were conducti... | 2017/08/22 | [
"https://worldbuilding.stackexchange.com/questions/89701",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41847/"
] | Your premise is problematic
===========================
I am going to take two steps back and start by looking at what you want to achieve: **a way to force humans to live under water**.
Nuclear fallout does not really help you there, because of the way fallout works. Fallout is not some evil magical gas that floats... | You didn't specify what the nuclear fallout is from, so I'm going to assume it is from nuclear bombs instead of reactor meltdowns.
[Water is very good at shielding radiation](https://what-if.xkcd.com/29/) (I know that isn't a great source, but it illustrates the point). It is unlikely that life under the water will e... |
89,701 | I'm trying to build a setting in which humankind would have no other choice than to live underwater to survive.
Suppose there was a nuclear war in which a huge part of the human population died, and it renders the surface of the earth uninhabitable for several centuries. But people survived because they were conducti... | 2017/08/22 | [
"https://worldbuilding.stackexchange.com/questions/89701",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41847/"
] | Your premise is problematic
===========================
I am going to take two steps back and start by looking at what you want to achieve: **a way to force humans to live under water**.
Nuclear fallout does not really help you there, because of the way fallout works. Fallout is not some evil magical gas that floats... | There is one important point to realize: Fallout is distributed over ground *surface*, but diluted in ocean *volume*. That difference is huge. It means, that the same nuclear material that settles in a thin layer on the ground is spread across a few meters of depth at first, and will keep reducing in density as surface... |
89,701 | I'm trying to build a setting in which humankind would have no other choice than to live underwater to survive.
Suppose there was a nuclear war in which a huge part of the human population died, and it renders the surface of the earth uninhabitable for several centuries. But people survived because they were conducti... | 2017/08/22 | [
"https://worldbuilding.stackexchange.com/questions/89701",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41847/"
] | There is one important point to realize: Fallout is distributed over ground *surface*, but diluted in ocean *volume*. That difference is huge. It means, that the same nuclear material that settles in a thin layer on the ground is spread across a few meters of depth at first, and will keep reducing in density as surface... | You didn't specify what the nuclear fallout is from, so I'm going to assume it is from nuclear bombs instead of reactor meltdowns.
[Water is very good at shielding radiation](https://what-if.xkcd.com/29/) (I know that isn't a great source, but it illustrates the point). It is unlikely that life under the water will e... |
89,701 | I'm trying to build a setting in which humankind would have no other choice than to live underwater to survive.
Suppose there was a nuclear war in which a huge part of the human population died, and it renders the surface of the earth uninhabitable for several centuries. But people survived because they were conducti... | 2017/08/22 | [
"https://worldbuilding.stackexchange.com/questions/89701",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41847/"
] | Nuclear fallout will first and foremost affect ocean plankton. Plankton is a mixture: it is part animal (including the larvae of many fish and crustaceans), part plant (microscopic algae). Plankton is the main food source for many creatures in the ocean. Contaminated plankton will kill the animals that eat it, and thes... | As always much depends on details, but, in general, rain falls (also) over continents and most of that water returns to the oceans, sooner or later, transporting a lot of material it found on its way.
Any water-soluble radioactive material is bound to end-up in the oceans, sooner or later.
It will be much more dilute... |
89,701 | I'm trying to build a setting in which humankind would have no other choice than to live underwater to survive.
Suppose there was a nuclear war in which a huge part of the human population died, and it renders the surface of the earth uninhabitable for several centuries. But people survived because they were conducti... | 2017/08/22 | [
"https://worldbuilding.stackexchange.com/questions/89701",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41847/"
] | There is one important point to realize: Fallout is distributed over ground *surface*, but diluted in ocean *volume*. That difference is huge. It means, that the same nuclear material that settles in a thin layer on the ground is spread across a few meters of depth at first, and will keep reducing in density as surface... | As always much depends on details, but, in general, rain falls (also) over continents and most of that water returns to the oceans, sooner or later, transporting a lot of material it found on its way.
Any water-soluble radioactive material is bound to end-up in the oceans, sooner or later.
It will be much more dilute... |
89,701 | I'm trying to build a setting in which humankind would have no other choice than to live underwater to survive.
Suppose there was a nuclear war in which a huge part of the human population died, and it renders the surface of the earth uninhabitable for several centuries. But people survived because they were conducti... | 2017/08/22 | [
"https://worldbuilding.stackexchange.com/questions/89701",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41847/"
] | As always much depends on details, but, in general, rain falls (also) over continents and most of that water returns to the oceans, sooner or later, transporting a lot of material it found on its way.
Any water-soluble radioactive material is bound to end-up in the oceans, sooner or later.
It will be much more dilute... | **Radioactive material**
It depends in the most common radiactive material used during the conflict. This material could maintaint his radiation level for a few seconds and then dissipate totally or million of years still keep emanating radiation.
Since this radiation is in the air, raining would bring it to the ocea... |
89,701 | I'm trying to build a setting in which humankind would have no other choice than to live underwater to survive.
Suppose there was a nuclear war in which a huge part of the human population died, and it renders the surface of the earth uninhabitable for several centuries. But people survived because they were conducti... | 2017/08/22 | [
"https://worldbuilding.stackexchange.com/questions/89701",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41847/"
] | Nuclear fallout will first and foremost affect ocean plankton. Plankton is a mixture: it is part animal (including the larvae of many fish and crustaceans), part plant (microscopic algae). Plankton is the main food source for many creatures in the ocean. Contaminated plankton will kill the animals that eat it, and thes... | You didn't specify what the nuclear fallout is from, so I'm going to assume it is from nuclear bombs instead of reactor meltdowns.
[Water is very good at shielding radiation](https://what-if.xkcd.com/29/) (I know that isn't a great source, but it illustrates the point). It is unlikely that life under the water will e... |
89,701 | I'm trying to build a setting in which humankind would have no other choice than to live underwater to survive.
Suppose there was a nuclear war in which a huge part of the human population died, and it renders the surface of the earth uninhabitable for several centuries. But people survived because they were conducti... | 2017/08/22 | [
"https://worldbuilding.stackexchange.com/questions/89701",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41847/"
] | Your premise is problematic
===========================
I am going to take two steps back and start by looking at what you want to achieve: **a way to force humans to live under water**.
Nuclear fallout does not really help you there, because of the way fallout works. Fallout is not some evil magical gas that floats... | As always much depends on details, but, in general, rain falls (also) over continents and most of that water returns to the oceans, sooner or later, transporting a lot of material it found on its way.
Any water-soluble radioactive material is bound to end-up in the oceans, sooner or later.
It will be much more dilute... |
89,701 | I'm trying to build a setting in which humankind would have no other choice than to live underwater to survive.
Suppose there was a nuclear war in which a huge part of the human population died, and it renders the surface of the earth uninhabitable for several centuries. But people survived because they were conducti... | 2017/08/22 | [
"https://worldbuilding.stackexchange.com/questions/89701",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41847/"
] | Nuclear fallout will first and foremost affect ocean plankton. Plankton is a mixture: it is part animal (including the larvae of many fish and crustaceans), part plant (microscopic algae). Plankton is the main food source for many creatures in the ocean. Contaminated plankton will kill the animals that eat it, and thes... | **Radioactive material**
It depends in the most common radiactive material used during the conflict. This material could maintaint his radiation level for a few seconds and then dissipate totally or million of years still keep emanating radiation.
Since this radiation is in the air, raining would bring it to the ocea... |
74,255,960 | I'm new to react and I'm trying to figure out how to make redirect after check if email is available or not. I've tried to do it with only React.useState, but states are not updated immediately, so I've been redirected in all cases.
I've read somewhere here that to change state I have to use React.useEffect, but after... | 2022/10/30 | [
"https://Stackoverflow.com/questions/74255960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20373809/"
] | From [the docs](https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-pull-ecr-image.html):
>
> The image name format should be registry/repository[:tag] to pull by tag, or registry/repository[@digest] to pull by digest.
>
>
>
so for the pull command you should use:
```
$ docker pull <account-id>.dkr.ecr... | It was failing because the image tag was being returned inside double quotes. Had to get the output in plain text using :-
`aws ecr describe-images --repository-name repo --query 'sort_by(imageDetails,& imagePushedAt)[-1].imageTags[0]' --output text` |
1,054,188 | Suppose I have a junction table
```
EmployeeId DeptId
--------- ------
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
4 1
5 2
5 3
6 1
6 2
6 3
```
So 1 employee can work ... | 2009/06/28 | [
"https://Stackoverflow.com/questions/1054188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/111663/"
] | There's reactive -- <http://github.com/nafg/reactive>.
The repository currently contains two projects. reactive-core is a standalone FRP library. reactive-web builds on it to make it very easy to make very dynamic and interactive Lift webapps. | You have many many libraries. Here you have a list of many of them <https://github.com/politrons/reactiveScala> |
1,054,188 | Suppose I have a junction table
```
EmployeeId DeptId
--------- ------
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
4 1
5 2
5 3
6 1
6 2
6 3
```
So 1 employee can work ... | 2009/06/28 | [
"https://Stackoverflow.com/questions/1054188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/111663/"
] | Coursera [Principles of Reactive Programming](https://www.coursera.org/course/reactive) course promotes [RxScala](http://rxscala.github.io/).
>
> RxScala brings Reactive Extensions to Scala. Rx was first implemented
> for .NET, and is now being implemented in Java. The RxScala project is
> an adaptor for RxJava. It... | You have many many libraries. Here you have a list of many of them <https://github.com/politrons/reactiveScala> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.