question_id
int64
37.6M
73.2M
input_text
stringlengths
88
52.4k
output_text
stringlengths
37
35.6k
title
stringlengths
15
150
tags
stringlengths
1
107
q_score
int64
-19
397
view_count
int64
3
879k
answer_count
int64
1
21
accepted_answer_id
int64
37.6M
73.8M
answer_id
int64
37.6M
73.8M
a_score
int64
-5
1.29k
is_accepted
bool
1 class
creation_date
stringlengths
20
24
input_text_instruct
stringlengths
251
52.6k
72,803,463
How to change Visual Studio cursor color?<p>I was making Visual Studio Code stylish so I decided to change the color of the cursor.</p> <p>I searched on the <strong>Extensions</strong> tab but there were no extensions.</p>
<p>I figured it out and the answer is:</p> <p>I have to write a few lines of code in <strong><code>settings.json</code></strong>.</p> <p>And these are lines:</p> <pre><code>&quot;workbench.colorCustomizations&quot;: { &quot;editorCursor.foreground&quot;: &quot;#3a30fe&quot;, // light blue &quot;terminalCursor.f...
How to change Visual Studio cursor color?
visual-studio-code|colors
1
65
1
72,803,464
72,803,464
1
true
2022-06-29T14:51:05.020Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change Visual Studio cursor color?<p>I was making Visual Studio Code stylish so I decided to change the color of the cursor.</p> <p>I searched on the ...
72,809,243
Restrict cart weight per individual product category in WooCommerce<p>I am working on having WooCommerce restrict product weight per category and starting from the ability to restrict total weight in cart as shown here.</p> <p>The function is loaded into the themes functions.php file and works as expected by restrictin...
<p>When several similar conditions have to be met, it is desirable to use a multidimensional array and foreach loop(s). That way you avoid adding multiple if/else conditions.</p> <p>Via the <code>$settings</code> array, multiple settings arrays can be added/removed if desired.</p> <p>Only <code>'category'</code> and <c...
Restrict cart weight per individual product category in WooCommerce
wordpress|woocommerce|product|cart|taxonomy-terms
1
65
1
72,812,167
72,812,167
1
true
2022-06-30T00:50:20.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Restrict cart weight per individual product category in WooCommerce<p>I am working on having WooCommerce restrict product weight per category and starting fr...
72,986,813
Regex Track1 Magnetic Stripe<p>How can I create regex rule for name in Track1, following these rules:</p> <ul> <li>Allowed Characters would be: ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 .()-$</li> <li>Not Allowed Characters would be: ^!&quot;&amp;'*+,:;&lt;=&gt;@_[]#%?</li> <li>Required character - only must character <st...
<p>If there has to be at least <code>^</code> at the start and end, and there has to be at least a single <code>/</code> then the minimum amount of characters would be 3 instead of 2.</p> <p>In that case, you might use:</p> <pre><code>\^(?=[A-Z .()\/-]{1,24}\^)[A-Z .()-]*\/[A-Z .()-]*\^ </code></pre> <p><strong>Explana...
Regex Track1 Magnetic Stripe
regex|regex-group|magnetic-cards
0
65
1
72,990,098
72,990,098
1
true
2022-07-14T21:24:55.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex Track1 Magnetic Stripe<p>How can I create regex rule for name in Track1, following these rules:</p> <ul> <li>Allowed Characters would be: ABCDEFGHIJKL...
72,928,458
How to add OnClickListener with databinding in recycleView buttons?<p>I am fetching the categories from an API and I would like to fire up a new fragment by passing the category name to retrofit on the button click. I am thinking of doing it in my UI with <code>getText()</code> on the button clicked and firing up the A...
<p>You can pass a call back to the adapter class. In your fragment / activity, below the class create a new class to handle the click</p> <pre><code> /** * Click listener for YourDomainObject. By giving the block a name it helps a reader understand what it does. */ class YourCustomClickClick(val block:(YourDomainObje...
How to add OnClickListener with databinding in recycleView buttons?
android|android-studio|kotlin|android-fragments|android-recyclerview
1
65
1
72,928,889
72,928,889
1
true
2022-07-10T12:27:12.507Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add OnClickListener with databinding in recycleView buttons?<p>I am fetching the categories from an API and I would like to fire up a new fragment by ...
72,959,356
Printing to PDF, I can't set the proper active area<p>This is what I am working on. I have a workbook that is exporting data, running data through a couple of other macros to sort and format it before inserting the data into a formatted worksheet that will have a &quot;Print to PDF&quot; button. What I am running into ...
<p>Two ways to go about this then. The first one is to use array formulas, specifically <code>Filter(Range,criteria)</code> and depending on how complicated the data is, you might want to have a separate row to determine what data to include. In my example I'm using:</p> <blockquote> <p>=COUNTIF(E2:G2,&quot;-/-&quot;)&...
Printing to PDF, I can't set the proper active area
excel|vba|pdf|printing|range
0
65
1
72,973,772
72,973,772
1
true
2022-07-12T23:29:18.327Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Printing to PDF, I can't set the proper active area<p>This is what I am working on. I have a workbook that is exporting data, running data through a couple o...
73,007,200
Is there any way to identify each user in a collection of users by some specific id field in Firebase?<p>I want to create display detials accroding to roomid (comman in some users) but the firebase email and password authenication does not support any other property in firebase authenication. so how i can do this?</p>
<p>Of course, you can add properties as you wish for each user</p> <p>Let's say you have a collection called users each user in this collection can have a field named roomId</p> <p>Then you can get a user by roomId</p> <p>See the picture below to see how the structure could go to handle your case</p> <p><a href="https:...
Is there any way to identify each user in a collection of users by some specific id field in Firebase?
firebase|firebase-realtime-database
-1
65
1
73,007,964
73,007,964
1
true
2022-07-16T19:47:03.030Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any way to identify each user in a collection of users by some specific id field in Firebase?<p>I want to create display detials accroding to roomid...
72,936,044
Is it possible to use PCRE2 on variables in bash<p>I'm trying to use PCRE2 on stdin in a bash script but I'm not sure it's possible based on reading the docs. I know I can give it the filename but I'm doing a test and it specifically says on stdin.</p> <p>For example I have this text in input.txt</p> <pre><code>foo bla...
<p>Just run it, just like grep:</p> <pre><code>regex=$(mix run -e &quot;my_mod.main('${token}')&quot; &lt;&amp;-) pcre2grep &quot;${regex}&quot; </code></pre> <hr /> <p>It happens that <code>mix</code> is reading from standard input, leaving nothing for <code>pcre2grep</code> to read. Close standard input for the proce...
Is it possible to use PCRE2 on variables in bash
bash|pcre
0
65
1
72,936,085
72,936,085
1
true
2022-07-11T09:04:20.713Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to use PCRE2 on variables in bash<p>I'm trying to use PCRE2 on stdin in a bash script but I'm not sure it's possible based on reading the docs...
72,839,144
Problem parsing the body of a POST request<p>So what I'm trying to do is: with a link similar to: <a href="http://localhost/API-REST/Endpoints/ajoutDeMessage.php?contenu=%27Hello%27&amp;idUser=4" rel="nofollow noreferrer">http://localhost/API-REST/Endpoints/ajoutDeMessage.php?contenu='Hello'&amp;idUser=4</a>. For now, ...
<h2>There is no post body</h2> <blockquote> <p>i'm putting this url directly in postman, and press send.</p> </blockquote> <p>I don't use postman myself, but doing this will generate a post request with no data it's the equivalent of:</p> <pre><code>curl -X POST http://example.com </code></pre> <p>That's not passing a ...
Problem parsing the body of a POST request
php
-1
65
1
72,842,050
72,842,050
1
true
2022-07-02T12:43:05.017Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem parsing the body of a POST request<p>So what I'm trying to do is: with a link similar to: <a href="http://localhost/API-REST/Endpoints/ajoutDeMessage...
72,849,871
Print array of strings vertically<p>I know how to print a single string vertically.</p> <pre><code>char test[100] = &quot;test&quot;; int i; for(i=0;i&lt;strlen(test);i++){ printf(&quot;%c\n&quot;,test[i]); } </code></pre> <p>Which will give me:</p> <pre><code>t e s t </code></pre> <p>But how can I print an array o...
<p>Simply print a character from both strings.</p> <p>(Better to test for the null character rather than repeatedly call <code>strlen()</code>.)</p> <pre><code>for(i = 0; listOfTest[0][i] &amp;&amp; listOfTest[1][i]; i++) { printf(&quot;%c%c\n&quot;, listOfTest[0][i], listOfTest[1][i]); } </code></pre> <p>To extend t...
Print array of strings vertically
arrays|c|string
1
65
2
72,849,943
72,849,943
1
true
2022-07-03T21:00:06.430Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Print array of strings vertically<p>I know how to print a single string vertically.</p> <pre><code>char test[100] = &quot;test&quot;; int i; for(i=0;i&lt;str...
72,965,255
Decoding signed CAN bytes in C<p>I've been trying to write a function to decode CAN bytes in C, taking into account endianness of values coming in and endianness of system. Now, it works fine for unsigned values, but sucks for signed ones.</p> <p>I have a feeling I have deeply misunderstood how signed representation wo...
<p>Problems:</p> <p><strong>Sign extending woes</strong></p> <p>OP appears to want to sign extend the sign <em>bit</em> into other <em>bytes</em>.</p> <pre><code>if(byte_order == LITTLE_ENDIAN_VAL) { //memcpy(blocks, payload, (is_signed ? data_len - 1 : data_len)); //blocks[7] = is_signed ? payload[data_len - 1...
Decoding signed CAN bytes in C
c|hex|endianness|can-bus
1
65
1
72,965,519
72,965,519
1
true
2022-07-13T11:07:09.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Decoding signed CAN bytes in C<p>I've been trying to write a function to decode CAN bytes in C, taking into account endianness of values coming in and endian...
72,971,112
the second elif condition doesnt get executed here?<p>Task Given an integer, n, perform the following conditional actions:</p> <p>If n is odd, print Weird</p> <p>If n is even and in the inclusive range of 2 to 5, print Not Weird</p> <p>If n is even and in the inclusive range of 6 to20 , print Weird</p> <p>If n is even ...
<p>I think this works:</p> <pre><code>... if (n % 2 != 0) or (n in range(6, 21)): print('Weird') elif (n in range(2, 6)) or (n &gt; 20): print('Not Weird') </code></pre>
the second elif condition doesnt get executed here?
python|python-3.x
1
65
2
72,971,160
72,971,160
1
true
2022-07-13T18:36:49.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: the second elif condition doesnt get executed here?<p>Task Given an integer, n, perform the following conditional actions:</p> <p>If n is odd, print Weird</p...
72,987,792
Issue when rendering a new state in React<p>I am still new in react, and i am having trouble to figure it out how to fix an issue with the useState method when i call a function, i try to simplifie as much as possible the code in below as example (on the front-end) :</p> <pre><code>function App() { const [imageUrl,...
<p>Well, I was able to fix it myself, looks like the issue is with the <code>Object.assign</code> method which didn't work as expected even though I still don't understand why... however when I replaced it with the entire Object like below :</p> <pre><code>const onPictureSubmit = () =&gt; { setImageUrl(input) ...
Issue when rendering a new state in React
reactjs
1
65
1
72,995,312
72,995,312
1
true
2022-07-15T00:02:13.203Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue when rendering a new state in React<p>I am still new in react, and i am having trouble to figure it out how to fix an issue with the useState method wh...
72,888,899
React Localize Global Styles?<p>Is it possible to localize the global styles of a module to only one file?</p> <p>for instance, I would like to change the width of an item from a react module but only for one file. <em>inline styles aren't possible :/</em></p> <p>edit for context: in my particular case ... i'm using 'r...
<p>You just nest the CSS rule to only apply when inside a specific container:</p> <pre><code>.my-container .react-multi-carousel-item { width: 310px !important; } </code></pre> <p>And then in React:</p> <pre><code>return &lt;&gt; &lt;MultiCarousel /&gt; &lt;div className=&quot;my-container&quot;&gt; &lt;MultiCa...
React Localize Global Styles?
javascript|css|reactjs|typescript|frontend
0
65
1
72,889,867
72,889,867
1
true
2022-07-06T19:25:52.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Localize Global Styles?<p>Is it possible to localize the global styles of a module to only one file?</p> <p>for instance, I would like to change the wi...
73,022,262
can't delete google cloud project<pre><code>gcloud projects delete test-henx </code></pre> <p>When I try to delete <code>test-henx</code> project, error occurs like this.</p> <pre><code>Do you want to continue (Y/n)? Y ERROR: (gcloud.projects.delete) FAILED_PRECONDITION: Precondition check failed. - '@type': type.goo...
<p>List this way: <code>gcloud alpha resource-manager liens list</code></p> <p>And to delete please use this command as an example:</p> <pre><code>gcloud alpha resource-manager liens delete [LIEN_NAME] </code></pre>
can't delete google cloud project
google-cloud-platform
0
65
1
73,023,967
73,023,967
1
true
2022-07-18T12:23:31.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: can't delete google cloud project<pre><code>gcloud projects delete test-henx </code></pre> <p>When I try to delete <code>test-henx</code> project, error occu...
72,844,598
How to Make the http Interceptor in flutter<p>I would like to know if it is possible to have a global HTTP interceptor for http: ^0.13.4 package to attach token in header for all requests in Flutter or catch error 401 and relogin in one method? thanks a lot!</p>
<p>I assume you need a better HTTP Request for handling errors. Perhaps, you can check <a href="https://pub.dev/packages/dio" rel="nofollow noreferrer">Dio Package</a>.</p> <p>So far as I know, Dio could handle many details about HTTP Request requirements, including attaching tokens to the header.</p>
How to Make the http Interceptor in flutter
flutter
0
65
1
72,845,046
72,845,046
1
true
2022-07-03T07:16:23.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Make the http Interceptor in flutter<p>I would like to know if it is possible to have a global HTTP interceptor for http: ^0.13.4 package to attach to...
72,772,296
Value in "input" filed becomes empty<p>Hi Folks I'm new to JS World.</p> <p>I am trying to add A <code>&lt;div&gt;</code> dynamically to my HTML with the help of JavaScript.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippe...
<p>The problem stems from the line <code>form.innerHTML+=html</code> which is shorthand for <code>form.innerHTML = form.innerHTML + html</code>. When it gets the <code>form.innerHTML</code> it is grabbing the HTML only; The text typed into the inputs are not a part of this HTML. When the innerHTML gets set, think <code...
Value in "input" filed becomes empty
javascript|html
2
65
1
72,772,602
72,772,602
1
true
2022-06-27T12:42:21.793Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Value in "input" filed becomes empty<p>Hi Folks I'm new to JS World.</p> <p>I am trying to add A <code>&lt;div&gt;</code> dynamically to my HTML with the hel...
72,842,202
Tailwind CSS - make image in flex bigger<p>I want to move a picture/row down using Tailwind CSS, in order to achieve this kind of image gallery: <a href="https://i.stack.imgur.com/MmPng.png" rel="nofollow noreferrer">https://i.stack.imgur.com/MmPng.png</a></p> <p>Here is what I have tried:</p> <pre><code> &lt;sectio...
<p>I think you should use the <code>grid</code> classes instead of <code>flex</code> for this purpose. Then you can use row-span and col-span, which makes it quite easy to achieve the grid that is in the example in your question.</p> <p><a href="https://play.tailwindcss.com/CqaKjQ6NSh" rel="nofollow noreferrer">Here is...
Tailwind CSS - make image in flex bigger
html|css|tailwind-css
0
65
1
72,842,480
72,842,480
1
true
2022-07-02T20:23:00.653Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tailwind CSS - make image in flex bigger<p>I want to move a picture/row down using Tailwind CSS, in order to achieve this kind of image gallery: <a href="htt...
72,926,648
how to map a class object and instantiate it<p>I'm trying to mimic this Python functionality:</p> <pre><code>class Bla: def __init__(self, arg): self.arg = arg {&quot;bla&quot;: Bla}[&quot;bla&quot;](None) # create a Bla class dynamically </code></pre> <p>I looked at <a href="https://stackoverflow.com/ques...
<p>C++, in contrast to Python, is statically typed. Classes are not first-class objects and you can't store them.</p> <p>In the following I assume that <code>MyObj</code> is the abstract base that all &quot;stored&quot; types are meant to inherit from and that <code>MyObj1</code>/<code>MyObj2</code> are some of these t...
how to map a class object and instantiate it
c++
0
65
2
72,926,709
72,926,709
1
true
2022-07-10T06:50:16.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to map a class object and instantiate it<p>I'm trying to mimic this Python functionality:</p> <pre><code>class Bla: def __init__(self, arg): ...
72,976,328
Best asymetric encryption scheme for logging<p>I am using java spring boot and adding functions to log exceptions.</p> <p>Although I try to remove as much sensitive information as possible, I am trying to encrypt all logs that I store in case my server is breached (so no sensitive plaintext information is shown to hack...
<blockquote> <p>I tried ECDSA/ECDH, but that is only for signing stuff, not for string encryption and decryption.</p> </blockquote> <p>If you must, you can use ECDH:</p> <ul> <li>Have a securely stored EC keypair (A) (stored in some vault/secured keystore)</li> <li>Give A.pub to the application</li> <li>During runtime,...
Best asymetric encryption scheme for logging
java|encryption|public-key-encryption|encryption-asymmetric
2
65
1
72,978,810
72,978,810
1
true
2022-07-14T06:49:51.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best asymetric encryption scheme for logging<p>I am using java spring boot and adding functions to log exceptions.</p> <p>Although I try to remove as much se...
72,977,403
std::tolower example from website not giving expected result<p>I found an example of std::tolower, here: <a href="https://en.cppreference.com/w/cpp/string/byte/islower" rel="nofollow noreferrer">https://en.cppreference.com/w/cpp/string/byte/islower</a></p> <p>There's an example which, according to the website, should r...
<p>Ok so problem is that on Windows locale names are not same as on Linux.</p> <p>On Windows <code>iso88591</code> is represented by codepage <code>1252</code> so one of possible locale name is:<code>.1252</code>:</p> <pre class="lang-cpp prettyprint-override"><code>std::setlocale(LC_ALL, &quot;.1252&quot;); </code></p...
std::tolower example from website not giving expected result
c++
1
65
1
72,977,728
72,977,728
1
true
2022-07-14T08:21:16.100Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: std::tolower example from website not giving expected result<p>I found an example of std::tolower, here: <a href="https://en.cppreference.com/w/cpp/string/by...
73,003,998
change dynamic field value in logstash<p>I'm using a filter in logstash. I wanna change value of a dynamic field in logstash. I'm using below codes in my filter:</p> <pre><code>if [state_ls_keyvalue] == &quot;False&quot; { mutate{ add_field =&gt; {&quot;%{field_ls_keyvalue}&quot; =&gt; &quot;%{...
<p>The problem is related to <em><strong>type of field</strong></em> in elasticsearch. we can handle with <em><strong>mapping</strong></em> and change it.</p> <p>using only <code>add_field</code>, the value of new field appends into old one.</p> <p>using <code>remove_field</code> and then <code>add_field</code>, replac...
change dynamic field value in logstash
filter|logstash
1
65
2
73,036,043
73,036,043
1
true
2022-07-16T11:58:15.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: change dynamic field value in logstash<p>I'm using a filter in logstash. I wanna change value of a dynamic field in logstash. I'm using below codes in my fil...
72,786,238
Use `Application.FindFormat` to find all the other different format (Color)?<p>I am using the below code to select the colored cells (Yellow) on usedrange.<br> In the same sheet I have other cells filled with another different colors.<br> I am asking, is it possible to use <code>Application.FindFormat</code> to find al...
<p>The <code>Application.FindFormat</code> in Excel/VBA can do exactly the same as the Find-Dialog in Excel. As you can see, there is no &quot;not equal&quot; search in Excel for formatting, so there is no such search in VBA.</p> <p>To get a list of colors and it's usage, you will have to loop over all cells. The follo...
Use `Application.FindFormat` to find all the other different format (Color)?
excel|vba|format
1
65
1
72,788,027
72,788,027
1
true
2022-06-28T12:14:06.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use `Application.FindFormat` to find all the other different format (Color)?<p>I am using the below code to select the colored cells (Yellow) on usedrange.<b...
73,017,390
How to create an alluvial plot in ggplot2 with ggalluvial package?<p>I'm trying to create an alluvial plot in <code>ggplot2</code> with the <code>ggalluvial</code> package. Here are the two helpful websites I've been using to create the plot: <a href="https://r-charts.com/flow/ggalluvial/" rel="nofollow noreferrer">sit...
<p>When you <code>cbind()</code> your vectors, you create a <code>matrix</code> which (unlike a <code>data.frame</code>) cannot contain different data types. Therefore, the <code>Freq</code> gets converted to a <code>character</code>. If you just directly create the <code>data.frame</code> without <code>cbind()</code> ...
How to create an alluvial plot in ggplot2 with ggalluvial package?
r|ggplot2|ggalluvial
1
65
1
73,017,439
73,017,439
1
true
2022-07-18T04:37:47.923Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create an alluvial plot in ggplot2 with ggalluvial package?<p>I'm trying to create an alluvial plot in <code>ggplot2</code> with the <code>ggalluvial<...
72,250,232
Why could the filtered elements from a Java stream return an empty list after a String was converted to List?<p>I accessed a web table with selenium and collected all the table rows into a list:</p> <pre><code>List&lt;WebElement&gt; nameColumn = driver.findElements(By.xpath(&quot;//tbody/tr/td[2]/span&quot;)); </code><...
<p>Your arraylist contains words with quotes, i.e <strong>&quot;</strong> <em>test1</em> <strong>&quot;</strong>. <br>That is why you should not check directly with <code>field.startswith</code>. But you should first remove quote and then check <code>field.startswith</code>. <br>Please use below :</p> <pre><code>List&l...
Why could the filtered elements from a Java stream return an empty list after a String was converted to List?
java|selenium|selenium-webdriver
0
65
1
72,254,175
72,254,175
1
true
2022-05-15T16:37:08.340Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why could the filtered elements from a Java stream return an empty list after a String was converted to List?<p>I accessed a web table with selenium and coll...
72,343,517
How to control the kestrel port during deployment?<p>During development I control the http and https ports using the launchSettings.json file as marked below:</p> <p><a href="https://i.stack.imgur.com/EXbqz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EXbqz.png" alt="enter image description here" ...
<p>Because <code>launchSettings.json</code> work for Development env <a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-6.0#development-and-launchsettingsjson" rel="nofollow noreferrer">Development and launchSettings.json</a></p> <p>There are the several ways you can set the...
How to control the kestrel port during deployment?
.net|kestrel-http-server|asp.net-core-6.0
1
65
1
72,343,673
72,343,673
1
true
2022-05-23T05:13:41.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to control the kestrel port during deployment?<p>During development I control the http and https ports using the launchSettings.json file as marked below...
72,238,972
emplace and try_emplace with copy constructor<p>I have an issue with emplace and try_emplace as they always use the copy constructors when moving an object in.</p> <pre><code>#include &lt;iostream&gt; #include &lt;unordered_map&gt; #include &lt;map&gt; using namespace std; class Too { public: Too(int x, int y):x...
<p>Since you've provided a copy constructor for your class, the move constructor <code>Too::Too(Too&amp;&amp;)</code> will <strong>not be implicitly generated by the compiler</strong>.</p> <p>Moreover, when there is no move constructor available for a class, the copy constructor can be used.</p> <hr /> <p>For using the...
emplace and try_emplace with copy constructor
c++|dictionary|try-catch|emplace
0
65
1
72,239,020
72,239,020
1
true
2022-05-14T09:37:41.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: emplace and try_emplace with copy constructor<p>I have an issue with emplace and try_emplace as they always use the copy constructors when moving an object i...
72,362,343
Correct way to deactivate user and its profile in Django<p>I have created a view where the logged-in user should be able to deactivate its profile.<br> I expect then to see the change being reflected in my admin section, but it's not.<br> Looks like the user is being deactivated but the user.profile isn't.<br> I am puz...
<p>owner and profile is <code>request.user</code>.</p> <h2>Solution #1</h2> <p>in your model add <code>related_name</code>:</p> <pre><code>class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE,related_name=&quot;profile&quot;) </code></pre> <p>in your ProfileInactive.post method:</...
Correct way to deactivate user and its profile in Django
python|django|django-class-based-views
1
65
2
72,362,598
72,362,598
1
true
2022-05-24T11:46:57.047Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Correct way to deactivate user and its profile in Django<p>I have created a view where the logged-in user should be able to deactivate its profile.<br> I exp...
72,324,696
Python run both as user and sudo<p>I'm writing a python script to automatize the installation of some tools every time I create a VM and, since I'm not a bash fan I'm doing it with python. The problem is that <code>apt</code> installations require sudo privileges, while <code>pip</code> installations don't.</p> <p>I'm ...
<p>You can use a list of <code>apt</code> commands with <code>subprocess</code> or <code>pexpect</code>. It can also prompt for a password if no password is provided using <code>getpass</code>:</p> <blockquote> <p><strong>NOTE</strong> - Tested on Ubuntu 20.04 using Python 3.8.10</p> </blockquote> <blockquote> <p><stro...
Python run both as user and sudo
python|python-3.x|linux|bash
1
65
1
72,325,303
72,325,303
1
true
2022-05-20T20:56:11.607Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python run both as user and sudo<p>I'm writing a python script to automatize the installation of some tools every time I create a VM and, since I'm not a bas...
72,357,828
How do I set limits for my range function in python?<p>Say I am iterating through a list. I want to check if the list's neighbours (i-1 and i+1) contain a certain element. How do I do this without running into &quot;list index out of range&quot; problem? Example:</p> <pre><code>list = [1, 0, 1, 0, 1, 0] for i, j in enu...
<p>If you want to iterate for all elements in the target list, one solution is to check the value of second for loop:</p> <pre><code>_list = [1, 0, 1, 0, 1, 0] elements = 0 for i, j in enumerate(_list): for m in range(max(i-1, 0), min(i+2, len(_list))): if _list[m] == 1: elements += 1 </code></p...
How do I set limits for my range function in python?
python|list|for-loop|range
0
65
3
72,358,066
72,358,066
1
true
2022-05-24T05:58:20.650Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I set limits for my range function in python?<p>Say I am iterating through a list. I want to check if the list's neighbours (i-1 and i+1) contain a ce...
72,325,550
Generalize algorithm for a loop comparing to last record?<p>I have a data set which I can represent by this toy example of a list of dictionaries:</p> <pre><code>data = [{ &quot;_id&quot; : &quot;001&quot;, &quot;Location&quot; : &quot;NY&quot;, &quot;start_date&quot; : &quot;2022-01-01T00:00:00...
<p><strong>EDIT</strong>: If you want to use a query for this, one option is something like:</p> <ol> <li>The <code>$objectToArray</code> allow to format the keys as values, and the <code>$ifNull</code> allows to check several options of <code>start_date</code>.</li> <li>The <code>$unwind</code> allows us to sort the k...
Generalize algorithm for a loop comparing to last record?
python|mongodb-query|aggregation-framework
1
65
2
72,330,896
72,330,896
1
true
2022-05-20T23:18:34.073Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generalize algorithm for a loop comparing to last record?<p>I have a data set which I can represent by this toy example of a list of dictionaries:</p> <pre><...
72,338,543
React MUI - Clearing input on Autocomplete component<p>I have an Autocomplete component which displays the coutries name and flags as in the example from the MUI doc.</p> <p><a href="https://codesandbox.io/s/countryselect-material-demo-forked-qdc4wg?fontsize=14&amp;hidenavigation=1&amp;theme=dark" rel="nofollow norefer...
<p>That's behavior occurs because when you click on the flag, the <code>e.target</code> won´t be the <code>input</code> element, but the wrapper <code>div</code>. You can see this just adding a <code>console.log</code> to the <code>handleClear</code> function:</p> <pre class="lang-js prettyprint-override"><code>const h...
React MUI - Clearing input on Autocomplete component
reactjs|material-ui
0
65
2
72,342,779
72,342,779
1
true
2022-05-22T14:37:06.583Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React MUI - Clearing input on Autocomplete component<p>I have an Autocomplete component which displays the coutries name and flags as in the example from the...
72,261,048
Pandas - collapse rows on cell value but retain order<p>I have a transcription from an interview which I've converted into a df (I have only recently started learning the pandas framework). The structure of the df is as follows:</p> <pre><code>Timestamp Content Speaker 00:00:00.000-00:00:01.100 Cont...
<p>You can use <a href="https://pandas.pydata.org/docs/reference/api/pandas.core.groupby.DataFrameGroupBy.aggregate.html" rel="nofollow noreferrer"><code>Groupby.agg</code></a> and use the non equality between successive rows as grouper:</p> <pre><code>(df .groupby(df['Speaker'].ne(df['Speaker'].shift()).cumsum(), ...
Pandas - collapse rows on cell value but retain order
python|pandas
1
65
2
72,261,136
72,261,136
1
true
2022-05-16T14:43:07.003Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas - collapse rows on cell value but retain order<p>I have a transcription from an interview which I've converted into a df (I have only recently started...
72,308,744
pandas apply with assignment on large dataframe<p>I have a very long dataframe <code>dfWeather</code> with the column <code>TEMP</code>. Because of its size, I want to keep only relevant information. Concretely, keep only entries, where the temperature changed by more than 1 since the last entry I kept. I want to use <...
<p>If you don't want to call this recursive (so you have <code>[1, 2, 3]</code> and you want to keep <code>[1, 3]</code> because <code>2</code> is only 1 degree larger than <code>1</code> but <code>3</code> is more than 1 degree larger than <code>1</code>, but not than <code>2</code>) than you can simply use <code>diff...
pandas apply with assignment on large dataframe
python|pandas|dataframe|lambda
0
65
1
72,309,212
72,309,212
1
true
2022-05-19T17:24:47.030Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pandas apply with assignment on large dataframe<p>I have a very long dataframe <code>dfWeather</code> with the column <code>TEMP</code>. Because of its size,...
72,362,615
Is it really impossible to suspend two std/posix threads at the same time?<p>I want to briefly suspend multiple C++ std threads, running on Linux, at the same time. It seems this is not supported by the OS.</p> <p>The threads work on tasks that take an uneven and unpredictable amount of time (several seconds). I want t...
<blockquote> <p>I want to suspend them when the CPU temperature rises above a threshold.</p> </blockquote> <p>In general, that is putting the cart before the horse.</p> <p>Properly designed hardware should have adequate cooling for maximum load and your program should not be able to exceed that cooling capacity.</p> <p...
Is it really impossible to suspend two std/posix threads at the same time?
c++|multithreading|pthreads|pause|stdthread
0
65
1
72,420,796
72,420,796
1
true
2022-05-24T12:07:27.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it really impossible to suspend two std/posix threads at the same time?<p>I want to briefly suspend multiple C++ std threads, running on Linux, at the sam...
72,259,120
repaint() not updating panel?<p>I have a class (not public, so you probably do not know the class) which is drawing a picture with picture.draw(g2). With picture.changeToDry() I can change the picture. It works fine, when I call the picture and change it in implemented paintComponent() method. But when I call changeToD...
<p>There is your problem:</p> <pre><code>public class ClimateFrame extends JFrame { public ClimateFrame() { setTitle(&quot;A task&quot;); setLayout(new BorderLayout()); add(new ClimatePanel(), BorderLayout.CENTER); } public static void main(String [] args) { ...
repaint() not updating panel?
java|swing|jpanel|paint|repaint
0
65
1
72,260,012
72,260,012
1
true
2022-05-16T12:20:25.663Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: repaint() not updating panel?<p>I have a class (not public, so you probably do not know the class) which is drawing a picture with picture.draw(g2). With pic...
72,323,673
Is there a way I can loop inside a var in typescript?<pre><code>setup() { var nodes = { node1: { name: &quot;Node 1&quot; }, node2: { name: &quot;Node 2&quot; }, node3: { name: &quot;Node 3&quot; }, node4: { name: &quot;Node 4&quot; }, } var edges = { edge1: { source: &quot;nod...
<p>Here's a solution:</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>const setup = (nodeCount) =&gt; { const nodes = {}; const edges = {}; for (let i = 1; i &lt;= nodeC...
Is there a way I can loop inside a var in typescript?
typescript|vue.js
1
65
5
72,323,753
72,323,753
1
true
2022-05-20T18:57:45.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way I can loop inside a var in typescript?<pre><code>setup() { var nodes = { node1: { name: &quot;Node 1&quot; }, node2: { name: &...
72,347,606
Return only the modified records in a table, using T-SQL<p>I'm attempting to return only the modified records in a table, using T-SQL.</p> <p>This is what I've done thus far:</p> <pre><code> BEGIN IF OBJECT_ID('tempdb..#Test') IS NOT NULL DROP TABLE #Test CREATE TABLE #Test (SetName nvarchar(10...
<p>To track the changes at whole dataset, you were almost there, you just need to remove the first row by using <code>LastValue &lt;&gt; -1</code>.</p> <pre><code>WITH CTE AS ( SELECT SetName, [Timestamp], Value, lag(Value, 1, -1) OVER (ORDER BY [Timestamp]) AS LastValue FROM #Test ) SELECT SetName, [Timest...
Return only the modified records in a table, using T-SQL
sql|sql-server|tsql|lag
1
65
2
72,348,910
72,348,910
1
true
2022-05-23T11:15:07.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Return only the modified records in a table, using T-SQL<p>I'm attempting to return only the modified records in a table, using T-SQL.</p> <p>This is what I'...
72,239,126
React Context State Not Updating<p>My Context:</p> <pre><code>type Props = { children: React.ReactNode; }; interface Context { postIsDraft: boolean; setPostIsDraft: Dispatch&lt;SetStateAction&lt;boolean&gt;&gt;; } const initialContext: Context = { postIsDraft: false, setPostIsDraft: (): void =&gt; {}, }; c...
<p>Your <code>ParentComponent</code> should be wrapped inside provider so as to use it's value:</p> <pre><code> &lt;EditPostContextProvider&gt; &lt;ParentComponent /&gt; &lt;/EditPostContextProvider&gt; </code></pre> <p>Generally we can put the provider in index.js file, and wrap <code>&lt;app /&gt;</code>...
React Context State Not Updating
reactjs|typescript
0
65
1
72,239,155
72,239,155
2
true
2022-05-14T09:58:17.013Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Context State Not Updating<p>My Context:</p> <pre><code>type Props = { children: React.ReactNode; }; interface Context { postIsDraft: boolean; s...
72,253,261
Using elif statement "print function" not working correctly instead printing if statement's "print function" instead<p>I am trying to make a selection tool to pick my next anime, I used the random package to select which one would be the next to watch and this works correctly my issue lies in the following I want to ad...
<p>You'll need to use the <code>==</code> operator like so:</p> <pre><code>import random print(&quot;Project Select&quot;) print(&quot;&quot;) #for future me print(&quot;Summary Of Project: This Project Has The Goal To Help Select What Anime I Should Watch Next&quot;) print(&quot;&quot;) Anime = [&quot;Black Bullet&qu...
Using elif statement "print function" not working correctly instead printing if statement's "print function" instead
python|python-3.x|if-statement|random|printing
1
65
4
72,253,301
72,253,301
2
true
2022-05-16T01:03:37.657Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using elif statement "print function" not working correctly instead printing if statement's "print function" instead<p>I am trying to make a selection tool t...
72,256,096
SQL Query to exclude a certain user on a certain day<p>I'm trying to write a SQL query which will be used in an SSRS report. It is to show the number of changes made to a table by a user between two dates. I have the query working fine except when I try to remove all entries by a certain user on a certain day as these ...
<pre><code>...AND NOT (hist.timestamp = '2022-04-26' AND hist.userid = 'DOMAIN\John.Smith') </code></pre>
SQL Query to exclude a certain user on a certain day
sql|sql-server|reporting-services
0
65
1
72,256,177
72,256,177
2
true
2022-05-16T08:17:40.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL Query to exclude a certain user on a certain day<p>I'm trying to write a SQL query which will be used in an SSRS report. It is to show the number of chan...
72,270,420
What does Default Implementation of Python means in CPython?<p>I have started learning python and there's a concept of flavors of python in which first is CPython and it's defination is that it is default implementation of Python. Now here i don't understand what it is trying to say, is that - full python is implemente...
<p>There's <a href="https://www.python.org/psf-landing/" rel="nofollow noreferrer">one group of developers</a> which work on the Python language. The &quot;Python language&quot; <em>could</em> just be an abstract specification of how the language is supposed to behave, with no actual runnable project. But that's not wh...
What does Default Implementation of Python means in CPython?
python|c|cpython
0
65
2
72,270,700
72,270,700
2
true
2022-05-17T08:14:38.727Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does Default Implementation of Python means in CPython?<p>I have started learning python and there's a concept of flavors of python in which first is CP...
72,284,113
Whats the correct way of declaring folder path in python?<p>I Need to know whats the correct way of declaring folder path , suppose I have a <strong>dummy.py</strong> file inside a main folder &amp; also Inside main folder 2 child folders are present images &amp; music , now if i want to declare a image22.img from im...
<p>The use of './' is not obligatory if you're requesting files from a folder that is on the current path.</p> <p>So, in this example you don't need to use './' :</p> <pre><code>images/image22.img </code></pre>
Whats the correct way of declaring folder path in python?
python|python-3.x
3
65
2
72,284,209
72,284,209
2
true
2022-05-18T06:25:32.460Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Whats the correct way of declaring folder path in python?<p>I Need to know whats the correct way of declaring folder path , suppose I have a <strong>dummy.py...
72,295,806
Define a temporary table within an SQL "select" query<p>I'm referring to MS Access SQL. Suppose I have a column with dates of birth of a population and the decades which these dates fall into.</p> <pre><code>Year Decade 1971 8 1953 6 1958 6 1929 3 1930 4 </code></pre> <p>I want to create a query which will show how man...
<p>MsAccess does not have a function like Range() that you can use. What I have done in my databases is create a table of numbers to use for cases like this.</p> <p>The simplest way to create this table is by using an Excel spreadsheet to build the column of numbers (for instance, from 1 to 1,000) and then import the s...
Define a temporary table within an SQL "select" query
sql|ms-access
1
65
2
72,296,427
72,296,427
2
true
2022-05-18T20:47:38.200Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Define a temporary table within an SQL "select" query<p>I'm referring to MS Access SQL. Suppose I have a column with dates of birth of a population and the d...
72,309,955
Python's Numpy dot function returning incorrect value, why?<p>Real simple, my code is:</p> <pre><code>import numpy as np a = np.array([0.4, 0.3]) b = np.array([-0.15, 0.2]) print(np.dot(a,b)) </code></pre> <p>The dot product of this should be 0, and instead i get:</p> <pre><code>3.3306690738754695e-18 </code></pre>
<p>Floating-point!</p> <p>Floating-point (i.e. non-integer) arithmetic tends not to be 100% accurate.</p> <p>See <a href="https://stackoverflow.com/questions/21895756/why-are-floating-point-numbers-inaccurate">here</a> for more info.</p> <p>Also, note that your result is very close to zero.</p>
Python's Numpy dot function returning incorrect value, why?
python|numpy|dot-product
-2
65
1
72,309,995
72,309,995
2
true
2022-05-19T19:11:30.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python's Numpy dot function returning incorrect value, why?<p>Real simple, my code is:</p> <pre><code>import numpy as np a = np.array([0.4, 0.3]) b = np.ar...
72,319,664
How to move a function into a separate method?<p>I have a function that is called when a ListTile is clicked. I need to move it to a separate method. The function is in onTap. I want to put it in a separate method outside of build. How can i do this?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-con...
<p>Method outside of build:</p> <pre><code>_onTap(int index, BuildContext context, ??? listModel) { final event = listModel.getEvent(listModel.eventList[index].id); if (event != null) { showModalBottomSheet&lt;void&gt;( ...
How to move a function into a separate method?
flutter|dart
0
65
1
72,319,725
72,319,725
2
true
2022-05-20T13:22:16.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to move a function into a separate method?<p>I have a function that is called when a ListTile is clicked. I need to move it to a separate method. The fun...
72,336,047
Why does randomElement() return ?? and not?<p>I'm learning Swift and some iOS development. Here is my code which I'm trying to figure out why XCode is complaining.</p> <pre><code>private func rollMyDice() { let diceRollImages = [ UIImage(named: &quot;DiceOne&quot;), UIImage(named: &quot;DiceTwo&quot...
<p>Note that <a href="https://developer.apple.com/documentation/uikit/uiimage/1624146-init" rel="nofollow noreferrer"><code>UIImage(named:)</code></a> is a failable initialiser, and so the expressions <code>UIImage(named: &quot;DiceOne&quot;)</code> etc are of type <code>UIImage?</code>. This makes the array <code>dice...
Why does randomElement() return ?? and not?
ios|swift
1
65
2
72,336,217
72,336,217
2
true
2022-05-22T08:48:01.300Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does randomElement() return ?? and not?<p>I'm learning Swift and some iOS development. Here is my code which I'm trying to figure out why XCode is compla...
72,353,787
Creating interaction terms with continuous variables in stata<p>I have &quot;trading&quot; as a variable. I want to see how trading by the rich and the poor affect their total asset returns by interacting this continuous variable &quot;trading&quot; with a dummy rich, poor and compare the effect vis a vis the middle. I...
<p>You can specify an interaction between a continuous variable and a categorical variable as such:</p> <pre><code>sysuse auto reg price c.weight#i.rep78 </code></pre> <p>I'd recommend using factor-notation (<code>i.</code>) to make it explicit that the categorical variable is a categorical variable.</p>
Creating interaction terms with continuous variables in stata
stata|interaction
0
65
1
72,357,079
72,357,079
2
true
2022-05-23T19:17:51.013Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating interaction terms with continuous variables in stata<p>I have &quot;trading&quot; as a variable. I want to see how trading by the rich and the poor ...
72,378,190
Pivot_wider and count number of occurrences retaining all other columns<p>I want to <code>pivot_wider</code> to spread the column <code>issue</code>. The value should be the number of occurences of each <code>issue</code> per <code>product</code>:</p> <pre><code>library(dplyr) library(tidyr) df = data.frame(product= ...
<p>You can count them first:</p> <pre class="lang-r prettyprint-override"><code>library(dplyr) library(tidyr) df = data.frame(product= c(1,1,1,2,2,2,3,3,3), type = c(rep(&quot;a&quot;,3),rep(&quot;b&quot;, 3),rep(&quot;a&quot;,3)), issue = c(&quot;fall&quot;,&quot;fall&quot;,&quot;trap...
Pivot_wider and count number of occurrences retaining all other columns
r|tidyr
0
65
1
72,378,460
72,378,460
2
true
2022-05-25T13:03:19.010Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pivot_wider and count number of occurrences retaining all other columns<p>I want to <code>pivot_wider</code> to spread the column <code>issue</code>. The val...
72,382,507
Appending filename at the end of certain lines in a text file<p>I am trying to append a file name at the end of certain lines in many files which I am concatenating.</p> <p>short example:</p> <p><em>INPUTS:</em></p> <pre><code>filename (1): 1234_contigs.fasta &gt;NODE_STUFF GATTACA filename (2): 5678_contigs.fasta &gt...
<p>with bash and sed I'd propose:</p> <pre><code>for i in ./*/*contigs.fasta; do n=$(basename -s _contigs.fasta &quot;$i&quot;) sed &quot;s/^\(&gt;NODE.*\)/\1-$n/&quot; &quot;$i&quot; done </code></pre>
Appending filename at the end of certain lines in a text file
bash|sed|bioinformatics|fasta
3
65
3
72,382,686
72,382,686
2
true
2022-05-25T18:20:36.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Appending filename at the end of certain lines in a text file<p>I am trying to append a file name at the end of certain lines in many files which I am concat...
72,381,163
Does {spatstat}'s `nearestsegment()` produce imprecise results?<p>Although, the figure is rather small, one can see that several points/<em>events</em> (lightred) do not lie on colored line segments and vice a versa. Where does this deviation come from? Is there a way to improve my procedure?</p> <p>Why I am doing this...
<p>remove adjacency matrix calculation; it reorders segments of the graph<br /> correct <code>g</code> assignment:</p> <pre><code>g &lt;- graph_from_edgelist(edges) </code></pre>
Does {spatstat}'s `nearestsegment()` produce imprecise results?
r|sf|spatstat
2
65
1
72,384,962
72,384,962
2
true
2022-05-25T16:18:31.577Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does {spatstat}'s `nearestsegment()` produce imprecise results?<p>Although, the figure is rather small, one can see that several points/<em>events</em> (ligh...
72,307,893
"Exists" keyword with false positive result - Robot Framework with Sikuli<p>The &quot;Exists&quot; keywords is it assertive?</p> <p>I added this keyword in my test (the objective is failed test, because i put a different image of the displayed screen), but the status is passed!</p> <p>Which of these keywords is better ...
<p>I'm prefer to use keyword <code>Screen Should Contain</code> because different image</p>
"Exists" keyword with false positive result - Robot Framework with Sikuli
python|automation|robotframework|sikuli
0
65
1
72,428,474
72,428,474
2
true
2022-05-19T16:15:31.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "Exists" keyword with false positive result - Robot Framework with Sikuli<p>The &quot;Exists&quot; keywords is it assertive?</p> <p>I added this keyword in m...
72,295,835
What happens when a thread calls pthread_mutex_unlock on an already unlocked mutex<p>I know this question sounds familiar and it might even be a stupid question but I wasn't able to find the solution to it.</p> <p>So my question basically is, what happens when a <code>parent_thread</code> calls <code>pthread_mutex_lock...
<p>Sorry, only read your title when I commented. Just to make sure I understand your order of operations, a long-winded version of the already-posted answer:</p> <p>parent calls:</p> <pre><code>pthread_mutex_lock(&amp;m); // locks the mutex pthread_cond_wait(&amp;c, &amp;m); // releases the mutex </code></pre> <p>chi...
What happens when a thread calls pthread_mutex_unlock on an already unlocked mutex
c|pthreads
2
65
2
72,296,388
72,296,388
2
true
2022-05-18T20:51:15.063Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What happens when a thread calls pthread_mutex_unlock on an already unlocked mutex<p>I know this question sounds familiar and it might even be a stupid quest...
72,350,072
Does .NET 5 Identity CreateAsync() use sha512 for hashing and salting<p>I am currently using the inbuilt .NET 5 Identity CreateAsync() to create new user accounts. This is meant to take their passwords, hash them and then salt them. Does .NET 5 CreateAsync() method use SHA1, SHA256, or SHA512 and does it salt them?</p>
<p>Per the <a href="https://github.com/dotnet/aspnetcore/blob/v5.0.17/src/Identity/Extensions.Core/src/PasswordHasher.cs#L29" rel="nofollow noreferrer">PasswordHasher source code for .NET 5.0.17</a>:</p> <pre><code> /* ======================= * HASHED PASSWORD FORMATS * ======================= * ...
Does .NET 5 Identity CreateAsync() use sha512 for hashing and salting
c#|asp.net|hash|asp.net-identity|.net-5
0
65
1
72,350,278
72,350,278
2
true
2022-05-23T14:14:28.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does .NET 5 Identity CreateAsync() use sha512 for hashing and salting<p>I am currently using the inbuilt .NET 5 Identity CreateAsync() to create new user acc...
72,241,168
String_Split example not working for me, says insufficient parameters<p>Using SQL Server 2016 and latest SSMS, I'm trying to take a csv string and split it and then insert into table-value parameter variable and I'm getting error squiggles under the string_split function.</p> <p>Is what I'm doing even possible?</p> <pr...
<p>Not sure what build of SSMS you're using but that is just IntelliSense being not so intelligent. In anticipation of <a href="https://www.mssqltips.com/sqlservertip/7039/stringsplit-function-azure-sql-database-ordinal-position/?utm_source=AaronBertrand" rel="nofollow noreferrer">these changes to that function</a>, In...
String_Split example not working for me, says insufficient parameters
sql-server
0
65
1
72,241,246
72,241,246
2
true
2022-05-14T14:34:09.553Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: String_Split example not working for me, says insufficient parameters<p>Using SQL Server 2016 and latest SSMS, I'm trying to take a csv string and split it a...
72,354,482
How to parse span with beautiful soup if in final html it's hidden by javascript?<p>The goal is to get clothe's rating (stars) via beautiful soup.</p> <p>For more clear detail this is part of python code, and in the past it worked:</p> <pre><code> url = f&quot;https://www.wildberries.ru/catalog/18645227/detail.aspx?...
<p>The short answer is <em>you can't</em> parse and/or get that data with <code>bs4</code>.</p> <p>As you've noticed, all of the product's data is generated dynamically, which means you need to have a way of running <code>JavaScript</code>, which <code>bs4</code> doesn't do.</p> <p>If you want to get the <em>old school...
How to parse span with beautiful soup if in final html it's hidden by javascript?
python|beautifulsoup
1
65
1
72,358,961
72,358,961
2
true
2022-05-23T20:26:42.503Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to parse span with beautiful soup if in final html it's hidden by javascript?<p>The goal is to get clothe's rating (stars) via beautiful soup.</p> <p>For...
72,377,482
Is it possible to execute hand-coded bytecode scripts in the V8 engine?<p>I am in the early stages of a project that aims to estimate the power consumption of Javascript apps. Similar work has been done with Android apps through Java bytecode profiling, and I am hoping to apply a similar methodology using the bytecode ...
<p>(V8 developer here.)</p> <p>No, this is not possible.</p> <p>Bytecode is an internal implementation detail. It intentionally doesn't have an external interface (you can't get it out of V8, and can't feed it back in), and is not standardized or documented -- in fact, it could change any day.</p> <p>Also, bytecode typ...
Is it possible to execute hand-coded bytecode scripts in the V8 engine?
node.js|v8|embedded-v8|libv8
1
65
1
72,378,351
72,378,351
2
true
2022-05-25T12:15:47.910Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to execute hand-coded bytecode scripts in the V8 engine?<p>I am in the early stages of a project that aims to estimate the power consumption o...
72,262,555
Jenkins, docker and kubernetes (minikube)<p>i'm using Jenkins to deploy pipeline, so first step i did it is deploying jenkins to minikube, and it's work at first, but each time i run <code>minikube stop</code> and restart it , jenkins restart too from first (unlock jenkins), i just followed this tutorial :</p> <p><a h...
<p>It looks like the secret is not mounted for deployment you can do it following</p> <ol> <li><p>create secret using</p> <p><code>kubectl create secret jenkins --from-literal jenkins_password=&quot;ADD YOUR SECRET TOKEN Which you will find in jenkins pod logs&quot;</code></p> </li> </ol> <p>and mount it like this</p> ...
Jenkins, docker and kubernetes (minikube)
docker|kubernetes|jenkins
0
65
1
72,262,643
72,262,643
2
true
2022-05-16T16:29:51.010Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jenkins, docker and kubernetes (minikube)<p>i'm using Jenkins to deploy pipeline, so first step i did it is deploying jenkins to minikube, and it's work at f...
72,270,028
Google Apps script: time-driven trigger not triggering<p>I have an issue with a time-driven trigger in Google Apps script: It should be triggered once a week on Saturday and then call another function named: saveregular()</p> <p>Please see the code below:</p> <pre><code>function createTimeDrivenTriggers() { // Trigge...
<h3>Issue:</h3> <p>As suggested by <a href="https://stackoverflow.com/questions/72270028/google-apps-script-time-driven-trigger-not-triggering#comment127680819_72270028">TheMaster's comment</a>, and as shown in the docs:</p> <blockquote> <p>Frequency is required if you are using atHour() or nearMinute()</p> </blockquot...
Google Apps script: time-driven trigger not triggering
google-apps-script|triggers
0
65
1
72,270,729
72,270,729
2
true
2022-05-17T07:46:01.777Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Apps script: time-driven trigger not triggering<p>I have an issue with a time-driven trigger in Google Apps script: It should be triggered once a week...
72,281,087
Rails 6 monads pattern matching to fetch only success/failure<p>Is there any build in or some nifty way to fetch only Success or Failure results from array of monad results?</p> <p>e.g.</p> <pre><code>state =&gt; [Failure(&quot;12345 Product code is not valid&quot;), Success(&quot;eiowruqoiu Backbone Product created&qu...
<pre><code>state.grep(Dry::Monads::Result::Failure) state.grep(Dry::Monads::Result::Success) </code></pre> <p>or</p> <pre><code>state.select { |s| s.is_a?(Dry::Monads::Result::Failure) } state.select { |s| s.is_a?(Dry::Monads::Result::Success) } </code></pre> <p>or using <code>success?</code> / <code>failure?</code> mo...
Rails 6 monads pattern matching to fetch only success/failure
ruby-on-rails|ruby|monads
0
65
1
72,281,113
72,281,113
2
true
2022-05-17T21:57:54.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails 6 monads pattern matching to fetch only success/failure<p>Is there any build in or some nifty way to fetch only Success or Failure results from array o...
72,240,675
Overflow operation when compiling using AnyCPU<p>I have a legacy solution written in VB.NET. It writes to a DB2 database using <strong>ODBC.</strong> I have a Textbox that is filled with a numeric value then I use <code>ToString</code> in order to cast whatever is written there and write it to the database using <em>Ex...
<p>When I enter <code>12345</code> in the TextBox and then do the following:</p> <pre><code>Dim input As String = Me.txt2.ToString.Trim </code></pre> <p>The contents of <code>input</code> are not the desired <code>&quot;12345&quot;</code>, but instead a string representation of the TextBox and its contents, namely: <co...
Overflow operation when compiling using AnyCPU
.net|vb.net|odbc|anycpu
0
65
1
72,246,285
72,246,285
2
true
2022-05-14T13:30:24.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Overflow operation when compiling using AnyCPU<p>I have a legacy solution written in VB.NET. It writes to a DB2 database using <strong>ODBC.</strong> I have ...
72,377,460
jsonnet expression to string before evaluation<p>Given the following jsonnetfile:</p> <pre><code>{ expression: self.result, result: 3 &gt; 1, } </code></pre> <p>That evaluates to this:</p> <pre><code>{ &quot;expression&quot;: true, &quot;result&quot;: true } </code></pre> <p>Is there a way to convert the expr...
<p>As <code>jsonnet</code> doesn't support <code>eval()</code>- alike expressions, the <em>only</em> way really is to load such file as text with <code>importstr()</code> (then conveniently parse it as YAML¹), also with <code>import()</code> to get it parsed as <code>jsonnet</code>, then &quot;merge&quot; both objects ...
jsonnet expression to string before evaluation
jsonnet
0
65
1
72,384,374
72,384,374
2
true
2022-05-25T12:14:43.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jsonnet expression to string before evaluation<p>Given the following jsonnetfile:</p> <pre><code>{ expression: self.result, result: 3 &gt; 1, } </code></...
72,254,352
Template Haskell resolve type aliases<p>I'm using template Haskell to generate data about a type. For many reasons I need the type to be used to be &quot;normalized&quot;. So it shouldn't be a type alias/synonym. I really don't want to disallow using type aliases in the construct since some types that are used can beco...
<p>The function <a href="https://hackage.haskell.org/package/th-abstraction-0.4.3.0/docs/Language-Haskell-TH-Datatype.html#v:resolveTypeSynonyms" rel="nofollow noreferrer"><code>resolveTypeSynonyms :: TH.Type -&gt; Q TH.Type</code></a> can be found in the library <a href="https://hackage.haskell.org/package/th-abstract...
Template Haskell resolve type aliases
haskell|template-haskell
1
65
1
72,254,456
72,254,456
3
true
2022-05-16T05:04:10.740Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Template Haskell resolve type aliases<p>I'm using template Haskell to generate data about a type. For many reasons I need the type to be used to be &quot;nor...
72,261,388
Why pass input/output stream in a function?<p>Why would we want to do this:</p> <pre><code>#include &lt;iostream&gt; void print(std::ostream&amp; os) { os &lt;&lt; &quot;Hi&quot;; } int main() { print(std::cout); return 0; } </code></pre> <p>instead of this:</p> <pre><code>#include &lt;iostream&gt; void print(...
<p>Yes, the first version is significantly better. Like already mentioned in the comments, it allows you to use any kind of <code>std::ostream</code>, not just <code>std::cout</code>. Some of the most important consequences of this architectural choice are:</p> <ol> <li><p>You can use your function to print the require...
Why pass input/output stream in a function?
c++|stream
0
65
1
72,261,576
72,261,576
3
true
2022-05-16T15:04:45.173Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why pass input/output stream in a function?<p>Why would we want to do this:</p> <pre><code>#include &lt;iostream&gt; void print(std::ostream&amp; os) { os...
72,332,387
Is this a correct implementation of ConvertsWithoutNarrowing<p>I am currently learning about concepts in C++20, and came across this example:</p> <pre><code>template &lt;typename From, typename To&gt; concept is_convertible_without_narrowing = requires (From&amp;&amp; from) { { std::type_identity_t&lt;To[]&gt;{std::f...
<blockquote> <p>I am curious if the following can be considered a correct alternative implementation of the above:</p> </blockquote> <p>The simple answer is no.</p> <p>In the second version, <code>To{std::forward&lt;From&gt;(from)}</code> can be regarded as constructing <code>To</code> through <code>initializer_list</...
Is this a correct implementation of ConvertsWithoutNarrowing
c++|c++20|c++-concepts
1
65
1
72,332,550
72,332,550
3
true
2022-05-21T18:50:18.777Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is this a correct implementation of ConvertsWithoutNarrowing<p>I am currently learning about concepts in C++20, and came across this example:</p> <pre><code>...
72,355,047
Replacing spaces with underscores within each capture group in Vim using regex<p>I often edit Power Query &quot;M&quot; code using Vim while working with Power BI. Typically I prefer to change the auto-generated identifier names for each query step by replacing spaces with underscores and shifting it to lowercase. Iden...
<p>The following creates a mapping for <code>&lt;space&gt;</code>-<code>&lt;c&gt;</code> to convert the strings to identifiers:</p> <pre><code>noremap &lt;space&gt;c :%s/#&quot;\([^&quot;]\+\)&quot;/\=substitute(tolower(submatch(1)), &quot; &quot;, &quot;_&quot;, &quot;g&quot;)/g&lt;CR&gt; </code></pre> <p>A little exp...
Replacing spaces with underscores within each capture group in Vim using regex
regex|string|vim|replace|powerbi
0
65
1
72,355,397
72,355,397
3
true
2022-05-23T21:38:24.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replacing spaces with underscores within each capture group in Vim using regex<p>I often edit Power Query &quot;M&quot; code using Vim while working with Pow...
72,358,852
Int subtraction from a string<p>Why doesn't the code below give an error that says the array is out of range?</p> <pre><code>#include &lt;iostream&gt; int main() { std::cout &lt;&lt; &quot;Hello, world!&quot; - 50; return 0; } </code></pre>
<p>It doesn't give an error because it's your job to make sure to honor array bounds. Like many other things this is impossible to always detect so it's left up to the user to not do it.</p> <p>Compiler have gotten better at warning about it though:</p> <pre><code>&lt;source&gt;:4:36: warning: offset '-50' outside boun...
Int subtraction from a string
c++|string
-1
65
2
72,358,973
72,358,973
3
true
2022-05-24T07:32:08.317Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Int subtraction from a string<p>Why doesn't the code below give an error that says the array is out of range?</p> <pre><code>#include &lt;iostream&gt; int m...
72,374,387
How to get C# library file in output directory?<p>I have a solution with a few projects:</p> <ol> <li>library.dll with <code>something.json</code></li> <li>webapp.dll</li> <li>winapp.exe</li> </ol> <p>2 and 3 depend on 1, not on eachother.</p> <p>I would like copy <code>something.json</code> to the bin directory of win...
<p>You can use the Post-build event command line of your <code>winapp.exe</code> for instruct to copy that file inside your target dir</p> <p>something like this</p> <pre><code>xcopy /Y $your path of something.json $(TargetDir). </code></pre> <p>Change <code>your path of something.json</code> to your actual path.</p> ...
How to get C# library file in output directory?
c#|buildaction
3
65
2
72,374,547
72,374,547
3
true
2022-05-25T08:35:35.803Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get C# library file in output directory?<p>I have a solution with a few projects:</p> <ol> <li>library.dll with <code>something.json</code></li> <li>w...
72,378,575
Convert "weird" strings to normal python strings<p>Context: I'm trying to convert characters like these:</p> <p> </p> <p>To normal python strings (speedy, building, tuesday, etc) and save them into a new dataframe to be exported into a new excel file. For example, the charcter (U+1D552) should be converted to a (U+0...
<p>Using <code>unicodedata</code> you can normalize unicode strings:</p> <pre class="lang-py prettyprint-override"><code>&gt;&gt; from unicodedata import normalize &gt;&gt; test_str = &quot; &quot; &gt;&gt; print(normalize('NFKC', test_str)) BUILDING Speedy TUESDAY spaghetti </code></pre>
Convert "weird" strings to normal python strings
python|character-encoding
0
65
1
72,378,726
72,378,726
3
true
2022-05-25T13:30:21.980Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert "weird" strings to normal python strings<p>Context: I'm trying to convert characters like these:</p> <p> </p> <p>To normal python strings (speedy, ...
72,397,025
In Python, is there a common pattern to using methods that have arguments that are only used a method's decorator?<h1>Goal</h1> <p>To have a type hinted argument on a method that doesn't get caught by linters like <code>pylint</code> as unused.</p> <h2>Context</h2> <p>We have an argument called <code>context</code> tha...
<p>Just because it's optional doesn't mean you can't explicitly declare it.</p> <pre><code>def wrapper(func): @functools.wraps(func) def handler(*args, context: str = None, **kwargs): # Here we run our logic that used the arg passed in when calling the method return func(*args, **kwarg...
In Python, is there a common pattern to using methods that have arguments that are only used a method's decorator?
python|pylint
2
65
1
72,397,094
72,397,094
3
true
2022-05-26T19:25:02.400Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In Python, is there a common pattern to using methods that have arguments that are only used a method's decorator?<h1>Goal</h1> <p>To have a type hinted argu...
72,381,010
How does Python's bisect function use this tuple as an argument?<p>This is a question arising from a Coursera course on genomics that I'm following. We are currently dealing with search methods, specifically how to detect (align) all occurrences of a shorter DNA sequence (<strong>p</strong>, a string) within a longer D...
<p>In Python, you can compare tuples lexicographically (like in a dictionary). First, the first elements are compared, then the second elements, and so on.</p> <pre><code>&gt;&gt;&gt; (1, 2, 3) &lt; (1, 2, 4) True &gt;&gt;&gt; (1, 3, 3) &lt; (1, 2, 4) False &gt;&gt;&gt; ('a', 'p', 'p', 'l', 'e') &gt; ('a', 'r', 't') Fa...
How does Python's bisect function use this tuple as an argument?
python|hashtable|dna-sequence|bisect
0
65
1
72,381,306
72,381,306
3
true
2022-05-25T16:08:07.227Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does Python's bisect function use this tuple as an argument?<p>This is a question arising from a Coursera course on genomics that I'm following. We are c...
72,278,017
How to eliminate lines from a file while comparing two files<p>I have two files, I need an output file which contains everything that is not in the first file but is in the second file, the second file contains everything that is in the first file with some more entries. I tried:</p> <pre><code>for j in `cat first`; do...
<p>Converting my comment to answer so that solution is easy to find for future visitors.</p> <p>You may use this <code>grep</code>:</p> <pre class="lang-sh prettyprint-override"><code>grep -vFxf first second 1 22 33 44 11 </code></pre> <p>Options are:</p> <ul> <li><code>-v</code>: Selected lines are those not matching...
How to eliminate lines from a file while comparing two files
bash|awk|sed|grep
1
65
4
72,278,813
72,278,813
4
true
2022-05-17T17:00:33.410Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to eliminate lines from a file while comparing two files<p>I have two files, I need an output file which contains everything that is not in the first fil...
72,290,488
How to check if a noun exists in a text file with C#?<p>I have tried to find a library in C# that can help me do parts of speech tagging to recognize a noun from a sentence but with no avail. So I decided to check my string's words against a list of nouns in a text file I downloaded. My code assumes the first Noun in a...
<p>Your original code has a couple problems:</p> <ol> <li><p>You are splitting by space, so in your case, you get (for example), <code>television,</code> with a comma in your word list. When comparing, you are comparing <code>television</code> with <code>television,</code> so it doesn't match.</p> </li> <li><p>You are ...
How to check if a noun exists in a text file with C#?
c#|arrays|loops
1
65
1
72,291,459
72,291,459
4
true
2022-05-18T13:52:19.020Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check if a noun exists in a text file with C#?<p>I have tried to find a library in C# that can help me do parts of speech tagging to recognize a noun ...
72,346,498
Is there a method to convert each element of source array from one type to another type?<p>This <strong>Transfrom</strong> function transforms each element of source array from one type to another type by some rule. It has 2 parameters, one of them is an Interface</p> <pre><code>public static TResult[] Transform&lt;TSo...
<p>The <a href="https://docs.microsoft.com/en-us/dotnet/api/system.array.convertall?view=net-6.0" rel="nofollow noreferrer"><code>ConvertAll</code> docs</a> shows that the method has the following signature:</p> <pre><code>public static TOutput[] ConvertAll&lt;TInput,TOutput&gt; (TInput[] array, Converter&lt;TInput,TOu...
Is there a method to convert each element of source array from one type to another type?
c#|arrays|.net|generics
0
65
1
72,346,579
72,346,579
4
true
2022-05-23T09:49:02.447Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a method to convert each element of source array from one type to another type?<p>This <strong>Transfrom</strong> function transforms each element o...
72,340,260
Meshes.jl ERROR: UndefVarError: P2 not defined<p>I am trying to run some code from the Meshes.jl test source code, and it fails. What am I missing?</p> <pre><code>using Meshes points = P2[(0,0), (1,0), (0,1), (1,1), (0.5,0.5)] #ERROR: UndefVarError: P2 not defined #Stacktrace: # [1] top-level scope # @ REPL[2]:1 </c...
<p>If you look at the <em>runtests.jl</em> file (<a href="https://github.com/JuliaGeometry/Meshes.jl/blob/bcc08b0b53622f2578c61561fef91153c05c393b/test/runtests.jl#L118" rel="noreferrer">https://github.com/JuliaGeometry/Meshes.jl/blob/bcc08b0b53622f2578c61561fef91153c05c393b/test/runtests.jl#L118</a>), P2 is defined as...
Meshes.jl ERROR: UndefVarError: P2 not defined
julia
3
65
1
72,340,580
72,340,580
5
true
2022-05-22T18:25:11.240Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Meshes.jl ERROR: UndefVarError: P2 not defined<p>I am trying to run some code from the Meshes.jl test source code, and it fails. What am I missing?</p> <pre>...
72,271,666
Getting flicker issue while animating font-size on hover<p>I want the font size to decrease with the transition when the mouse is hovered over. However, it flickers when hovering over the mouse. I want to get rid of flicker.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="fa...
<p>A better way is to use <code>scale</code> instead of <code>font-size</code>, like so:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>.big-box { display: flex; } .big-bo...
Getting flicker issue while animating font-size on hover
javascript|html|css
4
65
1
72,271,725
72,271,725
5
true
2022-05-17T09:43:17.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting flicker issue while animating font-size on hover<p>I want the font size to decrease with the transition when the mouse is hovered over. However, it f...
72,341,710
How to make two Forms access the same variables in C++Builder<p>I have two Forms, both are including the same <code>.cpp</code> file that has these global variables:</p> <pre><code>static vector&lt;News&gt; allNews; static vector&lt;user&gt; allUsers; static admin appAdmin(&quot;admin&quot;, &quot;adminpassword&quot;);...
<p><em>both are including the same .cpp</em> - never include <code>.cpp</code> files. Make a <code>.h</code> file with the content:</p> <pre><code>extern vector&lt;News&gt; allNews; extern vector&lt;user&gt; allUsers; extern admin appAdmin; extern int userIndex; </code></pre> <p>And then update the <code>.cpp</code> fi...
How to make two Forms access the same variables in C++Builder
c++|c++builder
1
65
1
72,341,746
72,341,746
5
true
2022-05-22T22:27:57.557Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make two Forms access the same variables in C++Builder<p>I have two Forms, both are including the same <code>.cpp</code> file that has these global va...
72,387,925
How to use an abstract class as the type of the index variable of a for each loop?<p>I was translating a <strong>Java</strong> program of mine to <strong>C++</strong>. I got to a problem trying to use <strong>polymorphism</strong> the same way as in <strong>Java</strong>.</p> <p>My code looks something like this:</p> <...
<p>Coming from <a href="/questions/tagged/java" class="post-tag" title="show questions tagged &#39;java&#39;" rel="tag">java</a> to <a href="/questions/tagged/c%2b%2b" class="post-tag" title="show questions tagged &#39;c++&#39;" rel="tag">c++</a>, there are a lot to take-care; Especially memory management!</p> <p>In yo...
How to use an abstract class as the type of the index variable of a for each loop?
c++|class|pointers|polymorphism|abstract-class
1
65
1
72,387,973
72,387,973
6
true
2022-05-26T06:56:29.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use an abstract class as the type of the index variable of a for each loop?<p>I was translating a <strong>Java</strong> program of mine to <strong>C++...
72,399,249
How export {} affects declare global<p>global.d.ts</p> <pre><code>declare global { export interface Window { ... } export {} </code></pre> <p>I realized that export {} has an effect on redefining window module.</p> <p>I saw a brief explanation that export {} makes the d.ts file a module. However, I didn't unde...
<p>I think this official documentation of TypeScript, could help you!</p> <blockquote> <h3>Global-modifying Modules</h3> <p>A global-modifying module alters existing values in the global scope when they are imported. For example, there might exist a library which adds new members to String.prototype when imported. This...
How export {} affects declare global
typescript|node-modules
1
65
1
72,399,294
72,399,294
-1
true
2022-05-27T00:16:39.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How export {} affects declare global<p>global.d.ts</p> <pre><code>declare global { export interface Window { ... } export {} </code></pre> <p>I real...
72,808,051
Is this valid CSV?<p>I have a csv file with the following single line:</p> <p><code>Some,Test,&quot;is&quot;thisvalid,or,not</code></p> <p>according to <code>cvslint.io</code> it's not valid csv: <a href="https://i.stack.imgur.com/hMk3h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hMk3h.png" alt="...
<p>For CSV format the reference is this <a href="https://datatracker.ietf.org/doc/html/rfc4180" rel="nofollow noreferrer">https://datatracker.ietf.org/doc/html/rfc4180</a></p> <p>And you have:</p> <blockquote> <p>Fields containing line breaks (CRLF), double quotes, and commas <strong>should be enclosed in double-quotes...
Is this valid CSV?
csv
0
65
2
72,810,848
72,810,848
1
true
2022-06-29T21:26:54.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is this valid CSV?<p>I have a csv file with the following single line:</p> <p><code>Some,Test,&quot;is&quot;thisvalid,or,not</code></p> <p>according to <code...
72,808,354
Sharing numpy array between processes collecting data (populating array) and parsing data (array operations) with both processes as class methods<p>My project has a sensor with a Python driver which collects readings and generates a numpy array, which needs to have some statistical processing done and return one or mor...
<h2>Sharing the flags</h2> <p>You can use <a href="https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Value" rel="nofollow noreferrer">multiprocessing.Value</a> to store the flags in shared memory. These would need to be created in the main process and shared to the child processes which store them....
Sharing numpy array between processes collecting data (populating array) and parsing data (array operations) with both processes as class methods
python|multithreading|numpy|multiprocessing
2
65
1
72,818,661
72,818,661
1
true
2022-06-29T22:05:21.427Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sharing numpy array between processes collecting data (populating array) and parsing data (array operations) with both processes as class methods<p>My projec...
72,859,950
Deleting a line in a txt file with Node.js<p>I recently made a script in which I want to delete an <strong>EXACT</strong> match from a txt file with node. It print's out true but doesn't actually remove the line from the txt file. I am using discord to get the argument. I'm not sure what I'm doing wrong but here is my ...
<p>I think you can do it very similarly as your current solution, just the regex is a little off.</p> <p>Instead of just using <code>^</code> and <code>$</code> to indicate that the entire string starts and ends with the <code>args[0]</code>, I used two capture groups as the delimiters of a line.</p> <p>This one matche...
Deleting a line in a txt file with Node.js
javascript|node.js|discord.js
2
65
2
72,860,511
72,860,511
1
true
2022-07-04T16:55:28.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Deleting a line in a txt file with Node.js<p>I recently made a script in which I want to delete an <strong>EXACT</strong> match from a txt file with node. It...
72,850,987
how to remove string after integer in a dataframe python<p><a href="https://i.stack.imgur.com/XeVLw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XeVLw.png" alt="enter image description here" /></a>I want to remove string(subject to approval) after integer(90) in a dataframe.</p> <pre class="lang-p...
<p>You can use regex to replace all non numeric characters and then cast to int.</p> <pre><code>import pandas as pd name_dict = { 'Name': ['a','b','c','d'], 'Score': ['90(subject to approval)',80,95,20] } df = pd.DataFrame(name_dict) df['Score'] = df['Score'].replace(r'[^0-9]+', '', r...
how to remove string after integer in a dataframe python
python|pandas
1
65
2
72,851,020
72,851,020
1
true
2022-07-04T01:33:46.127Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to remove string after integer in a dataframe python<p><a href="https://i.stack.imgur.com/XeVLw.png" rel="nofollow noreferrer"><img src="https://i.stack....
72,772,356
Passing an object by reference (C++)<p>I want a method that creates a binary tree from an array and returns nothing. So I would have to work by reference but I am having some troubles with the proper syntax to use.</p> <p>I have obviously tried to search before posting this question, I have seen similar posts but no an...
<pre><code>void Node::make_tree(Node* node, int values[], int size); </code></pre> <p><code>Node</code> pointer cannot be modified inside the function, as you pass it by value (only the copy is modified).</p> <p>You can use a reference, as suggested in comments :</p> <pre><code> void Node::make_tree(Node* &amp;node, in...
Passing an object by reference (C++)
c++|object|pointers|reference
1
65
1
72,772,616
72,772,616
2
true
2022-06-27T12:47:11.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing an object by reference (C++)<p>I want a method that creates a binary tree from an array and returns nothing. So I would have to work by reference but...
72,774,774
Make table which have cells 10x10 and every cells have inside number from 1 to 100<p>Need to make table which have numbers from 1 to 100, and it should be 10x10 cells. I make cells 10x10 but result fill every grid line from 1 to 10, how to make every line like that 1 to 10, 11 to 20 and to 100 like that ? Thank you for...
<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>function generate_table() { const tbl = document.createElement("table"); const tblBody = document.createElement("tbody"); for ...
Make table which have cells 10x10 and every cells have inside number from 1 to 100
javascript|html
1
65
1
72,774,921
72,774,921
2
true
2022-06-27T15:37:36.413Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make table which have cells 10x10 and every cells have inside number from 1 to 100<p>Need to make table which have numbers from 1 to 100, and it should be 10...
72,782,444
Wait for page to load after click() on download button<p>It is possible to somehow skip waiting for page to load, after Cypress test click() on download button which start download but does not redirect to other page?</p> <pre><code>it('name of the test', () =&gt;{ cy.get('#btnGeneratePdf').click() .url...
<p>This is a known Cypress problem. A lot of related issues have been opened on <a href="https://github.com/cypress-io/cypress/issues" rel="nofollow noreferrer">Cypress github</a>, however you can follow the main discussion in <a href="https://github.com/cypress-io/cypress/issues/14857" rel="nofollow noreferrer">this o...
Wait for page to load after click() on download button
testing|automated-tests|cypress
0
65
1
72,782,933
72,782,933
2
true
2022-06-28T07:38:24.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Wait for page to load after click() on download button<p>It is possible to somehow skip waiting for page to load, after Cypress test click() on download butt...
72,788,409
How to view other users' objects like mine in Oracle SQL Developer?<p>When I access other users' objects, I can do something like</p> <pre><code>select * from user_2.booking_table; </code></pre> <p>given that I have the privileges over <code>user_2</code>'s objects.</p> <p>Using the console, I know I can do</p> <pre><c...
<p>No. We show you what you have, or what other schemas have.</p> <p>The only way to get close to what you're looking for is if you were to create synonyms to tables in other schemas, then you can ask SQL Developer to present those as TABLES in your connection list.</p> <p>I'm logged in as a user with an 'empty' schema...
How to view other users' objects like mine in Oracle SQL Developer?
oracle|oracle-sqldeveloper|dbobject
0
65
1
72,788,795
72,788,795
2
true
2022-06-28T14:34:15.867Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to view other users' objects like mine in Oracle SQL Developer?<p>When I access other users' objects, I can do something like</p> <pre><code>select * fro...
72,816,899
Using Toggle in a password field in jetpack compose<p>I am trying to use toggle in a password field. This is my code so far but for some reason it wont work. How can I achieve toggling a password as in this image? Much appreciated!</p> <p>Image: <a href="https://gyazo.com/5ad35b44dc955e0846c68f61ec9630b0" rel="nofollow...
<p>You have given <code>revealPassword = true</code> in both <code>onClick()</code>.</p> <p>Change the first one to <code>revealPassword = false</code></p> <p><strong>Complete code</strong></p> <pre><code>@Composable fun TogglePassword() { val password = remember { mutableStateOf(&quot;&quot;) } var...
Using Toggle in a password field in jetpack compose
toggle|android-jetpack-compose
1
65
2
72,817,149
72,817,149
2
true
2022-06-30T13:43:01.880Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Toggle in a password field in jetpack compose<p>I am trying to use toggle in a password field. This is my code so far but for some reason it wont work....
72,821,758
How to get the next Bi-weekly date based on a given start date and today's date in Google Sheets<p>I am trying to get bi-weekly dates based on a start date that would then provide the next upcoming date following the 14-day sequence from the start date, to get me the date that comes after today's date.</p> <p>For examp...
<p>try:</p> <pre><code>=B1+(14*ROUNDUP((TODAY()-B1)/14)) </code></pre> <p><a href="https://i.stack.imgur.com/rgehV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rgehV.png" alt="enter image description here" /></a></p>
How to get the next Bi-weekly date based on a given start date and today's date in Google Sheets
date|if-statement|google-sheets|sum|rounding
1
65
1
72,822,690
72,822,690
2
true
2022-06-30T20:39:51.480Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the next Bi-weekly date based on a given start date and today's date in Google Sheets<p>I am trying to get bi-weekly dates based on a start date t...
72,828,707
Spark/Scala - Join resultset giving type mismatch error while performing withColumn operation; found : org.apache.spark.sql.Column required: Boolean<p>I have two dataframes that I am trying to join and based on the joined set trying to assign a flag column.</p> <p>demandDF1</p> <pre class="lang-none prettyprint-overrid...
<p>I've carefully read your conditions and created a separate variable for it in case something went wrong. But everything went well.</p> <pre class="lang-scala prettyprint-override"><code>val cond = ( ($&quot;input_file_crt_dt&quot; &gt; $&quot;output_file_crt_dt&quot;) || (($&quot;input_file_crt_dt&quot; === $&qu...
Spark/Scala - Join resultset giving type mismatch error while performing withColumn operation; found : org.apache.spark.sql.Column required: Boolean
dataframe|scala|apache-spark|apache-spark-sql|typeerror
1
65
1
72,830,268
72,830,268
2
true
2022-07-01T11:39:54.647Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spark/Scala - Join resultset giving type mismatch error while performing withColumn operation; found : org.apache.spark.sql.Column required: Boolean<p>I have...
72,847,961
Need logo on the left and links on the right<p>Currently I'm making navbar for my website, but have this issue: I need logo to be on the left and links on the right. I tried to find some solutions for this, but didn't find any. I'm using <code>nav</code> element and float didn't worked.</p> <p>Here is my code:</p> <p><...
<p>You can simply add <code>margin-right: auto</code> to the <code>img</code>, and it would do the job, like so:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>* {margin: 0;...
Need logo on the left and links on the right
html|css
0
65
3
72,848,062
72,848,062
2
true
2022-07-03T15:55:22.620Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need logo on the left and links on the right<p>Currently I'm making navbar for my website, but have this issue: I need logo to be on the left and links on th...
72,850,072
Sorting a 3D array by a given row<p>I have a 2x3x4 Numpy array that looks like this:</p> <pre><code>[[[1 3 2 4] [0 1 0 1] [0 1 2 3]] [[1 4 2 3] [1 0 1 1] [0 1 2 3]]] </code></pre> <p>How can I sort this via the first row in each 2D matrix, i.e. achieve the output:</p> <pre><code>[[[1 2 3 4] [0 0 1 1] [0 2 ...
<p>Maybe you could use a <a href="https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions" rel="nofollow noreferrer">list comprehension</a>:</p> <pre><code>import numpy as np arr = np.array([[ [1, 3, 2, 4], [0, 1, 0, 1], [0, 1, 2, 3], ], [ [1, 4, 2, 3], [1, 0, 1, 1], [0, 1, 2...
Sorting a 3D array by a given row
python|arrays|numpy
3
65
3
72,850,191
72,850,191
2
true
2022-07-03T21:34:07.830Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sorting a 3D array by a given row<p>I have a 2x3x4 Numpy array that looks like this:</p> <pre><code>[[[1 3 2 4] [0 1 0 1] [0 1 2 3]] [[1 4 2 3] [1 0 1...
72,855,268
How to match a regular expression against another regular expression in javascript?<p>I want to see whether there are any matches between my two regular expressions. To do this, I just perform a <code>.test</code> against each other, and if one of them matches <code>true</code>, I consider them to be matched.</p> <pre>...
<p>Assuming <code>*</code> means &quot;any number of characters&quot;, your equivalence relation can be written as</p> <ul> <li>if A is empty, then true if B is empty too, otherwise false</li> <li>split A and B into a head (=first char) and a tail (the rest)</li> <li>if heads are equal, then compare both tails</li> <l...
How to match a regular expression against another regular expression in javascript?
javascript|node.js|regex|algorithm
1
65
1
72,856,245
72,856,245
2
true
2022-07-04T10:26:09.897Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to match a regular expression against another regular expression in javascript?<p>I want to see whether there are any matches between my two regular expr...
72,861,225
Python Combine Dict<p>I have two dict. The elements in the dicts come in order.</p> <pre><code>[{'macaddress': 'xx:xx:xx:xx:xx:xx'}, {'macaddress': 'cc:cc:cc:cc:cc:cc'}] </code></pre> <pre><code>[{'ipaddress': '192.168.1.1'}, {'ipaddress': '192.168.1.2'}] </code></pre> <p>I want to combine them as I show below;</p> <pr...
<p>Assuming <code>l1</code> and <code>l2</code> the two lists, you can use <a href="https://docs.python.org/3/library/functions.html#zip" rel="nofollow noreferrer"><code>zip</code></a> and a list comprehension with dictionary expansion:</p> <pre><code>l1 = [{'macaddress': 'xx:xx:xx:xx:xx:xx'}, {'macaddress': 'cc:cc:cc:...
Python Combine Dict
python
-2
65
3
72,861,292
72,861,292
2
true
2022-07-04T19:25:46.497Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Combine Dict<p>I have two dict. The elements in the dicts come in order.</p> <pre><code>[{'macaddress': 'xx:xx:xx:xx:xx:xx'}, {'macaddress': 'cc:cc:cc...
72,862,233
Format negative number C#<p>I have a variable that when it is smaller that zero it formats the number to -5,650 allowing AllowThousands using comma as separator</p> <p>however when I try to check the value it throws me an exception... what can I do?</p> <p><code> if (int.Parse(&quot;-5,650&quot;, NumberStyles.AllowLead...
<p>Besides going with the &quot;nuclear&quot; option of <code>NumberStyles.Any</code>, you can combine <code>NumberStyles</code> entries. Good news is that you already know which ones to use.</p> <pre><code>int.Parse(&quot;-5,650&quot;, NumberStyles.AllowThousands | NumberStyles.AllowLeadingSign); // gives &quot;-5650&...
Format negative number C#
c#
1
65
3
72,862,440
72,862,440
2
true
2022-07-04T21:38:09.053Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Format negative number C#<p>I have a variable that when it is smaller that zero it formats the number to -5,650 allowing AllowThousands using comma as separa...
72,862,791
WHERE HAVING COUNT(*) Very slow query<p>I'm trying to run a SQL query which takes 32 sec to complete, any ideas how to run it faster?</p> <pre><code>SELECT accounts.* FROM accounts WHERE accounts.account_id IN (SELECT map.account_id FROM map WHERE map.accou...
<p>You could use an inner join to achieve that filtering:</p> <pre><code>SELECT accounts.* FROM accounts INNER JOIN ( SELECT map.account_id FROM map GROUP BY map.account_id HAVING COUNT(*) &lt; 2 ) AS m ON accounts.account_id = m.account_id ORDER BY rand() limit 1 </code></pre> <p>I'm not sure why ...
WHERE HAVING COUNT(*) Very slow query
mysql|sql
0
65
2
72,862,838
72,862,838
2
true
2022-07-04T23:35:14.287Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WHERE HAVING COUNT(*) Very slow query<p>I'm trying to run a SQL query which takes 32 sec to complete, any ideas how to run it faster?</p> <pre><code>SELECT a...
72,870,323
use custom class in another class (same package)<p>I just started Java and search everywhere, but for whatever reason wasn't able to find a solution. My problem seems simple to me: I have two classes in the same folder, that folder is my package, so to illustrate:</p> <pre><code>packageE/Class1.java packageE/Class2.jav...
<p>It looks like you are compiling manually via <code>javac</code></p> <p>Change the working folder to the root folder where your files are, not <code>substitutiva</code> and use <code>javac substitutiva/Stakeholders.java</code> command for compile</p>
use custom class in another class (same package)
java|class
0
65
1
72,870,898
72,870,898
2
true
2022-07-05T13:31:04.413Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: use custom class in another class (same package)<p>I just started Java and search everywhere, but for whatever reason wasn't able to find a solution. My prob...
72,870,775
java convert xml String to List<String><p>I want to convert a String which is an XML to List.</p> <p>Logic needs to be generic. only XPath of records should be taken as input. sometimes this can be any kind of data.</p> <p>I tried internet help but was unable to get a generic solution being new to XML parsing.</p> <p><...
<p>you can transform your string to xml document and extract nodes</p> <pre><code> String xmlString = ...; String nodeName = &quot;book&quot;; List&lt;String&gt; nodeStrList = getNodeStringList(xmlString, nodeName); for(int i = 0; i &lt; nodeStrList.size(); i++){ System.out.println(&quot;element ...
java convert xml String to List<String>
java|xml|xml-parsing
-2
65
1
72,872,773
72,872,773
2
true
2022-07-05T14:02:58.260Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: java convert xml String to List<String><p>I want to convert a String which is an XML to List.</p> <p>Logic needs to be generic. only XPath of records should ...
72,873,111
Python logging: how to write logs into file and stdout<p>I have a main file where I use all the functions from the module. I want to log all the necessary things into file and into stdout.</p> <p>It works when I use <code>logger.info(&quot;Write it into file&quot;)</code> inside main file, but it doesn't work when I im...
<p><code>__name__</code> has different values in your two modules, so you really have two different loggers. You are only adding the file handler to one of them.</p> <p>You want to configure a common ancestor. That could be the root logger:</p> <pre><code>root_logger = logging.getLogger() ... root_logger.addHandler(fh)...
Python logging: how to write logs into file and stdout
python|logging
1
65
1
72,873,222
72,873,222
2
true
2022-07-05T17:01:31.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python logging: how to write logs into file and stdout<p>I have a main file where I use all the functions from the module. I want to log all the necessary th...
72,872,925
Arduino C++ move http client initialization to a function<p>I'm working on an ESP-01 (ESP8266 board) project and making some HTTP requests. I'm trying to refactor my code to keep it DRY, but I'm stuck on how to extract the http client initialization to a function.</p> <p>Here is my working PUT request function:</p> <pr...
<p>You are trying to return a HTTPClient object (http) <em>by value</em> at the end of your prepareRequest function. This would mean copy construction in this case and the compiler is telling you that copy construction is deliberately disabled for this class. (There can be quite a number of reasons for this.)</p> <p>Ho...
Arduino C++ move http client initialization to a function
arduino|esp8266|arduino-c++
0
65
2
72,873,229
72,873,229
2
true
2022-07-05T16:43:40.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Arduino C++ move http client initialization to a function<p>I'm working on an ESP-01 (ESP8266 board) project and making some HTTP requests. I'm trying to ref...
72,892,256
convert datetime column to a zero-based months. 0 is Jan and 11 is Dec<p>I have a datetime column that I want to 'stringify' it using <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.strftime.html" rel="nofollow noreferrer"><code>strftime</code></a>, the problem is I want the months to be zero-ba...
<p>Simply use string formatting to achieve the same result.</p> <pre class="lang-py prettyprint-override"><code>df = pd.to_datetime(pd.Series([&quot;2022-01-01&quot;])) # We extract the month as integer and subtract one from it. Then do string formatting df.apply(lambda x: x.strftime(&quot;Date(%Y,%i,%d,%H,%M,%S)&quot...
convert datetime column to a zero-based months. 0 is Jan and 11 is Dec
python|python-3.x|pandas|python-datetime
1
65
2
72,892,530
72,892,530
2
true
2022-07-07T04:23:16.610Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: convert datetime column to a zero-based months. 0 is Jan and 11 is Dec<p>I have a datetime column that I want to 'stringify' it using <a href="https://panda...