qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
52,070,565
I want to display an AdMob banner underneath a web view in a fragment in Android Studio. With this code: ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.androi...
2018/08/29
[ "https://Stackoverflow.com/questions/52070565", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4483791/" ]
Not directly related to your question, but have you thought about using Terraform to automate the creation of your resources? <http://terraform.io> Terraform is very similar to ARM (only much nicer) here's an example of a VM creation and the public IP export: ``` resource "azurerm_resource_group" "main" { ...
why do you care about the ip address? just use dns name? you always know that one (since you define it when you create vm, at least you can do that). Another option is to output the ip address as part of the arm template. or query the ip address in powershell: ``` Get-AzureRmVM -ResourceGroupName ‘HSG-ResourceGroup’ ...
52,070,565
I want to display an AdMob banner underneath a web view in a fragment in Android Studio. With this code: ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.androi...
2018/08/29
[ "https://Stackoverflow.com/questions/52070565", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4483791/" ]
Not directly related to your question, but have you thought about using Terraform to automate the creation of your resources? <http://terraform.io> Terraform is very similar to ARM (only much nicer) here's an example of a VM creation and the public IP export: ``` resource "azurerm_resource_group" "main" { ...
You can use the Powershell command to get all the private IP of the VMs. And the command will like this: ``` Get-AzureRmNetworkInterface -ResourceGroupName resourceGroupName | Select-Object {$_.IpConfigurations.PrivateIpAddress} ``` **Update** Also the command to set a variable like this: ``` $vm = Get-AzureRmNetw...
22,625,175
The old list format looked like: ``` ['Item 1', [['Item 1.1', []], ['Item 1.2', []]]] ``` And it is supposed be converted to: ``` ['Item 1', ['Item 1.1', 'Item 1.2']] ``` This question comes from Django's ource code but I have trouble figuring it out.Thanks in advance.
2014/03/25
[ "https://Stackoverflow.com/questions/22625175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3369923/" ]
``` #!/usr/bin/python import itertools l = ['Item 1', [['Item 1.1', []], ['Item 1.2', []]]] def con(L): res = [] for x in l: if isinstance(x, list): temp = list(itertools.chain(*x)) res.extend(temp) else: res.append(x) return [x for x in res if x] if __...
Like this? ``` test = ['Item 1', [['Item 1.1', []], ['Item 1.2', []]]] def convert(oldlist): return [oldlist[0], [oldlist[1][0][0], oldlist[1][1][0]]] print(convert(test)) ``` Output is: `['Item 1', ['Item 1.1', 'Item 1.2']]`
22,625,175
The old list format looked like: ``` ['Item 1', [['Item 1.1', []], ['Item 1.2', []]]] ``` And it is supposed be converted to: ``` ['Item 1', ['Item 1.1', 'Item 1.2']] ``` This question comes from Django's ource code but I have trouble figuring it out.Thanks in advance.
2014/03/25
[ "https://Stackoverflow.com/questions/22625175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3369923/" ]
Another option... this will also keep the format you request, and should work with any number of sub-items, but since I lack an example with more complex sub-items, I don't know if it will hold with real data... you'd have to check! ``` test = ['Item 1', [['Item 1.1', []], ['Item 1.2', []]]] def convert(oldlist, newl...
Like this? ``` test = ['Item 1', [['Item 1.1', []], ['Item 1.2', []]]] def convert(oldlist): return [oldlist[0], [oldlist[1][0][0], oldlist[1][1][0]]] print(convert(test)) ``` Output is: `['Item 1', ['Item 1.1', 'Item 1.2']]`
35,448,973
I want to be able to take the seekbar value selected by user (# of years) and add it to the calculatePayments(View clickedButton) method. This seekbar value will then be divided by 1200 as shown in the code below, but I am confused how to link the seekbar value with the math calculation. Any help? Thanks! ``` public c...
2016/02/17
[ "https://Stackoverflow.com/questions/35448973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5938607/" ]
You can cast the integer value of 1 to object to hit the correct indexer. ``` Console.WriteLine(od[(object)1]); ```
Cast the argument to an object to force the use of the object indexer: ``` Console.WriteLine(od[(object)1]); ``` That should work.
73,621,451
I have the follwoing table structure | start | count | | --- | --- | | 2022-08-02 22:13:35 | 20 | | 2022-08-03 04:27:20 | 10 | | 2022-08-03 09:21:48 | 10 | | 2022-08-03 14:25:48 | 10 | | 2022-08-03 14:35:07 | 10 | | 2022-08-03 15:16:09 | 10 | | 2022-08-04 07:09:07 | 20 | | 2022-08-04 10:35:45 | 10 | | 2022-08-04 14:42...
2022/09/06
[ "https://Stackoverflow.com/questions/73621451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2693543/" ]
You can't append content to a script and have the browser "re-parse" the script You can create a new script tag, add the content, and append that to the body ```html <script> const a = `function amb() { console.log('hello')}`; const scr = document.createElement('script'); scr.textContent = a; document.body.ap...
You can use `eval` aswell ```html <script id="append_here"> // the appended function goes in this script </script> <script> a = `function amb() { console.log('hello')}`; document.getElementById("append_here").append(eval(a)); </script> <div id="a"> <button onclick="amb()">amb</button> </div> ```
89,456
This is a long shot but I am looking for a movie I saw in the early 90's. It involved a ship sent to research an abandoned ghost ship. They go through "hyperspace" and find the ship. The ship they find looks like pole with a ball on the end and it is spinning. They dock with it and and find computer terminal and restar...
2015/05/10
[ "https://scifi.stackexchange.com/questions/89456", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/45484/" ]
This sounds like the 1984 movie [*2010,*](http://www.imdb.com/title/tt0086837/) the sequel to the classic [*2001.*](http://www.imdb.com/title/tt0062622/?ref_=nm_knf_i1) Although there's no hyperspace everything else in the description matches. A Soviet crew is sent to Jupiter to find the *Discovery,* the ship that was ...
If I recall correctly there is also **Event Horizon**. Its a sci fi horror flick which got okay ratings, but when I was young it was awesome! It has a similar premise that your requirements ask for.
89,456
This is a long shot but I am looking for a movie I saw in the early 90's. It involved a ship sent to research an abandoned ghost ship. They go through "hyperspace" and find the ship. The ship they find looks like pole with a ball on the end and it is spinning. They dock with it and and find computer terminal and restar...
2015/05/10
[ "https://scifi.stackexchange.com/questions/89456", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/45484/" ]
This sounds like the 1984 movie [*2010,*](http://www.imdb.com/title/tt0086837/) the sequel to the classic [*2001.*](http://www.imdb.com/title/tt0062622/?ref_=nm_knf_i1) Although there's no hyperspace everything else in the description matches. A Soviet crew is sent to Jupiter to find the *Discovery,* the ship that was ...
I was just looking this up yesterday and I think the movie is called " Sunshine " it seems really close to what you described
89,456
This is a long shot but I am looking for a movie I saw in the early 90's. It involved a ship sent to research an abandoned ghost ship. They go through "hyperspace" and find the ship. The ship they find looks like pole with a ball on the end and it is spinning. They dock with it and and find computer terminal and restar...
2015/05/10
[ "https://scifi.stackexchange.com/questions/89456", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/45484/" ]
If I recall correctly there is also **Event Horizon**. Its a sci fi horror flick which got okay ratings, but when I was young it was awesome! It has a similar premise that your requirements ask for.
I was just looking this up yesterday and I think the movie is called " Sunshine " it seems really close to what you described
67,545,006
The first function calculates the depth of a lake and has the volume as parameter. In the second one, I have to pass a volume and a time increment (that I have to increment) and it returns two lists. First List: time increments and the the last time/element in this list corresponds to the volume = 0, when the lake empt...
2021/05/15
[ "https://Stackoverflow.com/questions/67545006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15894806/" ]
`obj[{key:"instagram"}] = "Akrixa"` is equivalent to `obj[({key:"instagram"}).toString()] = "Akrixa"` since objects are keyed by strings. So it's equivalent to `obj["[object Object]"] = "Akrixa"`
The second line `obj[{key:"instagram"}] = "Akrixa";` creates a key within your obj `[{key:"instagram}]` (which is an object inside an array) and then sets the value of that key to `Akrixa`, and the third line does the same but with a different key and value. It might be better to use `obj["instagram"] = "Akrixa"` and ...
67,545,006
The first function calculates the depth of a lake and has the volume as parameter. In the second one, I have to pass a volume and a time increment (that I have to increment) and it returns two lists. First List: time increments and the the last time/element in this list corresponds to the volume = 0, when the lake empt...
2021/05/15
[ "https://Stackoverflow.com/questions/67545006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15894806/" ]
I think because obj[{key:"instagram"}] and obj[{key:"facebook"}] are the same object. When assign value for it, it has the same value. More detail: [How to create dictionary and add key–value pairs dynamically?](https://stackoverflow.com/questions/7196212/how-to-create-dictionary-and-add-key-value-pairs-dynamically). I...
The second line `obj[{key:"instagram"}] = "Akrixa";` creates a key within your obj `[{key:"instagram}]` (which is an object inside an array) and then sets the value of that key to `Akrixa`, and the third line does the same but with a different key and value. It might be better to use `obj["instagram"] = "Akrixa"` and ...
67,545,006
The first function calculates the depth of a lake and has the volume as parameter. In the second one, I have to pass a volume and a time increment (that I have to increment) and it returns two lists. First List: time increments and the the last time/element in this list corresponds to the volume = 0, when the lake empt...
2021/05/15
[ "https://Stackoverflow.com/questions/67545006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15894806/" ]
`obj[{key:"instagram"}] = "Akrixa"` is equivalent to `obj[({key:"instagram"}).toString()] = "Akrixa"` since objects are keyed by strings. So it's equivalent to `obj["[object Object]"] = "Akrixa"`
I think because obj[{key:"instagram"}] and obj[{key:"facebook"}] are the same object. When assign value for it, it has the same value. More detail: [How to create dictionary and add key–value pairs dynamically?](https://stackoverflow.com/questions/7196212/how-to-create-dictionary-and-add-key-value-pairs-dynamically). I...
25,152,752
My internet connection is very fast. Despite that my image loads very slow in the app. Here is the code i have been using. As suggested I have been using async method to perform certain task seperately.. ``` public class ItemPage extends Activity{ ImageView image; String url; @Override protected void onCreate(Bun...
2014/08/06
[ "https://Stackoverflow.com/questions/25152752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3890749/" ]
A JAXB (JSR-222) implementation will represent `byte[]` in XML as the `base64Binary` schema type. If you want an alternate representation you can use an `XmlAdapter`.
Now after you edited your post, it works perfectly. I read the XML with the following code, and in the end it prints the same `"ABCDEF"` string: ``` Path path = Paths.get("trivial.xml"); TokenCollection tc = JAXB.unmarshal(path.toFile(), TokenCollection.class); // Prints "ABCDEF" System.out.println(new String(tc.get...
52,937,935
I'm trying to get ngrok's dynamically generated IP address programmatically by using bash to set globals and env variables. Below is what I have so far. --- Run `ngrok http {server url}` Inside your host root directory run: ``` curl http://localhost:4040/api/tunnels > ~/ngrok_tunnels.json; ``` **Install jq** `...
2018/10/22
[ "https://Stackoverflow.com/questions/52937935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4887993/" ]
For people who want to get a url through ngrok using python there is [the pyngrok library](https://github.com/alexdlaird/pyngrok) ```py from pyngrok import ngrok #Open a HTTP tunnel on the default port 80 #<NgrokTunnel: "http://<public_sub>.ngrok.io" -> "http://localhost:80"> http_tunnel = ngrok.connect() #Open a SSH...
The short answer is yes. You can upgrade to a [paid plan](https://ngrok.com/pricing) and use the `--subdomain` argument to get the same ngrok url every time. The next price level from that includes white labeling where you can use your own custom domain as well.
47,547,627
Is should be possible to upload an artifact (WAR file) to Nexus 3 repository without using Maven?
2017/11/29
[ "https://Stackoverflow.com/questions/47547627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3022264/" ]
When you say “without Maven”, but you really mean “without using `mvn` at all” or just mean “without using Maven to build the WAR”? If the latter, then I would suggest to use [`mvn deploy:deploy-file`](https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html). This can deploy [arbitrary files](https:...
In the [documentation for Nexus Repository Manager 2.9](https://books.sonatype.com/nexus-book/2.9/reference/using-sect-uploading.html), it says: > > To upload artifacts to a repository, select a hosted repository in the Repositories panel and then click on the Artifact Upload tab. > > >
47,547,627
Is should be possible to upload an artifact (WAR file) to Nexus 3 repository without using Maven?
2017/11/29
[ "https://Stackoverflow.com/questions/47547627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3022264/" ]
**EDIT:** You have two options, first if the repository format is raw you can upload any type of file using Direct Deploy as mentioned in their docs: > > Direct Deploy > > > You can do an HTTP PUT of a file into /repository/your-repo-id/path-to-file > > Using curl you can do this with: > > > curl -v -u admin...
In the [documentation for Nexus Repository Manager 2.9](https://books.sonatype.com/nexus-book/2.9/reference/using-sect-uploading.html), it says: > > To upload artifacts to a repository, select a hosted repository in the Repositories panel and then click on the Artifact Upload tab. > > >
47,547,627
Is should be possible to upload an artifact (WAR file) to Nexus 3 repository without using Maven?
2017/11/29
[ "https://Stackoverflow.com/questions/47547627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3022264/" ]
**EDIT:** You have two options, first if the repository format is raw you can upload any type of file using Direct Deploy as mentioned in their docs: > > Direct Deploy > > > You can do an HTTP PUT of a file into /repository/your-repo-id/path-to-file > > Using curl you can do this with: > > > curl -v -u admin...
When you say “without Maven”, but you really mean “without using `mvn` at all” or just mean “without using Maven to build the WAR”? If the latter, then I would suggest to use [`mvn deploy:deploy-file`](https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html). This can deploy [arbitrary files](https:...
60,003,798
So I started with a pull request that was a few commits ahead of `develop`, let's call this branch `feature`. `feature` had 1 merge conflict with develop. So I decided to rebase it and resolve the conflict. 1. `git checkout develop` `git pull` 2. `git checkout feature` `git pull` 3. `git rebase develop` 4. Merge conf...
2020/01/31
[ "https://Stackoverflow.com/questions/60003798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10482684/" ]
Take a look at your branch's git log and try to find anything out of the ordinary. One comment mentioned using `git log`, but you can also use `git log --graph --oneline` to get a visual representation of your branch's commit history. If your branch was rebased correctly, you would see something along the lines of: `...
The problem could be your `feature` branch is probably checked-out from some different branch let's say `test` which is already many commits ahead. So even if you rebased from the same branch you're raising against, you'll get commit inconsistency. To fix this one way I know is, create a new branch from develop branch,...
60,003,798
So I started with a pull request that was a few commits ahead of `develop`, let's call this branch `feature`. `feature` had 1 merge conflict with develop. So I decided to rebase it and resolve the conflict. 1. `git checkout develop` `git pull` 2. `git checkout feature` `git pull` 3. `git rebase develop` 4. Merge conf...
2020/01/31
[ "https://Stackoverflow.com/questions/60003798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10482684/" ]
Take a look at your branch's git log and try to find anything out of the ordinary. One comment mentioned using `git log`, but you can also use `git log --graph --oneline` to get a visual representation of your branch's commit history. If your branch was rebased correctly, you would see something along the lines of: `...
*Here is idea what could happen.* This situation may happen when you continue adding commits into branch which will be rebased. Imagine we have two branches `master` and `dev`. ``` master A-B-C | dev D-E-F ``` Now we push `dev` for review. By the time of waiting for review there is new task. Branch...
6,150,307
I created a new logger ``` my_logger = Logger.new(File.join(Rails.root, 'log', 'my_log.log')) my_logger.info "my message" ``` and I tried logging some bit of texts on this log file. Here is the logger\_level of all my environments. ``` Development = 0 - Logger::DEBUG Staging = 1 - Logger::INFO Production = 1 -...
2011/05/27
[ "https://Stackoverflow.com/questions/6150307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104450/" ]
If you're looking to customize the output of the Rails3 logger, try this gem: <https://github.com/johmas/itslog>
[Rails3 custom logging options?](https://stackoverflow.com/questions/4937396/rails3-custom-logging-options/6318380#6318380)
6,150,307
I created a new logger ``` my_logger = Logger.new(File.join(Rails.root, 'log', 'my_log.log')) my_logger.info "my message" ``` and I tried logging some bit of texts on this log file. Here is the logger\_level of all my environments. ``` Development = 0 - Logger::DEBUG Staging = 1 - Logger::INFO Production = 1 -...
2011/05/27
[ "https://Stackoverflow.com/questions/6150307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104450/" ]
If you're looking to customize the output of the Rails3 logger, try this gem: <https://github.com/johmas/itslog>
Try putting this in application.rb ``` if defined?(Rails) && (Rails.env == 'development') Rails.logger = Logger.new(STDOUT) end ```
6,150,307
I created a new logger ``` my_logger = Logger.new(File.join(Rails.root, 'log', 'my_log.log')) my_logger.info "my message" ``` and I tried logging some bit of texts on this log file. Here is the logger\_level of all my environments. ``` Development = 0 - Logger::DEBUG Staging = 1 - Logger::INFO Production = 1 -...
2011/05/27
[ "https://Stackoverflow.com/questions/6150307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/104450/" ]
[Rails3 custom logging options?](https://stackoverflow.com/questions/4937396/rails3-custom-logging-options/6318380#6318380)
Try putting this in application.rb ``` if defined?(Rails) && (Rails.env == 'development') Rails.logger = Logger.new(STDOUT) end ```
52,561,760
I have a method using 2 Instants in parameters `getIssuesBillable(Instant start, Instant end, ....)`, my question is how I get the first day of a month and the last day of the month using a Java 8 Instant? I already tried use **`withDayOfMonth()`**, and **`lengthOfMonth()`**: ``` LocalDate initial = LocalDate.now(); ...
2018/09/28
[ "https://Stackoverflow.com/questions/52561760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5544884/" ]
tl;dr ===== Use modern *java.time* classes. Here is a brief nonsensical example of starting with an `Instant` (a moment in UTC), assigning a time zone to view that moment through the wall-clock time used by the people of a particular region (a time zone), extracting the year-and-month as perceived in that time zone, ...
For the first day of the month, depends on the time zone: ``` YearMonth.from(Instant.now().atZone(ZoneId.of("UTC"))).atDay(1); ``` For the last day of the month, depends on the time zone: ``` YearMonth.from(Instant.now().atZone(ZoneId.of("UTC"))).atEndOfMonth(); ```
6,304,875
I need to display 3 random images from my sqlite database horizontally. Since it's impossible to make a horizontal `ListView`, I manipulated my way by making 3 ListViews next to each other inside a horizontal oriented `LinearLayout`. So I'm using this method currently: ``` final ListView g = (ListView)findViewById(R....
2011/06/10
[ "https://Stackoverflow.com/questions/6304875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/690672/" ]
I have recently been working on something similar for an iPhone project also using SQLite. Take a look at the following two questions I asked, I suspect they answer what you are trying to do. [SQLite select statement optimisation advice](https://stackoverflow.com/questions/6090905/sqlite-select-statement-optimisation...
Get the rowcount, pick your random numbers in the range 0 to rowcount-1 at the client, then use LIMIT to choose the nth row...
6,304,875
I need to display 3 random images from my sqlite database horizontally. Since it's impossible to make a horizontal `ListView`, I manipulated my way by making 3 ListViews next to each other inside a horizontal oriented `LinearLayout`. So I'm using this method currently: ``` final ListView g = (ListView)findViewById(R....
2011/06/10
[ "https://Stackoverflow.com/questions/6304875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/690672/" ]
FSM save us ... you're still here ListView for single item is a bad idea just put 3 ImagesView in Layout and do something like this ``` final ImageView[] images = new ImageView[3]; ImageLoader loader = new ImageLoader(this); images[0] = (ImageView)findViewById(R.id.imageView1); images[1] = (ImageView)findViewById(R...
Get the rowcount, pick your random numbers in the range 0 to rowcount-1 at the client, then use LIMIT to choose the nth row...
1,952,336
In Physics, I've heard of the smallest length of space as the "Planck length" and the smallest unit of time as the "Planck time". This isn't really a physics question as much a math question, though. If we have a smallest unit of space and of time, why don't our mathematical models of real life systems deal with discr...
2016/10/03
[ "https://math.stackexchange.com/questions/1952336", "https://math.stackexchange.com", "https://math.stackexchange.com/users/131740/" ]
One can think of continuous methods as a limit of discrete processes (think of the derivative as the limit of secant lines, or the usual approach of Riemmann integration as a limit of rectangular areas, for instance). If the discretization is sufficiently fine (Planck measures are very, very small for most of our appl...
I don't think there is a very good answer to your question, but it allows me to highlight a very important point. Physics consists of mathematical models of certain parts of reality that we can measure. This is very important: there is nothing obviously mathematical about reality, yet somehow Physics has been incredibl...
2,532,191
> > Let $k$ be a field containing $\mathbb{F}\_p$ and let $\alpha$ be a root in $k$ for $x^p -x -1 \in \mathbb{F}\_p[x]$. Show that the roots in $k$ are $\alpha, \alpha-1, \dots ,\alpha-p+1$. > > > From a previous exercise, I know that $x^p-x = x(x-1)(x-2)\dots(x-(p-1))$ in $\mathbb{F}\_p[x]$ but I'm not sure how ...
2017/11/22
[ "https://math.stackexchange.com/questions/2532191", "https://math.stackexchange.com", "https://math.stackexchange.com/users/290738/" ]
An element $\alpha$ is a root, if and only if $\alpha^p - \alpha - 1 = 0$, which is equivalent to $$\alpha^p - \alpha = 1.$$ Now you know the factorization of $x^p-x$, great. Let's define $f(x) := x^p-x$. Can you show that $f(x) = f(x-1) = f(x-2) = \ldots = f(x-p+1)$ for all $x \in k$? Once you have that, given that yo...
Consider $\beta\_j=\alpha-j$, where $j \in \{1,2, \ldots ,p-1\}$. Then \begin{align\*} \beta\_j^p-\beta-1&=(\alpha-j)^p-(\alpha-j)-1\\ &=(\alpha^p-j^p)-(\alpha-j)-1\\ &=(\alpha^p-\alpha-1)-(j^p-j)\\ &=0-0. \end{align\*} The first term is $0$ because $\alpha$ is a root, the second term is $0$ by Fermat's little theorem.
112,187
At my public library, I have ready access to resource books from older editions of D&D (only 5e are in heavy demand). Most of the books at the library are 4e. I am interested in converting some of the adventures and/or campaign settings for use with the 5e group I DM. How can I convert these 4e adventures to 5e? My ...
2017/12/21
[ "https://rpg.stackexchange.com/questions/112187", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/39217/" ]
**Yes**. The creature within would take falling damage. It is the sphere itself that is weightless, not the occupant. It is explicitly stated that the sphere can be moved by either internal or external forces. Therefore, if the sphere (for example) rolled over a cliff, the weight of the occupant would cause the sphere...
No -- 1. Fall damage is because kinetic energy is changed into other kinds of energy when you stop / transferred in a different direction (Someone might be able to clarify the science - but I know D&D is not a physics sim). Energy is not transferred through the sphere. 2. As you said yourself effects originating from ...
112,187
At my public library, I have ready access to resource books from older editions of D&D (only 5e are in heavy demand). Most of the books at the library are 4e. I am interested in converting some of the adventures and/or campaign settings for use with the 5e group I DM. How can I convert these 4e adventures to 5e? My ...
2017/12/21
[ "https://rpg.stackexchange.com/questions/112187", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/39217/" ]
No -- 1. Fall damage is because kinetic energy is changed into other kinds of energy when you stop / transferred in a different direction (Someone might be able to clarify the science - but I know D&D is not a physics sim). Energy is not transferred through the sphere. 2. As you said yourself effects originating from ...
RAW : You take fall damage -------------------------- Most other answers try to explain their point using logic, physics and such. However, when answering this question purely with as Rules as Written approach, those concepts do not matter, because of how ORS is worded. Here is the key part of its description, emphas...
112,187
At my public library, I have ready access to resource books from older editions of D&D (only 5e are in heavy demand). Most of the books at the library are 4e. I am interested in converting some of the adventures and/or campaign settings for use with the 5e group I DM. How can I convert these 4e adventures to 5e? My ...
2017/12/21
[ "https://rpg.stackexchange.com/questions/112187", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/39217/" ]
**Yes**. The creature within would take falling damage. It is the sphere itself that is weightless, not the occupant. It is explicitly stated that the sphere can be moved by either internal or external forces. Therefore, if the sphere (for example) rolled over a cliff, the weight of the occupant would cause the sphere...
No, the creatures inside the sphere do not take falling damage. --------------------------------------------------------------- — *The current phrasing of the question means the following paragraph is operating on a different set of assumptions.* The sphere by definition is weightless. Weightless things are not affec...
112,187
At my public library, I have ready access to resource books from older editions of D&D (only 5e are in heavy demand). Most of the books at the library are 4e. I am interested in converting some of the adventures and/or campaign settings for use with the 5e group I DM. How can I convert these 4e adventures to 5e? My ...
2017/12/21
[ "https://rpg.stackexchange.com/questions/112187", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/39217/" ]
No, the creatures inside the sphere do not take falling damage. --------------------------------------------------------------- — *The current phrasing of the question means the following paragraph is operating on a different set of assumptions.* The sphere by definition is weightless. Weightless things are not affec...
RAW : You take fall damage -------------------------- Most other answers try to explain their point using logic, physics and such. However, when answering this question purely with as Rules as Written approach, those concepts do not matter, because of how ORS is worded. Here is the key part of its description, emphas...
112,187
At my public library, I have ready access to resource books from older editions of D&D (only 5e are in heavy demand). Most of the books at the library are 4e. I am interested in converting some of the adventures and/or campaign settings for use with the 5e group I DM. How can I convert these 4e adventures to 5e? My ...
2017/12/21
[ "https://rpg.stackexchange.com/questions/112187", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/39217/" ]
**Yes**. The creature within would take falling damage. It is the sphere itself that is weightless, not the occupant. It is explicitly stated that the sphere can be moved by either internal or external forces. Therefore, if the sphere (for example) rolled over a cliff, the weight of the occupant would cause the sphere...
RAW : You take fall damage -------------------------- Most other answers try to explain their point using logic, physics and such. However, when answering this question purely with as Rules as Written approach, those concepts do not matter, because of how ORS is worded. Here is the key part of its description, emphas...
65,413,192
This question is similar to [this one](https://stackoverflow.com/questions/64119888/how-to-use-java-version-15-in-eclipse-2020-09). I know you need to have [this plugin](https://marketplace.eclipse.org/content/java-15-support-eclipse-2020-09-417) to support Java 15 in eclipse 2020-09, however, it doesn't seem to be ava...
2020/12/22
[ "https://Stackoverflow.com/questions/65413192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6790326/" ]
Because of regressions in 4.18, I decided to recreate 4.17-P-builds repository. Please note this will be available till 4.19 is released or we decide to create a patch for 4.18 release.
I got a answer from the [eclipse forums](https://www.eclipse.org/forums/index.php/t/1106384/) > > Java 15 support is included in eclipse 4.18(2020-12). As part of > cleaning old releases we removed 4.17-P-builds repo as it is not > supported anymore. > > > Please upgrade to 2020-12 to continue work on java 15 > > ...
12,732,147
Just wanted to know what is the **best elegant way** (currently available) to handle CORS (Cross-Origin Resource Sharing) in ASP.NET WebAPI so i can use XmlHttpRequest over multiple domains ? How i can integrate this in the headers of every type of request (GEt, POST, etc..) with OPTIONS too ? Thanks!
2012/10/04
[ "https://Stackoverflow.com/questions/12732147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/575065/" ]
Carlos Figueira has a nice series of posts about CORS and ASP.NET Web API: * [Implementing CORS support in ASP.NET Web APIs](http://blogs.msdn.com/b/carlosfigueira/archive/2012/02/20/implementing-cors-support-in-asp-net-web-apis.aspx) * [Implementing CORS support in ASP.NET Web APIs – Take 2](http://blogs.msdn.com/b/c...
It depends how fine-grained you want to control CORS. If you want to allow any domain for instance you can add static CORS headers to all responses by configuring them in IIS. I chose this approach and [wrote about it here](http://www-jo.se/f.pfleger/cors-and-iis).
12,732,147
Just wanted to know what is the **best elegant way** (currently available) to handle CORS (Cross-Origin Resource Sharing) in ASP.NET WebAPI so i can use XmlHttpRequest over multiple domains ? How i can integrate this in the headers of every type of request (GEt, POST, etc..) with OPTIONS too ? Thanks!
2012/10/04
[ "https://Stackoverflow.com/questions/12732147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/575065/" ]
Tpeczek have a nice found, however while doing my own research ive found something similar and also very elegant ways of handling CORS which enable you to configure your CORS in a config file in App\_Start folder. Its all handled using an open source library called Thinkecture. See details here : <http://brockallen.co...
It depends how fine-grained you want to control CORS. If you want to allow any domain for instance you can add static CORS headers to all responses by configuring them in IIS. I chose this approach and [wrote about it here](http://www-jo.se/f.pfleger/cors-and-iis).
12,732,147
Just wanted to know what is the **best elegant way** (currently available) to handle CORS (Cross-Origin Resource Sharing) in ASP.NET WebAPI so i can use XmlHttpRequest over multiple domains ? How i can integrate this in the headers of every type of request (GEt, POST, etc..) with OPTIONS too ? Thanks!
2012/10/04
[ "https://Stackoverflow.com/questions/12732147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/575065/" ]
There is now CORS support in the nightly of web api <http://blogs.msdn.com/b/yaohuang1/archive/2013/04/05/try-out-asp.net-web-api-cors-support-using-the-nightly-builds.aspx> Use [nuget](http://docs.nuget.org/docs/start-here/installing-nuget) to: * Uninstall the Microsoft.AspNet.Mvc.FixedDisplayModes package. * Insta...
It depends how fine-grained you want to control CORS. If you want to allow any domain for instance you can add static CORS headers to all responses by configuring them in IIS. I chose this approach and [wrote about it here](http://www-jo.se/f.pfleger/cors-and-iis).
12,732,147
Just wanted to know what is the **best elegant way** (currently available) to handle CORS (Cross-Origin Resource Sharing) in ASP.NET WebAPI so i can use XmlHttpRequest over multiple domains ? How i can integrate this in the headers of every type of request (GEt, POST, etc..) with OPTIONS too ? Thanks!
2012/10/04
[ "https://Stackoverflow.com/questions/12732147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/575065/" ]
Add below in web.cofig file(inside the system.webserver element). ``` <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Headers" value="accept, maxdataserviceversion, origin, x-requested-with, dataserviceversion" /> <add name="Access-Control-Allow-Origin" value="*" /> <add n...
It depends how fine-grained you want to control CORS. If you want to allow any domain for instance you can add static CORS headers to all responses by configuring them in IIS. I chose this approach and [wrote about it here](http://www-jo.se/f.pfleger/cors-and-iis).
12,732,147
Just wanted to know what is the **best elegant way** (currently available) to handle CORS (Cross-Origin Resource Sharing) in ASP.NET WebAPI so i can use XmlHttpRequest over multiple domains ? How i can integrate this in the headers of every type of request (GEt, POST, etc..) with OPTIONS too ? Thanks!
2012/10/04
[ "https://Stackoverflow.com/questions/12732147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/575065/" ]
Tpeczek have a nice found, however while doing my own research ive found something similar and also very elegant ways of handling CORS which enable you to configure your CORS in a config file in App\_Start folder. Its all handled using an open source library called Thinkecture. See details here : <http://brockallen.co...
Carlos Figueira has a nice series of posts about CORS and ASP.NET Web API: * [Implementing CORS support in ASP.NET Web APIs](http://blogs.msdn.com/b/carlosfigueira/archive/2012/02/20/implementing-cors-support-in-asp-net-web-apis.aspx) * [Implementing CORS support in ASP.NET Web APIs – Take 2](http://blogs.msdn.com/b/c...
12,732,147
Just wanted to know what is the **best elegant way** (currently available) to handle CORS (Cross-Origin Resource Sharing) in ASP.NET WebAPI so i can use XmlHttpRequest over multiple domains ? How i can integrate this in the headers of every type of request (GEt, POST, etc..) with OPTIONS too ? Thanks!
2012/10/04
[ "https://Stackoverflow.com/questions/12732147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/575065/" ]
Tpeczek have a nice found, however while doing my own research ive found something similar and also very elegant ways of handling CORS which enable you to configure your CORS in a config file in App\_Start folder. Its all handled using an open source library called Thinkecture. See details here : <http://brockallen.co...
There is now CORS support in the nightly of web api <http://blogs.msdn.com/b/yaohuang1/archive/2013/04/05/try-out-asp.net-web-api-cors-support-using-the-nightly-builds.aspx> Use [nuget](http://docs.nuget.org/docs/start-here/installing-nuget) to: * Uninstall the Microsoft.AspNet.Mvc.FixedDisplayModes package. * Insta...
12,732,147
Just wanted to know what is the **best elegant way** (currently available) to handle CORS (Cross-Origin Resource Sharing) in ASP.NET WebAPI so i can use XmlHttpRequest over multiple domains ? How i can integrate this in the headers of every type of request (GEt, POST, etc..) with OPTIONS too ? Thanks!
2012/10/04
[ "https://Stackoverflow.com/questions/12732147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/575065/" ]
Tpeczek have a nice found, however while doing my own research ive found something similar and also very elegant ways of handling CORS which enable you to configure your CORS in a config file in App\_Start folder. Its all handled using an open source library called Thinkecture. See details here : <http://brockallen.co...
Add below in web.cofig file(inside the system.webserver element). ``` <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Headers" value="accept, maxdataserviceversion, origin, x-requested-with, dataserviceversion" /> <add name="Access-Control-Allow-Origin" value="*" /> <add n...
21,493,498
I'm trying to use AJAX to POST to a page and display the results but it's not sending all of the parameters. ``` function change_page(button){ var parent_div = $(button.parentNode); var param = parent_div.attr("id"); var page = this.value; var user = $("#user").val(); var ip = $("#ip").val(); $...
2014/02/01
[ "https://Stackoverflow.com/questions/21493498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2923125/" ]
You are not seeing the variable in the request because its value is undefined. Undefined values are not included in the jQuery POST. For example, when sending data like this... ``` $.ajax({ type: 'POST', data: { a: 1, b: undefined, c: false, d: null } }); ``` ...these are the parameters passed...
``` data: { page: param, url: url, ip: ip } ```
21,493,498
I'm trying to use AJAX to POST to a page and display the results but it's not sending all of the parameters. ``` function change_page(button){ var parent_div = $(button.parentNode); var param = parent_div.attr("id"); var page = this.value; var user = $("#user").val(); var ip = $("#ip").val(); $...
2014/02/01
[ "https://Stackoverflow.com/questions/21493498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2923125/" ]
You are not seeing the variable in the request because its value is undefined. Undefined values are not included in the jQuery POST. For example, when sending data like this... ``` $.ajax({ type: 'POST', data: { a: 1, b: undefined, c: false, d: null } }); ``` ...these are the parameters passed...
All you have to do is this : ``` $.ajax({ url: "gui_info.php", type: 'POST', data: { param : page, user : user, ip : ip }, dataType: "json", // pass json in there success: function(data){ parent_div.html(data); alert(data); } }); ```
21,493,498
I'm trying to use AJAX to POST to a page and display the results but it's not sending all of the parameters. ``` function change_page(button){ var parent_div = $(button.parentNode); var param = parent_div.attr("id"); var page = this.value; var user = $("#user").val(); var ip = $("#ip").val(); $...
2014/02/01
[ "https://Stackoverflow.com/questions/21493498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2923125/" ]
You are not seeing the variable in the request because its value is undefined. Undefined values are not included in the jQuery POST. For example, when sending data like this... ``` $.ajax({ type: 'POST', data: { a: 1, b: undefined, c: false, d: null } }); ``` ...these are the parameters passed...
Try this, ``` page = $(button).val() //If "button" is an element ``` instead of ``` page = this.value ``` change "this" to your element for getting value
52,735,971
**Problem:** I have a session variable that consist of multiple array and each array has a set of values. I wish to unset the specific array that matches the value of a specific variable inside the session array. **Session construction:** [![enter image description here](https://i.stack.imgur.com/QW5NN.png)](https:/...
2018/10/10
[ "https://Stackoverflow.com/questions/52735971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1045160/" ]
If you only want to check the specific occurance on the session against `$answers['evaluationnumber']` and as you say there will only ever be one occurance of the sub array in `$_SESSION['stimuli']`, this would seem the simplest way. ``` if ( $_SESSION['stimuli'][0]['evaluationsnumber'] == $answers['evaluationnumber']...
You should have a look at the [`array_filter`](http://php.net/manual/en/function.array-filter.php) function for php. It will take a array and a filter function. This filter function will be handed every element of your original array. In there check for your desired key. If you return `true` in that function the fi...
54,566,834
How to check if cur.executemany() is success or not in python? ``` a = self.cur.executemany("""insert into test_table(REQUEST_ID,PLATFORM_NAME,SYSTEM_NAME,DB_NAME,TABLE_NAME,COLUMN_NAME,COLUMN_DESC,DATA_TYPE,LENGTH,PRECISION,PRIMARY_KEY_FLAG,CREATED_BY_DS_ID) values(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12)""",rowTup) ...
2019/02/07
[ "https://Stackoverflow.com/questions/54566834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3451858/" ]
You’ll need to handle a notification differently depending on what state your app is in when it’s received: If your app wasn’t running and the user launches it by tapping the push notification, the push notification is passed to your app in the launchOptions of `application(_:didFinishLaunchingWithOptions:)`. If your...
you should fallow below steps **1-) in your AppDelegate, added below code snipped** ``` func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { print(userInfo) } ```...
37,183,450
I have the following code which works using a if-then-else ladder: ``` val test: Array[Array[Int]] = ... val dim = 3 if (dim < test.length - 1) { 1 } else { 0 } ``` casting it as pattern matching I attempt: ``` val dim = 3 val maxDim = test.length - 1 dim match { case _ < maxDim => { 1 ...
2016/05/12
[ "https://Stackoverflow.com/questions/37183450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1142881/" ]
You need an if-clause in your match-case if you need to test a boolean expression. Try this: ``` dim match { case i if i < maxDim => 1 case _ => 0 } ```
`test.lift(dim).fold(0){ _ => 1}` This is not pattern matching, but the whole point is that you don't need pattern matching in this case. **Explanation**: your `if-then` thingy is basically testing whether the index is valid for an array, and returns 1 if it is, and 0 if it isn't (I am assuming, the lack of test for ...
32,648,589
Suppose I have a class TransactionDetails. This table holds transaction of last 10 year. Now How can i get all TransactionDetails of current year I am using criteria as following ``` Criteria criteria = session.getCurrentSession().createCriteria(TransactionDetails.class); criteria.add(Restrictions.eq("entryDate", thi...
2015/09/18
[ "https://Stackoverflow.com/questions/32648589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1097800/" ]
Try `Restrictions.between("entryDate", loDate, highDate)` **Edit:** You could also probably use a (vendor specific) sql restriction. eg: `Restrictions.sqlRestriction("to_char(entry_date, 'YYYY') = ?", "2015", StringType.INSTANCE)` Note: This will likely perform worse than `between`
``` Restrictions.between("entryDate",fromYear, thisYear) ``` can give you what you need. Reference to [API](http://docs.jboss.org/hibernate/orm/3.5/javadocs/org/hibernate/criterion/Restrictions.html) here or compute the year/date 10 years before now and use ``` Restrictions.ge("entryDate",fromYearMinus10);//uses ...
32,648,589
Suppose I have a class TransactionDetails. This table holds transaction of last 10 year. Now How can i get all TransactionDetails of current year I am using criteria as following ``` Criteria criteria = session.getCurrentSession().createCriteria(TransactionDetails.class); criteria.add(Restrictions.eq("entryDate", thi...
2015/09/18
[ "https://Stackoverflow.com/questions/32648589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1097800/" ]
Try `Restrictions.between("entryDate", loDate, highDate)` **Edit:** You could also probably use a (vendor specific) sql restriction. eg: `Restrictions.sqlRestriction("to_char(entry_date, 'YYYY') = ?", "2015", StringType.INSTANCE)` Note: This will likely perform worse than `between`
You need to use `between` restriction together with date range: ``` Calendar lowCal = Calendar.getInstance(); lowCal.set(Calendar.DAY_OF_YEAR, lowCal.getActualMinimum(Calendar.DAY_OF_YEAR); Date lowDate = lowCal.getTime(); Calendar highCal = Calendar.getInstance(); lowCal.set(Calendar.DAY_OF_YEAR, lowCal.getActualMax...
32,648,589
Suppose I have a class TransactionDetails. This table holds transaction of last 10 year. Now How can i get all TransactionDetails of current year I am using criteria as following ``` Criteria criteria = session.getCurrentSession().createCriteria(TransactionDetails.class); criteria.add(Restrictions.eq("entryDate", thi...
2015/09/18
[ "https://Stackoverflow.com/questions/32648589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1097800/" ]
You need to use `between` restriction together with date range: ``` Calendar lowCal = Calendar.getInstance(); lowCal.set(Calendar.DAY_OF_YEAR, lowCal.getActualMinimum(Calendar.DAY_OF_YEAR); Date lowDate = lowCal.getTime(); Calendar highCal = Calendar.getInstance(); lowCal.set(Calendar.DAY_OF_YEAR, lowCal.getActualMax...
``` Restrictions.between("entryDate",fromYear, thisYear) ``` can give you what you need. Reference to [API](http://docs.jboss.org/hibernate/orm/3.5/javadocs/org/hibernate/criterion/Restrictions.html) here or compute the year/date 10 years before now and use ``` Restrictions.ge("entryDate",fromYearMinus10);//uses ...
31,117,879
There is a data source with JNDI name "jdbc/project/SimpleDS" defined in WebSphere 7. In admin console I changed the data source properties: db\_name, db\_port, db\_host , login and password. Whereby the deployed applications which references to "jdbc/project/SimpleDS" data source throws the exception: ``` java.sql.S...
2015/06/29
[ "https://Stackoverflow.com/questions/31117879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4293997/" ]
The action to close the wear app should be `slide` from left to right to close it. You will see `onDestroy` is called. If you just press the button ( I only have a moto 360 1st gen. i.e. the side button), it is like just put the app off the foreground. So just `onStop` and `onStart` pair is called. Hope this late answe...
You need to add finish the app by swiping left to right or by long press (Need to code for the same). Once finish is called, onDestroy will get called.
28,612,625
I'm using JUnit and JMockit to create a unit test method that tests the creation and manipulation of a CSV file. How do I intercept the file that is being created to ensure that is created correctly? ``` @Test public void testPersistResultsAsCSV() throws IOException { final Long id = new Long(1234l); TableRow...
2015/02/19
[ "https://Stackoverflow.com/questions/28612625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4584903/" ]
You should refactor your method under test so that you're supplying it with an output stream or writer instead of having it open the file itself. This is a good idea generally, even outside the context of unit testing, since it makes the code more reusable; for example, you might want to write the output to a socket or...
Should probably use a Rule (dumbest name ever, really has nothing to do with rules per se). [Rules for Files in Unit Tests](https://garygregory.wordpress.com/2010/01/20/junit-tip-use-rules-to-manage-temporary-files-and-folders/)
28,612,625
I'm using JUnit and JMockit to create a unit test method that tests the creation and manipulation of a CSV file. How do I intercept the file that is being created to ensure that is created correctly? ``` @Test public void testPersistResultsAsCSV() throws IOException { final Long id = new Long(1234l); TableRow...
2015/02/19
[ "https://Stackoverflow.com/questions/28612625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4584903/" ]
I am the creator of JMockit, but I will happily say "don't use JMockit" for this. You *can* mock the Java IO classes, but that is almost never a good idea; instead, use a real file on the local filesystem. Your test will be simpler, less fragile, and fast enough (unless you do something bad like reading/writing big fi...
Should probably use a Rule (dumbest name ever, really has nothing to do with rules per se). [Rules for Files in Unit Tests](https://garygregory.wordpress.com/2010/01/20/junit-tip-use-rules-to-manage-temporary-files-and-folders/)
28,612,625
I'm using JUnit and JMockit to create a unit test method that tests the creation and manipulation of a CSV file. How do I intercept the file that is being created to ensure that is created correctly? ``` @Test public void testPersistResultsAsCSV() throws IOException { final Long id = new Long(1234l); TableRow...
2015/02/19
[ "https://Stackoverflow.com/questions/28612625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4584903/" ]
I am the creator of JMockit, but I will happily say "don't use JMockit" for this. You *can* mock the Java IO classes, but that is almost never a good idea; instead, use a real file on the local filesystem. Your test will be simpler, less fragile, and fast enough (unless you do something bad like reading/writing big fi...
You should refactor your method under test so that you're supplying it with an output stream or writer instead of having it open the file itself. This is a good idea generally, even outside the context of unit testing, since it makes the code more reusable; for example, you might want to write the output to a socket or...
1,070
Should we consider this question (1) [Does the Thorncaster Sliver's ability damage have to be assigned before or after blockers are declared?](https://boardgames.stackexchange.com/q/12656/2474) a duplicate of this one (2) [Do Thorncaster Sliver's triggered abilities go on the stack?](https://boardgames.stackexchange.co...
2013/08/06
[ "https://boardgames.meta.stackexchange.com/questions/1070", "https://boardgames.meta.stackexchange.com", "https://boardgames.meta.stackexchange.com/users/2474/" ]
These two questions aren't duplicates. Even going by the rule of thumb of "if two questions have the same answer, they're duplicates", they're not duplicates. It only appears that way at first glance because of the lengthy citation which explains both situations. In reality, though, the answers are more like this: * ...
I agree it is not a duplicate (of that question), they ask different things. One asks if something uses the stack, and the other is about stack resolution during combat. My original comment on the question caused the question's author to mark it as a duplicate himself which I assume caused the 'close vote frenzy'. >...
1,070
Should we consider this question (1) [Does the Thorncaster Sliver's ability damage have to be assigned before or after blockers are declared?](https://boardgames.stackexchange.com/q/12656/2474) a duplicate of this one (2) [Do Thorncaster Sliver's triggered abilities go on the stack?](https://boardgames.stackexchange.co...
2013/08/06
[ "https://boardgames.meta.stackexchange.com/questions/1070", "https://boardgames.meta.stackexchange.com", "https://boardgames.meta.stackexchange.com/users/2474/" ]
These two questions aren't duplicates. Even going by the rule of thumb of "if two questions have the same answer, they're duplicates", they're not duplicates. It only appears that way at first glance because of the lengthy citation which explains both situations. In reality, though, the answers are more like this: * ...
Looking at both questions (although I am hardly fluent in M:tG-ese) I would say that no, they are not duplicates. The questions themselves don't necessarily need to be asking the exact same thing to be duplicates, but unless you can be reasonably sure that *every answer to the original question* (be they extant answer...
57,611,608
I am trying to extract whitespace separated columns with `sed`. Here is an example with `ps`: ``` $ ps | sed -n -E "s/^(\s*([^\s]+)){4}.*$/\0/p" PID TTY TIME CMD 8446 pts/185 00:00:00 ps 8447 pts/185 00:00:00 sed 54326 pts/185 00:00:00 bash $ ps | sed -n -E "s/^(\s*([^\s]+)){4}.*$/\1/p" D t t t ``` W...
2019/08/22
[ "https://Stackoverflow.com/questions/57611608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/258483/" ]
In your code, `user` is a [DocumentSnapshot](https://firebase.google.com/docs/reference/js/firebase.firestore.DocumentSnapshot) type object. If you want to delete the document, you can use `user.ref.delete()`. It returns a promise, so you will need to await it. Deleting a document will not also delete a user account i...
Building off Doug Stevenson's answer, this is the function that ultimately worked. ``` async deleteProfile (user) { await db.collection("users").doc(user).delete() await firebase.auth().currentUser.delete() } ``` `await db.collection("users").doc(user).delete()` accepts "user" as an argument fro...
57,611,608
I am trying to extract whitespace separated columns with `sed`. Here is an example with `ps`: ``` $ ps | sed -n -E "s/^(\s*([^\s]+)){4}.*$/\0/p" PID TTY TIME CMD 8446 pts/185 00:00:00 ps 8447 pts/185 00:00:00 sed 54326 pts/185 00:00:00 bash $ ps | sed -n -E "s/^(\s*([^\s]+)){4}.*$/\1/p" D t t t ``` W...
2019/08/22
[ "https://Stackoverflow.com/questions/57611608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/258483/" ]
In your code, `user` is a [DocumentSnapshot](https://firebase.google.com/docs/reference/js/firebase.firestore.DocumentSnapshot) type object. If you want to delete the document, you can use `user.ref.delete()`. It returns a promise, so you will need to await it. Deleting a document will not also delete a user account i...
try this ``` <button class="..." @click="deleteProfile(currentUser.uid)">Delete</button> ``` and ``` methods: { async deleteProfile(dataId) { fireDb.collection("yourCollection").doc(dataId).delete() .then(() => { alert('Deleted') }) } } ```
57,611,608
I am trying to extract whitespace separated columns with `sed`. Here is an example with `ps`: ``` $ ps | sed -n -E "s/^(\s*([^\s]+)){4}.*$/\0/p" PID TTY TIME CMD 8446 pts/185 00:00:00 ps 8447 pts/185 00:00:00 sed 54326 pts/185 00:00:00 bash $ ps | sed -n -E "s/^(\s*([^\s]+)){4}.*$/\1/p" D t t t ``` W...
2019/08/22
[ "https://Stackoverflow.com/questions/57611608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/258483/" ]
try this ``` <button class="..." @click="deleteProfile(currentUser.uid)">Delete</button> ``` and ``` methods: { async deleteProfile(dataId) { fireDb.collection("yourCollection").doc(dataId).delete() .then(() => { alert('Deleted') }) } } ```
Building off Doug Stevenson's answer, this is the function that ultimately worked. ``` async deleteProfile (user) { await db.collection("users").doc(user).delete() await firebase.auth().currentUser.delete() } ``` `await db.collection("users").doc(user).delete()` accepts "user" as an argument fro...
1,742,913
This is a very strange request for advice for which I truly feel there is no real answer. In my project I have archiving routines on various objects that have been consumed for logical calculations, I archive these items for the sake of audit trail and to check up on calculation errors or prove correctiveness at a late...
2009/11/16
[ "https://Stackoverflow.com/questions/1742913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/209358/" ]
I think there are two pieces to this problem you are describing: 1. First you need some unit tests that you can build which will represent technical requirements of the system. Think of the unit tests as the rules which you have set up to technically accomplish the goal that the end user desires. In this way, I would ...
The number one best practice for unit tests is just do it! Beyond that, I'd like to recommend [xUnit Test Patterns: Refactoring Test Code](http://xunitpatterns.com/) by Gerard Meszaros.
1,742,913
This is a very strange request for advice for which I truly feel there is no real answer. In my project I have archiving routines on various objects that have been consumed for logical calculations, I archive these items for the sake of audit trail and to check up on calculation errors or prove correctiveness at a late...
2009/11/16
[ "https://Stackoverflow.com/questions/1742913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/209358/" ]
One best practice is to make sure the tests can be run in any order. You could separate the produce routines from the archive routines, perhaps by using "gold" data on the archive routing.
The number one best practice for unit tests is just do it! Beyond that, I'd like to recommend [xUnit Test Patterns: Refactoring Test Code](http://xunitpatterns.com/) by Gerard Meszaros.
1,742,913
This is a very strange request for advice for which I truly feel there is no real answer. In my project I have archiving routines on various objects that have been consumed for logical calculations, I archive these items for the sake of audit trail and to check up on calculation errors or prove correctiveness at a late...
2009/11/16
[ "https://Stackoverflow.com/questions/1742913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/209358/" ]
I think there are two pieces to this problem you are describing: 1. First you need some unit tests that you can build which will represent technical requirements of the system. Think of the unit tests as the rules which you have set up to technically accomplish the goal that the end user desires. In this way, I would ...
One best practice is to make sure the tests can be run in any order. You could separate the produce routines from the archive routines, perhaps by using "gold" data on the archive routing.
1,825,278
I'm planning to use flash image rotator based on xml where are defined paths from all images that will be rotated. What I wanted to do is to use this rotator for random images rotating. Each time page is refreshed new xml file is created (existing one is replaced with new one). Well, I was thinking and came to this: - ...
2009/12/01
[ "https://Stackoverflow.com/questions/1825278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/168535/" ]
Reads the whole thing. You'll be safe with what you've got. You might want to add a cache breaker to the end of the XML request too by attaching a random number on the end of the query string: www.myserver.com/xml.asp?random=189473737
@ Pete Duncanson First, thanks for answering so fast :) I'm not pretty sure if I understood you... this is example xml of jw flash rotator in which I inserted random query at the bottom of xml file: ``` <?xml version="1.0" encoding="utf-8"?> <playlist version="1" xmlns="http://xspf.org/ns/0/"> <trackList> ...
120,446
I recently received dual citizenship (born Canadian and acquired Italian). I am currently in Canada and last entered the country on my Canadian passport. If I decide to leave Canada on my Italian passport, will the Canadian government be aware of this? Are these two passports linked in any way? ie. Is the Canadian gove...
2018/08/12
[ "https://travel.stackexchange.com/questions/120446", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/82795/" ]
No, there's no such sharing. Canada doesn't do border control on exit; however the check-in staff will transmit data to the CBSA. At check-in when leaving Canada, you should always present the Canadian passport, as that is what needs to be recorded by the CBSA. If the check-in staff asks for a return/onward ticket f...
As a Canadian citizen, the Canadian government does not keep track of, or care, when or how long you are in the country. You may leave at any time without telling anybody. This also means that you can enter Canada at any time and be admitted (assuming you can prove your Canadian citizenship). For your specific questi...
33,903,116
I use a enum to define several variations which can be added to a product (custom logo, colors, etc.). Each variation has several options (ID, description in two languages, where in the process the changes are made, price, etc.). It has methods to define the variation further (for example which color should be used) or...
2015/11/24
[ "https://Stackoverflow.com/questions/33903116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5587505/" ]
No, you can't do that with enums. There is always exactly one instance of each enum value. If you change the data on the enum (e.g. with one of your `setOpn()` methods) it is changed globally, because there is only one. It's best to make the data on an enum immutable. Then, for the variable options, you can associate ...
There is only one instance of each enum value. Think of them as global variables enforced by the compiler. ``` enumVar = TestEnum.TEST2; enums.add(enumVar); enumVar = null; enumVar = TestEnum.TEST2; enumVar.setOp1("new op21"); enumVar.setOp2("new op22"); enumVar.setOp3("new op23"); enums.add(enumVar); enumVar = null;...
33,903,116
I use a enum to define several variations which can be added to a product (custom logo, colors, etc.). Each variation has several options (ID, description in two languages, where in the process the changes are made, price, etc.). It has methods to define the variation further (for example which color should be used) or...
2015/11/24
[ "https://Stackoverflow.com/questions/33903116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5587505/" ]
No, enums are not a good fit for describing objects which are similar but have different states. Enum constants are *static*. You don't have two different instances of `TEST1`. You have just one. Both of the list entries that refer to `TEST2` in your example, refer to the same instance. It's not a copy, it's a second ...
No, you can't do that with enums. There is always exactly one instance of each enum value. If you change the data on the enum (e.g. with one of your `setOpn()` methods) it is changed globally, because there is only one. It's best to make the data on an enum immutable. Then, for the variable options, you can associate ...
33,903,116
I use a enum to define several variations which can be added to a product (custom logo, colors, etc.). Each variation has several options (ID, description in two languages, where in the process the changes are made, price, etc.). It has methods to define the variation further (for example which color should be used) or...
2015/11/24
[ "https://Stackoverflow.com/questions/33903116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5587505/" ]
No, you can't do that with enums. There is always exactly one instance of each enum value. If you change the data on the enum (e.g. with one of your `setOpn()` methods) it is changed globally, because there is only one. It's best to make the data on an enum immutable. Then, for the variable options, you can associate ...
Normally, an enum is invariant by definition. By adding setters to your enum, you make it variant. As for your question, it's because you have the same reference to `TEST2` in your array. Since it's a reference, the second and the third element is exacly the same. So if you modify any of the `TEST2` element, the othe...
33,903,116
I use a enum to define several variations which can be added to a product (custom logo, colors, etc.). Each variation has several options (ID, description in two languages, where in the process the changes are made, price, etc.). It has methods to define the variation further (for example which color should be used) or...
2015/11/24
[ "https://Stackoverflow.com/questions/33903116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5587505/" ]
No, enums are not a good fit for describing objects which are similar but have different states. Enum constants are *static*. You don't have two different instances of `TEST1`. You have just one. Both of the list entries that refer to `TEST2` in your example, refer to the same instance. It's not a copy, it's a second ...
There is only one instance of each enum value. Think of them as global variables enforced by the compiler. ``` enumVar = TestEnum.TEST2; enums.add(enumVar); enumVar = null; enumVar = TestEnum.TEST2; enumVar.setOp1("new op21"); enumVar.setOp2("new op22"); enumVar.setOp3("new op23"); enums.add(enumVar); enumVar = null;...
33,903,116
I use a enum to define several variations which can be added to a product (custom logo, colors, etc.). Each variation has several options (ID, description in two languages, where in the process the changes are made, price, etc.). It has methods to define the variation further (for example which color should be used) or...
2015/11/24
[ "https://Stackoverflow.com/questions/33903116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5587505/" ]
There is only one instance of each enum value. Think of them as global variables enforced by the compiler. ``` enumVar = TestEnum.TEST2; enums.add(enumVar); enumVar = null; enumVar = TestEnum.TEST2; enumVar.setOp1("new op21"); enumVar.setOp2("new op22"); enumVar.setOp3("new op23"); enums.add(enumVar); enumVar = null;...
Normally, an enum is invariant by definition. By adding setters to your enum, you make it variant. As for your question, it's because you have the same reference to `TEST2` in your array. Since it's a reference, the second and the third element is exacly the same. So if you modify any of the `TEST2` element, the othe...
33,903,116
I use a enum to define several variations which can be added to a product (custom logo, colors, etc.). Each variation has several options (ID, description in two languages, where in the process the changes are made, price, etc.). It has methods to define the variation further (for example which color should be used) or...
2015/11/24
[ "https://Stackoverflow.com/questions/33903116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5587505/" ]
The other answers on this page are likely all correct, but might not really help you solve your problem. Instead of an enum, try implementing a plain old class, but include a `clone()` method. Then, you can create a few "default" instances of the class that each represent a default product configuration. When a user s...
There is only one instance of each enum value. Think of them as global variables enforced by the compiler. ``` enumVar = TestEnum.TEST2; enums.add(enumVar); enumVar = null; enumVar = TestEnum.TEST2; enumVar.setOp1("new op21"); enumVar.setOp2("new op22"); enumVar.setOp3("new op23"); enums.add(enumVar); enumVar = null;...
33,903,116
I use a enum to define several variations which can be added to a product (custom logo, colors, etc.). Each variation has several options (ID, description in two languages, where in the process the changes are made, price, etc.). It has methods to define the variation further (for example which color should be used) or...
2015/11/24
[ "https://Stackoverflow.com/questions/33903116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5587505/" ]
No, enums are not a good fit for describing objects which are similar but have different states. Enum constants are *static*. You don't have two different instances of `TEST1`. You have just one. Both of the list entries that refer to `TEST2` in your example, refer to the same instance. It's not a copy, it's a second ...
Normally, an enum is invariant by definition. By adding setters to your enum, you make it variant. As for your question, it's because you have the same reference to `TEST2` in your array. Since it's a reference, the second and the third element is exacly the same. So if you modify any of the `TEST2` element, the othe...
33,903,116
I use a enum to define several variations which can be added to a product (custom logo, colors, etc.). Each variation has several options (ID, description in two languages, where in the process the changes are made, price, etc.). It has methods to define the variation further (for example which color should be used) or...
2015/11/24
[ "https://Stackoverflow.com/questions/33903116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5587505/" ]
No, enums are not a good fit for describing objects which are similar but have different states. Enum constants are *static*. You don't have two different instances of `TEST1`. You have just one. Both of the list entries that refer to `TEST2` in your example, refer to the same instance. It's not a copy, it's a second ...
The other answers on this page are likely all correct, but might not really help you solve your problem. Instead of an enum, try implementing a plain old class, but include a `clone()` method. Then, you can create a few "default" instances of the class that each represent a default product configuration. When a user s...
33,903,116
I use a enum to define several variations which can be added to a product (custom logo, colors, etc.). Each variation has several options (ID, description in two languages, where in the process the changes are made, price, etc.). It has methods to define the variation further (for example which color should be used) or...
2015/11/24
[ "https://Stackoverflow.com/questions/33903116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5587505/" ]
The other answers on this page are likely all correct, but might not really help you solve your problem. Instead of an enum, try implementing a plain old class, but include a `clone()` method. Then, you can create a few "default" instances of the class that each represent a default product configuration. When a user s...
Normally, an enum is invariant by definition. By adding setters to your enum, you make it variant. As for your question, it's because you have the same reference to `TEST2` in your array. Since it's a reference, the second and the third element is exacly the same. So if you modify any of the `TEST2` element, the othe...
7,132,888
In Doctrine 1.2, it is possible to set up [Key Mapping](http://www.doctrine-project.org/projects/orm/1.2/docs/manual/component-overview/en#collection:key-mapping) for a table where `Doctrine_Collection` objects created by that table will populate keys from a particular column in each record in the collection. An examp...
2011/08/20
[ "https://Stackoverflow.com/questions/7132888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
While exploring a similar issue, I came across [this example](http://www.doctrine-project.org/documentation/manual/1_2/pl/yaml-schema-files#relationships%3amany-to-many): > > > ``` > --- > User: > columns: > ... > attributes: > export: all > validate: true > > ``` > > Applying the same principle ...
If it is possible, it is not well documented. You can specify options for a table in the table definition, [like this](http://www.doctrine-project.org/documentation/manual/1_2/pl/yaml-schema-files#features-examples%3aoptions) Knowing that ``` const ATTR_COLL_KEY = 108; ``` I would try : ``` User: opt...
11,987,494
I'm creating XML document using XDocument in C#. I have a question. Is ``` <Simple xmlns = "Example"></Simple> ``` equivalent to ``` <Example:Simple></Example:Simple> ``` ? I tried to get second solution with XNamespace and XElement in C#, but I get only first.
2012/08/16
[ "https://Stackoverflow.com/questions/11987494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/873387/" ]
No. The first example creates a *Simple* element in the Example namespace (note that namespaces are usually expressed as URIs) The second example creates a *Simple* element in whatever namespace is associated with the Example prefix (as defined by an `xmlns` attribute). These would be equivalent: ``` <xml xmlns="...
In the first example, you have defined a *default* namespace which applies to any element/attribute that is not prefixed with its own namespace. In the second example, you have not defined a namespace.
11,987,494
I'm creating XML document using XDocument in C#. I have a question. Is ``` <Simple xmlns = "Example"></Simple> ``` equivalent to ``` <Example:Simple></Example:Simple> ``` ? I tried to get second solution with XNamespace and XElement in C#, but I get only first.
2012/08/16
[ "https://Stackoverflow.com/questions/11987494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/873387/" ]
No. The first example creates a *Simple* element in the Example namespace (note that namespaces are usually expressed as URIs) The second example creates a *Simple* element in whatever namespace is associated with the Example prefix (as defined by an `xmlns` attribute). These would be equivalent: ``` <xml xmlns="...
No, because xml namespaces allow for characters which aren't supported by element names, you can't prefix an element tag name with its namespace like that. Add a namespace prefix, like so: ``` <alias:Simple xmlns:alias = "Example"></alias:Simple> ```
11,987,494
I'm creating XML document using XDocument in C#. I have a question. Is ``` <Simple xmlns = "Example"></Simple> ``` equivalent to ``` <Example:Simple></Example:Simple> ``` ? I tried to get second solution with XNamespace and XElement in C#, but I get only first.
2012/08/16
[ "https://Stackoverflow.com/questions/11987494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/873387/" ]
No. The first example creates a *Simple* element in the Example namespace (note that namespaces are usually expressed as URIs) The second example creates a *Simple* element in whatever namespace is associated with the Example prefix (as defined by an `xmlns` attribute). These would be equivalent: ``` <xml xmlns="...
No, but it's equivalent to: ``` <Example:Simple xmlns:Example="Example"></Example:Simple> ``` It's a bad idea to use relative URIs as the namespace name, since this XML now has a different namespace depending on where it came from. So always give the full URI. E.g if the XML was being received from `http://example.n...
9,035,052
I got this compiler error: > > You cannot reduce the visibility of a inherited method. > > > I have the following code ``` class Parent { public void func() { System.out.println("in Parent"); } } public class TestClass extends Parent { public static void main(String args[]) { ...
2012/01/27
[ "https://Stackoverflow.com/questions/9035052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/646276/" ]
It's because the subclass has visibility of `private` for the `void func()` method, but the superclass has visibility `public`. If your code was allowed to compile, it would explode at runtime if you did this: ``` parent p = new TestClass(); p.func(); // boom - func is public in parent, but TestClass's impl is privat...
From [section 8.4.8.3 of the Java Language specification](http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.8.3): > > The access modifier (§6.6) of an overriding or hiding method must provide at least as much access as the overridden or hidden method, or a compile-time error occurs. In more detai...
9,035,052
I got this compiler error: > > You cannot reduce the visibility of a inherited method. > > > I have the following code ``` class Parent { public void func() { System.out.println("in Parent"); } } public class TestClass extends Parent { public static void main(String args[]) { ...
2012/01/27
[ "https://Stackoverflow.com/questions/9035052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/646276/" ]
It's because the subclass has visibility of `private` for the `void func()` method, but the superclass has visibility `public`. If your code was allowed to compile, it would explode at runtime if you did this: ``` parent p = new TestClass(); p.func(); // boom - func is public in parent, but TestClass's impl is privat...
If you think about it, not being able to do this makes sense.. The reason is that you could pass the child object around as if it's the parent one (i.e you can use the parent type as the reference type to a TestClass instance). e.g. ``` parent p = new TestClass(); ``` There maybe some code elsewhere which uses...
9,035,052
I got this compiler error: > > You cannot reduce the visibility of a inherited method. > > > I have the following code ``` class Parent { public void func() { System.out.println("in Parent"); } } public class TestClass extends Parent { public static void main(String args[]) { ...
2012/01/27
[ "https://Stackoverflow.com/questions/9035052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/646276/" ]
From [section 8.4.8.3 of the Java Language specification](http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.8.3): > > The access modifier (§6.6) of an overriding or hiding method must provide at least as much access as the overridden or hidden method, or a compile-time error occurs. In more detai...
If you think about it, not being able to do this makes sense.. The reason is that you could pass the child object around as if it's the parent one (i.e you can use the parent type as the reference type to a TestClass instance). e.g. ``` parent p = new TestClass(); ``` There maybe some code elsewhere which uses...
59,820,686
I've been wrecking my brain to figure out a way to attach a little CSS triangle to a `MatTooltip` in Angular that switches from being at the `top` when the tooltip is displayed below the host element (default) to being at the `bottom` when the tooltip is above the host element (e.g. when the host element is too close t...
2020/01/20
[ "https://Stackoverflow.com/questions/59820686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12746982/" ]
**It is possible.** Since MatTooltip controls its positioning via `transform-origin`, you can make use of it. For example, `.mat-tooltip[style*="transform-origin: left center"]` only selects tooltips shown to the right of its parent, so you can display the triangle on the left side of the tooltip. **Values of `trans...
Welcome to SO! Although you can use css to draw pointed triangle to `mat-tooltip` but you cannot move its position according to View-port/DOM view like above or below, So Its not possible to move the pointed triangle. **Solution:** > > I have used SAT Popover for styling tooltips. You can give it an > angular com...
59,820,686
I've been wrecking my brain to figure out a way to attach a little CSS triangle to a `MatTooltip` in Angular that switches from being at the `top` when the tooltip is displayed below the host element (default) to being at the `bottom` when the tooltip is above the host element (e.g. when the host element is too close t...
2020/01/20
[ "https://Stackoverflow.com/questions/59820686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12746982/" ]
**It is possible.** Since MatTooltip controls its positioning via `transform-origin`, you can make use of it. For example, `.mat-tooltip[style*="transform-origin: left center"]` only selects tooltips shown to the right of its parent, so you can display the triangle on the left side of the tooltip. **Values of `trans...
Step 1 - Add the mat CSS class "matTooltipClass="below"" in HTML control. Step 2 - Add the below CSS class in you CSS file. ``` .mat-tooltip { background-color: white; border-bottom-color: white; color: black; margin: 16px; border-radius: 3px; outline: none; box-shadow: 0 0 10px #9f9fa3; ...
32,450,516
The ECMAScript 2015 specification mention the keyword (or words?) ***new.target*** exactly 3 times - 1 time in [14.2.3](http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions-static-semantics-contains): > > Normally, Contains does not look inside most function forms However, > Contains is use...
2015/09/08
[ "https://Stackoverflow.com/questions/32450516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3887516/" ]
You didn't find it in the spec because in the syntax definitions it is written with blanks, as `new . target`. The name of the expression is `NewTarget`, and you'll find that term a few times around. *NewTarget* is the first of the so-called [*meta properties*](http://www.ecma-international.org/ecma-262/6.0/#sec-meta-...
It's primarily intended as a better way to detect when a constructor is called without `new`. From <http://www.2ality.com/2015/02/es6-classes-final.html>: > > `new.target` is an implicit parameter that all functions have. It is to constructor calls what `this` is to method calls. > > > So I can write: ``` funct...
19,958,908
Let's say I have the following html: ``` <table> <thead> <tr> <th class="alignRight">Header1</th> <th>Header2</th> <th class="alignLeft">Header3</th> </tr> </thead> <tbody> <tr> <td>Row1</td> //Add class="alignRight" <td>Ro...
2013/11/13
[ "https://Stackoverflow.com/questions/19958908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1751883/" ]
Try ``` $('table thead th[class]').each(function () { $('table tbody td:nth-child(' + ($(this).index() + 1) + ')').addClass(this.className) }) ``` Demo: [Fiddle](http://jsfiddle.net/arunpjohny/s5D7e/)
Your code doesn't do what you think it does: ``` // find all tr's that have a th with class `alignRight` and add class `th.alignRight` to them $('tr').has('th.alignRight').addClass('th.alignRight'); // find all tr's that have a th with class `alignLeft` and add class `th.alignLeft` to them $('tr').has('th.alignLeft')....
19,958,908
Let's say I have the following html: ``` <table> <thead> <tr> <th class="alignRight">Header1</th> <th>Header2</th> <th class="alignLeft">Header3</th> </tr> </thead> <tbody> <tr> <td>Row1</td> //Add class="alignRight" <td>Ro...
2013/11/13
[ "https://Stackoverflow.com/questions/19958908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1751883/" ]
Try ``` $('table thead th[class]').each(function () { $('table tbody td:nth-child(' + ($(this).index() + 1) + ')').addClass(this.className) }) ``` Demo: [Fiddle](http://jsfiddle.net/arunpjohny/s5D7e/)
None of your addClass strings are valid. Whan adding a class you only provide the className.... no `dot` in it ``` /* would add class to the TR*/ $('tr').has('th.alignLeft').addClass('alignLeft'); ``` Now to add to the TD can simply use selector ``` $('tr th.alignLeft td').addClass('alignLeft'); ```
19,958,908
Let's say I have the following html: ``` <table> <thead> <tr> <th class="alignRight">Header1</th> <th>Header2</th> <th class="alignLeft">Header3</th> </tr> </thead> <tbody> <tr> <td>Row1</td> //Add class="alignRight" <td>Ro...
2013/11/13
[ "https://Stackoverflow.com/questions/19958908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1751883/" ]
I think you don't see how jquery selectors work. `$('thead.tr')` means : find me all `thead` which has the `tr` class. Visibly not what you want to do. Here a code that should work : ``` $('tbody tr td').each(function(index){ //index contains the current td index in the parent tr (1,2,3),(1,2,3)... //if the ...
Try ``` $('table thead th[class]').each(function () { $('table tbody td:nth-child(' + ($(this).index() + 1) + ')').addClass(this.className) }) ``` Demo: [Fiddle](http://jsfiddle.net/arunpjohny/s5D7e/)
19,958,908
Let's say I have the following html: ``` <table> <thead> <tr> <th class="alignRight">Header1</th> <th>Header2</th> <th class="alignLeft">Header3</th> </tr> </thead> <tbody> <tr> <td>Row1</td> //Add class="alignRight" <td>Ro...
2013/11/13
[ "https://Stackoverflow.com/questions/19958908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1751883/" ]
Try ``` $('table thead th[class]').each(function () { $('table tbody td:nth-child(' + ($(this).index() + 1) + ')').addClass(this.className) }) ``` Demo: [Fiddle](http://jsfiddle.net/arunpjohny/s5D7e/)
Here is a solution: [(fiddle here)](http://jsfiddle.net/8BZU4/) ``` var headrow = $('thead tr').children(); $('tbody tr').each(function(){ var row = $(this).children(); for(var i=0; i<headrow.length; ++i){ if($(headrow[i]).hasClass("alignRight")){ $(row[i]).addClass("alignRight"); } if(...
19,958,908
Let's say I have the following html: ``` <table> <thead> <tr> <th class="alignRight">Header1</th> <th>Header2</th> <th class="alignLeft">Header3</th> </tr> </thead> <tbody> <tr> <td>Row1</td> //Add class="alignRight" <td>Ro...
2013/11/13
[ "https://Stackoverflow.com/questions/19958908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1751883/" ]
Your code doesn't do what you think it does: ``` // find all tr's that have a th with class `alignRight` and add class `th.alignRight` to them $('tr').has('th.alignRight').addClass('th.alignRight'); // find all tr's that have a th with class `alignLeft` and add class `th.alignLeft` to them $('tr').has('th.alignLeft')....
None of your addClass strings are valid. Whan adding a class you only provide the className.... no `dot` in it ``` /* would add class to the TR*/ $('tr').has('th.alignLeft').addClass('alignLeft'); ``` Now to add to the TD can simply use selector ``` $('tr th.alignLeft td').addClass('alignLeft'); ```
19,958,908
Let's say I have the following html: ``` <table> <thead> <tr> <th class="alignRight">Header1</th> <th>Header2</th> <th class="alignLeft">Header3</th> </tr> </thead> <tbody> <tr> <td>Row1</td> //Add class="alignRight" <td>Ro...
2013/11/13
[ "https://Stackoverflow.com/questions/19958908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1751883/" ]
I think you don't see how jquery selectors work. `$('thead.tr')` means : find me all `thead` which has the `tr` class. Visibly not what you want to do. Here a code that should work : ``` $('tbody tr td').each(function(index){ //index contains the current td index in the parent tr (1,2,3),(1,2,3)... //if the ...
Your code doesn't do what you think it does: ``` // find all tr's that have a th with class `alignRight` and add class `th.alignRight` to them $('tr').has('th.alignRight').addClass('th.alignRight'); // find all tr's that have a th with class `alignLeft` and add class `th.alignLeft` to them $('tr').has('th.alignLeft')....
19,958,908
Let's say I have the following html: ``` <table> <thead> <tr> <th class="alignRight">Header1</th> <th>Header2</th> <th class="alignLeft">Header3</th> </tr> </thead> <tbody> <tr> <td>Row1</td> //Add class="alignRight" <td>Ro...
2013/11/13
[ "https://Stackoverflow.com/questions/19958908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1751883/" ]
Your code doesn't do what you think it does: ``` // find all tr's that have a th with class `alignRight` and add class `th.alignRight` to them $('tr').has('th.alignRight').addClass('th.alignRight'); // find all tr's that have a th with class `alignLeft` and add class `th.alignLeft` to them $('tr').has('th.alignLeft')....
Here is a solution: [(fiddle here)](http://jsfiddle.net/8BZU4/) ``` var headrow = $('thead tr').children(); $('tbody tr').each(function(){ var row = $(this).children(); for(var i=0; i<headrow.length; ++i){ if($(headrow[i]).hasClass("alignRight")){ $(row[i]).addClass("alignRight"); } if(...
19,958,908
Let's say I have the following html: ``` <table> <thead> <tr> <th class="alignRight">Header1</th> <th>Header2</th> <th class="alignLeft">Header3</th> </tr> </thead> <tbody> <tr> <td>Row1</td> //Add class="alignRight" <td>Ro...
2013/11/13
[ "https://Stackoverflow.com/questions/19958908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1751883/" ]
I think you don't see how jquery selectors work. `$('thead.tr')` means : find me all `thead` which has the `tr` class. Visibly not what you want to do. Here a code that should work : ``` $('tbody tr td').each(function(index){ //index contains the current td index in the parent tr (1,2,3),(1,2,3)... //if the ...
None of your addClass strings are valid. Whan adding a class you only provide the className.... no `dot` in it ``` /* would add class to the TR*/ $('tr').has('th.alignLeft').addClass('alignLeft'); ``` Now to add to the TD can simply use selector ``` $('tr th.alignLeft td').addClass('alignLeft'); ```
19,958,908
Let's say I have the following html: ``` <table> <thead> <tr> <th class="alignRight">Header1</th> <th>Header2</th> <th class="alignLeft">Header3</th> </tr> </thead> <tbody> <tr> <td>Row1</td> //Add class="alignRight" <td>Ro...
2013/11/13
[ "https://Stackoverflow.com/questions/19958908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1751883/" ]
I think you don't see how jquery selectors work. `$('thead.tr')` means : find me all `thead` which has the `tr` class. Visibly not what you want to do. Here a code that should work : ``` $('tbody tr td').each(function(index){ //index contains the current td index in the parent tr (1,2,3),(1,2,3)... //if the ...
Here is a solution: [(fiddle here)](http://jsfiddle.net/8BZU4/) ``` var headrow = $('thead tr').children(); $('tbody tr').each(function(){ var row = $(this).children(); for(var i=0; i<headrow.length; ++i){ if($(headrow[i]).hasClass("alignRight")){ $(row[i]).addClass("alignRight"); } if(...
68,245,174
Click on cell is opening new ViewController with proper value from each cell ``` func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let singleMovie = movieList[indexPath.row] getCredits(movieId: singleMovie.id) var directorName = "" creditResponse?.crew.forEach({ singleCr...
2021/07/04
[ "https://Stackoverflow.com/questions/68245174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16366914/" ]
#### Change 1 Add a `completion` parameter to following. ``` func getCredits(movieId: Int, completion: @escaping (() -> Void)) { networkManager.getDirector(from: "https://api.themoviedb.org/3/movie/", movieId: movieId) { (creditResponse) in guard let credit = creditResponse else { return ...
The problem is creditResponse gets set, but it gets set too late you are making an async call and then leaving. Local var directorName then gets copied as "" and goes out of scope. When the network call comes back you need to update the detailVC. Consider passing just singleMovie and handling your async calls in detail...
252,854
I just bought an external GPU thinking it would help with rendering images, and the viewport is definitely moving faster but I tried to render an image and I realized I'm still using the CPU to render. I'm fairly new to all this so this is all I can tell: I'm working on a Macbook Pro version 12.1. The eGPU I'm using i...
2022/02/04
[ "https://blender.stackexchange.com/questions/252854", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/131674/" ]
As far as I can see you have two possibilities to correct the relations of the scaling. 1. Either you use your object in the `Object Info` node relative to your geometry: [![enter image description here](https://i.stack.imgur.com/mQgP6.png)](https://i.stack.imgur.com/mQgP6.png) 2. Or you apply the current scaling of ...
I had the same problem but when I was clicking on the *Scale* option it wasn't changing the size properly, the sprinkles were still too small. I realized that the scale wasn't set to 1 when I originally created my mesh, in the start of the tutorial video he explains this very quickly. You need to go to the navigation...
60,638,431
I would like to know what I need to do in order to filter a dataframe, keeping unique values of `Name` column, adding values from `Value` column and adding a new column for counting appearances of each `Name` what I have is this: ``` Name Type Value 0 apple A 1 1 banana B 3 2 apple A ...
2020/03/11
[ "https://Stackoverflow.com/questions/60638431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4337253/" ]
Try `groupby` method: ``` df.groupby(["Name","Type"]).agg(["count","sum"]) ``` Result: ``` Value count sum Name Type apple A 3 9 banana B 2 5 carrot C 1 3 pear P 1 4 ``` However if You want to flatten columns/index use: ``` df2 = df.g...
Yes, just like ipj has answered you can try the groupby method in Pandas [Groupby](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.groupby.html). ``` df = df.groupby(["Name","Type"]).agg(["count","sum"]) df.columns = df.columns.droplevel(0) df = df.rename({"count": "AddedValue", "sum": "Occ...
2,608,656
I would like to implement the following simple pattern in an android app: 1. Activity A starts activity B 2. In activity B the user fills out a simple form F, then hits submit 3. Activity B then starts an AsyncTask C that posts F to a url, and immediately returns to Activity A 4. Back in activity A, the user continues...
2010/04/09
[ "https://Stackoverflow.com/questions/2608656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/311681/" ]
I would use a broadcast reciever. <http://d.android.com/reference/android/content/BroadcastReceiver.html> In Activity B ``` Intent broadcastIntent = new Intent("com.yourapppackage.BROADCAST"); broadcastIntent.putExtra("myExtras", myExtras.extra); // Put your results in here sendBroadcast(broadcastIntent); ``` Fire ...
Why not have B acquire the information needed to run the task, then pass that back to A? The onPreExecute() and onPostExecute() happen in the main thread of Activity A. Never mind, I just saw that in your description. But yes - B handles it all - A just submits the data to the URL.
2,608,656
I would like to implement the following simple pattern in an android app: 1. Activity A starts activity B 2. In activity B the user fills out a simple form F, then hits submit 3. Activity B then starts an AsyncTask C that posts F to a url, and immediately returns to Activity A 4. Back in activity A, the user continues...
2010/04/09
[ "https://Stackoverflow.com/questions/2608656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/311681/" ]
I would use a broadcast reciever. <http://d.android.com/reference/android/content/BroadcastReceiver.html> In Activity B ``` Intent broadcastIntent = new Intent("com.yourapppackage.BROADCAST"); broadcastIntent.putExtra("myExtras", myExtras.extra); // Put your results in here sendBroadcast(broadcastIntent); ``` Fire ...
Try this way out. <http://masl.cis.gvsu.edu/2010/04/05/android-code-sample-asynchronous-http-connections/>
68,452,291
I don't understand why this is happening I am a beginner and hardly know anything so please do make it simple ```html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style media="screen"> .main{ background color: yellow; } </style> </head> <body> <div...
2021/07/20
[ "https://Stackoverflow.com/questions/68452291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16486628/" ]
It seems like you have problem because of your `.ebp_container { width: 300px}` If you change it to ``` .ebp_container { width: 100%; } ``` in your media query, it should work as you want ```html <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-...
``` <style> .tr { border: none; } .ebp_container { /* What you need */ position: relative; /* the code below is only for this example */ width: 300px; /*background-color: yellow;*/ margin: 10px; padding: 20px; } .ebp_vide...
68,452,291
I don't understand why this is happening I am a beginner and hardly know anything so please do make it simple ```html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style media="screen"> .main{ background color: yellow; } </style> </head> <body> <div...
2021/07/20
[ "https://Stackoverflow.com/questions/68452291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16486628/" ]
Your width when responsive is causing the overflow. Its set to a width greater than the viewport and is overflowing. You also seem to have some position:absolute stuff which seems largely un-necessary for the positioning of your icons. I've reset that back to basics when it goes responsive, but I'd guess it isn't quit...
``` <style> .tr { border: none; } .ebp_container { /* What you need */ position: relative; /* the code below is only for this example */ width: 300px; /*background-color: yellow;*/ margin: 10px; padding: 20px; } .ebp_vide...
68,857,838
I am using a view inside a scrollview and inside the view, there are two labels with fixed width. and I want to make these labels auto-resizing in respect of height. For this I have given the height of the view >= but it's breaking the constraints. How can I achieve auto resizing content within scrollview. [![enter ima...
2021/08/20
[ "https://Stackoverflow.com/questions/68857838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10469417/" ]
While using scrollview it's mandatory to give the height of the elements inside scrollview. But if we want to make an element self height adjusting then we can give the minimum height with the priority 250 [![enter image description here](https://i.stack.imgur.com/mvLNF.png)](https://i.stack.imgur.com/mvLNF.png)
First, you need a content view inside the scroll that has constraints with the controller's view (equally both width and height) and top, leading, trailing, bottom with scroll view. Then, add any subviews inside that content view. In your case is the label's bound view. Something like: * The red one is the content o...
68,857,838
I am using a view inside a scrollview and inside the view, there are two labels with fixed width. and I want to make these labels auto-resizing in respect of height. For this I have given the height of the view >= but it's breaking the constraints. How can I achieve auto resizing content within scrollview. [![enter ima...
2021/08/20
[ "https://Stackoverflow.com/questions/68857838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10469417/" ]
While using scrollview it's mandatory to give the height of the elements inside scrollview. But if we want to make an element self height adjusting then we can give the minimum height with the priority 250 [![enter image description here](https://i.stack.imgur.com/mvLNF.png)](https://i.stack.imgur.com/mvLNF.png)
Just embed all these labels in stack view. And that's it. [![enter image description here](https://i.stack.imgur.com/YABEB.png)](https://i.stack.imgur.com/YABEB.png) [![enter image description here](https://i.stack.imgur.com/OlvlJ.png)](https://i.stack.imgur.com/OlvlJ.png)