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 |
|---|---|---|---|---|---|
57,088,879 | Currently started to learn **MVVM Kotlin**. This youtube tutorial is pretty confusing but direct to the point.
<https://www.youtube.com/watch?v=0LaUXQcGuT0&t=254s>
I have this error in my title.
this code triggers the error in my `MainActivity`
[]... | 2019/07/18 | [
"https://Stackoverflow.com/questions/57088879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10947681/"
] | Many people experiencing this have their packages named starting with a capital letter. Rename your package names to start with a small case letters such that in your path of reference to view Model class its only the view Model class that starts with a capital letter
i.e `type="com.example.rnd.kotlinmvvmlogin.viewMod... | The problem is the package name that you're using for your view model classes
Although google call this structural design pattern "MVVM" and everybody want to make "Model", "ViewModel" and "View" packages in their project, but when data-binding library wants to generate the files for you will confront problem with pack... |
57,088,879 | Currently started to learn **MVVM Kotlin**. This youtube tutorial is pretty confusing but direct to the point.
<https://www.youtube.com/watch?v=0LaUXQcGuT0&t=254s>
I have this error in my title.
this code triggers the error in my `MainActivity`
[]... | 2019/07/18 | [
"https://Stackoverflow.com/questions/57088879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10947681/"
] | Simply rename the package from `ViewModel` to `viewModel`. The first character just has to be lowercase and it'll work. | **UPDATE**
hey, i see you did not include this library
```
implementation 'androidx.core:core-ktx:1.0.2'
```
my dependencies
[](https://i.stack.imgur.com/FIANG.png)
Have you try write code like below
```
activityMainBinding?.viewModel = ViewModel... |
57,088,879 | Currently started to learn **MVVM Kotlin**. This youtube tutorial is pretty confusing but direct to the point.
<https://www.youtube.com/watch?v=0LaUXQcGuT0&t=254s>
I have this error in my title.
this code triggers the error in my `MainActivity`
[]... | 2019/07/18 | [
"https://Stackoverflow.com/questions/57088879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10947681/"
] | I had same issue. Problem is in your type `type="com.example.rnd.kotlinmvvmlogin.ViewModel.LoginViewModel"`
Remember in databinding only Viewmodel class name should start with Capital letter and other parent folder of a class should start with lower case. Just rename `ViewModel`with `viewModel`. Clear and Rebuild the p... | Simply rename the package from `ViewModel` to `viewModel`. The first character just has to be lowercase and it'll work. |
57,088,879 | Currently started to learn **MVVM Kotlin**. This youtube tutorial is pretty confusing but direct to the point.
<https://www.youtube.com/watch?v=0LaUXQcGuT0&t=254s>
I have this error in my title.
this code triggers the error in my `MainActivity`
[]... | 2019/07/18 | [
"https://Stackoverflow.com/questions/57088879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10947681/"
] | Simply rename the package from `ViewModel` to `viewModel`. The first character just has to be lowercase and it'll work. | The problem is the package name that you're using for your view model classes
Although google call this structural design pattern "MVVM" and everybody want to make "Model", "ViewModel" and "View" packages in their project, but when data-binding library wants to generate the files for you will confront problem with pack... |
57,088,879 | Currently started to learn **MVVM Kotlin**. This youtube tutorial is pretty confusing but direct to the point.
<https://www.youtube.com/watch?v=0LaUXQcGuT0&t=254s>
I have this error in my title.
this code triggers the error in my `MainActivity`
[]... | 2019/07/18 | [
"https://Stackoverflow.com/questions/57088879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10947681/"
] | Simply rename the package from `ViewModel` to `viewModel`. The first character just has to be lowercase and it'll work. | Yes it's quite unfortunate, even though it is referred to as a MVVM architecture, you can't have a package named "ViewModel", "ViewModels", "viewModels", or in any case similar to the sort, or else it just won't build, and it gives you a completely misleading error. |
41,616,374 | ```py
from random import randint
def random_number():
return randint (1,10)
rn1 = random_number()
rn2 = random_number()
while rn2 == rn1:
rn2 = random_number()
rn3 = random_number()
while rn3 == rn1 or rn3 == rn2:
rn3 = random_number()
rn4 = random_number()
while rn4 == rn1 or rn4 == rn2 or rn4 == rn... | 2017/01/12 | [
"https://Stackoverflow.com/questions/41616374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7410282/"
] | I think the easiest way to do this is to use [`random.sample`](https://docs.python.org/3/library/random.html#random.sample):
```
import random
numbers = random.sample(range(1, 11), 5)
```
This does *sampling without replacement*, which seems to be what you want.
Note that `random.sample(pop, k)` selects a sample o... | You can add each random number to a list and then check in that list to see if it has already been made:
```
numbers = []
while len(numbers) < 5:
n = random_number()
if n not in numbers:
numbers += [n]
```
Note that while this method is simple to understand it is not very efficient when you are wanti... |
41,616,374 | ```py
from random import randint
def random_number():
return randint (1,10)
rn1 = random_number()
rn2 = random_number()
while rn2 == rn1:
rn2 = random_number()
rn3 = random_number()
while rn3 == rn1 or rn3 == rn2:
rn3 = random_number()
rn4 = random_number()
while rn4 == rn1 or rn4 == rn2 or rn4 == rn... | 2017/01/12 | [
"https://Stackoverflow.com/questions/41616374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7410282/"
] | You could just use built-in numpy functionality:
```
import numpy as np
np.random.choice(10,5)
```
[Documentation here](https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.choice.html). Note that `choice` has a `replacement` keyword as well to switch between sampling with and without replacement, like ... | You can add each random number to a list and then check in that list to see if it has already been made:
```
numbers = []
while len(numbers) < 5:
n = random_number()
if n not in numbers:
numbers += [n]
```
Note that while this method is simple to understand it is not very efficient when you are wanti... |
41,616,374 | ```py
from random import randint
def random_number():
return randint (1,10)
rn1 = random_number()
rn2 = random_number()
while rn2 == rn1:
rn2 = random_number()
rn3 = random_number()
while rn3 == rn1 or rn3 == rn2:
rn3 = random_number()
rn4 = random_number()
while rn4 == rn1 or rn4 == rn2 or rn4 == rn... | 2017/01/12 | [
"https://Stackoverflow.com/questions/41616374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7410282/"
] | ```
from random import randint
def random_numbers():
return randint(1,10)
def main():
my_list = []
for i in range(10):
value = random_numbers()
if value in my_list:
continue
else:
my_list.append(value)
print(my_list)
main()
``` | You can add each random number to a list and then check in that list to see if it has already been made:
```
numbers = []
while len(numbers) < 5:
n = random_number()
if n not in numbers:
numbers += [n]
```
Note that while this method is simple to understand it is not very efficient when you are wanti... |
41,616,374 | ```py
from random import randint
def random_number():
return randint (1,10)
rn1 = random_number()
rn2 = random_number()
while rn2 == rn1:
rn2 = random_number()
rn3 = random_number()
while rn3 == rn1 or rn3 == rn2:
rn3 = random_number()
rn4 = random_number()
while rn4 == rn1 or rn4 == rn2 or rn4 == rn... | 2017/01/12 | [
"https://Stackoverflow.com/questions/41616374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7410282/"
] | I think the easiest way to do this is to use [`random.sample`](https://docs.python.org/3/library/random.html#random.sample):
```
import random
numbers = random.sample(range(1, 11), 5)
```
This does *sampling without replacement*, which seems to be what you want.
Note that `random.sample(pop, k)` selects a sample o... | You could just use built-in numpy functionality:
```
import numpy as np
np.random.choice(10,5)
```
[Documentation here](https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.choice.html). Note that `choice` has a `replacement` keyword as well to switch between sampling with and without replacement, like ... |
41,616,374 | ```py
from random import randint
def random_number():
return randint (1,10)
rn1 = random_number()
rn2 = random_number()
while rn2 == rn1:
rn2 = random_number()
rn3 = random_number()
while rn3 == rn1 or rn3 == rn2:
rn3 = random_number()
rn4 = random_number()
while rn4 == rn1 or rn4 == rn2 or rn4 == rn... | 2017/01/12 | [
"https://Stackoverflow.com/questions/41616374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7410282/"
] | I think the easiest way to do this is to use [`random.sample`](https://docs.python.org/3/library/random.html#random.sample):
```
import random
numbers = random.sample(range(1, 11), 5)
```
This does *sampling without replacement*, which seems to be what you want.
Note that `random.sample(pop, k)` selects a sample o... | ```
from random import randint
def random_numbers():
return randint(1,10)
def main():
my_list = []
for i in range(10):
value = random_numbers()
if value in my_list:
continue
else:
my_list.append(value)
print(my_list)
main()
``` |
41,616,374 | ```py
from random import randint
def random_number():
return randint (1,10)
rn1 = random_number()
rn2 = random_number()
while rn2 == rn1:
rn2 = random_number()
rn3 = random_number()
while rn3 == rn1 or rn3 == rn2:
rn3 = random_number()
rn4 = random_number()
while rn4 == rn1 or rn4 == rn2 or rn4 == rn... | 2017/01/12 | [
"https://Stackoverflow.com/questions/41616374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7410282/"
] | You could just use built-in numpy functionality:
```
import numpy as np
np.random.choice(10,5)
```
[Documentation here](https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.choice.html). Note that `choice` has a `replacement` keyword as well to switch between sampling with and without replacement, like ... | ```
from random import randint
def random_numbers():
return randint(1,10)
def main():
my_list = []
for i in range(10):
value = random_numbers()
if value in my_list:
continue
else:
my_list.append(value)
print(my_list)
main()
``` |
48,612,637 | Suppose, I want to build a simple TODO-app. I want to make it possible to create todo-items, and also it should be possible to rearrange items manually.
I made following model:
```py
class Item(models.Model):
title = models.CharField(max_length=500)
```
Now, I need to add a special field, let's call it `order`,... | 2018/02/04 | [
"https://Stackoverflow.com/questions/48612637",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/916330/"
] | As it turns out there is no straightforward way to implement this in Django. There are packages which help you, like [this one](https://github.com/bfirsh/django-ordered-model)
But I would recommend just look at their model implementation and fit your needs. [models.py](https://github.com/bfirsh/django-ordered-model/bl... | You could use `Item.objects.count()` to automatically increment your field. Plug it in the save() method of your model so that your field is calculated each time you create an instance. |
6,320,754 | I have UITableView and it add data from NSMutableArray.
So, I want to know how to add NSMutableArray into Object?
and I will add Object into UITableView.
Because I want use [tableData removeAllObjects];
But now I can only use [UITableView removeFromSuperview];
Thank you for your hand.
Kind Regard. | 2011/06/12 | [
"https://Stackoverflow.com/questions/6320754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/792295/"
] | Use `addObject` to add an object in your `NSMutableArray` .
```
- (void)addObject:(id)anObject
```
Use the method as below.
```
[myMutableArray addObject:myObj];
```
Once you done with updating your array, call `reloadData` on `UITableView` instance.
```
[myTableView reloadData];
``` | UITableView does not work the way i think you think it does. It does not have a collection of cells that you manually modify using add or remove function calls like an NSArray. UITableView requires an object that serves as a delegate.
The tableview will "ask" the delegate "questions" about the content it should have ... |
6,320,754 | I have UITableView and it add data from NSMutableArray.
So, I want to know how to add NSMutableArray into Object?
and I will add Object into UITableView.
Because I want use [tableData removeAllObjects];
But now I can only use [UITableView removeFromSuperview];
Thank you for your hand.
Kind Regard. | 2011/06/12 | [
"https://Stackoverflow.com/questions/6320754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/792295/"
] | Use `addObject` to add an object in your `NSMutableArray` .
```
- (void)addObject:(id)anObject
```
Use the method as below.
```
[myMutableArray addObject:myObj];
```
Once you done with updating your array, call `reloadData` on `UITableView` instance.
```
[myTableView reloadData];
``` | What kind of object your tableData is? `UITableView` should have a delegate of kind `UITableViewSourceData` which provides it with data. Usually it's a controller that contains this `UITableView`. When UITableView has to draw the cell it call the delegate method:
```
- (UITableViewCell *)tableView:(UITableView *)aTabl... |
6,320,754 | I have UITableView and it add data from NSMutableArray.
So, I want to know how to add NSMutableArray into Object?
and I will add Object into UITableView.
Because I want use [tableData removeAllObjects];
But now I can only use [UITableView removeFromSuperview];
Thank you for your hand.
Kind Regard. | 2011/06/12 | [
"https://Stackoverflow.com/questions/6320754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/792295/"
] | UITableView does not work the way i think you think it does. It does not have a collection of cells that you manually modify using add or remove function calls like an NSArray. UITableView requires an object that serves as a delegate.
The tableview will "ask" the delegate "questions" about the content it should have ... | What kind of object your tableData is? `UITableView` should have a delegate of kind `UITableViewSourceData` which provides it with data. Usually it's a controller that contains this `UITableView`. When UITableView has to draw the cell it call the delegate method:
```
- (UITableViewCell *)tableView:(UITableView *)aTabl... |
9,532,956 | Right now I have a listbox inside which a scrollviewer and a stackpanel is placed with the data binding to the observablecollection of imagelist.
I am having a photolist class which holds the image and path of it and binding it to the listbox.
```
<Style TargetType="{x:Type ListBox}">
<Setter Property="Foreground"... | 2012/03/02 | [
"https://Stackoverflow.com/questions/9532956",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1082956/"
] | You could try using a WrapPanel and if you require the cells to all be the same size use the answer from here: [WPF WrapPanel - all items should have the same width](https://stackoverflow.com/questions/2817620/wpf-wrappanel-all-items-should-have-the-same-width) | You need to change your style to use the WrapPanel:
```
<Style TargetType="{x:Type ListBox}">
<Setter Property="Foreground" Value="White" />
<Setter Property="Margin" Value="100"/>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<Border BorderThickness="1"... |
16,750,583 | I'm starting a new project and thought i would give em's ago but I have noticed that when using em's for Padding, Margin, line-height etc(anything but fonts) The browsers doesn't calculate them properly.
Example:
I was using Firebug to quickly position elements around using pixels then I translated them in my stylesh... | 2013/05/25 | [
"https://Stackoverflow.com/questions/16750583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1395510/"
] | >
> I translated them in my stylesheet using the formula pixel size / base
> font. so 25px / 16px
>
>
>
If you are using ems, it's best to leave pixels behind. The 16px base font idea is not reliable. It's just more of a general guide, as you don't know what the user's real base font (system font) size is, becaus... | EM's get compounded when nested in child elements. For example, if you use body font-size: is 16px, and then in a header you have 1.1em, then inside that header you have menu item and you set it to 1em, it will equal to the parent at 1.1em(most likely around 18px).
The way around this is to use REM, which stands for t... |
53,744,731 | I am trying to implement a button without margin.
My code is :
```
@override
Widget build(BuildContext context) {
return new AppState(
child: new Scaffold(
appBar: AppBar(
backgroundColor: Color(0xFF031e39),
title: Text("MY APP"),
),
body:
... | 2018/12/12 | [
"https://Stackoverflow.com/questions/53744731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/467092/"
] | According to the [source](https://github.com/flutter/flutter/blob/2994d3562a0abb4a4db0fefdab27907e934cd161/packages/flutter/lib/src/material/button.dart#L206). It looks like Flutter pads out buttons that are smaller than the target tap size (48 x 48), you can get around it by:
1. Make your button height larger than or... | I got it but making some modifications.
Instead of using a `ButtonTheme` and a `FlatButton` I used a `Container` and a `FloatingActionButton`
With `Container` you can set the size in the screen. With `FloatingActionButton` you can set the position of the button in the `Scaffold`, which in this case is in all the scree... |
53,744,731 | I am trying to implement a button without margin.
My code is :
```
@override
Widget build(BuildContext context) {
return new AppState(
child: new Scaffold(
appBar: AppBar(
backgroundColor: Color(0xFF031e39),
title: Text("MY APP"),
),
body:
... | 2018/12/12 | [
"https://Stackoverflow.com/questions/53744731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/467092/"
] | According to the [source](https://github.com/flutter/flutter/blob/2994d3562a0abb4a4db0fefdab27907e934cd161/packages/flutter/lib/src/material/button.dart#L206). It looks like Flutter pads out buttons that are smaller than the target tap size (48 x 48), you can get around it by:
1. Make your button height larger than or... | use:
**materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,**
```
FlatButton(
textColor: GFColors.WHITE,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
child: Text(
"BLOG",
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.normal ... |
1,770,486 | Slight curiosity. I've learned not to question too much in topology and basically, acquiesce. In a sense, thinking hard or trying to be smart in this area of study is a suicide mission for newbies. Unless for uber futuristic geniuses of course.
Anyway, so a continuous function $f:X \to Y$, in topology is defined as
>... | 2016/05/03 | [
"https://math.stackexchange.com/questions/1770486",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/294775/"
] | First, the open sets in $X$ are by definition *subsets* of $X$; if $x\in X$, it makes no sense to ask whether $x$ is open. It *is* meaningful to ask whether the set $\{x\}$ is open, however.
Now suppose that $X$ is given the indiscrete topology, so that the only open subsets of $X$ are $\varnothing$ and $X$ itself, an... | $f^{-1}$ is not necessarily a function so $f^{-1}:Y \rightarrow X$ doesn't always make sense, but you can talk about pre-images of open sets under $f$. Also, points of $X$ are not technically subsets of $X$, so you shouldn't talk about $x \in X$ being open. You can ask if $\{x\} \subset X$ is open, which it isn't in th... |
1,770,486 | Slight curiosity. I've learned not to question too much in topology and basically, acquiesce. In a sense, thinking hard or trying to be smart in this area of study is a suicide mission for newbies. Unless for uber futuristic geniuses of course.
Anyway, so a continuous function $f:X \to Y$, in topology is defined as
>... | 2016/05/03 | [
"https://math.stackexchange.com/questions/1770486",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/294775/"
] | First, usually there is no map $f^{-1}:Y\to X$, what we have is a map $f^{-1} : P(Y) \to P(X)$ defined by $f^{-1}(E) = \{ x\in X | f(x) \in E \}$. And this is always well defined.
About your first question :
If you are equiping $X$ with the indiscrete topology, then you don't have continuity in most cases : if your t... | $f^{-1}$ is not necessarily a function so $f^{-1}:Y \rightarrow X$ doesn't always make sense, but you can talk about pre-images of open sets under $f$. Also, points of $X$ are not technically subsets of $X$, so you shouldn't talk about $x \in X$ being open. You can ask if $\{x\} \subset X$ is open, which it isn't in th... |
34,184,793 | Hi I am trying to create CRUD functions in C# but am stuck on my first one which is FetchALL, as so far it says not all code path returns a value.
Heres my code so far
```
public SqlDataReader FetchAll(string tableName)
{
using (SqlConnection conn = new SqlConnection(_ConnectionString,))
{
... | 2015/12/09 | [
"https://Stackoverflow.com/questions/34184793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4651493/"
] | Firstly you aren't returning anything from the method. I'd add, are you sure you want to return a SqlDataReader? It is declared within a using block, so it will be closed by the time you return it anyway. I think you should re-evaluate what this function should return. | You need a return statment for the method to return a value. |
34,184,793 | Hi I am trying to create CRUD functions in C# but am stuck on my first one which is FetchALL, as so far it says not all code path returns a value.
Heres my code so far
```
public SqlDataReader FetchAll(string tableName)
{
using (SqlConnection conn = new SqlConnection(_ConnectionString,))
{
... | 2015/12/09 | [
"https://Stackoverflow.com/questions/34184793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4651493/"
] | You have a return type of `SqlDataReader`, but you aren't returning anything anywhere in your code. At the very least you should declare your data reader and return it like this:
```
public SqlDataReader FetchAll(string tableName)
{
SqlDataReader reader;
using (SqlConnection conn = new SqlConnection(_Connecti... | You need a return statment for the method to return a value. |
34,184,793 | Hi I am trying to create CRUD functions in C# but am stuck on my first one which is FetchALL, as so far it says not all code path returns a value.
Heres my code so far
```
public SqlDataReader FetchAll(string tableName)
{
using (SqlConnection conn = new SqlConnection(_ConnectionString,))
{
... | 2015/12/09 | [
"https://Stackoverflow.com/questions/34184793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4651493/"
] | You have a return type of `SqlDataReader`, but you aren't returning anything anywhere in your code. At the very least you should declare your data reader and return it like this:
```
public SqlDataReader FetchAll(string tableName)
{
SqlDataReader reader;
using (SqlConnection conn = new SqlConnection(_Connecti... | Firstly you aren't returning anything from the method. I'd add, are you sure you want to return a SqlDataReader? It is declared within a using block, so it will be closed by the time you return it anyway. I think you should re-evaluate what this function should return. |
51,617,332 | A simple issue I'm having. I'm getting a syntax error from the following SQL:
```
DELETE FROM Blog.Category c
WHERE NOT EXISTS (SELECT * FROM Blog.Posts p
WHERE p.postCategory = blog.Category.catId)
```
Obviously I'm missing something silly here. Any hints would be appreciated.
**EDIT**
I have a... | 2018/07/31 | [
"https://Stackoverflow.com/questions/51617332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3650516/"
] | I like updating and deleting alias'd tables better as I feel it is more clear.
```
DELETE c
FROM Blog.Category c
left join Blog.Posts p ON p.postCategory = c.catId
WHERE p.postCategory IS NULL
```
The issue in your query is you alias the table and then don't use it in the EXISTS. | Try this following query, I think it is related to alias:
```
DELETE FROM Blog.Category c
WHERE NOT EXISTS (SELECT * FROM Blog.Posts p
WHERE p.postCategory = c.catId);
``` |
51,617,332 | A simple issue I'm having. I'm getting a syntax error from the following SQL:
```
DELETE FROM Blog.Category c
WHERE NOT EXISTS (SELECT * FROM Blog.Posts p
WHERE p.postCategory = blog.Category.catId)
```
Obviously I'm missing something silly here. Any hints would be appreciated.
**EDIT**
I have a... | 2018/07/31 | [
"https://Stackoverflow.com/questions/51617332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3650516/"
] | Same topic here
>
> In SQL Server, when using not exists, you need to set an alias for the table to be connected, and in the delete statement, to specify the table to delete rows from.
>
>
>
[Trying to delete when not exists is not working. Multiple columns in primary key](https://stackoverflow.com/questions/1980... | Try this following query, I think it is related to alias:
```
DELETE FROM Blog.Category c
WHERE NOT EXISTS (SELECT * FROM Blog.Posts p
WHERE p.postCategory = c.catId);
``` |
51,617,332 | A simple issue I'm having. I'm getting a syntax error from the following SQL:
```
DELETE FROM Blog.Category c
WHERE NOT EXISTS (SELECT * FROM Blog.Posts p
WHERE p.postCategory = blog.Category.catId)
```
Obviously I'm missing something silly here. Any hints would be appreciated.
**EDIT**
I have a... | 2018/07/31 | [
"https://Stackoverflow.com/questions/51617332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3650516/"
] | You are missing the alias directly after the `DELETE` statement.
```
DELETE c FROM Blog.Category c
WHERE NOT EXISTS(SELECT * FROM Blog.Posts p WHERE p.postCategory = c.catId)
```
---
Alternatively you can omit the alias and use the full table name.
```
DELETE FROM Blog.Category
WHERE NOT EXISTS(SELECT * FROM Blo... | Try this following query, I think it is related to alias:
```
DELETE FROM Blog.Category c
WHERE NOT EXISTS (SELECT * FROM Blog.Posts p
WHERE p.postCategory = c.catId);
``` |
51,617,332 | A simple issue I'm having. I'm getting a syntax error from the following SQL:
```
DELETE FROM Blog.Category c
WHERE NOT EXISTS (SELECT * FROM Blog.Posts p
WHERE p.postCategory = blog.Category.catId)
```
Obviously I'm missing something silly here. Any hints would be appreciated.
**EDIT**
I have a... | 2018/07/31 | [
"https://Stackoverflow.com/questions/51617332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3650516/"
] | You are missing the alias directly after the `DELETE` statement.
```
DELETE c FROM Blog.Category c
WHERE NOT EXISTS(SELECT * FROM Blog.Posts p WHERE p.postCategory = c.catId)
```
---
Alternatively you can omit the alias and use the full table name.
```
DELETE FROM Blog.Category
WHERE NOT EXISTS(SELECT * FROM Blo... | I like updating and deleting alias'd tables better as I feel it is more clear.
```
DELETE c
FROM Blog.Category c
left join Blog.Posts p ON p.postCategory = c.catId
WHERE p.postCategory IS NULL
```
The issue in your query is you alias the table and then don't use it in the EXISTS. |
51,617,332 | A simple issue I'm having. I'm getting a syntax error from the following SQL:
```
DELETE FROM Blog.Category c
WHERE NOT EXISTS (SELECT * FROM Blog.Posts p
WHERE p.postCategory = blog.Category.catId)
```
Obviously I'm missing something silly here. Any hints would be appreciated.
**EDIT**
I have a... | 2018/07/31 | [
"https://Stackoverflow.com/questions/51617332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3650516/"
] | You are missing the alias directly after the `DELETE` statement.
```
DELETE c FROM Blog.Category c
WHERE NOT EXISTS(SELECT * FROM Blog.Posts p WHERE p.postCategory = c.catId)
```
---
Alternatively you can omit the alias and use the full table name.
```
DELETE FROM Blog.Category
WHERE NOT EXISTS(SELECT * FROM Blo... | Same topic here
>
> In SQL Server, when using not exists, you need to set an alias for the table to be connected, and in the delete statement, to specify the table to delete rows from.
>
>
>
[Trying to delete when not exists is not working. Multiple columns in primary key](https://stackoverflow.com/questions/1980... |
19,804 | I recently have bought a mac book pro and I have noticed there is no home button, and I can't find a hotkey anywhere to make the cursor to the beginning of the line. Am I missing something? Is there a program out there that will help me do this?
This in in the terminal btw. | 2009/08/07 | [
"https://superuser.com/questions/19804",
"https://superuser.com",
"https://superuser.com/users/3516/"
] | `Fn` + `←` = Home
`Fn` + `→` = End
`Fn` + `↑` = Page Up
`Fn` + `↓` = Page Down
`Command` + `←` = Beginning of Line
`Command` + `→` = End of Line
`Command` + `↑` = Top of Document
`Command` + `↓` = Bottom of Document
Include `Shift` with these combinations to select all text between initial and final position of... | The home button for the mac is `Fn`+`[` |
19,804 | I recently have bought a mac book pro and I have noticed there is no home button, and I can't find a hotkey anywhere to make the cursor to the beginning of the line. Am I missing something? Is there a program out there that will help me do this?
This in in the terminal btw. | 2009/08/07 | [
"https://superuser.com/questions/19804",
"https://superuser.com",
"https://superuser.com/users/3516/"
] | `Fn` + `←` = Home
`Fn` + `→` = End
`Fn` + `↑` = Page Up
`Fn` + `↓` = Page Down
`Command` + `←` = Beginning of Line
`Command` + `→` = End of Line
`Command` + `↑` = Top of Document
`Command` + `↓` = Bottom of Document
Include `Shift` with these combinations to select all text between initial and final position of... | For beginning of line: [Command]+[Left arrow]
For end of line: [Command]+[Right arrow]
For top of document: [Command]+[Up arrow]
For bottom of document: [Command]+[Down arrow] |
19,804 | I recently have bought a mac book pro and I have noticed there is no home button, and I can't find a hotkey anywhere to make the cursor to the beginning of the line. Am I missing something? Is there a program out there that will help me do this?
This in in the terminal btw. | 2009/08/07 | [
"https://superuser.com/questions/19804",
"https://superuser.com",
"https://superuser.com/users/3516/"
] | In a text editor, you can use `Cmd` + `←` and `Cmd` + `→` to jump to the beginning and end of a line.
The command line is a little bit different. If you're using Bash (the default shell for OS X), `Ctrl` + `A` and `Ctrl` + `E` will do what you want. | The home button for the mac is `Fn`+`[` |
19,804 | I recently have bought a mac book pro and I have noticed there is no home button, and I can't find a hotkey anywhere to make the cursor to the beginning of the line. Am I missing something? Is there a program out there that will help me do this?
This in in the terminal btw. | 2009/08/07 | [
"https://superuser.com/questions/19804",
"https://superuser.com",
"https://superuser.com/users/3516/"
] | In a text editor, you can use `Cmd` + `←` and `Cmd` + `→` to jump to the beginning and end of a line.
The command line is a little bit different. If you're using Bash (the default shell for OS X), `Ctrl` + `A` and `Ctrl` + `E` will do what you want. | For beginning of line: [Command]+[Left arrow]
For end of line: [Command]+[Right arrow]
For top of document: [Command]+[Up arrow]
For bottom of document: [Command]+[Down arrow] |
19,804 | I recently have bought a mac book pro and I have noticed there is no home button, and I can't find a hotkey anywhere to make the cursor to the beginning of the line. Am I missing something? Is there a program out there that will help me do this?
This in in the terminal btw. | 2009/08/07 | [
"https://superuser.com/questions/19804",
"https://superuser.com",
"https://superuser.com/users/3516/"
] | The home button for the mac is `Fn`+`[` | For beginning of line: [Command]+[Left arrow]
For end of line: [Command]+[Right arrow]
For top of document: [Command]+[Up arrow]
For bottom of document: [Command]+[Down arrow] |
45,270,740 | Basically I have three values.
Each of those values is specified in a variable.
In the `if` statement I would like to state all these 3 values to be `true` in order for it to perform the `if` statement.
For example: `val == 'Millennium Wheel'` and `val2 = 'Palace of Westminster'` and then comes `val3`, all of these ... | 2017/07/23 | [
"https://Stackoverflow.com/questions/45270740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5625923/"
] | Don't define areas so that the columns can be flexible, set `grid-template-columns: 1fr;` with `grid-auto-flow: column;` and `grid-auto-columns: 50%`
```js
var button = document.querySelector('.click');
var buttone = document.querySelector('.clicke')
var left = document.querySelector('.left');
button.addEventListe... | Change `.wrap` `display` to `block` when `grid` is redundant
============================================================
Although you have stated that:
>
> I can use other displays to achieve this effect easily, but I wanted to know if there was a method to do this while using a grid display with its areas being sp... |
45,270,740 | Basically I have three values.
Each of those values is specified in a variable.
In the `if` statement I would like to state all these 3 values to be `true` in order for it to perform the `if` statement.
For example: `val == 'Millennium Wheel'` and `val2 = 'Palace of Westminster'` and then comes `val3`, all of these ... | 2017/07/23 | [
"https://Stackoverflow.com/questions/45270740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5625923/"
] | At least in this case, it's enough to set
```
gridColumnStart: 1;
```
to get the desired layout. The element occupies the named area and also the first column.
I am unsure however about the posibilities to make this solution more *general*
```js
var button = document.querySelector('.click');
var buttone = documen... | Change `.wrap` `display` to `block` when `grid` is redundant
============================================================
Although you have stated that:
>
> I can use other displays to achieve this effect easily, but I wanted to know if there was a method to do this while using a grid display with its areas being sp... |
5,109,754 | I am creating an Android app that uses Facebook SSO to login and I'm not sure how to authenticate with my own webservices after I login to FB. When a user first opens my app they login to Facebook, authorize my application some privileges, and continue into my app. This part works great, but now to use my app they need... | 2011/02/24 | [
"https://Stackoverflow.com/questions/5109754",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/633026/"
] | Facebook SSO returns an access token. If you'd like, you can pass that along to your server and your server can make a call to the Facebook APIs to check that it's a valid access token for that user (eg by calling <https://graph.facebook.com/me?access_token=ACCESS_TOKEN>) -- if it is, you're good and have verified that... | I think you have to pass a password along with your basic info upon profile creation. All in all, the Facebook SSO only gives your client application the right to access the profile user, but it does not garantee your web services that the caller is the actual owner of this FB account. I am afraid that subsequent calls... |
16,140,933 | I created sample application I want to get latitude and longtitude from string address line. this is my method which I used to get latitude and longtitude
```
private void getFromLocation(String address) {
Geocoder geoCoder = new Geocoder(this, Locale.getDefault());
try {
List<Address> addresses = geo... | 2013/04/22 | [
"https://Stackoverflow.com/questions/16140933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866771/"
] | The relative path to your database files might not work between projects because of what your app's current working directory could be. You can find out what your app's working directory is by getting `Environment.CurrentDirectory` while the app is running.
For example, in a C# Console app, the working directory could... | @"Data source=" + System.Windows.Forms.Application.StartupPath + "demo project\MyData.sdb";
this with this code
is the database where the application is running |
31,999 | For some context:
>
> [In sociolinguistics, a T–V distinction (from the Latin pronouns tu and vos) is a contrast, within one language, between second-person pronouns that are specialized for varying levels of politeness, social distance, courtesy, familiarity, age or insult toward the addressee.](https://en.wikipedia... | 2014/11/20 | [
"https://academia.stackexchange.com/questions/31999",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/24528/"
] | Unfortunately, there is no general rule covering every situation (or every language).
However, a good rule of thumb is to just use the "vous" when you are not sure which one to use and then imitate the other person.
If you are more senior you probably can also offer using "tu", especially at the university, but with ... | Even when addressing professors by their first name you should use "vous". That is not uncommon. I'm not that familiar with French (I had it in high school), but in German that is described as "Hamburger Sie". In my experience, it is considered quite rude to address older unfamiliar people, let alone your supervisor wi... |
52,493 | Background
----------
The [metallic means](https://en.wikipedia.org/wiki/Metallic_mean), starting with the famous [golden mean](https://en.wikipedia.org/wiki/Golden_ratio), are defined for every natural number (positive integer), and each one is an irrational constant (it has an infinite non-recurring decimal expansio... | 2015/07/01 | [
"https://codegolf.stackexchange.com/questions/52493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/20283/"
] | dc, 12
======
```
?kdd*4+v+2/p
```
* `?` Push n and p onto the stack
* `k` set precision to p
* `dd` duplicate n twice (total three copies)
* `*` multiply n\*n
* `4+` add 4
* `v` take square root
* `+` add n (last copy on stack)
* `2/` divide by 2
* `p` print
### Testcase:
```
$ dc -f metalmean.dc <<< "1 9"
1.6180... | Mathematica, 50 bytes
=====================
```
SetAccuracy[Floor[(#+Sqrt[4+#^2])/2,10^-#2],#2+1]&
```
Defines an anonymous function that takes `n` and `p` in order. I use `Floor` to prevent rounding with `SetAccuracy`, which I need in order to get decimal output. |
52,493 | Background
----------
The [metallic means](https://en.wikipedia.org/wiki/Metallic_mean), starting with the famous [golden mean](https://en.wikipedia.org/wiki/Golden_ratio), are defined for every natural number (positive integer), and each one is an irrational constant (it has an infinite non-recurring decimal expansio... | 2015/07/01 | [
"https://codegolf.stackexchange.com/questions/52493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/20283/"
] | R, 116 bytes
============
```r
library(Rmpfr);s=scan();n=mpfr(s[1],1e6);r=(n+(4+n^2)^.5)/2;t=toString(format(r,s[2]+2));cat(substr(t,1,nchar(t)-1))
```
This reads two integers from STDIN and prints the result to STDOUT. You can [try it online](http://www.r-fiddle.org/#/fiddle?id=nDZLCRyq).
Ungolfed + explanation:
... | Mathematica, 50 bytes
=====================
```
SetAccuracy[Floor[(#+Sqrt[4+#^2])/2,10^-#2],#2+1]&
```
Defines an anonymous function that takes `n` and `p` in order. I use `Floor` to prevent rounding with `SetAccuracy`, which I need in order to get decimal output. |
52,493 | Background
----------
The [metallic means](https://en.wikipedia.org/wiki/Metallic_mean), starting with the famous [golden mean](https://en.wikipedia.org/wiki/Golden_ratio), are defined for every natural number (positive integer), and each one is an irrational constant (it has an infinite non-recurring decimal expansio... | 2015/07/01 | [
"https://codegolf.stackexchange.com/questions/52493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/20283/"
] | R, 116 bytes
============
```r
library(Rmpfr);s=scan();n=mpfr(s[1],1e6);r=(n+(4+n^2)^.5)/2;t=toString(format(r,s[2]+2));cat(substr(t,1,nchar(t)-1))
```
This reads two integers from STDIN and prints the result to STDOUT. You can [try it online](http://www.r-fiddle.org/#/fiddle?id=nDZLCRyq).
Ungolfed + explanation:
... | Python 2, 92 Bytes
==================
As I am now looking at the answers, it looks like the CJam answer uses the same basic method as this. It calculates the answer for `n*10**p` and then adds in the decimal point. It is incredibly inefficient due to the way it calculates the integer part of the square root (just addi... |
52,493 | Background
----------
The [metallic means](https://en.wikipedia.org/wiki/Metallic_mean), starting with the famous [golden mean](https://en.wikipedia.org/wiki/Golden_ratio), are defined for every natural number (positive integer), and each one is an irrational constant (it has an infinite non-recurring decimal expansio... | 2015/07/01 | [
"https://codegolf.stackexchange.com/questions/52493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/20283/"
] | dc, 12
======
```
?kdd*4+v+2/p
```
* `?` Push n and p onto the stack
* `k` set precision to p
* `dd` duplicate n twice (total three copies)
* `*` multiply n\*n
* `4+` add 4
* `v` take square root
* `+` add n (last copy on stack)
* `2/` divide by 2
* `p` print
### Testcase:
```
$ dc -f metalmean.dc <<< "1 9"
1.6180... | CJam, 35 bytes
==============
```
1'el+~1$*_2#2$2#4*+mQ+2/1$md@+s0'.t
```
Reads **p** first, then **n**.
Try it online in the [CJam interpreter](http://cjam.aditsu.net/#code=1'el%2B~1%24*_2%232%242%234*%2BmQ%2B2%2F1%24md%40%2Bs0'.t&input=19%201).
### How it works
We simply compute the formula from the question fo... |
52,493 | Background
----------
The [metallic means](https://en.wikipedia.org/wiki/Metallic_mean), starting with the famous [golden mean](https://en.wikipedia.org/wiki/Golden_ratio), are defined for every natural number (positive integer), and each one is an irrational constant (it has an infinite non-recurring decimal expansio... | 2015/07/01 | [
"https://codegolf.stackexchange.com/questions/52493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/20283/"
] | dc, 12
======
```
?kdd*4+v+2/p
```
* `?` Push n and p onto the stack
* `k` set precision to p
* `dd` duplicate n twice (total three copies)
* `*` multiply n\*n
* `4+` add 4
* `v` take square root
* `+` add n (last copy on stack)
* `2/` divide by 2
* `p` print
### Testcase:
```
$ dc -f metalmean.dc <<< "1 9"
1.6180... | J, 27 Bytes
===========
```
4 :'}:":!.(2+x)-:y+%:4+*:y'
```
### Explanation:
```
4 :' ' | Define an explicit dyad
*:y | Square y
4+ | Add 4
%: | Square root
y+ | Add y
-: ... |
52,493 | Background
----------
The [metallic means](https://en.wikipedia.org/wiki/Metallic_mean), starting with the famous [golden mean](https://en.wikipedia.org/wiki/Golden_ratio), are defined for every natural number (positive integer), and each one is an irrational constant (it has an infinite non-recurring decimal expansio... | 2015/07/01 | [
"https://codegolf.stackexchange.com/questions/52493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/20283/"
] | dc, 12
======
```
?kdd*4+v+2/p
```
* `?` Push n and p onto the stack
* `k` set precision to p
* `dd` duplicate n twice (total three copies)
* `*` multiply n\*n
* `4+` add 4
* `v` take square root
* `+` add n (last copy on stack)
* `2/` divide by 2
* `p` print
### Testcase:
```
$ dc -f metalmean.dc <<< "1 9"
1.6180... | Python 2, 92 Bytes
==================
As I am now looking at the answers, it looks like the CJam answer uses the same basic method as this. It calculates the answer for `n*10**p` and then adds in the decimal point. It is incredibly inefficient due to the way it calculates the integer part of the square root (just addi... |
52,493 | Background
----------
The [metallic means](https://en.wikipedia.org/wiki/Metallic_mean), starting with the famous [golden mean](https://en.wikipedia.org/wiki/Golden_ratio), are defined for every natural number (positive integer), and each one is an irrational constant (it has an infinite non-recurring decimal expansio... | 2015/07/01 | [
"https://codegolf.stackexchange.com/questions/52493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/20283/"
] | dc, 12
======
```
?kdd*4+v+2/p
```
* `?` Push n and p onto the stack
* `k` set precision to p
* `dd` duplicate n twice (total three copies)
* `*` multiply n\*n
* `4+` add 4
* `v` take square root
* `+` add n (last copy on stack)
* `2/` divide by 2
* `p` print
### Testcase:
```
$ dc -f metalmean.dc <<< "1 9"
1.6180... | R, 116 bytes
============
```r
library(Rmpfr);s=scan();n=mpfr(s[1],1e6);r=(n+(4+n^2)^.5)/2;t=toString(format(r,s[2]+2));cat(substr(t,1,nchar(t)-1))
```
This reads two integers from STDIN and prints the result to STDOUT. You can [try it online](http://www.r-fiddle.org/#/fiddle?id=nDZLCRyq).
Ungolfed + explanation:
... |
52,493 | Background
----------
The [metallic means](https://en.wikipedia.org/wiki/Metallic_mean), starting with the famous [golden mean](https://en.wikipedia.org/wiki/Golden_ratio), are defined for every natural number (positive integer), and each one is an irrational constant (it has an infinite non-recurring decimal expansio... | 2015/07/01 | [
"https://codegolf.stackexchange.com/questions/52493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/20283/"
] | R, 116 bytes
============
```r
library(Rmpfr);s=scan();n=mpfr(s[1],1e6);r=(n+(4+n^2)^.5)/2;t=toString(format(r,s[2]+2));cat(substr(t,1,nchar(t)-1))
```
This reads two integers from STDIN and prints the result to STDOUT. You can [try it online](http://www.r-fiddle.org/#/fiddle?id=nDZLCRyq).
Ungolfed + explanation:
... | PHP, 85 78 bytes
================
```
echo bcdiv(bcadd($n=$argv[bcscale($argv[2])],bcsqrt(bcadd(4,bcpow($n,2)))),2);
```
It uses the [BC Math](http://php.net/manual/en/book.bc.php) mathematical extension which, on some systems, could not be available. It needs to be included on the [compilation time](http://php.net/... |
52,493 | Background
----------
The [metallic means](https://en.wikipedia.org/wiki/Metallic_mean), starting with the famous [golden mean](https://en.wikipedia.org/wiki/Golden_ratio), are defined for every natural number (positive integer), and each one is an irrational constant (it has an infinite non-recurring decimal expansio... | 2015/07/01 | [
"https://codegolf.stackexchange.com/questions/52493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/20283/"
] | R, 116 bytes
============
```r
library(Rmpfr);s=scan();n=mpfr(s[1],1e6);r=(n+(4+n^2)^.5)/2;t=toString(format(r,s[2]+2));cat(substr(t,1,nchar(t)-1))
```
This reads two integers from STDIN and prints the result to STDOUT. You can [try it online](http://www.r-fiddle.org/#/fiddle?id=nDZLCRyq).
Ungolfed + explanation:
... | J, 27 Bytes
===========
```
4 :'}:":!.(2+x)-:y+%:4+*:y'
```
### Explanation:
```
4 :' ' | Define an explicit dyad
*:y | Square y
4+ | Add 4
%: | Square root
y+ | Add y
-: ... |
52,493 | Background
----------
The [metallic means](https://en.wikipedia.org/wiki/Metallic_mean), starting with the famous [golden mean](https://en.wikipedia.org/wiki/Golden_ratio), are defined for every natural number (positive integer), and each one is an irrational constant (it has an infinite non-recurring decimal expansio... | 2015/07/01 | [
"https://codegolf.stackexchange.com/questions/52493",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/20283/"
] | R, 116 bytes
============
```r
library(Rmpfr);s=scan();n=mpfr(s[1],1e6);r=(n+(4+n^2)^.5)/2;t=toString(format(r,s[2]+2));cat(substr(t,1,nchar(t)-1))
```
This reads two integers from STDIN and prints the result to STDOUT. You can [try it online](http://www.r-fiddle.org/#/fiddle?id=nDZLCRyq).
Ungolfed + explanation:
... | CJam, 35 bytes
==============
```
1'el+~1$*_2#2$2#4*+mQ+2/1$md@+s0'.t
```
Reads **p** first, then **n**.
Try it online in the [CJam interpreter](http://cjam.aditsu.net/#code=1'el%2B~1%24*_2%232%242%234*%2BmQ%2B2%2F1%24md%40%2Bs0'.t&input=19%201).
### How it works
We simply compute the formula from the question fo... |
7,226,414 | I'm trying to have virtual hosts in Tomcat 7.0.20
**WITHOUT rename everything ROOT AND
WITHOUT using Apache http server in front**
Steps done so far
put fake domain in windows host file
127.0.0.1 fakedomain.com
Started Tomcat and logged into Host Manager.
Add virtual host.
Name : fakedomain.com
Aliasas : www.fakedo... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7226414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/631052/"
] | >
> Right answer from chuck at unisys.com from the tomcat mailing list.
>
>
>
Not sure why you want to do things the hard way, but so be it.
You need to place the Animotest-1.war in a location outside of the appBase directory so that Tomcat won't find it via auto-deployment. Put the full path in the docBase attri... | [Deploy application on custom host of Tomcat](https://stackoverflow.com/questions/3914888/deploy-application-on-custom-host-of-tomcat)
Worked for me, no windows host file modification necessary. I think the key for me was having the appbase in the root.xml and in the server.xml. Had to remove it from server.xml and ev... |
41,972,988 | Whenever I input letter 'a' it suggesting all the name with letter 'a' in the name\_table.
I want to to make it suggest only the name that start with letter 'a'. How to fix this?.
index.php
```
<html><script type="text/javascript">
$(function() {
var availableTags = <?php include('autocomplete.php'); ?>;
$("#... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41972988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7304621/"
] | You have overlapping cases what I suggest is to enable all the controls and disable specific control under condition. I think you have to make some option exclusive like view and delete! as they cancel each other. This is something you can try that I made based on discussion with you and you may need to further tune it... | You are looking through specific field in the `dtFill`. I assume you are looking for only 1 condition to be true. **UPDATE**: Used your original code. Quite Lengthy.
Try this:
```
if (dtFill.Rows[0]["ADD_FLAG"].ToString() == "Y" || dtFill.Rows[0]["MODIFY_FLAG"].ToString() == "Y")
{
txtAbbr... |
41,972,988 | Whenever I input letter 'a' it suggesting all the name with letter 'a' in the name\_table.
I want to to make it suggest only the name that start with letter 'a'. How to fix this?.
index.php
```
<html><script type="text/javascript">
$(function() {
var availableTags = <?php include('autocomplete.php'); ?>;
$("#... | 2017/02/01 | [
"https://Stackoverflow.com/questions/41972988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7304621/"
] | As per setting some *criteria*, I have to check multiple conditions and then assign the `Enabled` and `Disabled` logic.
So before assigning the logic, what I did was created a Matrix for every possible conditions.
Below is the Image of the matrix.
[]... | You are looking through specific field in the `dtFill`. I assume you are looking for only 1 condition to be true. **UPDATE**: Used your original code. Quite Lengthy.
Try this:
```
if (dtFill.Rows[0]["ADD_FLAG"].ToString() == "Y" || dtFill.Rows[0]["MODIFY_FLAG"].ToString() == "Y")
{
txtAbbr... |
65,981 | On a year in which the night we start to say *ותן טל ומטר* is a weekday night, if one forgets to say *ותן ברכה* by the *מנחה* before and doesn't realize that he forgot it until *שקיעה*, what is the Halacha regarding the right insertion to say by each *שמונה עשרה*? | 2015/12/06 | [
"https://judaism.stackexchange.com/questions/65981",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/11267/"
] | It seems that this may be a problem, since you don't gain anything by repeating the Amida at Maariv with ותן טל ומטר since you already did that.
(In other words, you didn't say ותן ברכה the first time, nor the second, so what have you achieved by repeating the Amida?)
See the Aruch Hashulchan in [סימן קח - דידין מי ש... | it makes no difference why you need to repeat shmonei esrai you say according to how you need to daven NOW even if you missed/messed up a different nusach/tefilla |
65,981 | On a year in which the night we start to say *ותן טל ומטר* is a weekday night, if one forgets to say *ותן ברכה* by the *מנחה* before and doesn't realize that he forgot it until *שקיעה*, what is the Halacha regarding the right insertion to say by each *שמונה עשרה*? | 2015/12/06 | [
"https://judaism.stackexchange.com/questions/65981",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/11267/"
] | The fact that forgetting ותן ברכה justifies a repeat (or tashlumim if the time has passed) means it is an essential part of the amida. So the question becomes how does one make up for an essential part of the amida when the time has passed.
Generally for tashlumim one repeats twice the amida that should be said at the... | it makes no difference why you need to repeat shmonei esrai you say according to how you need to daven NOW even if you missed/messed up a different nusach/tefilla |
65,981 | On a year in which the night we start to say *ותן טל ומטר* is a weekday night, if one forgets to say *ותן ברכה* by the *מנחה* before and doesn't realize that he forgot it until *שקיעה*, what is the Halacha regarding the right insertion to say by each *שמונה עשרה*? | 2015/12/06 | [
"https://judaism.stackexchange.com/questions/65981",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/11267/"
] | DannyS I think that is a different question. The questioner seemed to be clear (to me) that he was not sure "one forgot to [consciously] say" the correct form, ie v'ten beracha.
As for your case, if someone knows that he erred by saying v'ten tal u'mattar early, I saw a Rabbi Daniel Sperling (yeshiva.org.il 5773, ask... | it makes no difference why you need to repeat shmonei esrai you say according to how you need to daven NOW even if you missed/messed up a different nusach/tefilla |
65,981 | On a year in which the night we start to say *ותן טל ומטר* is a weekday night, if one forgets to say *ותן ברכה* by the *מנחה* before and doesn't realize that he forgot it until *שקיעה*, what is the Halacha regarding the right insertion to say by each *שמונה עשרה*? | 2015/12/06 | [
"https://judaism.stackexchange.com/questions/65981",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/11267/"
] | The fact that forgetting ותן ברכה justifies a repeat (or tashlumim if the time has passed) means it is an essential part of the amida. So the question becomes how does one make up for an essential part of the amida when the time has passed.
Generally for tashlumim one repeats twice the amida that should be said at the... | It seems that this may be a problem, since you don't gain anything by repeating the Amida at Maariv with ותן טל ומטר since you already did that.
(In other words, you didn't say ותן ברכה the first time, nor the second, so what have you achieved by repeating the Amida?)
See the Aruch Hashulchan in [סימן קח - דידין מי ש... |
65,981 | On a year in which the night we start to say *ותן טל ומטר* is a weekday night, if one forgets to say *ותן ברכה* by the *מנחה* before and doesn't realize that he forgot it until *שקיעה*, what is the Halacha regarding the right insertion to say by each *שמונה עשרה*? | 2015/12/06 | [
"https://judaism.stackexchange.com/questions/65981",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/11267/"
] | It seems that this may be a problem, since you don't gain anything by repeating the Amida at Maariv with ותן טל ומטר since you already did that.
(In other words, you didn't say ותן ברכה the first time, nor the second, so what have you achieved by repeating the Amida?)
See the Aruch Hashulchan in [סימן קח - דידין מי ש... | I don't see a scenario where it would be possible that one halachic ally is considered as having "forgotten to say "v'ten beracha" in the earlier Amidah.
If he is not sure whether he said it, and he has been saying v'ten beracha all along, (for over 7 months, since Pesach), then the Halacha assumes that he said the c... |
65,981 | On a year in which the night we start to say *ותן טל ומטר* is a weekday night, if one forgets to say *ותן ברכה* by the *מנחה* before and doesn't realize that he forgot it until *שקיעה*, what is the Halacha regarding the right insertion to say by each *שמונה עשרה*? | 2015/12/06 | [
"https://judaism.stackexchange.com/questions/65981",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/11267/"
] | The fact that forgetting ותן ברכה justifies a repeat (or tashlumim if the time has passed) means it is an essential part of the amida. So the question becomes how does one make up for an essential part of the amida when the time has passed.
Generally for tashlumim one repeats twice the amida that should be said at the... | I don't see a scenario where it would be possible that one halachic ally is considered as having "forgotten to say "v'ten beracha" in the earlier Amidah.
If he is not sure whether he said it, and he has been saying v'ten beracha all along, (for over 7 months, since Pesach), then the Halacha assumes that he said the c... |
65,981 | On a year in which the night we start to say *ותן טל ומטר* is a weekday night, if one forgets to say *ותן ברכה* by the *מנחה* before and doesn't realize that he forgot it until *שקיעה*, what is the Halacha regarding the right insertion to say by each *שמונה עשרה*? | 2015/12/06 | [
"https://judaism.stackexchange.com/questions/65981",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/11267/"
] | The fact that forgetting ותן ברכה justifies a repeat (or tashlumim if the time has passed) means it is an essential part of the amida. So the question becomes how does one make up for an essential part of the amida when the time has passed.
Generally for tashlumim one repeats twice the amida that should be said at the... | DannyS I think that is a different question. The questioner seemed to be clear (to me) that he was not sure "one forgot to [consciously] say" the correct form, ie v'ten beracha.
As for your case, if someone knows that he erred by saying v'ten tal u'mattar early, I saw a Rabbi Daniel Sperling (yeshiva.org.il 5773, ask... |
65,981 | On a year in which the night we start to say *ותן טל ומטר* is a weekday night, if one forgets to say *ותן ברכה* by the *מנחה* before and doesn't realize that he forgot it until *שקיעה*, what is the Halacha regarding the right insertion to say by each *שמונה עשרה*? | 2015/12/06 | [
"https://judaism.stackexchange.com/questions/65981",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/11267/"
] | DannyS I think that is a different question. The questioner seemed to be clear (to me) that he was not sure "one forgot to [consciously] say" the correct form, ie v'ten beracha.
As for your case, if someone knows that he erred by saying v'ten tal u'mattar early, I saw a Rabbi Daniel Sperling (yeshiva.org.il 5773, ask... | I don't see a scenario where it would be possible that one halachic ally is considered as having "forgotten to say "v'ten beracha" in the earlier Amidah.
If he is not sure whether he said it, and he has been saying v'ten beracha all along, (for over 7 months, since Pesach), then the Halacha assumes that he said the c... |
3,757,651 | Can someone please help me to prove that $$f(x,y)=\frac{x^2\sin(x)}{x^2+y^2}\quad \text{if}\quad (x,y)\not=(0,0),\quad\quad f(0,0)=0$$ is not differentiable at the point $(0,0)$.
Thank you in advance. | 2020/07/15 | [
"https://math.stackexchange.com/questions/3757651",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/640960/"
] | We have:
$$( \frac{a+b}{2})^2 \ge ab \iff \frac{a^2+2ab+b^2}{4} \ge ab \iff a^2-2ab+b^2 \ge 0 \iff (a-b)^2 \ge 0.$$ | Hint: $(x+y)^2-4xy=(x-y)^2\ge0$. Can you see how to rearrange to get $\left(\frac{x+y}{2}\right)^2\ge xy$? |
23,725,860 | ```
$tpl = new Smarty();
$tpl->configLoad('compose.conf');
$config = $tpl->getConfigVars();
print_r($config);
```
it returns
```
Array()
```
What is it, I am doing wrong?
compose.conf
```
[jquery]
jquery = lib/jquery/jquery.js
[jquery_validate]
css=res/css/jquery.validate.css
js=lib/jquery/jquery.validate.js
X... | 2014/05/18 | [
"https://Stackoverflow.com/questions/23725860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3335776/"
] | Use [`SendMailAsync`](http://msdn.microsoft.com/en-us/library/hh193922%28v=vs.110%29.aspx) instead of `SendAsync`:
```
public class EmailService : IIdentityMessageService
{
public async Task SendAsync(IdentityMessage message)
{
// Plug in your email service here to send an email.
var mailMessa... | -Future readers, dispose the MailMessage, or as I prefer to do use the using syntax! I don't know how much memory you lose when you don't dispose it or if it can somehow be reclaimed. I am going to be sending a lot of emails to users so I don't want to find out if it will stop working over time if left alone.
```
publ... |
112,296 | I sometimes like to put spine crawlers in between the minerals and the hive when I am really sick of harassment. How much does this affect the rate of mineral collection? I reckon there must be some impact, since nobody seems to do it. | 2013/04/01 | [
"https://gaming.stackexchange.com/questions/112296",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/46109/"
] | Well, there are multiple theories about this and only one that make somewhat sense:
>
> The theories that she took it off or that it was a oversight by the developers don't make any sense. Even if the brooch doesn't change the plot it's still, weirdly, a important plot point.
>
>
>
>
> The other theory is that... | I had been thinking about this scene since finishing the game and I came up with a theory.
**Warning: Spoilers Ahead**
>
> When Elizabeth first discovers the Lutece twins and comes across the two brooches, she is offered one of two brooches and leaves the decision to Booker. I came to the conclusion that by the end ... |
17,654,530 | I am new to this forum so please go easy on me :)
I have the following in my code
```
#define SYS_SBS 0x02
```
Whenever I try to use this and try to output,I get 2 as the value, however I want to get SYS\_SBS as the output for my program. Is there a way, I can do this.
I have no control over the source code. ... | 2013/07/15 | [
"https://Stackoverflow.com/questions/17654530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2359861/"
] | ```
#include <stdio.h>
#define SYS_SBS 0x02
#define id(x) #x
int main(){
printf("%s %d\n", id(SYS_SBS), SYS_SBS);
return 0;
}
``` | `0x02` is the hexadecimal representation in the *source*. Once you compiled it, it's just a number (2).
If you want to print it as hex, then, well... print it as hex (eg: use the formatting string `"0x%.2x"`).
Well, you could simply:
```
printf("SYS_SBS");
```
But I assume you have a number as "input" (like 2), an... |
17,654,530 | I am new to this forum so please go easy on me :)
I have the following in my code
```
#define SYS_SBS 0x02
```
Whenever I try to use this and try to output,I get 2 as the value, however I want to get SYS\_SBS as the output for my program. Is there a way, I can do this.
I have no control over the source code. ... | 2013/07/15 | [
"https://Stackoverflow.com/questions/17654530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2359861/"
] | ```
#include <stdio.h>
#define SYS_SBS 0x02
#define id(x) #x
int main(){
printf("%s %d\n", id(SYS_SBS), SYS_SBS);
return 0;
}
``` | The C standard provides a [stringification](http://gcc.gnu.org/onlinedocs/cpp/Stringification.html) operator (add a # in front of the token) that allows you to outuput a specific token.
What's not possible is to convert backwards from a variable's value to this token name as this is lost during translations (as others... |
62,944,714 | I am attempting to code Conway's Game of Life. As far as I can tell the program should be complete, but when I run it I get KeyError: 0, which to my understanding means a nonexistent dictionary key was referenced. The dictionary (cell\_dict) contains the 20x20 grid of tkinter buttons that form the dead/alive cells.
He... | 2020/07/16 | [
"https://Stackoverflow.com/questions/62944714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13702786/"
] | Functions in the WITH clause work in SQL but not in PL/SQL. To keep the SQL statement as-is, you'll need to use dynamic SQL:
```
declare
type number_nt is table of number;
v_numbers number_nt;
begin
--Your original example only returned one row. But since there is a loop,
--I assume the real code could... | I dont think `with function` is a correct syntax in Oracle or SQLServer.
You need to first define your function. try this code -
```
declare
i number(10);
function f(x in number) return number as
begin
return x*2;
end f;
begin
for i in (
select f(2) r from dual;
)
... |
1,341,345 | If I have the following example file where each number is represents a byte (123 has bytes 1, 2, and 3):
```
123456789
```
Let's say I create a FileInputStream. This reads in the binary byte by byte. So .read() returns 1, then 2, etc. Now let's say I create a buffer. The initial chunk it reads in (if I understand bu... | 2009/08/27 | [
"https://Stackoverflow.com/questions/1341345",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148389/"
] | **Yes**.
From the `java.util.Scanner` code:
```
// Internal buffer used to hold input
private CharBuffer buf;
// Size of internal character buffer
private static final int BUFFER_SIZE = 1024; // change to 1024;
``` | It's not obvious, but if you look at the API doc of Scanner carefully, you see that it's based on the [`Readable`](http://java.sun.com/javase/6/docs/api/java/lang/Readable.html) interface - and the only method in that interface is based on a buffer. So yes, Scanner implicitly creates a buffer. |
54,706,936 | This is my form:
```
<form id="sessie_datum">
<input type="text" id="datepicker" placeholder="Klik hier om een datum te kiezen" name="wapbk_hidden_date" value="">
<input type="submit" value"submit">
</form>
```
I submit this form with AJAX into my root folder of WordPress in a file called datum.php
My jQuer... | 2019/02/15 | [
"https://Stackoverflow.com/questions/54706936",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11047651/"
] | You are sending the date using ajax in datum.php. how to get in datum.php i total depends on you ajax 'type' which is POST or GET.
```
If type = POST
$_SESSION["chosen_date"] = $_POST['wapbk_hidden_date'];
if Type = GET
$_SESSION['chosen_date'] = $_GET['wapbk_hidden_date']
echo $_SESSION['chosen_date'];
``` | in datum.php
make it as a session like
`session_start();`
`if(isset($_REQUEST['wapbk_hidden_date'])) {`
`$_SESSION['wapbk_hidden_date']=$_REQUEST['wapbk_hidden_date'];`
`}` |
5,073,811 | Hey all. I'm really new at this obj-c/xcode stuff. I'm trying to load the background of my xib file. To do this i'm using a UIImageView and populating that with an image I found from the net. the problem with that is that it's REALLY slow. Feels like it's crashing but it's not. I was told to use an NSURLConnection to f... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5073811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/584765/"
] | `NSURLConnection` will download the data in a new thread, so you app will feel much faster.
It is pretty easy to implement but it does require you to understand the concept of delegation.
I have a useful class I created to handle image downloads on separate threads, I will share the code with you, with comments to le... | You need to do parsing for this as you are using the webservice.Like this
```
-(void)startParsingForPhotoAlbumList:(NSString*)providerIdString
{
NSString *urlString = [NSString stringWithFormat:@"http://YourUrl/showalbumxml.php?id=%@&show=show",providerIdString];
NSURL *xmlURL = [NSURL URLWithString:urlString]... |
5,073,811 | Hey all. I'm really new at this obj-c/xcode stuff. I'm trying to load the background of my xib file. To do this i'm using a UIImageView and populating that with an image I found from the net. the problem with that is that it's REALLY slow. Feels like it's crashing but it's not. I was told to use an NSURLConnection to f... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5073811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/584765/"
] | `NSURLConnection` will download the data in a new thread, so you app will feel much faster.
It is pretty easy to implement but it does require you to understand the concept of delegation.
I have a useful class I created to handle image downloads on separate threads, I will share the code with you, with comments to le... | There is an example which may help:
[NSURLConnection loading image example](http://www.qbmob.com/?p=171) |
5,073,811 | Hey all. I'm really new at this obj-c/xcode stuff. I'm trying to load the background of my xib file. To do this i'm using a UIImageView and populating that with an image I found from the net. the problem with that is that it's REALLY slow. Feels like it's crashing but it's not. I was told to use an NSURLConnection to f... | 2011/02/22 | [
"https://Stackoverflow.com/questions/5073811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/584765/"
] | You need to do parsing for this as you are using the webservice.Like this
```
-(void)startParsingForPhotoAlbumList:(NSString*)providerIdString
{
NSString *urlString = [NSString stringWithFormat:@"http://YourUrl/showalbumxml.php?id=%@&show=show",providerIdString];
NSURL *xmlURL = [NSURL URLWithString:urlString]... | There is an example which may help:
[NSURLConnection loading image example](http://www.qbmob.com/?p=171) |
50,981,288 | I'm getting the below error on Tableau Desktop when using the custom query, I'm successfully able to connect and see contents from the table when directly drag the table to query builder section on Tableau Desktop.
Datasource used: AWS Athena
Driver version: AthenaJDBC42\_2.0.2
Tableau Desktop version: 10.4
```
com... | 2018/06/22 | [
"https://Stackoverflow.com/questions/50981288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1939568/"
] | Try removing the ; from the subquery - That always throws errors for me | I was having the same issue.
To provide some clarity to the above - the outer query is being added by Tableau. Here is my simple query and the error being returned by Tableau. [](https://i.stack.imgur.com/xFcBG.jpg)
I was able to resolve by changi... |
3,896,164 | Yesterday, I faced the problem : what is the number of ring isomorphisms from $\mathbb{Z}^2$ to $\mathbb{Z}^2$. And I got $6$. After then, I found that if $n=3$, the number is $3! \times 29$. Suddenly, I wondered what is the number of isomorphisms from $\mathbb{Z}^n$ to $\mathbb{Z}^n$. I have tried to solve it but fail... | 2020/11/06 | [
"https://math.stackexchange.com/questions/3896164",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/433491/"
] | >
> One of my friends gave me a suggestion to find the number of $n×n$ invertible matrices with components $1$ or $0$.
>
>
>
This is [OEIS A055165](https://oeis.org/A055165); there appears to be no simple formula for it. | Any ring homomorphism $\phi$ sends idempotents (elements $e$ satisfying $e^2=1$) to idempotents. The idempotents of $\mathbb{Z}^n$ are the vectors with coordinates all $0$ or $1$. These correspond to subsets of $\{1,\cdots,n\}$ (to describe where the $1$s occur in the coordinates). Thus, if $e\_1,\cdots,e\_n$ refer to ... |
36,168,321 | I have two `JComboBox` components and a `JLabel`. The two combo boxes both contain Strings and the label is supposed to have the price added. My issue is that I can not figure out how to set int values to the combo box selections and then add those integerss and make them output on the label. So far it sticks at 0 and ... | 2016/03/23 | [
"https://Stackoverflow.com/questions/36168321",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6101767/"
] | I found out that there were more problems which I needed to fix (I got it working only with xcode building, so far the ionic package still does not want to register my device).
If you are using development certificates you need to create in your ionic.io Settings -> Certificates a certificate with **development** type... | I've got the same issue before, try connnecting your iphone to internet and then rebuild.
If it works, I don't know why it solves the problem. |
36,168,321 | I have two `JComboBox` components and a `JLabel`. The two combo boxes both contain Strings and the label is supposed to have the price added. My issue is that I can not figure out how to set int values to the combo box selections and then add those integerss and make them output on the label. So far it sticks at 0 and ... | 2016/03/23 | [
"https://Stackoverflow.com/questions/36168321",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6101767/"
] | I found out that there were more problems which I needed to fix (I got it working only with xcode building, so far the ionic package still does not want to register my device).
If you are using development certificates you need to create in your ionic.io Settings -> Certificates a certificate with **development** type... | If you remove and add your ios platform, XCode loses all provisioning profile staff and "Automatically manage signing" for you. This makes your existing Provisioning Profile "Invalid". You have to go and regenerate you Provisioning Profile (from IOS Developer Console) again and import to XCode.
In Xcode in Capabiliti... |
1,538,994 | We are working on a new web site using Apache, Python and Django.
In the development phase, no problem but once binding to Apache, using Firefox 3.5.3, we got a strange problem.
We stand on :
<http://website.fr/search/>
When we want to change the ordering of the research, we are sending the user to :
<http://websi... | 2009/10/08 | [
"https://Stackoverflow.com/questions/1538994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/186202/"
] | I'd say you're doing it wrong. The same URL should be the same page. Everything with HTTP and web browsers assume this, and when you don't follow this convention you're going to get yourself into trouble. Just add the search parameters and sort orders as query parameters to the URL. | How about redirecting to
```
http://website.fr/search/?ignoredvar=<random int>
```
Please provide the full http conversation If you need a better solution.
The conversation can be traced using firebug or live http headers.
Btw. The above solution is the only one I know for similar bug in a flash on IE. |
1,538,994 | We are working on a new web site using Apache, Python and Django.
In the development phase, no problem but once binding to Apache, using Firefox 3.5.3, we got a strange problem.
We stand on :
<http://website.fr/search/>
When we want to change the ordering of the research, we are sending the user to :
<http://websi... | 2009/10/08 | [
"https://Stackoverflow.com/questions/1538994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/186202/"
] | What happens is, the browser asks for the new URL and via 302 gets redirected back to the previous one, which is in the cache and thus not refreshed. Adding a random integer, like Piotr is suggesting will solve the problem. For randomness you can use simple timestamp.
Implication of performing forward as you are doing... | How about redirecting to
```
http://website.fr/search/?ignoredvar=<random int>
```
Please provide the full http conversation If you need a better solution.
The conversation can be traced using firebug or live http headers.
Btw. The above solution is the only one I know for similar bug in a flash on IE. |
1,538,994 | We are working on a new web site using Apache, Python and Django.
In the development phase, no problem but once binding to Apache, using Firefox 3.5.3, we got a strange problem.
We stand on :
<http://website.fr/search/>
When we want to change the ordering of the research, we are sending the user to :
<http://websi... | 2009/10/08 | [
"https://Stackoverflow.com/questions/1538994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/186202/"
] | What happens is, the browser asks for the new URL and via 302 gets redirected back to the previous one, which is in the cache and thus not refreshed. Adding a random integer, like Piotr is suggesting will solve the problem. For randomness you can use simple timestamp.
Implication of performing forward as you are doing... | I'd say you're doing it wrong. The same URL should be the same page. Everything with HTTP and web browsers assume this, and when you don't follow this convention you're going to get yourself into trouble. Just add the search parameters and sort orders as query parameters to the URL. |
28,941,768 | I am attempting to make a form that has 3 fields. It also has buttons to add another set of fields called modules. This part works. Each module that is created, should then be able to create more sets of fields below them called tasks.
The hierarchy goes:
```
Project:
Module:
Task 1:
Task 2:
M... | 2015/03/09 | [
"https://Stackoverflow.com/questions/28941768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4122367/"
] | I solved it using the jQuery used on this fiddle iteration:
<http://jsfiddle.net/smkarber/ezdk96z3/19/>
Basically, I had to navigate using familial relationships, and since the hierarchy will always be the same, it is perfectly reliable.
```
$('#div_form').on('click', '.f_addTask', function() {
$(this).parent()... | You can create a global counter, and append this counter to the container where you want to insert the tasks:
```
'<div class="div_task_'+count+'"></div>'
'<input type="button" value="Add Task" id="f_addTask" onclick="addTask('+count+')" />'
'<input type="button" value="Undo Add" id="f_undoAddTask" onclick="removeTask... |
31,687,775 | I just want to create a field which will appear if the user clicks on a button. I know that would also work with just a simple target in CSS, but in my use, I need to do this in the way I tried it. I know it's very much CSS, but I think it shouldn't be too hard to check.
Here is my try:
```js
function brief() {
$(... | 2015/07/28 | [
"https://Stackoverflow.com/questions/31687775",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5166922/"
] | I am guessing that you mean to update your records when you say `alter the table`. If so, you can simply rewrite your update statement with join like this:
```
UPDATE a_dataset a
JOIN b_dataset b ON a.ID = b.ID
SET a.lang_flag = b.[LANGUAGE]
``` | As Uueerdo and myself said: Starting table names with numbers is a bad[TM] idea. The same is for letters, which you now chose to use. a is no better than 1 in this regard. Also calling tables just "dataset" isn't really helpful either. What is the table storing? Users? Then call it users. Articles on a news web site? T... |
3,850 | Placing [this post](https://philosophy.stackexchange.com/questions/59265/how-does-god-know-that-he-is-eternal) on hold seems inconsistent with guidance provided in Philosophy Meta (examples: [here](https://philosophy.meta.stackexchange.com/questions/32/what-is-considered-off-topic/61#61) and [here](https://philosophy.m... | 2019/01/02 | [
"https://philosophy.meta.stackexchange.com/questions/3850",
"https://philosophy.meta.stackexchange.com",
"https://philosophy.meta.stackexchange.com/users/36014/"
] | I agree that this question should not have been closed. I also feel that the current moderation approach is overzealous in closing both questions and answers, in a way that is not beneficial to this community.
With all that said, your linked meta questions are out of date. Please refer to this one instead: [Friends, ... | I have not closed the question myself, even if I probably would have done so if I had handled a flag.
The reason is not that it is about Christianity, certainly not.
The reasons, for me, would be that
1. it is a very naive and uninformed question about concepts. For
example, comments rightfully pointed out that nei... |
25,604,636 | I hope someone can help me with following issue:
I'm trying automatically install network printer: first script asks user for his network credentials and then run second one, installing a printer. Problem is: scripts not throws any errors but no printer added:
```
Dim objNetwork
Set objNetwork = CreateObject("WScript.... | 2014/09/01 | [
"https://Stackoverflow.com/questions/25604636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1954572/"
] | Thanks to @Bharal I was able to find a solution...
By using the Ti.Media.openPhotoGallery() method I was able to identify the correct native path for the image by inspecting the event object returned from the success callback.
The path was missing 'file://' at the beginning, I couldn't be 100% sure but I suspect this... | Yah mon, i dunno.
Here is wat i used when i was doin pictures on my Ti app, but then i got rid of that section because i realised i didn't need to be doin pictures. Pictures mon, dey ain' what you want sometimes, yo?
```
Ti.Media.openPhotoGallery({ //dissall jus' open up a piccha selectin' ting. ez.
succe... |
258,844 | I used simple XML sitemap module to create a sitemap for search engines but now I need one sitemap for visitors.
Can I create this manually instead of using a module because the site already has too many modules?
I was thinking to create a basic page and just add the links there one by one.
Is this a good way? | 2018/03/29 | [
"https://drupal.stackexchange.com/questions/258844",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/71485/"
] | Depends on how often your site changes and who makes the changes.
If it's a single person and that person can remember to add new pages to the site map then manual is probably OK.
If you have non-technical people adding pages to the site, chances are that they will not update the map just add it to the menu.
With a... | Easiest way perhaps using the Main menu block and displaying them at the sitemap page's content region.
If you already have the [Menu Block](https://www.drupal.org/project/menu_block) installed, it'll give you more flexibility configuring how deep to expand the shown menus as well.
Then you can simply style the menu ... |
258,844 | I used simple XML sitemap module to create a sitemap for search engines but now I need one sitemap for visitors.
Can I create this manually instead of using a module because the site already has too many modules?
I was thinking to create a basic page and just add the links there one by one.
Is this a good way? | 2018/03/29 | [
"https://drupal.stackexchange.com/questions/258844",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/71485/"
] | There is a module that does what you want, and it isn't XML Sitemap but just Sitemap:
<https://www.drupal.org/project/sitemap>
>
> This module provides a site map that gives visitors an overview of
> your site. It can also display the RSS feeds for all blogs and
> categories.
>
>
> Drupal generates the RSS feeds... | Easiest way perhaps using the Main menu block and displaying them at the sitemap page's content region.
If you already have the [Menu Block](https://www.drupal.org/project/menu_block) installed, it'll give you more flexibility configuring how deep to expand the shown menus as well.
Then you can simply style the menu ... |
485,238 | I'm trying to learn physics, and I have a question regarding Newton's Cradle.
I learned that momentum is conserved on a Newton's Cradle, and that momentum conservation is only for closed systems (no interaction with the external environment).
So, how Newton's Cradle can Conserve Momentum if we have the action of grav... | 2019/06/10 | [
"https://physics.stackexchange.com/questions/485238",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/234214/"
] | It's the simplest action of a field $X^I(\sigma,\tau)$ defined on a 2d worldsheet which is manifestly Lorentz invariant in target space. Your action is a special case of the Polyakov action where both the worldsheet metric $h^{ab}(\sigma,\tau)$ and the target space metric $g\_{\mu \nu}(X)$ are taken to be flat. | 1. FWIW, it is in principle possible to systematically derive the light-cone action (12.81) from (the Hamiltonian formulation of) the [Nambu-Goto (NG) string](https://en.wikipedia.org/wiki/Nambu%E2%80%93Goto_action), see e.g. [this](https://physics.stackexchange.com/q/184742/2451) related Phys.SE post.
2. The NG action... |
485,238 | I'm trying to learn physics, and I have a question regarding Newton's Cradle.
I learned that momentum is conserved on a Newton's Cradle, and that momentum conservation is only for closed systems (no interaction with the external environment).
So, how Newton's Cradle can Conserve Momentum if we have the action of grav... | 2019/06/10 | [
"https://physics.stackexchange.com/questions/485238",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/234214/"
] | It's the simplest action of a field $X^I(\sigma,\tau)$ defined on a 2d worldsheet which is manifestly Lorentz invariant in target space. Your action is a special case of the Polyakov action where both the worldsheet metric $h^{ab}(\sigma,\tau)$ and the target space metric $g\_{\mu \nu}(X)$ are taken to be flat. | $$
\delta S=\int\_{\tau\_{i}}^{\tau\_{f}} d \tau\left[\delta X^{\mu} \mathcal{P}\_{\mu}^{\sigma}\right]\_{0}^{\sigma\_{1}}-\int\_{\tau\_{i}}^{\tau\_{f}} d \tau \int\_{0}^{\sigma\_{1}} d \sigma \delta X^{\mu}\left(\frac{\partial \mathcal{P}\_{\mu}^{\tau}}{\partial \tau}+\frac{\partial \mathcal{P}\_{\mu}^{\sigma}}{\parti... |
485,238 | I'm trying to learn physics, and I have a question regarding Newton's Cradle.
I learned that momentum is conserved on a Newton's Cradle, and that momentum conservation is only for closed systems (no interaction with the external environment).
So, how Newton's Cradle can Conserve Momentum if we have the action of grav... | 2019/06/10 | [
"https://physics.stackexchange.com/questions/485238",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/234214/"
] | 1. FWIW, it is in principle possible to systematically derive the light-cone action (12.81) from (the Hamiltonian formulation of) the [Nambu-Goto (NG) string](https://en.wikipedia.org/wiki/Nambu%E2%80%93Goto_action), see e.g. [this](https://physics.stackexchange.com/q/184742/2451) related Phys.SE post.
2. The NG action... | $$
\delta S=\int\_{\tau\_{i}}^{\tau\_{f}} d \tau\left[\delta X^{\mu} \mathcal{P}\_{\mu}^{\sigma}\right]\_{0}^{\sigma\_{1}}-\int\_{\tau\_{i}}^{\tau\_{f}} d \tau \int\_{0}^{\sigma\_{1}} d \sigma \delta X^{\mu}\left(\frac{\partial \mathcal{P}\_{\mu}^{\tau}}{\partial \tau}+\frac{\partial \mathcal{P}\_{\mu}^{\sigma}}{\parti... |
3,379,973 | I'm dynamically generating a grid of EditText views in code based on a specified number of rows and columns. I want each of the EditText views to be the same width (e.g., 100dp).
Although I can set the size of the views with either setWidth or by creating a LayoutParam object, I only seem able to specify the value in ... | 2010/07/31 | [
"https://Stackoverflow.com/questions/3379973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/230388/"
] | I have a method in a Utils class that does this conversion:
```
public static int dip(Context context, int pixels) {
float scale = context.getResources().getDisplayMetrics().density;
return (int) (pixels * scale + 0.5f);
}
``` | ```
float value = 12;
int unit = TypedValue.COMPLEX_UNIT_DIP;
DisplayMetrics metrics = getResources().getDisplayMetrics();
float dipPixel = TypedValue.applyDimension(unit, value, metrics);
``` |
3,379,973 | I'm dynamically generating a grid of EditText views in code based on a specified number of rows and columns. I want each of the EditText views to be the same width (e.g., 100dp).
Although I can set the size of the views with either setWidth or by creating a LayoutParam object, I only seem able to specify the value in ... | 2010/07/31 | [
"https://Stackoverflow.com/questions/3379973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/230388/"
] | ```
float value = 12;
int unit = TypedValue.COMPLEX_UNIT_DIP;
DisplayMetrics metrics = getResources().getDisplayMetrics();
float dipPixel = TypedValue.applyDimension(unit, value, metrics);
``` | **Using the below code i was able to do it.**
>
> int width = (int)
> TypedValue.applyDimension(TypedValue.COMPLEX\_UNIT\_DIP, (100)your Size
> in int, getResources().getDisplayMetrics());
>
>
> |
3,379,973 | I'm dynamically generating a grid of EditText views in code based on a specified number of rows and columns. I want each of the EditText views to be the same width (e.g., 100dp).
Although I can set the size of the views with either setWidth or by creating a LayoutParam object, I only seem able to specify the value in ... | 2010/07/31 | [
"https://Stackoverflow.com/questions/3379973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/230388/"
] | I have a method in a Utils class that does this conversion:
```
public static int dip(Context context, int pixels) {
float scale = context.getResources().getDisplayMetrics().density;
return (int) (pixels * scale + 0.5f);
}
``` | **Using the below code i was able to do it.**
>
> int width = (int)
> TypedValue.applyDimension(TypedValue.COMPLEX\_UNIT\_DIP, (100)your Size
> in int, getResources().getDisplayMetrics());
>
>
> |
65,028,452 | How can I use groupby and mean on a DataFrame, keeping all non-numeric columns?
Example:
```
ID label_1 label_2 label_3 label_4
0 1 0.582152 13 A False
1 1 0.177475 3 A False
2 2 0.263141 13 B True
3 2 0.630196 ... | 2020/11/26 | [
"https://Stackoverflow.com/questions/65028452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13131079/"
] | Using GNAT Community 2020 I get the following diagnostics using SPARK:
```
package threads with
SPARK_Mode
is
X : Natural := 0;
pragma Volatile (X);
task type AddTen with
Global => (in_out => X);
end threads;
pragma Ada_2012;
package body threads with
SPARK_Mode
is
------------
-- AddTen --
... | Absent round-robin scheduling, which isn’t the default (it’s usually FIFO within priorities), why would the tasks swap? There are no scheduling points there. *I should add, I’m more used to scheduling with Ravenscar RTSs on single-processor MCUs, so I’ve probably got the wrong idea here!*
That would result in 200 ever... |
17,543,202 | Env: JBoss AS 7.1.1.Final.
I have a WAR application using a data source taken from JBoss AS JNDI. When I shut down the server (Ctrl+C in the console), the application receives a shutdown command and starts to destroy its Spring context. However, I use a scheduler to perform some DB operations. When the application is ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17543202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466738/"
] | I don't know which functionality is offered by Spring Scheduling, but if you had used an executor from the standard API, the solution would have been to add a `ServletContextListener` to your web application, which is invoked by the container when undeploying or stopping your application. In the `contextDestroyed(Servl... | Have you considered using EJB Scheduled bean? This way jboss will spawn the worker thread. |
17,543,202 | Env: JBoss AS 7.1.1.Final.
I have a WAR application using a data source taken from JBoss AS JNDI. When I shut down the server (Ctrl+C in the console), the application receives a shutdown command and starts to destroy its Spring context. However, I use a scheduler to perform some DB operations. When the application is ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17543202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466738/"
] | I had the same problem, and I have now found the cause described in <https://issues.jboss.org/browse/WFLY-944> . The solution proposed there in order to avoid it, is to declare the jndi as a resource in your web application, so that it does not unbind from the jboss server before your application terminates.
To achie... | Have you considered using EJB Scheduled bean? This way jboss will spawn the worker thread. |
17,543,202 | Env: JBoss AS 7.1.1.Final.
I have a WAR application using a data source taken from JBoss AS JNDI. When I shut down the server (Ctrl+C in the console), the application receives a shutdown command and starts to destroy its Spring context. However, I use a scheduler to perform some DB operations. When the application is ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17543202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466738/"
] | I don't know which functionality is offered by Spring Scheduling, but if you had used an executor from the standard API, the solution would have been to add a `ServletContextListener` to your web application, which is invoked by the container when undeploying or stopping your application. In the `contextDestroyed(Servl... | I found [this JBoss AS issue](https://issues.jboss.org/browse/WFLY-944), which reflects my problem. It appears that if the data sources are not bound in a static way, via @Resource, then the server does not know that the data source is still in use. I went with letting Spring manage the data sources on its own, which m... |
17,543,202 | Env: JBoss AS 7.1.1.Final.
I have a WAR application using a data source taken from JBoss AS JNDI. When I shut down the server (Ctrl+C in the console), the application receives a shutdown command and starts to destroy its Spring context. However, I use a scheduler to perform some DB operations. When the application is ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17543202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466738/"
] | I had the same problem, and I have now found the cause described in <https://issues.jboss.org/browse/WFLY-944> . The solution proposed there in order to avoid it, is to declare the jndi as a resource in your web application, so that it does not unbind from the jboss server before your application terminates.
To achie... | I don't know which functionality is offered by Spring Scheduling, but if you had used an executor from the standard API, the solution would have been to add a `ServletContextListener` to your web application, which is invoked by the container when undeploying or stopping your application. In the `contextDestroyed(Servl... |
17,543,202 | Env: JBoss AS 7.1.1.Final.
I have a WAR application using a data source taken from JBoss AS JNDI. When I shut down the server (Ctrl+C in the console), the application receives a shutdown command and starts to destroy its Spring context. However, I use a scheduler to perform some DB operations. When the application is ... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17543202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466738/"
] | I had the same problem, and I have now found the cause described in <https://issues.jboss.org/browse/WFLY-944> . The solution proposed there in order to avoid it, is to declare the jndi as a resource in your web application, so that it does not unbind from the jboss server before your application terminates.
To achie... | I found [this JBoss AS issue](https://issues.jboss.org/browse/WFLY-944), which reflects my problem. It appears that if the data sources are not bound in a static way, via @Resource, then the server does not know that the data source is still in use. I went with letting Spring manage the data sources on its own, which m... |
1,836,753 | a,b,c,d $\in \mathbb{R}$ $a,b,c,d \gt 0$ and $ c^2 +d^2=(a^2 +b^2)^3$ prove that $$ \frac{a^3}{c} + \frac{b^3}{d} \ge 1$$
If I rewrite the inequation like $ \frac{a^3}{c} + \frac{b^3}{d} \ge \frac{c^2 +d^2}{(a^2 +b^2)^3}$ and manage to simplfy it brings me nowhere. I try with
Cauchy-Schwarz Inequality but still can n... | 2016/06/23 | [
"https://math.stackexchange.com/questions/1836753",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/348432/"
] | Using Titu's Lemma, we have
$$ \dfrac{a^3}{c} + \dfrac{b^3}{d} \ge \dfrac{(a^2+b^2)^2}{ac+bd}$$
So, we are left to prove that
$$ (a^2+b^2)^2 \geq (ac+bd)\tag{1} $$
Using Cauchy-Schwarz inequality, we have
$$(a^2+b^2)(c^2+d^2) \geq (ac+bd)^2\tag{2}$$
Using the given proposition, $$c^2+d^2 =(a^2+b^2)^3$$ in $(2)$... | Another way would be Holder's inequality which gives:
$$\left(\frac{a^3}c+\frac{b^3}d \right)^2(c^2+d^2)\geqslant (a^2+b^2)^3$$ |
69,122,486 | Maybe there is a better way of achieving what I want, but this is my current attempt.
I am working with the [`singletons`](https://hackage.haskell.org/package/singletons) package in order to reify values into types. This works fine, but at some point I will have to run a function that is polymorphic in the reified typ... | 2021/09/09 | [
"https://Stackoverflow.com/questions/69122486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15973603/"
] | Two options spring to mind:
1. Implement
```
withTypeable :: SType a -> (Typeable a => r) -> r
```
via exhaustive pattern matching on the first argument. Then instead of just `withSomeSing`, you use both, as in `withSomeSing typ $ \singType -> withTypeable singType $ ...`.
2. Upgrade your `Sing` instance. Write
`... | You can avoid the CPS style entirely. Any time I see `(Cls a => res) -> res` I prefer to use pattern matching.
*singletons* has [pattern `FromSing`](https://hackage.haskell.org/package/singletons-3.0/docs/Data-Singletons.html#v:FromSing) which replaces `withSomeSing` with a pattern match:
```
checkResult :: EType -> ... |
49,885,323 | I have a table in Hive as below -
```
create table somedf
(sellers string ,
orders int
)
insert into somedf values
('1--**--2--**--3',50),
('1--**--2', 10)
```
The table has a column called sellers and it is delimited by the characters described in the insert statement. I would like to split the sellers into m... | 2018/04/17 | [
"https://Stackoverflow.com/questions/49885323",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8229534/"
] | The pattern passed into `split` is incorrect. `*` character needs to be escaped. No need to escape `-`.
Use
```
select exploded_sellers, orders
from somedf
lateral view outer explode(split(sellers,'--\\*\\*--')) t1 as exploded_sellers
``` | This would work too. It expects two occurrences of \* in the middle.
```
select exploded_sellers, orders
from somedf
lateral view outer explode(split(sellers,'--\\*{2}--')) t1 as exploded_sellers;
``` |
44,268,305 | I am a programming student, I'm trying to build a simple website using HTML, JavaScripts, and jQuery for the front-end, and node.js + Express frameworks for the back-end.
In this example, I am using Ajax to get data, then append HTML codes + this data to a div element with the id = 'listFile'. The implementation work... | 2017/05/30 | [
"https://Stackoverflow.com/questions/44268305",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4776227/"
] | Change your `click` binding like below:
```
$(document).on('click', '#deleteButton',function(){
alert("DELETED");
});
```
**Explanation:** `$('#deleteButton').click` event will work only for available DOM element when window load successfully. As Delete button is created dynamically using ajax so you should use `... | try this
```
$.ajax({
url: '/download',
method: "get",
success: function(data){
for(i=1; i<data.length; i++){
$('#listFile').append("<tr><td id='tab'><a href='#' class='list-group-item' id='"+data[i]+"' style='margin-top:5px' value='"+data[i]+"'>"+data[i]+"</a></td>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.