question_id
int64
37.6M
73.2M
input_text
stringlengths
88
52.4k
output_text
stringlengths
37
35.6k
title
stringlengths
15
150
tags
stringlengths
1
107
q_score
int64
-19
397
view_count
int64
3
879k
answer_count
int64
1
21
accepted_answer_id
int64
37.6M
73.8M
answer_id
int64
37.6M
73.8M
a_score
int64
-5
1.29k
is_accepted
bool
1 class
creation_date
stringlengths
20
24
input_text_instruct
stringlengths
251
52.6k
73,013,322
How do I extend a type argument so that it allows only string literal types but not 'string' itself?<p>I need a type that is essentially &quot;any string except for {reservedKeywords}&quot;. However, that is apparently <a href="https://stackoverflow.com/a/63549561/1730082">either impossible or tricky and undwieldly</a>...
<p>You could use a recursive constraint (so-called <a href="https://en.wikipedia.org/wiki/Bounded_quantification#F-bounded_quantification" rel="nofollow noreferrer">F-bounded quantification</a>) like <code>S extends Exclude&lt;string, S&gt;</code>:</p> <pre><code>type FiniteSet&lt;S extends Exclude&lt;string, S&gt;&gt;...
How do I extend a type argument so that it allows only string literal types but not 'string' itself?
typescript
1
62
1
73,013,395
73,013,395
1
true
2022-07-17T16:03:51.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I extend a type argument so that it allows only string literal types but not 'string' itself?<p>I need a type that is essentially &quot;any string exc...
73,019,307
How to split a string with space into two lines in python<p>I am trying to split github.com/pmezard/go-difflib v1.0.0 into name and version</p> <p>I tried like this but it only split into 2. output i am getting is [{'name': 'pmezard', 'version': 'v1.0.0\n'}]</p> <p>Expected output [{'name': 'go-difflib', 'version': 'v1...
<p>Considering all string of format <code>github.com/pmezard/go-difflib v1.0.0</code></p> <pre class="lang-py prettyprint-override"><code>path = foldername + &quot;/example.txt&quot; print(path) file = open(path) Lines = file.readlines() file.close() # close file List = [] for line in Lines: try: link,...
How to split a string with space into two lines in python
python
0
62
4
73,019,385
73,019,385
1
true
2022-07-18T08:21:52.700Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to split a string with space into two lines in python<p>I am trying to split github.com/pmezard/go-difflib v1.0.0 into name and version</p> <p>I tried li...
73,021,335
How to parse this JSON file in Snowflake?<p>So I have a column in a Snowflake table that stores JSON data but the column is of a varchar data type.</p> <p>The JSON looks like this:</p> <pre><code>{ &quot;FLAGS&quot;: [], &quot;BANNERS&quot;: {}, &quot;TOOLS&quot;: { &quot;game.appC...
<p>I assumed that the TOOLs can have more than one tool ID, so I wrote this query:</p> <pre><code>with mydata as ( select '{ &quot;FLAGS&quot;: [], &quot;BANNERS&quot;: {}, &quot;TOOLS&quot;: { &quot;game.appConfig&quot;: { &quot;type&quot;: [ ...
How to parse this JSON file in Snowflake?
sql|json|database|parsing|snowflake-cloud-data-platform
0
62
2
73,021,553
73,021,553
1
true
2022-07-18T11:05:45.343Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to parse this JSON file in Snowflake?<p>So I have a column in a Snowflake table that stores JSON data but the column is of a varchar data type.</p> <p>Th...
73,023,370
How can I configure PyCharm so that it automatically installs any missing Python package?<p>When running a Python script in Python, Python packages are sometimes missing from the python environment being used:</p> <p><a href="https://i.stack.imgur.com/ODpP4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur...
<p>As others have said - wise to avoid automatic installs</p> <p>Run deployments in PyCharm via a CLI rather than the Studio. This will facilitate construction of batch scripts to drive the install (in your preferred OS interpreter). The output of installs are then easily spooled to a log file. Then a couple of comm...
How can I configure PyCharm so that it automatically installs any missing Python package?
python|pycharm
-5
62
1
73,023,789
73,023,789
1
true
2022-07-18T13:45:06.687Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I configure PyCharm so that it automatically installs any missing Python package?<p>When running a Python script in Python, Python packages are somet...
73,011,236
Image and Video links do not open in Electron app<p>Hi, I face a very weird thing from electron that I could not understand why. Suppose we develop a very simple webView tag based electron app like following link</p> <p><a href="https://github.com/cba85/electron-webview" rel="nofollow noreferrer">simple electron webvie...
<p>I find a link and based on it, I can remove this bug.</p> <p><a href="https://stackoverflow.com/questions/48298364/choose-which-popups-should-be-allowed-from-webview-in-electron-app">Choose which popups should be allowed from webview in electron app</a></p> <p>This is the updated fork of electron-webview project tha...
Image and Video links do not open in Electron app
image|video|webview|electron|tags
1
62
1
73,047,958
73,047,958
1
true
2022-07-17T11:07:02.263Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Image and Video links do not open in Electron app<p>Hi, I face a very weird thing from electron that I could not understand why. Suppose we develop a very si...
73,007,121
why can't i use casting to deal with pointer to pointer variable without using double asterisks? - This is purely academic<p>I was just trying something to understand pointer to pointer deeply. I write the code below</p> <pre><code>int x = 20; int *p0 = &amp;x; int *p1 = &amp;p0; printf(&quot;*p0 = %d\n&quot;, *p0); pr...
<p>I think what you want to know is why this is happening:</p> <p>let's say there are 3 boxes of memory</p> <p>x y z<br /> 20 &amp;x &amp;y</p> <p>why cant you do that *((int *) *z) =&gt; =&gt; *y =&gt; =&gt; x</p> <p>and the answer is you should <strong>compile your code with warning flags</strong> a...
why can't i use casting to deal with pointer to pointer variable without using double asterisks? - This is purely academic
c|pointers|casting|segmentation-fault|pointer-to-pointer
0
62
2
73,007,210
73,007,210
1
true
2022-07-16T19:33:33.287Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why can't i use casting to deal with pointer to pointer variable without using double asterisks? - This is purely academic<p>I was just trying something to u...
72,860,106
MPAndroidChart line chart label attached to the line<p>I want to achieve an effect similar to this using the MPAndroidChart library <a href="https://i.stack.imgur.com/PDnHa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PDnHa.png" alt="enter image description here" /></a></p> <p>I want my label to b...
<p>A possible way is to use the marker, chart.setMarker(), but marker only shows when user tap on the chart, if you want the marker to show constantly, an custom chart can be invoked and override the function drawMarkers like this, the marker is drawn in the middle of chart:</p> <pre><code>@Override protected void draw...
MPAndroidChart line chart label attached to the line
android|charts|label|mpandroidchart|linechart
0
62
1
72,863,563
72,863,563
1
true
2022-07-04T17:12:04.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MPAndroidChart line chart label attached to the line<p>I want to achieve an effect similar to this using the MPAndroidChart library <a href="https://i.stack....
72,962,869
Filtering tf data ZipDataset<p>I have a dataset with images loaded with <code>image_dataset_from_directory</code> with 4 classes containing tuples of <code>(image, label).</code><br /> What i did was create a column <code>'id'</code> with the same size as the dataset, convert this column to a tf data dataset and concat...
<p><code>x[0]</code> is a tuple and <code>x[1]</code> contains the client-ids when iterating over your dataset. Maybe try:</p> <pre><code>import tensorflow as tf a = tf.data.Dataset.range(1, 4) # ==&gt; [ 1, 2, 3 ] b = tf.data.Dataset.range(4, 7) # ==&gt; [ 4, 5, 6 ] dataset = tf.data.Dataset.zip((tf.data.Dataset.zi...
Filtering tf data ZipDataset
python|python-3.x|tensorflow|tensorflow2.0|tensorflow-datasets
1
62
1
72,963,006
72,963,006
1
true
2022-07-13T08:06:11.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filtering tf data ZipDataset<p>I have a dataset with images loaded with <code>image_dataset_from_directory</code> with 4 classes containing tuples of <code>(...
72,906,846
Can I recalculate the energy of an awkward array of Vectors by declaring a new mass value?<p>My question is about the <code>Vector</code> module in scikit-hep.</p> <p><a href="https://vector.readthedocs.io/en/latest/index.html" rel="nofollow noreferrer">https://vector.readthedocs.io/en/latest/index.html</a></p> <p>I ha...
<p>This is a well written question, thank you for the effort!</p> <p>The answer here is yes, you can set a new value for the mass! One would do this updating the <code>mass</code> field using <code>ak.with_field</code>, or using the subscript <code>__setitem__</code> operator, e.g.</p> <pre class="lang-py prettyprint-o...
Can I recalculate the energy of an awkward array of Vectors by declaring a new mass value?
python|awkward-array
2
62
1
72,929,486
72,929,486
1
true
2022-07-08T05:02:23.370Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I recalculate the energy of an awkward array of Vectors by declaring a new mass value?<p>My question is about the <code>Vector</code> module in scikit-he...
72,854,101
Remove multiple rows based on condition in multiple columns in pandas<p>I have dataset like this from csv file.<a href="https://i.stack.imgur.com/9FoV6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9FoV6.png" alt="enter image description here" /></a></p> <p>I want to remove all records that has que...
<p>Filter all rows without <code>?</code> with space:</p> <pre><code>out = df[(df != ' ?').all(axis=1)] </code></pre> <p>Or if possible use <code>read_csv</code> and no missing values, only <code>?</code> use:</p> <pre><code> out = pd.read_csv(file, na_values=' ?').dropna() </code></pre>
Remove multiple rows based on condition in multiple columns in pandas
python|pandas|jupyter-notebook|jupyter
1
62
1
72,854,174
72,854,174
1
true
2022-07-04T08:55:04.733Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove multiple rows based on condition in multiple columns in pandas<p>I have dataset like this from csv file.<a href="https://i.stack.imgur.com/9FoV6.png" ...
72,811,050
How to get ParcelableExtra from RecyclerView<p>I had one learning project that require RecyclerView item to send his detailed data to another activity with getParcelableExtra, my problem is when I clicked the item, the data is null on detailsActivity then I check it with the log.d, and yes it's null. any solution ;</p>...
<p>The problem is here</p> <pre><code>intent.putExtra(&quot;DATA&quot;, dataHero.photo) intent.putExtra(&quot;DATA&quot;, dataHero.name) intent.putExtra(&quot;DATA&quot;, dataHero.description) </code></pre> <p>You are sending single item in your intent as a String with the same key name</p> <p>The first solution would ...
How to get ParcelableExtra from RecyclerView
android|android-studio|kotlin|android-recyclerview|parcelable
0
62
3
72,811,136
72,811,136
1
true
2022-06-30T06:12:08.500Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get ParcelableExtra from RecyclerView<p>I had one learning project that require RecyclerView item to send his detailed data to another activity with g...
72,880,081
Create a new div every nth array element and append item<p>I have an array of elements. What I want is to add the elements to a div but strategically. First, add class <code>.wrapperItems</code> then add only 5 elements from the array then if there are more elements left in the array create a new <code>.wrapperItems</c...
<p>This is really a question about how to chunk an array into an array of arrays.</p> <p>This can be done by mapping and grouping.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><co...
Create a new div every nth array element and append item
javascript
0
62
4
72,880,221
72,880,221
1
true
2022-07-06T08:20:00.003Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a new div every nth array element and append item<p>I have an array of elements. What I want is to add the elements to a div but strategically. First,...
72,794,098
Combining two JSONS in a dataframe in scala<p>I'm working with a dataframe at below. What I want to do is combine the JSONS of column <code>JSON1</code> and <code>JSON2</code> if the <code>FLAG</code> = Y and insert the values into <code>JSON2</code>.</p> <pre><code>+--------------------+-------------------------+-----...
<p>Unfortunately, You appear to be on a very old version of Scala. <code>scala.util.parsing.json</code> was deprecated and removed years ago in favor of external libraries. <a href="https://github.com/circe/circe" rel="nofollow noreferrer">Circe</a> would be a common one used today.</p> <pre><code>import io.circe.parse...
Combining two JSONS in a dataframe in scala
dataframe|scala|apache-spark
0
62
1
72,795,297
72,795,297
1
true
2022-06-28T23:10:01.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combining two JSONS in a dataframe in scala<p>I'm working with a dataframe at below. What I want to do is combine the JSONS of column <code>JSON1</code> and ...
72,795,498
Crawling news articles with BeautifulSoup<p>I want to crawl maritime news from <a href="https://www.fleetmon.com/maritime-news/" rel="nofollow noreferrer">Fleetmon.com news</a> as well as with detail pages and save it in text file. I tried BeautifulSoup in python but it not work properly..</p> <pre><code>import request...
<p>Go to the details page (here I use req2 to go to the details page) and I 've made the pagination using for loop and range function and you can increase or decrease the page numbers with no time.</p> <p>P/S: If you click on any title link then you can see the details page and from the details pages are scraped all r...
Crawling news articles with BeautifulSoup
python|beautifulsoup|web-crawler
0
62
1
72,796,348
72,796,348
1
true
2022-06-29T03:29:47.473Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Crawling news articles with BeautifulSoup<p>I want to crawl maritime news from <a href="https://www.fleetmon.com/maritime-news/" rel="nofollow noreferrer">Fl...
73,031,256
How to show error text in TextFormField in Flutter below it and not in it<p>I have sign up page where user has to enter info in text form field. I have added validator that field can't be empty or min of 5 or xyz characters should be entered to pass through. My question is how can I make the error message display below...
<p><code>main.dart</code> file:</p> <pre><code>import 'package:flutter/material.dart'; void main() =&gt; runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: Padding( padding: EdgeInsets.all(30),...
How to show error text in TextFormField in Flutter below it and not in it
flutter
0
62
4
73,031,623
73,031,623
1
true
2022-07-19T04:48:18.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to show error text in TextFormField in Flutter below it and not in it<p>I have sign up page where user has to enter info in text form field. I have added...
72,783,699
check if value appears within list created from key() step in gremlin<p>I have a vertex that has a 'title' property. I have other vertices that have outgoing edges that have multiple properties. I'm trying to find vertices that have outgoing edges where the 'title' property value is a property key on the edge.</p> <p>F...
<p>Try this:</p> <pre><code>g .V('alice') .outE() .as('b') .otherV() .hasId('bob') .as('c') .select('b') .aggregate('keys').by(properties().key()) .select('c') .out() .where(values().where(within('keys'))) .valueMap('title') .toList() </code></pre>
check if value appears within list created from key() step in gremlin
gremlin|tinkerpop|amazon-neptune|gremlinjs
1
62
2
72,786,317
72,786,317
1
true
2022-06-28T09:10:21.657Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: check if value appears within list created from key() step in gremlin<p>I have a vertex that has a 'title' property. I have other vertices that have outgoing...
72,827,135
Django: how to upload media files to different folders?<p>I want to save file in automatically created folder related with Employee id_number like:</p> <p><code>media-&gt;employee-&gt;attachments-&gt;emp001-&gt;emp001.pdf</code></p> <p><strong>models.py</strong></p> <pre><code>from django.db import models class...
<p>This will change a path of cv on <code>EmployeeAttachments</code> according to your <code>Employee id</code></p> <pre><code>def facility_path(instance, filename): return f'attachments/employee/emp{instance.employee.id}/emp{instance.employee.id}.pdf' class EmployeeAttachments(models.Model): employee = mode...
Django: how to upload media files to different folders?
python|django|django-models|django-file-upload|django-media
1
62
1
72,827,394
72,827,394
1
true
2022-07-01T09:24:39.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django: how to upload media files to different folders?<p>I want to save file in automatically created folder related with Employee id_number like:</p> <p><c...
72,905,633
making latex table<p>Can anyone give an idea on how to make this table? <img src="https://i.stack.imgur.com/fm6jR.png" alt="enter image description here" /></p>
<p>Use \begin{table} [...] \end{table}<br /> Here is a minimal working example:</p> <pre><code>\begin{table} \centering \begin{tabular}{l r} &amp; 119 Responses\\ Field &amp; Percentage \\ \hline Very convenient &amp; 63\% \\ Sowewhat convenient &amp; 28...
making latex table
latex|tex
-2
62
1
72,911,741
72,911,741
1
true
2022-07-08T00:55:56.933Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: making latex table<p>Can anyone give an idea on how to make this table? <img src="https://i.stack.imgur.com/fm6jR.png" alt="enter image description here" /><...
72,791,248
What's the difference between overflow: auto and overflow: clip?<p>Simple question, one element has overflow:auto and another element has overflow:clip. What is the difference?</p> <pre class="lang-css prettyprint-override"><code>.some-div{ overflow: auto; } .another-div{ overflow: clip; } </code></pre>
<p>From <a href="https://drafts.csswg.org/css-overflow/#overflow-properties" rel="nofollow noreferrer">the specification</a></p> <blockquote> <p>If the computed value of overflow on a block box is neither visible nor clip nor a combination thereof, it establishes an <strong>independent formatting context</strong> for i...
What's the difference between overflow: auto and overflow: clip?
css
-1
62
1
72,792,224
72,792,224
1
true
2022-06-28T18:06:48.577Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the difference between overflow: auto and overflow: clip?<p>Simple question, one element has overflow:auto and another element has overflow:clip. What...
72,831,995
os.execv(sys.executable) uses wrong Python version<p>I want to restart a script from <strong>within</strong> itself. However on Linux <code>os.execv</code> ignores <code>sys.executable</code> and falls back to the default python version, 2.7. <br>Here is a minimal running example :</p> <pre class="lang-py prettyprint-o...
<p>Explicit specification of the Python version in <code>execv()</code> does not result in a fallback to the Python 2 version like the specification only of <code>python</code> does. See the code ( which is not executing an endless loop):</p> <pre><code>import os, sys, time strF = None try: f = open(&quot;counter...
os.execv(sys.executable) uses wrong Python version
python|python-3.x|linux
1
62
1
72,835,519
72,835,519
1
true
2022-07-01T16:08:54.383Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: os.execv(sys.executable) uses wrong Python version<p>I want to restart a script from <strong>within</strong> itself. However on Linux <code>os.execv</code> i...
72,768,953
How to filter out the file path using grok filter and add as new field<p>I want to filter out <code>scm_output</code> portion from <code>/lib/logs/scm_output.log</code> this file path and <code>abc_output</code> from this file path , <code>/lib/logs/abc_output.log</code>, and add new fields as <code>scm_output</code> ...
<p>The below grok pattern should work for you</p> <pre><code>grok { match =&gt; {&quot;message&quot; =&gt; &quot;%{GREEDYDATA:PATH}/%{GREEDYDATA:filename}.log&quot;} } </code></pre> <p>Keep Posted!!! Thanks !!!</p>
How to filter out the file path using grok filter and add as new field
elasticsearch|logstash|logstash-grok|elk
0
62
1
72,771,762
72,771,762
1
true
2022-06-27T08:15:29.873Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to filter out the file path using grok filter and add as new field<p>I want to filter out <code>scm_output</code> portion from <code>/lib/logs/scm_output...
72,884,809
Bulk rename file(s) using Powershell from csv\txt file<p>As the title suggests I am trying to create a Powershell script to rename multiple files. The script refers to a csv file which contains a string in a csv file &quot;column A&quot;. If the result is true then I would like to rename the file from &quot;Column B&qu...
<p>The following assumes that your CSV file contains the file names <em>with</em> extension - adjust as needed.</p> <ul> <li><p>Build a <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_Hash_Tables" rel="nofollow noreferrer">hashtable</a> from the CSV whose entries are ke...
Bulk rename file(s) using Powershell from csv\txt file
powershell|file-rename
1
62
1
72,885,000
72,885,000
1
true
2022-07-06T13:52:44.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bulk rename file(s) using Powershell from csv\txt file<p>As the title suggests I am trying to create a Powershell script to rename multiple files. The script...
72,943,817
Difficulty Selecting Element using Selenium<p><a href="https://www.glassdoor.com/Job/us-data-scientist-jobs-SRCH_IL.0,2_IN1_KO3,17.htm?srs=JOBS_HOME_RECENT_SEARCHES" rel="nofollow noreferrer">Glassdoor Job Search Link</a></p> <p>Currently attempting to select the &quot;sector&quot; for a job posting. Not having an luck...
<p>Looks like I was missing the click through to the other tab on the page.</p> <pre><code>driver.find_element(By.XPATH,'.//div[@class=&quot;css-r7fjfn ead8scz1&quot;]').click() </code></pre> <p>Thanks all that attempted to assist!</p>
Difficulty Selecting Element using Selenium
python|selenium|web-scraping|data-science
0
62
2
72,982,355
72,982,355
1
true
2022-07-11T19:40:01.773Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Difficulty Selecting Element using Selenium<p><a href="https://www.glassdoor.com/Job/us-data-scientist-jobs-SRCH_IL.0,2_IN1_KO3,17.htm?srs=JOBS_HOME_RECENT_S...
72,851,433
Split element within xslt file<p>I have the following input</p> <pre><code>UK/006/10 US/004/12 </code></pre> <p>And wanted to get the following output.</p> <pre><code>Country: UK Code:006 Line: 10 Country: US Code:004 Line:12 </code></pre> <p>I tried to use following, but I need something simple, like split function. ...
<p>Using <a href="https://invisiblexml.org/" rel="nofollow noreferrer">Invisible XML</a>, you could define a grammar for your text data to map it to XML, then an extension function library like the CoffeeSacks library to Saxon Java can be used in XSLT to parse and post-process the text so that with e.g. the XML input b...
Split element within xslt file
xslt
0
62
1
72,856,846
72,856,846
1
true
2022-07-04T03:16:51.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split element within xslt file<p>I have the following input</p> <pre><code>UK/006/10 US/004/12 </code></pre> <p>And wanted to get the following output.</p> <...
72,814,208
How to solve this specific SQL query? My solution also returns not wanted values<p>I have three tables in my DB:</p> <ul> <li>&quot;<em>Film</em>&quot;, which contains details regarding movies</li> <li>&quot;<em>Sale</em>&quot;, which contains details regarding theathers where movies are projected</li> <li>&quot;<em>Pr...
<p>You should first inner join &quot;<em>film</em>&quot; with &quot;<em>proiezioni</em>&quot;, such that you'll ensure to get projected films. Then you can exclude all theathers where the film was projected in any city other than &quot;<em>Pisa</em>&quot;, which will output films that were projected in Pisa only.</p> <...
How to solve this specific SQL query? My solution also returns not wanted values
mysql|sql
2
62
2
72,814,441
72,814,441
1
true
2022-06-30T10:25:47.147Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to solve this specific SQL query? My solution also returns not wanted values<p>I have three tables in my DB:</p> <ul> <li>&quot;<em>Film</em>&quot;, whic...
73,021,191
Extract difference in consecutive values for MySQL 5.7<div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Name</th> <th>Date</th> <th>Hours</th> <th>Count</th> </tr> </thead> <tbody> <tr> <td>Mills</td> <td>2022-07-17</td> <td>23</td> <td>12</td> </tr> <tr> <td>Mills</td> <td>2022-07-18</td> <td>00...
<p>In <strong>MySQL 5.7</strong> you can update your variable inline in order to contain your updated value of &quot;<em>Count</em>&quot;. Since when the value of &quot;<em>Name</em>&quot; changes you need to reset your variable, you can use another variable that contains the previous &quot;<em>Name</em>&quot; value. T...
Extract difference in consecutive values for MySQL 5.7
mysql|sql
2
62
2
73,021,710
73,021,710
1
true
2022-07-18T10:53:57.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract difference in consecutive values for MySQL 5.7<div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Name</th> <th>Date</th> <th>Ho...
73,019,548
Regex for getting integers and hyphen with spaces (special pattern recognition)<p>Here is the data I want to capture (10 - 12) &lt;===== This format</p> <p>Sample Data:</p> <pre class="lang-none prettyprint-override"><code>sdfdsfsdffsd 16.50sd - 57676766.0sd 16.50sd - 57676766.0sd 16.50sd - 57676766.0sd sdfsdffsdf 6sd ...
<p>If you only want the first digits before the dot and there has to be a hyphen in between, you can use 2 capture groups:</p> <pre><code>(\d+)(?:\.\d+)?[^\s\d-]*(\s-\s)[^\d-]*(\d+) </code></pre> <p><strong>Explanation</strong></p> <ul> <li><code>(\d+)</code> Capture 1+ digits in group 2</li> <li><code>(?:\.\d+)?</code...
Regex for getting integers and hyphen with spaces (special pattern recognition)
java|regex
2
62
1
73,020,084
73,020,084
1
true
2022-07-18T08:43:57.547Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex for getting integers and hyphen with spaces (special pattern recognition)<p>Here is the data I want to capture (10 - 12) &lt;===== This format</p> <p>S...
72,801,678
Trigger the setter method of a field based on the field's JsonProperty<p>I have a class as follows:</p> <pre><code>public class MyClass { @JsonProperty(&quot;my_id&quot;) private String id; public getId() { return this.id; } public setId(String id) { this.id = id; } } </code></pre> <p>I ...
<p>If you don't have message with you, in that case I think reflection only can help you and if you use reflection you even don't need to call setter method for setting value, you can use below code to set the value-</p> <pre><code>public void myMethod(MyClass myClass, String jsonProperty, String newId) throws IllegalA...
Trigger the setter method of a field based on the field's JsonProperty
java|reflection
1
62
3
72,802,427
72,802,427
1
true
2022-06-29T12:46:35.803Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trigger the setter method of a field based on the field's JsonProperty<p>I have a class as follows:</p> <pre><code>public class MyClass { @JsonProperty(&q...
72,943,189
Function to calculate the sum of numbers defined in a list and in a dictionary in python / using * and **<p>Given a list and a dictionary, I want to calculate the sum of its elements. Here's how I tried to do it</p> <pre><code>def sum(*arg , **argv): S=0 for i , j in arg, list(argv.values()): S+= i + j ...
<p>If you print out the values of <code>arg</code> and <code>argv</code> in the function, you will see that the value of <code>arg</code> is <code>([1, 2], {'a': 1, 'b': 2})</code> while the value of <code>argv</code> is an empty dict <code>{}</code>, which is most likely not what you intended. Now there are multiple p...
Function to calculate the sum of numbers defined in a list and in a dictionary in python / using * and **
python-3.x
0
62
1
72,944,611
72,944,611
1
true
2022-07-11T18:38:54.693Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Function to calculate the sum of numbers defined in a list and in a dictionary in python / using * and **<p>Given a list and a dictionary, I want to calculat...
72,780,313
Simplify & Optimize PHP Array<p>I am working on combining the array into a key with the count of repeated &quot;option&quot;&quot;code&quot;. My Request JSON is like this</p> <pre><code>[{ &quot;productId&quot;: &quot;DENSUS-MARK&quot;, &quot;options&quot;: [ { &quot;code&quot;: &quot;HIGLIG...
<p>I don't know if this is the optimization you want. Meanwhile, less than two loops, I have not found. It's not quite the expected result, but you should be able to fix it if you need to.</p> <p>With:</p> <pre><code>$input = array ( 0 =&gt; array ( 'productId' =&gt; 'DENSUS-MARK', 'options' =&gt; arr...
Simplify & Optimize PHP Array
php|multidimensional-array
1
62
1
72,784,890
72,784,890
1
true
2022-06-28T03:03:10.520Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simplify & Optimize PHP Array<p>I am working on combining the array into a key with the count of repeated &quot;option&quot;&quot;code&quot;. My Request JSON...
73,016,460
How to split a long string based on delimiter in R<p>I have a dataframe with a column having few records with long string which I want to split based on delimeter <code>\n-</code></p> <p>for example in below dataframe I want to split the values in a second column based on delimeter from second record onwards by keeping...
<p>Something like this should do it as long as you know the maximum number of parts you expect.</p> <pre><code>dat &lt;- data.frame( Sr_no = 1:3, Col1 = c(&quot;Lorem Ipsum is simply dummied text&quot;, &quot;\n- Lorem Ipsum is simply dummied text,\n- Lorem Ipsum is simply dummied text ,\n- Lorem Ipsum i...
How to split a long string based on delimiter in R
r
0
62
3
73,016,561
73,016,561
1
true
2022-07-18T01:17:15.150Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to split a long string based on delimiter in R<p>I have a dataframe with a column having few records with long string which I want to split based on deli...
73,016,630
Laravel how to get value from different tables at the controller<p>I have a jQuery call in my page that takes data from a link I made in the controller like this:</p> <pre><code>public function api(Request $request , $project_id){ return Program::where('project_id',$project_id)-&gt;get(); } </code></pre> <p>result...
<p>you can use WITH if ORM is setup in model, or you can use joins to get zone table along with program. it would look something like this.</p> <pre><code>return Program::where('project_id',$project_id) -&gt;select('programs.*', 'zones.name') -&gt;join('zones', 'programs.zone_id', '=', 'zones.id') -&gt;get(...
Laravel how to get value from different tables at the controller
javascript|php|jquery|mysql|laravel
0
62
2
73,018,862
73,018,862
1
true
2022-07-18T02:00:40.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel how to get value from different tables at the controller<p>I have a jQuery call in my page that takes data from a link I made in the controller like ...
72,801,855
What is the meaning of "= |" in Verilog?<p>Can someone please tell me what is the meaning of &quot;= |&quot; in these Verilog lines:</p> <pre><code>wire result; wire [NUM_BITS-1:0] pterms; assign result = | pterms; </code></pre> <p>If it means <code>assign result = result | pterms</code>, then does this mean that it do...
<p>No, in your code, <code>|</code> is the reduction-OR operator which does a bitwise OR of all the bits of <code>pterms</code> and assigns the 1-bit result to the <code>result</code> wire. Refer to IEEE Std 1800-2017, section 11.4.9 <em>Reduction operators</em>.</p> <p>If <code>pterms</code> is 4 bits, then the assig...
What is the meaning of "= |" in Verilog?
verilog
2
62
1
72,801,986
72,801,986
1
true
2022-06-29T13:00:19.897Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the meaning of "= |" in Verilog?<p>Can someone please tell me what is the meaning of &quot;= |&quot; in these Verilog lines:</p> <pre><code>wire resu...
72,986,981
Porting custom job from GCP AI Platform to Vertex AI - how to get state and logs of job?<p>I am porting custom job training from gcp AI Platform to Vertex AI. I am able to start a job, but can't find how to to get the status and how to stream the logs to my local client.</p> <p>For AI Platform I was using this to get t...
<p>Can you try this command for streaming logs :</p> <pre><code>gcloud ai custom-jobs stream-logs 123 --region=europe-west4 </code></pre> <p>123 is the <strong>ID</strong> of the custom job for this case, you can add glcoud wide flags such as --format as well.</p> <p>You can visit this <a href="https://cloud.google.com...
Porting custom job from GCP AI Platform to Vertex AI - how to get state and logs of job?
google-cloud-platform|google-cloud-vertex-ai|google-ai-platform
0
62
1
72,988,678
72,988,678
1
true
2022-07-14T21:47:19.540Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Porting custom job from GCP AI Platform to Vertex AI - how to get state and logs of job?<p>I am porting custom job training from gcp AI Platform to Vertex AI...
72,872,361
JQ - Remove Duplicate Array Values<p>Edited for better clarity</p> <p>I am using the following jq query to extract the AWS ARN and associated protocols. However I only need the ARN to be listed once followed by the ports and protocols</p> <p>my code is <code>jq -r '.Listeners[] | (.LoadBalancerArn), (.Protocol)'</code>...
<p>Group by the common field and iterate over the groups, then output the common field of the first (which is the same for the whole group), and iterate again to output other fields from the same group:</p> <pre class="lang-bash prettyprint-override"><code>jq -r '.Listeners | group_by(.LoadBalancerArn)[] | .[0].LoadB...
JQ - Remove Duplicate Array Values
json|jq
0
62
4
72,874,637
72,874,637
1
true
2022-07-05T15:56:01.233Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JQ - Remove Duplicate Array Values<p>Edited for better clarity</p> <p>I am using the following jq query to extract the AWS ARN and associated protocols. Howe...
72,824,577
Lodash to check object property on array elements<p>I want to use lodash to find a property of an object at a specific array element.</p> <p>Lets say I am hitting an api and getting response which sets it to the react state &quot;personsDetails&quot; (whose initial value was null), so now it becomes</p> <pre><code>let ...
<p>You can still use <code>get</code> and set the default as <code>null</code></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>let personsDetails=[{name:'king',id:2},{name:'que...
Lodash to check object property on array elements
javascript|reactjs|lodash
2
62
1
72,824,761
72,824,761
1
true
2022-07-01T05:05:21.503Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Lodash to check object property on array elements<p>I want to use lodash to find a property of an object at a specific array element.</p> <p>Lets say I am hi...
72,823,377
How to Compare String in a Dataframe column with a sub-string in another Dataframe and extract the value<p><strong>I have 2 dataframes:</strong> DF1</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>ID</th> <th>Name</th> <th>Category----</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>Apple</...
<p><strong>Edit - Second solution below as per OP comments</strong></p> <p><strong>First</strong> : This code uses <strong>MERGE</strong> to do the same task</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang...
How to Compare String in a Dataframe column with a sub-string in another Dataframe and extract the value
python|pandas|dataframe
2
62
2
72,823,825
72,823,825
1
true
2022-07-01T00:51:19.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Compare String in a Dataframe column with a sub-string in another Dataframe and extract the value<p><strong>I have 2 dataframes:</strong> DF1</p> <div...
72,808,622
limiting the number of checkbox in svelte form using disabled attribute with more than one group of options<p>A form that displays options for an item. The user suppose to select specific number of options for each item. Options example:</p> <pre><code>let optiongroups = [ { groupname : &quot;exactly1&qu...
<p>You cannot use a simple global value like <code>disableit</code> for all groups; instead you need to check state by group. E.g. if <code>checkresults</code> is initialized to a dictionary according to the available groups like this:</p> <pre class="lang-js prettyprint-override"><code>let checkresults = Object.fromEn...
limiting the number of checkbox in svelte form using disabled attribute with more than one group of options
svelte|svelte-3
0
62
1
72,810,473
72,810,473
1
true
2022-06-29T22:47:24.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: limiting the number of checkbox in svelte form using disabled attribute with more than one group of options<p>A form that displays options for an item. The u...
73,002,415
How to read nested objects in a json file as dataframe?<p>I have a .json file with content:</p> <blockquote> <p>{&quot;success&quot;:true,&quot;code&quot;:&quot;SUCCESS&quot;,&quot;data&quot;:{&quot;from&quot;:1514745000000,&quot;to&quot;:1522175400000,&quot;transactionData&quot;:[{&quot;name&quot;:&quot;Recharge &amp;...
<p>Since you want to read data key in your dictionary. You can load the json as dictionary in memory and then use pandas to convert the same to a dataframe.</p> <p>As discussed in <a href="https://stackoverflow.com/questions/73002415/how-to-read-json-file-in-dataframe/73002774?noredirect=1#comment128937695_73002774">co...
How to read nested objects in a json file as dataframe?
python|json|pandas|dataframe
0
62
1
73,002,774
73,002,774
1
true
2022-07-16T07:36:33.073Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read nested objects in a json file as dataframe?<p>I have a .json file with content:</p> <blockquote> <p>{&quot;success&quot;:true,&quot;code&quot;:&q...
72,902,665
Go - calculate the cidr below one bit of the cidr provided<p><strong>Ask</strong></p> <p>How do you calculate the cidr below one bit of the cidr provided?</p> <p><strong>Given:</strong></p> <p>a network CIDR : (192.168.0.0/16)</p> <p><strong>wanted result</strong></p> <p>192.168.0.0/17, 192.168.128.0/17</p> <p>Using pa...
<p>To split a network in two, increment the length of the prefix by one. That gives you the lower half. To compute the second half, increment the network part by one (error handling omitted for brevity):</p> <pre><code>package main import ( &quot;fmt&quot; &quot;math/big&quot; &quot;net/netip&quot; ) func...
Go - calculate the cidr below one bit of the cidr provided
go|cidr
1
62
2
72,903,486
72,903,486
1
true
2022-07-07T18:31:07.233Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Go - calculate the cidr below one bit of the cidr provided<p><strong>Ask</strong></p> <p>How do you calculate the cidr below one bit of the cidr provided?</p...
72,960,266
Pause and resume a looping Task without using TaskCompletionSource<p>I have a simple program that inputs a number and starts counting from 0, I have 1 counter to do pause and resume (_nCurrentCount), the below code works fine, but I canceled Task on pause right?. Is there a way to just &quot;pause&quot; that Task witho...
<p>Here's a version using <code>async</code>:</p> <pre><code>private int _target = 0; private int _counter = 0; private CancellationTokenSource cts = null; private async Task Execute(CancellationToken ct) { while (true) { txtCount.Text = $&quot;{++_counter}&quot;; if (_counter == _target) ...
Pause and resume a looping Task without using TaskCompletionSource
c#|asynchronous|async-await
-1
62
1
72,960,425
72,960,425
1
true
2022-07-13T02:30:15.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pause and resume a looping Task without using TaskCompletionSource<p>I have a simple program that inputs a number and starts counting from 0, I have 1 counte...
72,867,308
RabbitMQ declaring multiple routing keys<p>I have multiple routing keys that connect with the same exchange. I have configure the routing keys separated by semicolon in my application.properties like this:</p> <pre><code>events.routingkey=ONLINE.UPDATE.ADDRESS.RES; ONLINE.UPDATE.ADDRESS.PHN; ONLINE.UPDATE.ADDRESS.MOB; ...
<p>You need a separate binding for each routing key.</p> <p><strong>EDIT</strong></p> <p>If you use a comma-delimited list, you don't need SpEL, Spring will automatically split and trim the values:</p> <pre class="lang-java prettyprint-override"><code>@Bean Declarables bindings(@Value(&quot;${keys}&quot;) List&lt;Strin...
RabbitMQ declaring multiple routing keys
java|spring|spring-boot|rabbitmq|spring-rabbit
0
62
1
72,870,013
72,870,013
1
true
2022-07-05T09:47:43.570Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RabbitMQ declaring multiple routing keys<p>I have multiple routing keys that connect with the same exchange. I have configure the routing keys separated by s...
72,392,908
How can I split a string in python that has multiple spaces between?<p>It's difficult for me to explain this within a title, so please allow me to do such here.</p> <p>I'm working on a search interface for a utility I'm developing, one with google(ish) filters.</p> <p>It works fine when there's only one filter in the q...
<p>If I understand your requirements correctly. I would write something like this:</p> <pre class="lang-py prettyprint-override"><code>from collections import defaultdict filters = [ &quot;intitle&quot;, &quot;inbody&quot; ] query = 'intitle:foo bar inbody: boo far ' result = defaultdict(list) current_filter...
How can I split a string in python that has multiple spaces between?
python|python-3.x|search
0
62
2
72,393,519
72,393,519
1
true
2022-05-26T13:49:12.377Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I split a string in python that has multiple spaces between?<p>It's difficult for me to explain this within a title, so please allow me to do such he...
72,393,339
How to select the parent elements?<p>I am trying to make a sidebar that stores the last click link into the local storage and still opens the collapse links after the page reloads.</p> <pre><code>$(&quot;.clickedLink&quot;).parent().parent().css('background-color', 'green'); </code></pre> <p>Could someone help me how t...
<p>You can do something like this. call <code>parents('.collapse')</code> to get all parents with given class. Then call <code>prev()</code> to get the links.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-...
How to select the parent elements?
javascript|html|jquery|parent
0
62
1
72,397,281
72,397,281
1
true
2022-05-26T14:20:31.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to select the parent elements?<p>I am trying to make a sidebar that stores the last click link into the local storage and still opens the collapse links ...
72,399,828
C# -> 7 in a string, convert to int returns 55?<p>Evening... revising some C# coding questions///</p> <p>10 Random numbers 7319018271 ....so I put brackets around the numbers and made it a string... created an array with [10]...idea is to iterate through the string and convert each string var to an int and add to myArr...
<p>To explain 55, that's the ASCII code for the <em>character</em> <code>7</code>.</p> <p>The problem you have your code here is that you have <code>Convert.ToInt32</code> in the wrong place. Currently you're converting <code>i</code> (an <code>int</code>) to an <code>int</code>. The other issue is that passing a <code...
C# -> 7 in a string, convert to int returns 55?
c#|arrays|string|data-structures|char
-1
62
1
72,399,953
72,399,953
1
true
2022-05-27T02:25:27.410Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# -> 7 in a string, convert to int returns 55?<p>Evening... revising some C# coding questions///</p> <p>10 Random numbers 7319018271 ....so I put brackets a...
72,365,724
MS Word number of pages in a flextable table using Rmarkdown<p>Is there a way to insert MS Word computed field - total number of pages in the document - into a flextable table?</p> <p>In the <code>officer</code> package there's a function <code>run_word_field</code>. I tried to use it the following way:</p> <pre><code>...
<p>You can now use function <code>as_word_field</code>:</p> <pre><code>library(flextable) library(officer) # define some default values ---- set_flextable_defaults(font.size = 22, border.color = &quot;gray&quot;) ft_2 &lt;- flextable(head(cars)) ft_2 &lt;- add_footer_lines(ft_2, &quot;temp text&quot;) ft_2 &lt;- comp...
MS Word number of pages in a flextable table using Rmarkdown
r|r-markdown|flextable|officer|officedown
0
62
1
72,402,112
72,402,112
1
true
2022-05-24T15:38:27.293Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MS Word number of pages in a flextable table using Rmarkdown<p>Is there a way to insert MS Word computed field - total number of pages in the document - into...
72,399,649
React: sub.component not re-rendering on main.component<p>I just started studying React and I got into the following issue: the SubComponent doesn't re-render data when updating the state.</p> <p>Main component is the view Webpage for holding all the subComponents, the Logic component manages all the functions and this...
<h2>Problem</h2> <p>As mentioned in the comments, you have 2 instances of LogicComponent - one in SubComponent and one in Main. Think of this like having 2 instances of a class - the state kept within each is completely separate. When you call getMaintenance from Main, you update the state of the instance of LogicCompo...
React: sub.component not re-rendering on main.component
reactjs|react-hooks
0
62
1
72,403,825
72,403,825
1
true
2022-05-27T01:46:22.583Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React: sub.component not re-rendering on main.component<p>I just started studying React and I got into the following issue: the SubComponent doesn't re-rende...
72,393,943
How to manually commit kafka offset after FileIO in apache beam?<p>I have a <code>FileIO</code> writing a <code>Pcollection&lt;GenericRecord&gt;</code> to files and returns <code>WriteFilesResult&lt;DestinationT&gt;</code>.</p> <p>I would like to create a <code>DoFn</code> after writing files to commit the offset of wr...
<p>For anyone interested, here is how I did:</p> <ul> <li>manually groupbykey records by <code>DestinationT</code></li> <li>for each group I get the list of offsets and I create a new key <code>EnrichedDestinationT</code> + flatten the iterable</li> <li>so the Pcollection before entering FileIO is <code>PCollection&lt;...
How to manually commit kafka offset after FileIO in apache beam?
apache-kafka|google-cloud-dataflow|apache-beam|apache-beam-kafkaio
1
62
1
72,520,453
72,520,453
1
true
2022-05-26T15:04:11.977Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to manually commit kafka offset after FileIO in apache beam?<p>I have a <code>FileIO</code> writing a <code>Pcollection&lt;GenericRecord&gt;</code> to fi...
72,309,477
Details of PHP 7.4 Reference Counting of Zvals<p>I have some points of clarification based on reading the internal implementations for zvals described here <a href="https://www.npopov.com/2015/05/05/Internal-value-representation-in-PHP-7-part-1.html" rel="nofollow noreferrer">Internal value representation in PHP 7 - Pa...
<blockquote> <p>So based on this simplistic view, I would imagine the reference counting for arrays, strings, and objects in PHP are the same, but it appears not to be the case. Can someone explain where this (apparently) overly simplistic view falls apart?</p> </blockquote> <p>It falls apart because the way variables ...
Details of PHP 7.4 Reference Counting of Zvals
php|reference-counting
0
62
1
72,324,368
72,324,368
1
true
2022-05-19T18:28:20.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Details of PHP 7.4 Reference Counting of Zvals<p>I have some points of clarification based on reading the internal implementations for zvals described here <...
72,375,837
Converting Postgres cross join lateral to SQL server code<p>this is my current code:</p> <pre><code> SELECT c.id, t.vaccinedate, t.vaccine, t.vaccinesource, t.num FROM child c CROSS JOIN LATERAL ( VALUES (c.bc...
<p>We can try to use <code>CROSS APPLY</code> instead <code>CROSS JOIN LATERAL</code> in SQL server</p> <pre><code>SELECT c.id, t.vaccinedate, t.vaccine, t.vaccinesource, t.num FROM child c CROSS APPLY ( VALUES (c.bcgsource, c.bcgdate, 'bcg', 1), (c.opv0source, c.opv0date, 'opv0', 2), (c....
Converting Postgres cross join lateral to SQL server code
sql-server|lateral-join
0
62
1
72,375,897
72,375,897
1
true
2022-05-25T10:22:11.073Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting Postgres cross join lateral to SQL server code<p>this is my current code:</p> <pre><code> SELECT c.id, t.vaccinedat...
72,332,210
Passing c++ map by reference and see changes after insert<p><strong>Hey guys!</strong></p> <p>I'm just getting into c++ and after learning stuff about reference and value pass I've come across a problem.</p> <p>So basically I'm trying to copy a map and I do so in my method. So far the size of the 2 maps are the same.</...
<p><code>map</code> and <code>copyMap</code> are separate objects and so changing one won't affect other. Moreover, you're returning the map <strong>by value</strong> from the function <code>passMapByReference</code>. Instead you could return the map <strong>by reference</strong> from <code>passMapByReference</code> as...
Passing c++ map by reference and see changes after insert
c++|reference
0
62
1
72,332,272
72,332,272
1
true
2022-05-21T18:21:43.570Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing c++ map by reference and see changes after insert<p><strong>Hey guys!</strong></p> <p>I'm just getting into c++ and after learning stuff about refere...
72,394,472
How to keep mysql names together in ordered list<p>I have the following list of items</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Category</th> <th>OrderNum</th> </tr> </thead> <tbody> <tr> <td>Prerequisites</td> <td>2</td> </tr> <tr> <td>NULL</td> <td>4</td> </tr> <tr> <td>Prerequisite...
<p>You can apply all the conditions that you want with a <code>CASE</code> expression:</p> <pre><code>SELECT * FROM tablename ORDER BY CASE WHEN Category = 'Prerequisites' THEN 1 WHEN Category IS NULL THEN 2 ELSE 3 END, Category, OrderNum; </code></pre> <p>o...
How to keep mysql names together in ordered list
mysql|sql|database|sql-order-by|recordset
2
62
3
72,396,046
72,396,046
1
true
2022-05-26T15:41:58.833Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to keep mysql names together in ordered list<p>I have the following list of items</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr...
72,380,745
Retrieve Value from Textbox in ASP UpdatePanel on AsyncPostBackTrigger<p>I have an issue where I am embedding a user control inside a JQuery dialog. In this user control is a simple contact form which utilizes UpdatePanel to asyncronously hit the server, and submit the data without causing a full page postback. The iss...
<p>In the VAST majority of cases, a post-back from a update panel Will cause the dialog to collapse. However, I have found if you put a div OUT side of the update panel, and have jquery.ui pop that div, and INSIDE the div is THEN your update panel, then the jquery.ui dialog can survive and have post-backs. Do keep in m...
Retrieve Value from Textbox in ASP UpdatePanel on AsyncPostBackTrigger
jquery|asp.net|ajax|vb.net
0
62
1
72,381,847
72,381,847
1
true
2022-05-25T15:50:42.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Retrieve Value from Textbox in ASP UpdatePanel on AsyncPostBackTrigger<p>I have an issue where I am embedding a user control inside a JQuery dialog. In this ...
72,323,005
Can I use a `multiprocessing.Queue` for communication within a process?<p>I'm using queues for inter-thread communication. I'm using <code>multiprocessing.Queue()</code> instead of <code>queue.Queue()</code> because the <code>multiprocessing</code> version exposes an underlying file descriptor which can be waited on w...
<p><strong>TL;DR:</strong> <code>threading.Lock</code> instances simply cannot be pickled and <em>pickle</em> is used to serialize an object that is <code>put</code> to a <code>multiprocessing.Queue</code> instance. But there is very little value to passing an object to another thread via a <code>multiprocessing.Queue<...
Can I use a `multiprocessing.Queue` for communication within a process?
python|multithreading|multiprocessing
-1
62
1
72,362,658
72,362,658
1
true
2022-05-20T17:53:24.170Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I use a `multiprocessing.Queue` for communication within a process?<p>I'm using queues for inter-thread communication. I'm using <code>multiprocessing.Q...
72,336,922
select best comb among all combination data.table r<p>Suppose there are a few firm combination result in certain best value, how to efficiently select unique best combination that every firm appear only once the data.table way?</p> <p>The sample data:</p> <pre><code>require(data.table) set.seed(1234) allcombs &lt;- dat...
<p>If I understand correctly, the OP wants to select the unique best combinations where every firm appears only once.</p> <p>The code below picks the combination with the highest <code>val</code>, marks all other rows which contain <code>firm1</code> or <code>firm2</code> as <em>done</em> and iteratively continues with...
select best comb among all combination data.table r
r|data.table
0
62
1
72,342,011
72,342,011
1
true
2022-05-22T10:55:50.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: select best comb among all combination data.table r<p>Suppose there are a few firm combination result in certain best value, how to efficiently select unique...
72,242,240
Why can’t my code find the second smallest elements array?<pre><code>int smallindex = 0; int secsmallindex = 0; </code></pre> <p>I put the lines above into gobalslope.<br /> The rest of the code:</p> <pre><code>#include &lt;iostream&gt; using namespace std; int main() { int list[10] = { 33,6,3,4,55,22,5,6,7,6 }; ...
<p>You had some problems. Mostly index ranges of an array, and comparing index with the actual value stored in the array. I commented out the old (problematic) lines and added the correct ones with some description. (<a href="https://godbolt.org/z/cWq1WTbhK" rel="nofollow noreferrer">Demo</a>)</p> <pre><code> #include ...
Why can’t my code find the second smallest elements array?
c++
-2
62
2
72,242,357
72,242,357
1
true
2022-05-14T16:45:49.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can’t my code find the second smallest elements array?<pre><code>int smallindex = 0; int secsmallindex = 0; </code></pre> <p>I put the lines above into g...
72,345,169
read a File in hex byteArray and write part of that array to another File - java android<p>I have a 200kb file and I have to read it in bytes, and then write part of this byteArray (from index 90000 to 165000) to another file. How can I accomplish this.<br></p> <pre><code>File file1 = new File(getExternalStorageDirecto...
<p>Use a <code>RandomAccessFile</code> in order to seek to the offset to start copying from.</p> <p>For example:</p> <pre class="lang-java prettyprint-override"><code>final int bufSize = 1024; // the buffer size for copying byte[] buf = new byte[bufSize]; final long start = 10000L; // start offset at source final long...
read a File in hex byteArray and write part of that array to another File - java android
java|android|arrays|bufferedreader
-1
62
1
72,345,320
72,345,320
1
true
2022-05-23T08:06:23.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: read a File in hex byteArray and write part of that array to another File - java android<p>I have a 200kb file and I have to read it in bytes, and then write...
72,269,741
How to create an android CRUD app using SQLite database, HashMap and HashSet to perfrom crud operations<p>I have started coding with some basic ideas and created a class called Student to create object hashmap to perform insertion and updating. And a Class called DatabaseHelper to perform SQLite operations and main act...
<pre><code>map.put(&quot;1&quot;,student1); Boolean insert_student_details = db.InsertStudentDetails(map); String key=entry.getKey(); // Is always 1 Student student = entry.getValue(); Student student = entry.getValue(); contentValues.put(key, student.rollNo); contentValues.put(key, student.studentName); contentVal...
How to create an android CRUD app using SQLite database, HashMap and HashSet to perfrom crud operations
android|sqlite
-2
62
1
72,270,145
72,270,145
1
true
2022-05-17T07:22:07.540Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create an android CRUD app using SQLite database, HashMap and HashSet to perfrom crud operations<p>I have started coding with some basic ideas and cre...
72,335,217
Fastest way to convert CSV files from UTF-16 tabs, to UTF-8-SIG commas<p>I have two 30 gb CSV files, each contains tens of millions of records.</p> <p><a href="https://i.stack.imgur.com/R2l4K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R2l4K.png" alt="enter image description here" /></a></p> <p>T...
<p>I converted a 35GB file in two minutes, Note that you can optimize performances by changing the constants in the top lines.</p> <pre><code>BUFFER_SIZE_READ = 1000000 # depends on available memory in bytes MAX_LINE_WRITE = 1000 # number of lines to write at once source_file_name = 'source_fle_name' dest_file_name ...
Fastest way to convert CSV files from UTF-16 tabs, to UTF-8-SIG commas
python|pandas|utf-8|tableau-desktop
0
62
1
72,338,390
72,338,390
1
true
2022-05-22T06:14:07.167Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fastest way to convert CSV files from UTF-16 tabs, to UTF-8-SIG commas<p>I have two 30 gb CSV files, each contains tens of millions of records.</p> <p><a hre...
72,265,601
How to throw a ball that player picked up in Unity 2d project<p>I have a problem with writing a function that throws spawned ball by pressing a button. So far, i could only instantiate the ball and it is affected by gravity. I can not wrap my head arround, how in my code should i add a force to push it with some force....
<p>So, i manage to fiddle with the .AddForce() method once again and i came up with a solution to my problem.</p> <p>My OnFire script looks like this:</p> <pre><code> void OnFire(InputValue value) { if(!playerHasABall) {return;} Instantiate(ball, ballSpawn.position, transform.rotation); p...
How to throw a ball that player picked up in Unity 2d project
c#|unity3d
0
62
2
72,280,158
72,280,158
1
true
2022-05-16T21:02:54.740Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to throw a ball that player picked up in Unity 2d project<p>I have a problem with writing a function that throws spawned ball by pressing a button. So fa...
72,341,360
How to search json for a string and output a parent value using jq?<p>Trying to pull a value out with jq, but didn't seem as easy as i originally thought.</p> <p>I have a variable of <code>CAR=&quot;baga6e~tlwdcmli__QmbHKa~G65fMXzh.car&quot;</code>.</p> <p>How can i use this variable to return the parent <code>&quot;pi...
<p>Depending on what level you can expect your search value, here's a quite narrow solution using all keys from the example: First, iterate over the <code>.response</code> array, then keep only those items for which <code>any</code> of the values in <code>.sources[].sample_retrieve_cmd</code> <code>contains</code> the ...
How to search json for a string and output a parent value using jq?
arrays|json|bash|scripting|jq
0
62
1
72,341,420
72,341,420
1
true
2022-05-22T21:20:37.460Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to search json for a string and output a parent value using jq?<p>Trying to pull a value out with jq, but didn't seem as easy as i originally thought.</p...
72,340,415
SwiftUI - picker view after timer expires not working as expected-seems to have a pulsating effect<p>I'm building a very simple timer app, and what I want it to do is that I want to show a picker view once the timer expires to add more time and go back to the timer. However, although it compiles, it gives me a really w...
<p>Your issue is that you are using <code>secondScreenShown</code> to show the third screen as well. Since that value is <code>true</code>, it automatically takes the link and you continuously push additional screens.</p> <p>You don't really need to push another screen. It is enough if the <strong>Add Stoppage</stron...
SwiftUI - picker view after timer expires not working as expected-seems to have a pulsating effect
ios|swift|swiftui
0
62
1
72,341,328
72,341,328
1
true
2022-05-22T18:47:11.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SwiftUI - picker view after timer expires not working as expected-seems to have a pulsating effect<p>I'm building a very simple timer app, and what I want it...
72,358,682
Take the value without automatically converting it<p>So I have a cell that I need to read which has the value <strong>375:00:00</strong>. When looking at the formula I can see that the value is <strong>14.01.1900 15:00:00</strong>. When trying to read the value of the cell I only get the Date and not the 375.</p> <p>My...
<p>Either use</p> <pre><code>TimeUS = TimeWB.Sheets(&quot;Übersicht&quot;).Range(&quot;E3&quot;).Text </code></pre> <p>to get it in the same format as the number format of the cell.</p> <p>Or use the numeric <code>.Value</code> and format it to whatever you like:</p> <pre><code>TimeUS = Format$(TimeWB.Sheets(&quot;Über...
Take the value without automatically converting it
excel|vba
0
62
2
72,358,826
72,358,826
1
true
2022-05-24T07:17:18.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Take the value without automatically converting it<p>So I have a cell that I need to read which has the value <strong>375:00:00</strong>. When looking at the...
72,358,539
Styled Components hiding HTML attributes in Typescript<p>I create a standard Styled Component like:</p> <pre><code>export type ContainerProps = { color: string; }; export const Container = styled.div&lt;ContainerProps&gt;` color: ${p =&gt; p.color}; background: blue; width: 100% `; </code></pre> <p>When I want...
<p>I doubt you will be able to achieve it, check the implementation <a href="https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/constructors/styled.tsx" rel="nofollow noreferrer">here</a></p> <p>A naive approach can be, to create another component and export this.</p> <pre><...
Styled Components hiding HTML attributes in Typescript
typescript|styled-components
0
62
1
72,358,892
72,358,892
1
true
2022-05-24T07:05:19.243Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Styled Components hiding HTML attributes in Typescript<p>I create a standard Styled Component like:</p> <pre><code>export type ContainerProps = { color: st...
72,387,893
Not able to load images from static folder in django<p>Not able to load image from static dir in Django. Below is the picture of my file structure. <a href="https://i.stack.imgur.com/brywn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/brywn.png" alt="enter image description here" /></a></p> <p>In <...
<p>instead of this:</p> <pre><code>STATICFILES_DIR = [os.path.join(BASE_DIR,'static'),] </code></pre> <p>Do this and try:</p> <pre><code>STATICFILES_DIRS = [os.path.join(BASE_DIR,'appname/static'),] </code></pre> <p>and also add this:</p> <pre><code>os.path.join(BASE_DIR, 'appname', 'templates') {% load static %} &lt;...
Not able to load images from static folder in django
django|django-settings
0
62
1
72,389,643
72,389,643
1
true
2022-05-26T06:54:15.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not able to load images from static folder in django<p>Not able to load image from static dir in Django. Below is the picture of my file structure. <a href="...
72,291,486
How do I evaluate form inside lambda that is within a macro?<p>I'm having problems with the following macro:</p> <pre><code>(defmacro gather-params (&amp;rest body) &quot;Return plist of params&quot; `(concatenate 'list (map 'list #'(lambda (plist) (if (typep (first plist) 'key...
<p><code>(concatenate 'list '(1 2 3))</code> is just <code>(copy-list '(1 2 3))</code></p> <p>-&gt; which both evaluate to <code>(1 2 3)</code>.</p> <p>The macro generates code. It has a backquoted list. This backquoted list is computed at macroexpansion time -&gt; when the macro expansion happens, for example during c...
How do I evaluate form inside lambda that is within a macro?
common-lisp
1
62
1
72,291,741
72,291,741
1
true
2022-05-18T14:55:02.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I evaluate form inside lambda that is within a macro?<p>I'm having problems with the following macro:</p> <pre><code>(defmacro gather-params (&amp;res...
72,262,917
Meaning of absolute values of flex-grow<p>As I understand it, <code>flex-grow</code> on the child elements of a <code>flex</code>-ed element specifies how much of the relative proportion of space remaining to all the child elements should be allocated to a given element. So this:</p> <p><div class="snippet" data-lang="...
<p>Per the <a href="https://drafts.csswg.org/css-flexbox/#valdef-flex-flex-grow" rel="nofollow noreferrer">flexbox draft spec</a>:</p> <blockquote> <p>Flex values between 0 and 1 have a somewhat special behavior: when the sum of the flex values on the line is less than 1, they will take up less than 100% of the free sp...
Meaning of absolute values of flex-grow
css|flexbox
0
62
2
72,265,821
72,265,821
1
true
2022-05-16T16:57:58.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Meaning of absolute values of flex-grow<p>As I understand it, <code>flex-grow</code> on the child elements of a <code>flex</code>-ed element specifies how mu...
72,333,935
None value from a function after assert checking<p>I am writing a function that checks the output of a notebook file and checks against an assert expression to match the output. But I get a <code>None</code> value when I print the output from the function.</p> <pre><code>from testbook import testbook @testbook('ssnn_s...
<p>If your goal is to count the number of successful assertions, it's either 4 or you can't get it because an exception was raised. If you use regular checks instead of assertions, you can change that, because the function won't raise an error on the first falsy check it encounters:</p> <pre><code>@testbook('ssnn_solve...
None value from a function after assert checking
python|assert|testbook
1
62
1
72,334,541
72,334,541
1
true
2022-05-21T23:51:30.003Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: None value from a function after assert checking<p>I am writing a function that checks the output of a notebook file and checks against an assert expression ...
72,262,633
Remove characters from list of strings using comprehension<p>I would like to know how to remove certain characters from a list of strings. In this case, I am trying to remove <code>numbers</code> of type <code>str</code> using list comprehension.</p> <pre><code>numbers = [str(i) for i in range(10)] imgs_paths = [os.pat...
<h2>Option 1</h2> <p>If I understand your question right, a function might simplify it more than nested comprehension.</p> <pre class="lang-py prettyprint-override"><code>&quot;doj394no.jpg&quot;.replace(&quot;0&quot;,&quot;&quot;).replace(&quot;1&quot;,&quot;&quot;)... # &quot;dojno.jpg&quot; </code></pre> <p>If you h...
Remove characters from list of strings using comprehension
python|list|list-comprehension|nested-loops
0
62
3
72,262,802
72,262,802
1
true
2022-05-16T16:36:18.090Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove characters from list of strings using comprehension<p>I would like to know how to remove certain characters from a list of strings. In this case, I am...
72,296,642
Python exec function<p>In file &quot;A.py&quot; I wrote a function <code>runPyFile</code> which simply is</p> <pre><code>exec(open(file).read()) </code></pre> <p>But now when I write in file &quot;B.py&quot;:</p> <pre><code>from A import * runPyFile(myFile) </code></pre> <p>then the values defined in this <code>myFile<...
<p><code>exec</code> takes dictionaries to hold the global and local variables in the executed code. Pass in <code>globals()</code> to use the globals of the module it's in.</p> <pre><code>exec(open(file).read(), globals()) </code></pre> <p>SSince you need to be able to call this from other modules, you can write <code...
Python exec function
python
0
62
1
72,296,680
72,296,680
1
true
2022-05-18T22:24:13.727Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python exec function<p>In file &quot;A.py&quot; I wrote a function <code>runPyFile</code> which simply is</p> <pre><code>exec(open(file).read()) </code></pre...
72,397,981
grep/sed/awk parsing text file into one file with genes as rows and descriptions as columns<p>I am wanting to use <code>grep</code>/<code>awk</code>/<code>sed</code> to parse a text file containing various gene descriptions.</p> <p>To download file</p> <pre><code>wget https://downloads.wormbase.org/releases/current-pro...
<p>Assuming output is tab delimited, one <code>awk</code> idea:</p> <pre><code>awk ' BEGIN { OFS=&quot;\t&quot; } function print_output() { if (baseID) print baseID,gene_name,trans_name,gene_desc,concise_desc,auto_desc; baseID=&quot;&quot; } $1 ~ /WBGene/ { baseID=$1; gene_name=$2; trans_name=$3 } /^Ge...
grep/sed/awk parsing text file into one file with genes as rows and descriptions as columns
linux|bash|awk|sed|grep
0
62
2
72,398,415
72,398,415
1
true
2022-05-26T21:03:25.380Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: grep/sed/awk parsing text file into one file with genes as rows and descriptions as columns<p>I am wanting to use <code>grep</code>/<code>awk</code>/<code>se...
72,336,725
Excel Lookup 2 condition<p>I have a data table:</p> <p><a href="https://i.stack.imgur.com/NrfzV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NrfzV.png" alt="enter image description here" /></a></p> <p>I want this result:</p> <p><a href="https://i.stack.imgur.com/0qbx7.png" rel="nofollow noreferrer...
<p>Please, test the next code. It should return as looks to be logical according to your question and comments. It assumes that your picture representing desired output is wrong. It returns in the same sheet starting from &quot;E1&quot;. Of course, it may be easily adapted to return anywhere:</p> <pre><code>Sub TestExt...
Excel Lookup 2 condition
excel|vba|excel-formula|excel-2010
-2
62
1
72,337,913
72,337,913
1
true
2022-05-22T10:28:52.093Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel Lookup 2 condition<p>I have a data table:</p> <p><a href="https://i.stack.imgur.com/NrfzV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgu...
72,386,531
Why is the variable undefined in the initialization form of this letrec?<p>Scheme complains that in the code below, the <code>x</code> in <code>(+ x 1)</code> is undefined:</p> <pre class="lang-lisp prettyprint-override"><code>(letrec ((x 1) (y (+ x 1))) y) </code></pre> <ul> <li>Chez Scheme: <code>Exception...
<p>That's not how <code>letrec</code> works. You can think of <code>letrec</code> as if it did something close to this (see <a href="https://small.r7rs.org/attachment/r7rs.pdf" rel="nofollow noreferrer">R7RS</a>, 4.2.2 for instance).</p> <pre><code>(letrec ((a &lt;xpr&gt;) ...inits) ...body) </code></pre> <...
Why is the variable undefined in the initialization form of this letrec?
scheme|letrec
1
62
1
72,388,910
72,388,910
1
true
2022-05-26T04:00:34.290Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is the variable undefined in the initialization form of this letrec?<p>Scheme complains that in the code below, the <code>x</code> in <code>(+ x 1)</code...
72,342,141
what is output format of Utils? (using chartjs in vanillajs, not react/angular)<p>I'm trying to load data for a bubbles chart from datafiles, the examples use a chartjs function to generate data.</p> <p>Working through some of the examples, want to load csv/json files via d3.js as will be using data files from an api a...
<p>As can be read <a href="https://www.chartjs.org/docs/3.7.1/charts/bubble.html#data-structure" rel="nofollow noreferrer">here</a> in the documentation. The datastructure for bubble charts consists out of an array containing objects where each object has an x key for the x value, an y key for the y value and a r key f...
what is output format of Utils? (using chartjs in vanillajs, not react/angular)
d3.js|charts|chart.js
1
62
1
72,344,398
72,344,398
1
true
2022-05-23T00:19:43.767Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: what is output format of Utils? (using chartjs in vanillajs, not react/angular)<p>I'm trying to load data for a bubbles chart from datafiles, the examples us...
72,291,832
How do you upload a file using Emscripten in C++?<p>I'm trying to upload a file to a server. I have been successful in downloading data using Emscripten's Fetch API with a GET request, but so far have been unsuccessful with POST requests.</p> <p>Here is my current implementation: (the file is being opened and read as e...
<p>You need to make sure that the request header has:</p> <pre><code>&quot;Content-Type&quot;, &quot;multipart/form-data; boundary=[custom-boundary]\r\n&quot; </code></pre> <p>...where <code>[custom-boundary]</code> is a string of your choice.</p> <p>Then in the request data, you start with that custom boundary, follow...
How do you upload a file using Emscripten in C++?
c++|networking|emscripten
1
62
1
72,318,543
72,318,543
1
true
2022-05-18T15:17:44.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you upload a file using Emscripten in C++?<p>I'm trying to upload a file to a server. I have been successful in downloading data using Emscripten's Fe...
72,240,611
D3D : hardware mip linear blending is different from shader linear blending<p>I have a d3d application that renders a mip mapped cubemap in a fullscreen quad pixel shader. I stumbled on a weird behavior, and wrote the following test to illustrate the issue.</p> <p>This shader outputs the absolute difference between har...
<p>I was writing <code>&quot;but anisotropic filtering is not a candidate as I use explicit LOD sampling)&quot;</code>. It turns out that this statement it wrong. To my understanding, anisotropic filtering should not affect sampling with textureLOD, however, it seems that in some implementations, it does, ex: <a href="...
D3D : hardware mip linear blending is different from shader linear blending
c++|gpu|hlsl|direct3d
4
62
1
72,274,597
72,274,597
1
true
2022-05-14T13:20:55.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: D3D : hardware mip linear blending is different from shader linear blending<p>I have a d3d application that renders a mip mapped cubemap in a fullscreen quad...
72,338,030
Find the first Recurring letter in Java<p>I wrote the code as follows but it doesn't return the first recurring letter properly.</p> <p><em>Example:</em></p> <p>In the word <code>&quot;statistics&quot;</code> the recurring letters are <code>s</code>, <code>t</code>, and <code>i</code>. But the letter <code>t</code> rec...
<p>You can reduce eliminate the nested loop and improve the performance by storing every encountered character in a <code>HashSet</code>:</p> <pre><code>public static char FRL(String word){ Set&lt;Character&gt; seen = new HashSet&lt;&gt;(); for(int i = 0; i &lt; word.length(); i++) { char next = word.ch...
Find the first Recurring letter in Java
java|string|algorithm|for-loop|recurring
1
62
1
72,338,253
72,338,253
1
true
2022-05-22T13:33:12Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find the first Recurring letter in Java<p>I wrote the code as follows but it doesn't return the first recurring letter properly.</p> <p><em>Example:</em></p>...
72,294,618
Why my multi-thread program runs slower than single thread?<p>I'm new to threads,my teacher asked for a 9 nine threads program that makes 3 arrays A B C with 10^6 elements each-all equal to 1. So we must use 9 threads to fill (with the number 1) those arrays faster. I came with a plan to use 3 threads to fill each arra...
<p>Having a separate thread function for each segment in each array, makes the program less flexible. The usual way is to have a struct that describes the work for each thread (e.g. pointer to array and start/end indexes).</p> <p>Also, <code>clock_gettime</code> is probably better than <code>clock</code> for timing. An...
Why my multi-thread program runs slower than single thread?
arrays|c|multithreading|thread-safety|pthreads
-1
62
1
72,295,416
72,295,416
1
true
2022-05-18T18:57:42.730Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why my multi-thread program runs slower than single thread?<p>I'm new to threads,my teacher asked for a 9 nine threads program that makes 3 arrays A B C with...
72,241,420
How to get the i-th element of vector<p>I want to get the i-th element of the void*. I understand that it is void type and I have to give it a certain data type. The idea behind this is that it should be working for different data types. If i am right about the issue, how do I implement that?</p> <pre><code>#include &l...
<p>C is a language for adrenaline junkies. It's always akin to free climbing, sky diving and formula 1 racing. Defensive programming is not a perfect protection against all kinds of &quot;sabotage&quot; by a caller, but it is better than nothing.</p> <p>The code below is in that very spirit. It cannot detect all possib...
How to get the i-th element of vector
c|vector
0
62
2
72,241,746
72,241,746
2
true
2022-05-14T15:03:01.600Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the i-th element of vector<p>I want to get the i-th element of the void*. I understand that it is void type and I have to give it a certain data t...
72,242,817
Why do new variable names need to be on the left of the equals (=)?<p>I am curious as to why a certain format produces an error while the other doesn't.</p> <p>Code that works:</p> <pre><code>name = input().split() if len(name) == 3: first_name, middle_name, last_name = name print(f'{last_name}, {first_name[0]}.{m...
<p>Those say two entirely different things. The second one takes three objects (first_name, middle_name, last_name), then builds them into a tuple, and assigns that to <code>name</code>. That's clearly not what you want, since those three names do not exist. Your first example takes the three parts of the variable <cod...
Why do new variable names need to be on the left of the equals (=)?
python|variable-assignment
-2
62
2
72,242,898
72,242,898
2
true
2022-05-14T18:11:47.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do new variable names need to be on the left of the equals (=)?<p>I am curious as to why a certain format produces an error while the other doesn't.</p> ...
72,250,710
Which version of C++ standard allows reuse of storage previously occupied by an object of a class that has const or reference members?<p><a href="https://stackoverflow.com/a/50221156/5447906">This answer</a> cites some unknown revision of C++ standard draft:</p> <blockquote> <p>If, after the lifetime of an object has e...
<p>In terms of the &quot;Major&quot; Standard releases, the clause about the <code>const</code> qualification (which you have emphasised in the excerpt you cite in your question) was present in the <a href="https://open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf" rel="nofollow noreferrer">final draft for the C++...
Which version of C++ standard allows reuse of storage previously occupied by an object of a class that has const or reference members?
c++|language-lawyer
3
62
1
72,250,913
72,250,913
2
true
2022-05-15T17:39:57.640Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Which version of C++ standard allows reuse of storage previously occupied by an object of a class that has const or reference members?<p><a href="https://sta...
72,254,258
Understand React-Redux Toolkit Syntax?<p>I'm new to react, redux and tyring to understand the redux-toolkit tutorial i follow. I have the slice as follows.</p> <pre><code>const initialState = { count: 0, }; export const counterSlice = createSlice({ name: &quot;counter&quot;, initialState, reducers: { incre...
<p>So this:</p> <pre><code>export const incrementTest = () =&gt; (dispatch) =&gt; { dispatch(increment()); }; </code></pre> <p>is an example for a thunk, a function that gets called (by a redux middleware) with two arguments, <code>dispatch</code> and <code>getState</code>. It is typically used to coordinate async wo...
Understand React-Redux Toolkit Syntax?
javascript|reactjs|redux|redux-toolkit
3
62
1
72,255,649
72,255,649
2
true
2022-05-16T04:49:46.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Understand React-Redux Toolkit Syntax?<p>I'm new to react, redux and tyring to understand the redux-toolkit tutorial i follow. I have the slice as follows.</...
72,289,395
Sort array object based on another array in javascript<p>How can i sort and rearrange an array that looks like this</p> <pre><code>fields = [ { uid: '2c2162cc-37d0-f1e3-96c2-6d9ccb50f38d', field: new ObjectId(&quot;627f816d8443318c6aaa1220&quot; }, { uid: '2aa60f96-135b-e179-2b46-516c87a877cc', fi...
<p>You need to use <code>sort</code> method on the array. And then compare the index of <code>field</code> on the order array.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>c...
Sort array object based on another array in javascript
javascript
1
62
1
72,289,517
72,289,517
2
true
2022-05-18T12:41:08.087Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort array object based on another array in javascript<p>How can i sort and rearrange an array that looks like this</p> <pre><code>fields = [ { uid: '2...
72,292,879
Using react hooks, how would you write an event listener dependent on state that does not need to be added and removed every time the state changes?<p>The code below shows a working, but inefficient implementation of an Android <code>BackHandler</code> within React Native to have the app exit after two presses in two s...
<p>You could use useRef for this.</p> <pre><code>const recentlyPressedHardwareBackRef = useRef(false); useEffect(() =&gt; { const backHandler = BackHandler.addEventListener( 'hardwareBackPress', () =&gt; { // Exit app if user pressed the button within last 2 seconds. if (recentlyPressedH...
Using react hooks, how would you write an event listener dependent on state that does not need to be added and removed every time the state changes?
javascript|reactjs|react-native|react-hooks
1
62
1
72,294,043
72,294,043
2
true
2022-05-18T16:31:25.013Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using react hooks, how would you write an event listener dependent on state that does not need to be added and removed every time the state changes?<p>The co...
72,291,624
What is the Log4j2 syntax especially for the 2nd part of the name?<p>I have not been able to find the syntax for setting up the configuration file. Granted it is working but unable to find an explanation of the 2nd item.</p> <p>For example, I see plenty of samples like this and it works.</p> <pre><code>log4j2.propertie...
<p>The best reference for the properties configuration format is of course the <a href="https://github.com/apache/logging-log4j2/blob/release-2.x/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java" rel="nofollow noreferrer">source code</a>.</p> <p>The nature of ...
What is the Log4j2 syntax especially for the 2nd part of the name?
java|logging|log4j2
0
62
1
72,296,403
72,296,403
2
true
2022-05-18T15:03:37.657Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the Log4j2 syntax especially for the 2nd part of the name?<p>I have not been able to find the syntax for setting up the configuration file. Granted i...
72,302,951
how to Centre This Input Box<p>I am making an app. And here I have an input box and a button. I want to center it. I tried using the <code>center</code> tag, it did not work. I tried using <code>align-items:center</code> still did not work. How to do this ??? Here is my program -</p> <pre><code> .form-inline { displ...
<pre><code>**justify-content: center;** .form-inline { display: flex; flex-flow: row wrap; align-items: center; justify-content: center; } </code></pre>
how to Centre This Input Box
html|css|forms|alignment|center
0
62
4
72,303,118
72,303,118
2
true
2022-05-19T10:30:10.720Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to Centre This Input Box<p>I am making an app. And here I have an input box and a button. I want to center it. I tried using the <code>center</code> tag,...
72,313,166
Pandas replace and fillna if column begins with part of a string<p>I was wondering whether there is a way to use the .replace() and .fillna() for columns headers that begin with part of a string.</p> <p>For example:</p> <pre><code>data['Q5_A'].fillna(value='Not Applicable', inplace=True) </code></pre> <p>This will only...
<p>You can do a for loop and perform all the processes you need as well.</p> <pre><code>for header in data.columns: if &quot;Q5&quot; in header: data[header].fillna(value='Not Applicable', inplace=True) data[header] = data[header].replace(&quot;,&quot;, &quot;&quot;, regex=True) </code></pre>
Pandas replace and fillna if column begins with part of a string
python|pandas
2
62
2
72,313,258
72,313,258
2
true
2022-05-20T03:09:29.697Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas replace and fillna if column begins with part of a string<p>I was wondering whether there is a way to use the .replace() and .fillna() for columns hea...
72,317,245
plus sign doesnt move up or down<p>I've been trying to move this span (+ sign) down a bit so that it's in line with the question, been trying margin, padding top or bottom, but nothing works. tried removing the other padding from parent classes still didn't work. can anyone spot my mistake, thanks :)</p> <p><div class...
<p>One of my favourite challenges. It was an issue of the <code>line-height</code> and so on. I added these:</p> <pre class="lang-css prettyprint-override"><code>.plusminus { font-weight: 100; font-size: xxx-large; line-height: 0; position: relative; top: 0.15em; } </code></pre> <p>Hope this gives you what's ...
plus sign doesnt move up or down
javascript|html|css
1
62
3
72,317,314
72,317,314
2
true
2022-05-20T10:18:14.977Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: plus sign doesnt move up or down<p>I've been trying to move this span (+ sign) down a bit so that it's in line with the question, been trying margin, paddin...
72,321,554
How to prepend a Python 'deque' object as part of a list comprehension<p>I am using <code>jsonschema</code> to validate a JSON document, and if there are any errors I need to capture them, including the path to the errors in the document. To ensure that path is never empty (i.e. if a required key at the root of the doc...
<p>So, the problem is you were passing a single string object to the <code>dequeue</code> constructor, which works like other sequence-like constructors in Python, it accepts an arbitrary iterable and constructs a dequeue by iterating over the iterable.</p> <p>But I noticed you used an extra set of parentheses, so I th...
How to prepend a Python 'deque' object as part of a list comprehension
python|collections|jsonschema
1
62
1
72,321,850
72,321,850
2
true
2022-05-20T15:41:00.010Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to prepend a Python 'deque' object as part of a list comprehension<p>I am using <code>jsonschema</code> to validate a JSON document, and if there are any...
72,362,605
How to convert the output of DT formatStyle to a data frame with highlighted cells for RShiny<p>I am trying to colour specific cells in a data frame with RShiny, based on their values.</p> <p>I have managed to highlight the cells successfully using the formatStyle function from the DT library, however the output format...
<p>It shows that <code>colourWeights</code> is already a datatable. Thus, moving the options to the <code>highlightData</code> part will work.</p> <pre><code>library(shiny) library(reticulate) library(DT) ui &lt;- fluidPage( mainPanel( # first header title h3(&quot;MTCars&quot;), # prepare the...
How to convert the output of DT formatStyle to a data frame with highlighted cells for RShiny
r|shiny|dt
1
62
1
72,364,495
72,364,495
2
true
2022-05-24T12:06:37.017Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert the output of DT formatStyle to a data frame with highlighted cells for RShiny<p>I am trying to colour specific cells in a data frame with RSh...
72,388,324
The method 'dark' isn't defined for the type 'ThemeData'<p>I'm getting this errror while following a lecture. ThemeData.dark() is not working properly.</p> <pre><code>import 'package:zoom_clone/screens/login_screen.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Ke...
<p>Use it like this</p> <pre><code>MaterialApp( title: 'Flutter Demo', theme: ThemeData.dark(), // default dark theme replaces default light theme home: MyHomePage(title: 'Flutter Demo Home Page'), ); </code></pre>
The method 'dark' isn't defined for the type 'ThemeData'
flutter|flutter-layout|flutter-theme
0
62
1
72,388,424
72,388,424
2
true
2022-05-26T07:34:31.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The method 'dark' isn't defined for the type 'ThemeData'<p>I'm getting this errror while following a lecture. ThemeData.dark() is not working properly.</p> <...
72,391,217
Where is kernel machine_desc table information?<p>I'm trying to understand how devicetrees work.</p> <p>According to the kernel documentation, they are used, in arm architecture, in the following manner:</p> <blockquote> <p>In the majority of cases, the machine identity is irrelevant, and the kernel will instead select...
<p>TL;DR - The machine description is built by building and linking different source files into the kernel. So each machine source file adds an entry into the table.</p> <hr /> <p>The table is based in <em>arch/arm/kernel/vmlinux.lds.S</em> (or relevant architecture linker file). It is built with the macros <code>MAC...
Where is kernel machine_desc table information?
linux|linux-kernel|kernel|device-tree
1
62
1
72,411,362
72,411,362
2
true
2022-05-26T11:39:34.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where is kernel machine_desc table information?<p>I'm trying to understand how devicetrees work.</p> <p>According to the kernel documentation, they are used,...
72,400,680
useState keeps the previous state<p>In my app I click <code>Play</code> button and audio should start playing, when it's over speech recognition should start listening, when it's over the message should be printed in console (it will be change to some other actions further).</p> <p>My app also has a feature to stop rec...
<p>Logging the state from within playSong will log the state when the function was defined. This means that the value will be outdated, i.e. stale. This is because of a functional concept called closures. From <a href="https://en.wikipedia.org/wiki/Closure_(computer_programming)" rel="nofollow noreferrer">Wikipedia</a>...
useState keeps the previous state
reactjs|react-hooks
0
62
1
72,401,568
72,401,568
2
true
2022-05-27T05:06:20.763Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: useState keeps the previous state<p>In my app I click <code>Play</code> button and audio should start playing, when it's over speech recognition should start...
72,254,115
Why is this not working? (Java for loop condition part)<pre><code>int cnt = 0, sum = 0; for(int i = 1; ((i &lt;= 1000) &amp;&amp; (i%3 == 0) &amp;&amp; (i%5 == 0)); i++){ if(cnt &gt;= 5) break; System.out.println(i); sum += i; cnt++; } System.out.println(sum); </code></pre> <p>I want to get the ...
<p>It sounds like you do not understand how a for loop works. <code>@Silvio Mayolo</code> and <code>@experiment unit 1998X</code> commented some very helpful links. I would encourage you to read through those and get comfortable with them.</p> <p>In your example, your for loop has a very complex header.</p> <p><code>fo...
Why is this not working? (Java for loop condition part)
java|for-loop
-5
62
2
72,254,303
72,254,303
2
true
2022-05-16T04:21:42Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is this not working? (Java for loop condition part)<pre><code>int cnt = 0, sum = 0; for(int i = 1; ((i &lt;= 1000) &amp;&amp; (i%3 == 0) &amp;&amp; (i%5 ...
72,283,224
Output without "print()" in SublimeText<p>Is there a way/plug-in to enable output without &quot;print()&quot; in SublimeText?</p> <p>For example,</p> <pre><code>a = 1 + 2 print (a) </code></pre> <p>Output:</p> <pre><code>3 </code></pre> <p>Wanted:</p> <pre><code>a = 1 + 2 a </code></pre> <p>Output:</p> <pre><code>3 </c...
<p>I am pretty sure that the answer is no. You can rename the print function to make it less noticable like this:</p> <pre><code>_ = print a = 2 _(a) </code></pre> <p>Output is <code>2</code></p> <p>Alternatively:</p> <p>As a few people mentioned in the comments, what you are likely looking for is a <code>repl</code>...
Output without "print()" in SublimeText
python|sublimetext3
1
62
1
72,284,551
72,284,551
2
true
2022-05-18T04:29:24.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Output without "print()" in SublimeText<p>Is there a way/plug-in to enable output without &quot;print()&quot; in SublimeText?</p> <p>For example,</p> <pre><c...
72,388,560
How do I install an archived CRAN package<p>I am trying to use the allanvar package which is documented on this <a href="https://www.rdocumentation.org/packages/allanvar/versions/1.1/topics/allanvar" rel="nofollow noreferrer">rdocumentation page</a> and this <a href="https://rdrr.io/cran/allanvar/man/allanvar-package.h...
<p>To see if a package has been archived, you can go to its CRAN page. In this case, it is <a href="https://cran.r-project.org/web/packages/allanvar" rel="nofollow noreferrer">https://cran.r-project.org/web/packages/allanvar</a> , but it's the same url pattern for other packages. Just put the package name after the las...
How do I install an archived CRAN package
r
1
62
2
72,388,748
72,388,748
2
true
2022-05-26T07:56:03.343Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I install an archived CRAN package<p>I am trying to use the allanvar package which is documented on this <a href="https://www.rdocumentation.org/packa...
72,238,349
Saving frame to file without rendering in processing<p>In Processing, how can I modify an existing sketch which saves each frame to an image file so that it does not render to the screen?</p> <p>I saw in <a href="https://forum.processing.org/one/topic/how-can-i-save-calculate-frame-without-displaying-them-in-real-time....
<p>You can use a <code>PGraphics</code> object and draw on it just like you would with a canvas. Here's an example sketch with no draw loop which outputs an image file:</p> <pre><code>void setup() { PGraphics pg = createGraphics(150, 150); pg.beginDraw(); pg.background(255); pg.stroke(0); pg.fill(color(0, ...
Saving frame to file without rendering in processing
processing
0
62
1
72,241,333
72,241,333
2
true
2022-05-14T07:57:45.840Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Saving frame to file without rendering in processing<p>In Processing, how can I modify an existing sketch which saves each frame to an image file so that it ...
72,367,797
Probability based function in Node.JS<p>I wanted to create a function that when clicking when opening a chest, the person will get a random character, based on their probability of each class:</p> <p>1 - Common: 90% 2 - Rare: 8% 3 - Super rare: 2%</p> <p>Is this possible in Node.JS?</p>
<p>It's indeed possible, and in any language since that's just generating a random number (see <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random" rel="nofollow noreferrer">Math.Random()</a>) and doing some maths!</p> <p>Here's an example with the code commented to exp...
Probability based function in Node.JS
javascript|node.js|sorting
0
62
1
72,368,128
72,368,128
2
true
2022-05-24T18:27:40.283Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Probability based function in Node.JS<p>I wanted to create a function that when clicking when opening a chest, the person will get a random character, based ...
72,387,774
Strange behavior about WEXITSTATUS with `G++ 4.9.4`<p>This code snippet below does compiles,</p> <pre><code>#include&lt;sys/types.h&gt; #include&lt;sys/wait.h&gt; #include&lt;iostream&gt; int main() { int ret = 0xFFFF; std::cout &lt;&lt; WEXITSTATUS(ret); } </code></pre> <p>whereas this code snippet does not ...
<p>The <code>WEXITSTATUS</code> macro is a matter of the C standard library implementation, not the compiler per se. Typically (and in the case of GCC) the compiler doesn't supply the C standard library implementation. It is an independent package.</p> <p>Most Linux distributions, including Ubuntu, use glibc as C stand...
Strange behavior about WEXITSTATUS with `G++ 4.9.4`
c++|linux|compiler-errors|wexitstatus
3
62
2
72,388,169
72,388,169
2
true
2022-05-26T06:42:38.447Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Strange behavior about WEXITSTATUS with `G++ 4.9.4`<p>This code snippet below does compiles,</p> <pre><code>#include&lt;sys/types.h&gt; #include&lt;sys/wait....
72,347,804
Check for intersection between 2 dateranges in Postgres<p>So the idea is very simple :</p> <p>I have a table containing a <code>start_date</code> and <code>end_date</code> columns .</p> <p>I also have 2 parameters (<code>initial_date</code>, <code>final_date</code>).</p> <p>I want to check of my daterange <code>[initit...
<p>Use the daterange overlap operator <code>&amp;&amp;</code>:</p> <pre class="lang-sql prettyprint-override"><code>select * from my_table where daterange(start_date, end_date) &amp;&amp; daterange('2022-05-19', '2022-05-24') </code></pre> <p>or the standard-compliant <code>overlaps</code>:</p> <pre class="lang-sql pre...
Check for intersection between 2 dateranges in Postgres
sql|postgresql
2
62
1
72,348,026
72,348,026
2
true
2022-05-23T11:30:30.957Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check for intersection between 2 dateranges in Postgres<p>So the idea is very simple :</p> <p>I have a table containing a <code>start_date</code> and <code>e...