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,277,345
How to toggle table row based on custom id<p>I have a table in an HTML file used in an Angular application. I need to retrieve the user orders and list the orders in the table. if the user clicks on the Review button, I want the user to be able to see the related order items for this specific order. The review button s...
<p>I have solved this issue by following those steps:</p> <p>1- I have created a JS file in the assets/js folder 2- I have added the above function to the JS file. 3- I have added the file to the angular.json file</p> <pre><code>&quot;scripts&quot;: [&quot;src/assets/js/common.js&quot;] </code></pre> <p>4- run the comm...
How to toggle table row based on custom id
javascript|html|jquery|angular
0
54
1
72,279,099
72,279,099
1
true
2022-05-17T16:06:49.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to toggle table row based on custom id<p>I have a table in an HTML file used in an Angular application. I need to retrieve the user orders and list the o...
72,279,506
Trouble translating this regex to bash<p>I have the following working regex that I tested in regex101</p> <pre><code>^function\s(\w+)\(\)\s{$ </code></pre> <p>for the following test string</p> <pre><code>function hello() { echo &quot;Hello World&quot; } function get_aws_credentials() { echo &quot;Getting AWS Cred...
<p>Would this work or are you trying to create a universal regex for every file type?</p> <pre class="lang-sh prettyprint-override"><code># Get all function names defined in a bash script file # Usage: script.sh &lt;script_file&gt; function get_functions() { local FUNC_NAME=$(basename $1) local FUNC_NAMES=$(gr...
Trouble translating this regex to bash
bash|sed|grep
1
54
4
72,279,594
72,279,594
1
true
2022-05-17T19:12:40.543Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trouble translating this regex to bash<p>I have the following working regex that I tested in regex101</p> <pre><code>^function\s(\w+)\(\)\s{$ </code></pre> <...
72,282,088
Queue actions to run when stopwatch reaches a certain exact timespan<p>I am making a software to show a chronometer on screen and run certain actions at certain times defined by the user. I found a way to show the chronometer on an independent window by using a DispatcherTimer with a 16ms Interval (around 60FPS) but no...
<p>A stopwatch is the wrong tool for the job, you are essentially spinwaiting on a thread, burning CPU time and potentially causing other threads to be starved.</p> <p>The framework already provides this functionality in the form of <a href="https://stackoverflow.com/questions/10317088/why-there-are-5-versions-of-timer...
Queue actions to run when stopwatch reaches a certain exact timespan
c#|.net|wpf|uwp|.net-6.0
0
54
1
72,284,414
72,284,414
1
true
2022-05-18T00:40:52.300Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Queue actions to run when stopwatch reaches a certain exact timespan<p>I am making a software to show a chronometer on screen and run certain actions at cert...
72,272,341
(R) Graphs in a loop and funktion are empty, even though they work when plottet standalone<p>So, I have a boxplot where i annotate the number of datapoint per plot and significance levels in letters above the plots. When plottet in a normal (?!?) workflow, they take about 1-2 seconds to plot in a X Window System Graphi...
<p>I had to post a <code>print(ggplot(...))</code> around it to make it work in a for-loop.</p>
(R) Graphs in a loop and funktion are empty, even though they work when plottet standalone
r|function|for-loop|ggplot2|x11
0
54
1
72,287,073
72,287,073
1
true
2022-05-17T10:25:55.447Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: (R) Graphs in a loop and funktion are empty, even though they work when plottet standalone<p>So, I have a boxplot where i annotate the number of datapoint pe...
72,287,249
Custom Javascript Regex - Cannot make it work<p>I need to accept the following:</p> <ul> <li>x{1}.xxxxx{1,40}</li> <li>x{1}.xxxxx{1,40}-xxxxx{1,40}</li> <li>xxxxx{1,40}</li> <li>xxxxx{1,40}-xxxxx{1,40}</li> <li>xxxx xxxxx xxxxx{words with space between}</li> </ul> <p>My regex is not working...</p> <pre><code>/^([a-z]{1...
<p>You can try with the following regex:</p> <pre><code>^(([a-z]\.)?[a-z]{1,40}(-[a-z]{1,40})?|[a-z]+( [a-z]+)+)$ </code></pre> <p>This solution uses two patterns:</p> <ul> <li>the first one matches your first four samples: <ul> <li>optional first group: <code>[a-z]{1}\.</code></li> <li>mandatory second group: <code>[a...
Custom Javascript Regex - Cannot make it work
regex
1
54
2
72,287,566
72,287,566
1
true
2022-05-18T10:13:28.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Custom Javascript Regex - Cannot make it work<p>I need to accept the following:</p> <ul> <li>x{1}.xxxxx{1,40}</li> <li>x{1}.xxxxx{1,40}-xxxxx{1,40}</li> <li>...
72,287,891
How can I properly override default styles in a shiny application?<p>I would like to preface this by saying that I've looked through answers to slightly similar questions but couldn't quite find what I was looking for.</p> <p>My main job is a data developer however I have a lot of experience with web development. As su...
<p>Shiny allows you to disable the use of bootstrap giving you the freedom to start your styling from scratch:</p> <pre><code>library(shiny) ui &lt;- fluidPage( tags$head( # Note the wrapping of the string in HTML() tags$style(HTML(&quot; body { background-color: black; color: white; ...
How can I properly override default styles in a shiny application?
r|shiny
2
54
2
72,288,158
72,288,158
1
true
2022-05-18T10:56:15.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I properly override default styles in a shiny application?<p>I would like to preface this by saying that I've looked through answers to slightly simi...
72,275,167
How to import gitsubmodule containing golang code with go.mod and go.sum file<p>I am facing issue in importing a gitsubmodule containing golang package with go.mod and go.sum file inside the package inside main project directory. But facing issue in importing the package.</p> <p>go.mod inside gitsubmodule package</p> <...
<p>the solution to this problem is inside the main go.mod file add the following line</p> <pre><code>replace abc =&gt; ./abc </code></pre> <p>and do go mod tidy</p>
How to import gitsubmodule containing golang code with go.mod and go.sum file
git|go|git-submodules
0
54
1
72,288,691
72,288,691
1
true
2022-05-17T13:45:22.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to import gitsubmodule containing golang code with go.mod and go.sum file<p>I am facing issue in importing a gitsubmodule containing golang package with ...
72,296,228
Сonvert the coefficients of the Hermite polynomial into a function<p>I want to make a function from the output of Matlab Hermite function (for example, if we had an output from Hermite function <code>[8 0 -12 0]</code> it would be <code>8x^3 - 12x</code> polynomial) and then integrate this function using the <strong>Si...
<p>To create a polynomial function given its coefficients, you can use <a href="https://www.mathworks.com/help/matlab/ref/polyval.html" rel="nofollow noreferrer"><code>polyval</code></a> (see also <a href="https://www.mathworks.com/help/matlab/matlab_prog/anonymous-functions.html" rel="nofollow noreferrer"><em>anonynmo...
Сonvert the coefficients of the Hermite polynomial into a function
matlab|polynomials|simpsons-rule|hermite
1
54
1
72,296,417
72,296,417
1
true
2022-05-18T21:31:13.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Сonvert the coefficients of the Hermite polynomial into a function<p>I want to make a function from the output of Matlab Hermite function (for example, if we...
72,297,777
Use dask for an out of core conversion of iterable.product into a numpy/dask array (create a matrix of every permutation with repetition)<p>I am looking to create a matrix (numpy array of numpy arrays) of every permutation with repetition (I want to use it for matrix multiplication later on). Currently the way I am doi...
<p>The memory problems is due to this line:</p> <pre class="lang-py prettyprint-override"><code>lst = list(itertools.product(*lst)) </code></pre> <p>Without <code>list()</code> this would be a generator, so would not require a lot of memory. Hence, a solution might be to examine the matrix operations downstream and see...
Use dask for an out of core conversion of iterable.product into a numpy/dask array (create a matrix of every permutation with repetition)
python|arrays|numpy|dask|itertools
2
54
1
72,298,490
72,298,490
1
true
2022-05-19T01:48:24.913Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use dask for an out of core conversion of iterable.product into a numpy/dask array (create a matrix of every permutation with repetition)<p>I am looking to c...
72,302,070
Set the bounds of an array after object initialisation in cpp<p>I'm working on an image renderer in C++ that I wrote from scratch (I don't want to use anything but standard libraries), but I'm having some trouble when trying to store the image. The class I use to store images looks like this:</p> <pre><code>class RawIm...
<blockquote> <p>Set the bounds of an array after object initialisation in cpp</p> </blockquote> <p>The size of an array never changes through its lifetime. It's set upon creation. Technically this isn't a problem for you because you can initialise the array in the constructor.</p> <p>But, size of an array variable must...
Set the bounds of an array after object initialisation in cpp
c++|arrays|class
2
54
3
72,302,201
72,302,201
1
true
2022-05-19T09:32:17.233Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set the bounds of an array after object initialisation in cpp<p>I'm working on an image renderer in C++ that I wrote from scratch (I don't want to use anythi...
72,303,723
Python - how to build a multi-list for loop?<p>At my application, I use FFmpeg to pack videos for web delivery in HLS format. During development, I wrote the following for loop in order to create a master.m3u8 playlist. Basically, this is working fine, except of one thing I currently don't understand. How can I make th...
<p>If <code>position [0]</code> means <code>job[&quot;video&quot;][0]</code> and <code>position [1]</code> means <code>job[&quot;video&quot;][1]</code> then you should use outer <code>for</code>-loop with <code>for item in job['video']:</code> and later use <code>item</code> instead of <code>job[&quot;video&quot;][0]</...
Python - how to build a multi-list for loop?
python|for-loop
0
54
1
72,304,701
72,304,701
1
true
2022-05-19T11:27:36.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python - how to build a multi-list for loop?<p>At my application, I use FFmpeg to pack videos for web delivery in HLS format. During development, I wrote the...
72,302,573
Partial loading of data(columns) from a parquet file into relational table<p>I have a table of data type VARIANT that holds a parquet file.</p> <p><a href="https://i.stack.imgur.com/11cIH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/11cIH.jpg" alt="Parquet file output" /></a></p> <p>I have a relat...
<p>It would be better to post sample data as text rather than an image. People can more easily copy and paste the sample to test. So this isn't tested, but it should work.</p> <p>Take a close look at the <code>cases.calculated.change_from_prior_day</code> key. It is not a nested key in the grandparent path <code>cases....
Partial loading of data(columns) from a parquet file into relational table
snowflake-cloud-data-platform|parquet
0
54
1
72,305,958
72,305,958
1
true
2022-05-19T10:02:58.660Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Partial loading of data(columns) from a parquet file into relational table<p>I have a table of data type VARIANT that holds a parquet file.</p> <p><a href="h...
72,306,377
Subscript out of range when trying to loop through array to read values<p>I have a string of predefined worksheets, that I need to run specific code for. I get a compile error.</p> <p>The code is set up to copy data from one sheet to another.<br /> How do I do the same for multiple sheets?</p> <p>When I step through th...
<p>Split by what?</p> <pre><code>SheetNames = Strings.Split(&quot;MHP60,MHP61,MHP62&quot;) </code></pre> <p>Split by comma? Then use the following instead:</p> <pre><code>SheetNames = Strings.Split(&quot;MHP60,MHP61,MHP62&quot;, &quot;,&quot;) </code></pre> <hr /> <p>Alternative</p> <pre><code>Dim SheetNames() As Varia...
Subscript out of range when trying to loop through array to read values
arrays|excel|vba
0
54
1
72,306,421
72,306,421
1
true
2022-05-19T14:27:01.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Subscript out of range when trying to loop through array to read values<p>I have a string of predefined worksheets, that I need to run specific code for. I g...
72,301,006
Recreate contextmenu event in RxJS<p>I want to recreate the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event" rel="nofollow noreferrer">contextmenu</a> event from touch events in RxJS because iOS <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event#brows...
<p>Your solution can be simplified a little bit. The inner <code>mapTo</code> isn't necessary, if you don't reuse the name <code>event</code>, you can just use a single <code>mapTo</code> at the end of your pipe. Also, you may want to use <code>take(1)</code> instead of <code>takeUntil(touchMove$)</code> on the inner...
Recreate contextmenu event in RxJS
typescript|rxjs
2
54
2
72,306,532
72,306,532
1
true
2022-05-19T08:19:06.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Recreate contextmenu event in RxJS<p>I want to recreate the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/contextmenu_event" rel="nofollo...
72,310,606
Can't use WpfAnimatedGif nuget package<p>I'm trying to make a WPF project that use nuget package of &quot;WpfAnimatedGif&quot; (<a href="https://github.com/XamlAnimatedGif/WpfAnimatedGif" rel="nofollow noreferrer">https://github.com/XamlAnimatedGif/WpfAnimatedGif</a>) in order to make a window background gif. But for s...
<p>The namespace prefix it's complaining about is an xmlns. You're missing:</p> <pre><code> xmlns:gif=&quot;http://wpfanimatedgif.codeplex.com&quot; </code></pre> <p>See the example code on github.</p> <p><a href="https://github.com/XamlAnimatedGif/WpfAnimatedGif" rel="nofollow noreferrer">https://github.com/XamlAnimat...
Can't use WpfAnimatedGif nuget package
wpf|visual-studio|nuget-package|animated-gif
-1
54
1
72,310,693
72,310,693
1
true
2022-05-19T20:15:59.513Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't use WpfAnimatedGif nuget package<p>I'm trying to make a WPF project that use nuget package of &quot;WpfAnimatedGif&quot; (<a href="https://github.com/X...
72,310,783
With python How to get only the indices of list items and use them as a variable in f-string<p>I'm trying to get selenium to click specific buttons on a website. To do that I need the indices of list items to be a variable in a f-string. Is there a neat way to access the indices of that list and declare them a variable...
<p>You can just retrieve the index of the item in a list (called 'array' here) like this:</p> <pre><code>x = array.index(i) </code></pre> <p>Or just do it in the f-string:</p> <pre><code>f'//*[@id=&quot;tabelle_merkliste&quot;]/tbody/tr{array.index(i)}/td{y} /img' </code></pre>
With python How to get only the indices of list items and use them as a variable in f-string
python|list|selenium|enumerate
-2
54
1
72,310,870
72,310,870
1
true
2022-05-19T20:35:07.060Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: With python How to get only the indices of list items and use them as a variable in f-string<p>I'm trying to get selenium to click specific buttons on a webs...
72,255,202
MongoDB - Get data in date sections from an array<p>I am new to MongoDB, I want to get data in sections from the array.</p> <pre><code>{ &quot;name&quot;:&quot;User name&quot;, &quot;messages&quot;:[ { &quot;message&quot;:&quot;Message 1&quot;, &quot;date&quot;:&quot;2022-05-12T00:00:00.00...
<p>You can use aggregation to get your desired output.</p> <pre><code>db.collection.aggregate([ { $unwind: &quot;$messages&quot; }, { $group: { _id: &quot;$messages.date&quot;, messages: { $push: &quot;$messages&quot; } } }, { $project: { _id: 0, date: &qu...
MongoDB - Get data in date sections from an array
javascript|arrays|mongodb|aggregation-framework|aggregation
1
54
2
72,314,141
72,314,141
1
true
2022-05-16T06:58:07.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MongoDB - Get data in date sections from an array<p>I am new to MongoDB, I want to get data in sections from the array.</p> <pre><code>{ &quot;name&quot;:...
72,315,496
How do i display the information of foreign key instead of id in MySQL and PHP?<p>just like the caption, how do i fetch information from foreign key instead of id?</p> <p>Here are the first table:</p> <p><a href="https://i.stack.imgur.com/6LRa2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6LRa2.pn...
<p>You need to use <a href="https://www.w3schools.com/mysql/mysql_join.asp" rel="nofollow noreferrer">join</a> Your query should look something like this:</p> <pre><code>SELECT ft.id, pr.product_name, pr.unit_price from firsttable as ft join product as pr on ft.product_id = pr.product_id; </code></pre> <p>Where <code>...
How do i display the information of foreign key instead of id in MySQL and PHP?
php|mysql
0
54
1
72,315,547
72,315,547
1
true
2022-05-20T08:02:26.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do i display the information of foreign key instead of id in MySQL and PHP?<p>just like the caption, how do i fetch information from foreign key instead ...
72,312,167
How to use a variable in multiple DataGrip queries?<p>Given I have a bunch of queries E.g.</p> <pre><code>delete from permissions where user_id = 9845 and project_id =2; delete from users_projects where user_id = 9845 and project_id =2; delete from users where id = 9845 and project_id =2; </code></pre> <p>How can I avo...
<p>You can use <code>${variable_name}</code> syntax to enter a value only once for queries:</p> <pre class="lang-sql prettyprint-override"><code>delete from permissions where user_id = ${userId} and project_id =2; delete from users_projects where user_id = ${userId} and project_id =2; delete from users where id = ${use...
How to use a variable in multiple DataGrip queries?
sql|postgresql|datagrip
0
54
1
72,318,375
72,318,375
1
true
2022-05-19T23:49:58.150Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use a variable in multiple DataGrip queries?<p>Given I have a bunch of queries E.g.</p> <pre><code>delete from permissions where user_id = 9845 and pr...
72,316,084
How to convert a directory of XML files in to RRD Files<p>I need to restore rrd files from my exisiting xml files. So I have used following simple bash script.</p> <pre><code>#!/bin/bash for i in /home/dump_xml/*.xml; do rrdtool restore $i /home/rrd_new/&quot;${i%.xml}&quot;.rrd; done </code></pre> <p>I could not exec...
<p>When you use:</p> <pre><code>for i in /home/dump_xml/*.xml do echo &quot;$i&quot; done </code></pre> <p>You will see that $i equals:</p> <ul> <li>/home/dump_xml/a.xml</li> <li>/home/dump_xml/b.xml</li> </ul> <p>You see, it contains the path. Therefore your <code>rddtool</code> will try to write the results in <...
How to convert a directory of XML files in to RRD Files
linux|xml|bash|rrdtool
0
54
1
72,322,692
72,322,692
1
true
2022-05-20T08:49:51.840Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert a directory of XML files in to RRD Files<p>I need to restore rrd files from my exisiting xml files. So I have used following simple bash scrip...
72,322,620
How do I replace the first occurance of a key value in a config file with sed?<p>I would like to change the application name in a config file. <code>Name=</code> has multiple occurrences, but I only want to change the first. For reference, the config file has the following structure:</p> <pre><code>[Desktop Entry] Vers...
<p>So match exactly <code>Name=</code> not <code>=.*</code></p> <pre><code>sed '0,/^Name=/s/^Name=.*/Name=Replace/' </code></pre>
How do I replace the first occurance of a key value in a config file with sed?
bash|sed
1
54
3
72,322,711
72,322,711
1
true
2022-05-20T17:19:11.213Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I replace the first occurance of a key value in a config file with sed?<p>I would like to change the application name in a config file. <code>Name=</c...
72,323,290
Remove menu button from Iframe<p>How should I do to remove these 2 buttons ? I can't find any properties to set them to false: <a href="https://i.stack.imgur.com/YgCyV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YgCyV.png" alt="enter image description here" /></a> <a href="https://i.stack.imgur.c...
<p>Hide the player controls.</p> <p>controls parameter type definition:</p> <p>type ControlName = &quot;play&quot; | &quot;seekBackward&quot; | &quot;seekForward&quot; | &quot;playbackRate&quot; | &quot;volume&quot; | &quot;fullscreen&quot; | &quot;subtitles&quot; | &quot;chapters&quot; | &quot;pictureInPicture&quot; |...
Remove menu button from Iframe
html|typescript|iframe
0
54
1
72,323,814
72,323,814
1
true
2022-05-20T18:20:26.400Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove menu button from Iframe<p>How should I do to remove these 2 buttons ? I can't find any properties to set them to false: <a href="https://i.stack.imgur...
72,325,310
Can JavaScript function trigger only when specific HTML <element> exist eliminating the need of unique ID tags?<p><em>Unlike questions based on (unique) <a href="https://stackoverflow.com/questions/70579/what-are-valid-values-for-the-id-attribute-in-html/79022#79022">id's</a> and <a href="https://stackoverflow.com/ques...
<pre><code>if (document.getElementsByTagName(&quot;audio&quot;).length !== 0){ window.onload = audio(); } </code></pre> <p>Should do the work.</p> <p>From: <a href="https://developer.mozilla.org/fr/docs/Web/API/Document/getElementsByTagName" rel="nofollow noreferrer">https://developer.mozilla.org/fr/docs/Web/API/Docu...
Can JavaScript function trigger only when specific HTML <element> exist eliminating the need of unique ID tags?
javascript|html|if-statement|element
1
54
1
72,325,333
72,325,333
1
true
2022-05-20T22:28:02.797Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can JavaScript function trigger only when specific HTML <element> exist eliminating the need of unique ID tags?<p><em>Unlike questions based on (unique) <a h...
72,324,787
How do I check the component type of values inside the $slots?<p>I'll provide a simple example that would demonstrate the problem I'm facing.</p> <p>So I have a page that includes the following code:</p> <pre class="lang-js prettyprint-override"><code>&lt;Slider&gt; &lt;Slide&gt; &lt;p&gt;test 1&lt;/p&gt; &lt;/...
<p>Similarly to React element objects represented by JSX, Vue vnode objects have <code>type</code> property that is a string for DOM elements, and a component for Vue components.</p> <p>There should be a check:</p> <pre><code>if (vNode.type === Slide) ... </code></pre>
How do I check the component type of values inside the $slots?
vue.js|vuejs3
1
54
1
72,325,696
72,325,696
1
true
2022-05-20T21:07:11.887Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I check the component type of values inside the $slots?<p>I'll provide a simple example that would demonstrate the problem I'm facing.</p> <p>So I hav...
72,326,019
Looping through columns SQL to select multiple years<p>I have GDP data for 1960 - 2020, each year is stored as a column. In order to unpivot the columns, do I have to hard code all year(columns)?</p> <p>For example</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>country name</th> <th>1960</...
<p>Here is an approach which will dynamically UNPIVOT your data without actually using Dynamic SQL</p> <p><strong>Example or <a href="https://dbfiddle.uk/?rdbms=sqlserver_2016&amp;fiddle=1d0e109e710fc2eda8776e5dde8ff77f" rel="nofollow noreferrer">dbFiddle</a></strong></p> <pre><code>Select A.[country name] ,B.* ...
Looping through columns SQL to select multiple years
sql|sql-server|tsql
2
54
2
72,326,537
72,326,537
1
true
2022-05-21T01:24:11.390Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Looping through columns SQL to select multiple years<p>I have GDP data for 1960 - 2020, each year is stored as a column. In order to unpivot the columns, do ...
72,325,420
Interaction between sample_weight and min_samples_split in decision tree<p>In sklearn.ensemble.RandomForestClassifier, if we define both <code>sample_weight</code> and <code>min_samples_split</code>, does the sample weight impact the min_samples_split. For example, if min_sample_split = 20 and the weight of data points...
<p>No, see <a href="https://github.com/scikit-learn/scikit-learn/blob/80598905e517759b4696c74ecc35c6e2eb508cff/sklearn/tree/_tree.pyx#L224" rel="nofollow noreferrer">the source</a>; <code>min_samples_split</code> does not take into consideration sample weights. Compare to <code>min_samples_leaf</code> and its weighted...
Interaction between sample_weight and min_samples_split in decision tree
python|scikit-learn|random-forest|decision-tree
0
54
1
72,331,272
72,331,272
1
true
2022-05-20T22:51:31.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Interaction between sample_weight and min_samples_split in decision tree<p>In sklearn.ensemble.RandomForestClassifier, if we define both <code>sample_weight<...
72,332,520
How to create flutter widget list using list builder?<p>I have a <code>items</code> argument where I have to assign list widget, it's looks like below</p> <pre><code>items: [ CachedNetworkImage( imageUrl: &quot;https://images.unsplash.com/photo-1534531173927-aeb928d54385?crop=entropy&amp;cs=tinysrgb&amp;fm=...
<p>Try this example code:</p> <pre><code>List&lt;Widget&gt; _listItem = []; for(var imageWidget in carousels){ Widget newWidget = CachedNetworkImage( imageUrl: imageWidget.imageUrl, height: double.infinity, fit: BoxFit.cover, ); _listIt...
How to create flutter widget list using list builder?
flutter|dart
0
54
2
72,332,653
72,332,653
1
true
2022-05-21T19:08:15.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create flutter widget list using list builder?<p>I have a <code>items</code> argument where I have to assign list widget, it's looks like below</p> <p...
72,335,820
Could not find lexicographic termination order<pre><code>type_synonym ('q,'a) LTS = &quot;('q * 'a set * 'q) set&quot; fun LTS_is_reachable :: &quot;('q, 'a) LTS \&lt;Rightarrow&gt; 'q \&lt;Rightarrow&gt; 'a list \&lt;Rightarrow&gt; 'q \&lt;Rightarrow&gt; bool&quot; where &quot;LTS_is_reachable \&lt;Delta&gt; q [] ...
<p>To define a recursive function, it must be terminating. And the error you get means that Isabelle is not able to prove automatically that your function is terminating.</p> <p>And indeed, <code>LTS_is_reachable \&lt;Delta&gt; q (a # w) q'</code> calls <code>LTS_is_reachable \&lt;Delta&gt; q'' (a # w) q'</code>. Actua...
Could not find lexicographic termination order
isabelle
1
54
2
72,336,495
72,336,495
1
true
2022-05-22T08:06:36.160Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Could not find lexicographic termination order<pre><code>type_synonym ('q,'a) LTS = &quot;('q * 'a set * 'q) set&quot; fun LTS_is_reachable :: &quot;('q, 'a)...
72,338,504
RegEx for twitter usernames<p>I need some help with regex for usernames which start with &quot;@&quot; and following rules:</p> <ol> <li><p>Username includes only \w symbols.</p> </li> <li><p>Match if string has any non word character except &quot;@&quot;, e.g.</p> <ul> <li>Match @username in <code>@username!&amp;?()*^...
<p>You can assert a whitespace boundary to the left, and assert not @ in the line to the right.</p> <pre><code>(?&lt;!\S)@(\w{4,15})\b(?![^@\n]*@) </code></pre> <p><strong>Explanation</strong></p> <ul> <li><code>(?&lt;!\S)</code> Assert a whitespace boundary to the left</li> <li><code>@</code> Match literally</li> <li>...
RegEx for twitter usernames
python|regex
0
54
1
72,338,768
72,338,768
1
true
2022-05-22T14:29:57.600Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RegEx for twitter usernames<p>I need some help with regex for usernames which start with &quot;@&quot; and following rules:</p> <ol> <li><p>Username includes...
72,338,619
Rails WHERE method in the context of SCOPE for like ? syntax<p>I fail to find the right syntax for a WHERE method in the context of a SCOPE. My classified MODEL has several SCOPE that works well to filter classifieds by category or area:</p> <pre><code>#in the model scope :filter_by_category, -&gt; (category) {where ...
<p>You have three problems:</p> <ol> <li><p>The lambda is an argument to <code>scope</code> to you need a comma after the symbol:</p> <pre><code> scope :filter_by_title, -&gt; ... # --------------------^ </code></pre> </li> <li><p>Whitespace matters in Ruby so <code>f (x, y)</code> and <code>f(x, y)</code> are differe...
Rails WHERE method in the context of SCOPE for like ? syntax
ruby-on-rails|scope|where-clause
1
54
1
72,339,301
72,339,301
1
true
2022-05-22T14:48:18.613Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails WHERE method in the context of SCOPE for like ? syntax<p>I fail to find the right syntax for a WHERE method in the context of a SCOPE. My classified MO...
72,339,248
Use a random number to render that corresponding object ID's data in React<p>I'm trying to create an react app where you press a button and it gives you a date night option and a corresponding image. I created a small array of objects within dates.js ex:</p> <pre><code>export const dates = [ { id: 0, ...
<p>The prop is called <code>onClick</code> in React, not <code>onclick</code> (like the HTML attribute). You should also render the currently selected item, which you currently do not. In general you should also use functional components instead of class components. Also be careful with <code>this</code> as it may not ...
Use a random number to render that corresponding object ID's data in React
arrays|reactjs|object|random|render
0
54
2
72,339,413
72,339,413
1
true
2022-05-22T16:08:20.253Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use a random number to render that corresponding object ID's data in React<p>I'm trying to create an react app where you press a button and it gives you a da...
72,344,379
How can I make dictionary key as column of dataframe?<pre><code>!pip install -U LeXmo from LeXmo import LeXmo df['Dict'] = df['Content '].apply(lambda x: [LeXmo.LeXmo(x)]) </code></pre> <p>Using this snippet , I am able to generate this</p> <p><a href="https://i.stack.imgur.com/e9Dv2.png" rel="nofollow noreferrer"><img...
<p>You can convert output from <code>LeXmo.LeXmo(x)</code> to <code>Series</code>, so it create new columns if call function in <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.apply.html" rel="nofollow noreferrer"><code>Series.apply</code></a>, last append to original DataFrame by <a hr...
How can I make dictionary key as column of dataframe?
python|pandas|dataframe|dictionary|nlp
0
54
1
72,344,583
72,344,583
1
true
2022-05-23T06:59:58.933Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I make dictionary key as column of dataframe?<pre><code>!pip install -U LeXmo from LeXmo import LeXmo df['Dict'] = df['Content '].apply(lambda x: [Le...
72,345,986
How to plot histogram with color function of a column value?<p>I Would like to plot a histogram but the color of my boxes should be function of a value inside a column. If the value in column 12 of my file is egal to 160 the color change in red.</p> <p>my script :</p> <pre><code>set xlabel 'elapsed' font &quot;,14&quot...
<p>I expected this to be a frequently asked question, however, it seems it would take more time to search for a suitable example than writing a few lines of code. The ingredients are <code>lc rgb variable</code> (check <code>help variable</code>) and ternary operator (check <code>help ternary</code>).</p> <p><strong>Sc...
How to plot histogram with color function of a column value?
gnuplot
0
54
1
72,347,973
72,347,973
1
true
2022-05-23T09:11:30.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to plot histogram with color function of a column value?<p>I Would like to plot a histogram but the color of my boxes should be function of a value insid...
72,347,850
undo git changes on a file<p>I made several commits and pushed them so, remote looks like this:</p> <p>A-B-C-D---...--N</p> <p>Commit B is of 4 modified files (a, b, c, d). I realized that I only want changes in file a, so I need to discard b,c,d changes. The problem is that I have already pushed the commit and made mo...
<p>With git bash you find the sha of the commit (use a gui, or <code>git log</code>), then you simply launch <code>git revert &lt;SHA&gt;</code> This will create a new commit that revert the changes you made in the original commit.</p>
undo git changes on a file
git|git-revert
0
54
1
72,348,352
72,348,352
1
true
2022-05-23T11:33:39.553Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: undo git changes on a file<p>I made several commits and pushed them so, remote looks like this:</p> <p>A-B-C-D---...--N</p> <p>Commit B is of 4 modified file...
72,355,961
Is there a way to get the rank of each player?<ul> <li><p>I'm a bit confused on how to get the rank of each player. I created an integer array of ranks because I thought it would make it easier to compare, but I'm lost on how to compare the ranks given in the String.</p> </li> <li><p>For rank 1, &quot;A of suit&quot; i...
<p>You've confused yourself. Your class is named <code>CardDeck</code>. Which suggests it represents <strong>an entire deck of cards</strong>. A deck of cards <em>does not</em> have a rank and does not have a suit. I don't go to the store and buy a pack of cards that contains only 52 ace of spades, of course.</p> <p>It...
Is there a way to get the rank of each player?
java|compare
0
54
1
72,356,237
72,356,237
1
true
2022-05-24T00:12:02.263Z
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 get the rank of each player?<ul> <li><p>I'm a bit confused on how to get the rank of each player. I created an integer array of ranks becau...
72,361,853
Nodejs: process exits while promise is pending<p>Excerpt of a lambda function using nodejs 12. There is a promise (aws dynamo db document client query) nested inside a promise (node-fetch API request).</p> <p>The first promise works fine. It executes the request, waits for the promise to resolve, and then enters the <c...
<p>You have to add <code>async</code> to the beginning of the function in which you want to use <code>await</code>.</p> <pre><code>.then(async(data) =&gt; { var dbscan = await ... }) </code></pre>
Nodejs: process exits while promise is pending
javascript|node.js|lambda|async-await|promise
0
54
2
72,362,045
72,362,045
1
true
2022-05-24T11:11:49.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nodejs: process exits while promise is pending<p>Excerpt of a lambda function using nodejs 12. There is a promise (aws dynamo db document client query) neste...
72,359,373
Not able to use for loop using bash in Jenkins pipeline<p>Following is my code</p> <pre><code> def jsonObj; jsonObj = readJSON file: 'vars.json' sh &quot;gcloud container clusters get-credentials ${jsonObj.cluster_name} --zone ${jsonObj.zone} --project ${jsonObj.project}&quot; ...
<p>The problem here is that <code>jsonObj</code> is a <code>Map</code> type in Groovy with a <code>List</code> type at the <code>ns</code> key, and your expectation is that when you implicitly cast this to a string during interpolation, then it will become iterable in the shell interpreter as well. Groovy types and she...
Not able to use for loop using bash in Jenkins pipeline
bash|jenkins-pipeline|jenkins-groovy
1
54
1
72,363,268
72,363,268
1
true
2022-05-24T08:11:37.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not able to use for loop using bash in Jenkins pipeline<p>Following is my code</p> <pre><code> def jsonObj; jsonObj = readJSON file: 'vars.json' ...
72,362,501
Filter rows on dates depending on different column values<p>I've been trying to filter rows with a certain value for <code>code</code> based on the values of task_dts. Essentially I only want the rows <strong>per id</strong> where the <code>task_dts</code> timestamp falls between the <code>code_dts</code> timestamp of ...
<p>You can use a table expression to pre-compute the timestamp ranges. Then, filtering is easy.</p> <p>For example:</p> <pre><code>select t.* from t join ( select code, dt, lead(dt) over(order by dt) as next_dt from (select code, min(code_dts) as dt from t group by code) x ) y on t.code = y.code where t.task_dts be...
Filter rows on dates depending on different column values
sql|teradata
0
54
2
72,363,464
72,363,464
1
true
2022-05-24T11:57:11.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filter rows on dates depending on different column values<p>I've been trying to filter rows with a certain value for <code>code</code> based on the values of...
72,348,734
React not registering state change when setting previous state with slight modifications as the new one<p>I have the following code :-</p> <pre><code>const [dice, setDice] = React.useState(allNewDice()) // Array of objects with the following properties: `value` (random digit between 1 and 6), `id` (unique id), `isHeld`...
<p>The first time you call <code>setDice()</code> after the initial mount of your component or rerender, <code>prevDice</code> refers to the same array in memory that your <code>dice</code> state refers to (so <code>prevDice === dice</code>). It is <strong>not</strong> a unqiue copy of the array that you're able to mod...
React not registering state change when setting previous state with slight modifications as the new one
javascript|reactjs
0
54
2
72,363,546
72,363,546
1
true
2022-05-23T12:45:25.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React not registering state change when setting previous state with slight modifications as the new one<p>I have the following code :-</p> <pre><code>const [...
72,363,567
Type 'JQueryPromise<unknown>' is not assignable to type 'JQueryPromise<string>'<p>I am getting an error at <code>$deferred.promise();</code> about &quot;'unknown' is not assignable to type 'string'&quot;. Can I set this to a string?</p> <pre><code>Error TS2322 (TS) Type 'JQueryPromise&lt;unknown&gt;' is not assignab...
<p>I believe the deferred object will have the correct type if it's instantiated like this:</p> <pre class="lang-js prettyprint-override"><code>var $deferred = $.Deferred&lt;string&gt;(); // now typeof $deferred.promise() is JQueryPromise&lt;string&gt; </code></pre> <hr /> <p>Just by the way, this:</p> <pre class="lang...
Type 'JQueryPromise<unknown>' is not assignable to type 'JQueryPromise<string>'
jquery|angular|typescript
1
54
1
72,365,146
72,365,146
1
true
2022-05-24T13:15:06.317Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Type 'JQueryPromise<unknown>' is not assignable to type 'JQueryPromise<string>'<p>I am getting an error at <code>$deferred.promise();</code> about &quot;'unk...
72,367,891
Special characters to be used in subprocess module<p>In subprocess module in python,</p> <pre><code> subprocess.Popen( ( &quot;git&quot;, &quot;add&quot;, &quot;-A&quot;, &quot;&amp;&amp;&quot;, &quot;git&quot;, ...
<p>The <code>&amp;&amp;</code> logical operator is something that the shell (e.g., bash) understands. However, you're executing git which doesn't understand what <code>&amp;&amp;</code> means. Explained another way, you're entering the arguments as if you were typing them into a terminal. <code>subprocess.Popen</cod...
Special characters to be used in subprocess module
python|subprocess
1
54
2
72,367,946
72,367,946
1
true
2022-05-24T18:35:35.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Special characters to be used in subprocess module<p>In subprocess module in python,</p> <pre><code> subprocess.Popen( ( &quot;gi...
72,368,266
Can Someone help me write a query to determine which team lost a match AND a separate query to count each teams losses<p>I have tried the following code.</p> <pre><code>SELECT (Team 1) OR ( Team 2) AS[Losser], Winner FROM MatchesTbl WHERE (WINNER NOT LIKE (Team 1)) </code></pre> <p>I have attached an image of the tabl...
<p>If you use MS Access you can use the <a href="https://support.microsoft.com/en-us/office/iif-function-32436ecf-c629-48a3-9900-647539c764e3" rel="nofollow noreferrer">IIF</a> function to get the first result</p> <pre><code>SELECT T.Team1, T.Team2, T.Winner, IIf([Team1]=[Winner],[Team2],[Team1]) AS Loser FROM tblMatch...
Can Someone help me write a query to determine which team lost a match AND a separate query to count each teams losses
sql|ms-access
0
54
2
72,368,633
72,368,633
1
true
2022-05-24T19:10:02.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can Someone help me write a query to determine which team lost a match AND a separate query to count each teams losses<p>I have tried the following code.</p>...
72,367,449
get an argument list with sublists<p>I would like to flatten this list of arguments</p> <pre><code>args &lt;- list( a = 1, b = &quot;2&quot;, list = list(c = 3, d = list(d1 = 5, d2 = 6)), e = data.frame(e1 = c(&quot;a&quot;, &quot;b&quot;), e2 = c(7, 8)) ) </code></pre> <p>on this</p> <pre><code>args &lt;- list...
<p>The output of map always be the same dim. So you need a for loop.</p> <blockquote> <pre><code>output &lt;- NULL for (x in seq(length(args))) { list &lt;- args[x] if (is.list(args[[x]]) &amp;&amp; !is.data.frame(args[[x]])) { list &lt;- flatten(args[x]) } output &lt;- append(output, list) } </code></pre>...
get an argument list with sublists
r|nested-lists
1
54
3
72,368,788
72,368,788
1
true
2022-05-24T17:59:48.003Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: get an argument list with sublists<p>I would like to flatten this list of arguments</p> <pre><code>args &lt;- list( a = 1, b = &quot;2&quot;, list = li...
72,346,142
How do I get an event using fullcalendar getEventSourceById?<p>The function as mentioned <a href="https://fullcalendar.io/docs/Calendar-getEventSourceById" rel="nofollow noreferrer">in the docs</a> doesn't seem to be working:</p> <ul> <li>Events are added with ids 1 and 2.</li> <li>I execute <code>calendar.getEventSour...
<p>As mentioned in the comments, I should have used</p> <pre><code>calendar.getEventById(1) </code></pre> <p>and not</p> <pre><code>calendar.getEventSourceById(1) </code></pre>
How do I get an event using fullcalendar getEventSourceById?
fullcalendar|fullcalendar-5
0
54
1
72,373,676
72,373,676
1
true
2022-05-23T09:23:53.940Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I get an event using fullcalendar getEventSourceById?<p>The function as mentioned <a href="https://fullcalendar.io/docs/Calendar-getEventSourceById" r...
72,359,379
Kendo ASP.NET MVC - Adding Dropdown to Grid<p>So I have been following a few tutorials as well as some examples on other SO posts on how to add a drop down list to my Kendo grid, though I've been having little success in getting it to work. My grid is as follows:</p> <pre><code>@(Html.Kendo().Grid&lt;SampleUserModel&gt...
<p>I figured out the cause, my grid was missing Editable and Model configurations. I updated my grid to add the following and the dropdowns work now. Making the grid editable:</p> <pre><code> .Editable(editabe =&gt; editabe.Mode(GridEditMode.InCell)) </code></pre> <p>And the adding the model call in DataSource:</p> ...
Kendo ASP.NET MVC - Adding Dropdown to Grid
c#|asp.net|model-view-controller|kendo-ui
0
54
1
72,378,787
72,378,787
1
true
2022-05-24T08:12:02.033Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kendo ASP.NET MVC - Adding Dropdown to Grid<p>So I have been following a few tutorials as well as some examples on other SO posts on how to add a drop down l...
72,380,987
How to add index to optimise SQLite query?<p>I'm using a Sqlite database for my Python application.</p> <p>In that database there's a huge table (about 5M records) and some queries are too slow.</p> <p>Here is the table:</p> <pre class="lang-py prettyprint-override"><code>CREATE TABLE mytable( ID integer PRIMARY KEY, C...
<p>You most definitely can add an index to the datetime column. Based on your query it would certainly help.</p> <p>So in the end, you would be looking at something like this:</p> <pre><code>Create Index myIndex On myTable(Date); </code></pre> <p>You can find more info regarding Sqlite indexes here: <a href="https://w...
How to add index to optimise SQLite query?
python|sql|sqlite|indexing
0
54
1
72,381,150
72,381,150
1
true
2022-05-25T16:06:18Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add index to optimise SQLite query?<p>I'm using a Sqlite database for my Python application.</p> <p>In that database there's a huge table (about 5M re...
72,381,510
I can't update state when submitted in a form<p>I need to update the state on main page, the problem is that I update values 3 levels down...</p> <p>This component is where I get all the cities, putting the data on the State and map through cities.</p> <p><em>CitiesPage.tsx</em></p> <pre><code>export const CitiesPage =...
<p>You are storing the updated value in a different state, namely the <code>updateCity</code> state, but what you should be doing is update the origional <code>cities</code> state. While these two states are not related, and at the same time your UI is depend on <code>cities</code> state's data, so if you wish to updat...
I can't update state when submitted in a form
reactjs|typescript
0
54
2
72,382,436
72,382,436
1
true
2022-05-25T16:46:23.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I can't update state when submitted in a form<p>I need to update the state on main page, the problem is that I update values 3 levels down...</p> <p>This com...
72,383,061
Push object in mongoDB array of objects which contains value from parent document<p>So I have a mongodb document</p> <pre class="lang-json prettyprint-override"><code>{ &quot;id&quot;: 1, &quot;balance&quot;: 10, &quot;transactions&quot;: [ { &quot;balance&quot;: 10, &quot;transaction_amount&quot;...
<p>Simply use <code>$add</code> and <code>$concatArrays</code> to wrangle the data</p> <pre class="lang-js prettyprint-override"><code>db.collection.update({ id: 1 }, [ { &quot;$addFields&quot;: { &quot;txnAmt&quot;: &lt;amount you want&gt; } }, { $addFields: { balance: { $add: [...
Push object in mongoDB array of objects which contains value from parent document
mongodb|mongodb-query|aggregation-framework
0
54
1
72,383,305
72,383,305
1
true
2022-05-25T19:15:41.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Push object in mongoDB array of objects which contains value from parent document<p>So I have a mongodb document</p> <pre class="lang-json prettyprint-overri...
72,390,919
MySQL - Count unique users each day considering all previous days<p>I would like to count how many new unique users the database gets each day for all days recorded. There will not be any duplicate ids per day, but there will be duplicates over multiple days.</p> <p>If my table looks like this :</p> <pre><code>ID | DAT...
<p>The user is new when the date is the least date for this user.</p> <p>So you need in something like</p> <pre class="lang-sql prettyprint-override"><code>SELECT date, COUNT(new_users.id) FROM calendar LEFT JOIN ( SELECT id, MIN(date) date FROM test GROUP BY id ) new_users USING (date) GROUP B...
MySQL - Count unique users each day considering all previous days
mysql
5
54
3
72,391,112
72,391,112
1
true
2022-05-26T11:13:47.760Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MySQL - Count unique users each day considering all previous days<p>I would like to count how many new unique users the database gets each day for all days r...
72,385,159
How can you tail AWS application load balancer logs? Is it really this hard? If so, why?<p>I'm new to AWS's Application Load Balancers, and I'm feeling a bit lost coming from the nginx world. Is it true that there's no way to tail your request logs? If so, are there relatively <em>simple</em> ways people use to watch t...
<p>It really is that hard. API Gateway, by comparison, can write its access logs to CloudWatch Logs, so you get closer to real-time.</p> <p>The reason is that files on S3 are written atomically, so you have a choice of either batching records together into a single file, or writing one file per record. The latter would...
How can you tail AWS application load balancer logs? Is it really this hard? If so, why?
logging|aws-application-load-balancer
2
54
1
72,393,267
72,393,267
1
true
2022-05-25T23:35:00.573Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can you tail AWS application load balancer logs? Is it really this hard? If so, why?<p>I'm new to AWS's Application Load Balancers, and I'm feeling a bit...
72,794,829
Can I use strings within an array to name struct variables using concatenation, macros, or similar?<p>I have an array of animal names in the order that I intend to create each struct 'animal' and store it in farm_animals, a struct of animals.</p> <p><code>typedef struct ani animal;</code></p> <p><code>animal* farm_anim...
<p>Yes, it is not possible to dynamically name variables in C. If I understand correctly, you want to create an animal type corresponding to a string and then name it that name.</p> <p>The advantage with using <a href="https://en.wikipedia.org/wiki/Struct_(C_programming_language)" rel="nofollow noreferrer">structs</a> ...
Can I use strings within an array to name struct variables using concatenation, macros, or similar?
arrays|c|namespaces|c-strings|identifier
0
54
1
72,795,849
72,795,849
1
true
2022-06-29T01:33:10.500Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I use strings within an array to name struct variables using concatenation, macros, or similar?<p>I have an array of animal names in the order that I int...
72,795,965
Creating Relationship in PowerBI<p>I have to create a relationship, where both table have dates and measures. I created name bridge between two tables. if i pull by name it works, however, not with date, i am not able to create the relationship. Can you please help to create relation between dates, so that amount can b...
<p>You can have only one active relationship between two tables. So, if you are already having active relationship on Name, then the date based relationship will be inactive relationship. So, it is not working.</p> <p>Btw, your model has to go for below changes:</p> <ol> <li>Create a Date Dimension with the list of dat...
Creating Relationship in PowerBI
sql|powerbi|dax|datamodel
-1
54
1
72,796,317
72,796,317
1
true
2022-06-29T04:58:19.990Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating Relationship in PowerBI<p>I have to create a relationship, where both table have dates and measures. I created name bridge between two tables. if i ...
72,800,456
python - creating a join with the optional ignoring of the first character<p>I have 2 data sets that I need to join via the asset id. I have columns in each table that can be used for the join but the excel docs are from different systems and therefore the formats are different.</p> <p>My problem is dataset one will re...
<p>As I understand you want to remove leading zeros. See this <a href="https://stackoverflow.com/questions/13142347/how-to-remove-leading-and-trailing-zeros-in-a-string-python">discussion</a>.</p> <p>Example</p> <pre><code>data = &quot;01234564500&quot; print(data.lstrip(&quot;0&quot;)) print(data.rstrip(&quot;0&quot;...
python - creating a join with the optional ignoring of the first character
python
0
54
1
72,800,976
72,800,976
1
true
2022-06-29T11:14:56.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python - creating a join with the optional ignoring of the first character<p>I have 2 data sets that I need to join via the asset id. I have columns in each ...
72,809,324
Any tips on creating interfaces for a function in Scheme LISP<p>I've been doing some genetic programming with Chicken Scheme. I have been defining functions to have interfaces since internally a function might need to iterate over a list.</p> <p>I want to avoid exposing all of these details to the caller.</p> <p>EG:</p...
<p>In this particular case of a recursive function that starts with some of the top level function's arguments and possibly a extra accumulator argument, a <a href="http://wiki.call-cc.org/man/5/Module%20scheme#iteration" rel="nofollow noreferrer"><em>named let</em></a> is invaluable syntactic sugar:</p> <pre class="la...
Any tips on creating interfaces for a function in Scheme LISP
scheme|lisp|chicken-scheme
0
54
1
72,810,711
72,810,711
1
true
2022-06-30T01:10:00.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Any tips on creating interfaces for a function in Scheme LISP<p>I've been doing some genetic programming with Chicken Scheme. I have been defining functions ...
72,810,820
Evaluate constant inequation in Coq<p>I am trying to prove this :</p> <pre class="lang-ml prettyprint-override"><code>Goal forall a : R, (forall e : R, e &gt; 0 /\ Rabs a &lt;= e) -&gt; a = 0. </code></pre> <p>This is what I've done so far :</p> <pre class="lang-ml prettyprint-override"><code>Goal forall a : R, (forall...
<p>part of Coq's real numbers are defined axiomatically (see e.g. here: <a href="https://coq.inria.fr/stdlib/Coq.Reals.Rdefinitions.html" rel="nofollow noreferrer">https://coq.inria.fr/stdlib/Coq.Reals.Rdefinitions.html</a>). This means that computation does not work as straight-forwardly as it works with e.g. integers...
Evaluate constant inequation in Coq
coq
2
54
2
72,811,002
72,811,002
1
true
2022-06-30T05:45:48.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Evaluate constant inequation in Coq<p>I am trying to prove this :</p> <pre class="lang-ml prettyprint-override"><code>Goal forall a : R, (forall e : R, e &gt...
72,813,380
Bash shell if operator<p><br />I write a function like this to <code>.commands</code> file, and I imported <code>.commands</code> in <code>.zshrc</code></p> <pre><code>function testA() { echo &quot;start&quot; if [ &quot;$1&quot; == &quot;a&quot; ]; then echo &quot;ok&quot; fi echo &quot;end&quot; } </code>...
<p>Chapter 12 – &quot;Conditional Expressions&quot; of the <a href="https://zsh.sourceforge.io/Doc/Release/Conditional-Expressions.html#Conditional-Expressions" rel="nofollow noreferrer"><code>zsh</code> documentation</a> states:</p> <blockquote> <p>A <em>conditional expression</em> is used with the <code>[[</code> com...
Bash shell if operator
zsh
0
54
3
72,813,712
72,813,712
1
true
2022-06-30T09:26:52.543Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bash shell if operator<p><br />I write a function like this to <code>.commands</code> file, and I imported <code>.commands</code> in <code>.zshrc</code></p> ...
72,812,081
PowerShell 5.1 handling sql server nvarchar datatype<p>I am loading a DataTable with data from SQL Server as such:</p> <pre><code>$queryStr = &quot;SELECT TOP 10 ID, QueryText FROM dbo.DatabaseName&quot;; $dataRows = Invoke-DbaQuery -SqlInstance instance.name -Database databasename -Query $queryStr -As DataSet; </code>...
<p>Your code uses <code>StreamWriter</code> that uses the default UTF-8 encoding, which matches what you get with hashing a <code>VARCHAR</code> -- if you stick to ASCII characters. To hash Unicode instead (and for variation, let's use <code>SHA256</code> directly instead of going through <code>Get-FileHash</code>, and...
PowerShell 5.1 handling sql server nvarchar datatype
powershell
0
54
1
72,816,829
72,816,829
1
true
2022-06-30T07:49:10.783Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PowerShell 5.1 handling sql server nvarchar datatype<p>I am loading a DataTable with data from SQL Server as such:</p> <pre><code>$queryStr = &quot;SELECT TO...
72,817,319
R - set list element names from strings they contain using tidyverse<p>Let's say you have a list like this one:</p> <pre><code>cityhoods &lt;- list(&quot;Zagreb/Donji Grad&quot;, &quot;Berlin/Mitte&quot;, &quot;Warsaw/Stare Miasto&quot;) </code></pre> <p>Now if I want the list elements to ...
<p>Here is a function that should do what you want.</p> <pre class="lang-r prettyprint-override"><code>name_list &lt;- function(x) { setNames(x, sub('/.*', '', x)) } cityhoods %&gt;% name_list # $Zagreb # [1] &quot;Zagreb/Donji Grad&quot; # # $Berlin # [1] &quot;Berlin/Mitte&quot; # # $Warsaw # [1] &quot;Warsaw...
R - set list element names from strings they contain using tidyverse
r
-1
54
3
72,821,271
72,821,271
1
true
2022-06-30T14:10:55.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R - set list element names from strings they contain using tidyverse<p>Let's say you have a list like this one:</p> <pre><code>cityhoods &lt;- list(&quot;Zag...
72,821,256
Notepad ++ not responding<p>This all started because I tried to open a very large file by right clicking on a text file and then selecting &quot;edit with notepad++&quot;. Since then I have removed and reinstalled. I have followed the steps in (<strong><a href="https://community.notepad-plus-plus.org/topic/21755/notepa...
<p>Uninstalling probably is not clearing out the program's entry in AppData. Go to C:\Users[YourUser]\AppData\Roaming\Notepad++ and you might be okay with just removing the session.txt file (this appears to be the file that tells NotePad++ which files you had open). If that doesn't work delete everything here then try ...
Notepad ++ not responding
notepad++
-3
54
1
72,821,370
72,821,370
1
true
2022-06-30T19:45:55.680Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Notepad ++ not responding<p>This all started because I tried to open a very large file by right clicking on a text file and then selecting &quot;edit with no...
72,821,962
Go HTTP Proxy - Prevent Re-using Proxy Connections<p>I have a set of SOCKS proxies, which are sitting behind a load balancer (an AWS Network Load Balancer, to be specific). When the load balancer receives a request on the SOCKS port, it forwards the request to the Docker container (proxy) with the fewest active connect...
<p>SOCKS is protocol agnostic. It has no idea of what a HTTP request is but only what a TCP connection is which gets tunneled by the proxy. Thus every TCP connection caused by the HTTP stack will mean a new connection through the proxy - no reuse. If you want to make sure that every HTTP/S requests gets its own connect...
Go HTTP Proxy - Prevent Re-using Proxy Connections
http|go|load-balancing|socks|go-http
2
54
1
72,822,157
72,822,157
1
true
2022-06-30T20:59:36.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Go HTTP Proxy - Prevent Re-using Proxy Connections<p>I have a set of SOCKS proxies, which are sitting behind a load balancer (an AWS Network Load Balancer, t...
72,815,732
Why swashbuckle example value does not work?<p>Here I added XML doc parameter <code>example=&quot;this does not work&quot;</code> for swashbuckle framework.</p> <pre><code>/// &lt;summary&gt;Gets a user by id.&lt;/summary&gt; /// &lt;param name=&quot;id&quot; example=&quot;this does not work&quot;&gt;The id of user.&lt...
<p>Unfortunately out of the box Swashbuckle doesn't support the example tag/attribute. You need to write an operation filter and implement your own. Or you can use the <code>Swashbuckle.AspNetCore.Filters</code> nuget package.</p> <p>You need to add the following code in your program.cs file.</p> <pre><code>builder.Ser...
Why swashbuckle example value does not work?
asp.net-core|.net-core|swashbuckle.aspnetcore
0
54
1
72,823,596
72,823,596
1
true
2022-06-30T12:20:51.943Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why swashbuckle example value does not work?<p>Here I added XML doc parameter <code>example=&quot;this does not work&quot;</code> for swashbuckle framework.<...
72,827,203
How to write query for this given result?<p>Table &quot;<em>question</em>&quot;:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>q_id</th> <th>s_id question</th> </tr> </thead> <tbody> <tr> <td>8</td> <td>1</td> </tr> <tr> <td>9</td> <td>1</td> </tr> <tr> <td>10</td> <td>1</td> </tr> </tbo...
<p>In the future it would help if you make a reproducible example using something like <a href="https://dbfiddle.uk/" rel="nofollow noreferrer">https://dbfiddle.uk/</a>.</p> <p>If you want to pivot like this, you will need to use <code>GROUP BY</code> and some aggregation. I would include s_id and q_id in your result a...
How to write query for this given result?
mysql|sql|database|join|rdbms
0
54
1
72,827,454
72,827,454
1
true
2022-07-01T09:29:50.723Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to write query for this given result?<p>Table &quot;<em>question</em>&quot;:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th...
72,830,776
Laravel count has many through without n+1<p>I have 4 models that are relevant.</p> <p><code>Company</code></p> <p><code>Location</code></p> <p><code>Customer</code></p> <p><code>ThirdPartyLinkClick</code></p> <p>Company.php</p> <pre><code>public function locations() { return $this-&gt;hasMany('App\Location'); ...
<p>You need to use eager loading.</p> <pre><code>$companies = Company::with('locations', 'locations.linkClicks')-&gt;get(); </code></pre> <p>This prevents n + 1 query problem, so, to get te total of linkClicks for each company youur function will work or simply you can do.</p> <pre><code>$companies = Company::with('loc...
Laravel count has many through without n+1
laravel|eloquent
0
54
1
72,831,193
72,831,193
1
true
2022-07-01T14:27:50.480Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel count has many through without n+1<p>I have 4 models that are relevant.</p> <p><code>Company</code></p> <p><code>Location</code></p> <p><code>Custome...
72,831,751
Typescript property type same as property which has multiple types<p>In my data store, I have two properties</p> <p>data, backupData</p> <p>I am trying to define that backupData must be of the same type as data.</p> <p>However,</p> <pre><code>class ClassC{ data: InterfaceA | InterfaceB backupData: InterfaceA | In...
<p>I think you need to solve this with a generic type.</p> <pre><code>interface A { foo: string; } interface B { bar: string; } class MyClass&lt;T extends A | B&gt; { data: T; backupData: T; } const example1: MyClass&lt;A&gt; = { data: { foo: 'foo' }, backupData: { foo: 'foo' } } const example2: MyClass...
Typescript property type same as property which has multiple types
typescript|types
1
54
1
72,831,889
72,831,889
1
true
2022-07-01T15:48:54.850Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript property type same as property which has multiple types<p>In my data store, I have two properties</p> <p>data, backupData</p> <p>I am trying to de...
72,822,278
Why does Spring Data Rest mangle / corrupt data when binding to entity?<p>On the client and server side, I have:</p> <pre><code>@Data public class Car { private Long id; } @Data public class GroupMember { private Long id; private Group group; // has only single field, id private Car car; private Car ...
<p>Spring Data Rest tries to deserialize the <code>Car</code> fields in <code>GroupMember</code> using URIs. There are no URIs provided by the client though. Instead, <code>groupCar</code> and <code>car</code> are nested objects in the JSON.</p> <p>Adding <code>@RestResource(exported = false)</code> on the two car fiel...
Why does Spring Data Rest mangle / corrupt data when binding to entity?
spring|spring-boot|spring-data|spring-data-rest|spring-cloud-feign
0
54
1
72,834,270
72,834,270
1
true
2022-06-30T21:35:00.630Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does Spring Data Rest mangle / corrupt data when binding to entity?<p>On the client and server side, I have:</p> <pre><code>@Data public class Car { pr...
72,831,232
Determine which project I'm in and which are available<p>I think I'm connected to BigQuery via ODBC:</p> <pre><code>isql -v BigQuery +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] ...
<p>The Problem you are facing deals with roles, you need to <a href="https://cloud.google.com/iam/docs/granting-changing-revoking-access#grant-single-role" rel="nofollow noreferrer">grant the role</a> <code>bigquery.jobs.create</code> to the service account. You can also add the role <code>bigquery.user</code> or <code...
Determine which project I'm in and which are available
google-bigquery|odbc
1
54
1
72,834,797
72,834,797
1
true
2022-07-01T15:05:31.023Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Determine which project I'm in and which are available<p>I think I'm connected to BigQuery via ODBC:</p> <pre><code>isql -v BigQuery +-----------------------...
72,830,190
Android intent returning null when moving back and forth of activities<p>I have an app where a user can create/login an account, when the user logs in, I pass their valid email as an intent to the main/landing activity .</p> <p>I also have another activity for the user profile, from which I pass the intent from the lan...
<p>The problem here is, your are starting another ProjectActivity instance in your ProfileActivity's <em>onNavigationItemSelected</em> listener of <strong>bottomNavView</strong>, which has no arguments (<code>startActivity(new Intent(getApplicationContext(), ProjectActivity.class));</code>) <br> That's why in your seco...
Android intent returning null when moving back and forth of activities
java|android|sqlite
-1
54
1
72,836,771
72,836,771
1
true
2022-07-01T13:40:23.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android intent returning null when moving back and forth of activities<p>I have an app where a user can create/login an account, when the user logs in, I pas...
72,838,235
C++ How to choose file size as array size<p>I can't use file size as array size, because it should be a constant. But I made it constant.</p> <pre><code>ifstream getsize(dump, ios::ate); const int fsize = getsize.tellg(); // gets file size in constant variable getsize.close(); byte dumpArr[fsize] // not correct array&...
<p>You need a <a href="https://en.cppreference.com/w/cpp/language/constant_expression" rel="nofollow noreferrer"><strong>compile-time constant</strong></a> to declare arrays so you have two options:</p> <ul> <li>Give up the idea to create an array and use a <code>std::vector</code> instead: <pre><code>std::ifstream fil...
C++ How to choose file size as array size
c++|fstream|stdarray
0
54
1
72,838,443
72,838,443
1
true
2022-07-02T10:11:24.073Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C++ How to choose file size as array size<p>I can't use file size as array size, because it should be a constant. But I made it constant.</p> <pre><code>ifst...
72,778,455
How to get values of a pyparsing parser from parseAction<p>I have this pyparsing variable in a class:</p> <pre class="lang-py prettyprint-override"><code>def takeval(type, name, value): #do stuff with args self.variable = pp.Optional(self.let_ | self.const_ | self.var_).set_results_name('vartype') ^ self.varn...
<p>I have even three versions for you.</p> <ul> <li>Version 1 needs for each of you parser actions a separate call parser action.</li> <li>Verison 2 needs only one such function.</li> <li>Version 3 needs nothing of such but the caller code is not so nice any more.</li> </ul> <p>Normally I use the result names a lot. Bu...
How to get values of a pyparsing parser from parseAction
python|pyparsing
2
54
1
72,841,894
72,841,894
1
true
2022-06-27T21:24:13.837Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get values of a pyparsing parser from parseAction<p>I have this pyparsing variable in a class:</p> <pre class="lang-py prettyprint-override"><code>def...
72,841,607
SwiftUI - Drag Gesture doesn't activate on HStack with Buttons in it<p>I have an HStack with buttons in it defined like this:</p> <pre><code>GeometryReader { proxy in HStack { Button(&quot;test&quot;) .frame(width: 100, height: 50) Button(&quot;test&quot;) .frame(width: 100, height: 50) Button...
<p>You can use a View with an <code>onTapGesture</code> instead of a button.</p> <p>Try something like this:</p> <pre><code>@State private var count = 0 // To check if dragging works GeometryReader { proxy in HStack { Text(&quot;test&quot;) .onTapGesture { // The action gesture ...
SwiftUI - Drag Gesture doesn't activate on HStack with Buttons in it
swiftui|gesture|drag
1
54
1
72,843,154
72,843,154
1
true
2022-07-02T18:43:15.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SwiftUI - Drag Gesture doesn't activate on HStack with Buttons in it<p>I have an HStack with buttons in it defined like this:</p> <pre><code>GeometryReader {...
72,843,122
Remove duplicate index in 2D array<p>I have this 2D numpy array here:</p> <pre class="lang-python prettyprint-override"><code>arr = np.array([[1,2], [2,2], [3,2], [4,2], [5,3]]) </code></pre> <p>I would like to delete all duplicates corresponding to the pr...
<p>Rather than trying to delete from the array, you can use <a href="https://numpy.org/doc/stable/reference/generated/numpy.unique.html" rel="nofollow noreferrer"><code>np.unique</code></a> to find the indices of first occurrences of the unique values in the second columns and use that to pull those values out:</p> <pr...
Remove duplicate index in 2D array
python|arrays|numpy|multidimensional-array
0
54
1
72,843,178
72,843,178
1
true
2022-07-02T23:47:52.377Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove duplicate index in 2D array<p>I have this 2D numpy array here:</p> <pre class="lang-python prettyprint-override"><code>arr = np.array([[1,2], ...
72,842,791
In flutter how to display a png image above a background color?<p>I want to achieve this</p> <p><a href="https://i.stack.imgur.com/pOHjZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pOHjZ.png" alt="enter image description here" /></a></p> <p>But, I got this</p> <p>:<a href="https://i.stack.imgur.c...
<p>Here is the code to achieve the bottom</p> <pre><code>Scaffold( floatingActionButton: FloatingActionButton( onPressed: (){}, child: Icon(Icons.check, color: Colors.white,), backgroundColor: Colors.blue, ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, body: Container( ...
In flutter how to display a png image above a background color?
android|flutter
0
54
2
72,844,240
72,844,240
1
true
2022-07-02T22:22:58.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In flutter how to display a png image above a background color?<p>I want to achieve this</p> <p><a href="https://i.stack.imgur.com/pOHjZ.png" rel="nofollow n...
72,833,079
c++11 - list-initialization of an aggregate from an aggrrgate<p>On <a href="https://en.cppreference.com/w/cpp/language/list_initialization" rel="nofollow noreferrer">this page</a> of the cppreference.com I read the following:</p> <blockquote> <p>If T is an aggregate class and the braced-init-list has a single element o...
<blockquote> <p>of the same or derived type</p> </blockquote> <p>That means that default copy-constructor will be used. That's why there is no contradiction between these two rules</p>
c++11 - list-initialization of an aggregate from an aggrrgate
c++|initialization|list-initialization|aggregate-initialization
0
54
1
72,848,497
72,848,497
1
true
2022-07-01T18:00:28.793Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c++11 - list-initialization of an aggregate from an aggrrgate<p>On <a href="https://en.cppreference.com/w/cpp/language/list_initialization" rel="nofollow nor...
72,848,048
COUNT with JOIN and WHERE clause - very slow query<p>The queries on the website I am working on are pretty slow (there are only about 300k records in the database and some queries take more than 30 seconds), so I wanted to find the problem and decided to do some performance tests with some simple queries, here you will...
<p>The reason for the timings may be seen in the <code>EXPLAINs</code> for the other two.</p> <p>The 3rd query is not really the combination of the other two -- it is also counting how many rows are in both tables based on the city. What counts did you get for the 3 queries? Often a JOIN &quot;inflates&quot; a COUNT(...
COUNT with JOIN and WHERE clause - very slow query
mysql|sql
0
54
1
72,848,536
72,848,536
1
true
2022-07-03T16:06:54.117Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: COUNT with JOIN and WHERE clause - very slow query<p>The queries on the website I am working on are pretty slow (there are only about 300k records in the dat...
72,839,724
Debugging with Java/Spring's @Autowired on Eclipse<p>I have picked up a project that uses @Autowired and dependency injection a lot. People have been saying all the nice things about them. It seems kind of like a magic.</p> <p>I am new to Spring injection and @Autowired. My first glance of @Autowired is good, but when ...
<p>When a Spring application starts, it first creates instances of beans, either by scanning for annotations, or processing the XML Spring context definition. Some of those beans have to be created in a specific order, like if they use constructor injection. Once beans are created, wiring those beans together can hap...
Debugging with Java/Spring's @Autowired on Eclipse
spring|eclipse|dependency-injection|autowired|spring-tool-suite
0
54
1
72,848,548
72,848,548
1
true
2022-07-02T14:13:43.217Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Debugging with Java/Spring's @Autowired on Eclipse<p>I have picked up a project that uses @Autowired and dependency injection a lot. People have been saying ...
72,847,775
How to create custom function Windows command prompt and set up "dotfile"-like system<p>How can I create a &quot;dotfile&quot; on Windows with custom functions to run in command prompt (not PowerShell)? A related question is, where should I save the file? There are a ton of resources for this for bash/unix, but I haven...
<p>Use the <a href="http://technet.microsoft.com/en-us/library/cc779439(WS.10).aspx" rel="nofollow noreferrer">AutoRun</a> registry entry to run a batch file. Just <a href="https://stackoverflow.com/a/4900046/3501">be careful</a> that you only do this when cmd.exe is started manually.</p> <p>This batch file may use <co...
How to create custom function Windows command prompt and set up "dotfile"-like system
windows|command-prompt|dotfiles
0
54
1
72,849,001
72,849,001
1
true
2022-07-03T15:32:57.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create custom function Windows command prompt and set up "dotfile"-like system<p>How can I create a &quot;dotfile&quot; on Windows with custom functio...
72,848,472
ArchUnit ignoreDependency for classes rule<p>In my <a href="https://github.com/tfassbender/onnessium" rel="nofollow noreferrer">project</a> I'm using some simple <code>ArchRule</code> test to ensure that there are no unwanted dependencies between packages. Most of them work fine, but the following test leads to a probl...
<p>ArchUnit (as of the current version 0.23.1) assigns <code>char[]</code> to the empty package <code>&quot;&quot;</code> (probably because <code>char[].class.getPackage() == null</code>). (Side note: I just realized that <code>char[].class.getPackageName()</code>, available with JRE ≥9, actually returns <code>&quot;ja...
ArchUnit ignoreDependency for classes rule
java|junit5|archunit
1
54
1
72,849,333
72,849,333
1
true
2022-07-03T17:11:50.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ArchUnit ignoreDependency for classes rule<p>In my <a href="https://github.com/tfassbender/onnessium" rel="nofollow noreferrer">project</a> I'm using some si...
72,850,428
How to plot a dictionary of sets in python?<p>I have a dictionary of sets and I want to plot the histogram for it. How can I do that? i tried turning it into lists but it still gives me errors linked to set</p> <pre><code>#Plot histogram for the first 10 keys = [key for key in frequency.keys()] val = [value for value i...
<p>The error says &quot;'set' object is not subscriptable,&quot; which means you're trying to access an element of a set with an index, but a set is not an ordered data structure, so you cannot do that.</p> <p>The problem lies in this line: <code>val = [value for value in frequency.values()]</code>.You said you tried t...
How to plot a dictionary of sets in python?
python|list|plot|set
-1
54
1
72,850,830
72,850,830
1
true
2022-07-03T22:56:00.333Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to plot a dictionary of sets in python?<p>I have a dictionary of sets and I want to plot the histogram for it. How can I do that? i tried turning it into...
72,856,112
Prefetch count for receiver is less than the max messages requested<p>I am using Azure Service Bus extension for Function App service bus trigger and have below extension settings prefetchCount = 30,</p> <pre><code> &quot;extensions&quot;: { &quot;serviceBus&quot;: { &quot;prefetchCount&quot;: 30, &quot;messageHand...
<blockquote> <p>What this warning means and how to get rid of it?</p> </blockquote> <p>The message tells that the configuration is sub optimal. To fix this, set the prefetch larger than the number of the message you're receiving using a batches recieve.</p>
Prefetch count for receiver is less than the max messages requested
azure-functions|azure-servicebus-topics|azure-servicebus-subscriptions
0
54
1
72,856,273
72,856,273
1
true
2022-07-04T11:39:37.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Prefetch count for receiver is less than the max messages requested<p>I am using Azure Service Bus extension for Function App service bus trigger and have be...
72,794,238
Using AutoFixture to create MockFileSystem and its corresponding types<p>I'm using AutoFixture to test some code that uses <code>System.IO.Abstractions.IFileSystem</code>.</p> <p>I also have some code that uses <code>IFileInfo</code> and <code>IDirectoryInfo</code>. When I create my AutoFixture <code>Fixture</code> obj...
<p>As I struggled through solving my own problem, I eventually came up with this class:</p> <pre class="lang-cs prettyprint-override"><code>public class MockFileSystemSpecimenBuilder : ICustomization { public void Customize(IFixture fixture) { var fs = new MockFileSystem(); fixture.Inject(fs); ...
Using AutoFixture to create MockFileSystem and its corresponding types
c#|autofixture
0
54
2
72,860,889
72,860,889
1
true
2022-06-28T23:34:29.150Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using AutoFixture to create MockFileSystem and its corresponding types<p>I'm using AutoFixture to test some code that uses <code>System.IO.Abstractions.IFile...
72,863,598
Collection Extension for checking unique values for a given property in Swift<p>I have an extension for a <code>Collection</code> that checks if the items inside the collection has a unique value for a specific property and I have implemented it like this:</p> <pre><code>func isPropertyUnique &lt;T: Hashable&gt; (by: (...
<p>A bit simplified (because <code>Collection</code> already knows own element type and enough only key path) and faster (because it is not needed to iterate all as soon as first non-unique found)</p> <p>Here is a result</p> <pre><code>func isUnique&lt;T: Hashable&gt;(by key: KeyPath&lt;Element, T&gt;) -&gt; Bool { ...
Collection Extension for checking unique values for a given property in Swift
arrays|swift
1
54
1
72,864,141
72,864,141
1
true
2022-07-05T03:04:14.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Collection Extension for checking unique values for a given property in Swift<p>I have an extension for a <code>Collection</code> that checks if the items in...
72,865,748
Swapping and flattening a Java Map<Integer, List<Integer>> using Stream API<p>Having this Map&lt;Integer, List&gt;:</p> <pre><code>Map&lt;Integer, List&lt;Integer&gt;&gt; forwardMap = Map.of( 100, List.of(6), 300, List.of(49, 52), 500, List.of(293) ); </code></pre> <p>I would like to 'flatten' t...
<p>As part of your goal is to flatten the values, you're correct you'll probably need a <code>flatMap</code> operation somewhere. For example:</p> <pre class="lang-java prettyprint-override"><code>Map&lt;Integer, Integer&gt; reverseMap = forwardMap.entrySet().stream() .flatMap( entry -&gt; entry...
Swapping and flattening a Java Map<Integer, List<Integer>> using Stream API
collections|java-stream|flatmap
-1
54
2
72,866,018
72,866,018
1
true
2022-07-05T07:45:52.760Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swapping and flattening a Java Map<Integer, List<Integer>> using Stream API<p>Having this Map&lt;Integer, List&gt;:</p> <pre><code>Map&lt;Integer, List&lt;In...
72,866,859
Cannot add my scoretext to script in gamecontrol in unity 2d<p>I am new to unity and I am trying to make a flappy bird as a project but I am stuck in one place. I created a game control script and added game over text and it worked fine, but when I tried to add to score text to a different script, it didn't work. It's ...
<p>The gameobject you are trying to drag into the <code>Text</code> slot doesn't have a <strong>&quot;Text&quot;</strong> component which looks like this:<br> <a href="https://i.stack.imgur.com/9DxGR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9DxGR.png" alt="enter image description here" /></a><...
Cannot add my scoretext to script in gamecontrol in unity 2d
c#|unity3d|2d|game-development
0
54
1
72,867,354
72,867,354
1
true
2022-07-05T09:15:44.490Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot add my scoretext to script in gamecontrol in unity 2d<p>I am new to unity and I am trying to make a flappy bird as a project but I am stuck in one pla...
72,867,602
How to delete empty cells in css grid?<p>I'm not sure if these are empty cells, most likely they are stretched because of the largest element, please tell me how I can remove these indentations without javascript. I tried to use grid-auto-flow: colunm, but it doesn't works.</p> <p><a href="https://i.stack.imgur.com/uuI...
<p>is this what you want ?</p> <p>I updated the following code to make it work</p> <pre><code>#header__submenu-item-block { grid-column: 4; grid-row: 1 / 3; } </code></pre> <p>check below the working sample. <a href="https://codepen.io/shahilparichay/pen/LYdpJGX" rel="nofollow noreferrer">https://codepen.io/sha...
How to delete empty cells in css grid?
html|css|css-grid|grid-layout
0
54
1
72,867,966
72,867,966
1
true
2022-07-05T10:08:35.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to delete empty cells in css grid?<p>I'm not sure if these are empty cells, most likely they are stretched because of the largest element, please tell me...
72,868,071
splitting representative data by list of separators vs. acutal data<p>I have a <em>string</em> <code>text</code> and a <em>list</em> <code>names</code></p> <ul> <li>I want to <strong>split</strong> <code>text</code> <strong>every time an element of</strong> <code>names</code> <strong>occurs</strong>.</li> </ul> <p><cod...
<p>You should make the optional group non-capturable in <code>create_regex_string</code> by changing the last line to</p> <pre class="lang-py prettyprint-override"><code>return f&quot;(?:{re.escape(salutation)} )?{re.escape(' '.join(name))}&quot; </code></pre> <p>Also, you should avoid additional variables like <code>g...
splitting representative data by list of separators vs. acutal data
python|regex|split
0
54
2
72,868,847
72,868,847
1
true
2022-07-05T10:43:09.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: splitting representative data by list of separators vs. acutal data<p>I have a <em>string</em> <code>text</code> and a <em>list</em> <code>names</code></p> <...
72,866,486
Parameter arithmetic in Prolog<p>In Prolog, I would like to implement a trivial logical induction predicate <code>i</code> as (1):</p> <pre><code>i(0). i(N) :- i(N-1). </code></pre> <p>or (2):</p> <pre><code>i(0). i(N+1) :- i(N). </code></pre> <p>But this doesn't work; with (1), query <code>i(3).</code> causes a stack ...
<p>Surprisingly, it isn't a trivial syntactic shift. <code>N-1</code> in Python is always arithmetic; you can replace <code>5-1</code> with <code>4</code> and <code>&quot;cat&quot;-1</code> is an error.</p> <p>In Prolog dash is not arithmetic, it's a term connecting Left/Right with a dash. You can write <code>&quot;cat...
Parameter arithmetic in Prolog
syntax|prolog|induction
1
54
1
72,869,867
72,869,867
1
true
2022-07-05T08:45:43.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parameter arithmetic in Prolog<p>In Prolog, I would like to implement a trivial logical induction predicate <code>i</code> as (1):</p> <pre><code>i(0). i(N) ...
72,871,002
How to count without duplicates in Excel?<p>I am trying to count the &quot;iso3&quot; items (in column A) with different combinations without duplicates. For example, &quot;RUS&quot; with different &quot;cnum&quot; (column B) and &quot;country&quot;(column C) have 2 combinations, including &quot;RUS -- 643 --- Russian ...
<p>This formula should work for you, in cell D2 and copied down:</p> <pre><code>=SUMPRODUCT(--($A$2:$A$13=A2),1/COUNTIFS($A$2:$A$13,$A$2:$A$13,$B$2:$B$13,$B$2:$B$13,$C$2:$C$13,$C$2:$C$13)) </code></pre>
How to count without duplicates in Excel?
excel
0
54
1
72,871,270
72,871,270
1
true
2022-07-05T14:19:44.763Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to count without duplicates in Excel?<p>I am trying to count the &quot;iso3&quot; items (in column A) with different combinations without duplicates. For...
72,873,465
How to skip hidden or veryhidden sheets in a workbook when combining them<p>I am trying to skip all of the sheets that are&quot;xlSheetHidden&quot; or &quot;xlSheetVeryHidden&quot;. I have recently started using VBA to help speed up processes at my work when python wasn't allowing for what was needed. I currently have ...
<p>You did not use the for each correctly. In your code you loop over sheets with the name <code>Sheets</code>, then in the loop you refer to <code>Sheet</code></p> <pre><code>For Each Sheets In ActiveWorkbook.Worksheets If Sheet.Visible = xlSheetVisible Then '// Doesn't work! </code></pre> <p>So you probaby only n...
How to skip hidden or veryhidden sheets in a workbook when combining them
excel|vba
1
54
2
72,874,126
72,874,126
1
true
2022-07-05T17:33:57.970Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to skip hidden or veryhidden sheets in a workbook when combining them<p>I am trying to skip all of the sheets that are&quot;xlSheetHidden&quot; or &quot;...
72,873,692
In Julia, how does one initialize a two-dimensional array (a matrix) in which each element is a column vector?<hr> <p>Using Julia version 1.7.3, my understanding is that the following initializes <code>matrix</code> to be a 9 × 9 matrix each of whose elements is undefined …</p> <pre><code>matrix = Array{Char}( undef, 9...
<pre><code> julia&gt; [[ c for c = '1':'9' ] for _ in 1:9, _ in 1:9] 9×9 Matrix{Vector{Char}}: ['1', '2', '3', '4', '5', '6', '7', '8', '9'] … ['1', '2', '3', '4', '5', '6', '7', '8', '9'] ['1', '2', '3', '4', '5', '6', '7', '8', '9'] ['1', '2', '3', '4', '5', '6', '7', '8', '9'] ['1', '2', '3', '4', '5', '6',...
In Julia, how does one initialize a two-dimensional array (a matrix) in which each element is a column vector?
arrays|vector|initialization|julia
2
54
2
72,874,150
72,874,150
1
true
2022-07-05T17:58:03.720Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In Julia, how does one initialize a two-dimensional array (a matrix) in which each element is a column vector?<hr> <p>Using Julia version 1.7.3, my understan...
72,874,198
Evaluating environment variables in github actions workflow<p>I'm positive that this is something easy but I'm not able to track down exactly what I'm looking for. I have a workflow that performs a build and creates an artifact. The artifact uses an environment variable in the filename. So far so good. Then when I ...
<p>Since these parameters are passed through to the <code>s3-upload-action</code>, the behaviour depends on whether the action expands shell parameters or not, but the input value will be literally</p> <pre><code>${GITHUB_WORKSPACE}/build/${FILE_NAME}.zip </code></pre> <p>i.e., unexpanded.</p> <p>You can use <a href="h...
Evaluating environment variables in github actions workflow
github|automation|continuous-integration|github-actions
0
54
1
72,874,362
72,874,362
1
true
2022-07-05T18:47:15.260Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Evaluating environment variables in github actions workflow<p>I'm positive that this is something easy but I'm not able to track down exactly what I'm lookin...
72,877,433
Error while adding Eloquent class to User in Laravel<p>I want to make an eloquent model out of two table, pekerjaan and user. User hasMany pekerjaan and pekerjaan belongsTo User. How do I add eloquent's method to the User class in Laravel? I have an error that shows:</p> <blockquote> <p>Cannot declare class App\Models\...
<p>The error message says it what is the problem:</p> <pre><code>Cannot declare class App\Models\User, because the name is already in use </code></pre> <p>Your problem is you have 2 classes of <code>User</code> in your <code>User.php</code>. Remove the first <code>User</code> class put the function <code>pekerjaans</co...
Error while adding Eloquent class to User in Laravel
php|laravel|eloquent
0
54
1
72,877,477
72,877,477
1
true
2022-07-06T02:47:40.850Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error while adding Eloquent class to User in Laravel<p>I want to make an eloquent model out of two table, pekerjaan and user. User hasMany pekerjaan and peke...
72,878,073
How do one count rows in powerquery table that contain just text values<p>Good day all,how can one count rows in a table in powerquery containing just text values.</p> <p>I want my table in this format.</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Mail</th> <th>listern</th> <th>Boby</th>...
<p><a href="https://i.stack.imgur.com/uDpDY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uDpDY.png" alt="enter image description here" /></a></p> <pre><code> let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText(&quot;i45WclJQ0lEyBBHOCkqxOlABAxBhDBSIBQA=&quot;, Binary...
How do one count rows in powerquery table that contain just text values
excel|powerquery
1
54
3
72,879,084
72,879,084
1
true
2022-07-06T04:47:54.923Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do one count rows in powerquery table that contain just text values<p>Good day all,how can one count rows in a table in powerquery containing just text v...
72,879,634
Remove padding from chartjs bar chart canvas<p>I want to create a single stacked bar chart with Chart.js that shows how close someone is to a certain amount of money. To define this amount I put a dotted line on top of the chart.</p> <p>The problem is however that the canvas of this chart has some unwanted padding. So ...
<p>Try setting <code>barPercentage</code> &amp; <code>categoryPercentage</code> values to <code>1</code> inside <code>options</code> like below. Here is updated Code sandbox <a href="https://codesandbox.io/s/winter-wind-xdcuxu?file=/src/App.js" rel="nofollow noreferrer">https://codesandbox.io/s/winter-wind-xdcuxu?file=...
Remove padding from chartjs bar chart canvas
javascript|css|reactjs|chart.js
1
54
1
72,880,067
72,880,067
1
true
2022-07-06T07:43:28.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove padding from chartjs bar chart canvas<p>I want to create a single stacked bar chart with Chart.js that shows how close someone is to a certain amount ...
72,878,627
how do those webdriver option arguments work?<pre><code>options.add_argument('--disable-blink-features=AutomationControlled') options.add_experimental_option('excludeSwitches', ['enable-automation']) options.add_experimental_option('useAutomationExtension', False) driver.execute_cdp_cmd(&quot;Page.addScriptToEvaluateOn...
<p>Javascript fingerprinting and context analysis is often used by websites to tell whether connecting client is a human or a robot.</p> <p>Since website can execute arbitrary javascript on your web browser instance it can look for small details that are only present in automated browser instances and flag you as a rob...
how do those webdriver option arguments work?
python|html|selenium-webdriver|web-scraping|selenium-chromedriver
0
54
1
72,880,229
72,880,229
1
true
2022-07-06T06:07:34.570Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how do those webdriver option arguments work?<pre><code>options.add_argument('--disable-blink-features=AutomationControlled') options.add_experimental_option...
72,881,166
Is it possible to add some string before Column value in Laravel?<p>So, i need to put AWS S3 URL before the <code>attachment</code> value. I use <strong>Laravel Query builder</strong> to get data from database.</p> <p>Query</p> <pre><code>$query = DB::table('subscriber')-&gt;select(['ID as SBC_ID','SUBSCRIBER_NAME','AT...
<p>You can use <a href="https://laravel.com/docs/9.x/queries#raw-expressions" rel="nofollow noreferrer">Laravel Raw Expressions</a> and <a href="https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_concat" rel="nofollow noreferrer">MySQL CONCAT function</a>. E.g.:</p> <pre><code>$query = DB::table('su...
Is it possible to add some string before Column value in Laravel?
mysql|sql|laravel
0
54
3
72,881,711
72,881,711
1
true
2022-07-06T09:37:05.833Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to add some string before Column value in Laravel?<p>So, i need to put AWS S3 URL before the <code>attachment</code> value. I use <strong>Lara...
72,882,007
Javascript map method - write key only if there is a defined value for it<p>I am using a map method in Javascript to convert an array of objects to an array of objects with different key names. Let's say I have an array like this:</p> <pre><code>let arr1 = [ {id:1,name:&quot;Luke&quot;}, {id:2}, {id:3,name:&quot;Greg&q...
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>let arr1 = [ {id:1,name:"Luke"}, {id:2}, {id:3,name:"Greg"}, {id:4,name:"Joe"} ] let arr2 = arr1.map((data) =&gt; ({ ......
Javascript map method - write key only if there is a defined value for it
javascript
-2
54
6
72,882,129
72,882,129
1
true
2022-07-06T10:34:22.700Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript map method - write key only if there is a defined value for it<p>I am using a map method in Javascript to convert an array of objects to an array ...
72,885,276
Split a string and capture all instances in python regex<p>Newbie here, I have been trying to learn regex for some time but sometimes I feel I can't understand how regex is handling strings. Because in planning phase I seem to work it out, but in implementation it doesn't work as I expect it.</p> <p>Here is my little ...
<p><code>([A-Z0-9].*s)*</code> will capture as many of any character as it can, so that's causing 'RangersIslandersMols' to get stuck together as one match.</p> <p>It sounds like the boundary between team names is defined as a lowercase letter (not necessarily an 's', as in 'Avalanche') followed immediately by an upper...
Split a string and capture all instances in python regex
python|regex|regex-group
1
54
1
72,885,671
72,885,671
1
true
2022-07-06T14:24:34.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split a string and capture all instances in python regex<p>Newbie here, I have been trying to learn regex for some time but sometimes I feel I can't underst...
72,884,345
Scalar-valued function returning NULL<p>I have the below function, and for the life of me, I cannot get it to return a value, I get NULL every time.</p> <p>I am calling it via <code>select [dbo].[getFiatProfit](600.26,'GBP', 1000.99,'BTC') as op</code></p> <p>What am I missing?</p> <pre><code>/****** Object: UserDefin...
<p>Your issue looks it's because your parameters are declared without a length. <code>nvarchar</code> <a href="https://sqlblog.org/2009/10/09/bad-habits-to-kick-declaring-varchar-without-length" rel="nofollow noreferrer">defaults to a length of <code>1</code></a> in a lot of circumstances, so it's simply the wrong valu...
Scalar-valued function returning NULL
sql|sql-server|tsql
1
54
1
72,885,810
72,885,810
1
true
2022-07-06T13:23:11.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Scalar-valued function returning NULL<p>I have the below function, and for the life of me, I cannot get it to return a value, I get NULL every time.</p> <p>I...
72,885,273
Ensure that pandas.crosstab returns a square matrix<p>I am currently using pandas.crosstab to generate the confusion matrix of my classifiers after testing. Unfortunately, sometimes my classifier fails, and classifies every signal as a single label (instead of multiple labels). pandas.crosstab generates a single vector...
<p>You could create a <code>zeros</code> array of the required shape and then replace a portion of the array with the <code>crosstab</code></p> <pre class="lang-py prettyprint-override"><code>xtab = pd.crosstab(pred_data, true_data, dropna=False).sort_index(axis=0).sort_index(axis=1) all_unique_values = sorted(set(true...
Ensure that pandas.crosstab returns a square matrix
python|pandas|crosstab
2
54
2
72,885,818
72,885,818
1
true
2022-07-06T14:24:30.087Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ensure that pandas.crosstab returns a square matrix<p>I am currently using pandas.crosstab to generate the confusion matrix of my classifiers after testing. ...
72,885,060
Ruby: Get the value if end_with? is true<p>Looking for a clean way to return the characters of a string if <code>end_with?</code> evaluates to true. i.e.</p> <pre><code>s = &quot;my_name&quot; name = s.end_with?(&quot;name&quot;) puts name &gt;&gt; &quot;name&quot; </code></pre> <p>My use case would look somewhat like...
<p>I would do this:</p> <pre><code>&quot;my_name&quot;.scan(/name\z/)[0] #=&gt; &quot;name&quot; &quot;something&quot;.scan(/name\z/)[0] #=&gt; nil </code></pre>
Ruby: Get the value if end_with? is true
ruby-on-rails|ruby
0
54
3
72,886,645
72,886,645
1
true
2022-07-06T14:10:45.713Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ruby: Get the value if end_with? is true<p>Looking for a clean way to return the characters of a string if <code>end_with?</code> evaluates to true. i.e.</p>...