qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
20,320,591 | I am using a UITableView to present a variety of viewControllers. Depending on which index is clicked, it will present a different view controller, which can then be dismissed. For some reason one of my ViewControllers takes two clicks to display. Thus, it seems every other click is working. Other view presentations wo... | 2013/12/02 | [
"https://Stackoverflow.com/questions/20320591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1795643/"
] | After much more debugging, I was able to determine it wasn't the view controller, but something to do with the the didSelectRowAtIndexPath and presentViewController. It started happening to other views I was presenting also, and not reliably. I also tried using if/else instead of switch with no help.
Ultimately I foun... | In Swift and iOS9 it's:
```
dispatch_async(dispatch_get_main_queue(), {
self.performSegueWithIdentifier("OpenBookingDetail", sender: self)
})
``` |
20,320,591 | I am using a UITableView to present a variety of viewControllers. Depending on which index is clicked, it will present a different view controller, which can then be dismissed. For some reason one of my ViewControllers takes two clicks to display. Thus, it seems every other click is working. Other view presentations wo... | 2013/12/02 | [
"https://Stackoverflow.com/questions/20320591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1795643/"
] | **Swift 3 :**
```
DispatchQueue.main.async(execute: {
self.present(yourViewControllerHere, animated: true, completion: nil)
})
``` | In Swift and iOS9 it's:
```
dispatch_async(dispatch_get_main_queue(), {
self.performSegueWithIdentifier("OpenBookingDetail", sender: self)
})
``` |
20,320,591 | I am using a UITableView to present a variety of viewControllers. Depending on which index is clicked, it will present a different view controller, which can then be dismissed. For some reason one of my ViewControllers takes two clicks to display. Thus, it seems every other click is working. Other view presentations wo... | 2013/12/02 | [
"https://Stackoverflow.com/questions/20320591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1795643/"
] | After much more debugging, I was able to determine it wasn't the view controller, but something to do with the the didSelectRowAtIndexPath and presentViewController. It started happening to other views I was presenting also, and not reliably. I also tried using if/else instead of switch with no help.
Ultimately I foun... | At the end of `didSelectRow` method, deselect it so that it's available for selection the next time.
```
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
.
.
.
tableView.deselectRow(at: indexPath, animated: false)
}
``` |
20,320,591 | I am using a UITableView to present a variety of viewControllers. Depending on which index is clicked, it will present a different view controller, which can then be dismissed. For some reason one of my ViewControllers takes two clicks to display. Thus, it seems every other click is working. Other view presentations wo... | 2013/12/02 | [
"https://Stackoverflow.com/questions/20320591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1795643/"
] | Check this out: <https://devforums.apple.com/thread/201431>
If you don't want to read it all - the solution for some people (including me) was to make the `presentViewController` call explicitly on the main thread:
```
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:myVC animated:YES compl... | This is an actual bug in `presentViewController:animated:completion:`. See my answer with the proper workaround here: <https://stackoverflow.com/a/30787046/1812788> |
20,320,591 | I am using a UITableView to present a variety of viewControllers. Depending on which index is clicked, it will present a different view controller, which can then be dismissed. For some reason one of my ViewControllers takes two clicks to display. Thus, it seems every other click is working. Other view presentations wo... | 2013/12/02 | [
"https://Stackoverflow.com/questions/20320591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1795643/"
] | After much more debugging, I was able to determine it wasn't the view controller, but something to do with the the didSelectRowAtIndexPath and presentViewController. It started happening to other views I was presenting also, and not reliably. I also tried using if/else instead of switch with no help.
Ultimately I foun... | One reason for this behavior could be that your table view code, and thus the code to start up your other view controllers, is not executed on the main thread. But all code related to UI must be executed on the main thread to work correctly.
Thus please ensure that the code runs on the main thread, e.g. by setting a... |
20,320,591 | I am using a UITableView to present a variety of viewControllers. Depending on which index is clicked, it will present a different view controller, which can then be dismissed. For some reason one of my ViewControllers takes two clicks to display. Thus, it seems every other click is working. Other view presentations wo... | 2013/12/02 | [
"https://Stackoverflow.com/questions/20320591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1795643/"
] | This is an actual bug in `presentViewController:animated:completion:`. See my answer with the proper workaround here: <https://stackoverflow.com/a/30787046/1812788> | At the end of `didSelectRow` method, deselect it so that it's available for selection the next time.
```
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
.
.
.
tableView.deselectRow(at: indexPath, animated: false)
}
``` |
20,320,591 | I am using a UITableView to present a variety of viewControllers. Depending on which index is clicked, it will present a different view controller, which can then be dismissed. For some reason one of my ViewControllers takes two clicks to display. Thus, it seems every other click is working. Other view presentations wo... | 2013/12/02 | [
"https://Stackoverflow.com/questions/20320591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1795643/"
] | In Swift and iOS9 it's:
```
dispatch_async(dispatch_get_main_queue(), {
self.performSegueWithIdentifier("OpenBookingDetail", sender: self)
})
``` | One reason for this behavior could be that your table view code, and thus the code to start up your other view controllers, is not executed on the main thread. But all code related to UI must be executed on the main thread to work correctly.
Thus please ensure that the code runs on the main thread, e.g. by setting a... |
20,320,591 | I am using a UITableView to present a variety of viewControllers. Depending on which index is clicked, it will present a different view controller, which can then be dismissed. For some reason one of my ViewControllers takes two clicks to display. Thus, it seems every other click is working. Other view presentations wo... | 2013/12/02 | [
"https://Stackoverflow.com/questions/20320591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1795643/"
] | Check this out: <https://devforums.apple.com/thread/201431>
If you don't want to read it all - the solution for some people (including me) was to make the `presentViewController` call explicitly on the main thread:
```
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:myVC animated:YES compl... | After much more debugging, I was able to determine it wasn't the view controller, but something to do with the the didSelectRowAtIndexPath and presentViewController. It started happening to other views I was presenting also, and not reliably. I also tried using if/else instead of switch with no help.
Ultimately I foun... |
175,653 | I'm referring to this:
[](https://i.stack.imgur.com/RPBXN.jpg)
At first, I thought they could be called *bangs*.
But according to [Google](https://www.google.com.tw/search?q=bangs%20define&oq=bangs%20define&aqs=chrome.0.69i59j0l2.1595j1j7&sour... | 2018/08/09 | [
"https://ell.stackexchange.com/questions/175653",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/1806/"
] | [Tresses](https://www.dictionary.com/browse/tresses) are long locks of hair which hang down from the head. It doesn't mean side of the head exclusively, but it does mean long hair hanging down.
>
> Her dark brown tresses framed her pale face as she gazed into the distance.
>
>
> | The specific portion which you are pointing out of Bipasa Basu is informally called **flick(s)** (*informally*). If the flick is on one side, then you say **side flick**.
[Flick](https://dictionary.reverso.net/english-cobuild/flick+of+hair) is also a noun: e.g....a flick of a paintbrush.
>
> He had straight sandy-c... |
175,653 | I'm referring to this:
[](https://i.stack.imgur.com/RPBXN.jpg)
At first, I thought they could be called *bangs*.
But according to [Google](https://www.google.com.tw/search?q=bangs%20define&oq=bangs%20define&aqs=chrome.0.69i59j0l2.1595j1j7&sour... | 2018/08/09 | [
"https://ell.stackexchange.com/questions/175653",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/1806/"
] | In U.S. English, a common way to refer to this hairstyle is that it's cut/angled/layered "**to frame the face**." See [all of these youtube tutorials](https://www.youtube.com/results?search_query=hair%20to%20frame%20your%20face) on how to cut hair like this.
While not an exact match for your sentence, a very natural ... | The specific portion which you are pointing out of Bipasa Basu is informally called **flick(s)** (*informally*). If the flick is on one side, then you say **side flick**.
[Flick](https://dictionary.reverso.net/english-cobuild/flick+of+hair) is also a noun: e.g....a flick of a paintbrush.
>
> He had straight sandy-c... |
53,557,866 | I have some data in a table that has the data separated by :
What I am trying to do is to create an array of all the table data and then explode the data that happens to be seperated by :
For example
My table has the following columns
pid,mid,uid,permissions
Now the data for a row will look typically like this
```... | 2018/11/30 | [
"https://Stackoverflow.com/questions/53557866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10591448/"
] | You **can't use** the constructor `val chip = Chip(context, null, R.style.CustomChipChoice)` because the **3rd** parameter isn't the style but the attribute in the theme as `R.attr.chipStyle`.
The `Chip` hasn't a constructor with 4 parameters as other components because it extends `AppCompatCheckbox` which does not ... | In order to set the chip style in code you can try the following:
```
val chip = Chip(context)
val drawable = ChipDrawable.createFromAttributes(context, null, 0, R.style.Widget_MaterialComponents_Chip_Choice)
chip.setChipDrawable(drawable)
``` |
53,557,866 | I have some data in a table that has the data separated by :
What I am trying to do is to create an array of all the table data and then explode the data that happens to be seperated by :
For example
My table has the following columns
pid,mid,uid,permissions
Now the data for a row will look typically like this
```... | 2018/11/30 | [
"https://Stackoverflow.com/questions/53557866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10591448/"
] | In order to set the chip style in code you can try the following:
```
val chip = Chip(context)
val drawable = ChipDrawable.createFromAttributes(context, null, 0, R.style.Widget_MaterialComponents_Chip_Choice)
chip.setChipDrawable(drawable)
``` | the `CustomChipChoice` is not a style it is just a reference to a style. therefore change `R.style.CustomChipChoice` to it : `R.attr.CustomChipChoice`
```
val newChip = Chip(context, null, R.attr.CustomChipChoice)
```
but before it you should add this `CustomChipChoice`in `values.xml` file in your project.
for this.... |
53,557,866 | I have some data in a table that has the data separated by :
What I am trying to do is to create an array of all the table data and then explode the data that happens to be seperated by :
For example
My table has the following columns
pid,mid,uid,permissions
Now the data for a row will look typically like this
```... | 2018/11/30 | [
"https://Stackoverflow.com/questions/53557866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10591448/"
] | In order to set the chip style in code you can try the following:
```
val chip = Chip(context)
val drawable = ChipDrawable.createFromAttributes(context, null, 0, R.style.Widget_MaterialComponents_Chip_Choice)
chip.setChipDrawable(drawable)
``` | Kotlin
------
xml
```
<com.google.android.material.chip.ChipGroup
android:id="@+id/chipGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">... |
53,557,866 | I have some data in a table that has the data separated by :
What I am trying to do is to create an array of all the table data and then explode the data that happens to be seperated by :
For example
My table has the following columns
pid,mid,uid,permissions
Now the data for a row will look typically like this
```... | 2018/11/30 | [
"https://Stackoverflow.com/questions/53557866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10591448/"
] | In order to set the chip style in code you can try the following:
```
val chip = Chip(context)
val drawable = ChipDrawable.createFromAttributes(context, null, 0, R.style.Widget_MaterialComponents_Chip_Choice)
chip.setChipDrawable(drawable)
``` | There's another very simple approach to this.
**styles.xml**
```xml
<style name="Widget.MyApp.Chip" parent="Widget.MaterialComponents.Chip.Choice">
<item name="android:textAppearance">@style/TextAppearance.MyApp.Chip</item>
<item name="chipIconTint">?attr/colorPrimary</item>
</style>
```
**theme.xml**
```x... |
53,557,866 | I have some data in a table that has the data separated by :
What I am trying to do is to create an array of all the table data and then explode the data that happens to be seperated by :
For example
My table has the following columns
pid,mid,uid,permissions
Now the data for a row will look typically like this
```... | 2018/11/30 | [
"https://Stackoverflow.com/questions/53557866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10591448/"
] | You **can't use** the constructor `val chip = Chip(context, null, R.style.CustomChipChoice)` because the **3rd** parameter isn't the style but the attribute in the theme as `R.attr.chipStyle`.
The `Chip` hasn't a constructor with 4 parameters as other components because it extends `AppCompatCheckbox` which does not ... | the `CustomChipChoice` is not a style it is just a reference to a style. therefore change `R.style.CustomChipChoice` to it : `R.attr.CustomChipChoice`
```
val newChip = Chip(context, null, R.attr.CustomChipChoice)
```
but before it you should add this `CustomChipChoice`in `values.xml` file in your project.
for this.... |
53,557,866 | I have some data in a table that has the data separated by :
What I am trying to do is to create an array of all the table data and then explode the data that happens to be seperated by :
For example
My table has the following columns
pid,mid,uid,permissions
Now the data for a row will look typically like this
```... | 2018/11/30 | [
"https://Stackoverflow.com/questions/53557866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10591448/"
] | You **can't use** the constructor `val chip = Chip(context, null, R.style.CustomChipChoice)` because the **3rd** parameter isn't the style but the attribute in the theme as `R.attr.chipStyle`.
The `Chip` hasn't a constructor with 4 parameters as other components because it extends `AppCompatCheckbox` which does not ... | Kotlin
------
xml
```
<com.google.android.material.chip.ChipGroup
android:id="@+id/chipGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">... |
53,557,866 | I have some data in a table that has the data separated by :
What I am trying to do is to create an array of all the table data and then explode the data that happens to be seperated by :
For example
My table has the following columns
pid,mid,uid,permissions
Now the data for a row will look typically like this
```... | 2018/11/30 | [
"https://Stackoverflow.com/questions/53557866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10591448/"
] | You **can't use** the constructor `val chip = Chip(context, null, R.style.CustomChipChoice)` because the **3rd** parameter isn't the style but the attribute in the theme as `R.attr.chipStyle`.
The `Chip` hasn't a constructor with 4 parameters as other components because it extends `AppCompatCheckbox` which does not ... | There's another very simple approach to this.
**styles.xml**
```xml
<style name="Widget.MyApp.Chip" parent="Widget.MaterialComponents.Chip.Choice">
<item name="android:textAppearance">@style/TextAppearance.MyApp.Chip</item>
<item name="chipIconTint">?attr/colorPrimary</item>
</style>
```
**theme.xml**
```x... |
53,557,866 | I have some data in a table that has the data separated by :
What I am trying to do is to create an array of all the table data and then explode the data that happens to be seperated by :
For example
My table has the following columns
pid,mid,uid,permissions
Now the data for a row will look typically like this
```... | 2018/11/30 | [
"https://Stackoverflow.com/questions/53557866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10591448/"
] | the `CustomChipChoice` is not a style it is just a reference to a style. therefore change `R.style.CustomChipChoice` to it : `R.attr.CustomChipChoice`
```
val newChip = Chip(context, null, R.attr.CustomChipChoice)
```
but before it you should add this `CustomChipChoice`in `values.xml` file in your project.
for this.... | Kotlin
------
xml
```
<com.google.android.material.chip.ChipGroup
android:id="@+id/chipGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">... |
53,557,866 | I have some data in a table that has the data separated by :
What I am trying to do is to create an array of all the table data and then explode the data that happens to be seperated by :
For example
My table has the following columns
pid,mid,uid,permissions
Now the data for a row will look typically like this
```... | 2018/11/30 | [
"https://Stackoverflow.com/questions/53557866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10591448/"
] | the `CustomChipChoice` is not a style it is just a reference to a style. therefore change `R.style.CustomChipChoice` to it : `R.attr.CustomChipChoice`
```
val newChip = Chip(context, null, R.attr.CustomChipChoice)
```
but before it you should add this `CustomChipChoice`in `values.xml` file in your project.
for this.... | There's another very simple approach to this.
**styles.xml**
```xml
<style name="Widget.MyApp.Chip" parent="Widget.MaterialComponents.Chip.Choice">
<item name="android:textAppearance">@style/TextAppearance.MyApp.Chip</item>
<item name="chipIconTint">?attr/colorPrimary</item>
</style>
```
**theme.xml**
```x... |
9,393,589 | I'm not the worlds most experienced Java programmer, and I'm trying to create a tool which ingests data and stores it away, but I've got a memory leak (at least I think that's what's happening, either way I'm getting a java.lang.OutOfMemoryError: Java heap space).
Here's the offending code:
```
public static void mai... | 2012/02/22 | [
"https://Stackoverflow.com/questions/9393589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/450460/"
] | You could increase the max memory allocate to your program with -Xmx option:
```
java -Xmx256m -jar yourApplication.jar
```
Besides, a better way to close the stream is to use try / catch / finally. The "finally" statement is always run, even if an exception is thrown. It will be something like:
```
boolean result ... | Have you tried increasing the maximum heap size?
```
java -Xms<initial heap size> -Xmx<maximum heap size>
```
Edited: Ow.. There already an answer |
6,591,894 | 1. Get current requested url (no parameters)
2. Get all GET parameters as hash
3. Convert hash to `key1=val1&key2=val2...`
I think these are necessary tools in web development.
How do you do this in Perl? | 2011/07/06 | [
"https://Stackoverflow.com/questions/6591894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/807893/"
] | It sounds like you're trying to re-invent web development again from scratch. Don't do this.
The CGI module is also probably not a good place to start if you're new to this. Look at one of the many modern frameworks that already exist to prevent you from having to ever care about parsing request parameters, construct ... | The [CGI](http://p3rl.org/CGI) module provides all of these functions. |
62,876,369 | I'd like to create a short program to download several pictures from a website.
On a form, I would like to enter a root-link to a website with placeholders.
The placeholders can be defined with **Start**/**End** value and **asc**/**desc**.
For example: the original link is
>
> google.de/1236-01.jpg
>
>
>
and... | 2020/07/13 | [
"https://Stackoverflow.com/questions/62876369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2430168/"
] | how about a simple `for` loop?
```
for (int i = 1236; i <= 9955; i++)
{
for (int j = 1; j <= 12; j++)
{
tmpQueue.Enqueue(string.Format("google.de/{0}-{1}.jpg", i, j));
}
}
``` | @Hogan this was the hint to the correct way.
solution is this
```
private void CreateDownloadList()
{
Queue<string> tmpQueue = new Queue<string>();
tmpQueue.Enqueue(downloadPathWithPlaceHolders);
while(tmpQueue.Count > 0)
{
string currentItem = tm... |
62,876,369 | I'd like to create a short program to download several pictures from a website.
On a form, I would like to enter a root-link to a website with placeholders.
The placeholders can be defined with **Start**/**End** value and **asc**/**desc**.
For example: the original link is
>
> google.de/1236-01.jpg
>
>
>
and... | 2020/07/13 | [
"https://Stackoverflow.com/questions/62876369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2430168/"
] | I'm not going give you the full code but here is some pseudo code that would solve the problem.
given :
```
todostack -- stack object that holds a list of unresolved items
replace_map -- map object that holds marker string and map of all values
marker_list -- list of all markers
final_list -- list object that hold... | @Hogan this was the hint to the correct way.
solution is this
```
private void CreateDownloadList()
{
Queue<string> tmpQueue = new Queue<string>();
tmpQueue.Enqueue(downloadPathWithPlaceHolders);
while(tmpQueue.Count > 0)
{
string currentItem = tm... |
478,232 | I have to show that (!(P.Q) + R)(!Q + P.!R) => !Q by simplifying it using De Morgan's Laws. Here is what I did but I'm not sure it's right.
(!(P.Q) + R)(!Q + P.!R) => !Q
(!P + !Q + R)(!Q + P.!R)
!(P.Q) + !P.P.!R + !Q + !Q.P.!R + R.!Q + R.P.!R
!(P.Q) + 0 + !Q + !Q.P.!Q + R.!Q + 0
!(P.Q) + !Q + !Q(1 + P.!R + R)
!(P... | 2013/08/28 | [
"https://math.stackexchange.com/questions/478232",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/92049/"
] | Indeed, your work is correct. Let's shorten things up, though, using the Distributive Law (D.L.) twice immediately following the application of DeMorgan's:
$\begin{align}(\overline{P\cdot Q} + R)\cdot (\overline Q + P\cdot \overline R) &= (\overline P + \overline Q + R)\cdot(\overline Q + P\cdot \overline R) \tag{DeMo... | Yes your simplification is right, but can be done shorter way:
$((PQ)' + R)(Q' + PR') = (P' + Q' + R)(Q' + PR') = Q' + (P' + R)(PR') = Q' + P'PR' + RPR' = Q' + 0 + 0 = Q'$. |
1,246,512 | I installed PostgreSQL with the following command:
```
$ sudo apt install postgresql postgresql-contrib libpq-dev
```
Both [help.ubuntu.com](https://help.ubuntu.com/community/PostgreSQL) and [Digitalocean](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04) agree th... | 2020/06/03 | [
"https://askubuntu.com/questions/1246512",
"https://askubuntu.com",
"https://askubuntu.com/users/467407/"
] | The PostgreSQL doc says about `ident` in its [list of auth methods](https://www.postgresql.org/docs/current/auth-methods.html):
>
> **Ident authentication**, which relies on an “Identification Protocol”
> (RFC 1413) service on the client's machine. (On local Unix-socket
> connections, **this is treated as peer auth... | You are using password authentication currently and you have chosen md5 algorithm for encryption and here is the procedure to reset your password
**Switch to the PostgreSQL User**
switch to the default PostgreSQL user, postgres:
```
su - postgres
```
then attempt a connection to PostgreSQL:
```
psql
```
the ... |
3,313,041 | I have a table of items that need to be displayed in a certain order, but that order can be changed. Items can be added at the beginning, end, or in the middle, and items can be rearranged. How can I set up the table to keep track of that order in such a way that it's easy to modify but the list can also be fetched in ... | 2010/07/22 | [
"https://Stackoverflow.com/questions/3313041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/390885/"
] | I have this problem often, and I solved it with a simple solution : an extra column called Sort Order (or DisplayOrder, whatever floats your boat really) . This allows me the flexibility to use auto-generated, auto-incremented ID column and have a special pre-defined sort.
In my case, I need them to come out of the da... | Unless I am misunderstanding what you are looking for it would seem you could just add a DISPLAY\_ORDER column that is a numeric index of how things should be returned. This can easily be changed and rearranged. Plus value can be used in order by. |
3,313,041 | I have a table of items that need to be displayed in a certain order, but that order can be changed. Items can be added at the beginning, end, or in the middle, and items can be rearranged. How can I set up the table to keep track of that order in such a way that it's easy to modify but the list can also be fetched in ... | 2010/07/22 | [
"https://Stackoverflow.com/questions/3313041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/390885/"
] | I have this problem often, and I solved it with a simple solution : an extra column called Sort Order (or DisplayOrder, whatever floats your boat really) . This allows me the flexibility to use auto-generated, auto-incremented ID column and have a special pre-defined sort.
In my case, I need them to come out of the da... | Create a column in the table that represents the sort order. Put an index on this column so that the MySQL engine can retrieve based on this column quickly. When you change the order, update the values in this field for all records to keep it consistent.
For example, when you insert a new record in the middle:
```
U... |
3,313,041 | I have a table of items that need to be displayed in a certain order, but that order can be changed. Items can be added at the beginning, end, or in the middle, and items can be rearranged. How can I set up the table to keep track of that order in such a way that it's easy to modify but the list can also be fetched in ... | 2010/07/22 | [
"https://Stackoverflow.com/questions/3313041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/390885/"
] | I have this problem often, and I solved it with a simple solution : an extra column called Sort Order (or DisplayOrder, whatever floats your boat really) . This allows me the flexibility to use auto-generated, auto-incremented ID column and have a special pre-defined sort.
In my case, I need them to come out of the da... | easiest solution: use a column named "display\_order" in which you set 1,2,3 and so on. The query would be sorted with "ORDER BY display\_order".
To edit this (if youre in a website related environment) use javascript with + and - buttons for example. everytime you do + the number increments and if something with the ... |
3,313,041 | I have a table of items that need to be displayed in a certain order, but that order can be changed. Items can be added at the beginning, end, or in the middle, and items can be rearranged. How can I set up the table to keep track of that order in such a way that it's easy to modify but the list can also be fetched in ... | 2010/07/22 | [
"https://Stackoverflow.com/questions/3313041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/390885/"
] | I have this problem often, and I solved it with a simple solution : an extra column called Sort Order (or DisplayOrder, whatever floats your boat really) . This allows me the flexibility to use auto-generated, auto-incremented ID column and have a special pre-defined sort.
In my case, I need them to come out of the da... | If you want to avoid the sort order, you can try a "parent" column and consider the linked list to be a special case of a tree like structure. This article may help.
<http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/>
There are other articles out there:
<http://ferdychristant.com/blog//archive/DOMM... |
51,118,808 | I am trying to add monitoring to a Node.js PM2 cluster where I am looking for aggregated stats in prometheus which I will then import in Grafana.
I have been able to configure prom-client and get metrics for a single process to prometheus and grafana but not a pm2 cluster.
I referred <https://github.com/siimon/prom-c... | 2018/06/30 | [
"https://Stackoverflow.com/questions/51118808",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/988268/"
] | I've came up with [this solution](https://gist.github.com/yekver/34c9d41c1c4ea478151574ea539e9953).
It correctly collects metrics across all instances of PM2 cluster.
Instead of `cluster` module there is no direct access to the master process in `pm2`. To return metrics for the whole cluster you can do IPC calls from... | Node cluster is incompatible with the "pull model" of Prometheus, so a solution is to make node push data to an "collector", from which Prometheus pulls data. For example, `statsd` should work.
The idea in sketch:
*node\_instance* -> *[statsd\_exporter](https://github.com/prometheus/statsd_exporter)* <- *Prometheus* |
8,925,805 | I have installed Hadoop 0.20.2 in psuedo distributed mode (all daemons on single machine).
It's up and running and I'm able to access HDFS through command line and run the jobs and I'm able to see the output.
But I am not able to browse the file system using UI provide by Hadoop.
<http://namenode:50070/dfshealth.jsp>... | 2012/01/19 | [
"https://Stackoverflow.com/questions/8925805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/902214/"
] | try this:
```
vi /usr/local/hadoop/conf/core-site.xml
```
And change this line:
```
<value>hdfs://**localhost**:54310</value>
```
to
```
<value>hdfs://**[your IP]**:54310</value>
```
Add the hostname and IP of namenode into the hosts file of the system from where you are browsing the above URL. If not done, then... | ok i was also facing same problem...
>
> first my namenode Storage ditectory was tmp folder so when i restart my machine all data is lost.
> so i changed my namenode storage directory to other location in my hadrdisk.
> and than i was also facing same problem i cant browse my file system.
> when i check permission... |
8,925,805 | I have installed Hadoop 0.20.2 in psuedo distributed mode (all daemons on single machine).
It's up and running and I'm able to access HDFS through command line and run the jobs and I'm able to see the output.
But I am not able to browse the file system using UI provide by Hadoop.
<http://namenode:50070/dfshealth.jsp>... | 2012/01/19 | [
"https://Stackoverflow.com/questions/8925805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/902214/"
] | try this:
```
vi /usr/local/hadoop/conf/core-site.xml
```
And change this line:
```
<value>hdfs://**localhost**:54310</value>
```
to
```
<value>hdfs://**[your IP]**:54310</value>
```
Add the hostname and IP of namenode into the hosts file of the system from where you are browsing the above URL. If not done, then... | Here is my analysis. I'm having the same problem and I'm using AWS. the "Browse the filesystem" link points to nn\_browsedfscontent.jsp.
nn\_browsedfscontent.jsp typically does the following
1. fetch the datanode ip address
2. fetch the datanode port (50075)
3. redirect the request to the ipaddress:port.
In the cas... |
8,925,805 | I have installed Hadoop 0.20.2 in psuedo distributed mode (all daemons on single machine).
It's up and running and I'm able to access HDFS through command line and run the jobs and I'm able to see the output.
But I am not able to browse the file system using UI provide by Hadoop.
<http://namenode:50070/dfshealth.jsp>... | 2012/01/19 | [
"https://Stackoverflow.com/questions/8925805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/902214/"
] | try this:
```
vi /usr/local/hadoop/conf/core-site.xml
```
And change this line:
```
<value>hdfs://**localhost**:54310</value>
```
to
```
<value>hdfs://**[your IP]**:54310</value>
```
Add the hostname and IP of namenode into the hosts file of the system from where you are browsing the above URL. If not done, then... | Open /etc/hadoop/conf/core-site.xml
and change this
hdfs://localhost:8020
to
hdfs://(your-ip):8020
then restart hadoop-datanode service
Check logs if this also doesn't work. |
8,925,805 | I have installed Hadoop 0.20.2 in psuedo distributed mode (all daemons on single machine).
It's up and running and I'm able to access HDFS through command line and run the jobs and I'm able to see the output.
But I am not able to browse the file system using UI provide by Hadoop.
<http://namenode:50070/dfshealth.jsp>... | 2012/01/19 | [
"https://Stackoverflow.com/questions/8925805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/902214/"
] | ok i was also facing same problem...
>
> first my namenode Storage ditectory was tmp folder so when i restart my machine all data is lost.
> so i changed my namenode storage directory to other location in my hadrdisk.
> and than i was also facing same problem i cant browse my file system.
> when i check permission... | Here is my analysis. I'm having the same problem and I'm using AWS. the "Browse the filesystem" link points to nn\_browsedfscontent.jsp.
nn\_browsedfscontent.jsp typically does the following
1. fetch the datanode ip address
2. fetch the datanode port (50075)
3. redirect the request to the ipaddress:port.
In the cas... |
8,925,805 | I have installed Hadoop 0.20.2 in psuedo distributed mode (all daemons on single machine).
It's up and running and I'm able to access HDFS through command line and run the jobs and I'm able to see the output.
But I am not able to browse the file system using UI provide by Hadoop.
<http://namenode:50070/dfshealth.jsp>... | 2012/01/19 | [
"https://Stackoverflow.com/questions/8925805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/902214/"
] | ok i was also facing same problem...
>
> first my namenode Storage ditectory was tmp folder so when i restart my machine all data is lost.
> so i changed my namenode storage directory to other location in my hadrdisk.
> and than i was also facing same problem i cant browse my file system.
> when i check permission... | Open /etc/hadoop/conf/core-site.xml
and change this
hdfs://localhost:8020
to
hdfs://(your-ip):8020
then restart hadoop-datanode service
Check logs if this also doesn't work. |
8,925,805 | I have installed Hadoop 0.20.2 in psuedo distributed mode (all daemons on single machine).
It's up and running and I'm able to access HDFS through command line and run the jobs and I'm able to see the output.
But I am not able to browse the file system using UI provide by Hadoop.
<http://namenode:50070/dfshealth.jsp>... | 2012/01/19 | [
"https://Stackoverflow.com/questions/8925805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/902214/"
] | Open /etc/hadoop/conf/core-site.xml
and change this
hdfs://localhost:8020
to
hdfs://(your-ip):8020
then restart hadoop-datanode service
Check logs if this also doesn't work. | Here is my analysis. I'm having the same problem and I'm using AWS. the "Browse the filesystem" link points to nn\_browsedfscontent.jsp.
nn\_browsedfscontent.jsp typically does the following
1. fetch the datanode ip address
2. fetch the datanode port (50075)
3. redirect the request to the ipaddress:port.
In the cas... |
29,349,969 | I have an app with several custom dynamic frameworks which means I am using iOS 8 as the SDK on Xcode 6.2. My Mac is on Yosemite. The frameworks have Swift sources and resources.
The app is distributed enterprise so I just create an IPA and distribute internally via a webpage where the user can download and install th... | 2015/03/30 | [
"https://Stackoverflow.com/questions/29349969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1539874/"
] | I didn't stop figuring out the cause of the issue until I read about architectures. So it prompted me to build the frameworks while an iPhone 6 is connected. I created a project with all the defaults. Added a couple of frameworks including Alamofire. Built them while iPhone 6 connected. Generated an archive and deploye... | Check the Linking section in the Build Settings tab, following item may not been set:
```
Runpath Search Paths = @executable_path/Frameworks
```
* This fixed an error for me:
```
dyld: library not loaded: @rpath/CorePlot.framework/CorePlot
reason: image not found
``` |
29,349,969 | I have an app with several custom dynamic frameworks which means I am using iOS 8 as the SDK on Xcode 6.2. My Mac is on Yosemite. The frameworks have Swift sources and resources.
The app is distributed enterprise so I just create an IPA and distribute internally via a webpage where the user can download and install th... | 2015/03/30 | [
"https://Stackoverflow.com/questions/29349969",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1539874/"
] | I didn't stop figuring out the cause of the issue until I read about architectures. So it prompted me to build the frameworks while an iPhone 6 is connected. I created a project with all the defaults. Added a couple of frameworks including Alamofire. Built them while iPhone 6 connected. Generated an archive and deploye... | I had same issue with xcode 10 with Mojave & I am using Cocoa pods, here are my solution :
1. Make sure your target->build settings->iOS Deployment Target is set to the latest IOS.
2. In Pod file, remove "inherit! :search\_paths" for the test UI target. For Eg.
>
>
> ```
> Existing pod file :
>
> target 'MyApp... |
1,080,854 | I'd like a defintion list that looks like:
```
term 1
definition 1
term 2
definition 2
```
rather than
```
term 1
definition 1
term 2
definition 2
```
What's the easiest way to to this? | 2009/07/03 | [
"https://Stackoverflow.com/questions/1080854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/82474/"
] | Add a margin-left declaration to the `<dd>` element:
```
dd { margin-left: 15px; }
```
You'll have to adjust the amount to whatever suits your needs, obviously. | You need to set the `margin-left` attribute for the `dd` tag:
```
dd {
margin-left: 20px;
}
``` |
1,080,854 | I'd like a defintion list that looks like:
```
term 1
definition 1
term 2
definition 2
```
rather than
```
term 1
definition 1
term 2
definition 2
```
What's the easiest way to to this? | 2009/07/03 | [
"https://Stackoverflow.com/questions/1080854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/82474/"
] | Add a margin-left declaration to the `<dd>` element:
```
dd { margin-left: 15px; }
```
You'll have to adjust the amount to whatever suits your needs, obviously. | Or:
```
dd {
margin-left: 2em;
}
```
Which will indent 2 characters in. |
1,080,854 | I'd like a defintion list that looks like:
```
term 1
definition 1
term 2
definition 2
```
rather than
```
term 1
definition 1
term 2
definition 2
```
What's the easiest way to to this? | 2009/07/03 | [
"https://Stackoverflow.com/questions/1080854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/82474/"
] | Or:
```
dd {
margin-left: 2em;
}
```
Which will indent 2 characters in. | You need to set the `margin-left` attribute for the `dd` tag:
```
dd {
margin-left: 20px;
}
``` |
19,995 | Mark 5:9 ESV:
>
> **9** And Jesus asked him, “What is your name?” He replied, “My name is Legion, for we are many.” **10** And he begged him earnestly not to send them out of the country. **11** Now a great herd of pigs was feeding there on the hillside, **12** and they begged him, saying, “Send us to the pigs; let u... | 2015/09/20 | [
"https://hermeneutics.stackexchange.com/questions/19995",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | The context and sense of the question mean that Jesus was asking for a name, rather than a title, although in some sense he was answered with a title. This is the only occasion in Mark's Gospel when Jesus does ask a supplicant for his name, yet we are not told the demoniac's name, only the response of the demons, who s... | In the Book of Genesis God gave Adam (Man) dominion over all creatures and by granting Adam the right to name them, the deal was sealed. It was my understanding from my study of the Bible that knowing a name of a creature imbued the asker control. One cannot control that which has no name, it is a kind of hook.
Jacob ... |
19,995 | Mark 5:9 ESV:
>
> **9** And Jesus asked him, “What is your name?” He replied, “My name is Legion, for we are many.” **10** And he begged him earnestly not to send them out of the country. **11** Now a great herd of pigs was feeding there on the hillside, **12** and they begged him, saying, “Send us to the pigs; let u... | 2015/09/20 | [
"https://hermeneutics.stackexchange.com/questions/19995",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | The context and sense of the question mean that Jesus was asking for a name, rather than a title, although in some sense he was answered with a title. This is the only occasion in Mark's Gospel when Jesus does ask a supplicant for his name, yet we are not told the demoniac's name, only the response of the demons, who s... | For what it's worth, I'll buy Dick's answer because I'm unconvinced that the Bible - anywhere - supports the idea that Jesus - the Son of God the Son of Man - was omniscient.
He Himself stated that He came to do the will of the Father (John 12: 49, Hebrews 10:7 - from Ps 40). Paul teaches He is the new Adam. He lived a... |
19,995 | Mark 5:9 ESV:
>
> **9** And Jesus asked him, “What is your name?” He replied, “My name is Legion, for we are many.” **10** And he begged him earnestly not to send them out of the country. **11** Now a great herd of pigs was feeding there on the hillside, **12** and they begged him, saying, “Send us to the pigs; let u... | 2015/09/20 | [
"https://hermeneutics.stackexchange.com/questions/19995",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | **In Mark 5:9 does Jesus ask for a name or a title? And why did he ask?**
Jesus asked for a name, however, the reply from the man was a "Legion". Possibly the chief of these demons caused the man to reply as such, Legion was not the man's actual name, but meaning that there were many demons involved.
Legion: A Roman ... | Jesus taught His disciples on how to cast out demons.
As there are two attempts on casting out the demon:
**The first** attempt at 5:8 For he was saying to him, **“Come out of the man, you unclean spirit!”** - Not successful.
**The second** attempt at **5:13 So he gave them permission.** And the unclean spirits came o... |
19,995 | Mark 5:9 ESV:
>
> **9** And Jesus asked him, “What is your name?” He replied, “My name is Legion, for we are many.” **10** And he begged him earnestly not to send them out of the country. **11** Now a great herd of pigs was feeding there on the hillside, **12** and they begged him, saying, “Send us to the pigs; let u... | 2015/09/20 | [
"https://hermeneutics.stackexchange.com/questions/19995",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | The context and sense of the question mean that Jesus was asking for a name, rather than a title, although in some sense he was answered with a title. This is the only occasion in Mark's Gospel when Jesus does ask a supplicant for his name, yet we are not told the demoniac's name, only the response of the demons, who s... | Is it possible that Jesus was demonstrating to the apostles and disciples the importance of “knowing who you’re dealing with”? His initial command, “Come out of the man you unclean spirit,” seems to have fallen on deaf ears: We see in v.10 that the man is still speaking about the demons inside him. Once Jesus properly ... |
19,995 | Mark 5:9 ESV:
>
> **9** And Jesus asked him, “What is your name?” He replied, “My name is Legion, for we are many.” **10** And he begged him earnestly not to send them out of the country. **11** Now a great herd of pigs was feeding there on the hillside, **12** and they begged him, saying, “Send us to the pigs; let u... | 2015/09/20 | [
"https://hermeneutics.stackexchange.com/questions/19995",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | The context and sense of the question mean that Jesus was asking for a name, rather than a title, although in some sense he was answered with a title. This is the only occasion in Mark's Gospel when Jesus does ask a supplicant for his name, yet we are not told the demoniac's name, only the response of the demons, who s... | Jesus taught His disciples on how to cast out demons.
As there are two attempts on casting out the demon:
**The first** attempt at 5:8 For he was saying to him, **“Come out of the man, you unclean spirit!”** - Not successful.
**The second** attempt at **5:13 So he gave them permission.** And the unclean spirits came o... |
19,995 | Mark 5:9 ESV:
>
> **9** And Jesus asked him, “What is your name?” He replied, “My name is Legion, for we are many.” **10** And he begged him earnestly not to send them out of the country. **11** Now a great herd of pigs was feeding there on the hillside, **12** and they begged him, saying, “Send us to the pigs; let u... | 2015/09/20 | [
"https://hermeneutics.stackexchange.com/questions/19995",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | The context and sense of the question mean that Jesus was asking for a name, rather than a title, although in some sense he was answered with a title. This is the only occasion in Mark's Gospel when Jesus does ask a supplicant for his name, yet we are not told the demoniac's name, only the response of the demons, who s... | Mark 5:9. is very clear by the fact that Jesus was asking THE MAN not the demons. Let us first establish what the question did.
1. The question called back the demoniac to his personal or true identity (consciousness). The demons had robed him of his identity to such a big extent that not only did they make him an out... |
19,995 | Mark 5:9 ESV:
>
> **9** And Jesus asked him, “What is your name?” He replied, “My name is Legion, for we are many.” **10** And he begged him earnestly not to send them out of the country. **11** Now a great herd of pigs was feeding there on the hillside, **12** and they begged him, saying, “Send us to the pigs; let u... | 2015/09/20 | [
"https://hermeneutics.stackexchange.com/questions/19995",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | Is it possible that Jesus was demonstrating to the apostles and disciples the importance of “knowing who you’re dealing with”? His initial command, “Come out of the man you unclean spirit,” seems to have fallen on deaf ears: We see in v.10 that the man is still speaking about the demons inside him. Once Jesus properly ... | Jesus taught His disciples on how to cast out demons.
As there are two attempts on casting out the demon:
**The first** attempt at 5:8 For he was saying to him, **“Come out of the man, you unclean spirit!”** - Not successful.
**The second** attempt at **5:13 So he gave them permission.** And the unclean spirits came o... |
19,995 | Mark 5:9 ESV:
>
> **9** And Jesus asked him, “What is your name?” He replied, “My name is Legion, for we are many.” **10** And he begged him earnestly not to send them out of the country. **11** Now a great herd of pigs was feeding there on the hillside, **12** and they begged him, saying, “Send us to the pigs; let u... | 2015/09/20 | [
"https://hermeneutics.stackexchange.com/questions/19995",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | For what it's worth, I'll buy Dick's answer because I'm unconvinced that the Bible - anywhere - supports the idea that Jesus - the Son of God the Son of Man - was omniscient.
He Himself stated that He came to do the will of the Father (John 12: 49, Hebrews 10:7 - from Ps 40). Paul teaches He is the new Adam. He lived a... | Jesus taught His disciples on how to cast out demons.
As there are two attempts on casting out the demon:
**The first** attempt at 5:8 For he was saying to him, **“Come out of the man, you unclean spirit!”** - Not successful.
**The second** attempt at **5:13 So he gave them permission.** And the unclean spirits came o... |
19,995 | Mark 5:9 ESV:
>
> **9** And Jesus asked him, “What is your name?” He replied, “My name is Legion, for we are many.” **10** And he begged him earnestly not to send them out of the country. **11** Now a great herd of pigs was feeding there on the hillside, **12** and they begged him, saying, “Send us to the pigs; let u... | 2015/09/20 | [
"https://hermeneutics.stackexchange.com/questions/19995",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | Mark 5:9. is very clear by the fact that Jesus was asking THE MAN not the demons. Let us first establish what the question did.
1. The question called back the demoniac to his personal or true identity (consciousness). The demons had robed him of his identity to such a big extent that not only did they make him an out... | Jesus taught His disciples on how to cast out demons.
As there are two attempts on casting out the demon:
**The first** attempt at 5:8 For he was saying to him, **“Come out of the man, you unclean spirit!”** - Not successful.
**The second** attempt at **5:13 So he gave them permission.** And the unclean spirits came o... |
19,995 | Mark 5:9 ESV:
>
> **9** And Jesus asked him, “What is your name?” He replied, “My name is Legion, for we are many.” **10** And he begged him earnestly not to send them out of the country. **11** Now a great herd of pigs was feeding there on the hillside, **12** and they begged him, saying, “Send us to the pigs; let u... | 2015/09/20 | [
"https://hermeneutics.stackexchange.com/questions/19995",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/-1/"
] | In the Book of Genesis God gave Adam (Man) dominion over all creatures and by granting Adam the right to name them, the deal was sealed. It was my understanding from my study of the Bible that knowing a name of a creature imbued the asker control. One cannot control that which has no name, it is a kind of hook.
Jacob ... | Jesus taught His disciples on how to cast out demons.
As there are two attempts on casting out the demon:
**The first** attempt at 5:8 For he was saying to him, **“Come out of the man, you unclean spirit!”** - Not successful.
**The second** attempt at **5:13 So he gave them permission.** And the unclean spirits came o... |
2,688,640 | I am a student in middle school and I was wondering if anyone could help me with the following problem:
How many ways can I put down two indistinguishable pieces on an ordinary $8\times 8$ chessboard, if the pieces must either be in the same row or be in the same column?
I think there would be 64 options for the firs... | 2018/03/13 | [
"https://math.stackexchange.com/questions/2688640",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/540092/"
] | First of all, let's choose one of the two possibilities: either the same row OR the same column. They can't be both because then the two pieces would be the same. There are $16$ total rows and columns.
Next, given a single row/column, we choose two squares out of that specific row/column.
There are 8 squares in that... | The first piece can go in any of the $64$ squares. The second piece can then be in any of $14$ positions, since there are $7$ unoccupied squares in the row of the first piece, as well as $7$ unoccupied squares in the column of the first piece. This would seem to give us $64\cdot 14$ choices for the placement of the two... |
52,577,686 | I got a **movement vector** that looks like one of them:
```
let movement = { x: 0, y: 0 } // no movement
let movement = { x: 1, y: 0 } // move right
let movement = { x: -1, y: 0 } // move left
let movement = { x: 0, y: 1 } // move down
let movement = { x: 0, y: -1 } // move up
let movement = { x: 1, y: -1 } // move r... | 2018/09/30 | [
"https://Stackoverflow.com/questions/52577686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You should use [`Math.atan2(y,x)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2) to account for quadrants.
Note that the arguments are `y,x` rather than `y/x`.
*EDIT*
If you want `(0,0)` to point upwards, then you can use an if statement when deciding your rotation to ... | I just played with something last night that may be just what you need.
Forgoing trig except for vecLen calcs (where its still unnecessary), I draw an arrow head whose direction is specified with a vector.
You normalize the vector that extends from the back to the front of the arrow. You can then use this to step back... |
52,577,686 | I got a **movement vector** that looks like one of them:
```
let movement = { x: 0, y: 0 } // no movement
let movement = { x: 1, y: 0 } // move right
let movement = { x: -1, y: 0 } // move left
let movement = { x: 0, y: 1 } // move down
let movement = { x: 0, y: -1 } // move up
let movement = { x: 1, y: -1 } // move r... | 2018/09/30 | [
"https://Stackoverflow.com/questions/52577686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You should use [`Math.atan2(y,x)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2) to account for quadrants.
Note that the arguments are `y,x` rather than `y/x`.
*EDIT*
If you want `(0,0)` to point upwards, then you can use an if statement when deciding your rotation to ... | As you state yourself in comments, `atan` is not suitable for this as the quotient of the coordinates loses information about the coordinates. Instead of suggesting `atan2`, I would not advise using a trigonometric function for this: it is overkill.
As you only have 9 states (with "no movement" included), you could ju... |
52,577,686 | I got a **movement vector** that looks like one of them:
```
let movement = { x: 0, y: 0 } // no movement
let movement = { x: 1, y: 0 } // move right
let movement = { x: -1, y: 0 } // move left
let movement = { x: 0, y: 1 } // move down
let movement = { x: 0, y: -1 } // move up
let movement = { x: 1, y: -1 } // move r... | 2018/09/30 | [
"https://Stackoverflow.com/questions/52577686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | As you state yourself in comments, `atan` is not suitable for this as the quotient of the coordinates loses information about the coordinates. Instead of suggesting `atan2`, I would not advise using a trigonometric function for this: it is overkill.
As you only have 9 states (with "no movement" included), you could ju... | I just played with something last night that may be just what you need.
Forgoing trig except for vecLen calcs (where its still unnecessary), I draw an arrow head whose direction is specified with a vector.
You normalize the vector that extends from the back to the front of the arrow. You can then use this to step back... |
69,777,465 | I want to create an animation like this that revolves around the two shapes. And I want to achieve it in SVG with no external CSS. Can anyone help me out on how to do it?
This is my code
```html
<svg xmlns="http://www.w3.org/2000/svg" width="542" height="542" viewBox="0 0 542 542">
<g id="svg" transform="translate(... | 2021/10/30 | [
"https://Stackoverflow.com/questions/69777465",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14383601/"
] | If you load your file into a vector editor, we will see that the shapes are outside the SVG canvas.
[](https://i.stack.imgur.com/bwZvv.png)
Because of this, you were forced to use transform commands to bring the forms back to the custom viewport.
*P... | The **experimental** `<sprite-meister>` Web Component can generate the CSS for you
* After cleaning up your SVG: no translates, no self-closing tags
* You are left with the first frame of your animation
+ this is not SVG, but a String Template Literal you can program
* Sprite-Meister generates the other `steps=48` fr... |
35,259,616 | Hello, guys. I'm trying to retrieve data from Oracle database, but nothing appears on the screen.
Here is my `usersList.jsp`
```
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>Spring MVC Hello World</title>
</head>
<body>
<h2>All Users in System</h2>
<table b... | 2016/02/07 | [
"https://Stackoverflow.com/questions/35259616",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5896226/"
] | I found out the answer. I just replaced
```
<c:forEach items="${users}" var="user">
<tr>
<td>${user.userId}</td>
<td>${user.login}</td>
</tr>
</c:forEach>
```
With
```
<c:forEach items="${users}" var="user">
<tr>
<td>
<c:out value="${user.userId}"... | Try to write your `component-scan` like this:
```
<context:component-scan base-package="com.controller" />
``` |
407,680 | I got a suspicious alert on litte snitch today which I captured in a screenshot. I am sending it to you. Could you please take a look and tell whether you think my mac got infected or not?
I installed Clear VPN through my Setapp subscription last week and it asked for my keychain password. I am not really informed on ... | 2020/11/30 | [
"https://apple.stackexchange.com/questions/407680",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/236501/"
] | There's nothing there that indicates being "hacked."
Too often, folks see connections or random behavior and immediately assume this is a hacking attempt. It's not.
This could be any number of legitimate connection attempts especially given that the [IP in question](https://whatismyipaddress.com/ip/128.130.244.179) i... | I believe this is a real hack attempt targeting a BitTorrent listener on port 6881. I witnessed such an attempt recently from a malicious source IP, identified as a VPN client located in Zurich. Most likely, your firewall has port forwarding enabled on port 6881 to the machine running Little Snitch, prompting the alert... |
2,819 | All tutorials I have found say to add your shortcodes to functions.php in your theme. I would like to break that away from my theme and put that in a plugin so I can share these shortcodes between my network of blogs. Is there a reference or tutorial on creating these shortcodes in a plugin? | 2010/10/12 | [
"https://wordpress.stackexchange.com/questions/2819",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/104/"
] | The code you posted is to have multiple wp-config.php-style wordpress configuration files with one codebase. the configuration is then based on the domain name.
imagine the localserver is listening on `http://localhost.localdomain/` (no idea which one is the default with ubuntu), then the configuration file would be: ... | By the looks of it loads the config file from the `/etc/wordpress` directory instead of from `/usr/share/wordpress`, where the package is installed by default, probably for security reasons.
I would recommend not using the package and instead installing WordPress as you would with any other installation - the setup it... |
2,819 | All tutorials I have found say to add your shortcodes to functions.php in your theme. I would like to break that away from my theme and put that in a plugin so I can share these shortcodes between my network of blogs. Is there a reference or tutorial on creating these shortcodes in a plugin? | 2010/10/12 | [
"https://wordpress.stackexchange.com/questions/2819",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/104/"
] | By the looks of it loads the config file from the `/etc/wordpress` directory instead of from `/usr/share/wordpress`, where the package is installed by default, probably for security reasons.
I would recommend not using the package and instead installing WordPress as you would with any other installation - the setup it... | I use Ubuntu for everything except testing layouts in Internet Explorer. Definitely go with a manual install rather than installing through the package manager. In my experience packages available through the package manager tend to be a bit behind the present release. Not a big deal if your installing Guaydeque to lis... |
2,819 | All tutorials I have found say to add your shortcodes to functions.php in your theme. I would like to break that away from my theme and put that in a plugin so I can share these shortcodes between my network of blogs. Is there a reference or tutorial on creating these shortcodes in a plugin? | 2010/10/12 | [
"https://wordpress.stackexchange.com/questions/2819",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/104/"
] | The code you posted is to have multiple wp-config.php-style wordpress configuration files with one codebase. the configuration is then based on the domain name.
imagine the localserver is listening on `http://localhost.localdomain/` (no idea which one is the default with ubuntu), then the configuration file would be: ... | I use Ubuntu for everything except testing layouts in Internet Explorer. Definitely go with a manual install rather than installing through the package manager. In my experience packages available through the package manager tend to be a bit behind the present release. Not a big deal if your installing Guaydeque to lis... |
5,655,774 | There are 1 on 1 live chat. Two solutions:
1) I store every message into database and with jQuery's help I check if there is a new message in database every second. Of course I use cache either. If there is, we give that message.
2) I store every message in one html file and every second through jQuery that file is s... | 2011/04/13 | [
"https://Stackoverflow.com/questions/5655774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237681/"
] | Everyone has given a wide range of opinions but I don't think anyone has really hit the nail on the head.
When it comes down to storing data, the amount of data, the rate it is to be accessed, and several other factors all determine what's the best storage platform.
Some people have suggested using memcached. Now alt... | 3rd option. use [MEMCACHE](http://us2.php.net/manual/en/book.memcache.php). infinitely faster read/writes. perfect for your application. |
5,655,774 | There are 1 on 1 live chat. Two solutions:
1) I store every message into database and with jQuery's help I check if there is a new message in database every second. Of course I use cache either. If there is, we give that message.
2) I store every message in one html file and every second through jQuery that file is s... | 2011/04/13 | [
"https://Stackoverflow.com/questions/5655774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237681/"
] | Everyone has given a wide range of opinions but I don't think anyone has really hit the nail on the head.
When it comes down to storing data, the amount of data, the rate it is to be accessed, and several other factors all determine what's the best storage platform.
Some people have suggested using memcached. Now alt... | If you define a conversation as only two people, then a request every second is going to look like one read request per second per user, and one write request every time somebody writes something (say every 10 seconds). So every 10 seconds you will have about 2.2 requests per second, per conversation.
For 50 conversat... |
5,655,774 | There are 1 on 1 live chat. Two solutions:
1) I store every message into database and with jQuery's help I check if there is a new message in database every second. Of course I use cache either. If there is, we give that message.
2) I store every message in one html file and every second through jQuery that file is s... | 2011/04/13 | [
"https://Stackoverflow.com/questions/5655774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237681/"
] | A fourth option, probably not what you want if you already have PHP code you want to use, but maybe the most efficient is to use a Javascript based server instead of php.
Node.js is easily capable of being a chat server and can store all the recent messages as a Javascript variable.
You can use long polling or other ... | In general, http connections are not very useful when it comes to pushing data to the client. Doing polls at every x seconds tend to be a resource hog on any server, given you have significant traffic.
You should try [XMPP](http://www.xmpp.org/) combined with [BOSH](http://en.wikipedia.org/wiki/BOSH). Luckily, most of... |
5,655,774 | There are 1 on 1 live chat. Two solutions:
1) I store every message into database and with jQuery's help I check if there is a new message in database every second. Of course I use cache either. If there is, we give that message.
2) I store every message in one html file and every second through jQuery that file is s... | 2011/04/13 | [
"https://Stackoverflow.com/questions/5655774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237681/"
] | It depends on number of chats in the same time. If it's for support and you expect average load to be 1 to 5 chat sessions at a time then you don't to worry too much. Just make sure that when there is no activity for some time stop refreshing and show a message for user to click to resume chat session.
If the visitors... | I think storing the data on the database is better. Please refer the following link
[Script Tutorials Chat](http://www.script-tutorials.com/powerful-chat-system-lesson-8/) |
5,655,774 | There are 1 on 1 live chat. Two solutions:
1) I store every message into database and with jQuery's help I check if there is a new message in database every second. Of course I use cache either. If there is, we give that message.
2) I store every message in one html file and every second through jQuery that file is s... | 2011/04/13 | [
"https://Stackoverflow.com/questions/5655774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237681/"
] | 3rd option. use [MEMCACHE](http://us2.php.net/manual/en/book.memcache.php). infinitely faster read/writes. perfect for your application. | you could always get the right tool for the job ... an XMPP compliant bit of software. for as poor as the documentation is, `ejabber` is pretty alright. because it follows closely the XMPP standard: <http://code.google.com/p/ijab/> you can use any XMPP client. You can store all of it in an RDBMS if you like and provide... |
5,655,774 | There are 1 on 1 live chat. Two solutions:
1) I store every message into database and with jQuery's help I check if there is a new message in database every second. Of course I use cache either. If there is, we give that message.
2) I store every message in one html file and every second through jQuery that file is s... | 2011/04/13 | [
"https://Stackoverflow.com/questions/5655774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237681/"
] | It depends on number of chats in the same time. If it's for support and you expect average load to be 1 to 5 chat sessions at a time then you don't to worry too much. Just make sure that when there is no activity for some time stop refreshing and show a message for user to click to resume chat session.
If the visitors... | A really fast alternative could be a NoSQL database like MongoDB:
1. [MongoDB homepage](http://www.mongodb.org/display/DOCS/Home)
2. [Some benchmarks](http://www.mongodb.org/display/DOCS/Benchmarks)
3. [MongoDB's extension homepage on php.net](http://www.php.net/manual/en/book.mongo.php) |
5,655,774 | There are 1 on 1 live chat. Two solutions:
1) I store every message into database and with jQuery's help I check if there is a new message in database every second. Of course I use cache either. If there is, we give that message.
2) I store every message in one html file and every second through jQuery that file is s... | 2011/04/13 | [
"https://Stackoverflow.com/questions/5655774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237681/"
] | Just to throw in another option... flat files *could* provide a less resource-hungry alternative.
Every chat is assigned a unique ID and a flat file stored for it. Every chat adds a line to this file. Each client machine then uses jquery to check ONLY the modified date of the file, to see if the chat has been updated.... | Unless, its a small-audience script - Between Database vs File-System, its better to use Database(.)
P.S:- Flash also makes a great platform for chat servers, you might wanna look into that aswell. |
5,655,774 | There are 1 on 1 live chat. Two solutions:
1) I store every message into database and with jQuery's help I check if there is a new message in database every second. Of course I use cache either. If there is, we give that message.
2) I store every message in one html file and every second through jQuery that file is s... | 2011/04/13 | [
"https://Stackoverflow.com/questions/5655774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237681/"
] | It depends on number of chats in the same time. If it's for support and you expect average load to be 1 to 5 chat sessions at a time then you don't to worry too much. Just make sure that when there is no activity for some time stop refreshing and show a message for user to click to resume chat session.
If the visitors... | Just to throw in another option... flat files *could* provide a less resource-hungry alternative.
Every chat is assigned a unique ID and a flat file stored for it. Every chat adds a line to this file. Each client machine then uses jquery to check ONLY the modified date of the file, to see if the chat has been updated.... |
5,655,774 | There are 1 on 1 live chat. Two solutions:
1) I store every message into database and with jQuery's help I check if there is a new message in database every second. Of course I use cache either. If there is, we give that message.
2) I store every message in one html file and every second through jQuery that file is s... | 2011/04/13 | [
"https://Stackoverflow.com/questions/5655774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237681/"
] | Everyone has given a wide range of opinions but I don't think anyone has really hit the nail on the head.
When it comes down to storing data, the amount of data, the rate it is to be accessed, and several other factors all determine what's the best storage platform.
Some people have suggested using memcached. Now alt... | A really fast alternative could be a NoSQL database like MongoDB:
1. [MongoDB homepage](http://www.mongodb.org/display/DOCS/Home)
2. [Some benchmarks](http://www.mongodb.org/display/DOCS/Benchmarks)
3. [MongoDB's extension homepage on php.net](http://www.php.net/manual/en/book.mongo.php) |
5,655,774 | There are 1 on 1 live chat. Two solutions:
1) I store every message into database and with jQuery's help I check if there is a new message in database every second. Of course I use cache either. If there is, we give that message.
2) I store every message in one html file and every second through jQuery that file is s... | 2011/04/13 | [
"https://Stackoverflow.com/questions/5655774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237681/"
] | A fourth option, probably not what you want if you already have PHP code you want to use, but maybe the most efficient is to use a Javascript based server instead of php.
Node.js is easily capable of being a chat server and can store all the recent messages as a Javascript variable.
You can use long polling or other ... | Unless, its a small-audience script - Between Database vs File-System, its better to use Database(.)
P.S:- Flash also makes a great platform for chat servers, you might wanna look into that aswell. |
16,345,544 | I am having some trouble getting java to recognize my PrintWriter object 'out'. I'm not really sure what the problem is.
```
public void storeInput(String fileName)
{
String folderName = "C:/temper/testy/";
File filetest = new File(folderName, fileName);
System.out.println("ENTER TEXT!!!!!");
String ... | 2013/05/02 | [
"https://Stackoverflow.com/questions/16345544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2312727/"
] | declare that outside of `try`
```
PrintWriter out = null;
try {
out = new PrintWriter(
new BufferedWriter(
new FileWriter(filetest)));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
``` | The `out` variable's scope is currently only in the scope of the `try` block. Declare it before the `try` block so it's available after the block ends.
You'll need to initialize it to `null` so you don't get a "variable may not have been initialized" error. Then you'll need to test if it's `null` when attempting to us... |
16,345,544 | I am having some trouble getting java to recognize my PrintWriter object 'out'. I'm not really sure what the problem is.
```
public void storeInput(String fileName)
{
String folderName = "C:/temper/testy/";
File filetest = new File(folderName, fileName);
System.out.println("ENTER TEXT!!!!!");
String ... | 2013/05/02 | [
"https://Stackoverflow.com/questions/16345544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2312727/"
] | declare that outside of `try`
```
PrintWriter out = null;
try {
out = new PrintWriter(
new BufferedWriter(
new FileWriter(filetest)));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
``` | `PrintWriter out` is visible only inside the `try` block. accessing it from outside will result in a compile error.
You can either move it's declaration outside the `try` block so that it become in you case visible in the hole body of the function `storeInput` but then you'll have to check whether ist is initialized b... |
16,345,544 | I am having some trouble getting java to recognize my PrintWriter object 'out'. I'm not really sure what the problem is.
```
public void storeInput(String fileName)
{
String folderName = "C:/temper/testy/";
File filetest = new File(folderName, fileName);
System.out.println("ENTER TEXT!!!!!");
String ... | 2013/05/02 | [
"https://Stackoverflow.com/questions/16345544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2312727/"
] | The `out` variable's scope is currently only in the scope of the `try` block. Declare it before the `try` block so it's available after the block ends.
You'll need to initialize it to `null` so you don't get a "variable may not have been initialized" error. Then you'll need to test if it's `null` when attempting to us... | `PrintWriter out` is visible only inside the `try` block. accessing it from outside will result in a compile error.
You can either move it's declaration outside the `try` block so that it become in you case visible in the hole body of the function `storeInput` but then you'll have to check whether ist is initialized b... |
47,591 | I implemented my own sorting in VBA because it doesn't provide its own, and it's healthy to test yourself. It was surprisingly difficult and I ended up make a few tweaks that I didn't expect to make in order for it to sort.
```
Public Sub quicksort(ByRef arr As Variant, _
ByVal left As Integer, _
... | 2014/04/18 | [
"https://codereview.stackexchange.com/questions/47591",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/38248/"
] | Few notes.
* All algorithms on ranges are much simpler if the range is considered semi-open (that is, `right` is just beyond the last interesting element.
* The `While l < r` loop does a very important job; important enough to factor it into a separate function, `Public Sub Partition`
* One more thing you want to do i... | Just one comment: use Longs instead of Integers, sometimes it causes a dramatic improvement in speed (Excel converts Integers to Longs in the background). |
47,591 | I implemented my own sorting in VBA because it doesn't provide its own, and it's healthy to test yourself. It was surprisingly difficult and I ended up make a few tweaks that I didn't expect to make in order for it to sort.
```
Public Sub quicksort(ByRef arr As Variant, _
ByVal left As Integer, _
... | 2014/04/18 | [
"https://codereview.stackexchange.com/questions/47591",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/38248/"
] | VB6/VBA is a "bulky" language to read - `If...End If`, `Sub...End Sub`, `While...Wend`; compared to *curly braces* languages (Java, C#, etc.), VB6/VBA code, by the nature of its *code block* delimiters, makes pretty crowded code, even when written cleanly.
Give it some breathing vertical space:
```
Public Sub QuickSo... | Just one comment: use Longs instead of Integers, sometimes it causes a dramatic improvement in speed (Excel converts Integers to Longs in the background). |
267,659 | Hi i am new to the salesforce.com.
We are migrating from siebel to salesforce. In Siebel we have task based ui which is like a series of interfaces where we can navigate to forward, backward, pause and submit the flow at the end. Do we have some thing like this functionality in force.com? | 2019/06/29 | [
"https://salesforce.stackexchange.com/questions/267659",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/70298/"
] | today I've encountered the same issue. The 'Column' is not the same as any logical API reference we are aware of. The work-a-round which did work (though it requires a bit of developer-knowledge).
1. Update the Report to have the filter you want to set dynamically
2. Retrieve the Report .xml file via the metadata API
... | Expanding on Reinier's answer - I have also found that for community users, you must remove the original filter condition from the report in order for the URL filter condition to be applied correctly. If you leave the filter condition in the report, the URL filter does not change it - instead, it adds a "linked filter"... |
267,659 | Hi i am new to the salesforce.com.
We are migrating from siebel to salesforce. In Siebel we have task based ui which is like a series of interfaces where we can navigate to forward, backward, pause and submit the flow at the end. Do we have some thing like this functionality in force.com? | 2019/06/29 | [
"https://salesforce.stackexchange.com/questions/267659",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/70298/"
] | today I've encountered the same issue. The 'Column' is not the same as any logical API reference we are aware of. The work-a-round which did work (though it requires a bit of developer-knowledge).
1. Update the Report to have the filter you want to set dynamically
2. Retrieve the Report .xml file via the metadata API
... | @DavidCheng please find some documentation on the Report metadata. I'm not sure why you didn't see those capital-CUST fields, although I did find this is only for standard parent fields (which are part of the Report Type). Object fields are specified in the 'normal' approach.
The three filters added to the Report and ... |
1,872,744 | I want to build a search engine that is similar to Wolfram Alpha. I want to insert a query and receive a response from a dedicated database, or multiple databases for multiple responses. Up until this point I know HTML + CSS, but I am mostly focused on design. I want to expand my skill set and create a web application ... | 2009/12/09 | [
"https://Stackoverflow.com/questions/1872744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/227838/"
] | As a deleted post here says, WA is by no means a simple search engine. Even a good simple search engine (read: google, et al) is by no means simple. Wolfram Alpha is fathoms more complex.
At the very least, you're going to need a proper programming language and you're going to need to know it. *I* would stay as far aw... | I'm with Oli here. If you want to make a Wolfram Alpha style system, go to school and get a compsci degree, even better if you study up to PhD level. Then partner up with similarly well educated experts from other fields such as mathematics and natural language processing.
Please do not misconstrue my response as bein... |
23,707,620 | Removing characters between single quotes. I am trying this.
If I entered `sa' or '1'='1` then output should be `' or ' '='`.
I am working on sql injection project. What they require is removing characters from single quotes.
By using prepared statement we can prevent injection. But before that I want to remove char... | 2014/05/17 | [
"https://Stackoverflow.com/questions/23707620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3201607/"
] | You could do something like this, read each `char` one by one in the string in a loop and check if that character is `'` If it is then keep on deleting the following characters in the string until the `'` character comes again...
The pseudo code will be like this:
```
char string(10)="Da`ks`H"
for(int x=0, x<string_l... | I think this is the best way,
```
public static String removeUntil(String str, String c, int st)
{
StringBuilder sb = new StringBuilder(str);
str = sb.reverse().toString();
for(int i = 0;i<st;i++)
str = str.substring(0,str.lastIndexOf(c));
sb = new StringBuilder(str);
str = sb.reverse().toS... |
23,707,620 | Removing characters between single quotes. I am trying this.
If I entered `sa' or '1'='1` then output should be `' or ' '='`.
I am working on sql injection project. What they require is removing characters from single quotes.
By using prepared statement we can prevent injection. But before that I want to remove char... | 2014/05/17 | [
"https://Stackoverflow.com/questions/23707620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3201607/"
] | You could do something like this, read each `char` one by one in the string in a loop and check if that character is `'` If it is then keep on deleting the following characters in the string until the `'` character comes again...
The pseudo code will be like this:
```
char string(10)="Da`ks`H"
for(int x=0, x<string_l... | This is a simple implementation for removing specific characters from a string. The time complexity is O(n + m).
Note: This is only for ASCII characters.
```
String s = "Battle 123";
String remove = "e1";
System.out.println(removeCharacters(s,remove));
public static String removeCharacters(String sentence, String r... |
23,707,620 | Removing characters between single quotes. I am trying this.
If I entered `sa' or '1'='1` then output should be `' or ' '='`.
I am working on sql injection project. What they require is removing characters from single quotes.
By using prepared statement we can prevent injection. But before that I want to remove char... | 2014/05/17 | [
"https://Stackoverflow.com/questions/23707620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3201607/"
] | Not quite sure what you are doing with your code . Code will never enter `else if(j%4==0)` block because if this condition is true then `else if(j%2==0)` will obviously be true.
If you just want to skip characters between single quotes use a boolean flag. Set it to true at index it is encountered and set it to false ... | I think this is the best way,
```
public static String removeUntil(String str, String c, int st)
{
StringBuilder sb = new StringBuilder(str);
str = sb.reverse().toString();
for(int i = 0;i<st;i++)
str = str.substring(0,str.lastIndexOf(c));
sb = new StringBuilder(str);
str = sb.reverse().toS... |
23,707,620 | Removing characters between single quotes. I am trying this.
If I entered `sa' or '1'='1` then output should be `' or ' '='`.
I am working on sql injection project. What they require is removing characters from single quotes.
By using prepared statement we can prevent injection. But before that I want to remove char... | 2014/05/17 | [
"https://Stackoverflow.com/questions/23707620",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3201607/"
] | Not quite sure what you are doing with your code . Code will never enter `else if(j%4==0)` block because if this condition is true then `else if(j%2==0)` will obviously be true.
If you just want to skip characters between single quotes use a boolean flag. Set it to true at index it is encountered and set it to false ... | This is a simple implementation for removing specific characters from a string. The time complexity is O(n + m).
Note: This is only for ASCII characters.
```
String s = "Battle 123";
String remove = "e1";
System.out.println(removeCharacters(s,remove));
public static String removeCharacters(String sentence, String r... |
34,621,161 | I like to create a ratio between 0-1 of how "colorful" a color is, by colorful i mean:
* Black colors have ratio 0 (no light)
* White colors have ratio 0 (no saturation)
* A fully saturated / lighted color has ratio 1
i tried by converting the color to HSV colorspace and calculating the ratio as:
```
ratio = (color... | 2016/01/05 | [
"https://Stackoverflow.com/questions/34621161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/246234/"
] | The definition of saturation from HSV is not what you want, because it does not compensate for the lightness of the color.
From [the Wikipedia article on Colorfulness](https://en.wikipedia.org/wiki/Colorfulness):
>
> [Perceived saturation] is the proportion of pure chromatic color in the total color sensation.
>
> ... | As a simple approximation, you could use `max(r,g,b)/255 - min(r,g,b)/255`. It has the properties you seek, where anything on the gray spectrum between black and white has a colorfulness of 0, and only fully lit colors will have a colorfulness of 1. A fully saturated but dark color will be in between, e.g. (128, 0, 0) ... |
67,452,318 | Here is the code. I tried to give this parameter 'False' value by using
```
python file.py --add_depth_loss False
```
but it still print "True".... Why is that?
```
from absl import flags, app
FLAGS = flags.FLAGS
flags.DEFINE_boolean('add_depth_loss', None, 'sss')
flags.mark_flag_as_required('add_depth_loss')
def... | 2021/05/08 | [
"https://Stackoverflow.com/questions/67452318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12128237/"
] | After some research, I found that the `bool` or `boolean` flag is not used this way. It's actually a "set True" option. If you want to set `False` you need to do `---option=false` instead of `--option False` like other types, otherwise it always return `True`.
Even if you set
```
flags.bool('option', None, 'xxx')
fla... | Just adding more context from the documentation <https://abseil.io/docs/python/guides/flags>
*DEFINE\_bool or DEFINE\_boolean: typically does not take an argument: pass --myflag to set FLAGS.myflag to True, or --nomyflag to set FLAGS.myflag to False. --myflag=true and --myflag=false are also supported, but not recomme... |
67,452,318 | Here is the code. I tried to give this parameter 'False' value by using
```
python file.py --add_depth_loss False
```
but it still print "True".... Why is that?
```
from absl import flags, app
FLAGS = flags.FLAGS
flags.DEFINE_boolean('add_depth_loss', None, 'sss')
flags.mark_flag_as_required('add_depth_loss')
def... | 2021/05/08 | [
"https://Stackoverflow.com/questions/67452318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12128237/"
] | After some research, I found that the `bool` or `boolean` flag is not used this way. It's actually a "set True" option. If you want to set `False` you need to do `---option=false` instead of `--option False` like other types, otherwise it always return `True`.
Even if you set
```
flags.bool('option', None, 'xxx')
fla... | Use `python file.py --noadd_depth_loss` instead to set `add_depth_loss` to `False`. |
386,492 | I was asked by a client to install Windows XP on three partitions on his PC. He wants them to all be original. My question:
**Will the same Original XP installation work (get registered/ activated) on all the partitions?**
or
**Do I need three Original XP licenses?**
Note: *Original means Licensed*
I don't want to... | 2012/02/06 | [
"https://superuser.com/questions/386492",
"https://superuser.com",
"https://superuser.com/users/104027/"
] | Yes, as long as only one install is being used on one machine at any time. Here's the EULA:
[Windows XP EULA](http://download.microsoft.com/documents/useterms/Windows%20XP_Professional_English_9e8a2f82-c320-4301-869f-839a853868a1.pdf)
In the section about storing images of XP on a network, it says you need to have one... | This will work in theory, but you only get a max of I think its 3 activations so after that you would have to ring up Microsoft and beg for more. As long as the three installations are not running at the same time this should be ok, I wouldn't like to say how you would stand on the licence terms doing this but as far a... |
386,492 | I was asked by a client to install Windows XP on three partitions on his PC. He wants them to all be original. My question:
**Will the same Original XP installation work (get registered/ activated) on all the partitions?**
or
**Do I need three Original XP licenses?**
Note: *Original means Licensed*
I don't want to... | 2012/02/06 | [
"https://superuser.com/questions/386492",
"https://superuser.com",
"https://superuser.com/users/104027/"
] | As stated in the [XP Pro EULA](http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDEQFjAA&url=http://download.microsoft.com/documents/useterms/windows%2520xp_professional_english_9e8a2f82-c320-4301-869f-839a853868a1.pdf&ei=HMUvT5T9H86ftwe0j5nfDw&usg=AFQjCNF2iJM6PcB4eiW1nhTifw9K-iSfWA)
```
Installatio... | This will work in theory, but you only get a max of I think its 3 activations so after that you would have to ring up Microsoft and beg for more. As long as the three installations are not running at the same time this should be ok, I wouldn't like to say how you would stand on the licence terms doing this but as far a... |
386,492 | I was asked by a client to install Windows XP on three partitions on his PC. He wants them to all be original. My question:
**Will the same Original XP installation work (get registered/ activated) on all the partitions?**
or
**Do I need three Original XP licenses?**
Note: *Original means Licensed*
I don't want to... | 2012/02/06 | [
"https://superuser.com/questions/386492",
"https://superuser.com",
"https://superuser.com/users/104027/"
] | As stated in the [XP Pro EULA](http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDEQFjAA&url=http://download.microsoft.com/documents/useterms/windows%2520xp_professional_english_9e8a2f82-c320-4301-869f-839a853868a1.pdf&ei=HMUvT5T9H86ftwe0j5nfDw&usg=AFQjCNF2iJM6PcB4eiW1nhTifw9K-iSfWA)
```
Installatio... | Yes, as long as only one install is being used on one machine at any time. Here's the EULA:
[Windows XP EULA](http://download.microsoft.com/documents/useterms/Windows%20XP_Professional_English_9e8a2f82-c320-4301-869f-839a853868a1.pdf)
In the section about storing images of XP on a network, it says you need to have one... |
9,557,503 | When i run this command
>
> sudo /etc/init.d/httpd restart
>
>
>
it gives below error
Stopping httpd: [FAILED]
Starting httpd: (98)Address already in use: make\_sock: could not bind to address [::]:80
(98)Address already in use: make\_sock: could not bind to address 0.0.0.0:80
no listening sockets available, s... | 2012/03/04 | [
"https://Stackoverflow.com/questions/9557503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/848556/"
] | I ran into this problem when I installed apache from source, but then tried to run
```
$ sudo /etc/init.d/httpd restart
```
which was using a pre-installed version of apache. The stop directive in /etc/init.d/httpd was not removing the httpd.pid file that was created when starting the source-installed version of ap... | I feel its better to kill the process itself, find out the process id and kill it and then do a fresh start, it should work fine |
9,557,503 | When i run this command
>
> sudo /etc/init.d/httpd restart
>
>
>
it gives below error
Stopping httpd: [FAILED]
Starting httpd: (98)Address already in use: make\_sock: could not bind to address [::]:80
(98)Address already in use: make\_sock: could not bind to address 0.0.0.0:80
no listening sockets available, s... | 2012/03/04 | [
"https://Stackoverflow.com/questions/9557503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/848556/"
] | I tried this and it works:
1. sudo fuser -k -n tcp 80
2. sudo service httpd start
Hope this will help you!
Cheers | I feel its better to kill the process itself, find out the process id and kill it and then do a fresh start, it should work fine |
9,557,503 | When i run this command
>
> sudo /etc/init.d/httpd restart
>
>
>
it gives below error
Stopping httpd: [FAILED]
Starting httpd: (98)Address already in use: make\_sock: could not bind to address [::]:80
(98)Address already in use: make\_sock: could not bind to address 0.0.0.0:80
no listening sockets available, s... | 2012/03/04 | [
"https://Stackoverflow.com/questions/9557503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/848556/"
] | I feel its better to kill the process itself, find out the process id and kill it and then do a fresh start, it should work fine | I have had this issue very rarely over the last couple years with a server I've been managing. Unfortunately, if you are getting FAILED after trying to restart, the process that's managing the connection on port 80 won't release it's hold on that port.
I would try a full "sudo /etc/init.d/httpd stop" wait for that to ... |
9,557,503 | When i run this command
>
> sudo /etc/init.d/httpd restart
>
>
>
it gives below error
Stopping httpd: [FAILED]
Starting httpd: (98)Address already in use: make\_sock: could not bind to address [::]:80
(98)Address already in use: make\_sock: could not bind to address 0.0.0.0:80
no listening sockets available, s... | 2012/03/04 | [
"https://Stackoverflow.com/questions/9557503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/848556/"
] | I ran into this problem when I installed apache from source, but then tried to run
```
$ sudo /etc/init.d/httpd restart
```
which was using a pre-installed version of apache. The stop directive in /etc/init.d/httpd was not removing the httpd.pid file that was created when starting the source-installed version of ap... | I tried this and it works:
1. sudo fuser -k -n tcp 80
2. sudo service httpd start
Hope this will help you!
Cheers |
9,557,503 | When i run this command
>
> sudo /etc/init.d/httpd restart
>
>
>
it gives below error
Stopping httpd: [FAILED]
Starting httpd: (98)Address already in use: make\_sock: could not bind to address [::]:80
(98)Address already in use: make\_sock: could not bind to address 0.0.0.0:80
no listening sockets available, s... | 2012/03/04 | [
"https://Stackoverflow.com/questions/9557503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/848556/"
] | I ran into this problem when I installed apache from source, but then tried to run
```
$ sudo /etc/init.d/httpd restart
```
which was using a pre-installed version of apache. The stop directive in /etc/init.d/httpd was not removing the httpd.pid file that was created when starting the source-installed version of ap... | I have had this issue very rarely over the last couple years with a server I've been managing. Unfortunately, if you are getting FAILED after trying to restart, the process that's managing the connection on port 80 won't release it's hold on that port.
I would try a full "sudo /etc/init.d/httpd stop" wait for that to ... |
9,557,503 | When i run this command
>
> sudo /etc/init.d/httpd restart
>
>
>
it gives below error
Stopping httpd: [FAILED]
Starting httpd: (98)Address already in use: make\_sock: could not bind to address [::]:80
(98)Address already in use: make\_sock: could not bind to address 0.0.0.0:80
no listening sockets available, s... | 2012/03/04 | [
"https://Stackoverflow.com/questions/9557503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/848556/"
] | I tried this and it works:
1. sudo fuser -k -n tcp 80
2. sudo service httpd start
Hope this will help you!
Cheers | I have had this issue very rarely over the last couple years with a server I've been managing. Unfortunately, if you are getting FAILED after trying to restart, the process that's managing the connection on port 80 won't release it's hold on that port.
I would try a full "sudo /etc/init.d/httpd stop" wait for that to ... |
63,727,598 | **edit 00:** *NOTE:*
This message is coming from the GraphiQL interface. When I tried the same query in the 'Banana Cake Pop' UI, no message is returned when I execute this query.
---
While trying to create a GraphQL subscription on an ASP.NET web server, using Hot Chocolate, with exactly the same code found in [this... | 2020/09/03 | [
"https://Stackoverflow.com/questions/63727598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2748567/"
] | I had the same error when try to call subscription from code(FE: react, BE: .net core). And probelm was that I call subscription via http... Subscription works via WebSocket.
So check if you app call subscription wia WEbSocket.
Here you can see how to configure client to split request between http and ws : <https://git... | **The question topic error message only shows up in GraphiQL**
TL;DR:
*I resolved this issue by using a .Net Core 3.0 Console Application, instead of a ASP.NET Web Application Project Type.*
Even though GraphiQL is the only editor which returns the above message, the problem remains regardless of how you try to consu... |
19,970,938 | I know this might be a dummy question or a question that comes from lack of knowledge, but I hope someone can still answer it. I did try to read a lot of Postfix documentation but found no answer to this. I don't even know if it's a Postfix specific or mail servers general question.
So I have a mail server, just a cle... | 2013/11/14 | [
"https://Stackoverflow.com/questions/19970938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1064121/"
] | Postfix itself does not place copies of sent messages anywhere; it receives messages and delivers them to the recipient. Saving sent messages to your own mailbox is the responsibility of your user agent (Thunderbird, in your case).
It's important to understand that Postfix (and other traditional Unix SMTP servers) don... | I am running a Installation with automatic copies created by sender\_bcc\_maps. It's working fine. You have to check the sender, otherwise everyone can create sent mails in foreign sent folders.
I have solved it with two virtual domains. One for the user and one for the copy.
But there is a big problem with sender\_b... |
19,970,938 | I know this might be a dummy question or a question that comes from lack of knowledge, but I hope someone can still answer it. I did try to read a lot of Postfix documentation but found no answer to this. I don't even know if it's a Postfix specific or mail servers general question.
So I have a mail server, just a cle... | 2013/11/14 | [
"https://Stackoverflow.com/questions/19970938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1064121/"
] | Postfix itself does not place copies of sent messages anywhere; it receives messages and delivers them to the recipient. Saving sent messages to your own mailbox is the responsibility of your user agent (Thunderbird, in your case).
It's important to understand that Postfix (and other traditional Unix SMTP servers) don... | As 'ego2dot0' said above, you don't need any MDA filters (sieve etc.) to do this. It can be done using Postfix alone, although it took me a while to figure out how to do it.
You have to use **sender\_bcc\_maps** AND **virtual\_mailbox\_maps** features together.
You have to use a virtual domain dedicated specially for... |
19,970,938 | I know this might be a dummy question or a question that comes from lack of knowledge, but I hope someone can still answer it. I did try to read a lot of Postfix documentation but found no answer to this. I don't even know if it's a Postfix specific or mail servers general question.
So I have a mail server, just a cle... | 2013/11/14 | [
"https://Stackoverflow.com/questions/19970938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1064121/"
] | Just for the record, having searched around for a how to, and not finding one, I am posting it here:
The only (easy) way I've found to save sent emails is the sender\_bcc solution (with it's attendant faults):
I am using postfix / dovecot / sieve / mysql virtual boxes
In /etc/postfix/main.cf add:
```
sender_bcc_map... | I am running a Installation with automatic copies created by sender\_bcc\_maps. It's working fine. You have to check the sender, otherwise everyone can create sent mails in foreign sent folders.
I have solved it with two virtual domains. One for the user and one for the copy.
But there is a big problem with sender\_b... |
19,970,938 | I know this might be a dummy question or a question that comes from lack of knowledge, but I hope someone can still answer it. I did try to read a lot of Postfix documentation but found no answer to this. I don't even know if it's a Postfix specific or mail servers general question.
So I have a mail server, just a cle... | 2013/11/14 | [
"https://Stackoverflow.com/questions/19970938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1064121/"
] | Just for the record, having searched around for a how to, and not finding one, I am posting it here:
The only (easy) way I've found to save sent emails is the sender\_bcc solution (with it's attendant faults):
I am using postfix / dovecot / sieve / mysql virtual boxes
In /etc/postfix/main.cf add:
```
sender_bcc_map... | As 'ego2dot0' said above, you don't need any MDA filters (sieve etc.) to do this. It can be done using Postfix alone, although it took me a while to figure out how to do it.
You have to use **sender\_bcc\_maps** AND **virtual\_mailbox\_maps** features together.
You have to use a virtual domain dedicated specially for... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.