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,163,012 | I have a question about React router dom v6<p>Below code does not work in react router dom v6.</p>
<pre><code><Route path='/study-board' element={<StudyBoard />}>
<Route path=':id' element={<StudyBoardDetail />} />
</Route>
</code></pre>
<p>But the code below works.</p>
<pre><code><... | <p>you have to use <code><outlet/></code> to access nested routes
demo code</p>
<pre><code>import { Routes, Route, Outlet } from "react-router-dom";
function App() {
return (
<Routes>
<Route path="invoices" element={<Invoices />}>
<Route path=":in... | I have a question about React router dom v6 | reactjs|react-router-dom | 0 | 49 | 1 | 72,170,064 | 72,170,064 | 1 | true | 2022-05-08T16:24:48.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I have a question about React router dom v6<p>Below code does not work in react router dom v6.</p>
<pre><code><Route path='/study-board' element={<Stud... |
72,147,556 | Analysis the hashmap keys as 3 keys in each one lane<p>I'm trying to analyze a hashmap keys, so I want to make every 3 keys from the hashmap send as one line, and then after sending 3 keys it will put a "\n" so it will go to the next line and put another 3 values and etc... till the hashmap keys print all.</p... | <p>I finally find out that the easiest way to do it which is, it's only in one line :</p>
<pre class="lang-java prettyprint-override"><code>
AtomicInteger counter = new AtomicInteger(0);
System.out.println(map.keySet().stream().map(map -> ((counter.getAndAdd(1) % 3 == 0) ? "\n" : " / ") + map).... | Analysis the hashmap keys as 3 keys in each one lane | java | 0 | 70 | 2 | 72,156,522 | 72,156,522 | 1 | true | 2022-05-06T21:29:55.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Analysis the hashmap keys as 3 keys in each one lane<p>I'm trying to analyze a hashmap keys, so I want to make every 3 keys from the hashmap send as one line... |
72,057,025 | Select the max,min of nested lists vb.net<p>I have these objects</p>
<pre><code>Public Class Class1
Public Property Type As String
Public Property SpecLimits As Limits
End Class
Public Class Limits
Public Property MinValue As Double?
Public Property MaxValue As Double?
End C... | <p>I <em>guess</em> you want something like this:</p>
<pre><code>Dim minValue As Double = list.Min(Function(x) x.SpecLimits.MinValue)
Dim maxValue As Double = list.Max(Function(x) x.SpecLimits.MaxValue)
</code></pre> | Select the max,min of nested lists vb.net | vb.net|linq|nested | 0 | 30 | 1 | 72,057,183 | 72,057,183 | 1 | true | 2022-04-29T11:12:03.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select the max,min of nested lists vb.net<p>I have these objects</p>
<pre><code>Public Class Class1
Public Property Type As String
Public Pro... |
72,159,868 | PostgreSQL- Round REAL data type (yes, I know numeric exist)<p>I know REAL data type is not accurate and normally for currency I should use <strong>numeric</strong> data type.
But, I'm asked to do some stuff and one of the conditions is that the data type is real.
When I try to do <code>round((....),2)</code> for examp... | <p>As you can see <a href="https://www.postgresql.org/docs/8.1/functions-math.html" rel="nofollow noreferrer">here</a> it's no way to round without any type cast. It's only two kinds of function exists:</p>
<p><strong>round(dp or numeric)</strong> - round to nearest integer</p>
<p><strong>round(v numeric, s int)</stron... | PostgreSQL- Round REAL data type (yes, I know numeric exist) | sql|postgresql|rounding|real-datatype | 0 | 109 | 3 | 72,160,055 | 72,160,055 | 1 | true | 2022-05-08T09:57:08.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PostgreSQL- Round REAL data type (yes, I know numeric exist)<p>I know REAL data type is not accurate and normally for currency I should use <strong>numeric</... |
72,150,250 | how to switch between inputs in converter app in react?<p>I built a celsius(as input) to fahrenheit(as output) conveter with react But<br>
I want to switch between celsius and fahrenheit as input and output<br>
I mean when I click on fahrenheit it turn to input and use can edit it an type init and see <br>celsius as re... | <p>You can use the same <code>onChange</code> handler but with a condition based on the current focused input:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="true">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const useState = ... | how to switch between inputs in converter app in react? | javascript|reactjs|input|use-state | 0 | 44 | 2 | 72,150,374 | 72,150,374 | 1 | true | 2022-05-07T07:06:09.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to switch between inputs in converter app in react?<p>I built a celsius(as input) to fahrenheit(as output) conveter with react But<br>
I want to switch b... |
72,223,583 | Set of String is not acting normal in Spring JPA Projection Interface<p>I am using Projection Interface to return a partial view of an Entity, and the partial view contains a Set of String. I expect the Set works as normal but its not: when I add a new String to it, it ignores the String, see the example code below:</p... | <p><em>Note</em> : I haven't worked with projections before in Spring Data JPA. So thank you for sharing this! :TIL</p>
<p>I think problem is with <code>myEntityPartial.getStrings().add("B");</code>.
It does not update the actual <code>MyEntity</code> managed by <code>MyRepo</code>. And every execution of <co... | Set of String is not acting normal in Spring JPA Projection Interface | java|spring|spring-boot|hibernate|spring-data-jpa | 0 | 71 | 1 | 72,245,127 | 72,245,127 | 1 | true | 2022-05-13T01:30:28.550Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set of String is not acting normal in Spring JPA Projection Interface<p>I am using Projection Interface to return a partial view of an Entity, and the partia... |
72,158,399 | How to perform scheduling using python?<p>I am trying to schedule a few jobs inside my python. Supposely , the text from the logging should appear every 1 minute and every 5 minute from jobs.py file inside my docker container. However, the text is appearing every 2minutes inside the docker container. Is there a clash b... | <p>I think you're running into a couple of issues:</p>
<ol>
<li>As you suspected, your <code>schedule</code> is on a different schedule/interval than your cron job. They're out of sync (and you can't ever expect them to be in sync for the next reason). From the moment your <code>jobs.py</code> script was executed, that... | How to perform scheduling using python? | python|docker|cron | 0 | 252 | 1 | 72,159,330 | 72,159,330 | 1 | true | 2022-05-08T05:39:38.660Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to perform scheduling using python?<p>I am trying to schedule a few jobs inside my python. Supposely , the text from the logging should appear every 1 mi... |
72,198,313 | Android - How to implement external library with a login form<p>I'm learning to develop android app using kotlin. I have an app written using web technologies and I want to port it on android. I've created a simple layout where I have some input field that are needed to connect to the IP cam I need to display.</p>
<p>I... | <p>place cursor somewhere in the middle of <code>OnvifDevice(...</code> and some hint should appear allowing importing dependency. you can press Alt+Enter for autoimport then</p>
<p>also you haven't implemented needed interface <code>OnvifListener</code> and didn't declared <code>onvifDevice</code> anywhere...</p>
<pre... | Android - How to implement external library with a login form | android|kotlin|onvif | 0 | 89 | 1 | 72,198,684 | 72,198,684 | 1 | true | 2022-05-11T09:06:51.483Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android - How to implement external library with a login form<p>I'm learning to develop android app using kotlin. I have an app written using web technologie... |
72,227,858 | Know whether a view is completely visible in a recycler view from its adapter<p>I saw a lot of posts that show the currently entirely visible item in the recycler view but, from the activity. But, I want to know about that from the adapter. If the view is completely visible, I want to start playing a video and when it ... | <p>you have to set <a href="https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.LayoutManager" rel="nofollow noreferrer"><code>LayoutManager</code></a> for <code>RecyclerView</code>. if you are using most common <a href="https://developer.android.com/reference/androidx/recyclerview/widget/... | Know whether a view is completely visible in a recycler view from its adapter | android|kotlin|android-recyclerview | 0 | 103 | 1 | 72,227,918 | 72,227,918 | 1 | true | 2022-05-13T10:08:58.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Know whether a view is completely visible in a recycler view from its adapter<p>I saw a lot of posts that show the currently entirely visible item in the rec... |
72,192,806 | Is there a way to generate random numbers with a large range, but tend towards values near 1? (Java)<p>I'm making a neural network and I have a variable <code>weight</code> that is multiplied with some value. I want to be able to randomize the <code>weight</code> variable and allow it to be decimals like 0.1 or large n... | <p>It sounds like you want a <a href="https://byjus.com/maths/poisson-distribution/" rel="nofollow noreferrer">Poisson distribution</a>. Normally the distribution of values is discrete, given by whole number, e.g. 0, 1, 2, etc., but you can divide a result by 10 to get one decimal place.</p>
<p>The probability functio... | Is there a way to generate random numbers with a large range, but tend towards values near 1? (Java) | java|math|random | 0 | 166 | 3 | 72,193,475 | 72,193,475 | 1 | true | 2022-05-10T20:53:32.570Z | 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 generate random numbers with a large range, but tend towards values near 1? (Java)<p>I'm making a neural network and I have a variable <cod... |
72,182,133 | WPF - MVVM binding in UserControl<p>I'm testing a sample binding in MVVM pattern. I'm using package GalaSoft.MvvmLight. Binding from MainViewModel to MainWindow is normal but I can't binding data from a ViewModel (ImageViewModel) to View (ImageView). All my code is below</p>
<p>in App.xaml</p>
<pre><code><Applicatio... | <p>The expression</p>
<pre><code>Text="{Binding TestText, ElementName=ucImage}"
</code></pre>
<p>expects a <code>TestText</code> property in the ImageView control, which apperently does not exists - that is what the error message says.</p>
<p>You would simply write the following to make the element in the con... | WPF - MVVM binding in UserControl | wpf|mvvm|binding | 0 | 66 | 1 | 72,182,320 | 72,182,320 | 1 | true | 2022-05-10T07:18:54.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
WPF - MVVM binding in UserControl<p>I'm testing a sample binding in MVVM pattern. I'm using package GalaSoft.MvvmLight. Binding from MainViewModel to MainWin... |
72,187,371 | Detecting a pixel based on approximate color?<p>I am currently working on a AI for minesweeper and I am trying to detect the color of the numbers to see which number is there and I am having trouble finding the exact RGB code of it and when I print it it seems to change by slight amounts I am wondering if there is a wa... | <p>The solution was this:</p>
<pre class="lang-py prettyprint-override"><code> def check_clicked(self, rgb):
ok = str(rgb).replace("(", "").replace(" ", "").replace(")", "").split(",")
r = int(ok[0])
g = int(ok[1])
... | Detecting a pixel based on approximate color? | python|python-3.x|image|python-imaging-library|rgb | 0 | 127 | 1 | 72,350,892 | 72,350,892 | 1 | true | 2022-05-10T13:36:39.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Detecting a pixel based on approximate color?<p>I am currently working on a AI for minesweeper and I am trying to detect the color of the numbers to see whic... |
72,221,239 | Retrieving a value in one class that is set in another<p>I hope you are all doing well.</p>
<p>I've been having a small issue in a task for university, I have a variable in a class named <strong>Alpha</strong> where I want the value to be changed to what is entered by the user. For the second class named <strong>Charli... | <p>you need to pass the alpha instance to charlie</p>
<pre><code> charlie.Delta(this);
</code></pre>
<p>and</p>
<pre><code> public void Delta(Alpha alpha)
{
Console.WriteLine("Charlie() says, " + alpha.message);
}
</code></pre>
<p>this is because you can have multiple different alphas w... | Retrieving a value in one class that is set in another | c#|class | 0 | 40 | 2 | 72,221,302 | 72,221,302 | 1 | true | 2022-05-12T19:37:33.457Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Retrieving a value in one class that is set in another<p>I hope you are all doing well.</p>
<p>I've been having a small issue in a task for university, I hav... |
72,172,640 | Why "EA.Project.GeneratePackage" method does not generate the code?<p>I'm working on an add-in for EA that can generate C code from a package. You can see a piece of my code below. I can see that GUID and the GUID in XML format are correct. But for some reason, the GeneratePackage method does not generate any code at a... | <p>The problem is step one</p>
<pre><code>// step one: get the GUID of the package you want to generate code from
string thePackageGUID = repository.ProjectGUID;
</code></pre>
<p>The <code>ProjectGUID</code> you are using is the unique identifier of your whole project (AKA model, AKA Repository), and does not identify ... | Why "EA.Project.GeneratePackage" method does not generate the code? | c#|enterprise-architect | 0 | 62 | 2 | 72,174,824 | 72,174,824 | 1 | true | 2022-05-09T13:18:19.483Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why "EA.Project.GeneratePackage" method does not generate the code?<p>I'm working on an add-in for EA that can generate C code from a package. You can see a ... |
72,198,929 | Best way to replace/remove a specific character when it appears between 2 character sequences<p>I have a php function which selects the text from a string between 2 different character sequences.</p>
<pre><code>function get_string_between($string, $start, $end){
$string = ' ' . $string;
$ini = strpos($string, $... | <p>So it was a good thing I asked for the output, because initially I had something else. Many people would use regular expressions here, but I often find those difficult to work with, so I took a more basic approach:</p>
<pre><code>function extractWantedStuff($input)
{
$output = [];
$sections = explode('"... | Best way to replace/remove a specific character when it appears between 2 character sequences | php|replace|substring | 0 | 81 | 3 | 72,199,344 | 72,199,344 | 1 | true | 2022-05-11T09:50:55.077Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Best way to replace/remove a specific character when it appears between 2 character sequences<p>I have a php function which selects the text from a string be... |
72,069,294 | Add, update and read sub-collection in firestore using Angular (@angular/fire)<p>I am trying to learn firebase. I am making a project like Linkedin using Angular and Firebase.</p>
<p>I am using the @angular/fire package in my project.</p>
<p>So far I have done authentication and adding some basic info of a user. I have... | <p>From your <a href="https://stackoverflow.com/questions/72066236/collection-structure-in-firestore">other question</a> I think you need to add a sub-collection which contains a document with ID <code>work-experience</code>.</p>
<p>If my assumption is correct, do as follows to create the <code>DocumentReference</code>... | Add, update and read sub-collection in firestore using Angular (@angular/fire) | javascript|angular|firebase|google-cloud-firestore|nosql | 0 | 522 | 1 | 72,069,343 | 72,069,343 | 1 | true | 2022-04-30T14:20:03.920Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add, update and read sub-collection in firestore using Angular (@angular/fire)<p>I am trying to learn firebase. I am making a project like Linkedin using Ang... |
72,166,308 | Delete a batch of docs using admin SDK and callable cloud function in most similar way to client SDK?<p>I have an array of docs ids that I want to delete in using a cloud function, my code looks like the following :</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<di... | <p>There are several errors in your code:</p>
<ul>
<li><code>data.arr.forEach()</code> cannot work wince your data object contains one element with the key <code>array</code> and not the key <code>arr</code>.</li>
<li>You are mixing up the syntax of the JS SDK v9 and the <a href="https://firebase.google.com/docs/refere... | Delete a batch of docs using admin SDK and callable cloud function in most similar way to client SDK? | javascript|node.js|firebase|google-cloud-firestore|google-cloud-functions | 0 | 56 | 2 | 72,168,525 | 72,168,525 | 1 | true | 2022-05-09T01:58:57.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Delete a batch of docs using admin SDK and callable cloud function in most similar way to client SDK?<p>I have an array of docs ids that I want to delete in ... |
72,213,160 | How to use the return of a cloud function in realtime databse [Firebase]<p>I am using Realtime database from Firebase.</p>
<p>I have a cloud function in my index.js that returns an object:</p>
<pre><code>{"state":"create","users":["user1","user2"]}
</code></pre>
<p>I wo... | <blockquote>
<p>I have a cloud function in my index.js that returns an object... I
would like to get it from my java code to use it later.</p>
</blockquote>
<p>All Realtime Database Cloud Functions are <a href="https://firebase.google.com/docs/functions/database-events" rel="nofollow noreferrer"><strong>backgound trigg... | How to use the return of a cloud function in realtime databse [Firebase] | android|firebase|firebase-realtime-database|google-cloud-functions | 0 | 28 | 1 | 72,214,202 | 72,214,202 | 1 | true | 2022-05-12T09:29:59.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use the return of a cloud function in realtime databse [Firebase]<p>I am using Realtime database from Firebase.</p>
<p>I have a cloud function in my i... |
72,210,571 | Python Hydra configuration for different environments<h2>Background</h2>
<p>I currently have a script which does some API data gathering. The script is deployed to two environments, <code>test</code> and <code>user</code>. Each environment has different settings which I have created the respective configuration files. ... | <p>You can introduce a config group, e.g. <code>env</code> that would contain configs with the default lists you want to use for each environment.</p>
<pre><code>├── config
│ ├── config.yaml
│ ├── env
│ │ ├── user.yaml
│ │ └── test.yaml
│ ├── test
│ │ └── user.yaml
│ └── user
│ └── config1.yam... | Python Hydra configuration for different environments | python|python-3.x|fb-hydra | 0 | 340 | 1 | 72,212,363 | 72,212,363 | 1 | true | 2022-05-12T05:38:49.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python Hydra configuration for different environments<h2>Background</h2>
<p>I currently have a script which does some API data gathering. The script is deplo... |
72,199,102 | Netlogo : calling a procedure after opening a file<p>Here-below is the code for opening a file, reading it and writing it into a list (inspired from another discussion) :</p>
<pre><code>to setup
reset-timer
; first, we load the database file
; We check to make sure the file exists first
ifelse ( file-exists? &q... | <p>Are you sure the run is endless and not exponential? You <code>ask patches</code> to <code>assign-data</code> and in <code>assign-data</code> you use <code>ask patches</code> again. That means that every single patch is checking every single patch and letting the qualified patch go through the loop, which can take a... | Netlogo : calling a procedure after opening a file | netlogo|procedure | 0 | 37 | 1 | 72,203,502 | 72,203,502 | 1 | true | 2022-05-11T10:03:21.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Netlogo : calling a procedure after opening a file<p>Here-below is the code for opening a file, reading it and writing it into a list (inspired from another ... |
72,215,932 | Looping through patches that share a common properties in Netlogo<p>I would like to sum up one numeric properties (AT1) of patches that share the same ID and store the value for that ID (procedure <code>simulation</code> here-below). I started with the idea of looping through the patches to find the ones that share the... | <p>My first remark is that you have patches asking patches again in <code>simulation</code>.</p>
<p>Your second solution was the simpler one to work with. The main thing here was to take it out of patch context and let the observer run it.
For printing outputs, I suggest using a format such as <code>print (word current... | Looping through patches that share a common properties in Netlogo | loops|netlogo|patch | 0 | 46 | 1 | 72,218,299 | 72,218,299 | 1 | true | 2022-05-12T12:52:28.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Looping through patches that share a common properties in Netlogo<p>I would like to sum up one numeric properties (AT1) of patches that share the same ID and... |
72,185,669 | What is the real memory available in Docker container?<p>I've run mongodb service via docker-compose like this:</p>
<pre><code>version: '2'
services:
mongo:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
mem_limit: 4GB
</code></pre>
<p>If I run d... | <p><code>free</code> (and other utilities like <code>top</code>) will not report correct numbers inside a memory-constraint container because it gathers its information from <code>/proc/meminfo</code> which is not namespaced.</p>
<p>If you want the actual limit, you must use the entries populated by <code>cgroup</code>... | What is the real memory available in Docker container? | docker|memory-limit | 0 | 151 | 1 | 72,185,762 | 72,185,762 | 1 | true | 2022-05-10T11:40:10.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the real memory available in Docker container?<p>I've run mongodb service via docker-compose like this:</p>
<pre><code>version: '2'
services:
mongo... |
72,152,176 | How to put buttons on two ends of screen in flutter<p>I want the buttons on flutter to be either side of screen i.e one on the bottom right and one on the bottom left.</p>
<p>I want the minus button on the left side of screen :
<a href="https://i.stack.imgur.com/pW0VQ.png" rel="nofollow noreferrer"><img src="https://i.... | <p>One option is to use <code>mainAxisAlignment: MainAxisAlignment.spaceBetween</code> in the <code>Row</code> widget, combined with setting <code>floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat</code>. You can use <code>Padding</code> to add some space horizontally:</p>
<pre><code>floatingAction... | How to put buttons on two ends of screen in flutter | flutter|button | 0 | 166 | 1 | 72,152,330 | 72,152,330 | 1 | true | 2022-05-07T11:47:30.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to put buttons on two ends of screen in flutter<p>I want the buttons on flutter to be either side of screen i.e one on the bottom right and one on the bo... |
72,212,264 | Select one record per minute group in postgres<p>I have a big table in a postgres db with location of units. Now I need to retrieve a location for every 60 seconds.</p>
<p>In Mysql, this is a piece of cake: <code>select * from location_table where unit_id = '123' GROUP BY round(timestamp / 60)</code></p>
<p>But in post... | <p>Use date_trunc() to make sets per minute:</p>
<pre><code>SELECT * -- most likely not what you want
FROM location_table
WHERE unit_id = 123 -- numbers don't need quotes '
GROUP BY date_trunc('minute', 'timestamp');
</code></pre>
<p>The * is of course wrong, but I don't know what you want to know about the GRO... | Select one record per minute group in postgres | postgresql | 0 | 46 | 1 | 72,212,565 | 72,212,565 | 1 | true | 2022-05-12T08:23:42.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select one record per minute group in postgres<p>I have a big table in a postgres db with location of units. Now I need to retrieve a location for every 60 s... |
72,113,360 | spring / hibernate: Generate UUID automatically for Id column<p>I am trying to persist a simple class using Spring, with hibernate/JPA and a PostgreSQL database.</p>
<p>The <code>ID</code> column of the table is a UUID, which I want to generate in code, not in the database.</p>
<p>This should be <a href="https://thorbe... | <p><strong>Update</strong>
There are, at least, 2 types of Spring Data: <code>JPA</code> and <code>JDBC</code>.</p>
<p>The issue happens because you are mixing the 2 of them.</p>
<p>So, in order to fix, there are 2 solutions.</p>
<p><strong>Solution 1</strong> - <strong>Use Spring Data JDBC only</strong>.</p>
<ol>
<li>... | spring / hibernate: Generate UUID automatically for Id column | java|postgresql|hibernate|spring-data-jpa|uuid | 0 | 2,846 | 1 | 72,118,715 | 72,118,715 | 1 | true | 2022-05-04T12:55:19.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
spring / hibernate: Generate UUID automatically for Id column<p>I am trying to persist a simple class using Spring, with hibernate/JPA and a PostgreSQL datab... |
72,160,190 | How to fetch line numbers for all 'if' 'else' and 'elif' positions in a python file<p>Example: Suppose, we have a .py file containing the below code snippet. How do we read and extract the positions of if-elif-else</p>
<pre><code>If fisrtconditon:#line 1
If sub-condition:#line2
print(line no 3)
elif secnd_co... | <p>A simple solution is to iterate over the lines of the file, using <code>enumerate</code> to help you get the line number:</p>
<pre><code>with open("somefile.py") as f:
for line_no, line in enumerate(f, start = 1):
if line[:2] == "if" and (line[2].isspace() or line[2] == "("... | How to fetch line numbers for all 'if' 'else' and 'elif' positions in a python file | python|abstract-syntax-tree | 0 | 156 | 4 | 72,160,421 | 72,160,421 | 1 | true | 2022-05-08T10:39:51.293Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fetch line numbers for all 'if' 'else' and 'elif' positions in a python file<p>Example: Suppose, we have a .py file containing the below code snippet.... |
72,145,467 | Plot variant abundance vs. time (e,g, of mutant strains) in python<p>Given [absolute] numbers for each of a number of variants over time, I would like to produce a plot like the following:
<a href="https://i.stack.imgur.com/Ab5aa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ab5aa.png" alt="enter i... | <p>This type of plot is called a "time stack plot" matplotlib has a built in function for building time stack plots. The syntax is:</p>
<pre><code>matplotlib.pyplot.stackplot(x, y1, y2, ..., yn, colors=None, ...)
</code></pre>
<p>In your case x would be time (e.g. in months), y1,...,yn would be the abundance ... | Plot variant abundance vs. time (e,g, of mutant strains) in python | python|matplotlib|graph | 0 | 47 | 2 | 72,145,528 | 72,145,528 | 1 | true | 2022-05-06T17:39:59.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Plot variant abundance vs. time (e,g, of mutant strains) in python<p>Given [absolute] numbers for each of a number of variants over time, I would like to pro... |
72,039,714 | Update Timestamp field with the oldest record of fields within the row or those in a linked table<p>One table looks like this:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;">TABLE A</th>
<th>Nullables</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">... | <p>Try this:</p>
<pre><code>UPDATE TABLE_A A
SET
last_mod_timestamp =
NULLIF
(
MAX
(
COALESCE (A.create_timestamp, '0001-01-01'::TIMESTAMP)
, COALESCE (A.edit_timestamp, '0001-01-01'::TIMESTAMP)
, COALESCE (A.closed_timestamp, '0001-01-01'::TIMESTAMP)
, COALESCE (B.create_timestamp, '0001-01-01'::TIME... | Update Timestamp field with the oldest record of fields within the row or those in a linked table | sql|db2 | 0 | 29 | 1 | 72,040,755 | 72,040,755 | 1 | true | 2022-04-28T07:34:49.540Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Update Timestamp field with the oldest record of fields within the row or those in a linked table<p>One table looks like this:</p>
<div class="s-table-contai... |
72,175,414 | bug in qselect mips assembly program<p>Below is the quickselect algorithm in mips. There is an error there but I can't find it. qselect function does not work correctly, but the other functions seem to be fine. I have spent so many hours trying to debug it but it compiles without errors in mars. It just doesn't work as... | <pre><code>qselectfp1k:
#return qselect(f,p-1,k);
addi $a1, $a1, -1 # a1 = p-1 *** p is in $v0 so this is not p-1, but l-1
jal partition *** this is supposed to be a call to qselect
lw $ra, 0($sp) # restore ra
j end_qselect
</code></pre>
<p>Did you notice that the comment says <co... | bug in qselect mips assembly program | assembly|mips|quickselect | 0 | 63 | 1 | 72,176,453 | 72,176,453 | 1 | true | 2022-05-09T16:37:56.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
bug in qselect mips assembly program<p>Below is the quickselect algorithm in mips. There is an error there but I can't find it. qselect function does not wor... |
72,231,137 | Break down the logic for a C for-loop into something I can implement in MIPS? (count number occurrences in an array)<p>Hi all i am converting my C code to MIPS but problem is here i couldn't make correct logic for this</p>
<pre class="lang-c prettyprint-override"><code>for (int i=0;i<count;i++)
{
h[a[i]]++... | <p>You need to understand what is being incremented. One approach to gaining this understanding is decomposition: expressions can be decomposed using an approach like <a href="https://en.wikipedia.org/wiki/Three-address_code" rel="nofollow noreferrer">Three-Address Code</a>.</p>
<p>Suggest then, to decompose this:</p>... | Break down the logic for a C for-loop into something I can implement in MIPS? (count number occurrences in an array) | c|for-loop|assembly|histogram|mips | 0 | 68 | 1 | 72,234,029 | 72,234,029 | 1 | true | 2022-05-13T14:23:05.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Break down the logic for a C for-loop into something I can implement in MIPS? (count number occurrences in an array)<p>Hi all i am converting my C code to MI... |
72,202,972 | How to show a splash screen onLoadStart?<p>I am making my first Flutter app and I have a question. I am using the plugin flutter_inappwebview and I want to show a full screen splash/load screen. Preferably with a Lottie animation. The code I have so far:</p>
<pre><code> Widget build(BuildContext context) {
SystemChr... | <p>The <code>onLoadStart</code> parameter let's you know when the loading start, so you'll never be able to put a splash screen there, your second option would be to use the <code>isLoading</code> method that comes from the <code>webviewController</code>, it returns <code>true or false</code> for when the page is compl... | How to show a splash screen onLoadStart? | flutter|webview | 0 | 136 | 1 | 72,209,288 | 72,209,288 | 1 | true | 2022-05-11T14:37:17.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to show a splash screen onLoadStart?<p>I am making my first Flutter app and I have a question. I am using the plugin flutter_inappwebview and I want to s... |
72,191,274 | Why does `display: table;` cause a pseudo padding in a div? (And why only when it is itself in a table?)<p>I have a <code>table.matrix</code> in a <code>div.matrix-wrapper</code>.<br>
The whole thing shall be centered in a bigger <code>div</code>.</p>
<p>I only achieved this by adding <code>display: table; margin: 0 au... | <p><code>border-spacing</code> and <code>border-collapse</code> inherit. The wrapping table has</p>
<pre><code>border-spacing: 2px;
border-collapse: separate;
</code></pre>
<p>applied to it through the user-agent stylesheet, so these values are inherited by your div.matrix-wrapper and have effect when it's given <code>... | Why does `display: table;` cause a pseudo padding in a div? (And why only when it is itself in a table?) | css | 0 | 44 | 1 | 72,194,726 | 72,194,726 | 1 | true | 2022-05-10T18:18:53.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does `display: table;` cause a pseudo padding in a div? (And why only when it is itself in a table?)<p>I have a <code>table.matrix</code> in a <code>div.... |
72,182,859 | Flutter change background every dynamic second<p>I have a application. Its simply changing background every 1.5 second(default). But I want to control it with a Slider. I changing my state but my timer is inside of initstate. So Its not effecting it. How can i make it ? My Code:</p>
<pre><code>Slider(
... | <p>You have to cancel timer and reassign. I created function named with _changeTimer() when you slide the slider It will be reassign with new value.</p>
<pre><code>import 'dart:async';
import 'dart:developer';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidg... | Flutter change background every dynamic second | android|ios|flutter|dart|mobile | 0 | 66 | 1 | 72,183,158 | 72,183,158 | 1 | true | 2022-05-10T08:18:14.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter change background every dynamic second<p>I have a application. Its simply changing background every 1.5 second(default). But I want to control it wit... |
72,149,604 | How to convert String having key=value pairs to Json<p>myString = <code>{AcquirerName=abc, AcquiringBankCode=0.2, ApprovalCode=00};</code></p>
<p>I want to convert it to the following string.</p>
<pre><code>{"AcquirerName": "abc", "AcquiringBankCode": 0.2, "ApprovalCode": 0};
</... | <p>You can use Gson to convert the key-value String to Object and convert it into JSON. For Eg,</p>
<p><strong>Add the following dependency:</strong></p>
<pre><code><dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8... | How to convert String having key=value pairs to Json | java|android|arrays|json|object | 0 | 434 | 2 | 72,150,314 | 72,150,314 | 1 | true | 2022-05-07T04:57:30.937Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert String having key=value pairs to Json<p>myString = <code>{AcquirerName=abc, AcquiringBankCode=0.2, ApprovalCode=00};</code></p>
<p>I want to ... |
72,178,996 | Program that takes two lists and outputs similarity between lists<p>I am writing a program where a user inputs data for two lists ( numbers ) and then the program outputs the matching numbers from both of the lists.
I have written a bit of code to manually achieve this but I need to implement a way where the user can i... | <p>If you need to keep the order in the list, you can work directly on the lists and use a simple list comprehension:</p>
<pre><code>a = [1,2,3,4]
b = [4,2,0,0]
c = [el for el in b if el in a]
print('Output:',c)
</code></pre>
<p>Output:</p>
<pre><code>[4, 2]
</code></pre>
<hr />
<p><strong>EDIT 1.</strong> If you w... | Program that takes two lists and outputs similarity between lists | python|python-3.x | 0 | 42 | 1 | 72,179,083 | 72,179,083 | 1 | true | 2022-05-09T22:54:57.033Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Program that takes two lists and outputs similarity between lists<p>I am writing a program where a user inputs data for two lists ( numbers ) and then the pr... |
72,234,777 | How to delete a record depending on the following record<p>I have a table with the following columns: (Car, User, Location, Time, Type)</p>
<p>The type can be:</p>
<ul>
<li><strong>'OUT'</strong> if the user's request to rent the car is accepted</li>
<li><strong>'IN'</strong> when the user stops using the car and regis... | <p>You can use a pair of window functions on the <code>Type</code> field:</p>
<ul>
<li><a href="https://dev.mysql.com/doc/refman/8.0/en/window-function-descriptions.html#function_lag" rel="nofollow noreferrer"><code>LAG</code></a>, to retrieve the previous value</li>
<li><a href="https://dev.mysql.com/doc/refman/8.0/en... | How to delete a record depending on the following record | mysql|sql|database | 0 | 50 | 1 | 72,235,172 | 72,235,172 | 1 | true | 2022-05-13T19:50:55.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to delete a record depending on the following record<p>I have a table with the following columns: (Car, User, Location, Time, Type)</p>
<p>The type can b... |
72,168,514 | How to check if sub values of a mapped results are the same in Java stream?<p>I have the following stream transform:</p>
<pre><code>Stream.of(string1, string2)
.map(this::function1) // generate Stream<Pair<Integer, Integer>>
</code></pre>
<p>How to check the keys of the pairs are the same? Since I need to... | <p>Well, the requirement looks like the one in <a href="https://stackoverflow.com/q/23699371/507738">this question</a>, and Stuart Marks added <a href="https://stackoverflow.com/a/27872852/507738">an implementation</a> to filter the stream based on distinct properties of an object.</p>
<p>This is his code:</p>
<blockqu... | How to check if sub values of a mapped results are the same in Java stream? | java|java-stream | 0 | 84 | 2 | 72,171,632 | 72,171,632 | 1 | true | 2022-05-09T07:42:07.617Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check if sub values of a mapped results are the same in Java stream?<p>I have the following stream transform:</p>
<pre><code>Stream.of(string1, string... |
72,172,580 | Plotting using xyplot()<p>I am having trouble understanding the xyplot() function to create plots in R. Below, I have an example of R code that does create a nice plot</p>
<pre><code>install.packages("mice")
library("mice")
data <- airquality[, c("Ozone", "Solar.R")]
# Applies... | <p>Remember that in R, generic functions call a specific method depending on the "class" attribute of the object passed as the first argument. This is known as <em>S3 dispatch</em>. The "class" of an object is not the same thing as its storage mode or internal type, which is what <code>typeof</code>... | Plotting using xyplot() | r | 0 | 52 | 1 | 72,172,762 | 72,172,762 | 1 | true | 2022-05-09T13:14:23.833Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Plotting using xyplot()<p>I am having trouble understanding the xyplot() function to create plots in R. Below, I have an example of R code that does create a... |
72,191,303 | S3 template which can take different formulas and numeric vectors as arguments<p>Please help me to make my code work. Here I'm trying to create an S3 template which can take different formulas and numeric vectors as arguments. Also I want to add a plot method, drawing the resulting figure. For now it throws an error:</... | <p>There are a couple of tweaks you could make.</p>
<ol>
<li>Using <code>do.call(f, list(x, y))</code> is the same as doing <code>f(x, y)</code>, so you <em>could</em> just use that, but...</li>
<li>...you probably don't want to call the function at all during object creation, since that will just create an unnamed dat... | S3 template which can take different formulas and numeric vectors as arguments | r|r-s3 | 0 | 17 | 1 | 72,191,459 | 72,191,459 | 1 | true | 2022-05-10T18:21:51.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
S3 template which can take different formulas and numeric vectors as arguments<p>Please help me to make my code work. Here I'm trying to create an S3 templat... |
72,143,091 | How do return a BigDecimal as decimal in json using jaxrs?<p>I'm using Tomee 8 as an application server and I have this trouble when my rest service returns a BigDecimal.</p>
<p>This is my service:</p>
<pre><code>import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;... | <p>You need to use a MapperConverter object.</p>
<p>For example, you could implement the ObjectConverter.Codec interface.</p>
<p>This code can be useful for your requirement.</p>
<p>For example: You can include <code>@JohnzonConverter(MyBigDecimalValueConverter.class)</code> on the desired fields.</p>
<pre class="lang-... | How do return a BigDecimal as decimal in json using jaxrs? | java|json|jax-rs|bigdecimal|apache-johnzon | 0 | 169 | 1 | 72,371,078 | 72,371,078 | 1 | true | 2022-05-06T14:25:56.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do return a BigDecimal as decimal in json using jaxrs?<p>I'm using Tomee 8 as an application server and I have this trouble when my rest service returns ... |
72,067,730 | Regex for this double handlebar pattern not working in the following case<p>I have created regex pattern for this: {{}}-{{}}-{{}}</p>
<p><code>(?<![^*])(^|[^{])\{\{[^{}]*\}\}(?!\})([-]{1}\{\{[^{}]*\}\}(?!\})){2}(?![^*])</code></p>
<p>Double handle bars repeated exactly 3 times with dashes in between.</p>
<p>But the ... | <p>This part <code>(?<![^*])</code> means that these should not be a char other than <code>*</code> directly to the left of the current position (which is also used in the negative lookahead at the end of the pattern)</p>
<p>Instead you can assert a whitspace boundary to the left and to the right.</p>
<p>Note that t... | Regex for this double handlebar pattern not working in the following case | regex|regex-lookarounds|regex-look-ahead | 0 | 30 | 1 | 72,067,800 | 72,067,800 | 1 | true | 2022-04-30T10:33:36.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Regex for this double handlebar pattern not working in the following case<p>I have created regex pattern for this: {{}}-{{}}-{{}}</p>
<p><code>(?<![^*])(^... |
72,159,089 | LookAround or default regex if symbol is not present<p>I have got this regex</p>
<pre><code>^\d+(?<=\d)_?(?=\d)\d*
</code></pre>
<p>My original goal is to match these patterns:</p>
<ul>
<li><code>5</code></li>
<li><code>55</code></li>
<li><code>5_5</code></li>
<li><code>55_5</code></li>
</ul>
<p>But ignore</p>
<ul>
... | <p>The reason is because the pattern should match at least 2 digits.</p>
<p>This is due to the <code>^\d+</code> and asserting another digit to the right <code>(?=\d)</code></p>
<p>In your pattern, you can remove the lookaround assertions, as you are also matching the digits that you are asserting so they are redundant... | LookAround or default regex if symbol is not present | regex | 0 | 22 | 1 | 72,159,160 | 72,159,160 | 1 | true | 2022-05-08T07:56:30.333Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
LookAround or default regex if symbol is not present<p>I have got this regex</p>
<pre><code>^\d+(?<=\d)_?(?=\d)\d*
</code></pre>
<p>My original goal is to... |
72,165,470 | Regex : Ass subtitles - Match the last \b tag value<p>I want to match the numeric values of the <strong>last</strong> \b tag, or empty string if there's no number.</p>
<p>Here are the strings at left, and what I want to match at right :</p>
<pre><code>\b Empty string
\b\b Empty str... | <p>For a match only without empty matches, you might use:</p>
<pre><code>(?<=\\ *b *)(?!\S*\\b *(?!lur|ord|e))\d+
</code></pre>
<p><strong>Explanation</strong></p>
<ul>
<li><code>(?<=\\ *b *)</code> Positive lookbehind, assert <code>\b</code> with optional spaces in between to the left</li>
<li><code>(?!</code> N... | Regex : Ass subtitles - Match the last \b tag value | regex | 0 | 63 | 1 | 72,168,813 | 72,168,813 | 1 | true | 2022-05-08T22:18:59.410Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Regex : Ass subtitles - Match the last \b tag value<p>I want to match the numeric values of the <strong>last</strong> \b tag, or empty string if there's no n... |
72,188,528 | Better way to use regular expression<p>I have a string of account information with multiple accounts in the string (the example shows one line, where I actually have a text file with multiple lines of account data, so there is another loop going through each line in the text file in my code). I need to pull out each ac... | <p>Instead of using split, you can match the values:</p>
<pre><code>\b\d\d-\d{7}-\d\d\b.*?(?=\s*\b\d\d-\d{7}-\d\d\b.*?|$)
</code></pre>
<p><strong>Explanation</strong></p>
<ul>
<li><code>\b\d\d-\d{7}-\d\d\b</code> Match the pattern with 2 digits - 7 digits - 2 digits using a quantifier</li>
<li><code>.*?</code> Match a... | Better way to use regular expression | python|regex|regex-replace | 0 | 53 | 1 | 72,190,499 | 72,190,499 | 1 | true | 2022-05-10T14:49:19.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Better way to use regular expression<p>I have a string of account information with multiple accounts in the string (the example shows one line, where I actua... |
72,188,517 | RegEx Pattern Validations failing on html input<p><strong>Issue:</strong>
I'm trying to achieve the following results for the test cases using a Regex pattern on a input type text html.</p>
<p>Looking to meet the following criteria's:</p>
<ol>
<li><p>Numeric only - no alpha or special characters allowed</p>
</li>
<li><... | <p>You could assert not starting with a zero followed by only digits, or only dots, comma's and zero's till the end of the string.</p>
<pre><code>^(?![0,.]*$|0\d*$)\d{1,3}(?:,\d{3})*(?:\.\d{1,2})?$
</code></pre>
<p><strong>Explanation</strong></p>
<ul>
<li><code>^</code> Start of string</li>
<li><code>(?!</code> Negati... | RegEx Pattern Validations failing on html input | javascript|html|jquery|angular|regex | 0 | 52 | 1 | 72,193,520 | 72,193,520 | 1 | true | 2022-05-10T14:48:46.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
RegEx Pattern Validations failing on html input<p><strong>Issue:</strong>
I'm trying to achieve the following results for the test cases using a Regex patter... |
72,199,486 | RegEx minimum 4 characters with no repetition<p>Trying to create a regex where a field should contain minimum 4 characters(only alphabets [a-zA-Z]) where</p>
<ol>
<li>first 4 alphabets should not repeat. eg aaaa,zzzz not acceptable</li>
<li>first 4 characters should not contain space, numbers, special characters</li>
<... | <p>You might write the pattern as:</p>
<pre><code>^(?!(.)\1{3})[a-zA-Z]{4}.*
</code></pre>
<p><strong>Explanantion</strong></p>
<ul>
<li><code>^</code> Start of string</li>
<li><code>(?!(.)\1{3})</code> Negative lookahead, assert not 4 of the same characters</li>
<li><code>[a-zA-Z]{4}</code> Match 4 chars a-z A-Z</li>
... | RegEx minimum 4 characters with no repetition | regex | 0 | 42 | 1 | 72,199,538 | 72,199,538 | 1 | true | 2022-05-11T10:32:12.100Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
RegEx minimum 4 characters with no repetition<p>Trying to create a regex where a field should contain minimum 4 characters(only alphabets [a-zA-Z]) where</p>... |
72,197,401 | How can i reset my document.getElementById color value<p>I'm trying to change the color from red to blue but when the red color come its unchangeable</p>
<pre><code>var colorvalue=0;
var sizevalue;
function CG()
{
colorvalue ++;
if (colorvalue==0)
{
document.getElementById("testd").style.c... | <p>i edit a bit of your code. try below</p>
<pre><code>var colorvalue=0;
var sizevalue;
function CG()
{
colorvalue ++;
if (colorvalue % 2 == 0)
{
document.getElementById("testd").style.color = "blue";
}
else
{
document.getElementById("testd").style.c... | How can i reset my document.getElementById color value | javascript | 0 | 52 | 2 | 72,197,479 | 72,197,479 | 1 | true | 2022-05-11T07:58:29.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i reset my document.getElementById color value<p>I'm trying to change the color from red to blue but when the red color come its unchangeable</p>
<pr... |
72,169,525 | Save multiple radios checked on LocalStorage<p>I have a list of multiple radios and I would like to save which radios are checked in localStorage when the user clicks a button.</p>
<p>Once the user reloads (or comes back on) the page, I would like to check the radios that where checked when he clicked the button.</p>
<... | <blockquote>
<p>You can use this :)</p>
</blockquote>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function saveFav() {
let checked = Array.from(document.querySelectorAll("in... | Save multiple radios checked on LocalStorage | javascript|html|jquery|local-storage | 0 | 64 | 2 | 72,171,176 | 72,171,176 | 1 | true | 2022-05-09T09:11:10.127Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Save multiple radios checked on LocalStorage<p>I have a list of multiple radios and I would like to save which radios are checked in localStorage when the us... |
72,172,278 | HTML - How to stick an element on top of a mat-select scrollable list?<p>I have this mat-select with many optons in it so it becomes scrollable. I've implemented a search bar to filter the options, but if scrolled the input field gets hidden if going too low, just like all other content of the list. How can I make it s... | <p>You just need to add <code>position:sticky</code> and <code>top:0</code> :)</p>
<p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.calendarfilter {
wi... | HTML - How to stick an element on top of a mat-select scrollable list? | html|css | 0 | 113 | 2 | 72,172,470 | 72,172,470 | 1 | true | 2022-05-09T12:48:44.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HTML - How to stick an element on top of a mat-select scrollable list?<p>I have this mat-select with many optons in it so it becomes scrollable. I've impleme... |
72,232,029 | Airflow SimpleHttpOperator is not pushing to xcom<p>I have the following SimpleHttpOperator inside my dag:</p>
<pre><code>extracting_user = SimpleHttpOperator(
task_id='extracting_user',
http_conn_id='user_api',
endpoint='api/', # Some Api already configured and checked
method="GET&... | <p>I solved the problem changing to the version 2.0.0 of airflow. It seems that the SimpleHttpOperator doesn't store the request response on the xcom table on 2.3.0 version</p> | Airflow SimpleHttpOperator is not pushing to xcom | python|airflow | 0 | 237 | 1 | 72,234,393 | 72,234,393 | 1 | true | 2022-05-13T15:28:42.163Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Airflow SimpleHttpOperator is not pushing to xcom<p>I have the following SimpleHttpOperator inside my dag:</p>
<pre><code>extracting_user = SimpleHttpOperato... |
72,154,410 | Finding biggest integer smaller than max key but not in AVL tree<p>Given AVL tree T, I need to find the maximal integer which is smaller than maximal key in tree, but is not in tree.</p>
<p>I've written auxiliary functions to get the biggest node, yet my thoughts are stuck.</p>
<p>I tried looking at the rank of the max... | <p>The general idea is: initialize a variable <code>crawl</code> with the <code>max</code> (<code>crawl <- max</code>). Search the second maximum. If it's smaller than <code>crawl-1</code>, your answer is <code>crawl-1</code>. Else, there are two possibilities:</p>
<ol>
<li>The second maximum is equal to <code>crawl... | Finding biggest integer smaller than max key but not in AVL tree | rank|avl-tree | 0 | 85 | 2 | 72,154,542 | 72,154,542 | 1 | true | 2022-05-07T16:24:17.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finding biggest integer smaller than max key but not in AVL tree<p>Given AVL tree T, I need to find the maximal integer which is smaller than maximal key in ... |
72,146,910 | Close hamburger menu when click on anchor links on same page (in mobile view)<p>I use this HTML, CSS and Javascript hamburger menu code: In the mobile view, it doesn't close the menu for me when I click on one of the other menus on the left that have an anchor. It works for the first one with the index.html. What can I... | <p>You can use the custom javascript function to close your hamburger menu options as follows:</p>
<pre><code>const mobile_menu_anchors = document.querySelectorAll('nav.mobile-nav > a');
mobile_menu_anchors.forEach(anchor => {
anchor.addEventListener('click', event => {
menu_btn.classList.remove('... | Close hamburger menu when click on anchor links on same page (in mobile view) | javascript|css|response|anchor|hamburger-menu | 0 | 78 | 1 | 72,151,402 | 72,151,402 | 1 | true | 2022-05-06T20:13:34.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Close hamburger menu when click on anchor links on same page (in mobile view)<p>I use this HTML, CSS and Javascript hamburger menu code: In the mobile view, ... |
72,173,747 | Pyspark: Get index of array element based on substring<p>I have the following dataframe, that contains a column of arrays (<code>col1</code>). I need to get the index of the element that contains a certain substring ("58=").</p>
<pre><code>+-----------------------------------------------------------+-----+
| ... | <p>Check existence of <code>58</code> using the <code>rlike</code> function in a higher order function. Determine position using <code>array_position</code>. Code below</p>
<pre class="lang-py prettyprint-override"><code>df = df.withColumn('index',expr("array_position(transform(col1, x-> rlike(x,58)),true)"... | Pyspark: Get index of array element based on substring | python|arrays|pyspark|user-defined-functions | 0 | 99 | 1 | 72,178,984 | 72,178,984 | 1 | true | 2022-05-09T14:35:55.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pyspark: Get index of array element based on substring<p>I have the following dataframe, that contains a column of arrays (<code>col1</code>). I need to get ... |
72,047,954 | Apply loc to the entire dataframe but one column (keep the one column as it was and not remove it)<p>I am trying to divide the entire dataframe by a fix number but I want to keep the 'Year' column as is. I tried dividing the entire df with 100 and then multiplying the 'Year' column by 100 and then converting it to inte... | <p>Set "Year" as index, do the division, then <code>reset_index</code>:</p>
<pre><code>df = df.set_index("Year").div(100).reset_index()
</code></pre>
<p>Alternatively, divide all columns except "Year":</p>
<pre><code>subset = df.columns.difference(["Year"])
df[subset] = df[subset... | Apply loc to the entire dataframe but one column (keep the one column as it was and not remove it) | python|pandas|dataframe | 0 | 35 | 1 | 72,048,026 | 72,048,026 | 1 | true | 2022-04-28T17:28:49.350Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Apply loc to the entire dataframe but one column (keep the one column as it was and not remove it)<p>I am trying to divide the entire dataframe by a fix numb... |
72,187,053 | Dynamic aggregation in Pandas DataFrame<p>I have timestamped data in a dataframe of the form:</p>
<pre><code>+----+-------+-------+
| ID | DATE | VALUE |
+----+-------+-------+
| 1 | 01-01 | 10 |
| 1 | 01-01 | 20 |
| 1 | 02-01 | 20 |
| 1 | 02-01 | 25 |
| 1 | 03-01 | 30 |
| 2 | 01-01 | 10 |
| 2... | <p>You could write a custom function to compute the averages and then call it with <code>groupby.apply</code>:</p>
<pre><code>def expanding_average(frame):
average = frame.groupby("DATE")["VALUE"].sum().expanding(1).sum().div(frame.groupby("DATE")["VALUE"].count().expanding(1... | Dynamic aggregation in Pandas DataFrame | python|pandas|dataframe|numpy | 0 | 36 | 1 | 72,187,550 | 72,187,550 | 1 | true | 2022-05-10T13:15:22.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dynamic aggregation in Pandas DataFrame<p>I have timestamped data in a dataframe of the form:</p>
<pre><code>+----+-------+-------+
| ID | DATE | VALUE |
+-... |
72,187,790 | Compare multiple lists with same structure for the one with smaller integers at lowest positions<p>I have multiple lists (<strong>arbitrary number of lists, not pre-set</strong>) of the type [65, 34, 13, 6] and all elements have diminishing sizes from index [0] to length (e.g. 65 > 34 > 13 > 6). I want to comp... | <p>Since your lists are decreasing, you can use:</p>
<pre><code>idx, val = [(i, min(vals)) for i, vals in enumerate(zip(*lsts)) if len(set(vals))>1][-1]
output = [l for l in lsts if l[idx]==val][0]
</code></pre>
<h6>Examples:</h6>
<pre><code>lsts = [[165, 54, 33, 6],
[165, 34, 24, 6],
[65, 23, 13, ... | Compare multiple lists with same structure for the one with smaller integers at lowest positions | python|python-3.x|list|compare|comparison | 0 | 40 | 3 | 72,187,954 | 72,187,954 | 1 | true | 2022-05-10T14:02:06.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Compare multiple lists with same structure for the one with smaller integers at lowest positions<p>I have multiple lists (<strong>arbitrary number of lists, ... |
72,193,681 | Pandas: Need to increment duplicate file names starting at 1<p>I have a column containing file names - numerous duplicates - that need to be incremented starting at 001, 002 ...etc. Ex. filename_001.pdf, filename_002.pdf</p>
<pre><code>df_files = pd.DataFrame([[1000, 'filename.pdf'],
[1001, 'f... | <p>Try:</p>
<pre><code>numbered = df_files["Filestub"] + "_" + df_files.groupby("Filestub").cumcount().add(1).astype(str).str.zfill(3) + df_files["ext"]
df["NumberedCopy"] = numbered.where(df_files["Filestub"].duplicated(keep=False), df_files["filename&q... | Pandas: Need to increment duplicate file names starting at 1 | python|pandas|duplicates | 0 | 94 | 1 | 72,193,713 | 72,193,713 | 1 | true | 2022-05-10T22:46:43.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas: Need to increment duplicate file names starting at 1<p>I have a column containing file names - numerous duplicates - that need to be incremented star... |
72,207,220 | Tricky duplicate rows based on condition and add a counter in Python<p>I have a dataframe where if a certain condition is met, I'd like to essentially create a duplicate of that row. <strong>Row should be duplicated IF 'Date' = Q4.22 or > AND type = 'live'</strong>
Also, for every duplicate created the 'unit' count ... | <p>Try:</p>
<ol>
<li>Convert your date column to timestamps</li>
<li><code>concat</code> your original data with the filtered data</li>
<li><code>groupby</code> to get the <code>cumcount</code> of "id" and "Date" and set the "unit" accordingly</li>
</ol>
<pre><code>df["Date"] = p... | Tricky duplicate rows based on condition and add a counter in Python | python|pandas|numpy | 0 | 51 | 2 | 72,207,774 | 72,207,774 | 1 | true | 2022-05-11T20:24:12.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Tricky duplicate rows based on condition and add a counter in Python<p>I have a dataframe where if a certain condition is met, I'd like to essentially create... |
72,216,332 | Subtract columns value in ascending order value of a column<p>Have a dataframe mortgage_data with columns name mortgage_amount and month (in asceding order)</p>
<p><code>mortgage_amount_paid = 1000</code></p>
<p>mortgage_data:</p>
<pre><code>name mortgage_amount month
mark 400 1
mark 500 ... | <p>Here is one way :</p>
<pre><code>import numpy as np
mortgage_amount_paid = 1000
df['mortgage_amount_updated'] = np.where(mortgage_amount_paid - df['mortgage_amount'].cumsum() >=0 , 0, df['mortgage_amount'].cumsum() - mortgage_amount_paid)
df['paid_full'] = np.where(df['mortgage_amount_updated'],'no','yes')
</code... | Subtract columns value in ascending order value of a column | python|python-3.x|pandas|dataframe | 0 | 58 | 2 | 72,216,667 | 72,216,667 | 1 | true | 2022-05-12T13:17:54.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Subtract columns value in ascending order value of a column<p>Have a dataframe mortgage_data with columns name mortgage_amount and month (in asceding order)<... |
72,086,425 | How to re-pass a parameter to another screen?<p>The last screen takes the color parameter from the previous screen - arg. I need that when you click on the button on the last screen, this parameter, which takes the last screen, is again transferred to the HomeScreenWidget. How can this be implemented?</p>
<p>My code:</... | <p>You can have <code>HomeScreenWidget</code> take a <code>ColorArguments</code> parameter in the constructor like so:</p>
<pre><code>class HomeScreenWidget{
final ColorArguments? colorArgs;
final String valueText;
HomeScreenWidget({
Key? key,
required this.valueText;
required this.colorArgs;
});
}
... | How to re-pass a parameter to another screen? | flutter|dart | 0 | 29 | 1 | 72,086,504 | 72,086,504 | 1 | true | 2022-05-02T12:05:10.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to re-pass a parameter to another screen?<p>The last screen takes the color parameter from the previous screen - arg. I need that when you click on the b... |
72,167,386 | Flutter using useEffect to get data from server and getting return type error<p>After implementing a simple <code>riverpod</code> library to send request and getting response from server, when i try to use <code>useEffect</code> for that i get this error:</p>
<pre><code>Error: A value of type 'Future<NetworkRequestS... | <p><code>useProvider</code> doesn't return a <code>void Function()?</code> and <code>useEffect</code> expects a <code>void Function()?</code> to be returned.</p>
<p>Do this:</p>
<pre><code>useEffect((){
useProvider(postProvider.notifier).getPosts();
return (){};
});
</code></pre>
<p>Or you can choose to not return ... | Flutter using useEffect to get data from server and getting return type error | flutter|dart|riverpod|hook-widgets | 0 | 177 | 1 | 72,167,634 | 72,167,634 | 1 | true | 2022-05-09T05:37:16.737Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter using useEffect to get data from server and getting return type error<p>After implementing a simple <code>riverpod</code> library to send request and... |
72,181,030 | Vuetify Data-table expanding all rows on click instead of just the selected row<p>I have a data-table of items, I'm wanting to expand only the selected row to show extra information but it ends up expanding all existing row items instead.</p>
<p><strong>EDIT Sorry</strong> Im wanting to single-expand without the use o... | <p>You can use the demo provided by vuetify
In the website
<a href="https://vuetifyjs.com/en/components/data-tables/#expandable-rows" rel="nofollow noreferrer">https://vuetifyjs.com/en/components/data-tables/#expandable-rows</a></p>
<p>Var:
expanded=[ ]
This is the template</p>
<pre><code><template>
<v-data-... | Vuetify Data-table expanding all rows on click instead of just the selected row | javascript|html|vue.js|vuetify.js | 0 | 84 | 1 | 72,181,129 | 72,181,129 | 1 | true | 2022-05-10T05:13:41.553Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vuetify Data-table expanding all rows on click instead of just the selected row<p>I have a data-table of items, I'm wanting to expand only the selected row t... |
72,223,070 | Specify the order of scripts in Laravel Mix<p>I'm trying to combine two JS scripts into one file. One is a third-party library, and the other is some custom js. No matter how I specify the scripts in the mix.js array, it always puts the custom.js on top. I want to put the library on top. How can I achieve that?</p>
<p>... | <p>Consider the following Mix configuration file.</p>
<pre><code>mix.combine(['one.js', 'two.js'], 'merged.js');
</code></pre>
<p>This instructs Mix to merge - or concatenate - one.js and two.js into a single file, called merged.js. As always, during development, that merged file will remain uncompressed. However, when... | Specify the order of scripts in Laravel Mix | laravel|laravel-mix | 0 | 222 | 1 | 72,223,343 | 72,223,343 | 1 | true | 2022-05-12T23:34:26.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Specify the order of scripts in Laravel Mix<p>I'm trying to combine two JS scripts into one file. One is a third-party library, and the other is some custom ... |
72,192,019 | How to implement this stacked line chart in MPAndroidCharts or iOS-Charts<p>I have a number of charts/graphs created with the ported MPAndroidCharts project <a href="https://github.com/danielgindi/Charts" rel="nofollow noreferrer">iOS-Charts by DanielGindi</a> but I'm getting a request and I'm just not sure it's techni... | <p>It looks like a line chart with three lines and each with a solid fill.</p>
<p>In the top one, the dashed line graph has a white stroke and no fill, but in the bottom one, it has a black stroke and gray fill.</p>
<p>In the top one, the dashed line should be z-ordered to be on top, but in the bottom one, it should be... | How to implement this stacked line chart in MPAndroidCharts or iOS-Charts | swift|xcode|ios-charts | 0 | 180 | 1 | 72,192,155 | 72,192,155 | 1 | true | 2022-05-10T19:29:26.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to implement this stacked line chart in MPAndroidCharts or iOS-Charts<p>I have a number of charts/graphs created with the ported MPAndroidCharts project ... |
72,144,944 | Mask from bitfield in C++<p>Here's a little puzzle I couldn't find a good answer for:</p>
<p>Given a struct with bitfields, such as</p>
<pre class="lang-cpp prettyprint-override"><code>struct A {
unsigned foo:13;
unsigned bar:19;
};
</code></pre>
<p>Is there a (portable) way in C++ to get the correct mask for o... | <p>Unfortunately, there is no better way - in fact, there is <em>no</em> way to extract individual adjacent bit fields from a struct by inspecting its memory directly in C++.</p>
<p>From <a href="https://en.cppreference.com/w/cpp/language/bit_field" rel="nofollow noreferrer">Cppreference</a>:</p>
<blockquote>
<p>The f... | Mask from bitfield in C++ | c++|reflection|bit-fields | 0 | 104 | 1 | 72,145,346 | 72,145,346 | 1 | true | 2022-05-06T16:50:09.187Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mask from bitfield in C++<p>Here's a little puzzle I couldn't find a good answer for:</p>
<p>Given a struct with bitfields, such as</p>
<pre class="lang-cpp ... |
72,237,054 | Swift for loop not waiting for firestore call to complete<p>I know firestore calls are async which means this will not work:</p>
<pre><code> private func removeUserSavedMomentFromAllUsers(moment: StoryMoment, completion: @escaping () -> Void) {
guard let savedByUIDs = moment.savedByUIDs else { return }
... | <p>The code in the first part of the question does work - and works fine for small group of data. However, in general it's recommended to not call Firebase functions in tight loops.</p>
<p>While the question mentions DispatchQueues, we use DispatchGroups with .enter and .leave as it's pretty clean.</p>
<p>Given a Fireb... | Swift for loop not waiting for firestore call to complete | swift|firebase|google-cloud-firestore | 0 | 125 | 1 | 72,241,370 | 72,241,370 | 1 | true | 2022-05-14T03:14:41.237Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Swift for loop not waiting for firestore call to complete<p>I know firestore calls are async which means this will not work:</p>
<pre><code> private func ... |
72,115,809 | Validating is there any different menu item with capybara<p>I will try to improve the question.
How to validate if a different item is included in the menu: GAR?
I used it below and it still didn't work
page.all('select#tbm2').map(&:value).should == %w(Regras, GAR Regras, GAE Log Processamentos GAR/GAE)</p>
<pre><c... | <p><code>all('select#tbm2')</code> is going to find all <code><select></code> elements with an id of <code>tbm2</code>, of which there are none in your HTML. Also <code>.value</code> gets the <code>value</code> property of an element but you have all <code>div</code> elements which don't have a value. If you wan... | Validating is there any different menu item with capybara | ruby|capybara | 0 | 33 | 1 | 72,121,491 | 72,121,491 | 1 | true | 2022-05-04T15:42:46.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Validating is there any different menu item with capybara<p>I will try to improve the question.
How to validate if a different item is included in the menu: ... |
72,166,148 | Linear Regression - how to predict the estimated relative performance?<blockquote>
<p>Paul need a laptop that is fast enough. One of the main parameter of computers which he must focus on is CPU. In this project we need to forecast performance of CPU which is characterized in terms of cycle time and memory capacity and... | <p>In any fitted model from <code>statsmodels</code> you can extract predicted values with method predict() and then add them to your frame.</p>
<pre><code>data['predicted'] = results.predict()
</code></pre>
<p><a href="https://i.stack.imgur.com/PkalU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P... | Linear Regression - how to predict the estimated relative performance? | python|pandas|linear-regression|prediction | 0 | 80 | 3 | 72,166,766 | 72,166,766 | 1 | true | 2022-05-09T01:20:50.837Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Linear Regression - how to predict the estimated relative performance?<blockquote>
<p>Paul need a laptop that is fast enough. One of the main parameter of co... |
72,222,147 | Mass Find & Replace including subfolders<p>I don't really know VBA but have had some success with manipulating code in the past. I'm getting stuck with this one, where I tried to mix 2 different ideas into one. What I want to do is a mass find & replace with pop-up boxes to (1) select or insert the path (that inclu... | <p>«I need pop-up windows as described in my original post. I'm not familiar enough with this stuff to make changes» For example:</p>
<pre><code>Option Explicit
Dim FSO As Object, oFolder As Object, StrFolds As String, StrFnd As String, StrRep As String
Sub Main()
Dim TopLevelFolder As String, TheFolders As Variant, ... | Mass Find & Replace including subfolders | vba|ms-word|batch-processing|docx | 0 | 229 | 2 | 72,253,236 | 72,253,236 | 1 | true | 2022-05-12T21:17:29.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mass Find & Replace including subfolders<p>I don't really know VBA but have had some success with manipulating code in the past. I'm getting stuck with this ... |
72,159,198 | JS/ How to search with input by firstname and lastname but also work if i type space after firstname<pre><code>let input = document.getElementById('searchInput')
let searchField = document.getElementById('searchField')
input.addEventListener('keyup', (e) => {
const string = e.target.value
const filteredUsers = ... | <p>Replace this:</p>
<pre><code>const string = e.target.value
if (user.name.first.toLowerCase().includes(string) || user.name.last.toLowerCase().includes(string)) {
</code></pre>
<p>With this:</p>
<pre><code>const q1 = e.target.value.split(' ')[0]
const q2 = e.target.value.split(' ')[1]
if (user.name.first.toLowerCase(... | JS/ How to search with input by firstname and lastname but also work if i type space after firstname | javascript|html|search | 0 | 320 | 1 | 72,159,270 | 72,159,270 | 1 | true | 2022-05-08T08:13:51.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JS/ How to search with input by firstname and lastname but also work if i type space after firstname<pre><code>let input = document.getElementById('searchInp... |
72,178,360 | Why does my attempt at backtracking to solve the balanced parentheses problem not work?<p>I'm not sure what I'm misunderstanding about backtracking.</p>
<p>Problem:</p>
<blockquote>
<p>Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.</p>
</blockquote>
<p>Example 1:... | <p>I'm not sure if the extra complication is necessary. We can have a recursion that keeps track and doesn't let the count of right parentheses (<code>r</code>) exceed the count of the left (<code>n</code>) at any point during the construction:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="... | Why does my attempt at backtracking to solve the balanced parentheses problem not work? | python|algorithm|backtracking | 0 | 48 | 1 | 72,195,173 | 72,195,173 | 1 | true | 2022-05-09T21:25:16.190Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does my attempt at backtracking to solve the balanced parentheses problem not work?<p>I'm not sure what I'm misunderstanding about backtracking.</p>
<p>P... |
72,158,129 | How can I Python web scrape a CSV download button that uses a JavaScript function?<p>I am trying to Python web scrape this webpage daily for a school project: <a href="https://thereserve2.apx.com/myModule/rpt/myrpt.asp?r=206" rel="nofollow noreferrer">https://thereserve2.apx.com/myModule/rpt/myrpt.asp?r=206</a></p>
<p>... | <p>Needed the cookie as well to make it work~</p>
<pre><code>import requests
from io import StringIO
import pandas as pd
data = {
'myFilter': '',
'Data': 'Stamp_0',
'Title': 'Retired Offset Credits',
'Exclude': ',rhid,ftType,Other Attributes here,Make Public,ahid,',
'Columns': 'all,Account Holder,Q... | How can I Python web scrape a CSV download button that uses a JavaScript function? | python|asp.net|web-scraping|python-requests | 0 | 76 | 1 | 72,158,352 | 72,158,352 | 1 | true | 2022-05-08T04:44:53.863Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I Python web scrape a CSV download button that uses a JavaScript function?<p>I am trying to Python web scrape this webpage daily for a school project... |
72,208,311 | Accelerating speed of reading contents from dataframe in pandas<p>Let us suppose we have table with following dimension :</p>
<pre><code>print(metadata.shape)-(8732, 8)
</code></pre>
<p><a href="https://i.stack.imgur.com/oHXXj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oHXXj.png" alt="enter imag... | <p>You could try and run the feature extractor in parallel, this could give a new column in your dataframe with the <code>mfccs_scaled_features</code>.</p>
<pre><code>from pandarallel import pandarallel
pandarallel.initialize()
PATH = os.path.abspath(Base_Directory)
def feature_extractor(file_name):
# If using wi... | Accelerating speed of reading contents from dataframe in pandas | python|pandas|optimization | 0 | 43 | 1 | 72,208,460 | 72,208,460 | 1 | true | 2022-05-11T22:36:58.910Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Accelerating speed of reading contents from dataframe in pandas<p>Let us suppose we have table with following dimension :</p>
<pre><code>print(metadata.shape... |
72,221,260 | How to indicate leading zero differences row wise?<p>I have this as the ID numbers:
"00456, 0000456, 567, 00567" in a dataframe called "test".</p>
<p>I created a dataframe where it has the IDs with leading zeros in a column called ID, and a left strip version of the ID in a column named stripped. an... | <p>Are either of these helpful to what you want to do?</p>
<p>Given a column of ids:</p>
<pre><code> id
0 00456
1 0000456
2 456
3 00345
4 345
5 00000345
</code></pre>
<p>Doing:</p>
<pre><code>df['id'].groupby(df.id.str.lstrip('0')).agg(list)
</code></pre>
<p>Output:</p>
<pre><code>id
345 ... | How to indicate leading zero differences row wise? | python|pandas | 0 | 62 | 2 | 72,222,136 | 72,222,136 | 1 | true | 2022-05-12T19:39:37.910Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to indicate leading zero differences row wise?<p>I have this as the ID numbers:
"00456, 0000456, 567, 00567" in a dataframe called "test&q... |
72,142,888 | Change directory in Jupyter Lab not working<p>I ran the commands attached below in my command line and it works, as it should, but not in JupyterLab. It seems odd but I was wondering what's going on?</p>
<p><a href="https://i.stack.imgur.com/7sLzD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7sLzD... | <p>The <code>!cd datasets</code> command did work. However, you aren't understanding what is going on with the use of the exclamation point. What the exclamation point does is open a separate temporary shell instance and does work returning what gets returned. The separate shell instance goes away. <em>Poof</em></p>
<p... | Change directory in Jupyter Lab not working | python|jupyter-notebook|command-line-interface|jupyter|jupyter-lab | 0 | 73 | 1 | 72,143,382 | 72,143,382 | 1 | true | 2022-05-06T14:11:50.867Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change directory in Jupyter Lab not working<p>I ran the commands attached below in my command line and it works, as it should, but not in JupyterLab. It seem... |
72,174,482 | Bold certain part of Ipywidgets Button text<p>I am creating a button in Jupyter Notebook using ipywidgets with the following code:</p>
<pre><code>from IPython.display import Javascript, display
from ipywidgets import widgets
from ipywidgets import Layout,interact, interactive, fixed, interact_manual, IntSlider, HBox, L... | <p>From <a href="https://discourse.jupyter.org/t/how-to-make-certain-words-of-button-description-bold/9148" rel="nofollow noreferrer">here</a>:</p>
<p>It looks like it will be possible to use HTML tags in the description when version 8 is out.</p>
<p>Because the description accepts unicode, for now the workaround is to... | Bold certain part of Ipywidgets Button text | python|jupyter-notebook|jupyter|ipywidgets | 0 | 224 | 1 | 72,176,366 | 72,176,366 | 1 | true | 2022-05-09T15:25:51.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bold certain part of Ipywidgets Button text<p>I am creating a button in Jupyter Notebook using ipywidgets with the following code:</p>
<pre><code>from IPytho... |
72,178,957 | Jupyter notebook python library testbook not giving any results<p>Here's my jupyter notebook's cell 1 (notebook is called tested.ipynb)</p>
<pre><code>def func(a,b):
return a+b
</code></pre>
<p>Here's the testbook testing python code (tester.py):</p>
<pre><code>import testbook
@testbook.testbook('tested.ipynb',execu... | <p>That's because you still need to use pytest, or another unit testing library, to run your tests. Note under 'Features' it says:</p>
<blockquote>
<p>"Works with any unit testing library - unittest, pytest or nose" -<a href="https://testbook.readthedocs.io/en/latest/index.html#features" rel="nofollow norefer... | Jupyter notebook python library testbook not giving any results | python-3.x|jupyter-notebook|jupyter|testbook | 0 | 32 | 1 | 72,189,981 | 72,189,981 | 1 | true | 2022-05-09T22:47:40.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jupyter notebook python library testbook not giving any results<p>Here's my jupyter notebook's cell 1 (notebook is called tested.ipynb)</p>
<pre><code>def fu... |
72,233,304 | How do you set the value of a variable to the value of an arrays slot defined by another variable(see code) in Batch<p>in a larger program that I am attempting to create in batch format it is important that I learn how to set a variables value to that of an arrays value as determined by the number of another variable i... | <p>I believe there are other tricks that can do this, but basic method would be this:</p>
<pre><code>@ECHO OFF
SETLOCAL EnableDelayedExpansion
set a[1]=1
set a[0]=10000
set c=0
set b=!a[%c%]!
echo %b%
</code></pre>
<p><strong>EDIT:</strong>
Stephan's comment had a link that included the trick I... | How do you set the value of a variable to the value of an arrays slot defined by another variable(see code) in Batch | batch-file | 0 | 57 | 3 | 72,233,633 | 72,233,633 | 1 | true | 2022-05-13T17:19:05.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you set the value of a variable to the value of an arrays slot defined by another variable(see code) in Batch<p>in a larger program that I am attempti... |
72,035,791 | Partially refund the authorized order in Paypal<p>I am trying to make a partial refund in PayPal v2 SDK but each time the whole amount is captured. I am just capturing the different amount so in this way the rest amount should be dropped, but the full amount is captured no matter I am requesting the partial. Workflow i... | <p>Your request body's fields are incorrect and so are not recognized. Unrecognized fields are ignored. Since everything about your body is being ignored, the original amount is being captured.</p>
<p>To create a body with correct fields, see <a href="https://developer.paypal.com/docs/api/payments/v2/#authorizations_ca... | Partially refund the authorized order in Paypal | php|paypal | 0 | 35 | 1 | 72,035,853 | 72,035,853 | 1 | true | 2022-04-27T22:02:40.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Partially refund the authorized order in Paypal<p>I am trying to make a partial refund in PayPal v2 SDK but each time the whole amount is captured. I am just... |
72,151,214 | I called Paypal subscription API which returns success message but don't see any active subscription in the Paypal dashboard<p>I am trying to create Paypal subscription through its Rest API using live client and secret.
The API returns success message. The GET subscription API returns the active subscription created, h... | <p>First of all, everything in your question shows creating a plan. A plan is not a subscription, it is the cycle details to be able to create a subscription.</p>
<p>Secondly, creating a subscription still will not do anything unless a payer signs in to <em>approve</em> it. For a payer to approve a subscription, use a ... | I called Paypal subscription API which returns success message but don't see any active subscription in the Paypal dashboard | paypal|paypal-subscriptions | 0 | 64 | 1 | 72,155,770 | 72,155,770 | 1 | true | 2022-05-07T09:27:40.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I called Paypal subscription API which returns success message but don't see any active subscription in the Paypal dashboard<p>I am trying to create Paypal s... |
72,064,063 | Retrieving data from HTML having the child direction using python<p>I'm trying to get the email from the city from <a href="http://www.comuni-italiani.it/110/index.html" rel="nofollow noreferrer">http://www.comuni-italiani.it/110/index.html</a></p>
<p>I have the speceific child direction using xPath Finder which is <co... | <p>Please find my attempt to solve your problem below. It starts the same way as in your code, just has a bit of magic to find the email and print it out.</p>
<pre><code>from bs4 import BeautifulSoup
import requests
sample_web_page = 'http://www.comuni-italiani.it/110/index.html'
page = requests.get(sample_web_page)... | Retrieving data from HTML having the child direction using python | python|html|parsing | 0 | 29 | 1 | 72,064,193 | 72,064,193 | 1 | true | 2022-04-29T21:59:22.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Retrieving data from HTML having the child direction using python<p>I'm trying to get the email from the city from <a href="http://www.comuni-italiani.it/110... |
72,206,128 | When raycasting forms multiple intersections, which point does it return? Can which point is returned be controlled?<p>I'm working on a chess "game" in Godot where players can import 3D models for the board and wrap a checkerboard around it with uv coordinates. All the conversions between world, local, and uv... | <p>We could render to a hidden <code>Viewport</code> and query that.</p>
<p>So let us start by adding a <code>Viewport</code> to your scene. Make sure it has a size set. In fact, we can resize to match the main <code>Viewport</code> with a script. For example:</p>
<pre><code>extends Viewport
func _ready() -> void:... | When raycasting forms multiple intersections, which point does it return? Can which point is returned be controlled? | game-physics|godot|gdscript | 0 | 146 | 1 | 72,208,592 | 72,208,592 | 1 | true | 2022-05-11T18:44:42.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When raycasting forms multiple intersections, which point does it return? Can which point is returned be controlled?<p>I'm working on a chess "game"... |
71,956,261 | Jest: to check if a function is called by a specific instance of class in JavaScript/Typescript<p>I am testing some express middlewares with jest.</p>
<pre><code>it("should throw 400 error if request.body.id is null", () => {
const req = { body: { id: null } } as any;
const res = {} as any;
con... | <p>After a cursory look at the jest documentation, it seems that <a href="https://jestjs.io/docs/expect#expectextendmatchers" rel="nofollow noreferrer"><code>expect.extend</code></a> might do what you want:</p>
<pre class="lang-js prettyprint-override"><code>expect.extend({
toBeErrorResponse(received) {
if (recei... | Jest: to check if a function is called by a specific instance of class in JavaScript/Typescript | javascript|typescript|express|jestjs | 0 | 262 | 1 | 72,060,756 | 72,060,756 | 1 | true | 2022-04-21T14:31:14.860Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jest: to check if a function is called by a specific instance of class in JavaScript/Typescript<p>I am testing some express middlewares with jest.</p>
<pre><... |
72,118,943 | Correct way to push in string[] react+typescript<p>What is the correct way to push elements in string[] in react?
I'm getting <code> Type '(string | string[])[]' is not assignable to type 'string[]'</code></p>
<p>This is a playground link : <a href="https://playcode.io/893658" rel="nofollow noreferrer">Here</a></p>
<p>... | <p>You appear to be missing a square bracket in your example code:</p>
<pre class="lang-js prettyprint-override"><code>| null>(['')
</code></pre>
<p>Should be</p>
<pre class="lang-js prettyprint-override"><code>| null>([''])
</code></pre>
<p>Change line 8 so you're also spreading the second array, and it fixes yo... | Correct way to push in string[] react+typescript | reactjs|typescript|react-hooks | 0 | 26 | 1 | 72,119,137 | 72,119,137 | 1 | true | 2022-05-04T20:12:50.300Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Correct way to push in string[] react+typescript<p>What is the correct way to push elements in string[] in react?
I'm getting <code> Type '(string | string[]... |
72,173,318 | Printing prime factors of numbers in C<p>The code fits the first number and prints it constantly. how can i fix this?</p>
<pre class="lang-c prettyprint-override"><code>int count = 0;
for (int i = 0; i <= 20; i++) {
for (count = 2; i > 1; count++) {
while (i % count == 0) {
printf("%d... | <p>The values in each iteration are as follows.</p>
<ol>
<li><code>count = 0; i = 0;</code> Doesn't enter the second <strong>for</strong>.</li>
<li><code>count = 0; i = 1;</code> Doesn't enter the second <strong>for</strong>.</li>
<li><code>count = 0; i = 2;</code> Enters the second <strong>for</strong>. <code>count = ... | Printing prime factors of numbers in C | c | 0 | 83 | 2 | 72,174,002 | 72,174,002 | 1 | true | 2022-05-09T14:06:41.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Printing prime factors of numbers in C<p>The code fits the first number and prints it constantly. how can i fix this?</p>
<pre class="lang-c prettyprint-over... |
72,215,137 | How do I add a onclick event listener to all of my dynamically created rows?<p>I am creating some dynamic rows in my table and attaching <code>onclick listener</code> to them:</p>
<pre><code>var i=0;
while(i!=5){
var row=table.insertRow(table.rows.length);
var cell=row.insertCell(0);
var cell1=row.insertCe... | <p>Delegate to nearest static container</p>
<pre><code>function f1(e) {
console.log(e.target.closest("tr").id, ";", e.target.textContent);
}
table.addEventListener("click", f1)
</code></pre>
<p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
<... | How do I add a onclick event listener to all of my dynamically created rows? | javascript | 0 | 46 | 1 | 72,215,192 | 72,215,192 | 1 | true | 2022-05-12T11:57:03.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I add a onclick event listener to all of my dynamically created rows?<p>I am creating some dynamic rows in my table and attaching <code>onclick listen... |
72,226,742 | button not triggering call back function when clicked on. No way to know why as no error's thrown by console<p>I'm using an event listener on the button element. The user's first asked to select a language. Once they've have done so they are presented with the button in question. Clicking on it triggers a call back fun... | <p>You have invalid HTML. P cannot contain a DIV and the empty P created by the two</p>
<pre><code><p><div class=welcomeText></div></p>
</code></pre>
<p>and</p>
<pre><code><p class="finalMessage">
<div class=""></div>
</p>
</code></pre>
<p>you have b... | button not triggering call back function when clicked on. No way to know why as no error's thrown by console | javascript|html|css|button|callback | 0 | 35 | 1 | 72,226,823 | 72,226,823 | 1 | true | 2022-05-13T08:43:19.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
button not triggering call back function when clicked on. No way to know why as no error's thrown by console<p>I'm using an event listener on the button elem... |
72,183,639 | How to create a Tags collection and a Categories collection in Eleventy<p>I have the following two blocks of code in my <code>.eleventy.js</code> file</p>
<pre><code> // Tags
eleventyConfig.addCollection('tagList', collection => {
const tagsSet = new Set();
collection.getAll().forEach(item =&g... | <p>Your issue might be in the pagination in your template. You're paginating on the <a href="https://www.11ty.dev/docs/collections/" rel="nofollow noreferrer"><code>collections</code> object</a>, which is an object mapping tags (a special 11ty front matter attribute) to pages with that tag.</p>
<p>Since you're creating... | How to create a Tags collection and a Categories collection in Eleventy | eleventy | 0 | 225 | 2 | 72,193,728 | 72,193,728 | 1 | true | 2022-05-10T09:15:10.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a Tags collection and a Categories collection in Eleventy<p>I have the following two blocks of code in my <code>.eleventy.js</code> file</p>
<p... |
72,184,479 | R create monthly returns from daily returns (without xts)<p>Similar existing topics mostly use stock prices instead of returns, this is why I created a new topic for my question.</p>
<p>I am trying to create geometric monthly portfolio returns out of daily portfolio returns, in this way:</p>
<p><a href="https://i.stack... | <p>Your solution comes close, you just needed to make it <code>prod</code> instead of <code>cumprod</code>:</p>
<pre class="lang-r prettyprint-override"><code>library(dplyr)
library(lubridate)
size = 1e4
set.seed(100)
df <- tibble(
Date = sample(seq(as.Date('2020/01/01'), as.Date('2022/01/01'), by="day"... | R create monthly returns from daily returns (without xts) | r|dplyr|quantmod | 0 | 51 | 1 | 72,184,934 | 72,184,934 | 1 | true | 2022-05-10T10:15:13.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R create monthly returns from daily returns (without xts)<p>Similar existing topics mostly use stock prices instead of returns, this is why I created a new t... |
72,194,960 | Creating tabs in markdown<p>How would I be able to indent the <code>G(2)</code> and <code>G(1)</code> so that they are inline just below the 2 expressions. <code>G(2)</code> being just below <code>[16/4..]</code> and G(1) being just below <code>[1/4..]</code>. How would I be able to do such a thing in markdown?</p>
<pr... | <p>You are probably looking for the <code>underbrace</code> command:</p>
<pre><code>$$\underbrace{\left[\frac{16}{4}-3\left(\frac{4}{2}\right)+2\right]}_{G(2)} - \underbrace{\left[\frac{1}{4}-\frac{3}{2}+1\right]}_{G(1)}$$
</code></pre>
<p><a href="https://i.stack.imgur.com/RekW9.png" rel="nofollow noreferrer"><img src... | Creating tabs in markdown | css|math|markdown|mathjax | 0 | 69 | 1 | 72,195,150 | 72,195,150 | 1 | true | 2022-05-11T03:11:16.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating tabs in markdown<p>How would I be able to indent the <code>G(2)</code> and <code>G(1)</code> so that they are inline just below the 2 expressions. <... |
72,172,536 | Ajax POST not posting model to the controller in asp.net core 6<p>I am trying to POST data to my controller from an event raised from Kendo dialog. But, the model is always coming as null. I tried various steps which were mentioned in StackOverflow itself, but none of them works.</p>
<p><strong>My Ajax call</strong></p... | <p>It was due to a <code>datatype</code> mismatch in one of my <code>property</code> in the model. <code>IsActive</code> is <code>Int</code> in model and since I was passing an empty string it was not deserializing properly.</p>
<p>I debugged this by using the below code</p>
<pre><code> [HttpPost]
public JsonResu... | Ajax POST not posting model to the controller in asp.net core 6 | javascript|ajax|.net-core|asp.net-core-mvc | 0 | 826 | 2 | 72,182,259 | 72,182,259 | 1 | true | 2022-05-09T13:09:33.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ajax POST not posting model to the controller in asp.net core 6<p>I am trying to POST data to my controller from an event raised from Kendo dialog. But, the ... |
72,234,637 | Implement an SQL query in LINQ<p>I'm trying implement the follow query in LINQ, but I don't find solution:</p>
<p>SQL:</p>
<pre><code>SELECT COUNT(*) AS AmountMonths
FROM (SELECT SUBSTRING(CONVERT(NVARCHAR(12), pay_date, 112), 1, 6) AS Month
FROM #tmp
GROUP BY SUBSTRING(CONVERT(NVARCHAR(12), pay_date, 112)... | <p>(Assuming you're using EF Core)</p>
<p>You're almost there. You could do:</p>
<pre><code>var amountMonths = context.AmountMonths.GroupBy(c => new { c.PayDate.Year, c.PayDate.Month }).Count();
</code></pre>
<p>This will translate to something like:</p>
<pre><code>SELECT COUNT(*)
FROM (
SELECT DATEPART(year... | Implement an SQL query in LINQ | c#|sql-server|linq | 0 | 85 | 1 | 72,235,495 | 72,235,495 | 1 | true | 2022-05-13T19:36:46.720Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Implement an SQL query in LINQ<p>I'm trying implement the follow query in LINQ, but I don't find solution:</p>
<p>SQL:</p>
<pre><code>SELECT COUNT(*) AS Amou... |
72,203,904 | Need plugin to control who can approve a stage in Jenkins Pipeline<p>I need a plugin where a team lead can approve if a pipeline can move to the next stage in Jenkins. I am planning to use multistage pipeline(declarative) so after dev stage I need a person to approve(only he can approve) and the developer folks can jus... | <p>To solve the problem of role based approval i used input block with submitter. This means that person who listed as the submitter will only be able to give stage approvals.</p>
<pre><code> stage('Approval') {
agent none
steps {
script {
def deploymentDelay = input id: '... | Need plugin to control who can approve a stage in Jenkins Pipeline | jenkins|jenkins-pipeline|jenkins-plugins|jenkins-groovy | 0 | 159 | 2 | 72,209,989 | 72,209,989 | 1 | true | 2022-05-11T15:39:40.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need plugin to control who can approve a stage in Jenkins Pipeline<p>I need a plugin where a team lead can approve if a pipeline can move to the next stage i... |
72,188,350 | Nginx returns 404 When I use valid_referers<p>This is my environment:</p>
<ul>
<li>Rails</li>
<li>Axios</li>
<li>Next.js</li>
<li>AWS EC2</li>
<li>Nginx</li>
<li>Vercel</li>
</ul>
<p>I have two domains in production environment.
<br>
One is let's say <code>fuga.com</code> which is made with rails and containing some fr... | <p>Every request ends up in a particular location and uses that location <em>content handler</em>. You can't do something like</p>
<pre class="lang-none prettyprint-override"><code>location / {
... some settings ruleset
}
location /admin {
... additional settings ruleset
}
</code></pre>
<p>and expect that <code... | Nginx returns 404 When I use valid_referers | ruby-on-rails|nginx|next.js | 0 | 58 | 1 | 72,195,495 | 72,195,495 | 1 | true | 2022-05-10T14:37:13.397Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Nginx returns 404 When I use valid_referers<p>This is my environment:</p>
<ul>
<li>Rails</li>
<li>Axios</li>
<li>Next.js</li>
<li>AWS EC2</li>
<li>Nginx</li>... |
72,146,043 | SQL Over/Under Column Comparison<p>I am trying to pull rows where the Net_Qty is +/- 300 of the Order_Qty, but I think I might just be missing something with the syntax.</p>
<pre><code>SELECT DISTINCT
o.Ord_No,
odf.OrdFuel_Order_Qty,
odf.OrdFuel_Deliv_Net_Qty
FROM Order_Details_Fuel odf
JOIN Orders o ON odf... | <p>You've got a few things wrong with that query:</p>
<ol>
<li>You have the less/greater than backwards</li>
<li>You have the subtraction backwards</li>
<li>You need an <code>and</code>, not an <code>or</code></li>
</ol>
<p>What you are probably looking for is:</p>
<pre><code>SELECT DISTINCT
o.Ord_No,
odf.OrdFu... | SQL Over/Under Column Comparison | sql|sql-server | 0 | 34 | 1 | 72,146,127 | 72,146,127 | 1 | true | 2022-05-06T18:40:27.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL Over/Under Column Comparison<p>I am trying to pull rows where the Net_Qty is +/- 300 of the Order_Qty, but I think I might just be missing something with... |
72,152,705 | Schema privileges vs Database privileges in PostgreSQL<p>In a PostgreSQL server, I want to create a database (<code>db1</code>) and give all privileges on that database to a user (<code>user1</code>). I run these commands:</p>
<pre><code>CREATE USER user1 WITH PASSWORD 'password';
CREATE DATABASE db1;
\c db1
CREATE SCH... | <blockquote>
<p>What are the privileges granted by that command?</p>
</blockquote>
<p>According to the <a href="https://www.postgresql.org/docs/current/ddl-priv.html" rel="nofollow noreferrer">privileges</a> documentation, a <code>GRANT ALL</code> on the <code>DATABASE</code> level encompasses:</p>
<ul>
<li><code>CREAT... | Schema privileges vs Database privileges in PostgreSQL | postgresql | 0 | 136 | 2 | 72,154,533 | 72,154,533 | 1 | true | 2022-05-07T12:52:43.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Schema privileges vs Database privileges in PostgreSQL<p>In a PostgreSQL server, I want to create a database (<code>db1</code>) and give all privileges on th... |
72,152,797 | insert to the table inside loop or bulk insert with django<p>i need to insert all products in the Cart table to the table called (OrderItem), I have used this code:</p>
<pre><code> neworder.save()
new_order_items = Cart.objects.filter(user=request.user)
for item in new_order_items:
OrderIte... | <p>Can you try with this approach</p>
<pre><code>from django.db import transaction
from django.db.models import F
with transaction.atomic():
new_order_items = Cart.objects.filter(user=request.user)
print(new_order_items) # check if we are getting more than 1 value or not it may be the reason that your loop run ... | insert to the table inside loop or bulk insert with django | python|django|bulkinsert|bulk-create | 0 | 206 | 1 | 72,153,005 | 72,153,005 | 1 | true | 2022-05-07T13:04:45.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
insert to the table inside loop or bulk insert with django<p>i need to insert all products in the Cart table to the table called (OrderItem), I have used thi... |
72,166,627 | Laravel pagination for API<p>I want to make simple pagination for API using Laravel within the format response like this:</p>
<pre><code>{
"code": 0,
"message": "success",
"data": [
{...},
{...}
],
"page_context": {
"page... | <p>You could start by creating a helper class:</p>
<pre><code><?php
namespace App\Helpers;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
class AppHelper
{
public static function defaultMetaInput($input) : array
{
$page = isset($input['page']) ? (int)$input['page'] : 1;
... | Laravel pagination for API | laravel|api|pagination | 0 | 263 | 1 | 72,166,690 | 72,166,690 | 1 | true | 2022-05-09T03:10:33.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel pagination for API<p>I want to make simple pagination for API using Laravel within the format response like this:</p>
<pre><code>{
"code&quo... |
72,198,930 | Preview File before uploading in proper way.(React&Typescript)<p>I am trying to preview the image file before uploading.</p>
<pre><code>const [selectedFile, setSelectedFile] = useState<File>();
const [preview, setPreview] = useState<string>();
<form action="" onSubmit={onUploadImage}>
... | <p>You should first sec the default of <code>selectedFile</code> to be <code>null</code>,<br />
then set <code>src</code> of image directly :</p>
<pre><code>const [selectedFile, setSelectedFile] = useState<File | null>(null);
<input
onChange={(event: ChangeEvent<HTMLInputElement>) => {
if (!... | Preview File before uploading in proper way.(React&Typescript) | reactjs|typescript|image|file|react-hooks | 0 | 45 | 1 | 72,199,546 | 72,199,546 | 1 | true | 2022-05-11T09:51:08.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Preview File before uploading in proper way.(React&Typescript)<p>I am trying to preview the image file before uploading.</p>
<pre><code>const [selectedFile, ... |
72,135,168 | Images are not rendering on Django template from a multi-model view<p><strong>Problem:</strong>
I cannot get images to appear on my template <em>plant_detail.html</em>. I think I'm calling on variables incorrectly, but not sure what to change.</p>
<p><strong>Context:</strong></p>
<p>I created a model <em>PlantImage</em... | <p>The code "PlantImage.objects.all()" gets not only specific image related plant but another images.</p>
<p>so if you want to access PlantImage from Plant, you have to write related_name.</p>
<p><a href="https://docs.djangoproject.com/en/4.0/ref/models/fields/#django.db.models.ForeignKey.related_name" rel="n... | Images are not rendering on Django template from a multi-model view | django|django-models|django-rest-framework|django-views|django-templates | 0 | 32 | 1 | 72,135,217 | 72,135,217 | 1 | true | 2022-05-06T01:18:28.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Images are not rendering on Django template from a multi-model view<p><strong>Problem:</strong>
I cannot get images to appear on my template <em>plant_detail... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.