question_id
int64
37.6M
73.2M
input_text
stringlengths
88
52.4k
output_text
stringlengths
37
35.6k
title
stringlengths
15
150
tags
stringlengths
1
107
q_score
int64
-19
397
view_count
int64
3
879k
answer_count
int64
1
21
accepted_answer_id
int64
37.6M
73.8M
answer_id
int64
37.6M
73.8M
a_score
int64
-5
1.29k
is_accepted
bool
1 class
creation_date
stringlengths
20
24
input_text_instruct
stringlengths
251
52.6k
73,012,100
variable binding in a condition requires an initializer Swift GuideTour PlayGround error<p>I'm learning Swift, using this guide from the official website, in the form of PlayGround.</p> <p>And I had this error: <a href="https://i.stack.imgur.com/9E3rJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9...
<p>Answering your questions:</p> <ol> <li><p>There's an error because the Xcode version that you are working with has a Swift version &lt;5.7 (Xcode &lt;14) which does not yet support <code>if let</code> shorthand syntax for optional binding when shadowing an existing optional variable (proposed in <a href="https://git...
variable binding in a condition requires an initializer Swift GuideTour PlayGround error
swift
0
75
1
73,015,153
73,015,153
1
true
2022-07-17T13:14:27.257Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: variable binding in a condition requires an initializer Swift GuideTour PlayGround error<p>I'm learning Swift, using this guide from the official website, in...
72,821,948
HTML, JS calculator output number as NaN<p>I was trying to create a simple demo calculator and I got the output as NaN. I think it is something with the JS calling the input values. Please refer to the below code.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div ...
<pre class="lang-html prettyprint-override"><code>var num1 = document.getElementsByName(firstNoInput).value; var num2 = document.getElementsByName(secondNoInput).value; </code></pre> <p>is wrong. You should pass the parameters as strings. However, ignore this part, since the both variables that you define make only sen...
HTML, JS calculator output number as NaN
javascript|html
0
75
3
72,822,593
72,822,593
1
true
2022-06-30T20:58:13.977Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTML, JS calculator output number as NaN<p>I was trying to create a simple demo calculator and I got the output as NaN. I think it is something with the JS c...
72,872,200
How to convert string to an int array using stoi() && substr()<p>im triying to convert an string to an integer and save those numbers into an array, i tried like this</p> <pre><code>#include &lt;iostream&gt; #include &lt;cstdlib&gt; #include &lt;string&gt; using namespace std; int main() { int number[5]; string...
<p>Your first loop is asking for a substring beginning at index <code>0</code>, with length <code>0</code>, so you're passing an empty string to <code>stoi</code>. Even if you in fact provided valid inputs (a string of at least eight digits, so you could call <code>.substr(4, 4)</code> on it and get useful results), th...
How to convert string to an int array using stoi() && substr()
c++
0
75
1
72,872,232
72,872,232
1
true
2022-07-05T15:44:41.137Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert string to an int array using stoi() && substr()<p>im triying to convert an string to an integer and save those numbers into an array, i tried ...
73,025,377
How to solve "field must be unique" in django?<p>I am creating an app with vue and django but struggle with getting information from serializer. my models look like this:</p> <p>models.py</p> <pre><code>from django.contrib.auth.models import User class Profile(models.Model): user = models.OneToOneField(User, on_de...
<p>How about:</p> <ul> <li>views.py</li> </ul> <pre class="lang-py prettyprint-override"><code>from rest_framework.exceptions import ValidationError from rest_framework.response import Response class OfferView(ListModelMixin, GenericAPIView): queryset = Offer.objects.all() serializer_class = OfferSerializer ...
How to solve "field must be unique" in django?
python|django|django-models|django-rest-framework|django-views
1
75
2
73,025,676
73,025,676
1
true
2022-07-18T16:06:32.233Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to solve "field must be unique" in django?<p>I am creating an app with vue and django but struggle with getting information from serializer. my models lo...
72,836,040
How to insert node/element in XML using Attribute<p>I am trying to insert these nodes <code>price</code>, <code>qty</code>, <code>amount</code> under the descendants <code>Apple</code> &gt; <code>Store</code> only using the attribute to find the exact location of insert.</p> <pre><code>&lt;?xml version=&quot;1.0&quot; ...
<p>You're using an attribute named &quot;text&quot; to define a path to the location for the insert. To make it straightforward to iterate to that location, you could try writing a simple <code>FindPath</code> extension that <em>knows</em> that the &quot;text&quot; attribute is the one to look for, and then call the ex...
How to insert node/element in XML using Attribute
c#|xml|treeview|linq-to-xml
2
75
1
72,836,391
72,836,391
1
true
2022-07-02T02:21:08.127Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to insert node/element in XML using Attribute<p>I am trying to insert these nodes <code>price</code>, <code>qty</code>, <code>amount</code> under the des...
72,939,640
Close hamburger menu on click<p>I'm looking for a way to make this hamburger menu close after the user clicks the link/makes selection. I've checked out several options on how to do it, but with no luck. I understand I need a missing piece of JS.</p> <p>The rest of the code (html&amp;css) can be found here (<a href="ht...
<p>You forgot to pass in the onclick function to the nav.</p> <p>This should do the trick:</p> <pre><code>&lt;div id=&quot;menu&quot;&gt; &lt;div id=&quot;menu-bar&quot; onclick=&quot;menuOnClick()&quot;&gt; &lt;div id=&quot;bar1&quot; class=&quot;bar&quot;&gt;&lt;/div&gt; &lt;div id=&quot;bar2&quot; class=&q...
Close hamburger menu on click
javascript|menu|onclick
-2
75
2
72,939,705
72,939,705
1
true
2022-07-11T13:48:49.130Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Close hamburger menu on click<p>I'm looking for a way to make this hamburger menu close after the user clicks the link/makes selection. I've checked out seve...
72,920,460
Unable to attain correct results with CASE WHEN statement in Databricks with Left Join<p>I am trying to do a left join between two datasets using a CASE WHEN in databricks statement with the following code:</p> <pre><code>;WITH CTE1 AS ( SELECT *,ROW_NUMBER()OVER(ORDER BY ts_primarysecondaryfocus)RowNum FROM dataver...
<p>The problem is because of the misinterpretation of the table values. When I tried reproducing this query, it gave the correct output when empty values in <code>ts_primarysecondaryfocus</code> column in both tables are empty string <code>''</code>. It fails when these values are <code>null</code> instead.</p> <p><str...
Unable to attain correct results with CASE WHEN statement in Databricks with Left Join
databricks|azure-databricks|databricks-sql
0
75
1
72,923,729
72,923,729
1
true
2022-07-09T10:02:46.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to attain correct results with CASE WHEN statement in Databricks with Left Join<p>I am trying to do a left join between two datasets using a CASE WHEN...
72,877,463
Flutter - Why Material elevation not working?<p>Material elevation in Column not working.</p> <p>On this code elevation not working.</p> <pre class="lang-dart prettyprint-override"><code> Scaffold( backgroundColor: Colors.grey, appBar: AppBar( title: const Text('Test'), ), body: Colum...
<p>I think you can use <code>Stack</code> instead of <code>Column</code> if you want the shadow of <code>Material</code> was visible even if you scroll the list. And add transparent <code>Container</code> on the top of the list.</p> <pre><code>Scaffold( backgroundColor: Colors.grey, appBar: AppBar( ...
Flutter - Why Material elevation not working?
flutter
0
75
1
72,879,099
72,879,099
1
true
2022-07-06T02:52:55.070Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter - Why Material elevation not working?<p>Material elevation in Column not working.</p> <p>On this code elevation not working.</p> <pre class="lang-dar...
72,340,944
Multiple urls Tampermonkey<p>For the first time in my live i make a Tampermonkey script.</p> <p>I want add multiple url's to a page: <a href="https://voertuig.net/zoek/merk/volkswagen/datum-tenaamstelling/30-05-2018?pagina=3" rel="nofollow noreferrer">https://voertuig.net/zoek/merk/volkswagen/datum-tenaamstelling/30-05...
<p>Something like this should do it.</p> <p>Note that you need to modify the <code>//@match</code> line or it will only work for the given page (i.e. page 3 -- just end the line with a <code>*</code> at the point where the match can be wild-carded.</p> <pre><code>// ==UserScript== // @name voertuig.net SO EXAMP...
Multiple urls Tampermonkey
tampermonkey
0
75
1
72,538,298
72,538,298
1
true
2022-05-22T20:05:26.683Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multiple urls Tampermonkey<p>For the first time in my live i make a Tampermonkey script.</p> <p>I want add multiple url's to a page: <a href="https://voertui...
72,330,483
How to Get Last Item in a Python Generator<p><strong>Question</strong>: how can I get the last item in a python generator in a fast and memory-efficient way?</p> <p><strong>MWE</strong>:</p> <pre><code>import snscrape.modules.twitter as sntwitter import time; start = time.time() query = &quot;Rooty Roo&quot; obj = sn...
<p>The last item of a generator cannot (always) be determined.</p> <p>Of some generators you cannot predict if they'll ever end (or the last element is uncertain):</p> <pre><code>import random def random_series(): while x := random.randint(1, 10) &gt; 1: yield x # print random numbers from generator unti...
How to Get Last Item in a Python Generator
python
-2
75
1
72,341,019
72,341,019
1
true
2022-05-21T14:31:33.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Get Last Item in a Python Generator<p><strong>Question</strong>: how can I get the last item in a python generator in a fast and memory-efficient way?...
72,370,210
Counting instances of modules in SystemVerilog<p>I am attempting to design a simple CPU and I ma using SystemVerilog to design and ModelSim to simulate the design. I am trying to set up some code to count the number of instances of a specific module. I am currently using static variables to try to achieve this however ...
<p>All declarations at the module level are already <code>static</code>, and each module instance has a separate allocation of variable instances.</p> <p>You could create a global package with an associative array.</p> <pre><code>package inst; int count[string] = '{default:0}; endpackage module AND(input logic a, b, o...
Counting instances of modules in SystemVerilog
module|static|instance|system-verilog|modelsim
-1
75
1
72,371,159
72,371,159
1
true
2022-05-24T22:45:37.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Counting instances of modules in SystemVerilog<p>I am attempting to design a simple CPU and I ma using SystemVerilog to design and ModelSim to simulate the d...
72,346,408
Remove php extension for only one file by using htaccess<p>I am learning how to configure htaccess. Today, I wanted to hide the PHP access when opening a certain PHP page without removing the extension from the file.</p> <pre><code>RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRul...
<blockquote> <p>with the code I just posted I can visit example.com/content/myfile correctly. But I wanted to restrict it to only this URL.</p> </blockquote> <pre><code>RewriteRule ^content/myfile$ content/myfile.php [L] </code></pre> <p>Or, use a backreference to save repetition:</p> <pre><code>RewriteRule ^content/my...
Remove php extension for only one file by using htaccess
apache|.htaccess|mod-rewrite
0
75
1
72,346,902
72,346,902
1
true
2022-05-23T09:42:38.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove php extension for only one file by using htaccess<p>I am learning how to configure htaccess. Today, I wanted to hide the PHP access when opening a cer...
72,325,680
Asp.net prefetch strategy?<p>In the header of /pages/dashboard/default.aspx I have included the following:</p> <pre><code>&lt;link rel=&quot;prefetch&quot; href=&quot;/pages/agent/statistics/&quot;&gt; &lt;link rel=&quot;prefetch&quot; href=&quot;/pages/agent/statistics/transactions/&quot;&gt; &lt;link rel=&quot;prefet...
<p>By prefetching all of these pages, you are multiplying your server traffic, by loading pages which may not be visited by the user. Whether or not this is OK is a development decision you will need to make, and it is a tradeoff between having higher site responsiveness and requiring more server power. It is up to you...
Asp.net prefetch strategy?
c#|html|asp.net|iis|caching
0
75
1
72,325,890
72,325,890
1
true
2022-05-20T23:46:38.213Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Asp.net prefetch strategy?<p>In the header of /pages/dashboard/default.aspx I have included the following:</p> <pre><code>&lt;link rel=&quot;prefetch&quot; h...
72,347,329
In this For loop count is not increasing<pre><code> &lt;tbody&gt; @foreach (var item in Model) { int count = 1; &lt;tr&gt; &lt;td&gt;@count&lt;/td&gt; &lt;td&gt;@item.ProductName&lt;/td&gt;...
<p>You need to initialize the variable <em>outside</em> of the for loop, or it will not increase:</p> <pre><code>&lt;tbody&gt; @{ int count = 1; foreach (var item in Model) { &lt;tr&gt; &lt;td&gt;@count&lt;/td&gt; &lt;td&gt;@item.ProductName&lt;/td&gt; ...
In this For loop count is not increasing
asp.net|asp.net-mvc|visual-studio|model-view-controller|e-commerce
2
75
3
72,348,561
72,348,561
1
true
2022-05-23T10:52:27.553Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In this For loop count is not increasing<pre><code> &lt;tbody&gt; @foreach (var item in Model) { ...
72,305,138
Not getting expected output when calling PowerShell function from Azure PowerShell Task<p>Given:</p> <ul> <li>PowerShell 5.1</li> <li>Azure DevOps Server 2019</li> </ul> <p>I'm trying to call my function directly from my Azure PowerShell Task Arguments, is this possible? I'm not getting any expected output.</p> <pre><c...
<p>If you execute your script directly, it will simply <em>define</em> the <code>Foo</code> function, but never <em>call</em> it.</p> <p>Place the following <em>after</em> the function definition in your script in order to invoke it with the arguments that the script itself received, using the <a href="https://docs.mic...
Not getting expected output when calling PowerShell function from Azure PowerShell Task
azure|powershell|azure-devops
0
75
1
72,305,904
72,305,904
1
true
2022-05-19T13:07:08.647Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not getting expected output when calling PowerShell function from Azure PowerShell Task<p>Given:</p> <ul> <li>PowerShell 5.1</li> <li>Azure DevOps Server 201...
72,323,059
How to get the last item in foreach loop writing to CSV?<p>I'm having trouble getting the last item in the loop Writing to CSV, I don't want the last item in CSV to have a <code>,</code> at the end.</p> <p><strong>This is the public string to write my controller to CSV</strong></p> <pre><code> public string WriteTsv...
<p>Given your code, the simplest approach would be to remove the last 3 characters (final <code>&quot;, \t&quot;</code>) before each call to <code>AppendLine()</code> using the fact that the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.text.stringbuilder.length?view=net-6.0" rel="nofollow noreferrer">St...
How to get the last item in foreach loop writing to CSV?
c#|csv|asp.net-web-api|export-to-csv|csvhelper
0
75
2
72,323,602
72,323,602
1
true
2022-05-20T17:56:47.720Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the last item in foreach loop writing to CSV?<p>I'm having trouble getting the last item in the loop Writing to CSV, I don't want the last item in...
72,305,194
How to sort parts of a numpy 2D array by second column?<p>I am currently working on a computer vision project with python and openCV. I have a 2D numpy array like this:</p> <pre><code> [100 38 18] [134 332 16] [136 200 16] [136 288 15] [138 160 17] [138 246 15] [140 76 12] [140 116 12] [142 34 14] <...
<p>Consider reshaping your data into 3d, then use for loop to sort each array and cast back into an np.array</p> <pre><code>np.array([sorted(i, key = lambda x: x[1]) for i in ar.reshape(3, -1, ar.shape[1])]).reshape(ar.shape) array([[100, 38, 18], [136, 200, 16], [134, 332, 16], [138, 160, 1...
How to sort parts of a numpy 2D array by second column?
python|arrays|numpy
-1
75
3
72,305,774
72,305,774
1
true
2022-05-19T13:11:32.990Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sort parts of a numpy 2D array by second column?<p>I am currently working on a computer vision project with python and openCV. I have a 2D numpy array...
72,293,129
How to save pandas dataframe rows as seperate files with the first row fixed for all?<p>I have a DataFrame with multiple columns and rows. The rows are student names with marks and the columns are marking criteria. I want to save the first row (column names) along with each row in seperate files with the name of the st...
<p>Just note that you have to have a unique name to save a file. Otherwise files with the same name will overwrite each other.</p> <pre><code># ````````````````````````````````````````````````````````````````````````` ### create dummy data column1_list = ['John Doe','John Doe','Not John Doe','special ß ß %&amp;^ charac...
How to save pandas dataframe rows as seperate files with the first row fixed for all?
python|pandas|dataframe
1
75
1
72,293,695
72,293,695
1
true
2022-05-18T16:51:20.300Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to save pandas dataframe rows as seperate files with the first row fixed for all?<p>I have a DataFrame with multiple columns and rows. The rows are stude...
72,248,000
Python Script won't run against all files, and won't end when I hit Ctrl-C<p>I'm new to Python, and I'm having a problem with executing some code with Watchdog. The code is supposed to copy files to their respective folders when they're modified or created. It will work against one file, but then it quits if there a...
<p>I don't know if I resolve all problems but:</p> <hr /> <p><code>listdir()</code> gives filenames without directory and you have to use <code>os.path.join()</code> even when you check <code>os.path.exists()</code></p> <pre><code>if os.path.exists( os.path.join(sourcepath, file) ): </code></pre> <hr /> <p><code>listdi...
Python Script won't run against all files, and won't end when I hit Ctrl-C
python|python-watchdog
0
75
1
72,248,848
72,248,848
1
true
2022-05-15T11:52:04.913Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Script won't run against all files, and won't end when I hit Ctrl-C<p>I'm new to Python, and I'm having a problem with executing some code with Watchd...
72,293,913
Is there a good, readable way to define simple nested classes in C#<p>I'm an experienced C# software engineer. I've read the docs and dug through blogs. I suspect the answer is &quot;No, C# doesn't support that&quot;, but it's worth asking here:</p> <p>Suppose I have a JSON data description like this:</p> <pre><code>{ ...
<p>You're confounding two different concepts. The JSON you included is defining the <em>object</em>. The C# equivalent of this might look like this, using anonymous types:</p> <pre><code>new { data = new { name = new { first_name = &quot;Fred&quot;, last_name = &quot;Smit...
Is there a good, readable way to define simple nested classes in C#
c#|json
1
75
3
72,294,090
72,294,090
1
true
2022-05-18T17:58:17.187Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a good, readable way to define simple nested classes in C#<p>I'm an experienced C# software engineer. I've read the docs and dug through blogs. I su...
72,244,371
Get start date of event, format it and then display it with a shortcode<p>I have an [essential grid] grid which goes through some [the events calendar] events. Now in each of those items, I want to display the event start date but when I use the relevant meta key as a parameter source in the grid item, I get the defaul...
<p>You could pass the event ID through to the shortcode. The global <code>$post</code> will not retrieve the post object whilst inside a shortcode function.</p> <p>Use the shortcode like this</p> <p><code>[tribe-start-date event=123]</code></p> <pre><code>function tribe_start_date_shortcode( $atts ) { $atts = short...
Get start date of event, format it and then display it with a shortcode
php|wordpress
1
75
1
72,247,509
72,247,509
1
true
2022-05-14T22:49:09.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get start date of event, format it and then display it with a shortcode<p>I have an [essential grid] grid which goes through some [the events calendar] event...
72,284,681
When month picker value is changed my day picker value will change in number picker using xamarin C#<p>This is my code, I would like when month value is changed my day picker value will change. Day value is depends on month. Like, if month value is 1,3,5,7,8,10,12 then day value will 31 otherwise day value 30. If month...
<p>You can add a ValueChanged event to the monthPicker. Such as:</p> <pre><code> var month = new List&lt;int&gt;() {1,3,5,7,8,10,12 }; monthPicker.ValueChanged += (s, e) =&gt; { if(month.Contains(monthPicker.Value)) { dayPicker.MaxV...
When month picker value is changed my day picker value will change in number picker using xamarin C#
c#|visual-studio|xamarin|xamarin.android
0
75
1
72,285,108
72,285,108
1
true
2022-05-18T07:15:35.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When month picker value is changed my day picker value will change in number picker using xamarin C#<p>This is my code, I would like when month value is chan...
72,334,956
Count the number of matches in an array in BigQuery<p>How I can count the number of matches in an array? For example, for numbers [1,3] in the array [1,2,3] there will be 2 matches, and for the array [1,2] there will be 1 match. Right now I can only check if [1,3] is in the array or not.</p> <pre><code> WITH `arrays`...
<p>Using a math, following seems to be possible:</p> <ul> <li>If union of <code>arr</code> and <code>numbers</code> is same as <code>arr</code>, it will be <code>numbers is in array</code></li> <li>If union of <code>arr</code> and <code>numbers</code> is greater than <code>arr</code>, elements as much as the increased ...
Count the number of matches in an array in BigQuery
sql|google-bigquery
3
75
2
72,335,689
72,335,689
1
true
2022-05-22T05:13:07.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Count the number of matches in an array in BigQuery<p>How I can count the number of matches in an array? For example, for numbers [1,3] in the array [1,2,3]...
72,322,834
How to calculate sumproduct in pandas by column?<p>I have a dataframe:</p> <pre><code>ID 2000-01 2000-02 2000-03 2000-04 2000-05 val 1 2847 2861 2875 2890 2904 94717 2 1338 1343 1348 1353 1358 70105 3 3301 3311 3321 3331 3341 60307 4 1425 1422 1419 1416 ...
<p>You can do this, assuming ID is not in the index:</p> <pre><code> df.loc[5, :] = df.iloc[:,1:-1].mul(df['val'], axis=0).sum() </code></pre> <p>Output:</p> <pre><code> ID 2000-01 2000-02 2000-03 2000-04 2000-05 val 0 1.0 2847.0 2861.0 2875.0 2890.0 2904....
How to calculate sumproduct in pandas by column?
python|python-3.x|pandas|dataframe
0
75
4
72,323,025
72,323,025
1
true
2022-05-20T17:38:31.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to calculate sumproduct in pandas by column?<p>I have a dataframe:</p> <pre><code>ID 2000-01 2000-02 2000-03 2000-04 2000-05 val 1 2847 2861 287...
72,379,885
More time efficient manner to implement code?<p>Is there a more time efficient manner to implement the following toy code, i.e., is their a numpy function (or whatever) I can use instead of the nested for loops?</p> <pre><code>import numpy as np import time x =np.asarray([[0.13528165, 0.75680003, 0.34140618, 0.2722093...
<p>Working out this from reading your code:</p> <p>First, cast your cluster labels and your centroids as arrays</p> <pre class="lang-py prettyprint-override"><code>clusters = np.array([0, 0, 1, 0, 1, 1, 1, 0, 0, 1]) centroids = np.array([[0.29219793, 0.31940793, 0.34953051, 0.43480875], [0.74277803, 0.56695522, 0.862...
More time efficient manner to implement code?
python|python-3.x|numpy
0
75
1
72,380,155
72,380,155
1
true
2022-05-25T14:51:25.857Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: More time efficient manner to implement code?<p>Is there a more time efficient manner to implement the following toy code, i.e., is their a numpy function (o...
72,324,294
How can I temporarily hide a specific index in an array?<p>I'm making a black jack game. My <code>AI</code> and <code>Player</code> classes both contain an arraylist that takes in all the cards they currently hold. However, I do not want to reveal the first card the dealer draws until later.</p> <p>This is what it look...
<p>A card couldn't be shared between a dealer and a player, and therefore could carry with itself the state whether it should be visible.</p> <p>Your code could look like something..</p> <pre><code>import java.util.ArrayList; import java.util.Arrays; import java.util.List; class Application { public static class Ca...
How can I temporarily hide a specific index in an array?
java
0
75
3
72,324,763
72,324,763
1
true
2022-05-20T20:05:25.030Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I temporarily hide a specific index in an array?<p>I'm making a black jack game. My <code>AI</code> and <code>Player</code> classes both contain an a...
72,241,763
Why the result of categorical cross entropy in tensorflow different from the definition?<p>I am testing outcomes of <code>tf.keras.losses.CategoricalCrossEntropy</code>, and it gives me values different from the definition. My understanding of cross entropy is:</p> <pre><code> def ce_loss_def(y_true, y_pred): retur...
<p>I found out what the problem was. The vector elements get scaled automatically somehow, to sum up to 1 because the values are probabilities.</p> <pre><code>import tensorflow as tf ce_loss = tf.keras.losses.CategoricalCrossentropy() pred = [0.05, 0.2, 0.25, 0.5] target = [0, 0, 0, 1] pred = tf.constant(pred, dtype ...
Why the result of categorical cross entropy in tensorflow different from the definition?
keras|tensorflow2.0|tf.keras|cross-entropy
0
75
1
72,242,174
72,242,174
1
true
2022-05-14T15:43:48.680Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why the result of categorical cross entropy in tensorflow different from the definition?<p>I am testing outcomes of <code>tf.keras.losses.CategoricalCrossEnt...
72,329,100
How to link a string key to a function in a c# dictionary<p>I am currently programming using Unity and C#, and I have trouble linking a string value to a function using a dictionary.</p> <p>I think of a code looking like this :</p> <pre><code>private string name; void function1() { // code } private Dicti...
<p>You use Action e.g. Action&lt;input type1, input type 2&gt; if not returning a value, and Func&lt;input type1, input type2, output type&gt; to return a value. Both are defined with multiple numbers of inputs. So you could do Func&lt;int,int,int,bool&gt; for example, and Action&lt;int,int,bool,string,string&gt;</p...
How to link a string key to a function in a c# dictionary
c#|unity3d
1
75
3
72,330,296
72,330,296
1
true
2022-05-21T11:24:23.263Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to link a string key to a function in a c# dictionary<p>I am currently programming using Unity and C#, and I have trouble linking a string value to a fun...
72,392,889
Replace jQuery visibility and opacity animation with pure Javascript<p>I'm trying to remove jQuery from an old website but I'm stuck with this animation they have.</p> <p>I can only replicate the opacity fade, but I don't seem able to transition the visibility slowly it just goes 1 or 0, how can I do both thing smoothl...
<p>The simplest (and by far the most performant) option here is to use CSS for animations. JS animation should be avoided as much as possible as it's slow and not hardware accelerated.</p> <p>To do what you require in CSS the key rule to apply is <code>transition</code>. You can use this to control the properties to be...
Replace jQuery visibility and opacity animation with pure Javascript
javascript|jquery|css
0
75
1
72,393,160
72,393,160
1
true
2022-05-26T13:47:06.840Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace jQuery visibility and opacity animation with pure Javascript<p>I'm trying to remove jQuery from an old website but I'm stuck with this animation they...
72,308,314
xmonad doesnt recognize the Spotify Window<p>my ManageHook doesn't recognize the Spotify Window, so i can't automatically move it to the Workspace I want it to be opened in. It works fine with every other Window, except Spotify.</p> <p>Heres my Managehook:</p> <pre><code>myManageHook :: XMonad.Query (Data.Monoid.Endo W...
<p>Similar issue on Reddit was asked <a href="https://www.reddit.com/r/xmonad/comments/q7i569/spotify_workspace_shift_issue/" rel="nofollow noreferrer">here</a>, where an answer suggests the links below.</p> <p>Briefly said, it helps to use <a href="https://hackage.haskell.org/package/xmonad-contrib-0.16/docs/XMonad-Ho...
xmonad doesnt recognize the Spotify Window
spotify|xmonad
2
75
1
72,361,373
72,361,373
1
true
2022-05-19T16:48:50.817Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: xmonad doesnt recognize the Spotify Window<p>my ManageHook doesn't recognize the Spotify Window, so i can't automatically move it to the Workspace I want it ...
72,318,621
applying str_split_fixed function simultaneously across multiple columns in r<p>I have a data frame which is having multiple columns each column is having string values. I want to split column values by coma separator in the output data frame. Input and required output are as below</p> <pre><code>Col1=c(&quot;a,b,c&quo...
<p>The package <code>splitstackshape</code> is made for such operations,</p> <pre><code>library(splitstackshape) cSplit(Input, names(Input), type.convert = 'as.is') # Col1_1 Col1_2 Col1_3 Col2_1 Col2_2 Col2_3 Col3_1 Col3_2 Col3_3 #1: a b c c b e e f g #2: 9 a ...
applying str_split_fixed function simultaneously across multiple columns in r
r|split|stringr
1
75
3
72,318,722
72,318,722
1
true
2022-05-20T12:03:08.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: applying str_split_fixed function simultaneously across multiple columns in r<p>I have a data frame which is having multiple columns each column is having st...
72,244,537
SQL Segmentation<p>I have this table</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align: left;">Customer</th> <th style="text-align: center;">Amount</th> <th style="text-align: right;">Date</th> <th style="text-align: right;">Period</th> <th style="text-align: right;">Group</...
<p>You can use window function such as <code>MAX() OVER ()</code> with conditionals for values of <code>Period</code> column such as</p> <pre class="lang-sql prettyprint-override"><code>SELECT *, MAX(CASE WHEN Period=1 THEN `Group` END) OVER (PARTITION BY Customer) AS Group_Period1, MAX(CASE ...
SQL Segmentation
sql|sql-server
0
75
2
72,248,483
72,248,483
2
true
2022-05-14T23:33:04.513Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL Segmentation<p>I have this table</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align: left;">Customer</th> <th...
72,271,006
Task.WhenAny - alternative to List avoiding O(N²) issues<p>I've been trying to improve my understanding and usage of <code>async</code> code in C#, specifically how to integrate it into existing synchronous code.</p> <p>I have the following test program, which is basically the test from <a href="https://docs.microsoft....
<blockquote> <p>So would this minor change to a <code>Dictionary</code> fix this and leave the whole thing as an O(n) operation?</p> </blockquote> <p>No. Searching a <code>List&lt;T&gt;</code> is indeed a O(n) operation, but eliminating this operation does not eliminate <em>all</em> O(n) operations that are happening i...
Task.WhenAny - alternative to List avoiding O(N²) issues
c#|optimization|async-await
1
75
1
72,276,921
72,276,921
2
true
2022-05-17T08:54:47.577Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Task.WhenAny - alternative to List avoiding O(N²) issues<p>I've been trying to improve my understanding and usage of <code>async</code> code in C#, specifica...
72,244,418
Cannot Set CORS with Blazegraph (localhost:9999, Jetty) for Access from Another Port (localhost:600, http-server)<p>I've been running <a href="https://www.mediawiki.org/wiki/Wikibase/Installation" rel="nofollow noreferrer">MediaWiki with Wikibase</a>, the <a href="https://www.mediawiki.org/wiki/Wikidata_Query_Service/I...
<p>I finally figured it out, by adding a proxy into <code>/etc/apache2/sites-enabled/000-default.conf</code>, as follows:</p> <pre><code>&lt;VirtualHost *:9000&gt; Header add Access-Control-Allow-Origin &quot;*&quot; ProxyPreserveHost On ProxyPass / http://127.0.0.1:9999/ ProxyPassReverse / http://127...
Cannot Set CORS with Blazegraph (localhost:9999, Jetty) for Access from Another Port (localhost:600, http-server)
cors|jetty|httpserver|same-origin-policy|blazegraph
2
75
1
72,319,469
72,319,469
2
true
2022-05-14T23:00:47.607Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot Set CORS with Blazegraph (localhost:9999, Jetty) for Access from Another Port (localhost:600, http-server)<p>I've been running <a href="https://www.me...
72,329,343
How to add +1 to a python variable every day?<p>I have three variables</p> <p>a = 1</p> <p>b = 2</p> <p>c = 3</p> <p>Every day, I need to add 1 to each variable</p> <p>a = a + 1 (so a=2)</p> <p>b = b + 1</p> <p>c = c + 1</p> <p>But I need that when tomorrow I run the script, to add 1 unit more:</p> <p>a = a + 2 (so tom...
<p>Choose some fixed reference date, and when the code runs, calculate the number of days from the reference date, adjust by some constant offset, and add that to your variables. So, maybe I choose 1/1/2022 as my reference date and an offset of 100 days. This means on 100 days after 1/1/2022 the variables don't get inc...
How to add +1 to a python variable every day?
python|numpy|date
1
75
1
72,329,367
72,329,367
2
true
2022-05-21T11:59:46.483Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add +1 to a python variable every day?<p>I have three variables</p> <p>a = 1</p> <p>b = 2</p> <p>c = 3</p> <p>Every day, I need to add 1 to each varia...
72,346,758
Where to find the intended boot sequence of an MCU<p>I have worked with STM, NXP and Atmel MCUs, but all the time during board bring up, we use the vendor provided startup script to bring up the hardware. I know we do that because we do not want to be rewriting the linker script and startup sequence from scratch, which...
<p>Chip vendors don't typically dictate such things; it is application specific - i.e. up to you how you use the chip. Often it is &quot;documented&quot; by example/reference code rather then explicitly described.</p> <p>That said there are some general principles:</p> <p>There will be hardware initialisation which wi...
Where to find the intended boot sequence of an MCU
arm|embedded|stm32|reset|bootloader
4
75
1
72,347,924
72,347,924
2
true
2022-05-23T10:08:44.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where to find the intended boot sequence of an MCU<p>I have worked with STM, NXP and Atmel MCUs, but all the time during board bring up, we use the vendor pr...
72,350,721
Laravel 9 with argument 2 must be of type ?callable, string given<p>I'm following a tutorial. In the controller I'm using with to send a success message.</p> <pre><code> public function store(Request $request) { $request-&gt;validate([ 'recipe' =&gt; 'required', 'rating' =&gt; 'required', ]); ...
<p>You missed arrow:</p> <pre class="lang-php prettyprint-override"><code>return redirect()-&gt;route('recipes.index') -with('success', 'Recipe created successfully'); </code></pre> <p>Should be:</p> <pre class="lang-php prettyprint-override"><code>return redirect()-&gt;route('recipes.index') -&gt;with(...
Laravel 9 with argument 2 must be of type ?callable, string given
php|laravel
0
75
1
72,350,770
72,350,770
2
true
2022-05-23T15:00:58.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel 9 with argument 2 must be of type ?callable, string given<p>I'm following a tutorial. In the controller I'm using with to send a success message.</p>...
72,362,314
Bash script that counts and prints out the files that start with a specific letter<p><strong>How do i print out all the files of the current directory that start with the letter &quot;k&quot; ?Also needs to count this files.</strong></p> <p>I tried some methods but i only got errors or wrong outputs. Really stuck on th...
<p>Try this <a href="https://www.shellcheck.net/" rel="nofollow noreferrer">Shellcheck</a>-clean pure POSIX shell code:</p> <pre><code>count=0 for file in k*; do if [ -f &quot;$file&quot; ]; then printf '%s\n' &quot;$file&quot; count=$((count+1)) fi done printf 'count=%d\n' &quot;$count&quot; </...
Bash script that counts and prints out the files that start with a specific letter
linux|bash
0
75
4
72,364,339
72,364,339
2
true
2022-05-24T11:45:14.683Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bash script that counts and prints out the files that start with a specific letter<p><strong>How do i print out all the files of the current directory that s...
72,370,395
Asserting localStorage value is always null<p>I am building a web application using React JS. I am writing integration tests for my application using Cypress. Now I am writing a test to assert the value in the localStorage. But the localStorage value is always returning null even though the application actually stores ...
<p>The line <code>expect(localStorage.getItem('access_token')).to.eq(accessToken)</code> is synchronous, all the others are asynchronous, so it has already run before the login completes.</p> <p>Try adding a <code>.then()</code></p> <pre class="lang-js prettyprint-override"><code>cy.location('pathname').should('eq', '/...
Asserting localStorage value is always null
local-storage|cypress
2
75
1
72,370,671
72,370,671
2
true
2022-05-24T23:14:10Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Asserting localStorage value is always null<p>I am building a web application using React JS. I am writing integration tests for my application using Cypress...
72,400,144
Is JVM working memory the same as CPU cache<p>The <a href="https://docs.oracle.com/javase/specs/jvms/se6/html/Threads.doc.html#22197" rel="nofollow noreferrer">JVM spec</a> says that each thread has its own working memory and lists several operations including use, assign, load, read, store, write, lock, unlock. Is wor...
<p>You are looking at the oldest specification that is <a href="https://docs.oracle.com/javase/specs/index.html" rel="nofollow noreferrer">still online at Oracle</a> (at the bottom of the page). We’re talking about nothing less than 16 years having passed since the release of this document. But even within the outdated...
Is JVM working memory the same as CPU cache
java|jvm|specifications|java-memory-model
0
75
2
72,432,572
72,432,572
2
true
2022-05-27T03:25:54.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is JVM working memory the same as CPU cache<p>The <a href="https://docs.oracle.com/javase/specs/jvms/se6/html/Threads.doc.html#22197" rel="nofollow noreferre...
72,300,721
How to sort diferent type of lists with template in C++<p>In my homework my task is to create the FooCl class for these:</p> <pre><code> double d[] = {1.3, 0.7, 2.4, 1.5, 6.2, 5.7, 8.6, 9.1}; FooCl&lt;double&gt; itemsD(d, sizeof(d) / sizeof(d[0])); std::string s[] = {&quot;C++&quot;, &quot;Haskell&quot;, &q...
<p>One way is to use <a href="https://en.cppreference.com/w/cpp/algorithm/sort" rel="nofollow noreferrer"><code>std::sort</code></a> as shown below:</p> <pre><code>void mySort() { //--vvvvvvvvv------------------------------------&gt;use std::sort std::sort(mItems, mItems + mItemsSize); } </code></pre> <p>You can ev...
How to sort diferent type of lists with template in C++
c++|list|class|sorting|templates
0
75
3
72,300,795
72,300,795
2
true
2022-05-19T07:56:30.500Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sort diferent type of lists with template in C++<p>In my homework my task is to create the FooCl class for these:</p> <pre><code> double d[] = {1.3...
72,303,663
Detect infinite fraction in javascript<p>Infinite fraction: 1/3, 2/3, pie, etc.</p> <p>Non-infinite fractions: 1/2, 1/5, 1/10, etc.</p> <p>How can I detect when a a number is an infinitely fraction?</p>
<p>Interesting question.</p> <p>Carefully following the wisdom laid out in this <a href="https://math.stackexchange.com/questions/197478/detecting-that-a-fraction-is-a-repeating-decimal">question on math.stackexchange.com</a>, I think the following should do the trick for an <a href="https://en.wikipedia.org/wiki/Fract...
Detect infinite fraction in javascript
javascript|math
0
75
3
72,304,204
72,304,204
2
true
2022-05-19T11:23:06.697Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Detect infinite fraction in javascript<p>Infinite fraction: 1/3, 2/3, pie, etc.</p> <p>Non-infinite fractions: 1/2, 1/5, 1/10, etc.</p> <p>How can I detect w...
72,398,165
Why doesn't the thread execute, or does it execute?<p>I am trying to make a multithreaded random number generator for the command line interface, and for that I use TThreads to use multiple cpu cores to make random numbers. My program works till I try to start a thread, as it seemingly starts but, as far as I can tell,...
<p>There are a number of problems with your threads:</p> <ul> <li><p><code>threads[i].create(true);</code> is the wrong way to create the thread objects. You need to use <code>threads[i] := TMyThread.Create(true);</code> instead.</p> </li> <li><p>you are creating each thread with <code>CreateSuspended=True</code>, but ...
Why doesn't the thread execute, or does it execute?
pascal|freepascal
-1
75
1
72,398,228
72,398,228
2
true
2022-05-26T21:24:42.127Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why doesn't the thread execute, or does it execute?<p>I am trying to make a multithreaded random number generator for the command line interface, and for tha...
72,299,119
Python: Recreate file path with shorter name(s)?<p>D:\MyDir contains a huge number of directories with or without subdirectories which may or may not contain one or more files.</p> <p>Some of them have very long name +/- very long name for the subdirectories and/or file(s) too which leads to a huge path name for that f...
<p>You could traverse each folder that you wanted to change to the bottom level. Move each file at the bottom up two levels and change their names. Then remove any empty folders on your way back up. Then finally change the name of the directory itself.</p> <p>Here is an example. Without knowing what your planning on r...
Python: Recreate file path with shorter name(s)?
python|python-3.x|shutil
2
75
1
72,299,972
72,299,972
2
true
2022-05-19T05:35:21.577Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: Recreate file path with shorter name(s)?<p>D:\MyDir contains a huge number of directories with or without subdirectories which may or may not contain...
72,303,281
Mutating columns with reduce2 and rlang<p>I am trying the following:</p> <pre class="lang-r prettyprint-override"><code>library(tidyverse) library(rlang) df &lt;- data.frame(a = 1:2) reduce2(list(df, df, df), letters[2:3], ~ mutate(.x, !!(.y) := 2:3)) #&gt; Error in local_error_context(dots = dots, .index = i, mask =...
<p>I don't think <code>reduce2</code> is the correct function here, since you aren't actually using any items an the list of data frames after the first iteration. The function that is passed to <code>reduce2</code> takes three arguments - the first is the object being reduced, the second is the next item in <code>.x</...
Mutating columns with reduce2 and rlang
r|purrr|rlang
2
75
3
72,303,858
72,303,858
2
true
2022-05-19T10:55:04.657Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mutating columns with reduce2 and rlang<p>I am trying the following:</p> <pre class="lang-r prettyprint-override"><code>library(tidyverse) library(rlang) df...
72,335,138
What does 'o = o or {}' do in Lua?<p>As I understand from docs, we don't have classes in Lua. Lua does not have the concept of class; each object defines its own behavior and has a shape of its own.</p> <p>So a simple emulation of classes in Lua, following the lead from prototype-based languages, such as Self and Newto...
<p>For the first line, see Vlads answer.</p> <p><code>setmetatable(o, self)</code> assigns <code>self</code> as the <a href="https://www.lua.org/pil/13.html" rel="nofollow noreferrer">metatable</a> of <code>o</code>. <code>self</code> can now contain a set of metamethods to add functionality to <code>o</code> (see link...
What does 'o = o or {}' do in Lua?
class|object|oop|lua|prototype
2
75
2
72,335,701
72,335,701
2
true
2022-05-22T05:55:28.880Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does 'o = o or {}' do in Lua?<p>As I understand from docs, we don't have classes in Lua. Lua does not have the concept of class; each object defines its...
72,396,391
compile-time variable-length objects based on string<h2>Related SO questions:</h2> <ul> <li><a href="https://stackoverflow.com/questions/47429767/how-can-i-have-a-compile-time-const-object-configured-with-a-chunk-of-data-of-va">variable size struct</a></li> <li><a href="https://stackoverflow.com/questions/66907778/comp...
<p>Adding a <a href="https://en.cppreference.com/w/cpp/language/class_template_argument_deduction" rel="nofollow noreferrer">CTAD</a> to <code>UsbDescrString</code> should be enough</p> <pre><code>template&lt;size_t N&gt; struct UsbDescrString final: UsbDescrStd { char str[N * 2]; constexpr UsbDescrString(cons...
compile-time variable-length objects based on string
c++|templates|c++20|constexpr
0
75
1
72,399,728
72,399,728
2
true
2022-05-26T18:23:17.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: compile-time variable-length objects based on string<h2>Related SO questions:</h2> <ul> <li><a href="https://stackoverflow.com/questions/47429767/how-can-i-h...
72,293,977
Assign Column Value to Column Names and Pivot it & Group Them<p>I am sorry for the messy title, I don't know how to describe it. Anyways, this is my current dataframe (1. Dataframe):</p> <pre><code># A tibble: 6 x 14 # Groups: Full.Name [3] Full.Name year `1` `2` `3` `4` `5` `6` `7` `8` ...
<pre><code>xx &lt;- structure(list(Full.Name = c(&quot;A. Patrick Beharelle&quot;, &quot;A. Patrick Beharelle&quot;, &quot;A. Patrick Beharelle&quot;, &quot;A. Patrick Beharelle&quot;, &quot;A. Patrick Beharelle&quot; ), month = c(1, 1, 2, 2, 3), year = c(2019, 2020, 2019, 2020, 2019), counter = c(556L, 220L, 577L, 213...
Assign Column Value to Column Names and Pivot it & Group Them
r|dataframe|dplyr|tidyverse|tidyr
0
75
5
72,294,088
72,294,088
3
true
2022-05-18T18:03:49.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Assign Column Value to Column Names and Pivot it & Group Them<p>I am sorry for the messy title, I don't know how to describe it. Anyways, this is my current ...
72,277,537
How to edit a color scheme?<p>I am using Altair for Python and my current heatmap code uses a redyellowblue color scheme (A) that uses yellow as the middle color. I am trying to edit this color scheme in order to achieve the scheme on (B), which the only difference is replacing yellow with white as the middle color. Do...
<p>You probably want <code>interpolate='rgb'</code> when defining your own <code>range</code>.Using the <code>interpolate</code> property for the color scale you can define one of the interpolation methods as is defined by d3-interpolate, <a href="https://github.com/d3/d3-interpolate#color-spaces" rel="nofollow norefer...
How to edit a color scheme?
python|altair|vega-lite
0
75
1
72,321,239
72,321,239
3
true
2022-05-17T16:21:37.870Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to edit a color scheme?<p>I am using Altair for Python and my current heatmap code uses a redyellowblue color scheme (A) that uses yellow as the middle c...
72,329,026
compute median every 12 values<pre><code>ex_array = [-8.23294593e-02, -4.07239507e-02, 6.08131029e-02, 2.72433402e-02, -4.73587631e-02, 5.15452252e-02, 1.32902476e-01, 1.22322232e-01, 2.71845990e-02, -1.16927038e-01, -2.62239877e-01, -1.46526396e-01, -1.82859136e-01, -1.02089602e-01, -1.91863501e-04, -5....
<p>Let us use <code>numpy</code> operations:</p> <pre><code>np.median(np.reshape(ex_array, (12, -1), 'F'), axis=1) </code></pre> <hr /> <pre><code>array([-0.08017496, -0.04771155, 0.06031283, -0.00385278, -0.03095536, 0.06283668, 0.15979743, 0.14921719, 0.06285071, -0.08965355, -0.21959495, -0.080840...
compute median every 12 values
python|arrays|pandas|slice
2
75
2
72,329,169
72,329,169
3
true
2022-05-21T11:13:41.393Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: compute median every 12 values<pre><code>ex_array = [-8.23294593e-02, -4.07239507e-02, 6.08131029e-02, 2.72433402e-02, -4.73587631e-02, 5.15452252e-02,...
72,312,239
How to write a pandoc reader with Python<p>I've been searching for a way to write a pandoc reader (not a filter) with Python. But could not find any.</p> <p>I mean a <code>Reader</code> as documented in <a href="https://hackage.haskell.org/package/pandoc-2.18/docs/Text-Pandoc-Readers.html" rel="nofollow noreferrer">Tex...
<p>A &quot;reader&quot; usually refers to any program that parses a file into pandoc's internal document representation. Both compiled-in readers written in Haskell as well as custom Lua readers create the document elements directly; this is not possible with any other method.</p> <p>However, it would be possible to do...
How to write a pandoc reader with Python
python|pandoc
1
75
1
72,330,635
72,330,635
3
true
2022-05-20T00:05:42.073Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to write a pandoc reader with Python<p>I've been searching for a way to write a pandoc reader (not a filter) with Python. But could not find any.</p> <p>...
72,386,746
Matrix from cv2.getPerspectiveTransform does not transform points appropriately<p>The <a href="https://docs.opencv.org/4.x/da/d54/group__imgproc__transform.html#ga20f62aa3235d869c9956436c870893ae" rel="nofollow noreferrer">function</a> <code>cv2.getPerspectiveTransform</code> calculates the 3x3 matrix of a perspective ...
<p>You can use cv2.perspectiveTransform to transform points.</p> <p>If you want to do this manually, by multiplying (x,y,1) with the 3x3 transformation matrix, make sure that you divide the result by its z value, so it will be (x',y',1) and is a homogeneous point representation.</p>
Matrix from cv2.getPerspectiveTransform does not transform points appropriately
python|opencv|image-processing|matrix
2
75
1
72,387,659
72,387,659
3
true
2022-05-26T04:37:14.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Matrix from cv2.getPerspectiveTransform does not transform points appropriately<p>The <a href="https://docs.opencv.org/4.x/da/d54/group__imgproc__transform.h...
72,244,488
ASP.NET Core - Entity Framework Core - Drop Down List - DbContext SaveChanges Issue<p>I'm new to using EF as well as ASP.NET Core. I'm working on a simple web application and I am getting an error when I go to save a new record. When the DbContext.SaveChanges() gets called, I get an error that states:</p> <p>&quot;Ca...
<p>Probably <code>Client</code> class should be:</p> <pre class="lang-cs prettyprint-override"><code>public class Client { public int ID { get; set; } public Person Person { get; set; }// = new Person(); public int ContactTypeID { get; set; } public ContactType ContactType { get; set; }// = new Conta...
ASP.NET Core - Entity Framework Core - Drop Down List - DbContext SaveChanges Issue
c#|asp.net-core|entity-framework-core
1
75
1
72,245,824
72,245,824
3
true
2022-05-14T23:18:05.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ASP.NET Core - Entity Framework Core - Drop Down List - DbContext SaveChanges Issue<p>I'm new to using EF as well as ASP.NET Core. I'm working on a simple w...
72,366,387
"else" block is executed every time even after the "if" statement is true<p>In the delete function, the <code>else</code> part is executed every time even after the <code>if</code> statement is true. How can I solve that problem?</p> <pre><code>#include&lt;stdio.h&gt; #include&lt;stdlib.h&gt; #define MAX 10 int front=-...
<p>You need to use a compound statement as for example</p> <pre><code>else { v=Q[front]; front++; printf(&quot;Your deleted number is:%d\n&quot;,v); } </code></pre> <p>Other wise this code snippet</p> <pre><code>else v=Q[front]; front++; printf(&quot;Your deleted number is:%d\n&quot;,v); </code></pre> <p>is...
"else" block is executed every time even after the "if" statement is true
c|if-statement
-3
75
1
72,366,440
72,366,440
3
true
2022-05-24T16:29:30.390Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "else" block is executed every time even after the "if" statement is true<p>In the delete function, the <code>else</code> part is executed every time even af...
72,364,575
Using Win32 GetStringTypeW() in a PowerShell script<p>I'd like to use the Win32 <a href="https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-getstringtypew" rel="nofollow noreferrer">GetStringTypeW()</a> method inside a PowerShell script.</p> <p>I figured out the correct signature in C# and ...
<p>As <a href="https://stackoverflow.com/users/7571258/zett42">zett42</a> points out, in PowerShell you cannot obtain a reference to an individual element of a value-type array, as discussed in <a href="https://stackoverflow.com/a/72364180/7571258">this answer</a>.</p> <p>However, you can simply use an <em>array</em> p...
Using Win32 GetStringTypeW() in a PowerShell script
powershell|powershell-5.1
1
75
1
72,366,406
72,366,406
3
true
2022-05-24T14:19:19.610Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Win32 GetStringTypeW() in a PowerShell script<p>I'd like to use the Win32 <a href="https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-s...
72,331,841
How to bootstrap interface method reference with ObjectWeb2 ASM<p>I am trying to fix the metafactory call for an interface method reference in Groovy: <a href="https://issues.apache.org/jira/browse/GROOVY-9853" rel="nofollow noreferrer">https://issues.apache.org/jira/browse/GROOVY-9853</a></p> <p>Given small Java progr...
<p>You are right, this is a bug in the Groovy compiler, caused by the wrong use of the <code>tag</code> and <code>isInterface</code> parameter.</p> <p>Let's start with the <code>isInterface</code> parameter:</p> <p>This parameter is true if and only if the owner class (also a parameter of the <code>Handle</code> constr...
How to bootstrap interface method reference with ObjectWeb2 ASM
java|groovy|java-bytecode-asm|invokedynamic
3
75
1
72,332,619
72,332,619
3
true
2022-05-21T17:30:28.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to bootstrap interface method reference with ObjectWeb2 ASM<p>I am trying to fix the metafactory call for an interface method reference in Groovy: <a hre...
72,268,638
How to assign Keys to Variables in pyqt5?<p>How to assign Keys to Variables in pyqt5?</p> <pre><code>def keyPressEvent(self, event): var = &quot;Qt.Key_F&quot; if event.key() == var: print(&quot;you press key F&quot;) </code></pre> <p><strong>Edit-:</strong> For more and clear pictures, add the followi...
<p>I think this is an <a href="https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem">XY problem</a>. Your goal is to detect which letter is pressed and perform some action if it matches the value of a variable, if so the solution is to use event.text():</p> <pre class="lang-py prettyprint-override"><co...
How to assign Keys to Variables in pyqt5?
python|pyqt|pyqt5
0
75
2
72,270,339
72,270,339
3
true
2022-05-17T05:35:31.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to assign Keys to Variables in pyqt5?<p>How to assign Keys to Variables in pyqt5?</p> <pre><code>def keyPressEvent(self, event): var = &quot;Qt.Key_F...
72,296,089
i'm making a console game (on cmd), when i touch the screen with my mouse. how do i make it ignore the mouse clicks<blockquote> <p>literally just that. <a href="https://i.stack.imgur.com/nuZuc.png" rel="nofollow noreferrer">in this pic</a> when i clicked here. the car stopped coming down.</p> </blockquote> <p>you can f...
<p>In your console options (the top left button), go to Properties and turn off the &quot;QuickEdit Mode&quot; setting. This is a Windows feature where clicking the mouse suspends whatever program is running and lets you select text from the screen. You don't want that for your program.</p>
i'm making a console game (on cmd), when i touch the screen with my mouse. how do i make it ignore the mouse clicks
c++
0
75
1
72,296,137
72,296,137
3
true
2022-05-18T21:17:12.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: i'm making a console game (on cmd), when i touch the screen with my mouse. how do i make it ignore the mouse clicks<blockquote> <p>literally just that. <a hr...
72,345,202
How to change random index positions in numpy array<p>I have a numpy array that looks like this:</p> <pre><code>array([[0.5, 0.2, 0.6], [0.8, 0.1, 0.3], [0.4, 0.5, 0.4], [0.3, 0.2, 0.9]]) </code></pre> <p>I want to change 50% of the values in the 3rd column into a random value. How can I do this ef...
<p>Try this</p> <pre><code>arr = np.array([[0.5, 0.2, 0.6], [0.8, 0.1, 0.3], [0.4, 0.5, 0.4], [0.3, 0.2, 0.9]]) # randomly select rows rows = np.random.choice(4, size=2, replace=False) # replace values in the last column with random values arr[rows, 2] = np.random.rand(2) arr array([[0.5 , 0.2 , 0.81496687...
How to change random index positions in numpy array
python|numpy
-2
75
3
72,345,313
72,345,313
3
true
2022-05-23T08:09:13.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change random index positions in numpy array<p>I have a numpy array that looks like this:</p> <pre><code>array([[0.5, 0.2, 0.6], [0.8, 0.1, 0.3...
72,380,108
select nth child from 2 levels up<p>I have an html structure like this:</p> <pre><code>&lt;div class='parent'&gt; &lt;div class='row'&gt; &lt;div class='button'&gt; button &lt;/div&gt; &lt;div class='button'&gt; button &lt;/div&gt; &lt;/div&gt; &lt;div class='row'&gt; &lt;div class...
<p>I'm afraid that it is not possible using only CSS. You can archive this using jQuery or pure Javascript :</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>//jQuery $(".button...
select nth child from 2 levels up
html|css
0
75
3
72,380,693
72,380,693
3
true
2022-05-25T15:06:03.320Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: select nth child from 2 levels up<p>I have an html structure like this:</p> <pre><code>&lt;div class='parent'&gt; &lt;div class='row'&gt; &lt;div class...
72,388,838
FALSE vs. F: Error mapply's SIMPLIFY argument: in SIMPLIFY=F<p>This Question refers to this <a href="https://stackoverflow.com/questions/72374654/is-there-a-best-way-to-append-a-list-values-to-a-sublist-of-a-list-in-r">Is there a best way to append a list values to a sublist of a list in R?</a>.</p> <p>One of the solut...
<p>In a fresh R session, this error isn't reproducible:</p> <pre class="lang-r prettyprint-override"><code>a &lt;- list(3,5,7) l &lt;- list(c(1,2,3), c(2,1,4), c(4,7,6)) mapply(c, l, a, SIMPLIFY=F) #&gt; [[1]] #&gt; [1] 1 2 3 3 #&gt; #&gt; [[2]] #&gt; [1] 2 1 4 5 #&gt; #&gt; [[3]] #&gt; [1] 4 7 6 7 </code></pre> <p>...
FALSE vs. F: Error mapply's SIMPLIFY argument: in SIMPLIFY=F
r|list|mapply
3
75
2
72,389,180
72,389,180
4
true
2022-05-26T08:20:59.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: FALSE vs. F: Error mapply's SIMPLIFY argument: in SIMPLIFY=F<p>This Question refers to this <a href="https://stackoverflow.com/questions/72374654/is-there-a-...
72,341,946
TypeError: '<' not supported between instances of 'str' and 'float'<p>I have a simple Python script that queries an API and parses the JSON data. Specifically, I am trying to find all <code>id</code>s that fall into a rectangle based on given latitude and longitude coordinates. I am having some data type issues since o...
<p>Try converting the data to floats like so:</p> <pre><code>lat = float(i['lat']) lon = float(i['lon']) </code></pre> <p>This will allow the comparison operators to work correctly when comparing 2 floats.</p> <p>Keep in mind the operators themselves are wrong (long <code>-179</code> and lat <code>-179</code> would fit...
TypeError: '<' not supported between instances of 'str' and 'float'
python|json|python-3.x
1
75
2
72,341,962
72,341,962
4
true
2022-05-22T23:27:33.283Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeError: '<' not supported between instances of 'str' and 'float'<p>I have a simple Python script that queries an API and parses the JSON data. Specificall...
72,363,633
Center a div in a circle<p>I have a circle in which I can't center the div with text. I tried with flexbox but it doesn't seem to work or I did it wrong.</p> <p>This is the code</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="sn...
<p>You can use <code>display:flex</code>, <code>align-items:center</code> and <code>justify-content:center</code></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.circle{ w...
Center a div in a circle
html|css
3
75
2
72,363,717
72,363,717
5
true
2022-05-24T13:19:43.833Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Center a div in a circle<p>I have a circle in which I can't center the div with text. I tried with flexbox but it doesn't seem to work or I did it wrong.</p>...
72,392,884
Fastest way to check if a list of sets has any containment relationship<p>I hava a list of 10,000 random sets with different lengths:</p> <pre><code>import random random.seed(99) lst = [set(random.sample(range(1, 10000), random.randint(1, 1000))) for _ in range(10000)] </code></pre> <p>I want to know the fastest way t...
<p>Seems to be faster to sort by length and then try small sets as subset first (and for each, try large sets as superset first). Times in ms from ten cases, data generated like you did but without seeding:</p> <pre><code>agree yours mine ratio result True 2.24 2.98 0.75 True True 146.25 3.10 47.19 True ...
Fastest way to check if a list of sets has any containment relationship
python|python-3.x|algorithm|performance|set
4
75
1
72,393,496
72,393,496
6
true
2022-05-26T13:46:25.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fastest way to check if a list of sets has any containment relationship<p>I hava a list of 10,000 random sets with different lengths:</p> <pre><code>import r...
72,331,345
Why my regex inside a function doesn't work in PHP?<p>I've to validate some data in my form, none of them works but i'd like some <strong>help for the username validation</strong> hoping that I can fix the other problems later.</p> <p>So here is <strong>my form</strong>, nothing unusual :</p> <pre class="lang-html pret...
<p>I found the solution with your help. In my validation file I called &quot;<em>database_connection.php</em>&quot;, the variable $username and $password was overwriting my variable in my validation file :</p> <pre><code>&lt;?php $hostname = &quot;localhost&quot;; $database = &quot;db_name&quot;; $userna...
Why my regex inside a function doesn't work in PHP?
php|regex|easyphp
-2
75
4
72,367,030
72,367,030
-1
true
2022-05-21T16:22:34.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why my regex inside a function doesn't work in PHP?<p>I've to validate some data in my form, none of them works but i'd like some <strong>help for the userna...
72,805,874
How can I replace or change object in data?<p>In my table it renders an array of users as rows in a table with <code>&lt;tr v-for=&quot;user in users&quot; :key=&quot;user.id&quot;&gt;</code></p> <p>For the the column roles, instead of getting admin or user. The data is sending a 1 for admin and 2 for user. Is there a ...
<p>One way with computed property:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>new Vue({ el: '#demo', data() { return { users: [], roles: ['admin', 'use...
How can I replace or change object in data?
javascript|vue.js|vuejs2
2
75
5
72,806,002
72,806,002
1
true
2022-06-29T17:53:03.717Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I replace or change object in data?<p>In my table it renders an array of users as rows in a table with <code>&lt;tr v-for=&quot;user in users&quot; :...
72,847,968
Bitmap inside a bitmap<p>I am trying to insert an image 800x500 inside a blank bitmap of 850x610 in the center. The inner image should be in the center and It also has a title on the top. I am attaching an image to illustrate my idea:</p> <p><img src="https://i.stack.imgur.com/bqG3S.png" alt="Bordered Image inside anot...
<p>The below sample sets the new bitmap size, it fills it with a background (black), draws the image in the center and finally after measuring the text will align it in the center (width check only).</p> <pre class="lang-cs prettyprint-override"><code>public static Bitmap AddBorder(Bitmap srcImage, string text) { B...
Bitmap inside a bitmap
c#
0
75
1
72,848,397
72,848,397
1
true
2022-07-03T15:55:47.593Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bitmap inside a bitmap<p>I am trying to insert an image 800x500 inside a blank bitmap of 850x610 in the center. The inner image should be in the center and I...
72,996,687
Run function from text file in Java<p>I want to implement a program that reads a text file and executes every line on it.</p> <p>For example if I have this txt file:</p> <h5>Commands.txt</h5> <pre><code>{ t.getP().getName() t.getP().getAge() t.getP().getLocation() } </code></pre> <p>And the following Java program...
<p>When you use Java Reflection to invoke methods, you need to pass the <em><strong>name</strong></em> of the function <em>without</em> parentheses. If you have methods that require parameters, you pass those parameters to the reflection method, not the method you are invoking.</p> <p>Assuming those methods exist in yo...
Run function from text file in Java
java|parsing|text-files
0
75
2
72,997,006
72,997,006
1
true
2022-07-15T15:55:16.457Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Run function from text file in Java<p>I want to implement a program that reads a text file and executes every line on it.</p> <p>For example if I have this t...
72,920,680
JavaScript recursive function to put multimap data into a tree object<p>I have a general tree class with: <em>myTree = new Tree(string), appendChildNode(node), createChildNode(string), myTree.print()</em> functions and <em>myTree.name, myTree.children</em>, etc attributes.</p> <p>I also have a multimap with data which ...
<p>Using a trivial tree implementation and using a Map of strings to arrays of strings in place of your MultiMap implementation, we can see the structure fairly clearly:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-co...
JavaScript recursive function to put multimap data into a tree object
javascript|recursion|tree|multimap
2
75
2
72,924,742
72,924,742
1
true
2022-07-09T10:40:27.837Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript recursive function to put multimap data into a tree object<p>I have a general tree class with: <em>myTree = new Tree(string), appendChildNode(node...
72,836,761
chained await in class chained methods<p><strong>context:</strong> Two javascript classes in separate files, each integrating a different external service and being called in a express.js router.</p> <p>See &quot;problematic code&quot; below:</p> <ul> <li>route</li> </ul> <pre class="lang-js prettyprint-override"><code...
<blockquote> <p>The problem is with the chained awaits in the router file: <code>await ( await ( await awsTranscribe.Upload...</code></p> </blockquote> <p>No, that's fine. In particular it would be trivial to refactor it to separate lines:</p> <pre><code>routes.post('/aws', upload.single('file'), async (req, res) =&gt;...
chained await in class chained methods
javascript|node.js|express|asynchronous|chaining
1
75
2
72,845,510
72,845,510
1
true
2022-07-02T05:46:41.620Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: chained await in class chained methods<p><strong>context:</strong> Two javascript classes in separate files, each integrating a different external service an...
72,769,824
Thread.Sleep() doesn't work with Cv2.ImShow, OpenCvSharp, C#<p>Very Simple C# Winforms App, OpenCVSharp4, Thread.Sleep() doesn't work. It seems like (as I guess) Cv2 cannot be used in multiple threads, eg, one thread create NamedWindow, another thread ImShow. But this simple code below is still confusing.</p> <pre><cod...
<p><code>waitKey</code>'s purpose is not waiting, it's to <em><strong>spin the GUI event loop</strong></em> that OpenCV uses. If you don't call it, OpenCV's GUI doesn't work.</p> <p>You're using C# and WinForms already (judging by the tags), so you should use WinForms instead of <code>imshow</code>. OpenCV does its own...
Thread.Sleep() doesn't work with Cv2.ImShow, OpenCvSharp, C#
c#|multithreading|winforms|opencv
0
75
1
72,770,531
72,770,531
2
true
2022-06-27T09:29:04.830Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Thread.Sleep() doesn't work with Cv2.ImShow, OpenCvSharp, C#<p>Very Simple C# Winforms App, OpenCVSharp4, Thread.Sleep() doesn't work. It seems like (as I gu...
72,781,000
how to convert a list to dictionary in python?<p>I have a list like this. containing question and its answer.</p> <pre><code>list=[['It has been noted that in __________________ urban cities quickly expanded rather than the slow evolution of urbanism in the northwest.', 'Gujarat'], ['These traditions and cul...
<p>A <a href="https://docs.python.org/3/glossary.html#term-list-comprehension" rel="nofollow noreferrer">list comprehension</a> will suffice:</p> <pre><code>[{'question': q, 'answer': a} for q, a in list] </code></pre> <p>This outputs:</p> <pre><code>[{'question': 'It has been noted that in __________________ urban cit...
how to convert a list to dictionary in python?
python|list|dictionary
-1
75
4
72,781,038
72,781,038
2
true
2022-06-28T05:09:40.077Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to convert a list to dictionary in python?<p>I have a list like this. containing question and its answer.</p> <pre><code>list=[['It has been noted that i...
72,796,211
Is string_split() injection safe?<p>After reading <a href="https://www.sommarskog.se/dyn-search.html" rel="nofollow noreferrer">this great article</a> on handling multi-valued parameters, I learned about the convenient <code>string_split()</code> function.<br /> I would like to use it in a where clause of a parameteriz...
<p>There is no outright injection issue in the sense that arbitrary code cannot be executed. This is because, ultimately, <code>@commaSeparatedListOfValues</code> remains a string, and is never parsed into actual code.</p> <p>The only injection issue is if you are explicitly passing say three value, and one of them co...
Is string_split() injection safe?
sql|sql-server|security
2
75
1
72,800,385
72,800,385
2
true
2022-06-29T05:31:22.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is string_split() injection safe?<p>After reading <a href="https://www.sommarskog.se/dyn-search.html" rel="nofollow noreferrer">this great article</a> on han...
72,800,883
Object.entries is working partially in REACT why?<p>I'm not able to display only : <code>&quot;Mona&quot;, &quot;Paul&quot;,&quot;Bastian&quot;</code>, I can display : <code>&quot;Mona&quot;, &quot;Paul&quot;,&quot;Bastian&quot;,&quot;Average&quot;</code> but I don't want to display &quot;Average&quot;. And display &qu...
<p>Use <code>filter</code>:</p> <pre><code>const data = Object.entries(graphs.names[0]) .filter(([key]) =&gt; key != &quot;Average&quot;) .map(([name, age]) =&gt; ({name, age})); </code></pre> <p>An alternative, is to spread the object to extract the Average (and ignore it) and get...
Object.entries is working partially in REACT why?
javascript|html|reactjs|recharts
-1
75
2
72,801,769
72,801,769
2
true
2022-06-29T11:46:00.390Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Object.entries is working partially in REACT why?<p>I'm not able to display only : <code>&quot;Mona&quot;, &quot;Paul&quot;,&quot;Bastian&quot;</code>, I can...
72,799,746
How to run a Google Cloud Function with a timeout of 60 min from a Google Cloud Task?<p>So I have an HTTPS cloud function that has a timeout of 60 minutes.</p> <pre class="lang-js prettyprint-override"><code>import { onRequest } from &quot;firebase-functions/v2/https&quot;; export const myFunction = onRequest( { ...
<p>You can set a retry configuration for your <a href="https://cloud.google.com/tasks/docs/configuring-queues#retry" rel="nofollow noreferrer">tasks</a>, and make your <code>Cloud Function</code> invocations idempotent (i.e. if a retry comes, but it's for a request that is already processing, don't process it again). H...
How to run a Google Cloud Function with a timeout of 60 min from a Google Cloud Task?
google-cloud-platform|google-cloud-functions|google-cloud-tasks
0
75
1
72,803,958
72,803,958
2
true
2022-06-29T10:21:43.013Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to run a Google Cloud Function with a timeout of 60 min from a Google Cloud Task?<p>So I have an HTTPS cloud function that has a timeout of 60 minutes.</...
72,811,212
sed command does not execute properly on gitlab runner<p>I have a script which needs to run npm run test and capture test coverage coverage value <a href="https://i.stack.imgur.com/kvHNT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kvHNT.png" alt="enter image description here" /></a> so here I am ...
<p>You could just pipe directly to <code>sed</code></p> <pre><code>total=$(npm test -- --coverage --watchAll=false | sed -En '/All files/s/^[^|]*\| +([[:digit:].]+).*$/\1/p') echo &quot;Current test coverage is : $total&quot; </code></pre>
sed command does not execute properly on gitlab runner
linux|shell|sed|gitlab|gnu
2
75
2
72,813,368
72,813,368
2
true
2022-06-30T06:33:03.410Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sed command does not execute properly on gitlab runner<p>I have a script which needs to run npm run test and capture test coverage coverage value <a href="ht...
72,816,423
How to do a partial autocorrelation plot with many zeros in r<p>I have a dataset of ER admissions with many zeros. These are daily admissions from <code>2016-06-05</code> to <code>2019-12-31</code>. This is my data:</p> <pre><code>df&lt;-structure(list(date = structure(c(1465084800, 1465171200, 1465257600, 1465344000,...
<p>This is closely related to this question: <a href="https://stackoverflow.com/questions/28744218/set-frequency-in-xts-object">Set frequency in xts object</a>. The <code>frequency</code> is used in <code>pacf</code> <a href="https://github.com/wch/r-source/blob/79298c499218846d14500255efd622b5021c10ec/src/library/stat...
How to do a partial autocorrelation plot with many zeros in r
r|time-series|lag|zoo
1
75
4
72,817,234
72,817,234
2
true
2022-06-30T13:10:20.543Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to do a partial autocorrelation plot with many zeros in r<p>I have a dataset of ER admissions with many zeros. These are daily admissions from <code>2016...
72,851,372
The framework 'Microsoft.NETCore.App', version '2.0.0' (arm64) was not found<p>My structure of folders is</p> <pre><code>BulkyBook / BulkyBook.DataAccess / BulkyBook.Models / BulkyBook.Utility / BulkyBookWeb </code></pre> <p>Inside BulkyBook.DataAccess contains my ApplicationDbContext, my migrations and also the reposi...
<p>Seemingly your project targets NETCore.App version 2.0.0. Download and install Microsoft.NETCore.App, version 2.0.0 runtime and try again.</p> <p>If it doesn't work, setting your web project as startup project may resolve the issue.</p>
The framework 'Microsoft.NETCore.App', version '2.0.0' (arm64) was not found
c#|.net|entity-framework|apple-m1
1
75
1
72,851,448
72,851,448
2
true
2022-07-04T02:59:01.217Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The framework 'Microsoft.NETCore.App', version '2.0.0' (arm64) was not found<p>My structure of folders is</p> <pre><code>BulkyBook / BulkyBook.DataAccess / B...
72,894,397
Kafka connect S3 source failing with read-only registry<p>I am trying to read avro records stored in S3 in order to put them back in a kafka topic using the S3 source provided by confluent. I already have the topics and the registry setup with the right schemas but when the connect S3 source tries to serialize the my r...
<p>If you're sure the correct schema for that subject is already registered by some other means, you can try to set <code>auto.register.schemas</code> to false in the serializer configuration.</p> <p>See here for more details: <a href="https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html...
Kafka connect S3 source failing with read-only registry
apache-kafka|avro|apache-kafka-connect|confluent-schema-registry
0
75
1
72,895,181
72,895,181
2
true
2022-07-07T08:13:00.110Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kafka connect S3 source failing with read-only registry<p>I am trying to read avro records stored in S3 in order to put them back in a kafka topic using the ...
72,901,652
Applying a function to a parameter pack<p>I'm playing around with parameter packs, and I'm trying to apply a mapping via a lambda function which adds <code>1</code> to each member of the parameter pack as shown. However, I get the output <code>4</code> while <code>234</code> is expected.</p> <pre><code>#include &lt;ios...
<p>You can't return a parameter pack. The closest thing is <code>std::tuple</code>.</p> <p>Something like this:</p> <pre><code>template&lt;typename F, typename ...Args&gt; auto mapping(F f, Args &amp;&amp;... args) { // Note `{...}` instead of `(...)`, forcing the call order of `f`. return std::tuple{f(std::for...
Applying a function to a parameter pack
c++|variadic-templates|parameter-pack
0
75
1
72,901,803
72,901,803
2
true
2022-07-07T16:54:48.840Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Applying a function to a parameter pack<p>I'm playing around with parameter packs, and I'm trying to apply a mapping via a lambda function which adds <code>1...
72,901,747
Get p data between two h2 elements using BeautifulSoup<p>I have a page url that I am looking to pull data from using Python.</p> <p>I basically want to return the paragraph data found 'under' a h2 element. Issue is the content is not nested and there are no real classes/id's on any of the content.</p> <p>Structure of ...
<p>You can use <code>tag.find_previous</code> to get previous <code>&lt;h2&gt;</code> element. For example:</p> <pre class="lang-py prettyprint-override"><code>import requests from bs4 import BeautifulSoup url = &quot;https://www.obd-codes.com/p0100&quot; soup = BeautifulSoup(requests.get(url).content, &quot;lxml&quot...
Get p data between two h2 elements using BeautifulSoup
python|html|web-scraping|beautifulsoup
1
75
2
72,903,190
72,903,190
2
true
2022-07-07T17:02:08.607Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get p data between two h2 elements using BeautifulSoup<p>I have a page url that I am looking to pull data from using Python.</p> <p>I basically want to retur...
72,911,293
Validate date in a CL program (AS400)<p>Hi can someone tell me how to validate date in a CL program. If a DATE is provided as an input to the CL program , the CL program should validate the provided DATE.</p>
<p>there is a CL command named <code>CVTDAT</code>. Use it to convert a date from one format to another. To validate the date, use the <code>MONMSG</code> command to monitor for any conversion error.</p> <pre><code> PGM PARM(&amp;CHDATE) ...
Validate date in a CL program (AS400)
ibm-midrange|rpgle|rpg
0
75
1
72,915,882
72,915,882
2
true
2022-07-08T12:17:09.090Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Validate date in a CL program (AS400)<p>Hi can someone tell me how to validate date in a CL program. If a DATE is provided as an input to the CL program , th...
72,924,315
Change the aspect ratio for canvas with set number of pixels<p>I have an image (well data) that is m = 3600 n = 512. It has to stay like this. The data really starts as an array but is then broken down into m,n chunks. I would like to change the aspect ratio in canvas. If I change <code>canvas.width</code>, it gives me...
<p>I'm almost afraid to answer - but what about the most obvious solution: Instead of just changing the width of the canvas via CSS - change both width <strong>&amp;</strong> height.</p> <pre><code>canvas.style.width = 1.2 * Math.round(512) + &quot;px&quot;; canvas.style.height = &quot;3600px&quot;; </code></pre>
Change the aspect ratio for canvas with set number of pixels
javascript|html|image|canvas
0
75
1
72,928,282
72,928,282
2
true
2022-07-09T20:11:53.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change the aspect ratio for canvas with set number of pixels<p>I have an image (well data) that is m = 3600 n = 512. It has to stay like this. The data reall...
72,949,640
What is the memory footprint of a character in a byte string when compared to a character in a string (in Racket)?<p>What is the memory footprint of a character in a byte string when compared to a character in a string in Racket? I <a href="https://docs.racket-lang.org/guide/bytestrings.html" rel="nofollow noreferrer">...
<p>Racket (CS) internally represents strings as UTF-32, so each character <a href="https://github.com/racket/ChezScheme/blob/master/s/cmacros.ss#L431" rel="nofollow noreferrer">occupies 4 bytes</a>. On a 64-bit platform, a string has an 8 byte header and is <a href="https://github.com/racket/ChezScheme/blob/master/s/cm...
What is the memory footprint of a character in a byte string when compared to a character in a string (in Racket)?
string|memory|scheme|racket
0
75
4
72,952,523
72,952,523
2
true
2022-07-12T09:01:27.767Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the memory footprint of a character in a byte string when compared to a character in a string (in Racket)?<p>What is the memory footprint of a charac...
72,955,786
MYSQL "Division by zero" warnings, strange behavior<p>I'm using MySQL 8.0.</p> <p>I created the following tables</p> <pre><code>SET SESSION sql_mode='ERROR_FOR_DIVISION_BY_ZERO'; create table Test( col1 integer, col2 integer ); create table Test1( colA integer, colB varchar(45) ); </code></pre> <p>I populated them wi...
<p>When executing an <a href="https://dbfiddle.uk/?rdbms=mysql_8.0&amp;fiddle=bb264a6c22078c879ecaffab12b43136" rel="nofollow noreferrer"><code>EXPLAIN ANALYSE</code> on the last query</a>, this is the output:</p> <pre class="lang-none prettyprint-override"><code>-&gt; Filter: ((T1.colA / T.col1) &gt; 0) (cost=1.00 ro...
MYSQL "Division by zero" warnings, strange behavior
mysql|sql
3
75
2
72,956,234
72,956,234
2
true
2022-07-12T16:48:25.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MYSQL "Division by zero" warnings, strange behavior<p>I'm using MySQL 8.0.</p> <p>I created the following tables</p> <pre><code>SET SESSION sql_mode='ERROR_F...
72,962,035
How do I keep first, if value of row1 column1 == row2 column2?<p>I want to check all rows in dataframe,</p> <ul> <li><p>if <strong>this row</strong>'s <code>column1</code> == <strong>previous row</strong>'s <code>column2</code></p> <p>and</p> </li> <li><p>if <strong>this row</strong>'s <code>column2</code> == <strong>p...
<p>You can use</p> <pre class="lang-py prettyprint-override"><code>m1 = df['Column1'] == df['Column2'].shift() m2 = df['Column2'] == df['Column1'].shift() out = df[~(m1 &amp; m2)] </code></pre> <pre><code>print(out) Column1 Column2 0 A B 2 A C 3 A D 5 B C </code></pre...
How do I keep first, if value of row1 column1 == row2 column2?
python|pandas|dataframe
0
75
2
72,962,144
72,962,144
2
true
2022-07-13T06:53:45.677Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I keep first, if value of row1 column1 == row2 column2?<p>I want to check all rows in dataframe,</p> <ul> <li><p>if <strong>this row</strong>'s <code>...
73,001,864
How to write string stream to ofstream?<p>I am trying to write a <code>stringstream</code> into a file but it not working.</p> <pre class="lang-cpp prettyprint-override"><code> int main() { std::stringstream stream; stream &lt;&lt; &quot;Hello world&quot;; cout &lt;&lt; stream.rdbuf()&lt;&lt;endl;//prints f...
<p>Internally, the <code>stringstream</code> maintain a read pointer/offset into its data buffer. When you read something from the stream, it reads from the current offset and then increments it.</p> <p>So, <code>cout &lt;&lt; stream.rdbuf()</code> reads the entire stream's data, leaving the read pointer/offset at the ...
How to write string stream to ofstream?
c++|file-io|stringstream|ofstream
0
75
2
73,002,048
73,002,048
2
true
2022-07-16T05:53:50.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to write string stream to ofstream?<p>I am trying to write a <code>stringstream</code> into a file but it not working.</p> <pre class="lang-cpp prettypri...
73,027,195
Merging text and image keras layers not working<p>Please judge me tender. I'm trying to concatenate two inputs, one for images and one for text.</p> <p>I'm not an expert and I'm new with the functional API, so it's hard for me to identify the problem here.</p> <p>In the code below, I confirmed that I can train both tex...
<p><a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model#fit" rel="nofollow noreferrer">As per the documentation on <code>fit()</code></a>, if you're passing a dictionary, the keys need to point to an array or tensor. You're using <code>tensorflow.python.data.ops.dataset_ops.PrefetchDataset</code>, which w...
Merging text and image keras layers not working
python|tensorflow|concatenation|text-classification|image-classification
0
75
1
73,029,535
73,029,535
2
true
2022-07-18T18:47:18.767Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Merging text and image keras layers not working<p>Please judge me tender. I'm trying to concatenate two inputs, one for images and one for text.</p> <p>I'm n...
72,800,246
How to prevent ansible from parsing string as json?<p>I am putting labels on a container with ansible. The labels I want (in docker compose syntax) are as follows:</p> <pre><code>labels: com.datadoghq.ad.check_names: '[&quot;portainer&quot;]' com.datadoghq.ad.init_configs: '[{}]' com.datadoghq.ad.instances: '[{&q...
<p>Ansible will more or less reinterpret every string it comes accross as a yaml/json datastructure whenever a variable is expanded.</p> <p>As you already found out, you can use the <a href="https://docs.ansible.com/ansible/latest/user_guide/playbooks_advanced_syntax.html#unsafe-or-raw-strings" rel="nofollow noreferrer...
How to prevent ansible from parsing string as json?
json|string|parsing|ansible|portainer
1
75
1
72,804,569
72,804,569
2
true
2022-06-29T10:59:30.457Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to prevent ansible from parsing string as json?<p>I am putting labels on a container with ansible. The labels I want (in docker compose syntax) are as fo...
72,813,856
format pandas column with strings and numbers<p>I have a pandas dataframe, which consists of numbers and strings. It looks something like this:</p> <pre><code>Column1 Column2 name1 12.4 name2 13 name3 - name4 0.2 </code></pre> <p>I want to format Column2 so that all numbers are formated with one digit...
<p>You can replace <code>,</code> to <code>.</code>, so possible use <code>to_numeric</code> with <code>errors='coerce'</code> for missing values for <code>-</code> (and another no numbers values) and then use <code>map</code> with <code>if-else</code> for processing <code>NaN</code>s:</p> <pre><code>f = lambda x: '${:...
format pandas column with strings and numbers
python|pandas
2
75
3
72,813,958
72,813,958
2
true
2022-06-30T10:02:13.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: format pandas column with strings and numbers<p>I have a pandas dataframe, which consists of numbers and strings. It looks something like this:</p> <pre><cod...
72,783,876
Get a multiple UNION ALL query faster<p>I have an issue of performance with a query with multiple UNION ALL statements. I need to add (row by row) data from different tables into the same columns. The query need to be used to create a view in MySQL, so, here an example:</p> <pre><code>CREATE OR REPLACE ALGORITHM = ...
<p><code>UNION ALL</code> is the most performant way of concatenating result sets. (<code>UNION</code> is slower because it removes duplicates.)</p> <p>Surely your timeout occurs when you <em>use</em> the view, not when you create it.</p> <p>Your performance issue stems from one or more of the SELECT queries in your <c...
Get a multiple UNION ALL query faster
mysql|sql|query-optimization|union-all
0
75
1
72,785,014
72,785,014
2
true
2022-06-28T09:24:02.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get a multiple UNION ALL query faster<p>I have an issue of performance with a query with multiple UNION ALL statements. I need to add (row by row) data from ...
72,920,005
How to run a single test in pytest using a complex custom id as a selector?<p>A similar question is being asked here: <a href="https://stackoverflow.com/questions/44943470/parametrize-and-running-a-single-test-in-pytest">parametrize and running a single test in pytest</a>.</p> <p>My question is more complex, as I param...
<p>Short answer is you can't achieve what you are looking for using a comma. Pytest uses a specific parsing pattern which can be found <a href="https://github.com/pytest-dev/pytest/blob/main/src/_pytest/mark/expression.py#L88" rel="nofollow noreferrer">here</a>. This patterns allows for the following characters:</p> <p...
How to run a single test in pytest using a complex custom id as a selector?
python|pytest|fixtures
2
75
1
72,921,225
72,921,225
2
true
2022-07-09T08:29:52.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to run a single test in pytest using a complex custom id as a selector?<p>A similar question is being asked here: <a href="https://stackoverflow.com/ques...
72,857,204
Replace certain values across multiple columns, before column values change, with NA in R<p>I have a dataframe like this:</p> <pre><code>dat &lt;- data.frame(Target = c(rep(&quot;01&quot;, times = 8), rep(&quot;02&quot;, times = 5), rep(&quot;03&quot;, times = 4)), ...
<p>This is something you can try using <code>cumall</code>. This effectively will convert values not equal to zero to <code>NA</code> until the first zero. This logic will give the same results as desired above. However, if your actual needs differ or you want to explicitly check the first row for a given <code>Target<...
Replace certain values across multiple columns, before column values change, with NA in R
r|dataframe|rows|na|data-wrangling
1
75
1
72,861,302
72,861,302
2
true
2022-07-04T13:01:01.390Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace certain values across multiple columns, before column values change, with NA in R<p>I have a dataframe like this:</p> <pre><code>dat &lt;- data.frame...
72,781,977
Move project to a different organization<p>Has anyone experience with moving a project (GKE, Cloud SQL, Cloud Storage, Private IPs, etc.) to a different organization?</p> <p>I found some documentation but its limited in describing what actually can be moved so I'm looking for people with experience in this topic</p>
<p>The Super Admin for both organization, Organization(A) and Organization(B) must be setup the required permissions necessary also the API to migrate the project.</p> <ol> <li><p>Give the email account the Project Mover (*access to update and move projects) role on the Project to be moved.</p> </li> <li><p>Give the em...
Move project to a different organization
google-cloud-platform
-1
75
2
72,782,136
72,782,136
2
true
2022-06-28T06:58:33.150Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Move project to a different organization<p>Has anyone experience with moving a project (GKE, Cloud SQL, Cloud Storage, Private IPs, etc.) to a different orga...
72,895,841
Show content when a button is pressed and change colour the active button<p>I would like to show a content when a button is pressed and change colour of the active button. Currently I'm able to perform both the operation individually, but I don't get how to merge these functionalities.</p> <p>To show the content, my sc...
<p>You just need to remove the class in <code>changedata()</code> and add it to the clicked element.</p> <pre><code>document.querySelectorAll(&quot;.button&quot;).forEach((e) =&gt; { e.classList.remove('highlight'); }); event.target.classList.add('highlight'); </code></pre> <p><div class="snippet" data-lang="js" da...
Show content when a button is pressed and change colour the active button
javascript|html|jquery|css
2
75
2
72,896,036
72,896,036
2
true
2022-07-07T09:59:22.227Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Show content when a button is pressed and change colour the active button<p>I would like to show a content when a button is pressed and change colour of the ...
72,797,622
Replacing dots, commas and percentages marks with load `csv` file with `fread()`<p>We would like to manage the columns from <code>csv</code> file with originally three <code>character</code> columns class when we used the <code>fread()</code> with the arguments detailed in the <code>R code used</code> section (separato...
<p>You could just do some postprocessing in R:</p> <pre><code>RAW = fread('col_1,col_2, col_3 /100.432,&quot;30,84Â %&quot;,&quot;4,14&quot; /3.200,&quot;62,89Â %&quot;,&quot;1,89&quot; /10.100,&quot;50,00Â %&quot;,&quot;1,62&quot; /15.570, &quot;40,10Â %&quot;,&quot;3,41&quot; /900.310, &quot;8,00Â %&quot;,&quot;0,10&...
Replacing dots, commas and percentages marks with load `csv` file with `fread()`
r|data.table|gsub|fread
0
75
2
72,802,155
72,802,155
2
true
2022-06-29T07:46:31.260Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replacing dots, commas and percentages marks with load `csv` file with `fread()`<p>We would like to manage the columns from <code>csv</code> file with origin...
72,882,234
Parse XML to Google sheets in google Apps Script<p>I need to parse a API XML data to Google sheet. I need all the data from each row.</p> <p>XML File, example:</p> <pre><code>&lt;directory&gt; &lt;fieldset&gt; &lt;field id=&quot;displayName&quot;&gt;Display name&lt;/field&gt; &lt;field id=&quot;firs...
<p>Try</p> <pre><code>function myEmployees() { var document = XmlService.parse(xmlString); var root = document.getRootElement(); var headers = [] headers.push('id') root.getChild(&quot;fieldset&quot;).getDescendants().filter(dsc =&gt; dsc.asElement()).forEach(el =&gt; { headers.push(el.getText()) }) v...
Parse XML to Google sheets in google Apps Script
google-apps-script
1
75
3
72,883,197
72,883,197
2
true
2022-07-06T10:48:33.503Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parse XML to Google sheets in google Apps Script<p>I need to parse a API XML data to Google sheet. I need all the data from each row.</p> <p>XML File, exampl...
73,025,602
Rewritemap to url with spaces<p>I'm trying to:</p> <ul> <li>give access to file in folder if query string value exist in map file</li> <li>disable access if query string value is empty or no query string at all</li> </ul> <p>With the following it works except for files with spaces: london bridge footage.mp4</p> <p>/etc...
<p>I suggest you remove every rule from vhost except <code>RewriteMap</code> and keep all the rules in one place i.e. <code>test/.htaccess</code> as it already exists in your file system.</p> <p><strong>/etc/httpd/extra/httpd-ssl.conf:</strong></p> <pre class="lang-bash prettyprint-override"><code>&lt;VirtualHost *:443...
Rewritemap to url with spaces
regex|apache|.htaccess|mod-rewrite|codeigniter-4
1
75
1
73,031,527
73,031,527
2
true
2022-07-18T16:25:49.697Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rewritemap to url with spaces<p>I'm trying to:</p> <ul> <li>give access to file in folder if query string value exist in map file</li> <li>disable access if ...
72,841,110
How to make a Windows shortcut to run a function in a Python script?<p>I am trying to find a way to create a Windows shortcut that executes a function from a Python file. The function being run would look something like this (it runs a command in the shell):</p> <pre><code>def function(command): subprocess.run(comm...
<p>Generally speaking AFAIK, you can't do it, however it could be done if the target script is written a certain way and is passed the name of the function to run as an argument. You could even add arguments to be passed to the function by listing them following its name in the shortcut.</p> <p>The target script has to...
How to make a Windows shortcut to run a function in a Python script?
python|windows|windows-shortcut
0
75
1
72,843,631
72,843,631
2
true
2022-07-02T17:27:27.433Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a Windows shortcut to run a function in a Python script?<p>I am trying to find a way to create a Windows shortcut that executes a function from a...
72,919,140
Github how to merge branch to main?<p>I have <code>main</code> and branch <code>myStudy</code>.</p> <p>And I want to merge myStudy to main. But I keep facing this issue message.</p> <pre><code>On branch main Your branch is ahead of 'origin/main' by 4 commits. (use &quot;git push&quot; to publish your local commits) ...
<p>The fact your <em>local</em> branch main is <em>ahead</em> of 'origin/main' by 4 commits means you don't have anything to do to &quot;reflect those 4 commits&quot;: they are already there:</p> <pre class="lang-bash prettyprint-override"><code>git switch main git merge myStudy git push </code></pre> <p>Regarding</p> ...
Github how to merge branch to main?
git
1
75
2
72,919,282
72,919,282
2
true
2022-07-09T05:20:42.490Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Github how to merge branch to main?<p>I have <code>main</code> and branch <code>myStudy</code>.</p> <p>And I want to merge myStudy to main. But I keep facing...