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,846,956
Pandas dot product returns "ValueError: matrices are not aligned" although there is no shape issue. Why?<p>I'm trying to multiply a square matrix by itself.</p> <pre><code>df2 = pd.DataFrame({'C1':[0, 0, 0.7], 'C2':[0.5, 0, 0], 'C3':[0.7, 0.3, 0] } ...
<p>According to <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.dot.html" rel="nofollow noreferrer"><code>DataFrame.dot</code></a></p> <blockquote> <p>The column names of DataFrame and the index of other must contain the same values, as they will be aligned prior to the multiplication.</p> </bloc...
Pandas dot product returns "ValueError: matrices are not aligned" although there is no shape issue. Why?
pandas|dataframe|matrix|matrix-multiplication
1
47
1
72,847,214
72,847,214
1
true
2022-07-03T13:38:31.783Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas dot product returns "ValueError: matrices are not aligned" although there is no shape issue. Why?<p>I'm trying to multiply a square matrix by itself.<...
72,978,876
How to find how a container was started: "docker run" or "docker-compose up"?<p>When accessing a remote machine I'd like to know if a container was started over <code>docker run</code> or <code>docker-compose</code> or some other means.</p> <p>Is that even possible?</p> <p>EDIT: the main reason for this was to find out...
<p>For investigation purposes I created the most simplest docker-compose.yml:</p> <pre><code>version: &quot;2.4&quot; services: hello: image: &quot;hello-world&quot; </code></pre> <p>Then run it with <code>docker-compose up</code></p> <p>And lastly the normal way: <code>docker run -it --name cli hello-world</code...
How to find how a container was started: "docker run" or "docker-compose up"?
docker|docker-compose|containers|devops
0
47
2
72,997,090
72,997,090
1
true
2022-07-14T10:15:42.097Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find how a container was started: "docker run" or "docker-compose up"?<p>When accessing a remote machine I'd like to know if a container was started o...
73,012,837
I want to delete the same part from the two -dimensional array<p>I would like to compare the two arrangements of the following script to delete the duplicate arrangement.<br> I used the Filter and Includes function or for statement but failed. <br> What should I do?</p> <pre class="lang-js prettyprint-override"><code>l...
<p>You could create an <code>arrayEqual</code> function that compares two arrays</p> <pre><code>function arrayEqual(arr1, arr2) { if (arr1.length !== arr2.length) return false; for (let i = 0; i &lt; arr1.length; i++) if (arr1[i] !== arr2[i]) return false; //adapt equality test if you have complex objects ...
I want to delete the same part from the two -dimensional array
javascript
-1
47
2
73,012,932
73,012,932
1
true
2022-07-17T14:59:02.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to delete the same part from the two -dimensional array<p>I would like to compare the two arrangements of the following script to delete the duplicate...
72,976,460
how can i add value to specific index in firstore ListField value<p>I have the following list field in Firestore.</p> <p><a href="https://i.stack.imgur.com/55ng4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/55ng4.png" alt="enter image description here" /></a></p> <p>Now, I need to place value in <...
<p>There is no way you can <a href="https://stackoverflow.com/questions/54004272/is-there-any-way-to-update-a-specific-index-from-the-array-in-firestore/54026098#54026098">update an element that exists in an array by its index</a>. This means you’ll need to:</p> <ul> <li>Read the content of the array into your applicat...
how can i add value to specific index in firstore ListField value
firebase|google-cloud-platform|google-cloud-firestore
0
47
1
72,976,592
72,976,592
1
true
2022-07-14T07:00:25.997Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how can i add value to specific index in firstore ListField value<p>I have the following list field in Firestore.</p> <p><a href="https://i.stack.imgur.com/5...
72,889,140
Can I use SSH and HTTPS both for single git account?<p>If i use <code>SSH</code> then I have to download git repository using git ssh but if I use <code>HTTPS</code> then https is the way.</p> <p>Can I download those git repo using both way for a single account?</p>
<p>The account is what the remote hosting service will use to authenticate you and determine if you have the right to access the remote repository you want to clone.</p> <ul> <li>for HTTPS, it will be the username/password</li> <li>for SSH, it will be the public key published to your remote account profile setting (whi...
Can I use SSH and HTTPS both for single git account?
git|github|ssh|https|gitlab
0
47
1
72,892,298
72,892,298
1
true
2022-07-06T19:50:45.547Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I use SSH and HTTPS both for single git account?<p>If i use <code>SSH</code> then I have to download git repository using git ssh but if I use <code>HTTP...
72,926,992
How to access elements of other component in Reactjs?<p>I have two components <code>Playlist</code> and <code>Vol-Slider</code>,I want to access <code>vol-Slider</code> component inside <code>Playlist</code> component the thing I wanna do is whenever someone clicks on icons a class should be added to the <code>vol-slid...
<p>In React, instead of using <code>toggle</code>, you can use states to handle UI updates. With this approach, you can pass states to any components for conditional renderings.</p> <p><strong>Playlist</strong></p> <pre><code>//reduce your code duplication, and re-use `isActive` state for each icon function PlaylistIte...
How to access elements of other component in Reactjs?
javascript|reactjs
0
47
2
72,927,180
72,927,180
1
true
2022-07-10T08:01:06.973Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access elements of other component in Reactjs?<p>I have two components <code>Playlist</code> and <code>Vol-Slider</code>,I want to access <code>vol-Sl...
72,956,292
Request timeout using jest, supertest to test for a wrong URL error or mongodb database ValidationError on an express server that has an error handler<p>I am running a test that never returns the error till the test times out, however this works pretty well with postman or insomnia</p> <p>index.js</p> <pre><code>const ...
<p>Been a while since I used jest but, as far as I remember, the only way to test for errors I think is to add a <code>try/catch</code> block around the <code>await request(app).get('/')</code> and write the <code>expects</code> in the <code>catch</code> block. You can also play around with the error object <code>e</co...
Request timeout using jest, supertest to test for a wrong URL error or mongodb database ValidationError on an express server that has an error handler
node.js|express|jestjs|supertest
0
47
1
72,956,333
72,956,333
1
true
2022-07-12T17:33:56.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Request timeout using jest, supertest to test for a wrong URL error or mongodb database ValidationError on an express server that has an error handler<p>I am...
72,918,842
SQL table definition best practice for column<p>I have these prices depending on monthly purchase Source A:</p> <pre><code>| Purchase | Price | | -------------------- | ------------------- | | 1 - 5 | $1.50 | | 6 - 7 | $1.40 | | 8 - 10 ...
<p>prefect use case for range data type.</p> <pre><code>CREATE TABLE txn_range_price_ref ( source text, txn_qty_range int8range, fee numeric ); INSERT INTO txn_range_price_ref VALUES ('Source A', '[1, 5000]'::int8range, 2.50), ('Source A', '[5001,7500]'::int8range, 2.40), ('Source A', '[7501,10...
SQL table definition best practice for column
sql|postgresql
0
47
2
72,919,331
72,919,331
1
true
2022-07-09T03:59:32.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL table definition best practice for column<p>I have these prices depending on monthly purchase Source A:</p> <pre><code>| Purchase | Price ...
72,794,134
seaborn violin plot with frequency and values in separate columns<p>I have some DataFrame:</p> <pre><code>import pandas as pd import numpy as np import seaborn as sns np.random.seed(1) data = {'values': range(0,200,1), 'frequency': np.random.randint(low=0, high=2000, size=200)} df = pd.DataFrame(data) </code></pre> <p...
<p>As suggested in my comment:</p> <p>Before repeating the frequencies, reduce their resolution to a percent level, by normalizing and rounding them to an integer range of 0 to 100.</p> <p>This way, you are not loosing significant amount of detail but keep the amount of repetitions to a maximum of 100.</p> <pre><code>i...
seaborn violin plot with frequency and values in separate columns
python|pandas|seaborn
0
47
1
72,796,458
72,796,458
1
true
2022-06-28T23:15:08.053Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: seaborn violin plot with frequency and values in separate columns<p>I have some DataFrame:</p> <pre><code>import pandas as pd import numpy as np import seabo...
72,390,142
What happens if two distinct processes use mmap to map the same region of file (one with MAP_SHARED, another with MAP_PRIVATE)?<p>Can two distinct(not parent/child) processes use mmap to map the same region of file, the process A with flag MAP_SHARED, the process B with MAP_PRIVATE)? If process A changes something in t...
<p>Then A gets the file mapped and B gets the file mapped but any writes will not be written back to the file.</p> <p>From the manpage:</p> <blockquote> <p>It is unspecified whether changes made to the file after the mmap() call are visible in the mapped region.</p> </blockquote>
What happens if two distinct processes use mmap to map the same region of file (one with MAP_SHARED, another with MAP_PRIVATE)?
c++|c|mmap
0
47
1
72,393,426
72,393,426
1
true
2022-05-26T10:09:25.663Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What happens if two distinct processes use mmap to map the same region of file (one with MAP_SHARED, another with MAP_PRIVATE)?<p>Can two distinct(not parent...
72,399,445
How to trigger lambda function through another function?<p>I would like to run one lambda function, that would return a list of parameters. Based on the number of parameters I would like to trigger another lambda functions to finish the process individually (e.g. 100 independent sub-lambda function).</p> <p>Would like ...
<p>There are three options: first, call <a href="https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html" rel="nofollow noreferrer">Invoke</a> using the AWS SDK for your language.</p> <p>Second, use <a href="https://docs.aws.amazon.com/step-functions/latest/dg/how-step-functions-works.html" rel="nofollow noreferre...
How to trigger lambda function through another function?
amazon-web-services|aws-lambda
-1
47
1
72,405,486
72,405,486
1
true
2022-05-27T01:02:15.447Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to trigger lambda function through another function?<p>I would like to run one lambda function, that would return a list of parameters. Based on the numb...
72,361,515
Getting huge random numbers error while trying to get the maximum element in array - C++ error<p>I am making a program in which the program takes 3 numbers as input: &quot;l&quot;, &quot;r&quot; and &quot;a&quot;. I get all the values of &quot;x&quot; between l and r, (l and r inclusive). example, l = 1, r = 3, x value...
<p>Request from Levi to post my comment as answer:</p> <p>The point is that one of the successes of C++ is that it started from C, but it moved on quite a bit and the code in your question is still mostly C-code. Here is an example how it could be handled in C++ with more knowledge needed but less chance for errors:</p...
Getting huge random numbers error while trying to get the maximum element in array - C++ error
c++|arrays
-1
47
1
72,430,374
72,430,374
1
true
2022-05-24T10:45:07.090Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting huge random numbers error while trying to get the maximum element in array - C++ error<p>I am making a program in which the program takes 3 numbers a...
72,255,441
How to find and repalce anchor tag link inside td in php<p>I am working with wordpress,I want to change &quot;url&quot;(product link) of &quot;product-image&quot; in &quot;cart&quot; page, So i have following code (dynamic)</p> <pre><code>&lt;td class=&quot;product-name&quot; data-title=&quot;Product&quot;&gt; &lt;a hr...
<p>You can do it like below:</p> <pre><code>var urlReplacement = $('.product-name a').text(); var url = $('.product-name a').attr(&quot;href&quot;); var pathComponent = url.split('/'); pathComponent[ pathComponent.length-1 ] = urlReplacement; url = pathComponent.join('/'); $('.product-name a').attr(&quot;href&quot;, ur...
How to find and repalce anchor tag link inside td in php
javascript|jquery|wordpress
0
47
2
72,256,127
72,256,127
1
true
2022-05-16T07:19:41.007Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find and repalce anchor tag link inside td in php<p>I am working with wordpress,I want to change &quot;url&quot;(product link) of &quot;product-image&...
72,267,603
Flex/Bison sometimes misses Re<p>I build a CLI using flex/bison, and I experience that the flex sometimes doesn't get the tokens.</p> <p>My .l looks like this:</p> <pre><code>%{ #include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &quot;hmd.tab.h&quot; #include &quot;cmd.h&quot; %} %option debug %option verbos...
<p>If you use the <code>--debug</code> (or <code>-d</code>) command-line flag when generating your scanner, flex will insert code which logs all rule matches (and certain other significant events). In reentrant scanners, such as yours, you also need to insert a call to <code>yyset_debug(1, scanner);</code> to enable th...
Flex/Bison sometimes misses Re
bison|flex-lexer
0
47
1
72,267,769
72,267,769
1
true
2022-05-17T02:40:27.823Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flex/Bison sometimes misses Re<p>I build a CLI using flex/bison, and I experience that the flex sometimes doesn't get the tokens.</p> <p>My .l looks like thi...
72,324,015
How to create and run two or more (multiple) servers in python asyncio with asyncio.Protocol<p>I would like to run two simple TCP servers in one script using asyncio in python (Python 3.9.9). Each server runs on a different port, obviously. I am having trouble with the correct syntax to use to create and launch the two...
<p>I've made some simple rearrangements to make the server work on two ports:</p> <pre class="lang-py prettyprint-override"><code>############################################################################### # echoserver.py # Simple code to run EchoServer on two ports simultaneously ##################################...
How to create and run two or more (multiple) servers in python asyncio with asyncio.Protocol
python|async-await|python-asyncio
1
47
1
72,324,466
72,324,466
1
true
2022-05-20T19:35:36.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create and run two or more (multiple) servers in python asyncio with asyncio.Protocol<p>I would like to run two simple TCP servers in one script using...
72,270,269
Is there a standard algorithm or library for representing data deltas?<p>I have a Python dictionary with fairly complex structure — multiple layers of nested values, some of which are dicts and some of which are lists. I want to represent changes to the data in a compact way that can be applied easily.</p> <p>For dicti...
<p>From the user's point of view, I don't think list indices are as much of an issue as you say it is. The indices will only have changed after all the manipulations are done. Use the old indices during the list's manipulation.</p> <p>From the implementation's point of view, we'll have to be super careful when manipula...
Is there a standard algorithm or library for representing data deltas?
python|algorithm
2
47
2
72,270,866
72,270,866
1
true
2022-05-17T08:04:45.490Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a standard algorithm or library for representing data deltas?<p>I have a Python dictionary with fairly complex structure — multiple layers of nested...
72,265,212
Runnign open source code locally - vscode<p>I decided I wanted to get started in open source code, as an almost beginner. One of the projects that has been suggested to me is vscode. So, I am following the instructions in the following link:</p> <p><a href="https://github.com/microsoft/vscode/wiki/How-to-Contribute" re...
<p>I can't understand why some persons here on stack overflow put dislike for no reason. As far as I can see there's a problem with the local repository. The error in the terminal guides, just read it!</p> <pre><code>make: ingresso nella directory «/home/matteopossamai/open_source/vscode/node_modules/native-is-elevated...
Runnign open source code locally - vscode
python|node.js|linux|visual-studio-code|npm
0
47
1
72,269,398
72,269,398
1
true
2022-05-16T20:25:33.773Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Runnign open source code locally - vscode<p>I decided I wanted to get started in open source code, as an almost beginner. One of the projects that has been s...
72,322,747
Resolving Dependencies based on request in Servicestack<p>I have a Servicestack Api and i need suggestions \ ideas in injection the dependencies.</p> <p>My Api needs to call appropriate dependency based on the request parameters</p> <p>I have registered the dependencies as below</p> <pre><code> public class AppHost...
<p>I wouldn't register multiple named <code>ITravelManager</code> instances, instead I would register a single <code>TravelServiceManager</code> instance that determines which <code>ITravelManager</code> to return based on the request, e.g:</p> <pre class="lang-cs prettyprint-override"><code>public override void Config...
Resolving Dependencies based on request in Servicestack
c#|asp.net-web-api|dependency-injection|servicestack
1
47
1
72,327,740
72,327,740
1
true
2022-05-20T17:31:09.547Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Resolving Dependencies based on request in Servicestack<p>I have a Servicestack Api and i need suggestions \ ideas in injection the dependencies.</p> <p>My A...
72,336,227
Generating letters using 'for' loop in Matlab<p>I have to generate 80 random letters of the English alphabet (capital letters) and display them in a row of 10 letters per row using a 'for' loop. I get an error because the limit is 26. What do I change in the code?</p> <pre><code>alfabet = 'A' : 'Z'; for i = 1 : 80 tem...
<p>Actually it could be an one-liner:</p> <pre><code>disp((char('A'+randi(26,8,10)-1))); </code></pre> <p>Surely you can split it with a usage of &quot;for&quot;:</p> <pre><code>alfabet=char('A'+randi(26,1,80)-1); for i = 1 : 10 : 80 disp(alfabet(i : i + 9)) end </code></pre> <p>If for whatever reason you have to u...
Generating letters using 'for' loop in Matlab
matlab|for-loop
2
47
1
72,337,352
72,337,352
1
true
2022-05-22T09:17:59.937Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generating letters using 'for' loop in Matlab<p>I have to generate 80 random letters of the English alphabet (capital letters) and display them in a row of 1...
72,247,751
Combining two data sets based on programme name<p>Hi I am trying to work out the best way to achieve something. I am essentially making two database calls</p> <pre><code>const [emails] = await dbConnection.execute('SELECT name, programme, timestamp FROM emails'); const [emailsCancelled] = await dbConnection.execute('S...
<p>From <code>emailsCancelled</code>, you can reduce your array to a lookup <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map" rel="nofollow noreferrer">Map</a> before your perform your <code>.reduce()</code> on on <code>emails</code>. The lookup will store the <code>programN...
Combining two data sets based on programme name
javascript|ecmascript-6
0
47
3
72,247,959
72,247,959
1
true
2022-05-15T11:15:36.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combining two data sets based on programme name<p>Hi I am trying to work out the best way to achieve something. I am essentially making two database calls</...
72,252,789
If case within string in JavaScript with variable either inside quotation marks or NULL?<p>This question is difficult to title but easy to show. I would like to add multiple sets of values to an SQL insert such as</p> <pre><code>var sqlInsertString = `INSERT INTO events (url) VALUES` var sqlInsertValuesString = `(`('${...
<p>There is more than one reason to use parametrised queries, not just preventing injection attacks. They make it as simple as</p> <pre><code>pg_client.query( &quot;INSERT INTO events (url, nothing, one, two, three) VALUES ($1, $2, $3, $4, $5)&quot;, [event.url || null, null, 1, 2, 3] ) .then(res =&gt; ...) .catch(...
If case within string in JavaScript with variable either inside quotation marks or NULL?
javascript|sql
0
47
5
72,254,182
72,254,182
1
true
2022-05-15T23:08:40.117Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If case within string in JavaScript with variable either inside quotation marks or NULL?<p>This question is difficult to title but easy to show. I would like...
72,265,277
Can I add a different function that is defined in my code in a vector like arrays that include function adress?<p>In this code, there are 6 different functions. They create 6 different boards for playing a game. But I don't want to create boards with <code>if</code> conditions, I want to create a <code>vector</code> th...
<p>What you are looking for is <a href="https://en.cppreference.com/w/cpp/utility/functional/function" rel="nofollow noreferrer"><code>std::function</code></a></p> <p>In your case, you'd create a vector of <code>std::function&lt;&gt;</code> for functions that take no parameter and return a <code>vector&lt;vector&lt;cel...
Can I add a different function that is defined in my code in a vector like arrays that include function adress?
c++|vector
0
47
1
72,265,754
72,265,754
1
true
2022-05-16T20:30:52.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I add a different function that is defined in my code in a vector like arrays that include function adress?<p>In this code, there are 6 different functio...
72,386,590
C++ unhandled Exception while checking ARGV values<p>Can someone tell me why this code worked 10 minutes ago but keeps failing now?</p> <p>I keep getting unhandled exception error. In the debug menu I am entering 32 and 12.5.</p> <p>The code fails each time I try to check i &gt; 0;</p> <pre><code>bool CheckArgInputs(ch...
<p>Your <code>CheckArgInputs()</code> function is coded to act like it is being given a pointer to an individual string, but <code>main()</code> is actually giving it a pointer to a pointer to a string. And then the function is not coded correctly to iterate the individual characters of just that string, it is actually...
C++ unhandled Exception while checking ARGV values
c++|unhandled-exception
1
47
1
72,386,897
72,386,897
1
true
2022-05-26T04:10:04.467Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C++ unhandled Exception while checking ARGV values<p>Can someone tell me why this code worked 10 minutes ago but keeps failing now?</p> <p>I keep getting unh...
72,318,445
Prevent cycle in Depth first search using prolog<p>Is there any way to prevent cycle in this code.</p> <pre><code>move(a,b). move(b,a). move(a,c). move(b,d). move(b,e). move(d,h). move(d,i). move(e,j). move(e,k). move(c,f). move(c,g). move(f,l). move(f,m). move(g,n). move(g,o). goal(n). goSolveTheMaze(Start,Way) :- ...
<p>What if you add a third argument to <code>dfs</code> which is a list of where you've already visited? You could then use <a href="https://www.swi-prolog.org/pldoc/man?predicate=%5C%2B/1" rel="nofollow noreferrer">\+/1</a> and <a href="https://www.swi-prolog.org/pldoc/man?predicate=member/2" rel="nofollow noreferrer"...
Prevent cycle in Depth first search using prolog
prolog|artificial-intelligence|depth-first-search
1
47
1
72,318,748
72,318,748
1
true
2022-05-20T11:47:56.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Prevent cycle in Depth first search using prolog<p>Is there any way to prevent cycle in this code.</p> <pre><code>move(a,b). move(b,a). move(a,c). move(b,d)....
72,357,759
How can I show element next to image when image is hovered?<p>I want to show a message when hovering on an image using CSS. I have used the following code :</p> <p><strong>Code:</strong></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre ...
<p>Use this way</p> <pre><code>.xyz:hover + .message{ visibility: visible; } </code></pre> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.message { visibility: hidden; } ...
How can I show element next to image when image is hovered?
html|css
0
47
2
72,357,774
72,357,774
1
true
2022-05-24T05:49:47.277Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I show element next to image when image is hovered?<p>I want to show a message when hovering on an image using CSS. I have used the following code :<...
72,330,089
Javascript: How to specify http method with AWS Lambda.invoke()?<p>From AWS documentation: <a href="https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#invoke-property" rel="nofollow noreferrer">https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#invoke-property</a></p> <pre class="lang-...
<p><code>lambda.invoke()</code> invokes the <strong>Lambda function</strong> - HTTP methods are for invoking Amazon API Gateway routes, not a Lambda function.</p> <p>A Lambda function just takes in an event.</p> <p>Either call the Amazon API Gateway endpoint (which then invokes the Lambda), or just directly invoke the ...
Javascript: How to specify http method with AWS Lambda.invoke()?
javascript|aws-lambda
0
47
1
72,330,107
72,330,107
1
true
2022-05-21T13:40:33.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript: How to specify http method with AWS Lambda.invoke()?<p>From AWS documentation: <a href="https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/L...
72,303,587
Need code for seperating the part of string(latex code) into an object : like below --><p>I have the <em>latex code</em> in the <strong>string</strong> and want output as a <strong>object</strong></p> <pre><code>const str = ` i am line1 i am part1 i am some1 i am line2 i am part2 i am some2 i am line3 i am part3 i ...
<p>You can do something like this <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 str = ` i am line1 i am part1 i am some1 i am line2 i am part2 i am some2 i am line3 i am pa...
Need code for seperating the part of string(latex code) into an object : like below -->
javascript|loops|split|javascript-objects|splice
-4
47
1
72,303,771
72,303,771
1
true
2022-05-19T11:17:59.830Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need code for seperating the part of string(latex code) into an object : like below --><p>I have the <em>latex code</em> in the <strong>string</strong> and w...
72,337,487
Node.js middleware does not work properly<p>I have a module with Routes in it. I want to check the access before letting user move forward. In Routes module I have two routes and two access-check functions, that I'd like to use as middlewares:</p> <pre class="lang-js prettyprint-override"><code>const doesUserExist = (r...
<p>A request <code>GET /cats/1</code></p> <ul> <li>ignores the route <code>app.use('/users/:id', doesUserExist)</code>, because the path does not match</li> <li>takes the route <code>app.use('/', dbAccess)</code>, because <code>/</code> matches every path</li> <li>inside <code>dbAccess</code> <ul> <li>it ignores <code>...
Node.js middleware does not work properly
javascript|node.js|express|middleware
0
47
1
72,337,850
72,337,850
1
true
2022-05-22T12:15:53.727Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Node.js middleware does not work properly<p>I have a module with Routes in it. I want to check the access before letting user move forward. In Routes module ...
72,332,811
Call different list with similar name in a for loop<p>I have a few lists that are with names: group1, group2, group3... I need a for loop (lets say for (int i=1; i&lt;=6; i++) and right now I check for example if i is 1 then use group1, if i is 2 use group2 etc... My question is, can I call the list with the 'i' in the...
<h2>In General</h2> <p>This comes up a lot. No; you cannot programmatically build a variable name. By the time the code is compiled the variable names are gone anyway</p> <p>If you ever have variables with names like</p> <pre><code>something1 something2 something3 </code></pre> <p>etc, then this is a candidate for usin...
Call different list with similar name in a for loop
c#|list|for-loop|variables
0
47
4
72,335,000
72,335,000
1
true
2022-05-21T19:56:46.730Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Call different list with similar name in a for loop<p>I have a few lists that are with names: group1, group2, group3... I need a for loop (lets say for (int ...
72,400,009
How do I copy text from an <Input> by using getElementbyTagName?<p>I am trying to create a button that doesn't use ID to copy text from an input text field.</p> <p>I thought the best way to do this would be using an event listener and then on click activate the function that would copy text from the input value.</p> <p...
<ol> <li>First getting by <code>tag</code> is elements . You were missed <code>s</code></li> </ol> <pre><code>document.getElementByTagName -&gt;document.getElemenstByTagName </code></pre> <ol start="2"> <li>Loop elements and add event</li> </ol> <p>Try it :</p> <p><div class="snippet" data-lang="js" data-hide="false" ...
How do I copy text from an <Input> by using getElementbyTagName?
javascript|copy|addeventlistener|buttonclick|getelementsbytagname
1
47
1
72,400,464
72,400,464
1
true
2022-05-27T03:01:46.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I copy text from an <Input> by using getElementbyTagName?<p>I am trying to create a button that doesn't use ID to copy text from an input text field.<...
72,349,648
How can i do a concat() in SQL 2008<p>I have this statement, which works in SQL Server 2017:</p> <pre><code>REPLACE(CONCAT(NOM_TIPO_QUEBRA_ORDEM, CHAR(13), DSC_TIPO_QUEBRA_ORDEM, CHAR(13), HST_ORDEM_FILA_MOVIMENTO), CHAR(13) + CHAR(13), '') as justificativa_quebra </code></pre> <p>How can I do this same in SQL Server 2...
<p><code>CONCAT(a,b,c)</code> is basically just syntactic sugar for <code>COALESCE(RTRIM(a),'') + COALESCE(RTRIM(b),'') + COALESCE(RTRIM(c),'')</code> (<a href="https://dbfiddle.uk/?rdbms=sqlserver_2019&amp;fiddle=fbed7e2591e1183f19cb3430d12e8f2a" rel="nofollow noreferrer">example</a>).</p> <p>So:</p> <pre><code>REPLAC...
How can i do a concat() in SQL 2008
sql|sql-server
-1
47
1
72,349,675
72,349,675
1
true
2022-05-23T13:45:16.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i do a concat() in SQL 2008<p>I have this statement, which works in SQL Server 2017:</p> <pre><code>REPLACE(CONCAT(NOM_TIPO_QUEBRA_ORDEM, CHAR(13), D...
72,279,539
Json schema of interface - serialization missing some fields<p>For this code, where I have an user defined interface and schema definition is guided.</p> <pre><code>type SchemaDefinition&lt;T&gt; = { [K in keyof T]: { type: { new(): unknown } // required?: boolean } } class Schema&lt;T&gt; { constructor(...
<p>You just need to use values that are serializable to JSON because <code>String</code> and <code>Number</code> are functions, and therefore are not serializable.</p> <p>For example, maybe you want to test the <code>typeof obj[prop]</code> for particular string.</p> <pre><code>type AllowedTypeNames = 'string' | 'numbe...
Json schema of interface - serialization missing some fields
javascript|typescript
0
47
1
72,280,163
72,280,163
1
true
2022-05-17T19:15:18.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Json schema of interface - serialization missing some fields<p>For this code, where I have an user defined interface and schema definition is guided.</p> <pr...
72,239,832
The while loop sometimes is infinite<pre><code>Sub Copy_Worksheets_Columns_Rows_to_ALL_D2() 'PURPOSE: To loop through all Excel files in a user specified folder and perform a set task on them 'Task: Copy worksheets, columns and rows to ALL (D2) Dim sourceSheet1 As Worksheet Dim sourceSheet2 As Work...
<p>When you modify files in a loop that is based on <code>Dir</code> you may get into this situation. <code>Dir</code> is great when you don't modify the files in the folder you are iterating over, but if you do make modifications, it is risky.</p> <p>A pragmatic solution is to first collect the files you want to proce...
The while loop sometimes is infinite
excel|vba
0
47
1
72,240,110
72,240,110
1
true
2022-05-14T11:39:47.927Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The while loop sometimes is infinite<pre><code>Sub Copy_Worksheets_Columns_Rows_to_ALL_D2() 'PURPOSE: To loop through all Excel files in a user specified...
72,260,504
Multi-Indexed data to nested list of objects<p>I have some data that looks like this...</p> <pre class="lang-py prettyprint-override"><code>import pandas as pd df = pd.DataFrame( [[1, 2, 3, 4, 5, 6], [5, 6, 7, 8, 9, 10]], columns=[ ['a', 'a', 'b', 'b', 'c', 'c'], ['col1', 'col2', 'col1', 'col2...
<h2>Pandas solution</h2> <pre><code>s = df.stack(0) s['r'] = s.to_dict('r') s['r'].unstack().to_dict('r') </code></pre> <p><strong>General pandas solution corresponding to OP's update:</strong></p> <pre><code>s = df.melt(var_name=['l0', 'l1'], ignore_index=False) s.groupby([s.index, 'l0']).apply(lambda s: dict(zip(s.l1...
Multi-Indexed data to nested list of objects
pandas
0
47
3
72,260,895
72,260,895
1
true
2022-05-16T14:04:33.880Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multi-Indexed data to nested list of objects<p>I have some data that looks like this...</p> <pre class="lang-py prettyprint-override"><code>import pandas as ...
72,340,677
Get configuration in method CreateDbContext of IDesignTimeDbContextFactory in .NET 6.0 for GetConnectionString<p>I need read the value connection string of appsettings.json for have this dynamic.</p> <p><strong>I have:</strong></p> <pre><code> public class StoreContextFactory : IDesignTimeDbContextFactory&lt;StoreCo...
<p>You can build configuration yourself via <code>ConfigurationBuilder</code>:</p> <pre class="lang-cs prettyprint-override"><code>public class StoreContextFactory : IDesignTimeDbContextFactory&lt;StoreContext&gt; { public StoreContext CreateDbContext(string[] args) { // add all needed configuration pro...
Get configuration in method CreateDbContext of IDesignTimeDbContextFactory in .NET 6.0 for GetConnectionString
c#|entity-framework-core|.net-6.0
1
47
1
72,341,139
72,341,139
1
true
2022-05-22T19:24:58.810Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get configuration in method CreateDbContext of IDesignTimeDbContextFactory in .NET 6.0 for GetConnectionString<p>I need read the value connection string of a...
72,299,160
Oracle ROWNUM pagination numbering problem<p>I have some problem sorting columns and paginate them.</p> <p>for example,</p> <pre><code>select * from (select A.*, ROWNUM RNUM from (select * from USER order by name) A where ROWNUM &lt;= 3 --edited ) B where RNUM &gt;= 1 </code></pre>...
<p>Why <em>what</em> happened?</p> <ul> <li>source is <code>select * from user</code> (apparently, false table name; that's reserved for function that returns username of a currently logged <em>user</em>) so it selects <em>all rows</em> from the table</li> <li><code>rownum rnum</code> then reflects number of all rows r...
Oracle ROWNUM pagination numbering problem
sql|oracle
0
47
1
72,299,548
72,299,548
1
true
2022-05-19T05:39:05.327Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle ROWNUM pagination numbering problem<p>I have some problem sorting columns and paginate them.</p> <p>for example,</p> <pre><code>select * from (sel...
72,310,349
Typescript - handling conditional parameters with<p>I am currently writing a wrapper component around Material UI's &lt;<a href="https://mui.com/material-ui/api/tree-view/" rel="nofollow noreferrer">TreeView</a>. - within this wrapper, I want to mimic some of the functionality to enable me to pass in props to the treev...
<p>I skimmed through the details of your post, would this suffice?</p> <pre><code>type Props&lt;T extends string | string[], M = T extends any[] ? true : false&gt; = { data: Date | Date[]; expand?: boolean; fieldName: string; handleSelect?: (event: Event, nodeIds: T) =&gt; void; selected: T; setSelected?: (...
Typescript - handling conditional parameters with
javascript|reactjs|typescript
1
47
1
72,310,585
72,310,585
1
true
2022-05-19T19:50:27.457Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript - handling conditional parameters with<p>I am currently writing a wrapper component around Material UI's &lt;<a href="https://mui.com/material-ui/...
72,369,706
Convert to upper case just a subset of the colum names of my dataframe<p>Let's say I have a dataframe with 10 columns, and I want to convert to upper case the name of just the columns 3 to 7. How could I do that ?</p> <p>Thanks!</p>
<p>How to <code>upper()</code> <em>column names</em>/<em>headers</em> based on their <strong>index</strong> (<em>one or multiple</em>):</p> <pre><code>df = pd.DataFrame({'test1234':[100,50,10], 'abc_!-?':[200,75,5], 'Column3':[50,300,60]}) df </code></pre> <div class="s-table-container"> <table class="s-table"> <thead>...
Convert to upper case just a subset of the colum names of my dataframe
python|pandas
-1
47
2
72,370,229
72,370,229
1
true
2022-05-24T21:32:22.883Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert to upper case just a subset of the colum names of my dataframe<p>Let's say I have a dataframe with 10 columns, and I want to convert to upper case th...
72,241,591
Convert image in list of coordinates in Julia<p>I have this short code <code>img_lab = rand(Lab, 10, 10)</code> where I just have created an image of random colored pixels. Probably this question is trivial but how do I convert the output of this (which is <code>Matrix{Lab{Float64}} (alias for Array{Lab{Float64}, 2}</c...
<p>First, please make sure that you have good reasons to do this. Converting to such a format makes it harder to use the rest of <code>Colors</code> functionality, could have a (potentially large) performance cost, and is usually unnecessary.</p> <p>Now, assuming it's necessary, here's one way to do it:</p> <pre><code>...
Convert image in list of coordinates in Julia
arrays|image|matrix|julia
1
47
1
72,242,125
72,242,125
1
true
2022-05-14T15:21:55.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert image in list of coordinates in Julia<p>I have this short code <code>img_lab = rand(Lab, 10, 10)</code> where I just have created an image of random ...
72,390,161
How to set children not overflow parent?<p>An eternal problem.</p> <p>With my ability, I think that if we want to use scroll view, we have to know exactly the scroll view's height.</p> <p>In <strong>React Native</strong> is easier because we only need to set <code>flex = 1</code> in parent view. And the child view will...
<p>Comment <code>height</code> on <code>.class2</code> and add <code>display: grid</code> to <code>.container</code></p> <p>You can get the same behaviour with <code>flex</code> too.</p> <pre><code> .container { height: 90vh; display: flex; flex-direction: column; } .class1 { backgro...
How to set children not overflow parent?
html|css|angular
0
47
1
72,390,424
72,390,424
1
true
2022-05-26T10:11:00.047Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set children not overflow parent?<p>An eternal problem.</p> <p>With my ability, I think that if we want to use scroll view, we have to know exactly th...
72,361,463
Reading in an integer array, and stopping when a string is entered<pre><code>int [] arr = new int [100]; int count = 0; int val; arr[count] = 0; while(count &lt; arr.Length &amp;&amp; (int.TryParse(arr[count], out val))) { arr[count] = Convert.ToInt32.Console.ReadLine(); } </code></pre> <p>I want the user to enter...
<p>You should read input first using <a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements#the-do-statement" rel="nofollow noreferrer"><code>do..while</code></a> loop and use exit condition to get out of while loop if user enters <code>exit</code></p> <pre><code>do {...
Reading in an integer array, and stopping when a string is entered
c#|arrays|string|integer
-1
47
1
72,361,488
72,361,488
1
true
2022-05-24T10:40:25.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reading in an integer array, and stopping when a string is entered<pre><code>int [] arr = new int [100]; int count = 0; int val; arr[count] = 0; while(count...
72,312,191
unit test bash script function which deletes files older than certain number of days<p>I don't have much experience with bash/shell scripting and just recently started writing some bash scripts with unit tests using Bats framework or libraries. Currently writing a script which needs to delete the files older than certa...
<p>From my perspective, you are asking three separate questions:</p> <ol> <li>Is my code any good?</li> <li>How do I write test in general for BASH</li> <li>How do I test this specific code?</li> </ol> <p>As that sounds more like a request for code review, it might be better suited to <a href="https://codereview.stacke...
unit test bash script function which deletes files older than certain number of days
linux|bash|shell|unit-testing|bats-core
1
47
1
72,328,383
72,328,383
1
true
2022-05-19T23:55:25.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: unit test bash script function which deletes files older than certain number of days<p>I don't have much experience with bash/shell scripting and just recent...
72,253,120
Align text in different containers (flexbox)<p>I have the following:</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-css lang-css prettyprint-override"><code>.container { display: flex; flex-direction: column; }...
<p>As both the <code>&lt;header&gt;</code> and <code>&lt;main&gt;</code> are having a flexbox, choose the first element in <code>header</code> and the first element in <code>main</code> and assign a flex of <code>20%</code> to them. Don't forget to assign <code>100-20%</code> to the second elements of <code>main</code>...
Align text in different containers (flexbox)
css|flexbox
0
47
2
72,253,177
72,253,177
1
true
2022-05-16T00:30:31.290Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Align text in different containers (flexbox)<p>I have the following:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-ba...
72,250,824
List elements getting overwritten in for loop R?<p>I have a bunch of csv files that I'm trying to read into R all at once, with each data frame from a csv becoming an element of a list. The loops largely work, but they keep overriding the list elements. So, for example, if I loop over the first 2 files, both data frame...
<p>Actually, both of your csv reading functions do exactly the same, except that the paths are different.</p> <p>If you find a way to list your files with abstract paths instead of relative paths (just the file names), you wouldn't need to reconstruct the paths like you do. This is possible by <code>full.names = TRUE</...
List elements getting overwritten in for loop R?
r|list|csv|for-loop
0
47
2
72,265,104
72,265,104
1
true
2022-05-15T17:51:42.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: List elements getting overwritten in for loop R?<p>I have a bunch of csv files that I'm trying to read into R all at once, with each data frame from a csv be...
72,343,327
Convert Excel Formula to VBA - Count Upper Case Characters in a String<p>=SUMPRODUCT(LEN($A$7) - LEN(SUBSTITUTE($A$7, CHAR(ROW(INDIRECT(&quot;65:90&quot;))), &quot;&quot;)))</p> <p>This formula above counts the Upper Case Characters in a string. It works great. I can not seem to get it converted to VBA. I am substit...
<p>FYI, you don't need to use <code>INDIRECT()</code> at all with your formula in your worksheets. <code>=SUMPRODUCT(LEN($A$7)-LEN(SUBSTITUTE($A$7,CHAR(ROW(65:90)),&quot;&quot;)))</code> works because of <code>SUMPRODUCT()</code>. Not sure why 'the internet' want to use <code>INDIRECT()</code> when you search for this....
Convert Excel Formula to VBA - Count Upper Case Characters in a String
excel|vba|excel-formula|type-conversion
0
47
1
72,344,056
72,344,056
1
true
2022-05-23T04:38:27.447Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert Excel Formula to VBA - Count Upper Case Characters in a String<p>=SUMPRODUCT(LEN($A$7) - LEN(SUBSTITUTE($A$7, CHAR(ROW(INDIRECT(&quot;65:90&quot;))),...
72,367,563
Detect Huawei app is uninstalled from phone<p>I'm having difficulty figuring out if the user has deleted my app from their Huawei phone when sending a Push.</p> <p>I'm looking at the <a href="https://developer.huawei.com/consumer/en/doc/quickapp-access-push-kit" rel="nofollow noreferrer">push docs</a>, I do not see any...
<p>One gets posted a <a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/msg-receipt-guide-0000001050040176" rel="nofollow noreferrer">receipt state</a> with value <code>2</code>, when the app isn't installed anymore.</p> <blockquote> <p>If the app does not exist after the message is succes...
Detect Huawei app is uninstalled from phone
push-notification|huawei-mobile-services|huawei-developers|huawei-push-notification
1
47
1
72,367,634
72,367,634
1
true
2022-05-24T18:08:04.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Detect Huawei app is uninstalled from phone<p>I'm having difficulty figuring out if the user has deleted my app from their Huawei phone when sending a Push.<...
72,258,643
Excel - custom number format as "## ### ####"<p>I'm looking for a solution to format my number as folow : 123456789 -&gt; 12 345 6789 When I try to use a custom format as &quot;## ### ####&quot; it's not working and Excel return 123 456 789</p> <p>Is there a way to do that ?</p>
<p>If the user defined number format <code>## ### ####</code> results in <code>123 456 789</code> for you, then the space is set to be the thousands separator in your system or your Excel. If so, then a simple space in a number format always means the thousands separator which separates thousands always and nothing els...
Excel - custom number format as "## ### ####"
excel
0
47
2
72,258,821
72,258,821
2
true
2022-05-16T11:42:11.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel - custom number format as "## ### ####"<p>I'm looking for a solution to format my number as folow : 123456789 -&gt; 12 345 6789 When I try to use a cus...
72,294,345
Capture results between delimiters. Content may contain a delimiter character<p>I have the following reg exp: <code>/@\w+(\(((?:(?!\))\S|\s)*)\))?/m</code></p> <p>And the value I'm expecting are template files like:</p> <pre><code>@for($i = 0; $i &lt; 10; $i++) {{ $i }} @endfor @if( !empty($name) &amp;&amp...
<p>You can use</p> <pre class="lang-none prettyprint-override"><code>@\w+(\(((?:[^()]++|(\g&lt;1&gt;))*)\))? </code></pre> <p>See the <a href="https://regex101.com/r/58ZbXe/2" rel="nofollow noreferrer">regex demo</a>.</p> <p><em>Details</em>:</p> <ul> <li><code>@</code> - a <code>@</code> char</li> <li><code>\w+</code>...
Capture results between delimiters. Content may contain a delimiter character
regex
1
47
3
72,294,603
72,294,603
2
true
2022-05-18T18:33:42.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Capture results between delimiters. Content may contain a delimiter character<p>I have the following reg exp: <code>/@\w+(\(((?:(?!\))\S|\s)*)\))?/m</code></...
72,301,239
ClojureDart: Error while host-compiling (ns samples.tables (:require ["package:flutter/material.dart" :as m] [cljd.flutter.alpha as f]))<p>Here is the trace:</p> <p><code>Something horrible happened! :scream: Error while host-compiling (ns samples.tables &quot;Faithful port of https://docs.flutter.dev/cookbook/design/t...
<p>First, make sure you have</p> <pre class="lang-yaml prettyprint-override"><code>dependencies: flutter: sdk: flutter </code></pre> <p>in your pubspec.yaml ; it is used for clojureDart to find flutter librairies. If no, add it, remove the <code>.clojuredart</code> folder, run <code>flutter pub get</code> and t</...
ClojureDart: Error while host-compiling (ns samples.tables (:require ["package:flutter/material.dart" :as m] [cljd.flutter.alpha as f]))
flutter|dart|clojure
2
47
1
72,301,240
72,301,240
2
true
2022-05-19T08:36:44.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ClojureDart: Error while host-compiling (ns samples.tables (:require ["package:flutter/material.dart" :as m] [cljd.flutter.alpha as f]))<p>Here is the trace:...
72,310,571
How to get the minimum of one column and get another column without grouping?<p>I'm trying to get a record from a table that has the minimum value of a specific column, but I want the rest of the data in that record without grouping one of the columns.</p> <p>This is sample data:</p> <p><a href="https://i.stack.imgur.c...
<p>One option is to use analytic function which &quot;ranks&quot; data; then fetch rows that rank as the <em>highest</em>. Something like this:</p> <p>Sample data:</p> <pre><code>SQL&gt; with test (month, day, c_initial, ending) as 2 (select 'jan', 24, 0, 3 from dual union all 3 select 'jan', 24, 1, 6 from d...
How to get the minimum of one column and get another column without grouping?
sql|oracle
0
47
2
72,310,612
72,310,612
2
true
2022-05-19T20:12:03.813Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the minimum of one column and get another column without grouping?<p>I'm trying to get a record from a table that has the minimum value of a speci...
72,312,495
Java, Type mismatch when extending abstract class<p>I don't understand why data.entrySet() and data.keySet() in the code below are giving me Type Mismatch in eclipse, though I specified the type in both cases in the for loop.</p> <p>Is this normal or am I missing something that should I take into account when extending...
<p>Your generics are out of whack. You are getting a warning on the line <code>class TreeSetDuplicates&lt;K&gt; extends SetDuplicates {</code>, and when the compiler gives you warnings you don't understand perhaps it is best to focus on those first.</p> <p>The problem is, <em>every</em> mention of <code>SetDuplicates</...
Java, Type mismatch when extending abstract class
java
1
47
2
72,312,531
72,312,531
2
true
2022-05-20T00:55:24.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java, Type mismatch when extending abstract class<p>I don't understand why data.entrySet() and data.keySet() in the code below are giving me Type Mismatch in...
72,321,381
renaming the column names in dataframe using some parts of original column name<p>I have this huge data frame with very long column names</p> <pre><code>import pandas as pd df = pd.DataFrame({'mynumber': [11, 20, 25], 'Raja_trial1:gill234_pit_type_id@rng': [4, 5, 42], 'Raja_trial1:Perm_...
<p>You can achieve this with a single regex:</p> <pre><code>df.columns = df.columns.str.replace(r'.*?([^_]+:).+?([^_]+_[^_]+)@.*', r'\1\2', regex=True) </code></pre> <p>output:</p> <pre><code> mynumber trial1:type_id trial1:king_que fer45:gul_har23 chb1:kaam_nix 0 11 ...
renaming the column names in dataframe using some parts of original column name
pandas|dataframe|multiple-columns
-1
47
2
72,321,977
72,321,977
2
true
2022-05-20T15:25:27.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: renaming the column names in dataframe using some parts of original column name<p>I have this huge data frame with very long column names</p> <pre><code>impo...
72,339,421
What's the ideal data modeling for app with multi-filters?<p>Viewed the Firestore docs + Google's I/O 2019 webinar, but I'm still not clear about the right data modeling for my particular use case.</p> <ol> <li>App lets pro service providers register and publish one or more of their services in pre-defined categories (...
<blockquote> <p>App lets pro service providers register and publish one or more of their services in pre-defined categories (Stay, Sports, Wellness...) and at pre-defined price points (50$, 75$, 100$...).</p> </blockquote> <p>Since you're having pre-defined categories, prices, and locations, then the simplest solution ...
What's the ideal data modeling for app with multi-filters?
firebase|google-cloud-platform|google-cloud-firestore|nosql|data-modeling
0
47
1
72,345,518
72,345,518
2
true
2022-05-22T16:32:26.710Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the ideal data modeling for app with multi-filters?<p>Viewed the Firestore docs + Google's I/O 2019 webinar, but I'm still not clear about the right d...
72,348,664
How to set column value based on string (mis)match between two other columns?<p>I want to create a match variable in a dataframe that</p> <ul> <li>is 1 if the value of another variable (string) is contained in the value of a third variable (string)</li> <li>is 0 if that is not the case</li> <li>and is NA if either of t...
<pre class="lang-r prettyprint-override"><code>library(tidyverse) data &lt;- tribble( ~str1, ~str2, ~match, &quot;left&quot;, &quot;right&quot;, &quot;-&quot;, &quot;right&quot;, &quot;somewhat left&quot;, &quot;-&quot;, &quot;left&quot;, &quot;very left&quot;, &quot;-&quot;, &quot;right&quot;, &quot;right&q...
How to set column value based on string (mis)match between two other columns?
r|string|dataframe|conditional-statements|match
1
47
2
72,348,839
72,348,839
2
true
2022-05-23T12:39:24.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set column value based on string (mis)match between two other columns?<p>I want to create a match variable in a dataframe that</p> <ul> <li>is 1 if th...
72,257,064
CF7 jquery custom text on submit<p>I have a simple radio button on CF7</p> <pre><code>[radio radio-698 id:domanda2 use_label_element default:1 &quot;0.Nessuna Risposta&quot; &quot;risposta1&quot; &quot;risposta2&quot;] [submit &quot;Invia&quot;] </code></pre> <p>I want to display text &quot;Hello Word&quot; by jquery w...
<p>There's a few simple issues with your jQuery. This should work for you assuming that there is an item with selector <code>#field1</code>.</p> <p>Note, you can't get the value of an input in a radio or checkbox without specifying that it's the <code>:checked</code> one.</p> <pre><code>jQuery( function ($) { $(doc...
CF7 jquery custom text on submit
jquery|wordpress|contact-form-7
1
47
1
72,364,216
72,364,216
2
true
2022-05-16T09:35:10.160Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CF7 jquery custom text on submit<p>I have a simple radio button on CF7</p> <pre><code>[radio radio-698 id:domanda2 use_label_element default:1 &quot;0.Nessun...
72,364,707
calculate sum of a column based on another col<p>My df looks like this:</p> <pre><code>value type 12 x 34 z 54 x 14 y </code></pre> <p>I want to create a new column <code>df.sum</code> where I want to do a sum of the value col but only where the <code>type == x</code>. The remaining rows shou...
<p>If you want to handle a single type (only <code>x</code>):</p> <pre><code>mask = df['type'].eq('x') df.loc[mask, 'sum'] = df.loc[mask, 'value'].sum() </code></pre> <p>if you might need to handle several:</p> <pre><code>types = ['x'] # add others, e.g.: types = ['x', 'y'] df.loc[df['type'].isin(types), 'sum'] = (df.g...
calculate sum of a column based on another col
python|python-3.x|pandas|dataframe|numpy
1
47
2
72,364,785
72,364,785
2
true
2022-05-24T14:28:57.607Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: calculate sum of a column based on another col<p>My df looks like this:</p> <pre><code>value type 12 x 34 z 54 x 14 y </code></pre...
72,374,047
Mongoose return all documents that contain a value wherever inside a property<p>Lets say my documents look like this :</p> <pre><code> _id: &quot;6285e9a7aff93ead37ec50ad&quot;, date: &quot;2022-04-28T10:51:37.923Z&quot;, devices: { tablets: [ { brand: &quot;samsung&quot;, model: &quot;s...
<p>When you have more dynamic keys, you can use</p> <pre><code>db.collection.aggregate([ { $project: { &quot;d&quot;: { &quot;$objectToArray&quot;: &quot;$devices&quot; } } }, { &quot;$match&quot;: { &quot;d.v.brand&quot;: &quot;apple&quot; } } ]) </code></pre> <p>You n...
Mongoose return all documents that contain a value wherever inside a property
mongodb|mongoose|mongodb-query|mongoose-schema
2
47
1
72,374,233
72,374,233
2
true
2022-05-25T08:08:36.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mongoose return all documents that contain a value wherever inside a property<p>Lets say my documents look like this :</p> <pre><code> _id: &quot;6285e9a7a...
72,376,499
Listing all my kafka consumers informations<p>I want to list all my kafka consumers and inspect their state, group ...</p> <p>Before I was using just spring-kafka so I did the following and it works</p> <pre><code>private final KafkaListenerEndpointRegistry kafkaListenerEndpointRegistry; var listenerContainers = kafka...
<p>With Spring Cloud Stream, add a <code>ListenerContainerCustomizer</code> bean and capture each listener container (e.g. store them in a list).</p> <pre class="lang-java prettyprint-override"><code>List&lt;AbstractMessageListenerContainer&lt;?, ?&gt;&gt; containers = new ArrayList&lt;&gt;(); @Bean ListenerContainerC...
Listing all my kafka consumers informations
spring-kafka|spring-cloud-stream
0
47
1
72,450,741
72,450,741
2
true
2022-05-25T11:07:27.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Listing all my kafka consumers informations<p>I want to list all my kafka consumers and inspect their state, group ...</p> <p>Before I was using just spring-...
72,254,269
Dataframe slicing with two indices<p>I got the following dataframe,df, with the <code>report_date</code> as the index:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>report_date</th> <th>sales</th> </tr> </thead> <tbody> <tr> <td>2021-06-30</td> <td>130000</td> </tr> <tr> <td>2021-06-30</t...
<p>For match values is possible convert <code>DatetimeIndex</code> to months periods and test membership by <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.isin.html" rel="nofollow noreferrer"><code>Index.isin</code></a>:</p> <pre><code>#if necessary #df.index = pd.to_datetime(df.index) ...
Dataframe slicing with two indices
python|pandas|dataframe|slice
1
47
2
72,254,382
72,254,382
2
true
2022-05-16T04:50:45.923Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dataframe slicing with two indices<p>I got the following dataframe,df, with the <code>report_date</code> as the index:</p> <div class="s-table-container"> <t...
72,390,721
Why would commands in selenium works seperately but if put in script selenium does'nt locate the elements<p>The problem i am facing is when i run the whole script it throws error of element not clickable or not found. While when i run it command per command it works.</p> <p>If anyone can explain the reason and why it b...
<p>I reproduced your problem and had the same error. What i did to fix it is just scroll to the element before clicking it.<br /> Try this out</p> <pre><code>driver.find_element(By.XPATH, &quot;//div[@id=\'Content_C164_Col00\']/div/div/div[2]/div/div/div/div/div/button/span/span/span[3]&quot;).click() driver.find_elem...
Why would commands in selenium works seperately but if put in script selenium does'nt locate the elements
python|selenium|selenium-webdriver|web-scraping
-1
47
2
72,391,371
72,391,371
2
true
2022-05-26T10:58:51.527Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why would commands in selenium works seperately but if put in script selenium does'nt locate the elements<p>The problem i am facing is when i run the whole s...
72,310,848
Doubling one letter with each new occurence<p>so I have task to double number of letter &quot;a&quot; every time it occurs in a string. For example sentence &quot;a cat walked on the road&quot; , at the end must be &quot;aa caaaat waaaaaaaalked on the roaaaaaaaaaaaaaaaa&quot; . I had something like this on my mind but ...
<p>You need to check what the <code>char a</code> is (in your case, 'a'). Additionally, you do not repeat the characters more than twice in your code, hence not getting the answer you expected: <code>result = result + a + a</code> only adds 'a' twice, <strong>not</strong> giving you: &quot;aa caaaat waaaaaaaalked...&qu...
Doubling one letter with each new occurence
java|string|character|letter
-1
47
3
72,311,047
72,311,047
2
true
2022-05-19T20:42:17.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Doubling one letter with each new occurence<p>so I have task to double number of letter &quot;a&quot; every time it occurs in a string. For example sentence ...
72,356,683
Optimize mongoDB query to get count of items from separate collection<p>I have two collections namely &quot;tags&quot; and &quot;bookmarks&quot;.</p> <pre><code>Tags documents: { &quot;taggedBookmarksCount&quot;: 2, &quot;taggedNotesCount&quot;: 0, &quot;_id&quot;: &quot;62...
<p>You can do as below</p> <pre><code>db.bookmark.aggregate([ { &quot;$unwind&quot;: &quot;$bookmarkTags&quot; //Reshape tags }, { &quot;$lookup&quot;: { //Do a join &quot;from&quot;: &quot;tags&quot;, &quot;localField&quot;: &quot;bookmarkTags.tagId&quot;, &quot;foreignField&quot;: &quo...
Optimize mongoDB query to get count of items from separate collection
node.js|mongodb|mongoose
1
47
1
72,357,061
72,357,061
2
true
2022-05-24T02:45:54.740Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Optimize mongoDB query to get count of items from separate collection<p>I have two collections namely &quot;tags&quot; and &quot;bookmarks&quot;.</p> <pre><c...
72,368,917
Class cannot implement TypeScript interface when using static methods<p>TypeScript recognises <code>static</code> class methods as valid properties that adhere to an interface when passing the class object as an argument, however it does not like them when the same interface is used to implement the class.</p> <p>E.g. ...
<p><a href="https://www.typescriptlang.org/docs/handbook/2/classes.html#implements-clauses" rel="nofollow noreferrer">An <code>implements</code> clause on a <code>class</code> declaration</a> tells the compiler to check that <em>instances</em> of the class are assignable to the implemented type. You use <code>implemen...
Class cannot implement TypeScript interface when using static methods
typescript
1
47
1
72,371,663
72,371,663
2
true
2022-05-24T20:08:28.727Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Class cannot implement TypeScript interface when using static methods<p>TypeScript recognises <code>static</code> class methods as valid properties that adhe...
72,319,377
SQL: Joining tables with WHERE clauses<p>I am trying to join two tables that share the same individual ID (<code>key</code>). The first table (<code>a</code>) is a 'wide' table with many variables including <code>key</code> and <code>age</code>, and the second table (<code>b</code>) is a 'long' table, including only th...
<p><s>Think this could be solved without subqueries/SELECTs inside of joins:</s></p> <h2>SQL Server</h2> <pre><code> SELECT a.key, a.age, b.diagnosis FROM a INNER JOIN b ON b.key = a.key WHERE b.diagnosis IN ('a', 'b', 'c') AND b.diagnosis_code = 1 AND a.key IN (SELECT b1.key FROM b AS b1...
SQL: Joining tables with WHERE clauses
sql|join
-1
47
1
72,319,514
72,319,514
2
true
2022-05-20T13:02:23.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL: Joining tables with WHERE clauses<p>I am trying to join two tables that share the same individual ID (<code>key</code>). The first table (<code>a</code>...
72,310,156
a shorter way to change some object values to uppercase<p>I have a large object and need to change some values (<strong>not all of them</strong>) to upperCase</p> <pre><code>obj.state = obj.state.toUpperCase(); obj.city = obj.city.toUpperCase(); obj.street = obj.street.toUpperCase(); obj.title = obj.title.toUpperCase()...
<p>You can iterate through all the keys of the object and do something like this:</p> <pre class="lang-js prettyprint-override"><code>for (const k of Object.keys(obj)) { obj[k] = obj[k].toUpperCase() } </code></pre> <p>If you only want to update some of the values, you can filter the keys:</p> <pre class="lang-js pre...
a shorter way to change some object values to uppercase
javascript|uppercase
0
47
1
72,310,179
72,310,179
2
true
2022-05-19T19:30:52.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: a shorter way to change some object values to uppercase<p>I have a large object and need to change some values (<strong>not all of them</strong>) to upperCas...
72,292,158
How to plot variable arrowheads AND variable colors?<p>Is there any way to have variable arrowheads AND variable colors?</p> <p>I know that I can define different arrowstyle with different heads. However, if I am using variable arrowstyle I cannot set a variable color. I will get an error:</p> <blockquote> <p>duplicate...
<p>You come up with such great corner cases! I love it. The intended way to do this is to set <code>lc rgb variable</code> or <code>lc variable</code> in the arrow style itself.</p> <pre><code>set style arrow 1 backhead lw 3 lc rgb variable set style arrow 2 nohead lw 3 lc rgb variable set style arrow 3 head lw 3...
How to plot variable arrowheads AND variable colors?
gnuplot
2
47
2
72,299,092
72,299,092
2
true
2022-05-18T15:38:57.240Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to plot variable arrowheads AND variable colors?<p>Is there any way to have variable arrowheads AND variable colors?</p> <p>I know that I can define diff...
72,248,702
MongoDb - Return bulks of N elements from the end of a nested array looping backwards at each call (pagination)<p>I have a collection of categories, and each category has its array of <code>_id</code> from a different collection. My goal is to create an infinite scrolling by giving N records every time but from the end...
<p>You can so something like:</p> <p><strong>EDIT:</strong> to support edge cases:</p> <pre><code>db.collection.aggregate([ { $match: {_id: ObjectId(&quot;625167ce3859b8465ccf69dc&quot;)} }, { $addFields: { avilableCount: {$max: [ {$subtract: [{$size: &quot;$tracks&quot; }, bulkSize * iterat...
MongoDb - Return bulks of N elements from the end of a nested array looping backwards at each call (pagination)
mongodb|pagination|mongodb-query|aggregate
0
47
1
72,249,618
72,249,618
2
true
2022-05-15T13:30:29.077Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MongoDb - Return bulks of N elements from the end of a nested array looping backwards at each call (pagination)<p>I have a collection of categories, and each...
72,248,062
How to fix the missing order of id in the pandas dataset?<p>I am trying to fix one issue with this dataset. The link is <a href="https://grouplens.org/datasets/movielens/10m/" rel="nofollow noreferrer">here</a>. So, I loaded the dataset this way.</p> <pre><code>df = pd.read_csv('ratings.csv', sep='::', names=['user_id'...
<p>Here's a way to do this:</p> <pre class="lang-py prettyprint-override"><code>df2 = df.groupby('user_id').count().reset_index() df2 = df2.assign(new_user_id=df2.index + 1).set_index('user_id') df = df.join(df2['new_user_id'], on='user_id').drop(columns=['user_id']).rename(columns={'new_user_id':'user_id'}) df2 = df....
How to fix the missing order of id in the pandas dataset?
python|pandas
0
47
1
72,248,242
72,248,242
2
true
2022-05-15T12:01:25.533Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix the missing order of id in the pandas dataset?<p>I am trying to fix one issue with this dataset. The link is <a href="https://grouplens.org/datase...
72,293,934
Regular Expression Stopping at Specified Value<p>I have to use a regular expression to parse values out of a swift message and there are some situations where the behaviour is not what I want.</p> <p>Lets say I am after something with a particular pattern - in this case a BIC (6 letters, followed by 2 letters or digits...
<p>Change <code>.*?</code> to <code>[^:]*?</code>:</p> <pre><code>(52A:[^:]*?[A-Z]{6}[A-Z0-9]{2}[XXX0-9]{0,3}) </code></pre> <p><code>[^:]</code> means &quot;any character except :&quot;, which ensures the match doesn't run into the next field.</p> <p>See <a href="https://rubular.com/r/wK5evDWKRtFRDp" rel="nofollow nor...
Regular Expression Stopping at Specified Value
regex
1
47
2
72,294,121
72,294,121
2
true
2022-05-18T18:00:22.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regular Expression Stopping at Specified Value<p>I have to use a regular expression to parse values out of a swift message and there are some situations wher...
72,270,349
Why does assignment to int and float are not generating error whereas assignment to while does generate error?<h2>Source:</h2> <pre><code>int = 33 float = 0.0 while = 33 </code></pre> <h2>Output:</h2> <pre><code>while = 33 ^ SyntaxError: invalid syntax </code></pre> <p>Why does assignment to <strong>int</st...
<p><code>while</code> is a <a href="https://docs.python.org/3/reference/lexical_analysis.html#keywords" rel="nofollow noreferrer">keyword</a>. Keywords are essential parts of the language that cannot be used as variable names.</p> <p><code>int</code> and <code>float</code> are <a href="https://docs.python.org/3/library...
Why does assignment to int and float are not generating error whereas assignment to while does generate error?
python|python-3.x|syntax-error|assignment-operator
-1
47
1
72,270,566
72,270,566
2
true
2022-05-17T08:09:37.683Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does assignment to int and float are not generating error whereas assignment to while does generate error?<h2>Source:</h2> <pre><code>int = 33 float = 0...
72,247,839
How to manually invoke actionPerformed in Java?<p>The method <code>actionPerformed</code> of class <code>ActionListener</code> is invoked when we <strong>click</strong> on a (let say) JButton. I want to run this method manually in a program. Is it possible? Here is an example:</p> <pre><code>button.addActionListener(ne...
<p>You can:</p> <ul> <li>Call <code>.doClick()</code> on the button</li> <li>Simply call <code>actionPerformed(null)</code> on the method ... difficult if the method is in an anonymous class</li> <li>Call <code>getActionListeners()</code> on the JButton and iterate through the <code>ActionListener[]</code> array that i...
How to manually invoke actionPerformed in Java?
java|swing|actionlistener
0
47
1
72,247,856
72,247,856
2
true
2022-05-15T11:29:33.747Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to manually invoke actionPerformed in Java?<p>The method <code>actionPerformed</code> of class <code>ActionListener</code> is invoked when we <strong>cli...
72,391,328
Is there a function in R that lets me create a new column with (1) the full country names and (2) the respective continent?<p>In my dataset I have only the country codes given. I managed to get the full country names, however for some reason I cannot create a new column with the full country names &amp; consequently ca...
<p>Are you looking for</p> <pre><code>library(countrycode) df &lt;- data.frame(country_code = mycodes, country_name = countrycode(sourcevar = mycodes, origin = &quot;iso3c&quot;, destination = &quot;country.name&quot;), continent = countrycode(source...
Is there a function in R that lets me create a new column with (1) the full country names and (2) the respective continent?
r|country-codes
0
47
2
72,391,649
72,391,649
2
true
2022-05-26T11:48:07.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a function in R that lets me create a new column with (1) the full country names and (2) the respective continent?<p>In my dataset I have only the c...
72,262,690
On the Snowflake Users page, what does "Create New User for Service Account" mean? Why does this link show up for two of my snowflake users?<p>For two of my snowflake user accounts, an icon is showing up on the right that has a popup when I hover over it:</p> <p><a href="https://i.stack.imgur.com/kCe74.png" rel="nofoll...
<p>The icon appears when a comment is set for the user. This comment can be set by yourself for a user to determine what is the purpose of it.</p> <p>You may un/set it using the statements:</p> <pre><code>alter user user1 set comment='Create New User for Service Account'; alter user user1 unset comment; </code></pr...
On the Snowflake Users page, what does "Create New User for Service Account" mean? Why does this link show up for two of my snowflake users?
snowflake-cloud-data-platform
1
47
1
72,263,486
72,263,486
3
true
2022-05-16T16:40:22.557Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: On the Snowflake Users page, what does "Create New User for Service Account" mean? Why does this link show up for two of my snowflake users?<p>For two of my ...
72,283,117
Scala: How to get all keys from Option[Map[String, Int]]?<p>I have this val: <code>val offsets: Option[Map[String, Int]] = jsonOffsets.get(topic)</code></p> <p>How do I get all the keys from <code>offsets</code>? Is it <code>offsets[0]</code>, <code>offsets.keys</code> isn't working.</p>
<p><code>offsets</code> is an <code>Option</code>, so it may or may not contain a <code>Map</code>. Use pattern matching to handle that:</p> <pre><code>offsets match { case Some(map) =&gt; // Whatever you want to do with the map case None =&gt; // What should you do when there's no map? } </code></pre> <p>If yo...
Scala: How to get all keys from Option[Map[String, Int]]?
scala
0
47
1
72,283,199
72,283,199
3
true
2022-05-18T04:12:14.760Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Scala: How to get all keys from Option[Map[String, Int]]?<p>I have this val: <code>val offsets: Option[Map[String, Int]] = jsonOffsets.get(topic)</code></p> ...
72,342,044
Can you have an echo in a echo PHP<p>Im trying to get the second echo to echo out the message but the first echo dont let me. I know the second echo works and the first too but when I but them together it wont work. Also im new to this so help is appreciated.</p> <pre><code>echo '&lt;h1 class=&quot;text-center text-inf...
<p>use concat</p> <pre><code>echo '&lt;h1 class=&quot;text-center text-info&quot; &gt;J!inder&lt;/h1&gt; &lt;br&gt; &lt;div class=&quot;container d-flex justify-content-around&quot; &gt; ' . $create-&gt;profilerand(). ' &lt;/div&gt;'; </code></pre>
Can you have an echo in a echo PHP
php|echo
0
47
2
72,342,057
72,342,057
3
true
2022-05-22T23:52:54.743Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can you have an echo in a echo PHP<p>Im trying to get the second echo to echo out the message but the first echo dont let me. I know the second echo works an...
72,352,417
How to Convert CYYMM to YYYY-MM<p>I have some date columns that are formatted as CYYMM (e.g. 12012). I would like to convert these to a typical data representation in SQL Server.</p> <p>FYI. C stands for century.</p> <p>E.g. 12012 should be 2020-12 (for December of 2020)</p> <p>Another</p> <p>11210 should be 2012-10 (f...
<p>Assuming first character would be 1 or 0</p> <pre><code>declare @dte int = 02012; Select left((@dte/10000+19),2)+stuff(right(@dte,4),3,0,'-') </code></pre> <p><strong>Results</strong></p> <pre><code>1920-12 </code></pre>
How to Convert CYYMM to YYYY-MM
sql|sql-server|date
1
47
1
72,352,534
72,352,534
3
true
2022-05-23T17:12:25.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Convert CYYMM to YYYY-MM<p>I have some date columns that are formatted as CYYMM (e.g. 12012). I would like to convert these to a typical data represen...
72,396,995
Python get vaule conditional instead of if else<p>I'm in the following situation:</p> <pre><code>title_value = clean_result['format']['tags'].get('title') </code></pre> <p>... sometimes <code>title</code> is pure uppercase. Can I handle this more efficiently than using the <code>if-else</code> clause here?</p> <p>Somet...
<p>Unfortunately, when the item in the data is not case sensitive, this can get a bit more messy. This is because not knowing the key makes things a bit more difficult. You could try something like this:</p> <pre class="lang-py prettyprint-override"><code>tags = clean_result.get('format',{}).get('tags',{}) title_value ...
Python get vaule conditional instead of if else
python
1
47
5
72,397,114
72,397,114
3
true
2022-05-26T19:22:35.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python get vaule conditional instead of if else<p>I'm in the following situation:</p> <pre><code>title_value = clean_result['format']['tags'].get('title') </...
72,248,741
Why does the thirteen.org date library return dates in the same year for a 53-week year (for week 53)?<p>Using the <a href="https://www.threeten.org/threeten-extra" rel="nofollow noreferrer">https://www.threeten.org/threeten-extra</a> library.</p> <p>When computing the first Sunday of the month, given week number and y...
<p>This is what <a href="https://www.threeten.org/threeten-extra/apidocs/org.threeten.extra/org/threeten/extra/YearWeek.html#of(int,int)" rel="nofollow noreferrer"><code>YearWeek.of</code></a> does:</p> <blockquote> <p>Obtains an instance of YearWeek from a week-based-year and week.</p> <p>If the week is 53 and the yea...
Why does the thirteen.org date library return dates in the same year for a 53-week year (for week 53)?
java
1
47
1
72,249,175
72,249,175
3
true
2022-05-15T13:35:23.207Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does the thirteen.org date library return dates in the same year for a 53-week year (for week 53)?<p>Using the <a href="https://www.threeten.org/threeten...
72,250,131
How to call a method from a dynamically instantiated class in PHP?<p>I'm dinamically instantiating a class, but I want to know if there's a way to call a method from this instance, thanks</p> <p><strong>Code</strong>:</p> <pre class="lang-php prettyprint-override"><code> if(class_exists($class_name)){ $class = new...
<p>In php use the arrow to call the class's function.</p> <pre><code>$class.method(); </code></pre> <p>should be</p> <pre><code>$class-&gt;method(); </code></pre> <p>alternatively if your method is declared as static you can use it like so</p> <pre><code>foo::method(); </code></pre>
How to call a method from a dynamically instantiated class in PHP?
php|class|oop|methods|instance
0
47
1
72,250,189
72,250,189
3
true
2022-05-15T16:24:25.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to call a method from a dynamically instantiated class in PHP?<p>I'm dinamically instantiating a class, but I want to know if there's a way to call a met...
72,311,314
C++ variadic template: typeid of it, way to optimize<p>So, I learn variadic templates and usage of it. Now I made that code below. The question is does some other methode exist for getting type of &quot;Params&quot; without any arrays or inilialized_list?</p> <pre><code>template&lt;class Type, class... Params&gt; void ...
<p>In C++17 and later, you can do something like this:</p> <pre><code>template&lt;class Type, class... Params&gt; void InsertInVector(std::vector&lt;Type&gt;&amp; v, const Params&amp;... params) { static_assert((std::is_convertible_v&lt;Params, Type&gt; &amp;&amp; ...)); v.insert(v.end(), {params}); } </code></pre>
C++ variadic template: typeid of it, way to optimize
c++|variadic-templates
1
47
1
72,311,361
72,311,361
3
true
2022-05-19T21:34:16.263Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C++ variadic template: typeid of it, way to optimize<p>So, I learn variadic templates and usage of it. Now I made that code below. The question is does some ...
72,280,652
Creating dummy variables from a string column in pandas<p>So I have a pandas df as follows and my goal is to take the <code>MATCHUP</code> column and make it several more dummy columns.</p> <pre><code>INDICATOR MATCHUP 1 [ &quot;APPLE&quot;, &quot;GRAPE&quot; ] 1 [ &quot;APPLE&quot;, &quot;GRAP...
<p>Check <code>explode</code> with <code>str.get_dummies</code></p> <pre><code>import ast df = df.join(df['MATCHUP'].map(ast.literal_eval).explode().str.get_dummies().groupby(level=0).sum()) </code></pre>
Creating dummy variables from a string column in pandas
python|pandas
1
47
1
72,280,672
72,280,672
3
true
2022-05-17T21:02:04.880Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating dummy variables from a string column in pandas<p>So I have a pandas df as follows and my goal is to take the <code>MATCHUP</code> column and make it...
72,347,414
How can I create a loop with my conditions<p>i am looking for help. We need to write a program that prints all numbers in the range of (n -20,n + 20). In addition, the program asks you beforehand to input a number. If that number is not even or multiple of 10, you need to take a guess again. Only if the number is even ...
<p>You can simply do:</p> <pre><code>while True: i = int(input(&quot;please enter a number: &quot;)) if i % 10 == 0: for x in range(i-20,i+21): print(x) break </code></pre> <p>It will keep on asking until it satisfies the condition.</p>
How can I create a loop with my conditions
python|loops
1
47
3
72,347,479
72,347,479
3
true
2022-05-23T10:58:29.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I create a loop with my conditions<p>i am looking for help. We need to write a program that prints all numbers in the range of (n -20,n + 20). In add...
72,241,071
How to do a new data frame of the latest value reported in each column?<p>I've got a table like this:</p> <pre><code>country continent date n_case Ex TD TC -------------------------------------------------------------------------------- Italy Europe 2022-02-24 6...
<p>With <code>dplyr</code>, you can sort the data by dates decreasingly and then select the first non-NA value in each column.</p> <pre class="lang-r prettyprint-override"><code>library(dplyr) df %&gt;% group_by(country, continent) %&gt;% arrange(desc(date), .by_group = TRUE) %&gt;% summarise(across(everything(...
How to do a new data frame of the latest value reported in each column?
r|dataframe
1
47
1
72,241,155
72,241,155
3
true
2022-05-14T14:19:41.293Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to do a new data frame of the latest value reported in each column?<p>I've got a table like this:</p> <pre><code>country continent date n...
72,273,528
Remove duplicate objects with condition<p>Suppose I have a list of objects like this:</p> <pre><code>let b = [ { name: &quot;test1&quot;, connectedTo: &quot;&quot;, }, { name: &quot;test1&quot;, connectedTo: &quot;test1.test2.test3&quot; }, { name: &quot;test2&quot;, connectedTo: &quo...
<p>Here's an approach utilizing <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce" rel="nofollow noreferrer"><code>Array#reduce</code></a> function:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snipp...
Remove duplicate objects with condition
javascript
2
47
1
72,273,639
72,273,639
4
true
2022-05-17T11:49:30.230Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove duplicate objects with condition<p>Suppose I have a list of objects like this:</p> <pre><code>let b = [ { name: &quot;test1&quot;, connecte...
72,297,615
Vue handle null in nasted array<p>I'm from Ruby language so sorry for noob question. I've got this response from API:</p> <pre><code>[{:id=&gt;&quot;61b79d02a0f6af001374744e&quot;, :name=&gt;&quot;Waffle Crewneck&quot;, :code=&gt;&quot;FW22KS000&quot;, :result=&gt;{&quot;status&quot;=&gt;&quot;Success&quot;, &quo...
<p>There's the same thing in TypeScript, called optional chaining. See: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining</a></p> <pre><code>{{ pr...
Vue handle null in nasted array
javascript|vue.js
1
47
2
72,297,635
72,297,635
4
true
2022-05-19T01:19:01.593Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vue handle null in nasted array<p>I'm from Ruby language so sorry for noob question. I've got this response from API:</p> <pre><code>[{:id=&gt;&quot;61b79d02...
72,398,018
How to convert a condition check from C# to Java?<p>I am attempting to convert this line of code from C# TO Java and I am having quite a hard time wrapping my head around it.</p> <pre><code>isEqual = !dbCertDict.Keys.Any(x =&gt; !String.Equals(dbCertDict[x], requestCertDict.ContainsKey(x) ? requestCertDict[x] : &quot;&...
<pre><code>isEqual = !dbCertDict.Keys.Any(x =&gt; !String.Equals(dbCertDict[x], requestCertDict.ContainsKey(x) ? requestCertDict[x] : &quot;&quot;, StringComparison.OrdinalIgnoreCase)); boolean isEqual = !dbCertDict.keySet().stream().anyMatch(x -&gt; dbCertDict.get(x).equalsIgnoreCase(requestCertDict.containsKey(x) ?...
How to convert a condition check from C# to Java?
java|c#|code-conversion
1
47
1
72,398,169
72,398,169
4
true
2022-05-26T21:08:06.090Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert a condition check from C# to Java?<p>I am attempting to convert this line of code from C# TO Java and I am having quite a hard time wrapping m...
72,322,047
Sequence of letters to sequence of numbers R<p>I have a data frame that looks like:</p> <pre><code>df &lt;- as.data.frame(c(&quot;AAA&quot;, &quot;AAB&quot;, &quot;AAC&quot;, &quot;BBA&quot;)) df 1 AAA 2 AAB 3 AAC 4 ...
<p>In <code>base R</code>, we can use <code>chartr</code></p> <pre><code>df[[1]] &lt;- chartr(&quot;ABC&quot;, &quot;123&quot;, df[[1]]) df[[1]] #[1] &quot;111&quot; &quot;112&quot; &quot;113&quot; &quot;221&quot; </code></pre> <hr /> <p>In case if the values that replaces have more than one character, then a general s...
Sequence of letters to sequence of numbers R
r|string|numbers
2
47
4
72,322,056
72,322,056
5
true
2022-05-20T16:25:23.650Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sequence of letters to sequence of numbers R<p>I have a data frame that looks like:</p> <pre><code>df &lt;- as.data.frame(c(&quot;AAA&quot;, &quot;AAB&quot;,...
72,240,452
No context error in Java, but the context is set immediately after window creation<p>I'm trying to make a game using LWJGL 3, but I get this error: <code>No context is current or a function that is not available in the current context was called.</code></p> <p>This error means that these methods were not called:</p> <p...
<p><code>GL11.glGenLists</code> is deprecated. Switch to using the <code>GLFW_OPENGL_COMPAT_PROFILE</code> instead.</p>
No context error in Java, but the context is set immediately after window creation
java|opengl|lwjgl|glfw
-3
47
1
72,249,012
72,249,012
-2
true
2022-05-14T13:02:12.713Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No context error in Java, but the context is set immediately after window creation<p>I'm trying to make a game using LWJGL 3, but I get this error: <code>No ...
72,383,204
SQL statement complicated INNER JOIN<p>In my database I have two tables:</p> <pre><code>user, columns: id, username friends, columns: this_friend_id, that_friend_id </code></pre> <p>On my website, users can send each other friend requests, and when one user accepts the friend request of an other user, an entry in the...
<p>So you've got the order of operators the wrong way around. The operator order of a simple query should be:</p> <ul> <li>SELECT</li> <li>FROM</li> <li>JOIN</li> <li>WHERE</li> <li>ORDER</li> </ul> <p>So your query would turn into:</p> <pre><code>SELECT user.id, friends.this_friend_id, friends.that_friend_id FROM fri...
SQL statement complicated INNER JOIN
sql|mariadb|inner-join
-2
47
2
72,383,400
72,383,400
-1
true
2022-05-25T19:29:21.850Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL statement complicated INNER JOIN<p>In my database I have two tables:</p> <pre><code>user, columns: id, username friends, columns: this_friend_id, that_fr...
72,972,430
string split with the value of another clumn PySpark<p>I have the following data frame</p> <pre><code>+----+-------+ |item| path| +----+-------+ | -a-| a-b-c| | -b-| e-b-f| | -d-|e-b-d-h| | -c-| g-h-c| +----+-------+ </code></pre> <p>i want it to split path column with value of the item column in the same index</p...
<p>using <code>.fillna(&quot;&quot;)</code> to fill null value to &quot;&quot;. Like this:<code>org = org.fillna(&quot;&quot;).withColumn('crb_url', split_udf('path','item')[0])</code></p>
string split with the value of another clumn PySpark
python|pyspark
0
47
1
72,975,785
72,975,785
1
true
2022-07-13T20:43:04.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: string split with the value of another clumn PySpark<p>I have the following data frame</p> <pre><code>+----+-------+ |item| path| +----+-------+ | -a-| a-...
72,814,682
Executing a callback only when reaching a certain state without user interactions<p>Our app receives a notification with a PendingIntent that when clicked, opens the following screen:</p> <pre><code>@Composable fun IntermediateMonthlyBillings( onDataAcquired: (AllStatementsByYear) -&gt; Unit, myEwayLoggedInView...
<p><code>LaunchedEffect</code> with <code>statementsByYear == null</code> <code>key</code> would run twice . First when statement is <strong>true</strong> then it changes to <strong>false</strong></p> <pre><code>LaunchedEffect(statementsByYear == null) { if (statementsByYear == null) { GenericLoader(type = ...
Executing a callback only when reaching a certain state without user interactions
kotlin|android-jetpack-compose
1
47
1
72,817,231
72,817,231
1
true
2022-06-30T11:04:48.190Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Executing a callback only when reaching a certain state without user interactions<p>Our app receives a notification with a PendingIntent that when clicked, o...
73,000,692
stdout not working properly with linked assembly function in simple c program<p>I am trying to learn arm assembly currently, and I've been toying with blending c and asm together. What I made was a simple program that will enter an infinite loop (written in assembly) where a string is output to the console. The problem...
<p><a href="https://stackoverflow.com/questions/73000692/stdout-not-working-properly-with-linked-assembly-function-in-simple-c-program/73001071#comment128934430_73000692">As Jester stated in their comment</a>, the answer is that I was not compiling correctly:</p> <blockquote> <p>You need to link the object file not the...
stdout not working properly with linked assembly function in simple c program
c|assembly|arm
0
47
1
73,001,071
73,001,071
1
true
2022-07-16T00:23:26.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: stdout not working properly with linked assembly function in simple c program<p>I am trying to learn arm assembly currently, and I've been toying with blendi...
72,954,086
Data format inconsistency during read/write parquet file with spark<p>Here is the schema of the input data that I read from a file <code>myfile.parquet</code> with spark/scala :</p> <pre><code>val df = spark.read.format(&quot;parquet&quot;).load(&quot;/usr/sample/myIntialFile.parquet&quot;) df.printSchema root |-- det...
<p>The actual data type didn't change. In both cases <code>infos</code> is a variable sized list of structs. In other words, each item in the <code>infos</code> array is a list of structs.</p> <p>Arguably, there isn't much point in the name <code>array</code> or <code>element</code>. I think different parquet reader...
Data format inconsistency during read/write parquet file with spark
scala|apache-spark|pyspark|parquet|pyarrow
0
47
1
72,958,627
72,958,627
1
true
2022-07-12T14:36:40.037Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Data format inconsistency during read/write parquet file with spark<p>Here is the schema of the input data that I read from a file <code>myfile.parquet</code...
72,926,414
Is there a way to make extentions ordered alphabetically, not based on length?<p>I've been using this code to order the extention based on alphabetical order</p> <pre><code>def sort_by_ext(files: List[str]) -&gt; List[str]: sort1 = sorted(files, key=lambda x: x[x.rindex(&quot;.&quot;):-1]) return sort1 </code><...
<p>i did a try by using str.partition() function. as argument the dot &quot;.&quot; is used. partition() uses the argument, and divides the string into 3 parts:</p> <ul> <li>everything before the argument</li> <li>the argument itself</li> <li>everything after the argument</li> </ul> <p>&quot;this_code.py&quot; =&gt; re...
Is there a way to make extentions ordered alphabetically, not based on length?
python|list|sorting|lambda
0
47
2
72,927,657
72,927,657
1
true
2022-07-10T05:53:03.147Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way to make extentions ordered alphabetically, not based on length?<p>I've been using this code to order the extention based on alphabetical order...
73,029,078
How to vertically align text in a row using Bootstrap 5<p>I am trying to vertically align text in the middle of a row.</p> <p>Below is what I have done. The vertical alignment is not working. How can I align the text vertically in the middle of the row?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-...
<p>Use <code>align-items-center</code> because <code>row</code> is already <code>display: flex</code></p> <p>From the <a href="https://getbootstrap.com/docs/5.1/utilities/vertical-align/" rel="nofollow noreferrer">docs</a>,</p> <blockquote> <p>Please note that vertical-align only affects inline, inline-block, inline-ta...
How to vertically align text in a row using Bootstrap 5
html|css|twitter-bootstrap|bootstrap-5
-1
47
2
73,029,100
73,029,100
1
true
2022-07-18T22:02:14.743Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to vertically align text in a row using Bootstrap 5<p>I am trying to vertically align text in the middle of a row.</p> <p>Below is what I have done. The ...
72,975,210
VSCode How do I skip past an automatically generated end </tag>?<p>Say I were typing</p> <pre><code>&lt;h2&gt;Show Subject*&lt;/h2&gt; </code></pre> <p>How would I jump to the end of the brackets if my cursor was at the *. Usually I would just arrow key right 4 times or use my mouse to select the next line. I see other...
<p>The magics you're seeing in the linked video are features of <a href="https://code.visualstudio.com/docs/editor/emmet" rel="nofollow noreferrer">Emmet</a>. For example there's <code>Emmet: Go to matching pair</code>, which you can bind to something convenient using the Keyboard Shortcuts dialog (<code>Ctrl-k Ctrl-s<...
VSCode How do I skip past an automatically generated end </tag>?
html|visual-studio|visual-studio-code|tags
0
47
1
72,975,296
72,975,296
1
true
2022-07-14T04:30:01.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VSCode How do I skip past an automatically generated end </tag>?<p>Say I were typing</p> <pre><code>&lt;h2&gt;Show Subject*&lt;/h2&gt; </code></pre> <p>How w...
72,814,607
python typing Dict and overloading: Overloaded function implementation does not accept all possible arguments<pre class="lang-py prettyprint-override"><code>@overload def get_random( d:Dict[int,int] )-&gt;int: ... @overload def get_random( d:Dict[int,float] )-&gt;float: ... def get_random( ...
<p>Note that <code>Dict[int, Union[int, float]]</code> is not the same as <code>Union[Dict[int, int], Dict[int, float]]</code> which is what you meant.</p> <pre><code>import random from typing import Dict, Union, overload @overload def get_random(d: Dict[int, int]) -&gt; int: ... @overload def get_random(d: Dic...
python typing Dict and overloading: Overloaded function implementation does not accept all possible arguments
python|overloading|python-typing
0
47
1
72,817,535
72,817,535
1
true
2022-06-30T10:59:07.950Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python typing Dict and overloading: Overloaded function implementation does not accept all possible arguments<pre class="lang-py prettyprint-override"><code>...
72,927,233
Time and Space algorithm complexity<p>I am coding brute force approach for one coding problem - I need to count the maximum score path in the array with maximum step <em>k</em>.</p> <p><em>Input: nums = [1,-1,-2,4,-7,3], k = 2 Output: 7 Explanation: You can choose your jumps forming the subsequence [1,-1,4,3] (underlin...
<p>The recurrence relation for your code for a particular k is</p> <pre><code>C(n) = sum(C(n-i) for i = 1...k) for n&gt;k C(n) = C(1) + C(2) + ... + C(n-1) for n &lt;= k C(1) = 1 </code></pre> <p>These are the recurrence relations for the <a href="https://en.wikipedia.org/wiki/Generalizations_of_Fibonacci_numbers#Fibon...
Time and Space algorithm complexity
algorithm|time-complexity
0
47
1
72,927,578
72,927,578
1
true
2022-07-10T08:44:42.920Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Time and Space algorithm complexity<p>I am coding brute force approach for one coding problem - I need to count the maximum score path in the array with maxi...
72,769,145
How to compare two comboboxes items if even atleast one match found count it c#<p>I am trying to compare two comboboxes items if they have even single items match count that item and how to set condition for display message as match found?</p> <p>combo10 already has IDs like</p> <p>1001 1003 1004 1100</p> <p>comboBox1 ...
<p>Other alternative method is to double loop to compare list of each comboboxes</p> <pre><code>int repeatedItems = 0; foreach (var cbItems1 in itms1) { foreach (var cbItems2 in itms2) { if(cbItems1 == cbItems2){ repeatedItems++; } } } </code></pre>
How to compare two comboboxes items if even atleast one match found count it c#
c#
0
47
2
72,769,240
72,769,240
1
true
2022-06-27T08:32:06.580Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to compare two comboboxes items if even atleast one match found count it c#<p>I am trying to compare two comboboxes items if they have even single items ...
72,790,059
Deleting head node of a linked list in C where every node knows its headlist<pre><code>typedef struct node { int x; struct node *next; struct node **head; } node; </code></pre> <p>Considering this struct, I've implemented a push function:</p> <pre><code>node *push(node *nodo, node *top) { nodo-&gt;next ...
<blockquote> <p>But I have some problems when I have to delete the head of the list</p> </blockquote> <p>You have much worse and more pervasive problems.</p> <p>Here ...</p> <blockquote> <pre><code>node* push(node* nodo, node* top){ nodo-&gt;next=top; top = nodo; nodo-&gt;head = &amp;top; return top; } </code><...
Deleting head node of a linked list in C where every node knows its headlist
c|list|pointers|linked-list|pointer-to-pointer
0
47
1
72,790,276
72,790,276
1
true
2022-06-28T16:24:12.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Deleting head node of a linked list in C where every node knows its headlist<pre><code>typedef struct node { int x; struct node *next; struct nod...