qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
138,522 | I'd like to start my music player (Clementine) when my bluetooth headset connects to my computer. How do I detect the bluetooth device connecting so I can run a script to start the player? | 2012/05/17 | [
"https://askubuntu.com/questions/138522",
"https://askubuntu.com",
"https://askubuntu.com/users/252/"
] | Here is another example for monitoring all Bluetooth devices. It does not need to specify a specific MAC address. This approach makes the xinput setting persistent even when login/out, suspend/wake and connect/dis-connect your bluetooth device.
I have a Thinkpad compact Bluetooth Keyboard, and I wish to run an xinput ... | If none of the previous solutions worked for you for any reason, I wrote a Python script using `pydbus` package. `dbus-python` as in @Erigami, @Hitul and @Yixing answers was giving me hard times, so I switched to this one.
<https://gist.github.com/altbrace/52ae1783b31257021520673fadb95b6e>
This particular script chan... |
138,522 | I'd like to start my music player (Clementine) when my bluetooth headset connects to my computer. How do I detect the bluetooth device connecting so I can run a script to start the player? | 2012/05/17 | [
"https://askubuntu.com/questions/138522",
"https://askubuntu.com",
"https://askubuntu.com/users/252/"
] | To discover a successfully established Bluetooth connection we can run
```
sdptool browse xx:xx:xx:xx:xx:xx
```
By this the SDB connection will be tested for a connection to the given MAC address. It may take considerable time until browsing times out with an error like
```
Failed to connect to SDP server on 00:0C:... | Here is another example for monitoring all Bluetooth devices. It does not need to specify a specific MAC address. This approach makes the xinput setting persistent even when login/out, suspend/wake and connect/dis-connect your bluetooth device.
I have a Thinkpad compact Bluetooth Keyboard, and I wish to run an xinput ... |
138,522 | I'd like to start my music player (Clementine) when my bluetooth headset connects to my computer. How do I detect the bluetooth device connecting so I can run a script to start the player? | 2012/05/17 | [
"https://askubuntu.com/questions/138522",
"https://askubuntu.com",
"https://askubuntu.com/users/252/"
] | I didn't like the polling approach, so I did some digging on bluez and DBus. I ended up writing the following script:
```
#!/usr/bin/python
import dbus
from dbus.mainloop.glib import DBusGMainLoop
import gobject
import subprocess
# ID of the device we care about
DEV_ID = '00_1D_54_AB_DC_72'
dbus_loop = DBusGMainLo... | To discover a successfully established Bluetooth connection we can run
```
sdptool browse xx:xx:xx:xx:xx:xx
```
By this the SDB connection will be tested for a connection to the given MAC address. It may take considerable time until browsing times out with an error like
```
Failed to connect to SDP server on 00:0C:... |
138,522 | I'd like to start my music player (Clementine) when my bluetooth headset connects to my computer. How do I detect the bluetooth device connecting so I can run a script to start the player? | 2012/05/17 | [
"https://askubuntu.com/questions/138522",
"https://askubuntu.com",
"https://askubuntu.com/users/252/"
] | To discover a successfully established Bluetooth connection we can run
```
sdptool browse xx:xx:xx:xx:xx:xx
```
By this the SDB connection will be tested for a connection to the given MAC address. It may take considerable time until browsing times out with an error like
```
Failed to connect to SDP server on 00:0C:... | You write "when your headset connects to your computer". How does it do that, automatically? When you have to trigger it manually, you might as well make it a script and then run your script after the connection has been established. This is what I did to set the default output device to my bluetooth receiver (so I can... |
138,522 | I'd like to start my music player (Clementine) when my bluetooth headset connects to my computer. How do I detect the bluetooth device connecting so I can run a script to start the player? | 2012/05/17 | [
"https://askubuntu.com/questions/138522",
"https://askubuntu.com",
"https://askubuntu.com/users/252/"
] | @Erigami Your answer helped a lot but to make it work I'd to do some changes. I'm using ubuntu 14.04.
```
#!/usr/bin/python
import dbus
from dbus.mainloop.glib import DBusGMainLoop
import gobject
import subprocess
# ID of the device we care about
DEV_ID = 'CC:C3:EA:A5:16:90'.replace(":", "_")
dbus_loop = DBusGMain... | If none of the previous solutions worked for you for any reason, I wrote a Python script using `pydbus` package. `dbus-python` as in @Erigami, @Hitul and @Yixing answers was giving me hard times, so I switched to this one.
<https://gist.github.com/altbrace/52ae1783b31257021520673fadb95b6e>
This particular script chan... |
138,522 | I'd like to start my music player (Clementine) when my bluetooth headset connects to my computer. How do I detect the bluetooth device connecting so I can run a script to start the player? | 2012/05/17 | [
"https://askubuntu.com/questions/138522",
"https://askubuntu.com",
"https://askubuntu.com/users/252/"
] | @Erigami Your answer helped a lot but to make it work I'd to do some changes. I'm using ubuntu 14.04.
```
#!/usr/bin/python
import dbus
from dbus.mainloop.glib import DBusGMainLoop
import gobject
import subprocess
# ID of the device we care about
DEV_ID = 'CC:C3:EA:A5:16:90'.replace(":", "_")
dbus_loop = DBusGMain... | Here is another example for monitoring all Bluetooth devices. It does not need to specify a specific MAC address. This approach makes the xinput setting persistent even when login/out, suspend/wake and connect/dis-connect your bluetooth device.
I have a Thinkpad compact Bluetooth Keyboard, and I wish to run an xinput ... |
138,522 | I'd like to start my music player (Clementine) when my bluetooth headset connects to my computer. How do I detect the bluetooth device connecting so I can run a script to start the player? | 2012/05/17 | [
"https://askubuntu.com/questions/138522",
"https://askubuntu.com",
"https://askubuntu.com/users/252/"
] | I didn't like the polling approach, so I did some digging on bluez and DBus. I ended up writing the following script:
```
#!/usr/bin/python
import dbus
from dbus.mainloop.glib import DBusGMainLoop
import gobject
import subprocess
# ID of the device we care about
DEV_ID = '00_1D_54_AB_DC_72'
dbus_loop = DBusGMainLo... | You write "when your headset connects to your computer". How does it do that, automatically? When you have to trigger it manually, you might as well make it a script and then run your script after the connection has been established. This is what I did to set the default output device to my bluetooth receiver (so I can... |
138,522 | I'd like to start my music player (Clementine) when my bluetooth headset connects to my computer. How do I detect the bluetooth device connecting so I can run a script to start the player? | 2012/05/17 | [
"https://askubuntu.com/questions/138522",
"https://askubuntu.com",
"https://askubuntu.com/users/252/"
] | @Erigami Your answer helped a lot but to make it work I'd to do some changes. I'm using ubuntu 14.04.
```
#!/usr/bin/python
import dbus
from dbus.mainloop.glib import DBusGMainLoop
import gobject
import subprocess
# ID of the device we care about
DEV_ID = 'CC:C3:EA:A5:16:90'.replace(":", "_")
dbus_loop = DBusGMain... | You write "when your headset connects to your computer". How does it do that, automatically? When you have to trigger it manually, you might as well make it a script and then run your script after the connection has been established. This is what I did to set the default output device to my bluetooth receiver (so I can... |
138,522 | I'd like to start my music player (Clementine) when my bluetooth headset connects to my computer. How do I detect the bluetooth device connecting so I can run a script to start the player? | 2012/05/17 | [
"https://askubuntu.com/questions/138522",
"https://askubuntu.com",
"https://askubuntu.com/users/252/"
] | Here is another example for monitoring all Bluetooth devices. It does not need to specify a specific MAC address. This approach makes the xinput setting persistent even when login/out, suspend/wake and connect/dis-connect your bluetooth device.
I have a Thinkpad compact Bluetooth Keyboard, and I wish to run an xinput ... | You write "when your headset connects to your computer". How does it do that, automatically? When you have to trigger it manually, you might as well make it a script and then run your script after the connection has been established. This is what I did to set the default output device to my bluetooth receiver (so I can... |
138,522 | I'd like to start my music player (Clementine) when my bluetooth headset connects to my computer. How do I detect the bluetooth device connecting so I can run a script to start the player? | 2012/05/17 | [
"https://askubuntu.com/questions/138522",
"https://askubuntu.com",
"https://askubuntu.com/users/252/"
] | I didn't like the polling approach, so I did some digging on bluez and DBus. I ended up writing the following script:
```
#!/usr/bin/python
import dbus
from dbus.mainloop.glib import DBusGMainLoop
import gobject
import subprocess
# ID of the device we care about
DEV_ID = '00_1D_54_AB_DC_72'
dbus_loop = DBusGMainLo... | Here is another example for monitoring all Bluetooth devices. It does not need to specify a specific MAC address. This approach makes the xinput setting persistent even when login/out, suspend/wake and connect/dis-connect your bluetooth device.
I have a Thinkpad compact Bluetooth Keyboard, and I wish to run an xinput ... |
71,658,450 | Please see the error and help me. Its showing error. I just can't understand where is the problem?? I have resolved all the errors that could be solved but still I am stuck. I know this is a vey simple question and its very frustrating.
The question is:
Create a class calculate that uses two separate functions:-a func... | 2022/03/29 | [
"https://Stackoverflow.com/questions/71658450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18142977/"
] | Compiling your program yields the compiler error:
```
error: no matching function for call to 'calculate::calculate(float&, float&)'
29 | calculate obj (a,b);
```
This is telling you that on the line where you construct a `calculate` object named `obj` by invoking a constructor that takes two float arguments,... | ```
#include <iostream>
using namespace std;
class calculate
{
float a, b;
public:
calculate(float a, float b);
float multiply(float a, float b);
float divide(float a, float b);
};
calculate::calculate(float a, float b)
: a(a)
, b(b)
{
}
inline float calculate::multiply(float a, float b)
{
... |
29,483,677 | I defined a test which tests the creation of a user. The controller is set to redirect back to the same page on error (using validation through a generated `App\Http\Requests\Request`). This works correctly when manually clicking in a browser, but fails during a test. Instead of being redirected to:
```
http://localho... | 2015/04/07 | [
"https://Stackoverflow.com/questions/29483677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619246/"
] | [Override the response function](https://mattstauffer.co/blog/laravel-5.0-form-requests) in the FormRequest validation handler to force the redirect to be constructed with Redirect::route('named\_route') instead of allowing the default redirect. | You need to change `config/app.php` file's `url` value. Default value is `http://localhost`
Doc from `config/app.php`
*This URL is used by the console to properly generate URLs when using the Artisan command line tool. You should set this to the root of your application so that it is used when running Artisan tasks.* |
29,483,677 | I defined a test which tests the creation of a user. The controller is set to redirect back to the same page on error (using validation through a generated `App\Http\Requests\Request`). This works correctly when manually clicking in a browser, but fails during a test. Instead of being redirected to:
```
http://localho... | 2015/04/07 | [
"https://Stackoverflow.com/questions/29483677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619246/"
] | You need to change `config/app.php` file's `url` value. Default value is `http://localhost`
Doc from `config/app.php`
*This URL is used by the console to properly generate URLs when using the Artisan command line tool. You should set this to the root of your application so that it is used when running Artisan tasks.* | If you tried changine `config/app.php` and it did not help.
it is better to use $\_ENV - global variable in phpunit.
say, you want Request::root() to return 'my.site'
but you cannot touch phpunit.xml
you can simply set an env param like so
```
$_ENV['APP_URL'] = 'my.site';
```
and call `$this->refreshApplication... |
29,483,677 | I defined a test which tests the creation of a user. The controller is set to redirect back to the same page on error (using validation through a generated `App\Http\Requests\Request`). This works correctly when manually clicking in a browser, but fails during a test. Instead of being redirected to:
```
http://localho... | 2015/04/07 | [
"https://Stackoverflow.com/questions/29483677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619246/"
] | [Override the response function](https://mattstauffer.co/blog/laravel-5.0-form-requests) in the FormRequest validation handler to force the redirect to be constructed with Redirect::route('named\_route') instead of allowing the default redirect. | I know this isn't an exact answer to your question since it is **not** a configuration update that solves the problem. But I was struggling with a related problem and this seems to be the only post on the internet of someone dealing with something similar - I thought I'd put in my two cents for anyone that wants a diff... |
29,483,677 | I defined a test which tests the creation of a user. The controller is set to redirect back to the same page on error (using validation through a generated `App\Http\Requests\Request`). This works correctly when manually clicking in a browser, but fails during a test. Instead of being redirected to:
```
http://localho... | 2015/04/07 | [
"https://Stackoverflow.com/questions/29483677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619246/"
] | I know this isn't an exact answer to your question since it is **not** a configuration update that solves the problem. But I was struggling with a related problem and this seems to be the only post on the internet of someone dealing with something similar - I thought I'd put in my two cents for anyone that wants a diff... | If you tried changine `config/app.php` and it did not help.
it is better to use $\_ENV - global variable in phpunit.
say, you want Request::root() to return 'my.site'
but you cannot touch phpunit.xml
you can simply set an env param like so
```
$_ENV['APP_URL'] = 'my.site';
```
and call `$this->refreshApplication... |
29,483,677 | I defined a test which tests the creation of a user. The controller is set to redirect back to the same page on error (using validation through a generated `App\Http\Requests\Request`). This works correctly when manually clicking in a browser, but fails during a test. Instead of being redirected to:
```
http://localho... | 2015/04/07 | [
"https://Stackoverflow.com/questions/29483677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619246/"
] | [Override the response function](https://mattstauffer.co/blog/laravel-5.0-form-requests) in the FormRequest validation handler to force the redirect to be constructed with Redirect::route('named\_route') instead of allowing the default redirect. | If you tried changine `config/app.php` and it did not help.
it is better to use $\_ENV - global variable in phpunit.
say, you want Request::root() to return 'my.site'
but you cannot touch phpunit.xml
you can simply set an env param like so
```
$_ENV['APP_URL'] = 'my.site';
```
and call `$this->refreshApplication... |
58,512,027 | I have been working with excel vba for some period of time related with automation. Now I am planning to upgrade to python. I did a little bit of research on how to implement automation using python. All I see people doing coding with PyCharm or Jupiter, to do an automation user has to have knowledge of python. What I ... | 2019/10/22 | [
"https://Stackoverflow.com/questions/58512027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12178062/"
] | I know this isn't technically and answer, and since I can't comment yet (too low rep), I'm going to point you to [automate the boring stuff with python](https://automatetheboringstuff.com/). I'm sure you can find your answer here plus some! | Here is my answer.
<https://github.com/TaeYoon2/ExcelAutomation>
This project is a sample excel automation program with python.
I used 'openpyxl' library. |
58,512,027 | I have been working with excel vba for some period of time related with automation. Now I am planning to upgrade to python. I did a little bit of research on how to implement automation using python. All I see people doing coding with PyCharm or Jupiter, to do an automation user has to have knowledge of python. What I ... | 2019/10/22 | [
"https://Stackoverflow.com/questions/58512027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12178062/"
] | I know this isn't technically and answer, and since I can't comment yet (too low rep), I'm going to point you to [automate the boring stuff with python](https://automatetheboringstuff.com/). I'm sure you can find your answer here plus some! | welcome to stackoverflow. Here are a few resources that hopefully get you started on your journey to automating excel tasks with python then wrapping your project up for non-python users.
Python libraries that interface with excel (these are for you to write your excel automation projects)
----------------------------... |
3,937 | Conspiracy Theorists, in *my* opinion, are people I don't like except for some exceptions. However, this question will not be answered with my irrelevant opinions on said people..
Now, here is the question:
* Why do conspiracy theorists become conspiracy theorists?
* Why do they get the ideas that they do?
* Are they... | 2013/07/23 | [
"https://cogsci.stackexchange.com/questions/3937",
"https://cogsci.stackexchange.com",
"https://cogsci.stackexchange.com/users/3199/"
] | Interesting question, I am glad that you stated that it is not going to be opinion-based (grounds for closure), as there is some research being done in this field.
A couple papers and details of their research for you:
["Social Psychological Origins of Conspiracy Theories: The Case of the Jewish Conspiracy Theory in ... | If you are looking for an insight into the mind of a conspiracy theorist, there was a very long "suicide note" printed by some guy who successfully committed suicide.[Wikipedia says this is the longest note, but it does not seem like the right one](http://en.wikipedia.org/wiki/The_longest_suicide_note_in_history) I can... |
3,937 | Conspiracy Theorists, in *my* opinion, are people I don't like except for some exceptions. However, this question will not be answered with my irrelevant opinions on said people..
Now, here is the question:
* Why do conspiracy theorists become conspiracy theorists?
* Why do they get the ideas that they do?
* Are they... | 2013/07/23 | [
"https://cogsci.stackexchange.com/questions/3937",
"https://cogsci.stackexchange.com",
"https://cogsci.stackexchange.com/users/3199/"
] | Interesting question, I am glad that you stated that it is not going to be opinion-based (grounds for closure), as there is some research being done in this field.
A couple papers and details of their research for you:
["Social Psychological Origins of Conspiracy Theories: The Case of the Jewish Conspiracy Theory in ... | In my opinion the main reason of conspiracy theory is lack of information. As in rumors.
In this wikipedia page you can find a lot of research on rumors:
<http://en.wikipedia.org/wiki/Rumor>. When people dont have enough information they tend to confabulate because of Gestalt princioles.
But also there is quality of c... |
3,937 | Conspiracy Theorists, in *my* opinion, are people I don't like except for some exceptions. However, this question will not be answered with my irrelevant opinions on said people..
Now, here is the question:
* Why do conspiracy theorists become conspiracy theorists?
* Why do they get the ideas that they do?
* Are they... | 2013/07/23 | [
"https://cogsci.stackexchange.com/questions/3937",
"https://cogsci.stackexchange.com",
"https://cogsci.stackexchange.com/users/3199/"
] | In my opinion the main reason of conspiracy theory is lack of information. As in rumors.
In this wikipedia page you can find a lot of research on rumors:
<http://en.wikipedia.org/wiki/Rumor>. When people dont have enough information they tend to confabulate because of Gestalt princioles.
But also there is quality of c... | If you are looking for an insight into the mind of a conspiracy theorist, there was a very long "suicide note" printed by some guy who successfully committed suicide.[Wikipedia says this is the longest note, but it does not seem like the right one](http://en.wikipedia.org/wiki/The_longest_suicide_note_in_history) I can... |
47,603,220 | Say I've got a Java file with 500 custom objects of type `Item`. Now, say I want users to be able to add/remove any one of those objects to that list in the program. I want to try to avoid doing something like this:
```
public class Inventory {
public static ArrayList<Item> inv = new ArrayList<>();
public stat... | 2017/12/02 | [
"https://Stackoverflow.com/questions/47603220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9000465/"
] | How about using generic class ?
```
public class Inventory<T> {
public static ArrayList<Item> inv = new ArrayList<>();
public void addItem (T item){
inv.add((Item)item); // where item can be anything from Item.item1 to Item.item500
}
public void removeItem (T item){
inv.remove((Item)item);
}
```
In that cas... | Perhaps use:
```
public void setItem(Item item){
inv.add(item);
}
```
Then use the same concept for removal. |
557,223 | I have the below question. I am not trying to ask the answer for the problem.
[](https://i.stack.imgur.com/GMek9.png)
But my question is that, we can see that 60deg is the phase shift.
But both the voltage and current across the passive element is 6... | 2021/03/30 | [
"https://electronics.stackexchange.com/questions/557223",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/220456/"
] | If I said that the voltage was \$10\cos(100t)\$ and the current was \$5\sin(100t)\$, would you be asking about the phase angle? I mean; the phase angle (when not mentioned) is implicitly assumed to be 0° so there wouldn't be any worry there if it wasn't mentioned. Are you OK with that?
So, if both voltage and current ... | The complex power of a system is given by:
$$\text{Q}=\text{V}\_\text{RMS}\cdot\text{I}\_\text{RMS}\cdot\sin\left(\varphi\right)\tag1$$
Where \$\varphi\$ is the absolute phasedifference between the voltage and the current.
Using your given functions, we have:
* $$\text{V}\left(t\right)=10\cos\left(100t+60^\circ\rig... |
52,732,389 | This is mainly a question about a corner of C++ syntax related to fixed-sized arrays.
Suppose I have a function that exploits type information, for example:
```
template<class T> void fun(T const& t){
std::cout << typeid(t).name() << std::endl;
}
```
I can pass a value or a temporary object:
```
int i;
fun(i)... | 2018/10/10 | [
"https://Stackoverflow.com/questions/52732389",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/225186/"
] | Try:
```
fun((int[3]){1,2,3});
fun((int[5]){});
```
As for the "bonus points": variable sized arrays are not part of the language. This extension to the language does not work with template arguments:
>
> prog.cc:4:6: note: candidate template ignored: substitution failure :
> variably modified type 'int [n]' cann... | You have tried many combinations with `double`, but you seem to have missed out on one.
```
fun((double[10][10]){});
```
This compiles and gives: `A10_A10_d` |
69,678 | A player in my game wants to train some commoners to be a level 1 character. How long would this take and how much would it cost? | 2015/10/08 | [
"https://rpg.stackexchange.com/questions/69678",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/7698/"
] | **By the Books**
There is no answer to this question, either RAW or RAI. NPCs are statted exactly the same as monsters- unlike in Pathfinder and older editions of Dungeons and Dragons, they have no system for progression in the rules.
Hence, they do not have levels in character classes.
If you decide to house-rule, ... | The [D&D GM basic rules](http://media.wizards.com/2014/downloads/dnd/DMDnDBasicRules_v0.1.pdf) indicate that there are NPC classes, and gives the experience values of monsters by CR. An NPC commoner should already have a level (to give it stats) of a commoner class. Levelling this commoner should be as simple as taking... |
27,051,469 | This question is with reference to [This SO question](https://stackoverflow.com/questions/27030179/how-to-change-the-facet-labels-in-facet-wrap)
The above question is regarding changing the labels of a facet\_wrap, the answer is perfect --> add a modified label as a new column of the dataset.
Now, the problem I am fa... | 2014/11/20 | [
"https://Stackoverflow.com/questions/27051469",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2416525/"
] | The collation is not BINARY. It is *CI* case insensitive, so it will fold upper and lowercase characters to sort the same. It defines the sort order of punctuation and digits in a non-ASCII way as you have discovered. It is a SQL collation, doing what SQL collations do: define the sort order according to some particula... | If you want the sort to be in `ASCII value` of each character then you should mention that **explicitly** in `Order by` clause.
```
select c, ASCII(c) ascvalue from #testtable order by ASCII(c)
```
else **SQL\_Latin1\_General\_CP1\_CI\_AS**
tells us that the supported language is English.
There is no BIN in the co... |
27,051,469 | This question is with reference to [This SO question](https://stackoverflow.com/questions/27030179/how-to-change-the-facet-labels-in-facet-wrap)
The above question is regarding changing the labels of a facet\_wrap, the answer is perfect --> add a modified label as a new column of the dataset.
Now, the problem I am fa... | 2014/11/20 | [
"https://Stackoverflow.com/questions/27051469",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2416525/"
] | Thanks Ross et al! Found the following documentation which has an excellent explanation on MS SQL Server collation, thought I'd post it here so as to benefit those who comes across this question or related questions.
---
>
> Collation
> A collation specifies the bit patterns that represent each character in a data ... | The collation is not BINARY. It is *CI* case insensitive, so it will fold upper and lowercase characters to sort the same. It defines the sort order of punctuation and digits in a non-ASCII way as you have discovered. It is a SQL collation, doing what SQL collations do: define the sort order according to some particula... |
27,051,469 | This question is with reference to [This SO question](https://stackoverflow.com/questions/27030179/how-to-change-the-facet-labels-in-facet-wrap)
The above question is regarding changing the labels of a facet\_wrap, the answer is perfect --> add a modified label as a new column of the dataset.
Now, the problem I am fa... | 2014/11/20 | [
"https://Stackoverflow.com/questions/27051469",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2416525/"
] | Thanks Ross et al! Found the following documentation which has an excellent explanation on MS SQL Server collation, thought I'd post it here so as to benefit those who comes across this question or related questions.
---
>
> Collation
> A collation specifies the bit patterns that represent each character in a data ... | If you want the sort to be in `ASCII value` of each character then you should mention that **explicitly** in `Order by` clause.
```
select c, ASCII(c) ascvalue from #testtable order by ASCII(c)
```
else **SQL\_Latin1\_General\_CP1\_CI\_AS**
tells us that the supported language is English.
There is no BIN in the co... |
14,100,224 | I want to select all **CheckBox** from **Custom ListView** on single Button click .
But when I have more than 9 items in ListView I am getting NullPointerException in below second line of code.
```
View vi= diffeneceLv.getChildAt(i);
CheckBox cb = (CheckBox) vi.findViewById(R.id.conschkbx);
``` | 2012/12/31 | [
"https://Stackoverflow.com/questions/14100224",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1939414/"
] | You are getting it wrong, `ListView` re-uses your rows, which means number of created rows/layouts in memory are not equal to your items in array.
Typically `ListView` re-sets the new data to previous row upon scroll.
I would suggest you to study [this blog post](http://vikaskanani.wordpress.com/2011/07/20/android-cu... | You should NOT hold references of individual views for this purpose, as they are recycled.
For your convenience, `ListView` holds a `BooleanSparseArray` to store what items are checked. This array contains a map of item id (index/position of items in adapter) to a boolean value.
Since `ListView` does all that for yo... |
36,081,998 | I think I have a quite simple question. I'm working on a web app with java and glassfish server where users can register and after they do, I want to send them an email with an activation link.
Is it possible to send mails with the java mail API without an external smtp server?
Since it is not necessary for users to ... | 2016/03/18 | [
"https://Stackoverflow.com/questions/36081998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5827589/"
] | Put a *dummy* View (a bare `View`, 0dp wide and high) at the center of the RelativeLayout.
Then, for an **horizontal** alignment, align one TextView to the right of it and the other one to the left of it.
For a **vertical** alignment, align one TextView to the top of it and the other one to the bottom of it. | add `android:gravity="center`" in `RotatableContainer` |
219,159 | On Debian, when running:
```
$ fakeroot cdebootstrap stable /tmp/foo
```
cdebootstrap downloads the packages, but when it has to extract them, I get this error:
```
E: Failed to unshare: Operation not permitted
```
How can I run cdebootstrap as non-root?
This part in unshare's manual seems relevant, but am not s... | 2015/07/29 | [
"https://unix.stackexchange.com/questions/219159",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/26143/"
] | Problem
-------
Your issue has to do with permission inheritance. `cdbootstrap` will inherit the permissions of `fakeroot`, which can be elevated via `sudo`. Issue:
`sudo fakeroot cdbootstrap /tmp/foo`
If the above command succeeds, permissions on `/tmp` are the issue. See [What are common rights for /tmp ? I uninte... | maybe /tmp is the issue. try
$fakeroot cdebootstrap stable $HOME/somedir |
40,739 | In my last game I had an interesting situation. The PCs took a Goblin captive and interrogated him. After that they decided to bind him up with rope, and use the Goblin as a living shield against other Goblins. How should I play this as a DM? Cover modifier +4 against ranged attacks, Goblin's will saves? | 2014/06/09 | [
"https://rpg.stackexchange.com/questions/40739",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/14616/"
] | This answer is about the mechanics I would apply, and not about intended results or morals of the PC behaviour.
First, use the Grapple rules, because they seem most appropriate for dragging a creature around:
* The tied-up goblin can be considered [Helpless](http://www.d20srd.org/srd/conditionSummary.htm#Helpless), t... | In addition to the fine answer about the grapple rules, if you were to just simply let the players wield the goblin as an item, you would have to first consider the size of the goblin and whether they would be treated as a large or tower shield if you're looking for an AC bonus and armor penalty. Also keep in mind I do... |
40,918 | Before marking my question as duplicate, I would like to say that I have tried all the possible solutions mentioned in similar questions, but that doesn't seem to work.
I am currently working on blood cells classification problem where we basically have to classify blood images (4 classes). The dataset consists of 99... | 2018/11/08 | [
"https://datascience.stackexchange.com/questions/40918",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/61406/"
] | I'll make a few observations that will hopefully help.
1. I would remove the dropout layer until you have evidence of overfitting on the data. A dropout layer is generally used to make a model more generalized which is not your problem in this case and it may be hurting your model.
2. The images may not contain enough... | I would suggest the following:
Add a 1\*1 convolution layer in the beginning of shape 1\*1\*3. So this will change the image to another colour space if the colour changes are subtle. Add a max pool followed by another 1\*1\*your\_choice after to learn the colour mapping.
Add skip connections(^with this and even other... |
40,918 | Before marking my question as duplicate, I would like to say that I have tried all the possible solutions mentioned in similar questions, but that doesn't seem to work.
I am currently working on blood cells classification problem where we basically have to classify blood images (4 classes). The dataset consists of 99... | 2018/11/08 | [
"https://datascience.stackexchange.com/questions/40918",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/61406/"
] | I'll make a few observations that will hopefully help.
1. I would remove the dropout layer until you have evidence of overfitting on the data. A dropout layer is generally used to make a model more generalized which is not your problem in this case and it may be hurting your model.
2. The images may not contain enough... | Late answer, but I was running into a similar issue. I set the learning rate of my Adam optimizer to a lower value (e.g. 3e-5) and voila! The model started fitting. |
138,096 | I have a Window where I have put a Frame. I would like to add a Page to the Frame when I click a button that is also on the Window but not in the Frame. There are several buttons in the Window and each click on a button should load a different Page in the Frame.
Since I'm a total newbie on this WPF stuff it's quite po... | 2008/09/26 | [
"https://Stackoverflow.com/questions/138096",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/143/"
] | the Frame class exposes a method named "Navigate" that takes the content you want to show in your frame as parameter.
try calling
```
myFrame.Navigate(myPageObject);
```
this should work | yourFramName.NavigationService.Navigate(yourPageObject)
e.g
Frame1.NavigationService.Navigate(new Page1()); |
27,221,203 | My goal is to send [Gmail-style desktop notifications](https://support.google.com/mail/answer/1075549?hl=en) in Chrome or Firefox from a web app (let's call it X) that is NOT currently open in the browser, without requiring the user to install an app or extension. It's okay if the user needs to grant permission to rece... | 2014/12/01 | [
"https://Stackoverflow.com/questions/27221203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1544138/"
] | You can send push notifications even when your web page is not active using [Service Workers](https://github.com/slightlyoff/ServiceWorker/blob/master/explainer.md), the [Notification API for service workers](https://notifications.spec.whatwg.org/#service-worker-api) and the [push API](https://w3c.github.io/push-api/) ... | You can do exactly what you are looking for using the W3C **Push API**.
If you want to build everything from scratch I suggest to start reading [this tutorial by Google](https://developers.google.com/web/updates/2015/03/push-notifications-on-the-open-web). It is for Chrome, but Firefox works in [a very similar way](ht... |
12,855,209 | Hi every one i have some problem with Jboss-7-as.1.1 when i deploy i am getting `ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service` error.
```
10:44:30,343 INFO [org.jboss.as.connector] (MSC service thread 1-1) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.7.Fin... | 2012/10/12 | [
"https://Stackoverflow.com/questions/12855209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1439243/"
] | The below is saying you put a jboss-app element inside the servers jboss-service.xml file.
No such element is allowed. You probably need to be more careful in your XML editor IDE interface when editing.
```
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017224: Failed to parse service... | Are you migrating your application from an earlier version of jboss to jboss7?
follow [How to migrate an application from AS5,6 to AS7](https://docs.jboss.org/author/display/AS71/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7) post if you are migrating your app
**The following error**
```
ERROR [org.jb... |
46,411,295 | I want to work with Laravel, wanna no what all this hype is about.
Slowly, I have no patience left.
I tried make it working for weeks, now I finally did - but I seem to cannot be able to create migratons...
Creating itself is possible.
But when I type in
`php artisan migrate`
that errors occur:
>
> `[Illuminate\D... | 2017/09/25 | [
"https://Stackoverflow.com/questions/46411295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8113745/"
] | The solution that I proposed in [another question](https://stackoverflow.com/questions/43305664/can-i-draw-a-curved-dashed-line-in-google-maps-android/43665433#43665433) was focused on curved polylines for really small distances. For example, when you have a Directions API route where the start and end points are snapp... | Here is Route object I am using after some improvement from [@xomena](https://stackoverflow.com/a/43665433/3627898)
[Route.java](https://gist.github.com/tamhuynhit/ecb322643455f721c06bca759c0c2ef2)
My changes:
* Use `heading - 90.0` instead of `heading + 90.0`
* Rename variables, make constants (Still figuring out w... |
46,411,295 | I want to work with Laravel, wanna no what all this hype is about.
Slowly, I have no patience left.
I tried make it working for weeks, now I finally did - but I seem to cannot be able to create migratons...
Creating itself is possible.
But when I type in
`php artisan migrate`
that errors occur:
>
> `[Illuminate\D... | 2017/09/25 | [
"https://Stackoverflow.com/questions/46411295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8113745/"
] | The solution that I proposed in [another question](https://stackoverflow.com/questions/43305664/can-i-draw-a-curved-dashed-line-in-google-maps-android/43665433#43665433) was focused on curved polylines for really small distances. For example, when you have a Directions API route where the start and end points are snapp... | Hy , you need to change your showCurvePolyline method with this method.
```
private void showCurvedPolyline (LatLng p1, LatLng p2, double k) {
//Calculate distance and heading between two points
double d = 0;
if (d == 0)
d= SphericalUtil.computeDistanceBetween(origin, dest);
double h = SphericalU... |
46,411,295 | I want to work with Laravel, wanna no what all this hype is about.
Slowly, I have no patience left.
I tried make it working for weeks, now I finally did - but I seem to cannot be able to create migratons...
Creating itself is possible.
But when I type in
`php artisan migrate`
that errors occur:
>
> `[Illuminate\D... | 2017/09/25 | [
"https://Stackoverflow.com/questions/46411295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8113745/"
] | The solution that I proposed in [another question](https://stackoverflow.com/questions/43305664/can-i-draw-a-curved-dashed-line-in-google-maps-android/43665433#43665433) was focused on curved polylines for really small distances. For example, when you have a Directions API route where the start and end points are snapp... | There is another way to draw an arc. Using the google maps projection API to draw the polylines on an overlay view enables us to do a lot of things. Check this [repo](https://github.com/amalChandran/trail-android) that has an example.
[](https://i.st... |
34,420 | I have some technical interviews coming up. I am struggling to think like a programmer. Whenever I get an assignment, I always ask for help from professor or tutor and explain how to get started and such. But I have a feeling that I would not able to answer technical questions if given. I do not want to say, "I don't k... | 2014/10/01 | [
"https://workplace.stackexchange.com/questions/34420",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/27440/"
] | You need to practice coding to think like a programmer in the same way you need to practice anything to be comfortable with it.
1) Write code
There are plenty of places online that will give you a bunch of problems to practice on and ponder upon. I like <http://codekata.com/> but there are several others. You also ha... | That's pretty simple : practice. A lot. That's the only way you're gonna get better. Your example of forgetting simple coding methods such as storing data in an array is typical from someone who hasn't produced enough code in his life. Sure, if you read how to do it on Google and copy-paste it once to complete your hom... |
3,190,079 | I'm trying to figure out to to combine a serialized object with an existing xml doc and return it as a webservice.
Thanks ahead for you help.
Sample code:
```
[WebMethod]
public string GetApple()
{
Apples apples = Report.GetReport();
// this returns:
// <Apples xmlns:xsi="http://www.w3.org... | 2010/07/06 | [
"https://Stackoverflow.com/questions/3190079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87302/"
] | XOR has the nice property that if you XOR something twice using the same data, you obtain the original. The code you posted is some rudimentary encryption function, which "encrypts" a string using a key. The resulting ciphertext can be fed through the same program to decrypt it. | The xor on characters performs the xor operation on each corresponding bit of the two characters (one byte each). |
3,190,079 | I'm trying to figure out to to combine a serialized object with an existing xml doc and return it as a webservice.
Thanks ahead for you help.
Sample code:
```
[WebMethod]
public string GetApple()
{
Apples apples = Report.GetReport();
// this returns:
// <Apples xmlns:xsi="http://www.w3.org... | 2010/07/06 | [
"https://Stackoverflow.com/questions/3190079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87302/"
] | XOR has the nice property that if you XOR something twice using the same data, you obtain the original. The code you posted is some rudimentary encryption function, which "encrypts" a string using a key. The resulting ciphertext can be fed through the same program to decrypt it. | > So does this mean the byte which makes up the character is being XORed?
Exactly.
> What does this look like?
As any other XOR :) . In ASCII "A nice cat" is (in hexadecimal)
```
41 20 6E 69 63 65 20 63 61 74
```
and ABCDEFGHIJ
```
41 42 43 44 45 46 47 48 49 4A
```
so, if you XOR each byte with each other, you... |
3,190,079 | I'm trying to figure out to to combine a serialized object with an existing xml doc and return it as a webservice.
Thanks ahead for you help.
Sample code:
```
[WebMethod]
public string GetApple()
{
Apples apples = Report.GetReport();
// this returns:
// <Apples xmlns:xsi="http://www.w3.org... | 2010/07/06 | [
"https://Stackoverflow.com/questions/3190079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87302/"
] | XOR has the nice property that if you XOR something twice using the same data, you obtain the original. The code you posted is some rudimentary encryption function, which "encrypts" a string using a key. The resulting ciphertext can be fed through the same program to decrypt it. | This is a simple demonstration of one time pad encryption, which as you can see is quite simple and also happens to be the only provably unbreakable form of encryption. Due to it being symmetric and having a key as large as the message, it's often not practical, but it still has a number of interesting applications.. :... |
3,190,079 | I'm trying to figure out to to combine a serialized object with an existing xml doc and return it as a webservice.
Thanks ahead for you help.
Sample code:
```
[WebMethod]
public string GetApple()
{
Apples apples = Report.GetReport();
// this returns:
// <Apples xmlns:xsi="http://www.w3.org... | 2010/07/06 | [
"https://Stackoverflow.com/questions/3190079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87302/"
] | In C and C++ strings are *usually* stored in memory as 8-bit char values where the value stored is the [ASCII](http://en.wikipedia.org/wiki/ASCII) value of the character.
Your code is therefore XORing the ASCII values. For example, the second character in your output is calculated as follows:
```
'B' ^ ' '
= 66 ^ ... | The xor on characters performs the xor operation on each corresponding bit of the two characters (one byte each). |
3,190,079 | I'm trying to figure out to to combine a serialized object with an existing xml doc and return it as a webservice.
Thanks ahead for you help.
Sample code:
```
[WebMethod]
public string GetApple()
{
Apples apples = Report.GetReport();
// this returns:
// <Apples xmlns:xsi="http://www.w3.org... | 2010/07/06 | [
"https://Stackoverflow.com/questions/3190079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87302/"
] | The xor on characters performs the xor operation on each corresponding bit of the two characters (one byte each). | This is a simple demonstration of one time pad encryption, which as you can see is quite simple and also happens to be the only provably unbreakable form of encryption. Due to it being symmetric and having a key as large as the message, it's often not practical, but it still has a number of interesting applications.. :... |
3,190,079 | I'm trying to figure out to to combine a serialized object with an existing xml doc and return it as a webservice.
Thanks ahead for you help.
Sample code:
```
[WebMethod]
public string GetApple()
{
Apples apples = Report.GetReport();
// this returns:
// <Apples xmlns:xsi="http://www.w3.org... | 2010/07/06 | [
"https://Stackoverflow.com/questions/3190079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87302/"
] | In C and C++ strings are *usually* stored in memory as 8-bit char values where the value stored is the [ASCII](http://en.wikipedia.org/wiki/ASCII) value of the character.
Your code is therefore XORing the ASCII values. For example, the second character in your output is calculated as follows:
```
'B' ^ ' '
= 66 ^ ... | > So does this mean the byte which makes up the character is being XORed?
Exactly.
> What does this look like?
As any other XOR :) . In ASCII "A nice cat" is (in hexadecimal)
```
41 20 6E 69 63 65 20 63 61 74
```
and ABCDEFGHIJ
```
41 42 43 44 45 46 47 48 49 4A
```
so, if you XOR each byte with each other, you... |
3,190,079 | I'm trying to figure out to to combine a serialized object with an existing xml doc and return it as a webservice.
Thanks ahead for you help.
Sample code:
```
[WebMethod]
public string GetApple()
{
Apples apples = Report.GetReport();
// this returns:
// <Apples xmlns:xsi="http://www.w3.org... | 2010/07/06 | [
"https://Stackoverflow.com/questions/3190079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87302/"
] | In C and C++ strings are *usually* stored in memory as 8-bit char values where the value stored is the [ASCII](http://en.wikipedia.org/wiki/ASCII) value of the character.
Your code is therefore XORing the ASCII values. For example, the second character in your output is calculated as follows:
```
'B' ^ ' '
= 66 ^ ... | This is a simple demonstration of one time pad encryption, which as you can see is quite simple and also happens to be the only provably unbreakable form of encryption. Due to it being symmetric and having a key as large as the message, it's often not practical, but it still has a number of interesting applications.. :... |
3,190,079 | I'm trying to figure out to to combine a serialized object with an existing xml doc and return it as a webservice.
Thanks ahead for you help.
Sample code:
```
[WebMethod]
public string GetApple()
{
Apples apples = Report.GetReport();
// this returns:
// <Apples xmlns:xsi="http://www.w3.org... | 2010/07/06 | [
"https://Stackoverflow.com/questions/3190079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87302/"
] | > So does this mean the byte which makes up the character is being XORed?
Exactly.
> What does this look like?
As any other XOR :) . In ASCII "A nice cat" is (in hexadecimal)
```
41 20 6E 69 63 65 20 63 61 74
```
and ABCDEFGHIJ
```
41 42 43 44 45 46 47 48 49 4A
```
so, if you XOR each byte with each other, you... | This is a simple demonstration of one time pad encryption, which as you can see is quite simple and also happens to be the only provably unbreakable form of encryption. Due to it being symmetric and having a key as large as the message, it's often not practical, but it still has a number of interesting applications.. :... |
17,657,981 | I have the following piece of code:
```
PEMParser pemParser;
File telexuskeys = new File(locationKey);
if(telexuskeys.exists())
pemParser = new PEMParser(new FileReader(telexuskeys));
else{
usage(ops);
throw new FileNotFoundException("The key file (company's certificate) doesn't... | 2013/07/15 | [
"https://Stackoverflow.com/questions/17657981",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/876887/"
] | The following code does the work for me. (Using the bcpkix and bcprov libs from Bouncy Castle).
```
private PrivateKey readPrivateKey(String privateKeyPath, String keyPassword) throws IOException {
FileReader fileReader = new FileReader(privateKeyPath);
PEMParser keyReader = new PEMParser(fileReader);
Jc... | My key was generated with the command below.
`openssl req -new -newkey rsa:2048 -keyout key.pem -pubkey -out pubreq.p10 -subj "/CN=MyKey"`
Apparently the output was a `PKCS8EncryptedPrivateKeyInfo` and after reading stuff here and there, this is what I came up with:
```java
try {
File file = ResourceUtils.getFil... |
4,987,003 | I'm trying to configure CKEditor to allow the user to upload an image from her computer. I'm using filebrowserUploadUrl, so I can upload the image to the server and get back the URL assigned to it, but I can't figure out how to pass the URL to the actual editor...
Some examples on the net talk about returning from the... | 2011/02/13 | [
"https://Stackoverflow.com/questions/4987003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3497/"
] | The server shouldn't return javascript for the client to render.
Even though the following is an ugly ugly... ugly hack.. I still prefer it over sending javascript from the server:
(Example of automatically inserting the image in the editor once the image is uploaded - works with 4.4.7)
```
var onUploadImage = funct... | Read again the syntax: you get the CKEDITOR object and tell it to call back a function, so it does exactly what you want. |
16,875,827 | I want to write a method that will create a List of the type I define in the method parameters. So if I have 3 classes: `Student`, `Teacher` and `Janitor`, the method should create a `List` of whatever type is passed in
```
public void methodName(TYPE){
List<TYPE> results = new List<TYPE>();
}
```
What shoul... | 2013/06/01 | [
"https://Stackoverflow.com/questions/16875827",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2231887/"
] | You can use JAVA generics. One way is to allow all class types to be acceptable, by this..
```
public <T> void methodName(Class<T> cl){
List<T> results = new ArrayList<T>();
}
```
or a better way would be to make all classes you want to be accepted derive from an interface, say `Person` and then you can do.... | It's not entirely clear what you want, but one option is as follows:
```
public <T>
void methodName(Class<T> clazz) {
List<T> results = new ArrayList<T>();
...
}
```
You could then call it as:
```
methodName(Student.class);
``` |
16,875,827 | I want to write a method that will create a List of the type I define in the method parameters. So if I have 3 classes: `Student`, `Teacher` and `Janitor`, the method should create a `List` of whatever type is passed in
```
public void methodName(TYPE){
List<TYPE> results = new List<TYPE>();
}
```
What shoul... | 2013/06/01 | [
"https://Stackoverflow.com/questions/16875827",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2231887/"
] | You can use JAVA generics. One way is to allow all class types to be acceptable, by this..
```
public <T> void methodName(Class<T> cl){
List<T> results = new ArrayList<T>();
}
```
or a better way would be to make all classes you want to be accepted derive from an interface, say `Person` and then you can do.... | If these three classes can inherit from a single class or implement a single interface then your method signature can be like this:
```
public List<ParentClass/Interface> methodName(TYPE);
```
If three class cannot be related to a common contract as mentioned above then other choice will be to return the list of Obj... |
16,875,827 | I want to write a method that will create a List of the type I define in the method parameters. So if I have 3 classes: `Student`, `Teacher` and `Janitor`, the method should create a `List` of whatever type is passed in
```
public void methodName(TYPE){
List<TYPE> results = new List<TYPE>();
}
```
What shoul... | 2013/06/01 | [
"https://Stackoverflow.com/questions/16875827",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2231887/"
] | You can use JAVA generics. One way is to allow all class types to be acceptable, by this..
```
public <T> void methodName(Class<T> cl){
List<T> results = new ArrayList<T>();
}
```
or a better way would be to make all classes you want to be accepted derive from an interface, say `Person` and then you can do.... | You may want to check out [a question of mine](https://stackoverflow.com/q/8436055/483113), which, however, approaches the issue from the other side.
Basically Java has such a function already (feel free to go from there):
```
Collections.<String>emptyList()
```
to get an empty List with elements which are supposed... |
16,442,933 | I have inherited some code from an application that I need to modify (yuck). The activity in question implements SurfaceHolder.Callback and SensorEventListener. This activity is for a custom Camera.
The code works fine to autofocus, and take a picture. Once the picture is taken, I start another activity for result to ... | 2013/05/08 | [
"https://Stackoverflow.com/questions/16442933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572854/"
] | Semantically, joins are processed in the order they appear in the `from` clause. (They may not be actually executed in this order due to SQL optimizations, but the ordering is important for defining the result set.)
So, when you do:
```
from orders left outer join customers inner join companies
```
(I'm leaving out... | Query 1 have INNER JOIN on Company , which means a Order need to have vaild Customer(CompanyID)
If you want to use INNER JOIN, it can be like this
```
SELECT Orders.OrderId, a.CustomerId, a.Name
FROM Orders
LEFT JOIN (
SELECT Customers.CustomerId, Companies.Name
FROM Customers
INNER JOIN Companies
... |
16,442,933 | I have inherited some code from an application that I need to modify (yuck). The activity in question implements SurfaceHolder.Callback and SensorEventListener. This activity is for a custom Camera.
The code works fine to autofocus, and take a picture. Once the picture is taken, I start another activity for result to ... | 2013/05/08 | [
"https://Stackoverflow.com/questions/16442933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572854/"
] | Semantically, joins are processed in the order they appear in the `from` clause. (They may not be actually executed in this order due to SQL optimizations, but the ordering is important for defining the result set.)
So, when you do:
```
from orders left outer join customers inner join companies
```
(I'm leaving out... | 1. Query 1: Because you have an `INNER JOIN` on Customers, the `LEFT JOIN` is effectively an `INNER JOIN`.
2. Query 2 is correct because you want to see all Orders regardless of the data quality / condition.
3. I like to avoid `RIGHT JOIN`s in general as it is confusing to some developers and is therefore less readable... |
16,442,933 | I have inherited some code from an application that I need to modify (yuck). The activity in question implements SurfaceHolder.Callback and SensorEventListener. This activity is for a custom Camera.
The code works fine to autofocus, and take a picture. Once the picture is taken, I start another activity for result to ... | 2013/05/08 | [
"https://Stackoverflow.com/questions/16442933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572854/"
] | Semantically, joins are processed in the order they appear in the `from` clause. (They may not be actually executed in this order due to SQL optimizations, but the ordering is important for defining the result set.)
So, when you do:
```
from orders left outer join customers inner join companies
```
(I'm leaving out... | 1) It doesn't work because when you `INNER JOIN` to `Companies` you make it required to exist in the entirety of the join, but since `Customer` does not exist for the order there is no way to associate a `Companies` record back to the order and thus it is not returned.
2) I suppose you could use the second query if yo... |
16,442,933 | I have inherited some code from an application that I need to modify (yuck). The activity in question implements SurfaceHolder.Callback and SensorEventListener. This activity is for a custom Camera.
The code works fine to autofocus, and take a picture. Once the picture is taken, I start another activity for result to ... | 2013/05/08 | [
"https://Stackoverflow.com/questions/16442933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572854/"
] | Semantically, joins are processed in the order they appear in the `from` clause. (They may not be actually executed in this order due to SQL optimizations, but the ordering is important for defining the result set.)
So, when you do:
```
from orders left outer join customers inner join companies
```
(I'm leaving out... | You can write your joins nested like this so that the left join is performed on the combined result of customers and companies instead of an inner join being performed on the combined result of orders and customers. I basically just moved your inner join to before the ON clause for the left outer join. Someone else sug... |
31,293,824 | While developing with all my tools up to date, I noticed that on 8.3 and lower devices my extension seems to have disappeared and not show at all in the list from which users can enable it. I extracted the contents of the app file and the extension does get compiled and packaged.
On a few devices we decided to update,... | 2015/07/08 | [
"https://Stackoverflow.com/questions/31293824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/703193/"
] | The `LocalSessionFactoryBean` creates a `SessionFactory`:
```
@Bean
public LocalSessionFactoryBean sessionFactory() {
LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
sessionFactory.setDataSource(dataSource());
sessionFactory.setPackagesToScan(new String[] { "my.packages" });
ses... | If you use XML configuration it should look like this:
```
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${hibernate.connection.driver.class}"/>
<property name="url" value="${hibernate.connection.url}"/>
<property n... |
19,543,654 | I am fairly new to Anuglar JS so please keep that in mind while answering this question. My goal here is to create and persist a new user in the oracle database. My frontend is written in AngularJS. A REST service (using JERSEY) is in place already with a method signature like below:
```
@POST
@Path("/create/{user}"... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19543654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/534271/"
] | Rather than having cumbersome sudo links to setup I prefer to use a simple bash function and use the native Mac `open` command:
```
#somewhere in your .bashrc or .zshrc
sublime () {
open -a "Sublime Text" $@
}
```
Now all you have to do is `sublime .` whenever you want to open up sublime from a given folder. Obv... | The answers already given are all fine but what about making your life waaay easier and rely on good tools instead ;)
1. Install 'Oh My ZSh' (imho: a must have) <https://github.com/robbyrussell/oh-my-zsh>
2. Open the configuration file: **~/.zshrc**
3. Add sublime to the plugins: **plugins=(sublime)** (other recommend... |
19,543,654 | I am fairly new to Anuglar JS so please keep that in mind while answering this question. My goal here is to create and persist a new user in the oracle database. My frontend is written in AngularJS. A REST service (using JERSEY) is in place already with a method signature like below:
```
@POST
@Path("/create/{user}"... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19543654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/534271/"
] | This works for me as well:
```none
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/st
```
Than you can write just:
```none
st filename.file extension
```
It should works. I tried so many things but this worked first. | If you want to run Sublime from the terminal, append the following to your `~/.bash_profile` file (`~/.zshrc` in case you use `zsh`).
```
subl () { open -n -b "com.sublimetext.3" --args $* ;}
```
Now, you can simply type `subl .` in any folder to start editing files in that folder. |
19,543,654 | I am fairly new to Anuglar JS so please keep that in mind while answering this question. My goal here is to create and persist a new user in the oracle database. My frontend is written in AngularJS. A REST service (using JERSEY) is in place already with a method signature like below:
```
@POST
@Path("/create/{user}"... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19543654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/534271/"
] | Mavericks does not ship with a ~/bin directory, but found I ran into trouble trying to install the `subl` command in any of the low-level system bin directories. I found the following solution worked neatly:
Create a ~/bin directory for your user:
```
mkdir ~/bin
```
Add the `subl` command as per the Sublime Text d... | This works for me as well:
```none
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/st
```
Than you can write just:
```none
st filename.file extension
```
It should works. I tried so many things but this worked first. |
19,543,654 | I am fairly new to Anuglar JS so please keep that in mind while answering this question. My goal here is to create and persist a new user in the oracle database. My frontend is written in AngularJS. A REST service (using JERSEY) is in place already with a method signature like below:
```
@POST
@Path("/create/{user}"... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19543654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/534271/"
] | After a few days of struggling with the issue, this worked for me.
Make sure you have `~/usr/bin` set in `$PATH`
```
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
```
If you get a permission denied error:
```
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/... | The answers already given are all fine but what about making your life waaay easier and rely on good tools instead ;)
1. Install 'Oh My ZSh' (imho: a must have) <https://github.com/robbyrussell/oh-my-zsh>
2. Open the configuration file: **~/.zshrc**
3. Add sublime to the plugins: **plugins=(sublime)** (other recommend... |
19,543,654 | I am fairly new to Anuglar JS so please keep that in mind while answering this question. My goal here is to create and persist a new user in the oracle database. My frontend is written in AngularJS. A REST service (using JERSEY) is in place already with a method signature like below:
```
@POST
@Path("/create/{user}"... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19543654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/534271/"
] | Should be:
```
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
```
Notice I removed the tilde (`~`). Tilde (`~`) in Unix refers to your user's home directory, so your source was correct, but the second argument was placing the link in /Users/[your username]/usr/local/bin... | If you want to run Sublime from the terminal, append the following to your `~/.bash_profile` file (`~/.zshrc` in case you use `zsh`).
```
subl () { open -n -b "com.sublimetext.3" --args $* ;}
```
Now, you can simply type `subl .` in any folder to start editing files in that folder. |
19,543,654 | I am fairly new to Anuglar JS so please keep that in mind while answering this question. My goal here is to create and persist a new user in the oracle database. My frontend is written in AngularJS. A REST service (using JERSEY) is in place already with a method signature like below:
```
@POST
@Path("/create/{user}"... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19543654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/534271/"
] | Mavericks does not ship with a ~/bin directory, but found I ran into trouble trying to install the `subl` command in any of the low-level system bin directories. I found the following solution worked neatly:
Create a ~/bin directory for your user:
```
mkdir ~/bin
```
Add the `subl` command as per the Sublime Text d... | The answers already given are all fine but what about making your life waaay easier and rely on good tools instead ;)
1. Install 'Oh My ZSh' (imho: a must have) <https://github.com/robbyrussell/oh-my-zsh>
2. Open the configuration file: **~/.zshrc**
3. Add sublime to the plugins: **plugins=(sublime)** (other recommend... |
19,543,654 | I am fairly new to Anuglar JS so please keep that in mind while answering this question. My goal here is to create and persist a new user in the oracle database. My frontend is written in AngularJS. A REST service (using JERSEY) is in place already with a method signature like below:
```
@POST
@Path("/create/{user}"... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19543654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/534271/"
] | Rather than having cumbersome sudo links to setup I prefer to use a simple bash function and use the native Mac `open` command:
```
#somewhere in your .bashrc or .zshrc
sublime () {
open -a "Sublime Text" $@
}
```
Now all you have to do is `sublime .` whenever you want to open up sublime from a given folder. Obv... | If you want to run Sublime from the terminal, append the following to your `~/.bash_profile` file (`~/.zshrc` in case you use `zsh`).
```
subl () { open -n -b "com.sublimetext.3" --args $* ;}
```
Now, you can simply type `subl .` in any folder to start editing files in that folder. |
19,543,654 | I am fairly new to Anuglar JS so please keep that in mind while answering this question. My goal here is to create and persist a new user in the oracle database. My frontend is written in AngularJS. A REST service (using JERSEY) is in place already with a method signature like below:
```
@POST
@Path("/create/{user}"... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19543654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/534271/"
] | Should be:
```
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
```
Notice I removed the tilde (`~`). Tilde (`~`) in Unix refers to your user's home directory, so your source was correct, but the second argument was placing the link in /Users/[your username]/usr/local/bin... | The answers already given are all fine but what about making your life waaay easier and rely on good tools instead ;)
1. Install 'Oh My ZSh' (imho: a must have) <https://github.com/robbyrussell/oh-my-zsh>
2. Open the configuration file: **~/.zshrc**
3. Add sublime to the plugins: **plugins=(sublime)** (other recommend... |
19,543,654 | I am fairly new to Anuglar JS so please keep that in mind while answering this question. My goal here is to create and persist a new user in the oracle database. My frontend is written in AngularJS. A REST service (using JERSEY) is in place already with a method signature like below:
```
@POST
@Path("/create/{user}"... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19543654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/534271/"
] | Mavericks does not ship with a ~/bin directory, but found I ran into trouble trying to install the `subl` command in any of the low-level system bin directories. I found the following solution worked neatly:
Create a ~/bin directory for your user:
```
mkdir ~/bin
```
Add the `subl` command as per the Sublime Text d... | If you want to run Sublime from the terminal, append the following to your `~/.bash_profile` file (`~/.zshrc` in case you use `zsh`).
```
subl () { open -n -b "com.sublimetext.3" --args $* ;}
```
Now, you can simply type `subl .` in any folder to start editing files in that folder. |
19,543,654 | I am fairly new to Anuglar JS so please keep that in mind while answering this question. My goal here is to create and persist a new user in the oracle database. My frontend is written in AngularJS. A REST service (using JERSEY) is in place already with a method signature like below:
```
@POST
@Path("/create/{user}"... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19543654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/534271/"
] | Should be:
```
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
```
Notice I removed the tilde (`~`). Tilde (`~`) in Unix refers to your user's home directory, so your source was correct, but the second argument was placing the link in /Users/[your username]/usr/local/bin... | After a few days of struggling with the issue, this worked for me.
Make sure you have `~/usr/bin` set in `$PATH`
```
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
```
If you get a permission denied error:
```
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/... |
34,876,073 | Is it possible to switch Network Link Conditioner profiles from MacOS command line or by using script, and generally is it possible to automate NLC, if so how?
Thank you in advance. | 2016/01/19 | [
"https://Stackoverflow.com/questions/34876073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/627334/"
] | Your code has several problems:
* you modify the pointers in the `words` array instead of iterating via an index.
* you check for upper case letters but access offsets outside of its boundaries with `freq[*words[c]-'a']` in this case.
* there is a typo in the last loop: it should be `freq[i]` instead if `freq[c]`.
* y... | Start by distinguishing between upper and lower case. This may not be the complete solution, but it's a start.
```
if (*words[c]>='a' && *words[c]<='z'){
freq[*words[c]-'a']++;
words[c]++;
}
else if (*words[c]>='A' && *words[c] <='Z'){
... |
34,876,073 | Is it possible to switch Network Link Conditioner profiles from MacOS command line or by using script, and generally is it possible to automate NLC, if so how?
Thank you in advance. | 2016/01/19 | [
"https://Stackoverflow.com/questions/34876073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/627334/"
] | you seem to only check the first letter of each word, then move on to the next word. clearly you need 2 loops working there.
or something like:
```
while (c<N) {
if(( *words[c]>='a' && *words[c]<='z') || (*words[c]>='A' && *words[c] <='Z')) {
freq[*words[c]-'a']++;
}
words[c... | Start by distinguishing between upper and lower case. This may not be the complete solution, but it's a start.
```
if (*words[c]>='a' && *words[c]<='z'){
freq[*words[c]-'a']++;
words[c]++;
}
else if (*words[c]>='A' && *words[c] <='Z'){
... |
34,876,073 | Is it possible to switch Network Link Conditioner profiles from MacOS command line or by using script, and generally is it possible to automate NLC, if so how?
Thank you in advance. | 2016/01/19 | [
"https://Stackoverflow.com/questions/34876073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/627334/"
] | Your code has several problems:
* you modify the pointers in the `words` array instead of iterating via an index.
* you check for upper case letters but access offsets outside of its boundaries with `freq[*words[c]-'a']` in this case.
* there is a typo in the last loop: it should be `freq[i]` instead if `freq[c]`.
* y... | you seem to only check the first letter of each word, then move on to the next word. clearly you need 2 loops working there.
or something like:
```
while (c<N) {
if(( *words[c]>='a' && *words[c]<='z') || (*words[c]>='A' && *words[c] <='Z')) {
freq[*words[c]-'a']++;
}
words[c... |
29,296,741 | I am receiving an error while trying to post to a facebook wall using php.
The error is as follows ~ PHP Fatal error: Uncaught exception 'Facebook\FacebookPermissionException' with message '(#200) The user hasn't authorized the application to perform this action' in /facebook-php-sdk-v4-4.0-dev/src/Facebook/FacebookReq... | 2015/03/27 | [
"https://Stackoverflow.com/questions/29296741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3408717/"
] | This error occurring because **you do not have permission to post on pages.**
Permission ***publish\_actions*** is required to post on pages.
Your Login URL would look like this:
`$loginUrl = $helper->getLoginUrl(array('publish_actions'));` /\* login url with permission \*/
In order to check **Permissions Gran... | This is a known bug affecting thousands of developers since last week, follow this bug report and post there to speed up Facebook:
<https://developers.facebook.com/bugs/1655744048061679/> |
61,852 | Consider an elliptic curve $E/ \mathbb{Q}$, with a regular model $\mathcal{E} / \mathbb{Z}$. We have (Beilinson regulator) maps
$$ K\_1(\mathcal{E})^{(2)} \to K\_1(E)^{(2)} \to H\_D^3(E\_{/ \mathbb{R}} , \mathbb{R}(2) )$$
from (an Adams eigenspace of) K-theory (with rational coefficients) to Deligne cohomology of $E$. ... | 2011/04/15 | [
"https://mathoverflow.net/questions/61852",
"https://mathoverflow.net",
"https://mathoverflow.net/users/349/"
] | This is not a full answer, more a lenghty comment, since I think the key part of your question is whether there are elements in $K\_1(\mathcal{E})^{(2)}$ with non-trivial regulator.
Conjecturally $K\_1(\mathcal{E})^{(2)}$ is finitely generated -- this a particular case of what is known as Bass's conjecture which is th... | not an answer, but
* in general, the image of K-theory depends on the choice of the regular model, see the work of Rob de Jeu [(on his webpage)](http://www.few.vu.nl/~jeu/) on further counterexamples to Beilinson's conjecture (this is incorrect: see Cisinski's comment below)
* there is some work on the function field ... |
61,852 | Consider an elliptic curve $E/ \mathbb{Q}$, with a regular model $\mathcal{E} / \mathbb{Z}$. We have (Beilinson regulator) maps
$$ K\_1(\mathcal{E})^{(2)} \to K\_1(E)^{(2)} \to H\_D^3(E\_{/ \mathbb{R}} , \mathbb{R}(2) )$$
from (an Adams eigenspace of) K-theory (with rational coefficients) to Deligne cohomology of $E$. ... | 2011/04/15 | [
"https://mathoverflow.net/questions/61852",
"https://mathoverflow.net",
"https://mathoverflow.net/users/349/"
] | Let me explain why Beilinson's conjecture implies that $\iota$ is the zero map (thus your first question has conditionally a negative answer).
Let $\mathcal{E}$ be a proper regular model of $E$ over $\mathbf{Z}$. The morphism $E \to \mathcal{E}$ induces a $\mathbf{Q}$-linear map $\iota : K\_1(\mathcal{E})^{(2)} \to K\... | not an answer, but
* in general, the image of K-theory depends on the choice of the regular model, see the work of Rob de Jeu [(on his webpage)](http://www.few.vu.nl/~jeu/) on further counterexamples to Beilinson's conjecture (this is incorrect: see Cisinski's comment below)
* there is some work on the function field ... |
61,852 | Consider an elliptic curve $E/ \mathbb{Q}$, with a regular model $\mathcal{E} / \mathbb{Z}$. We have (Beilinson regulator) maps
$$ K\_1(\mathcal{E})^{(2)} \to K\_1(E)^{(2)} \to H\_D^3(E\_{/ \mathbb{R}} , \mathbb{R}(2) )$$
from (an Adams eigenspace of) K-theory (with rational coefficients) to Deligne cohomology of $E$. ... | 2011/04/15 | [
"https://mathoverflow.net/questions/61852",
"https://mathoverflow.net",
"https://mathoverflow.net/users/349/"
] | Let me explain why Beilinson's conjecture implies that $\iota$ is the zero map (thus your first question has conditionally a negative answer).
Let $\mathcal{E}$ be a proper regular model of $E$ over $\mathbf{Z}$. The morphism $E \to \mathcal{E}$ induces a $\mathbf{Q}$-linear map $\iota : K\_1(\mathcal{E})^{(2)} \to K\... | This is not a full answer, more a lenghty comment, since I think the key part of your question is whether there are elements in $K\_1(\mathcal{E})^{(2)}$ with non-trivial regulator.
Conjecturally $K\_1(\mathcal{E})^{(2)}$ is finitely generated -- this a particular case of what is known as Bass's conjecture which is th... |
15,395 | I'm going to a boat cruise tonight in London. With the following kit to choose from:
* Nikon D7000
* Nikkor 35mm f/1.8
* Nikkor 16-85mm f/3.5-5.6
* Nikon SB-400
* Yongnuo YN-465
I will definitely have both lenses with me, but I don't really like switching between the two too much. Do you think it'll be more useful to... | 2011/09/02 | [
"https://photo.stackexchange.com/questions/15395",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/3187/"
] | For night-time photography, a fast prime is worlds better than a consumer-grade zoom - you can see better through the viewfinder, and the camera has much better chances of achieving focus; and of course you can use shorter shutter time or lower ISO. So I'd pick the 35mm f/1.8. Whenever I go out shooting at night withou... | In general, I'd take the zoom. Having the wide angle (16mm) is a tremendously useful thing when taking landscape/scenery shots, especially on a crop factor camera like the D7000. Having 85mm on the long end can be very handy too, especially as you'll want to be picking out details from the boat.
However, if you really... |
15,395 | I'm going to a boat cruise tonight in London. With the following kit to choose from:
* Nikon D7000
* Nikkor 35mm f/1.8
* Nikkor 16-85mm f/3.5-5.6
* Nikon SB-400
* Yongnuo YN-465
I will definitely have both lenses with me, but I don't really like switching between the two too much. Do you think it'll be more useful to... | 2011/09/02 | [
"https://photo.stackexchange.com/questions/15395",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/3187/"
] | For night-time photography, a fast prime is worlds better than a consumer-grade zoom - you can see better through the viewfinder, and the camera has much better chances of achieving focus; and of course you can use shorter shutter time or lower ISO. So I'd pick the 35mm f/1.8. Whenever I go out shooting at night withou... | Both of the previous photographers are only thinking two dimensional; shutter speed and aperture.
With a D7000, set the aperture for the depth of field required & the shutter speed required to freeze actions or let the VR compensate for motion and the camera will select the appropriate ISO for the availalbe light.
For ... |
15,395 | I'm going to a boat cruise tonight in London. With the following kit to choose from:
* Nikon D7000
* Nikkor 35mm f/1.8
* Nikkor 16-85mm f/3.5-5.6
* Nikon SB-400
* Yongnuo YN-465
I will definitely have both lenses with me, but I don't really like switching between the two too much. Do you think it'll be more useful to... | 2011/09/02 | [
"https://photo.stackexchange.com/questions/15395",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/3187/"
] | Both of the previous photographers are only thinking two dimensional; shutter speed and aperture.
With a D7000, set the aperture for the depth of field required & the shutter speed required to freeze actions or let the VR compensate for motion and the camera will select the appropriate ISO for the availalbe light.
For ... | In general, I'd take the zoom. Having the wide angle (16mm) is a tremendously useful thing when taking landscape/scenery shots, especially on a crop factor camera like the D7000. Having 85mm on the long end can be very handy too, especially as you'll want to be picking out details from the boat.
However, if you really... |
47,903,437 | Suppose user entered 'my name is xyz' so how would i get the last three letters 'xyz' in BlueJ. What code should i use to get last or the first letters of the input. In Q basic it is easy by using Right$ and Lest$ but I don't know how to do it in BlueJ. | 2017/12/20 | [
"https://Stackoverflow.com/questions/47903437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8965543/"
] | The normal way is to use a dependency manager such as [dep](https://github.com/golang/dep).
An alternative is just to copy the vendor directory directly in your Dockerfile, but this is not ideal, as it will copy the entire vendor directory verbatim, even if it contains old or unused imports. | Assuming you have a kind of monorepo setup, with vendor at the top level and then dockerfiles in each of the sub directories (/services) you could use a top level `docker-compose.yml` file ([docs](https://docs.docker.com/compose/)) to define all the services and then use volume mounts to ensure that vendor ends up insi... |
15,558,475 | How can I track how long a user stays on a page before they request another or simply leave the site?
Basically, I want to do a check, if a user stays on the page for 20 minutes or longer, then do something.
I believe this would require php and javascript, but I am not exactly sure how to accomplish it.
Maybe usi... | 2013/03/21 | [
"https://Stackoverflow.com/questions/15558475",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2103538/"
] | You can do all this with simple javascript.
**For a single page:**
```
window.setTimeout(function(){
// Do stuff after 20 minutes of loading the page
// Then using jQuery you can call a PHP script to do stuff like so:
$.ajax({
url: '/myScript.php',
method: 'POST',
success: function(result){
... | I've put some work into a small JavaScript library and service that times how long a user is on a web page. It has the added benefit of more accurately (not perfectly, though) tracking how long a user is actually interacting with the page. It ignores time that a user switches to different tabs, goes idle, minimizes the... |
53,683 | Being a denomination which prides itself of the restored beliefs of the original church before false doctrine infiltrated the truth, do Mormons celebrate Christmas on/or around the 25th of December? If so on what scriptural basis do they have for that date? | 2016/11/16 | [
"https://christianity.stackexchange.com/questions/53683",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/31712/"
] | Yes, Mormons generally celebrate the birth of Christ on the traditional day of Christmas, December 25. They never said there was scriptural basis for this date; the specific day of the year is not important to them. | As an addition to Matt's correct answer, to see how LDS Church leaders talk about Christmas one can visit ["Christmas" under the Gospel Topics on www.lds.org](https://www.lds.org/topics/christmas?lang=eng). The current Church President, Thomas S. Monson, is quoted on the website:
>
> When we keep the spirit of Christ... |
53,683 | Being a denomination which prides itself of the restored beliefs of the original church before false doctrine infiltrated the truth, do Mormons celebrate Christmas on/or around the 25th of December? If so on what scriptural basis do they have for that date? | 2016/11/16 | [
"https://christianity.stackexchange.com/questions/53683",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/31712/"
] | Yes, Mormons generally celebrate the birth of Christ on the traditional day of Christmas, December 25. They never said there was scriptural basis for this date; the specific day of the year is not important to them. | To add some additional context, Christmas was created after quite a few of the other Saints had their Feast Days canonized by some of the early churches. Some time between the 2nd and 3rd century AD, it was determined that a feast day should be set apart for the Christ — literally "[Christ's Mass](https://en.wikipedia.... |
53,683 | Being a denomination which prides itself of the restored beliefs of the original church before false doctrine infiltrated the truth, do Mormons celebrate Christmas on/or around the 25th of December? If so on what scriptural basis do they have for that date? | 2016/11/16 | [
"https://christianity.stackexchange.com/questions/53683",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/31712/"
] | As an addition to Matt's correct answer, to see how LDS Church leaders talk about Christmas one can visit ["Christmas" under the Gospel Topics on www.lds.org](https://www.lds.org/topics/christmas?lang=eng). The current Church President, Thomas S. Monson, is quoted on the website:
>
> When we keep the spirit of Christ... | To add some additional context, Christmas was created after quite a few of the other Saints had their Feast Days canonized by some of the early churches. Some time between the 2nd and 3rd century AD, it was determined that a feast day should be set apart for the Christ — literally "[Christ's Mass](https://en.wikipedia.... |
30,663 | I am reading from the book of Genesis where it is written,
**Genesis 2:20-23 New International Version (NIV)**
>
> 20 So the man gave names to all the livestock, the birds in the sky
> and all the wild animals.
>
>
> But for Adam no suitable helper was found. 21 So the Lord God caused
> the man to fall into a de... | 2017/11/27 | [
"https://hermeneutics.stackexchange.com/questions/30663",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/2572/"
] | Original answer followed by the translation supplied by Google Translate:
Original:
>
> É correto afirmar que o osso da costela de Adão era sim um osso
> vivo. Se observarmos atentamente o versículo 21 ( Então, o Senhor
> Deus fez cair um sono pesado sobre Adão e este adormeceu; e tomou uma
> de suas costelas e c... | In the scriptural paradigm of the making of Adam man was/is composed of two ingredients:
* clay (sculptable wet dirt)
* the "breath of life"
>
> NET Bible Genesis 2:7 The LORD God formed the man from the soil of the
> ground and breathed into his nostrils the breath of life, and the man
> became a living being.
> ... |
9,014,045 | would be possible to Compare two strings to find Alliteration and Assonance?
i use mainly javascript or php | 2012/01/26 | [
"https://Stackoverflow.com/questions/9014045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/282772/"
] | I'm not sure that a regex would be the best way of building a robust comparison tool. A simple regex might be part of a larger solution that used more sophisticated algorithms for non-exact matching.
There are a variety of readily-available options for English, some of which could be extended fairly simply to language... | To find alliterations in a text you simply iterate over all words, omitting too short and too common words, and collect them as long as their initial letters match.
```
text = ''
+'\nAs I looked to the east right into the sun,'
+'\nI saw a tower on a toft worthily built;'
+'\nA deep dale beneath a dungeon therein,'
+... |
41,469,041 | I had such a quick response time and had very helpful comments on my first question so I thought I would bring another issue here.
Currently I have an application that does form validation. My issue is that it only shows the required fields or form validation after submitting. However I want it to show an asterisk or ... | 2017/01/04 | [
"https://Stackoverflow.com/questions/41469041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7374617/"
] | You need to use Unobtrusive Valudation
1) install via nuget:
<https://www.nuget.org/packages/jQuery.Validation.Unobtrusive/>
This will install a bunch of javascript files in our Scripts directory
2) Edit your bundleConfig
```
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new Scr... | Client side validation is done using jquery. Ensure you have jquery and the validate scripts included in your page.
```
<script src=".../Scripts/jquery.validate.js"></script>
<script src=".../Scripts/jquery.validate.unobtrusive.js"></script>
``` |
165,463 | I want to check if excerpt is not empty, then echo the excerpt link, if not the echo permalink, like this:
`if(the_excerpt()!='') echo the_excerpt(); else echo get_permalink()`
but how can I check if the excerpt field is empty without using the content when empty?
Any help will be appreciated. | 2014/10/15 | [
"https://wordpress.stackexchange.com/questions/165463",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/62143/"
] | I am answering this old question, as it still remains unanswered. Instead of using the plugin, you should use cPanel to redirect HTTP to HTTPS. It will help you to get rid of the infinite redirection loop issue. Follow these steps:
1. Login to your cPanel account.
2. Click on the **File Manager**.
3. Ensure that publi... | Put this code in `.htaccess` file:
```
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
``` |
67,318,653 | i got a Angular components that in the init execute 2 funcions, one of them charge a array and the second one takes the values of thata array and execute a service.
The problem is that the second funcion execute before the first so the array is not charge and the second funcion returns error.
This is the code:
```
i... | 2021/04/29 | [
"https://Stackoverflow.com/questions/67318653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10199128/"
] | *Hope below snippet helps*
```
import { fromEvent, Subscription } from 'rxjs';
import { map } from 'rxjs/operators';
ngOnInit(): void {
getProducts().pipe(
map(products => products.filter(p => p.id == '4')),
tap(filteredProducts => {
getLoans(filteredProducts)
})
).... | I think you are looking for a solution like below.
Solution 1
----------
```
async ngOnInit() {
await this.firstFunction();
await this.secondFunction();
}
```
Solution 2
----------
Just using the `switchMap` operator or such things of Observable. |
67,318,653 | i got a Angular components that in the init execute 2 funcions, one of them charge a array and the second one takes the values of thata array and execute a service.
The problem is that the second funcion execute before the first so the array is not charge and the second funcion returns error.
This is the code:
```
i... | 2021/04/29 | [
"https://Stackoverflow.com/questions/67318653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10199128/"
] | The problem is that you have not synchronize the two asynchronous call. The simplest thing you can do is call the second one function when the first one get the data, in this way
```
getProducts() {
this.clientService.getClientProducts(this.clientId).subscribe(
(res) => {
if (res.su... | I think you are looking for a solution like below.
Solution 1
----------
```
async ngOnInit() {
await this.firstFunction();
await this.secondFunction();
}
```
Solution 2
----------
Just using the `switchMap` operator or such things of Observable. |
67,318,653 | i got a Angular components that in the init execute 2 funcions, one of them charge a array and the second one takes the values of thata array and execute a service.
The problem is that the second funcion execute before the first so the array is not charge and the second funcion returns error.
This is the code:
```
i... | 2021/04/29 | [
"https://Stackoverflow.com/questions/67318653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10199128/"
] | The problem is that you have not synchronize the two asynchronous call. The simplest thing you can do is call the second one function when the first one get the data, in this way
```
getProducts() {
this.clientService.getClientProducts(this.clientId).subscribe(
(res) => {
if (res.su... | *Hope below snippet helps*
```
import { fromEvent, Subscription } from 'rxjs';
import { map } from 'rxjs/operators';
ngOnInit(): void {
getProducts().pipe(
map(products => products.filter(p => p.id == '4')),
tap(filteredProducts => {
getLoans(filteredProducts)
})
).... |
17,617,081 | I want to be use some sliders in my wordpress theme. I want to select them in my theme option. I am using the code below.
```
<?php
$slider_select = get_option_tree( 'slider_select', '', 'true' );
?>
<?php get_template_part('$slider_select'); ?>
```
But, it is not working. I want the get\_template\_part code... | 2013/07/12 | [
"https://Stackoverflow.com/questions/17617081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1133748/"
] | LINQ to SQL has a LoadOptions that you can set on the context to do some powerful things. Most people point to the .LoadWith which eagerly loads child records. There's also an AssociateWith which specifies the filtering to apply on lazy child fetches. Both of them can take a lambda expression for sub child filtering. H... | ```
using (var context = new DbEntities()) {
foreach (var p in context.Parents) {
var childQuery = from c in p.Children
where c.whatever == something
select c;
// Do something with the items in childQuery, like add them to a List<Child>,
//... |
27,259,322 | I have a trigger that's purpose is to check the activity of the newly inserted row and print out a message if the activity already is in the table. The message prints the new row being added as well as a row in which already had that activity. I am able to print the row and that there is a duplicate but can't figure ou... | 2014/12/02 | [
"https://Stackoverflow.com/questions/27259322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3587186/"
] | This may be due to your hardware. You could try switching to *Software Rendering* (Internet Options > Advanced > Software Rendering) and see if that resolves the issue.
 | Which browser do you use? It could be related to HTML5 or CSS3 rendering(Internet explorer 10 didn't support HTML5 and there are some issues with CSS3 on Internet explorer 8 or lower).
My suggestion: Don't user Internet explorer. EVER. |
3,975,564 | Let $\{G\_i\}\_{i \in \Lambda}$ be a family of compact sets in a Hausdorff topological space. Show that the intersection $\bigcap\_{i \in \Lambda} G\_i$ is compact.
My attempt was:
Since $G\_j$ for some $j \in \Lambda$ is compact, there exists an open, finite covering. And $\bigcap\_{i \in \Lambda} G\_i \subset G\_j$... | 2021/01/06 | [
"https://math.stackexchange.com/questions/3975564",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | **No.** If we consider an infinitely differentiable function $f(x)$, then we can write down it's Taylor series about the point $x = a$ as
$$\sum\_{n=0}^{\infty}\frac{f^{(n)}(a)}{n!}(x-a)^n.$$ Now, if we consider the translation $h(x)=f(x+a)$ and compute its Maclaurin series, we get $$\sum\_{n=0}^{\infty}\frac{h^{(n)}(0... | Let $ f $ be a function defined arround $ x= a $, let us say at $ (a-\eta,a+\eta)$.
then, the function $ g $ given by $ g(x)=f(x+a) $ will be well defined at $(-\eta,\eta) $.
If $$ g(x)=P\_n(x)+x^n\epsilon\_1(x)$$
with $\lim\_{x\to 0}\epsilon\_1(x)=0$
then
$$f(x)=g(x-a)=$$
$$P\_n(x-a)+(x-a)^n\epsilon\_2(x)$$
with ... |
5,563,478 | I'm having an issue with a certain requirement to one of my Homework Assignments. I am required to take a list of students and print out all of the students with credit hours of 12 or more. The Credit hours are stored in a separate table, and referenced through a third table
basically, a students table, a classes table... | 2011/04/06 | [
"https://Stackoverflow.com/questions/5563478",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/694435/"
] | Since it's a homework exercise, I'm going to give a very short answer: look up the documentation for `HAVING`. | Beside getting the desired result directly from SQL as Martijn suggested, Delphi datasets have ways to filter data on the "client side" also. Check the Filter property and the OnFilter record.
Anyway, remember it is usually **better to apply the best "filter" on the database side** using the proper SQL, and then use c... |
28,106,743 | I have a contact form on a website thats uses a php script to send the details to my email.
The issue i'm having is that the data from the First Name field is not sending to my email at all.
I have a feeling this will be a really obvious mistake, but I cannot seem to find the error!
**PHP**
```
<?php
$ToEmail ... | 2015/01/23 | [
"https://Stackoverflow.com/questions/28106743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4129463/"
] | The error is here
```
$MESSAGE_BODY = "First Name: ".$_POST["firstName"]."";
$MESSAGE_BODY = "Last Name: ".$_POST["lastName"]."";
```
Change it to
```
$MESSAGE_BODY = "First Name: ".$_POST["firstName"]."";
$MESSAGE_BODY .= "Last Name: ".$_POST["lastName"]."";
```
You are overriding the first $MESSAGE\_BODY th... | There is an issue in your php script
```
$ToEmail = 'myemail@mycompany.com';
$EmailSubject = 'BGM Contact Form';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
... |
28,106,743 | I have a contact form on a website thats uses a php script to send the details to my email.
The issue i'm having is that the data from the First Name field is not sending to my email at all.
I have a feeling this will be a really obvious mistake, but I cannot seem to find the error!
**PHP**
```
<?php
$ToEmail ... | 2015/01/23 | [
"https://Stackoverflow.com/questions/28106743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4129463/"
] | Try the following by replacing `".` with a single quote `"`
```
<?php
$MESSAGE_BODY .= "First Name: '$_POST["firstName"]'";
$MESSAGE_BODY .= "Last Name: '$_POST["lastName"]'";
$MESSAGE_BODY .= "Email: '$_POST["email"]'";
$MESSAGE_BODY .= "Comment: 'nl2br($_POST["message"])'";
?>
``` | There is an issue in your php script
```
$ToEmail = 'myemail@mycompany.com';
$EmailSubject = 'BGM Contact Form';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
... |
3,467,997 | I'm learning C++ and can't get my head around this problem:
I have a simple class A
```
class A {
private:
int ival;
float fval;
public:
A(int i = 0, float f = 0.0) : ival(i), fval(f) { }
~A(){ }
void show() const {
cout << ival << " : " << fval << "\n";
}
void setVal(int i) {
... | 2010/08/12 | [
"https://Stackoverflow.com/questions/3467997",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/368003/"
] | The STL set does not let you change values it stores. It does that by returning a copy of the object through the iterator (not the actual one in the set).
The reason that set does this is because it's using < to order the set and it doesn't want to remake the entire tree every time you dereference the iterator, which ... | ~~From [this page](http://www.cplusplus.com/reference/stl/set/begin/), it seems that `begin()` exists as well as a non-const method.~~
Perhaps your set is passed into the method as a const reference ?
**EDIT**
The referenced page is wrong. As Scharron states, there is no non-const `begin()` (or `end()` for that matt... |
1,823,995 | Does anyone have a good tute/example of writing good tests for views? Most of the stuff I've been finding was from mid 2008 which is only a little helpful. | 2009/12/01 | [
"https://Stackoverflow.com/questions/1823995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181146/"
] | Alex Gaynor wrote some tips about this very subject just the other day:
[Getting started with testing in Django](http://lazypython.blogspot.com/2009/11/getting-started-with-testing-in-django.html) | I'm not sure if this is exactly what you're looking for, but I've been looking into this same topic and found this example test code very helpful.
<http://bitbucket.org/ubernostrum/django-registration/src/tip/registration/tests/views.py> |
62,473,710 | I'm a beginner for Angular.I'm using the latest Angular version (Angular: 9.1.11) and tried to install bootstrap by the command,
`ng add @ng-bootstrap/schematics`
Though it gave the message that Packages installed successfully Suddenly the compilation fails and gives the error
```
Failed to compile.
src/app/app.modu... | 2020/06/19 | [
"https://Stackoverflow.com/questions/62473710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7409078/"
] | you can simply install bootstrap using
`npm install bootstrap --save`
and then you can include bootstrap js and css file in angular.json like below:
```
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.scss"
],
"scripts": ["node_modules/bootstrap/di... | Let's uninstall and install it again.
1- Go to `angular.json` and remove:
```
"node_modules/bootstrap/dist/css/bootstrap.min.css"
```
2- Go to package.json and remove the package from there
3- Go to `node_modules` and delete `bootstrap` directory
Kill the running process and run it again `ng serve`.
And install ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.