qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
19,796,235 | I'm new to Android programming and working with Retrofit. I've done a bunch of research on this topic, but haven't been able to find a solution specific to my needs. I'm working with our API and trying to make a POST request. I successfully achieved this with the following non-Retrofit code:
```
private class Proc... | 2013/11/05 | [
"https://Stackoverflow.com/questions/19796235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2957545/"
] | One of the benefits of Retrofit is not having to parse the JSON yourself. You should have something like:
```
service.login(email, password, new Callback<User>() {
@Override
public void failure(final RetrofitError error) {
android.util.Log.i("example", "Error, body: " + error.getBody().toS... | Seem Retrofit have problem with `@POST` and `@FormUrlEncoded`. It works well if we do synchronous but failed if asynchronous.
If @mike problem is deserialization object, User class should be
```
public class User {
@SerializedName("name")
String name;
@SerializedName("email")
String email;
}
``... |
93,391 | I am designing a campaign and I have a couple of evil power blocs vying for control. I would really like to have one of them directly interacting with the party and I think I really want it to be a devil because I love the idea of the lawful evil tricking them while still being true to its word.
So my question would i... | 2017/01/18 | [
"https://rpg.stackexchange.com/questions/93391",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/29455/"
] | Consider Titivilus
==================
Mordenkainen’s Tome of Foes includes a number of devils that you can draw on for your campaign. One of these is [Titivilus](https://www.dndbeyond.com/monsters/titivilus) who can innately cast [*Alter Self*](https://www.dndbeyond.com/spells/alter-self) and [*Nondetection*](https://... | Would [Shapechange](http://engl393-dnd5th.wikia.com/wiki/Shapechange) go? It only lasts for an hour, but the caster can transform into any creature with same or lower challenge rating. Limitations are "not a construct or an undead, no class levels or the Spellcasting trait, and you must have seen the sort of creature a... |
93,391 | I am designing a campaign and I have a couple of evil power blocs vying for control. I would really like to have one of them directly interacting with the party and I think I really want it to be a devil because I love the idea of the lawful evil tricking them while still being true to its word.
So my question would i... | 2017/01/18 | [
"https://rpg.stackexchange.com/questions/93391",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/29455/"
] | Why not try using the disguise of an entirely different person?
In the MM, all the stronger devils seem to have telepathy of 120ft. They could use their telepathy in order to communicate through another person that is in service to the devil. I think it would make sense that a higher more prestigious devil would empl... | A hat of disguise could easily allow an erinyes pass off as an aarakocra or winged elf, either of which would stand out in a crowd, but wouldn't be barred entrance to a city. |
93,391 | I am designing a campaign and I have a couple of evil power blocs vying for control. I would really like to have one of them directly interacting with the party and I think I really want it to be a devil because I love the idea of the lawful evil tricking them while still being true to its word.
So my question would i... | 2017/01/18 | [
"https://rpg.stackexchange.com/questions/93391",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/29455/"
] | You had requested no homebrew creatures, and I'm not sure this qualifies as homebrew or just refluff, but you could easily take the Deva (MM pp16) and have it be "fallen" (think Lucifer.)
Instead of an Angel, it is a Fallen Angel, but still has all of the attributes which allows for Change Shape with everything you'r... | A hat of disguise could easily allow an erinyes pass off as an aarakocra or winged elf, either of which would stand out in a crowd, but wouldn't be barred entrance to a city. |
93,391 | I am designing a campaign and I have a couple of evil power blocs vying for control. I would really like to have one of them directly interacting with the party and I think I really want it to be a devil because I love the idea of the lawful evil tricking them while still being true to its word.
So my question would i... | 2017/01/18 | [
"https://rpg.stackexchange.com/questions/93391",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/29455/"
] | Consider Titivilus
==================
Mordenkainen’s Tome of Foes includes a number of devils that you can draw on for your campaign. One of these is [Titivilus](https://www.dndbeyond.com/monsters/titivilus) who can innately cast [*Alter Self*](https://www.dndbeyond.com/spells/alter-self) and [*Nondetection*](https://... | When you say 'devil', would *any* devil do? If so, and given your "anything else that would normally interact with a party around a town" then - for a given definition of "interact" an imp works. It's technically a devil and can shapechange at will into a spider, rat or raven, all of which can be encountered in a town ... |
93,391 | I am designing a campaign and I have a couple of evil power blocs vying for control. I would really like to have one of them directly interacting with the party and I think I really want it to be a devil because I love the idea of the lawful evil tricking them while still being true to its word.
So my question would i... | 2017/01/18 | [
"https://rpg.stackexchange.com/questions/93391",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/29455/"
] | Consider Titivilus
==================
Mordenkainen’s Tome of Foes includes a number of devils that you can draw on for your campaign. One of these is [Titivilus](https://www.dndbeyond.com/monsters/titivilus) who can innately cast [*Alter Self*](https://www.dndbeyond.com/spells/alter-self) and [*Nondetection*](https://... | A hat of disguise could easily allow an erinyes pass off as an aarakocra or winged elf, either of which would stand out in a crowd, but wouldn't be barred entrance to a city. |
93,391 | I am designing a campaign and I have a couple of evil power blocs vying for control. I would really like to have one of them directly interacting with the party and I think I really want it to be a devil because I love the idea of the lawful evil tricking them while still being true to its word.
So my question would i... | 2017/01/18 | [
"https://rpg.stackexchange.com/questions/93391",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/29455/"
] | Hide in plain sight. There are two good options for this:
**Erinyes** Based on the picture on MM 73, these creatures are mostly humanoid, but have wings. The horns on the helmet may or may not cover any natural horns; it's unclear. Either way, you could throw on a cloak to hide your wings, then claim to be a Tiefling.... | When you say 'devil', would *any* devil do? If so, and given your "anything else that would normally interact with a party around a town" then - for a given definition of "interact" an imp works. It's technically a devil and can shapechange at will into a spider, rat or raven, all of which can be encountered in a town ... |
93,391 | I am designing a campaign and I have a couple of evil power blocs vying for control. I would really like to have one of them directly interacting with the party and I think I really want it to be a devil because I love the idea of the lawful evil tricking them while still being true to its word.
So my question would i... | 2017/01/18 | [
"https://rpg.stackexchange.com/questions/93391",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/29455/"
] | Hide in plain sight. There are two good options for this:
**Erinyes** Based on the picture on MM 73, these creatures are mostly humanoid, but have wings. The horns on the helmet may or may not cover any natural horns; it's unclear. Either way, you could throw on a cloak to hide your wings, then claim to be a Tiefling.... | Would [Shapechange](http://engl393-dnd5th.wikia.com/wiki/Shapechange) go? It only lasts for an hour, but the caster can transform into any creature with same or lower challenge rating. Limitations are "not a construct or an undead, no class levels or the Spellcasting trait, and you must have seen the sort of creature a... |
93,391 | I am designing a campaign and I have a couple of evil power blocs vying for control. I would really like to have one of them directly interacting with the party and I think I really want it to be a devil because I love the idea of the lawful evil tricking them while still being true to its word.
So my question would i... | 2017/01/18 | [
"https://rpg.stackexchange.com/questions/93391",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/29455/"
] | You had requested no homebrew creatures, and I'm not sure this qualifies as homebrew or just refluff, but you could easily take the Deva (MM pp16) and have it be "fallen" (think Lucifer.)
Instead of an Angel, it is a Fallen Angel, but still has all of the attributes which allows for Change Shape with everything you'r... | Would [Shapechange](http://engl393-dnd5th.wikia.com/wiki/Shapechange) go? It only lasts for an hour, but the caster can transform into any creature with same or lower challenge rating. Limitations are "not a construct or an undead, no class levels or the Spellcasting trait, and you must have seen the sort of creature a... |
93,391 | I am designing a campaign and I have a couple of evil power blocs vying for control. I would really like to have one of them directly interacting with the party and I think I really want it to be a devil because I love the idea of the lawful evil tricking them while still being true to its word.
So my question would i... | 2017/01/18 | [
"https://rpg.stackexchange.com/questions/93391",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/29455/"
] | You had requested no homebrew creatures, and I'm not sure this qualifies as homebrew or just refluff, but you could easily take the Deva (MM pp16) and have it be "fallen" (think Lucifer.)
Instead of an Angel, it is a Fallen Angel, but still has all of the attributes which allows for Change Shape with everything you'r... | When you say 'devil', would *any* devil do? If so, and given your "anything else that would normally interact with a party around a town" then - for a given definition of "interact" an imp works. It's technically a devil and can shapechange at will into a spider, rat or raven, all of which can be encountered in a town ... |
93,391 | I am designing a campaign and I have a couple of evil power blocs vying for control. I would really like to have one of them directly interacting with the party and I think I really want it to be a devil because I love the idea of the lawful evil tricking them while still being true to its word.
So my question would i... | 2017/01/18 | [
"https://rpg.stackexchange.com/questions/93391",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/29455/"
] | Hide in plain sight. There are two good options for this:
**Erinyes** Based on the picture on MM 73, these creatures are mostly humanoid, but have wings. The horns on the helmet may or may not cover any natural horns; it's unclear. Either way, you could throw on a cloak to hide your wings, then claim to be a Tiefling.... | Why not try using the disguise of an entirely different person?
In the MM, all the stronger devils seem to have telepathy of 120ft. They could use their telepathy in order to communicate through another person that is in service to the devil. I think it would make sense that a higher more prestigious devil would empl... |
16,849,302 | I want to start my `MainActivity` with a new `Intent` in my other `Activity`. The two Activities are in the same app, and the second Activity is actually started from the MainActivity. So the scenario is like this:
1. MainActivity is created with an Intent
2. MainActivity starts SecondActivity (but MainActivity is not... | 2013/05/31 | [
"https://Stackoverflow.com/questions/16849302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/869330/"
] | Create a table with single autoincrement column.
When you need another unique id - just insert `null` into that column and retrieve last insert id.
For oracle - create a sequence and use `SELECT sequence_name.nextval` FROM DUAL`
For sql server - create a sequence and fetch it with `NEXT VALUE FOR` | In SQL Server to generate truly unique ID I suggest using GUID, e.g.:
```
DECLARE @UniqueID uniqueidentifier
SET @UniqueID = NEWID()
``` |
107,980 | I took a bunch of screenshots and I want to make them pages in a single PDF. Selecting all four in Preview and exporting to PDF only exports two (?), separately. The "Export to PDF" File menu function adds a strange white border around the screenshots (and orients the page as portrait). So I converted each to PDFs indi... | 2013/11/01 | [
"https://apple.stackexchange.com/questions/107980",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/21351/"
] | You can use the `convert` command if you install **ImageMagick**. ImageMagick isn't always a simple install, but if you install Xcode and [Homebrew](http://brew.sh) it should be fairly painless.
`convert *.png foobar.pdf`
<http://www.imagemagick.org/script/convert.php> | There is an Automator action - **New PDF from images**. It creates a single multi-page document from input images. You can create a workflow or app that would process your images that you drop onto it.
If I create an application in Automator with that single action, I can drop my images onto it, and it'll create a PDF... |
107,980 | I took a bunch of screenshots and I want to make them pages in a single PDF. Selecting all four in Preview and exporting to PDF only exports two (?), separately. The "Export to PDF" File menu function adds a strange white border around the screenshots (and orients the page as portrait). So I converted each to PDFs indi... | 2013/11/01 | [
"https://apple.stackexchange.com/questions/107980",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/21351/"
] | You can use the `convert` command if you install **ImageMagick**. ImageMagick isn't always a simple install, but if you install Xcode and [Homebrew](http://brew.sh) it should be fairly painless.
`convert *.png foobar.pdf`
<http://www.imagemagick.org/script/convert.php> | Preview's "Export As PDF..." places the converted image onto the default paper size, e.g. A4 or US Letter. That's why you get the "strange white border" around the image.
Using Preview's "Export..." menu item, and selecting PDF as the format will merely convert the image to PDF without placing it on a page.
Apple's A... |
107,980 | I took a bunch of screenshots and I want to make them pages in a single PDF. Selecting all four in Preview and exporting to PDF only exports two (?), separately. The "Export to PDF" File menu function adds a strange white border around the screenshots (and orients the page as portrait). So I converted each to PDFs indi... | 2013/11/01 | [
"https://apple.stackexchange.com/questions/107980",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/21351/"
] | There is an Automator action - **New PDF from images**. It creates a single multi-page document from input images. You can create a workflow or app that would process your images that you drop onto it.
If I create an application in Automator with that single action, I can drop my images onto it, and it'll create a PDF... | Preview's "Export As PDF..." places the converted image onto the default paper size, e.g. A4 or US Letter. That's why you get the "strange white border" around the image.
Using Preview's "Export..." menu item, and selecting PDF as the format will merely convert the image to PDF without placing it on a page.
Apple's A... |
54,439,830 | How will i set selected value=Booking.
```js
$('#status').val("Booking");
```
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select name="status" class="form-control">
<option value="" id="status">New</option>
<option value="">Follow</option>
<option ... | 2019/01/30 | [
"https://Stackoverflow.com/questions/54439830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10954362/"
] | try to follow the below example. there is no booking option in your select add it like below code
```
$('#mySelect')
.append($("<option></option>")
.attr("value",key)
.text("Booking"));
``` | Try this:
```
<select id="status" class="form-control">
<option value="">New</option>
<option value="">Follow</option>
<option value="">DND</option>
<option value="">Dead</option>
<option value="Booking">Booking</option>
</select>
```
and the script should be:
```
$(document).ready(function() {
$(... |
54,439,830 | How will i set selected value=Booking.
```js
$('#status').val("Booking");
```
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select name="status" class="form-control">
<option value="" id="status">New</option>
<option value="">Follow</option>
<option ... | 2019/01/30 | [
"https://Stackoverflow.com/questions/54439830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10954362/"
] | try to follow the below example. there is no booking option in your select add it like below code
```
$('#mySelect')
.append($("<option></option>")
.attr("value",key)
.text("Booking"));
``` | There should be any value of option like below so when you want to select booking option. so according to me it should be like that please check Is that matching with your requirement.`<option value="new">New</option>` |
13,177,124 | In a Hashmap the hash code of the key provided is used to place the value in the hashtable. In a Hashset the obects hashcode is used to place the value in the underlying hashtable. i.e the advantage of the hashmap is that you have the flexibility of deciding what you want as the key so you can do nice things like this.... | 2012/11/01 | [
"https://Stackoverflow.com/questions/13177124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1701264/"
] | In your example, the keys are String which are immutable. So the hashcode of the keys won't change. What happens when the hashcode of the keys changes is undefined and leads to "weird" behaviour. See the example below, which prints 1, false and 2. The object remains in the set, but the set looks like it is broken (cont... | The `HashSet` is backed up by a `HashMap`.
From the **javadocs**.
>
> This class implements the Set interface, backed by a hash table
> (actually a HashMap instance).
>
>
>
So if you **change** the hashcode, I doubt whether you can access the object.
Internal Implementation Details
---------------------------... |
13,177,124 | In a Hashmap the hash code of the key provided is used to place the value in the hashtable. In a Hashset the obects hashcode is used to place the value in the underlying hashtable. i.e the advantage of the hashmap is that you have the flexibility of deciding what you want as the key so you can do nice things like this.... | 2012/11/01 | [
"https://Stackoverflow.com/questions/13177124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1701264/"
] | In your example, a String is immutable so its hashcode cannot change. But hypothetically, if the hashcode of an object did change while was a key in a hash table, then it would *probably disappear* as far as hashtable lookups were concerned. I went into more detail in this Answer to a related question: <https://stackov... | The `HashSet` is backed up by a `HashMap`.
From the **javadocs**.
>
> This class implements the Set interface, backed by a hash table
> (actually a HashMap instance).
>
>
>
So if you **change** the hashcode, I doubt whether you can access the object.
Internal Implementation Details
---------------------------... |
13,177,124 | In a Hashmap the hash code of the key provided is used to place the value in the hashtable. In a Hashset the obects hashcode is used to place the value in the underlying hashtable. i.e the advantage of the hashmap is that you have the flexibility of deciding what you want as the key so you can do nice things like this.... | 2012/11/01 | [
"https://Stackoverflow.com/questions/13177124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1701264/"
] | In your example, the keys are String which are immutable. So the hashcode of the keys won't change. What happens when the hashcode of the keys changes is undefined and leads to "weird" behaviour. See the example below, which prints 1, false and 2. The object remains in the set, but the set looks like it is broken (cont... | With Java's hashes, the original reference is simply not found. It's searched in the bucket corresponding the current hashcode, and not found.
To recover from this after the fact, the Hash keySet must be iterated over, and and any key which is not found by `contains` method must be removed through the iterator. Prefer... |
13,177,124 | In a Hashmap the hash code of the key provided is used to place the value in the hashtable. In a Hashset the obects hashcode is used to place the value in the underlying hashtable. i.e the advantage of the hashmap is that you have the flexibility of deciding what you want as the key so you can do nice things like this.... | 2012/11/01 | [
"https://Stackoverflow.com/questions/13177124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1701264/"
] | In your example, a String is immutable so its hashcode cannot change. But hypothetically, if the hashcode of an object did change while was a key in a hash table, then it would *probably disappear* as far as hashtable lookups were concerned. I went into more detail in this Answer to a related question: <https://stackov... | In your example, the keys are String which are immutable. So the hashcode of the keys won't change. What happens when the hashcode of the keys changes is undefined and leads to "weird" behaviour. See the example below, which prints 1, false and 2. The object remains in the set, but the set looks like it is broken (cont... |
13,177,124 | In a Hashmap the hash code of the key provided is used to place the value in the hashtable. In a Hashset the obects hashcode is used to place the value in the underlying hashtable. i.e the advantage of the hashmap is that you have the flexibility of deciding what you want as the key so you can do nice things like this.... | 2012/11/01 | [
"https://Stackoverflow.com/questions/13177124",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1701264/"
] | In your example, a String is immutable so its hashcode cannot change. But hypothetically, if the hashcode of an object did change while was a key in a hash table, then it would *probably disappear* as far as hashtable lookups were concerned. I went into more detail in this Answer to a related question: <https://stackov... | With Java's hashes, the original reference is simply not found. It's searched in the bucket corresponding the current hashcode, and not found.
To recover from this after the fact, the Hash keySet must be iterated over, and and any key which is not found by `contains` method must be removed through the iterator. Prefer... |
1,780,461 | I have a shared library(.so) that I preload before executing an application and I have a few global data structures in the shared library that the application uses. The application can create other processes say using fork() and these processes can update the global data structures in the shared library. I would like t... | 2009/11/22 | [
"https://Stackoverflow.com/questions/1780461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/216682/"
] | To phrase this most clearly: you cannot do exactly what you asked. Linux does not support sharing of global variables that are laid out by the linker. That memory will be in unsharable mapped-to-swap space.
A general recipe I can offer is this:
1. define a struct that lays out your data. No Pointers! Just offsets.
2.... | How about creating a simple pipe in a known directory location, then get other processes to fopen the pipe for reading/writing a la fread/fwrite respectively, to share data...the tricky part is ensuring that the data is passed through the pipe in a manner not to cause corruption in this case. The above you mentioned us... |
1,780,461 | I have a shared library(.so) that I preload before executing an application and I have a few global data structures in the shared library that the application uses. The application can create other processes say using fork() and these processes can update the global data structures in the shared library. I would like t... | 2009/11/22 | [
"https://Stackoverflow.com/questions/1780461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/216682/"
] | If you only want to share the data with and among descendent processes (and not with arbitrary processes that are started up seperately, that just happen to link to the same shared library), then the easiest way to do this is have the library create a mapping with `mmap()` in a constructor function (that is called when... | How about creating a simple pipe in a known directory location, then get other processes to fopen the pipe for reading/writing a la fread/fwrite respectively, to share data...the tricky part is ensuring that the data is passed through the pipe in a manner not to cause corruption in this case. The above you mentioned us... |
1,780,461 | I have a shared library(.so) that I preload before executing an application and I have a few global data structures in the shared library that the application uses. The application can create other processes say using fork() and these processes can update the global data structures in the shared library. I would like t... | 2009/11/22 | [
"https://Stackoverflow.com/questions/1780461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/216682/"
] | To phrase this most clearly: you cannot do exactly what you asked. Linux does not support sharing of global variables that are laid out by the linker. That memory will be in unsharable mapped-to-swap space.
A general recipe I can offer is this:
1. define a struct that lays out your data. No Pointers! Just offsets.
2.... | If you only want to share the data with and among descendent processes (and not with arbitrary processes that are started up seperately, that just happen to link to the same shared library), then the easiest way to do this is have the library create a mapping with `mmap()` in a constructor function (that is called when... |
35,573 | I'm looking for all possible sources of clinically tested human SNPs. There is a handful of databases that store SNPs (like dbSNP), but I only need those that have validated presence/absence of phenotypic effects with some additional metadata. Thank you in advance. | 2015/06/27 | [
"https://biology.stackexchange.com/questions/35573",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/13338/"
] | You can search by traits (mostly diseases) for genome wide association, in these databases:
* [Gwasdb2](http://jjwanglab.org/gwasdb)
* [Human genome variation Database](https://gwas.biosciencedbc.jp/): it also links to a Copy number Variation (CNV) database. | Just to make this post a tiny bit more useful, I must add that there are several additional sources I've found:
* UniProt has an open dataset called `humsavar`
* ClinVar database
* HGMD database
* OMIM
* A [paper](http://www.ncbi.nlm.nih.gov/pubmed/25552646) with a manually collected database based on recent publicati... |
73,368,824 | `$ echo file.txt`
```
NAME="Ubuntu" <--- some of this
VERSION="20.04.4 LTS (Focal Fossa)" <--- and some of this
ID=ubuntu
ID_LIKE=debian
VERSION_ID="20.04"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-polic... | 2022/08/16 | [
"https://Stackoverflow.com/questions/73368824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9971404/"
] | With your shown samples try following `awk` code.
```bash
awk -F'"' '/^NAME="/{name=$2;next} /^VERSION="/{print name,$2}' Input_file
```
***Explanation:***
* Setting field separator as `"` for all the lines here.
* Checking condition if line starts with `Name=` then create variable name which has 2nd field. `next` ... | Here is another `awk` solution:
```bash
awk -F '=?"' '$1 == "NAME" {s = $2; next}
$1 == "VERSION" {sub(/ \(.*/, "", $2); print s, $2}' file
Ubuntu 20.04.4 LTS
``` |
44,419,907 | I am trying to integrate a version/source control system with my unity project. [This answer](http://answers.unity3d.com/answers/1251608/view.html) directed me towards using source/version control. (I dont know the difference.)
The answer links to a tutorial which explains creating the repository and pushing it to a ... | 2017/06/07 | [
"https://Stackoverflow.com/questions/44419907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5640537/"
] | This is simple math, the php code does exactly what it looks like it does. Am I missing something?
loop 1:
```
$i = 1
$s = 0 + (2*1 + 5) = 7
```
loop 2:
```
$i = 2
$s = 7 + (2*2 + 5) = 7 + 4 + 5 = 16
```
loop 3:
```
$i = 3
$s = 16 + (2*3 + 5) = 16 + 6 + 5 = 27
```
loop 4:
```
... | N=2;
A=5;
X=3;
S=0;
```
for
I=1 => S (0) = 0 + (2*1+5) = 7
I=2 => S (7) = 7 + (2*2+5) = 16
I=3 => S (16) = 16 + (2*3+5) = 27
I=4 => S (27) = 27 (2*4+5) = 40
``` |
44,419,907 | I am trying to integrate a version/source control system with my unity project. [This answer](http://answers.unity3d.com/answers/1251608/view.html) directed me towards using source/version control. (I dont know the difference.)
The answer links to a tutorial which explains creating the repository and pushing it to a ... | 2017/06/07 | [
"https://Stackoverflow.com/questions/44419907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5640537/"
] | its very simple, since i<=($n+2) the total iterations will be 4.
for first iteration,
```
$i=1 the value of s = 0+(2*1+5) = 7
$i=2 now s = 7+(2*2+5) = 16
$i=3 now s = 16+(2*3+5) = 27
$i=4 now s = 27+(2*4+5) = 40
```
Hope this explains. | N=2;
A=5;
X=3;
S=0;
```
for
I=1 => S (0) = 0 + (2*1+5) = 7
I=2 => S (7) = 7 + (2*2+5) = 16
I=3 => S (16) = 16 + (2*3+5) = 27
I=4 => S (27) = 27 (2*4+5) = 40
``` |
44,419,907 | I am trying to integrate a version/source control system with my unity project. [This answer](http://answers.unity3d.com/answers/1251608/view.html) directed me towards using source/version control. (I dont know the difference.)
The answer links to a tutorial which explains creating the repository and pushing it to a ... | 2017/06/07 | [
"https://Stackoverflow.com/questions/44419907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5640537/"
] | This is simple math, the php code does exactly what it looks like it does. Am I missing something?
loop 1:
```
$i = 1
$s = 0 + (2*1 + 5) = 7
```
loop 2:
```
$i = 2
$s = 7 + (2*2 + 5) = 7 + 4 + 5 = 16
```
loop 3:
```
$i = 3
$s = 16 + (2*3 + 5) = 16 + 6 + 5 = 27
```
loop 4:
```
... | Using pseudo code:
```
n = 2
a = 5
s = 0
for ( i in { 1...4 } ) {
s = s + ( ( 2 * i ) + 5 )
}
```
So we have
```
s = 0 + ( ( 2 * 1 ) + 5 ) = 0 + 7 = 7
s = 7 + ( ( 2 * 2 ) + 5 ) = 7 + 9 = 16
s = 16 + ( ( 2 * 3 ) + 5 ) = 16 + 11 = 27
s = 27 + ( ( 2 * 4 ) + 5 ) = 27 + 13 = 40
``` |
44,419,907 | I am trying to integrate a version/source control system with my unity project. [This answer](http://answers.unity3d.com/answers/1251608/view.html) directed me towards using source/version control. (I dont know the difference.)
The answer links to a tutorial which explains creating the repository and pushing it to a ... | 2017/06/07 | [
"https://Stackoverflow.com/questions/44419907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5640537/"
] | its very simple, since i<=($n+2) the total iterations will be 4.
for first iteration,
```
$i=1 the value of s = 0+(2*1+5) = 7
$i=2 now s = 7+(2*2+5) = 16
$i=3 now s = 16+(2*3+5) = 27
$i=4 now s = 27+(2*4+5) = 40
```
Hope this explains. | Using pseudo code:
```
n = 2
a = 5
s = 0
for ( i in { 1...4 } ) {
s = s + ( ( 2 * i ) + 5 )
}
```
So we have
```
s = 0 + ( ( 2 * 1 ) + 5 ) = 0 + 7 = 7
s = 7 + ( ( 2 * 2 ) + 5 ) = 7 + 9 = 16
s = 16 + ( ( 2 * 3 ) + 5 ) = 16 + 11 = 27
s = 27 + ( ( 2 * 4 ) + 5 ) = 27 + 13 = 40
``` |
44,419,907 | I am trying to integrate a version/source control system with my unity project. [This answer](http://answers.unity3d.com/answers/1251608/view.html) directed me towards using source/version control. (I dont know the difference.)
The answer links to a tutorial which explains creating the repository and pushing it to a ... | 2017/06/07 | [
"https://Stackoverflow.com/questions/44419907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5640537/"
] | This is simple math, the php code does exactly what it looks like it does. Am I missing something?
loop 1:
```
$i = 1
$s = 0 + (2*1 + 5) = 7
```
loop 2:
```
$i = 2
$s = 7 + (2*2 + 5) = 7 + 4 + 5 = 16
```
loop 3:
```
$i = 3
$s = 16 + (2*3 + 5) = 16 + 6 + 5 = 27
```
loop 4:
```
... | This is simple math. s is the sum of for i from 1 to n+2 of 2i+a. This is equal to the twice sum of i plus the sum of a. The latter is clearly worth (n+2)a. The former is twice the sum of integers from 1 to n+2, i.e. 2 \* (n+2)(n+3)/2. The total is thus (n+2)(n+3) + (n+2)a = (n+2)(n+3+a) = (2+2)\*(2+3+5) = 4\*10 = 40. ... |
44,419,907 | I am trying to integrate a version/source control system with my unity project. [This answer](http://answers.unity3d.com/answers/1251608/view.html) directed me towards using source/version control. (I dont know the difference.)
The answer links to a tutorial which explains creating the repository and pushing it to a ... | 2017/06/07 | [
"https://Stackoverflow.com/questions/44419907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5640537/"
] | its very simple, since i<=($n+2) the total iterations will be 4.
for first iteration,
```
$i=1 the value of s = 0+(2*1+5) = 7
$i=2 now s = 7+(2*2+5) = 16
$i=3 now s = 16+(2*3+5) = 27
$i=4 now s = 27+(2*4+5) = 40
```
Hope this explains. | This is simple math. s is the sum of for i from 1 to n+2 of 2i+a. This is equal to the twice sum of i plus the sum of a. The latter is clearly worth (n+2)a. The former is twice the sum of integers from 1 to n+2, i.e. 2 \* (n+2)(n+3)/2. The total is thus (n+2)(n+3) + (n+2)a = (n+2)(n+3+a) = (2+2)\*(2+3+5) = 4\*10 = 40. ... |
4,668,309 | I'm currently implementing a rather large interface and some of its methods are not applicable to the implementation.
Should I do something akin to:
```
/**
* @throws UnsupportedOperationException always. This method is not applicable.
*/
public void fooMethod() {
throw new UnsupportedOperationException("This met... | 2011/01/12 | [
"https://Stackoverflow.com/questions/4668309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73070/"
] | I think that simply depends on the contract defined by the method.
If for example "remove" is not supported by your "List" implementation, you should throw an exception to indicate that this behavior is missing because the client relies on an expected result.
If the feature is optional in the sense that the **contra... | Throw an `UnsupportedOperationException`, definitely. I can't see any benefit in failing silently, unless the method is meant to be a "hint" sort of method.
If you can refactor your interface and split it up a bit, that would probably be cleaner - but I understand that with a legacy codebase this may not be feasible. |
4,668,309 | I'm currently implementing a rather large interface and some of its methods are not applicable to the implementation.
Should I do something akin to:
```
/**
* @throws UnsupportedOperationException always. This method is not applicable.
*/
public void fooMethod() {
throw new UnsupportedOperationException("This met... | 2011/01/12 | [
"https://Stackoverflow.com/questions/4668309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73070/"
] | Throw an `UnsupportedOperationException`, definitely. I can't see any benefit in failing silently, unless the method is meant to be a "hint" sort of method.
If you can refactor your interface and split it up a bit, that would probably be cleaner - but I understand that with a legacy codebase this may not be feasible. | UnsupportedOperationException is better. Otherwise client code cannot distinguish the method is availble or not. |
4,668,309 | I'm currently implementing a rather large interface and some of its methods are not applicable to the implementation.
Should I do something akin to:
```
/**
* @throws UnsupportedOperationException always. This method is not applicable.
*/
public void fooMethod() {
throw new UnsupportedOperationException("This met... | 2011/01/12 | [
"https://Stackoverflow.com/questions/4668309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73070/"
] | I think that simply depends on the contract defined by the method.
If for example "remove" is not supported by your "List" implementation, you should throw an exception to indicate that this behavior is missing because the client relies on an expected result.
If the feature is optional in the sense that the **contra... | UnsupportedOperationException is better. Otherwise client code cannot distinguish the method is availble or not. |
1,745,183 | >
> I want to show that the ideals $(x,y)$ and $(2,x,y)$ of $\mathbb{Z}[x,y]$ are prime ideals.
>
>
>
---
Could you give some hints how we could do that?
Do we have to show that $\mathbb{Z}[x,y]/(x,y)$ and $\mathbb{Z}[x,y]/(2,x,y)$ are integral domains?
How could we do that? Could you give me a hint?
$$$$ ... | 2016/04/16 | [
"https://math.stackexchange.com/questions/1745183",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/80708/"
] | Show that $\mathbb{Z}[x,y]/(x,y)$ is isomorphic to $\mathbb{Z}$ using the evaluation map at $0$ and $\mathbb{Z}[x,y]/(2,x,y)$ is isomorphic $\mathbb{Z}/2\mathbb{Z}$ by reducing the coefficents of the polynomial modulo $2$. In both cases consider the kernel of the map and use the first isomorphism theorem. | The first isomorphism is proved by observing that any polynomial in $\mathbb{Z}[x,y]$ can be written as a sum of a constant term, terms involving nontrivial powers of $x$, and terms involving nontrivial powers of $y$. More explicitly, the ideal $(x,y)$ has all polynomials with constant term $0$, i.e., if $f \in (x,y)$ ... |
160,890 | I have the following MWE
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos \s... | 2014/02/17 | [
"https://tex.stackexchange.com/questions/160890",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/19396/"
] | Or use `\hphantom{{}={}}`:
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos ... | use `\mathrel{...}`
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos \sin\co... |
160,890 | I have the following MWE
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos \s... | 2014/02/17 | [
"https://tex.stackexchange.com/questions/160890",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/19396/"
] | use `\mathrel{...}`
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos \sin\co... | I typically use
```
\begin{align}
... = {} & ... \\
= {} & ... \\
& ...
\end{align}
```
note the set of `{}` between the `=` and the `&` a lot faster to type than `\phantom` and friends |
160,890 | I have the following MWE
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos \s... | 2014/02/17 | [
"https://tex.stackexchange.com/questions/160890",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/19396/"
] | use `\mathrel{...}`
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos \sin\co... | You don't need all the packages loaded; [`amsmath`](http://www.ctan.org/pkg/amsmath) is enough:
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\sum_{i}c_{i}
&= \cos\sin\cos\sin\cos\sin\cos\sin\cos\sin\\
\sum_{i}c_{i}
&= \delta\cos\sin\cos\sin\cos\cos\sin\cos\sin\cos\cos\sin\cos\sin\... |
160,890 | I have the following MWE
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos \s... | 2014/02/17 | [
"https://tex.stackexchange.com/questions/160890",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/19396/"
] | Or use `\hphantom{{}={}}`:
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos ... | I typically use
```
\begin{align}
... = {} & ... \\
= {} & ... \\
& ...
\end{align}
```
note the set of `{}` between the `=` and the `&` a lot faster to type than `\phantom` and friends |
160,890 | I have the following MWE
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos \s... | 2014/02/17 | [
"https://tex.stackexchange.com/questions/160890",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/19396/"
] | Or use `\hphantom{{}={}}`:
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos ... | You don't need all the packages loaded; [`amsmath`](http://www.ctan.org/pkg/amsmath) is enough:
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\sum_{i}c_{i}
&= \cos\sin\cos\sin\cos\sin\cos\sin\cos\sin\\
\sum_{i}c_{i}
&= \delta\cos\sin\cos\sin\cos\cos\sin\cos\sin\cos\cos\sin\cos\sin\... |
160,890 | I have the following MWE
```
\documentclass[10pt, a4paper]{article}
\usepackage{amsfonts, amsmath, amssymb, amsfonts}
\begin{document}
\begin{align}
\sum_i{ c_i} &= \cos \sin\cos \sin\cos \sin\cos \sin\cos \sin \\
\sum_i{ c_i} &= \delta \cos \sin\cos \sin\cos \cos \sin\cos \sin\cos \cos \sin\cos \s... | 2014/02/17 | [
"https://tex.stackexchange.com/questions/160890",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/19396/"
] | I typically use
```
\begin{align}
... = {} & ... \\
= {} & ... \\
& ...
\end{align}
```
note the set of `{}` between the `=` and the `&` a lot faster to type than `\phantom` and friends | You don't need all the packages loaded; [`amsmath`](http://www.ctan.org/pkg/amsmath) is enough:
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\sum_{i}c_{i}
&= \cos\sin\cos\sin\cos\sin\cos\sin\cos\sin\\
\sum_{i}c_{i}
&= \delta\cos\sin\cos\sin\cos\cos\sin\cos\sin\cos\cos\sin\cos\sin\... |
30,341,842 | In this program I try to get data from SQL into a list of strings and show them in a `messageBox`. The program should start searching when I type one character in `textBox` and use this in the query as below:
```
string sql = " SELECT * FROM general WHERE element='" + textBox1.Text + "' OR element='" + textBox2.Text... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30341842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4909030/"
] | What are you doing wrong? a bunch of things:
In your question you write you gen an error but don't tell us what it is.
Exceptions has messages for a reason: so that you will be able to know what went wrong.
As to your code:
* You are concatenating values into your select statement instead of using [parameterized ... | You have declared `rd` as string. You probably meant to use the reader object in this loop instead:
```
while (reader.Read())
{
item.Add(reader["element"].ToString());// change "rd" to "reader"
}
``` |
30,341,842 | In this program I try to get data from SQL into a list of strings and show them in a `messageBox`. The program should start searching when I type one character in `textBox` and use this in the query as below:
```
string sql = " SELECT * FROM general WHERE element='" + textBox1.Text + "' OR element='" + textBox2.Text... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30341842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4909030/"
] | What are you doing wrong? a bunch of things:
In your question you write you gen an error but don't tell us what it is.
Exceptions has messages for a reason: so that you will be able to know what went wrong.
As to your code:
* You are concatenating values into your select statement instead of using [parameterized ... | I took the liberty of modifing the SQL to use an IN instead of multiple or statements as well as including the use of parameter into the query and not a string based approach. This should solve your problems.
```
string elem1 = "@elem1";
string elem2 = "@elem2";
string elem3 = "@elem3";
string elem4 = ... |
23,408,853 | My program is running fine when i run it on VS with my own 'main()' function but i have to submit this where main is hidden from me I only know that it will pass arguements to my functions and check their return result. But it is giving segmentation fault error when I try to use arguement passed to my function.
Here is... | 2014/05/01 | [
"https://Stackoverflow.com/questions/23408853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3592832/"
] | Shouldn't it be?
```
var d = value.FirstOrDefault(x => String.Equals(x.Culture, Thread.CurrentThread.CurrentCulture.Name, StringComparison.InvariantCultureIgnoreCase));
``` | Your issue is here:
```
var d ... x.Culture == Thread.CurrentThread.CurrentCulture.Name
```
This evaluates to `true`, so `string.Equals` where it is used yields unexpected results.
So the right code:
```
var d = value.FirstOrDefault(x => String.Equals(x.Culture, Thread.CurrentThread.CurrentCulture.Name, StringComp... |
4,029 | I plan to ask about how to restore some defunct human genes. The GULO pseudo gene is the first one I am going to ask about. Should the question maybe be split into several question? The intended question is as follows.
A lot of base pairs in the defunct GULO pseudo gene in humans are missing to make a functional enzym... | 2020/01/10 | [
"https://biology.meta.stackexchange.com/questions/4029",
"https://biology.meta.stackexchange.com",
"https://biology.meta.stackexchange.com/users/11654/"
] | **NO: we should stick to the current threshold of 5.**
I have noticed wayy too many circumstances in which a question was being voted to be closed by 2-3 users *inappropriately* (i.e., the close votes were unfounded/not supported or the wrong close reason was chosen). Reasons for these inappropriate VTCs range from no... | **Yes: we should try a reduced threshold of 3 votes**
In the last moderator election, one of the questions was about moderator use of the unilateral close vote. I think the general consensus has been that it's best to let the community handle whatever is possible for the community to handle, and yet sometimes the mode... |
4,029 | I plan to ask about how to restore some defunct human genes. The GULO pseudo gene is the first one I am going to ask about. Should the question maybe be split into several question? The intended question is as follows.
A lot of base pairs in the defunct GULO pseudo gene in humans are missing to make a functional enzym... | 2020/01/10 | [
"https://biology.meta.stackexchange.com/questions/4029",
"https://biology.meta.stackexchange.com",
"https://biology.meta.stackexchange.com/users/11654/"
] | UPDATED ANSWER -- 2 years later (May 2021):
Dropping vote-to-close thresholds has been a topic discussed across many SE sites for years. As of May 2021, there's now a formal effort to test minimizing the threshold to 3 votes across the SE network. The 45-day 3-vote test will occur on 13 sites (Not Biology) throughout ... | **Yes: we should try a reduced threshold of 3 votes**
In the last moderator election, one of the questions was about moderator use of the unilateral close vote. I think the general consensus has been that it's best to let the community handle whatever is possible for the community to handle, and yet sometimes the mode... |
4,029 | I plan to ask about how to restore some defunct human genes. The GULO pseudo gene is the first one I am going to ask about. Should the question maybe be split into several question? The intended question is as follows.
A lot of base pairs in the defunct GULO pseudo gene in humans are missing to make a functional enzym... | 2020/01/10 | [
"https://biology.meta.stackexchange.com/questions/4029",
"https://biology.meta.stackexchange.com",
"https://biology.meta.stackexchange.com/users/11654/"
] | **NO: we should stick to the current threshold of 5.**
I have noticed wayy too many circumstances in which a question was being voted to be closed by 2-3 users *inappropriately* (i.e., the close votes were unfounded/not supported or the wrong close reason was chosen). Reasons for these inappropriate VTCs range from no... | This answer is in the nature of a reflection, with a suggestion that we try to accumulate more information on which to make a decision. To provide a one-liner:
**We should determine how difficult it is to find 5 votes to close an off-topic question on SE Biology, and drop the requirement to 3 votes if the barrier is t... |
4,029 | I plan to ask about how to restore some defunct human genes. The GULO pseudo gene is the first one I am going to ask about. Should the question maybe be split into several question? The intended question is as follows.
A lot of base pairs in the defunct GULO pseudo gene in humans are missing to make a functional enzym... | 2020/01/10 | [
"https://biology.meta.stackexchange.com/questions/4029",
"https://biology.meta.stackexchange.com",
"https://biology.meta.stackexchange.com/users/11654/"
] | UPDATED ANSWER -- 2 years later (May 2021):
Dropping vote-to-close thresholds has been a topic discussed across many SE sites for years. As of May 2021, there's now a formal effort to test minimizing the threshold to 3 votes across the SE network. The 45-day 3-vote test will occur on 13 sites (Not Biology) throughout ... | This answer is in the nature of a reflection, with a suggestion that we try to accumulate more information on which to make a decision. To provide a one-liner:
**We should determine how difficult it is to find 5 votes to close an off-topic question on SE Biology, and drop the requirement to 3 votes if the barrier is t... |
18,771,268 | I'm having trouble with 1 line of code I've run it over and over again but I don't know what I'm doing wrong, I'm thinking it's the `if` statement but I'm not sure. The line I'm having trouble with is in the comment. I don't know how to write it so it works properly.
```
import random
print"Hello hero, you are surrou... | 2013/09/12 | [
"https://Stackoverflow.com/questions/18771268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2423223/"
] | I think you want to test if you have any potions before you award the benefits of using one. Like this:
```
elif a=="potion":
if p==0: #supposed to be if potion = 0 print (you dont have any left)
print"you dont have any left"
else:
print "you have used a potion"
h+=20
p=p-1
... | here's what you should add to your code:
```
elif a=="potion":
if p>0:
print"you have used a potion"
h+=20
p=p-1
print"you have recovered 20 health"
print("you now have, "+str(h)+" health")
else: #supposed to be if potion = 0 print (you dont have any left)
print"... |
3,146,767 | I know that if we have $3$ points $a$, $b$,and $c$ in $\mathbb R^3$, the area of the triangle is given by: $\frac{1}{2}\|\vec{ab}\times \vec{ac}\|$.
This means that the area of the triangle equals half the length of the normal of the plane on which the triangle lays.
I don't quite understand how this can be. What o... | 2019/03/13 | [
"https://math.stackexchange.com/questions/3146767",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/649007/"
] | The [geometric interpretation](https://en.wikipedia.org/wiki/Cross_product#Geometric_meaning) of the magnitude of the cross product $\left\|\vec v \times \vec w\right\|$ is the area of the **parallellogram** spanned by the vectors $\vec v$ and $\vec w$ and the triangle with vertices $\vec o$, $\vec v$ and $\vec w$ is e... | Every triangle can be completely specified by two vectors sharing a common vertex. This is because the third side is found by vector subtraction of the other two sides. The triangle spanned by the two vectors is the area we are looking for. By mirrorflipping the two sides across the vector subtraction of the two sides ... |
4,295,758 | I have set my compression like this for my **NSMutableUrlRequest** on my iphone app (I use Monotouch, but it's a 1:1 API match):
```
var req = new NSMutableUrlRequest (new NSUrl (str), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 20)
req["Accept-Encoding"] = "compress, gzip";
```
When I download ... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4295758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172861/"
] | **Do not just increment the pointer if you have malloc'd any memory or your program will crash.** free needs the original pointer. You can copy the pointer, make a new chunk of memory and memcpy it, access it as ptr+1 or any of a bunch of other ways, but the people who say just increment the pointer are giving you dang... | It sounds as if you're under the impression that a char\* "contains" characters. It does not. It merely *points* at *a* byte. The rest of the string is implied to consist of the subsequent byte in memory up until the next null byte. (You should also be aware that although the 'char' data type is a byte, by definition, ... |
4,295,758 | I have set my compression like this for my **NSMutableUrlRequest** on my iphone app (I use Monotouch, but it's a 1:1 API match):
```
var req = new NSMutableUrlRequest (new NSUrl (str), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 20)
req["Accept-Encoding"] = "compress, gzip";
```
When I download ... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4295758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172861/"
] | **Do not just increment the pointer if you have malloc'd any memory or your program will crash.** free needs the original pointer. You can copy the pointer, make a new chunk of memory and memcpy it, access it as ptr+1 or any of a bunch of other ways, but the people who say just increment the pointer are giving you dang... | Here is my code
So simple
```
#include <stdio.h>
#include<stdlib.h>
int main()
{
char *str=(char *)malloc(100*sizeof(char));
scanf("%s",str);
str=&str[1];
printf("%s",str);
return 0;
}
```
str=&str[1] // here 1 indicates how many characters to remove. |
4,295,758 | I have set my compression like this for my **NSMutableUrlRequest** on my iphone app (I use Monotouch, but it's a 1:1 API match):
```
var req = new NSMutableUrlRequest (new NSUrl (str), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 20)
req["Accept-Encoding"] = "compress, gzip";
```
When I download ... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4295758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172861/"
] | `char* contents_chopped = contents + 1;`
This will result in `contents_chopped` pointing to the same string, except the first char will be the next after \n
Also, this method is faster. | ```
#include <stdio.h>
#include <string.h>
int main ()
{
char src[50] = "123456789123434567678";
char dest[16]={0};
memcpy(dest, src+1,sizeof(src));
printf("%s\n",dest);
return(0);
}
src+1 -> indicate how many char you want to remove
``` |
4,295,758 | I have set my compression like this for my **NSMutableUrlRequest** on my iphone app (I use Monotouch, but it's a 1:1 API match):
```
var req = new NSMutableUrlRequest (new NSUrl (str), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 20)
req["Accept-Encoding"] = "compress, gzip";
```
When I download ... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4295758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172861/"
] | It sounds as if you're under the impression that a char\* "contains" characters. It does not. It merely *points* at *a* byte. The rest of the string is implied to consist of the subsequent byte in memory up until the next null byte. (You should also be aware that although the 'char' data type is a byte, by definition, ... | If it finds the character it basically ignores the character and continues to loop.
```
void remove_character(char* string, char letter) {
int length = strlen(string);
int found = 0;
for (int i = 0; i < length; ++i)
{
if (string[i] == letter)
{
found = 1;
continue;
}
if (found == 1)
... |
4,295,758 | I have set my compression like this for my **NSMutableUrlRequest** on my iphone app (I use Monotouch, but it's a 1:1 API match):
```
var req = new NSMutableUrlRequest (new NSUrl (str), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 20)
req["Accept-Encoding"] = "compress, gzip";
```
When I download ... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4295758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172861/"
] | **Do not just increment the pointer if you have malloc'd any memory or your program will crash.** free needs the original pointer. You can copy the pointer, make a new chunk of memory and memcpy it, access it as ptr+1 or any of a bunch of other ways, but the people who say just increment the pointer are giving you dang... | Here is my code
```
char * bastakiniSil(char *contents){
char *p = malloc( sizeof(*p) * strlen(contents) );
int i;
for(i=0; i<strlen(contents); i++)
{
p[i]=contents[i+1];
}
return p;
```
} |
4,295,758 | I have set my compression like this for my **NSMutableUrlRequest** on my iphone app (I use Monotouch, but it's a 1:1 API match):
```
var req = new NSMutableUrlRequest (new NSUrl (str), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 20)
req["Accept-Encoding"] = "compress, gzip";
```
When I download ... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4295758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172861/"
] | ```
if (contents[0] == '\n')
memmove(contents, contents+1, strlen(contents));
```
Or, if the pointer can be modified:
```
if (contents[0] == '\n') contents++;
``` | It sounds as if you're under the impression that a char\* "contains" characters. It does not. It merely *points* at *a* byte. The rest of the string is implied to consist of the subsequent byte in memory up until the next null byte. (You should also be aware that although the 'char' data type is a byte, by definition, ... |
4,295,758 | I have set my compression like this for my **NSMutableUrlRequest** on my iphone app (I use Monotouch, but it's a 1:1 API match):
```
var req = new NSMutableUrlRequest (new NSUrl (str), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 20)
req["Accept-Encoding"] = "compress, gzip";
```
When I download ... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4295758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172861/"
] | It sounds as if you're under the impression that a char\* "contains" characters. It does not. It merely *points* at *a* byte. The rest of the string is implied to consist of the subsequent byte in memory up until the next null byte. (You should also be aware that although the 'char' data type is a byte, by definition, ... | Here is my code
So simple
```
#include <stdio.h>
#include<stdlib.h>
int main()
{
char *str=(char *)malloc(100*sizeof(char));
scanf("%s",str);
str=&str[1];
printf("%s",str);
return 0;
}
```
str=&str[1] // here 1 indicates how many characters to remove. |
4,295,758 | I have set my compression like this for my **NSMutableUrlRequest** on my iphone app (I use Monotouch, but it's a 1:1 API match):
```
var req = new NSMutableUrlRequest (new NSUrl (str), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 20)
req["Accept-Encoding"] = "compress, gzip";
```
When I download ... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4295758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172861/"
] | `char* contents_chopped = contents + 1;`
This will result in `contents_chopped` pointing to the same string, except the first char will be the next after \n
Also, this method is faster. | **Do not just increment the pointer if you have malloc'd any memory or your program will crash.** free needs the original pointer. You can copy the pointer, make a new chunk of memory and memcpy it, access it as ptr+1 or any of a bunch of other ways, but the people who say just increment the pointer are giving you dang... |
4,295,758 | I have set my compression like this for my **NSMutableUrlRequest** on my iphone app (I use Monotouch, but it's a 1:1 API match):
```
var req = new NSMutableUrlRequest (new NSUrl (str), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 20)
req["Accept-Encoding"] = "compress, gzip";
```
When I download ... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4295758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172861/"
] | It sounds as if you're under the impression that a char\* "contains" characters. It does not. It merely *points* at *a* byte. The rest of the string is implied to consist of the subsequent byte in memory up until the next null byte. (You should also be aware that although the 'char' data type is a byte, by definition, ... | Here is my code
```
char * bastakiniSil(char *contents){
char *p = malloc( sizeof(*p) * strlen(contents) );
int i;
for(i=0; i<strlen(contents); i++)
{
p[i]=contents[i+1];
}
return p;
```
} |
4,295,758 | I have set my compression like this for my **NSMutableUrlRequest** on my iphone app (I use Monotouch, but it's a 1:1 API match):
```
var req = new NSMutableUrlRequest (new NSUrl (str), NSUrlRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, 20)
req["Accept-Encoding"] = "compress, gzip";
```
When I download ... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4295758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/172861/"
] | ```
if (contents[0] == '\n')
memmove(contents, contents+1, strlen(contents));
```
Or, if the pointer can be modified:
```
if (contents[0] == '\n') contents++;
``` | **Do not just increment the pointer if you have malloc'd any memory or your program will crash.** free needs the original pointer. You can copy the pointer, make a new chunk of memory and memcpy it, access it as ptr+1 or any of a bunch of other ways, but the people who say just increment the pointer are giving you dang... |
49,290,374 | I have a table who have creation date like:
```
SELECT [CreationDate] FROM Store.Order
```
So each register have one datetime like:
```
2018-03-14 00:00:00.000
2017-04-14 00:00:00.000
2017-06-14 00:00:00.000
```
I want to know how to `COUNT` only register of Date equals to current month and year, for example i... | 2018/03/15 | [
"https://Stackoverflow.com/questions/49290374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9452841/"
] | Here is one option:
```
SELECT COUNT(*)
FROM Store.Order
WHERE
CONVERT(varchar(7), [CreationDate], 126) = CONVERT(varchar(7), GETDATE(), 126);
```
[Demo
----](http://rextester.com/NLHQPE86189)
We can convert both the creation date in your table and the current date into `yyyy-mm` strings, and then check if they... | The most efficient way is to do:
```
where creationdate >= dateadd(day, 1 - day(getdate(), cast(getdate() as date)) and
creationdate < dateadd(month, 1, dateadd(day, 1 - day(getdate(), cast(getdate() as date)))
```
Although this looks more complex than other solutions, all the complexity is on `getdate()` -- m... |
45,735,671 | I am using [GlideJS](http://glide.jedrzejchalubek.com/) to display a carousal. The height of each item in this carousal is different and I have therefore set the property:
```
autoheight: true
```
The problem is when I try to display the carousal in a collapsed div with the autoheight property set to 'true' the caro... | 2017/08/17 | [
"https://Stackoverflow.com/questions/45735671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3398797/"
] | What you need to do is codesplitting.
Without code splitting
+ are loaded at the first start
```
import Login from './Login'
import Home from './Home'
const App = ({ user }) => (
<Body>
{user.loggedIn ? <Route path="/" component={Home} /> : <Redirect to="/login" />}
<Route path="/login" component={Login... | Use `import` or `require` on the top on a given js file for adding custom scripts or custom css, but I agree that you should review it to be sure everything behaves as you expect.
Example:
```
import "../../assets/js/extensions/mouse-gesture/options.js";
```
Or if you want to import a script only when using a metho... |
45,735,671 | I am using [GlideJS](http://glide.jedrzejchalubek.com/) to display a carousal. The height of each item in this carousal is different and I have therefore set the property:
```
autoheight: true
```
The problem is when I try to display the carousal in a collapsed div with the autoheight property set to 'true' the caro... | 2017/08/17 | [
"https://Stackoverflow.com/questions/45735671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3398797/"
] | What you need to do is codesplitting.
Without code splitting
+ are loaded at the first start
```
import Login from './Login'
import Home from './Home'
const App = ({ user }) => (
<Body>
{user.loggedIn ? <Route path="/" component={Home} /> : <Redirect to="/login" />}
<Route path="/login" component={Login... | You can try this library: npm install --save react-script-tag
<https://www.npmjs.com/package/react-script-tag>
```
import React, { Component } from 'react';
import ScriptTag from 'react-script-tag';
class Demo extends Component {
render() {
return (<ScriptTag isHydrating={true} type="text/javascript" sr... |
58,255,047 | How do I display the information data using the ID in the url
example is www.thatsite.com/?id=1092
and it will display the data of the 1092 ID
```
<?php
$connect = mysqli_connect("localhost", "xxxxxxx", "xxxx","xxxx");
$query = "SELECT `name`, `age`, `xxxxx` , `xxxxx`, `image` FROM `profiles` WHERE `id` ... | 2019/10/06 | [
"https://Stackoverflow.com/questions/58255047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your code is full of security holes. It is prone to sql injection, xss attack, csrf, html injection.
I have re-written it to circumvent all the issues.
**1.) Sql Injection** is now mitigated using prepare queries
**2.) Html injection** is mitigated using **intval** for integer variables and **strip\_tags** for strin... | from <https://www.w3schools.com/php/php_mysql_select.asp>
leave out the 'get id', the id is in the SQL:
```
$id=$_GET['id'];
```
The similar example at
<https://www.w3schools.com/php/php_mysql_select.asp>
```
$servername = "localhost";
$username = "";
$password = "";
$dbname = "";
// Create connection
$conn = my... |
71,729,307 | I'm a beginner in Python and flask. I am going through the Flask tutorial up to [Define and Access the Database](https://flask.palletsprojects.com/en/2.1.x/tutorial/database/) section.
wrote up all the codes, saved, and execute the command below to initalise the DB.
`flask init-db`
However, I get the error on the ter... | 2022/04/03 | [
"https://Stackoverflow.com/questions/71729307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18600140/"
] | Your code has `open_instance_resource`, which is looking for `instance/schema.sql` - but your `schema.sql` is not there. The original code has `open_resource`, which looks relative to `root_path`. | I think you have downloaded the file in virtual env and trying to access it outside your env.When you create virtual env,files are downloaded inside that env irrespective of that whole system.So you have to first enter in your env and then run the code. |
30,975,060 | i'm new to android developing and started to develop an booking app. There is a calendar view and i want to disable booked dates in that calendar. I found out that disabling feature is not there in android default calendar. so could you please help me to find a good custom calendar view that can disable specific dates.... | 2015/06/22 | [
"https://Stackoverflow.com/questions/30975060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2214782/"
] | Include CalendarPickerView in your layout XML.
```
<com.squareup.timessquare.CalendarPickerView
android:id="@+id/calendar_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
```
In the onCreate of your activity/dialog or the onCreateView of your fragment, initialize the view with a range... | ```
i have faced the same problem using custom calendar ,
i just overridden the function of adapter
@Override
public boolean isEnabled(int position) {
if(mySet.contains(position))
return true;
else
return false;
}
then i call the function int the adapter view
isEn... |
12,106,280 | In my code, I want to remove the img tag which doesn't have src value.
I am using **HTMLAgilitypack's HtmlDocument** object.
I am finding the img which doesn't have src value and trying to remove it.. but it gives me error Collection was modified; enumeration operation may not execute.
Can anyone help me for this?
... | 2012/08/24 | [
"https://Stackoverflow.com/questions/12106280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1567913/"
] | It seems you're modifying the collection during the enumeration by using `HtmlNode.RemoveChild` method.
To fix this you need is to copy your nodes to a separate list/array by calling e.g. [`Enumerable.ToList<T>()`](http://msdn.microsoft.com/en-us/library/bb342261.aspx) or [`Enumerable.ToArray<T>()`](http://msdn.micro... | ```
var emptyImages = doc.DocumentNode
.Descendants("img")
.Where(x => x.Attributes["src"] == null || x.Attributes["src"].Value == String.Empty)
.Select(x => x.XPath)
.ToList();
emptyImages.ForEach(xpath => {
var node = doc.DocumentNode.SelectSingleNode(xpath);
if (node != null) { node.Remove(); }
... |
12,106,280 | In my code, I want to remove the img tag which doesn't have src value.
I am using **HTMLAgilitypack's HtmlDocument** object.
I am finding the img which doesn't have src value and trying to remove it.. but it gives me error Collection was modified; enumeration operation may not execute.
Can anyone help me for this?
... | 2012/08/24 | [
"https://Stackoverflow.com/questions/12106280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1567913/"
] | It seems you're modifying the collection during the enumeration by using `HtmlNode.RemoveChild` method.
To fix this you need is to copy your nodes to a separate list/array by calling e.g. [`Enumerable.ToList<T>()`](http://msdn.microsoft.com/en-us/library/bb342261.aspx) or [`Enumerable.ToArray<T>()`](http://msdn.micro... | ```
var emptyElements = doc.DocumentNode
.Descendants("a")
.Where(x => x.Attributes["src"] == null || x.Attributes["src"].Value == String.Empty)
.ToList();
emptyElements.ForEach(node => {
if (node != null){ node.Remove();}
});
``` |
12,106,280 | In my code, I want to remove the img tag which doesn't have src value.
I am using **HTMLAgilitypack's HtmlDocument** object.
I am finding the img which doesn't have src value and trying to remove it.. but it gives me error Collection was modified; enumeration operation may not execute.
Can anyone help me for this?
... | 2012/08/24 | [
"https://Stackoverflow.com/questions/12106280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1567913/"
] | What I have done is:
```
List<string> xpaths = new List<string>();
foreach (HtmlNode node in doc.DocumentNode.DescendantNodes())
{
if (node.Name.ToLower() == "img")
{
string src = node.Attributes["src"].Value;
... | ```
var emptyImages = doc.DocumentNode
.Descendants("img")
.Where(x => x.Attributes["src"] == null || x.Attributes["src"].Value == String.Empty)
.Select(x => x.XPath)
.ToList();
emptyImages.ForEach(xpath => {
var node = doc.DocumentNode.SelectSingleNode(xpath);
if (node != null) { node.Remove(); }
... |
12,106,280 | In my code, I want to remove the img tag which doesn't have src value.
I am using **HTMLAgilitypack's HtmlDocument** object.
I am finding the img which doesn't have src value and trying to remove it.. but it gives me error Collection was modified; enumeration operation may not execute.
Can anyone help me for this?
... | 2012/08/24 | [
"https://Stackoverflow.com/questions/12106280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1567913/"
] | What I have done is:
```
List<string> xpaths = new List<string>();
foreach (HtmlNode node in doc.DocumentNode.DescendantNodes())
{
if (node.Name.ToLower() == "img")
{
string src = node.Attributes["src"].Value;
... | ```
var emptyElements = doc.DocumentNode
.Descendants("a")
.Where(x => x.Attributes["src"] == null || x.Attributes["src"].Value == String.Empty)
.ToList();
emptyElements.ForEach(node => {
if (node != null){ node.Remove();}
});
``` |
12,106,280 | In my code, I want to remove the img tag which doesn't have src value.
I am using **HTMLAgilitypack's HtmlDocument** object.
I am finding the img which doesn't have src value and trying to remove it.. but it gives me error Collection was modified; enumeration operation may not execute.
Can anyone help me for this?
... | 2012/08/24 | [
"https://Stackoverflow.com/questions/12106280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1567913/"
] | ```
var emptyImages = doc.DocumentNode
.Descendants("img")
.Where(x => x.Attributes["src"] == null || x.Attributes["src"].Value == String.Empty)
.Select(x => x.XPath)
.ToList();
emptyImages.ForEach(xpath => {
var node = doc.DocumentNode.SelectSingleNode(xpath);
if (node != null) { node.Remove(); }
... | ```
var emptyElements = doc.DocumentNode
.Descendants("a")
.Where(x => x.Attributes["src"] == null || x.Attributes["src"].Value == String.Empty)
.ToList();
emptyElements.ForEach(node => {
if (node != null){ node.Remove();}
});
``` |
13,615,562 | Hi I really have googled this a lot without any joy. Would be happy to get a reference to a website if it exists. I'm struggling to understand the [Hadley documentation on polar coordinates](http://docs.ggplot2.org/current/coord_polar.html) and I know that pie/donut charts are considered inherently evil.
That said, w... | 2012/11/28 | [
"https://Stackoverflow.com/questions/13615562",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1675004/"
] | I don't have a full answer to your question, but I can offer some code that may help get you started making ring plots using `ggplot2`.
```
library(ggplot2)
# Create test data.
dat = data.frame(count=c(10, 60, 30), category=c("A", "B", "C"))
# Add addition columns, needed for drawing with geom_rect.
dat$fraction = d... | Just trying to solve question 2 with the same approach from [bdemarest's answer](https://stackoverflow.com/a/13636037/5410410). Also using his code as a scaffold. I added some tests to make it more complete but feel free to remove them.
```
library(broom)
library(tidyverse)
# Create test data.
dat = data.frame(count=c... |
50,462,402 | I starting getting this error on my Angular app:
>
> The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3
> was found instead
>
>
>
and when I try to downgrade typescript to the right version doing:
`npm install -g typescript@2.7.2` it says updated 1 package.
when I verify typescript version u... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50462402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931511/"
] | I did the following:
* Delete manually the folder node\_modules
* Delete manually the file package-lock.json
* In the file package.json be sure to set the dependence of TypeScript as
```
"typescript": "2.7.2"
```
* run npm cache clean -f
* run npm install
That work for me. | Had the same issue (amongst many others) after updating to macOS Mojave.
Fixed it by removing node\_modules and package\_lock.json manually, changed in package.json from "typescript": "~2.7.2" to "typescript": "~2.8.0" and ran npm install. |
50,462,402 | I starting getting this error on my Angular app:
>
> The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3
> was found instead
>
>
>
and when I try to downgrade typescript to the right version doing:
`npm install -g typescript@2.7.2` it says updated 1 package.
when I verify typescript version u... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50462402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931511/"
] | Installing "@angular/compiler-cli": "7.0.0-beta.4" resolved this issue.
I use "typescript": "3.0.3". | Had the same issue (amongst many others) after updating to macOS Mojave.
Fixed it by removing node\_modules and package\_lock.json manually, changed in package.json from "typescript": "~2.7.2" to "typescript": "~2.8.0" and ran npm install. |
50,462,402 | I starting getting this error on my Angular app:
>
> The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3
> was found instead
>
>
>
and when I try to downgrade typescript to the right version doing:
`npm install -g typescript@2.7.2` it says updated 1 package.
when I verify typescript version u... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50462402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931511/"
] | Installing "@angular/compiler-cli": "7.0.0-beta.4" resolved this issue.
I use "typescript": "3.0.3". | Downgrading to `typescript 2.9.2 (npm install typescript@2.9.2)` and `re-running ng update --all` still yields the error (twice):
```
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.10", would install "3.1.3"
Verified that version 2.9.2 of typescript was in nod... |
50,462,402 | I starting getting this error on my Angular app:
>
> The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3
> was found instead
>
>
>
and when I try to downgrade typescript to the right version doing:
`npm install -g typescript@2.7.2` it says updated 1 package.
when I verify typescript version u... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50462402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931511/"
] | In your project folder run again `npm install typescript@2.7.2` as stated from here:
[Want to upgrade project from Angular v5 to Angular v6](https://stackoverflow.com/questions/48970553/want-to-upgrade-project-from-angular-v5-to-angular-v6/49474334)
Then it should work. | To upgrade, run the following commands in the terminal.
* Install the latest version of NPM
```
npm install npm@latest -g
```
* Run audit
```
npm audit
```
* Update the NPM
```
npm update
```
* Run the NPM run script.
```
npm start
```
Now your compiler is ready. |
50,462,402 | I starting getting this error on my Angular app:
>
> The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3
> was found instead
>
>
>
and when I try to downgrade typescript to the right version doing:
`npm install -g typescript@2.7.2` it says updated 1 package.
when I verify typescript version u... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50462402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931511/"
] | To upgrade, run the following commands in the terminal.
* Install the latest version of NPM
```
npm install npm@latest -g
```
* Run audit
```
npm audit
```
* Update the NPM
```
npm update
```
* Run the NPM run script.
```
npm start
```
Now your compiler is ready. | This is just because in your projects `package.json` file has
eg.`"devDependencies": {"typescript": "~2.8.3"
}`
and in your machine where angular cli installed has `"typescript": "2.7.2"` version.
You can check this by `ng -v` or `ng v`.
So, just open **package.json** **update your typescript version** and `run ... |
50,462,402 | I starting getting this error on my Angular app:
>
> The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3
> was found instead
>
>
>
and when I try to downgrade typescript to the right version doing:
`npm install -g typescript@2.7.2` it says updated 1 package.
when I verify typescript version u... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50462402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931511/"
] | Installing "@angular/compiler-cli": "7.0.0-beta.4" resolved this issue.
I use "typescript": "3.0.3". | This is just because in your projects `package.json` file has
eg.`"devDependencies": {"typescript": "~2.8.3"
}`
and in your machine where angular cli installed has `"typescript": "2.7.2"` version.
You can check this by `ng -v` or `ng v`.
So, just open **package.json** **update your typescript version** and `run ... |
50,462,402 | I starting getting this error on my Angular app:
>
> The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3
> was found instead
>
>
>
and when I try to downgrade typescript to the right version doing:
`npm install -g typescript@2.7.2` it says updated 1 package.
when I verify typescript version u... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50462402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931511/"
] | I did the following:
* Delete manually the folder node\_modules
* Delete manually the file package-lock.json
* In the file package.json be sure to set the dependence of TypeScript as
```
"typescript": "2.7.2"
```
* run npm cache clean -f
* run npm install
That work for me. | Installing "@angular/compiler-cli": "7.0.0-beta.4" resolved this issue.
I use "typescript": "3.0.3". |
50,462,402 | I starting getting this error on my Angular app:
>
> The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3
> was found instead
>
>
>
and when I try to downgrade typescript to the right version doing:
`npm install -g typescript@2.7.2` it says updated 1 package.
when I verify typescript version u... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50462402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931511/"
] | I did next steps:
* removed package-lock.json;
* npm install -g --save typescript@2.7.2;
* npm uninstall -g --save typescript@2.9.2;
* in package.json, section "devDependencies" updated string with typescript as "typescript": "~2.7.2".
After all above run in project's terminal ng serve --open (I've been using IDEA 20... | Had the same issue (amongst many others) after updating to macOS Mojave.
Fixed it by removing node\_modules and package\_lock.json manually, changed in package.json from "typescript": "~2.7.2" to "typescript": "~2.8.0" and ran npm install. |
50,462,402 | I starting getting this error on my Angular app:
>
> The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3
> was found instead
>
>
>
and when I try to downgrade typescript to the right version doing:
`npm install -g typescript@2.7.2` it says updated 1 package.
when I verify typescript version u... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50462402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931511/"
] | To upgrade, run the following commands in the terminal.
* Install the latest version of NPM
```
npm install npm@latest -g
```
* Run audit
```
npm audit
```
* Update the NPM
```
npm update
```
* Run the NPM run script.
```
npm start
```
Now your compiler is ready. | Had the same issue (amongst many others) after updating to macOS Mojave.
Fixed it by removing node\_modules and package\_lock.json manually, changed in package.json from "typescript": "~2.7.2" to "typescript": "~2.8.0" and ran npm install. |
50,462,402 | I starting getting this error on my Angular app:
>
> The Angular Compiler requires TypeScript >=2.7.2 and <2.8.0 but 2.8.3
> was found instead
>
>
>
and when I try to downgrade typescript to the right version doing:
`npm install -g typescript@2.7.2` it says updated 1 package.
when I verify typescript version u... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50462402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931511/"
] | You should do `npm install typescript@'>=2.7.2 <2.8.0'`. This will install the correct typescript your project needs. Make sure you run this inside your Angular project.
On Windows, you should use double quotes instead of single quotes, like so:
```
npm install typescript@">=2.7.2 <2.8.0"
```
Otherwise, you'll get... | I did the following:
* Delete manually the folder node\_modules
* Delete manually the file package-lock.json
* In the file package.json be sure to set the dependence of TypeScript as
```
"typescript": "2.7.2"
```
* run npm cache clean -f
* run npm install
That work for me. |
21,871 | (I am learning Buddhism/dharma in Chinese.)
为什么合掌鞠躬叫"问讯"?
或是说:
为什么现在的"问讯"不是用讲的?
"问"和"讯"都是动词吗?还是动词+名词? | 2016/11/17 | [
"https://chinese.stackexchange.com/questions/21871",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/15752/"
] | 依[香光莊嚴](http://www.gaya.org.tw/magazine/v1/2005/59/art1.htm)解釋:
在漢語的構詞上,問訊是由「問」與「訊」二個同義詞所組成的詞彙。
「問」是動詞,意思是「恤問」。
「訊」是動詞,意思是「詢問」。
如果「訊」作名詞,在非佛教場合也還是可以用的。如:打聽消息。
現在的"問訊"也還是有用講的,但通常只在人少的時候。當很多人同時向佛或法師表達恭敬時,沒辦法大家都講,所以就只有身體的動作。
問訊 is composed of two synonyms, 問 and 訊.
Both are verbs, meaning "comfort and ask".... | A word with multiple meaning.
汉典 : [問訊](http://www.zdic.net/c/e/fc/265284.htm)
简单来说, 就是佛教借用这个词,用久了成规范。
同 `问好` 。 比如说: `遥遥点头问好` Greet with a node. 你不需要喊出来,不是吗?
如果是普通人, `問訊` 还是用说的或是写的。 |
27,411,468 | I'm trying to get my code to go through and pop-out after some math has been done. The file being summed is just lists of numbers on separate lines. Could you give me some pointers to make this work because I am stumped.
**EDIT:**
I'm trying to get the transition from the main function to Checker function working corr... | 2014/12/10 | [
"https://Stackoverflow.com/questions/27411468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4347640/"
] | `lambda args: expr` is not a special magic feature, it's just nice shorthand for
```
def someFunc(args):
return expr
```
which is mainly useful when you need a small function with a simple expression for its body and you don't care about the name. If we used familiar syntax, the `closest()` method would be:
```... | [`def __sub__`](https://docs.python.org/2/reference/datamodel.html#emulating-numeric-types) is one of the magic methods you can define on an object.
It will be called when you substract the two points. In the example, `self` will be `pt0`. |
27,411,468 | I'm trying to get my code to go through and pop-out after some math has been done. The file being summed is just lists of numbers on separate lines. Could you give me some pointers to make this work because I am stumped.
**EDIT:**
I'm trying to get the transition from the main function to Checker function working corr... | 2014/12/10 | [
"https://Stackoverflow.com/questions/27411468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4347640/"
] | `lambda args: expr` is not a special magic feature, it's just nice shorthand for
```
def someFunc(args):
return expr
```
which is mainly useful when you need a small function with a simple expression for its body and you don't care about the name. If we used familiar syntax, the `closest()` method would be:
```... | Yes, `__sub__` and `__pow__` redefines `-` and `**` respectively. In this example you just pass anonymous function to optional argument for `min()`. Here is what this optional argument does, as said in [docs](https://docs.python.org/2.7/library/functions.html#min):
>
> The optional keyword-only key argument specifies... |
218,488 | My house's 240v circuit for the cooktop is a /2 cable. (black, white and bare copper). The new whirlpool cooktop has a 3 wire connection (black,red and bare copper). Whirlpool's instructions do not cover this wiring example. Their 3 wire to 3 wire example assumes you have a red wire from the house. Is there an easy pat... | 2021/03/10 | [
"https://diy.stackexchange.com/questions/218488",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/131410/"
] | If that is indeed a 240V circuit, the white wire *kinda shoulda* been re-marked with tape to indicate that it is a hot wire. Prior to about 20 years ago, they were allowed to skip the marking "if the usage was obvious". The reason for the change is that their "obvious" is not your "obvious".
If you are confident that ... | Their wiring is based on a 240V/120V circuit with hot/hot/neutral/ground, which is *typically* black/red/white/green-or-bare. Normally white = neutral. However, if you have a pure 240V circuit wired with cable (as opposed to individual wires in conduit), it is perfectly legitimate for it to be hot/hot/ground using blac... |
3,588 | I am getting a 404 error when trying to go to my admin page was working fine earlier today. Haven't changed anything since I last logged in and the only thing I was doing was assigning products to categories.
<http://mytempsite.net/gotie/admin>
**WHAT IVE TRIED SO FAR**
Delete the following file:-
app/etc/use\_cac... | 2013/05/09 | [
"https://magento.stackexchange.com/questions/3588",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/1847/"
] | First, are you the only admin user?
Second, In your app/etc/local.xml, look for:
```
<admin>
<routers>
<adminhtml>
<args>
<frontName><![CDATA[admin]]></frontName>
</args>
</adminhtml>
</routers>
</admin>
```
Does it say admin or something else?
Third... | make sure that your apache .htaccess are enabled
refer link when you are using ubuntu 15.x:
<https://askubuntu.com/questions/48362/how-to-enable-mod-rewrite-in-apache> |
42,570,539 | When I run `docker-compose up -d`, docker always creates container name and network name prepended with the folder name that contains `docker-compose.yml`file.
I can specify the container name as follows:
```
nginx:
container_name: nginx
build:
context: .
dockerfile: .docker/docker-nginx.docke... | 2017/03/03 | [
"https://Stackoverflow.com/questions/42570539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1072698/"
] | Docker Prepends the current folder name with all the components name created using docker compose file.
Eg : If the current folder name containing the docker-compose.yml file is test, all the volumes,network and container names will get test appended to it. In order to solve the problem people earlier proposed the ide... | You have to place a ".env" file in the root of your docker-compose project directory.
```
COMPOSE_PROJECT_NAME=MyFancyProject
```
See Docker docs for further information: <https://docs.docker.com/compose/reference/envvars/>
If you don't use docker-compose, you can use the "`-p`" parameter to set this on `docker run... |
61,852 | *How do you even read these runes?*
[](https://i.stack.imgur.com/7yv5Q.png)
*Note: Click image for full size* | 2018/03/13 | [
"https://puzzling.stackexchange.com/questions/61852",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/46455/"
] | It says
>
> THINGS LOOK A BIT OFF DONT THEY
>
>
>
if we
>
> replace each wingding character with the character at the same code point in the ordinary ASCII character set.
>
>
>
This isn't all; it turns out that
>
> the white background isn't all quite white, and a bit of colour-remapping produces this:... | If we use
>
> a Least Significant Bit detector,
>
>
>
we can find:
>
> [](https://i.stack.imgur.com/vUZMB.png)
>
>
>
However these runes currently elude me...
The fifth block appears to say:
>
> ... CM Postal Company, Type of correct... |
61,852 | *How do you even read these runes?*
[](https://i.stack.imgur.com/7yv5Q.png)
*Note: Click image for full size* | 2018/03/13 | [
"https://puzzling.stackexchange.com/questions/61852",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/46455/"
] | As described in [Gareth's answer](https://puzzling.stackexchange.com/a/61853/20521) (go upvote that if you haven't already), the first step is to notice that:
>
> the white background isn't all quite white, and a bit of colour remapping produces [this image](https://i.stack.imgur.com/IoRmt.png).
>
>
>
From there... | It says
>
> THINGS LOOK A BIT OFF DONT THEY
>
>
>
if we
>
> replace each wingding character with the character at the same code point in the ordinary ASCII character set.
>
>
>
This isn't all; it turns out that
>
> the white background isn't all quite white, and a bit of colour-remapping produces this:... |
61,852 | *How do you even read these runes?*
[](https://i.stack.imgur.com/7yv5Q.png)
*Note: Click image for full size* | 2018/03/13 | [
"https://puzzling.stackexchange.com/questions/61852",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/46455/"
] | It says
>
> THINGS LOOK A BIT OFF DONT THEY
>
>
>
if we
>
> replace each wingding character with the character at the same code point in the ordinary ASCII character set.
>
>
>
This isn't all; it turns out that
>
> the white background isn't all quite white, and a bit of colour-remapping produces this:... | Wrap-up: The Making Of *Unintelligible Batch of Wingdinglish*
=============================================================
*This is not a solution to the puzzle, but provides notes from its poser. This type of answer has been [approved by the community](https://puzzling.meta.stackexchange.com/questions/5420/).*
---
... |
61,852 | *How do you even read these runes?*
[](https://i.stack.imgur.com/7yv5Q.png)
*Note: Click image for full size* | 2018/03/13 | [
"https://puzzling.stackexchange.com/questions/61852",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/46455/"
] | As described in [Gareth's answer](https://puzzling.stackexchange.com/a/61853/20521) (go upvote that if you haven't already), the first step is to notice that:
>
> the white background isn't all quite white, and a bit of colour remapping produces [this image](https://i.stack.imgur.com/IoRmt.png).
>
>
>
From there... | If we use
>
> a Least Significant Bit detector,
>
>
>
we can find:
>
> [](https://i.stack.imgur.com/vUZMB.png)
>
>
>
However these runes currently elude me...
The fifth block appears to say:
>
> ... CM Postal Company, Type of correct... |
61,852 | *How do you even read these runes?*
[](https://i.stack.imgur.com/7yv5Q.png)
*Note: Click image for full size* | 2018/03/13 | [
"https://puzzling.stackexchange.com/questions/61852",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/46455/"
] | If we use
>
> a Least Significant Bit detector,
>
>
>
we can find:
>
> [](https://i.stack.imgur.com/vUZMB.png)
>
>
>
However these runes currently elude me...
The fifth block appears to say:
>
> ... CM Postal Company, Type of correct... | Wrap-up: The Making Of *Unintelligible Batch of Wingdinglish*
=============================================================
*This is not a solution to the puzzle, but provides notes from its poser. This type of answer has been [approved by the community](https://puzzling.meta.stackexchange.com/questions/5420/).*
---
... |
61,852 | *How do you even read these runes?*
[](https://i.stack.imgur.com/7yv5Q.png)
*Note: Click image for full size* | 2018/03/13 | [
"https://puzzling.stackexchange.com/questions/61852",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/46455/"
] | As described in [Gareth's answer](https://puzzling.stackexchange.com/a/61853/20521) (go upvote that if you haven't already), the first step is to notice that:
>
> the white background isn't all quite white, and a bit of colour remapping produces [this image](https://i.stack.imgur.com/IoRmt.png).
>
>
>
From there... | Wrap-up: The Making Of *Unintelligible Batch of Wingdinglish*
=============================================================
*This is not a solution to the puzzle, but provides notes from its poser. This type of answer has been [approved by the community](https://puzzling.meta.stackexchange.com/questions/5420/).*
---
... |
3,070,274 | I'm looking for a way to do something like this:
```
// style.css
@def borderSize '2px';
.style {
width: borderSize + 2;
height: borderSize + 2;
}
```
where the width and height attributes would end up having values of 4px. | 2010/06/18 | [
"https://Stackoverflow.com/questions/3070274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/317404/"
] | Mozilla kind-of-sort-of-not-really supports this with it's CSS `calc()` function.
This example shamelessly stolen (with attribution!) from [Ajaxian](http://ajaxian.com/archives/css-calc-in-the-house)
```
/*
* Two divs aligned, split up by a 1em margin
*/
#a {
width:75%;
margin-right: 1em;
}
#b {
width: -moz-cal... | I would also love somehting like that, but it's not possible.
Even in CSS 3 their is nothing planned like this.
If you really want to make something like that, one possibility is to use
php and configure your webserver, so that .css files are parsed by php.
So you could do something like
```
<?
$borderSize = 2;
?>... |
3,070,274 | I'm looking for a way to do something like this:
```
// style.css
@def borderSize '2px';
.style {
width: borderSize + 2;
height: borderSize + 2;
}
```
where the width and height attributes would end up having values of 4px. | 2010/06/18 | [
"https://Stackoverflow.com/questions/3070274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/317404/"
] | Sometimes I use the following:
```
@eval BORDER_SIZE_PLUS_2 2+2+"px"; /* GWT evaluates this at compile time! */
```
Oddly, this only works, if you don't put any spaces between the `+` operator and the operands. Also, in @eval you can't use constants that were previously defined by @def. You can however use constants... | I would also love somehting like that, but it's not possible.
Even in CSS 3 their is nothing planned like this.
If you really want to make something like that, one possibility is to use
php and configure your webserver, so that .css files are parsed by php.
So you could do something like
```
<?
$borderSize = 2;
?>... |
3,070,274 | I'm looking for a way to do something like this:
```
// style.css
@def borderSize '2px';
.style {
width: borderSize + 2;
height: borderSize + 2;
}
```
where the width and height attributes would end up having values of 4px. | 2010/06/18 | [
"https://Stackoverflow.com/questions/3070274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/317404/"
] | You could also calculate in your provider method, if you put a parameter in the function:
```
@eval baseFontSize com.myexample.CssSettingsProvider.getBaseFontSize(0)+"pt";
@eval baseFontSize_plus_1 com.myexample.CssSettingsProvider.getBaseFontSize(1)+"pt";
```
`com.myexample.CssSettingsProvider` would look like thi... | I would also love somehting like that, but it's not possible.
Even in CSS 3 their is nothing planned like this.
If you really want to make something like that, one possibility is to use
php and configure your webserver, so that .css files are parsed by php.
So you could do something like
```
<?
$borderSize = 2;
?>... |
3,070,274 | I'm looking for a way to do something like this:
```
// style.css
@def borderSize '2px';
.style {
width: borderSize + 2;
height: borderSize + 2;
}
```
where the width and height attributes would end up having values of 4px. | 2010/06/18 | [
"https://Stackoverflow.com/questions/3070274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/317404/"
] | Sometimes I use the following:
```
@eval BORDER_SIZE_PLUS_2 2+2+"px"; /* GWT evaluates this at compile time! */
```
Oddly, this only works, if you don't put any spaces between the `+` operator and the operands. Also, in @eval you can't use constants that were previously defined by @def. You can however use constants... | Mozilla kind-of-sort-of-not-really supports this with it's CSS `calc()` function.
This example shamelessly stolen (with attribution!) from [Ajaxian](http://ajaxian.com/archives/css-calc-in-the-house)
```
/*
* Two divs aligned, split up by a 1em margin
*/
#a {
width:75%;
margin-right: 1em;
}
#b {
width: -moz-cal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.