question_id
int64
37.6M
73.2M
input_text
stringlengths
88
52.4k
output_text
stringlengths
37
35.6k
title
stringlengths
15
150
tags
stringlengths
1
107
q_score
int64
-19
397
view_count
int64
3
879k
answer_count
int64
1
21
accepted_answer_id
int64
37.6M
73.8M
answer_id
int64
37.6M
73.8M
a_score
int64
-5
1.29k
is_accepted
bool
1 class
creation_date
stringlengths
20
24
input_text_instruct
stringlengths
251
52.6k
72,855,936
Looping through a second column using a probability input<p>I have a similar question to one I posed here, but subtly different as it includes an extra step to the process involving a probability:</p> <p><a href="https://stackoverflow.com/questions/72576406/">Using a Python pandas dataframe column as input to a loop th...
<p>We'll use numpy binomial and pandas sample to get this done.</p> <pre><code>import pandas as pd import numpy as np # Set up dataframes vals = pd.DataFrame([[1,8,'25%'], [2,26,'19%'], [3,17,'26%'],[4,9,'10%']]) vals.columns = ['Year', 'Count', 'Probability'] temp = pd.DataFrame([[1,100], [2,25], [3,50], [4,15], [5,7...
Looping through a second column using a probability input
python|pandas
1
55
2
72,856,163
72,856,163
1
true
2022-07-04T11:25:18.573Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Looping through a second column using a probability input<p>I have a similar question to one I posed here, but subtly different as it includes an extra step ...
72,768,395
Why the rocketmq only consumes part of the queue<p>After send message to the RocketMQ 4.8, I found the consumer only consumed part of the queue. This is the RocketMQ consumer code looks like:</p> <pre><code>public void appConsumer(Long appId, List&lt;String&gt; topics) throws MQClientException { DefaultMQPushConsum...
<p>For your case, the most possible cause is that you started two instances with the same consumer group name. Let's say it c1 and c2 with the same consumer group &quot;CG1&quot;.</p> <p>While c1 subscribes different topics from c2 does. This can be the most possible cause. So please check your code if this case exists...
Why the rocketmq only consumes part of the queue
java|rocketmq
-1
55
1
72,771,940
72,771,940
1
true
2022-06-27T07:28:04.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why the rocketmq only consumes part of the queue<p>After send message to the RocketMQ 4.8, I found the consumer only consumed part of the queue. This is the ...
72,869,207
Is shutdown-hook a good practice?<p>I have a <code>Service</code> that makes requests via a <code>RestClient</code>.</p> <p>What is the Java best practice between:</p> <ol> <li>Opening and closing the connection every time I make a request</li> <li>Opening the connection at class initialization and closing it in a <cod...
<blockquote> <p>What is the Java best practice between</p> </blockquote> <p><sup>There are no &quot;best practices&quot;. Please read and contemplate <a href="https://www.satisfice.com/blog/archives/5164" rel="nofollow noreferrer">No Best Practices</a></sup></p> <blockquote> <ol> <li>Opening and closing the connection...
Is shutdown-hook a good practice?
java|shutdown-hook
0
55
1
72,869,328
72,869,328
1
true
2022-07-05T12:09:34.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is shutdown-hook a good practice?<p>I have a <code>Service</code> that makes requests via a <code>RestClient</code>.</p> <p>What is the Java best practice be...
72,958,631
For everything in a column, remove text between two periods<p>I'm trying to reformat column 4 in &quot;orthologsClassification.tsv&quot; file to include everything except the text between the two periods. I want:</p> <pre><code>t_gene t_transcript q_gene q_transcript ENSG00000213096 ENST0000061602...
<p>One <code>awk</code> idea using a regex:</p> <pre><code>$ awk 'BEGIN{FS=OFS=&quot;\t&quot;} FNR&gt;1 {sub(/\.[^.]*\./,&quot;.&quot;,$4)} 1' orthologsClassification.tsv t_gene t_transcript q_gene q_transcript ENSG00000213096 ENST00000616028.ZNF254 reg_2133 ENST00000616028.2177 ENSG00000213096 ENST0000061...
For everything in a column, remove text between two periods
string|awk|bioinformatics
0
55
5
72,958,838
72,958,838
1
true
2022-07-12T21:35:52.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: For everything in a column, remove text between two periods<p>I'm trying to reformat column 4 in &quot;orthologsClassification.tsv&quot; file to include ever...
72,968,036
How to query a dataframe optimally?<p>I have a csv with large number of rows.</p> <p>Sample:</p> <pre class="lang-none prettyprint-override"><code>User_id , Marks 12 3 13 2 . . </code></pre> <p>Marks can be in range (1,5) I want to count for every user_id The count of marks received in various ranges (1-2), (...
<p>I think this should work for you (Edit, I restructured the code to make it more readable):</p> <pre><code>df = pd.DataFrame({'User_id':[12, 13, 12, 13, 12, 13] , 'Marks': [3.0, 2.2, 4.9, 1.0, 3.1, 2.9]}) mark_ranges = pd.cut( df['Marks'], bins=[0,2,3,4,5], labels=['1-2', '2-3', '3-4', '4-5'], ).rena...
How to query a dataframe optimally?
python|pandas|dataframe|csv
0
55
1
72,969,020
72,969,020
1
true
2022-07-13T14:30:51.743Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to query a dataframe optimally?<p>I have a csv with large number of rows.</p> <p>Sample:</p> <pre class="lang-none prettyprint-override"><code>User_id , ...
72,815,763
FInding active users based on login and logoff timestamp using PySpark<p>There is a data frame with data of iot. Columns are device id(unique id), connected at(Timestamp), disconnect at(Timestamp). I have to get the active users based on timings. First, we need get dates from connection date and disconnected date and t...
<p>I've created example data and script for you. Example data and your attempt was your job. Normally on Stack Overflow people don't do such things and such question could have been closed as lacking details or a script to debug. Just because I'm in the mood...</p> <p>Make something along these lines...</p> <p>Example ...
FInding active users based on login and logoff timestamp using PySpark
dataframe|apache-spark|date|pyspark|timestamp
0
55
1
72,823,784
72,823,784
1
true
2022-06-30T12:22:54.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: FInding active users based on login and logoff timestamp using PySpark<p>There is a data frame with data of iot. Columns are device id(unique id), connected ...
72,857,026
Regex function in a loop runs slowly<p>I need to apply 15 regular expressions to a Spark DataFrame. I will add version with small <code>df</code> and 3 regexps here:</p> <pre><code>df = spark.createDataFrame([ Row(a=1, val1=&quot;aaa_wwwwwww&quot;), Row(a=2, val1=&quot;bwq_323&quot;), Row(a=3, val1=&quot;haha_kdj...
<p><strong>Attempt 1</strong></p> <p>From what can be seen, you can create just one <a href="https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.regexp_extract.html#pyspark.sql.functions.regexp_extract" rel="nofollow noreferrer"><strong><code>regexp_extract</code></strong></a...
Regex function in a loop runs slowly
python-3.x|regex|loops|apache-spark|pyspark
1
55
1
72,857,160
72,857,160
1
true
2022-07-04T12:46:46.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex function in a loop runs slowly<p>I need to apply 15 regular expressions to a Spark DataFrame. I will add version with small <code>df</code> and 3 regex...
72,975,448
How to convert a class A to class B?<p>I am working on a method where I've written the following line here:</p> <pre class="lang-java prettyprint-override"><code>public class XeroTrackingCategoryClient extends TrackingCategoryTransformationClient { public List&lt;ErpListEntry&gt; getCustomFieldListDataByName(Strin...
<p>There are two possible solutions (with <code>TrackingCategory extends AccountingObject</code>). The first one is to cast to <code>TrackingCategory</code>.:</p> <pre><code>Optional&lt;TrackingCategory&gt; trackingCategory = trackingCategoryTransformationClient .getErpListDataById(entityCode, null, customFieldList...
How to convert a class A to class B?
java|class|type-conversion
0
55
1
72,975,820
72,975,820
1
true
2022-07-14T05:04:16.760Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert a class A to class B?<p>I am working on a method where I've written the following line here:</p> <pre class="lang-java prettyprint-override"><...
72,940,993
Rewriting the values in a dictionary automatically from a function's output<p>I am trying to code a guessing game in Python. I have a function called bingo_calculator() that takes a 12-character Y/N string as a parameter (i.e. YNNYNNYNYYYN) from a dictionary value and then returns an integer value based on the rules of...
<p>Is this what you're looking for?</p> <pre><code>guess_results = {} for key in bingoGuesses190: guess_results[key] = bingo_calculator(bingoGuesses190[key]) </code></pre> <p>To simultaneously print and sort the dictionary in descending order based on the integer values:</p> <pre><code>for entry in sorted(guess_res...
Rewriting the values in a dictionary automatically from a function's output
python|dictionary
2
55
2
72,942,281
72,942,281
1
true
2022-07-11T15:28:10.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rewriting the values in a dictionary automatically from a function's output<p>I am trying to code a guessing game in Python. I have a function called bingo_c...
72,836,248
In PLSQL How to put result of conditional aggregation into variable?<p>I use the following query to count the number of rows labeled as cheap, fair and expansive</p> <pre><code>select sum(case when price_category = 'CHEAP' then 1 else 0 end) AS cheap, sum(case when price_category = 'FAIR' then 1 else 0 end) AS...
<p>With sample data like this:</p> <pre class="lang-sql prettyprint-override"><code>WITH t AS ( SELECT 1 &quot;ID&quot;, 'CHEAP' &quot;PRICE_CATEGORY&quot; FROM DUAL UNION ALL SELECT 2 &quot;ID&quot;, 'CHEAP' &quot;PRICE_CATEGORY&quot; FROM DUAL UNION ALL SELECT 3 &quot;ID&quot;, 'FAIR' &quo...
In PLSQL How to put result of conditional aggregation into variable?
sql|oracle|plsql
0
55
2
72,837,833
72,837,833
1
true
2022-07-02T03:28:32.400Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In PLSQL How to put result of conditional aggregation into variable?<p>I use the following query to count the number of rows labeled as cheap, fair and expan...
72,960,886
Filtering Documents with nested field nested value Elastic Search<p>My Data demo:</p> <pre><code>{ &quot;id&quot;: &quot;1&quot;, &quot;username&quot;: &quot;demo&quot;, &quot;email&quot;: &quot;dasdasdas@dsadas&quot;, &quot;number&quot;: &quot;000111000&quot;, &quot;createdDate&quot;: &quot;2022-07-13&quot;,...
<p>Well, the demo data you provided consists of one single document, which inside of a nested array has the data you want to filter on.</p> <p>By default, Elasticsearch will always return all <em>complete</em> documents that match a query. Since one of the nested fields matches your query, the complete source is return...
Filtering Documents with nested field nested value Elastic Search
java|elasticsearch|elastic-stack
1
55
1
72,967,533
72,967,533
1
true
2022-07-13T04:17:09.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filtering Documents with nested field nested value Elastic Search<p>My Data demo:</p> <pre><code>{ &quot;id&quot;: &quot;1&quot;, &quot;username&quot;: &...
72,769,734
return 2 values javascript<p>I'm trying to return two values in GAS like this:<br><br> Html<br></p> <pre><code>&lt;script&gt; function phoneSearch() { var phone = document.getElementById(&quot;phone&quot;).value; google.script.run.withSuccessHandler(onSuccess).phoneSearch(phone); } function onSuccess(name...
<p>You can only return 1 value from your function at a time, but you can easily wrap that in an object:</p> <pre><code>&lt;script&gt; function phoneSearch() { var phone = document.getElementById(&quot;phone&quot;).value; google.script.run.withSuccessHandler(onSuccess).phoneSearch(phone); } function onSucc...
return 2 values javascript
javascript|html|google-apps-script
1
55
2
72,769,844
72,769,844
2
true
2022-06-27T09:22:56.390Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: return 2 values javascript<p>I'm trying to return two values in GAS like this:<br><br> Html<br></p> <pre><code>&lt;script&gt; function phoneSearch() { ...
72,774,685
How to improve a select query performance?<p>I am working on a method that basically takes an array of Color (Unity Type) as parameter and replace all colors contained in a list by another color contained in another color array. For example you have 3 mask colors (red, blue green), so each green pixel will be replaced ...
<p>The unfortunate truth of LINQ is that it will pretty much <strong>never</strong> be faster than a for loop. It is because unlike languages like C++ and Rust where lambda expressions can be inlined/compiled-away, any time you invoke an <code>Action</code> object, or call <code>MoveNext()</code> on <code>IEnumerable&l...
How to improve a select query performance?
c#|performance|linq|unity3d|query-optimization
0
55
1
72,775,280
72,775,280
2
true
2022-06-27T15:30:05.617Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to improve a select query performance?<p>I am working on a method that basically takes an array of Color (Unity Type) as parameter and replace all colors...
72,783,911
creating a generic array taken from an array of structures<p>I need to pass to qsort a generic array. That array must be taken from the colons of a file structured like this: int,string,int,float. I've created an appropriate struct type but I'm having troubles creating a dinamically allocated array of structures.</p> <...
<blockquote> <p>I've created an appropriate struct type but I'm having troubles creating a dinamically allocated array of structures.</p> </blockquote> <p>Assuming this is your struct:</p> <pre><code>struct record { int i1; char *s; int i2; float f; }; </code></pre> <p>This should be the array declarati...
creating a generic array taken from an array of structures
c|generics
1
55
2
72,785,430
72,785,430
2
true
2022-06-28T09:26:17.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: creating a generic array taken from an array of structures<p>I need to pass to qsort a generic array. That array must be taken from the colons of a file stru...
72,792,576
How to add a new line before a capital letter?<p>I am writing a piece of code to get lyrics from genius.com.</p> <p>I have managed to extract the code from the website but it comes out in a format where all the text is on one line.</p> <p>I have used regex to add a space but cannot figure out how to add a new line. Her...
<p>If genius.com doesn't somehow provide a separator, it will be very hard to find a way to know what to look for.</p> <p>In your example, I made a regex searching for <code>&quot; [A-Z]&quot;</code>, which will find &quot; He...&quot;. But it will also find all places where a sentence starts with &quot; I...&quot;. So...
How to add a new line before a capital letter?
python|regex
0
55
4
72,792,691
72,792,691
2
true
2022-06-28T20:09:08.380Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add a new line before a capital letter?<p>I am writing a piece of code to get lyrics from genius.com.</p> <p>I have managed to extract the code from t...
72,792,662
Spring Data JPA: Ability to retrieve variable number of columns and specify any Where clause<p>I'm using Spring Data JPA to retrieve data from an Entity, say Employee, with 100 columns. User would not need all 100 cloumns each time. So I need a way to :</p> <ol> <li>Allow the user to retrieve(select) a variable number ...
<p>Implement a custom method in your repository. In that method you can assemble the where clause and the select list executing it using one of many methods:</p> <ul> <li>Using the <code>EntityManager</code>, so you are still using JPA if that is of value for you. You can assemble your query either using the Criteria A...
Spring Data JPA: Ability to retrieve variable number of columns and specify any Where clause
java|spring-boot|jpa|spring-data-jpa
0
55
2
72,797,905
72,797,905
2
true
2022-06-28T20:16:54.887Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring Data JPA: Ability to retrieve variable number of columns and specify any Where clause<p>I'm using Spring Data JPA to retrieve data from an Entity, say...
72,813,255
How to map this Json with rest template spring boot<p>I'm kind of new to REST API and I have to map an endpoint that returns me this JSON:</p> <pre><code>{ &quot;request&quot;: { &quot;Target&quot;: &quot;Affiliate_Offer&quot;, &quot;Format&quot;: &quot;json&quot;, &quot;Service&quot;: &quot;HasOffers&quot;...
<p>In your API response, you're getting this (I only use one fragment but you can extend the idea to all the other fields):</p> <pre><code>{ &quot;request&quot;: { &quot;Target&quot;: &quot;Affiliate_Offer&quot;, &quot;Format&quot;: &quot;json&quot;, </code></pre> <p>However, in your POJO, you have ...
How to map this Json with rest template spring boot
java|json|spring-boot|rest
0
55
2
72,813,462
72,813,462
2
true
2022-06-30T09:17:27.987Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to map this Json with rest template spring boot<p>I'm kind of new to REST API and I have to map an endpoint that returns me this JSON:</p> <pre><code>{ &...
72,822,311
Remove an specific user from Room in EF Core<p>I have a room including some users. I want to remove an specific user from the room.</p> <p>Here are my Models:</p> <pre><code>public class RoomModel { [Required] public int Id { get; set; } public string Name { get; set; } public string Admin { get; set; }...
<p>Since in your <code>UserModel</code> enity there is no CLR property which holds the foreign key for the relationship, a shadow property <code>RoomModelId</code> is created.</p> <p>See the documentation for more information: <a href="https://docs.microsoft.com/en-us/ef/core/modeling/shadow-properties" rel="nofollow n...
Remove an specific user from Room in EF Core
c#|entity-framework-core
0
55
3
72,822,744
72,822,744
2
true
2022-06-30T21:38:56.390Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove an specific user from Room in EF Core<p>I have a room including some users. I want to remove an specific user from the room.</p> <p>Here are my Models...
72,823,045
strconv.Unquote does not remove escaped json characters, unmarshall fails in Go<p>I am parsing rather simple json where the slash in the date format string is escaped when it arrives in response.</p> <p>however, when you try to unmarshall the string, it fails on &quot;invalid syntax&quot; error. So I googled and we sho...
<p>Go has a great built-in function to convert a JSON string to a Go string: <code>json.Unmarshal</code>. Here is how you can integrate it with a custom <code>UnmarshalJSON</code> method:</p> <pre><code>func (d *Time) UnmarshalJSON(b []byte) error { var s string if err := json.Unmarshal(b, &amp;s); err != nil {...
strconv.Unquote does not remove escaped json characters, unmarshall fails in Go
json|go|escaping
-2
55
2
72,825,169
72,825,169
2
true
2022-06-30T23:36:52.750Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: strconv.Unquote does not remove escaped json characters, unmarshall fails in Go<p>I am parsing rather simple json where the slash in the date format string i...
72,843,305
How to create a rust filter predicate for an iterator?<pre><code>pub struct S{ a: u32 } fn main() { let ve = vec![S{a: 1}, S{a: 2}]; ve.iter().filter(filter_function); } fn filter_function(s: &amp;S) -&gt; bool { todo!() } </code></pre> <p>Gives</p> <pre><code>error[E0631]: type mismatch in function ar...
<p>The signatures aren't quite the same. The expected type is a function which takes a <code>&amp;'r &amp;S</code>, while your function takes a <code>&amp;'r S</code>. One has an extra layer of indirection.</p> <p>You need a function that takes a double reference and calls <code>filter_function</code> with a single ref...
How to create a rust filter predicate for an iterator?
rust
0
55
1
72,843,316
72,843,316
2
true
2022-07-03T00:46:06.063Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a rust filter predicate for an iterator?<pre><code>pub struct S{ a: u32 } fn main() { let ve = vec![S{a: 1}, S{a: 2}]; ve.iter().fi...
72,843,585
Problems with form controls in Javascript<p>I'm working on a project and I am trying to add checks for the inputs on the form. I want it to only submit and move to the URL if the requirements are met. I'm using Javascript to check this. Currently, my code doesn't return any errors in the console but when I press submit...
<p>I made some changes to the code so it submits when it is successful.</p> <p>The first thing is to have <code>checkRequired</code> return <code>true</code> or <code>false</code> indicating if the validation was successful or not.</p> <p>Second, check that value in the submit event listener and submit the form if it i...
Problems with form controls in Javascript
javascript
0
55
2
72,843,634
72,843,634
2
true
2022-07-03T02:27:11.587Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problems with form controls in Javascript<p>I'm working on a project and I am trying to add checks for the inputs on the form. I want it to only submit and m...
72,847,250
Python - TypeError: '<' not supported between instances of 'int' and 'list'<p>I'm doing a small task in Python. I have to categorizes age into six different categories, based on the age ranges specified in the question. If the age is less than 18, the code prints &quot;Category: Under 18&quot;. If the age is between 18...
<p>You need to access each element of the list and perform the comparison, instead of using <code>&lt;=&gt;</code> operators between list and integer value:</p> <pre><code>Age_Group = [18,24,34,44,54,64] for i in Age_Group: print(f&quot;Age {i}&quot;) if i &lt; 18: print(&quot;Category: Under 18&quot;)...
Python - TypeError: '<' not supported between instances of 'int' and 'list'
python|if-statement
-1
55
1
72,847,272
72,847,272
2
true
2022-07-03T14:23:19.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python - TypeError: '<' not supported between instances of 'int' and 'list'<p>I'm doing a small task in Python. I have to categorizes age into six different ...
72,864,445
Rank customer Transactions per segments in SQL Server<p>I have below <strong>table</strong> which has customer's transaction details.</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align: left;">Tranactaction date</th> <th style="text-align: center;">CustomerID</th> </tr> </the...
<p>Using <a href="https://docs.microsoft.com/en-us/sql/t-sql/functions/lag-transact-sql?view=sql-server-ver16" rel="nofollow noreferrer">lag()</a> to check for change in <code>TransDate</code> that is within 2 days and groups together (as a segment). After that use <code>row_number()</code> to generate the required seq...
Rank customer Transactions per segments in SQL Server
sql|sql-server|tsql|azure-sql-data-warehouse
-1
55
1
72,866,330
72,866,330
2
true
2022-07-05T05:38:17.937Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rank customer Transactions per segments in SQL Server<p>I have below <strong>table</strong> which has customer's transaction details.</p> <div class="s-table...
72,875,512
pandas groupby fillna code does not work and gives error<p>I have the dataframe like this:</p> <pre><code>data = {'name': ['Alex', 'Ben', 'Marry','Alex', 'Ben', 'Marry'], 'job': ['teacher', 'doctor', 'engineer','teacher', 'doctor', 'engineer'], 'age': [27, 32, 78,27, 32, 78], 'weight': [160, 20...
<p>For your purpose using Andrej Kesely answer might be enough, but have in mind that using apply with pandas is not good performance-wise.</p> <p>A better option to maintain performance is to use <code>.transform('mean')</code> like</p> <pre class="lang-py prettyprint-override"><code> df[&quot;age&quot;].fillna(df.gr...
pandas groupby fillna code does not work and gives error
python|pandas|pandas-groupby|mean|fillna
1
55
3
72,876,531
72,876,531
2
true
2022-07-05T21:03:52.523Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pandas groupby fillna code does not work and gives error<p>I have the dataframe like this:</p> <pre><code>data = {'name': ['Alex', 'Ben', 'Marry','Alex', 'B...
72,885,151
upload file to google bucket from remote url in ruby<p>We have found various solutions around upload the file to google cloud bucket from local system. However I am wondering if is there a way we can upload file to bucket using the public URL or link.</p> <p><a href="https://googleapis.dev/ruby/google-cloud-storage/lat...
<p>Your code sits between the remote URL and the Google Cloud Storage (GCS) Bucket.</p> <p>You've 2 alternatives:</p> <ol> <li>(As you describe) Download the file behind the remote URL to a file system accessible to your code and then upload it to GCS;</li> <li><a href="https://cloud.google.com/storage/docs/streaming" ...
upload file to google bucket from remote url in ruby
ruby|ruby-on-rails-3|google-cloud-platform|file-upload|google-cloud-storage
0
55
2
72,886,650
72,886,650
2
true
2022-07-06T14:16:34.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: upload file to google bucket from remote url in ruby<p>We have found various solutions around upload the file to google cloud bucket from local system. Howev...
72,889,464
How can I pass correlationId across various classes without adding it to all method calls?<p>I’m using Java Spring Boot and I have a hexagonal / ports and adaptors structure to my code.</p> <p>Im trying to set up correlation IDs in my logging. My understanding is that my API gateway should generate a unique ID for each...
<p>Spring-cloud-starter-sleuth is available which supports this out of the box,just add this dependency and then you would have traceId-common across all services and gateway and spanId - unique correlation is per microservice. You can read more about it in topic distributed tracing.</p>
How can I pass correlationId across various classes without adding it to all method calls?
java|spring|spring-boot|design-patterns
0
55
1
72,889,628
72,889,628
2
true
2022-07-06T20:23:29.880Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I pass correlationId across various classes without adding it to all method calls?<p>I’m using Java Spring Boot and I have a hexagonal / ports and ad...
72,896,495
How to drop Materialized view in Azure Synapse Analytics<p>How to drop materialized view in Azure Synapse Analytics ?</p> <p>I tried <code>DROP MATERIALIZED VIEW [schema_name].[table_name]</code> but it did not work. I also attempted to find the doc regarding this but surprisingly, there are none.</p>
<p>Use <code>ALTER</code> to drop the materializes view.</p> <p>Syntax:</p> <pre><code>ALTER MATERIALIZED VIEW [ schema_name . ] view_name { REBUILD | DISABLE } [;] </code></pre> <p>Example:</p> <p><code>ALTER MATERIALIZED VIEW My_Indexed_View DISABLE;</code></p>
How to drop Materialized view in Azure Synapse Analytics
tsql|azure-synapse|materialized-views
0
55
1
72,896,665
72,896,665
2
true
2022-07-07T10:50:11.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to drop Materialized view in Azure Synapse Analytics<p>How to drop materialized view in Azure Synapse Analytics ?</p> <p>I tried <code>DROP MATERIALIZED ...
72,897,637
How can I move my glass effect overlay backwards?<p>I created an overlay with a blue background and reduced the opacity to give it a glassy/tint effect. The problem I'm having is trying to move it under my elements/containers (I guess calling in underlay makes more sense). I've tried using <code>z-index: -1</code>; but...
<p>why not use <code>RGBA</code> or <code>HSLA</code> as <code>background-color</code>? The issue is caused because <code>opacity</code> is rendered last. As such <code>z-index</code> has no influence as it is rendered last and by definition then always on top of the entire element (incl. all child elements).</p> <p><d...
How can I move my glass effect overlay backwards?
html|css
0
55
1
72,897,693
72,897,693
2
true
2022-07-07T12:14:43.613Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I move my glass effect overlay backwards?<p>I created an overlay with a blue background and reduced the opacity to give it a glassy/tint effect. The ...
72,899,252
What's an umbrella term for things like class, struct, interface and enum?<p>I know what I typed are keywords, but that umbrella term would also contain things like <code>if</code>, <code>new</code> or <code>using</code>. Can I just call <code>class</code>, <code>interface</code> etc. types? I feel like that would be c...
<p>I just found out, the Microsoft documentation calls them &quot;categories of types&quot; here:</p> <p><a href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/common-type-system?redirectedfrom=MSDN#types_in_the_net_framework" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/standard/base...
What's an umbrella term for things like class, struct, interface and enum?
c#
0
55
2
72,899,373
72,899,373
2
true
2022-07-07T14:03:51.047Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's an umbrella term for things like class, struct, interface and enum?<p>I know what I typed are keywords, but that umbrella term would also contain thin...
72,902,506
Automatic Numbering not incrementing<p>I want to recreate this picture using CSS, And I'm required to write the text using only CSS. I'm not allowed to edit the HTML code <a href="https://i.stack.imgur.com/Cnz3s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cnz3s.png" alt="the required output" /></...
<p>You need to set <code>counter-reset</code> to parent <code>.grid</code>, also no need to set <code>0</code></p> <p>Note you can improve your <code>grid-template-columns: auto auto auto</code>, to <code>grid-template-columns: repeat(3, auto)</code></p> <p><div class="snippet" data-lang="js" data-hide="false" data-con...
Automatic Numbering not incrementing
css|css-grid|css-counter
1
55
3
72,902,621
72,902,621
2
true
2022-07-07T18:15:14.110Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Automatic Numbering not incrementing<p>I want to recreate this picture using CSS, And I'm required to write the text using only CSS. I'm not allowed to edit ...
72,913,763
Spring Integration SFTP: Using PrivateKey Credentials<p>I had a few hickups setting up private keys for Spring Integration SFTP.</p> <p>Thought I may share my findings here.</p> <p>I read elsewhere that I should parameterize the JSch object with the private key. This, however, is <strong>not working</strong>:</p> <pre>...
<p>The solution is to instead set the private key for the session factory:</p> <pre><code>DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory(new JSch(), true); byte[] privateKeyBytes = privateKey.getBytes(StandardCharsets.UTF_8); factory.setPrivateKey(new ByteArrayResource(privateKeyBytes)); return setCo...
Spring Integration SFTP: Using PrivateKey Credentials
java|spring-integration|sftp|private-key|spring-integration-sftp
0
55
1
72,913,764
72,913,764
2
true
2022-07-08T15:32:58.257Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring Integration SFTP: Using PrivateKey Credentials<p>I had a few hickups setting up private keys for Spring Integration SFTP.</p> <p>Thought I may share m...
72,914,630
In Shiny/R app - why plotly charts are flickering?<p>I having a trouble here, this is my code:</p> <pre><code>library(gapminder) library(shiny) library(plotly) library(shinyWidgets) df_first_mexico &lt;- gapminder %&gt;% filter(country == &quot;Mexico&quot;)%&gt;% select(year,lifeExp) df_second_mexico &lt;- gapminder...
<p>The &quot;issue&quot; is that for efficiency, Shiny by default won't update outputs that aren't visible. When you're on the second tab and change the input, the <code>plot_B</code> updates but <code>plot_A</code> doesn't. When you click back to the first tab, you're browser still has the previous plot rendered. Now ...
In Shiny/R app - why plotly charts are flickering?
r|shiny|shinyjs
0
55
2
72,914,968
72,914,968
2
true
2022-07-08T16:54:05.007Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In Shiny/R app - why plotly charts are flickering?<p>I having a trouble here, this is my code:</p> <pre><code>library(gapminder) library(shiny) library(plot...
72,921,557
How do I make the properties of a class iterable is swift using Sequence and IteratorProtocol?<p>I would like to make my class in Swift iterable.</p> <p>My goal is to be able to create a class called Contact that holds properties such as the givenName, familyName, and middleName, like iOS CNContact. I would like to be ...
<p>If you really don't want to use mirror, a straightforward way is to cycle through a list of key paths. This is particularly easy in your case because the properties are all strings:</p> <pre><code>class Contact { static let properties = [\Contact.givenName, \Contact.familyName, \Contact.middleName] static f...
How do I make the properties of a class iterable is swift using Sequence and IteratorProtocol?
swift|class|properties|swift-iteratorprotocol|swift-sequence-protocol
0
55
2
72,922,351
72,922,351
2
true
2022-07-09T12:58:38.147Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I make the properties of a class iterable is swift using Sequence and IteratorProtocol?<p>I would like to make my class in Swift iterable.</p> <p>My g...
72,941,062
bash / sed : editing of the file<p>I use sed to remove all lines starting from &quot;HETATM&quot; from the input file and cat to combine another file with the output recieved from SED</p> <pre><code>sed -i '/^HETATM/ d' file1.pdb cat fil2.pdb file1.pdb &gt; file3.pdb </code></pre> <p>is this way to do it in one line e....
<p>If you want to consider <code>awk</code> then it can be done in a single command:</p> <pre class="lang-bash prettyprint-override"><code>awk 'FNR == NR {print; next} !/^HETATM/' file2.pdb file1.pdb &gt; file3.pdb </code></pre>
bash / sed : editing of the file
bash|awk|sed
2
55
4
72,941,394
72,941,394
2
true
2022-07-11T15:33:36.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: bash / sed : editing of the file<p>I use sed to remove all lines starting from &quot;HETATM&quot; from the input file and cat to combine another file with th...
72,941,753
How to sum up third elements of string in array<p>I have the following output:</p> <pre><code>[&quot;1154,1,8.00&quot;, &quot;1162,1,8.00&quot;, &quot;1161,1,8.00&quot;] </code></pre> <p>I would like to sum the third element of each item: <code>8.00 + 8.00 + 8.00</code></p> <p>I've tried with <code>.last, .map</code> w...
<p>You can do it like this:</p> <pre class="lang-rb prettyprint-override"><code>[&quot;1154,1,8.00&quot;, &quot;1162,1,8.00&quot;, &quot;1161,1,8.00&quot;].sum { |x| x.split(',').last.to_f } # output # =&gt; 24.0 </code></pre>
How to sum up third elements of string in array
ruby-on-rails|ruby
-1
55
2
72,941,803
72,941,803
2
true
2022-07-11T16:29:02.613Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sum up third elements of string in array<p>I have the following output:</p> <pre><code>[&quot;1154,1,8.00&quot;, &quot;1162,1,8.00&quot;, &quot;1161,1...
72,942,693
Datatype mismatch in anchor and recursive part of a recursive CTE<p>I am running this SQL code on SQL Server to print alphabets from A to Z:</p> <pre><code>;with alphaCte as ( select 'A' as letter union all select char(ascii(letter)+1) from alphaCte where letter &lt; 'Z' ) select * from alphaCte ...
<p>To expand on my comment</p> <pre><code>Select column_ordinal ,name ,system_type_name From sys.dm_exec_describe_first_result_set('select ''A'' as letter,char(ascii(''A'')+1) as letter2',null,null ) </code></pre> <p>Results</p> <pre><code>column_ordinal name system_type_name 1 lette...
Datatype mismatch in anchor and recursive part of a recursive CTE
sql|sql-server|common-table-expression|recursive-query
1
55
1
72,942,785
72,942,785
2
true
2022-07-11T17:49:32.170Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Datatype mismatch in anchor and recursive part of a recursive CTE<p>I am running this SQL code on SQL Server to print alphabets from A to Z:</p> <pre><code>;...
72,945,605
sql - How to only apply condition in WHERE if condition is met<p>I'm having trouble implementing this, where I want to have the condition in WHERE removed/added if a condition is met.</p> <p>sample:</p> <pre><code>select x.color, x.shape from table x x.finish = 'shine' </code></pre> <p>What I want this to do is that if...
<p>Use <code>OR</code> to match the conditions when <code>color</code> is not equal to 'Red' (which is when it is either not equal to <code>'Red'</code> or when it is <code>NULL</code>):</p> <pre class="lang-sql prettyprint-override"><code>SELECT color, shape FROM table_name WHERE color != 'Red' OR color ...
sql - How to only apply condition in WHERE if condition is met
sql|oracle
0
55
1
72,945,704
72,945,704
2
true
2022-07-11T23:30:45.583Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sql - How to only apply condition in WHERE if condition is met<p>I'm having trouble implementing this, where I want to have the condition in WHERE removed/ad...
72,953,104
Python - Sort profile report by tottime<p>Python includes a simple to use <a href="https://docs.python.org/3/library/profile.html" rel="nofollow noreferrer">profiler</a>:</p> <pre><code>&gt;&gt; import cProfile &gt;&gt; import re &gt;&gt; cProfile.run('re.compile(&quot;foo|bar&quot;)') 197 function calls (192 pr...
<p>Use the <code>sort=...</code> argument of <code>cProfile.run</code>:</p> <pre><code>&gt;&gt;&gt; import cProfile &gt;&gt;&gt; import time &gt;&gt;&gt; cProfile.run('time.sleep(1); time.monotonic()', sort='tottime') Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function)...
Python - Sort profile report by tottime
python|profiling|profiler
2
55
1
72,953,307
72,953,307
2
true
2022-07-12T13:26:58.097Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python - Sort profile report by tottime<p>Python includes a simple to use <a href="https://docs.python.org/3/library/profile.html" rel="nofollow noreferrer">...
72,953,566
Dropdown menu using html and css hides behind the h1?<p><em>This is the first time i am building a drop down menu for the navigation.</em><br/> The <strong>functionality</strong> of the dropdown menu <strong>works fine</strong>.<br/> But <strong>my dropdown appears behind the h1(it's a hero section)</strong><br/></p> <...
<p>It's because you forgot to set the dropdown backgroundcolor:</p> <pre><code>.drop-down__button:hover + .drop-down__list { opacity: 1; pointer-events: all; transform: translateY(0); background-color: white; } </code></pre> <p>By making this adjustment it should work as expected.</p>
Dropdown menu using html and css hides behind the h1?
html|css|drop-down-menu|css-position|z-index
0
55
2
72,953,645
72,953,645
2
true
2022-07-12T13:57:37.167Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dropdown menu using html and css hides behind the h1?<p><em>This is the first time i am building a drop down menu for the navigation.</em><br/> The <strong>f...
72,956,672
compare value in two rows in a column pandas<p>I have a pandas df something like this:</p> <pre><code> color pct days text 1 red 5 7 good 2 red 10 30 good 3 re...
<p>A variation on a (now-deleted) suggested answer as comment:</p> <pre><code># ensure numeric data df['pct'] = pd.to_numeric(df['pct'], errors='coerce') df['days'] = pd.to_numeric(df['days'], errors='coerce') # update in place df.loc[df.sort_values(['color','days']) .groupby('color')['pct'] .diff()....
compare value in two rows in a column pandas
pandas|compare
1
55
2
72,957,253
72,957,253
2
true
2022-07-12T18:09:25.513Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: compare value in two rows in a column pandas<p>I have a pandas df something like this:</p> <pre><code> color pct days ...
72,914,454
Default copy constructor and assignment operator<p>If among the elements of my class I have also a const data member, how do copy constructor and assignment operator behave? I think, but I am not sure, that copy constructor is provided (as most cases) while assignment operator is not provided (differently from what hap...
<pre><code>struct foo { int const x; }; foo f0{3}; // legal foo f1 = f0; // legal, copy-construction foo make_foo(int y) { return {y}; } // legal, direct-initialization foo f2 = make_foo(3); // legal, elision and/or move-construction f2 = f1; // illegal, copy-assignment f2 = make_foo(3); // illegal, move-assignme...
Default copy constructor and assignment operator
c++|class|c++11|copy-constructor|assignment-operator
0
55
1
72,972,429
72,972,429
2
true
2022-07-08T16:37:16.733Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Default copy constructor and assignment operator<p>If among the elements of my class I have also a const data member, how do copy constructor and assignment ...
72,977,690
Simple template to pass a c++ member method as a callback<p>I have a set of classes which have many very similar methods, grouped into 2 call signatures. These calls are of the form:</p> <p><code>bool fn( const std::string&amp; )</code> and <code>bool fn( const std::vector&lt;std::string&gt;&amp; )</code></p> <p>I need...
<p>You can just pass the member pointer as function argument:</p> <pre><code>template &lt;typename T&gt; bool CFG_STR( T&amp; cfg, bool(T::*fn)(const std::string&amp;), const char* key, Nodes data, bool flag ) { /*...*/ } </code></pre> <p>And instead of repeating the class name you can just write <code>decltype(config)...
Simple template to pass a c++ member method as a callback
c++|c++11
-1
55
1
72,978,056
72,978,056
2
true
2022-07-14T08:41:48.530Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simple template to pass a c++ member method as a callback<p>I have a set of classes which have many very similar methods, grouped into 2 call signatures. The...
72,984,211
Why wont the write mode change for writing to graphics memory in VGA mode?<p>I am trying to draw to the screen in VGA graphics in DOSBOX using NASM. My code is able to write to a black screen perfectly fine however if I edit a pixel that is already a certain color, the output color ends up being the previous color ORed...
<p>Some reference about VGA hardware: <a href="https://wiki.osdev.org/VGA_Hardware" rel="nofollow noreferrer">https://wiki.osdev.org/VGA_Hardware</a>, <a href="https://web.stanford.edu/class/cs140/projects/pintos/specs/freevga/vga/vgamem.htm" rel="nofollow noreferrer">https://web.stanford.edu/class/cs140/projects/pinto...
Why wont the write mode change for writing to graphics memory in VGA mode?
assembly|graphics|nasm|dos|dosbox
0
55
1
72,987,214
72,987,214
2
true
2022-07-14T17:02:34.933Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why wont the write mode change for writing to graphics memory in VGA mode?<p>I am trying to draw to the screen in VGA graphics in DOSBOX using NASM. My code ...
72,988,625
How to block pre-commit using 100% of my CPU?<p>I have the pre-commit config file with pre-push hook type. Every time when I push to the repo, my CPU shows me 100% of using power.</p> <p><a href="https://i.stack.imgur.com/DsfEn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DsfEn.png" alt="enter ima...
<p>you've misconfigured flake8 and so you are triggering a fork bomb (pre-commit's multiprocessing + flake8's multiprocessing) <strong>and</strong> you're double-linting every file in your codebase</p> <p>I would recommend you utilize the official flake8 configuration rather than reimplementing your own (poorly):</p> <...
How to block pre-commit using 100% of my CPU?
python|git|flake8|pre-commit|pre-commit.com
0
55
1
72,988,884
72,988,884
2
true
2022-07-15T02:59:54.660Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to block pre-commit using 100% of my CPU?<p>I have the pre-commit config file with pre-push hook type. Every time when I push to the repo, my CPU shows m...
72,983,027
Ejabberd APIs not working with python requests<p>I'm using ejabberd from the docker container. I followed <a href="https://www.process-one.net/blog/install-ejabberd-on-windows-10-using-docker-desktop/" rel="nofollow noreferrer">this link</a> to install ejabberd docker container.</p> <p>I tried the Administration APIs i...
<p>The full process, with all the steps that you must do, or ensure are correctly done:</p> <p>Register the account &quot;admin@localhost&quot;:</p> <pre><code>ejabberdctl register admin localhost somepass </code></pre> <p>Add the &quot;admin@localhost&quot; account to the &quot;admin&quot; ACL:</p> <pre class="lang-ya...
Ejabberd APIs not working with python requests
python-requests|xmpp|ejabberd|ejabberd-api|ejabberd-auth
0
55
1
72,991,679
72,991,679
2
true
2022-07-14T15:27:26.927Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ejabberd APIs not working with python requests<p>I'm using ejabberd from the docker container. I followed <a href="https://www.process-one.net/blog/install-e...
72,991,474
How to get relative rankings of numeric elements in a list or vector in R?<p><strong>Quick note regarding similar questions:</strong> This question was initially flagged as similar to <a href="https://stackoverflow.com/questions/11446254/how-to-emulate-sqls-rank-functions-in-r">How to emulate SQLs rank functions in R?<...
<p>I think you are looking for <code>dplyr::dense_rank()</code>:</p> <pre class="lang-r prettyprint-override"><code># Example 1 dplyr::dense_rank(c(1, 1, 1, 3, 1, 4, 1)) #&gt; [1] 1 1 1 2 1 3 1 # Example 2 dplyr::dense_rank(c(4, 1, 1, 1, 3, 5, 1)) #&gt; [1] 3 1 1 1 2 4 1 # Example in code dplyr::dense_rank(c(1, 1, 1,...
How to get relative rankings of numeric elements in a list or vector in R?
r|dplyr|rank
1
55
3
72,991,734
72,991,734
2
true
2022-07-15T08:54:45.457Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get relative rankings of numeric elements in a list or vector in R?<p><strong>Quick note regarding similar questions:</strong> This question was initi...
72,994,200
How to return output from stored procedure - Oracle<p>I have create a PL/SQL stored procedure from which I want to return output and display it.</p> <p>I want to return the output either the success or failure message into variable : <code>MSG</code></p> <p>How do I need to do this any idea</p> <p>PL/SQL code:</p> <pre...
<p>If it is a procedure, it should have an <strong>OUT</strong> parameter which will then be used to return some value.</p> <p>Something like this; note that it is probably useless to check whether <code>select</code> returned <code>null</code> (employees do have names; <code>select</code> would return <em>no row</em> ...
How to return output from stored procedure - Oracle
oracle|plsql
0
55
2
72,994,345
72,994,345
2
true
2022-07-15T12:44:25.847Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to return output from stored procedure - Oracle<p>I have create a PL/SQL stored procedure from which I want to return output and display it.</p> <p>I wan...
72,985,578
Is it possible through Spring to generate a wsdl with multiple services?<p>I've <strong>four</strong> Soap endpoints in <strong>one</strong> class in my application. Each of them has its own xsd file. There is also <strong>one</strong> configuration class, where <strong>all</strong> endpoints are described. Spring gene...
<p>Spring will generate one wsdl file if all requests and responses are located in one xsd file.</p> <pre><code> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; elementFormDefault=&quot;qualified&quot; ...
Is it possible through Spring to generate a wsdl with multiple services?
java|spring|soap|wsdl
1
55
1
72,994,934
72,994,934
2
true
2022-07-14T19:12:46.483Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible through Spring to generate a wsdl with multiple services?<p>I've <strong>four</strong> Soap endpoints in <strong>one</strong> class in my appl...
73,009,349
Why is SwiftUI List row selected but not highlighted (MacOS)<p>In the example below, if I type text into the TextField, the text is appended to the list and that row becomes the selection (as demonstrated by clicking on the button after entering the text), but the row is not highlighted. If another row is already selec...
<p>Very often two updates in one event does not work for SwiftUI, a usual workaround in such cases is to delay second update to next event cycle.</p> <p>Here is a fix. Tested with Xcode 13.4 / macOS 12.4</p> <pre><code>fruitList.fList.append(newFruitName) DispatchQueue.main.async { // &lt;&lt; postpon...
Why is SwiftUI List row selected but not highlighted (MacOS)
macos|listview|swiftui
2
55
1
73,009,373
73,009,373
2
true
2022-07-17T04:56:48.100Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is SwiftUI List row selected but not highlighted (MacOS)<p>In the example below, if I type text into the TextField, the text is appended to the list and ...
73,017,639
linear gradient background property not working when navigating screens with next js<p>I ran into something weird with next js. My background linear gradients are not loading when I switch pages.</p> <p>My link is</p> <pre><code>import Link from 'next/link' &lt;Link href='/register'&gt; &lt;a&gt; click me &lt;/a&g...
<p>You can use <code>tailwind @layer utility</code> for this like below.</p> <ol> <li><p>Just go to globals.css and add this</p> <pre><code> @tailwind base; @tailwind components; @tailwind utilities; @layer{ .backy { background-image: linear-gradient(153.68deg, #17191D 0%, #0C152C 45.82%); } } </code></p...
linear gradient background property not working when navigating screens with next js
css|reactjs|next.js|tailwind-css
0
55
1
73,017,856
73,017,856
2
true
2022-07-18T05:23:49.503Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: linear gradient background property not working when navigating screens with next js<p>I ran into something weird with next js. My background linear gradien...
73,018,142
Display tooltip content in multiple rows<p>In my vue js component, I'm trying to create a custom tool tip text with multiple line of texts.</p> <pre><code>&lt;div class=&quot;toolTip&quot;&gt; Shift ('+i+') &lt;/div&gt; &lt;div class=&quot;hide&quot;&gt; &lt;div class=&quot;w-full&quot;&gt; '+names[group]+' &l...
<pre><code>display: flex; </code></pre> <p>Will try to fit all your content on the same line.</p> <p>Try:</p> <pre><code>display: inherit; </code></pre> <p>or</p> <pre><code>display: inline; </code></pre>
Display tooltip content in multiple rows
html|css|vue.js|tailwind-css
0
55
2
73,018,308
73,018,308
2
true
2022-07-18T06:34:44.997Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Display tooltip content in multiple rows<p>In my vue js component, I'm trying to create a custom tool tip text with multiple line of texts.</p> <pre><code>&l...
73,025,780
Does calling a member variable of constexpr struct omits a whole constructor evaluation?<p>Let's say I have the following structure:</p> <pre><code>struct MyData { int minSteps{1}; int maxSteps{64}; double volume{0.25/7}; }; constexpr MyData data() { return MyData(); } </code></pre> <p>Does any of expr...
<p>It's very unlikely an instance of <code>MyData</code> will actually be created if you compile your code with optimizations on. Any modern compiler should optimize it out. GCC will do so even at O0, MSVC will optimize it out at O1, so it's fair to say you likely don't need to worry about it if you don't intend to com...
Does calling a member variable of constexpr struct omits a whole constructor evaluation?
c++|c++11|constexpr
0
55
1
73,026,534
73,026,534
2
true
2022-07-18T16:41:29.817Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does calling a member variable of constexpr struct omits a whole constructor evaluation?<p>Let's say I have the following structure:</p> <pre><code>struct My...
73,027,345
Getting error in [System.IO.Compression.ZipFile]::CreateFromDirectory when using CompressionLevel of SmallestSize<p>I want to compress a directory using PowerShell script. The following script works when I set the compression level to be Optimal or Fastest, but it is failing with SmallestSize.</p> <pre><code>$compressi...
<p><code>SmallestSize</code> is not available and will evaluate as null if your PowerShell version is 5.1 or lower.</p> <p>If you'd like to check what options you have available, you can run the following command:</p> <p><code>[System.IO.Compression.CompressionLevel] | Get-Member -Static -MemberType Property</code></p>
Getting error in [System.IO.Compression.ZipFile]::CreateFromDirectory when using CompressionLevel of SmallestSize
powershell|compression
1
55
1
73,039,342
73,039,342
2
true
2022-07-18T19:01:52.663Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting error in [System.IO.Compression.ZipFile]::CreateFromDirectory when using CompressionLevel of SmallestSize<p>I want to compress a directory using Powe...
73,025,048
Editing a poorly formatted CSV file<p>I have this poorly formatted csv file that was converted from a PDF. After some editing i got to this.</p> <pre><code>I-10, New, &quot;BRACELET JEWELRY 11/28/03, 14KT, LDS SS, STYLE: BANGLE&quot;, 1.00, 125.00, 1000.00, I-11, Old, &quot;BRACELET JEWELRY 11/28/03, 14KT; AMT / PER, L...
<p>You can use <a href="https://docs.python.org/3/library/csv.html" rel="nofollow noreferrer"><code>csv</code></a> module.</p> <p>try:</p> <pre class="lang-py prettyprint-override"><code>import csv # your output file output = open('final.csv', 'w') writer = csv.writer(output) with open('INVLISTcopy.csv') as csvfile: ...
Editing a poorly formatted CSV file
python|pandas|regex|csv
-1
55
1
73,025,231
73,025,231
2
true
2022-07-18T15:43:22.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Editing a poorly formatted CSV file<p>I have this poorly formatted csv file that was converted from a PDF. After some editing i got to this.</p> <pre><code>I...
72,963,892
Why console.log can not output properties of objects are created by vary ways?<p>I will be very obliged if u help me to realize why properties that can be shown by method getOwnPropertyDescriptor cannot be outputted by usual console.log. And waiting for your explanations why node 18.0 gets crazy about Object.create() a...
<p>By default, properties added on the objects using <code>Object.defineProperty</code> method are not enumerable. You have to explicitly set the property to be enumerable.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet...
Why console.log can not output properties of objects are created by vary ways?
javascript|node.js
0
55
1
72,963,960
72,963,960
2
true
2022-07-13T09:26:27.483Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why console.log can not output properties of objects are created by vary ways?<p>I will be very obliged if u help me to realize why properties that can be sh...
72,819,603
pythons opencv running out of frames when using webcam<p>I am trying to set my opencv to make a heat map. I have it working for a set .mp4 file. However when i try to make it work using my webcam on a live feed it doesn't seem to like it. the problem it has is it says that the <code>&quot;index is out of range&quot;</c...
<p><strong>Problem:</strong></p> <p>When using your webcam with <code>capture = cv2.VideoCapture(0)</code>; the line <code>length = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))</code> is not helpful. Because, when using a webcam <code>capture.get(cv2.CAP_PROP_FRAME_COUNT)</code> returns <code>-1.0</code>. And that means ...
pythons opencv running out of frames when using webcam
python|opencv
0
55
1
72,832,780
72,832,780
2
true
2022-06-30T17:07:15.523Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pythons opencv running out of frames when using webcam<p>I am trying to set my opencv to make a heat map. I have it working for a set .mp4 file. However when...
72,820,948
How to run two functions asynchronously in JavaScript using Async/Await;<p>I am creating a simple react pharmacy application in which I'm supposed to change remove all the medicines from a certain group and then delete the group.</p> <p>I have the two functions created like this.</p> <p><strong>1. changeMedicineGroupFu...
<p>In order to achieve that ,you have to some changes in your code. Starting with <code>changeMedicineGroupFunction</code> and <code>deleteGroup</code> that both should return a promise in order to await it in another function in your case <code>removeMedicinesFromGroup</code>.</p> <p>Example of changeMedicineGroupFunc...
How to run two functions asynchronously in JavaScript using Async/Await;
javascript|reactjs
1
55
3
72,821,103
72,821,103
2
true
2022-06-30T19:14:05.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to run two functions asynchronously in JavaScript using Async/Await;<p>I am creating a simple react pharmacy application in which I'm supposed to change ...
72,814,378
How to use Popen to open a program in Windows<p>I am working on a Python project to open an application in Windows. The following program is written like so</p> <pre><code>import subprocess subprocess.Popen(['open','C:\\Windows\\System32\\calc.exe']) </code></pre> <p>Expected: The calculator app should open.</p> <p>Act...
<p>Removing <code>open</code> parameter argument from the function <code>Popen</code> works well in Python 3:</p> <pre><code>import subprocess subprocess.Popen(['C:\\Windows\\System32\\calc.exe']) </code></pre> <p>Also, you can use <code>call()</code> instead of <code>Popen()</code>, with the same result:</p> <pre><cod...
How to use Popen to open a program in Windows
python|subprocess
0
55
1
72,814,416
72,814,416
2
true
2022-06-30T10:41:17.070Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use Popen to open a program in Windows<p>I am working on a Python project to open an application in Windows. The following program is written like so<...
73,028,171
Create a matrix with lowest cell count for every pair of binary variables<p>I have a dataset with several binary variables (x1-x5, values: 1, 2, NA). My goal is to identify whether pairs of binary variables have zero or very low cell counts in the cross-tab table (after ignoring the missing values). So, I would like to...
<p>I <em>think</em> this is what you mean. It's inefficient (we should only compute one triangle) but short.</p> <pre class="lang-r prettyprint-override"><code>cfun &lt;- function(i, j) { min(table(df[[i]], df[[j]])) } outer(1:ncol(df), 1:ncol(df), Vectorize(cfun)) </code></pre> <p>If you want to be more efficient:<...
Create a matrix with lowest cell count for every pair of binary variables
r|dplyr|purrr|missing-data|crosstab
3
55
2
73,028,308
73,028,308
2
true
2022-07-18T20:21:21.703Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a matrix with lowest cell count for every pair of binary variables<p>I have a dataset with several binary variables (x1-x5, values: 1, 2, NA). My goal...
72,923,206
Sending binary file via Winsock doesn't copy first 4 characters<p>So, of course, the file is not complete, but the actual size (not size on disk) is exactly the same.</p> <p>Here is the complete code of the server and client. In this example, I am copying the file from C:\temp\IMG_8526.jpg to E:\temp\newjpg.jpg.</p> <p...
<p>On the server side, <code>ReceiveDoWorkThenReturnDataToClient()</code> is running a loop where each iteration is first reading an arbitrary buffer of bytes from the socket and discarding that buffer before then trying to receive a file.</p> <p>When the client connects, it immediately sends the file's size followed b...
Sending binary file via Winsock doesn't copy first 4 characters
c++|winapi|winsock
0
55
1
72,923,683
72,923,683
2
true
2022-07-09T16:54:54.080Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sending binary file via Winsock doesn't copy first 4 characters<p>So, of course, the file is not complete, but the actual size (not size on disk) is exactly ...
72,944,403
Screen inside conda environment doesn't use python PATH<p>I have a conda environment that is running python 3.10.5. It works on the terminal without screen. First I did</p> <pre><code>conda deactivate </code></pre> <p>And <code>conda info</code> at this step shows:</p> <pre><code> active environment : base acti...
<p>Edit: as mentioned by other users, setting an alias is not recommended. I was able to fix it by:</p> <ol> <li>Entering screen</li> <li>Writing <code>conda deactivate</code> until the <code>(base)</code> environment was no longer activated either.</li> <li>Writing <code>conda activate my_env</code> to activate.</li> ...
Screen inside conda environment doesn't use python PATH
python|conda|gnu-screen
1
55
1
72,944,437
72,944,437
2
true
2022-07-11T20:37:35.353Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Screen inside conda environment doesn't use python PATH<p>I have a conda environment that is running python 3.10.5. It works on the terminal without screen. ...
72,863,536
ggplot - reverse y axis when plotting geom_smooth with gamma error distribution<p>I am trying to plot a <code>geom_smooth</code> using a gamma error distribution.</p> <pre class="lang-r prettyprint-override"><code>library(ggplot) data &lt;- data.frame(x = 1:100, y = (1:100 + runif(1:100, min = 0, max = 50))^2) p &lt;...
<p>I'm not sure if there are build-in methods to call out the predicted values of <code>geom_smooth</code> for <code>scale_y_reverse</code> to work.</p> <p>Here's the more conventional method with visualizing of regression models, i.e. construct, predict and plot.</p> <pre><code>library(broom) model &lt;- glm(y ~ x, da...
ggplot - reverse y axis when plotting geom_smooth with gamma error distribution
r|ggplot2
1
55
1
72,863,789
72,863,789
2
true
2022-07-05T02:51:38.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ggplot - reverse y axis when plotting geom_smooth with gamma error distribution<p>I am trying to plot a <code>geom_smooth</code> using a gamma error distribu...
72,916,242
Extract text between strings using regex<p>I'm trying to extract from the text below the value next to <code>number</code> and the text in between.</p> <p><strong>Text:</strong><br /> <code>The conditions are: number 1, the patient is allergic to dust, number next, the patient has bronchitis, number 4, The patient hea...
<p>As your <code>.</code> and <code>,</code> and the whitespace chars are optional after the digits or <code>next</code>, you might write the pattern with a non greedy dot asserting numbers again to the right or the end of the string.</p> <pre><code>\bnumbers? (\d+|next)[,.]?\s?(\w.*?)(?= numbers?\b|\.?$) </code></pre>...
Extract text between strings using regex
python-3.x|regex
2
55
2
72,916,278
72,916,278
2
true
2022-07-08T19:38:45.393Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract text between strings using regex<p>I'm trying to extract from the text below the value next to <code>number</code> and the text in between.</p> <p><s...
72,826,242
How can I make mouse support work for ncurses on OSX?<p>I have currently compiled and run the example from <a href="https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/mouse.html" rel="nofollow noreferrer">this tutorial</a> on OSX, and found that it does not work to capture the mouse event.</p> <p>I modified it slightly t...
<p>I got it working! I'm not sure which particular tweak was the important tweak (there's about a dozen-or-so things I changed), and I also have a bunch of instrumentation which I did not strip out.</p> <p>Hopefully this is sufficient to get you going.</p> <pre><code>/* brew install ncurses clang++ -Weverything -Wno-c...
How can I make mouse support work for ncurses on OSX?
c++|macos|ncurses
2
55
1
72,832,120
72,832,120
2
true
2022-07-01T08:09:46.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I make mouse support work for ncurses on OSX?<p>I have currently compiled and run the example from <a href="https://tldp.org/HOWTO/NCURSES-Programmin...
72,833,835
How to find maximum value of a field in mongodb golang?<p>This is my code. I always get maximum value of 999, even when there are more blocks (e.g 3000 blocks).</p> <p>This is what the document(s) look like.</p> <p><a href="https://i.stack.imgur.com/ErRSB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.c...
<p>Yes, you are right, from the image, I can see that the <code>blockNumber</code> field is a string, so you are not comparing integers, you are comparing string, where &quot;999&quot; is greater than &quot;3000&quot;:</p> <p>For example:</p> <pre><code>package main import ( &quot;fmt&quot; ) func findMax(a []str...
How to find maximum value of a field in mongodb golang?
mongodb|go
1
55
1
72,834,743
72,834,743
2
true
2022-07-01T19:26:34.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find maximum value of a field in mongodb golang?<p>This is my code. I always get maximum value of 999, even when there are more blocks (e.g 3000 block...
73,023,770
Is it possible to give parameters to program started from batch file?<p>Can I give parameters to a jar file when I'm opening it with a batch file?</p> <p>The batch file:</p> <pre><code>@ECHO OFF start java -jar 2D_TestGame.jar DebugMode = true </code></pre> <p>And this <code>debug mode = true</code> line giving a <code...
<p>This page describes how to pass parameters to a Java program's main-method using command line parameters: <a href="https://www.tutorialspoint.com/Java-command-line-arguments#:%7E:text=A%20command%2Dline%20argument%20is,array%20passed%20to%20main(%20)" rel="nofollow noreferrer">https://www.tutorialspoint.com/Java-com...
Is it possible to give parameters to program started from batch file?
java
0
55
1
73,026,312
73,026,312
2
true
2022-07-18T14:13:09.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to give parameters to program started from batch file?<p>Can I give parameters to a jar file when I'm opening it with a batch file?</p> <p>The...
72,786,559
Navbar component works in normal cases but breaks incase of getstatic props<p><a href="https://i.stack.imgur.com/zmnYu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zmnYu.png" alt="The error I am getting when navbar is in" /></a>I am trying to make a page with getstaticprops but I am unable to incl...
<p>Could you show us the <code>Navbar</code> code as well? can't really say what's going wrong without taking a look at the code.</p> <p>Edit: The problem is, when you import the Navbar component you are using a named import (an import with curly braces), and your Navbar component is a default export, so you should use...
Navbar component works in normal cases but breaks incase of getstatic props
javascript|reactjs|next.js
0
55
2
72,787,007
72,787,007
2
true
2022-06-28T12:36:03.853Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Navbar component works in normal cases but breaks incase of getstatic props<p><a href="https://i.stack.imgur.com/zmnYu.png" rel="nofollow noreferrer"><img sr...
73,000,039
Oracle - how to imitate bit columns and boolean AND/OR?<p>I come from MS SQL and My SQL. These DBMS provide a bit data type where the two boolean values are represented by 0 and 1.</p> <p>I am now in a project with Oracle that is new to me. There is no bit type. It (somewhere) advises to use NUMBER(1) as bit - so value...
<p>Use the functions <code>BITAND</code> (from at least Oracle 11) and <code>BITOR</code> (from Oracle 21, although undocumented) and put a <code>CHECK</code> constraint on your columns:</p> <pre class="lang-sql prettyprint-override"><code>SELECT abool, bbool, BITAND(abool, bbool), BITOR(abool, bbo...
Oracle - how to imitate bit columns and boolean AND/OR?
oracle|bit|operator-keyword
0
55
1
73,000,230
73,000,230
2
true
2022-07-15T22:11:06.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle - how to imitate bit columns and boolean AND/OR?<p>I come from MS SQL and My SQL. These DBMS provide a bit data type where the two boolean values are ...
72,814,055
Merge array elements group by properties in Javascript<p>I have the following javascript object array:</p> <pre><code> [ { &quot;firstName&quot;: &quot;x&quot;, &quot;lastName&quot;: &quot;y&quot;, &quot;age&quot;: 10}, { &quot;firstName&quot;: &quot;x&quot;, &quot;lastName&quot;: &quot;y&quot;, &quot;h...
<p><strong>Concept</strong></p> <p>Prepare a result array. Iterate through all the data. Check if the <code>firstName</code> and <code>lastName</code> exist in the result array. If no, push it into the result array. If yes, merge the object to get the missing properties.</p> <p><strong>Code</strong></p> <p><div class="...
Merge array elements group by properties in Javascript
javascript|typescript
1
55
2
72,814,266
72,814,266
2
true
2022-06-30T10:15:21.087Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Merge array elements group by properties in Javascript<p>I have the following javascript object array:</p> <pre><code> [ { &quot;firstName&quot;: &quot...
72,918,927
How to get all products from all categories<p>Could anyone assist me with my code I am trying to scrape products and prices from a patisserie website however it only retrieves the products on the main page. The rest of the products which are classified in categories have the same tags and attributes however when I run ...
<p>As mentioned you have to process all collections / categories and one approache could be to collect the links from your <code>baseUrl</code> - Note I used a <code>set comprehension</code> to get only unique urls and avoid to iterate the same categorie more than one time:</p> <pre><code>urlList = list(set(baseUrl+a['...
How to get all products from all categories
python|html|web-scraping|beautifulsoup|python-requests
1
55
1
72,919,383
72,919,383
2
true
2022-07-09T04:25:02.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get all products from all categories<p>Could anyone assist me with my code I am trying to scrape products and prices from a patisserie website however...
73,013,354
Excel (Mac) Formula - Group Like Items and Search Each Row<p>I've got a really huge excel file (14mb) that I need to remove certain rows based on criteria and can't figure out what the formula would look like to accomplish what I need.</p> <p>Here's an example of the data:</p> <pre><code>ID TYPE MA...
<p>My understanding of your question is like this:</p> <p><a href="https://i.stack.imgur.com/KAxrG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KAxrG.jpg" alt="enter image description here" /></a></p> <p>and this would be the formula:</p> <p>edit:</p> <p>If you just want TRUE/FALSE you can enter t...
Excel (Mac) Formula - Group Like Items and Search Each Row
excel|excel-formula
2
55
1
73,014,547
73,014,547
2
true
2022-07-17T16:07:58.410Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel (Mac) Formula - Group Like Items and Search Each Row<p>I've got a really huge excel file (14mb) that I need to remove certain rows based on criteria an...
73,021,388
how to add file path in django project<p>I am making an online judge in Django. I am taking user code in a file and then compile it and running it and giving the verdict. for example let say a user submitted code in c++ language so I am taking that code in a .cpp file and compile it and running it and I am doing it by ...
<p><strong>did you consider putting your cpp file inside static files and define STATIC_URL and STATICFILES_DIRS in your setting.py</strong></p> <p>you can put in the function you are using cpp file</p> <pre><code>import os print(os.getcwd()) </code></pre> <p>this script to know exact location of your script and put cp...
how to add file path in django project
python|django
1
55
1
73,021,478
73,021,478
2
true
2022-07-18T11:10:33.320Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to add file path in django project<p>I am making an online judge in Django. I am taking user code in a file and then compile it and running it and giving...
72,921,155
Why doesn't this one-liner that creates an array and pushes to it work?<p>When I run this code, it works, as you would expect:</p> <pre><code>var b = {} b['foo']=[] b['foo'].push(1) </code></pre> <p>But when I try doing this as a one-liner, like this:</p> <pre><code>var b = {} (b['foo']=[]).push(1) </code></pre> <p>It ...
<p>As noted by Reyno, this is parsed as</p> <pre class="lang-js prettyprint-override"><code>var b = {}(b['foo']=[]).push(1) </code></pre> <p><a href="https://stackoverflow.com/questions/56195773/is-a-semicolon-required-before-a-function-closure-in-javascript">since there is no semicolon</a> delimiting <code>var b = {}<...
Why doesn't this one-liner that creates an array and pushes to it work?
javascript|arrays|object|initialization
2
55
1
72,921,261
72,921,261
2
true
2022-07-09T11:55:38.997Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why doesn't this one-liner that creates an array and pushes to it work?<p>When I run this code, it works, as you would expect:</p> <pre><code>var b = {} b['f...
72,896,227
PyJWT get_signing_key_from_jwt throws PyJWKError: Unable to find a algorithm for key<p>My purpose is to simply get the JWKs key by supplying the access_token to the get_signing_key_from_jwt api</p> <p>(Using latest PyJWT==2.4.0 with python 3.8.10 on linux)</p> <p>like that:</p> <pre><code>import jwt jwks_uri=&quot;http...
<p>I noticed that the library file .venv/lib/python3.8/site-packages/jwt/algorithms.py will support additional algorithms <strong>only if cryptography lib is installed</strong></p> <p>so I've added cryptography==37.0.4 to my python dependencies and Voila, <strong>works</strong> (the key is retrieved successfully)</p> <...
PyJWT get_signing_key_from_jwt throws PyJWKError: Unable to find a algorithm for key
python|pyjwt
1
55
1
72,896,228
72,896,228
2
true
2022-07-07T10:28:43.460Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PyJWT get_signing_key_from_jwt throws PyJWKError: Unable to find a algorithm for key<p>My purpose is to simply get the JWKs key by supplying the access_token...
72,803,041
How to Properly use Array of Structures of C<p>I'm recently started learning about structures in C Language. I tried out a sample program to extend my learning curve. But, here in this subject, I'm facing few errors. Shall anyone please figure out the errors in the following program.</p> <pre><code>#include&lt;stdio.h&...
<p>Despite the other comments, if this is what you have to work with, then you'll still be wanting a solution.</p> <p>Try:</p> <pre><code>struct elements e[5] = { {1,1.008,&quot;Hydrogen&quot;,&quot;H&quot;}, {2,4.0026,&quot;Helium&quot;,&quot;He&quot;}, {3,6.94,&quot;Lithium&quot;,&quot;Li&quot;} }; </cod...
How to Properly use Array of Structures of C
arrays|c|data-structures|struct|structure
0
55
2
72,803,202
72,803,202
2
true
2022-06-29T14:22:18.240Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Properly use Array of Structures of C<p>I'm recently started learning about structures in C Language. I tried out a sample program to extend my learni...
72,792,573
How do I cast the result of GetProcAddress to a function pointer without -fpermissive on mingw?<p>When I use -fpermissive I can just write something like this:</p> <pre><code>void (*NtSetTimerResolution)(ULONG, bool, PULONG) = 0; int main() { NtSetTimerResolution = GetProcAddress(GetModuleHandle(&quot;ntdll.dll&qu...
<p>You need an explicit cast:</p> <pre><code>NtSetTimerResolution = reinterpret_cast &lt;void (*)(ULONG, bool, PULONG)&gt; (GetProcAddress(GetModuleHandle(&quot;ntdll.dll&quot;), &quot;NtSetTimerResolution&quot;)); </code></pre> <p>You might still be violating strict aliasing rules here, but you can use <code>-fno-stri...
How do I cast the result of GetProcAddress to a function pointer without -fpermissive on mingw?
c++
0
55
1
72,792,638
72,792,638
2
true
2022-06-28T20:08:43.337Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I cast the result of GetProcAddress to a function pointer without -fpermissive on mingw?<p>When I use -fpermissive I can just write something like thi...
72,875,252
Aggregating averages from large datasets for number of steps over period of time in ArangoDB<p>I previously touched on this problem in my post &quot;<a href="https://stackoverflow.com/questions/72637703/whats-the-best-way-to-return-a-sample-of-data-over-the-a-period">What's the best way to return a sample of data over ...
<p>I figured out the answer to this at about 2.00 am last night, waking up and scribbling down a general idea. I've just tested it and it seems to be running quite quickly.</p> <p>My thought was this: grabbing an average between two timestamps is a quick query, so if we simplify the overall query to simply run a filter...
Aggregating averages from large datasets for number of steps over period of time in ArangoDB
database|database-administration|arangodb|aql
1
55
1
72,886,996
72,886,996
2
true
2022-07-05T20:35:39.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Aggregating averages from large datasets for number of steps over period of time in ArangoDB<p>I previously touched on this problem in my post &quot;<a href=...
72,776,910
Second select element is not showing on browser<p>I'm having issues with my last row not showing at all when I compile the program. I tried many things but there seems to be an issue with the Select element because what ever I try to add after the first Select row doesn't show up.</p> <p>What am I missing?</p> <p>Here ...
<p>The second <code>&lt;select&gt;</code> is not shown, because the closing <code>&lt;/select&gt;</code> tag is missing. <code>&lt;select&gt;</code> tags are used with <code>&lt;option&gt;</code> tags inside them.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div ...
Second select element is not showing on browser
html|css
3
55
2
72,777,079
72,777,079
2
true
2022-06-27T18:37:35.130Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Second select element is not showing on browser<p>I'm having issues with my last row not showing at all when I compile the program. I tried many things but t...
73,011,192
How to get the percentage of points or the percentage that needs to get to the next level in Java?<p>I have a system that &quot;translates&quot; points of a player to a certain level, for example: If a player has 0-49 points it translates to level 0 and 50-299 points it translates to being at level 1 and so on.. The pr...
<p>From what I can tell you want to find the number of points needed to get to one level from another level. To do this you could think of your leveling system as an algebraic function where <code>x = points</code> and <code>y = level</code>.</p> <p>The function for calculating your level is <code>y = (25 + √(625 + 100...
How to get the percentage of points or the percentage that needs to get to the next level in Java?
java|math|integer|percentage|points
0
55
2
73,011,421
73,011,421
2
true
2022-07-17T10:59:32.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the percentage of points or the percentage that needs to get to the next level in Java?<p>I have a system that &quot;translates&quot; points of a ...
72,864,346
useEffect not triggered on state update by its dependency<p>I am trying to implement a seamless login and trigger another function when login is successful</p> <pre><code>const [token, setToken] = useState(); useEffect(() =&gt; { async function attemptLogin() { await fetch('http://localhost:3000/login') ...
<p>The problem is with this piece of code:</p> <pre><code> .then(data =&gt; console.log(data.data)) .then(data =&gt; setToken(JSON.stringify(data))) </code></pre> <p>In <code>.then()</code>, data is not passed on further to the next <code>.then()</code>. That is why the second <code>.then()</code> becomes...
useEffect not triggered on state update by its dependency
javascript|reactjs|react-hooks
1
55
2
72,864,442
72,864,442
2
true
2022-07-05T05:22:33.007Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: useEffect not triggered on state update by its dependency<p>I am trying to implement a seamless login and trigger another function when login is successful</...
72,857,900
Python OOP - calling a methode in a class<p>I am new in Python OOP and I am trying to understand one line of this Code (This is just a part of the whole Code)</p> <p>I am trying to understand what &quot;pet.name&quot; in the methode &quot;whichone&quot; do. The parameter 'petlist' in whichone can be empty or a list wit...
<p>Assuming the <code>petlist</code> parameter is a <code>List</code> of <code>Pet</code> objects, then the <code>for pet in petlist</code> line will iterate through the list and you will be able to use the <code>pet</code> variable to access the current element.</p> <p>What is happening in the for loop is that you che...
Python OOP - calling a methode in a class
python|oop
1
55
2
72,858,030
72,858,030
2
true
2022-07-04T13:55:37.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python OOP - calling a methode in a class<p>I am new in Python OOP and I am trying to understand one line of this Code (This is just a part of the whole Code...
72,775,702
Continue inside a forEach loop<p>It is standard practice to <code>continue</code> inside a loop if a certain condition is met/unmet. In a Javascript <code>forEach</code> loop, this produces a syntax error:</p> <pre><code>const values = [1, 2, 3, 4, 5]; values.forEach((value) =&gt; { if (value === 3) { continue; } ...
<p>As @robertklep stated forEach() is not a loop, it is a function. You cannot use the <code>continue</code> keyword inside a forEach loop because its functionality is meant to loop each item in the array.</p> <p>To achieve the similar behavior you can use,</p> <pre><code> for(let item of values){ if (item === 3)...
Continue inside a forEach loop
javascript|loops
0
55
2
72,775,855
72,775,855
2
true
2022-06-27T16:51:24.060Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Continue inside a forEach loop<p>It is standard practice to <code>continue</code> inside a loop if a certain condition is met/unmet. In a Javascript <code>fo...
72,891,098
PyQt5 - Assigning action to button class to update a label attribute from a different class<p>I'm creating a calculator app using PyQt5, and when I'm assigning an action to my button to update the label text that resides in a different class from the button class. It seems to be doing something, but instead of what I'm...
<p><sup>Note: this answer is mostly intended for <em>didactic</em> purposes. It somehow goes way beyond (or far away from) the original request, and has conceptual issues both in its resolution and result. Nonetheless, I believe it could be really educational for many (even unrelated) aspects of Python and Qt that are ...
PyQt5 - Assigning action to button class to update a label attribute from a different class
python|user-interface|pyqt5
0
55
1
72,891,967
72,891,967
2
true
2022-07-07T00:24:51.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PyQt5 - Assigning action to button class to update a label attribute from a different class<p>I'm creating a calculator app using PyQt5, and when I'm assigni...
73,016,638
Narrowing down to common JS methods and properties in TypeScript<p>Is there a way to make this TypeScript narrowing less ugly (or more elegant ;-) ❓</p> <p>With <code>IsSomething</code> type guard, I want to narrow down access to common methods and properties of any JavaScript variable which is <em>not</em> <code>null<...
<p>In TypeScript, every value except for <code>null</code> and <code>undefined</code> is assignable to the so-called <a href="https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes-oop.html#empty-types" rel="nofollow noreferrer"><em>empty object type</em> <code>{}</code></a>. So you can simplify your <co...
Narrowing down to common JS methods and properties in TypeScript
javascript|typescript|typeguards|narrowing|type-narrowing
1
55
2
73,016,837
73,016,837
2
true
2022-07-18T02:01:39.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Narrowing down to common JS methods and properties in TypeScript<p>Is there a way to make this TypeScript narrowing less ugly (or more elegant ;-) ❓</p> <p>W...
72,842,688
for loop to multiply index 0 with 1, index 1 with 2, index 2 with 3<p>how could i generate a loop that iterates through a array, and its just multiplying the next index?</p> <p>example:</p> <p>array= [0,1,2,3,4,5]</p> <pre><code>0x1 1x2 2x3 3x4 4x5 </code></pre> <p>i know that i need to have a nested loop, but I canno...
<p>The problem with your current implementation is that you are looping over every index twice: once for the outer loop and once for the inner loop. To get the item at the index after <code>i</code> you can simply write <code>Positions[i + 1].number</code>.</p> <p>You should loop over every index once like this:</p> <p...
for loop to multiply index 0 with 1, index 1 with 2, index 2 with 3
javascript|arrays
0
55
2
72,842,709
72,842,709
2
true
2022-07-02T21:58:36.353Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: for loop to multiply index 0 with 1, index 1 with 2, index 2 with 3<p>how could i generate a loop that iterates through a array, and its just multiplying the...
72,779,747
variable references & in Laravel<p>In the following code, I noticed <code>&amp;$list</code> is passed by reference in the loop, however <code>$user</code> and <code>$request</code> are passed by variables. Passing <code>$list</code> directly to the loop won't change <code>$list</code> outside the loop scope.</p> <pre><...
<p>Actually its the core PHP functionality rather than Laravel itself, basically when you are passing variables without reference, it actually clone the variable with the same name but in different locations. So, if you make any changes to it, there will be no changes to the value of the variable outside the scope.</p>...
variable references & in Laravel
php|laravel|eloquent
0
55
1
72,780,194
72,780,194
3
true
2022-06-28T01:16:42.387Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: variable references & in Laravel<p>In the following code, I noticed <code>&amp;$list</code> is passed by reference in the loop, however <code>$user</code> an...
72,789,515
c++ vector pointer reference issue<p>so I am having some issues with creating and using pointers for vectors. The problem I'm trying to solve with these pointers, is referencing data, without having an excess amount of code. This is how I'm currently defining the variables:</p> <pre><code>// Data vectors std::vector&lt...
<p>You want <code>pointerr-&gt;size()</code> (without a <code>*</code>); the <code>-&gt;</code> operator does the dereference of <code>pointerr</code> for you.</p> <p>Or alternatively, <code>(*pointerr).size()</code> which is equivalent. Your attempt of <code>*pointerr.size()</code> was close, but the <code>.</code> o...
c++ vector pointer reference issue
c++|pointers|vector|stdvector
0
55
1
72,789,581
72,789,581
3
true
2022-06-28T15:43:48.277Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c++ vector pointer reference issue<p>so I am having some issues with creating and using pointers for vectors. The problem I'm trying to solve with these poin...
72,807,142
Re-assign an element in a nested list KDB+/Q<p>I have a nested list like the following:</p> <pre><code>L:((2020.07.01 2020.09.30); (2020.10.01 2020.12.31); (2021.01.01 2021.03.31); (2021.04.01 2021.06.30); (2021.07.01 2021.09.30); (2021.10.01 2021.12.31); (2022.01.01 2022.03.31); (2022.04.01 2022.06.30)) </code></pre> ...
<p>Index at depth <a href="https://code.kx.com/q4m3/3_Lists/#382-indexing-at-depth" rel="nofollow noreferrer">https://code.kx.com/q4m3/3_Lists/#382-indexing-at-depth</a></p> <pre><code>q)L[7;1]:2022.05.31 q)L 2020.07.01 2020.09.30 2020.10.01 2020.12.31 2021.01.01 2021.03.31 2021.04.01 2021.06.30 2021.07.01 2021.09.30 2...
Re-assign an element in a nested list KDB+/Q
date|nested-lists|kdb
1
55
2
72,807,208
72,807,208
3
true
2022-06-29T19:56:05.780Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Re-assign an element in a nested list KDB+/Q<p>I have a nested list like the following:</p> <pre><code>L:((2020.07.01 2020.09.30); (2020.10.01 2020.12.31); (...
72,831,419
Can not copy local directory to remote container with docker using docker context<p>I have been working on my local machine with no issue using the <code>Dokerfile</code> below and <code>docker-compose.ylm</code></p> <p>Dokerfile</p> <pre><code>FROM node:14-alpine WORKDIR /app COPY package*.json ./ RUN npm install COP...
<p>The <code>volumes:</code> are always interpreted by the Docker daemon running the container. If you're using contexts to point at a remote Docker daemon, the <code>volumes:</code> named volumes and file paths are interpreted by that remote daemon, and point at files on the remote host.</p> <p>While <code>docker bui...
Can not copy local directory to remote container with docker using docker context
node.js|docker|docker-compose|dockerfile
1
55
1
72,831,599
72,831,599
3
true
2022-07-01T15:21:03.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can not copy local directory to remote container with docker using docker context<p>I have been working on my local machine with no issue using the <code>Dok...
72,846,461
How does MMAP_PAGE_ZERO personality flag work?<p>According to linux man pages, MMAP_PAGE_ZERO flag used in personality system call makes the system emulates SVr4 behavior, meaning that zero page is mapped as read only. However, this a little naive trial (visible in the code below) does not prevent segmentation fault oc...
<p>There are two reasons that wasn't working for you:</p> <ol> <li>The kernel only checks whether <code>MMAP_PAGE_ZERO</code> is set in <code>load_elf_binary</code>, so setting it after a process has started will have no effect.</li> <li>That setting doesn't override the <code>vm.mmap_min_addr</code> sysctl, which isn'...
How does MMAP_PAGE_ZERO personality flag work?
linux|system-calls
1
55
1
72,849,087
72,849,087
3
true
2022-07-03T12:21:38.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does MMAP_PAGE_ZERO personality flag work?<p>According to linux man pages, MMAP_PAGE_ZERO flag used in personality system call makes the system emulates ...
72,877,984
Java Generics - relationship between two type parameters<p>Fairly embarrassed to ask this is likely to turn out to be simple, but seemingly cannot find an answer.</p> <p>I have an interface Cacheable</p> <pre><code>/** K denotes the type of the key of a cacheable object */ public interface Cacheable&lt;K extends Se...
<p>You can't have higher-order generics in Java (which is why your <code>T&lt;K&gt;</code> trick doesn't compile), but you can have generics that are <em>bounded</em> by other generics. I believe you're looking for</p> <pre><code>public interface Cache&lt;K, T extends Cacheable&lt;K&gt;&gt; </code></pre>
Java Generics - relationship between two type parameters
java|generics
3
55
1
72,878,074
72,878,074
3
true
2022-07-06T04:31:47.433Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java Generics - relationship between two type parameters<p>Fairly embarrassed to ask this is likely to turn out to be simple, but seemingly cannot find an an...
72,909,339
Adding a certificate to Store then retrieve it<p>Disclaimer: I am 2 days into reading about Certificates/RSA Algorithms and Encrypt/Decrypt.</p> <p>I am trying to do a small app that communicates with Windows Key Store ( Certificate Store ) and where I should be able to read certificates/add certificates.</p> <p>I have...
<p>As @dimitar.bogdanov pointed out in comments, you are not adding the certificate to the store:</p> <pre><code>store.Certificates.Add(certificate); </code></pre> <p>here you are adding the certificate only to disconnected collection. Any changes in this collection object will not reflect actual store state. Instead, ...
Adding a certificate to Store then retrieve it
c#|windows|rsa|x509certificate2
0
55
1
72,909,557
72,909,557
3
true
2022-07-08T09:26:09.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding a certificate to Store then retrieve it<p>Disclaimer: I am 2 days into reading about Certificates/RSA Algorithms and Encrypt/Decrypt.</p> <p>I am tryi...
72,913,987
JQ - get keys without values in a simple list<p>I have a Pipfile.lock JSON file that I need to parse with the <code>jq</code> tool. The structure of the file is:</p> <pre><code>{ //... &quot;default&quot;: { &quot;value1&quot;: { // lots of nested properties with values }, ...
<p>You want the elements of the array, not the array itself.</p> <pre><code>jq '.default | keys[]' Pipfile.lock </code></pre> <p>Use the <code>-r</code> option to output raw strings, rather than JSON strings.</p> <pre><code>jq -r '.default | keys[]' Pipfile.lock </code></pre>
JQ - get keys without values in a simple list
json|shell|unix|jq
-1
55
1
72,914,055
72,914,055
3
true
2022-07-08T15:53:26.357Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JQ - get keys without values in a simple list<p>I have a Pipfile.lock JSON file that I need to parse with the <code>jq</code> tool. The structure of the file...
72,934,058
Writing function to find minimum value of 2-D array in VBA<p>I want to modify this sub procedure (Sub only) that looks for minimum temperature from 4 places (4 columns), into one with Function procedure.</p> <pre><code> Sub test() Dim i As Integer, j As Integer Dim temp(30, 3) As Integer Dim minTemp(3) As ...
<p><strong>(1)</strong> You can read data from Excel into an array with one statement.</p> <pre><code>Dim temp As Variant temp = ActiveSheet.Range(&quot;B2:E30&quot;).value </code></pre> <p>Note that <code>temp</code> is defined as <code>Variant</code>, not as array. A Variant can hold <em>anything</em>, and that incl...
Writing function to find minimum value of 2-D array in VBA
arrays|excel|vba
2
55
2
72,934,508
72,934,508
3
true
2022-07-11T05:24:06.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Writing function to find minimum value of 2-D array in VBA<p>I want to modify this sub procedure (Sub only) that looks for minimum temperature from 4 places ...
72,956,153
modifying elements of getElementsByClass results in NaN<p>I am running into trouble with this script below, as I take a collection based on a class name and then modify the class names of each member of the collection respectively the programs triggers that the very items of the collection are undefined.</p> <p>I assum...
<ul> <li><p>The main logic for below code is <code>toggle1.classList.contains(&quot;white&quot;)</code> this statement return true if toggle has class <code>white</code> else return false.</p> </li> <li><p>WIth DOM elements you can use this <code>classList</code> methods <code>classList.add()</code>,<code>classList.rem...
modifying elements of getElementsByClass results in NaN
javascript|html|css|getelementsbyclassname
0
55
3
72,956,364
72,956,364
3
true
2022-07-12T17:21:17.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: modifying elements of getElementsByClass results in NaN<p>I am running into trouble with this script below, as I take a collection based on a class name and ...
72,955,440
Why does CBCentralManager report "Peer removed pairing information" with 1st phone after 2nd phone is paired with device?<p><strong>Background</strong></p> <p>I'm using a couple of different hobbyist BLE devices (HM-10). This particular one is an <a href="https://amzn.to/3O32zNP" rel="nofollow noreferrer">example of o...
<blockquote> <p>Does BLE 4.0 Allow multiple devices to be paired &amp; bonded?</p> </blockquote> <p>Sure. But that doesn't mean that the device does. It needs to allocate memory for it, and smaller devices often don't.</p> <blockquote> <p>Do you know why the Peripheral would remove the pairing info? (again, this only o...
Why does CBCentralManager report "Peer removed pairing information" with 1st phone after 2nd phone is paired with device?
ios|swift|iphone|bluetooth-lowenergy|cbcentralmanager
2
55
1
72,956,406
72,956,406
3
true
2022-07-12T16:20:56.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does CBCentralManager report "Peer removed pairing information" with 1st phone after 2nd phone is paired with device?<p><strong>Background</strong></p> <...
72,960,615
How do I animate the color and width of a view?<p>I have a progress bar that I have written like such.</p> <pre><code>ZStack(alignment: .leading) { RoundedRectangle(cornerRadius: 20) .foregroundColor(.gray) .frame(width: 300, height: 20, alignment: .center) ...
<p>It is possible to do having each of progress view separate with own progress state that track changed value.</p> <p>Tested with Xcode 13.4 / iOS 15.5</p> <p><a href="https://i.stack.imgur.com/LtnNT.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LtnNT.gif" alt="demo" /></a></p> <p>Main part:</p> ...
How do I animate the color and width of a view?
ios|swiftui
2
55
1
72,961,726
72,961,726
3
true
2022-07-13T03:33:17.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I animate the color and width of a view?<p>I have a progress bar that I have written like such.</p> <pre><code>ZStack(alignment: .leading) { ...
72,986,257
How to build an easy to use cloud architecture<p>I'm a student and I'm supposed to set up a usable cluster for the university in the next semester. The main requirement is that other students can easily work with it. The cluster consists of 20 Linux PCs and 20 Macs. Other students should be able to quickly get applicat...
<p>Such questions are generally discouraged since they are not really questions but rather design problems but I'll answer anyway just to give you some idea.</p> <ol> <li>Keep in mind that an architecture with 40 machines is not something easy to achieve for a beginner, so you should have a lot of patience and dedicati...
How to build an easy to use cloud architecture
kubernetes|ansible|terraform|cloud|cluster-computing
-1
55
1
72,987,114
72,987,114
3
true
2022-07-14T20:21:23.593Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to build an easy to use cloud architecture<p>I'm a student and I'm supposed to set up a usable cluster for the university in the next semester. The main ...
73,013,798
Use of *n in free format RPG<p>So, I have got a job where fully free format RPG is used (even the D-Specs are in free).</p> <p>I am confused about the use of &quot;*N&quot; in various declarations. Like in data structures, procedure prototypes etc.</p> <p>My general understanding is that it is used as some sort of a pl...
<p>That's exactly right. *N indicates &quot;no name&quot;. In free-form, you can't just omit the name completely the way you can in fixed-form, so *N is used as a place-holder. You use this for subfields, prototype-parameters, procedure interfaces, and unqualified data structures.</p>
Use of *n in free format RPG
rpgle
1
55
2
73,021,281
73,021,281
3
true
2022-07-17T17:08:40.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use of *n in free format RPG<p>So, I have got a job where fully free format RPG is used (even the D-Specs are in free).</p> <p>I am confused about the use of...
72,789,667
I'm confused whether we can access the contents of list by not mentioning the index of elements in the code. Can someone explain this?<p>My tutor hasn't bothered to explicitly specify the index number to gain access to particular elements of a list. This seems strange to me and I believe it also affects the readability...
<h4>The explanation</h4> <p>In Python, we typically avoid iterating over indices, instead we iterate directly over the elements of all kinds of iterable objects. That's what your tutor is doing here.</p> <p>Iterating over elements means the same code will work regardless of the type of data structure you're iterating o...
I'm confused whether we can access the contents of list by not mentioning the index of elements in the code. Can someone explain this?
python
3
55
1
72,789,718
72,789,718
3
true
2022-06-28T15:55:10.243Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I'm confused whether we can access the contents of list by not mentioning the index of elements in the code. Can someone explain this?<p>My tutor hasn't both...