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,050 | how can I parse a multidimensional array into UITableview with sections<p>I have a remote db call delivering a list of items that looks something like this</p>
<pre><code>{
"result":[
{
"Section":"Client",
"result":[
{
"O... | <p>Several issues here:</p>
<ul>
<li><p>Your structs are wrong it should be:</p>
<pre><code>// MARK: - Response
struct Response: Codable {
let result: [ResponseResult]
}
// MARK: - ResponseResult
struct ResponseResult: Codable {
let section: String
let result: [Result]
enum CodingKeys:... | how can I parse a multidimensional array into UITableview with sections | swift|uitableview|uikit | 0 | 74 | 2 | 72,890,032 | 72,890,032 | 1 | true | 2022-07-06T18:01:06.090Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how can I parse a multidimensional array into UITableview with sections<p>I have a remote db call delivering a list of items that looks something like this</... |
72,947,275 | Remove an element if it contains a specific word<p>I have a button that adds a specific word to a <code><li></code> in a <code><ul></code>.
There is also a button to have a <code><li></code> containing a specific word removed.</p>
<p>I really thought <code>includes()</code> or <code>match()</code> wou... | <p>First, you need <code>querySelectAll</code> to get all <code>li</code> elements, and you need to use <code>find</code> method to find the <code>li</code> which <code>includes</code> the text.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code... | Remove an element if it contains a specific word | javascript | 1 | 74 | 7 | 72,947,342 | 72,947,342 | 1 | true | 2022-07-12T05:07:45.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove an element if it contains a specific word<p>I have a button that adds a specific word to a <code><li></code> in a <code><ul></code>.
There... |
72,961,947 | When I update my VSCode to v1.56.2, I can't run Jupyter Notebook<p>When I update my VSCode to v1.56.2, I can't run Jupyter Notebook.</p>
<p>VScode doesn't show any code by .ipynb format but .py format is okay and I can see this Error:</p>
<blockquote>
<p>Error loading webview: Error: Could not register service workers:... | <p>In Windows, you can simply fix this error by clearing the cache for VSCode. Please follow the steps below:</p>
<ol>
<li><p>Close VSCode and also kill any background processes running in the task manager.</p>
</li>
<li><p>Go to the file explorer and to the path <code>C:\Users\<user_name>\AppData\Roaming\Code</c... | When I update my VSCode to v1.56.2, I can't run Jupyter Notebook | visual-studio-code | 0 | 74 | 1 | 72,962,004 | 72,962,004 | 1 | true | 2022-07-13T06:44:32.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When I update my VSCode to v1.56.2, I can't run Jupyter Notebook<p>When I update my VSCode to v1.56.2, I can't run Jupyter Notebook.</p>
<p>VScode doesn't sh... |
72,780,850 | protobuf validator command generates file in wrong path<p>I am trying to include request validation for grpc. I modified the protobuf command like this.
<code>pkg/test/test.proto</code> contains my schema.</p>
<p>If i run the below command :</p>
<pre><code>protoc --go_out=. \
--proto_path=${GOPATH}/src \
--proto_path=$... | <h1>Analysis</h1>
<p>It looks like the <code>*.validator.pb.go</code> files are generated in the wrong directory.</p>
<p>Using the <code>pkg/test/test.proto</code> file with the following content:</p>
<pre><code>syntax = "proto3";
option go_package = "github.com/example-user/example-repository";
s... | protobuf validator command generates file in wrong path | protocol-buffers|grpc-go|protobuf-go | 1 | 74 | 1 | 72,941,652 | 72,941,652 | 1 | true | 2022-06-28T04:47:10.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
protobuf validator command generates file in wrong path<p>I am trying to include request validation for grpc. I modified the protobuf command like this.
<cod... |
72,924,313 | Pinescript conditional line end/delete<p>I’m trying to create lines that auto plot at certain intervals using the line.new() function. So for example every new monthly open there will be lines plotted 5% and 10% above and beneath price. They’re then extended to the right indefinitely.</p>
<p>I then want to have the lin... | <p>You can use additional arrays to track the price values and their crossed state more easily. Each element of the arrays corresponds to the values associated with the same line. We add, remove or modify them based on whether a particular line's price value has been crossed or the line limit has been exceeded.</p>
<pr... | Pinescript conditional line end/delete | line|pine-script|pinescript-v5 | 0 | 74 | 1 | 72,927,832 | 72,927,832 | 1 | true | 2022-07-09T20:11:43.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pinescript conditional line end/delete<p>I’m trying to create lines that auto plot at certain intervals using the line.new() function. So for example every n... |
72,917,759 | How can I resolve this Flutter Navigator.push() error?<p>I am trying to move from one page to another via Navigator.push. Here is my code:</p>
<pre><code>import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
... | <blockquote>
<p><strong>EDIT</strong>: Duplicate of:
<a href="https://stackoverflow.com/questions/44004451/navigator-operation-requested-with-a-context-that-does-not-include-a-navigator">Navigator operation requested with a context that does not include a Navigator</a></p>
</blockquote>
<p>The problem is with the <code... | How can I resolve this Flutter Navigator.push() error? | flutter|dart | 0 | 74 | 2 | 72,917,796 | 72,917,796 | 1 | true | 2022-07-08T23:02:59.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I resolve this Flutter Navigator.push() error?<p>I am trying to move from one page to another via Navigator.push. Here is my code:</p>
<pre><code>imp... |
73,015,915 | `nohup` issue with submitting `SLURM` job<p>I have a python code <code>main.py</code> that runs bash script, the bash script inturn submits a job <code>job.bash</code> and obtains its <code>JOBID</code> using <code>echo $JOBID | awk {'print $4'}</code>. If I run python in the terminal, the bash script works and I am ab... | <p>If this problem only happens with <code>nohup</code> present, you can get the benefits of <code>nohup</code> without actually using it with:</p>
<pre><code>yourscript </dev/null >file.log 2>&1 & disown -h "$!"
</code></pre>
<p>This does the following:</p>
<ul>
<li>Redirects stdin from <cod... | `nohup` issue with submitting `SLURM` job | linux|bash|nohup | 3 | 74 | 1 | 73,029,027 | 73,029,027 | 1 | true | 2022-07-17T22:55:32.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
`nohup` issue with submitting `SLURM` job<p>I have a python code <code>main.py</code> that runs bash script, the bash script inturn submits a job <code>job.b... |
72,830,583 | I am learning Android studio and doing a rectangle calculator, my kotlin has 19 errors and cannot figure it out<p>I am learning Android studio and doing a rectangle calculator. My Kotlin has 19 errors, and I cannot figure it out. I keep getting unresolved errors for btn, functions that cannot be called, and expecting a... | <p>If you want to access the views from your XML file directly in your activity you should use Kotlin Android Extension. But this plugin is <a href="https://developer.android.com/topic/libraries/view-binding/migration" rel="nofollow noreferrer">deprecated</a>. You should migrate to <a href="https://developer.android.co... | I am learning Android studio and doing a rectangle calculator, my kotlin has 19 errors and cannot figure it out | android|android-studio|kotlin|calculator | 0 | 74 | 1 | 72,830,834 | 72,830,834 | 1 | true | 2022-07-01T14:12:59.640Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I am learning Android studio and doing a rectangle calculator, my kotlin has 19 errors and cannot figure it out<p>I am learning Android studio and doing a re... |
72,933,820 | Format data returned from JSON in DataTable<p>I am reading a json file from remote url and displaying it in DataTable.</p>
<pre><code><script>
$(document).ready(function () {
$('#example').DataTable(
{
ajax: {
method: 'GET',
url: 'https://chainfo... | <p>Use <code>render</code> element.
Read document from <a href="https://datatables.net/extensions/buttons/examples/html5/outputFormat-orthogonal.html" rel="nofollow noreferrer">Format output data - orthogonal data
</a> and <a href="https://datatables.net/forums/discussion/61407/how-to-apply-a-numeric-format-to-a-colum... | Format data returned from JSON in DataTable | javascript|jquery|datatable|datatables | 0 | 74 | 1 | 72,933,856 | 72,933,856 | 1 | true | 2022-07-11T04:45:12.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Format data returned from JSON in DataTable<p>I am reading a json file from remote url and displaying it in DataTable.</p>
<pre><code><script>
$(do... |
72,771,283 | Why can't python sum properly?<p>I have this code snippet:</p>
<pre><code>import math
number_of_lists, M = list(map(int, input().split(" ")))
print(sum([math.pow(max(list(map(int, input().split(" ")))), 2) for i in range(number_of_lists)]) % M)
</code></pre>
<p>Im dealing with really LARGE numbers. ... | <p>Try this code to see if it can help - it simplify the reading and <code>processing</code> and make it more <code>readable</code> (for maintain and debug).</p>
<p>Sometimes, we want to impress people and make one-liner or compact code, thus sacrifice the <em>readability</em>. I don't recommend that.</p>
<pre><code>i... | Why can't python sum properly? | python|numbers|calculation|algebraic-data-types | -4 | 74 | 1 | 72,771,488 | 72,771,488 | 1 | true | 2022-06-27T11:23:47.037Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't python sum properly?<p>I have this code snippet:</p>
<pre><code>import math
number_of_lists, M = list(map(int, input().split(" ")))
print... |
72,812,459 | split each persons share in javascript<p>I'm trying to write a program where group of people shares a bill, however each of the user has paid different amount, to sum up, i'm able to calculate total sum, and divide it into number of users in order to get per-person share.
and then I have two array which contains users ... | <p>I've balanced the budget</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const users = [{id:1, username:"John One", amount:100}, {id:2, username:"John Two", amount:100}, {id... | split each persons share in javascript | javascript|reactjs|calculation | 1 | 74 | 2 | 72,812,951 | 72,812,951 | 1 | true | 2022-06-30T08:18:57.863Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
split each persons share in javascript<p>I'm trying to write a program where group of people shares a bill, however each of the user has paid different amoun... |
72,781,554 | Azure AD B2C breaks OIDC spec<p>I've configured a custom policy with AAD B2C IEF per <a href="https://docs.microsoft.com/en-us/azure/active-directory-b2c/tutorial-create-user-flows?pivots=b2c-custom-policy" rel="nofollow noreferrer">this</a> link and am now trying to integrate it into API Gateway as a JWT authorizer pe... | <p>Please try to configure issuer URL <em><strong>including tfp</strong></em> for token compatibility.</p>
<p>For more details see: <a href="https://docs.microsoft.com/en-us/azure/active-directory-b2c/tokens-overview#compatibility" rel="nofollow noreferrer"><em><strong>Token compatibility</strong></em></a>
which say... | Azure AD B2C breaks OIDC spec | azure|azure-active-directory|openid-connect|api-gateway|aad-b2c | 0 | 74 | 2 | 72,849,296 | 72,849,296 | 1 | true | 2022-06-28T06:18:59.767Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure AD B2C breaks OIDC spec<p>I've configured a custom policy with AAD B2C IEF per <a href="https://docs.microsoft.com/en-us/azure/active-directory-b2c/tut... |
72,977,192 | Java Runtime query - toString() and T<p>In the following expression:</p>
<pre><code>T(org.apache.commons.io.IOUtils).toString(T(java.lang.Runtime)
.getRuntime().exec(T(java.lang.Character).toString(105)
.concat(T(java.lang.Character).toString(100))).getInputStream())
</code></pre>
<p>Does the '105' in <code>toStr... | <p>The <code>toString()</code> method that seems to be invoked here is actually the <code>toString(char)</code> (static) method of <code>java.lang.Character</code>. Quoting the documentation:</p>
<pre><code>public static String toString(char c)
Returns a String object representing the specified char.
The result is a s... | Java Runtime query - toString() and T | java | -1 | 74 | 2 | 72,977,354 | 72,977,354 | 1 | true | 2022-07-14T08:06:02.910Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Runtime query - toString() and T<p>In the following expression:</p>
<pre><code>T(org.apache.commons.io.IOUtils).toString(T(java.lang.Runtime)
.getRun... |
72,830,852 | How to read data from Kafka Topic with Stream<p>I would like to create <code>MY_STREAM</code> in Kafka that reads the data messages from <code>MY_TOPIC</code> and push it to another <code>TARGET_TOPIC</code>. Using KSQL statement:</p>
<p><code>CREATE STREAM MY_STREAM WITH (KAFKA_TOPIC='TARGET_TOPIC') AS SELECT * FROM M... | <p>Perhaps review the <a href="https://developer.confluent.io/learn-kafka/ksqldb/intro/" rel="nofollow noreferrer">101 Course</a> videos.</p>
<p>You can <code>PRINT</code> a topic to do a basic consumer, but in order to <code>SELECT</code>, you need to <code>CREATE</code> a <code>STREAM</code> over the topic.</p>
<p>Fo... | How to read data from Kafka Topic with Stream | apache-kafka|apache-kafka-streams|apache-kafka-connect|ksqldb | 0 | 74 | 1 | 72,831,783 | 72,831,783 | 1 | true | 2022-07-01T14:34:54.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to read data from Kafka Topic with Stream<p>I would like to create <code>MY_STREAM</code> in Kafka that reads the data messages from <code>MY_TOPIC</code... |
72,931,293 | select * where not in (other table values)<p>I have a <code>reserves</code> table like this:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>id</th>
<th>name</th>
<th>room_ids</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>A</td>
<td>1,2,3</td>
</tr>
<tr>
<td>2</td>
<td>B</td>
<td>2,3,4</t... | <p>Yes, it's possible:</p>
<pre><code>select rooms.*
from rooms
left join reserves
on concat(',', room_ids, ',') like concat('%,', rooms.id, ',%')
where reserves.id is null
</code></pre>
<p>Explanation:</p>
<ul>
<li><code>left join</code> yields at least one pair for each record of <code>rooms</code></li>
<li>if <code>... | select * where not in (other table values) | sql|sqlite | 0 | 74 | 1 | 72,931,392 | 72,931,392 | 1 | true | 2022-07-10T19:27:02.557Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
select * where not in (other table values)<p>I have a <code>reserves</code> table like this:</p>
<div class="s-table-container">
<table class="s-table">
<the... |
72,932,528 | Conditional v-bind in Vue.js<p>Is there a way to put a <code>v-bind:something</code> conditionally?</p>
<p>I have this:</p>
<pre class="lang-html prettyprint-override"><code><div class="sample">
<div class="some-stuff" :handle=".handle" />
</div>
</code></pre>
<p>I wan... | <p>Give this a try:</p>
<pre><code><div class="sample">
<div class="some-stuff" v-bind="{ [condition && 'handle']: '.handle' }" />
</div>
</code></pre>
<p>Got idea from:
<a href="https://stackoverflow.com/questions/43658481/passing-props-dynamically-to-dynamic... | Conditional v-bind in Vue.js | vue.js | 0 | 74 | 1 | 72,932,696 | 72,932,696 | 1 | true | 2022-07-10T23:30:46.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Conditional v-bind in Vue.js<p>Is there a way to put a <code>v-bind:something</code> conditionally?</p>
<p>I have this:</p>
<pre class="lang-html prettyprint... |
72,934,802 | Need help creating a GET route<p>I need help implement a route to fetch all blog posts by author_ids.</p>
<ul>
<li>The post that we're fetching needs to have at least one of the authors specified in the passed in author_ids parameters. I've created a helper function to help me fetch all blog posts by their ID, <code>Po... | <p>I would do it like below.</p>
<pre><code>def index
author_ids_array = params[:ids].to_s.split(',')
Post
.get_posts_by_user_id(author_ids_array)
.order(sort_column => sort_direction)
end
private
def sort_column
allow_list = %w[id reads likes popularity]
params[:sortBy].presence_in(allow_list) ||... | Need help creating a GET route | json|ruby-on-rails|ruby | 0 | 74 | 1 | 72,935,314 | 72,935,314 | 1 | true | 2022-07-11T07:00:40.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need help creating a GET route<p>I need help implement a route to fetch all blog posts by author_ids.</p>
<ul>
<li>The post that we're fetching needs to have... |
72,847,329 | Count the number of digits with sizeof is missing one digit<p>I want to verifiy that the user entered a 12digit number. To do this I'm using the sizeof operator. However the result is 11 for a 12 digit number. Why is that?</p>
<pre><code>long long n;
printf("please enter a 12 digit number \n");
scanf("%l... | <p>You cannot measure the number of digits in a integer variable using <code>sizeof</code>: numbers not arrays. <code>sizeof(n)</code> evaluates to the number of bytes of the type of <code>n</code>, <code>long long</code>, which is <code>8</code> on most systems. <code>sizeof(n)</code> is the same as <code>sizeof(long ... | Count the number of digits with sizeof is missing one digit | c|sizeof | -4 | 74 | 3 | 72,847,510 | 72,847,510 | 1 | true | 2022-07-03T14:33:58.437Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Count the number of digits with sizeof is missing one digit<p>I want to verifiy that the user entered a 12digit number. To do this I'm using the sizeof opera... |
72,981,039 | Adding a score function to a chess game<p>I am trying to add a twist to the game of chess, where the game is decided by a taking the most pieces. Each piece is worth 1 point, and the game ends when one player has 10 points.</p>
<p>When there is a "kill"/the piece is removed, a message needs to update so as to... | <p>In my opinion, the way you have structured your code is poor. You have a <a href="https://stackoverflow.com/questions/36903870/java-is-it-bad-practice-to-have-a-circular-dependency-within-the-same-package">circular dependency</a> between class <code>GameUI</code> and class <code>Piece</code>. Sometimes circular depe... | Adding a score function to a chess game | java|swing|chess | -1 | 74 | 2 | 72,990,060 | 72,990,060 | 1 | true | 2022-07-14T13:07:26.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding a score function to a chess game<p>I am trying to add a twist to the game of chess, where the game is decided by a taking the most pieces. Each piece ... |
72,794,270 | Web scraping based on the class name<p>I'm doing web scraping on google maps website to get the distance between two points.
the scraping is based on the className (because the attribute doesn't have an Id) so it's like :</p>
<pre><code>document.getElementsByClassName("UgZKXd clearfix yYG3jf selected").item(&... | <p>I've been doing web scraping as a hobby for a few years now and I've automated a few tasks with selenium in WhatsApp and as far as I can tell from time to time the interface gets updated so what I do is take as a starting point some element that doesn't frequently change maybe like a <code>frame</code> or a <code>di... | Web scraping based on the class name | javascript|html|google-maps|web-scraping | -2 | 74 | 1 | 72,794,325 | 72,794,325 | 1 | true | 2022-06-28T23:41:14.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Web scraping based on the class name<p>I'm doing web scraping on google maps website to get the distance between two points.
the scraping is based on the cla... |
73,027,186 | How to fetch shared data once using Svelte<p>I want to load static data only once from an API -- when when my app loads, for example. And be able to access that from nested components.</p>
<pre><code>// App.svelte
<script>
import TeamSelector from "./lib/TeamSelector.svelte";
teams = [];
onMou... | <p>Change <code>teams</code> to a <a href="https://svelte.dev/docs#run-time-svelte-store-writable" rel="nofollow noreferrer"><code>writable</code></a> store and make it available as a context via <a href="https://svelte.dev/docs#run-time-svelte-setcontext" rel="nofollow noreferrer"><code>setContext</code></a> (has to h... | How to fetch shared data once using Svelte | svelte | 0 | 74 | 1 | 73,027,369 | 73,027,369 | 1 | true | 2022-07-18T18:46:21.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fetch shared data once using Svelte<p>I want to load static data only once from an API -- when when my app loads, for example. And be able to access ... |
72,804,395 | Adding timedelta to local datetime, unexpected behaviour accross DST shift<p>I just stumbled accross this surprising behaviour with Python datetimes while creating datetimes accross DST shift.</p>
<p>Adding a timedelta to a local datetime might not add the amount of time we expect.</p>
<pre><code>import datetime as dt
... | <p>The rationale is : timedelta arithmetic is wall time arithmetic. That is, it includes the DST transition hours (or excludes, depending on the change). See also <a href="https://blog.ganssle.io/articles/2018/02/aware-datetime-arithmetic.html" rel="nofollow noreferrer">P. Ganssle's blog post</a> on the topic .</p>
<p>... | Adding timedelta to local datetime, unexpected behaviour accross DST shift | python|datetime|timezone|dst | 3 | 74 | 1 | 72,804,650 | 72,804,650 | 1 | true | 2022-06-29T15:51:42.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding timedelta to local datetime, unexpected behaviour accross DST shift<p>I just stumbled accross this surprising behaviour with Python datetimes while cr... |
72,789,974 | How can I use the CSS :target selector to create a reusable modal box<p>I have a large collection of proverbs from an endangered language and I'd like to use a modal box for each to make different transcriptions available, without cluttering the page. I've created a div element that expands to show the optional informa... | <p>There are several <strong>CSS</strong>-first approaches to producing this effect (which do without javascript mostly or entirely).</p>
<p>But <em>one</em> approach barely relies even on <strong>CSS</strong>: it's an <strong>HTML</strong>-first solution.</p>
<p>The <code>details / summary</code> pair of elements are ... | How can I use the CSS :target selector to create a reusable modal box | html|css | 2 | 74 | 3 | 72,791,820 | 72,791,820 | 1 | true | 2022-06-28T16:17:02.097Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I use the CSS :target selector to create a reusable modal box<p>I have a large collection of proverbs from an endangered language and I'd like to use... |
72,874,118 | Cisco config replace strings with Powershell<p>For security reasons, how can I replace the values after the word "secret"? Cisco config file extract:</p>
<pre><code>enable secret 5 $1$362i$gx87nQDZq9RQxXWh2G5p//
!
username juanchis privilege 15 secret 5 $1$cGT9$uJ/rzNxjMvWJnUdPZahTS0
</code></pre> | <p>Assuming your config is in a file called cisco.cfg:</p>
<pre><code>Get-Content ./cisco.cfg | %{$_ -replace '(secret 5) .*','$1 <<ENCRYPTED PASSWORD REMOVED>>'}
</code></pre>
<p>Here is that idea applied to the script that you've put in the comments:</p>
<pre><code>$ParentPath = "C:\cygwin64\home\&qu... | Cisco config replace strings with Powershell | powershell|replace | 1 | 74 | 1 | 72,875,984 | 72,875,984 | 1 | true | 2022-07-05T18:38:00.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cisco config replace strings with Powershell<p>For security reasons, how can I replace the values after the word "secret"? Cisco config file extrac... |
72,891,761 | How To draw a changing trajectory with direction and angle as values in Python<p>What I am trying to do is collect Keyboard and mouse input data while I play a first person shooter game. I can record this data with SerpentAI and save it to a file.</p>
<p>I then want to draw my trajectory as I move through the map in th... | <p>Since your timestamps are equidistant and your keyboard and mouse inputs are mutually exclusive, you could simplify this task to an interpretation of a list of actions:</p>
<pre><code>import numpy as np
from matplotlib import pyplot as plt
actions = ["w", "a", "s", "d", 90, &... | How To draw a changing trajectory with direction and angle as values in Python | python|shapely|coordinate-systems|coordinate-transformation|rotational-matrices | 0 | 74 | 1 | 72,893,288 | 72,893,288 | 1 | true | 2022-07-07T02:46:59.317Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How To draw a changing trajectory with direction and angle as values in Python<p>What I am trying to do is collect Keyboard and mouse input data while I play... |
73,012,046 | Error: package directory XYZ does not exist<p>I have a directory with following structure,</p>
<pre><code>.
├── awesome
│ ├── alice
│ │ ├── conf.py
│ │ └── __init__.py
│ ├── bob
│ │ ├── conf.py
│ │ └── __init__.py
│ ├── conf.py
│ ├── __init__.py
│ └── john
│ ├── conf.py
│ └── __ini... | <p>I encountered a similar error. Try manually defining both the top-level package and the sub-packages:
<code>packages=["awesome", "awesome.alice", "awesome.bob", "awesome.john", "awesome.something.somethingelse"]</code>.</p>
<p>Edit:
The issue is that using the <code>... | Error: package directory XYZ does not exist | python|python-3.x|pip|setuptools|python-packaging | 1 | 74 | 1 | 73,014,287 | 73,014,287 | 1 | true | 2022-07-17T13:05:38.690Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error: package directory XYZ does not exist<p>I have a directory with following structure,</p>
<pre><code>.
├── awesome
│ ├── alice
│ │ ├── conf.py
│ ... |
72,273,059 | How can I save an MLMultiArray to a file<p>For debug reasons, I need to save the content of a big MLMultiarray as a file.</p>
<p>I need an accuracy of up to 0.0001.
Saving the entire matrix as a JSON file is impossible as it is too big (1.5G).
I Assume that a binary representation or a compressed representation will be... | <p>Instead of encoding the huge MLMultiArray which cause a memory overloading, you can iterate over it and write it as stream to a file in JSON format:</p>
<p>First you should add FileStreamer.swift which responsible for writing:</p>
<pre><code>import Foundation
class FileStreamer {
private let fileURL: URL
... | How can I save an MLMultiArray to a file | ios|swift|multidimensional-array|coreml | 0 | 74 | 1 | 72,452,071 | 72,452,071 | 1 | true | 2022-05-17T11:14:33.767Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I save an MLMultiArray to a file<p>For debug reasons, I need to save the content of a big MLMultiarray as a file.</p>
<p>I need an accuracy of up to ... |
72,245,577 | strlen defaulting to '40'?<p>new programmer here starting with the basics.
I need to write a code that checks for the length of a string (line) and does things with it. I'm working on getting the length correct before I start with the next part of the task.</p>
<p>What's happening when I run the below code is strlen(st... | <p>There are 2 problems with your code as described below:</p>
<h4>Problem 1</h4>
<p>In standard C++ the size of an array must be a <strong>compile time constant</strong>. This means that the following is incorrect in your program:</p>
<pre><code>char string1[line]; //not standard C++ because line is not a constant exp... | strlen defaulting to '40'? | c++|string|strlen | 0 | 74 | 2 | 72,245,660 | 72,245,660 | 1 | true | 2022-05-15T04:51:45.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
strlen defaulting to '40'?<p>new programmer here starting with the basics.
I need to write a code that checks for the length of a string (line) and does thin... |
72,357,522 | Create an entry in google calendar based on an email<p>Hi everyone I have been trying to know how to force gmail to add events to a calendar similar to how airbnb and airline tickets or even eventbrite does it, is there a standard email one can send or is it based on domain reputation to make it happen.</p> | <p>If we are talking about creating events in Google Calendar based on the content of an email (either inbound or outbound email) then Google already has these features called <a href="https://support.google.com/mail/answer/10079371" rel="nofollow noreferrer">Smart features & controls</a>. For trip information, you... | Create an entry in google calendar based on an email | gmail|google-calendar-api | 1 | 74 | 1 | 72,358,029 | 72,358,029 | 1 | true | 2022-05-24T05:18:01.460Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create an entry in google calendar based on an email<p>Hi everyone I have been trying to know how to force gmail to add events to a calendar similar to how a... |
72,305,063 | pyspark: turn array of dict to new columns<p>I am struggling to transform my pyspark dataframe which looks like this:</p>
<pre><code>df = spark.createDataFrame([('0018aad4',[300, 450], ['{"v1": "blue"}', '{"v2": "red"}']), ('0018aad5',[300], ['{"v1": "blue"}']... | <p>Using <code>transform</code> function you can convert each element of the array into a map type. After that, you can use <code>aggregate</code> function to get one map, explode it then pivot the keys to get the desired output:</p>
<pre><code>from pyspark.sql import functions as F
df1 = df.withColumn(
"Tstr... | pyspark: turn array of dict to new columns | python|apache-spark|pyspark|apache-spark-sql | 2 | 74 | 3 | 72,305,579 | 72,305,579 | 1 | true | 2022-05-19T13:01:40.670Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pyspark: turn array of dict to new columns<p>I am struggling to transform my pyspark dataframe which looks like this:</p>
<pre><code>df = spark.createDataFra... |
72,269,495 | Why does this c# code has two angular bracket '>>' after IHeapifyable in this line<p>The method is in a class Heap which creates a Heap data structure in C#
This method finds the Kth minimum value in O(K log n) time
What does this line exactly do</p>
<pre><code>List<IHeapifyable<K, D>> temp = new List<IH... | <p>The angle brackets are the opening and closing of what is contained in the data type they are describing.</p>
<pre><code>List<IHeapifyable<K, D>> temp = new List<IHeapifyable<K, D>>();
</code></pre>
<p>So what this line says is: Create a <code>List</code> data type containing one or more <c... | Why does this c# code has two angular bracket '>>' after IHeapifyable in this line | c#|algorithm|visual-studio|data-structures|delegates | 0 | 74 | 2 | 72,269,566 | 72,269,566 | 1 | true | 2022-05-17T07:02:46.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does this c# code has two angular bracket '>>' after IHeapifyable in this line<p>The method is in a class Heap which creates a Heap data structure in C#
... |
72,327,224 | Arrays.asList() how to append String value to each item<p>I'm reading getting the names of all the images inside a <code>subfolder</code> of my <code>assets</code> folder.</p>
<pre><code>//Returns name of all the images inside folder_previews
private static List<String> getPreviews(Context context) throws IOExce... | <p><code>Arrays.asList</code> doesn't allow the creation of <code>List</code>s from derived items directly.</p>
<p>However, you could use <code>Stream</code>s for creating a <code>List</code> from concatenated <code>String</code>s.</p>
<pre class="lang-java prettyprint-override"><code>imageNames
.stream()
.map(... | Arrays.asList() how to append String value to each item | java|android | 0 | 74 | 2 | 72,327,285 | 72,327,285 | 1 | true | 2022-05-21T06:30:40.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Arrays.asList() how to append String value to each item<p>I'm reading getting the names of all the images inside a <code>subfolder</code> of my <code>assets<... |
72,272,318 | Perl - substring keywords<p>I have a text file where is lot of lines, I need search in this file keywords and if exist write to log file line where is keywords and line one line below and one above the keyword. Now search or write keyword not function if find write all and I dont known how can I write line below and ab... | <p>The approach below use one semaphore variable and a buffer variable to enable the desired behavior.</p>
<p>Notice that the pattern used was replaced by 'A` for simplicity testing.</p>
<pre><code>#!/usr/bin/perl
use strict;
use warnings;
my ($in_fh, $out_fh);
my ($in, $out);
$in = 'input.txt';
$out = 'output.txt';... | Perl - substring keywords | perl|substring | 1 | 74 | 1 | 72,275,681 | 72,275,681 | 1 | true | 2022-05-17T10:24:48.273Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Perl - substring keywords<p>I have a text file where is lot of lines, I need search in this file keywords and if exist write to log file line where is keywor... |
72,393,937 | React functional component won't display<p>I've started to learn React lately and today to just memorize what i've learnt i decided to create a react component that contains a simple heading tag but i can't figure out why it won't be displayed in the browser here's my code</p>
<pre><code><html lang="en">... | <p>You are using a confusing mixture of non-compiled code and compiled code. Did you checked your console? You surely have errors guiding you...</p>
<p>This is for when you don't have a compiler and React and ReactDOM will be available globally:</p>
<pre><code><script crossorigin src="https://unpkg.com/react@18... | React functional component won't display | reactjs|render | 0 | 74 | 2 | 72,394,785 | 72,394,785 | 1 | true | 2022-05-26T15:03:38.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React functional component won't display<p>I've started to learn React lately and today to just memorize what i've learnt i decided to create a react compone... |
72,301,521 | Generic type in interface throwing error in Typescript<p>I want to access stored properties, the accessed property might be <code>null</code> if it has no value. I wanted to create a generic type which would provide me with the option to define the type of the stored property, in case its value is defined.</p>
<pre><co... | <p>In the provided code, in the <code>const store</code> constant, you define the <code>get</code> method. The problem is that the <code>get</code> method you define is not generic, but the <code>Store</code> interface requires a generic <code>get</code> method.</p>
<p>The solution is to define the <code>store.get</cod... | Generic type in interface throwing error in Typescript | typescript | 0 | 74 | 1 | 72,302,239 | 72,302,239 | 1 | true | 2022-05-19T08:55:37.180Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Generic type in interface throwing error in Typescript<p>I want to access stored properties, the accessed property might be <code>null</code> if it has no va... |
72,311,341 | How to pass data, when ngModel is removed?<p>I am using <code>MatDialog</code> and I need to work with the value of the input field and also want to validate it.</p>
<pre><code><input matInput [(ngModel)]="name" formControlName="name">
</code></pre>
<pre class="lang-js prettyprint-override"><c... | <h2>Short Explanation</h2>
<p>You are just passing non existing data to the MatDialog's close output.</p>
<p>The <code>data.animal</code> you are referring to in the template is just the data sent <strong>from</strong> the caller <strong>to</strong> the <code>MatDialog</code>. That is why it is injected into it. At the... | How to pass data, when ngModel is removed? | angular|typescript | 1 | 74 | 3 | 72,311,752 | 72,311,752 | 1 | true | 2022-05-19T21:38:50.210Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass data, when ngModel is removed?<p>I am using <code>MatDialog</code> and I need to work with the value of the input field and also want to validate... |
72,343,023 | Python get timezone from offset string<p>I'm new to datetime in Python and I have a date string in this format <code>'05/18/2022 12:00:55'</code>. And a separate offset string like this <code>'-06:00'</code>.
I'm trying to make a final datetime object which is timezone aware based on the offset string.
Expected Result ... | <p>Basically you'll want to parse the date_string to datetime object, replace tzinfo with UTC, then convert with astimezone to UTC-6. For that, you parse timezone_string to datetime object as well, but just use its tzinfo.</p>
<p>EX:</p>
<pre class="lang-py prettyprint-override"><code>from datetime import datetime, tim... | Python get timezone from offset string | python|datetime|timezone|timedelta | 1 | 74 | 1 | 72,343,731 | 72,343,731 | 1 | true | 2022-05-23T03:37:00.430Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python get timezone from offset string<p>I'm new to datetime in Python and I have a date string in this format <code>'05/18/2022 12:00:55'</code>. And a sepa... |
72,352,614 | Why laravel migrate:fresh takes a long time for 422 tables?<p>I have a Laravel project and I'm using this command to migrate a database every time I want to create a new project</p>
<pre><code>php artisan migrate:fresh
</code></pre>
<p>It was working fine, but after 3 years of working on it I've reached 422 tables and ... | <p>This is an answer to speed-up issue, not <code>internal server error 500</code>, because there's not any details related to issue that causing that error.</p>
<p>I'm assuming you're using <code>Laravel 8</code> at least, and base on that you can try <code>Schema Dump</code>, which It's added to creates a dump of the... | Why laravel migrate:fresh takes a long time for 422 tables? | php|laravel|migrate | 1 | 74 | 1 | 72,352,911 | 72,352,911 | 1 | true | 2022-05-23T17:30:19.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why laravel migrate:fresh takes a long time for 422 tables?<p>I have a Laravel project and I'm using this command to migrate a database every time I want to ... |
72,324,164 | Replace deprecated InvocationRecordingMethodInterceptor<p>I have this old hateos code which I would like to migrate to latest Spring hateos version</p>
<pre><code>import org.springframework.hateoas.core.DummyInvocationUtils;
public LinkBuilder linkTo(Object dummyInvocation) {
if (!(dummyInvocation instanceof Dummy... | <p>As described in <a href="https://github.com/spring-projects/spring-hateoas/issues/833" rel="nofollow noreferrer">this Github issue</a>, the structure of packages of Spring HATEOAS was heavily refactored.</p>
<p>In the specific case of <code>DummyInvocationsUtils</code> it was <a href="https://github.com/spring-proje... | Replace deprecated InvocationRecordingMethodInterceptor | java|spring|spring-hateoas | 2 | 74 | 1 | 72,341,712 | 72,341,712 | 1 | true | 2022-05-20T19:50:50.537Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace deprecated InvocationRecordingMethodInterceptor<p>I have this old hateos code which I would like to migrate to latest Spring hateos version</p>
<pre>... |
72,338,557 | Xamarin BindableProperty works with binding only when I don't use BindingContext<p>in Xamarin Forms I created a Page that contains a custom component which I want to feed a value just like this:</p>
<pre><code><c:CustomComponent Test="{Binding Test}" />
</code></pre>
<p>This, however, doesn't work. When... | <blockquote>
<p>"my custom component used a ViewModel / BindingContext."</p>
</blockquote>
<p>Its easier to create a reusable custom component, if it is "self-contained" - no BindingContext.</p>
<p>Constructor:</p>
<pre class="lang-cs prettyprint-override"><code>public CustomComponent()
{
Initia... | Xamarin BindableProperty works with binding only when I don't use BindingContext | c#|xamarin.forms|bindableproperty | 2 | 74 | 1 | 72,342,037 | 72,342,037 | 1 | true | 2022-05-22T14:39:30.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Xamarin BindableProperty works with binding only when I don't use BindingContext<p>in Xamarin Forms I created a Page that contains a custom component which I... |
72,383,318 | How do I solve error: Operator '==' cannot be applied to operands of type 'method group' and 'int'<p>I have game when you are destroying boxes with ball witch you are bouncing with platform (standard 2d game). And I have power ups that are spawning and they are multiply number of balls and when ball touch a wall that ... | <p>The variable <code>balls</code> is only defined as a private variable within the 'ball2' class. This is not accessible to anything except for that instance of the 'ball2' class. As a side note, if you run 'Copy()' on the ball, each new ball will get a separate instance of the 'balls' variable. They won't be the same... | How do I solve error: Operator '==' cannot be applied to operands of type 'method group' and 'int' | c#|visual-studio|unity3d|operators|c#-2.0 | -2 | 74 | 2 | 72,385,164 | 72,385,164 | 1 | true | 2022-05-25T19:40:47.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I solve error: Operator '==' cannot be applied to operands of type 'method group' and 'int'<p>I have game when you are destroying boxes with ball wit... |
72,362,782 | Javascript show next prev content appenchild<p><a href="https://i.stack.imgur.com/ScQa1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ScQa1.png" alt="enter image description here" /></a>I have multiple divs with same class and I need put only one of class to some id, It show me not right order. And... | <p>In javascript first's elements index is zero, not 1.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const
dGet = document.getElementById('get')
, dBack = doc... | Javascript show next prev content appenchild | javascript|html | 2 | 74 | 1 | 72,363,125 | 72,363,125 | 1 | true | 2022-05-24T12:19:29.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript show next prev content appenchild<p><a href="https://i.stack.imgur.com/ScQa1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sc... |
72,389,012 | Cannot perform Shift + Drag on a div element containing an embedded SVG image<p>I have a draggable div containing an en embedded SVG image like this:</p>
<pre><code><div draggable="true">
<svg width="160" height="40" xmlns="http://www.w3.org/2000/svg">
<g>... | <p>This is a known bug in Chromium, Firefox works fine</p>
<ul>
<li><p><a href="https://bugs.chromium.org/p/chromium/issues/detail?id=982219" rel="nofollow noreferrer">https://bugs.chromium.org/p/chromium/issues/detail?id=982219</a></p>
<ul>
<li><p>You can not start a <code>Shift-Drag</code> operation if the Element ha... | Cannot perform Shift + Drag on a div element containing an embedded SVG image | javascript|svg|drag-and-drop | 0 | 74 | 1 | 72,391,451 | 72,391,451 | 1 | true | 2022-05-26T08:36:42.153Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot perform Shift + Drag on a div element containing an embedded SVG image<p>I have a draggable div containing an en embedded SVG image like this:</p>
<pr... |
72,376,872 | entry_point file using XGBoost as a framework in sagemaker<p>Looking at the following source code taken from <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/xgboost.html" rel="nofollow noreferrer">here</a> (SDK v2):</p>
<pre><code>import boto3
import sagemaker
from sagemaker.xgboost.estimator import XGBoost
fr... | <p><code>your_xgboost_abalone_script.py</code> can be created locally. The path you provide is relative to where the code is running.</p>
<p>I.e. <code>your_xgboost_abalone_script.py</code> can be located in the same directory where you are running the SageMaker SDK ("source code").</p>
<p>For example if you ... | entry_point file using XGBoost as a framework in sagemaker | python|xgboost|amazon-sagemaker | 0 | 74 | 1 | 72,550,911 | 72,550,911 | 1 | true | 2022-05-25T11:34:26.700Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
entry_point file using XGBoost as a framework in sagemaker<p>Looking at the following source code taken from <a href="https://docs.aws.amazon.com/sagemaker/l... |
72,249,180 | Can I skip ahead to profile a specific invocation of a specific kernel?<p>I'm using NSight Compute GUI (ncu-ui) to profile kernels in a certain app. My app invokes kernel <code>my_kernel_1</code> thousands of times, then invokes <code>my_kernel_2</code> thousands of times. I don't want to profile all invocations of al... | <p>Completing HyunwooKim' answer:</p>
<p>You can arrange for skipping the invocations of the kernel you're not interested in, and some invocations of your kernel of interest - but only before profiling starts; and only in non-interactive profiling mode:</p>
<ol>
<li>Press the Connect button to get the Connection dialog... | Can I skip ahead to profile a specific invocation of a specific kernel? | user-interface|cuda|nsight-compute|cuda-profiling | 0 | 74 | 2 | 72,397,406 | 72,397,406 | 1 | true | 2022-05-15T14:28:29.507Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I skip ahead to profile a specific invocation of a specific kernel?<p>I'm using NSight Compute GUI (ncu-ui) to profile kernels in a certain app. My app ... |
72,249,191 | How to convert a Future to Stream in Flutter where data updates in real time<p>I have a Future method (getUserProfileData) that I use to retrieve the number of user posts, the number of followers, the userName, profileImage, etc. It works perfectly for a one time retrieval of the data. If a user adds a post I want th... | <p><a href="https://pub.dev/documentation/cloud_firestore/latest/cloud_firestore/DocumentReference/snapshots.html" rel="nofollow noreferrer">snapshots</a> method provides <code>stream</code>, which notifies about changes. Use <a href="https://api.flutter.dev/flutter/widgets/StreamBuilder-class.html" rel="nofollow noref... | How to convert a Future to Stream in Flutter where data updates in real time | flutter|dart|google-cloud-firestore | 0 | 74 | 1 | 72,249,610 | 72,249,610 | 2 | true | 2022-05-15T14:30:14.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert a Future to Stream in Flutter where data updates in real time<p>I have a Future method (getUserProfileData) that I use to retrieve the number ... |
72,249,823 | Math Functions With Firebase Firestore<p>Each time I click a button on my site I would like to 'updateDoc' increase the value of the number in the database with something similar the the Javascript ++</p>
<p>I was wondering if this is possible and if its not what else can i do?</p> | <p>Firestore has a <a href="https://firebase.google.com/docs/firestore/manage-data/add-data#increment_a_numeric_value" rel="nofollow noreferrer"><code>increment()</code></a> function that you can use to increment a field while updating a document.</p>
<pre><code>import { doc, updateDoc, increment } from "firebase/... | Math Functions With Firebase Firestore | javascript|firebase|google-cloud-firestore | 0 | 74 | 1 | 72,249,876 | 72,249,876 | 2 | true | 2022-05-15T15:47:25.070Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Math Functions With Firebase Firestore<p>Each time I click a button on my site I would like to 'updateDoc' increase the value of the number in the database w... |
72,252,670 | What do all these numbers mean in the names of ecma-262, ecma-402, tc-39?<p>I just visited an <a href="https://github.com/tc39" rel="nofollow noreferrer">official github page</a> of TC39 and noticed that some of the names end with numbers, for example:</p>
<ul>
<li>TC39</li>
<li>ecma-262</li>
<li>ecma-402</li>
</ul>
<p... | <p>Before reading the comments under this question I though that <a href="https://www.ecma-international.org/" rel="nofollow noreferrer">ecma international</a> was an organization that was responsible only for <code>ecmascript</code> and nothing else. And all these numbers in this context were strange for me. But now, ... | What do all these numbers mean in the names of ecma-262, ecma-402, tc-39? | ecma | -3 | 74 | 1 | 72,252,944 | 72,252,944 | 2 | true | 2022-05-15T22:37:23.163Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What do all these numbers mean in the names of ecma-262, ecma-402, tc-39?<p>I just visited an <a href="https://github.com/tc39" rel="nofollow noreferrer">off... |
72,263,786 | Docker container is using my host DNS instead of the docker internal DNS<p>I have a docker-compose file that builds two basic application.
A front-end with angular and a backend with adonis.</p>
<pre><code>version: "3.9"
services:
backend_login:
build:
context: ./apis/apis/login_api
ports:
... | <p>docker compose sets up a docker network for all services inside the compose file that allows it to instrument the DNS rules you're talking about, but only from service to service. As you noted, your Angular application is technically "run" from the browser (e.g. Firefox) which means it's not inside the net... | Docker container is using my host DNS instead of the docker internal DNS | angularjs|docker|docker-compose|dns|adonis.js | 0 | 74 | 1 | 72,265,372 | 72,265,372 | 2 | true | 2022-05-16T18:13:48.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Docker container is using my host DNS instead of the docker internal DNS<p>I have a docker-compose file that builds two basic application.
A front-end with a... |
72,326,082 | Question about the thread-safety of using shared_ptr<p>As it's well known that <code>shared_ptr</code> only guarantees access to underlying control block is thread
safe and no guarantee made for accesses to owned object.</p>
<p>Then why <a href="https://stackoverflow.com/q/20705304/13611002">there is a race condition i... | <p><code>std::shared_ptr<T></code> guarantees that access to its control block is thread-safe, but not access to the <code>std::shared_ptr<T></code> instance itself, which is generally an object with two data members: the raw pointer (the one returned by <code>get()</code>) and the pointer to the control bl... | Question about the thread-safety of using shared_ptr | c++|c++11|shared-ptr|smart-pointers | 0 | 74 | 1 | 72,326,125 | 72,326,125 | 2 | true | 2022-05-21T01:46:00.583Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Question about the thread-safety of using shared_ptr<p>As it's well known that <code>shared_ptr</code> only guarantees access to underlying control block is ... |
72,331,678 | How to count values from one column based on the description in other column in pandas?<p>I am new to programming and Python. Lately, I am learning to use pandas.</p>
<h1>What I would like to know</h1>
<p>I am wondering what would be the best approach to work only on numbers related to Group II (in the attached DataFra... | <p>One solution to this is to filter the DataFrame first:</p>
<pre><code>group[group["Group"] == "II"]["Project"].sum()
#Out: 18
</code></pre>
<p>Breaking this up into parts:</p>
<p>First, this part returns a series of bools (True/False) for each row as to whether the values in "Group... | How to count values from one column based on the description in other column in pandas? | python|pandas|dataframe | 1 | 74 | 3 | 72,331,772 | 72,331,772 | 2 | true | 2022-05-21T17:08:04.457Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to count values from one column based on the description in other column in pandas?<p>I am new to programming and Python. Lately, I am learning to use pa... |
72,344,189 | How to render a component for particular element in a array<p>I have an array, for which a component (<code><span>Delete</span></code> in my case) needs to be shown only if the array length is greater than 2 and also, not show in first two array elements but show in other elements.</p>
<p>Example:
array = [... | <p>Use the index of the element you're iterating over (the second argument in the <code>.map</code> callback) to check if the index is 2 or more - if so, you can show the delete, otherwise don't show it.</p>
<pre><code>const App = () => {
const [elements, setElements] = useState(["element"]);
return (... | How to render a component for particular element in a array | javascript|arrays|reactjs | 0 | 74 | 4 | 72,344,273 | 72,344,273 | 2 | true | 2022-05-23T06:41:14.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to render a component for particular element in a array<p>I have an array, for which a component (<code><span>Delete</span></code> in my case... |
72,353,149 | How to search backward for substring of string (backword indexOf) starting from specific index<p>I would like to search for substring of string starting from specific index.</p>
<p>Let's say I have string: <code>"PO DAD PO PE DA X PO ZA RA"</code></p>
<p>Index from which I want to start is character <code>X</... | <pre><code>public static void main(String[] args) {
String s = "PO DAD PO PE DA X PO ZA RA";
System.out.println(usingSubstring(s));
long start = System.currentTimeMillis();
for (int i = 0; i < 10000; i++) {
usingSubstring(s);
}
long end = System.currentTimeMillis();
... | How to search backward for substring of string (backword indexOf) starting from specific index | java | 1 | 74 | 4 | 72,354,063 | 72,354,063 | 2 | true | 2022-05-23T18:17:54.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to search backward for substring of string (backword indexOf) starting from specific index<p>I would like to search for substring of string starting from... |
72,365,430 | Is it possible to view all items in a C# channel at any given time<p>I need a background queue service for my dotnet 6 application. I followed <a href="https://docs.microsoft.com/en-us/dotnet/core/extensions/queue-service" rel="nofollow noreferrer">this Microsoft doc</a> to create the bones of it.</p>
<p>Because of the... | <p>No, the built-in <a href="https://devblogs.microsoft.com/dotnet/an-introduction-to-system-threading-channels/" rel="nofollow noreferrer"><code>Channel<T></code></a> implementations don't offer this functionality. You can only peek the item that is currently in the head of the queue. All other items that are st... | Is it possible to view all items in a C# channel at any given time | c#|asp.net|asp.net-core|asynchronous|channel | 1 | 74 | 1 | 72,366,104 | 72,366,104 | 2 | true | 2022-05-24T15:17:41.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to view all items in a C# channel at any given time<p>I need a background queue service for my dotnet 6 application. I followed <a href="https... |
72,387,875 | Is there anyway to remove access of google sheet to already shared users by using google sheet api or google drive api , etc in node js?<p>I am using google sheets api as well as google drive api (node js) and I have created google sheet by using service account and shared with one email "xyz@gmail.com" with... | <p>I believe your goal is as follows.</p>
<ul>
<li>You want to delete the permission of <code>xyz@gmail.com</code> from a file using googleapis for Node.js.</li>
</ul>
<p>In this case, how about the following sample script?</p>
<h3>Sample script:</h3>
<pre class="lang-js prettyprint-override"><code>const spId = "#... | Is there anyway to remove access of google sheet to already shared users by using google sheet api or google drive api , etc in node js? | node.js|permissions|google-drive-api|google-sheets-api|google-api-nodejs-client | 1 | 74 | 1 | 72,388,034 | 72,388,034 | 2 | true | 2022-05-26T06:52:48.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there anyway to remove access of google sheet to already shared users by using google sheet api or google drive api , etc in node js?<p>I am using google ... |
72,381,595 | Loop through database ANYLOGIC<p>In my model I want to loop through the database which contains multiple columns (see example) by an event. The idea behind it is that I want to create dynamic events based on the rows in the database.</p>
<p><a href="https://i.stack.imgur.com/K33DX.png" rel="nofollow noreferrer"><img sr... | <p>Use the database query wizard:</p>
<ol>
<li>put your cursor into a code field</li>
<li>this will allow you to open the database wizard
<a href="https://i.stack.imgur.com/ZHrZz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZHrZz.png" alt="enter image description here" /></a></li>
<li>select what ... | Loop through database ANYLOGIC | anylogic | 0 | 74 | 1 | 72,390,039 | 72,390,039 | 2 | true | 2022-05-25T16:54:50.863Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Loop through database ANYLOGIC<p>In my model I want to loop through the database which contains multiple columns (see example) by an event. The idea behind i... |
72,373,586 | Adding multiple lines to yaml file based on key<p>I have <strong>sample.yaml</strong> file that looks like the following:</p>
<pre><code> a:
b:
- "x"
- "y"
- "z"
</code></pre>
<p>and I have another file called <strong>toadd.yaml</strong> that contains the following</p>
<pre><... | <p>If the files are relatively smaller, you could just directly load the second file on to the first. See <a href="https://mikefarah.gitbook.io/yq/operators/multiply-merge#merge-two-files-together" rel="nofollow noreferrer">Merging two files together</a></p>
<pre class="lang-none prettyprint-override"><code>yq '.a.b +=... | Adding multiple lines to yaml file based on key | kubernetes|yaml|yq | 3 | 74 | 1 | 72,373,887 | 72,373,887 | 2 | true | 2022-05-25T07:34:41.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding multiple lines to yaml file based on key<p>I have <strong>sample.yaml</strong> file that looks like the following:</p>
<pre><code> a:
b:
- "... |
72,238,942 | What is the endian order of the host machine/device?<p>Actually the initial question was: "What exactly the kCGBitmapByteOrderDefault is?" Because sometimes CGImageGetByteOrderInfo(CGImageRef image) returns kCGBitmapByteOrderDefault as a result. But this just tells that it is equal to the endian order of the ... | <p>You said:</p>
<blockquote>
<p>Because sometimes <code>CGImageGetByteOrderInfo(CGImageRef image)</code> returns <code>kCGBitmapByteOrderDefault</code> as a result. But this just tells that it is equal to the endian order of the host machine/device.</p>
</blockquote>
<p>It is not the endian order of the machine. It is... | What is the endian order of the host machine/device? | ios|objective-c|macos | -2 | 74 | 1 | 72,252,640 | 72,252,640 | 2 | true | 2022-05-14T09:31:59.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the endian order of the host machine/device?<p>Actually the initial question was: "What exactly the kCGBitmapByteOrderDefault is?" Because ... |
72,287,019 | Update nested array object value by replacing substring of that object property<p>I have a following set of data in my mongodb collection called orders:</p>
<pre><code>{
"_id" : ObjectId("618e0e1b17687316dcdd6246"),
"groupUID": "abc",
"orderData" : {
... | <p>My answer may look complex (Welcome for suggestion/improvement).</p>
<p>Work the update with Aggegration Pipeline.</p>
<ol>
<li><p><code>$set</code> - Update <code>orderData.items</code> field.</p>
<p>1.1. <code>$map</code> - Iterate <code>orderData.items</code> and returns new array.</p>
<p>1.1.1. <code>$mergeObjec... | Update nested array object value by replacing substring of that object property | arrays|mongodb | 1 | 74 | 1 | 72,287,350 | 72,287,350 | 2 | true | 2022-05-18T10:00:19.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Update nested array object value by replacing substring of that object property<p>I have a following set of data in my mongodb collection called orders:</p>
... |
72,351,363 | Pandas DataFrame filling in a column incorrectly -- Strange behavior<p>I get different results in a for loop from <code>print</code> and <code>df.at</code>. Can this be explained?</p>
<pre><code>import pandas as pd
data = [['A', []], ['B', []], ['C', []], ['D', []]]
df = pd.DataFrame(data, columns = ['Act', 'PreviousAc... | <p>If I understand correctly, the problem is that, when the loop finishes, your dataframe contains <code>['A', 'B', 'C', 'D']</code> for all rows.This happens because you are passing the list as "reference", which means all rows are storing the same list. You should add a <code>list()</code> call to create a ... | Pandas DataFrame filling in a column incorrectly -- Strange behavior | python|pandas|dataframe | 0 | 74 | 2 | 72,351,462 | 72,351,462 | 2 | true | 2022-05-23T15:44:51.343Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas DataFrame filling in a column incorrectly -- Strange behavior<p>I get different results in a for loop from <code>print</code> and <code>df.at</code>. ... |
72,272,025 | Mypy: how to specify list (or sequence) of mixed types?<p>Here some code:</p>
<pre class="lang-py prettyprint-override"><code>import typing
class A:
def f(self):
print("A")
class B:
def f(self):
print("B")
C = typing.Union[A,B]
Sequence_C = typing.Sequence[C]
a = A()
b = ... | <p>You need to tell the type checker that <code>[a]</code> and <code>[b]</code> are to be interpreted as <code>Sequence_S</code>, and not <code>typing.Sequence[A]</code> (or <code>[B]</code>) explicitly, e.g. <a href="https://mypy-play.net/?mypy=latest&python=3.10&flags=strict&gist=32daac7d4b333bcde9fd5f860... | Mypy: how to specify list (or sequence) of mixed types? | python|mypy|typing|invariance | 0 | 74 | 1 | 72,272,704 | 72,272,704 | 2 | true | 2022-05-17T10:06:11.413Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mypy: how to specify list (or sequence) of mixed types?<p>Here some code:</p>
<pre class="lang-py prettyprint-override"><code>import typing
class A:
def... |
72,358,703 | Create Dynamic structure variables and save them<p>For my program input is a csv file with some variable names and their values.</p>
<pre><code>| var name | value |
| -------- | -------------- |
| a.b | 345 |
| a.c._0_.field1 | 322 |
| a.c._0_.field2 | 5 ... | <p>I'll assume here you've read your file already into MATLAB here; you can use <a href="https://mathworks.com/help/matlab/ref/strsplit.html" rel="nofollow noreferrer"><code>strsplit()</code></a> to split your variable name on the dot, check whether the entry corresponds to a number or field name, and create your struc... | Create Dynamic structure variables and save them | matlab|file-io|matlab-struct | 1 | 74 | 1 | 72,359,303 | 72,359,303 | 2 | true | 2022-05-24T07:19:17.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create Dynamic structure variables and save them<p>For my program input is a csv file with some variable names and their values.</p>
<pre><code>| var name ... |
72,248,362 | Reducing a string by detecting patterns<p>Given a string, I would like to detect the repeating substrings, and then reduce <strong>abab</strong> to <strong>(ab)<sup>2</sup></strong>.</p>
<p>For instance, <strong>ababababacdecdecdeababab</strong> would reduce to <strong>(ab)<sup>4</sup>a(cde)<sup>3</sup>(ab)<sup>3</sup>... | <p>You can use <a href="https://docs.python.org/3/library/re.html#re.sub" rel="nofollow noreferrer"><code>re.sub</code></a> to match any repeating two chars and then pass a replacement function that formats the pattern you desire</p>
<pre><code>import re
def superscript(n):
return "".join(["⁰¹²³⁴⁵⁶⁷... | Reducing a string by detecting patterns | python|string|algorithm | 1 | 74 | 2 | 72,248,663 | 72,248,663 | 2 | true | 2022-05-15T12:41:48.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reducing a string by detecting patterns<p>Given a string, I would like to detect the repeating substrings, and then reduce <strong>abab</strong> to <strong>(... |
72,254,129 | Tensorflow - range wise regression loss<p>I am trying to create an efficient loss function for the following problem:
<a href="https://i.stack.imgur.com/dcGF7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dcGF7.png" alt="enter image description here" /></a>
The loss is a sum of MAE calculated for e... | <p>You can try something like this:</p>
<pre><code>import numpy as np
import tensorflow as tf
def rwmae(y_true, y_pred):
(batch_size, length) = tf.shape(y_pred)
losses = tf.zeros(batch_size, dtype=y_pred.dtype)
for ii in tf.range(batch_size):
ris = 0
indices= tf.concat([tf.where(y_true[ii][... | Tensorflow - range wise regression loss | python|tensorflow|loss-function | 2 | 74 | 1 | 72,258,918 | 72,258,918 | 3 | true | 2022-05-16T04:25:02.583Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Tensorflow - range wise regression loss<p>I am trying to create an efficient loss function for the following problem:
<a href="https://i.stack.imgur.com/dcGF... |
72,385,586 | Implementing ToOwned ('a -> 'static) for an enum containing Cow<'a, str> causes unmet lifetime requirement<h2>Context</h2>
<p>Playground link: <a href="https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=de1286b8bce0dfb840a5fc0b50df25ad" rel="nofollow noreferrer">https://play.rust-lang.o... | <p><strong>TL;DR:</strong> You cannot implement <code>ToOwned</code> for that; use an inherent method.</p>
<hr />
<p><a href="https://doc.rust-lang.org/std/borrow/trait.ToOwned.html#associatedtype.Owned" rel="nofollow noreferrer"><code>ToOwned::Owned</code></a> has a bound:</p>
<pre class="lang-rust prettyprint-overrid... | Implementing ToOwned ('a -> 'static) for an enum containing Cow<'a, str> causes unmet lifetime requirement | rust | 1 | 74 | 1 | 72,385,648 | 72,385,648 | 3 | true | 2022-05-26T01:01:26.397Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Implementing ToOwned ('a -> 'static) for an enum containing Cow<'a, str> causes unmet lifetime requirement<h2>Context</h2>
<p>Playground link: <a href="https... |
72,389,534 | how to get length of WeakMap?<p>I have a <code>WeakMap</code> like this:</p>
<pre><code>let obj = new WeakMap();
let objKey1={"a":1};
let objKey2={"b":2};
let objKey3={"c":3};
obj.set(objKey1,"value1");
obj.set(objKey2,"value2");
obj.set(objKey3,"value3");
</... | <p>From the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap" rel="nofollow noreferrer">documentation</a></p>
<blockquote>
<p>But because a WeakMap doesn't allow observing the liveness of its keys, its keys are not enumerable. There is no method to obtain a list of the k... | how to get length of WeakMap? | javascript | 1 | 74 | 1 | 72,389,636 | 72,389,636 | 3 | true | 2022-05-26T09:20:08.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to get length of WeakMap?<p>I have a <code>WeakMap</code> like this:</p>
<pre><code>let obj = new WeakMap();
let objKey1={"a":1};
let objKey2={... |
72,383,004 | Initialze a member of a C++ templated class only for specific type<p>Suppose I have a templated class like this:</p>
<pre><code>template <typename C>
class ValArray
{
ValArray() = default;
ValArray(const ValArray&) = delete;
C& operator[](size_t pos) { return _values[pos]; }
...
private:
... | <p>In C++17 and later, you can use <code>if constexpr</code> inside the constructor to assign the array elements, eg:</p>
<pre><code>template <typename C>
class ValArray
{
public:
ValArray() {
if constexpr (std::is_same_v<C, bool>) {
_values.fill(false);
}
}
...
pri... | Initialze a member of a C++ templated class only for specific type | c++|templates|c++17 | 1 | 74 | 2 | 72,383,449 | 72,383,449 | 3 | true | 2022-05-25T19:10:19.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Initialze a member of a C++ templated class only for specific type<p>Suppose I have a templated class like this:</p>
<pre><code>template <typename C>
c... |
72,353,482 | How to get just the newest row from a group where the date is expressed as a string<p>I have a database using sqlite3 and one of the columns is storing a date (rfc3339 format) as TEXT.</p>
<p>My database is storing daily values for various objects. In the example below, A and B.</p>
<div class="s-table-container">
<tab... | <p>You can use <code>ROW_NUMBER()</code> function such as</p>
<pre><code>SELECT id, obj, date, value
FROM ( SELECT t.*,
ROW_NUMBER() OVER
(PARTITION BY obj
ORDER BY strftime('%Y-%m-%dT%H:%M:%S.%fZ', date) DESC) AS rn
FROM t ) AS tt
WHERE rn = 1
</code>... | How to get just the newest row from a group where the date is expressed as a string | sql|sqlite | 0 | 74 | 2 | 72,353,508 | 72,353,508 | 3 | true | 2022-05-23T18:46:00.150Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get just the newest row from a group where the date is expressed as a string<p>I have a database using sqlite3 and one of the columns is storing a dat... |
72,253,483 | Generating a continuous alphabetical list (from a-z then from aa, bb, cc, ..., aaa, bbb, ccc)<p>I have found a <a href="https://stackoverflow.com/questions/29351492/how-to-make-a-continuous-alphabetic-list-python-from-a-z-then-from-aa-ab-ac-e/29351603#29351603">similar solution</a> in Python, but I'm not too experience... | <p>If you <code>import Algorithms</code> you can use <a href="https://github.com/apple/swift-algorithms/blob/main/Guides/Product.md" rel="nofollow noreferrer"><code>product</code></a></p>
<pre><code>let p = product(1..., UnicodeScalar("a").value...UnicodeScalar("z").value)
.lazy
.map { (i, ... | Generating a continuous alphabetical list (from a-z then from aa, bb, cc, ..., aaa, bbb, ccc) | swift|swift5 | 2 | 74 | 1 | 72,257,222 | 72,257,222 | 3 | true | 2022-05-16T01:52:17.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Generating a continuous alphabetical list (from a-z then from aa, bb, cc, ..., aaa, bbb, ccc)<p>I have found a <a href="https://stackoverflow.com/questions/2... |
72,364,978 | PHP base64_encode giving different result to Javascript btoa<p>I have the dummy account:<br>
Username: giancagallardo@gmail.com<br>
Password: Av3$truz</p>
<p>When I try to use PHP base64_encode using the code <code>base64_encode($userName . ":" . $password);</code></p>
<p>I get "<em>Z2lhbmNhZ2FsbGFyZG9AZ... | <p>Since this is your code:</p>
<pre><code>$userName = "giancagallardo@gmail.com";
$password = "Av3$truz";
echo base64_encode($userName . ":" . $password);
</code></pre>
<p>PHP is trying to get the value of <code>$truz</code>, change it to this:</p>
<pre><code>$userName = "giancagall... | PHP base64_encode giving different result to Javascript btoa | javascript|php|base64 | 0 | 74 | 2 | 72,365,246 | 72,365,246 | 4 | true | 2022-05-24T14:46:40.240Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP base64_encode giving different result to Javascript btoa<p>I have the dummy account:<br>
Username: giancagallardo@gmail.com<br>
Password: Av3$truz</p>
<p... |
73,031,341 | Read data from Firebase to Flutter UI<p>I'am trying to show the datas from my firestore database into my user profile I made a separate class to get the datas. Now I'm having trouble on how to display it or call the class so that I can show the specific datas in the UI of my User Profile Screen.
here is my database man... | <p>FutureBuilder is quite simple and easy way to access data and handle errors. If you want to read more about it head over to this link. <a href="https://stackoverflow.com/questions/51983011/when-should-i-use-a-futurebuilder">When should I use a FutureBuilder?</a></p>
<pre class="lang-dart prettyprint-override"><code>... | Read data from Firebase to Flutter UI | flutter|firebase|dart|google-cloud-firestore | 1 | 74 | 2 | 73,032,394 | 73,032,394 | 1 | true | 2022-07-19T05:00:30.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Read data from Firebase to Flutter UI<p>I'am trying to show the datas from my firestore database into my user profile I made a separate class to get the data... |
72,934,550 | SVG pictures are not displayed<p>I am using images in svg format for the first time. and they aren't displayed my project. I tried with png and it works. I also tried changing the size, color etc.. Thank you!</p>
<p>Data file where the images and their title are stored (
I don't think that's the problem because when I ... | <p>I don't know what is <code><embedy></code> tag for, you can simply try load your svg icon with img tag</p>
<pre><code> <img src="{{$competence['icon']}}" alt="" class="skills-list-skill-icon" />
</code></pre>
<p>also you dont need to add complete address to getaddress metho... | SVG pictures are not displayed | html|laravel|svg|sass|laravel-blade | 0 | 74 | 1 | 72,934,652 | 72,934,652 | 1 | true | 2022-07-11T06:34:37.793Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SVG pictures are not displayed<p>I am using images in svg format for the first time. and they aren't displayed my project. I tried with png and it works. I a... |
72,845,612 | VBA: How to NOT copy if the filtered data is blank?<p>I have a set of code to advanced filter Dataset's Column F and H if certain criteria are met, after that the filtered data under Column F to I will be copied to another worksheet's next empty row, in sequence (F & G first, then H & I).</p>
<pre><code>With Wo... | <p>Please, replace the code you show:</p>
<pre><code>With Worksheets("Sheet3")
.Range("A:K").AutoFilter Field:=6, Criteria:=">=10000000", Operator:=xlAnd, Criteria2:="<=99999999"
.Range("F2:G" & .Cells(.Rows.Count, "F").End(xlUp).Row).Copy
... | VBA: How to NOT copy if the filtered data is blank? | excel|vba | 0 | 74 | 1 | 72,845,888 | 72,845,888 | 1 | true | 2022-07-03T10:10:30.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VBA: How to NOT copy if the filtered data is blank?<p>I have a set of code to advanced filter Dataset's Column F and H if certain criteria are met, after tha... |
73,007,918 | Replace text field with a dropdown menu in ASP.NET Core MVC Application<p>I am working through the "Get Started with ASP.NET Core MVC" tutorial at the link below:</p>
<p><a href="https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/start-mvc?view=aspnetcore-6.0&tabs=visual-studio" rel="nof... | <p>You should not put it on the Index page, because the Index is to display the data. You should change the Rating field to dropdown menu on the Creat page and Edit page.</p>
<p>Below is my test code,you can refer to it:</p>
<p>Controller:</p>
<pre><code>public class MoviesController : Controller
{
List<SelectL... | Replace text field with a dropdown menu in ASP.NET Core MVC Application | c#|html|asp.net-mvc|razor|asp.net-core-6.0 | 0 | 74 | 1 | 73,017,090 | 73,017,090 | 1 | true | 2022-07-16T22:01:47.107Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace text field with a dropdown menu in ASP.NET Core MVC Application<p>I am working through the "Get Started with ASP.NET Core MVC" tutorial at ... |
72,959,325 | DryIoc - Register multiple instance with ID<p>I want to register multiple instances of a class in a container. Each instance is identified by its ID property.</p>
<pre><code>public interface MyInterface
{
string Id { get; }
}
public class MyImpl : MyInterface
{
public string Id { get; }
public MyImpl(strin... | <p>You may replace the <code>Func<string, MyInterface> getObj</code> with the <code>IEnumerable<KeyValuePair<<string, MyInterface>>> getObj</code> so it will serve as a dictionary to get your instance (DryIoc currently does not support <code>Dictionary</code> directly, but may be in future).</p>... | DryIoc - Register multiple instance with ID | c#|dryioc | 3 | 74 | 1 | 72,963,049 | 72,963,049 | 1 | true | 2022-07-12T23:23:30.660Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DryIoc - Register multiple instance with ID<p>I want to register multiple instances of a class in a container. Each instance is identified by its ID property... |
72,778,677 | Converting string to keyword in clojure<p>Suppose i want to change a number in a loop to a keyword in order to check an entry in a dict/map:</p>
<pre><code>(def myarray {:p1 "test"})
#'user/myarray
user> (get myarray
(keyword ":p1")
)
nil
user> (get myarray
(... | <p>: is the indicator of keyword according to <a href="https://clojure.org/guides/weird_characters" rel="nofollow noreferrer">the Clojure guide</a>, and the keyword function adds : automatically according to <a href="https://clojuredocs.org/clojure.core/keyword" rel="nofollow noreferrer">the Clojure Docs</a>. So the co... | Converting string to keyword in clojure | clojure | 0 | 74 | 2 | 72,779,040 | 72,779,040 | 2 | true | 2022-06-27T21:52:58.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Converting string to keyword in clojure<p>Suppose i want to change a number in a loop to a keyword in order to check an entry in a dict/map:</p>
<pre><code>(... |
72,797,334 | Create subdomains like Shopify in pythonanywhere<p>My domain name is 'example.com' and I need to create subdomain for every store created in that site like 'store1.examaple.com', 'store2.examaple.com'.
Code for every subdomain is the same.
currently my project is deployed on pythonanywhere and I already have custom dom... | <p>On PythonAnywhere you would need separate web app for each subdomain. You could use API to create them programmatically.</p> | Create subdomains like Shopify in pythonanywhere | python|django|shopify|subdomain|pythonanywhere | 1 | 74 | 1 | 72,798,643 | 72,798,643 | 2 | true | 2022-06-29T07:23:44.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create subdomains like Shopify in pythonanywhere<p>My domain name is 'example.com' and I need to create subdomain for every store created in that site like '... |
72,828,683 | how to add a circle at end of HTML "progress" bar created with <progress> tag<p><a href="https://i.stack.imgur.com/3iSVY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3iSVY.png" alt="Expected Result" /></a></p>
<p><a href="https://i.stack.imgur.com/qIfwn.png" rel="nofollow noreferrer"><img src="htt... | <p>Add a second background using a <code>radial-gradient</code></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>progress {
width: 90%;
display: block; /* default: inline-... | how to add a circle at end of HTML "progress" bar created with <progress> tag | html|css | 0 | 74 | 2 | 72,829,832 | 72,829,832 | 2 | true | 2022-07-01T11:37:45.237Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to add a circle at end of HTML "progress" bar created with <progress> tag<p><a href="https://i.stack.imgur.com/3iSVY.png" rel="nofollow noreferrer"><img ... |
72,888,656 | Discord js - Fetch Guild role list (array)<h2>Trying to get roles from a discord server with discord.js</h2>
<p>I started playing around with Discord bots using the discord.js library.</p>
<p>One of my objectives was to get the Guild roles in an array. I figured out a way to get it, but it is returning an array inside ... | <p>There are a couple of ways to get a single array.</p>
<p>Using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat" rel="nofollow noreferrer"><code>flat()</code></a> to flatten the array:</p>
<pre class="lang-js prettyprint-override"><code>const roles = client.guilds.... | Discord js - Fetch Guild role list (array) | javascript|node.js|discord|discord.js|bots | 1 | 74 | 1 | 72,889,223 | 72,889,223 | 2 | true | 2022-07-06T18:59:54.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Discord js - Fetch Guild role list (array)<h2>Trying to get roles from a discord server with discord.js</h2>
<p>I started playing around with Discord bots us... |
72,906,386 | Creating a dependent drop down using laravel livewire<p>I am trying to use laravel livewire to create a dynamic dependent drop down list.
So I have created a livewire component named assignment.</p>
<p>assignment.blade.php</p>
<pre><code><div>
<div class="row mb-4">
<label for="... | <p>There is a typo in assignment.blade.php. @enforeach should be @endforeach. I had to post this as answer as could not post this as comment.</p> | Creating a dependent drop down using laravel livewire | php|laravel|laravel-livewire | -1 | 74 | 1 | 72,908,115 | 72,908,115 | 2 | true | 2022-07-08T03:36:43.453Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating a dependent drop down using laravel livewire<p>I am trying to use laravel livewire to create a dynamic dependent drop down list.
So I have created a... |
72,919,567 | With a while loop, how it is possible to output a number list with an ending dot for each number?<p>based on that code, I wish to output my result by ending each digit with a dot.</p>
<p>input:</p>
<pre class="lang-py prettyprint-override"><code>x = 0
while x<=5:
print(x)
x += 1
</code></pre>
<p>expected output:... | <p>Make sure you start at <code>x = 1</code> and add a full stop to the string. Concatenating more letters or symbols to variables can be done with <a href="https://docs.python.org/3/tutorial/inputoutput.html#fancier-output-formatting" rel="nofollow noreferrer"><code>f-strings</code></a>:</p>
<pre><code># Start at 1
x ... | With a while loop, how it is possible to output a number list with an ending dot for each number? | python|while-loop|printing | -2 | 74 | 3 | 72,919,607 | 72,919,607 | 2 | true | 2022-07-09T07:00:33.700Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
With a while loop, how it is possible to output a number list with an ending dot for each number?<p>based on that code, I wish to output my result by ending ... |
72,923,184 | Where can I see how OCaml’s standard library functions are implemented?<p>I'm interested in how <code>List.init</code> and other library functions are implemented in OCaml. Where can I see the implementations? I checked this official link: <a href="https://v2.ocaml.org/api/List.html" rel="nofollow noreferrer">https://v... | <p>OCaml, including its standard library, is entirely open source and at time of writing hosted on GitHub here: <a href="https://github.com/ocaml/ocaml/" rel="nofollow noreferrer">https://github.com/ocaml/ocaml/</a></p>
<p>The <code>List.init</code> function (located <a href="https://github.com/ocaml/ocaml/blob/af13e29... | Where can I see how OCaml’s standard library functions are implemented? | ocaml|standard-library | 0 | 74 | 3 | 72,923,298 | 72,923,298 | 2 | true | 2022-07-09T16:51:24.737Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Where can I see how OCaml’s standard library functions are implemented?<p>I'm interested in how <code>List.init</code> and other library functions are implem... |
72,955,092 | Run MongoDB and RabbitMQ in Dockerfile<p>I'm trying to run MongoDB and RabbitMQ in docker using Dockerfile to test my python app. what's the best way to do that?</p>
<p>I did</p>
<pre><code>FROM python:latest
RUN apt-get update
RUN apt-get install -y rabbitmq-server wget
RUN wget -qO - https://www.mongodb.org/static/p... | <p>Using <code>Dockerfile</code> you can only run one service at a time if you want to run 2 services at the same time, you have to use <code>docker-compose</code></p>
<p>Here is a <code>docker-compose.yaml</code>, you can use to run 2 MongoDB and rabbit-mq at the same time.</p>
<pre class="lang-yaml prettyprint-overri... | Run MongoDB and RabbitMQ in Dockerfile | mongodb|docker|rabbitmq | 1 | 74 | 1 | 72,955,180 | 72,955,180 | 2 | true | 2022-07-12T15:50:35.230Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Run MongoDB and RabbitMQ in Dockerfile<p>I'm trying to run MongoDB and RabbitMQ in docker using Dockerfile to test my python app. what's the best way to do t... |
72,954,503 | Parse tab intended list to JSON with jq<p>I have a legacy cli tool which outputs a structured list with sub-items intended with a <code>tab</code> (stackoverflow won't let me put tabs here so I replaced them with 4 spaces in this example).</p>
<pre><code>Heading One:
Sub One: 'Value 1'
Sub Two: 'Value 2'
Headin... | <p>This is an approach for a deeply nested input. It splits on top-level items using a negative look-ahead regex on tabs following newlines, then separates the head and "unindents" the rest by removing one tab following a newline, which serves as input for a recursive call.</p>
<pre class="lang-bash prettypri... | Parse tab intended list to JSON with jq | json|bash|jq | -1 | 74 | 1 | 72,956,440 | 72,956,440 | 2 | true | 2022-07-12T15:05:49.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parse tab intended list to JSON with jq<p>I have a legacy cli tool which outputs a structured list with sub-items intended with a <code>tab</code> (stackover... |
72,961,262 | How to Append to an Array in BigQuery or: How I Learned to Handle Optional Responses in Multiple Choice Typeform Payload<h3>Working with Typeform Surveys</h3>
<p>Here is the survey design for question 1:
<a href="https://i.stack.imgur.com/Q0Cwz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q0Cwz.pn... | <p>Basic SQL approach can be:</p>
<ul>
<li>Find all the normal response values.</li>
<li>Find all the other response values.</li>
<li>Combine them together using <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#set_operators" rel="nofollow noreferrer">union all</a></li>
</ul>
<p>Below... | How to Append to an Array in BigQuery or: How I Learned to Handle Optional Responses in Multiple Choice Typeform Payload | json|google-bigquery|typeform | 0 | 74 | 1 | 72,965,679 | 72,965,679 | 2 | true | 2022-07-13T05:18:06.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Append to an Array in BigQuery or: How I Learned to Handle Optional Responses in Multiple Choice Typeform Payload<h3>Working with Typeform Surveys</h3... |
72,986,102 | Apollo takes 100% CPU<p>I use ActiveMQ Apollo 1.7.1 in Linux. I use MQTT to send message from server to client.</p>
<p>Apollo config like below:</p>
<pre class="lang-xml prettyprint-override"><code><broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
<notes>
The default confi... | <p>ActiveMQ Apollo has had no releases in almost a decade and the <a href="https://github.com/apache/activemq-apollo" rel="nofollow noreferrer"><code>readme.md</code> in the source code</a> indicates the project is dead. Therefore you're unlikely to get much help. My recommendation would be to get a couple of <a href="... | Apollo takes 100% CPU | activemq|mqtt | -1 | 74 | 1 | 72,988,706 | 72,988,706 | 2 | true | 2022-07-14T20:05:07.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Apollo takes 100% CPU<p>I use ActiveMQ Apollo 1.7.1 in Linux. I use MQTT to send message from server to client.</p>
<p>Apollo config like below:</p>
<pre cl... |
72,993,076 | What is the difference (if any) between "defined" and "well-defined"?<p>Recently I've seen this comment w.r.t. behavior (emphasis added):</p>
<blockquote>
<p>Generally, it's not undefined, but <strong>not entirely well-defined either</strong>.</p>
</blockquote>
<p>It confused me a bit, because if the behavior is not un... | <p>Well-defined is what we usually call code containing neither undefined, unspecified or implementation-defined behavior. The definition of a strictly conforming program from chapter 4 might be helpful:</p>
<blockquote>
<p><em>A strictly conforming program</em> shall use only those features of the language and library... | What is the difference (if any) between "defined" and "well-defined"? | c|language-lawyer|terminology | 1 | 74 | 1 | 72,993,305 | 72,993,305 | 2 | true | 2022-07-15T11:09:46.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the difference (if any) between "defined" and "well-defined"?<p>Recently I've seen this comment w.r.t. behavior (emphasis added):</p>
<blockquote>
<p... |
73,029,681 | How to use recursion to get all children when each parent has an array of children?<p>I have a dictionary <code>d</code> of <code>parent:list(children)</code> as so:</p>
<pre><code>d = \
{'accounts': ['nodate'],
'retfile': ['bb', 'aa'],
'snaps': [],
'raw': ['pview', 'status'],
'nodate': ['tainlog', 'retfile'],
'mv... | <p>You can do a depth first search. Just keep track of which items you've seen in a set. Then yield each one you haven't seen and yield from the result of recursive call:</p>
<pre><code>def get_all_descendants(t, d, seen=None):
if seen is None:
seen = set([t])
for item in d[t]:
if item not in se... | How to use recursion to get all children when each parent has an array of children? | python|recursion | 0 | 74 | 2 | 73,029,726 | 73,029,726 | 2 | true | 2022-07-18T23:42:51.057Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use recursion to get all children when each parent has an array of children?<p>I have a dictionary <code>d</code> of <code>parent:list(children)</code... |
73,030,542 | changing return value for certain argument with guards<p>I am trying to code a Haskell function that returns the number of days in a month, given the month and year. Here is what I currently have:</p>
<pre><code>days :: Int -> Int -> Int
days month year
month 1 = 31
if ily year then month 2 = 29
else month ... | <p>Yes, you've just got the syntax a little confused I think.</p>
<pre><code>days :: Int -> Int -> Int
days 1 _ = 31 -- January always has 31 days
days 2 year | ily year = 29 -- February during a leap year
| otherwise = 28 -- February otherwise
days 3 _ = 31 -- March alw... | changing return value for certain argument with guards | haskell|conditional-statements | 0 | 74 | 1 | 73,030,646 | 73,030,646 | 2 | true | 2022-07-19T02:42:02.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
changing return value for certain argument with guards<p>I am trying to code a Haskell function that returns the number of days in a month, given the month a... |
72,794,633 | How to measure total memory used by a single function<p>I wonder how to measure total memory used by the function in JavaScript. I found that there is an API <a href="https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory" rel="nofollow noreferrer"><code>performance.memory</code></a>. I have noticed that <... | <p>(V8 developer here.)</p>
<p>You're absolutely right to be worried; this isn't going to work.</p>
<p>One reason is that <code>performance.memory</code> is (intentionally) not precise enough to support this pattern. Open the DevTools console and see for yourself:</p>
<pre><code>> var before = performance.memory.use... | How to measure total memory used by a single function | javascript|performance|memory|benchmarking | 1 | 74 | 1 | 73,099,114 | 73,099,114 | 2 | true | 2022-06-29T00:52:11.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to measure total memory used by a single function<p>I wonder how to measure total memory used by the function in JavaScript. I found that there is an API... |
72,787,419 | concatenation state in useEffect cause loop<p>i had read some questions and article about this issue including <a href="https://stackoverflow.com/questions/58866796/understanding-the-react-hooks-exhaustive-deps-lint-rule">this</a> one:
but i don't find my answer.</p>
<p>consider this code.</p>
<pre><code>function Compo... | <p>Your list updates on each <code>page</code> or <code>list</code> dependency update, resulting in an infinite loop. Removing the <code>list</code> argument from the dependency array will fix your bug.</p>
<p>In fact, if you use <code>callback</code> in <code>setState</code> like blew eslint never complain about the <... | concatenation state in useEffect cause loop | javascript|reactjs|react-hooks|infinite-loop | 1 | 74 | 1 | 72,787,520 | 72,787,520 | 2 | true | 2022-06-28T13:35:18.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
concatenation state in useEffect cause loop<p>i had read some questions and article about this issue including <a href="https://stackoverflow.com/questions/5... |
72,964,156 | Remove the part of string after the last occurrence in python<p>I have a string that has the path of the file stored in it.</p>
<pre><code>path = \home\linux\testfile\abc\work
</code></pre>
<p>now I want to write a function with which I can remove all the characters occurring after the <strong><code>last '\\'</code></s... | <p>You can use <code>rsplit</code> to start from the right and only split one time.</p>
<pre><code>>>> path = '\home\linux\testfile\abc\work'
>>> path.rsplit('\\', 1)
['\\home\\linux\\testfile\\abc', 'work']
>>> path.rsplit('\\', 1)[0]
'\\home\\linux\\testfile\\abc'
</code></pre> | Remove the part of string after the last occurrence in python | python|python-3.x | 0 | 74 | 6 | 72,964,208 | 72,964,208 | 2 | true | 2022-07-13T09:45:34.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove the part of string after the last occurrence in python<p>I have a string that has the path of the file stored in it.</p>
<pre><code>path = \home\linux... |
73,028,924 | How to measure time spent in blocking code while using asyncio in Python?<p>I'm currently migrating some Python code that used to be blocking to use <code>asyncio</code> with <code>async/await</code>. It is a lot of code to migrate at once so I would prefer to do it gradually and have metrics. With that thing in mind I... | <h1>TLDR;</h1>
<p>This decorator does the job:</p>
<pre class="lang-py prettyprint-override"><code>def measure_blocking_code(f):
async def wrapper(*args, **kwargs):
t = 0
coro = f()
try:
while True:
t0 = time.perf_counter()
future = coro.send(None)... | How to measure time spent in blocking code while using asyncio in Python? | python|performance|asynchronous|python-asyncio|metrics | 2 | 74 | 2 | 73,040,910 | 73,040,910 | 2 | true | 2022-07-18T21:41:20.210Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to measure time spent in blocking code while using asyncio in Python?<p>I'm currently migrating some Python code that used to be blocking to use <code>as... |
72,921,565 | How to get two threads to work on the shared resource<p>I have a С++ class that has a <strong>databases_list_</strong> vector defined.<br>
This vector contains <strong>database</strong> objects.</p>
<p>I need to make two functions that will run on separate threads.<br> And each function will use the <code>databases_lis... | <p>You can lock a <a href="https://en.cppreference.com/w/cpp/thread/mutex" rel="nofollow noreferrer"><code>std::mutex</code></a> every time you want to access the shared resource. You also access <code>is_work_</code> from multiple threads and I therefore suggest making that <code>std::atomic<bool> is_work_</code... | How to get two threads to work on the shared resource | c++|multithreading | 1 | 74 | 1 | 72,921,747 | 72,921,747 | 2 | true | 2022-07-09T13:00:15.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get two threads to work on the shared resource<p>I have a С++ class that has a <strong>databases_list_</strong> vector defined.<br>
This vector contai... |
73,027,215 | Fixing column names with unnest_wider in R<p>I am having a problem in R and seek your help!</p>
<p>I have a tibble that looks like this (unfortunately, I can't figure out how to write the code to create the table here). My table looks exactly like this to the viewer, e.g., you can see the letter "c" in the ta... | <p>With the OP's data, it is a case of <code>matrix</code> column, thus if we convert to a vector (doesn't have <code>dim</code> attributes), the <code>names_sep</code> should work</p>
<pre><code>library(dplyr)
library(purrr)
library(tidyr)
df1 %>%
mutate(zip = map(zip, c)) %>%
unnest_wider(zip, names_sep ... | Fixing column names with unnest_wider in R | r|tidyr | 1 | 74 | 2 | 73,027,540 | 73,027,540 | 2 | true | 2022-07-18T18:49:00.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Fixing column names with unnest_wider in R<p>I am having a problem in R and seek your help!</p>
<p>I have a tibble that looks like this (unfortunately, I can... |
72,883,323 | Translate quaternion rotation to correct frame<p>I place an IMU on my wrist and extend my arm as shown in the photo below. I spin in a circle once, while my arm remains in the fixed position. I calculate the <a href="https://stackoverflow.com/a/18115837/5655414">euler pitch</a> and <a href="https://stackoverflow.com/a/... | <p>Assuming you rotate around an axis <code>[x;y;z]</code> , <a href="https://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion/5783030#5783030">the post you refer to</a> states that the quaternion associated with the rotation is of the form:</p>
<pre><code>q(1) = cos(r/2);
q(2) = sin(r/2)*x;
q(3) = ... | Translate quaternion rotation to correct frame | matlab|rotation|quaternions|euler-angles|kinematics | 1 | 74 | 1 | 72,883,975 | 72,883,975 | 2 | true | 2022-07-06T12:09:04.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Translate quaternion rotation to correct frame<p>I place an IMU on my wrist and extend my arm as shown in the photo below. I spin in a circle once, while my ... |
73,013,705 | How to oracle partition by date range Unix Timestamp<p>I have below table in oracle, I want Partition Range by Date in Oracle monthly on <code>MyTimestamp</code> column(Data type is number). Can I partition with this column or do I need another column? If I need a new column, what is the data type of the new column an... | <p>You can define a virtual column and define partition key on that:</p>
<pre><code>CREATE TABLE ... (
id NUMBER,
MyTimestamp NUMBER
Name VARCHAR2(100),
etc...
PARTITION_KEY TIMESTAMP(0) GENERATED ALWAYS AS (
CAST(TRUNC(TIMESTAMP '1970-01-01 00:00:00 UTC' + MyTimestamp * INTERVAL '1' SECOND) AS T... | How to oracle partition by date range Unix Timestamp | oracle|database-partitioning|oracle19c | 0 | 74 | 2 | 73,018,079 | 73,018,079 | 2 | true | 2022-07-17T16:54:01.033Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to oracle partition by date range Unix Timestamp<p>I have below table in oracle, I want Partition Range by Date in Oracle monthly on <code>MyTimestamp</... |
72,786,136 | How to extract nested field from Envelop type schema in s3 sink connector<p>Avro schema :</p>
<pre><code>{
"type": "record",
"name": "Envelope",
"namespace": "test",
"fields": [
{
"name": "before",
"ty... | <p>You should be able to use <code>after.Value.createdAt</code> - <a href="https://github.com/confluentinc/kafka-connect-storage-common/pull/48" rel="nofollow noreferrer">See my PR</a></p>
<p>But the better option is to <a href="https://debezium.io/documentation/reference/stable/transformations/event-flattening.html" r... | How to extract nested field from Envelop type schema in s3 sink connector | amazon-s3|apache-kafka|apache-kafka-connect|confluent-schema-registry|s3-kafka-connector | 2 | 74 | 1 | 72,787,643 | 72,787,643 | 2 | true | 2022-06-28T12:07:05.607Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to extract nested field from Envelop type schema in s3 sink connector<p>Avro schema :</p>
<pre><code>{
"type": "record",
"na... |
72,861,195 | SQL Server : convert multiple different date format in one column<p>I have example table with different date format like this :</p>
<pre><code> | date-column |
------------
| 20150812 |
| 03/07/2013 |
| 2017-09-23 |
| --Etc-- |
</code></pre>
<p>How to change or convert all the date format? For example... | <p>This should work:</p>
<pre class="lang-sql prettyprint-override"><code>select CONVERT(VARCHAR(10), cast(date-column as date), 112)
</code></pre>
<p>Just take care of the format of your dates if it's <code>dmy</code> or <code>mdy</code>, it should be consistent.</p>
<p><a href="https://dbfiddle.uk/?rdbms=sqlserver_20... | SQL Server : convert multiple different date format in one column | sql|sql-server | 1 | 74 | 2 | 72,861,358 | 72,861,358 | 2 | true | 2022-07-04T19:21:57.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL Server : convert multiple different date format in one column<p>I have example table with different date format like this :</p>
<pre><code> | date-column... |
72,840,863 | Filter a dictionary with a list of strings<p>I have a dictionary where every key and every value is unique. I'd like to be able to filter based on a list of strings. I've seen lot of examples with the key is consistent but not where its unique like in the example below.</p>
<pre><code>thisdict = { "brand": &q... | <p>I assume that the key of the dict should be contained in any filter value. Accordingly, my solution looks like this:</p>
<pre class="lang-py prettyprint-override"><code>thisdict = { "brand": "Ford", "model": "Mustang", "year": 1964}
filt = ["rand", "a... | Filter a dictionary with a list of strings | python|dictionary | 0 | 74 | 2 | 72,840,941 | 72,840,941 | 2 | true | 2022-07-02T16:53:51.423Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filter a dictionary with a list of strings<p>I have a dictionary where every key and every value is unique. I'd like to be able to filter based on a list of ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.