Search is not available for this dataset
qid
int64
1
74.7M
question
stringlengths
10
43.1k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
0
33.7k
response_k
stringlengths
0
40.5k
62,673,500
I have a table like this.a,b,c,d,e are the columns of table [![enter image description here](https://i.stack.imgur.com/K7nA3.png)](https://i.stack.imgur.com/K7nA3.png) I want to find distinct records on a combination of group by(d,e) and do some operation on the table The final table should remove duplicate keys. Th...
2020/07/01
[ "https://Stackoverflow.com/questions/62673500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12464504/" ]
I think i found a solution ``` SELECT concat(x.a,"cis") as a_1,concat(x.b,'cis1') as b_1,x.c as c_1, concat(x.d,'cis2') as d_1,x.e as e_1 FROM (SELECT a,b,c,d,e, ROW_NUMBER() OVER (PARTITION BY d, e order by d,e) as cnt FROM table ) x WHERE cnt = 1 ```
You can try below way - ``` SELECT concat(a,'cis') as a_1, concat(b,'cis1') as b_1, c as c_1, concat(d,'cis2') as d_1, max(e) as e_1 FROM table1 group by concat(a,'cis'),concat(b,'cis1'),c,concat(d,'cis2') ```
62,673,500
I have a table like this.a,b,c,d,e are the columns of table [![enter image description here](https://i.stack.imgur.com/K7nA3.png)](https://i.stack.imgur.com/K7nA3.png) I want to find distinct records on a combination of group by(d,e) and do some operation on the table The final table should remove duplicate keys. Th...
2020/07/01
[ "https://Stackoverflow.com/questions/62673500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12464504/" ]
I think i found a solution ``` SELECT concat(x.a,"cis") as a_1,concat(x.b,'cis1') as b_1,x.c as c_1, concat(x.d,'cis2') as d_1,x.e as e_1 FROM (SELECT a,b,c,d,e, ROW_NUMBER() OVER (PARTITION BY d, e order by d,e) as cnt FROM table ) x WHERE cnt = 1 ```
I don't see why your are using `row_number()`. How about this? ``` SELECT concat(x.a, 'cis') as a_1, concat(x.b, 'cis1') as b_1, x.c as c_1, concat(MIN(x.d), 'cis2') as d_1, x.e as e_1F FROM t GROUP BY x.a, x.b, x.c, x.e ``` You should also be able to use `||` for string concatenation: ``` SELECT (x.a || 'ci...
62,673,504
I have a pair of coordinates (lat, long). I need to generate an image of displaying these coordinates on the map. And then generate such images with other coordinates in the future without the Internet. Please tell me whether there are solutions that allow you to display coordinates offline? Upd: is there any opportu...
2020/07/01
[ "https://Stackoverflow.com/questions/62673504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7136335/" ]
I think i found a solution ``` SELECT concat(x.a,"cis") as a_1,concat(x.b,'cis1') as b_1,x.c as c_1, concat(x.d,'cis2') as d_1,x.e as e_1 FROM (SELECT a,b,c,d,e, ROW_NUMBER() OVER (PARTITION BY d, e order by d,e) as cnt FROM table ) x WHERE cnt = 1 ```
You can try below way - ``` SELECT concat(a,'cis') as a_1, concat(b,'cis1') as b_1, c as c_1, concat(d,'cis2') as d_1, max(e) as e_1 FROM table1 group by concat(a,'cis'),concat(b,'cis1'),c,concat(d,'cis2') ```
62,673,504
I have a pair of coordinates (lat, long). I need to generate an image of displaying these coordinates on the map. And then generate such images with other coordinates in the future without the Internet. Please tell me whether there are solutions that allow you to display coordinates offline? Upd: is there any opportu...
2020/07/01
[ "https://Stackoverflow.com/questions/62673504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7136335/" ]
I think i found a solution ``` SELECT concat(x.a,"cis") as a_1,concat(x.b,'cis1') as b_1,x.c as c_1, concat(x.d,'cis2') as d_1,x.e as e_1 FROM (SELECT a,b,c,d,e, ROW_NUMBER() OVER (PARTITION BY d, e order by d,e) as cnt FROM table ) x WHERE cnt = 1 ```
I don't see why your are using `row_number()`. How about this? ``` SELECT concat(x.a, 'cis') as a_1, concat(x.b, 'cis1') as b_1, x.c as c_1, concat(MIN(x.d), 'cis2') as d_1, x.e as e_1F FROM t GROUP BY x.a, x.b, x.c, x.e ``` You should also be able to use `||` for string concatenation: ``` SELECT (x.a || 'ci...
62,673,530
So I am having a state somewhat like this ``` this.state={ angles:{} } ``` So how can I do setState on this empty object. For instance if I want to set a key and value inside my empty angles. How can I do that. ( Likewise I want 0:90 inside my `this.state.anlges`. After setting the state it should look like ``` t...
2020/07/01
[ "https://Stackoverflow.com/questions/62673530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13234895/" ]
You'd do it by setting a new `angles` object, like this if you want to completely replace it: ``` this.setState({angles: {0: 90}}); ``` or like this if you want to preserve any other properties and just replace the `0` property: ``` // Callback form (often best) this.setState(({angles}) => ({angles: {...angles, 0: ...
You can write something like this: ``` this.setState((currentState) => ({ angles: { ...currentState.angles, 0: 90, } })); ``` be aware that number as key in objects is not recommended if both 0 and 90 are values then `angles` should be an array containing duos of values. example: ``` angles: [[0,90], ...
62,673,530
So I am having a state somewhat like this ``` this.state={ angles:{} } ``` So how can I do setState on this empty object. For instance if I want to set a key and value inside my empty angles. How can I do that. ( Likewise I want 0:90 inside my `this.state.anlges`. After setting the state it should look like ``` t...
2020/07/01
[ "https://Stackoverflow.com/questions/62673530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13234895/" ]
You can write something like this: ``` this.setState((currentState) => ({ angles: { ...currentState.angles, 0: 90, } })); ``` be aware that number as key in objects is not recommended if both 0 and 90 are values then `angles` should be an array containing duos of values. example: ``` angles: [[0,90], ...
I think this is the simplest way to do it: ``` this.setState({angles: {0:99}}); ```
62,673,530
So I am having a state somewhat like this ``` this.state={ angles:{} } ``` So how can I do setState on this empty object. For instance if I want to set a key and value inside my empty angles. How can I do that. ( Likewise I want 0:90 inside my `this.state.anlges`. After setting the state it should look like ``` t...
2020/07/01
[ "https://Stackoverflow.com/questions/62673530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13234895/" ]
You can write something like this: ``` this.setState((currentState) => ({ angles: { ...currentState.angles, 0: 90, } })); ``` be aware that number as key in objects is not recommended if both 0 and 90 are values then `angles` should be an array containing duos of values. example: ``` angles: [[0,90], ...
You probably want something like this: ```js const state = { angles: {} }; const setThisToState = { 0: 90 }; const key = Object.keys(setThisToState).toString(); const value = Object.values(setThisToState).toString(); state.angels = { [key]: value }; // { angles: { '0': '90' } ``` **EDIT:** Since you asked for...
62,673,530
So I am having a state somewhat like this ``` this.state={ angles:{} } ``` So how can I do setState on this empty object. For instance if I want to set a key and value inside my empty angles. How can I do that. ( Likewise I want 0:90 inside my `this.state.anlges`. After setting the state it should look like ``` t...
2020/07/01
[ "https://Stackoverflow.com/questions/62673530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13234895/" ]
You'd do it by setting a new `angles` object, like this if you want to completely replace it: ``` this.setState({angles: {0: 90}}); ``` or like this if you want to preserve any other properties and just replace the `0` property: ``` // Callback form (often best) this.setState(({angles}) => ({angles: {...angles, 0: ...
I think this is the simplest way to do it: ``` this.setState({angles: {0:99}}); ```
62,673,530
So I am having a state somewhat like this ``` this.state={ angles:{} } ``` So how can I do setState on this empty object. For instance if I want to set a key and value inside my empty angles. How can I do that. ( Likewise I want 0:90 inside my `this.state.anlges`. After setting the state it should look like ``` t...
2020/07/01
[ "https://Stackoverflow.com/questions/62673530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13234895/" ]
You'd do it by setting a new `angles` object, like this if you want to completely replace it: ``` this.setState({angles: {0: 90}}); ``` or like this if you want to preserve any other properties and just replace the `0` property: ``` // Callback form (often best) this.setState(({angles}) => ({angles: {...angles, 0: ...
You probably want something like this: ```js const state = { angles: {} }; const setThisToState = { 0: 90 }; const key = Object.keys(setThisToState).toString(); const value = Object.values(setThisToState).toString(); state.angels = { [key]: value }; // { angles: { '0': '90' } ``` **EDIT:** Since you asked for...
62,673,530
So I am having a state somewhat like this ``` this.state={ angles:{} } ``` So how can I do setState on this empty object. For instance if I want to set a key and value inside my empty angles. How can I do that. ( Likewise I want 0:90 inside my `this.state.anlges`. After setting the state it should look like ``` t...
2020/07/01
[ "https://Stackoverflow.com/questions/62673530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13234895/" ]
I think this is the simplest way to do it: ``` this.setState({angles: {0:99}}); ```
You probably want something like this: ```js const state = { angles: {} }; const setThisToState = { 0: 90 }; const key = Object.keys(setThisToState).toString(); const value = Object.values(setThisToState).toString(); state.angels = { [key]: value }; // { angles: { '0': '90' } ``` **EDIT:** Since you asked for...
62,673,550
I've recently cloned my netlify [site](http://yonseiuicscribe.netlify.app). After deploying via netlify on my cloned github repo, I get the following error ``` gatsby-plugin-netlify-cms" threw an error while running the onCreateWebpackConfig lifecycle: Module build failed (from ./node_modules/gatsby/dist/utils/babel-l...
2020/07/01
[ "https://Stackoverflow.com/questions/62673550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12146388/" ]
deleted `node_modules` and `package-lock.json` and did `npm install` to reinstall everything. I think some babel dependencies were outdated. Answer inspired from this [source](https://github.com/babel/babel/issues/11216)
You can try adding this to your netlify.toml ``` [functions] # Specifies `esbuild` for functions bundling node_bundler = "esbuild" ``` source: <https://github.com/netlify/netlify-plugin-nextjs/issues/597>
62,673,553
I'm trying to search for 3 (or more) specific RegEx inside HTML documents. The HTML files do all have different forms and layouts but specific words, so I can search for the words. Now, I'd like to return the line: ```html <div> <p>This 17 is A BIG test</p> <p>This is another greaterly test</p> <p>17738 that is yet <...
2020/07/01
[ "https://Stackoverflow.com/questions/62673553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2110476/" ]
deleted `node_modules` and `package-lock.json` and did `npm install` to reinstall everything. I think some babel dependencies were outdated. Answer inspired from this [source](https://github.com/babel/babel/issues/11216)
You can try adding this to your netlify.toml ``` [functions] # Specifies `esbuild` for functions bundling node_bundler = "esbuild" ``` source: <https://github.com/netlify/netlify-plugin-nextjs/issues/597>
62,673,554
I want to trigger longer running operation via rest request and WebFlux. The result of a call should just return an info that operation has started. The long running operation I want to run on different scheduler (e.g. Schedulers.single()). To achieve that I used subscribeOn: ``` Mono<RecalculationRequested> recalcula...
2020/07/01
[ "https://Stackoverflow.com/questions/62673554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2092052/" ]
One caveat of `subscribeOn` is it does what it says: it runs the act of "subscribing" on the provided `Scheduler`. Subscribing flows from bottom to top (the `Subscriber` subscribes to its parent `Publisher`), at runtime. Usually you see in documentation and presentations that `subscribeOn` affects the whole chain. Tha...
As per the [documentation](https://projectreactor.io/docs/core/release/reference/) , all operators prefixed with doOn , are sometimes referred to as having a β€œside-effect”. They let you peek inside the sequence’s events without modifying them. If you want to chain the 'recalculate' step after 'provider.size()' do it w...
62,673,569
I have a code which will read file data from the defined path and copies the data to my Macro workbook's sheet. When I am running the code line by line, it is working perfectly fine. But when I run the entire code, it is getting closed automatically without my permission. Below is my previous code. ``` Set thisWB = Th...
2020/07/01
[ "https://Stackoverflow.com/questions/62673569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13737789/" ]
Best way to solve this is by declaring a variable to fully control the open workbook in the same way you have for thisWB, eg: ``` Dim thatWB As Workbook Set thatWB = Workbooks.Open(TimFilePath) 'do the work thatWB.Close SaveChanges:=False ```
This code should work without relying on `Active` anything. ``` Option Explicit 'This line is REALLY important. 'It forces you to declare each variable. 'Tools ~ Options ~ Editor. Tick 'Require Variable Declaration' to 'add it to each new module you create. Public Sub Test() 'Set references to required files. ...
62,673,585
Currently, images with the attribute `loading="lazy"` (<https://web.dev/native-lazy-loading/>) are displayed immediately when loaded, i.e. without fade-in effect. Is there a way to animate images with the `loading="lazy"` attribute when they are loaded and preferably without JavaScript? I know, there are many lazyloa...
2020/07/01
[ "https://Stackoverflow.com/questions/62673585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1329470/" ]
I managed to use a simple jQuery solution, since its already used in my case: ``` //fade in lazy loaded images $('article img').on('load', function(){ $(this).addClass('loaded'); }); ``` The images have 0 opacity by default and opacity 1 from the new class ``` img{ opacity: 0; transition: opacity 300...
Unfortunately it is not as simple as the simple jQuery solution above. `.on('load')` does not work properly for all Browsers (like Chrome) as discussed here: [Check if an image is loaded (no errors) with jQuery](https://stackoverflow.com/questions/1977871/check-if-an-image-is-loaded-no-errors-with-jquery)
62,673,586
I am trying to create multiple consumers in a consumer group for parallel processing since we have heavy inflow of messages. I am using spring boot and KafkTemplate. How can we create multiple consumers belonging to single consumer group, in single instance of spring boot application? Does having multiple methods annot...
2020/07/01
[ "https://Stackoverflow.com/questions/62673586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3696393/" ]
You have to use `ConcurrentMessageListenerContainer`. It delegates to one or more `KafkaMessageListenerContainer` instances to provide multi-threaded consumption. ```java @Bean KafkaListenerContainerFactory<ConcurrentMessageListenerContainer<String, String>> kafkaListenerContainerFactory() { ConcurrentKafkaListene...
Yes, the `@KafkaListener` will create multiple consumers for you. With that you can configure all of them to use the same topic and belong to the same group. The Kafka coordinator will distribute partitions to your consumers. Although if you have only one partition in the topic, the concurrency won't happen: a single...
62,673,586
I am trying to create multiple consumers in a consumer group for parallel processing since we have heavy inflow of messages. I am using spring boot and KafkTemplate. How can we create multiple consumers belonging to single consumer group, in single instance of spring boot application? Does having multiple methods annot...
2020/07/01
[ "https://Stackoverflow.com/questions/62673586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3696393/" ]
You have to use `ConcurrentMessageListenerContainer`. It delegates to one or more `KafkaMessageListenerContainer` instances to provide multi-threaded consumption. ```java @Bean KafkaListenerContainerFactory<ConcurrentMessageListenerContainer<String, String>> kafkaListenerContainerFactory() { ConcurrentKafkaListene...
As @Salavat Yalalo suggested I made my Kafka container factory to be `ConcurrentKafkaListenerContainerFactory`. On the @KafkaListenere method I added option called concurrency which accepts an integer as a string which indicates number of consumers to be spanned, like below ``` @KafakListener(concurrency ="4", contain...
62,673,586
I am trying to create multiple consumers in a consumer group for parallel processing since we have heavy inflow of messages. I am using spring boot and KafkTemplate. How can we create multiple consumers belonging to single consumer group, in single instance of spring boot application? Does having multiple methods annot...
2020/07/01
[ "https://Stackoverflow.com/questions/62673586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3696393/" ]
Yes, the `@KafkaListener` will create multiple consumers for you. With that you can configure all of them to use the same topic and belong to the same group. The Kafka coordinator will distribute partitions to your consumers. Although if you have only one partition in the topic, the concurrency won't happen: a single...
As @Salavat Yalalo suggested I made my Kafka container factory to be `ConcurrentKafkaListenerContainerFactory`. On the @KafkaListenere method I added option called concurrency which accepts an integer as a string which indicates number of consumers to be spanned, like below ``` @KafakListener(concurrency ="4", contain...
62,673,592
I am currently trying to figure out a formula; I have the following: `=IF(G18>109,"A*",IF(G18>103,"A",IF(G18>85,"B",IF(G18>67,"C","F"))))` This allows me to work out grades for my students in my French class but I want to add another part to the formula... I want it so that if `C18:F18` says "INC", then the cell this ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846125/" ]
You have to use `ConcurrentMessageListenerContainer`. It delegates to one or more `KafkaMessageListenerContainer` instances to provide multi-threaded consumption. ```java @Bean KafkaListenerContainerFactory<ConcurrentMessageListenerContainer<String, String>> kafkaListenerContainerFactory() { ConcurrentKafkaListene...
Yes, the `@KafkaListener` will create multiple consumers for you. With that you can configure all of them to use the same topic and belong to the same group. The Kafka coordinator will distribute partitions to your consumers. Although if you have only one partition in the topic, the concurrency won't happen: a single...
62,673,592
I am currently trying to figure out a formula; I have the following: `=IF(G18>109,"A*",IF(G18>103,"A",IF(G18>85,"B",IF(G18>67,"C","F"))))` This allows me to work out grades for my students in my French class but I want to add another part to the formula... I want it so that if `C18:F18` says "INC", then the cell this ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846125/" ]
You have to use `ConcurrentMessageListenerContainer`. It delegates to one or more `KafkaMessageListenerContainer` instances to provide multi-threaded consumption. ```java @Bean KafkaListenerContainerFactory<ConcurrentMessageListenerContainer<String, String>> kafkaListenerContainerFactory() { ConcurrentKafkaListene...
As @Salavat Yalalo suggested I made my Kafka container factory to be `ConcurrentKafkaListenerContainerFactory`. On the @KafkaListenere method I added option called concurrency which accepts an integer as a string which indicates number of consumers to be spanned, like below ``` @KafakListener(concurrency ="4", contain...
62,673,592
I am currently trying to figure out a formula; I have the following: `=IF(G18>109,"A*",IF(G18>103,"A",IF(G18>85,"B",IF(G18>67,"C","F"))))` This allows me to work out grades for my students in my French class but I want to add another part to the formula... I want it so that if `C18:F18` says "INC", then the cell this ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846125/" ]
Yes, the `@KafkaListener` will create multiple consumers for you. With that you can configure all of them to use the same topic and belong to the same group. The Kafka coordinator will distribute partitions to your consumers. Although if you have only one partition in the topic, the concurrency won't happen: a single...
As @Salavat Yalalo suggested I made my Kafka container factory to be `ConcurrentKafkaListenerContainerFactory`. On the @KafkaListenere method I added option called concurrency which accepts an integer as a string which indicates number of consumers to be spanned, like below ``` @KafakListener(concurrency ="4", contain...
62,673,595
Can you tell me why the OUTPUT of this program is `ABBBCDE`? It was my exam question. ``` #include <stdio.h> int main (void) { int i; for (i = 0; i < 2; i++) { printf ("A"); for (; i < 3; i++) printf ("B"); printf ("C"); for (; i < 4; i++) printf ("D"); ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` int main (void) { int i; for (i = 0; i < 2; i++) { printf ("A"); for (; i < 3; i++) printf ("B"); printf ("C"); for (; i < 4; i++) printf ("D"); printf ("E"); } return 0; } ``` is the same as ``` int main (void) { int i; for (i = 0; i < 2; i++) { ...
If you indent the code properly it will help you understand what's going on: ``` #include <stdio.h> int main(void) { int i; for (i = 0; i < 2; i++) { printf("A"); // prints A 1 time, i is still 0 for (; i < 3; i++) // prints B 3 times, i will now be 3, the cycle ends pr...
62,673,595
Can you tell me why the OUTPUT of this program is `ABBBCDE`? It was my exam question. ``` #include <stdio.h> int main (void) { int i; for (i = 0; i < 2; i++) { printf ("A"); for (; i < 3; i++) printf ("B"); printf ("C"); for (; i < 4; i++) printf ("D"); ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` int main (void) { int i; for (i = 0; i < 2; i++) { printf ("A"); for (; i < 3; i++) printf ("B"); printf ("C"); for (; i < 4; i++) printf ("D"); printf ("E"); } return 0; } ``` is the same as ``` int main (void) { int i; for (i = 0; i < 2; i++) { ...
Because you have a for loop that checks if i is less than three. It starts at zero, zero is less than three so it prints B once, then it adds one to i and i becomes one, which is still less than three, so it prints another B. Then it ads one to i, making it two, which is still less than zero, which makes it print B a t...
62,673,595
Can you tell me why the OUTPUT of this program is `ABBBCDE`? It was my exam question. ``` #include <stdio.h> int main (void) { int i; for (i = 0; i < 2; i++) { printf ("A"); for (; i < 3; i++) printf ("B"); printf ("C"); for (; i < 4; i++) printf ("D"); ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you indent the code properly it will help you understand what's going on: ``` #include <stdio.h> int main(void) { int i; for (i = 0; i < 2; i++) { printf("A"); // prints A 1 time, i is still 0 for (; i < 3; i++) // prints B 3 times, i will now be 3, the cycle ends pr...
Because you have a for loop that checks if i is less than three. It starts at zero, zero is less than three so it prints B once, then it adds one to i and i becomes one, which is still less than three, so it prints another B. Then it ads one to i, making it two, which is still less than zero, which makes it print B a t...
62,673,610
I am using WebdriverIO version 5 and would like to see the logs of my test run. I tried the command: `npm run rltest --logLevel=info`, but all I can see is the output of the spec reporter. ``` [chrome 83.0.4103.116 Mac OS X #0-0] Running: chrome (v83.0.4103.116) on Mac OS X [chrome 83.0.4103.116 Mac OS X #0-0] Sessio...
2020/07/01
[ "https://Stackoverflow.com/questions/62673610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10431512/" ]
Check documentation - [logLevel](https://webdriver.io/docs/options.html#loglevel) So basically you need to setup this property in `wdio.conf.js`: ``` // =================== // Test Configurations // =================== // Define all options that are relevant for the WebdriverIO instance here // // Level of...
You should see the `wdio` logs in your console, as WebdriverIO defaults to dumping all the Selenium logs into `stdout`. Hope I understood correctly and you're talking about the `webdriver` logs, as below: ``` [0-0] 2020-07-01T09:28:53.869Z INFO webdriver: [GET] http://127.0.0.1:4444/wd/hub/session/933eeee4135ea0ca37d5...
62,673,611
I’m trying to fetch some data, specifically the β€˜html’ from the [1] array from the json displayed below. However when I console log welcomeTXT after setting the variable to that json selector it says ``` undefined ``` Any idea why the data is returning as undefined? ``` var welcomeTXT; fetch('http://ip.ip.ip...
2020/07/01
[ "https://Stackoverflow.com/questions/62673611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13612518/" ]
you forgot `data` here: ```js welcomeTXT = data['pages'][0]['title']; ```
In promise then you missed the "data" > > welcomeTXT = ['pages'][0]['title']; > > > it should be > > welcomeTXT = data['pages'][0]['title']; > > > ``` var welcomeTXT; fetch('http://ip.ip.ip.ip4/ghost/api/v3/content/pages/?key=276f4fc58131dfcf7a268514e5') .then(response => response.json()) .then(data =>...
62,673,628
I want to have a field `tags` as `completion`, and I do not want this field to participate in the scoring, so I am trying to apply the mapping ``` "tags": { "type": "completion", "index": false } ``` And I am getting an error ``` ElasticsearchStatusException[Elasticsearch exception [type=mapper_parsing_exce...
2020/07/01
[ "https://Stackoverflow.com/questions/62673628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13674325/" ]
The `completion` type stores the data in a different way in a finite state transducer (FST) data structure and not in the inverted index. You can find more information about the completion suggester here: * [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html...
mapper\_parsing\_exception says that it is not able to parse suppose if you are writing in python false --> False data = "tags": { "type": "completion", "index": False } send this in request as json json.loads(data)
62,673,634
I don't know why first it prints `data return` instead of after loop done code ``` exports.put = async function (req, res, next) { const data = Array.from(req.body); let errors = false; data.forEach(async (update, index) => { try { const result = await TypeofAccount.findByIdAndUpdate( ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10842900/" ]
The `completion` type stores the data in a different way in a finite state transducer (FST) data structure and not in the inverted index. You can find more information about the completion suggester here: * [Official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html...
mapper\_parsing\_exception says that it is not able to parse suppose if you are writing in python false --> False data = "tags": { "type": "completion", "index": False } send this in request as json json.loads(data)
62,673,652
I added collapsing toolbar in my app but now it only collapses when a user scrolls the image view inside the CollapsingToolbarLayout. How can collapse the toolbar when a user scrolls from anywhere within the view? this is my layout ``` <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorL...
2020/07/01
[ "https://Stackoverflow.com/questions/62673652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10264518/" ]
Put your included layout inside `NestedScrollView` view, since the `ConstraintLayout` is not a scrollable view. Like this: ``` <androidx.core.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="bottom" app:layout_anchor="@+id/app_ba...
Add this in the `profile_contents` layout's root view ``` app:layout_behavior="@string/appbar_scrolling_view_behavior" ``` > > We need to define an association between the AppBarLayout and the View that will be scrolled. Add an `app:layout_behavior` to a RecyclerView or any other View capable of nested scrolling su...
62,673,653
I am having an issue when running multiple tests one after another in webdriverio. When I am running multiple tests (for example a describe that contains multiple it) I am getting a recapcha that basically fails the test. Is there a way to overcome this? Thanks
2020/07/01
[ "https://Stackoverflow.com/questions/62673653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10431512/" ]
Put your included layout inside `NestedScrollView` view, since the `ConstraintLayout` is not a scrollable view. Like this: ``` <androidx.core.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="bottom" app:layout_anchor="@+id/app_ba...
Add this in the `profile_contents` layout's root view ``` app:layout_behavior="@string/appbar_scrolling_view_behavior" ``` > > We need to define an association between the AppBarLayout and the View that will be scrolled. Add an `app:layout_behavior` to a RecyclerView or any other View capable of nested scrolling su...
62,673,671
I am trying to iterate through a set of results, similar to the below, so to select that I perform the below: ``` for a in browser.find_elements_by_css_selector(".inner-row"): ``` What I then want to do is return: a. The x in the class next to time-x (e.g. 26940 in the example) b. filter to bananas only c. Gr...
2020/07/01
[ "https://Stackoverflow.com/questions/62673671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1513726/" ]
I guess this html is the each of the `a` in your code then you can exract the `id` and `time` with following code: ```py for a in browser.find_elements_by_css_selector(".inner-row"): try: el = a.find_element_by_css_selector("div.bananas") print("id: %s", el.get_attribute("id").split("-")[1]) ...
You can get the ids like so ```py print([e.get_attribute('id') for e in driver.find_elements(By.CSS_SELECTOR, 'div.bananas')]) ``` Prints `['row-1522076067']`
62,673,671
I am trying to iterate through a set of results, similar to the below, so to select that I perform the below: ``` for a in browser.find_elements_by_css_selector(".inner-row"): ``` What I then want to do is return: a. The x in the class next to time-x (e.g. 26940 in the example) b. filter to bananas only c. Gr...
2020/07/01
[ "https://Stackoverflow.com/questions/62673671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1513726/" ]
I guess this html is the each of the `a` in your code then you can exract the `id` and `time` with following code: ```py for a in browser.find_elements_by_css_selector(".inner-row"): try: el = a.find_element_by_css_selector("div.bananas") print("id: %s", el.get_attribute("id").split("-")[1]) ...
To handle dynamic element Induce `WebDriverWait`() and wait for `visibility_of_all_elements_located`() and following css selector. Then use **regular expression** to get the value from element attribute. **Code** ``` from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium...
62,673,672
There are a lot of similar questions to this, but none have helped me so I assume a nuance to my version which I'm missing. I have two DataFrames: df1, df2 (of same dimensions which can me mapped 1-2-1 on unique column, ie Name) and I want all rows which exist in df1 and are different to the corresponding row in df2. ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4508879/" ]
I guess this html is the each of the `a` in your code then you can exract the `id` and `time` with following code: ```py for a in browser.find_elements_by_css_selector(".inner-row"): try: el = a.find_element_by_css_selector("div.bananas") print("id: %s", el.get_attribute("id").split("-")[1]) ...
You can get the ids like so ```py print([e.get_attribute('id') for e in driver.find_elements(By.CSS_SELECTOR, 'div.bananas')]) ``` Prints `['row-1522076067']`
62,673,672
There are a lot of similar questions to this, but none have helped me so I assume a nuance to my version which I'm missing. I have two DataFrames: df1, df2 (of same dimensions which can me mapped 1-2-1 on unique column, ie Name) and I want all rows which exist in df1 and are different to the corresponding row in df2. ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4508879/" ]
I guess this html is the each of the `a` in your code then you can exract the `id` and `time` with following code: ```py for a in browser.find_elements_by_css_selector(".inner-row"): try: el = a.find_element_by_css_selector("div.bananas") print("id: %s", el.get_attribute("id").split("-")[1]) ...
To handle dynamic element Induce `WebDriverWait`() and wait for `visibility_of_all_elements_located`() and following css selector. Then use **regular expression** to get the value from element attribute. **Code** ``` from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium...
62,673,697
When I save a pair rdd by `rdd.repartition(1).saveAsTextFile(file_path)`, an error meets. ``` Py4JJavaError: An error occurred while calling o142.saveAsTextFile. : org.apache.spark.SparkException: Job aborted. at org.apache.spark.internal.io.SparkHadoopWriter$.write(SparkHadoopWriter.scala:100) at org.apache.s...
2020/07/01
[ "https://Stackoverflow.com/questions/62673697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9276708/" ]
Repartion method is triggering full shuffle, and if the dataset is large driver will result into memory error. Try to increase the number of partitions vaue in repartitton.
Check your java version. By uninstalling 32bit and installing 64bit version solve mine.
62,673,701
`data = {string1,string2}` The array data is fetched from PostgreSQL database that has a column of type text[] ie text array. I need to empty this array. OUTPUT: `data = {}` Can I use `tablename.update_attributes!(data: "")` OR `tablename.data.map!{ |e| e.destroy }` Context: ``` EMAILS.each do |e...
2020/07/01
[ "https://Stackoverflow.com/questions/62673701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8203419/" ]
Repartion method is triggering full shuffle, and if the dataset is large driver will result into memory error. Try to increase the number of partitions vaue in repartitton.
Check your java version. By uninstalling 32bit and installing 64bit version solve mine.
62,673,726
there is a react component stored inside of a state variable. I've attached a sample code and created a [codesandbox sample](https://codesandbox.io/s/mystifying-robinson-wz4uf). As you can see, `nameBadgeComponent` is supposed to display `{name}` field from state. It works fine for the default value, but does not react...
2020/07/01
[ "https://Stackoverflow.com/questions/62673726", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9890829/" ]
You can't create a component from a useState. A state is all the properties and data that define in what condition/appearance/etc the component is. A useState allows to control a piece of information or data, but doesn't respond to changes, a component does. The fact that you put "Component" in the name should give yo...
Why are you extracting the nameBadgeComponent to a state? That is useless as it only relies on `name`, keeping your code as close to the original as possible: ```js const [name, setName] = useState("DefaultName"); const nameBadgeComponent = <h2>My name is: {name}</h2>; return ( <div className="App"> {nameBadge...
62,673,733
I am a total beginner to python and coding. I Was just wondering if there is a way for python to read what I've typed into the console, For example: If it prints out a question, I can answer with many choices. This is what I've tried yet. ``` `answer = input("Vilken?") if answer.lower().strip() == "1": print("Okej...
2020/07/01
[ "https://Stackoverflow.com/questions/62673733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846121/" ]
You can't create a component from a useState. A state is all the properties and data that define in what condition/appearance/etc the component is. A useState allows to control a piece of information or data, but doesn't respond to changes, a component does. The fact that you put "Component" in the name should give yo...
Why are you extracting the nameBadgeComponent to a state? That is useless as it only relies on `name`, keeping your code as close to the original as possible: ```js const [name, setName] = useState("DefaultName"); const nameBadgeComponent = <h2>My name is: {name}</h2>; return ( <div className="App"> {nameBadge...
62,673,738
I have a pretty simple .csv table: [![enter image description here](https://i.stack.imgur.com/q4fbi.png)](https://i.stack.imgur.com/q4fbi.png) I use this table as an input parameter when creating a model in Create ML, where the target is PRICE, CITY and DATE are feature columns. I need to get a price prediction for...
2020/07/01
[ "https://Stackoverflow.com/questions/62673738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1213848/" ]
You can't create a component from a useState. A state is all the properties and data that define in what condition/appearance/etc the component is. A useState allows to control a piece of information or data, but doesn't respond to changes, a component does. The fact that you put "Component" in the name should give yo...
Why are you extracting the nameBadgeComponent to a state? That is useless as it only relies on `name`, keeping your code as close to the original as possible: ```js const [name, setName] = useState("DefaultName"); const nameBadgeComponent = <h2>My name is: {name}</h2>; return ( <div className="App"> {nameBadge...
62,673,739
I have an Android App (written in Java) which retrieves a JSON object from the backend, parses it, and displays the data in the app. Everything is working fine (meaning that every field is being displayed correctly) except for one field. All the fields being displayed correctly are `String` whereas the one field which ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7015166/" ]
You can't create a component from a useState. A state is all the properties and data that define in what condition/appearance/etc the component is. A useState allows to control a piece of information or data, but doesn't respond to changes, a component does. The fact that you put "Component" in the name should give yo...
Why are you extracting the nameBadgeComponent to a state? That is useless as it only relies on `name`, keeping your code as close to the original as possible: ```js const [name, setName] = useState("DefaultName"); const nameBadgeComponent = <h2>My name is: {name}</h2>; return ( <div className="App"> {nameBadge...
62,673,756
I am trying to autofill a text box based on the state from another component. Which works fine. But when I go to add ngModel to the text box to take in the value when submitting the form. The value is cleared and not displayed to the user. ```html <div *ngIf="autoFill; else noFillMode" class="row"> <label>Mode of Tr...
2020/07/01
[ "https://Stackoverflow.com/questions/62673756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4682626/" ]
You can't create a component from a useState. A state is all the properties and data that define in what condition/appearance/etc the component is. A useState allows to control a piece of information or data, but doesn't respond to changes, a component does. The fact that you put "Component" in the name should give yo...
Why are you extracting the nameBadgeComponent to a state? That is useless as it only relies on `name`, keeping your code as close to the original as possible: ```js const [name, setName] = useState("DefaultName"); const nameBadgeComponent = <h2>My name is: {name}</h2>; return ( <div className="App"> {nameBadge...
62,673,771
If i declare a function like below: ``` function a(){ //do something } ``` And if i execute it with `a()` it gets putted onto the top of the callstack and gets popped of when its finished. While the function is in the callstack the main thread is blocked and cant do other things until the callstack is empty. But ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10990737/" ]
Yes, `async function`s will be on the call stack during their execution just like normal functions. You can consider the desugaring of the `await` keyword: ``` function log(x) { console.log("at "+x); } function delay(t) { return new Promise(resolve => setTimeout(resolve, t)); } async function example() { log(1);...
it does go onto the call stack, when its time for the async function to run it gets moved off of the call stack until the function is either fulfilled.or rejected. at this point it get moved into the callback queue while all other synchronous functions can continue to execute off of the callstack, then when the callsta...
62,673,780
I need the basename of a file that is given as an argument to a bash script. The basename should be stripped of its file extension. Let's assume `$1 = "/somefolder/andanotherfolder/myfile.txt"`, the desired output would be `"myfile"`. The current attempt creates an intermediate variable that I would like to avoid: ``...
2020/07/01
[ "https://Stackoverflow.com/questions/62673780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6908422/" ]
``` NOEXT="${1##*/}"; NOEXT="${NOEXT%.*}" ```
How about: ``` $ [[ $var =~ [^/]*$ ]] && echo ${BASH_REMATCH%.*} myfile ```
62,673,780
I need the basename of a file that is given as an argument to a bash script. The basename should be stripped of its file extension. Let's assume `$1 = "/somefolder/andanotherfolder/myfile.txt"`, the desired output would be `"myfile"`. The current attempt creates an intermediate variable that I would like to avoid: ``...
2020/07/01
[ "https://Stackoverflow.com/questions/62673780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6908422/" ]
Why not Zoidberg ? Ehhmm.. I meant why not remove the ext before going for basename ? ``` basename "${1%.*}" ``` Unless of course you have directory paths with dots, then you'll have to use basename before and remove the extension later: ``` echo $(basename "$1") | awk 'BEGIN { FS = "." }; { print $1 }' ``` The a...
How about: ``` $ [[ $var =~ [^/]*$ ]] && echo ${BASH_REMATCH%.*} myfile ```
62,673,780
I need the basename of a file that is given as an argument to a bash script. The basename should be stripped of its file extension. Let's assume `$1 = "/somefolder/andanotherfolder/myfile.txt"`, the desired output would be `"myfile"`. The current attempt creates an intermediate variable that I would like to avoid: ``...
2020/07/01
[ "https://Stackoverflow.com/questions/62673780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6908422/" ]
How about this? ```sh NEXT="$(basename -- "${1%.*}")" ``` Testing: ```sh set -- '/somefolder/andanotherfolder/myfile.txt' NEXT="$(basename -- "${1%.*}")" echo "$NEXT" ``` > > `myfile` > > > Alternatively: ```sh set -- "${1%.*}"; NEXT="${1##*/}" ```
How about: ``` $ [[ $var =~ [^/]*$ ]] && echo ${BASH_REMATCH%.*} myfile ```
62,673,780
I need the basename of a file that is given as an argument to a bash script. The basename should be stripped of its file extension. Let's assume `$1 = "/somefolder/andanotherfolder/myfile.txt"`, the desired output would be `"myfile"`. The current attempt creates an intermediate variable that I would like to avoid: ``...
2020/07/01
[ "https://Stackoverflow.com/questions/62673780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6908422/" ]
Why not Zoidberg ? Ehhmm.. I meant why not remove the ext before going for basename ? ``` basename "${1%.*}" ``` Unless of course you have directory paths with dots, then you'll have to use basename before and remove the extension later: ``` echo $(basename "$1") | awk 'BEGIN { FS = "." }; { print $1 }' ``` The a...
``` NOEXT="${1##*/}"; NOEXT="${NOEXT%.*}" ```
62,673,780
I need the basename of a file that is given as an argument to a bash script. The basename should be stripped of its file extension. Let's assume `$1 = "/somefolder/andanotherfolder/myfile.txt"`, the desired output would be `"myfile"`. The current attempt creates an intermediate variable that I would like to avoid: ``...
2020/07/01
[ "https://Stackoverflow.com/questions/62673780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6908422/" ]
Why not Zoidberg ? Ehhmm.. I meant why not remove the ext before going for basename ? ``` basename "${1%.*}" ``` Unless of course you have directory paths with dots, then you'll have to use basename before and remove the extension later: ``` echo $(basename "$1") | awk 'BEGIN { FS = "." }; { print $1 }' ``` The a...
How about this? ```sh NEXT="$(basename -- "${1%.*}")" ``` Testing: ```sh set -- '/somefolder/andanotherfolder/myfile.txt' NEXT="$(basename -- "${1%.*}")" echo "$NEXT" ``` > > `myfile` > > > Alternatively: ```sh set -- "${1%.*}"; NEXT="${1##*/}" ```
62,673,785
``` { "AWSTemplateFormatVersion": "2010-09-09", "Parameters": { "VpcId": { "Type": "AWS::EC2::VPC::Id", "Description": "VpcId of your existing Virtual Private Cloud (VPC)", "ConstraintDescription": "must be the VPC Id of an existing Virtual Private Cloud." },...
2020/07/01
[ "https://Stackoverflow.com/questions/62673785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12409879/" ]
I have ran your template through [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint) and got a lot of problems reported: ``` W2030 You must specify a valid allowed value for InstanceType (cg1.4xlarge). Valid values are ['a1.2xlarge', 'a1.4xlarge', 'a1.large', 'a1.medium', 'a1.metal', 'a1.xlarge', 'c1.med...
This is coming down to `HealthCheckType` being in the target group resource, it should instead be attached to your autoscaling group. The fixed template for this error is below ``` { "AWSTemplateFormatVersion": "2010-09-09", "Parameters": { "VpcId": { "Type": "AWS::EC2::VPC::Id", ...
62,673,787
What I'm trying to get is the immediate upper div value (Accounts Admin) when I'm clicking on a radio button. Below is my HTML structure. Whenever I click on the admin or alan radio button give me the div inner text Accounts Admin. How can get that value? ```html <div class="display-flex flex-row"> <div class="p-1...
2020/07/01
[ "https://Stackoverflow.com/questions/62673787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2414345/" ]
Assuming you have multiple blocks of this, I would change the html structure a bit so you have a wrapper around the complete block. With the `closest()` function you can find the first wrapper parent and then use `find()` to look for the header element. You can use `trim()` to remove the whitespace caused by code inde...
With your HTML structure as it is, you need to find the closest (nearest parent) `.row` and then use `prevAll` to get the header row. ``` $(this).closest(".row").prevAll(".flex-row").first().text().trim() ``` ```js $("input.userlist").click(function() { console.log($(this).closest(".row").prevAll(".flex-row").firs...
62,673,802
I am using the lightning chart and would like to make the background transparent I tried setting the following on my chart but it just gives me a black background ``` .setChartBackgroundFillStyle( new SolidFill({ // A (alpha) is optional - 255 by default color: ColorRGBA(255, 0, 0,0) }) ) .setBackgrou...
2020/07/01
[ "https://Stackoverflow.com/questions/62673802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13061693/" ]
In LightningChart JS version 2.0.0 and above it's possible to set the chart background color to transparent with [`chart.setChartBackgroundFillStyle(transparentFill)`](https://www.arction.com/lightningchart-js-api-documentation/v2.0.0/classes/chartxy.html#setchartbackgroundfillstyle) and [`chart.setBackgroundFillStyle(...
You can use css "**background-color:transparent**"
62,673,821
One of our client asks to get all the video that they uploaded to the system. The files are stored at s3. Client expect to get one link that will download archive with all the videos. Is there a way to create such an archive without downloading files archiving it and uploading back to aws? So far I didn't find the so...
2020/07/01
[ "https://Stackoverflow.com/questions/62673821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8870505/" ]
Unfortunately, you **can't create a zip-like archives from existing objects** directly on S3. Similarly you can't transfer them to Glacier to do this. Glacier is not going to produce a single zip or rar (or any time of) archive from multiple s3 objects for you. Instead, you have to **download** them first, zip or rar ...
You can create a glacier archive for a specific prefix (what you see as a subfolder) by using AWS lifecycle rules to perform this action. More information available [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html). **Original answer** There is no native way to ...
62,673,839
I use some approaches similar to the following one in Java: ``` public static void main(String[] args) { Scanner scan = new Scanner(System.in); int[] a= new int[3]; //assign inputs for (int i=0;i<3;i++) a[i] = scan.nextInt(); scan.close(); //print inputs for(int j=0;j<3;j++) ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Unfortunately, you **can't create a zip-like archives from existing objects** directly on S3. Similarly you can't transfer them to Glacier to do this. Glacier is not going to produce a single zip or rar (or any time of) archive from multiple s3 objects for you. Instead, you have to **download** them first, zip or rar ...
You can create a glacier archive for a specific prefix (what you see as a subfolder) by using AWS lifecycle rules to perform this action. More information available [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html). **Original answer** There is no native way to ...
62,673,857
I would like init a Jquery dataTable in svelte. My first solution was : I create in my html page a script function with Jquery dataTable ``` <script> function initTable() { if( $('#datatable').length ) { $('#datatable').dataTable({ sDom: "<'row'<'col-sm-6'l><'col-sm-6'f>r>t<'row'<'col-sm-6'i><...
2020/07/01
[ "https://Stackoverflow.com/questions/62673857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13595312/" ]
Unfortunately, you **can't create a zip-like archives from existing objects** directly on S3. Similarly you can't transfer them to Glacier to do this. Glacier is not going to produce a single zip or rar (or any time of) archive from multiple s3 objects for you. Instead, you have to **download** them first, zip or rar ...
You can create a glacier archive for a specific prefix (what you see as a subfolder) by using AWS lifecycle rules to perform this action. More information available [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html). **Original answer** There is no native way to ...
62,673,867
I'm trying to truncate a string in a select input option using perl if it is longer than a set value, though i can't get it to work correctly. ``` my $value = defined $option->{value} ? $option->{value} : ''; my $maxValueLength = 50; if ($value.length > $maxValueLength) { $value = substr $value, 0...
2020/07/01
[ "https://Stackoverflow.com/questions/62673867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5223350/" ]
Another option is regex ``` $string =~ s/.{$maxLength}\K.*/.../; ``` It matches any character (`.`) given number of times (`{N}`, here `$maxLength`), what is the first `$maxLength` characters in `$string`; then `\K` makes it "forget" all previous matches so those won't get replaced later. The rest of the string that...
To find a length of the string use `length(STRING)` --- Here is the code snippet how you can modify the script. ``` #!/usr/bin/perl use strict; use warnings; use feature qw(say); my $string = "abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz"; say "length of original string is:".len...
62,673,867
I'm trying to truncate a string in a select input option using perl if it is longer than a set value, though i can't get it to work correctly. ``` my $value = defined $option->{value} ? $option->{value} : ''; my $maxValueLength = 50; if ($value.length > $maxValueLength) { $value = substr $value, 0...
2020/07/01
[ "https://Stackoverflow.com/questions/62673867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5223350/" ]
Your code has several syntax errors. Turn on `use strict` and `use warnings` if you don't have it, and then read the error messages it tells you about. This is a bit tricky because of Perl's very complex syntax (see also [Damian Conway's keynote from the 2020 Perl and Raku Conference](https://www.youtube.com/watch?v=fV...
To find a length of the string use `length(STRING)` --- Here is the code snippet how you can modify the script. ``` #!/usr/bin/perl use strict; use warnings; use feature qw(say); my $string = "abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz"; say "length of original string is:".len...
62,673,867
I'm trying to truncate a string in a select input option using perl if it is longer than a set value, though i can't get it to work correctly. ``` my $value = defined $option->{value} ? $option->{value} : ''; my $maxValueLength = 50; if ($value.length > $maxValueLength) { $value = substr $value, 0...
2020/07/01
[ "https://Stackoverflow.com/questions/62673867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5223350/" ]
Your code has several syntax errors. Turn on `use strict` and `use warnings` if you don't have it, and then read the error messages it tells you about. This is a bit tricky because of Perl's very complex syntax (see also [Damian Conway's keynote from the 2020 Perl and Raku Conference](https://www.youtube.com/watch?v=fV...
Another option is regex ``` $string =~ s/.{$maxLength}\K.*/.../; ``` It matches any character (`.`) given number of times (`{N}`, here `$maxLength`), what is the first `$maxLength` characters in `$string`; then `\K` makes it "forget" all previous matches so those won't get replaced later. The rest of the string that...
62,673,868
Suppose I have a function gcf(x,y) that returns the greatest common factor of x and y. So, for example, ``` gcf(75,85) = 5 ``` Now, I'm trying to create a function lcm(v) that takes a vector of integers and returns the least common multiple. I know mathematically it will be lcd(a,b) = a\*b/((gcf(a,b)) But I have ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673868", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13548019/" ]
No need to reinvent the wheel. You can try the package `library(pracma)` and the vectorized functions `gcd` & `Lcm` like ``` a1 = c(75, 30) b1 = c(85, 10) pracma::gcd(a1,b1) [1] 5 10 pracma::Lcm(a1,b1) [1] 1275 30 ``` Check `View(pracma::gcd)` or hit `F2` in RStudio to learn from the source code. The second quest...
Package *numbers* contains number-theoretic functions, and function `mLCM()` therein does what you want (I think): ``` > numbers::mLCM(c(20,50,75)) [1] 300 ``` If you want to write your own function, you may still want to take a look into this function -- the logic behind is simple.
62,673,883
Here is my *main.yml* ```yaml --- - name: Gathering VCenter facts vmware_vm_info: hostname: "{{ vcenter_server }}" username: "{{ vcenter_user }}" password: "{{ vcenter_pass }}" validate_certs: false register: vcenter_facts delegate_to: localhost - debug: var: vcenter_facts.virtual_machines ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2899790/" ]
No need to reinvent the wheel. You can try the package `library(pracma)` and the vectorized functions `gcd` & `Lcm` like ``` a1 = c(75, 30) b1 = c(85, 10) pracma::gcd(a1,b1) [1] 5 10 pracma::Lcm(a1,b1) [1] 1275 30 ``` Check `View(pracma::gcd)` or hit `F2` in RStudio to learn from the source code. The second quest...
Package *numbers* contains number-theoretic functions, and function `mLCM()` therein does what you want (I think): ``` > numbers::mLCM(c(20,50,75)) [1] 300 ``` If you want to write your own function, you may still want to take a look into this function -- the logic behind is simple.
62,673,908
I have got two collections of same object ``` public class MyClass { public int Id {get;set;} public string Name {get;set;} public int Age{get;set;} public string SSN{get;set;} } ``` I have got two Collections (**colA and colB**) based on MyClass and want to compare them in a way to find New, Changed or D...
2020/07/01
[ "https://Stackoverflow.com/questions/62673908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1711287/" ]
The way I would approach this is as follows: * Implement a `Diff` method which, similar to `Equals` returns the list of fields which differ between the current and passed in instance * Use that method in `Equals` to check for equality. I might be tempted to implement `IEquatable<MyClass>` for a bit of type safety, and...
as far as i know best practice will be using the same equality members in both GetHashCode() and Equals(object obj). if using resharper you can get help with this manual : <https://www.jetbrains.com/help/resharper/Code_Generation__Equality_Members.html>
62,673,918
I am A PHP developer and currently moving towards Laravel framework as per my task I have to complete the realtime table using ajax but I am sticking with an error which is CSRF token mismatch error please help me to resolve the error I am posting shortcode only **JAVA Script** ``` <script> function getMessage() { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6611946/" ]
make sure that you have the meta tag in your head of the view: ``` <meta name="csrf-token" content="{{ csrf_token() }}" /> ``` Then you can initialize it just once after loading the jQuery library, add this: ``` <script type="text/javascript"> $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-...
I had a same problem. i changed **APP\_NAME** in .env file to default value (Laravel). try it.
62,673,918
I am A PHP developer and currently moving towards Laravel framework as per my task I have to complete the realtime table using ajax but I am sticking with an error which is CSRF token mismatch error please help me to resolve the error I am posting shortcode only **JAVA Script** ``` <script> function getMessage() { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6611946/" ]
I had a same problem. i changed **APP\_NAME** in .env file to default value (Laravel). try it.
If you have already configured headers and it still doesn't work, try creating a new key: ``` php artisan key:generate ```
62,673,918
I am A PHP developer and currently moving towards Laravel framework as per my task I have to complete the realtime table using ajax but I am sticking with an error which is CSRF token mismatch error please help me to resolve the error I am posting shortcode only **JAVA Script** ``` <script> function getMessage() { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62673918", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6611946/" ]
make sure that you have the meta tag in your head of the view: ``` <meta name="csrf-token" content="{{ csrf_token() }}" /> ``` Then you can initialize it just once after loading the jQuery library, add this: ``` <script type="text/javascript"> $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-...
If you have already configured headers and it still doesn't work, try creating a new key: ``` php artisan key:generate ```
62,673,946
I am using flutter country\_code\_picker 1.4.0 package to get the dial code, Is there any way to validate international phone number by length. [country\_code\_picker package](https://pub.dev/packages/country_code_picker)
2020/07/01
[ "https://Stackoverflow.com/questions/62673946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10768535/" ]
Answer was on comment section, I am mentioning that here, [International phone number input validation](https://pub.flutter-io.cn/packages/international_phone_input) Above package is the only way of I found to validate International phone number flutter
You can use regex NOTE: only 10 digit validate. by below method. ``` String validateMobile(String value) { String pattern = r'(^(?:[+0]9)?[0-9]{10,12}$)'; RegExp regExp = new RegExp(pattern); if (value.length == 0) { return 'Please enter mobile number'; } else if (!regExp.hasMatch(value)) { retur...
62,673,965
I am tinkering with tkinter for the first time. I got this from geeksforgeeks.org (changed it a little) When I run: > > pedro@pedro-512ssd:~/myPython/tkinter$ ./newWindow\_display\_textv5.py > > > in bash, I see my window, but the output "key was pressed" appears in bash and not in my shiny new window. Is it po...
2020/07/01
[ "https://Stackoverflow.com/questions/62673965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10470463/" ]
You could always do this: ```py from tkinter import Tk, Canvas def func(event): c.create_text(0, 0, text="Pressed key {}".format(event.char)) #0, 0 are coordinates (0, 0 is top left) window = Tk() window.title("some tkinter window") window.geometry("640x480") c = Canvas(window, width=640, height=480) c.pack() ...
you need to set a label on your window. for example `someLabel = Label( window, text='set Text here' )` there are other commands for the positioning of said label
62,673,968
Im trying to read the content from my webpage, I want the content from particular tag, For Example : `<div id="extension-id" class="bounded-text">ID: jljdfmfebppemoghjopapmnpedkibcpi</div>` I can find the existence of this tag using the method driver.find\_element\_by\_id, after this I want to get the id inside the t...
2020/07/01
[ "https://Stackoverflow.com/questions/62673968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13835969/" ]
You could always do this: ```py from tkinter import Tk, Canvas def func(event): c.create_text(0, 0, text="Pressed key {}".format(event.char)) #0, 0 are coordinates (0, 0 is top left) window = Tk() window.title("some tkinter window") window.geometry("640x480") c = Canvas(window, width=640, height=480) c.pack() ...
you need to set a label on your window. for example `someLabel = Label( window, text='set Text here' )` there are other commands for the positioning of said label
62,673,973
We have date-time in GMT and want to convert it in EST. when we are trying below xsl, we are getting an error. FORG0001: Invalid dateTime value "05/26/20 14:58" (Non-numeric year component) **Here is my xsl-** ``` <xsl:variable name="estDateTime"> <xsl:call-template name="convertGMTToEST"...
2020/07/01
[ "https://Stackoverflow.com/questions/62673973", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12070734/" ]
You could always do this: ```py from tkinter import Tk, Canvas def func(event): c.create_text(0, 0, text="Pressed key {}".format(event.char)) #0, 0 are coordinates (0, 0 is top left) window = Tk() window.title("some tkinter window") window.geometry("640x480") c = Canvas(window, width=640, height=480) c.pack() ...
you need to set a label on your window. for example `someLabel = Label( window, text='set Text here' )` there are other commands for the positioning of said label
62,673,980
I recently started using R to work on my research data (and have definitely not regretted leaving SPSS) and can't find a way to solve the following problem: I have created a function which groups my data by a binary variable (did the patient suffer a certain type of complication yes/no? -> reg\_var) and runs the summar...
2020/07/01
[ "https://Stackoverflow.com/questions/62673980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846231/" ]
You could always do this: ```py from tkinter import Tk, Canvas def func(event): c.create_text(0, 0, text="Pressed key {}".format(event.char)) #0, 0 are coordinates (0, 0 is top left) window = Tk() window.title("some tkinter window") window.geometry("640x480") c = Canvas(window, width=640, height=480) c.pack() ...
you need to set a label on your window. for example `someLabel = Label( window, text='set Text here' )` there are other commands for the positioning of said label
62,673,988
I have two tables `customers` which has many `orders`. I would like to list customers who ordered between dates but not order (after) between later dates. I would like to figure out which customers didn't not return. I can write write query where I can list customers which ordered between dates. ``` SELECT "cust...
2020/07/01
[ "https://Stackoverflow.com/questions/62673988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2924635/" ]
You could always do this: ```py from tkinter import Tk, Canvas def func(event): c.create_text(0, 0, text="Pressed key {}".format(event.char)) #0, 0 are coordinates (0, 0 is top left) window = Tk() window.title("some tkinter window") window.geometry("640x480") c = Canvas(window, width=640, height=480) c.pack() ...
you need to set a label on your window. for example `someLabel = Label( window, text='set Text here' )` there are other commands for the positioning of said label
62,673,997
I have say the following bool vector `v = [false ,true, false ,false ,true, false ,false ,true]` I want another vector which contains the indices of v for which the elements are true. I have the following code: ``` std::vector<int> nds; //contains the indices for (const auto &elem : v) { auto idx = &elem - &v[...
2020/07/01
[ "https://Stackoverflow.com/questions/62673997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/886357/" ]
> > is there a better way to find the indices? > > > Use a classical for loop ``` for (int i = 0; i != v.size(); ++i) { if (v[i]) nds.push_back(i); } ```
Using the [range-v3](https://ericniebler.github.io/range-v3/) library, you can use a functional programming style approach to chain the lazy [`views::enumerate`](https://ericniebler.github.io/range-v3/structranges_1_1views_1_1enumerate__fn.html) iterator with the lazy [`views::filter`](https://ericniebler.github.io/ran...
62,674,006
When I run: ``` sbt testOnly com.blablabla.A ``` I'm getting the following output: ``` [error] Failed: Total 19, Failed 6, Errors 0, Passed 13, Ignored 6 [error] Failed tests: [error] com.blablabla.A [error] com.blablabla.B [error] com.blablabla.C [error] (test:testOnly) sbt.TestsFailedExcep...
2020/07/01
[ "https://Stackoverflow.com/questions/62674006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1026271/" ]
The reason ``` sbt testOnly com.blablabla.A ``` does not work is because here sbt runs in [batch mode](https://www.scala-sbt.org/1.x/docs/Running.html#Batch+mode) which means it considers each *space-separated* value as a separate command and tries to execute them in sequence. For example, it considers `testOnly` as...
Try ``` sbt "testOnly com.blablabla.A" ```
62,674,027
I've tried for hours but cannot find a solution, my problem: Im trying to create a page login page where the login form is horizontal and vertical centered in the page. I'm working with syncfusion blazor and created the container full screen: HTML: ``` <div class="control-section" style="min-height: 100vh !important...
2020/07/01
[ "https://Stackoverflow.com/questions/62674027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13678760/" ]
The reason ``` sbt testOnly com.blablabla.A ``` does not work is because here sbt runs in [batch mode](https://www.scala-sbt.org/1.x/docs/Running.html#Batch+mode) which means it considers each *space-separated* value as a separate command and tries to execute them in sequence. For example, it considers `testOnly` as...
Try ``` sbt "testOnly com.blablabla.A" ```
62,674,037
I'd like to do something like the following (but with `str` actually determined dynamically): ``` let str = "I like to drive my car fast"; str = str.replace("car", "<Text style={styles.red}>red car</Text>"); return ( <Text>{str}</Text> ); ``` Is there anyway to insert JSX into other JSX using strings? edit: and ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7067693/" ]
no, it is not possible with React Native at the moment, yes many people suggested `dangerouslySetInnerHTML` but it won't work because it is not html under the hood. You can even look at props of the most common component [View](https://reactnative.dev/docs/view), it doesn't have anything closely similar to `dangerously...
Give it a try, please: ```js let str = "I like to drive my car fast"; const arr = str.split(' '); const reducer = (acc, cur, index) => { let previousVal = acc[acc.length - 1]; if ( previousVal && previousVal.startsWith('car') ) { acc[acc.length - 1] = previousVal + ' ' + cur; }...
62,674,037
I'd like to do something like the following (but with `str` actually determined dynamically): ``` let str = "I like to drive my car fast"; str = str.replace("car", "<Text style={styles.red}>red car</Text>"); return ( <Text>{str}</Text> ); ``` Is there anyway to insert JSX into other JSX using strings? edit: and ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7067693/" ]
If you want to change dynamically specify the field you want to change in a variable with can be changed later and split the text. Snack: <https://snack.expo.io/bdMxu7H_7> Check following example: ``` const text = 'I like to drive my car fast'; const replaceText = 'my car'; const replace = 'car'; export default fun...
Give it a try, please: ```js let str = "I like to drive my car fast"; const arr = str.split(' '); const reducer = (acc, cur, index) => { let previousVal = acc[acc.length - 1]; if ( previousVal && previousVal.startsWith('car') ) { acc[acc.length - 1] = previousVal + ' ' + cur; }...
62,674,037
I'd like to do something like the following (but with `str` actually determined dynamically): ``` let str = "I like to drive my car fast"; str = str.replace("car", "<Text style={styles.red}>red car</Text>"); return ( <Text>{str}</Text> ); ``` Is there anyway to insert JSX into other JSX using strings? edit: and ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7067693/" ]
no, it is not possible with React Native at the moment, yes many people suggested `dangerouslySetInnerHTML` but it won't work because it is not html under the hood. You can even look at props of the most common component [View](https://reactnative.dev/docs/view), it doesn't have anything closely similar to `dangerously...
Why not 2 text elements? ``` <Text>I like to drive my <Text style={{ color: 'red' }}>{carVar}</Text></Text> ```
62,674,037
I'd like to do something like the following (but with `str` actually determined dynamically): ``` let str = "I like to drive my car fast"; str = str.replace("car", "<Text style={styles.red}>red car</Text>"); return ( <Text>{str}</Text> ); ``` Is there anyway to insert JSX into other JSX using strings? edit: and ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7067693/" ]
If you want to change dynamically specify the field you want to change in a variable with can be changed later and split the text. Snack: <https://snack.expo.io/bdMxu7H_7> Check following example: ``` const text = 'I like to drive my car fast'; const replaceText = 'my car'; const replace = 'car'; export default fun...
Why not 2 text elements? ``` <Text>I like to drive my <Text style={{ color: 'red' }}>{carVar}</Text></Text> ```
62,674,037
I'd like to do something like the following (but with `str` actually determined dynamically): ``` let str = "I like to drive my car fast"; str = str.replace("car", "<Text style={styles.red}>red car</Text>"); return ( <Text>{str}</Text> ); ``` Is there anyway to insert JSX into other JSX using strings? edit: and ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7067693/" ]
no, it is not possible with React Native at the moment, yes many people suggested `dangerouslySetInnerHTML` but it won't work because it is not html under the hood. You can even look at props of the most common component [View](https://reactnative.dev/docs/view), it doesn't have anything closely similar to `dangerously...
The way I ended up doing this is perhaps not the most efficient way, but it does work. I split the string up into its component words with `str.split(" ")` Then iterated through the created array to check whether a word started with `#`, `@`, or a link. ``` function compose(post) { let str = ""; let blnFlag = ...
62,674,037
I'd like to do something like the following (but with `str` actually determined dynamically): ``` let str = "I like to drive my car fast"; str = str.replace("car", "<Text style={styles.red}>red car</Text>"); return ( <Text>{str}</Text> ); ``` Is there anyway to insert JSX into other JSX using strings? edit: and ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7067693/" ]
If you want to change dynamically specify the field you want to change in a variable with can be changed later and split the text. Snack: <https://snack.expo.io/bdMxu7H_7> Check following example: ``` const text = 'I like to drive my car fast'; const replaceText = 'my car'; const replace = 'car'; export default fun...
The way I ended up doing this is perhaps not the most efficient way, but it does work. I split the string up into its component words with `str.split(" ")` Then iterated through the created array to check whether a word started with `#`, `@`, or a link. ``` function compose(post) { let str = ""; let blnFlag = ...
62,674,065
is there any way to print out the fractional part of a double, My double number, ``` 4734.602654867 ``` I want only `6026` from it.
2020/07/01
[ "https://Stackoverflow.com/questions/62674065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846180/" ]
There is a `truncate()` function for double type which returns the integer part discarding the fractional part. We can subtract that from the original double to get the fraction. ``` double myDouble = 4734.602654867; double fraction = myDouble - myDouble.truncate(); print(fraction); /...
``` final double number = 4734.602654867; final String result = number.toStringAsFixed(5).split('.').last.substring(0,4); ```
62,674,065
is there any way to print out the fractional part of a double, My double number, ``` 4734.602654867 ``` I want only `6026` from it.
2020/07/01
[ "https://Stackoverflow.com/questions/62674065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846180/" ]
There is a `truncate()` function for double type which returns the integer part discarding the fractional part. We can subtract that from the original double to get the fraction. ``` double myDouble = 4734.602654867; double fraction = myDouble - myDouble.truncate(); print(fraction); /...
I got a simpler and straight forward answer, especially if you want to still use the fractional part as decimal, and not as a string ```dart double kunle = 300.0/7.0; // the decimal number int s = kunle.floor(); // takes out the integer part double fractionalPart = kunle-s; // takes out out the fractional par...
62,674,065
is there any way to print out the fractional part of a double, My double number, ``` 4734.602654867 ``` I want only `6026` from it.
2020/07/01
[ "https://Stackoverflow.com/questions/62674065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846180/" ]
Something like ```dart import 'dart:math' show pow; var number = 4734.602654867; var wantedDigits = 4; var fraction = (number % 1 * pow(10, wantedDigits)).floor(); print(fraction); ``` should work. [Dartpad example](https://dartpad.dev/7bf7aa276288a84c2685fc393524e613).
``` final double number = 4734.602654867; final String result = number.toStringAsFixed(5).split('.').last.substring(0,4); ```
62,674,065
is there any way to print out the fractional part of a double, My double number, ``` 4734.602654867 ``` I want only `6026` from it.
2020/07/01
[ "https://Stackoverflow.com/questions/62674065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846180/" ]
``` final double number = 4734.602654867; final String result = number.toStringAsFixed(5).split('.').last.substring(0,4); ```
``` void main() { double d = 4734.602654867; print(((d - d.floor()) * 10000).floor()); // --> prints 6026 } ``` [floor](https://www.tutorialspoint.com/dart_programming/dart_programming_floor_method.htm) method returns the decimal part of the number
62,674,065
is there any way to print out the fractional part of a double, My double number, ``` 4734.602654867 ``` I want only `6026` from it.
2020/07/01
[ "https://Stackoverflow.com/questions/62674065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846180/" ]
You can do that using `split()` Like this.. ```dart var s = 4734.602654867; var a = s.toString().split('.')[1]. substring(0,4); // here a = 6026 ``` Hope it solves your issue..
``` final double number = 4734.602654867; final String result = number.toStringAsFixed(5).split('.').last.substring(0,4); ```
62,674,065
is there any way to print out the fractional part of a double, My double number, ``` 4734.602654867 ``` I want only `6026` from it.
2020/07/01
[ "https://Stackoverflow.com/questions/62674065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846180/" ]
There is a `truncate()` function for double type which returns the integer part discarding the fractional part. We can subtract that from the original double to get the fraction. ``` double myDouble = 4734.602654867; double fraction = myDouble - myDouble.truncate(); print(fraction); /...
Something like ```dart import 'dart:math' show pow; var number = 4734.602654867; var wantedDigits = 4; var fraction = (number % 1 * pow(10, wantedDigits)).floor(); print(fraction); ``` should work. [Dartpad example](https://dartpad.dev/7bf7aa276288a84c2685fc393524e613).
62,674,065
is there any way to print out the fractional part of a double, My double number, ``` 4734.602654867 ``` I want only `6026` from it.
2020/07/01
[ "https://Stackoverflow.com/questions/62674065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846180/" ]
Something like ```dart import 'dart:math' show pow; var number = 4734.602654867; var wantedDigits = 4; var fraction = (number % 1 * pow(10, wantedDigits)).floor(); print(fraction); ``` should work. [Dartpad example](https://dartpad.dev/7bf7aa276288a84c2685fc393524e613).
``` void main() { double d = 4734.602654867; print(((d - d.floor()) * 10000).floor()); // --> prints 6026 } ``` [floor](https://www.tutorialspoint.com/dart_programming/dart_programming_floor_method.htm) method returns the decimal part of the number
62,674,065
is there any way to print out the fractional part of a double, My double number, ``` 4734.602654867 ``` I want only `6026` from it.
2020/07/01
[ "https://Stackoverflow.com/questions/62674065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846180/" ]
``` final double number = 4734.602654867; final String result = number.toStringAsFixed(5).split('.').last.substring(0,4); ```
I got a simpler and straight forward answer, especially if you want to still use the fractional part as decimal, and not as a string ```dart double kunle = 300.0/7.0; // the decimal number int s = kunle.floor(); // takes out the integer part double fractionalPart = kunle-s; // takes out out the fractional par...
62,674,065
is there any way to print out the fractional part of a double, My double number, ``` 4734.602654867 ``` I want only `6026` from it.
2020/07/01
[ "https://Stackoverflow.com/questions/62674065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846180/" ]
There is a `truncate()` function for double type which returns the integer part discarding the fractional part. We can subtract that from the original double to get the fraction. ``` double myDouble = 4734.602654867; double fraction = myDouble - myDouble.truncate(); print(fraction); /...
``` void main() { double d = 4734.602654867; print(((d - d.floor()) * 10000).floor()); // --> prints 6026 } ``` [floor](https://www.tutorialspoint.com/dart_programming/dart_programming_floor_method.htm) method returns the decimal part of the number
62,674,065
is there any way to print out the fractional part of a double, My double number, ``` 4734.602654867 ``` I want only `6026` from it.
2020/07/01
[ "https://Stackoverflow.com/questions/62674065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13846180/" ]
You can do that using `split()` Like this.. ```dart var s = 4734.602654867; var a = s.toString().split('.')[1]. substring(0,4); // here a = 6026 ``` Hope it solves your issue..
I got a simpler and straight forward answer, especially if you want to still use the fractional part as decimal, and not as a string ```dart double kunle = 300.0/7.0; // the decimal number int s = kunle.floor(); // takes out the integer part double fractionalPart = kunle-s; // takes out out the fractional par...
62,674,082
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Sign Up</title> <link rel="stylesheet" href="./css/style.css" /> </head> <body> <div class="sign-up-form"> <style> body { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13787540/" ]
Something like ```dart import 'dart:math' show pow; var number = 4734.602654867; var wantedDigits = 4; var fraction = (number % 1 * pow(10, wantedDigits)).floor(); print(fraction); ``` should work. [Dartpad example](https://dartpad.dev/7bf7aa276288a84c2685fc393524e613).
I got a simpler and straight forward answer, especially if you want to still use the fractional part as decimal, and not as a string ```dart double kunle = 300.0/7.0; // the decimal number int s = kunle.floor(); // takes out the integer part double fractionalPart = kunle-s; // takes out out the fractional par...
62,674,082
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Sign Up</title> <link rel="stylesheet" href="./css/style.css" /> </head> <body> <div class="sign-up-form"> <style> body { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13787540/" ]
There is a `truncate()` function for double type which returns the integer part discarding the fractional part. We can subtract that from the original double to get the fraction. ``` double myDouble = 4734.602654867; double fraction = myDouble - myDouble.truncate(); print(fraction); /...
Something like ```dart import 'dart:math' show pow; var number = 4734.602654867; var wantedDigits = 4; var fraction = (number % 1 * pow(10, wantedDigits)).floor(); print(fraction); ``` should work. [Dartpad example](https://dartpad.dev/7bf7aa276288a84c2685fc393524e613).
62,674,082
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Sign Up</title> <link rel="stylesheet" href="./css/style.css" /> </head> <body> <div class="sign-up-form"> <style> body { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13787540/" ]
You can do that using `split()` Like this.. ```dart var s = 4734.602654867; var a = s.toString().split('.')[1]. substring(0,4); // here a = 6026 ``` Hope it solves your issue..
I got a simpler and straight forward answer, especially if you want to still use the fractional part as decimal, and not as a string ```dart double kunle = 300.0/7.0; // the decimal number int s = kunle.floor(); // takes out the integer part double fractionalPart = kunle-s; // takes out out the fractional par...
62,674,082
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Sign Up</title> <link rel="stylesheet" href="./css/style.css" /> </head> <body> <div class="sign-up-form"> <style> body { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13787540/" ]
There is a `truncate()` function for double type which returns the integer part discarding the fractional part. We can subtract that from the original double to get the fraction. ``` double myDouble = 4734.602654867; double fraction = myDouble - myDouble.truncate(); print(fraction); /...
You can do that using `split()` Like this.. ```dart var s = 4734.602654867; var a = s.toString().split('.')[1]. substring(0,4); // here a = 6026 ``` Hope it solves your issue..
62,674,082
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Sign Up</title> <link rel="stylesheet" href="./css/style.css" /> </head> <body> <div class="sign-up-form"> <style> body { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13787540/" ]
Something like ```dart import 'dart:math' show pow; var number = 4734.602654867; var wantedDigits = 4; var fraction = (number % 1 * pow(10, wantedDigits)).floor(); print(fraction); ``` should work. [Dartpad example](https://dartpad.dev/7bf7aa276288a84c2685fc393524e613).
``` void main() { double d = 4734.602654867; print(((d - d.floor()) * 10000).floor()); // --> prints 6026 } ``` [floor](https://www.tutorialspoint.com/dart_programming/dart_programming_floor_method.htm) method returns the decimal part of the number
62,674,082
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Sign Up</title> <link rel="stylesheet" href="./css/style.css" /> </head> <body> <div class="sign-up-form"> <style> body { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13787540/" ]
``` final double number = 4734.602654867; final String result = number.toStringAsFixed(5).split('.').last.substring(0,4); ```
``` void main() { double d = 4734.602654867; print(((d - d.floor()) * 10000).floor()); // --> prints 6026 } ``` [floor](https://www.tutorialspoint.com/dart_programming/dart_programming_floor_method.htm) method returns the decimal part of the number
62,674,082
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Sign Up</title> <link rel="stylesheet" href="./css/style.css" /> </head> <body> <div class="sign-up-form"> <style> body { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13787540/" ]
``` final double number = 4734.602654867; final String result = number.toStringAsFixed(5).split('.').last.substring(0,4); ```
I got a simpler and straight forward answer, especially if you want to still use the fractional part as decimal, and not as a string ```dart double kunle = 300.0/7.0; // the decimal number int s = kunle.floor(); // takes out the integer part double fractionalPart = kunle-s; // takes out out the fractional par...
62,674,082
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Sign Up</title> <link rel="stylesheet" href="./css/style.css" /> </head> <body> <div class="sign-up-form"> <style> body { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13787540/" ]
You can do that using `split()` Like this.. ```dart var s = 4734.602654867; var a = s.toString().split('.')[1]. substring(0,4); // here a = 6026 ``` Hope it solves your issue..
``` final double number = 4734.602654867; final String result = number.toStringAsFixed(5).split('.').last.substring(0,4); ```
62,674,082
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Sign Up</title> <link rel="stylesheet" href="./css/style.css" /> </head> <body> <div class="sign-up-form"> <style> body { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13787540/" ]
There is a `truncate()` function for double type which returns the integer part discarding the fractional part. We can subtract that from the original double to get the fraction. ``` double myDouble = 4734.602654867; double fraction = myDouble - myDouble.truncate(); print(fraction); /...
``` void main() { double d = 4734.602654867; print(((d - d.floor()) * 10000).floor()); // --> prints 6026 } ``` [floor](https://www.tutorialspoint.com/dart_programming/dart_programming_floor_method.htm) method returns the decimal part of the number
62,674,082
```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Sign Up</title> <link rel="stylesheet" href="./css/style.css" /> </head> <body> <div class="sign-up-form"> <style> body { ...
2020/07/01
[ "https://Stackoverflow.com/questions/62674082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13787540/" ]
There is a `truncate()` function for double type which returns the integer part discarding the fractional part. We can subtract that from the original double to get the fraction. ``` double myDouble = 4734.602654867; double fraction = myDouble - myDouble.truncate(); print(fraction); /...
I got a simpler and straight forward answer, especially if you want to still use the fractional part as decimal, and not as a string ```dart double kunle = 300.0/7.0; // the decimal number int s = kunle.floor(); // takes out the integer part double fractionalPart = kunle-s; // takes out out the fractional par...
62,674,091
This is my first attempt on using Docker. I followed the instructions [here](https://docs.docker.com/engine/install/ubuntu/) to install Docker on an Ubuntu instance. When I reached the `apt-cache madison docker-ce` step, it showed many versions, a series of version 5.19.xx and another series of version 18.06.xx. Parti...
2020/07/01
[ "https://Stackoverflow.com/questions/62674091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936293/" ]
There is a `truncate()` function for double type which returns the integer part discarding the fractional part. We can subtract that from the original double to get the fraction. ``` double myDouble = 4734.602654867; double fraction = myDouble - myDouble.truncate(); print(fraction); /...
Something like ```dart import 'dart:math' show pow; var number = 4734.602654867; var wantedDigits = 4; var fraction = (number % 1 * pow(10, wantedDigits)).floor(); print(fraction); ``` should work. [Dartpad example](https://dartpad.dev/7bf7aa276288a84c2685fc393524e613).
62,674,091
This is my first attempt on using Docker. I followed the instructions [here](https://docs.docker.com/engine/install/ubuntu/) to install Docker on an Ubuntu instance. When I reached the `apt-cache madison docker-ce` step, it showed many versions, a series of version 5.19.xx and another series of version 18.06.xx. Parti...
2020/07/01
[ "https://Stackoverflow.com/questions/62674091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936293/" ]
There is a `truncate()` function for double type which returns the integer part discarding the fractional part. We can subtract that from the original double to get the fraction. ``` double myDouble = 4734.602654867; double fraction = myDouble - myDouble.truncate(); print(fraction); /...
``` void main() { double d = 4734.602654867; print(((d - d.floor()) * 10000).floor()); // --> prints 6026 } ``` [floor](https://www.tutorialspoint.com/dart_programming/dart_programming_floor_method.htm) method returns the decimal part of the number
62,674,091
This is my first attempt on using Docker. I followed the instructions [here](https://docs.docker.com/engine/install/ubuntu/) to install Docker on an Ubuntu instance. When I reached the `apt-cache madison docker-ce` step, it showed many versions, a series of version 5.19.xx and another series of version 18.06.xx. Parti...
2020/07/01
[ "https://Stackoverflow.com/questions/62674091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936293/" ]
Something like ```dart import 'dart:math' show pow; var number = 4734.602654867; var wantedDigits = 4; var fraction = (number % 1 * pow(10, wantedDigits)).floor(); print(fraction); ``` should work. [Dartpad example](https://dartpad.dev/7bf7aa276288a84c2685fc393524e613).
``` void main() { double d = 4734.602654867; print(((d - d.floor()) * 10000).floor()); // --> prints 6026 } ``` [floor](https://www.tutorialspoint.com/dart_programming/dart_programming_floor_method.htm) method returns the decimal part of the number