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
72,827,941
Why not equal displaying actual result in select queries by joining two select tables<p>I am using MySQL. I am trying to join two queries by != condition. For this example it should return empty result set. But it seems the condition is not applied. Why is this so?</p> <p>My attempts are below:</p> <pre><code> SELEC...
<p>Use a <code>HAVING</code> clause with the condition that the min <code>transaction_date</code> is <code>'2022-06-28'</code>:</p> <pre><code>SELECT scd.student_id, MIN(sc.transaction_date) transaction_date FROM student_collection_details scd INNER JOIN student_collection sc ON scd.student_collection_id = sc.i...
Why not equal displaying actual result in select queries by joining two select tables
mysql|sql|select|group-by|mariadb
1
50
1
72,828,207
72,828,207
1
true
2022-07-01T10:31:39.177Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why not equal displaying actual result in select queries by joining two select tables<p>I am using MySQL. I am trying to join two queries by != condition. Fo...
72,769,335
Issue with Formula for complicated text not working<p>So the issue i have is on the sheet below Column G formula is the same as Column H, but it is not working, i believe it is because of the complicated text it is looking for, any help is appreciated</p> <p><a href="https://docs.google.com/spreadsheets/d/1nEeulAtoiHS8...
<p>Most likely this is due to the fact that square brackets are used in your data. Those represent a character class in regex. I changed the formula you had so that it now replaces those brackets. Result can be seen in the duplicated sheet, starting in G2. The formula I used is</p> <pre><code>=INDEX(QUERY({regexreplace...
Issue with Formula for complicated text not working
google-sheets|formula
0
50
1
72,769,628
72,769,628
1
true
2022-06-27T08:49:21.903Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue with Formula for complicated text not working<p>So the issue i have is on the sheet below Column G formula is the same as Column H, but it is not worki...
72,945,721
MongoDB -- Remove null values in objects inside array<p>I have a sample document with array of objects</p> <pre><code>[ { array_a: [{&quot;key1&quot;: &quot;val1&quot;, &quot;key2&quot;: &quot;val2&quot;, &quot;key3&quot;: null}, ...], array_b: [{&quot;key4&quot;: &quot;val1&quot;, &quot;key5&quot;: null, &q...
<p>A bit long query.</p> <ol> <li><p><code>$set</code></p> <p>1.1. (<code>array_a</code>) <code>$map</code> - Iterate array from <em>1.1.1</em> and return new array.</p> <p>1.1.1. <code>input</code> - <code>$map</code> - Convert each document in <code>array_a</code> to key-value pair array: <code>[{ k: &quot;key1&quot;...
MongoDB -- Remove null values in objects inside array
mongodb|mongodb-query
0
50
1
72,946,197
72,946,197
1
true
2022-07-11T23:55:37.117Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MongoDB -- Remove null values in objects inside array<p>I have a sample document with array of objects</p> <pre><code>[ { array_a: [{&quot;key1&quot;:...
72,843,733
search registration through the year and month<p>I'm making a code where a record has to appear through the date (Month, Year), for example: 12-2022. But this is where it is, with this code, I'm not getting it. What can I do?</p> <pre><code>&lt;?php $sqli=sprintf(&quot;SELECT * FROM eve...
<p>Your where clause should be separated on year and month.</p> <p>The query that might work is some thing like this:</p> <pre><code>&quot;select * from eventos where year(data) = '2022' and month(data) = 10&quot; </code></pre>
search registration through the year and month
php|html|css|sql|date
-2
50
1
72,844,665
72,844,665
1
true
2022-07-03T03:24:37.207Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: search registration through the year and month<p>I'm making a code where a record has to appear through the date (Month, Year), for example: 12-2022. But thi...
72,894,063
How to convert Hex in string format to Hex format<p>So i have a code that converts binary input to hex in string format:</p> <pre><code>#include &lt;cstring&gt; #include &lt;iostream&gt; #include &lt;string&gt; using namespace std; int main() { string binary[16] = {&quot;0000&quot;, &quot;0001&quot;, &quot;0010&qu...
<p>To parse the input, the standard <a href="https://en.cppreference.com/w/cpp/string/basic_string/stoul" rel="nofollow noreferrer"><code>std::stoul</code></a> allows to set the base as parameter. For base 2:</p> <pre><code>unsigned long input = std::stoul(str, nullptr, 2); </code></pre> <p>Than you can print it as hex...
How to convert Hex in string format to Hex format
c++
0
50
1
72,894,282
72,894,282
1
true
2022-07-07T07:46:26.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert Hex in string format to Hex format<p>So i have a code that converts binary input to hex in string format:</p> <pre><code>#include &lt;cstring&...
72,987,814
`clock_gettime()` yields incorrect results on Apple M1 (Monterey 12.0.1)<p>I was working today on a pet project of mine involving performance and C when I was confronted with an unusual bug.</p> <p>The following code populates two 4096 by 4096 matrices using <code>arc4random()</code> and computes matrix multiplication....
<p>There is nothing wrong with the timing. Your multiplication function (omitted from the question but included in the gist) has a bug and does not actually do matrix multiplication, so it is much faster than you expect.</p> <pre><code>void matmul(size_t N, double C[static N][N], double A[static N][N], dou...
`clock_gettime()` yields incorrect results on Apple M1 (Monterey 12.0.1)
c|clang|apple-m1|clock
0
50
1
72,997,835
72,997,835
1
true
2022-07-15T00:06:20.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: `clock_gettime()` yields incorrect results on Apple M1 (Monterey 12.0.1)<p>I was working today on a pet project of mine involving performance and C when I wa...
72,975,256
Email to include ranges from different sheets<p>I wanted to use VBA to send an outlook email with ranges from three different sheets in the workbook, how can I combine the three ranges(rng1 then leave a blank row, then rng2 and leave a blank row, then rng3) in order to show them in the same email? I tried the below cod...
<p><a href="https://www.rondebruin.nl/win/s1/outlook/bmail2.htm" rel="nofollow noreferrer">Using Ron de Bruin's RangetoHTML</a></p> <p>You would need to run <code>RangetoHTML</code> on each one individually. That will give you an HTML <code>String</code> for each one.</p> <p>They can then be concatenated.</p> <pre><cod...
Email to include ranges from different sheets
excel|vba|outlook
1
50
1
72,975,299
72,975,299
1
true
2022-07-14T04:37:31.493Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Email to include ranges from different sheets<p>I wanted to use VBA to send an outlook email with ranges from three different sheets in the workbook, how can...
72,836,001
SQL join to include all records on the left most table and only show records from the two right table where two condition are met<p>I need assistance with my join and where condition.</p> <p>I would like all records in <code>hpd_help_desk</code> displayed.</p> <p>Tables <code>hpd_associations</code> and <code>chg_infra...
<p>When dealing with outer joins you need to cater for the possibility of NULLs in columns from those joined tables. This is especially true when it comes to the <code>where clause</code> because if you don't allow for NULLs when referring to outer joined tables you create the conditions that equate to an inner join.</...
SQL join to include all records on the left most table and only show records from the two right table where two condition are met
join|where-clause|impala
-1
50
1
72,836,362
72,836,362
1
true
2022-07-02T02:08:55.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL join to include all records on the left most table and only show records from the two right table where two condition are met<p>I need assistance with my...
72,982,601
Disallow URL with specific querystring from crawl using robots.txt<p>My client has an ASP.NET MVC web application that also has a WordPress blog in a subfolder.</p> <pre><code>https://www.example.com/ https://www.example.com/wordpress </code></pre> <p>The WordPress site is loaded with some social sharing links that I d...
<p><code>robots.txt</code> should <strong>only</strong> be at the root of the domain. <code>https://example.com/robots.txt</code> is the correct URL for your <code>robots.txt</code> file. Any <code>robots.txt</code> file in a subdirectory will be ignored.</p> <p>By default, <code>robots.txt</code> rules are all &quot;s...
Disallow URL with specific querystring from crawl using robots.txt
wordpress|seo|robots.txt|google-crawlers
0
50
1
72,997,290
72,997,290
1
true
2022-07-14T14:56:42.847Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Disallow URL with specific querystring from crawl using robots.txt<p>My client has an ASP.NET MVC web application that also has a WordPress blog in a subfold...
72,886,460
Can I use a dplyr pipe instead of lapplying over lists in R?<p>I'd like to know if I can use tidyverse for tasks I used lists in R so far. I got a matrix of species abundances per plot for which I want to calculate dissimilarity indices with <em>vegdist</em> from the <em>vegan</em> package. After that I'd like to put ...
<p>We may <code>split</code> the 'spec' by 'group' into a <code>list</code>, loop over the <code>list</code> and then <code>select</code> the columns based on the elements from the <code>list</code> and apply the <code>vegdist</code></p> <pre><code>library(vegan) library(purrr) library(dplyr) library(tidyr) out &lt;- m...
Can I use a dplyr pipe instead of lapplying over lists in R?
r|list|dplyr|data-manipulation
1
50
1
72,886,799
72,886,799
1
true
2022-07-06T15:43:25.717Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I use a dplyr pipe instead of lapplying over lists in R?<p>I'd like to know if I can use tidyverse for tasks I used lists in R so far. I got a matrix of ...
72,955,598
How to merge based on a string in a column?<p>I would like to do exact joins for the columns state and name, but a fuzzy join for the &quot;name&quot; and &quot;versus&quot; columns:</p> <pre><code>year &lt;- c(&quot;2002&quot;, &quot;2002&quot;, &quot;1999&quot;, &quot;1999&quot;, &quot;1997&quot;, &quot;2002&quot;) s...
<p>A simple approach, which depends somewhat on the structure of <code>df2$versus</code>, would be this:</p> <pre><code>library(dplyr) left_join(df1,df2, by=c(&quot;year&quot;,&quot;state&quot;)) %&gt;% rowwise() %&gt;% mutate(versus:=if_else(grepl(name,versus,ignore.case=T), versus,as.character(NA))) </code></p...
How to merge based on a string in a column?
r|join|merge|fuzzyjoin
-1
50
2
72,955,815
72,955,815
1
true
2022-07-12T16:33:16.720Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to merge based on a string in a column?<p>I would like to do exact joins for the columns state and name, but a fuzzy join for the &quot;name&quot; and &q...
72,983,376
Place ion-icon on ion-avatar bottom-right border<p>Got this avatar design displaying profile pic, name and surname, and an icon to change the profile pic.</p> <p><a href="https://i.stack.imgur.com/3O1S2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3O1S2.png" alt="avatar image" /></a></p> <p>Right ...
<p>Set the container to <code>position: relative</code>, and then <code>absolute</code>ly position the camera icon.</p> <pre class="lang-css prettyprint-override"><code>.profile-pic-container { position: relative; height: 100px; width: 100px; } ion-avatar { text-align: right; } #camera-icon { font-size: 24p...
Place ion-icon on ion-avatar bottom-right border
html|css|angular|ionic-framework|capacitor
0
50
1
72,983,797
72,983,797
1
true
2022-07-14T15:52:22.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Place ion-icon on ion-avatar bottom-right border<p>Got this avatar design displaying profile pic, name and surname, and an icon to change the profile pic.</p...
72,897,387
Getting basic stats from Np.array within a for loop in python<p>I don't have a lot of python experience and I'm trying something rather complicated for me, so excuse my messy code. I have a few arrays that were generated with <code>rasterio </code> from raster layers (tif), and ultimately I want to get some basic stat...
<p>Considering you have a dict of images:</p> <pre class="lang-py prettyprint-override"><code>import numpy as np import pandas as pd vmin, vmax = 0, 255 C, H, W = 2, 64, 64 images_names = [&quot;HH&quot;, &quot;VV&quot;, &quot;VH&quot;, &quot;HV&quot;] images = { im_name: np.random.randint(vmin, vmax, size=(C, H,...
Getting basic stats from Np.array within a for loop in python
python|pandas|numpy|gdal|rasterio
-1
50
1
72,897,691
72,897,691
1
true
2022-07-07T11:54:55.380Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting basic stats from Np.array within a for loop in python<p>I don't have a lot of python experience and I'm trying something rather complicated for me, s...
72,920,641
How to simulate EAGAIN or EWOULDBLOCK when send data to socket<p>I have a non-blocking socket to send data to. When sending data to a socket in non-blocking mode, we can get EAGAIN or EWOULDBLOCK if there is not enough space in the socket buffer. If the send call returns EAGAIN or EWOULDBLOCK, I subscribe to the EPOLLO...
<blockquote> <p>How i can test my code in this case?</p> </blockquote> <p>This depends a lot on your kind of application and protocol. In general to trigger the condition the socket write buffer needs to fill up.</p> <p>This can be done by sending lots of data and making sure that the receiver application does not read...
How to simulate EAGAIN or EWOULDBLOCK when send data to socket
c++|linux|sockets|networking|epoll
1
50
1
72,920,677
72,920,677
1
true
2022-07-09T10:32:19.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to simulate EAGAIN or EWOULDBLOCK when send data to socket<p>I have a non-blocking socket to send data to. When sending data to a socket in non-blocking ...
72,931,944
How to add and delete the specific item from an array of an object in react.js?<p>I am trying to add a functionality wherein when a user clicks on <code>add channel</code> button he can add the channel and it will show the newly added channel name in the respective teams. Similarly, when a user wants to delete a channe...
<p>You should create a <code>InputAddChannel</code> component</p> <pre><code>const InputAddChannel = ({ handleAddChannel }) =&gt; { const [inputChannelValue, setInputChannelValue] = useState(&quot;&quot;); const handlInputChange = (event) =&gt; { event.preventDefault(); const newChannelName = event.target.v...
How to add and delete the specific item from an array of an object in react.js?
javascript|reactjs|arrays|react-hooks|mern
0
50
1
72,932,895
72,932,895
1
true
2022-07-10T21:14:28.327Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add and delete the specific item from an array of an object in react.js?<p>I am trying to add a functionality wherein when a user clicks on <code>add ...
72,857,365
Why geom_rect colours only first row of facet_wrap?<p>I am trying to get shaded rectangles on every even-numbered panel of my <code>facet_wrap</code> plot. However, when I use <code>geom_rect</code>, it produces the rectangles only on the second panel. I tried using <code>annotate</code> and <code>geom_tile</code> but ...
<p>While your idea was right IMHO you could achieve your desired result more easily by putting the <code>xmin</code> and <code>xmax</code> values in a dataframe and by mapping on aesthetics. First note that we only need a vector of even numbers of <code>length(unique(df.tmp$Cnd))</code>, i.e. the number of categories o...
Why geom_rect colours only first row of facet_wrap?
r|ggplot2|facet-wrap
1
50
2
72,859,043
72,859,043
1
true
2022-07-04T13:14:32.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why geom_rect colours only first row of facet_wrap?<p>I am trying to get shaded rectangles on every even-numbered panel of my <code>facet_wrap</code> plot. H...
72,839,296
How can we display datas according to button clicks in mainpage ....if many filteration method is applied in ReactJs?<p>When someone Logs in first of all i want to <strong>show the currentUserData in the table body</strong>. then when clicks on &quot;<strong>Today</strong>&quot; button, table should be show the &quot;<...
<pre><code> //️ Setting state for showing the required datas when filtering const [showUserData, setShowUserData] = useState(false) const [showTodayData, setShowTodayData] = useState(false) const [showWeekData, setShowWeekData] = useState(false) const [showMonthData, setShowMonthData] = useState(false) const...
How can we display datas according to button clicks in mainpage ....if many filteration method is applied in ReactJs?
javascript|reactjs
0
50
2
72,841,179
72,841,179
1
true
2022-07-02T13:09:57.113Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can we display datas according to button clicks in mainpage ....if many filteration method is applied in ReactJs?<p>When someone Logs in first of all i w...
73,025,949
How to manipulate offsets of the source database for Debezium<p>So I've been experimenting with Kafka and I am trying to manipulate/change the offsets of the source database using this link <a href="https://debezium.io/documentation/faq/" rel="nofollow noreferrer">https://debezium.io/documentation/faq/</a>. I was succe...
<p><code>key.separator=&quot;:&quot;</code> looks like it will be an issue considering it will split your data at <code>[&quot;In-house&quot;,{&quot;server&quot;:</code></p> <p>So, basically you produced a bad event into the topic, and maybe broke the connector...</p> <p>If you want to literally use the same command, k...
How to manipulate offsets of the source database for Debezium
apache-kafka|apache-kafka-connect|debezium|kafkacat
0
50
1
73,026,132
73,026,132
1
true
2022-07-18T16:56:08.853Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to manipulate offsets of the source database for Debezium<p>So I've been experimenting with Kafka and I am trying to manipulate/change the offsets of the...
72,945,768
jQuery If Statement Message<p>I have the code set up so that when the user inputs a negative number or an invalid value for the thickness of the pipe (greater than 1/3rd of the diameter), an error message pops up. However, when I enter a valid input, the error message does not go away, and only goes away when updating ...
<p>The problem is that you have $('#error').hide(); outside the $('#inner_diameter').on('change', function() { so, if you change the function like 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-js lang-js pre...
jQuery If Statement Message
javascript|html|jquery|css
0
50
1
72,945,921
72,945,921
1
true
2022-07-12T00:03:26.017Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery If Statement Message<p>I have the code set up so that when the user inputs a negative number or an invalid value for the thickness of the pipe (greate...
72,772,505
Opening and preprocessing text (300 PDFs) in Python<p>I am supposed to preprocess some PDFs in a folder. I am supposed to remove punctuation, make everything lower case and remove stopwords, and add some extra data from another CSV to it (as metadata). But I cannot even open them. All the googling does not help, since ...
<p>You have forgotten to add the string formatting parameter:</p> <pre><code>object = PyPDF2.PdfFileReader(&quot;/Users/n_n/Desktop/Digitalization/reserve%s&quot; % k) </code></pre> <p>Note the <code>&quot;%s&quot;</code> at the end of the file path string. When formatting with the <code>%</code> operator, the <code>&q...
Opening and preprocessing text (300 PDFs) in Python
python|pdf|text-processing
0
50
1
72,772,711
72,772,711
1
true
2022-06-27T12:58:20.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Opening and preprocessing text (300 PDFs) in Python<p>I am supposed to preprocess some PDFs in a folder. I am supposed to remove punctuation, make everything...
72,846,128
Sort series on index for the values that are equal<p>I have a Pandas series here:</p> <blockquote> <p>s1=pd.Series([23,23,21,21,25,25,25])</p> </blockquote> <p>Now when i do s1.value_counts(), i get another series which is this image:</p> <p><a href="https://i.stack.imgur.com/WOOaS.png" rel="nofollow noreferrer"><img s...
<p>Is this is what you are after?:</p> <pre><code>import pandas as pd s1=pd.Series([23,23,21,21,25,25,25]) s1.value_counts().sort_index(ascending=True).sort_values(ascending=False) </code></pre>
Sort series on index for the values that are equal
python|pandas|sorting|series
1
50
2
72,846,293
72,846,293
1
true
2022-07-03T11:33:56.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort series on index for the values that are equal<p>I have a Pandas series here:</p> <blockquote> <p>s1=pd.Series([23,23,21,21,25,25,25])</p> </blockquote> ...
72,798,344
counting number of rows in a table that are true between two timedates<p>I've got this table:</p> <pre><code> IdNum BeginDate Exitdate ------------------------------------------------------------------------- 123 2022-06-13 09:03 2022-06-13 22:12 63...
<p>Here my solution, you will have a Dataframe with Id as idex and booleans for the hours where the employees were here like you've shown in your first example.</p> <pre><code>import pandas as pd #Your initial Dataframe df = pd.DataFrame([[123,&quot;2022-06-13 09:03&quot;, &quot;2022-06-13 22:12&quot;],[633, &quot;202...
counting number of rows in a table that are true between two timedates
python
-1
50
1
72,799,539
72,799,539
1
true
2022-06-29T08:41:19.730Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: counting number of rows in a table that are true between two timedates<p>I've got this table:</p> <pre><code> IdNum BeginDate ...
72,979,951
Filter for rows that start with a number stored in a vector of numbers<p>I would like to filter a data frame by checking to see if a column starts with a number that is also stored in a numeric vector.</p> <p>For example, consider the below data frame, with columns <code>Comment</code>and <code>Comment.Id</code>:</p> <...
<pre><code>df &lt;- structure(list(Comment = c(&quot;This comment&quot;, &quot;That comment&quot;, &quot;Another comment&quot;, &quot;Please comment&quot;, &quot;More comments&quot;, &quot;Many comments&quot;, &quot;Comment again&quot; ), Comment.Id = c(&quot;34_1_1_1&quot;, &quot;24&quot;, &quot;54_1_1&quot;, &quot;2...
Filter for rows that start with a number stored in a vector of numbers
r|dataframe|dplyr|stringr
1
50
1
72,979,996
72,979,996
1
true
2022-07-14T11:44:23.907Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filter for rows that start with a number stored in a vector of numbers<p>I would like to filter a data frame by checking to see if a column starts with a num...
72,773,039
How do I run script with admin perm?<p>im trying coding metin2 bot but it dont work. Because that python script not working with admin permissions. How do i run script with admin perm?</p> <p>I just tried some code blocks. First one:</p> <pre><code>import admin if not admin.isUserAdmin(): admin.runAsAdmin() else: ...
<p>In Windows:</p> <p>Start-&gt;Task Scheduler</p> <p>Action-&gt;Create Task</p> <p>Run whether user is logged on or not</p> <p>Change User or Group</p> <p>And then under <code>Actions</code> point it to your program. This will launch the job as your user you have picked, with those permissions.</p> <p><a href="https:...
How do I run script with admin perm?
python-3.x|windows
0
50
1
72,773,294
72,773,294
1
true
2022-06-27T13:36:33.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I run script with admin perm?<p>im trying coding metin2 bot but it dont work. Because that python script not working with admin permissions. How do i ...
72,820,129
Search discord channels for prefered posting channels<p>I'm trying to search through text channels for preferred channels to post in. Here's my code that works now.</p> <pre><code>@bot.event async def on_guild_join(Guild): channel_names = ['cool-channel', 'awesome-server', 'chatters-be-chatting'] for ch in channel_name...
<p>I'm not sure if I understood you correctly, but if you want to match channel names with keywords you give and then post a message in those channels, a code like this below would do.</p> <p>I made it a <code>@bot.command</code> to test it easily, but I'm sure you can rewrite it to a <code>@bot.event</code> without a ...
Search discord channels for prefered posting channels
python|discord|discord.py
-2
50
1
72,823,161
72,823,161
1
true
2022-06-30T17:55:58.370Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Search discord channels for prefered posting channels<p>I'm trying to search through text channels for preferred channels to post in. Here's my code that wor...
72,859,912
Regex key to match only a line(s)?<p>My issue is that I am trying to write a regex key to find certain line(s). Here is the data</p> <pre><code>| |-UsingDirectiveDecl 0x16de688 &lt;line:58:3, col:24&gt; col:24 Namespace 0x16de588 '__debug' |-UsingDirectiveDecl 0x1e840b8 &lt;simple.cpp:2:1, col:17&gt; col:17 Namespace 0...
<p>Regarding the regex, you are trying to match <code>(?:\d+)?(?:\.?\d*))(?:[eE]([+-]?\d+))?</code> on the places with the hex part, but you can use <code>0x[a-f0-9]{7}</code> instead.</p> <p>If you are matching, you don't need the lookahead <code>(?=\.\d|\d)</code></p> <p>There is also an extra closing bracket <code>]...
Regex key to match only a line(s)?
python|regex
0
50
1
72,860,069
72,860,069
1
true
2022-07-04T16:52:00.677Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex key to match only a line(s)?<p>My issue is that I am trying to write a regex key to find certain line(s). Here is the data</p> <pre><code>| |-UsingDire...
72,811,116
mongoose middleware, show length of array in model<p>I want to get the size of array in the model:</p> <pre class="lang-js prettyprint-override"><code>const UserSchema = mongoose.Schema( { username: { type: String, lowercase: true, required: true }, items: { type: [mongoose.Types.ObjectId], default: [] }, }...
<p>You can use aggregation pipeline for this:</p> <pre><code>ProductModel.aggregate([ { &quot;$lookup&quot;: { &quot;from&quot;: &quot;users&quot;, &quot;localField&quot;: &quot;user&quot;, &quot;foreignField&quot;: &quot;_id&quot;, &quot;as&quot;: &quot;users&quot; } }, { &quo...
mongoose middleware, show length of array in model
node.js|mongodb|mongoose|mongoose-schema|mongoose-populate
0
50
1
72,811,245
72,811,245
1
true
2022-06-30T06:20:54.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mongoose middleware, show length of array in model<p>I want to get the size of array in the model:</p> <pre class="lang-js prettyprint-override"><code>const ...
72,925,700
Paste a table from Excel into Word then transform it<p>I am beginner at coding with VBA. So, although the following code works very well, I am looking for a way to optimize and reduce it.</p> <p>Its objective is to:</p> <p>1- paste a table from Excel into Word without losing Excel format</p> <p>2- process the pasted ta...
<p>For example:</p> <pre><code>Sub TablePasteAndFormat() Application.ScreenUpdating = False With ActiveDocument With Selection .Collapse (wdCollapseStart) With .Range .PasteAndFormat wdFormatOriginalFormatting 'or ' .PasteExcelTable False, False, False With .Tables(1) .AutoFitB...
Paste a table from Excel into Word then transform it
excel|vba|ms-word
0
50
1
72,925,760
72,925,760
1
true
2022-07-10T02:00:21.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Paste a table from Excel into Word then transform it<p>I am beginner at coding with VBA. So, although the following code works very well, I am looking for a ...
72,841,002
How do you import a CSV whose elements are Numpy arrays?<p>Due to using a combination of not entirely compatible software packages, I need to be able to read a CSV file whose elements are stylized as Numpy arrays. An example of such a CSV would be the one below:</p> <p><a href="https://i.stack.imgur.com/izNLn.png" rel=...
<p>You may create an array from these strings dynamically (at run-time):</p> <pre><code>import numpy as np import ast # data represents the string returned by str(genfromtxt(...)) data = '[[\'[4 3 2 1]\' \'[1 1 0 0]\'] [\'[1 3 4 2]\' \'[0 1 1 0]\']]' # remove quotes data = data.replace('\'', '') # insert commas data ...
How do you import a CSV whose elements are Numpy arrays?
python|arrays|numpy
0
50
1
72,841,381
72,841,381
1
true
2022-07-02T17:12:59.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you import a CSV whose elements are Numpy arrays?<p>Due to using a combination of not entirely compatible software packages, I need to be able to read...
73,018,770
Not able to use the keyword 'message' as a parameter in Custom Ansible Module<p>We have a Custom Ansible Module which have been written by us. In that module, we have 4 parameters as module arguments:</p> <ul> <li><code>message_direction</code></li> <li><code>external_request_id</code></li> <li><code>message</code></li...
<p>Using the exact example from <a href="https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#creating-a-module" rel="nofollow noreferrer">Developing modules - Creating a module</a> and <a href="https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#verifying-your...
Not able to use the keyword 'message' as a parameter in Custom Ansible Module
ansible|ansible-2.x
1
50
1
73,020,764
73,020,764
1
true
2022-07-18T07:37:36.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not able to use the keyword 'message' as a parameter in Custom Ansible Module<p>We have a Custom Ansible Module which have been written by us. In that module...
73,005,970
Kotlin filter nested lists<p>I want to filter a list that has episodes of series. The list looks a bit like this:</p> <pre><code>[ { &quot;media&quot;: { &quot;episode_number&quot;: &quot;7&quot; }, &quot;collection&quot;: { &quot;collection_id&quot;: &quot;26464&quot; } }, { &quot...
<p>What you need here is to <strong>group items by</strong> <code>collection.collectionId</code> and then for each group look for an item with <strong>maximum</strong> value of <code>media.episode_number</code>. In Kotlin it can be done almost as it was said above:</p> <pre class="lang-kotlin prettyprint-override"><cod...
Kotlin filter nested lists
kotlin|filter
0
50
2
73,007,709
73,007,709
1
true
2022-07-16T16:37:35.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kotlin filter nested lists<p>I want to filter a list that has episodes of series. The list looks a bit like this:</p> <pre><code>[ { &quot;media&quot;:...
72,813,464
Sorting a 2D array using insertion sort algorithm<p>I have the following code in which I am trying to implement insertion sort but only able to sort the Names but not the numbers. What I should do so it will sort the numbers as well with their names.</p> <pre><code>def insertionsort(searchList): for index in range(1,...
<p>I guess you got your code from <a href="https://stackoverflow.com/a/36864009/15521392">here</a> ?</p> <p>I made some smaller changes to make your code a bit easier to read.</p> <ul> <li><p>First, you can use tuple unpacking, that way it looks cleaner than your multiple lines accessing each position of the list one b...
Sorting a 2D array using insertion sort algorithm
python
0
50
2
72,814,315
72,814,315
1
true
2022-06-30T09:33:48.240Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sorting a 2D array using insertion sort algorithm<p>I have the following code in which I am trying to implement insertion sort but only able to sort the Name...
72,802,168
Correctly abstracting the model from the view in an MVC Design Pattern<h1>Context</h1> <p>I am developing a simple <em>CandyCrush</em> lookalike game in C++ to familiarise myself more with Object Oriented Programming and Design Patterns, namely <strong>MVC</strong>.</p> <p>The general structure of the <em><strong>Model...
<p>Yes I think you may be overthinking things! Adhering to MVC in the most generic sense just means that your data and logic (the model) are independent of the user interface code, which has the view and controller components. Additionally, you could think of individual objects as models, to be rendered in individual v...
Correctly abstracting the model from the view in an MVC Design Pattern
c++|oop|model-view-controller
1
50
1
72,823,464
72,823,464
1
true
2022-06-29T13:21:35.517Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Correctly abstracting the model from the view in an MVC Design Pattern<h1>Context</h1> <p>I am developing a simple <em>CandyCrush</em> lookalike game in C++ ...
72,804,514
Cannot unpack non-iterable numpy.float32 object<p>I am building a line detection program. When I run the following code from <a href="https://www.geeksforgeeks.org/line-detection-python-opencv-houghline-method/" rel="nofollow noreferrer">https://www.geeksforgeeks.org/line-detection-python-opencv-houghline-method/</a>,<...
<p><strong>EDIT:</strong></p> <p>If you read comments in <a href="https://www.geeksforgeeks.org/line-detection-python-opencv-houghline-method/" rel="nofollow noreferrer">your link</a> then you see that this code is for older version</p> <pre class="lang-none prettyprint-override"><code>Devarshi (5 months ago) The abov...
Cannot unpack non-iterable numpy.float32 object
python|numpy|opencv|image-processing
-2
50
1
72,805,765
72,805,765
1
true
2022-06-29T16:01:18.580Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot unpack non-iterable numpy.float32 object<p>I am building a line detection program. When I run the following code from <a href="https://www.geeksforgee...
72,793,500
Wildcard return type in Typescript where objects that implement an interface are returned<p>I have the following interface that I use in an <code>abstract</code> base class:</p> <pre><code>interface MyInterface { field1: string } abstract class BaseClass { // some fields here... abstract serialize(): Array&lt...
<p>It sounds like you just need to intersect <code>MyInterface</code> with the extra fields you want to return. Subclasses can refine their methods return types in this way so long as the return type still conforms to the base class.</p> <pre><code>class Subclass1 extends BaseClass { serialize(): Array&lt;MyInterfac...
Wildcard return type in Typescript where objects that implement an interface are returned
typescript|typescript-generics
2
50
2
72,793,957
72,793,957
1
true
2022-06-28T21:48:31.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Wildcard return type in Typescript where objects that implement an interface are returned<p>I have the following interface that I use in an <code>abstract</c...
72,771,170
MongoDB join 2 tables and get ids on condition<p>We are really new to MongoDB query writing. We have 2 MongoDB tables Supplier1 &amp; Supplier 2. Both have the same _id. But the version number of these objects can be different sometimes. We need to find out _id when the version of 2 collections are different (i.e. Supl...
<p>You can simply use a sub-pipeline in <code>$lookup</code>. Simply <code>$unwind</code> the result array to filter out unwanted result.</p> <pre class="lang-js prettyprint-override"><code>db.Supplier1.aggregate([ { &quot;$lookup&quot;: { &quot;from&quot;: &quot;Supplier2&quot;, &quot;let&quot;: { ...
MongoDB join 2 tables and get ids on condition
mongodb|mongodb-query|aggregation-framework
-1
50
1
72,771,662
72,771,662
1
true
2022-06-27T11:15:20.943Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MongoDB join 2 tables and get ids on condition<p>We are really new to MongoDB query writing. We have 2 MongoDB tables Supplier1 &amp; Supplier 2. Both have t...
72,850,929
Is golang conn.setdeadline for the next operation only or forever?<p>In the code below:</p> <pre><code>conn.SetDeadline(time.Now().Add(time.Minute)) //read/write operation, only once conn.SetDeadline(time.Time{}) //cancel deadline </code></pre> <p>Is the &quot;cancel&quot; operation necessary...
<p>See the comments for the <a href="https://pkg.go.dev/net#Conn" rel="nofollow noreferrer"><code>Conn</code> <code>interface</code></a></p> <blockquote> <p>// A deadline is an absolute time after which I/O operations<br /> // fail instead of blocking. The deadline applies to all future<br /> // and pending I/O, not ju...
Is golang conn.setdeadline for the next operation only or forever?
go
1
50
1
72,852,040
72,852,040
1
true
2022-07-04T01:15:12.027Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is golang conn.setdeadline for the next operation only or forever?<p>In the code below:</p> <pre><code>conn.SetDeadline(time.Now().Add(time.Minute)) //read/...
72,958,885
CSS Border and Circle dynamically on top of each other<p>I am trying to achieve this with my current code. I want the 3 sided border on top to dynamically adjust so that it is always perfectly on top of the circles no matter the size of either. Essentially I want the border position to be relative to the circles so tha...
<p>Here's a sketch of placing div one over another. Using <code>flex</code> properties. The sizes are arbitrary.</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-override"><code>var t = 0; fun...
CSS Border and Circle dynamically on top of each other
javascript|html|jquery|css
1
50
1
72,959,027
72,959,027
1
true
2022-07-12T22:08:27.200Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS Border and Circle dynamically on top of each other<p>I am trying to achieve this with my current code. I want the 3 sided border on top to dynamically ad...
72,852,812
extract value from nested documents from 3x nested array ( mongod 4.0.23)<p>Please, help , I have following document type:</p> <pre><code>{ _id: 1, &quot;_a&quot;: [ { &quot;_aId&quot;: { &quot;CC&quot;: &quot;CA&quot; }, &quot;_p&quot;: [ { &quot;_pId&quot;: { &quot;CC&quot;...
<p><strong>Edit</strong>: rmoved <code>$first</code> to match mongodb version 3.6:</p> <p>One option is:</p> <ol> <li><code>$reduce</code> to <code>res</code> the objects under <code>_a._p.s</code></li> <li>Use <code>$objectToArry</code>, since there are different key names.</li> <li><code>$reduce</code> again to get a...
extract value from nested documents from 3x nested array ( mongod 4.0.23)
mongodb|mongodb-query|aggregation-framework
1
50
1
72,853,066
72,853,066
1
true
2022-07-04T06:58:12.480Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: extract value from nested documents from 3x nested array ( mongod 4.0.23)<p>Please, help , I have following document type:</p> <pre><code>{ _id: 1, &quot;_a&...
72,920,992
Uncaught ReferenceError: handleClick is not defined react native<p>Can anyone please explain to me why when I run this code I got this error : App.js:11 Uncaught ReferenceError: handleClick is not defined.<a href="https://i.stack.imgur.com/Bt6JE.png" rel="nofollow noreferrer">the code in question</a></p> <p>but when I ...
<p>in the first case, you are using a function component and this inside function component is undefined, so when you call the function using this.handleClick() it gives you a reference error.</p> <p>But at the same time in the class component, it works because this refers to the object, which is an instance of the cla...
Uncaught ReferenceError: handleClick is not defined react native
reactjs|react-native|expo
-1
50
2
72,921,039
72,921,039
1
true
2022-07-09T11:30:02.213Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Uncaught ReferenceError: handleClick is not defined react native<p>Can anyone please explain to me why when I run this code I got this error : App.js:11 Unca...
72,834,348
Make generic Lambda with exactly N arguments<p>I want to dynamically create math expressions with lambdas, <a href="https://codereview.stackexchange.com/questions/277794/evaluating-math-terms-as-nested-lambdas-instead-of-expression-tree">as reviewed here</a>.</p> <pre><code>using Func = std::function&lt;double(double)&...
<p>Not sure the standard allows you to manage argument count restriction like that, but you can definitely have an assert if the arg count is in mismatch. E.g.:</p> <pre><code>#include &lt;functional&gt; template &lt;std::size_t, typename T&gt; using alwaysT = T; template &lt;typename FLOAT, typename Seq&gt; stru...
Make generic Lambda with exactly N arguments
c++|lambda|variadic-templates
3
50
1
72,834,516
72,834,516
1
true
2022-07-01T20:29:09.867Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make generic Lambda with exactly N arguments<p>I want to dynamically create math expressions with lambdas, <a href="https://codereview.stackexchange.com/ques...
72,844,579
TypeError: cannot unpack non-iterable int object (Python)<p>I am trying to add <code>(0.5,-0.5)</code> to <code>(i,j)</code> elements in the list <code>I4</code> but there is an error. I present the expected output.</p> <pre><code>I3 = [[(0, 0), (0, 1)], [(0, 0), (1, 0)], [(0, 1), (1, 1)], [(1, 0), (1, 1)]] temp = [] f...
<p>You seems to misunderstand a thing <code>print(&quot;I4 =&quot;,temp)</code>, <code>I4</code> was just ONE element you added to <code>temp</code>, And you heave repeated the mistake later</p> <pre><code>I5 = [(i+0.5, j-0.5) for i, j in I4[h]] # error I5 = [(i+0.5, j-0.5) for i, j in temp[h]] # correct ...
TypeError: cannot unpack non-iterable int object (Python)
python|list
1
50
3
72,844,599
72,844,599
1
true
2022-07-03T07:13:08.607Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeError: cannot unpack non-iterable int object (Python)<p>I am trying to add <code>(0.5,-0.5)</code> to <code>(i,j)</code> elements in the list <code>I4</c...
72,900,379
Split string into array, convert last number to int and subtract, replace original string with new int in Batch file<p>I have a batch file that takes an argument that looks like this: 7.0.5 or maybe 10.34.7.2</p> <p>I want to take the last digit of the string, subtract 1 from it, then re-save the original string replac...
<p>Treat it like a file name and it becomes trivial. Your last token would then be the extension, available as <code>%%~xa</code>, the part before would be the &quot;file name&quot;, available as <code>%%~na</code>:</p> <pre><code>@echo off setlocal set tag=%~1 echo input: %tag% set &quot;last=%~x1&quot; &am...
Split string into array, convert last number to int and subtract, replace original string with new int in Batch file
batch-file|cmd
0
50
2
72,900,606
72,900,606
1
true
2022-07-07T15:17:44.553Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split string into array, convert last number to int and subtract, replace original string with new int in Batch file<p>I have a batch file that takes an argu...
72,872,300
C# Specify generic type parameter once and use it throughout class<p>Let's say I have a class <code>ClassWhichDoesThings</code> which makes various calls to methods such as</p> <pre><code>DoSomething&lt;TheTypeIWantToSpecifyOnce&gt;(); DoAnotherThing&lt;TheTypeIWantToSpecifyOnce&gt;(); AndAnother&lt;TheTypeIWantToSpeci...
<p>Depended on the case you can create internal generic method or class and use it, making the class itself basically a wrapper:</p> <pre class="lang-cs prettyprint-override"><code>public class SomeClass { private readonly int Data = 1; private Generic&lt;ActualType&gt; Instance; public SomeClass() { ...
C# Specify generic type parameter once and use it throughout class
c#|generics
2
50
2
72,872,505
72,872,505
1
true
2022-07-05T15:51:57.970Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# Specify generic type parameter once and use it throughout class<p>Let's say I have a class <code>ClassWhichDoesThings</code> which makes various calls to ...
72,998,051
Handle java.lang.NullPointerException in scala when accessing nested fields<p>I have a use case where</p> <pre><code> name = Person.getFirstSister().getname() </code></pre> <p><code>Person.getSister().getname()</code> gives <code>java.lang.NullPointerException</code> since <code>Person.getSister()</code> is java nul...
<p>Checking for <code>null</code> is the Java way to go. Scala offers a much more streamlined set of operations to avoid doing null checks manually.</p> <p>Naturally, <code>getSister</code> should result in an <code>Option[Sister]</code>, the argument being that not every person has a sister.</p> <p>Going on the same i...
Handle java.lang.NullPointerException in scala when accessing nested fields
java|scala
-1
50
1
73,000,686
73,000,686
1
true
2022-07-15T18:01:31.027Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Handle java.lang.NullPointerException in scala when accessing nested fields<p>I have a use case where</p> <pre><code> name = Person.getFirstSister().getna...
72,993,413
How to create Tkinter Tab frame with different (dynamic) heights<p>I am trying to create Tabs in python tkinter. I would like the Tab's height to size dynamically based on its content. Below is a sample of my code</p> <pre><code>from tkinter import * from tkinter import ttk root = Tk() root.title('Frames') root.geomet...
<p>You can bind a function to the virtual event <code>&lt;&lt;NotebookTabChanged&gt;&gt;</code> to adapt the height of the notebook to the currently selected tab using the <code>height</code> option of the notebook:</p> <pre><code>def on_change_tab(event): tab = event.widget.nametowidget(event.widget.select()) # g...
How to create Tkinter Tab frame with different (dynamic) heights
python|tkinter|tabs
0
50
1
72,993,705
72,993,705
1
true
2022-07-15T11:39:59.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create Tkinter Tab frame with different (dynamic) heights<p>I am trying to create Tabs in python tkinter. I would like the Tab's height to size dynami...
72,943,149
git not showing added files to staging area or committing files to repo<p>**edited</p> <p>I'm trying to commit a file to my repo after making some changes- I initially uploaded the files to the repo directly through github.</p> <pre><code>C:\Users\me\repos\grow-my-day&gt;git add popup.js C:\Users\me\repos\grow-my-day&...
<p>For both messages, a <code>git status</code> would be helpful:</p> <ul> <li>one for realizing there is nothing to add and commit</li> <li>one for checking your current branch, which might be <code>main</code> by default, and no longer <code>master</code> (since <a href="https://github.blog/changelog/2020-08-26-set-t...
git not showing added files to staging area or committing files to repo
git|github
2
50
1
72,943,343
72,943,343
1
true
2022-07-11T18:35:40.640Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: git not showing added files to staging area or committing files to repo<p>**edited</p> <p>I'm trying to commit a file to my repo after making some changes- I...
72,964,344
Upgrading the react router version, I got 2 in my project<p>I am upgrading the react router version for one of my friend project</p> <p>The thing is there are 2 react-router-dom. Do I need to remove both of them or just remove 1 of them is fine?</p> <pre><code>{ &quot;name&quot;: &quot;root&quot;, &quot;private&quo...
<p>You don't have two of the same NPM package installed, <code>@types/react-router-dom</code> is a different package than <code>react-router-dom</code>. The latter is the actual <code>react-router-dom</code> dependency while the former is the typescript definitions for it as a dev dependency. That said, you should try ...
Upgrading the react router version, I got 2 in my project
reactjs|react-router
1
50
2
72,970,215
72,970,215
1
true
2022-07-13T09:57:24.020Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Upgrading the react router version, I got 2 in my project<p>I am upgrading the react router version for one of my friend project</p> <p>The thing is there ar...
72,933,878
How to insert data from an Autoincremented table in sqlite3<p>I've been creating a database and started to edit a table whereas I made the ID auto increment.<br /> While configuring it I came up with this code:</p> <pre><code>import sqlite3 payrollConnect = sqlite3.connect(&quot;payrollDatabase.db&quot;) pC = payrollCo...
<p>For columns with <code>Auto Increment</code> property you don't need to supply the values.</p> <p>Try this.</p> <pre><code>pC.executemany(&quot;&quot;&quot;INSERT INTO LoanDB('GPL', 'SLMV', 'MPL GSIS', 'CALAMITY', 'OPTL INST', 'S/L CONSOLOAN', 'UOLI LOAN', 'PL REG REAL', 'EDUC ASST', 'MPL PAGIBIG', 'CPL', 'GSIS EMER...
How to insert data from an Autoincremented table in sqlite3
python|sqlite
0
50
1
72,933,924
72,933,924
1
true
2022-07-11T04:55:56.803Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to insert data from an Autoincremented table in sqlite3<p>I've been creating a database and started to edit a table whereas I made the ID auto increment....
72,863,466
Hibernate: How to distinguish two uni-directional relationship and one bi-directional relationship?<p>in <a href="https://stackoverflow.com/a/21068644/9754554">this answer</a>, the author said:</p> <blockquote> <p>Take an example of two entities mapped without declaring a owning side:</p> </blockquote> <pre><code>@Enti...
<p>(1) No ideas why the author said it is not a bi-directional relationship.</p> <p>From the hibernate documentation , it also mentions that <a href="https://docs.jboss.org/hibernate/orm/6.1/userguide/html_single/Hibernate_User_Guide.html#associations-one-to-many-bidirectional" rel="nofollow noreferrer">a similar mapp...
Hibernate: How to distinguish two uni-directional relationship and one bi-directional relationship?
java|database|hibernate|jpa|orm
0
50
1
72,863,642
72,863,642
1
true
2022-07-05T02:34:03.717Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hibernate: How to distinguish two uni-directional relationship and one bi-directional relationship?<p>in <a href="https://stackoverflow.com/a/21068644/975455...
73,005,773
Javascript canvas game enemys: solution not found<p>So, i am just making a javascript canvas only game. I know game engines like Godot but its just more like a challenge for me, thats why i choose javascript. The first thing i did was coding the enemies.</p> <p><div class="snippet" data-lang="js" data-hide="false" data...
<p>Using a <code>class</code> for this is the best option. A <code>class</code> allows you to create multiple instances of the same object while allowing each instance to be individually controlled.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-...
Javascript canvas game enemys: solution not found
javascript|html|canvas|html5-canvas|game-development
1
50
1
73,006,444
73,006,444
1
true
2022-07-16T16:10:09.463Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript canvas game enemys: solution not found<p>So, i am just making a javascript canvas only game. I know game engines like Godot but its just more like...
72,388,010
Python expand nested json<p>I need to expand the json below:</p> <pre><code>data = [ 'elements': { &quot;totalPageStatistics&quot;:{ &quot;clicks&quot;:{ &quot;mobileCustomButtonClickCounts&quot;:[ { &quot;customButtonType&quot;:&quot;VIEW_WEBSITE&quot;, ...
<p>I've managed to solve my issue:</p> <ol> <li>explode the 2 columns</li> <li>concatenate with the main df</li> <li>drop the original columns</li> </ol> <pre><code>flat_data = json_normalize(data['elements']) dd = flat_data.explode(['totalPageStatistics.clicks.mobileCustomButtonClickCounts', 'totalPageStatistics.click...
Python expand nested json
python|json|nested
0
50
1
72,395,638
72,395,638
1
true
2022-05-26T07:04:37.727Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python expand nested json<p>I need to expand the json below:</p> <pre><code>data = [ 'elements': { &quot;totalPageStatistics&quot;:{ &quot;...
72,397,463
Regex to match all subpaths except a list but not the base path<p>I'm trying to write a regular expression to match all subpaths under a given path with a handful of exceptions.</p> <p><strong>The regex:</strong></p> <p><code>^\/my-page\/(?!.*foo|bar|baz).*</code></p> <p><strong>Expected behavior:</strong></p> <p><code...
<p>You can use</p> <pre class="lang-none prettyprint-override"><code>^\/my-page\/(?!.*(?:foo|bar|baz)).+ </code></pre> <p>See the <a href="https://regex101.com/r/t7tKWl/1" rel="nofollow noreferrer">regex demo</a>.</p> <p><em>Details</em></p> <ul> <li><code>^</code> - start of string</li> <li><code>\/my-page\/</code> - ...
Regex to match all subpaths except a list but not the base path
regex
1
50
1
72,397,536
72,397,536
1
true
2022-05-26T20:05:39.113Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex to match all subpaths except a list but not the base path<p>I'm trying to write a regular expression to match all subpaths under a given path with a ha...
72,389,632
Filter IEnumerable according to cell in table to show dynamic table<p>I have a table in my front end that has 3 columns and 3 rows.</p> <p>I want to make the cells clickable and for this to show below a table with filters according to what they clicked.</p> <p>I have a list to which I would like to apply the filters ba...
<p>You can make the table cell value as an anchor link and use <code>asp-route-{value}</code> to pass the parameter value.</p> <p>Here is a simple demo:</p> <pre><code>@page @model IndexModel &lt;table class=&quot;table&quot;&gt; &lt;thead&gt; &lt;tr&gt;Col1&lt;/tr&gt; &lt;tr&gt;Col2&lt;/tr&gt; ...
Filter IEnumerable according to cell in table to show dynamic table
c#|asp.net-core|razor-pages
0
50
1
72,401,187
72,401,187
1
true
2022-05-26T09:28:15.257Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filter IEnumerable according to cell in table to show dynamic table<p>I have a table in my front end that has 3 columns and 3 rows.</p> <p>I want to make the...
72,396,191
How to make a player, without an interface, but with the ability to rewind in python?<p>I have found many ways to interact with music in python, but in all there are only a few commands, start, stop, volume change, but I can't find a banal rewind.</p> <p>The code at the moment:</p> <pre><code>import vlc import time imp...
<p>Use Pygame's mixer music. It is not exactly a rewind, but it allows you to start playing the audio from a certain time. Documentation <a href="https://www.pygame.org/docs/ref/music.html" rel="nofollow noreferrer">here</a>.</p>
How to make a player, without an interface, but with the ability to rewind in python?
python|audio-player
2
50
1
72,401,903
72,401,903
1
true
2022-05-26T18:04:36.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a player, without an interface, but with the ability to rewind in python?<p>I have found many ways to interact with music in python, but in all t...
72,367,620
Is it a good idea to use useRef to prevent rerendering on every input change?<p>I joined a Frontend bootcamp and now I have to create a registration form as a part of my first project. I want to use the best practices to be... you know... one of the best students to get hired afterwards.</p> <p>The registration form ha...
<p>You can use ref together with a formData.</p> <pre><code>const handleSubmit = (event) =&gt; { event.preventDefault() const form = new FormData(formRef.current) const formFields = Object.fromEntries(form) Object.entries(formFields).forEach(([fieldName, value]) =&gt; // do something // get the value of ema...
Is it a good idea to use useRef to prevent rerendering on every input change?
reactjs
2
50
1
72,367,709
72,367,709
1
true
2022-05-24T18:13:39.230Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it a good idea to use useRef to prevent rerendering on every input change?<p>I joined a Frontend bootcamp and now I have to create a registration form as ...
72,371,348
Comparing different rows inside a data frame and removing unnecessary rows: df.apply and index<p>I am comparing values in different rows within a data frame. If a row from the data frame matches any other row(s) by at least 75%, I will keep the original one and remove the others.</p> <p>The original data frame looks li...
<p>I suggest using a comparison df:</p> <pre><code>df_compare = pd.DataFrame( df['Text'].apply(lambda row: max([fuzz.partial_ratio(row, x), i] for i, x in enumerate(df['Text']) if x != row) ).to_list(), columns=['ratio', 'closest']...
Comparing different rows inside a data frame and removing unnecessary rows: df.apply and index
python|pandas|dataframe|compare
0
50
1
72,373,506
72,373,506
1
true
2022-05-25T02:22:29.340Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Comparing different rows inside a data frame and removing unnecessary rows: df.apply and index<p>I am comparing values in different rows within a data frame....
72,304,346
Why doesn't lambda function accept parameter in bond with sorted()<pre><code>Students = ((&quot;Squidward&quot;, &quot;F&quot;, 60), (&quot;Sandy&quot;, &quot;A&quot;, 33), (&quot;Patrick&quot;,&quot;D&quot;, 36), (&quot;Spongebob&quot;,&quot;B&quot;, 20), (&quot;Mr.Krabs...
<p>The <code>key</code> parameter of <code>sorted</code> is a function which will be applied to the elements in order to compare them to each other. Therefore, we only pass the function itself without calling it.</p> <p>I suggest you read the documentation first next time :) <a href="https://docs.python.org/3/library/f...
Why doesn't lambda function accept parameter in bond with sorted()
python|sorting|lambda
-3
50
2
72,304,452
72,304,452
1
true
2022-05-19T12:13:41.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why doesn't lambda function accept parameter in bond with sorted()<pre><code>Students = ((&quot;Squidward&quot;, &quot;F&quot;, 60), (&quot;Sandy...
72,282,059
Get data from a request to the main thread<p>I'm very new to Objective C and mobile development. I want to perform a get and use the response outside this session, can anyone tell me how I can do this?</p> <p>Now i got the error &quot;Use of undeclared identifier 'username'</p> <pre><code> NSMutableURLRequest *reque...
<p>The <code>dataTaskWithRequest</code> method runs <em>asynchronously,</em> i.e., later. You can’t just reference the variables outside of the block.</p> <p>The typical solution is to provide a block parameter to your method that performs this request, a completion handler, and call the completion handler inside the a...
Get data from a request to the main thread
ios|objective-c
1
50
1
72,282,315
72,282,315
1
true
2022-05-18T00:36:54.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get data from a request to the main thread<p>I'm very new to Objective C and mobile development. I want to perform a get and use the response outside this se...
72,339,837
Fastest Double Integration Method<p>I am using scipy's double integration <code>dblquad</code> and I am trying to increase the speed. I have checked the solutions proposed online, but couldn't get them work. To ease the question, I have prepared the comparison below. What I am doing wrong or what can I do to improve th...
<p>The main issue is that you are timing the <strong>compilation time</strong> of the Numba function. Indeed, when <code>bb_numbanjit</code> is called, the <code>@njit</code> decorator tell to Numba to declare a <em>lazily-compiled function</em> which is compiled when the <em>first call</em> is performed, so in <code>i...
Fastest Double Integration Method
python|scipy|integration|numba
1
50
1
72,340,080
72,340,080
1
true
2022-05-22T17:26:42.763Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fastest Double Integration Method<p>I am using scipy's double integration <code>dblquad</code> and I am trying to increase the speed. I have checked the solu...
72,281,849
Book section in the ref.bib file<p>I am looking for the solution on how I must describe the book section in the ref.bib file so that in my Markdown pdf file the References section contained this, for example:</p> <blockquote> <p>Early B.E. (2021). Making sanctions work: promoting compliance, punishing violations, and d...
<p>From: <a href="https://bookdown.org/yihui/rmarkdown-cookbook/bibliography.html" rel="nofollow noreferrer">https://bookdown.org/yihui/rmarkdown-cookbook/bibliography.html</a></p> <blockquote> <p>Items can be cited directly within the documentation using the syntax @key where key is the citation key in the first line ...
Book section in the ref.bib file
r-markdown
1
50
1
72,282,020
72,282,020
1
true
2022-05-17T23:51:19.930Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Book section in the ref.bib file<p>I am looking for the solution on how I must describe the book section in the ref.bib file so that in my Markdown pdf file ...
72,374,775
C# Delegate use with Generic Method to return Task<T><p>I' m missing something here. I 'll be as clear as I can be.</p> <p>let's say I have this method :</p> <pre><code> public Task&lt;CustomClass&gt; TestMethod(string one, string two, int three) { throw new NotImplementedException(); } <...
<p>as the error suggests your method is not compatible with the delegate. The delegate requires <code>object[]</code> as a parameter your method has 3 explicit parameters <code>string,string,int</code> this is not compatible.</p> <p>what you can do if you really need this is you can create a set of invoke methods that ...
C# Delegate use with Generic Method to return Task<T>
c#|asynchronous|generics|delegates|task
0
50
1
72,374,952
72,374,952
1
true
2022-05-25T09:06:51.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# Delegate use with Generic Method to return Task<T><p>I' m missing something here. I 'll be as clear as I can be.</p> <p>let's say I have this method :</p>...
72,357,895
React context provider updates state after context consumer renders<p>I am trying to implement Protected Routes in my app. I am using cookie-based session authentication. The issue is: Whenever I try to access a protected page for the first time, the <code>RequireAuth</code> component has the <code>isAuthenticated</cod...
<p>That's because that <code>useEffect</code> in <code>ProvideAuth</code> is as any <code>useEffect</code> an asynchronous task, which means the component and its children may render before its callback gets executed.</p> <p>A solution is to set up a loading state in <code>ProvideAuth</code>, called for example <code>i...
React context provider updates state after context consumer renders
javascript|reactjs
1
50
2
72,358,059
72,358,059
1
true
2022-05-24T06:06:12.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React context provider updates state after context consumer renders<p>I am trying to implement Protected Routes in my app. I am using cookie-based session au...
72,399,013
How to create a table in R that displays the percentage of observations per year equal to a certain value?<p>I'm working with a time series dataset on levels of opposition in authoritarian regimes. I've included a sample of the data below. I would like to produce a table that displays the percentage of countries per ye...
<p>Trying using <code>dplyr</code> from <code>tidyverse</code> to group your data by year, then summarize it (aggregate) by taking the sum of rows where <code>v2psoppaut_ord</code> is equal to 1 divided by the total number of rows within that group (e.g. year) with the <code>n()</code> function. Save that to a new df f...
How to create a table in R that displays the percentage of observations per year equal to a certain value?
r|dplyr|group
0
50
2
72,399,295
72,399,295
1
true
2022-05-26T23:27:15.490Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a table in R that displays the percentage of observations per year equal to a certain value?<p>I'm working with a time series dataset on levels...
72,243,905
Move a shape inside a list of lists<p>I have the following list of lists representing a matrix:</p> <pre><code>space = [ [0, 1, 1, 0], [0, 1, 0, 0], [0, 1, 0, 0], [0, 0, 0, 0], ] </code></pre> <p>The number 1s represent an upside down L (like a gamma, &quot;Γ&quot;). How can I make this &quot;object&quot; move to the ...
<p>Here's how I'd suggest doing something like this:</p> <p>Calculate all the indices for each gamma shape in the matrix, kept stored in a dictionary with the each corner index tuple as the dictionary keys, then whenever the corner moves, figure out the indices that should be 1s, and assign to a copy of a matrix of zer...
Move a shape inside a list of lists
python|list|nested-lists
0
50
3
72,244,020
72,244,020
1
true
2022-05-14T21:14:07.513Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Move a shape inside a list of lists<p>I have the following list of lists representing a matrix:</p> <pre><code>space = [ [0, 1, 1, 0], [0, 1, 0, 0], [0, 1, ...
72,260,608
How to resolve this syntax error in a postgresql sql query to update multiple rows in a single column<p>Given the <code>tableA</code> in a Postgres database, I need to update multiple rows in the field <code>column_a</code>:</p> <pre><code>UPDATE tableA SET column_a = CASE WHEN column_a = 'conserve' THEN column_a = '...
<p>You can do it with one single <code>CASE</code> statement:</p> <pre><code>UPDATE tableA SET column_a = CASE WHEN column_a = 'conserve' THEN 'fixed' WHEN column_a = 'balance' THEN 'moderate' WHEN column_a = 'balance growth' THEN 'moderate growth' ...
How to resolve this syntax error in a postgresql sql query to update multiple rows in a single column
sql|postgresql|sql-update
-1
50
1
72,260,718
72,260,718
1
true
2022-05-16T14:12:54.640Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to resolve this syntax error in a postgresql sql query to update multiple rows in a single column<p>Given the <code>tableA</code> in a Postgres database,...
72,350,868
How to add special/non-word character in defined groups?<p>I have a regex which gives me separate groups of string.</p> <p>old regex</p> <pre><code>const regex = /^(.*?)((?:\d{1,3}(?:,\d{1,3})*|\d+)(?:\.\d{1,5})?)(\D.*)?$/g; </code></pre> <p>new regex I wrote but not sure if it's right</p> <pre><code>const regex = /^(....
<p>You could make the pattern a bit more specific and then allow / disallow what you want to capture.</p> <p>You could use 3 optional capture groups that do not have overlapping matches, and use a negative lookahead do not match an empty string.</p> <pre><code>^(?!$)(\$?[^\d\n-]*)(-?(?:\d{1,3}(?:,\d{3})*(?:\.\d{1,5})?|...
How to add special/non-word character in defined groups?
javascript|regex
0
50
1
72,352,646
72,352,646
1
true
2022-05-23T15:10:20.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add special/non-word character in defined groups?<p>I have a regex which gives me separate groups of string.</p> <p>old regex</p> <pre><code>const reg...
72,368,751
How to make copies of Game objects?<p>What I am trying to do in my game is when the ball destroy box its makes random number for spawning different power ups I did random chanses but I don't know how to spawn power up icon on place of destroyed block. And when its spawned its just floating down and yiu need to pick him...
<p>So if I understand you correctly you want just to <a href="https://docs.unity3d.com/ScriptReference/Object.Instantiate.html" rel="nofollow noreferrer">Instantiate</a> object.</p> <p>To create a new GameObject on the scene you can follow these steps:</p> <ol> <li><p>Create a Prefab of the GameObject that you want to ...
How to make copies of Game objects?
c#|visual-studio|unity3d|clone|c#-2.0
0
50
1
72,369,408
72,369,408
1
true
2022-05-24T19:53:12.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make copies of Game objects?<p>What I am trying to do in my game is when the ball destroy box its makes random number for spawning different power ups...
72,364,367
How to add a dictionary to .json list written in file<p>I am trying to add a .json dictionary to the <code>&quot;Steps&quot;</code> list that's written in another file.</p> <pre><code>{ &quot;UPDATED AFTER IMPORT&quot;: { &quot;ID&quot; : &quot;UPDATED AFTER IMPORT&quot;, &quot;Name&quot; : &quot;...
<p>You're trying to use your file reference as a dict, this cannot work. Something along these lines might be closer to what you are looking for:</p> <pre class="lang-py prettyprint-override"><code>with open (stepjson, 'r+', encoding = 'utf-8') as jsonfile: #open step template data = json.load(jsonfile) data[&quot;...
How to add a dictionary to .json list written in file
python|json
-2
50
1
72,364,506
72,364,506
1
true
2022-05-24T14:04:28.703Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add a dictionary to .json list written in file<p>I am trying to add a .json dictionary to the <code>&quot;Steps&quot;</code> list that's written in an...
72,367,488
Remove multiple children from DOM (JS)<p>I am trying to remove certain children from DOM by iterating through them. I have a table, and I am looping through the children and removing some like this:</p> <pre class="lang-js prettyprint-override"><code>for (const row of table.children) { const testRow = row.children[2]...
<p><code>table.children</code> is an <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection" rel="nofollow noreferrer">HTMLCollection</a>; it gets updated as you change the document. You can convert it to a normal array so that changes to the DOM won't affect the contents that you're iterating through...
Remove multiple children from DOM (JS)
javascript|dom|iterator
1
50
4
72,368,492
72,368,492
1
true
2022-05-24T18:02:31.740Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove multiple children from DOM (JS)<p>I am trying to remove certain children from DOM by iterating through them. I have a table, and I am looping through ...
72,355,137
Grouping a set of numbers that reoccur in a pandas DataFrame<p>Say I have the following dataframe</p> <pre><code>holder 0 1 2 0 1 2 0 1 0 1 2 </code></pre> <p>I want to be able to group each set of numbers that come in starting at 0, ends at the max value, assign it a value for that group. So</p> <pre><code>holder gro...
<p>Assuming holder is monotonically nondecreasing until another 0 occurs, you can identify the zeroes and create groups by taking the cumulative sum.</p> <pre class="lang-py prettyprint-override"><code>df = pd.DataFrame({'holder': [0, 1, 2, 0, 1, 2, 0, 1, 0, 1, 2]}) # identify 0s and create groups df['group'] = df['hol...
Grouping a set of numbers that reoccur in a pandas DataFrame
python|pandas
1
50
2
72,355,218
72,355,218
1
true
2022-05-23T21:48:54.217Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Grouping a set of numbers that reoccur in a pandas DataFrame<p>Say I have the following dataframe</p> <pre><code>holder 0 1 2 0 1 2 0 1 0 1 2 </code></pre> <...
72,363,180
How to insert new rows for each foreign key from a table<p>I want to make a query to add for each user all the id_job, id_role pairs from the user with id 0 (id_user, default user). Is it possible in mysql?</p> <p><strong>user_role</strong> table</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> ...
<pre><code>insert into user_role(id_user, id_job, id_role) with cte_0 as(select id_user , id_job , id_role from user_role where id_user = 0) select distinct ur.id_user , cte_0.id_job , cte_0.id_role from user_role ur...
How to insert new rows for each foreign key from a table
mysql|sql|database|exists
0
50
1
72,363,337
72,363,337
1
true
2022-05-24T12:48:01.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to insert new rows for each foreign key from a table<p>I want to make a query to add for each user all the id_job, id_role pairs from the user with id 0 ...
72,252,698
How to recursively objectify a string<p>While trying to become more comfortable with recursive functions, I attempted to write a function that takes a dot-separated string and converts that into an object. So, given the following string: <code>user.first.name.robert</code> this function should return the following obje...
<p>You are almost there. However, if your helper accepts an object but also returns it, be consistent in your recursive call</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-override"><code>fun...
How to recursively objectify a string
javascript|recursion
2
50
2
72,252,811
72,252,811
1
true
2022-05-15T22:44:55.023Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to recursively objectify a string<p>While trying to become more comfortable with recursive functions, I attempted to write a function that takes a dot-se...
72,355,219
Create a generic method with generic signature<p>i have some redundant code that i would like to remove, my goal would be to create a method of this kind:</p> <pre><code>private GenericClass myMethod(GenericClass genericClass){ genericClass.getTipe(); //tipe1 or tipe2 genericClass.setValue(&quot;foo&quot;); ...
<p>Create a generic abstract type; either a super class or an interface:</p> <pre><code>public interface GenericClass&lt;T&gt; { public T getTipe(); public void setValue(String s); public void setValue2(String s); } </code></pre> <p>Have your implementation classes implement it:</p> <pre><code>public class ...
Create a generic method with generic signature
java|spring-boot
0
50
2
72,355,394
72,355,394
1
true
2022-05-23T22:01:17.213Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a generic method with generic signature<p>i have some redundant code that i would like to remove, my goal would be to create a method of this kind:</p...
72,351,917
OpenMP. Parallelization of two consecutive cycles<p>I am studying OpenMP and have written an implementation of shaker sorting. There are 2 consecutive cycles here, and in order for them to be called sequentially, I added blockers in the form of omp_init_lock, omp_destroy_lock, but still the result is incorrect. Please ...
<p>You seem to have several misconceptions about how OpenMP works.</p> <ol> <li>Two parallel sections don't execute in parallel. This is fork-join parallelism. The parallel section itself is executed by multiple threads which then join back up at the end of the parallel section.</li> </ol> <p>Your code looks like you e...
OpenMP. Parallelization of two consecutive cycles
c++|multithreading|concurrency|parallel-processing|openmp
0
50
2
72,354,444
72,354,444
1
true
2022-05-23T16:29:58.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OpenMP. Parallelization of two consecutive cycles<p>I am studying OpenMP and have written an implementation of shaker sorting. There are 2 consecutive cycles...
72,387,887
how to get last id after insert db in php<p>here I save data to the database with multiple rows, I want to retrieve each last id per row, how do I do that?</p> <p>ex : print_r result when input data.</p> <pre><code>Array ( [0] =&gt; Array ( [name] =&gt; metode 11 [description] =&gt; ...
<p>Why not insert it row by row instead of a batch? Build a dictionary from each insert to pair it back later on.</p> <pre><code>$data = array(); $numrow = 1; foreach ($sheet as $row) { if ($numrow &gt; 1) { array_push($data, array( 'name' =&gt; $row['A'], 'desc...
how to get last id after insert db in php
php|arrays|codeigniter|codeigniter-3
0
50
2
72,388,138
72,388,138
1
true
2022-05-26T06:53:44.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to get last id after insert db in php<p>here I save data to the database with multiple rows, I want to retrieve each last id per row, how do I do that?</...
72,349,627
How to use SQL to find specific names or words in a database?<p>I am working with a database of data from Reddit. I want to find the name and description of all subreddits where the name starts with &quot;covid&quot; or &quot;corona&quot; and the description contains &quot;covid&quot; anywhere. I then want to output a ...
<p>It looks like you need to adjust the column names that you're selecting instead of <code>subreddit AS x</code> twice. I'm not sure if you even have a column named <code>subreddit</code> or not, but that also appears to be the table name, which is confusing.</p> <p>Then you can adjust the logic in the <code>WHERE</co...
How to use SQL to find specific names or words in a database?
mysql|sql
0
50
1
72,349,760
72,349,760
1
true
2022-05-23T13:44:03.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use SQL to find specific names or words in a database?<p>I am working with a database of data from Reddit. I want to find the name and description of ...
72,266,063
If a player doesn't own a gamepass, then prompt it via ScreenGUI not working?<p>I'm trying to make a localscript for a <strong>TextButton</strong> so that when somebody clicks on it, the script <strong>checks if they have the gamepass</strong>. If they do, it will do a multitude of other things. <strong>But</strong>, i...
<p>You've made a simple mistake of calling <a href="https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/PromptGamePassPurchase" rel="nofollow noreferrer">PromptGamePassPurchase(player, gamePassId)</a> the same way as <a href="https://developer.roblox.com/en-us/api-reference/function/Marketplace...
If a player doesn't own a gamepass, then prompt it via ScreenGUI not working?
lua|roblox
0
50
1
72,266,809
72,266,809
1
true
2022-05-16T21:57:35.837Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If a player doesn't own a gamepass, then prompt it via ScreenGUI not working?<p>I'm trying to make a localscript for a <strong>TextButton</strong> so that wh...
72,270,329
Is it possible to calculate the effective shift time based on a start/end date and pauses in oracle sql<p>I have an table in Oracle</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>shift_id</th> <th>timestamp_(oracle)</th> <th>type_</th> </tr> </thead> <tbody> <tr> <td>00000001</td> <td>17/0...
<p>You can use LAG window function to calculate the time differencea and thn SUM it to get the total amount -</p> <pre><code>CALC AS (SELECT d.*, EXTRACT(DAY FROM timestamp_oracle - LAG(timestamp_oracle) OVER(PARTITION BY shift_id ORDER BY timestamp_oracle)) * 24 * 60 + EXTRACT(HOUR FROM...
Is it possible to calculate the effective shift time based on a start/end date and pauses in oracle sql
sql|oracle|group-by|sum
1
50
2
72,270,829
72,270,829
1
true
2022-05-17T08:07:37.047Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to calculate the effective shift time based on a start/end date and pauses in oracle sql<p>I have an table in Oracle</p> <div class="s-table-c...
72,304,309
Unable to call a method that is declared in one class from another singleton class<p>As the title says I'm trying to access a method that is declared in one class (Post) from another class (Comments) which is following a singleton pattern. Post class is a service class which has some methods to make API calls. So I nee...
<p>If You want to send two http request in parallel then get their values You should use combineLatest rxjs operator. Your post service will be like this:</p> <pre><code>getPost(id: string) { $postDataHttpRequest = this.http.get(`posts/${id}`); $commentsDataHttpRequest = this.http.get(`posts/${id}/comments`); ret...
Unable to call a method that is declared in one class from another singleton class
javascript|angular
0
50
2
72,305,831
72,305,831
1
true
2022-05-19T12:10:58.177Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to call a method that is declared in one class from another singleton class<p>As the title says I'm trying to access a method that is declared in one ...
72,239,930
Cast Complex JSON Dart<p>the dart code below allows you to decode a json that comes from a backend inside resultValue, I have the response of the rest call with the json shown below, when I go to create the list with the values I have the following error, to what is due? how do i fix it?</p> <p><a href="https://gist.gi...
<p>You forgot to specify <code>jsonObject</code> before the square brackets.</p> <pre><code>var urlmod = await Storage.leggi(&quot;URL&quot;) + &quot;/services/rest/v3/processes/PreventiveMaint/instances&quot;; final resultValue = await apiRequest(Uri.parse(urlmod), {}, UrlRequest.GET, true); Map&lt;String, dyn...
Cast Complex JSON Dart
json|flutter|dart|flutter-layout
0
50
1
72,240,377
72,240,377
2
true
2022-05-14T11:53:20.493Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cast Complex JSON Dart<p>the dart code below allows you to decode a json that comes from a backend inside resultValue, I have the response of the rest call w...
72,250,679
java type generic: why Function<? super E, ? extends F> is more preferred than Function<E, F>?<p>There is class called Foo as following:</p> <pre><code>public class Foo&lt;E&gt; { private List&lt;E&gt; ls; public Foo(List&lt;E&gt; ls) { this.ls = ls; } public void add(E l) { this.ls.a...
<p>It's a bad idea to try to reason about generics with final classes like String and Integer.</p> <p>Try a hierarchy like A &gt; B &gt; C</p> <pre><code>class A {} class B extends A {} class C extends B {} </code></pre> <p>Then an example like</p> <pre><code>Foo&lt;B&gt; foo1 = new Foo&lt;&gt;(new B()); Function&lt;A,...
java type generic: why Function<? super E, ? extends F> is more preferred than Function<E, F>?
java|generics
1
50
1
72,251,808
72,251,808
2
true
2022-05-15T17:36:13.750Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: java type generic: why Function<? super E, ? extends F> is more preferred than Function<E, F>?<p>There is class called Foo as following:</p> <pre><code>publi...
72,255,476
How to get today's date as quarterly divided<p>Today's date will be given and</p> <p>January, April, July, October = 1</p> <p>February, May, August, November = 2</p> <p>March, June, September, December = 3</p> <p>should be printed. Example: december is 3rd month of quarter so answer will be 3. Is there any better solut...
<pre><code>public int getValue(int month) { return month % 3 == 0 ? 3 : month % 3; } </code></pre>
How to get today's date as quarterly divided
java|localdate
0
50
1
72,255,697
72,255,697
2
true
2022-05-16T07:22:50.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get today's date as quarterly divided<p>Today's date will be given and</p> <p>January, April, July, October = 1</p> <p>February, May, August, November...
72,264,656
How to sequentially send requests to the server?<p>I have a List, and I need to send each element of this List to the server sequentially. And if the answer is with an error, then do not continue sending, but display an error. I am trying to use</p> <pre><code>await Future.wait([]); </code></pre> <p>but I do not quite ...
<p>This seems to be what you're looking for:</p> <pre><code> for (var element in state.revisionFill) { var successOrFail = await ContainerExpire.call(ContainerExpireParams(token: token, entity: element.entity)); if (successOrFail.hasFailed()) { //add code for some possible error handling break; ...
How to sequentially send requests to the server?
flutter|async-await|future
0
50
1
72,266,314
72,266,314
2
true
2022-05-16T19:31:31.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sequentially send requests to the server?<p>I have a List, and I need to send each element of this List to the server sequentially. And if the answer ...
72,267,649
How to merge a nested array of objects in javascript with a specific shape<p>I am trying to merge an array of objects by summing up the totals of each key-value pair under the totals object. For example, the below array would yield one object with a <code>totals</code> object of 3 apples and 5 oranges. This should be d...
<ul> <li>Using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce" rel="nofollow noreferrer"><code>Array#reduce</code></a>, iterate over the array while updating an object</li> <li>In every iteration, using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScr...
How to merge a nested array of objects in javascript with a specific shape
javascript|arrays
1
50
4
72,267,774
72,267,774
2
true
2022-05-17T02:49:41.740Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to merge a nested array of objects in javascript with a specific shape<p>I am trying to merge an array of objects by summing up the totals of each key-va...
72,265,017
Precision of a model in training (balanced dataset) versus production (imbalanced dataset)<p>I have a balanced dataset used for model training purposes. There are two classes. My model has a precision of 50%, meaning that for 100 samples it predicts that 50 are positive, of those 50 only 25 <em>are</em> actually positi...
<p>That depends: of those 50 samples classified as positive, are all 25 true positive samples correctly classified? If your model correctly predicts every positive sample as positive and then also negative samples as positive (high sensitivity, low specificity), I think your precision would be at around 8%. Nevertheles...
Precision of a model in training (balanced dataset) versus production (imbalanced dataset)
machine-learning
0
50
1
72,270,504
72,270,504
2
true
2022-05-16T20:07:31.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Precision of a model in training (balanced dataset) versus production (imbalanced dataset)<p>I have a balanced dataset used for model training purposes. Ther...
72,273,314
LateInitializationError: Field 'user' has not been initialized<p>I have problem with user initial value.</p> <p>I have this type of source codes: &quot;https:// paste.ofcode.org/ycHT4YFsDGSQXa68JiKJRH&quot;</p> <p>important lines in links:</p> <pre><code> child: Column( crossAxisAlignment: CrossAxisAlig...
<p>Use <code>User? user</code> instead of <code>late final user</code>to be able to check for a null value before the user has been loaded. And in your <code>getCurrentUser()</code> method when the user is fetched, use setState to update the user and the current state:</p> <pre><code>Future getCurrentUser() async { f...
LateInitializationError: Field 'user' has not been initialized
flutter
0
50
1
72,273,429
72,273,429
2
true
2022-05-17T11:33:15.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: LateInitializationError: Field 'user' has not been initialized<p>I have problem with user initial value.</p> <p>I have this type of source codes: &quot;http...
72,274,586
Python Nested functions within a class that update the class instance<p>I have a class lets call it EmployeeProfile. That collects a bunch of data about a person.</p> <p>I would like to be able to update specific data within the class using a function.</p> <pre><code>class EmployeeProfile: def __init__(self, profile): ...
<p>You have plenty of options. Some of them include using <code>setattr()</code>, updating the <code>__dict__</code> or using a custom dictionary:</p> <pre><code>class EmployeeProfile: ATTRIBUTES = {&quot;email&quot;, &quot;displayname&quot;} def __init__(self, profile): self.displayname = profile.get('displayN...
Python Nested functions within a class that update the class instance
python|function|class
0
50
1
72,274,836
72,274,836
2
true
2022-05-17T13:03:49.327Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Nested functions within a class that update the class instance<p>I have a class lets call it EmployeeProfile. That collects a bunch of data about a pe...
72,278,445
function to output pairwise of passed letters<p>I would like to create a Python function that can take in letters and output a pairwise comparison of the letter given.</p> <p>So for example, if my function is named <code>pairwise_letters()</code>, then it should behave as follows:</p> <pre class="lang-py prettyprint-ov...
<p>Use <a href="https://docs.python.org/3/library/itertools.html#itertools.combinations" rel="nofollow noreferrer"><code>itertools.combinations()</code></a> to get each pairing. By default, <code>itertools.combinations()</code> outputs an iterable of tuples, which you'll need to massage a bit to turn into a list of str...
function to output pairwise of passed letters
python|python-3.x
0
50
2
72,278,543
72,278,543
2
true
2022-05-17T17:39:05.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: function to output pairwise of passed letters<p>I would like to create a Python function that can take in letters and output a pairwise comparison of the let...
72,281,280
Average profit per day formula in 1 single cell<p>I want to use the solution explained here:</p> <p><a href="https://stackoverflow.com/questions/67003573/how-to-calculate-an-average-profit-per-day-with-google-sheets">How to calculate an average profit per day with Google Sheets</a></p> <p>But in just a single cell inst...
<p>try:</p> <pre><code>=INDEX(AVERAGE(QUERY(IFNA(QUERY( INDEX(SORTN(SORT({INT(A3:A), C3:C}, ROW(A3:A), ), 9^9, 2, 1, 1),,2), &quot;offset 1&quot;, )- INDEX(SORTN(SORT({INT(A3:A), C3:C}, ROW(A3:A), ), 9^9, 2, 1, 1),,2)), &quot;offset 1&quot;, ))) </code></pre> <p><a href="https://i.stack.imgur.com/p4rei.png" rel="nof...
Average profit per day formula in 1 single cell
sorting|google-sheets|google-sheets-formula|average|spreadsheet
1
50
1
72,281,765
72,281,765
2
true
2022-05-17T22:20:30.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Average profit per day formula in 1 single cell<p>I want to use the solution explained here:</p> <p><a href="https://stackoverflow.com/questions/67003573/how...
72,309,671
SQL query to find the count of number of same absences for an employee<p>I have a table:</p> <pre><code>PERSON_NUMBER ABS_DATE ABS_TYPE_NAME ABS_DAYS ----------------------------------------------------------------------------- 1010 01-01-2022 PTO ...
<p>When you are performing a <code>COUNT</code> with a partition clause, <code>ORDER BY</code> is not needed because it does not matter the order that the records are counted.</p> <p>You can also use a second analytic function to determine the first row that will hold the &quot;count&quot; and only display that in the ...
SQL query to find the count of number of same absences for an employee
sql|oracle|bi-publisher
0
50
1
72,310,422
72,310,422
2
true
2022-05-19T18:47:12.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL query to find the count of number of same absences for an employee<p>I have a table:</p> <pre><code>PERSON_NUMBER ABS_DATE ABS_TYPE_NAME...
72,318,155
Kotlin DSL - type inference on returned value<p>I'm trying to introduce the following (simplified) DSL:</p> <pre class="lang-kotlin prettyprint-override"><code>fun &lt;T&gt; myDsl(specFn: DslSpec&lt;T&gt;.() -&gt; Unit) { val value = DslSpec&lt;T&gt;().apply(specFn).fn!!() println(&quot;value is: $value&quot;) ...
<p>If you're using a version of Kotlin &lt; 1.6.0, you should add <code>@BuilderInference</code> to the <code>specFn</code> argument:</p> <pre class="lang-kotlin prettyprint-override"><code>fun &lt;T&gt; myDsl(@BuilderInference specFn: DslSpec&lt;T&gt;.() -&gt; Unit) { ... } </code></pre> <p><a href="https://pl.kot...
Kotlin DSL - type inference on returned value
kotlin|generics|dsl
1
50
1
72,318,370
72,318,370
2
true
2022-05-20T11:24:34.770Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kotlin DSL - type inference on returned value<p>I'm trying to introduce the following (simplified) DSL:</p> <pre class="lang-kotlin prettyprint-override"><co...
72,319,263
Get return value of method from TaskCompletionSource<p>I have a method <code>RenderReport</code> which generates a PDF file (<code>byte[]</code>). This can sometimes hang indefinitely. It should take no more than 15 seconds to complete when successful. Hence, I'm using a <code>TaskCompletionSource</code> to be able to ...
<p>You only risk deadlocks if you synchronously wait for a <code>Task</code> to complete.</p> <p>If you know that <code>longRunningTask</code> has completed, it's perfectly safe to access <code>longRunningTask.Result</code>. So just do:</p> <pre><code> if (completed) tcs.SetResult(longRunningTask.Result); ...
Get return value of method from TaskCompletionSource
c#|multithreading|asynchronous
0
50
2
72,319,806
72,319,806
2
true
2022-05-20T12:53:47.667Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get return value of method from TaskCompletionSource<p>I have a method <code>RenderReport</code> which generates a PDF file (<code>byte[]</code>). This can s...
72,332,413
Why isn't PDDL compiling correctly and resulting in parse error?<p>I am new to <code>PDDL</code> so I don't understand very well what's going on but I have this issue and it seems that black-box planner isn't able to parse my <code>PDDL</code> code.</p> <p>Here there is the <strong>domain</strong>:</p> <pre><code>(defi...
<p>you have to remove the <strong>negated predicates</strong> from the initial state in the problem due to the <a href="https://planning.wiki/ref/pddl/requirements#open-world" rel="nofollow noreferrer">Closed World Assumption</a>, plus you have a small typo in the domain <code>in_room</code> takes two variables, and no...
Why isn't PDDL compiling correctly and resulting in parse error?
planning|pddl
2
50
1
72,336,077
72,336,077
2
true
2022-05-21T18:53:42.333Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why isn't PDDL compiling correctly and resulting in parse error?<p>I am new to <code>PDDL</code> so I don't understand very well what's going on but I have t...
72,337,294
Return Error code when using try and except? (without raise)<p>I have some scripts running in docker containers that collect data from yfinance. Sometimes crashes occur because the data is not available.</p> <p>So I wanted to send me a mail if a crash occurs in a script, but I wanted it to be the exact error code that ...
<blockquote> <p>[...] but I wanted it to be the exact error code that caused the main function to crash.</p> </blockquote> <p>Try with the <code>except</code>/<code>as</code> syntax:</p> <pre><code>try: main() except Exception as e: # here you can print e </code></pre>
Return Error code when using try and except? (without raise)
python|error-handling|try-except|error-code
-1
50
1
72,337,488
72,337,488
2
true
2022-05-22T11:47:00.923Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Return Error code when using try and except? (without raise)<p>I have some scripts running in docker containers that collect data from yfinance. Sometimes cr...
72,355,189
OpenGL Render Half Polygon<p>I am getting half polygon rendered while using Indices in OpenGL. Any idea what's going wrong?</p> <pre><code> float vertices[] = { -0.5f, 0.5f, 0, -0.5f, -0.5f, 0, 0.5f, -0.5f, 0, 0.5f, -0.5f, 0, 0.5f, 0.5f, 0, -0.5f, 0.5f, 0 }; uint32_t Indices[] = { ...
<p>When you draw with indices you just need 4 vertices not 6. The index is the &quot;address&quot; of the vertex:</p> <pre class="lang-cpp prettyprint-override"><code>float vertices[] = { -0.5f, -0.5f, 0, // vertex 0 0.5f, -0.5f, 0, // vertex 1 0.5f, 0.5f, 0, // vertex 2 -0.5f, 0.5f, 0 ...
OpenGL Render Half Polygon
opengl|opengl-4
1
50
2
72,357,478
72,357,478
2
true
2022-05-23T21:55:53.387Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OpenGL Render Half Polygon<p>I am getting half polygon rendered while using Indices in OpenGL. Any idea what's going wrong?</p> <pre><code> float vertices...
72,360,511
How to add a new entry to an array after a certain property changes?<p>I am trying to add a new entry to an array after a certain property, in my case &quot; place&quot;, changes. However, I have big problems to find a suitable approach, because the operation depends on the next object in the array.</p> <pre><code>cons...
<p>Here is the implementation</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-override"><code>const initalData = [ { storyID: 1, place: 12, type: "Story" }, { storyID: 5, place: 12, ty...
How to add a new entry to an array after a certain property changes?
javascript|arrays
0
50
1
72,361,443
72,361,443
2
true
2022-05-24T09:31:53.267Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add a new entry to an array after a certain property changes?<p>I am trying to add a new entry to an array after a certain property, in my case &quot;...
72,365,553
Convert string into array or list of dicts<p>I am running an API call that gives as output the next string:</p> <pre><code>&quot;[{'hour':'5', 'day':'11', 'month':'sep', 'year':'2019'}, {'user_id':'x651242w', 'session_id':4025, 'location':'USA'}]&quot; </code></pre> <p>I want to access location what should I do in this...
<pre><code>import ast s = &quot;[{'hour':'5', 'day':'11', 'month':'sep', 'year':'2019'}, {'user_id':'x651242w', 'session_id':4025, 'location':'USA'}]&quot; lst = ast.literal_eval(s) print(lst) # [{'hour': '5', 'day': '11', 'month': 'sep', 'year': '2019'}, {'user_id': 'x651242w', 'session_id': 4025, 'location': 'USA'}]...
Convert string into array or list of dicts
python|arrays|string|dictionary
-1
50
4
72,365,803
72,365,803
2
true
2022-05-24T15:26:22.737Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert string into array or list of dicts<p>I am running an API call that gives as output the next string:</p> <pre><code>&quot;[{'hour':'5', 'day':'11', 'm...
72,367,003
how can i smooth the graph values or extract main signals only<p>when i try to run the code below i get this graph</p> <p><a href="https://i.stack.imgur.com/StM4q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/StM4q.png" alt="enter image description here" /></a></p> <p>my code:</p> <pre><code>from n...
<p>pandas has a <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.rolling.html" rel="nofollow noreferrer"><code>rolling()</code></a> method for dataframes that you can use to calculate the mean over a window of values, e.g. the 70 closest ones:</p> <pre class="lang-py prettyprint-override"><code>im...
how can i smooth the graph values or extract main signals only
python|math|graph|smoothing|data-preprocessing
1
50
1
72,367,429
72,367,429
2
true
2022-05-24T17:20:52.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how can i smooth the graph values or extract main signals only<p>when i try to run the code below i get this graph</p> <p><a href="https://i.stack.imgur.com/...
72,371,966
JavaFX TableView change column data if column contains certain value<p>I want to make it where in the <a href="https://i.stack.imgur.com/Ipboy.png" rel="nofollow noreferrer">tableview</a> if the First Dose Appointment Date of a certain row is 0000-01-01, then it will display N/A instead of 0000-01-01 for that specific ...
<p>If you want to do this with minimal disruption to the rest of your code, then I recommend putting this logic in a custom cell implementation. Here's an example:</p> <pre class="lang-java prettyprint-override"><code>import java.time.LocalDate; import javafx.application.Application; import javafx.beans.property.Object...
JavaFX TableView change column data if column contains certain value
java|javafx|tableview
-1
50
1
72,372,254
72,372,254
2
true
2022-05-25T04:28:16.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaFX TableView change column data if column contains certain value<p>I want to make it where in the <a href="https://i.stack.imgur.com/Ipboy.png" rel="nofo...