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 |
|---|---|---|---|---|---|
167,559 | I currently have a error in my 1.9.3.2 store.
When a customer wants to reset their password, the Magento Report error page is displayed.
When check the report, I get the following error:
```
a:5:{i:0;s:156:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'customer_flowpassword' doesn't exist, query was: DE... | 2017/04/04 | [
"https://magento.stackexchange.com/questions/167559",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16894/"
] | Run this command :
```
chmod -R 777 var/ pub/
``` | ```
Run this command:
sudo chmod -R 777 var/
``` |
167,559 | I currently have a error in my 1.9.3.2 store.
When a customer wants to reset their password, the Magento Report error page is displayed.
When check the report, I get the following error:
```
a:5:{i:0;s:156:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'customer_flowpassword' doesn't exist, query was: DE... | 2017/04/04 | [
"https://magento.stackexchange.com/questions/167559",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16894/"
] | Change the user for Magento directory and then set permission for all folders
```
sudo chown -R "$USER":www-data /webdirectory
cd <your Magento install dir>
find . -type f -exec chmod 644 {} \; // 644 permission for files
find . -type d -exec chmod 755 {} \; // 755 pe... | Run this command For Ubuntu
---------------------------
sudo chmod -R 777 var/\* pub/\* generated/\* |
167,559 | I currently have a error in my 1.9.3.2 store.
When a customer wants to reset their password, the Magento Report error page is displayed.
When check the report, I get the following error:
```
a:5:{i:0;s:156:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'customer_flowpassword' doesn't exist, query was: DE... | 2017/04/04 | [
"https://magento.stackexchange.com/questions/167559",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16894/"
] | First Set proper permission to your setup as per magento2 [permission](https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html) guidelines.
You need to add your current group to apache user.
**For Ubuntu:**
```
sudo usermod -a -G www-data $USER
```
**For CentOs:**
```
sudo usermod -a -G ... | Run this command :
```
chmod -R 777 var/ pub/
``` |
167,559 | I currently have a error in my 1.9.3.2 store.
When a customer wants to reset their password, the Magento Report error page is displayed.
When check the report, I get the following error:
```
a:5:{i:0;s:156:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'customer_flowpassword' doesn't exist, query was: DE... | 2017/04/04 | [
"https://magento.stackexchange.com/questions/167559",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16894/"
] | First Set proper permission to your setup as per magento2 [permission](https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html) guidelines.
You need to add your current group to apache user.
**For Ubuntu:**
```
sudo usermod -a -G www-data $USER
```
**For CentOs:**
```
sudo usermod -a -G ... | Run this command For Ubuntu
---------------------------
sudo chmod -R 777 var/\* pub/\* generated/\* |
167,559 | I currently have a error in my 1.9.3.2 store.
When a customer wants to reset their password, the Magento Report error page is displayed.
When check the report, I get the following error:
```
a:5:{i:0;s:156:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'customer_flowpassword' doesn't exist, query was: DE... | 2017/04/04 | [
"https://magento.stackexchange.com/questions/167559",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16894/"
] | First Set proper permission to your setup as per magento2 [permission](https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html) guidelines.
You need to add your current group to apache user.
**For Ubuntu:**
```
sudo usermod -a -G www-data $USER
```
**For CentOs:**
```
sudo usermod -a -G ... | Change the user for Magento directory and then set permission for all folders
```
sudo chown -R "$USER":www-data /webdirectory
cd <your Magento install dir>
find . -type f -exec chmod 644 {} \; // 644 permission for files
find . -type d -exec chmod 755 {} \; // 755 pe... |
167,559 | I currently have a error in my 1.9.3.2 store.
When a customer wants to reset their password, the Magento Report error page is displayed.
When check the report, I get the following error:
```
a:5:{i:0;s:156:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'customer_flowpassword' doesn't exist, query was: DE... | 2017/04/04 | [
"https://magento.stackexchange.com/questions/167559",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16894/"
] | First Set proper permission to your setup as per magento2 [permission](https://devdocs.magento.com/guides/v2.3/install-gde/prereq/file-system-perms.html) guidelines.
You need to add your current group to apache user.
**For Ubuntu:**
```
sudo usermod -a -G www-data $USER
```
**For CentOs:**
```
sudo usermod -a -G ... | Check below command for set permission.
```
find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \; && find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \; && chmod u+x bin/magento
``` |
167,559 | I currently have a error in my 1.9.3.2 store.
When a customer wants to reset their password, the Magento Report error page is displayed.
When check the report, I get the following error:
```
a:5:{i:0;s:156:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'customer_flowpassword' doesn't exist, query was: DE... | 2017/04/04 | [
"https://magento.stackexchange.com/questions/167559",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16894/"
] | From Magento DevDocs:
The sections that follow discuss requirements for one or two Magento file system owners. That means:
**One user**: Typically necessary on shared hosting providers, which allow you to access only one user on the server This user can log in, transfer files using FTP, and this user also runs the we... | Run this command For Ubuntu
---------------------------
sudo chmod -R 777 var/\* pub/\* generated/\* |
167,559 | I currently have a error in my 1.9.3.2 store.
When a customer wants to reset their password, the Magento Report error page is displayed.
When check the report, I get the following error:
```
a:5:{i:0;s:156:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'customer_flowpassword' doesn't exist, query was: DE... | 2017/04/04 | [
"https://magento.stackexchange.com/questions/167559",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16894/"
] | Check below command for set permission.
```
find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \; && find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \; && chmod u+x bin/magento
``` | ```
Run this command:
sudo chmod -R 777 var/
``` |
167,559 | I currently have a error in my 1.9.3.2 store.
When a customer wants to reset their password, the Magento Report error page is displayed.
When check the report, I get the following error:
```
a:5:{i:0;s:156:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'customer_flowpassword' doesn't exist, query was: DE... | 2017/04/04 | [
"https://magento.stackexchange.com/questions/167559",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16894/"
] | From Magento DevDocs:
The sections that follow discuss requirements for one or two Magento file system owners. That means:
**One user**: Typically necessary on shared hosting providers, which allow you to access only one user on the server This user can log in, transfer files using FTP, and this user also runs the we... | Change the user for Magento directory and then set permission for all folders
```
sudo chown -R "$USER":www-data /webdirectory
cd <your Magento install dir>
find . -type f -exec chmod 644 {} \; // 644 permission for files
find . -type d -exec chmod 755 {} \; // 755 pe... |
23,122,645 | I need your help,
Is there perhaps a more efficient method to code an SQL statement to connect to the database and retrieve numerical values? My way of logic is this. Use the SQL Count to tally, store the numeric value into a var (similar to excel labelled cells), and then use the vars and output the results to an HTM... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23122645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1474921/"
] | The best place to look is the [spec](http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc335818835). For example,
```
b {
let x = e
op x
}
```
gets translated to
```
T(let x = e in op x, [], fun v -> v, true)
=> T(op x, {x}, fun v -> let x = e in v, true)
=> [| op x, let... | The most complete examples I've seen are in [§6.3.10 of the spec](http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc335818835), especially this one:
```
/// Computations that can cooperatively yield by returning a continuation
type Eventually<'T> =
| Done of 'T
| NotYetDone ... |
23,122,645 | I need your help,
Is there perhaps a more efficient method to code an SQL statement to connect to the database and retrieve numerical values? My way of logic is this. Use the SQL Count to tally, store the numeric value into a var (similar to excel labelled cells), and then use the vars and output the results to an HTM... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23122645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1474921/"
] | The most complete examples I've seen are in [§6.3.10 of the spec](http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc335818835), especially this one:
```
/// Computations that can cooperatively yield by returning a continuation
type Eventually<'T> =
| Done of 'T
| NotYetDone ... | Following a similar struggle to Joel's (and not finding §6.3.10 of the spec that helpful) my issue with getting the For construct to generate a list came down to getting types to line up properly (no special attributes required). In particular I was slow to realise that For would build a list of lists, and therefore ne... |
23,122,645 | I need your help,
Is there perhaps a more efficient method to code an SQL statement to connect to the database and retrieve numerical values? My way of logic is this. Use the SQL Count to tally, store the numeric value into a var (similar to excel labelled cells), and then use the vars and output the results to an HTM... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23122645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1474921/"
] | The best place to look is the [spec](http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc335818835). For example,
```
b {
let x = e
op x
}
```
gets translated to
```
T(let x = e in op x, [], fun v -> v, true)
=> T(op x, {x}, fun v -> let x = e in v, true)
=> [| op x, let... | The tutorial at "F# for fun and profit" is first class in this regard.
<http://fsharpforfunandprofit.com/posts/computation-expressions-intro/> |
23,122,645 | I need your help,
Is there perhaps a more efficient method to code an SQL statement to connect to the database and retrieve numerical values? My way of logic is this. Use the SQL Count to tally, store the numeric value into a var (similar to excel labelled cells), and then use the vars and output the results to an HTM... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23122645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1474921/"
] | The best place to look is the [spec](http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc335818835). For example,
```
b {
let x = e
op x
}
```
gets translated to
```
T(let x = e in op x, [], fun v -> v, true)
=> T(op x, {x}, fun v -> let x = e in v, true)
=> [| op x, let... | Following a similar struggle to Joel's (and not finding §6.3.10 of the spec that helpful) my issue with getting the For construct to generate a list came down to getting types to line up properly (no special attributes required). In particular I was slow to realise that For would build a list of lists, and therefore ne... |
23,122,645 | I need your help,
Is there perhaps a more efficient method to code an SQL statement to connect to the database and retrieve numerical values? My way of logic is this. Use the SQL Count to tally, store the numeric value into a var (similar to excel labelled cells), and then use the vars and output the results to an HTM... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23122645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1474921/"
] | The tutorial at "F# for fun and profit" is first class in this regard.
<http://fsharpforfunandprofit.com/posts/computation-expressions-intro/> | Following a similar struggle to Joel's (and not finding §6.3.10 of the spec that helpful) my issue with getting the For construct to generate a list came down to getting types to line up properly (no special attributes required). In particular I was slow to realise that For would build a list of lists, and therefore ne... |
33,194 | I have a Page layout like this
```
Parent Page
- Sub page 1
-- sub sub 1
-- sub sub 2
-- sub sub 4
- Sub page 2
-- sub sub 1
-- sub sub 2
-- sub sub 4
```
I want to query every single child page, regardless of how deep I go. This is my query but it only returns direct children(sub page 1 and 2)
```
query_posts('pos... | 2011/11/08 | [
"https://wordpress.stackexchange.com/questions/33194",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/9026/"
] | I'm pretty sure you can use `get_pages` (<http://codex.wordpress.org/Function_Reference/get_pages>) function to solve this. It has `child_of` parameter which does exactly what you wanted.
The only problem is that it returns posts and not set `$wp_query`, so you can't use it as loop, but you can always call `setup_post... | try this
```
function wpse33151_getSubpages() {
global $post;
$parents = get_post_ancestors($post->post_id);
krsort($parents);
$parents = array_merge(array(), $parents);
if (is_home() || is_single()) {
$id = get_option('page_for_posts');
$parent = get_post_ancestors($id);
... |
60,390,234 | I am very new to Laravel and working on a project. I have a user table,category table(category\_id,category\_name) and pets table(id,user\_id,category\_id,breed,description....).How can i make the user add post and make his id and cagtegory\_id that he had chosen from select option save in user\_id and category\_id in ... | 2020/02/25 | [
"https://Stackoverflow.com/questions/60390234",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11399857/"
] | Your problem comes from your data :
* Your are trying to outputs 14 879 values from an input of shape (batch\_size, 100), it's impossible for your network to be able to learn something from your data.
* As said by @Nopileos, a batch size of 10 000 is way way too hudge, i don't think you have hundred of millions inputs... | If you are running out of memory, decrease your chunk size. Lower it to 10, and see if that works. Larger chunk size means your computer has to hold more information in RAM at one time. |
376,431 | Let $\beta\omega$ be collection of all ultrafilters on $\omega$ (principal and non-principal). We endow $\beta\omega$ with an operation $+$ in the following way. For ${\bf a}, {\bf b}\in \beta\omega$, set $${\bf a}+{\bf b} = \big\{ N\subseteq \omega:\{x \in \omega:\{y\in\omega: x+y\in N\}\in {\bf b}\}\in {\bf a}\big\}.... | 2020/11/13 | [
"https://mathoverflow.net/questions/376431",
"https://mathoverflow.net",
"https://mathoverflow.net/users/8628/"
] | No. Kunen proved that there are many weak P-points in $\beta\omega-\omega$, which means they are nonprincipal ultrafilters that are not in the closure of any countable set of other nonprincipal ultrafilters. In particular, a weak P-point is never a sum of nonprincipal ultrafilters because $\mathbf a+\mathbf b$ is in th... | Write $(\alpha x)\ P(x)$ for the statement $\{x:P(x)\}\in\alpha$. Now suppose that the set $\{1,2,4,8,\dots\}\in\alpha$. If $\beta+\gamma=\alpha$, then $(\beta x)\ (\gamma y)\ x+y\in\{1,2,4,8,\dots\}$. In particular, if $\beta$ is non-principal, then there must exist $x\_1\ne x\_2$ such that $(\gamma y)\ x\_1+y\in\{1,2... |
58,375,636 | I have a list with two elements
element 1:
```
no:1,
vendor: a,
Description: Nice,
price :10
```
element 2:
```
no:1
vendor:a,
Description: Nice,
price:20
```
i have lot more fields in list elements so i cannot use new to sum the price
if everything is same except price i need to combine two elements into a ... | 2019/10/14 | [
"https://Stackoverflow.com/questions/58375636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6398876/"
] | I couldn't get `@ApiModelProperty(dataType = "")` to work, but I found a more convenient way configuring a direct substitute in the Swagger configuration using `directModelSubstitute` method of the `Docket` instance in [this response](https://stackoverflow.com/a/29355873/469218).
```
@Configuration
@EnableSwagger2
cla... | For OpenApi (Swagger 3.0) and SpringDoc the following global configuration could be used.
```
static {
SpringDocUtils.getConfig().replaceWithSchema(ObjectId.class, new StringSchema());
}
``` |
3,360,772 | This code is case sensitive, how to make it case insensitive?
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM.Where(fi => fi.DESCRIPTION.Contains(description));
}
``` | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351564/"
] | Using C# 6.0 (which allows expression bodied functions and null propagation), for LINQ to Objects, it can be done in a single line like this (also checking for null):
```
public static bool ContainsInsensitive(this string str, string value) => str?.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0;
``` | ```
public static bool Contains(this string input, string findMe, StringComparison comparisonType)
{
return String.IsNullOrWhiteSpace(input) ? false : input.IndexOf(findMe, comparisonType) > -1;
}
``` |
3,360,772 | This code is case sensitive, how to make it case insensitive?
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM.Where(fi => fi.DESCRIPTION.Contains(description));
}
``` | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351564/"
] | ```
fi => fi.DESCRIPTION.ToLower().Contains(description.ToLower())
``` | Use **String.Equals** Method
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM
.Where(fi => fi.DESCRIPTION
.Equals(description, StringComparison.OrdinalIgnoreCase));
}
``` |
3,360,772 | This code is case sensitive, how to make it case insensitive?
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM.Where(fi => fi.DESCRIPTION.Contains(description));
}
``` | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351564/"
] | You can use string.Compare
```
lst.Where(x => string.Compare(x,"valueToCompare",StringComparison.InvariantCultureIgnoreCase)==0);
```
if you just want to check contains then use "Any"
```
lst.Any(x => string.Compare(x,"valueToCompare",StringComparison.InvariantCultureIgnoreCase)==0)
``` | Use **String.Equals** Method
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM
.Where(fi => fi.DESCRIPTION
.Equals(description, StringComparison.OrdinalIgnoreCase));
}
``` |
3,360,772 | This code is case sensitive, how to make it case insensitive?
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM.Where(fi => fi.DESCRIPTION.Contains(description));
}
``` | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351564/"
] | ```
fi => fi.DESCRIPTION.ToLower().Contains(description.ToLower())
``` | Using C# 6.0 (which allows expression bodied functions and null propagation), for LINQ to Objects, it can be done in a single line like this (also checking for null):
```
public static bool ContainsInsensitive(this string str, string value) => str?.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0;
``` |
3,360,772 | This code is case sensitive, how to make it case insensitive?
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM.Where(fi => fi.DESCRIPTION.Contains(description));
}
``` | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351564/"
] | >
> [StringComparison.InvariantCultureIgnoreCase](https://learn.microsoft.com/en-us/dotnet/api/system.stringcomparer.invariantcultureignorecase?view=netframework-4.8) just do the job for me:
>
>
>
```
.Where(fi => fi.DESCRIPTION.Contains(description, StringComparison.InvariantCultureIgnoreCase));
``` | Use **String.Equals** Method
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM
.Where(fi => fi.DESCRIPTION
.Equals(description, StringComparison.OrdinalIgnoreCase));
}
``` |
3,360,772 | This code is case sensitive, how to make it case insensitive?
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM.Where(fi => fi.DESCRIPTION.Contains(description));
}
``` | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351564/"
] | If the LINQ query is executed in database context, a call to `Contains()` is mapped to the `LIKE` operator:
`.Where(a => a.Field.Contains("hello"))`
becomes `Field LIKE '%hello%'`. The `LIKE` operator is case insensitive by default, but that can be changed by [changing the collation of the column](https://clicdatacod... | >
> [StringComparison.InvariantCultureIgnoreCase](https://learn.microsoft.com/en-us/dotnet/api/system.stringcomparer.invariantcultureignorecase?view=netframework-4.8) just do the job for me:
>
>
>
```
.Where(fi => fi.DESCRIPTION.Contains(description, StringComparison.InvariantCultureIgnoreCase));
``` |
3,360,772 | This code is case sensitive, how to make it case insensitive?
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM.Where(fi => fi.DESCRIPTION.Contains(description));
}
``` | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351564/"
] | Assuming we're working with strings here, here's another "elegant" solution using `IndexOf()`.
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM
.Where(fi => fi.DESCRIPTION
.IndexOf(description, StringC... | Honestly, this doesn't need to be difficult. It may seem that on the onset, but it's not. Here's a simple linq query in C# that does exactly as requested.
In my example, I'm working against a list of persons that have one property called FirstName.
```
var results = ClientsRepository().Where(c => c.FirstName.ToLower... |
3,360,772 | This code is case sensitive, how to make it case insensitive?
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM.Where(fi => fi.DESCRIPTION.Contains(description));
}
``` | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351564/"
] | Using C# 6.0 (which allows expression bodied functions and null propagation), for LINQ to Objects, it can be done in a single line like this (also checking for null):
```
public static bool ContainsInsensitive(this string str, string value) => str?.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0;
``` | You can use string.Compare
```
lst.Where(x => string.Compare(x,"valueToCompare",StringComparison.InvariantCultureIgnoreCase)==0);
```
if you just want to check contains then use "Any"
```
lst.Any(x => string.Compare(x,"valueToCompare",StringComparison.InvariantCultureIgnoreCase)==0)
``` |
3,360,772 | This code is case sensitive, how to make it case insensitive?
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM.Where(fi => fi.DESCRIPTION.Contains(description));
}
``` | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351564/"
] | ```
fi => fi.DESCRIPTION.ToLower().Contains(description.ToLower())
``` | ```
public static bool Contains(this string input, string findMe, StringComparison comparisonType)
{
return String.IsNullOrWhiteSpace(input) ? false : input.IndexOf(findMe, comparisonType) > -1;
}
``` |
3,360,772 | This code is case sensitive, how to make it case insensitive?
```
public IQueryable<FACILITY_ITEM> GetFacilityItemRootByDescription(string description)
{
return this.ObjectContext.FACILITY_ITEM.Where(fi => fi.DESCRIPTION.Contains(description));
}
``` | 2010/07/29 | [
"https://Stackoverflow.com/questions/3360772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/351564/"
] | IndexOf works best in this case
```
return this
.ObjectContext
.FACILITY_ITEM
.Where(fi => fi.DESCRIPTION.IndexOf(description, StringComparison.OrdinalIgnoreCase)>=0);
``` | You can use string.Compare
```
lst.Where(x => string.Compare(x,"valueToCompare",StringComparison.InvariantCultureIgnoreCase)==0);
```
if you just want to check contains then use "Any"
```
lst.Any(x => string.Compare(x,"valueToCompare",StringComparison.InvariantCultureIgnoreCase)==0)
``` |
15,555,800 | is there anything wrong with this coffee script? Its working fine on this fiddle
<http://jsfiddle.net/Dtwigs/ThnKc/2/>
but when i try to convert it to coffee script it does not want to seem to work
```
$(document).on "change", "#print_size_options_LargeFormatBlackWhite", (event) ->
selected = undefined
index = ... | 2013/03/21 | [
"https://Stackoverflow.com/questions/15555800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1502223/"
] | There are a few issues with your fiddle.
1. You're using the same ID for multiple elements - you should make it a class.
2. You're adding the change event to the document, it's probably better to add it to a more precise selector, namely the selects.
3. If you're going to write it in JS in the first place, there's not... | The only difference I can see is that you write (event) here when on fiddle is (evt).
Are you considering using <http://js2coffee.org/> for the conversion? |
41,507 | >
> **Possible Duplicate:**
>
> [Is it possible to go back in time?](https://physics.stackexchange.com/questions/2166/is-it-possible-to-go-back-in-time)
>
> [Is time travel possible?](https://physics.stackexchange.com/questions/7823/is-time-travel-possible)
>
>
>
According to Stephen Hawking, time travel to... | 2012/10/23 | [
"https://physics.stackexchange.com/questions/41507",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/14310/"
] | >
> **Does Stephen Hawking not believe in Negative movement?**
>
>
>
Yes,
...
Stephen Hawking does not believe that it is possible to travel into the past.
>
> We are all travelling forward in time anyway. We can fast forward by going off in a rocket at high speed and return to find everyone on Earth much olde... | We know time travel to the future is possible because we all do it. More specifically, we know time travel to the future at a rate faster than one second per second is possible because particles in the Large Hadron Collider do it.
Time travel to the past is a different matter because it implies we could create [closed... |
21,207 | I have a Capital One credit card that I got in college with a limit of $1,300 and a $39 annual fee. They've never raised the limit for me over the years even though my credit score is north of 700. I have a balance of $0 and I haven't used the card in years.
I wanted to close that card and get a different card, someth... | 2013/03/19 | [
"https://money.stackexchange.com/questions/21207",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/9506/"
] | Sorry to hear about your difficult circumstances.
**Secured Credit Card**
You may want to suggest a secured credit card. These are credit cards that are backed by a deposit that she would place with the credit issuer. The card issuer provides a line of credit backed by the deposit, with a credit limit not greater tha... | I've read multiple times that the way to rebuild the credit score is to get a credit card and then have some minor charges on it every month and have them paid in full every month. Old negative events age and this disciplined activity rebuild the score to some not to horrible levels.
Now it's true that it's hard to ge... |
21,207 | I have a Capital One credit card that I got in college with a limit of $1,300 and a $39 annual fee. They've never raised the limit for me over the years even though my credit score is north of 700. I have a balance of $0 and I haven't used the card in years.
I wanted to close that card and get a different card, someth... | 2013/03/19 | [
"https://money.stackexchange.com/questions/21207",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/9506/"
] | Sorry to hear about your difficult circumstances.
**Secured Credit Card**
You may want to suggest a secured credit card. These are credit cards that are backed by a deposit that she would place with the credit issuer. The card issuer provides a line of credit backed by the deposit, with a credit limit not greater tha... | I was in the same chicken and egg situation regarding credit cards. I did two things:
1. I got a credit card from [Capital One](https://www.capitalone.com/) that had a $60 annual fee in exchange for not caring that my credit history was bad. I used that card to pay for everything to build my credit history back up.
2.... |
21,207 | I have a Capital One credit card that I got in college with a limit of $1,300 and a $39 annual fee. They've never raised the limit for me over the years even though my credit score is north of 700. I have a balance of $0 and I haven't used the card in years.
I wanted to close that card and get a different card, someth... | 2013/03/19 | [
"https://money.stackexchange.com/questions/21207",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/9506/"
] | Sorry to hear about your difficult circumstances.
**Secured Credit Card**
You may want to suggest a secured credit card. These are credit cards that are backed by a deposit that she would place with the credit issuer. The card issuer provides a line of credit backed by the deposit, with a credit limit not greater tha... | I want to be a bit contrarian here. It may be true that to rebuild credit it *helps* to have credit, but it's not the most important thing. If your description of your wife's history is correct, the most important thing is to fix her tendency to 'spend out of control', especially on get-rich-quick schemes. She may well... |
62,966,802 | I'm trying to check how many slashes the window URL contains.
```
//var url = "www.myurl.com/segment1/segment2segment3";
var url = windowURL.indexOf.href;
var segment = url.split("/").length - 1 - (url.indexOf("http://")==-1?0:2);
alert(segment);
```
This gives errors of saying windowURL is not defined. Any ideas?
... | 2020/07/18 | [
"https://Stackoverflow.com/questions/62966802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4908082/"
] | findbars
--------
The lme4 package provides `findbars`:
```
library(lme4)
fo <- Y~X1+(1|fac1)+(1|fac2)
findbars(fo)
## [[1]]
## 1 | fac1
##
## [[2]]
## 1 | fac2
```
If character strings are needed we can use the following. `deparse1` will handle certain uncommon cases that `deparse` fails at but `deparse` will mo... | No regex required , however, it's still string manipulation.
```
# stringsplit the output of your formula()
# remove the first entry
# remove spaces with gsub()
# paste it back together
inp <- "X1 + (1| fac1) + (1| fac2)"
paste(gsub(" ", "", unlist(strsplit(inp, "+", fixed = T))[-1], fixed = T),
collapse = "... |
62,966,802 | I'm trying to check how many slashes the window URL contains.
```
//var url = "www.myurl.com/segment1/segment2segment3";
var url = windowURL.indexOf.href;
var segment = url.split("/").length - 1 - (url.indexOf("http://")==-1?0:2);
alert(segment);
```
This gives errors of saying windowURL is not defined. Any ideas?
... | 2020/07/18 | [
"https://Stackoverflow.com/questions/62966802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4908082/"
] | No regex required , however, it's still string manipulation.
```
# stringsplit the output of your formula()
# remove the first entry
# remove spaces with gsub()
# paste it back together
inp <- "X1 + (1| fac1) + (1| fac2)"
paste(gsub(" ", "", unlist(strsplit(inp, "+", fixed = T))[-1], fixed = T),
collapse = "... | After seeing G Grthendieck's answer I realise I'm probably reinventing the wheel, but here's a way to get the random effects parts out of a model without using regex. It uses recursion to examine each call in the formula's AST and keeps only those in parentheses, which it then rebuilds into an expression. I may be wron... |
62,966,802 | I'm trying to check how many slashes the window URL contains.
```
//var url = "www.myurl.com/segment1/segment2segment3";
var url = windowURL.indexOf.href;
var segment = url.split("/").length - 1 - (url.indexOf("http://")==-1?0:2);
alert(segment);
```
This gives errors of saying windowURL is not defined. Any ideas?
... | 2020/07/18 | [
"https://Stackoverflow.com/questions/62966802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4908082/"
] | No regex required , however, it's still string manipulation.
```
# stringsplit the output of your formula()
# remove the first entry
# remove spaces with gsub()
# paste it back together
inp <- "X1 + (1| fac1) + (1| fac2)"
paste(gsub(" ", "", unlist(strsplit(inp, "+", fixed = T))[-1], fixed = T),
collapse = "... | You can use the [insight-package](https://easystats.github.io/insight/) to access various model information, like formula, predictors, data etc. *insight* provides type-safe "generics" that work for many different models. In this case, you could use `find_formula()` or `find_random()`:
```r
library(insight)
library(lm... |
62,966,802 | I'm trying to check how many slashes the window URL contains.
```
//var url = "www.myurl.com/segment1/segment2segment3";
var url = windowURL.indexOf.href;
var segment = url.split("/").length - 1 - (url.indexOf("http://")==-1?0:2);
alert(segment);
```
This gives errors of saying windowURL is not defined. Any ideas?
... | 2020/07/18 | [
"https://Stackoverflow.com/questions/62966802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4908082/"
] | findbars
--------
The lme4 package provides `findbars`:
```
library(lme4)
fo <- Y~X1+(1|fac1)+(1|fac2)
findbars(fo)
## [[1]]
## 1 | fac1
##
## [[2]]
## 1 | fac2
```
If character strings are needed we can use the following. `deparse1` will handle certain uncommon cases that `deparse` fails at but `deparse` will mo... | A simple solution that may not generalise:
```
# This model may not make much sense, just for reproducibility
mymodel <- lmer(Petal.Length~Sepal.Width+(1|Species) + (1|Petal.Width),iris)
stringr::str_extract_all(formula(mymodel),"\\(.*\\)")[3]
[[1]]
[1] "(1 | Species) + (1 | Petal.Width)"
```
To "automat... |
62,966,802 | I'm trying to check how many slashes the window URL contains.
```
//var url = "www.myurl.com/segment1/segment2segment3";
var url = windowURL.indexOf.href;
var segment = url.split("/").length - 1 - (url.indexOf("http://")==-1?0:2);
alert(segment);
```
This gives errors of saying windowURL is not defined. Any ideas?
... | 2020/07/18 | [
"https://Stackoverflow.com/questions/62966802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4908082/"
] | A simple solution that may not generalise:
```
# This model may not make much sense, just for reproducibility
mymodel <- lmer(Petal.Length~Sepal.Width+(1|Species) + (1|Petal.Width),iris)
stringr::str_extract_all(formula(mymodel),"\\(.*\\)")[3]
[[1]]
[1] "(1 | Species) + (1 | Petal.Width)"
```
To "automat... | After seeing G Grthendieck's answer I realise I'm probably reinventing the wheel, but here's a way to get the random effects parts out of a model without using regex. It uses recursion to examine each call in the formula's AST and keeps only those in parentheses, which it then rebuilds into an expression. I may be wron... |
62,966,802 | I'm trying to check how many slashes the window URL contains.
```
//var url = "www.myurl.com/segment1/segment2segment3";
var url = windowURL.indexOf.href;
var segment = url.split("/").length - 1 - (url.indexOf("http://")==-1?0:2);
alert(segment);
```
This gives errors of saying windowURL is not defined. Any ideas?
... | 2020/07/18 | [
"https://Stackoverflow.com/questions/62966802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4908082/"
] | A simple solution that may not generalise:
```
# This model may not make much sense, just for reproducibility
mymodel <- lmer(Petal.Length~Sepal.Width+(1|Species) + (1|Petal.Width),iris)
stringr::str_extract_all(formula(mymodel),"\\(.*\\)")[3]
[[1]]
[1] "(1 | Species) + (1 | Petal.Width)"
```
To "automat... | You can use the [insight-package](https://easystats.github.io/insight/) to access various model information, like formula, predictors, data etc. *insight* provides type-safe "generics" that work for many different models. In this case, you could use `find_formula()` or `find_random()`:
```r
library(insight)
library(lm... |
62,966,802 | I'm trying to check how many slashes the window URL contains.
```
//var url = "www.myurl.com/segment1/segment2segment3";
var url = windowURL.indexOf.href;
var segment = url.split("/").length - 1 - (url.indexOf("http://")==-1?0:2);
alert(segment);
```
This gives errors of saying windowURL is not defined. Any ideas?
... | 2020/07/18 | [
"https://Stackoverflow.com/questions/62966802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4908082/"
] | findbars
--------
The lme4 package provides `findbars`:
```
library(lme4)
fo <- Y~X1+(1|fac1)+(1|fac2)
findbars(fo)
## [[1]]
## 1 | fac1
##
## [[2]]
## 1 | fac2
```
If character strings are needed we can use the following. `deparse1` will handle certain uncommon cases that `deparse` fails at but `deparse` will mo... | After seeing G Grthendieck's answer I realise I'm probably reinventing the wheel, but here's a way to get the random effects parts out of a model without using regex. It uses recursion to examine each call in the formula's AST and keeps only those in parentheses, which it then rebuilds into an expression. I may be wron... |
62,966,802 | I'm trying to check how many slashes the window URL contains.
```
//var url = "www.myurl.com/segment1/segment2segment3";
var url = windowURL.indexOf.href;
var segment = url.split("/").length - 1 - (url.indexOf("http://")==-1?0:2);
alert(segment);
```
This gives errors of saying windowURL is not defined. Any ideas?
... | 2020/07/18 | [
"https://Stackoverflow.com/questions/62966802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4908082/"
] | findbars
--------
The lme4 package provides `findbars`:
```
library(lme4)
fo <- Y~X1+(1|fac1)+(1|fac2)
findbars(fo)
## [[1]]
## 1 | fac1
##
## [[2]]
## 1 | fac2
```
If character strings are needed we can use the following. `deparse1` will handle certain uncommon cases that `deparse` fails at but `deparse` will mo... | You can use the [insight-package](https://easystats.github.io/insight/) to access various model information, like formula, predictors, data etc. *insight* provides type-safe "generics" that work for many different models. In this case, you could use `find_formula()` or `find_random()`:
```r
library(insight)
library(lm... |
62,966,802 | I'm trying to check how many slashes the window URL contains.
```
//var url = "www.myurl.com/segment1/segment2segment3";
var url = windowURL.indexOf.href;
var segment = url.split("/").length - 1 - (url.indexOf("http://")==-1?0:2);
alert(segment);
```
This gives errors of saying windowURL is not defined. Any ideas?
... | 2020/07/18 | [
"https://Stackoverflow.com/questions/62966802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4908082/"
] | After seeing G Grthendieck's answer I realise I'm probably reinventing the wheel, but here's a way to get the random effects parts out of a model without using regex. It uses recursion to examine each call in the formula's AST and keeps only those in parentheses, which it then rebuilds into an expression. I may be wron... | You can use the [insight-package](https://easystats.github.io/insight/) to access various model information, like formula, predictors, data etc. *insight* provides type-safe "generics" that work for many different models. In this case, you could use `find_formula()` or `find_random()`:
```r
library(insight)
library(lm... |
8,736,137 | I'm using the JQuery UI datepicker plugin with
```
changeMonth: true,
changeYear: true
```
But the text field that holds the date only updates when the user actually clicks a day. If the user selects a month and year and then clicks outside the datepicker popup, I want the field to contain the first day of the month... | 2012/01/05 | [
"https://Stackoverflow.com/questions/8736137",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/692456/"
] | You could populate the text of the field yourself by defining the onChangeMonthYear callback function
From the docs:
onChangeMonthYear: Allows you to define your own event when the datepicker moves to a new month and/or year. The function receives the selected year, month (1-12), and the datepicker instance as paramet... | mybe you can use something like this:
```
$('.selector').datepicker({
onChangeMonthYear: function(year, month, inst) {
var day = $(this).datepicker('getDate').getDate();
$(this).datepicker( "setDate", month+'/'+day+'/'+year);
}
});
```
Be carefully with location date format.
Complete example... |
49,167,367 | I have two query results.I need to merge the query result based on a condition.
```
$portfolio = DB::table('architects_portfolio')->get();
$img=DB::table('architects_portfolio_images')
->distinct()->get(['architects_images_id']);
```
and my condition to merge is
```
architects_portfolio.id = architects... | 2018/03/08 | [
"https://Stackoverflow.com/questions/49167367",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9418590/"
] | ```
$querys = DB::table('architects_portfolio');
$querys->select('architects_portfolio_images.architects_images_id');
$querys->join('architects_portfolio','architects_portfolio.id','=','architects_portfolio_images.architects_images_id')->distinct()->get();
``` | The best way is to use [relationships](https://laravel.com/docs/5.6/eloquent-relationships), then you could just load portfolios with related images:
```
$portfolios = ArhitectPortfolio::with('images')->get();
```
To make it work, you just need to define the `images` relationship in the `ArhitectPortfolio` model:
`... |
49,167,367 | I have two query results.I need to merge the query result based on a condition.
```
$portfolio = DB::table('architects_portfolio')->get();
$img=DB::table('architects_portfolio_images')
->distinct()->get(['architects_images_id']);
```
and my condition to merge is
```
architects_portfolio.id = architects... | 2018/03/08 | [
"https://Stackoverflow.com/questions/49167367",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9418590/"
] | You should try this:
```
$rsltArchitectDetails = DB::table('architects_portfolio')
->select('architects_portfolio_images.architects_images_id')
->join('architects_portfolio_images', 'architects_portfolio.id' , '=', 'architects_portfolio_images.architects_images_id')
... | The best way is to use [relationships](https://laravel.com/docs/5.6/eloquent-relationships), then you could just load portfolios with related images:
```
$portfolios = ArhitectPortfolio::with('images')->get();
```
To make it work, you just need to define the `images` relationship in the `ArhitectPortfolio` model:
`... |
49,167,367 | I have two query results.I need to merge the query result based on a condition.
```
$portfolio = DB::table('architects_portfolio')->get();
$img=DB::table('architects_portfolio_images')
->distinct()->get(['architects_images_id']);
```
and my condition to merge is
```
architects_portfolio.id = architects... | 2018/03/08 | [
"https://Stackoverflow.com/questions/49167367",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9418590/"
] | Instead of merging we can make use of following code
```
$data = Architect::where("user_id", $user_id)->first();
$architect = User::find($user_id)->architect;
$portfolio = ArchitectsPortfolio::where('architects_portfolio.architects_id', $architect->id)->paginate(6);
foreach ($portfolio as $r) {
... | The best way is to use [relationships](https://laravel.com/docs/5.6/eloquent-relationships), then you could just load portfolios with related images:
```
$portfolios = ArhitectPortfolio::with('images')->get();
```
To make it work, you just need to define the `images` relationship in the `ArhitectPortfolio` model:
`... |
43,120,132 | There is a question I always ask myself when I'm using a Factory pattern inside my code (C#, but it applies to any language I suppose).
I have a "Service" that takes care of interacting with my database, do stuff with objects and interacts with my object model.
This Service uses a Factory sometimes to delegate the in... | 2017/03/30 | [
"https://Stackoverflow.com/questions/43120132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2432679/"
] | The idea of passing the database context into the factory create method is called method injection. This is a form of dependency injection, so you are on the right track.
You can use dependency injection to manage your database context inside of your factory via the constructor. The factory could look something like t... | In the project I am working on, we try to keep all database access inside the Service. If the Factory needs objects that must be loaded from the DB, the Service should load them and pass them to the Factory. If the object returned by the Factory shall be persisted, the Service should add it to the DbContext.
This corr... |
54,189,829 | I am writing a recursive function that will create empty buckets according to n. However my code is not working. No matter what n is it'll only print none.
Can someone help me with where I am going wrong?
for example if n is 5 it should print [[], [], [], [], []]
```
def emptyBuckets(n):
assert n > 0
... | 2019/01/14 | [
"https://Stackoverflow.com/questions/54189829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10875651/"
] | ```
$form = $this->createForm(MyFormType::class);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
/**
* Do your stuff when form is valid
*/
} else {
/**
* Here you can get the input data even failed with $form->getData()
*/
dump($form->getData());
}
```... | $advert = new Advert();
```
$form = $this->createForm(AdvertType::class, $advert, ['method' => 'POST'])
->handleRequest($request);
if (false === $form->isSubmitted()) {
$form->submit([]);
}
if (false === $form->isValid()) {
return ['form' => $form];
}
$manager = $this... |
54,189,829 | I am writing a recursive function that will create empty buckets according to n. However my code is not working. No matter what n is it'll only print none.
Can someone help me with where I am going wrong?
for example if n is 5 it should print [[], [], [], [], []]
```
def emptyBuckets(n):
assert n > 0
... | 2019/01/14 | [
"https://Stackoverflow.com/questions/54189829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10875651/"
] | ```
$form = $this->createForm(MyFormType::class);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
/**
* Do your stuff when form is valid
*/
} else {
/**
* Here you can get the input data even failed with $form->getData()
*/
dump($form->getData());
}
```... | I needed something like below, in my form type class eg. DocType in buildForm() method I did:
```
$request = Request::createFromGlobals();
$myObjectId = $request->request->get('doc')['object']; // selected option of the first dropdown
$object = ($obectId) ? $objectRepository->find($objectId) : null;
```
Then I coul... |
61,247,862 | I want to convert sql query to entity framework core.
SQL query is
```
select * from Departments where id in(select DepartmentId from SubDepartments where id in(select SubDeptId from Tests where id in(select TestId from PatientTests where PatientId=3)))
``` | 2020/04/16 | [
"https://Stackoverflow.com/questions/61247862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6288727/"
] | You've got a few things to address here so lets break it down a little bit.
1) When you call `upload_to_s3()` you need to call it with the function parameters you've declared it with, a filename and a bucket key. So it would be `upload_to_s3(filename, bucket_key)` for example.
2) It's a been a while since I used Wind... | I guess you are using put\_object() the wrong way. It is used to save an **'object'** on s3 & **not a file** i.e you need to first read the file content using pandas.read\_csv() or something else & then replace the 'Body' part with the object obtained on reading.Something like this
```
df= pandas.read_csv('C:\Users\... |
61,247,862 | I want to convert sql query to entity framework core.
SQL query is
```
select * from Departments where id in(select DepartmentId from SubDepartments where id in(select SubDeptId from Tests where id in(select TestId from PatientTests where PatientId=3)))
``` | 2020/04/16 | [
"https://Stackoverflow.com/questions/61247862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6288727/"
] | I guess you are using put\_object() the wrong way. It is used to save an **'object'** on s3 & **not a file** i.e you need to first read the file content using pandas.read\_csv() or something else & then replace the 'Body' part with the object obtained on reading.Something like this
```
df= pandas.read_csv('C:\Users\... | in the last line
```
upload_to_s3()
```
you haven't actually given the function any parameters. inside the brackets put in the params:
```
(source_filename: str, key: str)
```
ie give the function it's filename and bucket |
61,247,862 | I want to convert sql query to entity framework core.
SQL query is
```
select * from Departments where id in(select DepartmentId from SubDepartments where id in(select SubDeptId from Tests where id in(select TestId from PatientTests where PatientId=3)))
``` | 2020/04/16 | [
"https://Stackoverflow.com/questions/61247862",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6288727/"
] | You've got a few things to address here so lets break it down a little bit.
1) When you call `upload_to_s3()` you need to call it with the function parameters you've declared it with, a filename and a bucket key. So it would be `upload_to_s3(filename, bucket_key)` for example.
2) It's a been a while since I used Wind... | in the last line
```
upload_to_s3()
```
you haven't actually given the function any parameters. inside the brackets put in the params:
```
(source_filename: str, key: str)
```
ie give the function it's filename and bucket |
16,044,839 | What is the most appropriate protocol (**SOAP** or **REST** with JSON format) to use with a **mobile OS** Android or iOS application that uses a web services exposed by a Java/Java EE application?
Which one is going to be more performant and providing security, atomic transaction and reliability? | 2013/04/16 | [
"https://Stackoverflow.com/questions/16044839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1408361/"
] | You'll need to define your security requirements a little better.
SOAP with WS-Security can be used to ensure the integrity of message, and that only the appropriate process can use the data.
It this is what you mean by security, you're better of with SOAP as it has handling capabilities for this.
REST is built ont... | My vote goes with REST with JSON. |
858,000 | >
> let $A=\{x^3+y^3+z^3-3xyz\mid x,y,z\in \mathbb {Z}\}$, prove that:
>
>
> if $a,b\in A$, then $ab\in A$,
>
>
>
I think we must find $A,B,C$ such
$$A^3+B^3+C^3-3ABC=(a^3+b^3+c^3-3abc)(x^3+y^3+z^3-3xyz)$$
where $A,B,C,a,b,c,x,y,z\in \mathbb Z$, but I can't find it.
I think this result is interesting, I hope so... | 2014/07/06 | [
"https://math.stackexchange.com/questions/858000",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/58742/"
] | Hint :
Consider the matrix :
$$\mathcal{D}\_{a,b,c}=\begin{pmatrix}
a&b&c\\
c&a&b\\
b&c&a\\
\end{pmatrix}$$
See, $$\mathcal{D}\_{a,b,c}\times \mathcal{D}\_{x,y,z}=\mathcal{D}\_{p,q,r}$$
Now $\det (\mathcal{D}\_{a,b,c})=a^3+b^3+c^3-3abc$
Looks like this hint solved the problem almost. :P | This answer is contained in the other, but by symmetry it is natural to write
$$A=ax+by+cz$$
$$B=cx+ay+bz$$
$$C=bx+cy+az$$ and its easy to see this satisfies the equation given by OP. |
6,231,198 | I have a problem with the new Xcode (today I upgraded). When I push on my file `view.xib`, I see the `XML` code, and not the graphics interface. Why? How can I see the "interface builder? | 2011/06/03 | [
"https://Stackoverflow.com/questions/6231198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/608294/"
] | Interesting that this is the second time someone has had this problem. You can open the `File Inspector` on the Utilities bar on the right ( Opt+Cmd+1 ). Change the `File Type` under `Identity and Type` to the topmost choice. It should be `Default - com.apple.InterfaceBuilder3.CocoaTouch.XIB`. | Perhaps you should look at this Article, it will explain a lot for you:
[Xcode 4 Transition Guide: Designing User Interfaces in Xcode 4:](http://developer.apple.com/library/ios/#documentation/IDEs/Conceptual/Xcode4TransitionGuide/InterfaceBuilder/InterfaceBuilder.html) |
6,231,198 | I have a problem with the new Xcode (today I upgraded). When I push on my file `view.xib`, I see the `XML` code, and not the graphics interface. Why? How can I see the "interface builder? | 2011/06/03 | [
"https://Stackoverflow.com/questions/6231198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/608294/"
] | Right Click on the .xib file and select "Open As". Then select "Xcode.IDEKit.TouchCodeIntegration.EditorDocument.CocoaTouch-title" | Perhaps you should look at this Article, it will explain a lot for you:
[Xcode 4 Transition Guide: Designing User Interfaces in Xcode 4:](http://developer.apple.com/library/ios/#documentation/IDEs/Conceptual/Xcode4TransitionGuide/InterfaceBuilder/InterfaceBuilder.html) |
40,245 | ### Background
I have no experience with midi (other than what I've read online) and I don't yet have any midi equipment to play with (but I have several devices working their way through the mail system).
### Question
Is it possible to have multiple midi keyboard controllers set to the same midi channel, but transp... | 2015/12/14 | [
"https://music.stackexchange.com/questions/40245",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/25237/"
] | Those letters are just section identification. They are not meant to indicate notes to play. You might use them in a rehearsal where someone says "Ok let's all play section **C** now". | They aren't played.
They are used to identify parts of the composition. This way you are able to communicate about the piece by using the letters. |
40,245 | ### Background
I have no experience with midi (other than what I've read online) and I don't yet have any midi equipment to play with (but I have several devices working their way through the mail system).
### Question
Is it possible to have multiple midi keyboard controllers set to the same midi channel, but transp... | 2015/12/14 | [
"https://music.stackexchange.com/questions/40245",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/25237/"
] | Both are right, these marks are to denote the section you are playing and you don't play anything specifically for them. The proper name for these marks are **rehearsal marks**.
In an sense you can look at them as practice checkpoints as they are typically where you would want to start playing if you needed more prac... | Those letters are just section identification. They are not meant to indicate notes to play. You might use them in a rehearsal where someone says "Ok let's all play section **C** now". |
40,245 | ### Background
I have no experience with midi (other than what I've read online) and I don't yet have any midi equipment to play with (but I have several devices working their way through the mail system).
### Question
Is it possible to have multiple midi keyboard controllers set to the same midi channel, but transp... | 2015/12/14 | [
"https://music.stackexchange.com/questions/40245",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/25237/"
] | Both are right, these marks are to denote the section you are playing and you don't play anything specifically for them. The proper name for these marks are **rehearsal marks**.
In an sense you can look at them as practice checkpoints as they are typically where you would want to start playing if you needed more prac... | They aren't played.
They are used to identify parts of the composition. This way you are able to communicate about the piece by using the letters. |
280,672 | I have let's say two pc's.PC-a and PC-b which both have the same application installed with java db support.I want from time to time to copy the data from the database on PC-a to database to PC-b and vice-versa so the two PC's to have the same data all the time.
Is there an already implemented API in the database layer... | 2008/11/11 | [
"https://Stackoverflow.com/questions/280672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36525/"
] | As you mention in the comments that you want to "merge" the databases, this sounds like you need to write custom code to do this, as presumably there could be conficts - the same key in both, but with different details against it, for example. | I guess you are using [Java DB (aka Derby)](http://developers.sun.com/javadb/) - in which case, assuming you just can't use a single instance, you can do a [backup/restore](http://db.apache.org/derby/docs/10.3/adminguide/). |
280,672 | I have let's say two pc's.PC-a and PC-b which both have the same application installed with java db support.I want from time to time to copy the data from the database on PC-a to database to PC-b and vice-versa so the two PC's to have the same data all the time.
Is there an already implemented API in the database layer... | 2008/11/11 | [
"https://Stackoverflow.com/questions/280672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36525/"
] | In short: You can't do this without some work on your side. SalesLogix fixed this problem by giving everything a site code, so here's how your table looked:
```
Customer:
SiteCode varchar,
CustomerID varchar,
....
primary key(siteCode, CustomerID)
```
So now you would take your databases, and match ... | I guess you are using [Java DB (aka Derby)](http://developers.sun.com/javadb/) - in which case, assuming you just can't use a single instance, you can do a [backup/restore](http://db.apache.org/derby/docs/10.3/adminguide/). |
280,672 | I have let's say two pc's.PC-a and PC-b which both have the same application installed with java db support.I want from time to time to copy the data from the database on PC-a to database to PC-b and vice-versa so the two PC's to have the same data all the time.
Is there an already implemented API in the database layer... | 2008/11/11 | [
"https://Stackoverflow.com/questions/280672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36525/"
] | As you mention in the comments that you want to "merge" the databases, this sounds like you need to write custom code to do this, as presumably there could be conficts - the same key in both, but with different details against it, for example. | Why dont you have the database on one pc. and have all other pc's request data from the host pc |
280,672 | I have let's say two pc's.PC-a and PC-b which both have the same application installed with java db support.I want from time to time to copy the data from the database on PC-a to database to PC-b and vice-versa so the two PC's to have the same data all the time.
Is there an already implemented API in the database layer... | 2008/11/11 | [
"https://Stackoverflow.com/questions/280672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36525/"
] | In short: You can't do this without some work on your side. SalesLogix fixed this problem by giving everything a site code, so here's how your table looked:
```
Customer:
SiteCode varchar,
CustomerID varchar,
....
primary key(siteCode, CustomerID)
```
So now you would take your databases, and match ... | Why dont you have the database on one pc. and have all other pc's request data from the host pc |
4,249,767 | This is a random question that came to me, obviously I wouldn't want to do it because it is bad practice, but is it possible to compile and run code from a file without an extension? Does this work with c,c++, java, python, any languages? If it does, than is the extension more of a stylist property or does it have a pu... | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/411201/"
] | Extension doesn't mean anything. Just a way to help you keep track of what file is what. (also helps stuff like a GUI explorer open the file in the right program).
(Java might care becuase the language spec says a source files end in .java, but there may be a way to hack it). | This is really compiler dependent. For example, I would imagine that there are C/C++ compiler dispatchers that make some assumptions based on the file ending in .c or .cpp but there may also be command line options to explicitly specify how a file should be handled. |
4,249,767 | This is a random question that came to me, obviously I wouldn't want to do it because it is bad practice, but is it possible to compile and run code from a file without an extension? Does this work with c,c++, java, python, any languages? If it does, than is the extension more of a stylist property or does it have a pu... | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/411201/"
] | Extension doesn't mean anything. Just a way to help you keep track of what file is what. (also helps stuff like a GUI explorer open the file in the right program).
(Java might care becuase the language spec says a source files end in .java, but there may be a way to hack it). | This depends more on the used compiler than on the language. E.g. gcc/g++ has a commandline option `-x <language>` that allows to override the detection based on the file extension. One use-case is using `-` (i.e. stdin) as input. |
4,249,767 | This is a random question that came to me, obviously I wouldn't want to do it because it is bad practice, but is it possible to compile and run code from a file without an extension? Does this work with c,c++, java, python, any languages? If it does, than is the extension more of a stylist property or does it have a pu... | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/411201/"
] | Extension doesn't mean anything. Just a way to help you keep track of what file is what. (also helps stuff like a GUI explorer open the file in the right program).
(Java might care becuase the language spec says a source files end in .java, but there may be a way to hack it). | Many compilers can accept multiple types of files in a build, and use the extension of a file to determine what to do with it. For example, one might be able to say:
```
acmecompile foo.c bar.c fred.cpp wow.asm lib1.lib compilething.obj -o result.exe
```
It would use the extensions of the various files to determine... |
4,249,767 | This is a random question that came to me, obviously I wouldn't want to do it because it is bad practice, but is it possible to compile and run code from a file without an extension? Does this work with c,c++, java, python, any languages? If it does, than is the extension more of a stylist property or does it have a pu... | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/411201/"
] | This is really compiler dependent. For example, I would imagine that there are C/C++ compiler dispatchers that make some assumptions based on the file ending in .c or .cpp but there may also be command line options to explicitly specify how a file should be handled. | Many compilers can accept multiple types of files in a build, and use the extension of a file to determine what to do with it. For example, one might be able to say:
```
acmecompile foo.c bar.c fred.cpp wow.asm lib1.lib compilething.obj -o result.exe
```
It would use the extensions of the various files to determine... |
4,249,767 | This is a random question that came to me, obviously I wouldn't want to do it because it is bad practice, but is it possible to compile and run code from a file without an extension? Does this work with c,c++, java, python, any languages? If it does, than is the extension more of a stylist property or does it have a pu... | 2010/11/22 | [
"https://Stackoverflow.com/questions/4249767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/411201/"
] | This depends more on the used compiler than on the language. E.g. gcc/g++ has a commandline option `-x <language>` that allows to override the detection based on the file extension. One use-case is using `-` (i.e. stdin) as input. | Many compilers can accept multiple types of files in a build, and use the extension of a file to determine what to do with it. For example, one might be able to say:
```
acmecompile foo.c bar.c fred.cpp wow.asm lib1.lib compilething.obj -o result.exe
```
It would use the extensions of the various files to determine... |
199,613 | Sometimes, when changing the resolution on windows, it just changes it and does nothing more. On some computers, it asks "do you want to keep these display settings?" and if you click nothing within 15 seconds it reverts them. What controls whether the dialog appears? How can I disable it? | 2010/10/14 | [
"https://superuser.com/questions/199613",
"https://superuser.com",
"https://superuser.com/users/4668/"
] | If there's a way to disable the dialog once and for all, I don't know what it is, but I do know how to do it for individual video modes. Prepare for a complicated answer to a simple question.
The thing that determines whether that dialog appears is whether the mode you're switching to has been used on that system befo... | I'm not sure, but may it be that this is only asked with analogue connectors like VGA? Because there's no check if the connected device can handle that resolution. DVI/HDMI both have those capability informations. |
199,613 | Sometimes, when changing the resolution on windows, it just changes it and does nothing more. On some computers, it asks "do you want to keep these display settings?" and if you click nothing within 15 seconds it reverts them. What controls whether the dialog appears? How can I disable it? | 2010/10/14 | [
"https://superuser.com/questions/199613",
"https://superuser.com",
"https://superuser.com/users/4668/"
] | Right Click on your desktop and go to "Properties". Under the Settings Tab, Click Advanced. Under the General tab, there is a Compatibility section. The settings are technically there. What I found works is to set it to "Ask me before applying changes". When the window pops up click the "Do not ask me again" check box.... | I'm not sure, but may it be that this is only asked with analogue connectors like VGA? Because there's no check if the connected device can handle that resolution. DVI/HDMI both have those capability informations. |
199,613 | Sometimes, when changing the resolution on windows, it just changes it and does nothing more. On some computers, it asks "do you want to keep these display settings?" and if you click nothing within 15 seconds it reverts them. What controls whether the dialog appears? How can I disable it? | 2010/10/14 | [
"https://superuser.com/questions/199613",
"https://superuser.com",
"https://superuser.com/users/4668/"
] | If there's a way to disable the dialog once and for all, I don't know what it is, but I do know how to do it for individual video modes. Prepare for a complicated answer to a simple question.
The thing that determines whether that dialog appears is whether the mode you're switching to has been used on that system befo... | Right Click on your desktop and go to "Properties". Under the Settings Tab, Click Advanced. Under the General tab, there is a Compatibility section. The settings are technically there. What I found works is to set it to "Ask me before applying changes". When the window pops up click the "Do not ask me again" check box.... |
210,499 | In science-fiction, what are referred to as "laser guns" are usually just plasma weapons that travel slower than the speed of light. But I want to have *actual* laser - not plasma - weapons in my universe, but I don't want them to travel at the speed of light. Is that possible? | 2021/08/20 | [
"https://worldbuilding.stackexchange.com/questions/210499",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/88454/"
] | As the other answerers have already pointed out, lasers are by definition light, and light by definition always travels through space at the speed of light in whatever medium it's travelling through. So you have two options: either it must travel through some medium with a lower speed of light, or it must travel throug... | You haven't included a hard science tag, so, sure! Just have a gun that alters the local speed of light so that lasers go slower than the speed of light. Perhaps they could store up light to make a more powerful laser.
You control the physical laws of your universe, you can them do whatever you want. It may not be phy... |
210,499 | In science-fiction, what are referred to as "laser guns" are usually just plasma weapons that travel slower than the speed of light. But I want to have *actual* laser - not plasma - weapons in my universe, but I don't want them to travel at the speed of light. Is that possible? | 2021/08/20 | [
"https://worldbuilding.stackexchange.com/questions/210499",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/88454/"
] | Lasers are not plasma weapons.
Plasma is a "soup" of free electrons and ionized atomic nuclei.
Lasers are coherent beams of photons.
Photons travel always at the velocity of light in the medium they propagate in ($c$ in vacuum, $c/n$ in a medium other than vacuum, with $n$ being its refractive index). End of the stor... | If the goal is to be able to watch the beam of light travel like in movies, that's not going to work.
However, one possibility is that pulling the trigger only begins the process of sending the beam - like a camera flash, there's a charge-up followed by a discharge a little bit later. The charge-up can't happen in adv... |
210,499 | In science-fiction, what are referred to as "laser guns" are usually just plasma weapons that travel slower than the speed of light. But I want to have *actual* laser - not plasma - weapons in my universe, but I don't want them to travel at the speed of light. Is that possible? | 2021/08/20 | [
"https://worldbuilding.stackexchange.com/questions/210499",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/88454/"
] | Not an actual laser, no. Laser is *light*, and by definition, the speed of any light is the speed of light. *In vacuo* that is ~300.000 km/s or so.
But you can *cheat*. Your "laser" might be some mixture of (*waves hands quickly*) light ions in an electromagnetically bound [self-contained matrix](https://en.wikipedia.... | You haven't included a hard science tag, so, sure! Just have a gun that alters the local speed of light so that lasers go slower than the speed of light. Perhaps they could store up light to make a more powerful laser.
You control the physical laws of your universe, you can them do whatever you want. It may not be phy... |
210,499 | In science-fiction, what are referred to as "laser guns" are usually just plasma weapons that travel slower than the speed of light. But I want to have *actual* laser - not plasma - weapons in my universe, but I don't want them to travel at the speed of light. Is that possible? | 2021/08/20 | [
"https://worldbuilding.stackexchange.com/questions/210499",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/88454/"
] | Lasers are not plasma weapons.
Plasma is a "soup" of free electrons and ionized atomic nuclei.
Lasers are coherent beams of photons.
Photons travel always at the velocity of light in the medium they propagate in ($c$ in vacuum, $c/n$ in a medium other than vacuum, with $n$ being its refractive index). End of the stor... | Realistically no, a electromagnetic wave will only propagate at the speed of light in that material.(air) It can change very slightly with things like [temperature and pressure](http://www.madsci.org/posts/archives/1998-02/888690999.Ph.r.html) but not to the extreme levels needed for it to be perceptible to human sense... |
210,499 | In science-fiction, what are referred to as "laser guns" are usually just plasma weapons that travel slower than the speed of light. But I want to have *actual* laser - not plasma - weapons in my universe, but I don't want them to travel at the speed of light. Is that possible? | 2021/08/20 | [
"https://worldbuilding.stackexchange.com/questions/210499",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/88454/"
] | Lasers are not plasma weapons.
Plasma is a "soup" of free electrons and ionized atomic nuclei.
Lasers are coherent beams of photons.
Photons travel always at the velocity of light in the medium they propagate in ($c$ in vacuum, $c/n$ in a medium other than vacuum, with $n$ being its refractive index). End of the stor... | Not an actual laser, no. Laser is *light*, and by definition, the speed of any light is the speed of light. *In vacuo* that is ~300.000 km/s or so.
But you can *cheat*. Your "laser" might be some mixture of (*waves hands quickly*) light ions in an electromagnetically bound [self-contained matrix](https://en.wikipedia.... |
210,499 | In science-fiction, what are referred to as "laser guns" are usually just plasma weapons that travel slower than the speed of light. But I want to have *actual* laser - not plasma - weapons in my universe, but I don't want them to travel at the speed of light. Is that possible? | 2021/08/20 | [
"https://worldbuilding.stackexchange.com/questions/210499",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/88454/"
] | Lasers are not plasma weapons.
Plasma is a "soup" of free electrons and ionized atomic nuclei.
Lasers are coherent beams of photons.
Photons travel always at the velocity of light in the medium they propagate in ($c$ in vacuum, $c/n$ in a medium other than vacuum, with $n$ being its refractive index). End of the stor... | You haven't included a hard science tag, so, sure! Just have a gun that alters the local speed of light so that lasers go slower than the speed of light. Perhaps they could store up light to make a more powerful laser.
You control the physical laws of your universe, you can them do whatever you want. It may not be phy... |
210,499 | In science-fiction, what are referred to as "laser guns" are usually just plasma weapons that travel slower than the speed of light. But I want to have *actual* laser - not plasma - weapons in my universe, but I don't want them to travel at the speed of light. Is that possible? | 2021/08/20 | [
"https://worldbuilding.stackexchange.com/questions/210499",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/88454/"
] | If you mean lasers going slower than $c$, as in the speed of light in a vacuum, then your only choice is shooting them in a medium other than the vacuum of space. Light is slower when travelling through a gas medium such as an atmosphere. However, the difference in speed between a vacuum and an atmosphere such as ours ... | Not an actual laser, no. Laser is *light*, and by definition, the speed of any light is the speed of light. *In vacuo* that is ~300.000 km/s or so.
But you can *cheat*. Your "laser" might be some mixture of (*waves hands quickly*) light ions in an electromagnetically bound [self-contained matrix](https://en.wikipedia.... |
210,499 | In science-fiction, what are referred to as "laser guns" are usually just plasma weapons that travel slower than the speed of light. But I want to have *actual* laser - not plasma - weapons in my universe, but I don't want them to travel at the speed of light. Is that possible? | 2021/08/20 | [
"https://worldbuilding.stackexchange.com/questions/210499",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/88454/"
] | **Don't shoot straight.**
Suppose I want to go get some Jolly Ranchers. The bodega that has all the flavors is 1 mile away. My Chevy Nova only goes 100 miles per hour. But I want it to take all day to get there.
I take a circuitous route. I set off in the opposite direction and go through town, laying on the horn, ta... | You haven't included a hard science tag, so, sure! Just have a gun that alters the local speed of light so that lasers go slower than the speed of light. Perhaps they could store up light to make a more powerful laser.
You control the physical laws of your universe, you can them do whatever you want. It may not be phy... |
210,499 | In science-fiction, what are referred to as "laser guns" are usually just plasma weapons that travel slower than the speed of light. But I want to have *actual* laser - not plasma - weapons in my universe, but I don't want them to travel at the speed of light. Is that possible? | 2021/08/20 | [
"https://worldbuilding.stackexchange.com/questions/210499",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/88454/"
] | Yes, but not in a way you will like.
A laser is electromagnetic radiation which never has mass and will only travel at lightspeed. While we have slowed down light, it requires a medium or material to do it\*. So unless that medium or material is inbetween you and your target all the time you are out of luck.
However,... | If the goal is to be able to watch the beam of light travel like in movies, that's not going to work.
However, one possibility is that pulling the trigger only begins the process of sending the beam - like a camera flash, there's a charge-up followed by a discharge a little bit later. The charge-up can't happen in adv... |
210,499 | In science-fiction, what are referred to as "laser guns" are usually just plasma weapons that travel slower than the speed of light. But I want to have *actual* laser - not plasma - weapons in my universe, but I don't want them to travel at the speed of light. Is that possible? | 2021/08/20 | [
"https://worldbuilding.stackexchange.com/questions/210499",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/88454/"
] | If you mean lasers going slower than $c$, as in the speed of light in a vacuum, then your only choice is shooting them in a medium other than the vacuum of space. Light is slower when travelling through a gas medium such as an atmosphere. However, the difference in speed between a vacuum and an atmosphere such as ours ... | If the goal is to be able to watch the beam of light travel like in movies, that's not going to work.
However, one possibility is that pulling the trigger only begins the process of sending the beam - like a camera flash, there's a charge-up followed by a discharge a little bit later. The charge-up can't happen in adv... |
28,101,097 | In Python 3, is there a difference between using these two expressions?
`item not in list`
vs.
`not item in list` | 2015/01/23 | [
"https://Stackoverflow.com/questions/28101097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1068700/"
] | The two expressions are equivalent, but the first one is more idiomatic, so it's preferred. | `item not in list` is being mentioned in the Python documentation and `not item in list` is not.
Which means that it is better to use `item not in list`. |
138,325 | Let $S\_n$ be the permutation group on $n$ elements.
Denote by $K(n)$ the largest $k$ s.t. $S\_n$ has a $k$-transitive subgroup (w.r.t. its action on the $n$-element set on which $S\_n$ acts) different from
$S\_n,A\_n$.
I heard that it has been proved that $K(n)\le 7$ for all $n$ but the proof uses
the classification ... | 2013/08/01 | [
"https://mathoverflow.net/questions/138325",
"https://mathoverflow.net",
"https://mathoverflow.net/users/9304/"
] | Actually $K(n)\le5$, with equality only for $n=12$ and $n=24$ and subgroup the Mathieu group $M\_n$. If $G\le S\_n$ is at least $2$-transitive, then an old theorem of Burnside shows that either $G$ has a regular elementary abelian normal subgroup, or $G$ has a simple non-abelian normal subgroup.
In the former case, it... | Wielandt was able to obtain an upper bound on $K(n)$ which grows logarithmically. He did this in (umlauts suppressed, and I hope I otherwise didn't screw this up)
Wielandt, H.:
Abschatzungen fur den Grad einer Permutationsgruppe yon vorgeschriebenem Transitivitatsgrad. Dissertation, Berlin 1934. Schriften des Math. ... |
58,936,088 | Suppose I have an external table like this:
```
CREATE EXTERNAL TABLE my.data (
`id` string,
`timestamp` string,
`profile` struct<
`name`: string,
`score`: int>
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES (
'serialization.format' = '1',
'ignore.malformed.json' = 'tru... | 2019/11/19 | [
"https://Stackoverflow.com/questions/58936088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1256041/"
] | Here is a sample on how to exclude a particular file
```sql
SELECT
*
FROM
"some_database"."some_table"
WHERE(
"$PATH" != 's3://path/to/a/file'
)
```
Just tested this approach with
```sql
SELECT
COUNT(*)
FROM
"some_database"."some_table"
-- Result: 68491573
SELECT
COUNT(*)
FROM
"some_da... | I have faced same issue. Since I could not found a specific solution, I have used a different approach. It might help you.
The error is related to bad data in profile field. Since you are using “struct” for profile field, Athena is expecting the profile field’s data in structured fashion in source files. If there is an... |
4,303 | I recently moved away from NYC to the suburbs. In NYC, I always locked up my bike with the New York Lock, which is a super heavy duty U-Lock. With a plethora of signs and parking meters, NYC works amazingly well for a U-Lock. Now however, the security is overkill and also there's very few signs and no parking meters in... | 2011/06/17 | [
"https://bicycles.stackexchange.com/questions/4303",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/1666/"
] | Any specific lock recommendation is going to be out of date in a year, so I'll focus on identifying the best kind of lock:
Any cable locks are going to be insecure by nature, but it's unfortunately the only other kind of lock available just now. (I'm not counting big-ass chains with giant locks; those are more for sh... | I just got this one: [http://www.amazon.com/gp/product/B00165S5FK](http://rads.stackoverflow.com/amzn/click/B00165S5FK). I don't know how secure it is yet, since I haven't used it, but it does come with a frame mount. |
4,303 | I recently moved away from NYC to the suburbs. In NYC, I always locked up my bike with the New York Lock, which is a super heavy duty U-Lock. With a plethora of signs and parking meters, NYC works amazingly well for a U-Lock. Now however, the security is overkill and also there's very few signs and no parking meters in... | 2011/06/17 | [
"https://bicycles.stackexchange.com/questions/4303",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/1666/"
] | A couple of months ago, I purchased an OnGuard link-plate lock which claims to be as tough as some u-locks. It mounts easily to the bicycle and has thus far served me well. It feels pretty durable and will go around more potential anchors than a u-lock.
Mine came with a plastic case that attaches to the downtube usin... | I just got this one: [http://www.amazon.com/gp/product/B00165S5FK](http://rads.stackoverflow.com/amzn/click/B00165S5FK). I don't know how secure it is yet, since I haven't used it, but it does come with a frame mount. |
4,303 | I recently moved away from NYC to the suburbs. In NYC, I always locked up my bike with the New York Lock, which is a super heavy duty U-Lock. With a plethora of signs and parking meters, NYC works amazingly well for a U-Lock. Now however, the security is overkill and also there's very few signs and no parking meters in... | 2011/06/17 | [
"https://bicycles.stackexchange.com/questions/4303",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/1666/"
] | You should check out the ABUS extreme editions of their folding bike lock:

See how it packs away:

They also do a twinset version so that you can have two rings of steel around both of your wheels and working off a common key.... | I just got this one: [http://www.amazon.com/gp/product/B00165S5FK](http://rads.stackoverflow.com/amzn/click/B00165S5FK). I don't know how secure it is yet, since I haven't used it, but it does come with a frame mount. |
1,759,677 | The goal of the assignment that I'm currently working on for my Data Structures class is to create a of Quantum Tic Tac Toe with an AI that plays to win.
Currently, I'm having a bit of trouble finding the most efficient way to represent states.
Overview of current Structure:
**AbstractGame**
* Has and manages Abs... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1759677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127139/"
] | My suggestion:
* Consider representing individual squares rather than rows, whereby `+1 == O`, `-1 == X` and `0` implies an empty square. **This allows you to detect an end state** by checking whether the sum of a horizontal, vertical or diagonal row equals `+3` or `-3`.
* Secondly "flatten" this 2D 3x3 matrix into a ... | Shouldn't each square have only three possible states (, X, O)?
Either store a grid of 3-state squares, or store 2 lists of moves. You don't need to store the overall board because it is defined by the moves.
Also, what do you mean by:
>
> generating next states for the
> GameTree
>
>
>
What is a GameTree? and... |
209,026 | If I open a large .JPG file in Preview I will see a big blank green screen...
[](https://i.stack.imgur.com/XLm8J.jpg)
I tried to delete the user's cache, some files from the preferences, but nothing helped me... | 2015/10/04 | [
"https://apple.stackexchange.com/questions/209026",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/150285/"
] | Go to `Preview > Preferences > Images` and select `Size on screen equals size on printout`.
[](https://i.stack.imgur.com/syO98.jpg)
Found this information at this [link](https://discussions.apple.com/thread/7252316) @ the Apple Discussions site. It s... | After set to **Size on screen equals size on printout** I had to scale my resolution to 1440 x 900 or 1680 x 1050 to make it work.
Steps: Go to System Preferences -> Displays -> select Scaled -> select one of 2 More Spaces on the right hand side of Default scale |
209,026 | If I open a large .JPG file in Preview I will see a big blank green screen...
[](https://i.stack.imgur.com/XLm8J.jpg)
I tried to delete the user's cache, some files from the preferences, but nothing helped me... | 2015/10/04 | [
"https://apple.stackexchange.com/questions/209026",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/150285/"
] | Go to `Preview > Preferences > Images` and select `Size on screen equals size on printout`.
[](https://i.stack.imgur.com/syO98.jpg)
Found this information at this [link](https://discussions.apple.com/thread/7252316) @ the Apple Discussions site. It s... | Update to OS X El Capitan v10.11.1.
```
Resolves an issue that caused JPEG images to appear as a gray or green box in Preview.
```
<https://support.apple.com/en-hk/HT205360> |
5,730 | No encuentro una regla para justificar la sospecha de que *dense* (del verbo *dar*) lleva acento. De acuerdo con las reglas de la acentuación de palabras graves no lo lleva, pero lo he visto un par de veces con acento. Entonces, ¿cómo se escribe?
>
> Dénse un beso
>
>
>
O bien:
>
> Dense un beso
>
>
>
En d... | 2014/05/20 | [
"https://spanish.stackexchange.com/questions/5730",
"https://spanish.stackexchange.com",
"https://spanish.stackexchange.com/users/768/"
] | Es *dense*.
No lleva acento gráfico actualmente por ser grave terminada en vocal, y tampoco llevaba con las viejas reglas, ya que *den* no lo lleva. En cambio *deles* antes llevaba acento gráfico y ahora no. La entrada *TILDE* del DPD, en la sección *4.3. Formas verbales con pronombres enclíticos* dice lo siguiente:
... | Dense es la respuesta correcta.
Pero...
Si estuvieras diciendo que dar algo a alguien, entonces llevaría un accento `dénselo`
Es porque sin el `lo` en el fin de `dense`, esa palabra obedece la regla que dice que el vocal penúltimo siempre lleva el estrés... si que ya no exista un accento en la palabra. |
16,737,502 | Hi for my application i need to remove null byte on a char array evry X bytes like:
```
char a[] = "\x0B8\x0B8\x0B8\x0B8\x00\x0B8\x0B8\x0B8\x0B8\x00\x0B8\x0B8\x0B8\x0B8\x00\x0B8\x0B8\x0B8\x0B8\x00\x0B8\x0B8\x0B8\x0B8\x00\x0B8\x0B8\x0B8\x00\x00"
```
need to be
```
char a[] = "\xB8\xB8\xB8\xB8\xB8\xB8\xB8\xB8\xB8\xB8... | 2013/05/24 | [
"https://Stackoverflow.com/questions/16737502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2417534/"
] | @Jerry Coffin describes the idiomatic solution to this general type of problem.
You'll want to scan and modify the array in-place, scanning from left to right, preserving or deleting elements as you go, while keeping track of the source (input) index and the target (output) index. Since this scans each element of the ... | One obvious way would be to walk through the array from beginning to end, keeping track of two points: a "input" and an "output". The two will start out the same (the beginning of the array), but every time you encounter a byte you don't want in the result, you'll move the input to the next byte, but leave the output a... |
44,369,831 | I have a container div ***(that cannot be floated)*** with two children elements. I want child elements to be on opposite sides - first on left, second on right. On 100% browser width children summary width is less than container, but on greater scales it is not, so container should be greater too. How to set container... | 2017/06/05 | [
"https://Stackoverflow.com/questions/44369831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3913440/"
] | ```
.container {
display: flex;
justify-content: space-between;
}
```
It should do that.
Google up FlexBox Introduction for good explaination. | something like this ?
I've used `display:flex` to let the two divs line up nicely, floats only needed for the inner boxed
<https://jsfiddle.net/070rk2e1/1/> |
6,775,718 | I'm trying to do the union between two MKCoordinateRegion. Does anybody have an idea on how to do this? | 2011/07/21 | [
"https://Stackoverflow.com/questions/6775718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/790645/"
] | There is a `MKMapRectUnion` function which accepts two `MKMapRects` so you could first convert each `MKCoordinateRegion` to an `MKMapRect` and then call that function (and convert the result back to an `MKCoordinateRegion` using the `MKCoordinateRegionForMapRect` function).
The conversion method might look like this:
... | i did a little test on both 4.3 and 5.0 and it seems that the conversion is not correct
```
UIImageView *imageView = [[UIImageView alloc] initWithImage:[[UIImage imageNamed:@"heart.png"] imageByScalingProportionallyToSize:CGSizeMake(100, 100)]];
imageView.frame = CGRectMake(0, 0, 100, 100);
imageView.center = [mapView... |
6,775,718 | I'm trying to do the union between two MKCoordinateRegion. Does anybody have an idea on how to do this? | 2011/07/21 | [
"https://Stackoverflow.com/questions/6775718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/790645/"
] | There is a `MKMapRectUnion` function which accepts two `MKMapRects` so you could first convert each `MKCoordinateRegion` to an `MKMapRect` and then call that function (and convert the result back to an `MKCoordinateRegion` using the `MKCoordinateRegionForMapRect` function).
The conversion method might look like this:
... | If anyone is looking for a swift equivalent using extensions,
```
extension MKCoordinateRegion {
func mapRectForCoordinateRegion() -> MKMapRect {
let dLat = span.latitudeDelta / 2.0
let dLon = span.longitudeDelta / 2.0
let topLeft = MKMapPointForCoordinate(
CLLocationCoordinate... |
6,775,718 | I'm trying to do the union between two MKCoordinateRegion. Does anybody have an idea on how to do this? | 2011/07/21 | [
"https://Stackoverflow.com/questions/6775718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/790645/"
] | If anyone is looking for a swift equivalent using extensions,
```
extension MKCoordinateRegion {
func mapRectForCoordinateRegion() -> MKMapRect {
let dLat = span.latitudeDelta / 2.0
let dLon = span.longitudeDelta / 2.0
let topLeft = MKMapPointForCoordinate(
CLLocationCoordinate... | i did a little test on both 4.3 and 5.0 and it seems that the conversion is not correct
```
UIImageView *imageView = [[UIImageView alloc] initWithImage:[[UIImage imageNamed:@"heart.png"] imageByScalingProportionallyToSize:CGSizeMake(100, 100)]];
imageView.frame = CGRectMake(0, 0, 100, 100);
imageView.center = [mapView... |
36,511,745 | What does `this` refer to inside an AngularJS provider?
>
> And the value it is assigned is based exclusively on the object that
> invokes the this Function.
> Source: <http://javascriptissexy.com/understand-javascripts-this-with-clarity-and-master-it/>
>
>
>
Based on above I think `this` references the object ... | 2016/04/09 | [
"https://Stackoverflow.com/questions/36511745",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4909076/"
] | It refers to the `CatProvider` function. If you check the AngularJS Documentation for **[`angular.Module.provider()`](https://docs.angularjs.org/api/auto/service/$provide#provider)**, then you'll see this description:
>
> Register a provider function with the $injector. **Provider functions
> are constructor functio... | In EcmaScript 5, which you are using, this refers to the function it is used within ...
```
function Jim() {
// this is the Jim function
var self = this;
function Fred() {
// this is the Fred function
this.name='fred'; // I have added a name property to the Fred function
// I can ac... |
8,713,090 | I'm trying to center the names(#box2) and the topic(#box1) on top of an image.
```
<?php require_once('seminar_config.php'); ?>
<a href="print.certificate.php">Print</a>
<body>
<?php
$participants = $db->get_results("SELECT participant FROM tbl_participants WHERE state=1");
$topics = $db->get_results("SELECT topic F... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8713090",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/225269/"
] | Most common HTML-to-PDF programs either don't understand CSS, or understand CSS poorly. If your HTML is working, but doesn't translate well to PDF using html2pdf, you might give wkhtmltopdf a shot <https://github.com/antialize/wkhtmltopdf> | Try using tables and inline css styles
```
<table align="left" width="100%" style="page-break-after:always; margin-top:25px; margin-left:25px; font-family:tahoma; font-size:20px; ">
<tr><td>Your info</td></tr>
</table>
``` |
8,713,090 | I'm trying to center the names(#box2) and the topic(#box1) on top of an image.
```
<?php require_once('seminar_config.php'); ?>
<a href="print.certificate.php">Print</a>
<body>
<?php
$participants = $db->get_results("SELECT participant FROM tbl_participants WHERE state=1");
$topics = $db->get_results("SELECT topic F... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8713090",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/225269/"
] | If you want to center .common try following:
```
.common{
position: absolute;
left: 50%;
top: 0;
font-size:20px;
width:600px;
margin-left:-300px;
}
``` | Try using tables and inline css styles
```
<table align="left" width="100%" style="page-break-after:always; margin-top:25px; margin-left:25px; font-family:tahoma; font-size:20px; ">
<tr><td>Your info</td></tr>
</table>
``` |
8,713,090 | I'm trying to center the names(#box2) and the topic(#box1) on top of an image.
```
<?php require_once('seminar_config.php'); ?>
<a href="print.certificate.php">Print</a>
<body>
<?php
$participants = $db->get_results("SELECT participant FROM tbl_participants WHERE state=1");
$topics = $db->get_results("SELECT topic F... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8713090",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/225269/"
] | Here is what I use to position divs in center.
Say you want to position div with id=test
CSS
```
#test {
width: 500px;
margin: 0 auto; //auto margin to left and right
}
``` | Try using tables and inline css styles
```
<table align="left" width="100%" style="page-break-after:always; margin-top:25px; margin-left:25px; font-family:tahoma; font-size:20px; ">
<tr><td>Your info</td></tr>
</table>
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.