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 |
|---|---|---|---|---|---|
12,753,035 | If in bash I run `a | b | c | d` on the command line and then press `^C`, which process gets the signal? | 2012/10/05 | [
"https://Stackoverflow.com/questions/12753035",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/189456/"
] | In short, they all do.
When setting up a pipeline, the shell creates a *[process group](http://www.informit.com/articles/article.aspx?p=366888&seqNum=8)*. `^C` is interpreted by the kernel's line discipline as the user's request to interrupt the process group currently running in the foreground. Sending a signal such ... | I like experimentation better:
```
#!/bin/bash
# FILE /tmp/bla.sh
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT
MY_ID=$1 # Identifier for messages
function ctrl_c() {
echo >&2 "GOODBYE $MY_ID"
exit
}
# This will continue until interrupted, e.g. if the input/output get closed
cat
# If we somehow got to the... |
28,928,016 | For several recent years, Microsoft offers a "NoSQL" key/value storage, called "Table Storage" (<http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-tables/>)
Table Storage offers a high performance, scalability (via partitioning) and relatively low cost. A primary drawback of Tables that... | 2015/03/08 | [
"https://Stackoverflow.com/questions/28928016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/861018/"
] | Both are NoSQL technologies, but they are massively different. Azure Tables is a simple Key/Value store and does not support complex functionality like complex queries (most of them will require a full partition/table scan anyway, which will kill your performance and your cost savings), custom indexing (indexing is bas... | Table Services is mainly a key-value type NOSQL and DocumentDB is (as the name suggests) a Document Type NoSQL store. What you are asking is essentially the difference between these two types of NOSQL approaches. If you shape your research according to this you should be able to get a better understanding for sure.
Ju... |
28,928,016 | For several recent years, Microsoft offers a "NoSQL" key/value storage, called "Table Storage" (<http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-tables/>)
Table Storage offers a high performance, scalability (via partitioning) and relatively low cost. A primary drawback of Tables that... | 2015/03/08 | [
"https://Stackoverflow.com/questions/28928016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/861018/"
] | Table Services is mainly a key-value type NOSQL and DocumentDB is (as the name suggests) a Document Type NoSQL store. What you are asking is essentially the difference between these two types of NOSQL approaches. If you shape your research according to this you should be able to get a better understanding for sure.
Ju... | A real life example:
I have to store some tokens, retrieve them, delete them. Only query ever done will be based on User ID.
So I use Table Storage, as it fulfill my requirement perfectly. I save the token against User ID.
Document DB seemed to be overkill for this. |
28,928,016 | For several recent years, Microsoft offers a "NoSQL" key/value storage, called "Table Storage" (<http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-tables/>)
Table Storage offers a high performance, scalability (via partitioning) and relatively low cost. A primary drawback of Tables that... | 2015/03/08 | [
"https://Stackoverflow.com/questions/28928016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/861018/"
] | Table Services is mainly a key-value type NOSQL and DocumentDB is (as the name suggests) a Document Type NoSQL store. What you are asking is essentially the difference between these two types of NOSQL approaches. If you shape your research according to this you should be able to get a better understanding for sure.
Ju... | I think that the comparison is *all* about trading price for performance. Table Services are just Storage Services, which seem to cap out at 20,000 ops/second, but paying for that kind of throughput all the time (because Storage gives it to us all the time) is $1,200/month. Crazy money.
Table services have simple inde... |
28,928,016 | For several recent years, Microsoft offers a "NoSQL" key/value storage, called "Table Storage" (<http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-tables/>)
Table Storage offers a high performance, scalability (via partitioning) and relatively low cost. A primary drawback of Tables that... | 2015/03/08 | [
"https://Stackoverflow.com/questions/28928016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/861018/"
] | Table Services is mainly a key-value type NOSQL and DocumentDB is (as the name suggests) a Document Type NoSQL store. What you are asking is essentially the difference between these two types of NOSQL approaches. If you shape your research according to this you should be able to get a better understanding for sure.
Ju... | Here is the answer from [`microsoft's official docs`](https://learn.microsoft.com/en-us/office365/enterprise/some-assembly-required)
Common attributes of Cosmos DB, Azure Table Storage, and Azure SQL Database:
* 99.99 availability SLA
* Fully managed database services
* ISO 27001, HIPAA and EU Model Clauses Compliant... |
28,928,016 | For several recent years, Microsoft offers a "NoSQL" key/value storage, called "Table Storage" (<http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-tables/>)
Table Storage offers a high performance, scalability (via partitioning) and relatively low cost. A primary drawback of Tables that... | 2015/03/08 | [
"https://Stackoverflow.com/questions/28928016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/861018/"
] | Both are NoSQL technologies, but they are massively different. Azure Tables is a simple Key/Value store and does not support complex functionality like complex queries (most of them will require a full partition/table scan anyway, which will kill your performance and your cost savings), custom indexing (indexing is bas... | A real life example:
I have to store some tokens, retrieve them, delete them. Only query ever done will be based on User ID.
So I use Table Storage, as it fulfill my requirement perfectly. I save the token against User ID.
Document DB seemed to be overkill for this. |
28,928,016 | For several recent years, Microsoft offers a "NoSQL" key/value storage, called "Table Storage" (<http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-tables/>)
Table Storage offers a high performance, scalability (via partitioning) and relatively low cost. A primary drawback of Tables that... | 2015/03/08 | [
"https://Stackoverflow.com/questions/28928016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/861018/"
] | Both are NoSQL technologies, but they are massively different. Azure Tables is a simple Key/Value store and does not support complex functionality like complex queries (most of them will require a full partition/table scan anyway, which will kill your performance and your cost savings), custom indexing (indexing is bas... | I think that the comparison is *all* about trading price for performance. Table Services are just Storage Services, which seem to cap out at 20,000 ops/second, but paying for that kind of throughput all the time (because Storage gives it to us all the time) is $1,200/month. Crazy money.
Table services have simple inde... |
28,928,016 | For several recent years, Microsoft offers a "NoSQL" key/value storage, called "Table Storage" (<http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-tables/>)
Table Storage offers a high performance, scalability (via partitioning) and relatively low cost. A primary drawback of Tables that... | 2015/03/08 | [
"https://Stackoverflow.com/questions/28928016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/861018/"
] | Both are NoSQL technologies, but they are massively different. Azure Tables is a simple Key/Value store and does not support complex functionality like complex queries (most of them will require a full partition/table scan anyway, which will kill your performance and your cost savings), custom indexing (indexing is bas... | Here is the answer from [`microsoft's official docs`](https://learn.microsoft.com/en-us/office365/enterprise/some-assembly-required)
Common attributes of Cosmos DB, Azure Table Storage, and Azure SQL Database:
* 99.99 availability SLA
* Fully managed database services
* ISO 27001, HIPAA and EU Model Clauses Compliant... |
28,928,016 | For several recent years, Microsoft offers a "NoSQL" key/value storage, called "Table Storage" (<http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-tables/>)
Table Storage offers a high performance, scalability (via partitioning) and relatively low cost. A primary drawback of Tables that... | 2015/03/08 | [
"https://Stackoverflow.com/questions/28928016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/861018/"
] | I think that the comparison is *all* about trading price for performance. Table Services are just Storage Services, which seem to cap out at 20,000 ops/second, but paying for that kind of throughput all the time (because Storage gives it to us all the time) is $1,200/month. Crazy money.
Table services have simple inde... | A real life example:
I have to store some tokens, retrieve them, delete them. Only query ever done will be based on User ID.
So I use Table Storage, as it fulfill my requirement perfectly. I save the token against User ID.
Document DB seemed to be overkill for this. |
28,928,016 | For several recent years, Microsoft offers a "NoSQL" key/value storage, called "Table Storage" (<http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-tables/>)
Table Storage offers a high performance, scalability (via partitioning) and relatively low cost. A primary drawback of Tables that... | 2015/03/08 | [
"https://Stackoverflow.com/questions/28928016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/861018/"
] | I think that the comparison is *all* about trading price for performance. Table Services are just Storage Services, which seem to cap out at 20,000 ops/second, but paying for that kind of throughput all the time (because Storage gives it to us all the time) is $1,200/month. Crazy money.
Table services have simple inde... | Here is the answer from [`microsoft's official docs`](https://learn.microsoft.com/en-us/office365/enterprise/some-assembly-required)
Common attributes of Cosmos DB, Azure Table Storage, and Azure SQL Database:
* 99.99 availability SLA
* Fully managed database services
* ISO 27001, HIPAA and EU Model Clauses Compliant... |
59,638,467 | Ok, so I'm spitting command line arguments by spaces, like Command Prompt, but the problem is, if the user tries to type in
DoStuff "argument that has spaces but is quoted"
it will not split it correctly. I am using a console application. I've tried to do it like this:
baseCommand is the string that the user types in ... | 2020/01/08 | [
"https://Stackoverflow.com/questions/59638467",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12621198/"
] | You could use following Regex for the purpose.
```
[\""].+?[\""]|[^ ]+
```
For example,
```
var commandList = Regex.Matches(baseCommand, @"[\""].+?[\""]|[^ ]+")
.Cast<Match>()
.Select(x => x.Value.Trim('"'))
.ToList();
```
**Sample 1 Input**
```
DoSomething "second... | I'm sure there's a more elegant way to do this, but one way is to simply walk through your command line one character at a time, keeping track if you're "inside a quoted string", and simply build the arguments as you go, adding them to a list when you encounter an end-quote or a space that's not inside a quoted string.... |
3,830,706 | How can I set all records to 0 in a table?
-- UPDATE --
What I want to do is the following. I have a table called Pages with an attributed called position.
When I delete page from the table i want som function to reorder the positions, so that there wont be any not used positions.
EX. Position
1, 2, 4, 8, 9, 12
become... | 2010/09/30 | [
"https://Stackoverflow.com/questions/3830706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/460448/"
] | ```
Pages.find(:all).sort_by(&:position).each_with_index do |page, index|
page.position = index + 1
page.save
end
``` | `Model.all.map { |m| m.field = 0 }.save!`
However this will create as many requests as records you have, so in case you have lots or records I'd suggest to use something like **[this](http://www.coffeepowered.net/2009/01/23/mass-inserting-data-in-rails-without-killing-your-performance/)**. |
3,830,706 | How can I set all records to 0 in a table?
-- UPDATE --
What I want to do is the following. I have a table called Pages with an attributed called position.
When I delete page from the table i want som function to reorder the positions, so that there wont be any not used positions.
EX. Position
1, 2, 4, 8, 9, 12
become... | 2010/09/30 | [
"https://Stackoverflow.com/questions/3830706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/460448/"
] | To answer your first question,
```
Pages.update_all(:position => 0)
```
One way to update the position array when a position is deleted is in a before\_destroy callback. This is reliable only if Rails' `destroy` method is the only way records are deleted!
```
def decrement_positions
Pages.update_all('position = p... | `Model.all.map { |m| m.field = 0 }.save!`
However this will create as many requests as records you have, so in case you have lots or records I'd suggest to use something like **[this](http://www.coffeepowered.net/2009/01/23/mass-inserting-data-in-rails-without-killing-your-performance/)**. |
3,830,706 | How can I set all records to 0 in a table?
-- UPDATE --
What I want to do is the following. I have a table called Pages with an attributed called position.
When I delete page from the table i want som function to reorder the positions, so that there wont be any not used positions.
EX. Position
1, 2, 4, 8, 9, 12
become... | 2010/09/30 | [
"https://Stackoverflow.com/questions/3830706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/460448/"
] | ```
Pages.find(:all).sort_by(&:position).each_with_index do |page, index|
page.position = index + 1
page.save
end
``` | If you're using the [**acts\_as\_list**](http://github.com/rails/acts_as_list) plugin, it should deal with the renumbering of positions automatically. |
3,830,706 | How can I set all records to 0 in a table?
-- UPDATE --
What I want to do is the following. I have a table called Pages with an attributed called position.
When I delete page from the table i want som function to reorder the positions, so that there wont be any not used positions.
EX. Position
1, 2, 4, 8, 9, 12
become... | 2010/09/30 | [
"https://Stackoverflow.com/questions/3830706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/460448/"
] | ```
Pages.find(:all).sort_by(&:position).each_with_index do |page, index|
page.position = index + 1
page.save
end
``` | To answer your first question,
```
Pages.update_all(:position => 0)
```
One way to update the position array when a position is deleted is in a before\_destroy callback. This is reliable only if Rails' `destroy` method is the only way records are deleted!
```
def decrement_positions
Pages.update_all('position = p... |
3,830,706 | How can I set all records to 0 in a table?
-- UPDATE --
What I want to do is the following. I have a table called Pages with an attributed called position.
When I delete page from the table i want som function to reorder the positions, so that there wont be any not used positions.
EX. Position
1, 2, 4, 8, 9, 12
become... | 2010/09/30 | [
"https://Stackoverflow.com/questions/3830706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/460448/"
] | ```
Pages.find(:all).sort_by(&:position).each_with_index do |page, index|
page.position = index + 1
page.save
end
``` | I would think using the plugin acts\_as\_list, like Andrew suggested, is a good idea if you need all the features, otherwise, I would just setup an after\_destroy filter.
```
after_destroy :fix_order
def fix_order
Page.order('position asc').all.each_with_index do |page, index|
page.update_attribute(:position, in... |
3,830,706 | How can I set all records to 0 in a table?
-- UPDATE --
What I want to do is the following. I have a table called Pages with an attributed called position.
When I delete page from the table i want som function to reorder the positions, so that there wont be any not used positions.
EX. Position
1, 2, 4, 8, 9, 12
become... | 2010/09/30 | [
"https://Stackoverflow.com/questions/3830706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/460448/"
] | To answer your first question,
```
Pages.update_all(:position => 0)
```
One way to update the position array when a position is deleted is in a before\_destroy callback. This is reliable only if Rails' `destroy` method is the only way records are deleted!
```
def decrement_positions
Pages.update_all('position = p... | If you're using the [**acts\_as\_list**](http://github.com/rails/acts_as_list) plugin, it should deal with the renumbering of positions automatically. |
3,830,706 | How can I set all records to 0 in a table?
-- UPDATE --
What I want to do is the following. I have a table called Pages with an attributed called position.
When I delete page from the table i want som function to reorder the positions, so that there wont be any not used positions.
EX. Position
1, 2, 4, 8, 9, 12
become... | 2010/09/30 | [
"https://Stackoverflow.com/questions/3830706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/460448/"
] | To answer your first question,
```
Pages.update_all(:position => 0)
```
One way to update the position array when a position is deleted is in a before\_destroy callback. This is reliable only if Rails' `destroy` method is the only way records are deleted!
```
def decrement_positions
Pages.update_all('position = p... | I would think using the plugin acts\_as\_list, like Andrew suggested, is a good idea if you need all the features, otherwise, I would just setup an after\_destroy filter.
```
after_destroy :fix_order
def fix_order
Page.order('position asc').all.each_with_index do |page, index|
page.update_attribute(:position, in... |
166,514 | I created a simple event receiver of `SPEmailEventReceiver`. But while creating it, Visual Studio did not ask me on which list/library it needs to be attached. In PowerShell I know that I can get event receivers like this.
```
$site = Get-SPSite -Identity "SITE"
$web = $site.RootWeb
$list = $web.Lists["LIST/LIBRARY"]
... | 2016/01/08 | [
"https://sharepoint.stackexchange.com/questions/166514",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/20540/"
] | You inherit a SharePoint site. Some of the lists do odd things and you want to find out if there are there event receivers on the list. If you have access to Power Shell and the SharePoint servers, you can use the following Power Shell code to find out.
Code :
```
$GC = Start-SPAssignment
$Site = $GC |... | You can add event receiver in element.xml for library as below.
--> It will not seen for all site and sub site. It will applied on only one list instance which is mention by user in Name property of below code.
Code:
```
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/share... |
3,944,655 | I need to test if the user input is the same as an element of a list, right now I'm doing this:
```
cars = ("red", "yellow", "blue")
guess = str(input())
if guess == cars[1] or guess == cars[2]:
print("success!")
```
But I'm working with bigger lists and my if statement is growing a lot with all those check... | 2010/10/15 | [
"https://Stackoverflow.com/questions/3944655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/412528/"
] | The simplest way is:
```
if guess in cars:
...
```
but if your list was huge, that would be slow. You should then store your list of cars in a set:
```
cars_set = set(cars)
....
if guess in cars_set:
...
```
Checking whether something is present is a set is much quicker than checking whether it's in a lis... | Use `guess in cars` to test if `guess` is equal to an element in `cars`:
```
cars = ("red","yellow","blue")
guess = str(input())
if guess in cars:
print ("success!")
``` |
3,944,655 | I need to test if the user input is the same as an element of a list, right now I'm doing this:
```
cars = ("red", "yellow", "blue")
guess = str(input())
if guess == cars[1] or guess == cars[2]:
print("success!")
```
But I'm working with bigger lists and my if statement is growing a lot with all those check... | 2010/10/15 | [
"https://Stackoverflow.com/questions/3944655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/412528/"
] | Use `guess in cars` to test if `guess` is equal to an element in `cars`:
```
cars = ("red","yellow","blue")
guess = str(input())
if guess in cars:
print ("success!")
``` | @Sean Hobbs:
First you'd have to assign a value to the variable index.
```
index = 0
```
You might want to use while True to create the infinite loop, so your code would be like this:
```
while True:
champ = input("Guess a champion: ")
champ = str(champ)
found_champ = False
for i in listC:
... |
3,944,655 | I need to test if the user input is the same as an element of a list, right now I'm doing this:
```
cars = ("red", "yellow", "blue")
guess = str(input())
if guess == cars[1] or guess == cars[2]:
print("success!")
```
But I'm working with bigger lists and my if statement is growing a lot with all those check... | 2010/10/15 | [
"https://Stackoverflow.com/questions/3944655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/412528/"
] | The simplest way is:
```
if guess in cars:
...
```
but if your list was huge, that would be slow. You should then store your list of cars in a set:
```
cars_set = set(cars)
....
if guess in cars_set:
...
```
Checking whether something is present is a set is much quicker than checking whether it's in a lis... | Use `in`:
```
if guess in cars:
print( 'success!' )
```
See also the possible operations on sequence type as documented [in the official documentation](http://docs.python.org/library/stdtypes.html#sequence-types-str-unicode-list-tuple-buffer-xrange). |
3,944,655 | I need to test if the user input is the same as an element of a list, right now I'm doing this:
```
cars = ("red", "yellow", "blue")
guess = str(input())
if guess == cars[1] or guess == cars[2]:
print("success!")
```
But I'm working with bigger lists and my if statement is growing a lot with all those check... | 2010/10/15 | [
"https://Stackoverflow.com/questions/3944655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/412528/"
] | Use `in`:
```
if guess in cars:
print( 'success!' )
```
See also the possible operations on sequence type as documented [in the official documentation](http://docs.python.org/library/stdtypes.html#sequence-types-str-unicode-list-tuple-buffer-xrange). | @Sean Hobbs:
First you'd have to assign a value to the variable index.
```
index = 0
```
You might want to use while True to create the infinite loop, so your code would be like this:
```
while True:
champ = input("Guess a champion: ")
champ = str(champ)
found_champ = False
for i in listC:
... |
3,944,655 | I need to test if the user input is the same as an element of a list, right now I'm doing this:
```
cars = ("red", "yellow", "blue")
guess = str(input())
if guess == cars[1] or guess == cars[2]:
print("success!")
```
But I'm working with bigger lists and my if statement is growing a lot with all those check... | 2010/10/15 | [
"https://Stackoverflow.com/questions/3944655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/412528/"
] | The simplest way is:
```
if guess in cars:
...
```
but if your list was huge, that would be slow. You should then store your list of cars in a set:
```
cars_set = set(cars)
....
if guess in cars_set:
...
```
Checking whether something is present is a set is much quicker than checking whether it's in a lis... | @Sean Hobbs:
First you'd have to assign a value to the variable index.
```
index = 0
```
You might want to use while True to create the infinite loop, so your code would be like this:
```
while True:
champ = input("Guess a champion: ")
champ = str(champ)
found_champ = False
for i in listC:
... |
4,436,883 | I have a Jasper report with the following output format:
```
Item | Price | Quantity
----------------------------
1 100 5
2 150 8
3 200 11
```
How do I make that table to this format:
```
Item 1 2 3
Price 100 ... | 2010/12/14 | [
"https://Stackoverflow.com/questions/4436883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/414173/"
] | Yes, `is_home()`
change it to
```
if (is_home()){
include 'somescript.php';
}
``` | There is a `is_home()` function, but you *may* need to use `is_front_page()` instead.
See [this page](http://codex.wordpress.org/Conditional_Tags) for details on page-identifying functions. |
4,411,140 | I have this:
<http://jsfiddle.net/ETm93/>
Now my floated element, leftPanel is having a margin-right: 20px; works fine. Now I want to give rightPanel\_center a margin-left by 50px; and it do not wants to.
Why cant I do this and how should I solve it? | 2010/12/10 | [
"https://Stackoverflow.com/questions/4411140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267304/"
] | >
> Is there a workaround available..?
>
>
>
Yeah. There is. Extract interface from existing classes.
**upd**
If you need it for some specific classes, you can write smt like
```
//interface that already exists
public interface IDomain {
String foo();
}
//your class
public class Domain implements IDomain{
... | >
> or alternative implementations
>
>
>
You can use [cglib](https://github.com/cglib/cglib).
Similar posts on alternatives to cglib : [Are there alternatives to cglib?](https://stackoverflow.com/questions/2261947/are-there-alternatives-to-cglib) |
4,411,140 | I have this:
<http://jsfiddle.net/ETm93/>
Now my floated element, leftPanel is having a margin-right: 20px; works fine. Now I want to give rightPanel\_center a margin-left by 50px; and it do not wants to.
Why cant I do this and how should I solve it? | 2010/12/10 | [
"https://Stackoverflow.com/questions/4411140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267304/"
] | You can use cglib like this:
```
import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
public class AbstractFactory {
@SuppressWarnings("unchecked... | >
> Is there a workaround available..?
>
>
>
Yeah. There is. Extract interface from existing classes.
**upd**
If you need it for some specific classes, you can write smt like
```
//interface that already exists
public interface IDomain {
String foo();
}
//your class
public class Domain implements IDomain{
... |
4,411,140 | I have this:
<http://jsfiddle.net/ETm93/>
Now my floated element, leftPanel is having a margin-right: 20px; works fine. Now I want to give rightPanel\_center a margin-left by 50px; and it do not wants to.
Why cant I do this and how should I solve it? | 2010/12/10 | [
"https://Stackoverflow.com/questions/4411140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267304/"
] | You can use cglib like this:
```
import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
public class AbstractFactory {
@SuppressWarnings("unchecked... | >
> or alternative implementations
>
>
>
You can use [cglib](https://github.com/cglib/cglib).
Similar posts on alternatives to cglib : [Are there alternatives to cglib?](https://stackoverflow.com/questions/2261947/are-there-alternatives-to-cglib) |
133,952 | I am trying to [Configure a Salesforce Authentication Provider](https://help.salesforce.com/apex/HTViewHelpDoc?id=sso_provider_sfdc.htm) but am stuck at "1. From Setup, enter Auth. Providers in the Quick Find box, then select Auth. Providers."
I have tried 'Authentication Provider', 'Auth. Provider', 'Auth Provider' i... | 2016/08/01 | [
"https://salesforce.stackexchange.com/questions/133952",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/16582/"
] | You should find Auth Providers under Setup->Administer->Security Controls, it's the node between Single Sign On and Identity Providers. If you don't see it there, log a case with Salesforce.com. Those docs are correct and up to date, so support may need to intervene here. | On Profile->System Administration -> Enable Manage Auth. Providers
[](https://i.stack.imgur.com/xxE1h.png) |
5,597,270 | I want to create an integration test which grabs an EF entity from the DB, clones it to a detached object, modifies it and then saves it back and compares it again to the original.
However, I was using AutoMapper to create the clone of the class, but it turns out this is also tracked or an alias to the original object... | 2011/04/08 | [
"https://Stackoverflow.com/questions/5597270",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306098/"
] | >
> Creating a cloned object containing current, original, or database
> values The DbPropertyValues object returned from CurrentValues,
> OriginalValues, or GetDatabaseValues can be used to create a clone of
> the entity. This clone will contain the property values from the
> DbPropertyValues object used to creat... | If it is a test you can do anything and you don't have to be binded to any architectural approach like repository. Your repository probably receive context as injection so you can have access to it. Another point is that I don't believe that AutoMapper will create tracked entity.
The one way to make a copy of the clas... |
5,597,270 | I want to create an integration test which grabs an EF entity from the DB, clones it to a detached object, modifies it and then saves it back and compares it again to the original.
However, I was using AutoMapper to create the clone of the class, but it turns out this is also tracked or an alias to the original object... | 2011/04/08 | [
"https://Stackoverflow.com/questions/5597270",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306098/"
] | All troubles are gone once you're using EF 5+ where they introduced [AsNoTracking()](http://msdn.microsoft.com/en-us/library/gg679352.aspx) method.
The line below returns an unlinked instance, so all the *context* won't be aware about any changes in that instance:
```
context.Clients.AsNoTracking().FirstOrDefault(item... | If it is a test you can do anything and you don't have to be binded to any architectural approach like repository. Your repository probably receive context as injection so you can have access to it. Another point is that I don't believe that AutoMapper will create tracked entity.
The one way to make a copy of the clas... |
5,597,270 | I want to create an integration test which grabs an EF entity from the DB, clones it to a detached object, modifies it and then saves it back and compares it again to the original.
However, I was using AutoMapper to create the clone of the class, but it turns out this is also tracked or an alias to the original object... | 2011/04/08 | [
"https://Stackoverflow.com/questions/5597270",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306098/"
] | >
> Creating a cloned object containing current, original, or database
> values The DbPropertyValues object returned from CurrentValues,
> OriginalValues, or GetDatabaseValues can be used to create a clone of
> the entity. This clone will contain the property values from the
> DbPropertyValues object used to creat... | All troubles are gone once you're using EF 5+ where they introduced [AsNoTracking()](http://msdn.microsoft.com/en-us/library/gg679352.aspx) method.
The line below returns an unlinked instance, so all the *context* won't be aware about any changes in that instance:
```
context.Clients.AsNoTracking().FirstOrDefault(item... |
89,361 | We currently have laminate flooring in our basement, which appears to be installed directly on the concrete floors. We haven't noticed any moisture issues in the 3 years we've been here; we had some "musty smell" issues in the summer with the A/C running, but a dehumidifier took care of that.
We want to carpet the bas... | 2016/04/25 | [
"https://diy.stackexchange.com/questions/89361",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/15277/"
] | Give the history you know of with the home, it's probably not a concern. I'd ask the carpet manufacturer how it affects your warranty, though. As easy as laminate is to remove, it might be worth doing.
One drawback to the adhesive tiles--if your basement floods you can't lift the carpet to dry things and salvage it. ... | I always go with carpet in basement =bad. But if you are confident there will be no moisture issues, OK. Honestly the laminate is not that bad, meaning once you start at one end, it all just kind of folds up. It is interlocking and not glued or nailed so you could probably handle that yourself. It would also give you a... |
4,349,173 | I made a streaming music player and it works fine in the foreground.
But in the background iOS4, it doesn't play the next song automatically. ( remote control works )
The reason is `AudioQueueStart return -12985`.
I already check the audio session. it just fine. I use `AudioQueueStart` when it start to play the music.... | 2010/12/03 | [
"https://Stackoverflow.com/questions/4349173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526629/"
] | I also faced with such problem week ago. I've spent two days to find solution and I found it. May be this link will help (it is official answer): <http://developer.apple.com/library/ios/#qa/qa1668/_index.html>
Make sure that you activate session from applicationDidEnterBackground task handler. Now my application can p... | See [this](https://stackoverflow.com/questions/7619794/play-music-in-background-in-iphone-using-avaudioplayer).
You probably need to include the following:
`[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];`
Towards the bottom there is a reiteration of the how important that line is. As it is no... |
4,349,173 | I made a streaming music player and it works fine in the foreground.
But in the background iOS4, it doesn't play the next song automatically. ( remote control works )
The reason is `AudioQueueStart return -12985`.
I already check the audio session. it just fine. I use `AudioQueueStart` when it start to play the music.... | 2010/12/03 | [
"https://Stackoverflow.com/questions/4349173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526629/"
] | I also faced with such problem week ago. I've spent two days to find solution and I found it. May be this link will help (it is official answer): <http://developer.apple.com/library/ios/#qa/qa1668/_index.html>
Make sure that you activate session from applicationDidEnterBackground task handler. Now my application can p... | I have the same problem.
I registry the AudioSessionInterruptionListener, pause the audio when phone call, resume it after the call end. but get -12985 error code when call AudioQueueStart to resume.
My solution is that I try to call AudioQueueStart after 0.02s.
I don't know the reason. |
4,349,173 | I made a streaming music player and it works fine in the foreground.
But in the background iOS4, it doesn't play the next song automatically. ( remote control works )
The reason is `AudioQueueStart return -12985`.
I already check the audio session. it just fine. I use `AudioQueueStart` when it start to play the music.... | 2010/12/03 | [
"https://Stackoverflow.com/questions/4349173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526629/"
] | I also faced with such problem week ago. I've spent two days to find solution and I found it. May be this link will help (it is official answer): <http://developer.apple.com/library/ios/#qa/qa1668/_index.html>
Make sure that you activate session from applicationDidEnterBackground task handler. Now my application can p... | On iOS7, AudioQueueStart was returning '!int' ('tni!'), though i'm sure no one would be surprised to find that it's not documented in the docs or headers. It was the same issue, though, and the same fix (setting the audio session to active in the background task handler) worked for me. |
4,349,173 | I made a streaming music player and it works fine in the foreground.
But in the background iOS4, it doesn't play the next song automatically. ( remote control works )
The reason is `AudioQueueStart return -12985`.
I already check the audio session. it just fine. I use `AudioQueueStart` when it start to play the music.... | 2010/12/03 | [
"https://Stackoverflow.com/questions/4349173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526629/"
] | In my experience, the -12985 message occurs because another app already has an audio session active when you try to start playback in your app. Options are to 1) instruct the user to close the other app, or 2) set mix mode (see kAudioSessionProperty\_OverrideCategoryMixWithOthers).
The disadvantage of mix mode is if y... | See [this](https://stackoverflow.com/questions/7619794/play-music-in-background-in-iphone-using-avaudioplayer).
You probably need to include the following:
`[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];`
Towards the bottom there is a reiteration of the how important that line is. As it is no... |
4,349,173 | I made a streaming music player and it works fine in the foreground.
But in the background iOS4, it doesn't play the next song automatically. ( remote control works )
The reason is `AudioQueueStart return -12985`.
I already check the audio session. it just fine. I use `AudioQueueStart` when it start to play the music.... | 2010/12/03 | [
"https://Stackoverflow.com/questions/4349173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526629/"
] | See [this](https://stackoverflow.com/questions/7619794/play-music-in-background-in-iphone-using-avaudioplayer).
You probably need to include the following:
`[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];`
Towards the bottom there is a reiteration of the how important that line is. As it is no... | I have the same problem.
I registry the AudioSessionInterruptionListener, pause the audio when phone call, resume it after the call end. but get -12985 error code when call AudioQueueStart to resume.
My solution is that I try to call AudioQueueStart after 0.02s.
I don't know the reason. |
4,349,173 | I made a streaming music player and it works fine in the foreground.
But in the background iOS4, it doesn't play the next song automatically. ( remote control works )
The reason is `AudioQueueStart return -12985`.
I already check the audio session. it just fine. I use `AudioQueueStart` when it start to play the music.... | 2010/12/03 | [
"https://Stackoverflow.com/questions/4349173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526629/"
] | See [this](https://stackoverflow.com/questions/7619794/play-music-in-background-in-iphone-using-avaudioplayer).
You probably need to include the following:
`[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];`
Towards the bottom there is a reiteration of the how important that line is. As it is no... | On iOS7, AudioQueueStart was returning '!int' ('tni!'), though i'm sure no one would be surprised to find that it's not documented in the docs or headers. It was the same issue, though, and the same fix (setting the audio session to active in the background task handler) worked for me. |
4,349,173 | I made a streaming music player and it works fine in the foreground.
But in the background iOS4, it doesn't play the next song automatically. ( remote control works )
The reason is `AudioQueueStart return -12985`.
I already check the audio session. it just fine. I use `AudioQueueStart` when it start to play the music.... | 2010/12/03 | [
"https://Stackoverflow.com/questions/4349173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526629/"
] | In my experience, the -12985 message occurs because another app already has an audio session active when you try to start playback in your app. Options are to 1) instruct the user to close the other app, or 2) set mix mode (see kAudioSessionProperty\_OverrideCategoryMixWithOthers).
The disadvantage of mix mode is if y... | I have the same problem.
I registry the AudioSessionInterruptionListener, pause the audio when phone call, resume it after the call end. but get -12985 error code when call AudioQueueStart to resume.
My solution is that I try to call AudioQueueStart after 0.02s.
I don't know the reason. |
4,349,173 | I made a streaming music player and it works fine in the foreground.
But in the background iOS4, it doesn't play the next song automatically. ( remote control works )
The reason is `AudioQueueStart return -12985`.
I already check the audio session. it just fine. I use `AudioQueueStart` when it start to play the music.... | 2010/12/03 | [
"https://Stackoverflow.com/questions/4349173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526629/"
] | In my experience, the -12985 message occurs because another app already has an audio session active when you try to start playback in your app. Options are to 1) instruct the user to close the other app, or 2) set mix mode (see kAudioSessionProperty\_OverrideCategoryMixWithOthers).
The disadvantage of mix mode is if y... | On iOS7, AudioQueueStart was returning '!int' ('tni!'), though i'm sure no one would be surprised to find that it's not documented in the docs or headers. It was the same issue, though, and the same fix (setting the audio session to active in the background task handler) worked for me. |
46,622,357 | I'm very new in Java Programming Language.
I asked to make something like this with nested loops method:
.
"Masukan Angka" is "Input Number" in Indonesian Language. So if we input 9, it will print out 9 lines of \* and the amount of \* decreased for each line.
I tried... | 2017/10/07 | [
"https://Stackoverflow.com/questions/46622357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Expanding a bit on [@Ringuerel](https://stackoverflow.com/users/4864071/ringuerel) solution:
```
for (int y = x; y > 0; y--) {
for (int z = 0; z < y; z++) {
// If it's first or last or first row print "*"
if( z == 0 || z == y-1 || y == x) {
System.out.print("*");
}
else ... | Add this after the second for, before the print statement, `if( z == 0 || z == y-1 )`, sorry I'm using my phone |
46,622,357 | I'm very new in Java Programming Language.
I asked to make something like this with nested loops method:
.
"Masukan Angka" is "Input Number" in Indonesian Language. So if we input 9, it will print out 9 lines of \* and the amount of \* decreased for each line.
I tried... | 2017/10/07 | [
"https://Stackoverflow.com/questions/46622357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Expanding a bit on [@Ringuerel](https://stackoverflow.com/users/4864071/ringuerel) solution:
```
for (int y = x; y > 0; y--) {
for (int z = 0; z < y; z++) {
// If it's first or last or first row print "*"
if( z == 0 || z == y-1 || y == x) {
System.out.print("*");
}
else ... | ```
public static void main(String[] args) {
int amount = 10;
String c = "*";
String message = "";
for (int i = 0; i < amount; i++) {
message += "*";
for (int j = 1; j < amount - i; j++) {
message += c;
}
message += "*";
c = " ";
System.out.pri... |
47,152,497 | i want to make regex to detect this format `image(numeric, string)`. ex: `image(100, 'test')`.
i have tried this one, but just detect the `image(numeric)`
```
/image\((\d+)\)/
```
Any help with second parameter and the `,`?
Also how i can get the second parameter? | 2017/11/07 | [
"https://Stackoverflow.com/questions/47152497",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4861352/"
] | You can try the following pattern:
```
/image\(\d+,\s*'.+?'\)/
```
I removed the capture group since it would be not needed if using the regex for validation only.
[Demo
----](https://regex101.com/r/Y7aiR9/1)
If you want to capture the number and text, then use capture groups:
```
$input = "code image(123, 'meh')... | You can try this one:
```
image\(\s*\d+\s*\,\s*'.*'\s*\)
``` |
47,152,497 | i want to make regex to detect this format `image(numeric, string)`. ex: `image(100, 'test')`.
i have tried this one, but just detect the `image(numeric)`
```
/image\((\d+)\)/
```
Any help with second parameter and the `,`?
Also how i can get the second parameter? | 2017/11/07 | [
"https://Stackoverflow.com/questions/47152497",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4861352/"
] | Try this:
```
image\((\d+), '(.+?)'\)
```
The `.` matches anything and the rest is pretty much self-explanatory. Group 1 is your number, group 2 is the string. | You can try this one:
```
image\(\s*\d+\s*\,\s*'.*'\s*\)
``` |
267,831 | How come the loop's gain \$\beta A\$ of a Wien's oscillator with Zener diodes is equal to the loop's gain of a Wien's oscillator without Zener diodes?
[](https://i.stack.imgur.com/LaOpH.png)
My professor uses the following expression to determine the... | 2016/11/06 | [
"https://electronics.stackexchange.com/questions/267831",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/111451/"
] | "*Why he does not consider the arm with Zener diodes?*"
When a circuit with frequency-dependent feedback is designed as an oscillator, the loop gain must fulfill the oscillation condition: **LOOP GAIN LG=1.**
However, this never cannot be fulfilled by design because for LG=1.001 we have continuously increasing amplitu... | During most of the cycle, one zener is reverse-biased,and the R5/D1/D2 branch is effectively an open circuit. As such, it can have no effect on the loop frequency.
As the amplitude of the output approaches (Vf + Vz), about 3 volts in this case, the diodes begin to conduct, and the effective loop gain is reduced. Since... |
54,421,600 | I have some text in a cell in a TableView which I would like to appear on the top left corner of the cell.
Aligning the text to the left was simple enough, using:
```
cell.textLabel?.textAlignment = NSTextAlignment.left
```
However, all the solutions I have found for aligning the text vertically to the top are very... | 2019/01/29 | [
"https://Stackoverflow.com/questions/54421600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5433058/"
] | you should set gravity of textview to bottom and specify layout\_above for imageview it will work try it | You need to add `margintop` in your **ImageView**.
```
<ImageView
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_marginTop="30dp"
android:id="@+id/productImageView"
android:scaleType="fitXY"
android:layout_centerHorizontal="true"/>
``` |
54,421,600 | I have some text in a cell in a TableView which I would like to appear on the top left corner of the cell.
Aligning the text to the left was simple enough, using:
```
cell.textLabel?.textAlignment = NSTextAlignment.left
```
However, all the solutions I have found for aligning the text vertically to the top are very... | 2019/01/29 | [
"https://Stackoverflow.com/questions/54421600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5433058/"
] | you should set gravity of textview to bottom and specify layout\_above for imageview it will work try it | `layout_below` will place marked layout below the referred layout and will not place it to bottom of your parent. To align your view to bottom of parent view use `android:layout_alignParentBottom="true"` and adjust other layout according to it if needed. |
54,421,600 | I have some text in a cell in a TableView which I would like to appear on the top left corner of the cell.
Aligning the text to the left was simple enough, using:
```
cell.textLabel?.textAlignment = NSTextAlignment.left
```
However, all the solutions I have found for aligning the text vertically to the top are very... | 2019/01/29 | [
"https://Stackoverflow.com/questions/54421600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5433058/"
] | You need to add `margintop` in your **ImageView**.
```
<ImageView
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_marginTop="30dp"
android:id="@+id/productImageView"
android:scaleType="fitXY"
android:layout_centerHorizontal="true"/>
``` | `layout_below` will place marked layout below the referred layout and will not place it to bottom of your parent. To align your view to bottom of parent view use `android:layout_alignParentBottom="true"` and adjust other layout according to it if needed. |
19,256,461 | I've prebuilt library (libxxx.so) with "-mfloat-abi=hard" parameter. Now i'd like to compile my native code with this lib and build shared lib (.so) with ndk.
Application.mk:
>
> APP\_ABI := armeabi-v7a
>
>
>
Android.mk:
>
> LOCAL\_PATH := $(call my-dir)
>
>
> include $(CLEAR\_VARS)
>
>
> LOCAL\_MODULE := ... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19256461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103561/"
] | `.find('.button')` to `.next('.button')`
`.find()` = find element inside this element
`.next()` = find element next to this element
---
Use `$( "input[value^='LO']")`(input starts with `LO`)
---
You don't need to use `if else statement`
---
Add `:hidden` for more focusing
or use your input id `hiddenCode` *(if... | Use something like:
```
var v = $('#hiddenCode').val();
if (v && v.indexOf('LO') > -1) {
$('.button').replaceWith('<a class="button green" href="some.html">More information</a>');
}
``` |
19,256,461 | I've prebuilt library (libxxx.so) with "-mfloat-abi=hard" parameter. Now i'd like to compile my native code with this lib and build shared lib (.so) with ndk.
Application.mk:
>
> APP\_ABI := armeabi-v7a
>
>
>
Android.mk:
>
> LOCAL\_PATH := $(call my-dir)
>
>
> include $(CLEAR\_VARS)
>
>
> LOCAL\_MODULE := ... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19256461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1103561/"
] | `.find('.button')` to `.next('.button')`
`.find()` = find element inside this element
`.next()` = find element next to this element
---
Use `$( "input[value^='LO']")`(input starts with `LO`)
---
You don't need to use `if else statement`
---
Add `:hidden` for more focusing
or use your input id `hiddenCode` *(if... | The if statement is not needed in: if ($( "input[value\*='LO']" )....
You need next instead of find:
```
$( "input[value^='LO']" ).next('.button').replaceWith('<a class="button green" href="some.html">More information</a>');
```
Next searches for the next sibling, find searches for descendents. |
11,863,874 | Suppose you had a set of numbers like below:
```
[A,B,C]
[6, 4.5, 6]
[7, 6, 5]
[9, 4.5, 6]
```
Only one number from each set **AND** of a category (A, B, or C) may be used to find the greatest sum. In this case, A=9, B=6, and C=6 will produce the greatest sum of 21. The greatest sum cannot be 22 (9+7+6) because 9 a... | 2012/08/08 | [
"https://Stackoverflow.com/questions/11863874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1584575/"
] | It sounds a bit like the [Eight Queens Puzzle](http://en.wikipedia.org/wiki/Eight_queens_puzzle "Wikipedia"), where you have to place 8 queens on a chessboard without any of them in the path of another. (If you don't know chess, don't fret over the analogy).
Suppose your example array:
```
[6, 4.5, 6]
[7, 6, 5]
[9,... | Here's some ideas about how I would do it.
let's say you store your data in a 2d array of integers
```
int [] [] data = new int [rows] [columns]
```
so in this case columns are A, B, C etc.
You need to iterate like this when searching the maximum:
`data[i][fix]` so the column is fixed and the row is changed in th... |
11,863,874 | Suppose you had a set of numbers like below:
```
[A,B,C]
[6, 4.5, 6]
[7, 6, 5]
[9, 4.5, 6]
```
Only one number from each set **AND** of a category (A, B, or C) may be used to find the greatest sum. In this case, A=9, B=6, and C=6 will produce the greatest sum of 21. The greatest sum cannot be 22 (9+7+6) because 9 a... | 2012/08/08 | [
"https://Stackoverflow.com/questions/11863874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1584575/"
] | One easy way to brute-force search this is to generate all permutations of length N where N is the number of categories. Then, for each permutation, calculate the sum of `Matrix[i][Permutation[i]]` for all i and take the maximum. | Here's some ideas about how I would do it.
let's say you store your data in a 2d array of integers
```
int [] [] data = new int [rows] [columns]
```
so in this case columns are A, B, C etc.
You need to iterate like this when searching the maximum:
`data[i][fix]` so the column is fixed and the row is changed in th... |
11,863,874 | Suppose you had a set of numbers like below:
```
[A,B,C]
[6, 4.5, 6]
[7, 6, 5]
[9, 4.5, 6]
```
Only one number from each set **AND** of a category (A, B, or C) may be used to find the greatest sum. In this case, A=9, B=6, and C=6 will produce the greatest sum of 21. The greatest sum cannot be 22 (9+7+6) because 9 a... | 2012/08/08 | [
"https://Stackoverflow.com/questions/11863874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1584575/"
] | It sounds a bit like the [Eight Queens Puzzle](http://en.wikipedia.org/wiki/Eight_queens_puzzle "Wikipedia"), where you have to place 8 queens on a chessboard without any of them in the path of another. (If you don't know chess, don't fret over the analogy).
Suppose your example array:
```
[6, 4.5, 6]
[7, 6, 5]
[9,... | One easy way to brute-force search this is to generate all permutations of length N where N is the number of categories. Then, for each permutation, calculate the sum of `Matrix[i][Permutation[i]]` for all i and take the maximum. |
55,374,977 | The application I refer to in the component container isn't loaded in a specific case. Any idea what I am doing wrong or what I could do to solve my issue?
These are the steps I take for the problem to occur:
**Step 1: Open popover in worklist**
[](h... | 2019/03/27 | [
"https://Stackoverflow.com/questions/55374977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9291038/"
] | When you attached a `ref` to `<b-form-textarea>`, what you get is the reference to an instance of the `<b-form-textarea>` component and not the `textarea` element which you are trying to access. Refer to
[docs](https://v2.vuejs.org/v2/api/#vm-refs) for more info.
To access the actual `<textarea>` element, you can do i... | I'm new to vue.js so sry if I got something wrong.
Here is what I got after some testing. I replaced `@keydown.native.tab` with `v-on:keydown.tab` and that seems to work without any problems.
```js
new Vue({
el: 'textarea',
methods: {
test: (e) => {
console.log(e.target.selectionStart);
}
}
})... |
46,382,946 | I get this : Incorrect argument label in call (have 'email:password:', expected 'withEmail:password:')
While tryin to sign up user with email and password !!
[](https://i.stack.imgur.com/ozjA4.png)
I have looked at the firebase documents [here](https://firebase.google.com... | 2017/09/23 | [
"https://Stackoverflow.com/questions/46382946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5153471/"
] | I used the autocomplete functionality of Xcode and found that this is the function:
```
EmailAuthProvider.credential(withEmail: String, password: String)
``` | If you are using Authenticate with Firebase using Password-Based Accounts Use this reference
Use this for method instead.
For Create a password-based account
```
Auth.auth().createUser(withEmail: email, password: password) { (user, error) in
// ...
}
```
And For Sign in a user with an email address and password
... |
48,790,349 | I feel like I must be missing something here and would like to find out if there is a better way of doing this.
I've got a directive that basically adds a class to the parent element of a input field. On load I need to check if the input field has a value, you'd think that would be simple...
I've used a few differe... | 2018/02/14 | [
"https://Stackoverflow.com/questions/48790349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1228736/"
] | From what you've told us, I'm not sure you need a custom directive. If you truly want to add the class "active" to the parent of a non-empty input, you can simply do
```
<div [ngClass]={'active': groupForm.get('name').value !== ''}>
<input formControlName="lastName">
</div>
```
You can even omit the `!== ''` as a... | You can use form valueChanges like so:
```
this.myForm.get('lastName').valueChanges.subscribe(val => {
console.log(val);
this.activeStateCheck(val);
});
```
You can use this anywhere in your component, OnInt, or AfterViewInit.
Check this article for more details:
<https://alligator.io/angular/reacti... |
48,790,349 | I feel like I must be missing something here and would like to find out if there is a better way of doing this.
I've got a directive that basically adds a class to the parent element of a input field. On load I need to check if the input field has a value, you'd think that would be simple...
I've used a few differe... | 2018/02/14 | [
"https://Stackoverflow.com/questions/48790349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1228736/"
] | When you said the page take longer than 1 second to load, does it mean it loads data from service to fill in the form?
You can try wrapping your form with `ng-container` and only render the form if the data loading is completed.
Something like
```
<ng-container *ngIf="finishLoading">
// ......
<fieldset cl... | You can use form valueChanges like so:
```
this.myForm.get('lastName').valueChanges.subscribe(val => {
console.log(val);
this.activeStateCheck(val);
});
```
You can use this anywhere in your component, OnInt, or AfterViewInit.
Check this article for more details:
<https://alligator.io/angular/reacti... |
48,790,349 | I feel like I must be missing something here and would like to find out if there is a better way of doing this.
I've got a directive that basically adds a class to the parent element of a input field. On load I need to check if the input field has a value, you'd think that would be simple...
I've used a few differe... | 2018/02/14 | [
"https://Stackoverflow.com/questions/48790349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1228736/"
] | From what you've told us, I'm not sure you need a custom directive. If you truly want to add the class "active" to the parent of a non-empty input, you can simply do
```
<div [ngClass]={'active': groupForm.get('name').value !== ''}>
<input formControlName="lastName">
</div>
```
You can even omit the `!== ''` as a... | To be sure when the value arrives, you must subscribe to the HTMLInputElement input event emitter. With this, you would **never have race conditions** or so. I think it will fit well for your purposes.
```
ngOnInit() {
fromEvent(this.el.nativeElement, 'input').subscribe((event) => activeStateCheck(event.target.val... |
48,790,349 | I feel like I must be missing something here and would like to find out if there is a better way of doing this.
I've got a directive that basically adds a class to the parent element of a input field. On load I need to check if the input field has a value, you'd think that would be simple...
I've used a few differe... | 2018/02/14 | [
"https://Stackoverflow.com/questions/48790349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1228736/"
] | From what you've told us, I'm not sure you need a custom directive. If you truly want to add the class "active" to the parent of a non-empty input, you can simply do
```
<div [ngClass]={'active': groupForm.get('name').value !== ''}>
<input formControlName="lastName">
</div>
```
You can even omit the `!== ''` as a... | When you said the page take longer than 1 second to load, does it mean it loads data from service to fill in the form?
You can try wrapping your form with `ng-container` and only render the form if the data loading is completed.
Something like
```
<ng-container *ngIf="finishLoading">
// ......
<fieldset cl... |
48,790,349 | I feel like I must be missing something here and would like to find out if there is a better way of doing this.
I've got a directive that basically adds a class to the parent element of a input field. On load I need to check if the input field has a value, you'd think that would be simple...
I've used a few differe... | 2018/02/14 | [
"https://Stackoverflow.com/questions/48790349",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1228736/"
] | When you said the page take longer than 1 second to load, does it mean it loads data from service to fill in the form?
You can try wrapping your form with `ng-container` and only render the form if the data loading is completed.
Something like
```
<ng-container *ngIf="finishLoading">
// ......
<fieldset cl... | To be sure when the value arrives, you must subscribe to the HTMLInputElement input event emitter. With this, you would **never have race conditions** or so. I think it will fit well for your purposes.
```
ngOnInit() {
fromEvent(this.el.nativeElement, 'input').subscribe((event) => activeStateCheck(event.target.val... |
1,265,452 | Like the title says,
I want to be able to, on page load, search through the text located inside `#wrapper`.
If there is a "`&`" I want it to have a `span` tag applied to it and a class appended to that `span`.
Ie:
if it finds "`hello & Welcome`"
it should end up like "`hello <span class="amp">&</span> Welcome`".
... | 2009/08/12 | [
"https://Stackoverflow.com/questions/1265452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148174/"
] | Have you looked at [jquery.highlight](http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html)? It seems that it does what you want - the correct way (by searching only within textnodes, etc)
```
$("#wrapper").highlight('&');
```
A little further explanation. Imag... | For ease of reading I would re factor to;
```
var html = $("#wrapper").text().replace(/&/g,'<span class="amp">&</span>');
$("#wrapper").html(html);
```
Although I supposes that's an extra call to the DOM. |
32,180,149 | I am working on a runnable that reads in input from a System stream and analyses the string that comes in, the program works well for a few days and then stops working, I am guessing it might be due to memory leak in my thread, but I cant seem to find it, can anyone suggest if there is something wrong with my code.
`... | 2015/08/24 | [
"https://Stackoverflow.com/questions/32180149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1480128/"
] | If the standard input is provided via a batch redirection, an EOF would cause the program execute the `break`, exiting the `while` loop and ending thus the thread. | Change bufReader to this
```
InputStreamReader iSR = new InputStreamReader(System.in);
BufferedReader bufReader = new BufferedReader(iSR);
```
and close them like so:
```
bufReader.close();
iSR.close();
```
**Note:** Its the answer relevant to your memory leak problem if it exists. |
274,769 | I was reading A.P.French's Special relativity and came across a table of evidence bearing on the nature of light:
I don't get why Bradley's discovery of stellar aberration supports particle theory of light?[](https://i.stack.imgur.com/aD0DF.png) | 2016/08/17 | [
"https://physics.stackexchange.com/questions/274769",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/127447/"
] | Consider a star directly over the North Pole. According to particle model you can think of the light as a rain of particles coming straight down from the star. If you point your telescope (essentially a tube) directly at the star the light particles (or at least some of them) coming straight down will hit the side of t... | Yes M.Enns is true. The particle model is essential even to explain stellar aberration within non-relativistic framework. In relativistic domain the aberration has to include effects of length contraction and time dilation so that we get the relation between altitude of star as measured by two observers in relative mot... |
36,403,166 | I have a search that I'm wanting to exclude any search result that has the name of the "Title" field in the search. For example, say I type in "Contact" in the search bar. I don't want the Contact Us page to come up, but if someone wants to search something that has words in the Contact Us page, then its ok. I am able ... | 2016/04/04 | [
"https://Stackoverflow.com/questions/36403166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2547971/"
] | Use `join` or `in`:
```
SELECT im.meta_name, im.meta_value, COUNT(*)
FROM items i JOIN
items_meta im
ON im.item_id = i.id
WHERE {some conditions are true}
GROUP BY im.meta_name, im.meta_value;
``` | Try this one:
```
SELECT id,
name,
price,
description,
meta_name,
meta_value,
COUNT(*)
FROM items
INNER JOIN items_meta ON items_meta.item_id = items.id
WHERE {SOME conditions ARE TRUE}
GROUP BY meta_name,
meta_value;
``` |
36,403,166 | I have a search that I'm wanting to exclude any search result that has the name of the "Title" field in the search. For example, say I type in "Contact" in the search bar. I don't want the Contact Us page to come up, but if someone wants to search something that has words in the Contact Us page, then its ok. I am able ... | 2016/04/04 | [
"https://Stackoverflow.com/questions/36403166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2547971/"
] | Use `join` or `in`:
```
SELECT im.meta_name, im.meta_value, COUNT(*)
FROM items i JOIN
items_meta im
ON im.item_id = i.id
WHERE {some conditions are true}
GROUP BY im.meta_name, im.meta_value;
``` | Assuming you have a form and retrieve the id of your item you could do this:
```
<?php
// $db being the PDO connection
$stmt_items = $db->query("SELECT id,name,price description FROM items WHERE {some conditions are true};");
$stmt_items_meta = $db->prepare("SELECT meta_name, meta_value,COUNT(*) FROM items_meta... |
36,403,166 | I have a search that I'm wanting to exclude any search result that has the name of the "Title" field in the search. For example, say I type in "Contact" in the search bar. I don't want the Contact Us page to come up, but if someone wants to search something that has words in the Contact Us page, then its ok. I am able ... | 2016/04/04 | [
"https://Stackoverflow.com/questions/36403166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2547971/"
] | Try this one:
```
SELECT id,
name,
price,
description,
meta_name,
meta_value,
COUNT(*)
FROM items
INNER JOIN items_meta ON items_meta.item_id = items.id
WHERE {SOME conditions ARE TRUE}
GROUP BY meta_name,
meta_value;
``` | Assuming you have a form and retrieve the id of your item you could do this:
```
<?php
// $db being the PDO connection
$stmt_items = $db->query("SELECT id,name,price description FROM items WHERE {some conditions are true};");
$stmt_items_meta = $db->prepare("SELECT meta_name, meta_value,COUNT(*) FROM items_meta... |
28,754,086 | Ran into a weird situation were using [array\_walk()](http://php.net/manual/en/function.array-walk.php) will only partially remove matches from my method, not certain exactly what is going on. I am currently using PHP v5.6.4. The issue almost seems to be that it is only removing every secondary match.
The kerning func... | 2015/02/26 | [
"https://Stackoverflow.com/questions/28754086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/411141/"
] | I don't have an ORACLE database to test with, but I can demonstrate something in javascript that you may be able to harness.
demo: <http://jsfiddle.net/knjv9zjp/1/>
```
<(li)>(.*?)<(\/li)>([^>]*)(?=(<li>.*?<\/li>[^>]*)*(?:[^>]*<\/ol>))
```
It did occur to me that you may want to account for attributes of the LI tag... | I think all you need is simple Replace():
```
SELECT REPLACE(
'<ol>
<li>some text</li>
<li>some <strong>more</strong> text</li>
<li>some more text</li>
</ol>
<ul>
<li>even more text</li>
<li>...</li>
</ul>', '<li>', '###li###')
FROM dual
/
```
Output:
```
<ol>
###li###some text</li>
###li###some <s... |
380,035 | I'm trying to build an Ubuntu image using live build:
```
lb config --mode ubuntu --distribution precise --debian-installer true --debian-installer true --debian-installer-gui true
```
I'm getting the following errors:
```
Reading state information...
Package busybox is not available, but is referred to by another ... | 2013/11/20 | [
"https://askubuntu.com/questions/380035",
"https://askubuntu.com",
"https://askubuntu.com/users/217728/"
] | live-builder defaults to only using the "main" component when building its chroots. This is fine for Debian, where all the packages needed to install a base system are present in main. Unfortunately, Ubuntu has put busybox in "universe", so you will need to add `--archive-areas "main universe"` and possibly also `--par... | install then these two for build as mentioned over there.
Just open your terminal and type as
```
sudo apt-get install busybox-static:i386 busybox-static
``` |
22,576,906 | hey guys I've just checked on this new Adobe Bracket code editor.
I want to know is there any book or video series On-line for learning this.
Just like sublime had??
thanks. | 2014/03/22 | [
"https://Stackoverflow.com/questions/22576906",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2729887/"
] | Some resources:
* The ["Getting Started" project](https://github.com/adobe/brackets/blob/master/samples/root/Getting%20Started/index.html) that Brackets opens on first launch is a great overview of Brackets's more unique features (you can usually use the recent-project switcher dropdown to get back to it)
* ["How to U... | Bracket is an Open source software and still at it's infant stage. There is no book avalable yet but you can search for youtube for some presentations and there is a quick preview series on envato too.
thanks. |
7,914,453 | I have a Django app that allows the user to create variables and name them
```
class Product(models.Model):
name = models.CharField(max_length=40, unique=True)
int1_name = models.CharField(max_length=60, blank=True, null=True)
int1_default = models.IntegerField(blank=True, null=True)
int2_name = models... | 2011/10/27 | [
"https://Stackoverflow.com/questions/7914453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/563247/"
] | Don't use `exec` for this! `getattr` is perfectly adequate, much safer, and readable too.
```
class ItemDataForm(ModelForm):
def __init__(self,product,*args,**kwargs):
super(ItemDataForm, self).__init__(*args, **kwargs)
del self.fields['created']
fields = 'int1', 'int2', 'float1', 'float2',... | There maybe better ways but without adding any significant amount of code you can try this:
```
USER_SETTABLE_VARIABLES = ['int1','int2','float1','float2','string1','string2']
for variable in USER_SETTABLE_VARIABLES:
exec("if if product."+variable+":\n\tself.fields['" + variable + "'].label = product."+variable+"\n... |
52,365,970 | I'm working with react native woocommerce API to build an android app. I have completed all major functionalities but I can't remove all products from the cart when I check out is successful.
```
const { cart } = this.props;
```
this props consist of name,image,qty,price and produc id of the products.
I tried
``... | 2018/09/17 | [
"https://Stackoverflow.com/questions/52365970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9994833/"
] | The props in react are readonly which means they cannot be deleted, however you can achieve the functionality you want to implement by setting cart prop in the state and then updating the state.
You can do following:
```
constructor(props){
super(props);
this.state = {
cart: props.cart
}
}
```
and then you... | you can't delete props in react. The props of a react component are immutable and are not supposed to be changed by the component.
If you need to work with the data locally, you could use the state of the component, or better create a local copy of the prop data. |
39,460,282 | I cannot figure out how to vertically center my navbar title.
In the example below (see link), I would like to lower the "Title" such that it is vertically centered within the sticky navbar.
Any help would be much appreciated.
* Jesse
```css
html,
body {
height: 100%;
width: 100%;
margin: 0;
padding: 0... | 2016/09/12 | [
"https://Stackoverflow.com/questions/39460282",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3072722/"
] | ```
.navTitle{
line-height: 50px;
}
```
EDIT:
If you don't want to hard code it you can use table-cells, here is an example of what I mean: <https://jsfiddle.net/aw30L9bh/> | you can set the nav to display:table; and then use vertical to middle:
```
.stickyNav li
{
display:table-cell;
}
.titleClass
{
vertical-align:middle;
}
```
I havent tested this, but it should work in most cases. Unless you have to do a lot of compatibility testing with older browsers.
Then you might as well... |
71,963,726 | I have a Home Component that contains 2 hardcoded routes and 2 mapped ones, I'm parsing the plan object to the Plan component.
```
<Routes>
<Route path='/' element={<Heading>index</Heading>}/>
<Route path='/profile' element={<Profile />}/>
{user &&
user.workoutPlans.map((plan, index) => (... | 2022/04/22 | [
"https://Stackoverflow.com/questions/71963726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14398894/"
] | Don't use the array index as a React key.
When switching plans the route changes, but the `Plan` component remains mounted and only the `plan` prop value updates. This triggers a rerender. ***But*** since the days are using an array index as the React key, the key doesn't change value. Day index 2 in plan "A" is equal... | You should also use exact props with Route `<Heading>` otherwise when you navigate to `/profile` or other routes then Heading will first get call.
For more reference check this link <https://stackoverflow.com/a/49162423/4554623>
```
<Routes>
<Route exact path='/' element={<Heading>index</Heading>} />
<Ro... |
59,465,358 | For the following dataframe I want to recalculate `value` if `predicted` is equal to `1`, it will be calculated based on `pct` of current date and `value` from previous date.
```
city district date value pct predicted
0 a c 2019-09 9.48 0.004237 0
1 a c 2019-10 9.35... | 2019/12/24 | [
"https://Stackoverflow.com/questions/59465358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8410477/"
] | I think you can use:
```
df['value'] = (1 + df['pct']).mul(df.groupby('district')['value'].shift()).fillna(df['value'])
print(df)
city district date value pct predicted
0 a c 2019-09 9.480000 0.004237 0
1 a c 2019-10 9.350001 -0.013713 0
2 a c ... | This seems solved the problem:
```
df.loc[df["predicted"]==1, "value"] = np.nan
while len(df.loc[df['value'].isin(['', np.nan])]) > 0:
df['value'] = (1 + df['pct']).mul(df.groupby('district')['value'].shift()).fillna(df['value'])
df['new_pct'] = df.groupby('district')['value'].apply(lambda x: x.pct_change())
prin... |
64,116,496 | I would like to extract the number after "-" in a string but the problem is that I have two "-" I am not sure how to do this in Php
The string looks like this:
>
> YUH2017-18-510601
>
>
>
I want only 510601 and I want to add 1 to that number.
I tried the following:
```
$ID = "YUH-2017-18-510601";
$ID = substr(... | 2020/09/29 | [
"https://Stackoverflow.com/questions/64116496",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4906944/"
] | Try this:
```
$ID = "YUH-2017-18-510601";
$ID = explode("-",$ID);
$ID = $ID[3];
echo $ID;
``` | Try this it'll always return last number number of string
```
$string = "YUH-2017-18-510601";
$string = explode("-",$string);
echo end($string) +1;
``` |
64,116,496 | I would like to extract the number after "-" in a string but the problem is that I have two "-" I am not sure how to do this in Php
The string looks like this:
>
> YUH2017-18-510601
>
>
>
I want only 510601 and I want to add 1 to that number.
I tried the following:
```
$ID = "YUH-2017-18-510601";
$ID = substr(... | 2020/09/29 | [
"https://Stackoverflow.com/questions/64116496",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4906944/"
] | Try this:
```
$ID = "YUH-2017-18-510601";
$ID = explode("-",$ID);
$ID = $ID[3];
echo $ID;
``` | Given a string:
```
$id = 'YUH-2017-18-510601';
```
We can [split](http://php.net/explode) it to parts:
```
$parts = \explode('-', $id);
```
And get the [last part](http://php.net/end) incremeneted:
```
$nextNumber = 1 + \end($parts);
```
Nothing fancy:
```
echo $nextNumber;
``` |
362,451 | I try to understand the boundary of a set.
I know the definition (Let $A \subseteq \mathbb{R}
$: P is a point of the boundary, if for every small $\epsilon \in \mathbb{R}, \epsilon>0$ are points in $A$ and in $A^c$.
I understood, why the boundary of $(0,1]$ is $\lbrace 0,1 \rbrace$.
Now I'm struggling with $M=\lbra... | 2013/04/15 | [
"https://math.stackexchange.com/questions/362451",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13661/"
] | After some study, it might become clear that the following is a group. But it seemed nonobvious the first time I saw it: the collection of all fractional linear transformations from $\mathbb{C}\cup\{\infty\}$ to itself, with formulas $$z\mapsto\frac{az+b}{cz+d}$$ such that $ad-bc\neq 0$ (in order to guarantee that you ... | If $G$ is a Lie group, with multiplication operator $m:G\times G\rightarrow G$ and inverse $i:G\rightarrow G$, then $TG$ is also a Lie group, with multiplication operator $Tm:TG\times TG\rightarrow TG$ and inverse $Ti:TG\rightarrow TG$. To see this, use the obvious notation that for $v\_g\in T\_g G$ and $h\in G$, $v\_g... |
362,451 | I try to understand the boundary of a set.
I know the definition (Let $A \subseteq \mathbb{R}
$: P is a point of the boundary, if for every small $\epsilon \in \mathbb{R}, \epsilon>0$ are points in $A$ and in $A^c$.
I understood, why the boundary of $(0,1]$ is $\lbrace 0,1 \rbrace$.
Now I'm struggling with $M=\lbra... | 2013/04/15 | [
"https://math.stackexchange.com/questions/362451",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13661/"
] | It's not *obvious* that the collection of integers mod $p$, excluding the coset of $0$, form a group under multiplication. In particular, it's not obvious that inverses exist. You typically use the Euclidean algorithm for that. | At page 6-7 of Yuri I. Manin's [*Cubic forms*](https://books.google.it/books?id=UHjSHUfg38oC&pg=PA7&dq=manin+becomes+an+Abelian+group+with&hl=it&sa=X&ei=HaLOVOG1PKv4ywOCwIBQ&ved=0CCQQ6AEwAA#v=onepage&q=manin%20becomes%20an%20Abelian%20group%20with&f=false) is given an example of abelian group over the set of non singul... |
362,451 | I try to understand the boundary of a set.
I know the definition (Let $A \subseteq \mathbb{R}
$: P is a point of the boundary, if for every small $\epsilon \in \mathbb{R}, \epsilon>0$ are points in $A$ and in $A^c$.
I understood, why the boundary of $(0,1]$ is $\lbrace 0,1 \rbrace$.
Now I'm struggling with $M=\lbra... | 2013/04/15 | [
"https://math.stackexchange.com/questions/362451",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13661/"
] | Here are some examples:
1. The ideal class group of a number field $K$. It is not obvious that this is a group, because for example to be able to invert an ideal requires the definition of an invertible ideal and showing that $\mathfrak{p}\mathfrak{p}^{-1} = \mathcal{O}$. This last part is not trivial and if memory se... | Exotic example can be **rubik's cube** group with cube moves. |
362,451 | I try to understand the boundary of a set.
I know the definition (Let $A \subseteq \mathbb{R}
$: P is a point of the boundary, if for every small $\epsilon \in \mathbb{R}, \epsilon>0$ are points in $A$ and in $A^c$.
I understood, why the boundary of $(0,1]$ is $\lbrace 0,1 \rbrace$.
Now I'm struggling with $M=\lbra... | 2013/04/15 | [
"https://math.stackexchange.com/questions/362451",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13661/"
] | The set of exotic differentiable structures on the $n$-sphere in any given dimension is a group under the operation of connected sum, with the standard sphere being the identity element. Not at all obvious that this forms a group! For example, in dimension 7, this group is isomorphic to $\mathbf{Z}/28$. | I was surprised the first time I saw the group of unit arithmetic functions under Dirichlet convolution. Arithmetic functions are functions $f:\mathbb{N}\rightarrow F$, where $F$ can be any field (but usually $\mathbb{C}$). The operation is $$(f\star g)(n)=\sum\_{d\mid n}f(d)g\left(\frac{n}{d}\right).$$
So, here the id... |
362,451 | I try to understand the boundary of a set.
I know the definition (Let $A \subseteq \mathbb{R}
$: P is a point of the boundary, if for every small $\epsilon \in \mathbb{R}, \epsilon>0$ are points in $A$ and in $A^c$.
I understood, why the boundary of $(0,1]$ is $\lbrace 0,1 \rbrace$.
Now I'm struggling with $M=\lbra... | 2013/04/15 | [
"https://math.stackexchange.com/questions/362451",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13661/"
] | It's not *obvious* that the collection of integers mod $p$, excluding the coset of $0$, form a group under multiplication. In particular, it's not obvious that inverses exist. You typically use the Euclidean algorithm for that. | A subsemigroup of a group is not necessarily a group, but a nonempty subsemigroup of a *finite* group is a group. |
362,451 | I try to understand the boundary of a set.
I know the definition (Let $A \subseteq \mathbb{R}
$: P is a point of the boundary, if for every small $\epsilon \in \mathbb{R}, \epsilon>0$ are points in $A$ and in $A^c$.
I understood, why the boundary of $(0,1]$ is $\lbrace 0,1 \rbrace$.
Now I'm struggling with $M=\lbra... | 2013/04/15 | [
"https://math.stackexchange.com/questions/362451",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13661/"
] | It is not obvious from their definition that [KK-groups](http://en.wikipedia.org/wiki/KK-theory) actually have inverses. | Let $k$ be a field, and let $A$ be a finite type $k$-algebra.
Consider the isomorphism classes of dualizing complexes over $A$.
Given two dualizing complexes $R$ and $S$, define their "product" to be the isomorphism class of the Hochschild cohomology complex of their tensor product over $k$:
$R\cdot S := RHom\_{A\ot... |
362,451 | I try to understand the boundary of a set.
I know the definition (Let $A \subseteq \mathbb{R}
$: P is a point of the boundary, if for every small $\epsilon \in \mathbb{R}, \epsilon>0$ are points in $A$ and in $A^c$.
I understood, why the boundary of $(0,1]$ is $\lbrace 0,1 \rbrace$.
Now I'm struggling with $M=\lbra... | 2013/04/15 | [
"https://math.stackexchange.com/questions/362451",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13661/"
] | It is not obvious from their definition that [KK-groups](http://en.wikipedia.org/wiki/KK-theory) actually have inverses. | [This paper](http://arxiv.org/pdf/0807.4169.pdf) begins describing, in its abstract, a group operation over the set of joint distributions of $k$ random variables in a probability space with given properties. This group is denoted as
$$(\mathcal{G}\_k,\boxtimes).$$ |
362,451 | I try to understand the boundary of a set.
I know the definition (Let $A \subseteq \mathbb{R}
$: P is a point of the boundary, if for every small $\epsilon \in \mathbb{R}, \epsilon>0$ are points in $A$ and in $A^c$.
I understood, why the boundary of $(0,1]$ is $\lbrace 0,1 \rbrace$.
Now I'm struggling with $M=\lbra... | 2013/04/15 | [
"https://math.stackexchange.com/questions/362451",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13661/"
] | 1- **Fourier analysis**: the set of non-vanishing absolutely convergent Fourier series is a group under pointwise multiplication.
The neutral element is the constant function equal to $1$. And product stability follows from Cauchy product. These are straightforward. The existence of inverses is less obvious.
>
> **W... | I think one of the most surprising results of this type is the following (and I could just be very naive): Kervaire and Milnor showed that diffeomorphism classes of oriented exotic spheres form the non-trivial elements of a finite abelian group under the connected sum for dimension not equal to $4$. |
362,451 | I try to understand the boundary of a set.
I know the definition (Let $A \subseteq \mathbb{R}
$: P is a point of the boundary, if for every small $\epsilon \in \mathbb{R}, \epsilon>0$ are points in $A$ and in $A^c$.
I understood, why the boundary of $(0,1]$ is $\lbrace 0,1 \rbrace$.
Now I'm struggling with $M=\lbra... | 2013/04/15 | [
"https://math.stackexchange.com/questions/362451",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13661/"
] | The [Brauer group](http://en.wikipedia.org/wiki/Brauer_group) of a field is not obviously a group in two ways: first it's not obvious that the group is closed under its group operation, and then it's still not obvious that inverses exist. | **Two examples**:
The set of algebraic numbers is a field and it isn't trivial to prove that their sum and multiplication comply to give two groups, in one hand. In the other, consider the Grothendieck group's construction. |
362,451 | I try to understand the boundary of a set.
I know the definition (Let $A \subseteq \mathbb{R}
$: P is a point of the boundary, if for every small $\epsilon \in \mathbb{R}, \epsilon>0$ are points in $A$ and in $A^c$.
I understood, why the boundary of $(0,1]$ is $\lbrace 0,1 \rbrace$.
Now I'm struggling with $M=\lbra... | 2013/04/15 | [
"https://math.stackexchange.com/questions/362451",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13661/"
] | What about the set of line bundles over a manifold? This forms a group, whether your line bundles are real or complex. The difference between them is also very interesting, as one is 2-torsion, and the other can be torsion-free!
Here the group operation is tensor product: showing it is a closed associative operation i... | Another example is mentionned [here](https://math.stackexchange.com/questions/475657/a-special-subgroup-of-groups-of-order-n):
>
> Let $G$ be a finite group of order $n$ and $S \subset G$ be any subset. Then $$S^n = \{s\_1s\_2 \cdots s\_n \mid s\_1, s\_2, \dots, s\_n \in S\}$$ is a subgroup of $G$.
>
>
> |
183,695 | Badges should encourage good behaviour. But what when a badge encourages more bad behaviour than good?
We hear it all the time - robo reviewers, badge-hunters. The review system fights with that users that only want badges and not want to help.
There are many suggestions how to find such robo-reviewers or how to make... | 2013/06/09 | [
"https://meta.stackexchange.com/questions/183695",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/172011/"
] | I agree with Bart's comment here
>
> Maybe passing audits should be part of the higher badges. Fail 2
> audits and your progress towards the silver/gold is reset, or
> something similar. – Bart 1 hour ago
>
>
>
But I would go further and change the Reviewer/Steward Badges to something like:
Completed at least 25... | I don't necessarily think this is a bad idea but, speaking particularly to the close vote queue, [there's so little incentive to work on it as it is](https://meta.stackexchange.com/questions/174358/how-to-make-close-review-queue-less-thankless). We shouldn't remove incentive without adding some incentive. You know, bes... |
183,695 | Badges should encourage good behaviour. But what when a badge encourages more bad behaviour than good?
We hear it all the time - robo reviewers, badge-hunters. The review system fights with that users that only want badges and not want to help.
There are many suggestions how to find such robo-reviewers or how to make... | 2013/06/09 | [
"https://meta.stackexchange.com/questions/183695",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/172011/"
] | Instead of removing these badges (which I am adamantly opposed to), let's do two things:
* Move the goalposts a bit using the audit system, and
* Actually *punish* those that do a poor job of reviewing posts.
I too like Bart's suggestion in that failing two reviews per review queue should be grounds for resetting pro... | I don't necessarily think this is a bad idea but, speaking particularly to the close vote queue, [there's so little incentive to work on it as it is](https://meta.stackexchange.com/questions/174358/how-to-make-close-review-queue-less-thankless). We shouldn't remove incentive without adding some incentive. You know, bes... |
357,030 | >
> Let $n\geqslant2$, and $k\in \mathbb{N}$
>
>
> Let $z\_1,z\_2,..,z\_n$ be distinct complex numbers
>
>
> Prove that
>
>
> $$ \sum\_{i=1}^{n}\frac {{z}\_{i}^{n-1+k}} { \prod \limits\_{\substack{j = 1\\j \ne i}}^{ n }{ (z\_i-z\_j) } } =\large\sum\_{i\_1+i\_2+...+i\_n=k}^{ } {z}\_{1}^{{i}\_{1}} {z}\_{2}^{{i}\_{... | 2013/04/10 | [
"https://math.stackexchange.com/questions/357030",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/66096/"
] | The case $n=2$ is simple. If $z\_i = 0$ for any $i$ then we can prove it by induction. So we suppose that $z\_i \neq 0$ for each $i$.
We choose $R > 0$ such that $|Rz\_i| \leqslant 1$ for each $i$. Then $\displaystyle{ \sum\_{m=0}^{\infty} (xz\_i)^m}$ converges. We have
$\displaystyle{ \prod\_{i=1}^n \sum\_{m=0}^{\... | I would say here thart the difficulty is more in the notations than in the mathematics. I present below
a proof by induction on $n$, where the result for $\lbrace z\_1,z\_2,\ldots,z\_n \rbrace$ is deduced
from the result for $\lbrace z\_1,z\_2,\ldots,z\_{n-1} \rbrace$ and the result for
$\lbrace z\_1,z\_2,\ldots,z\_{n... |
256,737 | For measuring AC current my multimeter has the options:
[](https://i.stack.imgur.com/QDd1O.jpg)
I just wanted to measure an AC current which I expect to be around 1A. Here are the two measurements I did:
[
>
>
>
I'm trying to split a 20Mb string. I've tried using componentsSeparatedByString but it consumes to... | 2011/09/15 | [
"https://Stackoverflow.com/questions/7430781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/940516/"
] | I think that @babbidi had the correct idea. mainHtml is large and you have many autoreleased copies of it around (one copy for each iteration) that are not being released. Try adding the following @autorelease in your code to release all the autoreleased objects at the end of each loop. If you are not using Mac OS X 10... | I don't believe you have any leaks. `substringFromIndex:` returns an autoreleased string, so it might be kept in memory for more then one iteration. You could create your own `substringFromIndex:` method (e.g: `createSubstringFromIndex`) which will return a string retained string which you can manually release.
```
+(... |
1,274,438 | The validation code that i have on my page is:
```
function validateForm() {
with (document.contactform) {
var alertMsg = "The following REQUIRED fields\nhave been left empty:\n";
if (name.value == "") alertMsg += "\nName";
if (email.value == "") alertMsg += "\nEmail";
if (message.v... | 2009/08/13 | [
"https://Stackoverflow.com/questions/1274438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156079/"
] | Change
```
<form id="contactform" onsubmit="return validateForm()" action="" method="post">
```
to
```
<form name="contactform" id="contactform" onsubmit="return validateForm()" action="" method="post">
```
The problem occurs when you try to access `document.contactform`. It's looking for a `form` named `contactf... | one suggestion is try to use document.getElementById("contactform") instead of just document.contactform
I have never used the with command so I am not exactly sure how it is used
{EDIT}
After playing around on your site I believe what I have suggested will fix your problem,
let me know how it goes |
1,274,438 | The validation code that i have on my page is:
```
function validateForm() {
with (document.contactform) {
var alertMsg = "The following REQUIRED fields\nhave been left empty:\n";
if (name.value == "") alertMsg += "\nName";
if (email.value == "") alertMsg += "\nEmail";
if (message.v... | 2009/08/13 | [
"https://Stackoverflow.com/questions/1274438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156079/"
] | Change
```
<form id="contactform" onsubmit="return validateForm()" action="" method="post">
```
to
```
<form name="contactform" id="contactform" onsubmit="return validateForm()" action="" method="post">
```
The problem occurs when you try to access `document.contactform`. It's looking for a `form` named `contactf... | Add `name="contactform"` attribute to the form tag or use `document.getElementById("contactform")`
instead of `document.contactform` |
1,274,438 | The validation code that i have on my page is:
```
function validateForm() {
with (document.contactform) {
var alertMsg = "The following REQUIRED fields\nhave been left empty:\n";
if (name.value == "") alertMsg += "\nName";
if (email.value == "") alertMsg += "\nEmail";
if (message.v... | 2009/08/13 | [
"https://Stackoverflow.com/questions/1274438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156079/"
] | Change
```
<form id="contactform" onsubmit="return validateForm()" action="" method="post">
```
to
```
<form name="contactform" id="contactform" onsubmit="return validateForm()" action="" method="post">
```
The problem occurs when you try to access `document.contactform`. It's looking for a `form` named `contactf... | The problem is with the **validateForm** function.
change:
```
function validateForm() {
with (document.contactform) {
```
to:
```
function validateForm() {
with (document.getElementById('contactform')) {
``` |
391,188 | >
> Consider the surface $\Sigma=\Bbb R^2\big\backslash \big\{(n,0):n\in \Bbb Z\big\}$. Does there exist a proper
> map $f\colon \Sigma\to \Sigma$ of degree $1$ and **not** homotopic to
> any self-homotopy equivalence of $\Sigma$ ?
>
>
>
$\bullet$ Here $H\_\mathbf{c}^2(\Sigma;\Bbb Z)=\Bbb Z$, so for any *proper* m... | 2021/04/26 | [
"https://mathoverflow.net/questions/391188",
"https://mathoverflow.net",
"https://mathoverflow.net/users/172285/"
] | Regarding the "only if" part, a stronger result actually holds: if the quadrilateral $ABCD$ is cyclic, then $PQRS$ is *similar* to $ABCD$, and so it is cyclic, too.
This is stated, without proof, in many elementary geometry textbooks, see for instance at p. 44 of
D. G. Wells: *The Penguin dictionary of curious and in... | The proposition is almost true. Francesco Polizzi has given the "if" part. For the "only if" part, the following is true:
>
> If $P,Q,R,S$ are concyclic then either $P=Q=R=S$ or $A,B,C,D$ are concyclic.
>
>
>
The first case of $P=Q=R=S$ can only happen for non-convex quadrilaterals.
The proof can be done using c... |
391,188 | >
> Consider the surface $\Sigma=\Bbb R^2\big\backslash \big\{(n,0):n\in \Bbb Z\big\}$. Does there exist a proper
> map $f\colon \Sigma\to \Sigma$ of degree $1$ and **not** homotopic to
> any self-homotopy equivalence of $\Sigma$ ?
>
>
>
$\bullet$ Here $H\_\mathbf{c}^2(\Sigma;\Bbb Z)=\Bbb Z$, so for any *proper* m... | 2021/04/26 | [
"https://mathoverflow.net/questions/391188",
"https://mathoverflow.net",
"https://mathoverflow.net/users/172285/"
] | Regarding the "only if" part, a stronger result actually holds: if the quadrilateral $ABCD$ is cyclic, then $PQRS$ is *similar* to $ABCD$, and so it is cyclic, too.
This is stated, without proof, in many elementary geometry textbooks, see for instance at p. 44 of
D. G. Wells: *The Penguin dictionary of curious and in... | Here is a proof using analytic tools, complex numbers, and formulas for the involved points in terms of them.
Points in the plane will be denoted by capital letters like $A,B,C,D;N;P,Q,R,S$ and the corresponding affixes will
be their lower cousins, respectively $a,b,c,d;n;p,q,r,s\in\Bbb C$, and decorations (sub- or upp... |
391,188 | >
> Consider the surface $\Sigma=\Bbb R^2\big\backslash \big\{(n,0):n\in \Bbb Z\big\}$. Does there exist a proper
> map $f\colon \Sigma\to \Sigma$ of degree $1$ and **not** homotopic to
> any self-homotopy equivalence of $\Sigma$ ?
>
>
>
$\bullet$ Here $H\_\mathbf{c}^2(\Sigma;\Bbb Z)=\Bbb Z$, so for any *proper* m... | 2021/04/26 | [
"https://mathoverflow.net/questions/391188",
"https://mathoverflow.net",
"https://mathoverflow.net/users/172285/"
] | This is not an answer but a comment. However, it will be too long and it would be awkward to break it up. It is of course natural to ask what is special about the nine point centre here. One can put the question in the following context. Given the shape of a quadrilateral $ABCD$, what is the shape of $PQRS$ (constructe... | The proposition is almost true. Francesco Polizzi has given the "if" part. For the "only if" part, the following is true:
>
> If $P,Q,R,S$ are concyclic then either $P=Q=R=S$ or $A,B,C,D$ are concyclic.
>
>
>
The first case of $P=Q=R=S$ can only happen for non-convex quadrilaterals.
The proof can be done using c... |
391,188 | >
> Consider the surface $\Sigma=\Bbb R^2\big\backslash \big\{(n,0):n\in \Bbb Z\big\}$. Does there exist a proper
> map $f\colon \Sigma\to \Sigma$ of degree $1$ and **not** homotopic to
> any self-homotopy equivalence of $\Sigma$ ?
>
>
>
$\bullet$ Here $H\_\mathbf{c}^2(\Sigma;\Bbb Z)=\Bbb Z$, so for any *proper* m... | 2021/04/26 | [
"https://mathoverflow.net/questions/391188",
"https://mathoverflow.net",
"https://mathoverflow.net/users/172285/"
] | This is not an answer but a comment. However, it will be too long and it would be awkward to break it up. It is of course natural to ask what is special about the nine point centre here. One can put the question in the following context. Given the shape of a quadrilateral $ABCD$, what is the shape of $PQRS$ (constructe... | Here is a proof using analytic tools, complex numbers, and formulas for the involved points in terms of them.
Points in the plane will be denoted by capital letters like $A,B,C,D;N;P,Q,R,S$ and the corresponding affixes will
be their lower cousins, respectively $a,b,c,d;n;p,q,r,s\in\Bbb C$, and decorations (sub- or upp... |
391,188 | >
> Consider the surface $\Sigma=\Bbb R^2\big\backslash \big\{(n,0):n\in \Bbb Z\big\}$. Does there exist a proper
> map $f\colon \Sigma\to \Sigma$ of degree $1$ and **not** homotopic to
> any self-homotopy equivalence of $\Sigma$ ?
>
>
>
$\bullet$ Here $H\_\mathbf{c}^2(\Sigma;\Bbb Z)=\Bbb Z$, so for any *proper* m... | 2021/04/26 | [
"https://mathoverflow.net/questions/391188",
"https://mathoverflow.net",
"https://mathoverflow.net/users/172285/"
] | The proposition is almost true. Francesco Polizzi has given the "if" part. For the "only if" part, the following is true:
>
> If $P,Q,R,S$ are concyclic then either $P=Q=R=S$ or $A,B,C,D$ are concyclic.
>
>
>
The first case of $P=Q=R=S$ can only happen for non-convex quadrilaterals.
The proof can be done using c... | Here is a proof using analytic tools, complex numbers, and formulas for the involved points in terms of them.
Points in the plane will be denoted by capital letters like $A,B,C,D;N;P,Q,R,S$ and the corresponding affixes will
be their lower cousins, respectively $a,b,c,d;n;p,q,r,s\in\Bbb C$, and decorations (sub- or upp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.