question_id int64 37.6M 73.2M | input_text stringlengths 88 52.4k | output_text stringlengths 37 35.6k | title stringlengths 15 150 | tags stringlengths 1 107 | q_score int64 -19 397 | view_count int64 3 879k | answer_count int64 1 21 | accepted_answer_id int64 37.6M 73.8M | answer_id int64 37.6M 73.8M | a_score int64 -5 1.29k | is_accepted bool 1
class | creation_date stringlengths 20 24 | input_text_instruct stringlengths 251 52.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73,025,481 | Why does this code NOT get all my Jenkins views?<p>Jenkins v2.263.3 (old I know)</p>
<p>I've Googled here and other Jenkins groups and see this code to get all the views</p>
<pre><code>import jenkins.model.*
def jenkins = jenkins.getInstance() // or simply jenkins.instance
def views = jenkins.getViews() // or simply j... | <p>The code you provided should work for new and old Jenkins versions including version <strong>v2.263.3</strong>.<br />
You can also use the following shortened syntax (tested in the Script Console):</p>
<pre class="lang-groovy prettyprint-override"><code>Jenkins.instance.views.each {
println(it.displayName)
}
</co... | Why does this code NOT get all my Jenkins views? | jenkins-pipeline | 0 | 51 | 1 | 73,078,244 | 73,078,244 | 1 | true | 2022-07-18T16:14:56.980Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does this code NOT get all my Jenkins views?<p>Jenkins v2.263.3 (old I know)</p>
<p>I've Googled here and other Jenkins groups and see this code to get a... |
72,799,320 | How to test the first characters of a file in php?<p>I have a PHP code that allows me to read a csv file, insert the data into the database and move this file to another folder once the processing is finished.</p>
<p>This code works by default with UTF8 BOM files, I added the line <code>fseek($handle, 3);</code> to pas... | <p>Leave the file as is and remove the BOM characters from the $data array. So you can process both files with BOM and without BOM. Roughly:</p>
<pre><code>$firstRow = true;
while (($data = fgetcsv($handle, 9000000, ";")) !== false) {
if($firstRow) {
$data[0] = str_replace("\xef\xbb\xbf","... | How to test the first characters of a file in php? | php|csv|utf-8 | 0 | 51 | 1 | 72,799,724 | 72,799,724 | 1 | true | 2022-06-29T09:50:34.643Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to test the first characters of a file in php?<p>I have a PHP code that allows me to read a csv file, insert the data into the database and move this fil... |
72,936,870 | How does Spring Boot + Keycloack (or another auth server) work in terms of clients?<p>I've a simple question regarding the object.
I made a @Controller to manage some REST APIs which read and write to a db which looks like this:</p>
<pre><code>@RestController
@RequestMapping("/api")
public class PersonControl... | <p>You need to get more knowledge of OpenID and spring-security specs.</p>
<p>Given your conf, each request to /api/read or /api/write on your <strong>resource-server</strong> will have to be authorized: contain an authorization header with an access-token.</p>
<p>In your <strong>resource-server</strong> security conf... | How does Spring Boot + Keycloack (or another auth server) work in terms of clients? | spring|keycloak | 1 | 51 | 1 | 72,940,321 | 72,940,321 | 1 | true | 2022-07-11T10:10:14.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How does Spring Boot + Keycloack (or another auth server) work in terms of clients?<p>I've a simple question regarding the object.
I made a @Controller to ma... |
72,839,982 | How to make such an animation of page transition? [Mobile]<p>Please check this page transition animation
<a href="https://i.stack.imgur.com/UAsyR.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UAsyR.gif" alt="enter image description here" /></a></p>
<p>I think that it is pretty standard and I see it... | <p>What you're looking for is called a modal bottom sheet.
you can use <a href="https://pub.dev/packages/modal_bottom_sheet" rel="nofollow noreferrer">modal_bottom_sheet package</a> to generate modal bottom sheets using these functions:</p>
<p>Material Design Style:</p>
<pre><code>showMaterialModalBottomSheet(
contex... | How to make such an animation of page transition? [Mobile] | android|ios|flutter|mobile|mobile-application | 0 | 51 | 1 | 72,840,421 | 72,840,421 | 1 | true | 2022-07-02T14:47:32.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make such an animation of page transition? [Mobile]<p>Please check this page transition animation
<a href="https://i.stack.imgur.com/UAsyR.gif" rel="n... |
72,919,077 | Separate ApolloProvider component render with ReactDOM giving error<p>I have the following <code>ApolloProvider</code> setup inside <code>index.js</code> in my React application. It's working fine connecting to the Apollo server.</p>
<pre><code>import { React } from 'react';
import * as ReactDOM from 'react-dom/client'... | <p>You seem to be using the syntax used to render the app for React <code>v17</code> while you have installed React <code>v18</code>. You have two choices to make that warning go away:</p>
<ol>
<li>Change <code>index.js</code> so that you use the setup for React <code>v18</code>:</li>
</ol>
<blockquote>
<pre class="lan... | Separate ApolloProvider component render with ReactDOM giving error | javascript|reactjs|graphql|apollo-client | 3 | 51 | 2 | 72,919,828 | 72,919,828 | 1 | true | 2022-07-09T05:03:49.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Separate ApolloProvider component render with ReactDOM giving error<p>I have the following <code>ApolloProvider</code> setup inside <code>index.js</code> in ... |
72,926,280 | Accessing CSV row value by another value<p>Considering the following CSV data, how can I access the <code>For Sale Amount</code> value of a specific row by its <code>ID</code>?</p>
<pre><code>Title,Price,For Sale Amount,Link,ID,Date Added
"First Sample Item",$358.35,2,https://www.website.com/release/FOO,FOO,J... | <p>If you're really inclined to do it using the csv module, here you go.</p>
<pre><code>import csv
with open('random_csv.csv', 'r') as fr:
csvreader = csv.DictReader(fr)
for_sale_by_ID = {col['ID'] : col['For Sale Amount'] for col in csvreader}
print(for_sale_by_ID)
# To access specific For Sale Amounts:... | Accessing CSV row value by another value | python|csv | 0 | 51 | 2 | 72,926,514 | 72,926,514 | 1 | true | 2022-07-10T05:11:47.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Accessing CSV row value by another value<p>Considering the following CSV data, how can I access the <code>For Sale Amount</code> value of a specific row by i... |
72,963,549 | R - Moving misplaced values in correct column<p>Beginner here, I have a large dataframe with multiple columns in which some values are misplaced but at least have the right column name in front of the value. Imagine a dataframe like this:</p>
<pre><code>Country <- c("Spain", "Time:16 Mar 2018 - 23 Apr... | <p>Ok, I do not know if you are familiarized with tidyverse and dplyr functions, so I used classic functions in my solution (taking into account the last update with the complete format). It is important to notice that some values started with "Bonuses:", but you did not define this column, so it was not cons... | R - Moving misplaced values in correct column | r|dataframe | 0 | 51 | 2 | 72,964,486 | 72,964,486 | 1 | true | 2022-07-13T08:59:02.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R - Moving misplaced values in correct column<p>Beginner here, I have a large dataframe with multiple columns in which some values are misplaced but at least... |
72,949,598 | classify text using 'from text' and 'to text' in the dataframe in R<p>Here is my toy data (Note that in my original data, I have 100s of rule sets i.e. such from to combinations):</p>
<pre><code>rule_set <- tibble::tribble(
~if_you_see, ~write,
"honda civic", "car",
"toyota ca... | <pre class="lang-r prettyprint-override"><code>library(tidyverse)
patterns_df <- rule_set %>%
group_by(write) %>%
summarise(
patterns = paste(if_you_see, collapse = "|")
)
to_be_classified %>%
rowwise() %>%
mutate(
class = list(str_detect(text, patterns_df$patterns) %&... | classify text using 'from text' and 'to text' in the dataframe in R | r|dplyr|stringr | 1 | 51 | 3 | 72,949,807 | 72,949,807 | 1 | true | 2022-07-12T08:58:42.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
classify text using 'from text' and 'to text' in the dataframe in R<p>Here is my toy data (Note that in my original data, I have 100s of rule sets i.e. such ... |
72,854,566 | Splitting multiple columns using mutate - dplyr<p>I'm trying to split multiple columns, but struggling to do this efficiently.</p>
<p>I have a df:</p>
<pre><code>> dput(df)
structure(list(UNIQUE_PATIENT_ID = c("DIS-1101-1001-E1", "DIS-1101-1002-E1",
"DIS-1101-1003-E1", "DIS-1101-1... | <p>The last <code>select</code> line is optional depending on how you want the columns ordered and whether or not you wish to keep the NULL columns:</p>
<pre><code>df |>
separate_rows(-UNIQUE_PATIENT_ID, sep = ";") |>
pivot_longer(-UNIQUE_PATIENT_ID) |>
separate(value, into = c("timepoi... | Splitting multiple columns using mutate - dplyr | r|dplyr|tidyverse | 1 | 51 | 2 | 72,855,033 | 72,855,033 | 1 | true | 2022-07-04T09:31:13.423Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Splitting multiple columns using mutate - dplyr<p>I'm trying to split multiple columns, but struggling to do this efficiently.</p>
<p>I have a df:</p>
<pre><... |
73,022,396 | Match an expression as a list<p>I have a string that I am trying to create a regular expression to match the assignment name "People" and its list of people</p>
<p><code>People = "Alice", "Bob", "Charlie", "David", "Erica", "Fred";</code></p>
<p><str... | <p>You could make the pattern even more specific, but in this case you might use the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.capturecollection?view=net-6.0" rel="nofollow noreferrer">CapturesCollection</a> in C# by using a repeated capture group:</p>
<pre><code>\b(?<name&g... | Match an expression as a list | regex | -1 | 51 | 1 | 73,027,133 | 73,027,133 | 1 | true | 2022-07-18T12:35:51.330Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Match an expression as a list<p>I have a string that I am trying to create a regular expression to match the assignment name "People" and its list ... |
72,975,279 | how to implement 3 nested subquery with 3 model in laravel?<p>I have 3 model <code>Transaction</code> , <code>Cart</code> , <code>Acceptedcart</code>.</p>
<p>in <code>Cart</code> model I have <code>transaction_id</code> and in <code>Acceptedcart</code> model have <code>cart_id</code>.</p>
<p>how can I find <code>transa... | <p>in Transaction.php your relationship to carts:</p>
<pre><code>public function carts()
{
return $this->hasMany(Cart::class);
}
</code></pre>
<p>in Cart.php you relationship to accepted carts:</p>
<pre><code>public function accepted_carts()
{
return $this->hasMany(Acceptedcart::class);
}
</code></pre>
<p... | how to implement 3 nested subquery with 3 model in laravel? | laravel|eloquent|subquery | 1 | 51 | 1 | 72,975,388 | 72,975,388 | 1 | true | 2022-07-14T04:41:12.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to implement 3 nested subquery with 3 model in laravel?<p>I have 3 model <code>Transaction</code> , <code>Cart</code> , <code>Acceptedcart</code>.</p>
<p... |
72,789,976 | MySQL Get distinct counts from different tables?<p>I have several tables, given below:</p>
<p>Company:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;">company_code</th>
<th style="text-align: left;">ceo</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"... | <p>You can aggregate first, and then join with the main table. For example:</p>
<pre><code>select
c.*, l.c, s.c, m.c, e.c
from company c
left join (select company_code, count(*) as c from lead group by company_code) l on l.company_code = c.company_code
left join (select company_code, count(*) as c from senior group b... | MySQL Get distinct counts from different tables? | mysql|sql|join | -1 | 51 | 2 | 72,790,111 | 72,790,111 | 1 | true | 2022-06-28T16:17:12.423Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MySQL Get distinct counts from different tables?<p>I have several tables, given below:</p>
<p>Company:</p>
<div class="s-table-container">
<table class="s-ta... |
72,843,137 | How to create a new column in a DataFrame and move select data from the first column to the new column<p>My dataframe is 860x1 and I want create a new column that shifts data from first column to the second.</p>
<p>example:</p>
<pre><code> Lyrics
0. name
1. lyric
2. name
3. lyric
4. name
5. lyric... | <p>Use slice indexing to grab every second row with either 0 or 1 as the offset from the start:</p>
<pre><code>df = pd.DataFrame()
df['Lyrics'] = lyrics.iloc[1::2].reset_index(drop=True)
df['Title'] = lyrics.iloc[0::2].reset_index(drop=True)
</code></pre> | How to create a new column in a DataFrame and move select data from the first column to the new column | python|pandas | 0 | 51 | 3 | 72,843,175 | 72,843,175 | 1 | true | 2022-07-02T23:51:38.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a new column in a DataFrame and move select data from the first column to the new column<p>My dataframe is 860x1 and I want create a new column... |
72,817,846 | HTML / CSS : Display flex on logo not working<p>hope you all are doing well.</p>
<p>I am new to web development and I am coding along with <a href="https://www.youtube.com/watch?v=bFvfqUMjvsA&ab_channel=CodingLab" rel="nofollow noreferrer">https://www.youtube.com/watch?v=bFvfqUMjvsA&ab_channel=CodingLab</a> and... | <p>first of all, to make the code work you need that</p>
<p><strong>1.</strong> the image <strong>2.</strong> span (text)</p>
<p>to be inside the same parent element <br>
so in his case, it would be <code>.image-text</code> but in your case is the <code><header></code></p>
<blockquote>
<p>you may think: <em>"... | HTML / CSS : Display flex on logo not working | html|css|flexbox | 0 | 51 | 4 | 72,817,901 | 72,817,901 | 1 | true | 2022-06-30T14:49:05.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HTML / CSS : Display flex on logo not working<p>hope you all are doing well.</p>
<p>I am new to web development and I am coding along with <a href="https://w... |
72,965,402 | How to extend styles in react component?<p>I have a task when I need to extend the styles of a certain element. I take the basic styles through the module, and the additional ones will need to be done inside the function that will be in the component.<br />
How can I extend the styles inside the component if I have alr... | <pre><code><p style={optionalStyles} className={`${style.subtitle}`}>42</p>
</code></pre> | How to extend styles in react component? | css|reactjs | -1 | 51 | 2 | 72,965,500 | 72,965,500 | 1 | true | 2022-07-13T11:19:50.090Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to extend styles in react component?<p>I have a task when I need to extend the styles of a certain element. I take the basic styles through the module, a... |
72,830,696 | landscapemetrics: extents do not overlap error<p>I am using the <code>landscapemetrics</code> package to calculate landscape metrics (e.g., total area, total edge length, etc.) from an input raster. I am using the <code>sample_lsm</code> function to perform these calculations within circular buffers centered on GPS poi... | <p>It looks like your points have the longitude/latitude coordinate reference system (crs), but your raster has a different crs: <code>+proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs</code>. You need to transform the point data to the coordinate reference system of th... | landscapemetrics: extents do not overlap error | r|raster|landscape|extent | 0 | 51 | 1 | 72,833,507 | 72,833,507 | 1 | true | 2022-07-01T14:22:05.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
landscapemetrics: extents do not overlap error<p>I am using the <code>landscapemetrics</code> package to calculate landscape metrics (e.g., total area, total... |
72,848,920 | Stop reading .txt file on empty/blank line<p>I have done a code (below) to read the numbers from a .txt file. The first two numbers are to be put on a <code>int</code> variable, the numbers from the second line onwards are to be put on an array of strings. But I have a problem, if there is a blank/empty line at the end... | <p>You use <code>fscanf()</code> to read the contents of the file, <code>fscanf()</code> ignores white space and newlines. You should use the same calls to count the number of items and to actually read them after rewinding the stream pointer. Note that you call to <code>rewind(file)</code> after you close the file has... | Stop reading .txt file on empty/blank line | arrays|c | 1 | 51 | 1 | 72,849,058 | 72,849,058 | 1 | true | 2022-07-03T18:21:28.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Stop reading .txt file on empty/blank line<p>I have done a code (below) to read the numbers from a .txt file. The first two numbers are to be put on a <code>... |
72,991,787 | What is the fastest way to encode a bytebuffer image in jpg format?<p>I use <a href="https://developer.android.com/training/camerax" rel="nofollow noreferrer">CameraX</a> to capture an image from the camera using <a href="https://developer.android.com/training/camerax/analyze" rel="nofollow noreferrer">ImageAnalysis</a... | <p>A somewhat efficient way to do that is first converting your <code>YUV_420_888</code> image to <code>NV21</code>, then use Android's <code>YuvImage#compressToJpeg</code> API to convert it.</p>
<p>For the <code>YUV_420_888</code> -> <code>NV21</code> conversion, you can see the code sample <a href="https://github.... | What is the fastest way to encode a bytebuffer image in jpg format? | java|android|kotlin|android-mediacodec|android-camerax | 0 | 51 | 1 | 72,995,306 | 72,995,306 | 1 | true | 2022-07-15T09:21:23.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the fastest way to encode a bytebuffer image in jpg format?<p>I use <a href="https://developer.android.com/training/camerax" rel="nofollow noreferrer... |
72,872,700 | How to migrate name column to first and last name in PostgreSQL<p>I want to write an SQL migration to split a "name" column to a "first_name" and a "last_name" column in a "users" table, I have already created the 2 columns.</p>
<p>I am looking for a command that looks like</p>
<... | <pre><code>UPDATE users SET first_name = (regexp_split_to_array(name, E'\s+'))[1], last_name = (regexp_split_to_array(name, E'\s+'))[2]
</code></pre>
<p>for names where 2 and more last names</p>
<pre><code>update users set firstname = (regexp_split_to_array(name, E'\\s+'))[1],
lastname = array_to_string((regex... | How to migrate name column to first and last name in PostgreSQL | sql|regex|postgresql|database-migration | 1 | 51 | 2 | 72,872,991 | 72,872,991 | 1 | true | 2022-07-05T16:24:11.463Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to migrate name column to first and last name in PostgreSQL<p>I want to write an SQL migration to split a "name" column to a "first_name&q... |
72,899,780 | VLC trigger action when media reaches timestamp<p>I'd like to the ability to run some code when the timestamp of a file has been reached (i.e. trigger an alert)</p>
<p>How can this be achieved?</p>
<p>I was looking at this <a href="https://www.geeksforgeeks.org/python-vl" rel="nofollow noreferrer">https://www.geeksforg... | <p>You want the <code>EventManager</code> class, the documentation for which can be found
<a href="https://www.olivieraubert.net/vlc/python-ctypes/doc/index.html" rel="nofollow noreferrer">here</a>. Here's an example of how to use it to notify you when a video stops playing.</p>
<pre><code>import vlc
def callback(even... | VLC trigger action when media reaches timestamp | python|vlc|libvlc|python-vlc | 1 | 51 | 1 | 73,004,813 | 73,004,813 | 1 | true | 2022-07-07T14:39:25.540Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VLC trigger action when media reaches timestamp<p>I'd like to the ability to run some code when the timestamp of a file has been reached (i.e. trigger an ale... |
73,029,652 | calculate frequency of unique values per group in R<p>How can I count the number of unique values such that I go from:</p>
<pre><code>organisation <- c("A","A","A","A","B","B","B","B","C","C","C","C&quo... | <p>Try this</p>
<pre><code>s <- aggregate(. ~ organisation , data = df , \(x) names(table(x)))
s$variable <- sapply(s$variable , \(x) paste0(x , collapse = ","))
setNames(aggregate(. ~ variable , data = s , length) , c("unique_values" , "frequency"))
</code></pre>
<ul>
<li>output</l... | calculate frequency of unique values per group in R | r|count|logic|unique | 1 | 51 | 2 | 73,029,743 | 73,029,743 | 1 | true | 2022-07-18T23:37:28.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
calculate frequency of unique values per group in R<p>How can I count the number of unique values such that I go from:</p>
<pre><code>organisation <- c(&q... |
72,950,927 | Create a new column based on a conditional subtraction in python<p>I'm trying to create a new column based on a conditional subtraction in python. I want to first group the dataframe by column A, then take the row value of C where B equals 2, and subtract that value from all values in column C.</p>
<pre><code>import pa... | <p>It's easiest to temporarily set the index to <code>a</code>. Then you can do the subtraction as usual while pandas will automatically align the index. Finally reset the index.</p>
<pre><code>df1 = df.set_index('a')
df1['d'] = df1.c - df1.loc[df1.b.eq(2), 'c']
df1.reset_index()
</code></pre>
<p>Result:</p>
<pre><code... | Create a new column based on a conditional subtraction in python | python|pandas|lambda|transform|subtraction | 1 | 51 | 1 | 72,951,058 | 72,951,058 | 1 | true | 2022-07-12T10:34:57.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create a new column based on a conditional subtraction in python<p>I'm trying to create a new column based on a conditional subtraction in python. I want to ... |
72,797,816 | Is there any Ways to get the average of every 3 rows in SQL?<p><img src="https://i.stack.imgur.com/Kh3mm.png" alt="enter image description here" /></p>
<p>Need to take a average of every 3 rows in sql, kindly
see the image for further clarification.</p>
<p>Thanks in advance!</p> | <p>You can use the <code>ROW_NUMBER</code> and <code>AVG</code> analytic functions:</p>
<pre class="lang-sql prettyprint-override"><code>SELECT product_id,
price,
AVG(price) OVER (PARTITION BY CEIL(rn/3)) AS avg_price
FROM (
SELECT t.*,
ROW_NUMBER() OVER (ORDER BY product_id) AS rn
FROM t... | Is there any Ways to get the average of every 3 rows in SQL? | sql | -3 | 51 | 2 | 72,798,196 | 72,798,196 | 1 | true | 2022-06-29T08:02:05.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there any Ways to get the average of every 3 rows in SQL?<p><img src="https://i.stack.imgur.com/Kh3mm.png" alt="enter image description here" /></p>
<p>Ne... |
72,997,913 | Save the input from the user make even after reload/refresh<p>I wanted to to add a function that every time the user refresh, reload or even close the page, the user to able to see the data (added books) whatever the user had entered previously or choose in the .</p>
<p>Also when the user make an update and refresh the... | <p>I don't usually write code for others for free, but your app was really exciting and the design was so . The idea is you need to use something permanent to store the data on, such as a database in the cloud, or simply for your simple app, you can use the browser built-in APIs for the <a href="https://developer.mozil... | Save the input from the user make even after reload/refresh | javascript|html | 0 | 51 | 1 | 73,000,203 | 73,000,203 | 1 | true | 2022-07-15T17:47:50.590Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Save the input from the user make even after reload/refresh<p>I wanted to to add a function that every time the user refresh, reload or even close the page, ... |
72,773,173 | Placeholder info not showing in Bootstrap 5.2<p>I have a page I am building using Bootstrap 5.2 which includes the following code snippet:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-o... | <p>With a bit of custom CSS this is easy enough, I've included a <code><span></code> in the <code><label></code> which will then disappear when you have filled in a value</p>
<p>If you want the placeholder to disappear on focus then refer to the CSS code -- you can uncomment the last part</p>
<p><div class=... | Placeholder info not showing in Bootstrap 5.2 | css|bootstrap-5 | 0 | 51 | 1 | 72,773,679 | 72,773,679 | 1 | true | 2022-06-27T13:46:44.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Placeholder info not showing in Bootstrap 5.2<p>I have a page I am building using Bootstrap 5.2 which includes the following code snippet:</p>
<p><div class=... |
72,898,349 | Can I make a div tag clickable with an a tag inside?<p>I have an <code>a</code> tag and want to put it inside div and the whole div will be clickable, but when I try to do this, only text is clickable, not div.<br />
Can I make it?</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-ba... | <p>There are 2 different ways I can think to do this.</p>
<p>First one is much easier using <code>display: block</code> on the anchor</p>
<p>Second one is a bit odd using <code>::before</code> to essentially "stretch" the link to fill a parent. The parent must have <code>position: relative</code> for this to ... | Can I make a div tag clickable with an a tag inside? | html|css | -1 | 51 | 2 | 72,898,698 | 72,898,698 | 1 | true | 2022-07-07T13:05:14.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I make a div tag clickable with an a tag inside?<p>I have an <code>a</code> tag and want to put it inside div and the whole div will be clickable, but wh... |
72,934,568 | Getting ID instead of Name in list<p>I am doing CRUD project with foreign keys and I am using serializers.I want to get the Name of the categories,sub categories,color and size instead of thier IDs
serializer:</p>
<pre><code>class POLLSerializer(serializers.ModelSerializer):
class Meta:
model = Products
... | <p>You need to specify in the serializer that you want the foreign keys to be displayed as strings:</p>
<pre class="lang-py prettyprint-override"><code>from rest_framework import serializers
class POLLSerializer(serializers.ModelSerializer):
categories = serializers.StringRelatedField(many=False)
sub_categorie... | Getting ID instead of Name in list | python|django | 1 | 51 | 1 | 72,937,663 | 72,937,663 | 1 | true | 2022-07-11T06:36:36.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting ID instead of Name in list<p>I am doing CRUD project with foreign keys and I am using serializers.I want to get the Name of the categories,sub catego... |
72,827,711 | Collect conditional items while streaming in kotlin<p>In Kotlin code, I have a list of objects and while processing it via <code>filter</code> and <code>map</code> I want to collect items of particular interest. And discard others.</p>
<p>For example, I am using <code>foreach</code> loop as below. Is it possible to mak... | <p>You can use <code>.mapNotNull</code></p>
<pre class="lang-kotlin prettyprint-override"><code>val exceptionResults = listOf<String>("Name1", "Name2", "Name3")
.filter {
it.length > 2
}
.mapNotNull { name ->
try {
if (name == "Name2") {
th... | Collect conditional items while streaming in kotlin | java|kotlin|collections|java-stream | 2 | 51 | 2 | 72,828,493 | 72,828,493 | 1 | true | 2022-07-01T10:12:13.077Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Collect conditional items while streaming in kotlin<p>In Kotlin code, I have a list of objects and while processing it via <code>filter</code> and <code>map<... |
73,017,939 | Return all objects inside nested loop in react<p>I want return all objects inside nested loop</p>
<pre><code>const data = [{ id:1, products:[{id:1, name:'apple'}, {id:2, name:'orange'}] },
{id:2, products:[{id:3, name:'grapes'}, {id:4, name:'banana'}, {id:5, name:'dragonFruit'}]
}]
let result = data.map(item=>{
... | <p>It is possible to use <code>flatMap</code> with <code>map</code>.</p>
<pre><code>let result = data.flatMap(({products})=>
products.map(prd=> ({...prd })))
</code></pre>
<p>Let me show an example:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div clas... | Return all objects inside nested loop in react | javascript|reactjs | 2 | 51 | 4 | 73,018,007 | 73,018,007 | 1 | true | 2022-07-18T06:09:26.907Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return all objects inside nested loop in react<p>I want return all objects inside nested loop</p>
<pre><code>const data = [{ id:1, products:[{id:1, name:'app... |
72,965,007 | Create destination folder on FTP server, if it does not exist yet, using WinSCP in PowerShell<p>I have this script and I want to transfer archive witch script created previous to the server. But on the server I want to check and create if the target folder with name of the machine (<code>$inputID</code>) exists or not.... | <p>Use <a href="https://winscp.net/eng/docs/library_session_fileexists" rel="nofollow noreferrer"><code>Session.FileExists</code> method</a> and <a href="https://winscp.net/eng/docs/library_session_createdirectory" rel="nofollow noreferrer"><code>Session.CreateDirectory</code> method</a>:</p>
<pre><code>$remotePath = &... | Create destination folder on FTP server, if it does not exist yet, using WinSCP in PowerShell | powershell|ftp|winscp|winscp-net | 1 | 51 | 1 | 72,965,276 | 72,965,276 | 1 | true | 2022-07-13T10:46:54.507Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create destination folder on FTP server, if it does not exist yet, using WinSCP in PowerShell<p>I have this script and I want to transfer archive witch scrip... |
72,972,452 | Interesting problem with VBA error 91, protection and intersetcion<p>Please, could anyone help with error 91, I can't find a solution. Firstly the related code part:</p>
<pre><code>.......
Application.EnableEvents = False
PrUpr.UJournal 'Protection code for sheet is located in PrUpr module.
Intersect(targetRow, rgRec... | <p>There's quite a bit to unpack here:</p>
<pre><code>Intersect(targetRow, rgRecName) = foundName
</code></pre>
<p>Intersect will return a <code>Range</code> object representing the cells that intersect between the two provided ranges; if no cell intersects, that's when you get <code>Nothing</code>.</p>
<p>Now that's o... | Interesting problem with VBA error 91, protection and intersetcion | excel|vba|runtime-error|set-intersection | 0 | 51 | 2 | 72,973,752 | 72,973,752 | 1 | true | 2022-07-13T20:45:43.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Interesting problem with VBA error 91, protection and intersetcion<p>Please, could anyone help with error 91, I can't find a solution. Firstly the related co... |
72,795,467 | Why use index signature `{[key: string]: any}` instead of `object` type?<p>I'm learning TypeScript and come across this use of index signatures in function parameters often. For eg,</p>
<pre><code>export function template(resources: {[key: string]: any})
</code></pre>
<p>Since the value type is <code>any</code>, why is... | <p>There are many ways to express 'objects', but consider the following examples. There is <code>Object</code>, <code>object</code>, <code>{}</code>, <code>{ [k: T]: U }</code> and <code>Record<K, T></code>. This is just because almost everything in JS (and by extension TS) is an object.*</p>
<p>I'll put the answ... | Why use index signature `{[key: string]: any}` instead of `object` type? | typescript | 0 | 51 | 2 | 72,796,027 | 72,796,027 | 1 | true | 2022-06-29T03:24:20.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why use index signature `{[key: string]: any}` instead of `object` type?<p>I'm learning TypeScript and come across this use of index signatures in function p... |
73,028,166 | how to include all values of an attribute<p>Working with an XML currently</p>
<pre><code><Company>
<Employee>
<FirstName Initial="A" Totaldigits="six" Lastletter="T"/>
<FirstName Initial="A" Totaldigits="six" Lastletter="Y"/>
... | <p>This expression loops on all the elements named <strong>Employee</strong> then iterates <em>its</em> child elements named <strong>FirstName</strong> and applies an expression that:</p>
<ol>
<li>Ensures element <em>has</em> an <code>Attribute</code> named <strong>Lastletter</strong></li>
<li>If so, dereferences its <... | how to include all values of an attribute | c#|xml | -1 | 51 | 1 | 73,029,394 | 73,029,394 | 1 | true | 2022-07-18T20:20:08.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to include all values of an attribute<p>Working with an XML currently</p>
<pre><code><Company>
<Employee>
<FirstName Initial="A... |
72,976,787 | How to `awk` print a space-separated field which contains space characters?<p>I am trying to print the list of all files and folders including hidden files:</p>
<pre><code>ls -al | awk -F' ' '{print $9}' | xargs do_something
</code></pre>
<p>However, some of the files and/or folders contain space characters. How could ... | <pre><code>$ find . -mindepth 1 -maxdepth 1 -printf "%p\n"|xargs -i sh -c 'echo found: "{}"'
found: ./file2
found: ./folder 2
found: ./folder
found: ./file 1
found: ./ file 3
$ ls |awk '{print}'|xargs -i sh -c 'echo found "{}"'
found: file2
found: folder 2
found: folder
found: file 1
$ l... | How to `awk` print a space-separated field which contains space characters? | bash|ubuntu|awk|whitespace | -1 | 51 | 1 | 72,976,989 | 72,976,989 | 1 | true | 2022-07-14T07:30:30.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to `awk` print a space-separated field which contains space characters?<p>I am trying to print the list of all files and folders including hidden files:<... |
72,885,552 | Pandas - Group / Aggregate rows based on duplication AND the existence of an opposite<p>I have a Dataframe that sometimes contains 2 rows for what is, in reality, one entry. The way to identify these is:</p>
<ol>
<li>Columns: Not, Strike, Cents, SD, ED are identical</li>
<li>Column ExecutionTimestamp is going to be wit... | <p>IIUC, you can use a custom group and a <code>merge_asof</code> on (+) with back insertion of the lone (-) values:</p>
<pre><code>cols = ['A', 'B', 'C', 'D', 'E']
df['ExecutionTimestamp'] = pd.to_datetime(df['ExecutionTimestamp'])
# identify + rows
m = df['F'].eq('(+)')
# merge
out = (pd
.merge_asof(df[m].reset_... | Pandas - Group / Aggregate rows based on duplication AND the existence of an opposite | python|pandas | 1 | 51 | 2 | 72,885,908 | 72,885,908 | 1 | true | 2022-07-06T14:43:30.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas - Group / Aggregate rows based on duplication AND the existence of an opposite<p>I have a Dataframe that sometimes contains 2 rows for what is, in rea... |
72,973,340 | What are the proper arguments for the generation of a SAS token to connect to Azure eventhub?<p>While reading this <a href="https://stackoverflow.com/questions/39451705/http-post-between-postman-and-eventhub">HTTP POST between Postman and EventHub</a>, I was directed to this:
<a href="https://docs.microsoft.com/en-us/r... | <blockquote>
<p>But I don't know what <code>resourceUri</code>, <code>keyName</code>, and key to use. Do I use the full url for the <code>eventHub</code>?</p>
</blockquote>
<p>You can get these three parameters from the azure portal as shown in the below screenshot:</p>
<p>--> Goto your EventHub Namespace -->shar... | What are the proper arguments for the generation of a SAS token to connect to Azure eventhub? | java|azure|sas-token | 0 | 51 | 1 | 72,976,510 | 72,976,510 | 1 | true | 2022-07-13T22:33:05.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What are the proper arguments for the generation of a SAS token to connect to Azure eventhub?<p>While reading this <a href="https://stackoverflow.com/questio... |
73,009,611 | How to drop specific pandas rows by value<p>Is there any way that I can drop the value if its index = column index.</p>
<p>I mean, this is my toy dataframe</p>
<pre class="lang-py prettyprint-override"><code>d = {'Non': [1, 2,4,5,2,7], 'Schzerando': [3, 4,8,4,7,7], 'cc': [1,2,0.75,0.25,0.3,1]}
df = pd.DataFrame(data=d)... | <p>You can filter out the rows by converting the <code>cc</code> column to int type then filter by applying mask.</p>
<pre><code>df['cc'] = df['cc'].astype('Int64')
df = df[df['cc'] == 1 | df['cc'] == 2 | df['cc'] == 3]
</code></pre>
<p>or you can declare a list with all the values you want to filter for then use panda... | How to drop specific pandas rows by value | python|pandas | 0 | 51 | 2 | 73,009,647 | 73,009,647 | 1 | true | 2022-07-17T06:17:18.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to drop specific pandas rows by value<p>Is there any way that I can drop the value if its index = column index.</p>
<p>I mean, this is my toy dataframe</... |
72,859,999 | How to do simple arithmetic calculator in django template?<p>I want to show two sets of number from model in the django template for the same. I am using for loop to get each row data of the table to show in template as below :</p>
<p>{% for a in vis %}</p>
<p>{a.numone}
{a.numtwo}</p>
<p>{% endfor %}</p>
<p>its workin... | <h3>Generic way</h3>
<p>The template is not designed for any calculation or modification of data. It is used just for showing the data in the prefered way.</p>
<p>As all template need a view in django, just place the calculation in the view instead.</p>
<p><code>views.py</code></p>
<pre class="lang-py prettyprint-overr... | How to do simple arithmetic calculator in django template? | django|django-templates | 0 | 51 | 1 | 72,860,811 | 72,860,811 | 1 | true | 2022-07-04T16:59:51.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to do simple arithmetic calculator in django template?<p>I want to show two sets of number from model in the django template for the same. I am using for... |
72,986,054 | Parsing JSON using a conditional<p>I'm trying to pull information from an API but only use what I need. In this case, I need to pull the "id" and "location id" if the "site id" equals a pre-defined variable.</p>
<pre><code>response = {
"results": [
{
"id": 9... | <p>Remember that you can iterate through the dictionary:</p>
<pre class="lang-py prettyprint-override"><code>for result in payload["results"]:
if result["site"]["id"] == 2:
result_id = (result["id"])
location_id = result["location"]["id"]
... | Parsing JSON using a conditional | python|json | 0 | 51 | 2 | 72,986,095 | 72,986,095 | 1 | true | 2022-07-14T20:00:34.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parsing JSON using a conditional<p>I'm trying to pull information from an API but only use what I need. In this case, I need to pull the "id" and &... |
72,880,270 | Type Hinting for variable with inherited classes as value<p>I have doubts about the pythonic way to do something like this:</p>
<pre><code>from my_package import A, B
class Main:
def __init__(self) -> None:
""" Constructor """
self._var1: Union[A, B]
def se... | <p>Change it like this:</p>
<pre class="lang-py prettyprint-override"><code>from my_package import A, B
class Main:
_var1: Union[A, B]
def __init__(self) -> None:
""" Constructor """
pass
def set_values(self, value: str) -> None:
""&qu... | Type Hinting for variable with inherited classes as value | python|pycharm|type-hinting|mypy | 1 | 51 | 2 | 72,880,398 | 72,880,398 | 1 | true | 2022-07-06T08:33:43.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Type Hinting for variable with inherited classes as value<p>I have doubts about the pythonic way to do something like this:</p>
<pre><code>from my_package im... |
73,029,775 | how to show file size in MB in the 'wget' module?<p>I want to customize 'bar_adaptive' function from 'wget' module in python to show file size in MB instead of Byte, I mean output should be something like this:</p>
<pre><code>45.0% [......................... ] 41.63 / 92.1 MB
</code></pre... | <p>I used my own function as ‘bar’ argument in ‘download’ function that uses 'bar_adaptive' function under the hood:</p>
<pre><code># custom bar function:
# '/1024/1024' to convert Byte to MB
# 'round' is a python built-in function that rounds numbers. first argument is
# number itself and second argument is The nu... | how to show file size in MB in the 'wget' module? | python|download | 0 | 51 | 1 | 73,029,787 | 73,029,787 | 1 | true | 2022-07-19T00:04:08.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to show file size in MB in the 'wget' module?<p>I want to customize 'bar_adaptive' function from 'wget' module in python to show file size in MB instead ... |
72,959,718 | Why do I get an error saying 'statement with no effect [-Werror=unused-value]'<p>I am confused why I get an error on these 5 lines. I'd assume it would be just a warning but my compiler is taking all warnings as errors.</p>
<pre><code> 161 | kernelBuffer->BaseAddress;
| ~~~~~~~~~~~~^~~~~~~~~~~~~
src_u... | <p>You are not performing an operation in those lines. Instead of a field of a struct pointer such as <code>kernelBuffer->BaseAddress;</code>, imagine you had a primitive value, like <code>int x;</code>. Hopefully you can see why a line like <code>x;</code> does nothing. There's no assignment or any other operation:... | Why do I get an error saying 'statement with no effect [-Werror=unused-value]' | c | -1 | 51 | 1 | 72,959,747 | 72,959,747 | 1 | true | 2022-07-13T00:38:41.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why do I get an error saying 'statement with no effect [-Werror=unused-value]'<p>I am confused why I get an error on these 5 lines. I'd assume it would be ju... |
72,397,839 | Why do activations need more bits (16bit) than weights (8bit) in tensor flow's neural network quantization framework?<p>I'm working with mobilenets and trying to understand the intuition for why activations have 16 bits and why weights have 8 bits. Empirically, I see it, but intuitively what's the reason for the huge d... | <p>Activations are actual signals propagating through the network. They have nothing to do with activation function, this is just a name collision. They are higher accuracy because <strong>they are not part of the model</strong>, so they do not affect storage, download size, or memory usage, as if you are not training ... | Why do activations need more bits (16bit) than weights (8bit) in tensor flow's neural network quantization framework? | tensorflow|optimization|deep-learning|neural-network | 0 | 51 | 1 | 72,397,979 | 72,397,979 | 1 | true | 2022-05-26T20:44:47.413Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why do activations need more bits (16bit) than weights (8bit) in tensor flow's neural network quantization framework?<p>I'm working with mobilenets and tryin... |
72,399,150 | Numbers Between 2 Columns of Integers<p>I have the following code:</p>
<pre><code>NumDf = {'Num1' : [5,7,5,5,5,5,8,5,5,5,5,5,9,5,5,5,5,6,5,5,6], 'Num2' : [10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10]}
NumDf = pd.DataFrame(NumDf)
NumDf
NumDf['Num1'] <= int(input('Input your number')) <= NumDf['... | <p>You can read your test value into a variable, and then create a new column as the <code>and</code> of the two conditions:</p>
<pre><code>test = int(input('Input your number'))
NumDf['test'] = (NumDf['Num1'] <= test) & (NumDf['Num2'] >= test)
</code></pre>
<p>For example, if the input was 6 the result would... | Numbers Between 2 Columns of Integers | python|pandas | 0 | 51 | 2 | 72,399,193 | 72,399,193 | 1 | true | 2022-05-26T23:51:28.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Numbers Between 2 Columns of Integers<p>I have the following code:</p>
<pre><code>NumDf = {'Num1' : [5,7,5,5,5,5,8,5,5,5,5,5,9,5,5,5,5,6,5,5,6], 'Num2' : [10... |
72,399,476 | Creating nested dictionary from two lists one of which contains dictionaries<p>Very similar to <a href="https://stackoverflow.com/questions/54928099/how-to-create-nested-dictionary-from-two-lists">this question</a> but with an added caveat.</p>
<p>I have two lists identical in length. One contains my keys, and the othe... | <p>For the less readable dictionary comprehension solution</p>
<pre><code>keys = ['key1', 'key2', 'key3']
vals = [
[{'subkey1': 'val1', 'subkey2': 'val2'}],
[{'subkey1': 'val2'}, None],
[{'subkey1': 'val3'}, {'subkey3':'val1'}, None, None]
]
s = {
k: {
sk: sv for d in (x for x in v if x is not None) ... | Creating nested dictionary from two lists one of which contains dictionaries | python|dictionary | 0 | 51 | 3 | 72,399,581 | 72,399,581 | 1 | true | 2022-05-27T01:08:02.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating nested dictionary from two lists one of which contains dictionaries<p>Very similar to <a href="https://stackoverflow.com/questions/54928099/how-to-c... |
72,387,489 | Google Ads Get Campaign ads spends based on date and all states of USA<p>I have many campaigns and I want to summarize the spends by all the states (USA states) and based on from and to dates.</p>
<p>I went through the <a href="https://developers.google.com/google-ads/api/docs/reporting/overview" rel="nofollow noreferr... | <p>Reporting in the Ads API works by defining a query in <a href="https://developers.google.com/google-ads/api/docs/query/overview" rel="nofollow noreferrer">GAQL</a> that describes the data you want to obtain. For your use case, a possible query would look something like this:</p>
<pre><code>SELECT
campaign.name,
... | Google Ads Get Campaign ads spends based on date and all states of USA | google-ads-api | 0 | 51 | 1 | 72,407,948 | 72,407,948 | 1 | true | 2022-05-26T06:14:52.347Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Ads Get Campaign ads spends based on date and all states of USA<p>I have many campaigns and I want to summarize the spends by all the states (USA stat... |
72,371,607 | How to index/slice 3D numpy array<p>I'm relatively new to python/numpy. I have a 3D numpy array of TxNxN. It contains a sequence of symmetrical NxN matrices. I want convert it to a 2D array of TxM (where M = N(N+1)/2). How can I do that? I can certainly use 3 loops, but I thought there probably better ways to do t... | <p>It seems that you want to get the upper triangle or lower triangle of each symmetric matrix. A simple method is to generate a mask array and apply it to each 2D array:</p>
<pre><code>>>> e
array([[[0, 1, 2, 3],
[1, 2, 3, 0],
[2, 3, 0, 1],
[3, 0, 1, 2]],
[[1, 2, 3, 4],
... | How to index/slice 3D numpy array | python|arrays|numpy|indexing | 0 | 51 | 1 | 72,371,770 | 72,371,770 | 1 | true | 2022-05-25T03:15:43.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to index/slice 3D numpy array<p>I'm relatively new to python/numpy. I have a 3D numpy array of TxNxN. It contains a sequence of symmetrical NxN matrice... |
72,239,570 | How to construct a class from a pack in C++?<p>I am trying to initialize a class with a pack passed as an argument to my function. Here is what I got so far:</p>
<pre class="lang-cpp prettyprint-override"><code>struct Vec3
{
float x, y, z;
};
template<typename _Ty, typename... Args>
__forceinline _Ty constru... | <p>You could replace <code>return _Ty(arguments...)</code> with <code>return _Ty{arguments...}</code> as shown below:</p>
<pre><code>//---------------v--------------------- v----->removed the underscore
template<typename Ty, typename... Args> Ty construct_class(Args&&... arguments)
{
//-----------v---... | How to construct a class from a pack in C++? | c++|class|constructor|variadic-templates|perfect-forwarding | 0 | 51 | 1 | 72,239,597 | 72,239,597 | 1 | true | 2022-05-14T11:00:15.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to construct a class from a pack in C++?<p>I am trying to initialize a class with a pack passed as an argument to my function. Here is what I got so far:... |
72,387,117 | Dynamic top 3 and percentage total using pandas groupby<p>I have a dataframe like as shown below</p>
<pre><code>id,Name,country,amount,qty
1,ABC,USA,123,4500
1,ABC,USA,156,3210
1,BCE,USA,687,2137
1,DEF,UK,456,1236
1,ABC,nan,216,324
1,DEF,nan,12678,11241
1,nan,nan,637,213
1,BCE,nan,213,543
1,XYZ,KOREA,432,321
1,XYZ,AUS,... | <p>Simpliest is use loop by columnsnames in list, for <code>pct_amount</code> use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.DataFrameGroupBy.transform.html" rel="nofollow noreferrer"><code>GroupBy.transform</code></a> with <code>sum</code> per <code>id</code> and divide <co... | Dynamic top 3 and percentage total using pandas groupby | python|pandas|dataframe|numpy|pandas-groupby | 1 | 51 | 1 | 72,387,204 | 72,387,204 | 1 | true | 2022-05-26T05:29:42.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dynamic top 3 and percentage total using pandas groupby<p>I have a dataframe like as shown below</p>
<pre><code>id,Name,country,amount,qty
1,ABC,USA,123,4500... |
72,282,961 | Need to find and replace one occurrence of a string in a PowerShell script<p>I need to find and replace one occurrence of a string in a PowerShell script (script is about 250 lines long). There are two occurrences where the string "start-sleep -s 10" appears within the script. I need to edit and only change t... | <p>For this you can read the file <em>line-by-line</em> and once you encounter the first match of what you're looking for, set a variable that can be used in case of future matches of the same word.</p>
<p>I would personally recommend you to use a <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.po... | Need to find and replace one occurrence of a string in a PowerShell script | powershell | 3 | 51 | 1 | 72,283,114 | 72,283,114 | 1 | true | 2022-05-18T03:42:09.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need to find and replace one occurrence of a string in a PowerShell script<p>I need to find and replace one occurrence of a string in a PowerShell script (sc... |
72,353,195 | CbPro python library giving invalid response<p>When i attempt to use the CBPro api it gives bad responses</p>
<pre><code>import cbpro
</code></pre>
<p>Output</p>
<pre><code>Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python310\lib\site-packages\cbpro\__... | <p>for me creating a separate instance of python on my desktop with all the right pip imports and files worked. I just copied the imports from my library folder and i put python 3.5.2 into a separate file folder and that worked completely perfect <a href="https://www.python.org/downloads/release/python-352/" rel="nofol... | CbPro python library giving invalid response | python|cryptography|coinbase-api | 0 | 51 | 1 | 72,353,349 | 72,353,349 | 1 | true | 2022-05-23T18:21:39.413Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CbPro python library giving invalid response<p>When i attempt to use the CBPro api it gives bad responses</p>
<pre><code>import cbpro
</code></pre>
<p>Output... |
72,248,449 | Edge / corner color issues with SVG line / path<p>This:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><svg width=100 height=100>
<g transform="translate(0.5, 0... | <p>On Win64 Chrome, I'm only seeing the antialiasing on the first two elements.</p>
<p>The explanation for the line element is simple. Because you are translating down by half a pixel, the two line ends are ending halfway up/down a pixel. Hence you will get antialiasing in that case. Adjust the coords, or add <code>... | Edge / corner color issues with SVG line / path | svg | 0 | 51 | 1 | 72,263,810 | 72,263,810 | 1 | true | 2022-05-15T12:53:55.063Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Edge / corner color issues with SVG line / path<p>This:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
... |
72,239,206 | C# access to stack object property<p>How can I access the objects property in this situation?</p>
<pre><code>Araba araba = new Araba();
araba.Renk = "mavi";
araba.fiyat = 12345;
// I created this class and it working normally
ArrayTypedStack asd = new ArrayTypedStack(10);
asd.Push(araba);
object araba2 = a... | <p>Here you are assigning the value of <code>asd.Pop()</code> to a variable of the type <code>object</code>.</p>
<p><code>object</code> is the root of all objects (all objects inherit from it and can be casted to it) and as such has no real information about what it is. It's just like any object in real life is a <cod... | C# access to stack object property | c#|class|object|properties|stack | 0 | 51 | 2 | 72,239,268 | 72,239,268 | 1 | true | 2022-05-14T10:09:35.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# access to stack object property<p>How can I access the objects property in this situation?</p>
<pre><code>Araba araba = new Araba();
araba.Renk = "ma... |
72,387,318 | How can I create a walkthrough guidance in Unity?<p>I am creating a new game in <a href="https://en.wikipedia.org/wiki/Unity_(game_engine)" rel="nofollow noreferrer">Unity</a>. And I like to create walkthrough guidance for my game that will show after the first signup, like, click here to grab the coins. After collecti... | <p>You have to have a plan for each step. Here is a very accurate and simple method that uses <code>IEnumerator</code>.</p>
<pre class="lang-cs prettyprint-override"><code>public void Start() => StartCoroutine(Guidence());
</code></pre>
<hr>
<h2> Example Guidance: </h2>
<p>Now you have to adjust the body of the Guid... | How can I create a walkthrough guidance in Unity? | unity3d|walkthrough | 0 | 51 | 1 | 72,389,246 | 72,389,246 | 1 | true | 2022-05-26T05:56:39.983Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I create a walkthrough guidance in Unity?<p>I am creating a new game in <a href="https://en.wikipedia.org/wiki/Unity_(game_engine)" rel="nofollow nor... |
72,376,644 | how cache react prop to ref?<p>My component hava a onChange prop,<br />
I don't want onChange fire useEffect,<br />
so I want cache onChange to a ref,<br />
below is my code,i don't know the code is right or not.</p>
<pre class="lang-js prettyprint-override"><code>const Component = ({onChange})=>{
const onChange... | <blockquote>
<p>I don't want onChange fire useEffect</p>
</blockquote>
<p>You can't do that in <em>quite</em> the way you've shown because by the time your function component is called, it's <em>already</em> in the process of rendering. It has to be memo-ized to prevent that using a "<a href="https://reactjs.org/d... | how cache react prop to ref? | javascript|reactjs | 1 | 51 | 1 | 72,377,154 | 72,377,154 | 1 | true | 2022-05-25T11:18:10.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how cache react prop to ref?<p>My component hava a onChange prop,<br />
I don't want onChange fire useEffect,<br />
so I want cache onChange to a ref,<br />
... |
72,260,266 | How to change state during saga test<p>I have created polling saga which calls backend API until the response from the API is marked as done or until saga encounters an error.</p>
<pre><code>export function* pollingSaga() {
while (true) {
try {
yield call(/*call to BE API*/);
const response = yield se... | <p>You can send a value to the generator by calling <code>gen.next(value)</code> to change the <code>response</code> value. See <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator/next" rel="nofollow noreferrer">Generator.prototype.next()</a>.</p>
<blockquote>
<p>The <cod... | How to change state during saga test | reactjs|testing|jestjs|redux-saga | 0 | 51 | 1 | 72,401,434 | 72,401,434 | 1 | true | 2022-05-16T13:47:01.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change state during saga test<p>I have created polling saga which calls backend API until the response from the API is marked as done or until saga en... |
72,272,823 | Flutter- adjust the custom button tap area<pre class="lang-dart prettyprint-override"><code> Widget customButton() {
return Container(
child: InkWell(
onTap: () {},
child: Container(
height: 100,
width: 100,
decoration: BoxDecoration(
color: Colors.... | <p>Using <code>customBorder: CircleBorder()</code>, on InkWell fixed the splash effect, but to work it properly I am extending the snippet.</p>
<pre class="lang-dart prettyprint-override"><code> Widget customButton() {
return Container(
decoration: const BoxDecoration(
shape: BoxShape.circle,
... | Flutter- adjust the custom button tap area | flutter|flutter-layout | 1 | 51 | 1 | 72,273,058 | 72,273,058 | 1 | true | 2022-05-17T10:57:58.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter- adjust the custom button tap area<pre class="lang-dart prettyprint-override"><code> Widget customButton() {
return Container(
child: In... |
72,296,896 | Why is my dictionary data being overwritten?<p>not sure what is going on here. My data items I store in the first dictionary entry get overwritten when I go to update data to the second entry. The dictionary's first entry is acting like it is using a reference to the original object so when i change it all instances in... | <p>You are overwriting your values beginning with the line <code>dataItems.minData = "4";</code> Just because you've stored the value in <code>Entry1</code> it doesn't "lock it away" as I suspect you think.</p>
<p><em>You original comment:</em></p>
<blockquote>
<p>The dictionary's first entry is act... | Why is my dictionary data being overwritten? | c#|dictionary | 0 | 51 | 1 | 72,296,954 | 72,296,954 | 1 | true | 2022-05-18T23:07:12.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is my dictionary data being overwritten?<p>not sure what is going on here. My data items I store in the first dictionary entry get overwritten when I go ... |
72,257,275 | C# Adding Whitespace around a specific character for spacing in file names<p>I'm building a program which processes documents based on their file path and file name.<br />
My current solution is based on file names containing 3 strings each separated by a space, dash and another space so that a valid name would be: &qu... | <p>You don't need regex, in case pure string methods are more readable for you:</p>
<pre><code>string FixFileName(string fn)
{
string fnwe = System.IO.Path.GetFileNameWithoutExtension(fn);
return string.Join(" - ", fnwe.Split('-').Select(token => token.Trim()))
+ System.IO.Path.GetExtension... | C# Adding Whitespace around a specific character for spacing in file names | c#|regex|string | 0 | 51 | 1 | 72,257,432 | 72,257,432 | 1 | true | 2022-05-16T09:51:03.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# Adding Whitespace around a specific character for spacing in file names<p>I'm building a program which processes documents based on their file path and fi... |
72,273,386 | Python Django Rest - Return extra field with lowest, highest and average values of some other field<p>I'm new to Django and APIs in general and I want to create a Django based API using Django Rest Framework.</p>
<p>Here's what I want to do:</p>
<p>Endpoint to age range report:</p>
<pre><code>curl -H 'Content-Type: app... | <h1>Idea</h1>
<p>No extra fields are needed to store the calculated values since they are calculated based on the rows in the database.</p>
<ol>
<li>First you find <code>min_salary</code>, <code>max_salary</code>, and <code>avg_salary</code> by using the aggregate method.</li>
<li>Use found <code>min_salary</code> and ... | Python Django Rest - Return extra field with lowest, highest and average values of some other field | python|django|rest | 0 | 51 | 1 | 72,277,466 | 72,277,466 | 1 | true | 2022-05-17T11:38:47.160Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python Django Rest - Return extra field with lowest, highest and average values of some other field<p>I'm new to Django and APIs in general and I want to cre... |
72,362,151 | Push into array inside reduced new Map()<p>I am trying to push to an array on a <code>new Map()</code> reduce from an array of objects, but for some reason it pushes only two items per array.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
... | <p>Here is a compact implementation that will produce your output</p>
<pre><code>data.reduce(
(a, o) => a.set(o.keyword, [...a.get(o.keyword) || [], o.url]),
new Map()
)
</code></pre> | Push into array inside reduced new Map() | javascript|arrays | 0 | 51 | 4 | 72,363,396 | 72,363,396 | 1 | true | 2022-05-24T11:33:23.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Push into array inside reduced new Map()<p>I am trying to push to an array on a <code>new Map()</code> reduce from an array of objects, but for some reason i... |
72,383,633 | IF + AND Statements<p>I have a 'Current Result' in the form of a data frame in Python (depicting in Excel as an illustration).</p>
<p>I'd like to add a column that classifies whether a row is a 'PRIME' or an 'ALT' designation.</p>
<p>The rules for whether something is a 'ALT' is both of the following:</p>
<ul>
<li>'Gro... | <p>Its kind of hard to re-create without digestible data, but I believe this will get you what you need IIUC</p>
<pre><code>data = {
'Group' : [np.nan, None, np.nan, '7f', '7f', '7f', None, None, None, '4j', '4j', None, None, '4j'],
'Utilization':[0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 100, 0, 0, 99]
}
df = pd.DataFra... | IF + AND Statements | python|arrays|pandas|if-statement|scripting | 0 | 51 | 1 | 72,383,729 | 72,383,729 | 1 | true | 2022-05-25T20:10:53.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
IF + AND Statements<p>I have a 'Current Result' in the form of a data frame in Python (depicting in Excel as an illustration).</p>
<p>I'd like to add a colum... |
72,397,986 | How can I create functionality that allows the user to filter multiple times in JavaScript?<p>I have been working on a website that displays projects completed by students for their Senior Project. I wanted to be able to sort by project category to make it easier for the user. I added that functionality in and everythi... | <p>I would use an object <code>var filters = { "category": "", "year": "" };</code> as a state variable to store the current filter options. Since you do similar logic in both of your filter functions, I would combine them into a single function that accepts an additional paramet... | How can I create functionality that allows the user to filter multiple times in JavaScript? | javascript|html|filtering | 0 | 51 | 2 | 72,398,246 | 72,398,246 | 1 | true | 2022-05-26T21:03:56.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I create functionality that allows the user to filter multiple times in JavaScript?<p>I have been working on a website that displays projects complet... |
72,266,563 | I'm trying to understand the syntax of this cartesian-product function in Clojure<p>Here's some code for a cartesian product, it can be two lists, two vectors, or any number of combinations of the two. I'd really appreciate help with the second, fourth, and final lines, explaining what each line is doing</p>
<pre class... | <p>Here is a reworked version that illustrates what is going on (and how):</p>
<pre><code>(ns tst.demo.core
(:use demo.core tupelo.core tupelo.test))
;----------------------------------------------------------------------------
; Lesson: how map & mapcat work
(defn dup [x]
"Return 2 of the arg in a vector... | I'm trying to understand the syntax of this cartesian-product function in Clojure | syntax|clojure | 0 | 51 | 1 | 72,266,844 | 72,266,844 | 1 | true | 2022-05-16T23:15:45.997Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I'm trying to understand the syntax of this cartesian-product function in Clojure<p>Here's some code for a cartesian product, it can be two lists, two vector... |
72,291,245 | 4 input & Dynamically change transform<p>I'm trying to make a transform generator.</p>
<p>Users will constantly update this, but without success. Because when I use jquery element.css('transform', .... it changes it to singleton. But, I can't change other elements.</p>
<p>HTML</p>
<pre><code><p>ROTATE X</p>... | <p>This is what you want?</p>
<p>you cant add multiple transform in an element so you have to create all the transformation in one string.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-overr... | 4 input & Dynamically change transform | javascript|html|jquery|css|input | 1 | 51 | 1 | 72,292,656 | 72,292,656 | 1 | true | 2022-05-18T14:39:09.943Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
4 input & Dynamically change transform<p>I'm trying to make a transform generator.</p>
<p>Users will constantly update this, but without success. Because whe... |
72,277,660 | My React Simple counter doesn't work as expected<p>I starting to learn React and I was wondering why my Counter it's not working :(
My objective is: When you press the button, Counter function start to "count" and render "count" state in the td. I don't know what I'm doing wrong.</p>
<pre><code>imp... | <p>Firstly, you need to put your setInterval in a useEffect hook because you are currently creating a new interval every time your state updates (i.e every second), which will drastically slow down your app. Secondly, you should use the useEffect cleanup function to remove the interval each time your component re-rende... | My React Simple counter doesn't work as expected | javascript|reactjs | 1 | 51 | 2 | 72,278,084 | 72,278,084 | 1 | true | 2022-05-17T16:30:42.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My React Simple counter doesn't work as expected<p>I starting to learn React and I was wondering why my Counter it's not working :(
My objective is: When you... |
72,241,130 | Sklearn error: None of [Int64Index([2, 3], dtype='int64')] are in the [columns]<p>Could someone explain why this code:</p>
<pre><code>from sklearn.model_selection import train_test_split
import pandas as pd
from sklearn.model_selection import StratifiedKFold
from sklearn.svm import SVC
import numpy as np
#df = pd.read... | <p><code>KFold.split()</code> returns the train and test indices, which should be used with a DataFrame like this:</p>
<pre><code>X_train.iloc[train_index]
</code></pre>
<p>With your syntax, you are trying to use them as column names. Change your code to:</p>
<pre><code>from sklearn.model_selection import train_test_sp... | Sklearn error: None of [Int64Index([2, 3], dtype='int64')] are in the [columns] | python|scikit-learn | 1 | 51 | 1 | 72,241,388 | 72,241,388 | 1 | true | 2022-05-14T14:29:35.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sklearn error: None of [Int64Index([2, 3], dtype='int64')] are in the [columns]<p>Could someone explain why this code:</p>
<pre><code>from sklearn.model_sele... |
72,379,854 | As per TreeSet two objects are shown equal but Queue shows them as unequal<p>I have the follwing Person Class -</p>
<p><code>Person.java</code> -</p>
<pre><code>public class Person implements Comparable<Person> {
private int id;
private String name;
Person(int id, String name) {
this.id = id;... | <p>You need to override <code>@equals</code> method in the class <code>Person</code>. See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#:%7E:text=equals%20and%20Set.,to%20any%20list%20or%20set." rel="nofollow noreferrer">documentation</a>.</p>
<p>Additionally I see that <code>Person</code... | As per TreeSet two objects are shown equal but Queue shows them as unequal | java|collections|queue|comparable|treeset | 0 | 51 | 2 | 72,379,947 | 72,379,947 | 1 | true | 2022-05-25T14:49:43.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
As per TreeSet two objects are shown equal but Queue shows them as unequal<p>I have the follwing Person Class -</p>
<p><code>Person.java</code> -</p>
<pre><c... |
72,300,801 | XML transformation with XSLT: Create multiple output files with file names from incremented variable<p>I have an XML file like this:</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<xml>
<letter n="1">
<p>test 1</p>
</letter>
&l... | <p>If I read your requirements correctly, you want to do:</p>
<p><strong>XSLT 2.0</strong></p>
<pre><code><xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes&q... | XML transformation with XSLT: Create multiple output files with file names from incremented variable | xml|xslt | 0 | 51 | 1 | 72,301,384 | 72,301,384 | 1 | true | 2022-05-19T08:02:41.690Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
XML transformation with XSLT: Create multiple output files with file names from incremented variable<p>I have an XML file like this:</p>
<pre><code><?xml ... |
72,363,974 | How to display k as thousand for the values of chart.js - Javascript<p>I am using <code>chart.js</code>, I wanna display the values as thousand format in <code>K</code>.<br>I googled a lot and find out these answers: <a href="https://stackoverflow.com/questions/64384908/how-to-show-thousand-in-k-format-for-bar-values-i... | <p>To use the datalabels plugin you have to include it, you cant just pass the config and expect it to work. For the ticks you can use a callback</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettypri... | How to display k as thousand for the values of chart.js - Javascript | javascript|charts|chart.js|bar-chart | 1 | 51 | 1 | 72,364,187 | 72,364,187 | 1 | true | 2022-05-24T13:40:35.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to display k as thousand for the values of chart.js - Javascript<p>I am using <code>chart.js</code>, I wanna display the values as thousand format in <co... |
72,378,850 | Remove portion of duplicated SASS code in nesting class<p><strong>What i want to achieve with normal CSS:</strong></p>
<pre><code>.reduit__search-input {
border-width: 2px;
border-style: solid;
border-radius: 0% !important;
}
.reduit__search-input:not(.error--text), .reduit__search-input:not(.error--text) fieldse... | <p>You can use <code>&:not(.error--text)</code> like parent level and use it in nested selectors (<code>&, fieldset</code>) to omit code duplicates:</p>
<pre class="lang-scss prettyprint-override"><code>.reduit__search-input {
border-width:2px ;
border-style: solid;
border-radius: 0% !important;
&:... | Remove portion of duplicated SASS code in nesting class | css|sass | 0 | 51 | 1 | 72,379,327 | 72,379,327 | 1 | true | 2022-05-25T13:48:05.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove portion of duplicated SASS code in nesting class<p><strong>What i want to achieve with normal CSS:</strong></p>
<pre><code>.reduit__search-input {
b... |
72,389,641 | ProcessBuilder is not working correctly when I deploy my Spring boot Application to a Linux server<pre><code> public void pushDataToOPA() throws IOException, InterruptedException {
ProcessBuilder pb = new ProcessBuilder("curl", "-X", "PUT", "-H", "\"Content-Type: ap... | <p>You can redirect the process output to a <code>file</code> with the following code:</p>
<pre><code>public void updatePolicy() throws IOException, InterruptedException {
ProcessBuilder pb = new ProcessBuilder();
pb.command("curl", "-X", "PUT", "--data-binary", &... | ProcessBuilder is not working correctly when I deploy my Spring boot Application to a Linux server | java|linux|spring-boot|processbuilder|opa | 0 | 51 | 1 | 72,390,101 | 72,390,101 | 1 | true | 2022-05-26T09:28:54.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ProcessBuilder is not working correctly when I deploy my Spring boot Application to a Linux server<pre><code> public void pushDataToOPA() throws IOException,... |
72,249,566 | Can I convert an getElementbyId into a number to make a math operation in JavaScript?<p>This is a basic calculator project. I am having trouble to return the result, after any button is clicked it returns NaN. It has something to do with the input and how it translate into a number, but ".value" doesn't seem ... | <p>When the script runs, num1 and num2 get their values just one first time, and both would be undefined. Therefor when you click the buttons and trigger functions, all results would be <code>NaN</code>.
Try this way:</p>
<pre><code>let num1, num2
function getNumbers() {
num1 = parseInt(document.getElementById(&qu... | Can I convert an getElementbyId into a number to make a math operation in JavaScript? | javascript|html|calculator | 0 | 51 | 1 | 72,249,647 | 72,249,647 | 1 | true | 2022-05-15T15:16:24.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I convert an getElementbyId into a number to make a math operation in JavaScript?<p>This is a basic calculator project. I am having trouble to return the... |
72,248,174 | Show macro expansions in GNU Assembler - AS - listing. Preprocess only?<p>I can't seem to find any command switch to show me the expansions of my macro definitions.</p>
<p>Is there a way to do this with the GNU Assembler?</p>
<p>For example, if I have a macro like this:</p>
<pre><code>.macro MACROA a
mov \a,%rax
.e... | <p><code>as -a -am</code> enables listings with macro expansion.</p>
<pre><code>...
5 MACROA 10
5 0000 488B0425 > mov 10,%rax
5 0A000000
# load from absolute address 10, not mov $10, %rax.
# That's why as -Os doesn't optimize it to a 5-byte mov to eax
...
</code... | Show macro expansions in GNU Assembler - AS - listing. Preprocess only? | assembly|macros|preprocessor|gnu-assembler | 1 | 51 | 1 | 72,248,292 | 72,248,292 | 2 | true | 2022-05-15T12:15:53.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Show macro expansions in GNU Assembler - AS - listing. Preprocess only?<p>I can't seem to find any command switch to show me the expansions of my macro defin... |
72,255,074 | Question marks in wildcard search in Windows<p>I am using wildcard characters (? and *) to search for files in Windows in a c++ program with _tfindfirst64 and _tfindnext64. I observed the following code</p>
<pre><code> TCHAR root[1024] = L"C:/testData/?????_?????.jpg";
_tfinddata64_t c_file;
intptr... | <p>As you've found, a <code>?</code> in a file search doesn't require a character to be present, but matching will fail if a character is present that your search string doesn't account for. For example, <code>foo?.txt</code> will match <code>foo.txt</code>, <code>foo1.txt</code>, <code>fooa.txt</code>, and so on, but ... | Question marks in wildcard search in Windows | c++|visual-c++|wildcard | 2 | 51 | 1 | 72,255,209 | 72,255,209 | 2 | true | 2022-05-16T06:46:21.417Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Question marks in wildcard search in Windows<p>I am using wildcard characters (? and *) to search for files in Windows in a c++ program with _tfindfirst64 an... |
72,265,401 | Subtract pandas dataframe using list to choose diferent columns in each iteration<p>I'm trying to use a list as an index in a Dataframe subtract operation. However I get the following error: <em>cannot do positional indexing on Index with these indexers</em></p>
<p>I have these two DataFrames:</p>
<p><strong>df1</stron... | <p>Assuming you want to subtract 0 when the row runs out.</p>
<p>Let <code>shifts</code> be the list <code>[2,3,1,2]</code>, what you call index_col.</p>
<p>Might not be the nicest/most elegant solution, but I think this will do what you want:</p>
<pre class="lang-py prettyprint-override"><code>import numpy as np
from ... | Subtract pandas dataframe using list to choose diferent columns in each iteration | python|pandas|dataframe | 0 | 51 | 1 | 72,266,236 | 72,266,236 | 2 | true | 2022-05-16T20:43:13.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Subtract pandas dataframe using list to choose diferent columns in each iteration<p>I'm trying to use a list as an index in a Dataframe subtract operation. H... |
72,266,569 | Compiling and running java with javac vs java ClassName.java has different results<p>The java version used is as follows:</p>
<pre><code>java 17.0.3 2022-04-19 LTS
Java(TM) SE Runtime Environment (build 17.0.3+8-LTS-111)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.3+8-LTS-111, mixed mode, sharing)
</code></pre>
<p>Th... | <p>The <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html#using-source-file-mode-to-launch-single-file-source-code-programs" rel="nofollow noreferrer">source-file mode</a> that lets you run a program that fits in a single file is a little bit different than the normal compile / execute process.... | Compiling and running java with javac vs java ClassName.java has different results | java|java-17 | 1 | 51 | 2 | 72,266,722 | 72,266,722 | 2 | true | 2022-05-16T23:16:22.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Compiling and running java with javac vs java ClassName.java has different results<p>The java version used is as follows:</p>
<pre><code>java 17.0.3 2022-04-... |
72,283,119 | About alias implementation in elastic search<p>I would like to ask about the methods of alias in <strong>elastic search</strong>, how are <strong>addAlias</strong> and <strong>removeAlias</strong> implemented? How do they avoid problems with <strong>atomicity</strong> among other operations? For example, how to ensure ... | <p>You can take a look at the Elasticsearch class called <a href="https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/cluster/metadata/AliasAction.java" rel="nofollow noreferrer">AliasAction</a> where add and remove alias functionality is implemented as part of implementation of... | About alias implementation in elastic search | elasticsearch|alias|implementation | 2 | 51 | 1 | 72,283,165 | 72,283,165 | 2 | true | 2022-05-18T04:12:15.937Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
About alias implementation in elastic search<p>I would like to ask about the methods of alias in <strong>elastic search</strong>, how are <strong>addAlias</s... |
72,296,340 | Why does blowfish code written in php give different results in Python?<p>I am not very skilled in encrypting and I have been using the php code I mentioned below for encrypting for a long time. Now I want to program the same code with python, but I couldn't find a solution.</p>
<pre class="lang-php prettyprint-overrid... | <p>You call <code>c1.decrypt()</code> in the Python code instead of <code>c1.encrypt()</code>, and the PHP code (inside <code>mcrypt_encrypt()</code>) just pads the plaintext to a multiple of 8 bytes with null bytes. The following gives the same result as the PHP code: <code>md5(0x9da1192c5d3b3072) == 0xe3b3884a2e3986a... | Why does blowfish code written in php give different results in Python? | python|php|mcrypt|blowfish | 1 | 51 | 1 | 72,297,093 | 72,297,093 | 2 | true | 2022-05-18T21:43:19.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does blowfish code written in php give different results in Python?<p>I am not very skilled in encrypting and I have been using the php code I mentioned ... |
72,298,163 | Correct usage of abstract case class<p>I am trying to model a scenario where I'm trying to achieve immutability rather than modifying instance variables. The way I'm achieving this is as below.</p>
<pre><code>case class TSS(k:Int, v:Int)
case class Combiner(a:Int,b:Int, tss: TSS) {
def func1():Option[TSS] = None
... | <p>The problem is that <code>modifyState</code> is creating a new <code>Combiner</code> rather than the appropriate subclass. This is because it is combining state with abstract behaviour in one class.</p>
<p>The best solution is to make a separate concrete <code>State</code> class and have the <code>Combiner</code>s a... | Correct usage of abstract case class | scala|functional-programming | 0 | 51 | 2 | 72,299,395 | 72,299,395 | 2 | true | 2022-05-19T03:05:39.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Correct usage of abstract case class<p>I am trying to model a scenario where I'm trying to achieve immutability rather than modifying instance variables. The... |
72,305,677 | AWS web server refused to connect<pre><code>provider "aws" {
region = "us-east-1"
}
provider "random" {}
resource "random_pet" "name" {}
resource "aws_instance" "web" {
ami = "ami-0022f774911c1d690"
instance_type = "... | <p>I cloned and ran this tutorial myself & it does not work for me either. Trying to connect gives me a timeout error.</p>
<p><strong>1st observation</strong> - it's very old & not a great tutorial. The AMI it samples does not even exist anymore & I used the latest AMZN Default Linux 2 AMI instead.</p>
<p><... | AWS web server refused to connect | amazon-web-services|terraform|terraform-provider-aws | 0 | 51 | 1 | 72,307,896 | 72,307,896 | 2 | true | 2022-05-19T13:43:18.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AWS web server refused to connect<pre><code>provider "aws" {
region = "us-east-1"
}
provider "random" {}
resource "ran... |
72,332,241 | How to move around an object drawn on a panel with button click<p>I am trying to build a bounce game in Java. My project has three classes ie the <code>Main</code> class which creates a new window(frame) where the game buttons and bounce objects are drawn.
The <code>GameInterface</code> class which represents the prope... | <ol>
<li>Never call getGraphics() on a component.</li>
<li>Override paintComponent not paint</li>
<li>Call the super.paintComponent(g) in your override.</li>
<li>Give the RightPanel class setter methods that allow you to change the positionX and positionY locations for drawing,</li>
<li>In the button listener, call an ... | How to move around an object drawn on a panel with button click | java|swing|bounce | 0 | 51 | 1 | 72,332,578 | 72,332,578 | 2 | true | 2022-05-21T18:26:39.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to move around an object drawn on a panel with button click<p>I am trying to build a bounce game in Java. My project has three classes ie the <code>Main<... |
72,335,049 | while loop, JavaScript printing unexpected value<p>I have gone through this Question and Answer <a href="https://stackoverflow.com/questions/40661321/while-loop-inside-while-loop-javascript">While loop inside while loop JavaScript</a></p>
<pre><code>function getMaxLessThanK(n, k) {
let i = 1;
while (i < n) {
... | <p>If you're running it in a console and get an <code>undefined</code> like this:</p>
<p><a href="https://i.stack.imgur.com/cjiYx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cjiYx.png" alt="enter image description here" /></a></p>
<p>This <code>undefined</code> indicates that your statement runs ... | while loop, JavaScript printing unexpected value | javascript | 0 | 51 | 1 | 72,335,110 | 72,335,110 | 2 | true | 2022-05-22T05:38:07.007Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
while loop, JavaScript printing unexpected value<p>I have gone through this Question and Answer <a href="https://stackoverflow.com/questions/40661321/while-l... |
72,350,542 | Can't use SharedPreferences in intended activity<p>There are two classes <code>MainActivity</code> and <code>PickTimeForNotif</code> in my project. In MainActivity <code>getSharedPreferences</code> works just fine, i can save my data and get it back. In PickTimeForNotif, however, the same method seems to do nothing.</p... | <p>In <code>loadTimeFromInternalStorage()</code>, you are fetching the value but not assigning to variable like this:</p>
<pre><code>private fun loadTimeFromInternalStorage() {
val sharedPref = this.getSharedPreferences(APP_PREFERENCES, MODE_PRIVATE)
if (sharedPref.contains(APP_PREFERENCES)) {
... | Can't use SharedPreferences in intended activity | android|kotlin|sharedpreferences | 1 | 51 | 1 | 72,350,720 | 72,350,720 | 2 | true | 2022-05-23T14:48:39.607Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't use SharedPreferences in intended activity<p>There are two classes <code>MainActivity</code> and <code>PickTimeForNotif</code> in my project. In MainAc... |
72,382,090 | How to remove characters between space and specific character in R<p>I have a question similar to <a href="https://stackoverflow.com/questions/26682107/remove-the-letters-between-two-patterns-of-strings-in-r">this one</a> but instead of having two specific characters to look between, I want to get the text between a sp... | <p>You can use</p>
<pre class="lang-r prettyprint-override"><code>str_remove_all(myString, "\\S*\\.jpg")
</code></pre>
<p>Or, if you also want to remove optional whitespace before the "word":</p>
<pre class="lang-r prettyprint-override"><code>str_remove_all(myString, "\\s*\\S*\\.jpg")
</co... | How to remove characters between space and specific character in R | r|regex|string | 1 | 51 | 1 | 72,383,601 | 72,383,601 | 2 | true | 2022-05-25T17:40:18.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove characters between space and specific character in R<p>I have a question similar to <a href="https://stackoverflow.com/questions/26682107/remov... |
72,389,693 | Reject input if the adjacent cell is empty<p>Using below formula to Reject input if the adjacent cell is empty.</p>
<p>I am trying to made the condition for the Data validation rules that if <code>R2:R500</code> is empty then Column M will Reject the input when try to add anything but below formula is not working in Va... | <p>Try this validation setup.</p>
<pre><code>=$R2:$R500<>""
</code></pre>
<p><a href="https://i.stack.imgur.com/mR199.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mR199.png" alt="enter image description here" /></a></p> | Reject input if the adjacent cell is empty | validation|google-sheets | 0 | 51 | 1 | 72,390,119 | 72,390,119 | 2 | true | 2022-05-26T09:33:06.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reject input if the adjacent cell is empty<p>Using below formula to Reject input if the adjacent cell is empty.</p>
<p>I am trying to made the condition for ... |
72,397,125 | Switching environments within a python script<p>I have a python script which needs to call the matlab engine so that I can use a code base (many funcitons) without having to rewrite a ton of code into python. Problem is the solution I found for running matlab requires an environemnt set up. I already have an environm... | <p>I feel that I've answered something similar to this before, but can't find an exact fit. One can't switch a Python process mid-execution to have context-sensitive evaluation, like OP describes. However, <code>os.system</code> or <code>subprocess.run</code> could be used run the other Python code (as a separate scrip... | Switching environments within a python script | python|matlab|conda | 1 | 51 | 1 | 72,397,424 | 72,397,424 | 2 | true | 2022-05-26T19:34:57.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Switching environments within a python script<p>I have a python script which needs to call the matlab engine so that I can use a code base (many funcitons) w... |
72,396,706 | F# deleting element from tree<p>I have a problem with function that should delete element from tree. It deletes whole node and not an single element.<br>
Type tree code:</p>
<pre><code>type tree =
| Empty
| Node of float * tree * tree
</code></pre>
<p>function code:</p>
<pre><code>let deleteFromTree n =
... | <p>Your code deletes a whole sub-tree because of how you handle the case when <code>a = n</code>. In that case, you return whatever you get by processing the right sub-tree <code>c</code> (using <code>loop newTree c</code>) but the variable <code>b</code> representing the left sub-tree is not used anywhere.</p>
<p>Give... | F# deleting element from tree | f#|tree | 1 | 51 | 1 | 72,399,043 | 72,399,043 | 2 | true | 2022-05-26T18:55:34.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
F# deleting element from tree<p>I have a problem with function that should delete element from tree. It deletes whole node and not an single element.<br>
Typ... |
72,389,106 | Loop in xAxis from highcharts according to returned data<p>I have the following data returned from php:</p>
<pre><code># Mes, Total, Categoria
2022-05, 1, Bullying (Mobbing, Bossing, Pessoal, Gossip)
2022-05, 1, Preocupação relativas à saúde e segurança
2022-05, 1, Suspeita de Roubo, Corrupção ou Desfalque
2022-04, 1, ... | <p>The stack option doesn't refer to the category index as you expect in your example.</p>
<p>You use stack: 'A' and stack: B' and have one y value for each series. It means that two stacked columns are grouped for one category.</p>
<p><strong>Take a look at the API Reference and its demo:</strong> <a href="https://api... | Loop in xAxis from highcharts according to returned data | javascript|highcharts | 0 | 51 | 1 | 72,432,528 | 72,432,528 | 2 | true | 2022-05-26T08:43:14.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Loop in xAxis from highcharts according to returned data<p>I have the following data returned from php:</p>
<pre><code># Mes, Total, Categoria
2022-05, 1, Bu... |
72,260,243 | If condition on multiple list<p>Am trying to write an if condition in which I test on the standard deviation of several lists that are in a dictionary, The if statement that I did didn't work for me as you can see in the code :</p>
<pre><code>a= {}
a[0] = [0.9907568097114563, 0.9913344979286194, 0.9907568097114563, 0.... | <p>I am not sure what you're trying to do, but you are calling an np.std on a generator "a[i] for i in range(len(a))", you have a syntax error (missing ')') and are using a dictionary like a list (which although might work, I don't recommend it). Consider using "any" for the if statement, you're cod... | If condition on multiple list | python|numpy | -2 | 51 | 2 | 72,260,387 | 72,260,387 | 2 | true | 2022-05-16T13:45:03.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
If condition on multiple list<p>Am trying to write an if condition in which I test on the standard deviation of several lists that are in a dictionary, The i... |
72,247,722 | How can I make title screen?<p>I am trying to make title screen when i press a button. It goes when i press the button game stops
with <code>Time.timeScale = 0f;</code> and I am trying to do is when I click button time stops and two buttons shows up for quit and resume and I am trying to do when I press the button it s... | <p>it would be great if you made bool</p>
<p>here some example of your code</p>
<pre><code>public bool show;
private void Awake()
{
gameObject.SetActive(false);
}
private void Start()
{
show = false;
gameObject.SetActive(false);
}
private void gameobject()
{
if (show = true)
{
gameObject.... | How can I make title screen? | windows|visual-studio|function|unity3d|c#-2.0 | 0 | 51 | 1 | 72,248,447 | 72,248,447 | 2 | true | 2022-05-15T11:12:08.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I make title screen?<p>I am trying to make title screen when i press a button. It goes when i press the button game stops
with <code>Time.timeScale =... |
72,244,755 | How to create a generic string of letters and numbers for "n" clusters in R to add in a dataframe?<p>I have this:</p>
<pre><code>df<-structure(list(x = c(-0.803739264931451, 0.852850728148773, 0.927179506105653, -0.752626056626365, 0.706846224294882, 1.0346985222527, -0.475845197699957, -0.460301566967151, -0.680301... | <p>Here is a small function that should do it for you:</p>
<pre><code>f <- function(g,n) {
letter_index = if_else(g%%26 ==0, 26, g%%26)
paste0(
paste0(rep(LETTERS[letter_index], times = ceiling(g/26)), collapse=""),
1:n)
}
</code></pre>
<p>Now apply that function to each shape value, using <cod... | How to create a generic string of letters and numbers for "n" clusters in R to add in a dataframe? | r|range | 0 | 51 | 1 | 72,244,885 | 72,244,885 | 2 | true | 2022-05-15T00:32:27.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a generic string of letters and numbers for "n" clusters in R to add in a dataframe?<p>I have this:</p>
<pre><code>df<-structure(list(x = c(... |
72,322,316 | Oracle sql Order By number and char inside<p>I'm quite new to sql so I don't fully understand what I'm doing. My question is, how can I order by this data, that the order would go by number like 1,2,3, but there are letters inside, so it would be like 1,2,A3, B3, 4.</p>
<p>I have this so far:</p>
<p>ORDER BY
REGEXP_REP... | <p>The immediate problem is that you are incrementing the positionas well as the occurrence; so</p>
<pre><code>REGEXP_SUBSTR(string, '\d', 2, 2)
</code></pre>
<p>should be</p>
<pre><code>REGEXP_SUBSTR(string, '\d', 1, 2)
</code></pre>
<p>But you're overcomplicating it, and not handling multiple-digit elements, either w... | Oracle sql Order By number and char inside | sql|oracle-sqldeveloper | 1 | 51 | 2 | 72,322,668 | 72,322,668 | 2 | true | 2022-05-20T16:50:54.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Oracle sql Order By number and char inside<p>I'm quite new to sql so I don't fully understand what I'm doing. My question is, how can I order by this data, t... |
72,263,820 | When does React call a component constructor function and what's like the execution flow?<p>Say I have a simple component like this one:</p>
<pre class="lang-js prettyprint-override"><code>export default function Foo({someProp}) {
const a = Math.random();
return <div>{a}{someProp}</div>
}
</code></pre>... | <p>The answer for every one of your question is <strong>yes</strong>. A re-render is triggered when there is a <code>props</code> change as you said, and also when there is a <code>state</code> change. When re-rendering and also on the first render, everything behaves like in a normal JavaScript function, as far as ass... | When does React call a component constructor function and what's like the execution flow? | javascript|reactjs | 2 | 51 | 1 | 72,263,893 | 72,263,893 | 2 | true | 2022-05-16T18:16:59.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When does React call a component constructor function and what's like the execution flow?<p>Say I have a simple component like this one:</p>
<pre class="lang... |
72,274,693 | String operations with stringr not working depending on vectorized/unvectorized call<p>I'm struggling understanding why my code below works only when using <code>rowwise</code> in combination with <code>ifelse</code>. Or more precisely, I think I get why it is working in that scenario, but not why it doesn't simply wor... | <p>Basically, the issue is that <code>if_else()</code> evaluates both the true and false output in every row, while <code>ifelse()</code> only evaluates the true and false expressions where they are used.</p>
<p>Also, if you don't use <code>rowwise()</code>, then mutate passes the whole set of strings in <code>df$value... | String operations with stringr not working depending on vectorized/unvectorized call | r|if-statement|vectorization|stringr | 2 | 51 | 2 | 72,277,420 | 72,277,420 | 2 | true | 2022-05-17T13:11:27.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
String operations with stringr not working depending on vectorized/unvectorized call<p>I'm struggling understanding why my code below works only when using <... |
72,397,134 | Formula based on first monday or tuesday etc of the week Part 2<p>So in the first past I was using the formula</p>
<p><code>=DATE(2022,{1;2;3;4;5;6;7;8;9;10;11;12},7-WEEKDAY(DATE(2022,{1;2;3;4;5;6;7;8;9;10;11;12},1)-5,3))</code></p>
<p>To calculate the first monday of each month.</p>
<p>We further made it interactive b... | <p>Simplifying Scott's formula a bit,
you can try:</p>
<pre><code>=LET(dt, DATE(YEAR(A1),SEQUENCE(12,,MONTH(A1)+1),8),
wkdy, MATCH(LEFT(A2,3),{"Sun","Mon","Tue","Wed","Thu","Fri","Sat"},0),
dt-(WEEKDAY(dt-wkdy)))
</code></pre>
<p><a href="https://i.s... | Formula based on first monday or tuesday etc of the week Part 2 | excel|excel-formula | 0 | 51 | 2 | 72,404,418 | 72,404,418 | 2 | true | 2022-05-26T19:35:34.150Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Formula based on first monday or tuesday etc of the week Part 2<p>So in the first past I was using the formula</p>
<p><code>=DATE(2022,{1;2;3;4;5;6;7;8;9;10;... |
72,262,272 | Binding several sf together only plots first layer<p>I'm trying to create a script to generate generic maps with bathymetry, and I'm struggling to get it to work.
My issue is that depending on the map I want to make, I will call different bathymetric layers, but when I bind them together, only the first one is plotted.... | <p>I think your main problem is with overplotting, which you can only really see by setting strong fill colors and an alpha value:</p>
<pre class="lang-r prettyprint-override"><code>plot_map <- function(bathy){
ggplot() +
geom_sf(data = bathy %>%
left_join(tibble(depth = c(200, 1000, 2000),
... | Binding several sf together only plots first layer | r|tidyverse|sf|rnaturalearth | 1 | 51 | 1 | 72,262,578 | 72,262,578 | 2 | true | 2022-05-16T16:08:34.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Binding several sf together only plots first layer<p>I'm trying to create a script to generate generic maps with bathymetry, and I'm struggling to get it to ... |
72,284,831 | Interactive rendering for a video in R Shiny<p>For each input from the user, I would like to render a different video based on a different <strong>src</strong>,
I have tested many methods non of them has served my needs, I am relying on extracting the src path from a specific cell in a CSV file</p>
<p>would you please ... | <p>If the video is on YouTube, you can just use their standard embedded Iframe. Only use the video ID, because you want to use a different URL (<a href="https://www.youtube.com/embed/" rel="nofollow noreferrer">https://www.youtube.com/embed/</a> instead of <a href="https://www.youtube.com/watch" rel="nofollow noreferre... | Interactive rendering for a video in R Shiny | r|shiny | 0 | 51 | 1 | 72,285,045 | 72,285,045 | 2 | true | 2022-05-18T07:27:13.417Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Interactive rendering for a video in R Shiny<p>For each input from the user, I would like to render a different video based on a different <strong>src</stron... |
72,283,484 | Using comparator for char array, but get no suitable method found<p>I am trying to use the value of freq to sort all the a-z chars. However it is not working. Could someone explain why the following code is not working please? And how can I sort the array as I want? Thank you.</p>
<pre><code> char[] chars = new ... | <p>According to the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html#sort-T:A-java.util.Comparator-" rel="nofollow noreferrer">javadocs</a>, Arrays.sort with a comparator is only applicable on Objects not primitives.</p>
<p>Arrays.sort(char[]) sorts on numerical order.</p>
<p>Just to solve your ... | Using comparator for char array, but get no suitable method found | java|sorting | 0 | 51 | 2 | 72,283,668 | 72,283,668 | 2 | true | 2022-05-18T05:11:08.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using comparator for char array, but get no suitable method found<p>I am trying to use the value of freq to sort all the a-z chars. However it is not working... |
72,267,211 | How do databases store live second data?<p>So what I mean by live second data is something like the stock market where every second the data is getting inputted to the exact area of the specific stock item.</p>
<p>How would the data look in the database? Does it have a timestamp of each second? If so, wouldn't that cau... | <p>Given the sheer amount of money that gets thrown around in fintech, I'd be surprised if trading platforms even use traditional RDMBS databases to store their trading data, but I digress...</p>
<blockquote>
<p>How would the data look in the database?</p>
</blockquote>
<p>(Again, assuming they're even using <a href="h... | How do databases store live second data? | sql|database | 0 | 51 | 2 | 72,267,397 | 72,267,397 | 2 | true | 2022-05-17T01:24:03.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do databases store live second data?<p>So what I mean by live second data is something like the stock market where every second the data is getting input... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.