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,888,596
OpenTK does not find OpenTK.Input.Keyboard.GetState();<p>So i was trying to detect the keywords with OpenTK and in their tutorial gave this code:</p> <pre><code>protected override void OnUpdateFrame(FrameEventArgs args) { //Get the state of the keyboard this frame KeyboardState input = O...
<p>Okey i solved it using KeyboardState.IsKeyDown(Keys.Space). With this i can take the space input. If any other key is wanted you change the the &quot;Keys&quot; class function.</p> <p>An exemple with this would be:</p> <pre><code>protected override void OnUpdateFrame(FrameEventArgs args) { if (K...
OpenTK does not find OpenTK.Input.Keyboard.GetState();
c#|opentk
0
66
1
72,900,773
72,900,773
1
true
2022-07-06T18:54:35.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OpenTK does not find OpenTK.Input.Keyboard.GetState();<p>So i was trying to detect the keywords with OpenTK and in their tutorial gave this code:</p> <pre><c...
72,806,442
javascript function sets the value of a form input field, but then the value disappeared<p>I'm trying to do a live database search using ajax with a form input field. The whole thing runs so far that i can select a text from the proposed list. The corresponding event &quot;livesearchSelect&quot; is also addressed, the ...
<p>Clicking an <a href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element" rel="nofollow noreferrer">anchor element</a> with an <a href="https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-href" rel="nofollow noreferrer"><code>href</code> attribute</a>, even when blank, will <a...
javascript function sets the value of a form input field, but then the value disappeared
javascript|php|html|ajax|forms
0
66
1
72,811,726
72,811,726
1
true
2022-06-29T18:52:15.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: javascript function sets the value of a form input field, but then the value disappeared<p>I'm trying to do a live database search using ajax with a form inp...
72,833,234
How to query Active Directory through attributeID (urn:iod) by ldapsearch or Powershell<p>I need to query AD by attributeID like: <code>urn:oid:2.5.4.42</code></p> <p>Instead of friendlyname: &quot;givenname&quot;</p> <p>How should I query AD by URN:OID?</p> <p>Thank you!</p>
<p>You can just replace the attributeName with its OID in the LDAPFilter like this:</p> <pre><code>(&amp;(objectCategory=person)(objectClass=user)(2.5.4.42=Oliver)) </code></pre> <p>This would find all user objects with givenName &quot;Oliver&quot;...</p>
How to query Active Directory through attributeID (urn:iod) by ldapsearch or Powershell
powershell|active-directory|ldap|openldap|urn
0
66
1
72,845,482
72,845,482
1
true
2022-07-01T18:17:34.030Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to query Active Directory through attributeID (urn:iod) by ldapsearch or Powershell<p>I need to query AD by attributeID like: <code>urn:oid:2.5.4.42</cod...
72,909,272
Processing - loading obj File<p>I've made a little game (<a href="https://github.com/JonLit/SpaceStarProcessing3D" rel="nofollow noreferrer">https://github.com/JonLit/SpaceStarProcessing3D</a>) and now want to convert it to 3D.</p> <p>I've done some things with spheres in P3D before, so I'm not completely new to this.<...
<p>I think the issue with your Cirno model is that you're missing the material file (cirno_low.mtl). The obj. file references it (if you open the .obj in a text editor):</p> <pre><code># # Wavefront OBJ file # Created in RealityCapture # Engine version v1.0.3.4987 # 5050 vertices, 10000 faces # mtllib cirno_low.mtl ...
Processing - loading obj File
processing
1
66
1
72,909,779
72,909,779
1
true
2022-07-08T09:21:00.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Processing - loading obj File<p>I've made a little game (<a href="https://github.com/JonLit/SpaceStarProcessing3D" rel="nofollow noreferrer">https://github.c...
73,024,331
Web Scraping Using Multiple Variables in Link<p>I am trying to efficiently scrape weekly tournament data from pgatour.com, and place the results in one encompassing table. Below, is an example link that I will use:</p> <p><a href="https://www.pgatour.com/stats/stat.02568.y2019.eon.t041.html" rel="nofollow noreferrer">h...
<p>Use <code>expand.grid()</code> to create unique combinations of <code>stat_id</code> and <code>tournament_id</code> and then mutate a new column with those links.</p> <pre><code>library(tidyverse) library(janitor) library(rvest) df &lt;- expand.grid( tournament_id = c(&quot;t041&quot;, &quot;t054&quot;, &quot;t46...
Web Scraping Using Multiple Variables in Link
r|web-scraping|dplyr|lapply|rvest
0
66
1
73,025,576
73,025,576
1
true
2022-07-18T14:53:00.593Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Web Scraping Using Multiple Variables in Link<p>I am trying to efficiently scrape weekly tournament data from pgatour.com, and place the results in one encom...
72,822,381
XSLT 2.0 3.0 for-each context error when tokenizing attributes<p>Given this XML</p> <pre><code>&lt;dmodule&gt; &lt;content&gt; &lt;warningsAndCautionsRef&gt; &lt;warningRef id=&quot;w001&quot; warningIdentNumber=&quot;warning-001&quot;&gt; &lt;/warningRef&gt...
<p>Here's a full working example. NB it's best to have this level of detail in the actual question; i.e. a sample input file, the XSLT, and output, along with an example of what you <em>want</em> the output to look like.</p> <p>Input:</p> <pre class="lang-xml prettyprint-override"><code>&lt;test&gt; &lt;safetyRqmts c...
XSLT 2.0 3.0 for-each context error when tokenizing attributes
xslt|xslt-2.0|tokenize
0
66
2
72,823,738
72,823,738
1
true
2022-06-30T21:49:38.580Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: XSLT 2.0 3.0 for-each context error when tokenizing attributes<p>Given this XML</p> <pre><code>&lt;dmodule&gt; &lt;content&gt; &lt;...
72,953,784
Change keys in a dictionary<p>I have this dictionary.</p> <pre><code>maximo = {'CodChamado': 50, '_14984|Top Down:': 0, '_14985|Hierarquia solicitante:': 0} </code></pre> <p>And I want to change these keys <code>&quot;_14984|Top Down:&quot;</code> and <code>&quot;_14985|Hierarquia solicitante:&quot;</code> to</p> <pre>...
<p>You don't need two loops to do this. If you know the original key, then to get the new key all you need to do is replace the part beginning at <code>&quot;_&quot;</code> and ending at <code>&quot;|&quot;</code> with <code>&quot;Campo Extra|&quot;</code>. You can do this using a regular expression like so:</p> <pre><...
Change keys in a dictionary
python|dictionary|dictionary-comprehension
2
66
4
72,953,892
72,953,892
1
true
2022-07-12T14:13:40.073Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change keys in a dictionary<p>I have this dictionary.</p> <pre><code>maximo = {'CodChamado': 50, '_14984|Top Down:': 0, '_14985|Hierarquia solicitante:': 0} ...
72,398,163
Returning default members when Enum member does not exist<p>I have an Enum where I would like a default member to be returned when a member does not exist inside of it. For example:</p> <pre><code>class MyEnum(enum.Enum): A = 12 B = 24 CUSTOM = 1 print(MyEnum.UNKNOWN) # Should print MyEnum.CUSTOM </code><...
<p>Add a definition for <code>__getattr__</code> to the metaclass:</p> <pre class="lang-py prettyprint-override"><code>class MyMeta(enum.EnumMeta): def __getitem__(cls, name): try: return super().__getitem__(name) except KeyError as error: return cls.CUSTOM def __get...
Returning default members when Enum member does not exist
python|enums
3
66
1
72,398,217
72,398,217
1
true
2022-05-26T21:24:05.763Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Returning default members when Enum member does not exist<p>I have an Enum where I would like a default member to be returned when a member does not exist in...
72,256,157
Google App Script loading other page per JS failed<p>I am trying to load a second page from my google apps script, but as answere I only get a 403.</p> <p>I have the following doGet:</p> <pre><code>function doGet(request) { Logger.log(Utilities.jsonStringify(request)); if(!request.parameter.page){ return HtmlSe...
<p>Try this:</p> <pre><code>&lt;a onclick=&quot;loadPage('&lt;?=url?&gt;?page=Settings')&quot;&gt; &lt;script&gt; function loadPage(page) { window.top.location.replace(page) } &lt;/script&gt; </code></pre>
Google App Script loading other page per JS failed
javascript|google-apps-script|web-applications
0
66
1
72,448,679
72,448,679
1
true
2022-05-16T08:23:53.723Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google App Script loading other page per JS failed<p>I am trying to load a second page from my google apps script, but as answere I only get a 403.</p> <p>I ...
72,378,566
Is it possible to convert HERE v7 link IDs to v8 segment IDs?<p>I have a HERE v7-based routing app that uses stored link IDs with the <code>avoidLinks</code> parameter to avoid certain road segments when calculating routes. Is there a straightforward way to convert v7 link IDs to segment IDs that can be used with the <...
<p>straightforward way doesn't exist but below is not difficult:</p> <ol> <li><p>Get tile id/tile ids for each target link id utilize request like <a href="https://smap.hereapi.com/v8/maps/index.json?layer=ROAD_GEOM_FCn&amp;attributes=LINK_ID&amp;values=17340430,565725162&amp;apikey=" rel="nofollow noreferrer">https://...
Is it possible to convert HERE v7 link IDs to v8 segment IDs?
here-api
0
66
1
72,546,212
72,546,212
1
true
2022-05-25T13:29:59.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to convert HERE v7 link IDs to v8 segment IDs?<p>I have a HERE v7-based routing app that uses stored link IDs with the <code>avoidLinks</code>...
72,259,524
Filling a missing value in a pandas data frame with an if statement based on a condition<p>I have this Pandas data frame in which some values are missing. For example, in row 542 the value of LATITUDE is missing. My goal is based on the condition CNTY_CITY_LOC to fill the missing value of LATITUDE by applying if elif a...
<p>First is necessary return value if no match, here <code>NaN</code> and for repalce only missing values in <code>CA_LOCATION['LATITUDE']</code> use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.fillna.html" rel="nofollow noreferrer"><code>Series.fillna</code></a>:</p> <pre><code>def...
Filling a missing value in a pandas data frame with an if statement based on a condition
python|pandas|if-statement|apply
1
66
1
72,259,621
72,259,621
1
true
2022-05-16T12:51:26.677Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filling a missing value in a pandas data frame with an if statement based on a condition<p>I have this Pandas data frame in which some values are missing. Fo...
72,400,446
htaccess - check multiple cookies with multiple values<p>I'm trying to restrict folder and file access based on browser cookies.</p> <p>Files can only be accessed if these 3 conditions are met:</p> <ol> <li>Wordpress user is logged in</li> <li><code>example_cookie</code> exists</li> <li><code>example_cookie</code> is <...
<p>The (edited) posted code does work now. On line 4, I had the <code>;?</code> around the wrong way! I also didn't need line 3. Final code:</p> <pre><code>RewriteEngine On RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC] RewriteCond %{HTTP_COOKIE} !example_cookie=value1;? [NC] RewriteCond %{HTTP_COOKIE} !exa...
htaccess - check multiple cookies with multiple values
wordpress|apache|.htaccess|cookies|mod-rewrite
0
66
1
72,412,446
72,412,446
1
true
2022-05-27T04:23:02.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: htaccess - check multiple cookies with multiple values<p>I'm trying to restrict folder and file access based on browser cookies.</p> <p>Files can only be acc...
72,311,394
Why does loop.sock_accept(sock) block other co-oroutines in same loop?<p>In the example below:</p> <pre><code> loop = asyncio.get_event_loop() loop.create_task(client()) # Does no start until run_server ends await server() # await f() </code></pre> <p>... the call to server causes client to be blocked. ...
<p>It seems that on Linux <code>sock.settimeout()</code> overrules <code>sock.setblocking(false)</code>.</p> <p>A couple of changes that made your code work for me:</p> <ul> <li>Remove <code>sock.settimeout(...)</code> and use asyncio's timeout functionality instead</li> <li>Use context managers for closing the socket ...
Why does loop.sock_accept(sock) block other co-oroutines in same loop?
python-3.x|python-asyncio
0
66
1
72,311,494
72,311,494
1
true
2022-05-19T21:45:24.580Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does loop.sock_accept(sock) block other co-oroutines in same loop?<p>In the example below:</p> <pre><code> loop = asyncio.get_event_loop() loop.cr...
72,288,945
Show different pages based on user - django<p>I'm building a web app IMDB's like. Each (logged) user views the same exact homepage, but they can flag/unflag every movie they want to save them in a &quot;seen list&quot;. I've done that but I've noticed that every user logged can view the other user's flagged movies. Of ...
<p>You could <a href="https://docs.djangoproject.com/en/4.0/topics/auth/customizing/#extending-the-existing-user-model" rel="nofollow noreferrer">extend the default User class</a> (check the docs, there is several ways to do this and the one I use may not be the best one for you) and use a many-to-many to save all the ...
Show different pages based on user - django
python|django|django-models|django-rest-framework
0
66
1
72,289,221
72,289,221
1
true
2022-05-18T12:11:12.957Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Show different pages based on user - django<p>I'm building a web app IMDB's like. Each (logged) user views the same exact homepage, but they can flag/unflag ...
72,249,623
combineLatest but remove completed observables<p>How can I combine the latest values but remove the completed observables dynamically? The <code>combineLatest</code> operator does not remove completed observables, it just repeats the last value they emitted until all observables complete.</p> <p>I wanted something like...
<p>I added two operators.</p> <ol> <li>endWith: Append end mark like undefined</li> <li>map: Transform array</li> </ol> <pre class="lang-js prettyprint-override"><code>combineLatest([interval(100).pipe(take(2), endWith(undefined)), interval(100)]).pipe( map(values =&gt; values.filter(v =&gt; v !== undefined)) ).s...
combineLatest but remove completed observables
javascript|rxjs
1
66
1
72,255,082
72,255,082
1
true
2022-05-15T15:23:46.340Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: combineLatest but remove completed observables<p>How can I combine the latest values but remove the completed observables dynamically? The <code>combineLates...
72,353,459
Angular Wordpress REST API - How to create a post with new tags (combine Observables)?<p>I have an Angular application that talks to Wordpress REST API. The app needs to create a new post as well as 0-3 new tags with it. I'm saying 0 because in this instance tags are optional. If the user decides to include tags, allow...
<p>You could do something like this:</p> <pre><code>saveQuestion(title: string, tags: string) { // value is now an array of strings: [&quot;tag-name-1&quot;,&quot;tag-name-2&quot;] let splittedTags = tags.split(&quot;,&quot;); from(splittedTags) .pipe( take(3), // &lt;-- take first 3 tags max ma...
Angular Wordpress REST API - How to create a post with new tags (combine Observables)?
angular|rxjs|wordpress-rest-api
0
66
1
72,354,210
72,354,210
1
true
2022-05-23T18:44:02.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular Wordpress REST API - How to create a post with new tags (combine Observables)?<p>I have an Angular application that talks to Wordpress REST API. The ...
72,248,548
Create file descriptor which outputs to multiple targets<p>I'm writing a script, and the majority of its output is best sent to the log file, but I would like to 'opt in' certain commands to console output, e.g. explicit script status/feedback messages.</p> <p>I have created three named file descriptors: one for the te...
<p>The problem is that when you send output to <code>both</code>, <code>bash</code> doesn't wait until <code>tee</code> actually writes it out before it moves on to the next line, so you end up with a race condition of <code>bash</code> and <code>tee</code> making unsynchronized writes to <code>log</code>. Unless you h...
Create file descriptor which outputs to multiple targets
bash|output|file-descriptor
0
66
2
72,250,214
72,250,214
1
true
2022-05-15T13:07:46.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create file descriptor which outputs to multiple targets<p>I'm writing a script, and the majority of its output is best sent to the log file, but I would lik...
72,354,387
SQL: Pull rows based on sequence of values<p>I need to pull rows of data based on the existence of certain values that exist in a specific sequence.</p> <p>Here's an example of the data:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Header</th> <th>EventId</th> <th>EventDate</th> </tr> </...
<p>I'm going to assume that a start event (81) always starts a new &quot;frame&quot; from that row onwards, and an end event (77) always starts a new frame from the following row onwards.</p> <p>I'm also going to assume that you're only interested in frames where both a start and end event are present, and that the fra...
SQL: Pull rows based on sequence of values
sql|sql-server
0
66
2
72,355,598
72,355,598
1
true
2022-05-23T20:17:20.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL: Pull rows based on sequence of values<p>I need to pull rows of data based on the existence of certain values that exist in a specific sequence.</p> <p>H...
72,360,099
wsl.exe always appears multiple times in eclipse local terminal custom entries<p>Using eclipse 2021-06 on a windows 10 PC, when I open a local terminal, it always displays multiple rows for the wsl.exe terminal, with names like this...</p> <p><a href="https://i.stack.imgur.com/DdHiL.png" rel="nofollow noreferrer"><img...
<p><em>Short answer:</em></p> <p>Upgrading to the latest Eclipse release should fix the issue.</p> <p><em>More detail:</em></p> <p>I'm going to take an educated guess here without (apologies) attempting to reproduce it myself. As @howlger mentioned in the comments, the 2021-06 release is a bit outdated.</p> <p>When it...
wsl.exe always appears multiple times in eclipse local terminal custom entries
eclipse|windows-subsystem-for-linux
1
66
1
72,385,514
72,385,514
1
true
2022-05-24T09:05:12.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: wsl.exe always appears multiple times in eclipse local terminal custom entries<p>Using eclipse 2021-06 on a windows 10 PC, when I open a local terminal, it a...
72,238,609
Declarables and MultiRabbit<p>I'm using spring-multirabbit library :</p> <pre><code>rabbitmq: host: localhost port: 5672 username: guest password: guest multirabbitmq: enabled: true connections: my-rabbitmq: host: localhost port: 5677 username: guest passw...
<p>Ok.. I figured out how to solve it</p> <p>Specify the admin with method : 'setAdminsThatShouldDeclare' on the declarable :</p> <pre><code>@Bean public Declarables queues(MessagingProperties messagingProperties) { return new Declarables(messagingProperties.getBindings().stream().map(b -&gt; { Declarab...
Declarables and MultiRabbit
spring|spring-rabbit|multirabbitmq|spring-multirabbit
0
66
1
72,238,971
72,238,971
1
true
2022-05-14T08:41:26.573Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Declarables and MultiRabbit<p>I'm using spring-multirabbit library :</p> <pre><code>rabbitmq: host: localhost port: 5672 username: guest pass...
72,277,725
Best way to find unique sublists of a given length that are present in a list?<p>So I have built a function that finds all of the unique sublists, of length <code>i</code>, present in a given list.</p> <p>For example if you have <code>list=[0,1,1,0,1]</code> and <code>i=1</code>, you just get <code>[1,0]</code>. If <co...
<p>Given your code and sample, look like you want all the unique contiguous sub-sequences of the given input, if so you don't need to compute all combinations, neither shifting around between strings, list, set and back from string, let alone looping multiple times over the thing, using the slice notation is more that ...
Best way to find unique sublists of a given length that are present in a list?
python|list
-1
66
3
72,280,399
72,280,399
1
true
2022-05-17T16:36:20.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best way to find unique sublists of a given length that are present in a list?<p>So I have built a function that finds all of the unique sublists, of length ...
72,351,305
R assign/get variables as df names in two for-loops, one works and one doesn't<p>i'm trying to use two for loops to</p> <ol> <li>import some csv files to dataframe and</li> <li>apply my self-made function to those imported dataframes.</li> </ol> <p>i searched about assign and get function and the first step(importing c...
<p>You haven't provided a reproducible example, but I'm going to make up some data and show how it's better to use lists than <code>assign</code> and <code>get</code>.</p> <pre><code>## each is just mtcars my_files = c(&quot;mtcars.1.txt&quot;, &quot;mtcars.2.txt&quot;, &quot;mtcars.3.txt&quot;) </code></pre> <p>We can...
R assign/get variables as df names in two for-loops, one works and one doesn't
r|for-loop|assign
0
66
1
72,351,573
72,351,573
1
true
2022-05-23T15:41:42.260Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R assign/get variables as df names in two for-loops, one works and one doesn't<p>i'm trying to use two for loops to</p> <ol> <li>import some csv files to dat...
72,305,828
Escaped characters appearing when appending to HTML element<p>I am fetching HTML code via an AJAX call, and then <strong>appending the code it to an existing HTML element</strong>. Problem is, the <strong>appended code contains escaped characters, causing the HTML to break</strong>, and resulting in haphazard elements ...
<p>The response is JSON, you need to parse it.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>let responseText = `"&lt;li class='listitems'&gt;&lt;a href='https:\\/\\/website....
Escaped characters appearing when appending to HTML element
javascript|html|ajax|escaping
0
66
1
72,306,105
72,306,105
1
true
2022-05-19T13:52:22.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Escaped characters appearing when appending to HTML element<p>I am fetching HTML code via an AJAX call, and then <strong>appending the code it to an existing...
72,288,301
How to secure Mule applications traffic<p>A client of mine has a bunch of APIs in CloudHub that communicate with two APIs on premise in their runtime. The question I get asked, to which I don't really know the answer, is how to secure the communication between the APIs on CloudHub and on premise without using API Manag...
<p>The server applications should implement some basic security best practices like authentication and encryption.</p> <p>Having applications deployed in any cloud environment without security is a big security risk. I assume that there is a secure link between the CloudHub environment and their on premise environment,...
How to secure Mule applications traffic
security|mule|middleware|ibm-api-management
1
66
1
72,292,053
72,292,053
1
true
2022-05-18T11:25:32.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to secure Mule applications traffic<p>A client of mine has a bunch of APIs in CloudHub that communicate with two APIs on premise in their runtime. The qu...
72,301,601
Visual Studio does not remember publish credentials (password)<p>I switched to a new pc, and now whenever I want to publish my application to azure, I need to fill in the credentials. It remembers the username, but not the password. This was not the case on my previous pc, where it remembered both.</p>
<ul> <li>download the publishing profile on the azure portal for your web app. In it are the credentials you should use.</li> <li>right click on the project - click 'Publish'</li> <li>on the top, select the publish configuration that you want to edit (with the dropbox that is barely visible)</li> <li>click on the combo...
Visual Studio does not remember publish credentials (password)
visual-studio|azure-web-app-service|publish
1
66
1
72,301,602
72,301,602
1
true
2022-05-19T09:02:01.050Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Visual Studio does not remember publish credentials (password)<p>I switched to a new pc, and now whenever I want to publish my application to azure, I need t...
72,250,408
Not able connect database using JDBC<p>I am trying to connect with my SQL server in databricks notebook with JDBC using spark sql.</p> <pre><code>val jdbcHostname = &quot;database.windows.net&quot; val jdbcPort = 1433 val jdbcDatabase = &quot;Database1&quot; // Create the JDBC URL without passing in the user and passw...
<p>The <code>s&quot;${xxx}&quot;</code> syntax is used to refer to a value in variable or an expression, but it your case it looks like a raw password, and in Scala variable names may not contain special characters, like in your expression: <code>abc$@123</code>. The solution would be to remove <code>s</code> from the...
Not able connect database using JDBC
scala|jdbc|apache-spark-sql|databricks
0
66
1
72,255,243
72,255,243
1
true
2022-05-15T17:01:07.733Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not able connect database using JDBC<p>I am trying to connect with my SQL server in databricks notebook with JDBC using spark sql.</p> <pre><code>val jdbcHos...
72,258,512
SNOWFLAKE insert failing -- Timestamp '06/28/2016 20:35:06:703000' is not recognized<p>I am trying to load data from SQL server to Snowflake environment. SQL gives output of date as --06/28/2016 20:35:06:703000'</p> <p>While inserting this value in snowflake with timestamp(9) as datatype, I am getting this error -- Ti...
<p>If I use lower case versions of your format string it works for me:</p> <p>Well, if <code>mi</code> is used for minutes, <a href="https://docs.snowflake.com/en/sql-reference/functions-conversion.html#date-and-time-formats-in-conversion-functions" rel="nofollow noreferrer">parameters format</a> AND the marker for the...
SNOWFLAKE insert failing -- Timestamp '06/28/2016 20:35:06:703000' is not recognized
sql-server|snowflake-cloud-data-platform
-1
66
1
72,258,598
72,258,598
1
true
2022-05-16T11:30:23.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SNOWFLAKE insert failing -- Timestamp '06/28/2016 20:35:06:703000' is not recognized<p>I am trying to load data from SQL server to Snowflake environment. SQL...
72,254,271
How to make a edit text which has a limit of char and ignores all the chars of a url<p>How can we make a custom edit text that will have a limit, for example, 300 chars? But, if the users enter a very long link like 200 chars, how can I reduce the chars for the link? For example:</p> <pre><code>User entered: Hello, wor...
<p>This code for works fine for java:</p> <pre class="lang-java prettyprint-override"><code>import android.content.Context; import android.util.AttributeSet; import android.util.Patterns; import androidx.annotation.NonNull; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; public cla...
How to make a edit text which has a limit of char and ignores all the chars of a url
java|android|kotlin
0
66
1
72,254,272
72,254,272
1
true
2022-05-16T04:50:59.070Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a edit text which has a limit of char and ignores all the chars of a url<p>How can we make a custom edit text that will have a limit, for example...
72,312,935
How to sync typing between a span and an input?<p>I'm making a new I found way to sync typing between a span and an input (&quot;https://stackoverflow.com/questions/8803416/synchonise-2-input-fields-can-it-be-done-using-jquery&quot;) and it works but I've come across a problem.</p> <p>What I'm trying to do is create a ...
<p><code>$(&quot;input#title&quot;).text()</code> never works. Instead you need to use <code>$(&quot;input#title&quot;).val()</code> to fill it.</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...
How to sync typing between a span and an input?
javascript|jquery|wordpress-theming
0
66
1
72,315,598
72,315,598
1
true
2022-05-20T02:25:36.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sync typing between a span and an input?<p>I'm making a new I found way to sync typing between a span and an input (&quot;https://stackoverflow.com/qu...
72,270,023
how to import items from txt to listview c#<p>I'm new at C# still learning I'm coding a bulk mail sender application, I want to import mail address from txt file to list view for example</p> <pre><code> No | Email Address | 1 test1@gmail.com 2 test2@gmail.com 3 test3@gmail.com 4 test4@gmail.com 5...
<p>You can try <em>querying</em> the file; assuming that UI is <em>WinForms</em> you can put something like this:</p> <pre><code>using System.IO; using System.Linq; ... var itemsToAdd = File .ReadLines(@&quot;c:\ItemsToCreate.txt&quot;) .Skip(1) // Skip Caption .Select(line =&gt; l...
how to import items from txt to listview c#
c#|winforms
-3
66
1
72,270,362
72,270,362
1
true
2022-05-17T07:45:55.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to import items from txt to listview c#<p>I'm new at C# still learning I'm coding a bulk mail sender application, I want to import mail address from txt ...
72,293,569
How can I use this React component to collect form data?<p>I've created two components which together create a 'progressive' style input form. The reason I've chosen this method is because the questions could change text or change order and so are being pulled into the component from an array stored in a JS file called...
<p>There what I have done:</p> <p><a href="https://codesandbox.io/s/angry-dew-37szi2?file=/src/InputForm.js:262-271" rel="nofollow noreferrer">https://codesandbox.io/s/angry-dew-37szi2?file=/src/InputForm.js:262-271</a></p> <p>So, we can make it easier, you just can pass necessary data when call handler from props:</p>...
How can I use this React component to collect form data?
javascript|reactjs|react-hooks
0
66
1
72,294,312
72,294,312
1
true
2022-05-18T17:28:42.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I use this React component to collect form data?<p>I've created two components which together create a 'progressive' style input form. The reason I'v...
72,261,135
SQL to find the match record based on the priority defined<p>I have to build a logic to update one column <code>SC_LEVI_LVL IN GCC_MAST.CLNT_MAST</code> based on the match found on the below criteria:</p> <p>(I am just looking at the select clause and I will update it later using update strategy in informatica)</p> <p>...
<pre><code>-- here is the combination of the two - priority_one and priority_two WITH landing As ( Select 'NZ' &quot;REL_COUNTRY&quot;, 12345 &quot;GRID&quot;, 'Y' &quot;LAT&quot;, 'ABC' &quot;SC_LEVI_LVL&quot; From Dual UNION Select 'MO' &quot;REL_COUNTRY&quot;, 44444 &quo...
SQL to find the match record based on the priority defined
sql|database|oracle
0
66
1
72,272,819
72,272,819
1
true
2022-05-16T14:49:08.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL to find the match record based on the priority defined<p>I have to build a logic to update one column <code>SC_LEVI_LVL IN GCC_MAST.CLNT_MAST</code> base...
72,389,462
How to bind a Navigation-Bar "Dropdown" with asp-controllers and asp-actions . (ASP.Net Core 5 MVC)<p>Short question: I have searched the internet for an answer but I can't seem to find one that fits my situation.</p> <p>This is where I want to bind some <code>asp-controllers</code> and <code>asp-actions</code>:</p> <p...
<p>Looks like yours is the standard situation for <a href="https://docs.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/built-in/anchor-tag-helper?view=aspnetcore-6.0#anchor-tag-helper-attributes" rel="nofollow noreferrer">Anchor Tag Helpers</a></p> <pre><code>&lt;a class=&quot;dropdown-item&quot; asp-controll...
How to bind a Navigation-Bar "Dropdown" with asp-controllers and asp-actions . (ASP.Net Core 5 MVC)
asp.net-core-mvc|asp.net-core-5.0
0
66
1
72,389,539
72,389,539
1
true
2022-05-26T09:15:00.710Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to bind a Navigation-Bar "Dropdown" with asp-controllers and asp-actions . (ASP.Net Core 5 MVC)<p>Short question: I have searched the internet for an ans...
72,397,970
Insert 2 Blank Rows In DF by Group<p>I basically want the solution from this question to be applied to 2 blank rows.</p> <p><a href="https://stackoverflow.com/questions/54105398/insert-blank-row-in-python-data-frame-when-value-in-column-changes">Insert Blank Row In Python Data frame when value in column changes?</a></p...
<p>You can do:</p> <pre><code>num_empty_rows = 2 df = (df.groupby('Col1',as_index=False).apply(lambda g: g.append( pd.DataFrame(data=[['']*len(df.columns)]*num_empty_rows, columns=df.columns))).reset_index(drop=True).iloc[:-num_empty_rows]) </code></pre> <p>As you can see, after each...
Insert 2 Blank Rows In DF by Group
python|pandas
0
66
1
72,398,478
72,398,478
1
true
2022-05-26T21:01:55.497Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Insert 2 Blank Rows In DF by Group<p>I basically want the solution from this question to be applied to 2 blank rows.</p> <p><a href="https://stackoverflow.co...
72,376,806
Over writing a dataframe with a list of dicts<p>Suppose a dict like</p> <pre><code>rows = [{&quot;A&quot;:1, &quot;B&quot;:2},{&quot;A&quot;:2, &quot;B&quot;:2},{&quot;A&quot;:3, &quot;B&quot;:2}] </code></pre> <p>A dataframe <code>df</code> may or may not contain <code>A</code> and <code>B</code> columns, in either ca...
<p>Are you trying to merge the 2 DataFrame to fill in the missing column?</p> <pre><code>df1 = pd.DataFrame([{&quot;A&quot;:1, &quot;B&quot;:2},{&quot;A&quot;:3, &quot;B&quot;:2},{&quot;A&quot;:4, &quot;B&quot;:3}]) dfA = df1.drop(&quot;B&quot;, axis=1) print(pd.concat([df1, dfA], axis=1)) A B A 0 1 2 1 1 3 ...
Over writing a dataframe with a list of dicts
python|pandas|dataframe
1
66
2
72,377,324
72,377,324
1
true
2022-05-25T11:29:25.750Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Over writing a dataframe with a list of dicts<p>Suppose a dict like</p> <pre><code>rows = [{&quot;A&quot;:1, &quot;B&quot;:2},{&quot;A&quot;:2, &quot;B&quot;...
72,245,849
How to count number of characters and words in an HTML file or HTML string?<p>I have this string input from a HTML file:</p> <pre><code>&lt;h1&gt; Hello world &lt;/h1&gt; </code></pre> <p>I want to count number of word and character of this file (not include HTML element)</p> <p>For example:</p> <pre><code>Input &lt...
<p>You can find them by regular expression.</p> <pre><code> input := []byte(&quot;&lt;h1&gt;Hello&lt;/h1&gt;\n&lt;h1&gt;Hello&lt;/h1&gt;&quot;) tags, _ := regexp.Compile(&quot;(\\&lt;\\/?[A-z0-9]+\\&gt;)|(\\\\[A-z]{1})&quot;) // remove tags and backslash characters input = tags.ReplaceAll(input, []byte(...
How to count number of characters and words in an HTML file or HTML string?
go
1
66
1
72,246,047
72,246,047
2
true
2022-05-15T05:56:09.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to count number of characters and words in an HTML file or HTML string?<p>I have this string input from a HTML file:</p> <pre><code>&lt;h1&gt; Hello worl...
72,262,028
RSelenium message:no such element: Unable to locate element<p>I intend to download and clean databases using <code>RSelenium</code>. I am able to open the link however I am having trouble downloading and opening the database. I believe the <code>xpath</code> is right but when I try to open I receive the following error...
<p>The element you are trying to access is inside an <code>iframe</code> and you need switch that iframe first in order to access the element.</p> <p><a href="https://i.stack.imgur.com/idPQF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/idPQF.png" alt="enter image description here" /></a></p> <pre>...
RSelenium message:no such element: Unable to locate element
r|selenium|rselenium
1
66
1
72,262,193
72,262,193
2
true
2022-05-16T15:51:10.497Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RSelenium message:no such element: Unable to locate element<p>I intend to download and clean databases using <code>RSelenium</code>. I am able to open the li...
72,275,952
How to use regex to match a group multiple times<p>Sorry for the bad title, I didn't know how to word this properly. I have a URL such as /colour-white/size-large/, and I need to rewrite it in htaccess. String should look like &amp;colour=white&amp;size=large after regex.</p> <p>I don't want to have to make multiple re...
<p>It is pretty common to add multiple rewrite rules for different numbers of parameters. This works, including what comes before it (&quot;dresses&quot;) for up to three parameters. Adding a 4th parameter is just a fourth line. The number of rules needed increases linearly with the number of parameters, not exponen...
How to use regex to match a group multiple times
regex|apache|.htaccess|url-rewriting|apache2
-1
66
1
72,278,583
72,278,583
2
true
2022-05-17T14:36:01.700Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use regex to match a group multiple times<p>Sorry for the bad title, I didn't know how to word this properly. I have a URL such as /colour-white/size-...
72,294,298
Get an element in a list at a specified index<p>I need to write a program that return an element from a list, using a specified index.</p> <p>We have a list of the English alphabet X = [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]</p> <p>Starting at 0, I have to return, for example, the...
<p>It's just a matter of iterating over the list and counting as you go. Try something like this:</p> <pre><code>select( [X|_] , 0 , X ) . select( [_,Xs] , N , C ) :- N &gt; 0 , N1 is N-1, select(Xs,N1,C). </code></pre> <p>or</p> <pre><code>select( Xs , N , C ) :- select(Xs,0,N,C) . select( [X|_] , N , N , X ) . sel...
Get an element in a list at a specified index
prolog
2
66
2
72,294,795
72,294,795
2
true
2022-05-18T18:29:42.977Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get an element in a list at a specified index<p>I need to write a program that return an element from a list, using a specified index.</p> <p>We have a list ...
72,302,331
How can I use pick with optional types in nested typescript<p>I want write typescript</p> <pre><code> dynamicContent?: { data?: { attributes?: { baccarat?: { title?: string | null; content?: string | null } | null; baccaratOnline?: { title?: string | null; content?: string | null } | null; ...
<p>You seem to not understand the difference between optional and nullable, hence the difference between <code>undefined</code> and <code>null</code>.</p> <p>In TypeScript, when you define an optional property, it effectively makes it the type of the property or <code>undefined</code>:</p> <pre><code>interface MyInterf...
How can I use pick with optional types in nested typescript
typescript
0
66
2
72,302,569
72,302,569
2
true
2022-05-19T09:49:04.413Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I use pick with optional types in nested typescript<p>I want write typescript</p> <pre><code> dynamicContent?: { data?: { attributes?: { ...
72,321,486
Pandas map multikey dictionary to dataframe<p>I have following dataset:</p> <pre><code>+────────────────────────────────+─────────────────+─────────────────+ | product_name | column_value_1 | column_value_2 | +────────────────────────────────+─────────────────+─────────────────+ | Coca Cola 1L ...
<p>Having product_map expanded should simplify things a lot:</p> <pre><code>product_map_expanded = {i:val for key, val in product_map.items() for i in key } </code></pre> <p><code>product_map_expanded</code> now looks like:</p> <pre><code>{'Кола Кола': 'Coca Cola 1L', 'Coca Cola 1L': 'Coca Cola 1L', 'Carbonated drink...
Pandas map multikey dictionary to dataframe
python|pandas|dataframe
0
66
2
72,322,241
72,322,241
2
true
2022-05-20T15:35:42.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas map multikey dictionary to dataframe<p>I have following dataset:</p> <pre><code>+────────────────────────────────+─────────────────+─────────────────+...
72,354,186
Overload Operator for Built-in Type in Dart<p>Consider the following Dart code:</p> <pre class="lang-dart prettyprint-override"><code>class Vec2 { num x, y; Vec2(this.x, this.y); Vec2 operator*(num rhs) =&gt; Vec2(x * rhs, y * rhs); String toString() =&gt; &quot;&lt;$x, $y&gt;&quot;; } void main() =&gt; print(...
<p>You cannot do what you want.</p> <p>Dart user-definable binary operators are all methods on the first operand. Doing <code>e1 + e2</code> is <em>kind-of like</em> doing <code>e1.+(e2)</code> where <code>+</code> is the name of the method, except you can't normally call a method <code>+</code>.</p> <p>In order to be ...
Overload Operator for Built-in Type in Dart
dart|operator-overloading
0
66
1
72,354,532
72,354,532
2
true
2022-05-23T19:57:52.973Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Overload Operator for Built-in Type in Dart<p>Consider the following Dart code:</p> <pre class="lang-dart prettyprint-override"><code>class Vec2 { num x, y...
72,367,081
Why weren't the newest version of dependencies fetched?<p>I have added dependencies in a Rust project like this:</p> <pre class="lang-toml prettyprint-override"><code>rust_wheel = { git = &quot;https://github.com/jiangxiaoqiang/rust_wheel.git&quot; } </code></pre> <p>When I built this project in GitHub Actions, I found...
<p>Likely you have a <code>Cargo.lock</code> file, which is designed to prevent updating dependencies from under your nose by keeping track of the specific versions you're using. If there are changes in the git repository that you want to use, you can update the <code>Cargo.lock</code> file using <a href="https://doc.r...
Why weren't the newest version of dependencies fetched?
rust|github-actions|rust-cargo
3
66
1
72,367,339
72,367,339
2
true
2022-05-24T17:28:18.433Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why weren't the newest version of dependencies fetched?<p>I have added dependencies in a Rust project like this:</p> <pre class="lang-toml prettyprint-overri...
72,366,987
How can I properly call functions within Enum.map?<p>I am trying to convert a string timestamp into unix time, however, I run into the following error:</p> <pre><code>(CompileError) nested captures via &amp; are not allowed: &amp;(NativeDateTime.diff(&amp;1, ~N[1970-01-01 00:00:00])) </code></pre> <p>I am unfamiliar wi...
<p>There is no need to try to define extra anonymous functions inside the <code>fn end</code> block - you can just use the arguments with regular function calls.</p> <p>This works for me:</p> <pre class="lang-elixir prettyprint-override"><code>[[nil, nil, &quot;2022-05-24T19:00:30.510232Z&quot;]] |&gt; Enum.map(fn [_us...
How can I properly call functions within Enum.map?
elixir
-1
66
1
72,368,292
72,368,292
2
true
2022-05-24T17:19:37.933Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I properly call functions within Enum.map?<p>I am trying to convert a string timestamp into unix time, however, I run into the following error:</p> <...
72,374,672
How to show download pdf button in every post bottom created with ACF<p>I created the a text field in which I can add url of pdf file. Now I'm trying to show it on every post after the content but it only shows the button but not the content. If I remove the_content from add_action, it shows the content but not the dow...
<p>All you need is to concat your button with existing content. With current code it will override. Check below code for reference:</p> <pre><code>add_action( 'the_content', 'show_download_url' ); function show_download_url($content) { $download_pdf = get_post_meta( get_the_ID(), 'download_pdf', true ); if...
How to show download pdf button in every post bottom created with ACF
php|wordpress|custom-wordpress-pages|wordpress-shortcode
1
66
1
72,374,953
72,374,953
2
true
2022-05-25T08:59:16.953Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to show download pdf button in every post bottom created with ACF<p>I created the a text field in which I can add url of pdf file. Now I'm trying to show...
72,377,837
Code Smell : Make this anonymous inner class a lambda<pre><code>public Transformer getTransformed(Locale locale, SlingHttpServletRequest request) { return new Transformer() { public Object transform(Object o) { Tag tag = (Tag) o; String tagId = tag.getTagID(); ValueMap v...
<p>This is what you need, no need to create an object of a some class:</p> <pre><code>Function&lt;Object, Object&gt; transform = o -&gt; { Tag tag = (Tag) o; String tagId = tag.getTagID(); ValueMap vm = new ValueMapDecorator(new HashMap&lt;&gt;()); vm.put(&quot;value&quot;, tagId); ...
Code Smell : Make this anonymous inner class a lambda
java|function|lambda
2
66
1
72,378,092
72,378,092
2
true
2022-05-25T12:41:08.220Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Code Smell : Make this anonymous inner class a lambda<pre><code>public Transformer getTransformed(Locale locale, SlingHttpServletRequest request) { retur...
72,293,224
The grammar of a language of a NFA state diagram - Antlr v4<p>I am trying to write the grammer of the following NFA diagram <img src="https://i.stack.imgur.com/SbTad.png" alt="Coffee machine state diagram" /></p> <p>My code is</p> <pre><code>grammar LTFA; rS: 'Start' rA | EOF; rA: 'Select_coffe' rB; rB: 'Enter_money...
<p>This task is probably not possible to accomplish. While you can generate a state machine (ATN, NFA, DFA) from a grammar, it's not possible to do the reverse, because states are not rules and you cannot create rules from only states and transitions. However, you are trying here to use grammar rules in place of states...
The grammar of a language of a NFA state diagram - Antlr v4
null|antlr4|grammar|finite-automata
0
66
2
72,300,041
72,300,041
2
true
2022-05-18T16:59:51.080Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The grammar of a language of a NFA state diagram - Antlr v4<p>I am trying to write the grammer of the following NFA diagram <img src="https://i.stack.imgur.c...
72,370,232
Making selectizeInput reactive to show/hide markers on Leaflet Shiny R<p>I am in the process of making a map of street food in Oaxaca, Mexico, although I am running into some trouble. I am trying to produce a leaflet map in Shiny and understand the UI side of shiny, although the server side not as much. I understand th...
<p>Try this</p> <pre><code>library(leaflet) library(shiny) library(shinydashboard) library(dplyr) #Data Sample long &lt;- c(-96.72363, -96.72880, -96.72700) lat &lt;- c(17.06167, 17.06200, 17.06170 ) name &lt;- c(&quot;jim&quot;, &quot;grant&quot;, &quot;pablo&quot;) food &lt;- c(&quot;tacos&quot;, &quot;burger&quot;...
Making selectizeInput reactive to show/hide markers on Leaflet Shiny R
r|shiny|leaflet|reactive|leaflet.markercluster
2
66
1
72,370,957
72,370,957
2
true
2022-05-24T22:49:05.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Making selectizeInput reactive to show/hide markers on Leaflet Shiny R<p>I am in the process of making a map of street food in Oaxaca, Mexico, although I am ...
72,260,975
Is it a good practice to use git merge `ours` strategy in a git flow release process<p>I've 3 branches: <code>Dev</code> (on which developers push their code), <code>Qa</code> (on which tests are done) and <code>Master</code> (production code).</p> <p>When releasing, we <code>merge</code> (default merge) <code>Qa</code...
<blockquote> <p>Is it a good idea?</p> </blockquote> <p>Hm, I doubt it. <code>git merge -s ours</code> pretends to do a merge where in fact it rather does a <code>reset</code>. You effectively ignore all commits that were made to <code>master</code>. And that is the point I would rather investigate:</p> <p>How can it b...
Is it a good practice to use git merge `ours` strategy in a git flow release process
git|git-flow
1
66
1
72,261,480
72,261,480
2
true
2022-05-16T14:37:58.630Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it a good practice to use git merge `ours` strategy in a git flow release process<p>I've 3 branches: <code>Dev</code> (on which developers push their code...
72,291,852
Declaration vs definition: is GCC wrong?<p>According to ISO9899:2017 § 6.7-5:</p> <blockquote> <p>A declaration specifies the interpretation and attributes of a set of identifiers. A definition of an identifier is a declaration for that identifier that: — for an object, causes storage to be reserved for that object;</p...
<p>First you have this:</p> <pre><code>extern int myVariable; </code></pre> <p>The <code>extern</code> keyword makes this a <em>declaration</em> for a variable with <em>external linkage</em>. Any such declaration will always refer to the same object.</p> <p>Then you have:</p> <pre><code>int myVariable; </code></pre>...
Declaration vs definition: is GCC wrong?
c|gcc
1
66
1
72,291,997
72,291,997
2
true
2022-05-18T15:19:31.890Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Declaration vs definition: is GCC wrong?<p>According to ISO9899:2017 § 6.7-5:</p> <blockquote> <p>A declaration specifies the interpretation and attributes o...
72,320,017
Remove everything from a cell thats within <> in Google Sheets<p>I know there are a lot of topics about removing characters from Google Sheets cells. I've tried to find a way how to solve my issue with the information on the web / stackoverflow but I can't find it...</p> <p>I need to create a column with text in multip...
<p>use:</p> <pre><code>=ARRAYFORMULA(REGEXREPLACE(D2:D, &quot;&lt;.*?&gt;&quot;, )) </code></pre> <p>in some cases that wont be enough so:</p> <pre><code>=ARRAYFORMULA(REGEXREPLACE(D2:D, &quot;&lt;\/\w+&gt;|&lt;\w+.*?&gt;&quot;, )) </code></pre> <p>and in some cases even that wont be enough so:</p> <pre><code>=ARRAYFOR...
Remove everything from a cell thats within <> in Google Sheets
regex|google-sheets|substitution|regexp-replace|re2
1
66
1
72,322,389
72,322,389
2
true
2022-05-20T13:48:28.540Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove everything from a cell thats within <> in Google Sheets<p>I know there are a lot of topics about removing characters from Google Sheets cells. I've tr...
72,274,927
How to pass incoming integer parameter value in json request while making a POST request<p>Making a POST request for the API, passing incoming json body as hardcoded string. Fine with all hardcoded values, only need to pass <strong>ID</strong> based on incoming parameter <strong>incomingID</strong> (int)</p> <p>Checked...
<p>To make this, you can use simple interpolation:</p> <pre><code>string json = $&quot;{{\&quot;Information\&quot;:{{\&quot;messageHeader\&quot;:{{\&quot;message\&quot;:\&quot;getInfo\&quot;,\&quot;transactionDate\&quot;:\&quot;2021-05-11T12:05:54.000\&quot;, \&quot;transactionID\&quot;:\&quot;2021-05-15T12:05:54.000-1...
How to pass incoming integer parameter value in json request while making a POST request
c#|json
0
66
1
72,275,662
72,275,662
2
true
2022-05-17T13:28:42.493Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pass incoming integer parameter value in json request while making a POST request<p>Making a POST request for the API, passing incoming json body as h...
72,263,419
pandas: How to sort values in order of most repeated to least repeated?<p>Suppose a <code>df</code> as:</p> <pre><code> A B ... 2 . 3 . 2 . 3 2 1 </code></pre> <p>I expect output to be:</p> <pre><code> A B ... 2 . 2 . 2 . 3 3 1 </code></pre> <p>Be...
<p>This works:</p> <pre><code># Suppose you have a df like this: import pandas as pd df = pd.DataFrame({'A':[2,3,2,3,2,1], 'B':range(6)}) A B 0 2 0 1 3 1 2 2 2 3 3 3 4 2 4 5 1 5 # you can pass a sorting function to sort_values as key: df = df.sort_values(by='A', key=lambda x: x.map(x.value_counts()), a...
pandas: How to sort values in order of most repeated to least repeated?
python|pandas|dataframe
1
66
4
72,263,595
72,263,595
2
true
2022-05-16T17:39:44.737Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pandas: How to sort values in order of most repeated to least repeated?<p>Suppose a <code>df</code> as:</p> <pre><code> A B ... 2 . 3 . 2 ...
72,286,103
In Inno Setup create page where the user may select files from a folder that is packaged in the setup file<p>In Inno Setup I want to create a page that has a list of checkboxes that correspond to the files in a folder I have listed in the <code>[Files]</code> section.</p> <p>How can I read the files in this folder and ...
<p>The <code>InitializeWizard</code> happens at the very beginning, long before the files are extracted. Moreover it would be inefficient to extract (all) files to <code>{tmp}</code> and then copy them somewhere else after users selects the files to install. And you would have to code the actual installation process.</...
In Inno Setup create page where the user may select files from a folder that is packaged in the setup file
inno-setup|pascalscript
2
66
1
72,287,109
72,287,109
2
true
2022-05-18T08:57:29.020Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In Inno Setup create page where the user may select files from a folder that is packaged in the setup file<p>In Inno Setup I want to create a page that has a...
72,249,638
Showing card depending on button pressed in flutter<p>I am trying to implement a functionality so that when I press a button it displays a Card with some info. I got 2 buttons, depending on which I press it should show one card or another.</p> <p>I simplified the code a bit not including some irrelevant parameters for ...
<p>you ned to wrap your functions with setState to redraw ui, like this</p> <pre><code>onPressed: () { setState(() { _visibleBehavior = true; }) } </code></pre> <p>Also to use setState method you have to refactor your DogCardDetails StatelessWidget to StatefullWidget</p>
Showing card depending on button pressed in flutter
flutter
0
66
1
72,249,785
72,249,785
2
true
2022-05-15T15:24:56.773Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Showing card depending on button pressed in flutter<p>I am trying to implement a functionality so that when I press a button it displays a Card with some inf...
72,239,855
How to close sidenav menu when click out of container div<p>I'm building a sidenav menu that appears and disappears when click a button. I learned a lot here about stacks, users have helped me up to this point, but now I can't integrate a function.</p> <p>As you can see in the code, if you click button menu, the sidena...
<p>If you inspect the <code>.mts_mob_container</code> element in your browser you'll realize it's covering the button (the button isn't triggering any event) so i had to comment its dimensions:</p> <pre><code>.mts_mob_container { display: flex; position: fixed; z-index: 999; /* height: 1...
How to close sidenav menu when click out of container div
javascript|html|jquery|css|menu
1
66
1
72,242,721
72,242,721
2
true
2022-05-14T11:42:29.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to close sidenav menu when click out of container div<p>I'm building a sidenav menu that appears and disappears when click a button. I learned a lot here...
72,274,672
next/previous button activate on pagination using jquery<p>I have pagination, I'm not getting how to activate the next/previous icon when clicking on it. Currently, if I click on the numbers, it shows the respective page. Please help to show the pages when clicked on next &amp; previous buttons and also how to disable ...
<p>To enable/disable the <code>#prev</code> and <code>#next</code> links based on the current page you can perform a check in the <code>showPage</code> function which adds a class to them that sets <code>pointer-events: none</code>.</p> <p>Also note the use of <code>slice()</code> instead of an explicit loop to hide/sh...
next/previous button activate on pagination using jquery
html|jquery|css
3
66
2
72,276,036
72,276,036
2
true
2022-05-17T13:10:01.467Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: next/previous button activate on pagination using jquery<p>I have pagination, I'm not getting how to activate the next/previous icon when clicking on it. Cur...
72,321,034
how to sort an array with a specific logic<p>I wish to sort the following array in such way that the 'distance' between the events are the largest.</p> <p>example:</p> <pre><code>events = [[1,2],[2,8],[3,4],[1,2]] </code></pre> <p>the end result should be:</p> <pre><code>events = [[1,2],[1,2],[3,4],[2,8]] </code></pr...
<p>Same as you did, just sort by the delta between the numbers:</p> <pre><code>events = sorted(sorted(events), key = lambda x: x[1]-x[0]) </code></pre> <p>Since Python's sort is a stable algorithm, first sorting normally ensures <code>[[1,2], [1,2], [3,4]]</code> will stay in that order, and then you can sort by distan...
how to sort an array with a specific logic
python|arrays|sorting|logic
-2
66
2
72,321,123
72,321,123
2
true
2022-05-20T14:58:26.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to sort an array with a specific logic<p>I wish to sort the following array in such way that the 'distance' between the events are the largest.</p> <p>ex...
72,241,906
Python list slicing not working correctly<p>I have recently started learning python. After learning list slicing, I thought of trying it out. But when I am using <strong>-1</strong>, it's returning an empty list</p> <pre><code>numbers = [2, 3, 9, 5, 6, 0, 1] # Slicing a list print(numbers[1:5:-1]) </code></pre> <p>give...
<p>If you specify indices so that the start comes after the end, you always get an empty slice:</p> <pre><code>&gt;&gt;&gt; numbers = [2, 3, 9, 5, 6, 0, 1] &gt;&gt;&gt; numbers[5:1] [] </code></pre> <p>Putting <code>-1</code> on the end reverses the slice, so you need to reverse the indices as well if you're doing it a...
Python list slicing not working correctly
python
0
66
1
72,241,925
72,241,925
3
true
2022-05-14T15:59:26.430Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python list slicing not working correctly<p>I have recently started learning python. After learning list slicing, I thought of trying it out. But when I am u...
72,262,708
Random numbers once a time<p>i want to random numbers only at once. i searched to get this and learned there is shuffle function. it is ok but i wonder what is wrong here. this code doesn't work it generates same numbers.</p> <pre><code>public class panel { boolean[] generated = new boolean[5]; int[] grid = new...
<p>When you recurse, you calculate a new r which is returned .ok.<br /> But you don't use it within the caller.<br /> So you always return the r of the very first step.<br /> Try</p> <pre><code>if (generated[r]) r = generaterandom(); return r; </code></pre>
Random numbers once a time
java
0
66
1
72,262,948
72,262,948
3
true
2022-05-16T16:41:24.353Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Random numbers once a time<p>i want to random numbers only at once. i searched to get this and learned there is shuffle function. it is ok but i wonder what ...
72,316,753
Find strings only optionally containing a specific char at the end<p>I want to find strings that have no <code>。</code> char in them, with an optional occurrence of this character at the end of the string.</p> <p>I search some tips, like that, but didn't solve my problem.</p> <pre><code>^(?!\.)(?!.*\.$)(?!.*\.\.)[a-zA-...
<p>You can use</p> <pre class="lang-py prettyprint-override"><code>import re str_l = [&quot;aaa。bbb。&quot;,&quot;aaa。&quot;,&quot;aaa&quot;] for str1 in str_l: print(str1, '=&gt;', bool(re.search(r'^[^。]*。?$', str1))) </code></pre> <p>Output:</p> <pre class="lang-none prettyprint-override"><code># =&gt; aaa。bbb。 =&g...
Find strings only optionally containing a specific char at the end
python|python-3.x|regex
2
66
3
72,317,142
72,317,142
3
true
2022-05-20T09:40:18.323Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find strings only optionally containing a specific char at the end<p>I want to find strings that have no <code>。</code> char in them, with an optional occurr...
72,332,949
How to make functions behave differently for different templates in C++?<p>A part of my C++ homework is to make the FooClass for this main:</p> <pre><code>int main() { const int max = 10; int x[] = {10, 20, 7, 9, 21, 11, 54, 91, 0, 1}; FooClass&lt;int&gt; xl(x, max); int x2[] = {10, 20, 7, 9, 21, 11, ...
<p>First of all, you are not using <code>F</code>. You need to pass an instance of <code>F</code> to <code>std::sort</code>:</p> <pre class="lang-cpp prettyprint-override"><code>void sort() { std::sort(mItems, mItems + mItemsSize, F{}); } </code></pre> <p>Secondly: Your default <code>F</code> would make both your i...
How to make functions behave differently for different templates in C++?
c++|sorting|templates
1
66
1
72,333,039
72,333,039
3
true
2022-05-21T20:19:34.160Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make functions behave differently for different templates in C++?<p>A part of my C++ homework is to make the FooClass for this main:</p> <pre><code>in...
72,341,969
How do I make my script stop and start again in the same line?<p>So basically I am running a script in Python that executes other 5 .py scripts as well, just like this:</p> <pre><code>exec(open('statcprs.py').read()) exec(open('dragndownf.py').read()) exec(open('lowprbubble.py').read()) exec(open('wshearstr.py').read()...
<p>The following will execute a list of python scripts in the same folder as the driver script:</p> <pre><code>import os from pathlib import Path import subprocess import sys scripts = [ 'statcprs.py', 'dragndownf.py', 'lowprbubble.py', 'wshearstr.py', 'slices.py', ] parent = Path(__file__).resolv...
How do I make my script stop and start again in the same line?
python
0
66
1
72,342,087
72,342,087
3
true
2022-05-22T23:34:38.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I make my script stop and start again in the same line?<p>So basically I am running a script in Python that executes other 5 .py scripts as well, just...
72,390,838
How do I remove '##' symbol that appears in Rmarkdown while printing console output?<p>Is there any nicer way to display console output without '##' symbol in pdf generated by Rmarkdown</p> <p>I have tried searching around here and googling for a solution, but I haven't found anything that solves my problem.</p>
<p>In a code chunk at the top of your document, you can write e.g.</p> <pre class="lang-r prettyprint-override"><code> knitr::opts_chunk$set(comment = &quot;&quot;) </code></pre> <p>The default is <code>comment = &quot;##&quot;</code>.</p>
How do I remove '##' symbol that appears in Rmarkdown while printing console output?
r|r-markdown
1
66
2
72,391,273
72,391,273
3
true
2022-05-26T11:07:39.713Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I remove '##' symbol that appears in Rmarkdown while printing console output?<p>Is there any nicer way to display console output without '##' symbol i...
72,299,978
How can I reduce the final image size when rendering image in Nodejs using FabricJs object?<p>Is there any way I can reduce my final image size?</p> <p>Currently, the image size is around 250-350kb.</p> <p>I'm planning to bring it to around 50-100 kb.</p> <p>Is it possible?</p> <p>My Code in Nodejs</p> <pre><code>app.g...
<p>PNG uses a lossless compression and hence it will always retain its size, unless you resize it. For the same resolution you could use JPEG which uses lossy compression and you can specify it's <code>quality</code> parameter, which would affect the size.</p> <pre><code>res.writeHead(200, { 'Content-Type': 'image/jpeg...
How can I reduce the final image size when rendering image in Nodejs using FabricJs object?
node.js|fabricjs|image-compression
0
66
1
72,349,701
72,349,701
3
true
2022-05-19T07:00:43.343Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I reduce the final image size when rendering image in Nodejs using FabricJs object?<p>Is there any way I can reduce my final image size?</p> <p>Curre...
72,326,128
Best Practice for Route Architecture<p>I'm trying to set up routes for my backend. I have two ways that I've tried setting these routes up, and I'm wondering which way fits best practices (or neither?). The differences are minimal, but I'd love to know if there is an objective &quot;best&quot; here.</p> <p>Here are my ...
<p>If you believe that the job of a router is to just handle some requests that it receives and it is the job of the calling code to place the router at whatever path the calling code wants it to operate on, then only your first option will do that. This would allow a caller to use these routes in whatever path it wan...
Best Practice for Route Architecture
javascript|express|routes|backend
-1
66
1
72,326,289
72,326,289
3
true
2022-05-21T01:57:54.127Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best Practice for Route Architecture<p>I'm trying to set up routes for my backend. I have two ways that I've tried setting these routes up, and I'm wondering...
72,334,463
Overloading AsRef<T> by using it to unwrap enums in Rust?<p>I'm using <code>AsRef&lt;T&gt;</code> and <code>AsMut&lt;T&gt;</code> to expose an wrapped value in an enum. Can anyone tell me if this is an anti-pattern? I came across <a href="https://stackoverflow.com/questions/45086595/is-it-considered-a-bad-practice-to-i...
<p>I strongly suggest you do not do this, especially considering the docs for <code>AsRef</code> and <code>AsMut</code> say in bold:</p> <blockquote> <p><strong>Note: This trait must not fail.</strong></p> </blockquote> <p>and I would definitely consider panicking to be failure. This isn't an anti-pattern so much as it...
Overloading AsRef<T> by using it to unwrap enums in Rust?
rust
0
66
1
72,334,601
72,334,601
4
true
2022-05-22T02:47:25.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Overloading AsRef<T> by using it to unwrap enums in Rust?<p>I'm using <code>AsRef&lt;T&gt;</code> and <code>AsMut&lt;T&gt;</code> to expose an wrapped value ...
72,293,988
date difference in millis to localdatetime<p>I need to print date again after i calculated difference between two dates.</p> <p>here is what I tried:</p> <pre><code> fun getRemainingTime(endTime: ZonedDateTime): Long { val currentTime = ZonedDateTime.now(ZoneId.systemDefault()) return dateUtils.duratio...
<p><code>java.time.LocalDateTime</code> was not created to represent a difference between two dates. There are <code>java.time.Period</code> and <code>java.time.Duration</code> that should be used for it (<a href="https://docs.oracle.com/javase/tutorial/datetime/iso/period.html" rel="nofollow noreferrer">see Oracle doc...
date difference in millis to localdatetime
java|android
1
66
1
72,296,313
72,296,313
4
true
2022-05-18T18:04:39.187Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: date difference in millis to localdatetime<p>I need to print date again after i calculated difference between two dates.</p> <p>here is what I tried:</p> <pr...
72,304,249
Match first and then all equal occurrences with regex<p>Lets say we have the string:</p> <blockquote> <p>one day, when Anne, Lisa and Paul went to the store, then Anne said to Paul: &quot;I love Lisa!&quot;. Then Lisa laughed and kissed Anne.</p> </blockquote> <p><strong>is there a way with regex to match the first nam...
<p>The only way I could think of is with non-fixed width lookbehinds. For example through Pypi's regex module, and maybe Javascript too? Either way, assuming a name is capture through <code>[A-Z][a-z]+</code> as per your question try:</p> <pre><code>\b([A-Z][a-z]+)\b(?&lt;=^[^A-Z]*\b\1\b.*) </code></pre> <p>See an onli...
Match first and then all equal occurrences with regex
regex
-1
66
1
72,304,981
72,304,981
4
true
2022-05-19T12:06:28.373Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Match first and then all equal occurrences with regex<p>Lets say we have the string:</p> <blockquote> <p>one day, when Anne, Lisa and Paul went to the store,...
72,368,476
Memory efficient alternative to str.replace()<p>I have a csv file with 200k rows and about 40 columns. Specific column contains special character '|' that i want to replace with '_'. However while doing str.replace and then .append i encounter OOM error on my 16GB RAM, there must be a more efficient way.</p> <p>My code...
<p>Don't convert to a list and loop, do the replacement directly in the dataframe.</p> <pre><code>data['category'] = data['category'].str.replace('|', '_', regex=False) </code></pre>
Memory efficient alternative to str.replace()
python|pandas|out-of-memory
0
66
1
72,368,508
72,368,508
5
true
2022-05-24T19:28:49.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Memory efficient alternative to str.replace()<p>I have a csv file with 200k rows and about 40 columns. Specific column contains special character '|' that i ...
72,283,549
What is a properly way to iterate a char* string? Getting "corrupt" values<p>When I was trying to iterate a number (transformed to binary with bitset library) I managed this solution</p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt; #include &lt;bitset&gt; void iterateBinary(int num) { ...
<p>The lifetime of the string returned by <code>to_string()</code>, and into which the pointer returned by <code>c_str()</code> points, ends at the end of the full expression.</p> <p>This means after the line</p> <pre><code>char *numInBinary = const_cast&lt;char*&gt;(std::bitset&lt;32&gt;(num).to_string().c_str()); </c...
What is a properly way to iterate a char* string? Getting "corrupt" values
c++|string|char|iteration|string-iteration
1
66
1
72,283,643
72,283,643
6
true
2022-05-18T05:19:11.470Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is a properly way to iterate a char* string? Getting "corrupt" values<p>When I was trying to iterate a number (transformed to binary with bitset library...
72,776,099
Extjs iframe - Embedding content from another page into an extjs application<p>I am new to working with iframes in extjs. I am looking to embed content from another page (another URL) into an existing extjs application. Is extjs iframe the correct way to go about it? if so, how do I render the component ? Any suggestio...
<p>1.You can create a Extjs js class like above and to render this component,you need to create and use it's instance like below code.</p> <pre><code>Ext.define('Iframe', { extend: 'Ext.panel.Panel', xtype: 'sample', initComponent: function(){ this.items = [{ xtype: 'box', ...
Extjs iframe - Embedding content from another page into an extjs application
iframe|extjs|extjs4|extjs4.1|extjs4.2
0
66
1
72,776,894
72,776,894
1
true
2022-06-27T17:22:53.523Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extjs iframe - Embedding content from another page into an extjs application<p>I am new to working with iframes in extjs. I am looking to embed content from ...
72,815,471
React native Undefined is not a function (near '...data.map...')<p>I'm making my first mobile application in React, where I have a map with rendered markers. Now I want the marker data to come from data I fetched from an Api. I want to write my own but to do a quick test I found one that has a lot of adresses in the Ne...
<p>Your response returns an object instead of an array. The array which you want is placed within <strong>results.details</strong>. So in your code, after data is fetched it becomes an object and the map function won't work on that type of variable.</p> <p>Just change:</p> <pre><code> fetch('http://api.postcodedata....
React native Undefined is not a function (near '...data.map...')
javascript|reactjs|react-native
0
66
1
72,815,775
72,815,775
1
true
2022-06-30T12:02:27.693Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React native Undefined is not a function (near '...data.map...')<p>I'm making my first mobile application in React, where I have a map with rendered markers....
72,890,702
How to conditionally shade a datetime span<p>I want to shade the background of my plot for regions where one column values are negative. Is there a way to do this using axvspan by setting conditions?</p> <pre class="lang-py prettyprint-override"><code>df = pd.DataFrame({'date': [&quot;2014-10-04&quot;,&quot;2014-10-05&...
<ul> <li>Plot the dataframe directly with <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.plot.html" rel="nofollow noreferrer"><code>pandas.DataFrame.plot</code></a>, which uses <code>matplotlib</code> as the default plotting backend.</li> <li>Use <a href="https://pandas.pydata.org/docs/reference...
How to conditionally shade a datetime span
python|pandas|matplotlib|data-visualization
1
66
1
72,891,204
72,891,204
1
true
2022-07-06T23:02:56.620Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to conditionally shade a datetime span<p>I want to shade the background of my plot for regions where one column values are negative. Is there a way to do...
72,859,939
Calculating product of numbers using do while<p>I'm new to coding and trying my best but I got stuck. Again. So. I need to calculate the product of some random numbers using do while. You type the numbers and when you type x, the loop needs to close showing the result. If you ONLY type x, it needs to show &quot;1&quot;...
<p><code>for</code> and <code>while</code> breaks in the start of the loops and <code>do while</code> break at the end, sometimes you have to break it the middle (here after the input was entered, if it's <code>x</code>) and before the accumulation.</p> <p>The best way to manage this is an infinite loop <code>for(;;)</...
Calculating product of numbers using do while
c#|loops|product|do-while
0
66
5
72,860,085
72,860,085
1
true
2022-07-04T16:54:21.290Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculating product of numbers using do while<p>I'm new to coding and trying my best but I got stuck. Again. So. I need to calculate the product of some rand...
72,892,468
Format time zone to Vi Locale use Moment in React-Native<p>i am having a date problem when using Moment in React-Native. Specifically, after I formatted the date to en locale, but now I want it to support the locale in my country is vi locale as well:</p> <pre><code>Moment('2022-09-02T02:00:00+00:00') .local() ...
<p>not same as you want but problem is you have to import <code>localization</code> also.</p> <pre><code>import moment from &quot;moment&quot;; import vi from &quot;moment/locale/vi&quot;; import fr from &quot;moment/locale/fr&quot;; const newVi = moment(&quot;2022-09-03T02:00:00+00:00&quot;).locale(&quot;vi&quot;, vi...
Format time zone to Vi Locale use Moment in React-Native
javascript|android|ios|reactjs|react-native
0
66
1
72,892,747
72,892,747
1
true
2022-07-07T04:56:59.117Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Format time zone to Vi Locale use Moment in React-Native<p>i am having a date problem when using Moment in React-Native. Specifically, after I formatted the ...
72,941,256
How to show icons conditionally?<p>I am trying to implement a small logic, where depending on the API property should be rendered different icons.</p> <p>The API sends 3 types of media_type:</p> <ul> <li>image</li> <li>video</li> <li>album</li> </ul> <p>I just want to display different icons based on those 3 types.</p>...
<p>In Angular you could also have the same implementation. I will mention 3 methods below:</p> <h2>Method 1:</h2> <pre class="lang-html prettyprint-override"><code>&lt;mat-icon *ngIf=&quot;data.media_type==='image'&quot;&gt;image&lt;/mat-icon&gt; &lt;mat-icon *ngIf=&quot;data.media_type==='video'&quot;&gt;movie&lt;/mat...
How to show icons conditionally?
angular
1
66
1
72,948,259
72,948,259
1
true
2022-07-11T15:49:19.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to show icons conditionally?<p>I am trying to implement a small logic, where depending on the API property should be rendered different icons.</p> <p>The...
72,997,646
Creating an extension method for a generic type interface<p>I want to restrict my extension method but I couldn't figure out how to do it.</p> <ol> <li>No control can find my extension method.</li> <li>Any control can find my extension method. But I don't want it to be found by those who don't have the <code>IMyProp</c...
<p>I'm not 100% sure what you want to achieve. My guess is that you would like to reuse some code and only expose the functionality to instances that have the type in the <code>this</code> parameter of the extension. This is what I cooked up:</p> <pre><code>namespace ConsoleApp4 { public static class Extensions ...
Creating an extension method for a generic type interface
c#|interface|extension-methods
0
66
2
72,998,249
72,998,249
1
true
2022-07-15T17:21:02.143Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating an extension method for a generic type interface<p>I want to restrict my extension method but I couldn't figure out how to do it.</p> <ol> <li>No co...
72,901,807
Add permission to group (or find where is the problem)<p>I have this message:</p> <blockquote> <p>The requested operation can not be completed due to security restrictions. Document type: Employee (hr.employee) Operation: read User: 23 Fields: - contract_id (allowed for groups 'Employees / Officer')</p> </blockquote> <...
<p>Odoo is nice for once and is telling you which field on which model is restricted. So in this case you should look into the field definition and will <a href="https://github.com/odoo/odoo/blob/dd64fc7730ef34d715cfb2146a7ef8a7ba98f34e/addons/hr_contract/models/hr_employee.py#L14-L16" rel="nofollow noreferrer">find</a...
Add permission to group (or find where is the problem)
odoo|odoo-15
0
66
1
72,902,253
72,902,253
1
true
2022-07-07T17:06:49.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add permission to group (or find where is the problem)<p>I have this message:</p> <blockquote> <p>The requested operation can not be completed due to securit...
72,780,042
How to add a column with minimum as values to a pivot table?<p>I need to get the min values(<code>rank</code>) for each row and create a new column for it, in a specific location in a data frame.</p> <pre class="lang-py prettyprint-override"><code>values_from_api_call = [ { &quot;rank&quot;: 5, &quo...
<p>If I'm not mistaken, margins creates a grand total column, not the minimum you expect.</p> <p>Here is one way to do it:</p> <pre class="lang-py prettyprint-override"><code>df = ( pd.DataFrame(values_from_api_call) .drop_duplicates(subset=[&quot;asin&quot;, &quot;keyword&quot;], keep=&quot;first&quot;) .f...
How to add a column with minimum as values to a pivot table?
python|pandas
1
66
1
72,848,344
72,848,344
1
true
2022-06-28T02:13:41.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add a column with minimum as values to a pivot table?<p>I need to get the min values(<code>rank</code>) for each row and create a new column for it, i...
72,930,160
What mistake am I making while memoizing this solution for Leetcode problem jump game 4<p>So the question is You are given a 0-indexed integer array nums and an integer k.</p> <p>You are initially standing at index 0. In one move, you can jump at most k steps forward without going outside the boundaries of the array. T...
<p>You only need to memoize dp[index] instead of calling f(index, currSum).</p> <p>Take for example present arr.length = 5, k = 2 For index-2 you need wether index 3 or 4 gives better points to you irrespective of your present point. Better way would be :</p> <pre><code>class Solution { static int[] dp; static...
What mistake am I making while memoizing this solution for Leetcode problem jump game 4
java|algorithm|recursion
1
66
1
72,930,440
72,930,440
1
true
2022-07-10T16:37:14.733Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What mistake am I making while memoizing this solution for Leetcode problem jump game 4<p>So the question is You are given a 0-indexed integer array nums and...
72,975,382
ASP.NET Core 6 routing in Azure App Service with ".dd" ending in the url<p>I have an ASP.NET Core 6 Web API that has a simple endpoint <code>/resources/{id}</code> where <code>id</code> is a string. Everything worked as expected in local development. We then deployed it to a standard Azure App Service.</p> <p>We got a ...
<p><strong>UPDATE</strong></p> <p>We can <a href="https://stackoverflow.com/a/53731666/7687666">create a <code>web.config</code> manually</a>, and copy the content from azure and paste it.</p> <p>Every time when you deploy it, it will include this web.config file.</p> <p><strong>Like:</strong></p> <p><a href="https://i...
ASP.NET Core 6 routing in Azure App Service with ".dd" ending in the url
asp.net-core|azure-web-app-service
1
66
1
72,988,428
72,988,428
1
true
2022-07-14T04:55:43.990Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ASP.NET Core 6 routing in Azure App Service with ".dd" ending in the url<p>I have an ASP.NET Core 6 Web API that has a simple endpoint <code>/resources/{id}<...
72,787,286
Executable.hasRealParameterData() and Parameter.isNamePresent() don't work as expected<p>This question is kind of continuation of one previously asked in <a href="https://stackoverflow.com/questions/939194/preserving-parameter-argument-names-in-compiled-java-classes">Preserving parameter/argument names in compiled java...
<p>As it was pointed out by <a href="https://mail.openjdk.org/pipermail/core-libs-dev/2022-June/092008.html" rel="nofollow noreferrer">Daniel Fuchs</a> we need to compile the code with <code>-parameters</code> flag.</p> <p><a href="https://docs.oracle.com/en/java/javase/18/docs/specs/man/javac.html" rel="nofollow noref...
Executable.hasRealParameterData() and Parameter.isNamePresent() don't work as expected
java|reflection
1
66
1
72,813,061
72,813,061
1
true
2022-06-28T13:26:27.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Executable.hasRealParameterData() and Parameter.isNamePresent() don't work as expected<p>This question is kind of continuation of one previously asked in <a ...
72,855,035
Add new liste to an existant dictionary with multiple liste value<p>i need to project a query to rack servers in tables format, but my problem is how to add empty unit values between used units. this is my code:</p> <pre><code>import io import pandas as pd query = '''servers1 - 15 - 17 server2 - 20 - 25 firewall - 2 -...
<p>I'm not sure if I understood your requirements correctly.<br /> The following example lists all occupied and vacant positions in order.<br /> The data is read line by line and added to a list as a tuple. Sorting can then be carried out using the start indices so that all assignments are available in sequence and can...
Add new liste to an existant dictionary with multiple liste value
python|dataframe|dictionary|flask
-2
66
1
72,862,072
72,862,072
1
true
2022-07-04T10:07:58.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add new liste to an existant dictionary with multiple liste value<p>i need to project a query to rack servers in tables format, but my problem is how to add ...
72,836,949
Error: unexpected '}' in " }" and I don't know what to do<pre><code> C &lt;- rep(c('F','M'), each = 3, times = 4) Gender &lt;- NULL for (i in C) { if i == 'F'{ append(Gender,values = 'Female') } else { append(Gender, values = 'Male') } } </code></pre> <p>and it shows Error: unexpected '}' in &quot; }...
<p>The error comes from <code>if i == 'F'</code></p> <pre class="lang-r prettyprint-override"><code>C &lt;- rep(c('F','M'), each = 3, times = 4) Gender &lt;- NULL for (i in C) { if (i == 'F'){ # The condition has to be wrapped by () Gender &lt;- append(Gender,values = 'Female') # Reassign to Gender } else { # ...
Error: unexpected '}' in " }" and I don't know what to do
r
0
66
1
72,837,109
72,837,109
1
true
2022-07-02T06:29:23.657Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error: unexpected '}' in " }" and I don't know what to do<pre><code> C &lt;- rep(c('F','M'), each = 3, times = 4) Gender &lt;- NULL for (i in C) { if i ...
72,907,385
How to access previous stage results in CompletableFuture<p>I am trying to chain tasks in CompletableFuture to execute them in parallel and get the best performance and resource utilization.</p> <p>The workflow I am writing has five stages and each stage depends on the result of the previous stages.</p> <p>The workflow...
<p>Use <code>thenCompose</code> to compose the results from different futures which depend on each other:</p> <pre><code>CompletableFuture&lt;String&gt; result = CompletableFuture.supplyAsync(() -&gt; &quot;result 1&quot;) .thenCompose(result1 -&gt; CompletableFuture.supplyAsync(result1::length) ...
How to access previous stage results in CompletableFuture
java|future|completable-future
2
66
1
72,909,025
72,909,025
1
true
2022-07-08T06:19:27.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access previous stage results in CompletableFuture<p>I am trying to chain tasks in CompletableFuture to execute them in parallel and get the best perf...
72,839,133
how to pass the value to the viewModel from a multiple list<p>I have two model list and master model. I need to access and store value to the model properties. not sure how to do this using a viewModel? previously I was using viewData list and now I wan to test viewModel.</p> <p><div class="snippet" data-lang="js" dat...
<pre><code> public class Master { public List&lt;Table1&gt; T1 { get; set; } public List&lt;Table2&gt; T2 { get; set; } } public class Table1 { public string sample1 { get; set; } public string sample2 { get; set; } } public class Table2 { public string sample1 { get; set; } public string sample2 { g...
how to pass the value to the viewModel from a multiple list
asp.net|asp.net-mvc|asp.net-core
0
66
1
72,839,680
72,839,680
1
true
2022-07-02T12:41:21.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to pass the value to the viewModel from a multiple list<p>I have two model list and master model. I need to access and store value to the model propertie...
72,777,147
Precedence of Azure AppService settings?<p>My .NET Core 6 app service has the following setup inside <code>Program.cs</code>:</p> <pre><code>var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllersWithViews(); //builder.Services.AddSingleton... ETC... var app = builder.Build(); </code></pre> <p...
<p><a href="https://docs.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal#configure-app-settings" rel="nofollow noreferrer">App Settings get injected as Environment Variables</a>. So I would assume they fall into position 2 of your list.</p>
Precedence of Azure AppService settings?
c#|azure|.net-core|azure-web-app-service
2
66
1
72,777,412
72,777,412
2
true
2022-06-27T19:00:36.750Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Precedence of Azure AppService settings?<p>My .NET Core 6 app service has the following setup inside <code>Program.cs</code>:</p> <pre><code>var builder = We...
72,786,220
Load multiple config Files<p>product1.conf</p> <pre><code>data { key1 { some-field = &quot;some-value&quot; product1 { path = ${some-path} } } } </code></pre> <p>product2.conf</p> <pre><code>data { key1 { some-field = &quot;some-value&quot; ...
<p>Assuming that the conf files are statically knowable, you can have an <code>application.conf</code> like this</p> <pre><code>include &quot;product1&quot; include &quot;product2&quot; </code></pre> <p>which will effectively merge the two configurations.</p>
Load multiple config Files
scala|typesafe-config
0
66
1
72,790,984
72,790,984
2
true
2022-06-28T12:12:57.987Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Load multiple config Files<p>product1.conf</p> <pre><code>data { key1 { some-field = &quot;some-value&quot; product1 { pa...
72,805,259
Computing mean and variance over time per group<p>I have a data frame with 1,000,000 rows. I would like to calculate mean and variance of <code>Tor</code> overtime for each <code>SID</code> to see if I can predict when <code>Tor</code> is starting to go out of limits. The Low limit is 0.4 and the high limit is 0.7. Bel...
<p>This is a very good question. You want to compute <strong>cumulative mean</strong> and <strong>cumulative variance</strong> of <code>Tor</code> (over time) per <code>SID</code>. Given the volume of your actual dataset, it is appropriate to use <strong>online algorithms</strong>. See <a href="https://stackoverflow.co...
Computing mean and variance over time per group
r|statistics|mean|variance
1
66
1
72,806,107
72,806,107
2
true
2022-06-29T17:01:28.617Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Computing mean and variance over time per group<p>I have a data frame with 1,000,000 rows. I would like to calculate mean and variance of <code>Tor</code> ov...
72,803,973
How can I draw a horizontal reference line in chart.js?<p>I want to draw a horizontal reference line at a particular value.</p> <p><a href="https://i.stack.imgur.com/FHaiH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FHaiH.png" alt="enter image description here" /></a></p> <p>The data is of the fo...
<p>You can use the <a href="https://www.chartjs.org/chartjs-plugin-annotation/latest/" rel="nofollow noreferrer">annotation plugin</a> for this:</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...
How can I draw a horizontal reference line in chart.js?
charts|chart.js|chart.js2|chart.js3
1
66
1
72,806,205
72,806,205
2
true
2022-06-29T15:22:16.610Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I draw a horizontal reference line in chart.js?<p>I want to draw a horizontal reference line at a particular value.</p> <p><a href="https://i.stack.i...
72,819,245
How to call a Groovy Closure with an Object Array<p>I may be misunderstanding how to use varargs, but according to the <a href="https://docs.groovy-lang.org/latest/html/api/groovy/lang/Closure.html#call(java.lang.Object...)" rel="nofollow noreferrer">Groovy Docs for Closures</a>, for the function <code>public V call(Ob...
<p>You can use the spread operator:</p> <pre><code> myClosure.call(*args) </code></pre>
How to call a Groovy Closure with an Object Array
groovy
0
66
1
72,819,308
72,819,308
2
true
2022-06-30T16:37:38.030Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to call a Groovy Closure with an Object Array<p>I may be misunderstanding how to use varargs, but according to the <a href="https://docs.groovy-lang.org/...
72,818,589
xml to dataframe error because of duplicate subscripts for columns<p>I am just trying to create a xml file into a dataframe. My file is big and probably because of that i am getting an error when I try to do it. The error is the followingL: Error in <code>[&lt;-.data.frame</code>(<code>*tmp*</code>, i, names(nodes[[i]]...
<p>This is an answer to the comment by OP: how to access specific nodes in an XML document.</p> <p>I prefer the <code>xml2</code> library over the <code>XML</code> library. The <a href="https://rdrr.io/cran/xml2/f/vignettes/releases/xml2-1.1.1.Rmd" rel="nofollow noreferrer">xml2 vignettes</a> are recommended reading / ...
xml to dataframe error because of duplicate subscripts for columns
r
0
66
1
72,820,132
72,820,132
2
true
2022-06-30T15:42:57.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: xml to dataframe error because of duplicate subscripts for columns<p>I am just trying to create a xml file into a dataframe. My file is big and probably beca...
72,820,226
FileSystemWatcher is not working with dotnet Background Workers<p>I am trying to create a windows service to watch the file changes in a specific directory. I am using dotnet core 6 and a <code>BackgroundService</code>.</p> <p>I created a separate class named <code>FileMonitor</code> in which I simply paste the Microso...
<pre><code>using var watcher = new FileSystemWatcher(folder); </code></pre> <p>That <code>using</code> right there will dispose of the watcher at the end of that function, so as soon as it sets up the events. They will never get called.</p> <p>You need to keep the objects alive and rooted for their entire lifetime. Loo...
FileSystemWatcher is not working with dotnet Background Workers
c#|.net|.net-core
-2
66
2
72,820,392
72,820,392
2
true
2022-06-30T18:05:00.853Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: FileSystemWatcher is not working with dotnet Background Workers<p>I am trying to create a windows service to watch the file changes in a specific directory. ...
72,837,945
String tokenizer method<p>Consider strings with this format:</p> <pre><code>id-string1-string2-string3.extension </code></pre> <p>where id, string1, string2 and string3 can be string of variable length, and extension is an image extension type.</p> <p>For example, two possible strings could be:</p> <pre><code>Il2dK-Ud2...
<p>You can achieve this using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split" rel="nofollow noreferrer"><code>spit</code></a> as:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre c...
String tokenizer method
javascript|node.js|regex|tokenize
1
66
3
72,837,994
72,837,994
2
true
2022-07-02T09:25:08.940Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: String tokenizer method<p>Consider strings with this format:</p> <pre><code>id-string1-string2-string3.extension </code></pre> <p>where id, string1, string2 ...
72,838,017
multiple shared_ptr that point to the same object<p>Just for studying purpose I'm coding binary search tree rotation now. I normally use <code>std::unique_ptr</code> but I used <code>std::shared_ptr</code> this time</p> <p>This works correctly:</p> <pre><code>// Node implementation template &lt;Containable T = int&gt; ...
<pre><code>void left_rotate(Node *xp, Node* x) { ... std::shared_ptr&lt;Node&gt; x_ptr(x); ... </code></pre> <p>When you create the <code>shared_ptr</code> it takes over ownership of <code>x</code>. The problem here is that it is not yours to give. Someone else, another <code>shared_ptr</code>, already has ...
multiple shared_ptr that point to the same object
c++|smart-pointers
0
66
1
72,839,302
72,839,302
2
true
2022-07-02T09:35:41.843Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: multiple shared_ptr that point to the same object<p>Just for studying purpose I'm coding binary search tree rotation now. I normally use <code>std::unique_pt...
72,841,794
React SetState not adding new objects to array of objects<p>This code is supposed to add new tasks to the state and keep the previous objects, past posts on this have lead to the same issue that it just wont be added.</p> <pre><code>function App() { var [tasks, setTasks] = useState([ { id: uui...
<p>React <code>setState</code> hook is executed asynchronously so after updating, you cannot access the updated state in that function. if you want to access to updated tasks, you can use <code>useEffect</code> hook:</p> <pre><code>const newTask = (text) =&gt; { const id = uuidv4(); var specify = 'todo' con...
React SetState not adding new objects to array of objects
javascript|reactjs
1
66
2
72,842,225
72,842,225
2
true
2022-07-02T19:09:03.823Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React SetState not adding new objects to array of objects<p>This code is supposed to add new tasks to the state and keep the previous objects, past posts on ...
72,854,764
C++ OpenSSL RSA encryption ignores non printable characters<p>C++ ignores non printable bytes when trying to encode a byte array. The encoded result only contains the printable characters.</p> <p>eg.: bytearray {0x41, 0x42, 0x43, 0x00, 0x01, 0x02, 0x03} would encrypt, and when decrypted (in c++ or c#), resulting bytes ...
<p>Here is your program in godbolt: <a href="https://godbolt.org/z/E6T1x8jT8" rel="nofollow noreferrer">https://godbolt.org/z/E6T1x8jT8</a></p> <p>Notice:</p> <pre><code>Decrypted Text =ABC Decrypted Length =7 </code></pre> <p>This is because I changed:</p> <p><code> int encrypted_length = public_encrypt((unsigned ch...
C++ OpenSSL RSA encryption ignores non printable characters
c++|openssl
2
66
2
72,855,103
72,855,103
2
true
2022-07-04T09:46:57.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C++ OpenSSL RSA encryption ignores non printable characters<p>C++ ignores non printable bytes when trying to encode a byte array. The encoded result only con...
72,854,390
Can I use single s3-sink connector to point same field name for the timeStamp field by using different type of Avro Schema's for different topics?<p>schema for topic t1</p> <pre><code>{ &quot;type&quot;: &quot;record&quot;, &quot;name&quot;: &quot;Envelope&quot;, &quot;namespace&quot;: &quot;t1&quot;, &quot;fie...
<p>All topics will need the same timestamp field; there's no way to configure topic-to-field mappings.</p> <p>Your t2 schema doesn't have an <code>after</code> field, so you need to run two separate connectors</p> <p>The field is also required to be present in all records, otherwise the partitioner won't work.</p>
Can I use single s3-sink connector to point same field name for the timeStamp field by using different type of Avro Schema's for different topics?
apache-kafka|apache-kafka-connect|confluent-platform|s3-kafka-connector
1
66
1
72,859,796
72,859,796
2
true
2022-07-04T09:16:38.437Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I use single s3-sink connector to point same field name for the timeStamp field by using different type of Avro Schema's for different topics?<p>schema f...
72,850,033
Creating a Promise<p>Inside a Node controller method I have this code block that I would like to <code>await</code> for before continuing with the code that comes next. How can I do this?</p> <p>I thought this should be done with a Promise (the only one in that controller method) and have tried the code below. But this...
<p>I'm going to break this down in reverse order.</p> <p>First, <code>Promise.all()</code> is for waiting for multiple promises, so instead of:</p> <pre><code>await Promise.all(other); </code></pre> <p>You can just do</p> <pre><code>await other; </code></pre> <p>The second issue is that you should usually avoid <code>n...
Creating a Promise
javascript|node.js|promise
0
66
2
72,859,853
72,859,853
2
true
2022-07-03T21:27:22.830Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating a Promise<p>Inside a Node controller method I have this code block that I would like to <code>await</code> for before continuing with the code that ...