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
186,111
i have news site for about 7 months. The site get new feeds every hour but google take about 1 day to index them and only few of them. I see other sites that instantly index. "1 hours ago etc". Mine newest in google says "19 hours ago"+. And after some errors with sitemap, now i have 0 links last 2-3 days. So, i wan...
2016/01/08
[ "https://drupal.stackexchange.com/questions/186111", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/55773/" ]
The indexing you are having is moderate / typical indeed. Only a small percentage of sites (from the 100% existing in the web right now) are being indexed every hour or so (some sites are indexed once smaller times like 20 minutes or even less - Wikipedia for example could be indexed in 10 minutes or less in some cases...
If the site is largely linking back out to other sites, you may be appearing to be a link-farm and Google isn't going to re-index frequently. If you have good reasons to be pulling lots of feeds with broken links in them I recommend adding a process that checks the new links before making them public. It'll make your ...
52,411,739
I have entities where one field has an one-to-many relationship. It looks like this. ``` @Entity @Table(name = "company") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Company implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(stra...
2018/09/19
[ "https://Stackoverflow.com/questions/52411739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9689221/" ]
You can use `lapply` to extract the three columns named `"Col1` in one go. Then set the names of the result. ``` col1 <- as.data.frame(lapply(df, '[[', "Col1")) names(col1) <- letters[seq_along(col1)] col1 # a b c #1 A A A #2 B M M #3 C N U #4 D P T #5 E E W #6 F H H ``` Choose any other column names that you migh...
``` res<-1:nrow(df[[1]][1]) for(i in 1:length(df)){ print ( as.vector(df[[i]][1])) res<-cbind(res,as.data.frame(df[[i]][1])) } res$res<-NULL ``` So, the output is: ``` Col1 Col1 Col1 1 A A A 2 B M M 3 C N U 4 D P T 5 E E W 6 F H H ```
52,411,739
I have entities where one field has an one-to-many relationship. It looks like this. ``` @Entity @Table(name = "company") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Company implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(stra...
2018/09/19
[ "https://Stackoverflow.com/questions/52411739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9689221/" ]
With `map_dfc` from `purrr`: ``` library(purrr) map_dfc(df, `[`, 1) ``` **Output:** ``` Col1 Col11 Col12 1 A A A 2 B M M 3 C N U 4 D P T 5 E E W 6 F H H ```
``` res<-1:nrow(df[[1]][1]) for(i in 1:length(df)){ print ( as.vector(df[[i]][1])) res<-cbind(res,as.data.frame(df[[i]][1])) } res$res<-NULL ``` So, the output is: ``` Col1 Col1 Col1 1 A A A 2 B M M 3 C N U 4 D P T 5 E E W 6 F H H ```
52,411,739
I have entities where one field has an one-to-many relationship. It looks like this. ``` @Entity @Table(name = "company") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Company implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(stra...
2018/09/19
[ "https://Stackoverflow.com/questions/52411739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9689221/" ]
``` res<-1:nrow(df[[1]][1]) for(i in 1:length(df)){ print ( as.vector(df[[i]][1])) res<-cbind(res,as.data.frame(df[[i]][1])) } res$res<-NULL ``` So, the output is: ``` Col1 Col1 Col1 1 A A A 2 B M M 3 C N U 4 D P T 5 E E W 6 F H H ```
Using `dplyr` ``` library(dplyr) df %>% sapply('[[',1) %>% as.data.frame #returns V1 V2 V3 1 A A A 2 B M M 3 C N U 4 D P T 5 E E W 6 F H H ```
52,411,739
I have entities where one field has an one-to-many relationship. It looks like this. ``` @Entity @Table(name = "company") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Company implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(stra...
2018/09/19
[ "https://Stackoverflow.com/questions/52411739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9689221/" ]
Alternative use of `map_dfc` making use of `purrr`'s concise element extraction syntax that allows specifying elements of elements by name or position. The first is, for example, equivalent to ``` map_dfc(df, `[[`, 1) ``` which differs from the use of `[` in that the columns will not be named variations of `Col1` an...
``` res<-1:nrow(df[[1]][1]) for(i in 1:length(df)){ print ( as.vector(df[[i]][1])) res<-cbind(res,as.data.frame(df[[i]][1])) } res$res<-NULL ``` So, the output is: ``` Col1 Col1 Col1 1 A A A 2 B M M 3 C N U 4 D P T 5 E E W 6 F H H ```
52,411,739
I have entities where one field has an one-to-many relationship. It looks like this. ``` @Entity @Table(name = "company") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Company implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(stra...
2018/09/19
[ "https://Stackoverflow.com/questions/52411739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9689221/" ]
You can use `lapply` to extract the three columns named `"Col1` in one go. Then set the names of the result. ``` col1 <- as.data.frame(lapply(df, '[[', "Col1")) names(col1) <- letters[seq_along(col1)] col1 # a b c #1 A A A #2 B M M #3 C N U #4 D P T #5 E E W #6 F H H ``` Choose any other column names that you migh...
With `map_dfc` from `purrr`: ``` library(purrr) map_dfc(df, `[`, 1) ``` **Output:** ``` Col1 Col11 Col12 1 A A A 2 B M M 3 C N U 4 D P T 5 E E W 6 F H H ```
52,411,739
I have entities where one field has an one-to-many relationship. It looks like this. ``` @Entity @Table(name = "company") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Company implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(stra...
2018/09/19
[ "https://Stackoverflow.com/questions/52411739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9689221/" ]
You can use `lapply` to extract the three columns named `"Col1` in one go. Then set the names of the result. ``` col1 <- as.data.frame(lapply(df, '[[', "Col1")) names(col1) <- letters[seq_along(col1)] col1 # a b c #1 A A A #2 B M M #3 C N U #4 D P T #5 E E W #6 F H H ``` Choose any other column names that you migh...
Using `dplyr` ``` library(dplyr) df %>% sapply('[[',1) %>% as.data.frame #returns V1 V2 V3 1 A A A 2 B M M 3 C N U 4 D P T 5 E E W 6 F H H ```
52,411,739
I have entities where one field has an one-to-many relationship. It looks like this. ``` @Entity @Table(name = "company") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Company implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(stra...
2018/09/19
[ "https://Stackoverflow.com/questions/52411739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9689221/" ]
You can use `lapply` to extract the three columns named `"Col1` in one go. Then set the names of the result. ``` col1 <- as.data.frame(lapply(df, '[[', "Col1")) names(col1) <- letters[seq_along(col1)] col1 # a b c #1 A A A #2 B M M #3 C N U #4 D P T #5 E E W #6 F H H ``` Choose any other column names that you migh...
Alternative use of `map_dfc` making use of `purrr`'s concise element extraction syntax that allows specifying elements of elements by name or position. The first is, for example, equivalent to ``` map_dfc(df, `[[`, 1) ``` which differs from the use of `[` in that the columns will not be named variations of `Col1` an...
52,411,739
I have entities where one field has an one-to-many relationship. It looks like this. ``` @Entity @Table(name = "company") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Company implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(stra...
2018/09/19
[ "https://Stackoverflow.com/questions/52411739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9689221/" ]
With `map_dfc` from `purrr`: ``` library(purrr) map_dfc(df, `[`, 1) ``` **Output:** ``` Col1 Col11 Col12 1 A A A 2 B M M 3 C N U 4 D P T 5 E E W 6 F H H ```
Using `dplyr` ``` library(dplyr) df %>% sapply('[[',1) %>% as.data.frame #returns V1 V2 V3 1 A A A 2 B M M 3 C N U 4 D P T 5 E E W 6 F H H ```
52,411,739
I have entities where one field has an one-to-many relationship. It looks like this. ``` @Entity @Table(name = "company") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Company implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(stra...
2018/09/19
[ "https://Stackoverflow.com/questions/52411739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9689221/" ]
With `map_dfc` from `purrr`: ``` library(purrr) map_dfc(df, `[`, 1) ``` **Output:** ``` Col1 Col11 Col12 1 A A A 2 B M M 3 C N U 4 D P T 5 E E W 6 F H H ```
Alternative use of `map_dfc` making use of `purrr`'s concise element extraction syntax that allows specifying elements of elements by name or position. The first is, for example, equivalent to ``` map_dfc(df, `[[`, 1) ``` which differs from the use of `[` in that the columns will not be named variations of `Col1` an...
52,411,739
I have entities where one field has an one-to-many relationship. It looks like this. ``` @Entity @Table(name = "company") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Company implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(stra...
2018/09/19
[ "https://Stackoverflow.com/questions/52411739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9689221/" ]
Alternative use of `map_dfc` making use of `purrr`'s concise element extraction syntax that allows specifying elements of elements by name or position. The first is, for example, equivalent to ``` map_dfc(df, `[[`, 1) ``` which differs from the use of `[` in that the columns will not be named variations of `Col1` an...
Using `dplyr` ``` library(dplyr) df %>% sapply('[[',1) %>% as.data.frame #returns V1 V2 V3 1 A A A 2 B M M 3 C N U 4 D P T 5 E E W 6 F H H ```
37,384,460
I can't figure out what's wrong with my index.html or main.css. I'm using Bootstrap with a custom stylesheet to add a few new things to my layout. Anyways, I made a one-page website and all the menu items are going to the right section but only 1 link is going to another website, this link isn't working. If I right cl...
2016/05/23
[ "https://Stackoverflow.com/questions/37384460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5997179/" ]
There is also ready to use [pyshadow](https://pypi.org/project/pyshadow/) pip module, which worked in my case, below example: ``` from pyshadow.main import Shadow from selenium import webdriver driver = webdriver.Chrome('chromedriver.exe') shadow = Shadow(driver) element = shadow.find_element("#Selector_level1") elem...
You can use the [`driver.executeScript()`](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/webdriver_exports_WebDriver.html#executeScript) method to access the HTML elements and JavaScript objects in your web page. In the exemple below, `executeScript` will return in a `Promise` ...
37,384,460
I can't figure out what's wrong with my index.html or main.css. I'm using Bootstrap with a custom stylesheet to add a few new things to my layout. Anyways, I made a one-page website and all the menu items are going to the right section but only 1 link is going to another website, this link isn't working. If I right cl...
2016/05/23
[ "https://Stackoverflow.com/questions/37384460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5997179/" ]
There is also ready to use [pyshadow](https://pypi.org/project/pyshadow/) pip module, which worked in my case, below example: ``` from pyshadow.main import Shadow from selenium import webdriver driver = webdriver.Chrome('chromedriver.exe') shadow = Shadow(driver) element = shadow.find_element("#Selector_level1") elem...
I originally implemented Eduard's solution just slightly modified as a loop for simplicity. But when Chrome updated to 96.0.4664.45 selenium started returning a dict instead of a WebElement when calling `'return arguments[0].shadowRoot'`. I did a little hacking around and found out I could get Selenium to return a Web...
37,384,460
I can't figure out what's wrong with my index.html or main.css. I'm using Bootstrap with a custom stylesheet to add a few new things to my layout. Anyways, I made a one-page website and all the menu items are going to the right section but only 1 link is going to another website, this link isn't working. If I right cl...
2016/05/23
[ "https://Stackoverflow.com/questions/37384460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5997179/" ]
There is also ready to use [pyshadow](https://pypi.org/project/pyshadow/) pip module, which worked in my case, below example: ``` from pyshadow.main import Shadow from selenium import webdriver driver = webdriver.Chrome('chromedriver.exe') shadow = Shadow(driver) element = shadow.find_element("#Selector_level1") elem...
With selenium 4.1 there's a new attribute `shadow_root` for the [`WebElement`](https://selenium-python.readthedocs.io/api.html#selenium.webdriver.remote.webelement.WebElement) class. From the docs: -------------- *Returns a shadow root of the element if there is one or an error. Only works from Chromium 96 onwards. P...
37,384,460
I can't figure out what's wrong with my index.html or main.css. I'm using Bootstrap with a custom stylesheet to add a few new things to my layout. Anyways, I made a one-page website and all the menu items are going to the right section but only 1 link is going to another website, this link isn't working. If I right cl...
2016/05/23
[ "https://Stackoverflow.com/questions/37384460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5997179/" ]
There is also ready to use [pyshadow](https://pypi.org/project/pyshadow/) pip module, which worked in my case, below example: ``` from pyshadow.main import Shadow from selenium import webdriver driver = webdriver.Chrome('chromedriver.exe') shadow = Shadow(driver) element = shadow.find_element("#Selector_level1") elem...
The ***downloaded*** items by [google-chrome](/questions/tagged/google-chrome "show questions tagged 'google-chrome'") are within multiple [#shadow-root (open)](https://stackoverflow.com/questions/56380091/how-to-locate-the-shadow-root-open-elements-through-cssselector). ![chrome_downloads](https://i.stack.imgur.com/3...
37,384,460
I can't figure out what's wrong with my index.html or main.css. I'm using Bootstrap with a custom stylesheet to add a few new things to my layout. Anyways, I made a one-page website and all the menu items are going to the right section but only 1 link is going to another website, this link isn't working. If I right cl...
2016/05/23
[ "https://Stackoverflow.com/questions/37384460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5997179/" ]
You can use the [`driver.executeScript()`](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/webdriver_exports_WebDriver.html#executeScript) method to access the HTML elements and JavaScript objects in your web page. In the exemple below, `executeScript` will return in a `Promise` ...
The ***downloaded*** items by [google-chrome](/questions/tagged/google-chrome "show questions tagged 'google-chrome'") are within multiple [#shadow-root (open)](https://stackoverflow.com/questions/56380091/how-to-locate-the-shadow-root-open-elements-through-cssselector). ![chrome_downloads](https://i.stack.imgur.com/3...
37,384,460
I can't figure out what's wrong with my index.html or main.css. I'm using Bootstrap with a custom stylesheet to add a few new things to my layout. Anyways, I made a one-page website and all the menu items are going to the right section but only 1 link is going to another website, this link isn't working. If I right cl...
2016/05/23
[ "https://Stackoverflow.com/questions/37384460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5997179/" ]
I would add this as a comment but I don't have enough reputation points-- The answers by Eduard Florinescu works well with the caveat that once you're inside a shadowRoot, you only have the selenium methods available that correspond to the available JS methods--mainly select by id. To get around this I wrote a longer...
The ***downloaded*** items by [google-chrome](/questions/tagged/google-chrome "show questions tagged 'google-chrome'") are within multiple [#shadow-root (open)](https://stackoverflow.com/questions/56380091/how-to-locate-the-shadow-root-open-elements-through-cssselector). ![chrome_downloads](https://i.stack.imgur.com/3...
37,384,460
I can't figure out what's wrong with my index.html or main.css. I'm using Bootstrap with a custom stylesheet to add a few new things to my layout. Anyways, I made a one-page website and all the menu items are going to the right section but only 1 link is going to another website, this link isn't working. If I right cl...
2016/05/23
[ "https://Stackoverflow.com/questions/37384460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5997179/" ]
Sometimes the shadow root elements are nested and the second shadow root is not visible in document root, but is available in its parent accessed shadow root. I think is better to use the selenium selectors and inject the script just to take the shadow root: ``` def expand_shadow_element(element): shadow_root = driv...
You can use the [`driver.executeScript()`](http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/webdriver_exports_WebDriver.html#executeScript) method to access the HTML elements and JavaScript objects in your web page. In the exemple below, `executeScript` will return in a `Promise` ...
37,384,460
I can't figure out what's wrong with my index.html or main.css. I'm using Bootstrap with a custom stylesheet to add a few new things to my layout. Anyways, I made a one-page website and all the menu items are going to the right section but only 1 link is going to another website, this link isn't working. If I right cl...
2016/05/23
[ "https://Stackoverflow.com/questions/37384460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5997179/" ]
Sometimes the shadow root elements are nested and the second shadow root is not visible in document root, but is available in its parent accessed shadow root. I think is better to use the selenium selectors and inject the script just to take the shadow root: ``` def expand_shadow_element(element): shadow_root = driv...
I originally implemented Eduard's solution just slightly modified as a loop for simplicity. But when Chrome updated to 96.0.4664.45 selenium started returning a dict instead of a WebElement when calling `'return arguments[0].shadowRoot'`. I did a little hacking around and found out I could get Selenium to return a Web...
37,384,460
I can't figure out what's wrong with my index.html or main.css. I'm using Bootstrap with a custom stylesheet to add a few new things to my layout. Anyways, I made a one-page website and all the menu items are going to the right section but only 1 link is going to another website, this link isn't working. If I right cl...
2016/05/23
[ "https://Stackoverflow.com/questions/37384460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5997179/" ]
With selenium 4.1 there's a new attribute `shadow_root` for the [`WebElement`](https://selenium-python.readthedocs.io/api.html#selenium.webdriver.remote.webelement.WebElement) class. From the docs: -------------- *Returns a shadow root of the element if there is one or an error. Only works from Chromium 96 onwards. P...
I originally implemented Eduard's solution just slightly modified as a loop for simplicity. But when Chrome updated to 96.0.4664.45 selenium started returning a dict instead of a WebElement when calling `'return arguments[0].shadowRoot'`. I did a little hacking around and found out I could get Selenium to return a Web...
37,384,460
I can't figure out what's wrong with my index.html or main.css. I'm using Bootstrap with a custom stylesheet to add a few new things to my layout. Anyways, I made a one-page website and all the menu items are going to the right section but only 1 link is going to another website, this link isn't working. If I right cl...
2016/05/23
[ "https://Stackoverflow.com/questions/37384460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5997179/" ]
Sometimes the shadow root elements are nested and the second shadow root is not visible in document root, but is available in its parent accessed shadow root. I think is better to use the selenium selectors and inject the script just to take the shadow root: ``` def expand_shadow_element(element): shadow_root = driv...
There is also ready to use [pyshadow](https://pypi.org/project/pyshadow/) pip module, which worked in my case, below example: ``` from pyshadow.main import Shadow from selenium import webdriver driver = webdriver.Chrome('chromedriver.exe') shadow = Shadow(driver) element = shadow.find_element("#Selector_level1") elem...
36,789,511
I want my function to calculate the total cost of my shopping cart and then set the state of my component to those totals, but I need the calculation done first and then the state set after the calculations are complete. When I run the code below, the state never gets set. ``` renderCart: function() { var new...
2016/04/22
[ "https://Stackoverflow.com/questions/36789511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264835/" ]
two points: 1. you should use .reduce function to calculate sum. 2. you should not use this.setState in your render(), I suggest ComponentDidMount or InitialState
Map is synchronous . Why you need setState, use variable enough. ``` renderCart: function() { var newSubtotal = 0; var newTotal = 0; this.props.cart.map((product)=>{ newSubtotal += product.price; newTotal += product.price; newTotal *= 1.10; co...
36,789,511
I want my function to calculate the total cost of my shopping cart and then set the state of my component to those totals, but I need the calculation done first and then the state set after the calculations are complete. When I run the code below, the state never gets set. ``` renderCart: function() { var new...
2016/04/22
[ "https://Stackoverflow.com/questions/36789511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264835/" ]
In pseudo code, the structure of your component should look more like: ``` MyCartTotalComponent => { // no need for state: if your props contain cart, then every time cart changes // your component gets new props, calculates total, and renders render() { // calculate stuff and store in local cart variable ...
Map is synchronous . Why you need setState, use variable enough. ``` renderCart: function() { var newSubtotal = 0; var newTotal = 0; this.props.cart.map((product)=>{ newSubtotal += product.price; newTotal += product.price; newTotal *= 1.10; co...
36,789,511
I want my function to calculate the total cost of my shopping cart and then set the state of my component to those totals, but I need the calculation done first and then the state set after the calculations are complete. When I run the code below, the state never gets set. ``` renderCart: function() { var new...
2016/04/22
[ "https://Stackoverflow.com/questions/36789511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264835/" ]
In pseudo code, the structure of your component should look more like: ``` MyCartTotalComponent => { // no need for state: if your props contain cart, then every time cart changes // your component gets new props, calculates total, and renders render() { // calculate stuff and store in local cart variable ...
two points: 1. you should use .reduce function to calculate sum. 2. you should not use this.setState in your render(), I suggest ComponentDidMount or InitialState
13,870,213
I'm using Autofill addon `https://addons.mozilla.org/pl/firefox/addon/autofill-262804/` and I want to fill my text field with random text from definied. For example I want to fill `/* City */ city|town` field with one of the definied: `London, Paris, Amsterdam` But I dont know how to do that. The developer says: > ...
2012/12/13
[ "https://Stackoverflow.com/questions/13870213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1743942/" ]
Despite putting a bounty on your question, I've managed to find the solution - I too had trouble finding it in the Google Groups pages and the dev's site, until I found his ["other" page](http://www.tohodo.com/autofill/help-firefox.html#other), which states: Expand variables – If this box is checked, {...} will be rep...
Value to Autofill should be : ``` {London|Paris|Amsterdam} ```
42,995,973
I am using template (**Full-text search via Algolia**) in Firebase Function. [See here](https://github.com/firebase/functions-samples/tree/master/fulltext-search) At the end of this link you will see > setting up the sample Here it asks for algolia secret account and key. I have created account at Algolia when I go ...
2017/03/24
[ "https://Stackoverflow.com/questions/42995973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5737536/" ]
I believe the "secret" is what we call the "*Admin API key*" in the dashboard and the key must be the "*search only api key*".
The key is the id of your Algolia application. The secret needs to be an API key that has read and write access (since the functions are doing both indexing and search). That can be your Admin API key or a specific API key you create with these permissions.
3,505,739
If two elliptic curves share the same j-invariant then they may not be isomorphic to each other over $\mathbb{Q}$. Example: > > $E\_1: y^2 = x^3 + x$ > > > j-inavriat: $1728$ > > > Torsion points: $[(0 : 0 : 1), (0 : 1 : 0)]$ > > > Rank $0$. > > > $ $ > > $E\_2: y^2 = x^3 + 3 x$ > > > j-inavriat: $1728...
2020/01/12
[ "https://math.stackexchange.com/questions/3505739", "https://math.stackexchange.com", "https://math.stackexchange.com/users/400836/" ]
You really don't need to use $L$-functions or representations. Let's work over a field $K$ of characteristic not equal to 2 or 3, so for example $K=\mathbb Q$. Then an elliptic curve $E/K$ always has a Weierstrass model $$ E:y^2=x^3+Ax+B, $$ but the model is not unique. The $j$-invariant $$ j(E) = 1728\cdot\frac{4A^3}{...
Since Silverman answered consider this as a comment, showing that it is a good thing to experiment with quadratic twists * Given an elliptic curve $E/\Bbb{Q}$ we get an homomorphism $$\rho\_E: Gal(\overline{\Bbb{Q}}/\Bbb{Q})\to Aut(E\_{tors})$$ If $E$ is isomorphic to $E'$ over $\Bbb{Q}$ then $\rho\_{E'}= f \circ \rh...
58,751,549
I have a problem in my graduation project, I add Unity as a library to Android Studio it works fine with my mobile, but when I try on the other Android mobile I got some weird error (unable to load **libmain.so**), I search a lot but I didn't find the answer. Note: there is no compile or build error, only when I click...
2019/11/07
[ "https://Stackoverflow.com/questions/58751549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12107055/" ]
You can follow [this](https://medium.com/@davidbeloosesky/embedded-unity-within-android-app-7061f4f473a) link, I think it will help ``` dependencies { compile project(":your_aar_file_name") compile fileTree(dir: 'libs', include: ['*.jar']) ... } ```
Please add following line into your string.xml ```js <string name="game_view_content_description">Game view</string> ``` After that add below snippet into your app level's gradle file ```js defaultConfig { ndk { abiFilters 'armeabi-v7a', 'x86' } } ```
58,751,549
I have a problem in my graduation project, I add Unity as a library to Android Studio it works fine with my mobile, but when I try on the other Android mobile I got some weird error (unable to load **libmain.so**), I search a lot but I didn't find the answer. Note: there is no compile or build error, only when I click...
2019/11/07
[ "https://Stackoverflow.com/questions/58751549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12107055/" ]
I had the same problem, in my case I solved by editing the project's gradle file which should be located in `your_project/Assets/Plugins/Android/mainTemplate.gradle` For an unknown reason my gradle file had this lines that prevented to pack libmain.so inside the apk therefore giving the unable to load libmain.so error...
You can follow [this](https://medium.com/@davidbeloosesky/embedded-unity-within-android-app-7061f4f473a) link, I think it will help ``` dependencies { compile project(":your_aar_file_name") compile fileTree(dir: 'libs', include: ['*.jar']) ... } ```
58,751,549
I have a problem in my graduation project, I add Unity as a library to Android Studio it works fine with my mobile, but when I try on the other Android mobile I got some weird error (unable to load **libmain.so**), I search a lot but I didn't find the answer. Note: there is no compile or build error, only when I click...
2019/11/07
[ "https://Stackoverflow.com/questions/58751549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12107055/" ]
I had the same problem, in my case I solved by editing the project's gradle file which should be located in `your_project/Assets/Plugins/Android/mainTemplate.gradle` For an unknown reason my gradle file had this lines that prevented to pack libmain.so inside the apk therefore giving the unable to load libmain.so error...
Please add following line into your string.xml ```js <string name="game_view_content_description">Game view</string> ``` After that add below snippet into your app level's gradle file ```js defaultConfig { ndk { abiFilters 'armeabi-v7a', 'x86' } } ```
19,659,969
So I have to fill my picture box with lines, though I can't understand what I've done wrong. ``` public Form1() { InitializeComponent(); PictureBox pb = new PictureBox(); } public void Zimet() { PictureBox pb = new PictureBox(); Graphics ...
2013/10/29
[ "https://Stackoverflow.com/questions/19659969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2800433/" ]
First your `PictureBox` should be field of your `Form` and you should not create it every time you click a button. Second, your `DrawLine` call is bad, for instance if you want horizontal lines you would need to do something like this: ``` Pen pen1 = new Pen(Color.Red); for (int i = 0; i < pb.Height; i...
Your `Zimet()` function creates a `Picturebox` and draws to it, and then throws it away at the end of the function. You need to call `SomeUiObject.Controls.Add(pb);` to actually put it on the form.
19,659,969
So I have to fill my picture box with lines, though I can't understand what I've done wrong. ``` public Form1() { InitializeComponent(); PictureBox pb = new PictureBox(); } public void Zimet() { PictureBox pb = new PictureBox(); Graphics ...
2013/10/29
[ "https://Stackoverflow.com/questions/19659969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2800433/" ]
There are actually three reasons why this code won't work, two of which have been mentioned in other answers: 1. your PictureBox isn't a control on the form (see answer by patchandchat) 2. wrong coordinates used in draw-line (see answer by Nicola Davidovic) The third issue is that you can't draw onto a PictureBox lik...
Your `Zimet()` function creates a `Picturebox` and draws to it, and then throws it away at the end of the function. You need to call `SomeUiObject.Controls.Add(pb);` to actually put it on the form.
19,659,969
So I have to fill my picture box with lines, though I can't understand what I've done wrong. ``` public Form1() { InitializeComponent(); PictureBox pb = new PictureBox(); } public void Zimet() { PictureBox pb = new PictureBox(); Graphics ...
2013/10/29
[ "https://Stackoverflow.com/questions/19659969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2800433/" ]
First your `PictureBox` should be field of your `Form` and you should not create it every time you click a button. Second, your `DrawLine` call is bad, for instance if you want horizontal lines you would need to do something like this: ``` Pen pen1 = new Pen(Color.Red); for (int i = 0; i < pb.Height; i...
You create a `PictureBox pb` in the form constructor, and then another one in your `Zimet()` method. The one in the `Zimet()` method is local in scope to that method, so goes out of scope when the method returns. Are you trying to draw lines in the `PictureBox` created in your constructor? Because that goes out of sco...
19,659,969
So I have to fill my picture box with lines, though I can't understand what I've done wrong. ``` public Form1() { InitializeComponent(); PictureBox pb = new PictureBox(); } public void Zimet() { PictureBox pb = new PictureBox(); Graphics ...
2013/10/29
[ "https://Stackoverflow.com/questions/19659969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2800433/" ]
There are actually three reasons why this code won't work, two of which have been mentioned in other answers: 1. your PictureBox isn't a control on the form (see answer by patchandchat) 2. wrong coordinates used in draw-line (see answer by Nicola Davidovic) The third issue is that you can't draw onto a PictureBox lik...
First your `PictureBox` should be field of your `Form` and you should not create it every time you click a button. Second, your `DrawLine` call is bad, for instance if you want horizontal lines you would need to do something like this: ``` Pen pen1 = new Pen(Color.Red); for (int i = 0; i < pb.Height; i...
19,659,969
So I have to fill my picture box with lines, though I can't understand what I've done wrong. ``` public Form1() { InitializeComponent(); PictureBox pb = new PictureBox(); } public void Zimet() { PictureBox pb = new PictureBox(); Graphics ...
2013/10/29
[ "https://Stackoverflow.com/questions/19659969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2800433/" ]
There are actually three reasons why this code won't work, two of which have been mentioned in other answers: 1. your PictureBox isn't a control on the form (see answer by patchandchat) 2. wrong coordinates used in draw-line (see answer by Nicola Davidovic) The third issue is that you can't draw onto a PictureBox lik...
You create a `PictureBox pb` in the form constructor, and then another one in your `Zimet()` method. The one in the `Zimet()` method is local in scope to that method, so goes out of scope when the method returns. Are you trying to draw lines in the `PictureBox` created in your constructor? Because that goes out of sco...
70,640,256
``` /** * A method that writes variables in a file for shows in the program. * * @author * @version (1.2 2022.01.05) */ public void writeShowData(String fileName) throws FileNotFoundException{ String showPath = "c:\\Users\\COMPUTER\\bluej files\\projects\\chapter15\\willem\\Cinema...
2022/01/09
[ "https://Stackoverflow.com/questions/70640256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9493669/" ]
You can use this method > > window.after(1000,<function\_name>) > > > It means the function call after 1 sec. If you are use recursion with this method then you can create timer.
I hope it works for you, cheer. ``` import time # time.time() return in second game_duration = float(input('duration: ')) + time.time() game_is_running = True while game_is_running: if game_duration == time.time(): # this means: if now equal to game_duration game_is_running = False # note: it is quite ...
10,308,381
Suppose I have the following code: ``` var X = XElement.Parse (@" <ROOT> <MUL v='2' /> <MUL v='3' /> </ROOT> "); Enumerable.Range (1, 100) .Select (s => X.Elements () .Select (t => Int32.Parse (t.Attribute ("v").Value)) .Aggregate (s, (t, u) => t * u) ) .ToList () ...
2012/04/25
[ "https://Stackoverflow.com/questions/10308381", "https://Stackoverflow.com", "https://Stackoverflow.com/users/631115/" ]
It has been a while since I dug through this code but, IIRC, the way `Select` works is to simply cache the `Func` you supply it and run it on the source collection one at a time. So, for each element in the outer range, it will run the inner `Select/Aggregate` sequence as if it were the first time. There isn't any buil...
LINQ and `IEnumerable<T>` is *pull based*. This means that the predicates and actions that are part of the LINQ statement in general are not executed until values are pulled. Furthermore the predicates and actions will execute each time values are pulled (e.g. there is no secret caching going on). Pulling from an `IEn...
5,455,592
Blocks are fine but what about writing C arrays? Given this simplified situation: ``` CGPoint points[10]; [myArray forEachElementWithBlock:^(int idx) { points[idx] = CGPointMake(10, 20); // error here // Cannot refer to declaration with an array type inside block }]; ``` after searching a while found this p...
2011/03/28
[ "https://Stackoverflow.com/questions/5455592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Maybe you can allocate the array on the heap? ``` // Allocates a plain C array on the heap. The array will have // [myArray count] items, each sized to fit a CGPoint. CGPoint *points = calloc([myArray count], sizeof(CGPoint)); // Make sure the allocation succeded, you might want to insert // some more graceful error h...
Another simple answer which works for me is the following: ``` CGPoint points[10], *pointsPtr; pointsPtr = points; [myArray forEachElementWithBlock:^(int idx) { pointsPtr[idx] = CGPointMake(10, 20); }]; ```
28,473,976
The following example shows a `box` `div` with an `:after` content, which should be a separate block. ```css div.box { background-color: #FAA; width: 10em; overflow: scroll; } div.box:after { content: "☑"; display: block; background-color: #AFA; width: 5em; overflow: auto; } ...
2015/02/12
[ "https://Stackoverflow.com/questions/28473976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/402322/" ]
The `:after` content comes within the scrollable area because even though the element is named `:after`, it is in actual terms a child of the `div.box` and hence will be positioned within the `.box` element (that is within the scrollable area). > > **From MDN:** The CSS ::after pseudo-element matches a ***virtual las...
I think you've become a little confused with pseudo elements, so i'll hopefully clear a few things up for you: > > The ::after pseudo-element can be used to describe generated content after an element's content. > > > A quick demonstration of this would be: ```css p::after { content: " :Note"; } ``` ```...
28,473,976
The following example shows a `box` `div` with an `:after` content, which should be a separate block. ```css div.box { background-color: #FAA; width: 10em; overflow: scroll; } div.box:after { content: "☑"; display: block; background-color: #AFA; width: 5em; overflow: auto; } ...
2015/02/12
[ "https://Stackoverflow.com/questions/28473976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/402322/" ]
The `:after` content comes within the scrollable area because even though the element is named `:after`, it is in actual terms a child of the `div.box` and hence will be positioned within the `.box` element (that is within the scrollable area). > > **From MDN:** The CSS ::after pseudo-element matches a ***virtual las...
> > My expectation was that it comes actually after the scrollable area. > > > This expectation is wrong. Looking at the CSS2.1 specification, we find: > > Authors specify the style and location of generated content with the > :before and :after pseudo-elements. As their names indicate, the > :before and :afte...
28,473,976
The following example shows a `box` `div` with an `:after` content, which should be a separate block. ```css div.box { background-color: #FAA; width: 10em; overflow: scroll; } div.box:after { content: "☑"; display: block; background-color: #AFA; width: 5em; overflow: auto; } ...
2015/02/12
[ "https://Stackoverflow.com/questions/28473976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/402322/" ]
I think you've become a little confused with pseudo elements, so i'll hopefully clear a few things up for you: > > The ::after pseudo-element can be used to describe generated content after an element's content. > > > A quick demonstration of this would be: ```css p::after { content: " :Note"; } ``` ```...
> > My expectation was that it comes actually after the scrollable area. > > > This expectation is wrong. Looking at the CSS2.1 specification, we find: > > Authors specify the style and location of generated content with the > :before and :after pseudo-elements. As their names indicate, the > :before and :afte...
34,544,396
I installed Qt library and Qt creator in Linux Mint but when I try to run the designer I get the following error: ``` designer: could not exec '/usr/lib/x86_64-linux-gnu/qt5/bin/designer': No such file or directory ``` I cannot find the designer version 5 online, but I could find the version 4. I'm afraid that this ...
2015/12/31
[ "https://Stackoverflow.com/questions/34544396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1889762/" ]
The designer app is part of the `qttools5-dev-tools` package: You can find the solution to answers like "where can I get binary X from" in Debian-based distros quite easily: ``` % apt-file search bin/designer qt4-designer: /usr/bin/designer-qt4...
If you installed Qt using the installers provided by the Qt website, the designer can also be launched from `~/Qt/<VERSION>/<COMPILER>/bin/designer`
7,573,827
I'm not sure why, but i can't seem to style a td element in my script. I'm trying to remove a border from all the td elements in the table-subtitles, and i guess my css is wrong somehow. PS: I was able to remove the border by inline css only. HTML: ``` <table> <thead> <tr> <th width="100%" ...
2011/09/27
[ "https://Stackoverflow.com/questions/7573827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/804671/" ]
did you try `border-bottom:0!important`
Your problem is with your selector. Doing `.table-subtitles td` means: The TD element inside the element with the "table-subtitles" class. What you need is: `td.table-subtitles { border-bottom:0; }`
7,573,827
I'm not sure why, but i can't seem to style a td element in my script. I'm trying to remove a border from all the td elements in the table-subtitles, and i guess my css is wrong somehow. PS: I was able to remove the border by inline css only. HTML: ``` <table> <thead> <tr> <th width="100%" ...
2011/09/27
[ "https://Stackoverflow.com/questions/7573827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/804671/" ]
You might find want to make friends with `border-collapse` and `th`.
did you try `border-bottom:0!important`
7,573,827
I'm not sure why, but i can't seem to style a td element in my script. I'm trying to remove a border from all the td elements in the table-subtitles, and i guess my css is wrong somehow. PS: I was able to remove the border by inline css only. HTML: ``` <table> <thead> <tr> <th width="100%" ...
2011/09/27
[ "https://Stackoverflow.com/questions/7573827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/804671/" ]
When I put just this table into a test HTML file I'm getting no borders by default. Therefore this is probably an inheritance issue with some previous table styling you have or are importing from your CSS. Normally, the solution to such problems is over riding whatever style its inheriting my making a more specific sel...
did you try `border-bottom:0!important`
7,573,827
I'm not sure why, but i can't seem to style a td element in my script. I'm trying to remove a border from all the td elements in the table-subtitles, and i guess my css is wrong somehow. PS: I was able to remove the border by inline css only. HTML: ``` <table> <thead> <tr> <th width="100%" ...
2011/09/27
[ "https://Stackoverflow.com/questions/7573827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/804671/" ]
// is not a css comment. you must use /\* \*/
did you try `border-bottom:0!important`
7,573,827
I'm not sure why, but i can't seem to style a td element in my script. I'm trying to remove a border from all the td elements in the table-subtitles, and i guess my css is wrong somehow. PS: I was able to remove the border by inline css only. HTML: ``` <table> <thead> <tr> <th width="100%" ...
2011/09/27
[ "https://Stackoverflow.com/questions/7573827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/804671/" ]
You might find want to make friends with `border-collapse` and `th`.
Your problem is with your selector. Doing `.table-subtitles td` means: The TD element inside the element with the "table-subtitles" class. What you need is: `td.table-subtitles { border-bottom:0; }`
7,573,827
I'm not sure why, but i can't seem to style a td element in my script. I'm trying to remove a border from all the td elements in the table-subtitles, and i guess my css is wrong somehow. PS: I was able to remove the border by inline css only. HTML: ``` <table> <thead> <tr> <th width="100%" ...
2011/09/27
[ "https://Stackoverflow.com/questions/7573827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/804671/" ]
When I put just this table into a test HTML file I'm getting no borders by default. Therefore this is probably an inheritance issue with some previous table styling you have or are importing from your CSS. Normally, the solution to such problems is over riding whatever style its inheriting my making a more specific sel...
Your problem is with your selector. Doing `.table-subtitles td` means: The TD element inside the element with the "table-subtitles" class. What you need is: `td.table-subtitles { border-bottom:0; }`
7,573,827
I'm not sure why, but i can't seem to style a td element in my script. I'm trying to remove a border from all the td elements in the table-subtitles, and i guess my css is wrong somehow. PS: I was able to remove the border by inline css only. HTML: ``` <table> <thead> <tr> <th width="100%" ...
2011/09/27
[ "https://Stackoverflow.com/questions/7573827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/804671/" ]
// is not a css comment. you must use /\* \*/
Your problem is with your selector. Doing `.table-subtitles td` means: The TD element inside the element with the "table-subtitles" class. What you need is: `td.table-subtitles { border-bottom:0; }`
7,573,827
I'm not sure why, but i can't seem to style a td element in my script. I'm trying to remove a border from all the td elements in the table-subtitles, and i guess my css is wrong somehow. PS: I was able to remove the border by inline css only. HTML: ``` <table> <thead> <tr> <th width="100%" ...
2011/09/27
[ "https://Stackoverflow.com/questions/7573827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/804671/" ]
// is not a css comment. you must use /\* \*/
You might find want to make friends with `border-collapse` and `th`.
7,573,827
I'm not sure why, but i can't seem to style a td element in my script. I'm trying to remove a border from all the td elements in the table-subtitles, and i guess my css is wrong somehow. PS: I was able to remove the border by inline css only. HTML: ``` <table> <thead> <tr> <th width="100%" ...
2011/09/27
[ "https://Stackoverflow.com/questions/7573827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/804671/" ]
// is not a css comment. you must use /\* \*/
When I put just this table into a test HTML file I'm getting no borders by default. Therefore this is probably an inheritance issue with some previous table styling you have or are importing from your CSS. Normally, the solution to such problems is over riding whatever style its inheriting my making a more specific sel...
34,680,920
I have a variable in my view `$models` which I want to pass to my controller for a function which I'm calling using a submit button. ``` <?php echo CHtml::beginForm('', 'post');?> <fieldset> <?php echo CHtml::submitButton('Confirm', array('name'=>'confirm', 'class'=>'btn btn-danger')); ?> </fieldset> <...
2016/01/08
[ "https://Stackoverflow.com/questions/34680920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4375167/" ]
This is a html form submission and php syntax problem, but not yii-specific. Whatever framework you use, even in plain static html, the basic idea of form submission is the same: if you want to send data to a page with a form, you need to put that data in your form, either as a form input the end-user can enter or sel...
I suppose this ain't the best way to achieve what you want, but you can always access the controller through: ``` $controller = Yii::app()->controller; ``` And then do with it whatever you want, for storing a variable in your controller, you probably will have to add a variable to your class. Another variant would ...
11,695,502
I am trying to create a simple bar graph including two bars showing the average math scores of two groups of students. The averages are 363.2 and 377.4. creating bar graph is simple. What I'd like to do is to have my y-axis starts from 340 rather than 0. I do know how to change the limits of y-axis, but the issue is wh...
2012/07/27
[ "https://Stackoverflow.com/questions/11695502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004102/" ]
Adding `xpd=FALSE` and re-adding the horizontal axis works, sort of: ``` b <- barplot(c(363.2, 377.4), beside = TRUE, ylim = c(340,380), col = c("orange", "blue"),xpd=FALSE) axis(side=1,at=b,labels=c("group 1", "group 2")) box(bty="l") ``` I claim (I can't point you to a definitive reference, although [Googling ...
The following can be seen if you look at `?barplot`: "xpd: logical. Should bars be allowed to go outside region?" You just need to include `xpd=FALSE` in your parameters for the barplot.
41,632,927
I am trying to add some buttons programmatically. But for some reason long text pushes the entire button down in my linearlayout. [![problem](https://i.stack.imgur.com/jp1X2.png)](https://i.stack.imgur.com/jp1X2.png) This is the code I use to replicate this behaviour. The button: ``` public class MyButton : Butto...
2017/01/13
[ "https://Stackoverflow.com/questions/41632927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1912169/" ]
Why do you try to declare a local variable named `MessageBoxButton`? This is the name of class that already exists in the framework. If the compiler says that it cannot find the type `MessageBoxButton`, you have to include the namespace where it can be found using a `using` clause at the top of the file: ``` using Sys...
Try ``` if (MessageBox.Show(String.Format("{0:0,0}", Convert.ToInt32(txtQuantity.Text)), "OK ??????", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) ```
3,483,400
I am studying predicate logic, and have been drawing regular venn diagrams for statements like (exists.x)(P(x) and Q(x)). They are invaluable to get what the expression is actually saying. But, I ran into this expression: (all.x)(all.y)(P(x) and Q(x) and R(x, y)) How can I represent the relation R(x, y) as a Venn dia...
2019/12/21
[ "https://math.stackexchange.com/questions/3483400", "https://math.stackexchange.com", "https://math.stackexchange.com/users/386221/" ]
Peirce's [Existential Graphs](https://en.wikipedia.org/wiki/Existential_graph) is a more graphical/visual way of representing logical statements. Interestingly, his system is expressively complete for Predicate Logic. Here's a very quick tutorial: First, Peirce uses the notion of a 'Sheet of Assertion' ($SA$). This i...
As @Josue commented, there are no good visuals for more complex expressions. This answer discusses why that's true, and talks about some other ways of thinking about expressions in predicate logic. When all our predicates have just one variable, like $P(x)$ and $Q(x)$, and we draw Venn diagrams of an expression, we're...
12,022,665
I am working on a desktop app with JPA(Eclipselink) and a remote mysql database directly. My persistence.xml i have two PersistenceUnit one uses localhost the other uses my remote database. When i try to load EntityManagerFactory, it works fine on localhost but never gets connected to the remote and no error is provid...
2012/08/18
[ "https://Stackoverflow.com/questions/12022665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1337096/" ]
When you say remote do you mean the same LAN or accross the internet? Cause the IP 192.168.10.138 designates a private LAN so your remote machine has to have an address on the same network like 192.168.10.\* First make sure to open port 3306 in your windows firewall. If it is a different network, your router(s) will ...
In normal JPA, it uses only one persistence.xml per project.But you can try [Spring's JPA](http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/orm.html#orm-jpa) that can use multiple persistence.xml in one project.See this [link](http://static.springsource.org/spring/docs/3.0.x/spring-frame...
30,710,114
I have a div class where I want change the css class name when resolution of the user's screen changes. The following script works: ``` if ( $(window).width() < 739) { $("#default").toggleClass('classold classnew'); } else { $("#default").toggleClass('classold classold'); } ``` But it has a problem. When I ...
2015/06/08
[ "https://Stackoverflow.com/questions/30710114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4493242/" ]
Move this code into a resize handler: ``` function resize() { if ( $(window).width() < 739) { $("#default").toggleClass('classold classnew'); } else { $("#default").toggleClass('classold classold'); } } $(window).on("resize", resize); resize(); // call once initially ``` --- You can als...
You can simply achieve it using CSS as ``` <style> @media (max-width: 600px) { /* your code */ } @media (min-width: 740px) { /* your code */ } </style> ``` [CSS media queries](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries)
30,710,114
I have a div class where I want change the css class name when resolution of the user's screen changes. The following script works: ``` if ( $(window).width() < 739) { $("#default").toggleClass('classold classnew'); } else { $("#default").toggleClass('classold classold'); } ``` But it has a problem. When I ...
2015/06/08
[ "https://Stackoverflow.com/questions/30710114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4493242/" ]
Move this code into a resize handler: ``` function resize() { if ( $(window).width() < 739) { $("#default").toggleClass('classold classnew'); } else { $("#default").toggleClass('classold classold'); } } $(window).on("resize", resize); resize(); // call once initially ``` --- You can als...
**Why your script does't work** Your if-else statement will be called on site load and then will never be touched again. For it to work properly you would have to trigger it on a resize event. **Why you should not use this solution** Whenever you can solve something with CSS only you should avoid using Javascript. O...
30,710,114
I have a div class where I want change the css class name when resolution of the user's screen changes. The following script works: ``` if ( $(window).width() < 739) { $("#default").toggleClass('classold classnew'); } else { $("#default").toggleClass('classold classold'); } ``` But it has a problem. When I ...
2015/06/08
[ "https://Stackoverflow.com/questions/30710114", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4493242/" ]
Move this code into a resize handler: ``` function resize() { if ( $(window).width() < 739) { $("#default").toggleClass('classold classnew'); } else { $("#default").toggleClass('classold classold'); } } $(window).on("resize", resize); resize(); // call once initially ``` --- You can als...
Have you tried something like this, but as well as attaching to resize event, attach to load? Also guys who are saying about media queries are right, but for JS it should be something like: ``` $(window).on('resize load', function () { if ($(window).width() < 739) { $("#default").addClass('classnew...
16,647,846
Is there a way to log the thread or queue that a method is running on / called from? Something like: ``` - (void)foo { NSLog(@"Running on %@ queue, %@ thread", queue, thread); } ```
2013/05/20
[ "https://Stackoverflow.com/questions/16647846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74118/" ]
You can get the current thread with `+[NSThread currentThread]`. That *could* have a `name` property, but if you didn't set one don't rely on it. Queues are trickier because there are different meanings of "queue". A queue *could* be an `NSOperationQueue`, and you can grab its `name` from `+[NSOperationQueue currentQu...
To get the thread, you can use ``` NSLog(@"Running on %@ thread", [NSThread currentThread]); ```
16,647,846
Is there a way to log the thread or queue that a method is running on / called from? Something like: ``` - (void)foo { NSLog(@"Running on %@ queue, %@ thread", queue, thread); } ```
2013/05/20
[ "https://Stackoverflow.com/questions/16647846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74118/" ]
Here's some Swift code that I'm currently using. This is partly based on another answer I previously posted here at Stack Overflow: <https://stackoverflow.com/a/41294559/253938> ``` /// Struct to contain either the thread name or an (arbitrary) thread number for the current thread. /// This is partly inspired by code...
To get the thread, you can use ``` NSLog(@"Running on %@ thread", [NSThread currentThread]); ```
16,647,846
Is there a way to log the thread or queue that a method is running on / called from? Something like: ``` - (void)foo { NSLog(@"Running on %@ queue, %@ thread", queue, thread); } ```
2013/05/20
[ "https://Stackoverflow.com/questions/16647846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74118/" ]
You can get the current thread with `+[NSThread currentThread]`. That *could* have a `name` property, but if you didn't set one don't rely on it. Queues are trickier because there are different meanings of "queue". A queue *could* be an `NSOperationQueue`, and you can grab its `name` from `+[NSOperationQueue currentQu...
You can get the current dispatch queue like this: ``` dispatch_queue_t dispatch_get_current_queue(void); ``` But the header has the following warnings: > > Recommended for debugging and logging purposes only: > > > The code must not > make any assumptions about the queue returned, unless it is one of the > gl...
16,647,846
Is there a way to log the thread or queue that a method is running on / called from? Something like: ``` - (void)foo { NSLog(@"Running on %@ queue, %@ thread", queue, thread); } ```
2013/05/20
[ "https://Stackoverflow.com/questions/16647846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74118/" ]
You can get the current thread with `+[NSThread currentThread]`. That *could* have a `name` property, but if you didn't set one don't rely on it. Queues are trickier because there are different meanings of "queue". A queue *could* be an `NSOperationQueue`, and you can grab its `name` from `+[NSOperationQueue currentQu...
Here's some Swift code that I'm currently using. This is partly based on another answer I previously posted here at Stack Overflow: <https://stackoverflow.com/a/41294559/253938> ``` /// Struct to contain either the thread name or an (arbitrary) thread number for the current thread. /// This is partly inspired by code...
16,647,846
Is there a way to log the thread or queue that a method is running on / called from? Something like: ``` - (void)foo { NSLog(@"Running on %@ queue, %@ thread", queue, thread); } ```
2013/05/20
[ "https://Stackoverflow.com/questions/16647846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74118/" ]
Here's some Swift code that I'm currently using. This is partly based on another answer I previously posted here at Stack Overflow: <https://stackoverflow.com/a/41294559/253938> ``` /// Struct to contain either the thread name or an (arbitrary) thread number for the current thread. /// This is partly inspired by code...
You can get the current dispatch queue like this: ``` dispatch_queue_t dispatch_get_current_queue(void); ``` But the header has the following warnings: > > Recommended for debugging and logging purposes only: > > > The code must not > make any assumptions about the queue returned, unless it is one of the > gl...
65,591,564
I have an html form from which I need to collect data and call a POST on a rest api. I am trying to do this using javascript and $.ajax but confused on how to setup the URL and collect data as I am very new to it. Could someone explain this fully, with an example if possible as I'm having trouble finding detailed docum...
2021/01/06
[ "https://Stackoverflow.com/questions/65591564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14949649/" ]
Try this: ``` <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <input type="text" value="3" name="id"...
Please read this simple article <https://javascript.info/fetch> You could use axios or jquery but fetch api is really simple
16,388,516
To scale an element with CSS based on various viewport heights is tedious to say the least, and should IMO not be needed. Then again, I might be totally wrong. I am wondering if it is at all possible to use jQuery in order to automatically set the scale of an element based on the height of the viewport? I have checke...
2013/05/05
[ "https://Stackoverflow.com/questions/16388516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1802982/" ]
It's easy enough to scale a top level element to some percentage of the viewport height. Just set the height property on the html and body elements to 100% and then any child of the body can use a percentage height and that will correspond to the viewport height. For example, something like the CSS below would make a ...
You can use `$(window).height()`, like in: ``` var winHeight = $(window).height(); ``` Then change the width according to the height and set both properties, something like: ``` $("#theElement").css({'width':varWidth, 'height':varHeight}); ```
2,643,741
I think complex number is really just 2D vector with product defined differently. But what is the significance of the way the product is defined for complex number: $(x\_1x\_2-y\_1y\_2,x\_1y\_2+x\_2y\_1)$? Why don't we go with say this $(-y\_2,x\_1y\_2+x\_2y\_1)$? We still have $i^2=-1$ right?
2018/02/09
[ "https://math.stackexchange.com/questions/2643741", "https://math.stackexchange.com", "https://math.stackexchange.com/users/294291/" ]
When you deal with $(a,b)$, what you should really have in mind is $a + bi$, even if you haven't yet formally defined it that way. Now, having that in mind, the multiplication becomes completely natural from the need to satisfy distributivity, commutativity and associativity (and $i ^ 2 = -1$): $$(a + bi)(c+di) = ac +...
It is very useful to define the multiplication of the complex numbers so that you get a field. This multiplication needs to extend multiplication of the reals, be associative, have inverses for non-zero elements, and satisfy the distributive property. Defined in the usual way, the complex numbers have the incredibly us...
2,643,741
I think complex number is really just 2D vector with product defined differently. But what is the significance of the way the product is defined for complex number: $(x\_1x\_2-y\_1y\_2,x\_1y\_2+x\_2y\_1)$? Why don't we go with say this $(-y\_2,x\_1y\_2+x\_2y\_1)$? We still have $i^2=-1$ right?
2018/02/09
[ "https://math.stackexchange.com/questions/2643741", "https://math.stackexchange.com", "https://math.stackexchange.com/users/294291/" ]
When you deal with $(a,b)$, what you should really have in mind is $a + bi$, even if you haven't yet formally defined it that way. Now, having that in mind, the multiplication becomes completely natural from the need to satisfy distributivity, commutativity and associativity (and $i ^ 2 = -1$): $$(a + bi)(c+di) = ac +...
We already know how to multiply sums because multiplication distributes over addition, so this is the rule $(a+b)(c+d) = a(c+d) + b(c+d) = ac+ad+bc+bd$. If it is possible (it may not be!) we would like to use such a rule. So we don't know what $\sqrt{-1}$ is. But if it were a number as we understand them (it may not b...
35,606,860
I would like to schedule a function which will run every 3 seconds until my app exits. I don't use setInterval because If something goes wrong it shouldn't be scheduled anymore so i use setTimeout i wrote something like this ``` function someWork(){ setTimeout(function(){ //do Stuff here someWork(); },300...
2016/02/24
[ "https://Stackoverflow.com/questions/35606860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2715191/" ]
You are rounding to the nearest 10. You can use modulo 10 to get the remainder: ``` $totalRows = 54; $remainder = $totalRows % 10; print $remainder; //prints 4 ```
Simply do ``` print $totalRows - $v; ``` As far as I know, there's not a function to retrieve it, but pure mathematical operation should be good enough.
267,593
I want to get product collection for current category while I am on a list page. I want to get current product collection for current category while ajax call **(i want the same collection in the controller which return some data based on collection)** so is there any way that I can get the same product collection whi...
2019/03/27
[ "https://magento.stackexchange.com/questions/267593", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/42301/" ]
Try below code ``` namespace Vendor\Module\Block\Home; use Magento\Catalog\Api\CategoryRepositoryInterface; class Products extends \Magento\Catalog\Block\Product\ListProduct { protected $_collection; protected $categoryRepository; protected $_resource; public function __construct( \Magento\C...
Try to use this below code in your block file : ``` <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace VendorName\ModuleName\Block; class Data extends \Magento\Framework\View\Element\Template { /** * @var \Magento\Catalog\Model\CategoryFactory ...
267,593
I want to get product collection for current category while I am on a list page. I want to get current product collection for current category while ajax call **(i want the same collection in the controller which return some data based on collection)** so is there any way that I can get the same product collection whi...
2019/03/27
[ "https://magento.stackexchange.com/questions/267593", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/42301/" ]
Try to use this below code in your block file : ``` <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace VendorName\ModuleName\Block; class Data extends \Magento\Framework\View\Element\Template { /** * @var \Magento\Catalog\Model\CategoryFactory ...
You can use a block like this. Loads the current catalog layer ( asuming you are in a category list page ) and from there you can get the loaded collection ``` namespace Vendor\Module\Block; use Magento\Catalog\Model\Layer\Resolver; use Magento\Framework\View\Element\Template; class Category extends \Magento\Framework...
267,593
I want to get product collection for current category while I am on a list page. I want to get current product collection for current category while ajax call **(i want the same collection in the controller which return some data based on collection)** so is there any way that I can get the same product collection whi...
2019/03/27
[ "https://magento.stackexchange.com/questions/267593", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/42301/" ]
Try below code ``` namespace Vendor\Module\Block\Home; use Magento\Catalog\Api\CategoryRepositoryInterface; class Products extends \Magento\Catalog\Block\Product\ListProduct { protected $_collection; protected $categoryRepository; protected $_resource; public function __construct( \Magento\C...
You can use a block like this. Loads the current catalog layer ( asuming you are in a category list page ) and from there you can get the loaded collection ``` namespace Vendor\Module\Block; use Magento\Catalog\Model\Layer\Resolver; use Magento\Framework\View\Element\Template; class Category extends \Magento\Framework...
51,398,335
I am trying to create a record of `salesorderdetail` and got an error: ``` { "error": { "code":"0x80040216", "message":"An unexpected error occurred.", "innererror": { "message":"An unexpected error occurred.", "type":"System.ServiceModel.FaultException`1[[Microsoft.Xrm....
2018/07/18
[ "https://Stackoverflow.com/questions/51398335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4476568/" ]
A type guard impacts the type of a parameter and must return a boolean. So a valid implementation would be: ``` function foo<T>(obj: T): obj is T & { bar: string }{ obj['bar'] = 'biz'; return true; } let o = { foo: "string" } if(foo(o)) { o.bar //valid o.foo //valid } ``` Unfortunately there isn't a...
Thanks to the answer provided by @TitianCernicova-Dragomir I ended up doing it like this: ``` function foo<T>(obj: T): obj is T & { bar: string }{ obj['bar'] = 'biz'; return true; } const obj = { foo: "string" } if(!foo(obj)) throw 'This will never happen'; o.bar //valid o.foo //valid ```
258,862
If you want to enter someone's bedroom and you want to avoid unpleasant situations(they're changing their clothes,for example) what would you say?
2015/07/12
[ "https://english.stackexchange.com/questions/258862", "https://english.stackexchange.com", "https://english.stackexchange.com/users/128884/" ]
You can simply knock on the door and wait to be invited. If they respond "Hello?" that may not be an invitation to enter, merely to announce yourself and why you wish to enter. You could state your intentions: > > May I come in and... (do whatever it is you need access to their room to do)? > > > I assume, of co...
One strategy is to feign complete ignorance. Knock on the door, and say > > "Knock, knock? Anyone in there?" > > > This avoids the need to ask any specific question. Asking "Are you decent?" is for some a bit personal, especially if you are not on close terms. After all, it suggests that you have been considerin...
171,118
I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like ``` cat "text to add" >> huge_file ``` To append to the file. Is that the route to go? What about prepending? In general, what is the bes...
2010/08/02
[ "https://superuser.com/questions/171118", "https://superuser.com", "https://superuser.com/users/44244/" ]
This is a partial answer, but yes, if you are simply appending I would use: ``` cat extra.txt >> huge_file.txt ``` or ``` echo "Single line to add" >> huge_file.txt ``` For prepending I would do: ``` cat extra.txt huge_file.txt > huge_file_new.txt ```
[UltraEdit](http://www.ultraedit.com) is capable of editing a file without loading it into memory. I haven't tested the Linux version of it yet, and neither have I tested a >4GB file, so I cannot give any guarantees, but I edited some huge (~1.5 GB) files with the Windows version (and long ago, too).
171,118
I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like ``` cat "text to add" >> huge_file ``` To append to the file. Is that the route to go? What about prepending? In general, what is the bes...
2010/08/02
[ "https://superuser.com/questions/171118", "https://superuser.com", "https://superuser.com/users/44244/" ]
If all you need is to append, then `>>huge_file` is much better than what any editor can do, because it won't touch the existing data. Inserting data into a file requires rewriting everything after the insertion point, so it'll be slow even with the right tools. With vim, make sure you try with the [LargeFile plugin](...
[UltraEdit](http://www.ultraedit.com) is capable of editing a file without loading it into memory. I haven't tested the Linux version of it yet, and neither have I tested a >4GB file, so I cannot give any guarantees, but I edited some huge (~1.5 GB) files with the Windows version (and long ago, too).
171,118
I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like ``` cat "text to add" >> huge_file ``` To append to the file. Is that the route to go? What about prepending? In general, what is the bes...
2010/08/02
[ "https://superuser.com/questions/171118", "https://superuser.com", "https://superuser.com/users/44244/" ]
Ultraedit is the only editor that does this well. I would, also, prefer an OSS. One doesn't exist. I'm particularly surprised that this isn't a capability of vi... it's such a swiss army knife.
[UltraEdit](http://www.ultraedit.com) is capable of editing a file without loading it into memory. I haven't tested the Linux version of it yet, and neither have I tested a >4GB file, so I cannot give any guarantees, but I edited some huge (~1.5 GB) files with the Windows version (and long ago, too).
171,118
I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like ``` cat "text to add" >> huge_file ``` To append to the file. Is that the route to go? What about prepending? In general, what is the bes...
2010/08/02
[ "https://superuser.com/questions/171118", "https://superuser.com", "https://superuser.com/users/44244/" ]
Just because I found this via google looking for something similar this is another method I found. Situation: You have a 4.0 GB file and you need to edit line number 120. Solution: Using head and tail to get everything except the line you want to edit. ``` # cat origfile.txt 1 2 3 4 5 6 7 8 9 10 # head -n...
[UltraEdit](http://www.ultraedit.com) is capable of editing a file without loading it into memory. I haven't tested the Linux version of it yet, and neither have I tested a >4GB file, so I cannot give any guarantees, but I edited some huge (~1.5 GB) files with the Windows version (and long ago, too).
171,118
I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like ``` cat "text to add" >> huge_file ``` To append to the file. Is that the route to go? What about prepending? In general, what is the bes...
2010/08/02
[ "https://superuser.com/questions/171118", "https://superuser.com", "https://superuser.com/users/44244/" ]
This is a partial answer, but yes, if you are simply appending I would use: ``` cat extra.txt >> huge_file.txt ``` or ``` echo "Single line to add" >> huge_file.txt ``` For prepending I would do: ``` cat extra.txt huge_file.txt > huge_file_new.txt ```
If all you need is to append, then `>>huge_file` is much better than what any editor can do, because it won't touch the existing data. Inserting data into a file requires rewriting everything after the insertion point, so it'll be slow even with the right tools. With vim, make sure you try with the [LargeFile plugin](...
171,118
I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like ``` cat "text to add" >> huge_file ``` To append to the file. Is that the route to go? What about prepending? In general, what is the bes...
2010/08/02
[ "https://superuser.com/questions/171118", "https://superuser.com", "https://superuser.com/users/44244/" ]
This is a partial answer, but yes, if you are simply appending I would use: ``` cat extra.txt >> huge_file.txt ``` or ``` echo "Single line to add" >> huge_file.txt ``` For prepending I would do: ``` cat extra.txt huge_file.txt > huge_file_new.txt ```
Ultraedit is the only editor that does this well. I would, also, prefer an OSS. One doesn't exist. I'm particularly surprised that this isn't a capability of vi... it's such a swiss army knife.
171,118
I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like ``` cat "text to add" >> huge_file ``` To append to the file. Is that the route to go? What about prepending? In general, what is the bes...
2010/08/02
[ "https://superuser.com/questions/171118", "https://superuser.com", "https://superuser.com/users/44244/" ]
This is a partial answer, but yes, if you are simply appending I would use: ``` cat extra.txt >> huge_file.txt ``` or ``` echo "Single line to add" >> huge_file.txt ``` For prepending I would do: ``` cat extra.txt huge_file.txt > huge_file_new.txt ```
Just because I found this via google looking for something similar this is another method I found. Situation: You have a 4.0 GB file and you need to edit line number 120. Solution: Using head and tail to get everything except the line you want to edit. ``` # cat origfile.txt 1 2 3 4 5 6 7 8 9 10 # head -n...
171,118
I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like ``` cat "text to add" >> huge_file ``` To append to the file. Is that the route to go? What about prepending? In general, what is the bes...
2010/08/02
[ "https://superuser.com/questions/171118", "https://superuser.com", "https://superuser.com/users/44244/" ]
If all you need is to append, then `>>huge_file` is much better than what any editor can do, because it won't touch the existing data. Inserting data into a file requires rewriting everything after the insertion point, so it'll be slow even with the right tools. With vim, make sure you try with the [LargeFile plugin](...
Ultraedit is the only editor that does this well. I would, also, prefer an OSS. One doesn't exist. I'm particularly surprised that this isn't a capability of vi... it's such a swiss army knife.
171,118
I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like ``` cat "text to add" >> huge_file ``` To append to the file. Is that the route to go? What about prepending? In general, what is the bes...
2010/08/02
[ "https://superuser.com/questions/171118", "https://superuser.com", "https://superuser.com/users/44244/" ]
If all you need is to append, then `>>huge_file` is much better than what any editor can do, because it won't touch the existing data. Inserting data into a file requires rewriting everything after the insertion point, so it'll be slow even with the right tools. With vim, make sure you try with the [LargeFile plugin](...
Just because I found this via google looking for something similar this is another method I found. Situation: You have a 4.0 GB file and you need to edit line number 120. Solution: Using head and tail to get everything except the line you want to edit. ``` # cat origfile.txt 1 2 3 4 5 6 7 8 9 10 # head -n...
33,622,496
I got an error in the following definition in typescript, may I know what is the problem? ``` interface Dictionary { [index: string]: string; length: number; } ```
2015/11/10
[ "https://Stackoverflow.com/questions/33622496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1497720/" ]
In your `Dictionary` interface, ``` [index: string]: string; ``` is called a string index signature, and tells the compiler all properties of a `Dictionary` must be of type `string`. You would commonly use an index signature to avoid having an array of mixed types. So then doing this is OK: ``` let d: Dictionary; ...
Please see the TypeScript documentation on [array types](http://www.typescriptlang.org/Handbook#interfaces-array-types). All properties must have the same return type so you can't declare length with a return type number on the interface. To get the length of the array you could cast back to a generic array type: ```...
58,163,850
Access to XMLHttpRequest at '<http://10.131.12.49:8010/get.me.data?opt=All>' from origin '<http://localhost:1826>' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. I am calling HttpRequest through Angular Framework. I tried with [R Shiny - how to add Acces...
2019/09/30
[ "https://Stackoverflow.com/questions/58163850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11969143/" ]
> > If parseFloat encounters a character other than a plus sign (+), > minus sign (- U+002D HYPHEN-MINUS), numeral (0–9), decimal point (.), > or exponent (e or E), it returns the value up to that character, > ignoring the invalid character and characters following it. > > > ``` parseFloat("10525142.25") ``` ...
The parseFloat() function parses a string and returns a floating point number. This function determines if the first character in the specified string is a number. If it is, it parses the string until it reaches the end of the number, and returns the number as a number, not as a string. Note: Only the first number in...
58,163,850
Access to XMLHttpRequest at '<http://10.131.12.49:8010/get.me.data?opt=All>' from origin '<http://localhost:1826>' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. I am calling HttpRequest through Angular Framework. I tried with [R Shiny - how to add Acces...
2019/09/30
[ "https://Stackoverflow.com/questions/58163850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11969143/" ]
To complete the previous answers and apply them to your problem. Remove dots from your string, then replace the comma with a dot. ``` // Your string values var strA = "10.525.142,25"; var strB = "10.525,25"; function fromUSFormatToStandard(x) { return x.replace(/\./g, "").replace(',', '.'); } var a = parseFloat(...
The parseFloat() function parses a string and returns a floating point number. This function determines if the first character in the specified string is a number. If it is, it parses the string until it reaches the end of the number, and returns the number as a number, not as a string. Note: Only the first number in...
59,939,098
Propose the following situation: ``` function functionExists(functionName) { if (typeof window[functionName] == 'function') console.log("It's a function"); } ``` What would be an equivalent function in `nodejs` for `functionExists` where there is no global `window` variable? **CONCRETE SITUATION:** My concrete...
2020/01/27
[ "https://Stackoverflow.com/questions/59939098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2691879/" ]
Unless you specifically KNOW that this is a global function (which is almost never the case in nodejs), functions by default in nodejs are scoped to the module and there is NO way to look them up by string name like you did with the `window` object in the browser, just like there is no way to look up local variables by...
In `node.js` you can achieve this like: ``` function functionExists(functionName) { if(functionName && typeof functionName === "function") console.log("It is a function"); } ``` Hope this works for you.
101,396
I have received a new laptop as a gift. I'd rather not open the package and carry the laptop onto the plane, so it seems I have two reasonable options: 1. Checking the package in as luggage. People often believe that it's a terrible idea because thieves can easily steal checked luggage (even though a TSA lock is used...
2017/09/03
[ "https://travel.stackexchange.com/questions/101396", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/66356/" ]
Checking in your laptop is a terrible idea, as mentioned: the risks are just too great, both in terms of loss and breakage. Moreover, option 2 isn't going to work in most places: you have to put laptops (and often tablets and phones) in trays. So you'd have to open the package anyway. Just take the laptop with you, an...
> > Bringing the laptop into the plane as carry-on: > > > Personal experience here - myself and my wife picked up two Macbook Airs in Schiphol during transit from the UK to Uganda. No one batted an eyelid at security at the gate - they were just x-rayed in their boxes, with shrink wrap undamaged, along with every...
101,396
I have received a new laptop as a gift. I'd rather not open the package and carry the laptop onto the plane, so it seems I have two reasonable options: 1. Checking the package in as luggage. People often believe that it's a terrible idea because thieves can easily steal checked luggage (even though a TSA lock is used...
2017/09/03
[ "https://travel.stackexchange.com/questions/101396", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/66356/" ]
Checking in your laptop is a terrible idea, as mentioned: the risks are just too great, both in terms of loss and breakage. Moreover, option 2 isn't going to work in most places: you have to put laptops (and often tablets and phones) in trays. So you'd have to open the package anyway. Just take the laptop with you, an...
I've cleared security with a new, boxed laptop--although they were free to open it if they wanted to. They didn't look. (This was a timing issue. While synching files in preparation for the trip my laptop utterly died. I burned what I could to CDs, stopped by the computer store on the way to the airport and grabbed the...
101,396
I have received a new laptop as a gift. I'd rather not open the package and carry the laptop onto the plane, so it seems I have two reasonable options: 1. Checking the package in as luggage. People often believe that it's a terrible idea because thieves can easily steal checked luggage (even though a TSA lock is used...
2017/09/03
[ "https://travel.stackexchange.com/questions/101396", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/66356/" ]
> > Bringing the laptop into the plane as carry-on: > > > Personal experience here - myself and my wife picked up two Macbook Airs in Schiphol during transit from the UK to Uganda. No one batted an eyelid at security at the gate - they were just x-rayed in their boxes, with shrink wrap undamaged, along with every...
I've cleared security with a new, boxed laptop--although they were free to open it if they wanted to. They didn't look. (This was a timing issue. While synching files in preparation for the trip my laptop utterly died. I burned what I could to CDs, stopped by the computer store on the way to the airport and grabbed the...
27,479,990
I've been trying to run the following code but the callbacks [ok() and ko()] are not called. Using Worklight 6.2 (Cordova 3.4). ``` function wlCommonInit() { window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, success, fail); window.resolveLocalFileSystemURL(cordova.file.applicationDirector...
2014/12/15
[ "https://Stackoverflow.com/questions/27479990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1293578/" ]
when you define `font: 1.1em/1.5 ...` ; you're using a shorthand property where the first value is the `font-size` and the second value is the `line-height` (which can be also unitless)
If `font` has two values separated by slash, the first one means `font-size`, the second one `line-height`. Ex. If parent has `font-size 10px`, this element will have `font-size 11px` and `line-height 16.5px` (11 \* 1.5).
27,479,990
I've been trying to run the following code but the callbacks [ok() and ko()] are not called. Using Worklight 6.2 (Cordova 3.4). ``` function wlCommonInit() { window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, success, fail); window.resolveLocalFileSystemURL(cordova.file.applicationDirector...
2014/12/15
[ "https://Stackoverflow.com/questions/27479990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1293578/" ]
when you define `font: 1.1em/1.5 ...` ; you're using a shorthand property where the first value is the `font-size` and the second value is the `line-height` (which can be also unitless)
It means nothing, since the declaration `font-size: 1.1em/1.5` is syntactically malformed and browsers are required to ignore it. A declaration like `font: 1.1em/1.5 serif` would be a different matter. But regarding the meaning of `/1.5` there, it has already been answered e.g. here: [Size of font in CSS with slash](h...
27,479,990
I've been trying to run the following code but the callbacks [ok() and ko()] are not called. Using Worklight 6.2 (Cordova 3.4). ``` function wlCommonInit() { window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, success, fail); window.resolveLocalFileSystemURL(cordova.file.applicationDirector...
2014/12/15
[ "https://Stackoverflow.com/questions/27479990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1293578/" ]
It means nothing, since the declaration `font-size: 1.1em/1.5` is syntactically malformed and browsers are required to ignore it. A declaration like `font: 1.1em/1.5 serif` would be a different matter. But regarding the meaning of `/1.5` there, it has already been answered e.g. here: [Size of font in CSS with slash](h...
If `font` has two values separated by slash, the first one means `font-size`, the second one `line-height`. Ex. If parent has `font-size 10px`, this element will have `font-size 11px` and `line-height 16.5px` (11 \* 1.5).
47,263,550
I am creating a Map with stores some data and i want the map to throw an exception if a duplicate value is tried to insert. ``` Map <Integer, String> temp; temp.put(1, "hi"); temp.put(1, "hello"); ``` Here this map should throw an error since a key '1' is already present. It can throw an error or does not compile. ...
2017/11/13
[ "https://Stackoverflow.com/questions/47263550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6059393/" ]
Map doesn't throw any error or exception while trying to add new value with a key that is present in the map. In that case old value is simply being replaced with a new value. If you want to add a functionality that will throw an error in that situation, you can use ``` if(map.containsKey(yourKey)) // here your err...
> > Map.put returns the previous value associated with key, or null if there was > no mapping for key. (A null return can also indicate that the map > previously associated null with key, if the implementation supports > null values.) > > > So you can do this: ``` public void addItem ( Integer key, String valu...
47,263,550
I am creating a Map with stores some data and i want the map to throw an exception if a duplicate value is tried to insert. ``` Map <Integer, String> temp; temp.put(1, "hi"); temp.put(1, "hello"); ``` Here this map should throw an error since a key '1' is already present. It can throw an error or does not compile. ...
2017/11/13
[ "https://Stackoverflow.com/questions/47263550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6059393/" ]
Check containsKey method. ``` Map<Integer, String> map = new LinkedHashMap<>(); map.put(1, "Value"); if (map.containsKey(1)) { throw new Exception("Map already contains key 1"); } ``` For your question, you can create your own implementation like: ``` public class MyCustomMap extends HashMap { ...
> > Map.put returns the previous value associated with key, or null if there was > no mapping for key. (A null return can also indicate that the map > previously associated null with key, if the implementation supports > null values.) > > > So you can do this: ``` public void addItem ( Integer key, String valu...
47,263,550
I am creating a Map with stores some data and i want the map to throw an exception if a duplicate value is tried to insert. ``` Map <Integer, String> temp; temp.put(1, "hi"); temp.put(1, "hello"); ``` Here this map should throw an error since a key '1' is already present. It can throw an error or does not compile. ...
2017/11/13
[ "https://Stackoverflow.com/questions/47263550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6059393/" ]
Using a contains-check prior to the put-operation is not an atomic-operation and therefore not thread-safe. Additionally, the map has to be accessed twice each time you add an entry. To avoid this, use one of the functional methods like merge or compute: ``` map.merge(key, value, (v1, v2) -> { throw new IllegalAr...
> > Map.put returns the previous value associated with key, or null if there was > no mapping for key. (A null return can also indicate that the map > previously associated null with key, if the implementation supports > null values.) > > > So you can do this: ``` public void addItem ( Integer key, String valu...
47,263,550
I am creating a Map with stores some data and i want the map to throw an exception if a duplicate value is tried to insert. ``` Map <Integer, String> temp; temp.put(1, "hi"); temp.put(1, "hello"); ``` Here this map should throw an error since a key '1' is already present. It can throw an error or does not compile. ...
2017/11/13
[ "https://Stackoverflow.com/questions/47263550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6059393/" ]
Check containsKey method. ``` Map<Integer, String> map = new LinkedHashMap<>(); map.put(1, "Value"); if (map.containsKey(1)) { throw new Exception("Map already contains key 1"); } ``` For your question, you can create your own implementation like: ``` public class MyCustomMap extends HashMap { ...
Map doesn't throw any error or exception while trying to add new value with a key that is present in the map. In that case old value is simply being replaced with a new value. If you want to add a functionality that will throw an error in that situation, you can use ``` if(map.containsKey(yourKey)) // here your err...
47,263,550
I am creating a Map with stores some data and i want the map to throw an exception if a duplicate value is tried to insert. ``` Map <Integer, String> temp; temp.put(1, "hi"); temp.put(1, "hello"); ``` Here this map should throw an error since a key '1' is already present. It can throw an error or does not compile. ...
2017/11/13
[ "https://Stackoverflow.com/questions/47263550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6059393/" ]
Using a contains-check prior to the put-operation is not an atomic-operation and therefore not thread-safe. Additionally, the map has to be accessed twice each time you add an entry. To avoid this, use one of the functional methods like merge or compute: ``` map.merge(key, value, (v1, v2) -> { throw new IllegalAr...
Map doesn't throw any error or exception while trying to add new value with a key that is present in the map. In that case old value is simply being replaced with a new value. If you want to add a functionality that will throw an error in that situation, you can use ``` if(map.containsKey(yourKey)) // here your err...
47,263,550
I am creating a Map with stores some data and i want the map to throw an exception if a duplicate value is tried to insert. ``` Map <Integer, String> temp; temp.put(1, "hi"); temp.put(1, "hello"); ``` Here this map should throw an error since a key '1' is already present. It can throw an error or does not compile. ...
2017/11/13
[ "https://Stackoverflow.com/questions/47263550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6059393/" ]
Using a contains-check prior to the put-operation is not an atomic-operation and therefore not thread-safe. Additionally, the map has to be accessed twice each time you add an entry. To avoid this, use one of the functional methods like merge or compute: ``` map.merge(key, value, (v1, v2) -> { throw new IllegalAr...
Check containsKey method. ``` Map<Integer, String> map = new LinkedHashMap<>(); map.put(1, "Value"); if (map.containsKey(1)) { throw new Exception("Map already contains key 1"); } ``` For your question, you can create your own implementation like: ``` public class MyCustomMap extends HashMap { ...
225,858
I am running Ubuntu 9.10 and 10.04 on MediaTemple (ve) servers. On both of them, the **anacron** setup is broken, ... and they have been broken since I first installed Ubuntu. It has only come to my attention recently, when I realize my log files were not rotating. I am hoping someone who has anacron working can help...
2011/01/23
[ "https://serverfault.com/questions/225858", "https://serverfault.com", "https://serverfault.com/users/51483/" ]
Upstart actually uses config files in `/etc/init` for each service, not `/etc/init.d`. I assume the /etc/init.d links are there to preserve compatibility with sysvinit. Here's the [upstart getting started guide](http://upstart.ubuntu.com/getting-started.html) which explains this. I don't have an ubuntu system so I can...
Ubuntu 10.04 /etc/cron.d/anacron: ``` # /etc/cron.d/anacron: crontab entries for the anacron package SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin #30 7 * * * root test -x /etc/init.d/anacron && /usr/sbin/invoke-rc.d anacron start >/dev/null 30 7 * * * root start -q a...