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,792,464 | How can I override content type header of every responses for http.Client?<p>I've got a <code>http.Client</code> in <a href="https://pkg.go.dev/net/http" rel="nofollow noreferrer">go</a> and I want it to update every content type for every response to <code>application/json</code> (even though it might not be the case)... | <pre><code>package main
import (
"fmt"
"net/http"
)
type MyRoundTripper struct {
httprt http.RoundTripper
}
func (rt MyRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
res, err := rt.httprt.RoundTrip(req)
if err != nil {
fmt.Printf("Error: %v&... | How can I override content type header of every responses for http.Client? | go|http-headers | -1 | 67 | 1 | 72,792,721 | 72,792,721 | 2 | true | 2022-06-28T19:58:05.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I override content type header of every responses for http.Client?<p>I've got a <code>http.Client</code> in <a href="https://pkg.go.dev/net/http" rel... |
72,802,545 | Dynamically retrieve key's value from a terraform yaml file<p>I am trying to get a value from a key in a <code>yaml</code> file after decoding it in locals:</p>
<pre><code>document.yaml
name: RandomName
emailContact: email@domain.com
tags:
- key: "BusinessUnit"
value: "BUnit"
- key: "... | <p>I managed to get the budget by converting the list of maps into a single map with each tag being a key value.</p>
<p>The way you were doing it would result in the following data structure under <code>local.file.tags</code>:</p>
<pre><code>[
{
"key" = "BusinessUnit"
"value" = &... | Dynamically retrieve key's value from a terraform yaml file | terraform|terraform-provider-azure | 0 | 67 | 1 | 72,803,238 | 72,803,238 | 2 | true | 2022-06-29T13:48:45.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dynamically retrieve key's value from a terraform yaml file<p>I am trying to get a value from a key in a <code>yaml</code> file after decoding it in locals:<... |
72,809,958 | Unable to create TigerGraph schema with pyTigerGraph - Connection Refused<p>I am an absolute beginner in TigerGraph, and I'm following <a href="https://www.youtube.com/watch?v=qay0GJJ28W8" rel="nofollow noreferrer">this</a> tutorial to get familiar with it. In the part of this tutorial where a Python script is used to ... | <p>Can you add <code>tgCloud=True</code> to your parameter settings?</p>
<p><strong>Example:</strong>
<code>conn = tg.TigerGraphConnection(host=hostName, username=userName, password=password, tgCloud=True)</code></p>
<p>With the latest release of TigerGraph Cloud ports were changed to route through 443. I've been infor... | Unable to create TigerGraph schema with pyTigerGraph - Connection Refused | python|tigergraph | 1 | 67 | 1 | 72,816,949 | 72,816,949 | 2 | true | 2022-06-30T03:19:23.160Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to create TigerGraph schema with pyTigerGraph - Connection Refused<p>I am an absolute beginner in TigerGraph, and I'm following <a href="https://www.y... |
72,814,953 | version mismatch in mule application dependencies<p>I am trying to deploy this application to the Mule server.
It works on Anypoint Studio without a problem.
When I go to deploy it on the standalone server, it fails and in the logs, I find this error</p>
<pre><code>java.lang.IllegalStateException: Incompatible version ... | <p>It looks like the domain is really using the dependency for APIKit 1.5.5. Another reason could be some incompatible version of the REST Validator Extension as mentioned in the <a href="https://docs.mulesoft.com/api-manager/2.x/rest-validator-extension" rel="nofollow noreferrer">documentation</a>. Also if the domain... | version mismatch in mule application dependencies | mule|mulesoft|anypoint-studio|mule4 | 0 | 67 | 1 | 72,817,785 | 72,817,785 | 2 | true | 2022-06-30T11:25:41.617Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
version mismatch in mule application dependencies<p>I am trying to deploy this application to the Mule server.
It works on Anypoint Studio without a problem.... |
72,818,025 | assign 0 when value_count() is not found<p>I have a column that looks like this:</p>
<pre><code>group
A
A
A
B
B
C
</code></pre>
<p>The value C exists sometimes but not always. This works fine when the C is present. However, if C does not occur in the column, it throws a key error.</p>
<pre><code> value_counts = df.g... | <p>One way of doing it is by converting series into dictionary and getting the key, unless not found return the default value (in your case it is 0):</p>
<pre class="lang-py prettyprint-override"><code>df = pd.DataFrame({'group': ['A', 'A', 'B', 'B', 'D']})
new_df = {}
character = "C"
new_df[character] = df... | assign 0 when value_count() is not found | python|python-3.x|pandas|numpy | 1 | 67 | 2 | 72,818,252 | 72,818,252 | 2 | true | 2022-06-30T15:00:57.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
assign 0 when value_count() is not found<p>I have a column that looks like this:</p>
<pre><code>group
A
A
A
B
B
C
</code></pre>
<p>The value C exists sometim... |
72,818,776 | GORM embedded struct not working correctly<p>I receive this error</p>
<pre><code>controllers/users.go:61:36: user.ID undefined (type models.User has no field or method ID)
</code></pre>
<p>when using</p>
<pre><code>var user models.User
...
jwtToken, err := generateJWT(user.ID, user.Username)
</code></pre>
<p>The defi... | <p>You have used <code>BaseModel</code> as attribute in your model so even though gorm can very well map it to the table column to access it, you have to use the attribute name</p>
<p>To access you would do</p>
<pre><code>jwtToken, err := generateJWT(user.BaseModel.ID, user.Username)
</code></pre>
<p>you could also try... | GORM embedded struct not working correctly | go|go-gorm | 1 | 67 | 1 | 72,819,166 | 72,819,166 | 2 | true | 2022-06-30T15:57:33.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GORM embedded struct not working correctly<p>I receive this error</p>
<pre><code>controllers/users.go:61:36: user.ID undefined (type models.User has no field... |
72,830,157 | Firestore listener - the best way for a large collection?<p>I using Firestore for my flutter's app. I have two collections with with several hundred documents (up to 600). I need to notify the application user when a document changes. first I used this code:</p>
<pre><code> _collectionRef.snapshots(includeMetadataChang... | <p>The best practice you quote is to limit the number of <strong>listeners</strong> per application to at most 100. So that is the number of times you have an active call to <code>.listen</code>, <code>onSnapshot</code> or similar APIs. This recommendation is not related to the number of collections or documents that y... | Firestore listener - the best way for a large collection? | flutter|firebase|google-cloud-firestore | 0 | 67 | 1 | 72,830,385 | 72,830,385 | 2 | true | 2022-07-01T13:37:57.407Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firestore listener - the best way for a large collection?<p>I using Firestore for my flutter's app. I have two collections with with several hundred document... |
72,830,506 | Calling macro from within generated function in Julia<p>I have been messing around with generated functions in Julia, and have come to a weird problem I do not understand fully: My final goal would involve calling a macro (more specifically <code>@tullio</code>) from within a generated function (to perform some tensor ... | <p>I find it helpful to think of generated functions as having two components: the <em>body</em> and any <em>generated code</em> (the stuff inside a <code>quote..end</code>). The body is evaluated at compile time, and doesn't "know" the values, only the types. So for a generated function taking <code>x::T</co... | Calling macro from within generated function in Julia | macros|julia|metaprogramming|auto-generate | 1 | 67 | 1 | 72,831,261 | 72,831,261 | 2 | true | 2022-07-01T14:06:35.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calling macro from within generated function in Julia<p>I have been messing around with generated functions in Julia, and have come to a weird problem I do n... |
72,832,468 | how to get data inside object in typescript object<p>I have this object :</p>
<pre><code>{
"id": 6,
"serialNumber": 555,
"status": "xxxx",
"createdDate": "2021-05-07T10:05:05.301+00:00",
"employee": {
"id": 1,
... | <p>you can simply return the response object and access it via response.id</p>
<p><a href="https://stackblitz.com/edit/angular-ivy-dmbhgv?file=src/app/app.component.ts" rel="nofollow noreferrer">https://stackblitz.com/edit/angular-ivy-dmbhgv?file=src/app/app.component.ts</a></p> | how to get data inside object in typescript object | angular|typescript | -1 | 67 | 2 | 72,832,995 | 72,832,995 | 2 | true | 2022-07-01T16:53:39.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to get data inside object in typescript object<p>I have this object :</p>
<pre><code>{
"id": 6,
"serialNumber": 555,
&quo... |
72,845,443 | Branching in Apache Airflow using TaskFlowAPI<p>I can't find the documentation for branching in Airflow's TaskFlowAPI. I tried doing it the "Pythonic" way, but when ran, the DAG does not see <code>task_2_execute_if_true</code>, regardless of truth value returned by the previous task.</p>
<pre><code>@dag(
... | <p>There's an example DAG in the source code: <a href="https://github.com/apache/airflow/blob/f1a9a9e3727443ffba496de9b9650322fdc98c5f/airflow/example_dags/example_branch_operator_decorator.py#L43" rel="nofollow noreferrer">https://github.com/apache/airflow/blob/f1a9a9e3727443ffba496de9b9650322fdc98c5f/airflow/example_... | Branching in Apache Airflow using TaskFlowAPI | python|airflow|airflow-taskflow | 0 | 67 | 1 | 72,845,685 | 72,845,685 | 2 | true | 2022-07-03T09:40:03.957Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Branching in Apache Airflow using TaskFlowAPI<p>I can't find the documentation for branching in Airflow's TaskFlowAPI. I tried doing it the "Pythonic&qu... |
72,849,406 | Class Reactivity with Proxy does not work as expected in Vue 3<p>I have a <code>Class</code> with a proxy-based object, the <code>set()</code> method changes another property of the same class, everything works fine if I run the code only in JS/TS.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-conso... | <p>To make <code>Form#errors</code> reactive in this case, initialize it with <a href="https://vuejs.org/api/reactivity-core.html#reactive" rel="nofollow noreferrer"><code>Vue.reactive()</code></a>:</p>
<pre class="lang-js prettyprint-override"><code>class Form {
errors = Vue.reactive([])
⋮
}
</code></pre>
<p><div ... | Class Reactivity with Proxy does not work as expected in Vue 3 | javascript|vue.js|proxy|vuejs3 | 1 | 67 | 1 | 72,850,373 | 72,850,373 | 2 | true | 2022-07-03T19:41:44.697Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Class Reactivity with Proxy does not work as expected in Vue 3<p>I have a <code>Class</code> with a proxy-based object, the <code>set()</code> method changes... |
72,868,486 | Reading data from the end of disk in C<p>I try to use crypto key for decrypting disk in Ubuntu 16 and I want read it from the end of disk just as raw data without creating any file for security reason, i.e. like dd does in way</p>
<pre><code>sudo dd if=some_disk bs=1 skip=end_of_disk - keysize count=keysize
</code></pr... | <p><code>ioctl(fd, BLKGETSIZE64, &numblocks)</code> return size in 512-byte blocks, <code>fseek()</code> expect offset in bytes.
BTW, you can set pointer relative to the end of disk without knowing it's size:</p>
<pre><code>fseek(device, -keySize, SEEK_END);
</code></pre> | Reading data from the end of disk in C | c|ubuntu | 1 | 67 | 1 | 72,868,943 | 72,868,943 | 2 | true | 2022-07-05T11:14:37.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reading data from the end of disk in C<p>I try to use crypto key for decrypting disk in Ubuntu 16 and I want read it from the end of disk just as raw data wi... |
72,889,571 | Identify an embedded image within an image in Python<p>I have, for example, the following image:</p>
<p><a href="https://i.stack.imgur.com/0lSss.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0lSss.png" alt="" /></a></p>
<p>Is there any way of identifying the embedded image between the text?</p>
<p>... | <p>Here's my attempt. This is how it works:</p>
<ol>
<li>To detect text, check how different pixels are from their neighbors. This is done using an absolute difference.</li>
<li>The previous step only detects the edges of text. Expand this with a gaussian blur.</li>
<li>Threshold this, and remove text.</li>
<li>Crop re... | Identify an embedded image within an image in Python | python|opencv|image-processing | 0 | 67 | 1 | 72,891,095 | 72,891,095 | 2 | true | 2022-07-06T20:34:58.513Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Identify an embedded image within an image in Python<p>I have, for example, the following image:</p>
<p><a href="https://i.stack.imgur.com/0lSss.png" rel="no... |
72,903,379 | create a time series scatter plot with plotly<p>I would like to create a time series scatter plot with plotly in python, I have for example 2 columns of data "a" and "b" and each entry in the column is a date and time of an event. I want to make a plot where time is on x-axis, and y axis just shows ... | <p>You can set the y values to the name of the column multiplied by the length of the column:</p>
<pre><code>import plotly.graph_objects as go
import pandas as pd
df = pd.DataFrame(dict(
a=["2020-01-10", "2020-02-10", "2020-03-10", "2020-04-10", "2020-05-10", "... | create a time series scatter plot with plotly | python|pandas|dataframe|plotly | 2 | 67 | 1 | 72,904,616 | 72,904,616 | 2 | true | 2022-07-07T19:39:28.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
create a time series scatter plot with plotly<p>I would like to create a time series scatter plot with plotly in python, I have for example 2 columns of data... |
72,903,212 | Push existing items in newly created item's nested array<p>This is my Form</p>
<pre><code><form action="/test" method="post">
<input type="text" name="name" id="">
<input type="text" name="year" id="">
<!-- This... | <p>When you need to make a relation between collections, you should use a reference, you should not copy the entire document, because data will be duplicated.</p>
<p><strong>test.ejs:</strong></p>
<pre><code><form action="/test" method="post">
<label>Club Name:</label>
<inpu... | Push existing items in newly created item's nested array | javascript|arrays|express|mongoose|ejs | 2 | 67 | 1 | 72,918,527 | 72,918,527 | 2 | true | 2022-07-07T19:23:49.507Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Push existing items in newly created item's nested array<p>This is my Form</p>
<pre><code><form action="/test" method="post">
<i... |
72,957,691 | react js: infinite page rendering issue<p>So I have a page in react that is constantly rendering , say for eg. when I console log I can see that getting logged infinitely in a loop. is it some hook on some inner components that is getting rendered constantly I can't figure out</p>
<p>When i comment out</p>
<pre><code> ... | <p>The problem here is that you have a <code>useEffect</code> with <code>state</code> as a dependency, meaning that every time the state value is altered, the <code>getCart</code> function gets called.<br />
Meanwhile, <code>getCart</code> sets the state within it.</p>
<p>Therefor, it creates a cycle where <code>getCar... | react js: infinite page rendering issue | reactjs | 1 | 67 | 1 | 72,958,072 | 72,958,072 | 2 | true | 2022-07-12T19:52:04.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
react js: infinite page rendering issue<p>So I have a page in react that is constantly rendering , say for eg. when I console log I can see that getting logg... |
72,957,519 | Arrows on edges in a graph using Networkx<p>I have a graph with nodes and edges. The code colors the array <code>Edges</code> with the array <code>Weights</code> as shown in the current output. Is it possible to put arrows on the array elements in <code>Edges</code> as displayed in the expected output? I want arrows on... | <p>You are almost there.</p>
<p>First, you will need to create a directed graph instead of an undirected graph:</p>
<pre><code>G = nx.DiGraph()
</code></pre>
<p>Second, <code>DiGraph</code> objects are plotted with arrow heads by default, so you need to specify <code>arrows=False</code> in the call to <code>nx.draw(...... | Arrows on edges in a graph using Networkx | python|numpy|matplotlib|networkx | 0 | 67 | 1 | 72,969,399 | 72,969,399 | 2 | true | 2022-07-12T19:35:59.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Arrows on edges in a graph using Networkx<p>I have a graph with nodes and edges. The code colors the array <code>Edges</code> with the array <code>Weights</c... |
72,969,075 | Make Left and Bottom Spines Visible in Seaborn Subplots<p>I try to come up with a helper function to plot figure with subplots in Seaborn.</p>
<p>The codes currently look like below:</p>
<pre><code>def granular_barplot(data, col_name, separator):
'''
data = dataframe
col_name: the column to be analysed
... | <p>Try setting this style:</p>
<pre><code>def granular_barplot(data, col_name, separator):
'''
data = dataframe
col_name: the column to be analysed
separator: column to be plotted in subplot
'''
sns.set_style({'axes.linewidth': 2, 'axes.edgecolor':'black'})
g = sns.catplot(data=data, y=col_n... | Make Left and Bottom Spines Visible in Seaborn Subplots | python|seaborn|subplot | 0 | 67 | 2 | 72,969,471 | 72,969,471 | 2 | true | 2022-07-13T15:44:17.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Make Left and Bottom Spines Visible in Seaborn Subplots<p>I try to come up with a helper function to plot figure with subplots in Seaborn.</p>
<p>The codes c... |
72,987,742 | Delete an entry in a map which key is an array<p>I'm new to JavaScript Maps and I want to know if there's a way to delete an entry which key is an array, this is the way I'm trying to do it but it's not working:</p>
<pre><code>/*
coffee map:
Map(8) {
'Roast' => 'Dark',
'Origin' => 'Chiapas',
304029198 =>... | <p>In JavaScript, there are primitive data types such as (string - number ...) and non-primitive data types (such as arrays). In non-primitive you access it by reference, so when you put an array as a key inside a map and then call that array inside the map.delete() you actually calling a different array with another ... | Delete an entry in a map which key is an array | javascript | 0 | 67 | 2 | 72,988,070 | 72,988,070 | 2 | true | 2022-07-14T23:51:41.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Delete an entry in a map which key is an array<p>I'm new to JavaScript Maps and I want to know if there's a way to delete an entry which key is an array, thi... |
73,001,026 | The view does not show up<p>I would like to show a <em>ProgressView</em> when the <em>Button</em> is pressed and the <em>user.showLoginProgress</em> property is set, which is declared as published. However, the new value of the property does not seem to trigger the <em>LoginView</em> to refresh, so the <em>ProgressView... | <p>Try using something like this approach, to re-structure your <code>User</code> and <code>Login</code>, where
there is only one <code>ObservableObject</code> and the login functions are in it.</p>
<pre><code>@main
struct TestApp: App {
var body: some Scene {
WindowGroup {
ContentView()
... | The view does not show up | swift|swiftui | 1 | 67 | 1 | 73,001,381 | 73,001,381 | 2 | true | 2022-07-16T01:51:19.850Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The view does not show up<p>I would like to show a <em>ProgressView</em> when the <em>Button</em> is pressed and the <em>user.showLoginProgress</em> property... |
73,001,971 | Indexing through an array to return any specific value in java<p>So, I have created code which is reading a CSV file line by line, then splitting each line into their individual values then putting this into an array, but i am stuck on trying the index a value from this array I have created, I will attach the CSV file ... | <p>You need to create a 2D array in readFile. As the file is read, and and each line is split by processLine, insert the array into the 2D array. The method readFile at the end returns the 2D array. Make processLine to return a string array and have it return the result of the split.</p>
<p>I marked where I made chan... | Indexing through an array to return any specific value in java | java | -1 | 67 | 2 | 73,002,837 | 73,002,837 | 2 | true | 2022-07-16T06:19:12.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Indexing through an array to return any specific value in java<p>So, I have created code which is reading a CSV file line by line, then splitting each line i... |
73,011,303 | Maximum call stack size exceeded - Vue Router<p>I am checking if jwt token is expired or not in my route guard. But it is running in an infinite loop. I can't understand why it is not working. Here are my codes:</p>
<p>Route Guard</p>
<pre><code>const parseJwt = (token) => {
const base64Url = token.split('.')[1]... | <p>I think the problem is here</p>
<pre><code> if (localStorage.getItem('token') && to.name === 'Login') {
return next({ path: '/' })
}
</code></pre>
<p>Let's assume I have the token but it's expired. The navigation guard will redirect me to login page, which will redirect me to the home page (because it... | Maximum call stack size exceeded - Vue Router | vue.js|vue-router | 2 | 67 | 1 | 73,012,447 | 73,012,447 | 2 | true | 2022-07-17T11:17:48.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Maximum call stack size exceeded - Vue Router<p>I am checking if jwt token is expired or not in my route guard. But it is running in an infinite loop. I can'... |
73,023,009 | How to check if enough specific elements are in a list?<p>I am trying to check if at least five items in my list have the following format: <code>r"P\d+:Q\d+"</code>. So, these are accepted:</p>
<pre><code>P14:Q52
P32:Q65
P1000:Q23423
:
:
etc.
</code></pre>
<p>I have a list of cell ranges like below:</p>
<pre... | <p>Using a list comprehension we can try:</p>
<pre class="lang-py prettyprint-override"><code>lst_filter = [x for x in mcr_coord_lst if re.search(r'^P\d+:Q\d+$', x)]
if len(lst_filter) >= 5:
print("list is valid")
else:
print("list is not valid")
</code></pre> | How to check if enough specific elements are in a list? | python|regex|list|loops|while-loop | 1 | 67 | 3 | 73,023,114 | 73,023,114 | 2 | true | 2022-07-18T13:21:37.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check if enough specific elements are in a list?<p>I am trying to check if at least five items in my list have the following format: <code>r"P\d+... |
73,003,136 | How to solve this strange bug? (c++)<pre class="lang-cpp prettyprint-override"><code>#include <iostream>
#include <vector>
int main()
{
std::string human = "";
std::vector <char> translate;
std::cout << "Enter English words or sentences to tranlate it into Whale's language.... | <p>Reading from an <code>ifstream</code> into a string will break on whitespaces, hence <code>cin >> human</code> only reads what's effectively the first word.</p>
<p>Change this:</p>
<pre><code>std::cin >> human;
</code></pre>
<p>To this:</p>
<pre><code>std::getline(cin, human);
</code></pre>
<p>While we'r... | How to solve this strange bug? (c++) | c++ | -2 | 67 | 1 | 73,003,172 | 73,003,172 | 2 | true | 2022-07-16T09:39:16.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to solve this strange bug? (c++)<pre class="lang-cpp prettyprint-override"><code>#include <iostream>
#include <vector>
int main()
{
std::s... |
73,001,090 | How do I add an search-function to a Table that displays Json-data?<p>My ASP.NET Core project displays data from a Json file as a table on a Razor page.</p>
<p>Now I want to add an search function so it only shows "objects" with the selected userId.</p>
<p>I added an search bar on the razor page but I do not ... | <p>If you play around with the provided link, the API service does provide the data filtering feature.</p>
<p>For example, link: <a href="https://jsonplaceholder.typicode.com/todos?userId=1" rel="nofollow noreferrer">https://jsonplaceholder.typicode.com/todos?userId=1</a></p>
<pre><code>[
{
"userId": 1,... | How do I add an search-function to a Table that displays Json-data? | c#|json.net|asp.net-core-mvc|filtering|dynamic-tables | 0 | 67 | 1 | 73,001,159 | 73,001,159 | 2 | true | 2022-07-16T02:13:49.413Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I add an search-function to a Table that displays Json-data?<p>My ASP.NET Core project displays data from a Json file as a table on a Razor page.</p>
... |
72,834,940 | Multiple buttons change the value of a single input text field of in a HTML form using JS<p>I am working on a piece of code that would allow me to press different "buttons" to insert a value inside of a text type input of a HTML form.</p>
<p>Currently, I am able to get the code working with one button connect... | <p>You are almost there! Just use the event parameter that contains the value of the target.</p>
<p><strong>Solution</strong></p>
<pre><code>button.addEventListener("click", updateTextField);
button2.addEventListener("click", updateTextField);
function updateTextField(event) {
console.log("b... | Multiple buttons change the value of a single input text field of in a HTML form using JS | javascript|html|forms | 1 | 67 | 3 | 72,835,043 | 72,835,043 | 2 | true | 2022-07-01T21:53:32.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple buttons change the value of a single input text field of in a HTML form using JS<p>I am working on a piece of code that would allow me to press diff... |
72,843,309 | Testing two elements with the same text<p>I have a page with two element containing the "some text", but cannot confirm it in my test.</p>
<p>Simplest example is this:</p>
<pre class="lang-html prettyprint-override"><code><div>some text</div>
<div>some text</div>
</code></pre>
<pre cla... | <p>Unfortunately <code>.contains()</code> only ever returns one element. If multiple are found, the first one is returned.</p>
<p>You can instead add <code>:contains()</code> into the selector.</p>
<p>Since the selector and text are variables, a string template can build the final selector.</p>
<pre class="lang-js pret... | Testing two elements with the same text | cypress | 2 | 67 | 2 | 72,843,315 | 72,843,315 | 2 | true | 2022-07-03T00:46:44.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Testing two elements with the same text<p>I have a page with two element containing the "some text", but cannot confirm it in my test.</p>
<p>Simpl... |
72,990,065 | Two sum but sum is in a range<p>How this can be solved faster than O(N^2) without using Binary indexed tree (O(NlogN), but Memory Out Limit)</p>
<pre><code>arr = [6, 2, 3, 5, 1, 6], l = 5, h = 7
</code></pre>
<p>Find number of pairs i, j such that <code>i < j && (arr[i] + arr[j] >= l && arr[i] + a... | <p>Sort the array in ascending order and, for each i, binary search (in <code>(i , n]</code>) the first <code>j</code> for which the first condition is true. Let it be <code>j1</code>. Then, binary search (again in <code>(i, n]</code>) the last j for which the second condition is true. Let it be <code>j2</code>. If eve... | Two sum but sum is in a range | c++|algorithm | -1 | 67 | 1 | 72,990,093 | 72,990,093 | 2 | true | 2022-07-15T06:52:45.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Two sum but sum is in a range<p>How this can be solved faster than O(N^2) without using Binary indexed tree (O(NlogN), but Memory Out Limit)</p>
<pre><code>a... |
72,860,712 | Kotlin For loop, confused<p>Does anyone explain how it works? X and Y answer explain, please. Answer: 81 and 23</p>
<pre><code>fun main(args: Array<String>) {
var x =0
var y =20
for (outer in 1..3) {
for (inner in 4 downTo 2) {
x += 6
y++
x += 3
}
... | <p>You can follow the steps with inserted print statements. For x it would look like this:</p>
<pre><code>var x = 0
for (outer in 1..3) {
for (inner in 4 downTo 2) {
x += (6 + 3)
println("outer: $outer | inner: $inner | x: $x")
}
println()
}
println("x: $x")
Output:
outer: 1 | inner:... | Kotlin For loop, confused | android|kotlin|for-loop | -2 | 67 | 2 | 72,860,815 | 72,860,815 | 2 | true | 2022-07-04T18:21:26.483Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kotlin For loop, confused<p>Does anyone explain how it works? X and Y answer explain, please. Answer: 81 and 23</p>
<pre><code>fun main(args: Array<String... |
72,876,618 | How to Make a Page Inaccessible With a Button<p>I've been trying to figure out how to make a menu button that functions similarly to that of YouTube, where once clicked the rest of the page is darker and inaccessible until the button is clicked once more and the menu retracts. If anyone could help with this, I would gr... | <p>Sorry OP, I know you asked for minimal change to your markup but what you were doing just seemed so backwards to me (also your snippet wasn't working for me??) -- take a look at the script in my snippet, I've set this up using click delegation on the body. This will detect every click anywhere on the page, but will ... | How to Make a Page Inaccessible With a Button | javascript|html|css | 0 | 67 | 2 | 72,876,950 | 72,876,950 | 2 | true | 2022-07-05T23:56:03.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Make a Page Inaccessible With a Button<p>I've been trying to figure out how to make a menu button that functions similarly to that of YouTube, where o... |
72,786,759 | form doesnt get submitted after disabling button after submit<p>Hello there i want my button disabled after the form submitted.
Disabling the button works but it doesnt execute the php code.</p>
<p>I tried different scrips that are posted on the internet but they all do the same: disabling the button without executing ... | <p>If you want to disable the button <em>after</em> executing the php code, then you need to make it happen when the page reloads. Any JavaScript which runs during the "submit" event is happening <em>before</em> the request containing the form data is sent to the server for PHP to process it. And your current... | form doesnt get submitted after disabling button after submit | javascript|php|html|jquery | 0 | 67 | 2 | 72,787,070 | 72,787,070 | 2 | true | 2022-06-28T12:51:07.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
form doesnt get submitted after disabling button after submit<p>Hello there i want my button disabled after the form submitted.
Disabling the button works bu... |
72,917,714 | Combinations of words that co-occur most often across strings<p><strong>Here's the problem...</strong></p>
<p>I have a list of strings:</p>
<pre><code>strings = ['one two three four', 'one two four five', 'four one two', 'three four']
</code></pre>
<p>I'm trying to find combinations of words that co-occur in two or mor... | <p>You can compute the powersets with minimum 2 combinations and count the combinations:</p>
<pre><code>from itertools import chain, combinations
from collections import Counter
# https://docs.python.org/3/library/itertools.html
def powerset(iterable, MIN=2):
"powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) ... | Combinations of words that co-occur most often across strings | python|pandas|nlp | 1 | 67 | 1 | 72,917,799 | 72,917,799 | 2 | true | 2022-07-08T22:53:49.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Combinations of words that co-occur most often across strings<p><strong>Here's the problem...</strong></p>
<p>I have a list of strings:</p>
<pre><code>string... |
72,918,239 | Python clean text file to make it searchable<p>I have a very messy text file that consist of both comma and space seperated data that looks like the following:</p>
<pre><code>NBLOCK,3,,13
(1i9,3e20.9e3)
1 4.000000000E+01 -6.000000000E+01 0.000000000E+00
2 4.000000000E+01 6.000000000E+... | <p>Consider this kind of solution:</p>
<pre><code>import numpy as np
from pprint import pprint
class Block:
def __init__(self):
self.data = {}
self.array = []
def ingest(self, lines):
for line in lines:
if 'A' <= line[0] <= 'Z':
parts = [k.strip() for ... | Python clean text file to make it searchable | python|numpy|data-cleaning | 0 | 67 | 1 | 72,918,296 | 72,918,296 | 2 | true | 2022-07-09T01:03:01.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python clean text file to make it searchable<p>I have a very messy text file that consist of both comma and space seperated data that looks like the followin... |
72,975,730 | How to standardize date format by VBA<p>There is column A and B with different date format :</p>
<ul>
<li>20200714</li>
<li>44043</li>
<li>2020/09/01</li>
<li>2021/1/4</li>
</ul>
<p>is there any VBA to standardize the date format as the same format?</p>
<ul>
<li><p>2020/7/14</p>
</li>
<li><p>2020/7/31</p>
</li>
<li><p>... | <p>Please, try the next function:</p>
<pre><code>Function DateConv(strVal) As Date
If IsDate(strVal) Then
DateConv = strVal
ElseIf IsNumeric(strVal) And Len(strVal) = 5 Then
DateConv = CDate(CLng(strVal))
ElseIf IsNumeric(strVal) And Len(strVal) = 8 Then
DateConv = DateSerial(CLng(left(... | How to standardize date format by VBA | excel|vba|date-format | 0 | 67 | 1 | 72,976,446 | 72,976,446 | 2 | true | 2022-07-14T05:43:40.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to standardize date format by VBA<p>There is column A and B with different date format :</p>
<ul>
<li>20200714</li>
<li>44043</li>
<li>2020/09/01</li>
<l... |
72,987,572 | why my if/else block doesn't work in redux toolkit reducer?<p>So basically I am making a shopping cart and I want to add a functionality if an item is already in the cart then increase it's quantity by 1. If you add same item and they have different sizes then show them separetely. I managed to deal with increasing the... | <blockquote>
<pre class="lang-js prettyprint-override"><code>state.bagData.filter((item, i) => (state.bagData[i].quantity += 1));
</code></pre>
</blockquote>
<p>For your first case, this is updating <strong>every</strong> item's quantity if you found a matching item by <code>id</code> and <code>size</code>. Since yo... | why my if/else block doesn't work in redux toolkit reducer? | javascript|reactjs|redux|react-redux|redux-toolkit | 0 | 67 | 1 | 72,987,698 | 72,987,698 | 2 | true | 2022-07-14T23:19:22.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why my if/else block doesn't work in redux toolkit reducer?<p>So basically I am making a shopping cart and I want to add a functionality if an item is alread... |
72,917,908 | class template and member function template with requires<p>I have a template class called Speaker, with a template member function called speak. These both have a requires clause. How do I define the member function outside of the class in the same header file?</p>
<pre><code>// speaker.h
#include <concepts>
n... | <p>The rules for defining template members of class templates are the same in principle as they were since the early days of C++.</p>
<p>You need the same <em>template-head(s)</em> grammar component(s), in the same order</p>
<pre><code>template <typename T> requires std::is_integral_v<T>
template <typena... | class template and member function template with requires | c++|c++20|c++-concepts | 0 | 67 | 1 | 72,917,972 | 72,917,972 | 2 | true | 2022-07-08T23:35:31.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
class template and member function template with requires<p>I have a template class called Speaker, with a template member function called speak. These both ... |
72,945,436 | Attempt to index nil with Instance<p>I'm trying to make a combat system with a dictionary but there's this one error that stops the whole entire system. This is the script</p>
<pre><code>local Dictionary = require(script.Dictionary)
local DictionaryHandler = {}
function DictionaryHandler.find(player, action)
ret... | <p>It looks like you are trying to make a system for checking whether there is an action mapped to each player. But the problem comes from the initial check whether the key exists in the nested tables.</p>
<pre><code>if not Dictionary[action][player] then
</code></pre>
<p>Reading the code from left to right, <code>Dict... | Attempt to index nil with Instance | lua|scripting|roblox | 1 | 67 | 1 | 72,945,758 | 72,945,758 | 2 | true | 2022-07-11T22:55:52.463Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Attempt to index nil with Instance<p>I'm trying to make a combat system with a dictionary but there's this one error that stops the whole entire system. This... |
73,016,136 | Filtering fields to be returned in API response<p>I am new to Python. I have a very simple question. Given the following code:</p>
<pre class="lang-py prettyprint-override"><code>import requests, json, pprint
from pprint import pprint
api_key='<mykey>' #define API key
movie_title='The Godfather' # define title... | <pre class="lang-py prettyprint-override"><code># As a result you've got a json response
# It is a python dictionary (a KEY-VALUE pairs of data)
# Python dictionary is within curly braces {}
# To get out a value from dictionary you need to refer to a key
myDict = {"Name": "Bob", "Age": 3... | Filtering fields to be returned in API response | python | 0 | 67 | 1 | 73,016,362 | 73,016,362 | 2 | true | 2022-07-17T23:53:39.403Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filtering fields to be returned in API response<p>I am new to Python. I have a very simple question. Given the following code:</p>
<pre class="lang-py pretty... |
72,952,277 | Omit 0 value points on chart.js radar<p><a href="https://i.stack.imgur.com/O0m16.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O0m16.jpg" alt="enter image description here" /></a></p>
<p>Is there a way to omit 0 value points on a radar chart from chart.js to prevent the border from collapsing in th... | <p>You can <code>map</code> the data array to replace all <code>0</code> values with <code>null</code> and then set
<code>spanGaps: true</code> in the options, which will skip missing data and connect the line to next point.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="fa... | Omit 0 value points on chart.js radar | javascript|chart.js | 1 | 67 | 1 | 72,953,151 | 72,953,151 | 2 | true | 2022-07-12T12:25:37.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Omit 0 value points on chart.js radar<p><a href="https://i.stack.imgur.com/O0m16.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O0m16.jpg... |
72,768,874 | ZonedDateTime America/Phoenix zone to GMT having issue<p>I want to Convert America/Phoenix to GMT</p>
<pre><code>ZonedDateTime zdtPhoenix1 = ZonedDateTime.of(2022, 6, 27, 10, 0, 0, 0, ZoneId.of("America/Phoenix"));
System.out.println(zdtPhoenix1);
System.out.println(zdtPhoenix1.withZoneSameInstant(Zon... | <p><code>10:00-07:00</code> is not an arithmetic expression.</p>
<p><code>-07:00</code> means that your clock is 7 hours <em>behind</em> GMT. So that means that when it is 10 o'clock in GMT, 10 o'clock in America/Phoenix will be 7 hours later.</p>
<p>So yes, if it's 10:00 in America/Phoenix, then it's already 17:00 in ... | ZonedDateTime America/Phoenix zone to GMT having issue | java|java-8|java-time | 0 | 67 | 3 | 72,769,220 | 72,769,220 | 3 | true | 2022-06-27T08:09:38.207Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ZonedDateTime America/Phoenix zone to GMT having issue<p>I want to Convert America/Phoenix to GMT</p>
<pre><code>ZonedDateTime zdtPhoenix1 = ZonedDateTime.of... |
72,795,417 | How long does it take for Kubernetes to detect and delete excess nodes<p>I am running a Kubernetes cluster in AWS EKS and I set up the autoscaler. I tested the autoscaler and it worked as when the number of pods in a node exceeded 110 then new nodes were automatically added to the cluster and the pending pods entered r... | <p>Although scaling down is a slow process the default scan interval is <strong>10 seconds</strong> if you are using the autoscaler to scale the nodes in EKS.</p>
<p>You can check the status of autoscaler using <strong>configmap</strong> and its a decision.</p>
<p>There could be a possibility that on the new node you h... | How long does it take for Kubernetes to detect and delete excess nodes | kubernetes|amazon-eks | 1 | 67 | 1 | 72,795,896 | 72,795,896 | 3 | true | 2022-06-29T03:17:36.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How long does it take for Kubernetes to detect and delete excess nodes<p>I am running a Kubernetes cluster in AWS EKS and I set up the autoscaler. I tested t... |
72,816,671 | What Benefits Does TimeOnly Have Over TimeSpan?<p><code>TimeOnly</code> was one of the new types introduced with .Net 6 along with <code>DateOnly</code>. I understand the great need for the <code>DateOnly</code> type as there are many instances you would want to store a date without a related time but no data type that... | <p>One of the benefits I can see from using <code>TimeOnly</code> instead of <code>TimeSpan</code> is in having appropriate data types to represent periods of time vs times of the day.</p>
<p><code>TimeOnly</code> is better suited for times of day and <code>TimeSpan</code> is better suited for representing durations/pe... | What Benefits Does TimeOnly Have Over TimeSpan? | c#|types|.net-6.0|timespan | 0 | 67 | 1 | 72,816,672 | 72,816,672 | 3 | true | 2022-06-30T13:26:48.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What Benefits Does TimeOnly Have Over TimeSpan?<p><code>TimeOnly</code> was one of the new types introduced with .Net 6 along with <code>DateOnly</code>. I u... |
72,818,716 | Why can't Comma IDE find `raku` binary after a reboot?<p>I have a test that I'm running in Comma IDE from a Raku distro downloaded from github.</p>
<p>The tests passed last night. But after rebooting this morning, the test no longer passes. The test runs the <code>raku</code> on the machine. After some investigation, I... | <p>My best guess: in the situation where it worked, Comma was started from a shell where rakubrew had set up the environment. Then, after the reboot, Comma was started again, but from a shell where that was not the case.</p>
<p>Unless you choose to do otherwise, environment variables are passed on from parent process t... | Why can't Comma IDE find `raku` binary after a reboot? | raku|commaide | 2 | 67 | 1 | 72,819,583 | 72,819,583 | 3 | true | 2022-06-30T15:52:56.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't Comma IDE find `raku` binary after a reboot?<p>I have a test that I'm running in Comma IDE from a Raku distro downloaded from github.</p>
<p>The te... |
72,824,471 | Recommended way to write a condition with multiple ifs<p>I am trying to do alert the user if any 2 of the 4 counter variables is non-zero.
What is the best way to code this without a long if else condition like this?</p>
<pre><code># Description: report violation if any 2 type of device counts is non-zero (mix of Vt ... | <p>Maybe something like</p>
<pre><code>set counters [list $count_hvt $count_lvt $count_svt $count_ulvt]
if {[llength [lsearch -all -exact -integer -not $counters 0]] >= 2} {
return 1
}
</code></pre>
<p>Basically, filter out the elements equal to zero from a list, and count how many remain.</p> | Recommended way to write a condition with multiple ifs | coding-style|tcl | 2 | 67 | 1 | 72,826,379 | 72,826,379 | 3 | true | 2022-07-01T04:46:59.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Recommended way to write a condition with multiple ifs<p>I am trying to do alert the user if any 2 of the 4 counter variables is non-zero.
What is the best w... |
72,828,941 | React: Passing Props not working. Am I missing something?<p>as you may get from the title, passing props in react is not working. And i don´t get why.</p>
<pre><code>import styled from 'styled-components';
const Login = (props) => {
return<div>Login</div>
}
export default Login;
</code></pre>
<p>... | <p>You should pass <code><Login /></code> as the element. Try this code:<br>
App.js:</p>
<pre><code>import './App.css';
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import Login from './components/Login.js';
function App() {
return (
<div className="App"... | React: Passing Props not working. Am I missing something? | javascript|reactjs|react-router | 1 | 67 | 2 | 72,829,053 | 72,829,053 | 3 | true | 2022-07-01T11:58:39.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React: Passing Props not working. Am I missing something?<p>as you may get from the title, passing props in react is not working. And i don´t get why.</p>
<p... |
72,862,871 | zsh: permission denied: webstorm - On Attempting to Create Shell Script That Launches WebStorm<p>I am following the documentation on creating a Shell script that launches the WebStorm application for a given file folder as described on <a href="https://www.jetbrains.com/help/webstorm/working-with-the-ide-features-from-... | <blockquote>
<p>Checked my permissions for both usr/local/bin and usr/local/bin/webstorm to ensure that I have the correct permissions to execute files from here. When right clicking on the webstorm file and clicking "Get Info", I can see that I currently have read and write permissions.</p>
</blockquote>
<p>... | zsh: permission denied: webstorm - On Attempting to Create Shell Script That Launches WebStorm | macos|zsh|webstorm | 0 | 67 | 1 | 72,863,706 | 72,863,706 | 3 | true | 2022-07-05T00:00:35.403Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
zsh: permission denied: webstorm - On Attempting to Create Shell Script That Launches WebStorm<p>I am following the documentation on creating a Shell script ... |
72,927,882 | Return a value from labeled loops<p>We can return a value from loops with <code>break</code>, for example:</p>
<pre class="lang-rust prettyprint-override"><code>fn main() {
let mut counter = 0;
let result = loop {
counter += 1;
if counter == 10 {
break counter * 2;
}
};... | <p>Loops in Rust are expressions, and while most loops evaluate to <code>()</code>, you can <code>break</code> with a value, including breaking to outer labels. In the following example, this is accomplished by <code>break 'counting_up Some(1)</code> and assigning the loop's value via <code>let foo: Option<usize>... | Return a value from labeled loops | rust|control-flow | 1 | 67 | 1 | 72,928,030 | 72,928,030 | 3 | true | 2022-07-10T10:45:37.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return a value from labeled loops<p>We can return a value from loops with <code>break</code>, for example:</p>
<pre class="lang-rust prettyprint-override"><c... |
72,939,862 | How to reduce union types in typescript without using string?<p>I have the following local state variable</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 [select, setSel... | <p>You can use a type alias here:</p>
<pre class="lang-js prettyprint-override"><code>type AllowedValues = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i'| 'j'| 'k'
export type group = {
id: string;
set: AllowedValues;
groupStatus: boolean;
}
const [select, setSelect] = useState<'' | AllowedValues>('... | How to reduce union types in typescript without using string? | reactjs|typescript | 2 | 67 | 1 | 72,942,579 | 72,942,579 | 3 | true | 2022-07-11T14:05:20.063Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reduce union types in typescript without using string?<p>I have the following local state variable</p>
<p><div class="snippet" data-lang="js" data-hid... |
72,985,880 | Qt Custom Animated Button (Ellipse effect)<p>I am trying to make a custom animated button on PyQt. I found a website which has custom buttons: <a href="https://tympanus.net/Development/ButtonHoverStyles/" rel="nofollow noreferrer">Buttons website</a></p>
<p>I already created a topic for making a 3rd button: <a href="ht... | <p>The main issue in your code is that the padding computation is wrong.</p>
<p>You are increasing the size of the padding from the current rectangle and then decrease it by half the padding size, which doesn't make a lot of sense.</p>
<p>You should instead consider the default padding <em>minus</em> the extent based o... | Qt Custom Animated Button (Ellipse effect) | python|qt|button|pyqt5|pyside6 | 1 | 67 | 1 | 73,001,780 | 73,001,780 | 3 | true | 2022-07-14T19:43:10.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Qt Custom Animated Button (Ellipse effect)<p>I am trying to make a custom animated button on PyQt. I found a website which has custom buttons: <a href="https... |
73,014,893 | How to create dummy variables that indicate the presence of a factor for other observations within in a group?<p>I am working with a data frame like the following, where <code>Color</code> and `Player are factor variables:</p>
<p><a href="https://i.stack.imgur.com/OtHEG.png" rel="nofollow noreferrer"><img src="https://... | <p>Perhaps this helps - split the 'Color' column by 'Game', create a binary matrix by comparing the elements of 'Color' (<code>!=</code>), convert to <code>tibble</code>, row bind (<code>_dfr</code>) and bind the dataset with the original dataset (<code>bind_cols</code>)</p>
<pre><code>library(purrr)
library(dplyr)
lib... | How to create dummy variables that indicate the presence of a factor for other observations within in a group? | r|dataframe | 4 | 67 | 5 | 73,015,015 | 73,015,015 | 3 | true | 2022-07-17T19:50:05.230Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create dummy variables that indicate the presence of a factor for other observations within in a group?<p>I am working with a data frame like the foll... |
72,788,883 | How to handle a numeric data type from PostgreSQL in C?<p>I try to convert data queried via libpq in binary format into Arrow format in C. For that, I queried the data type Oids for the corresponding columns via PQftype() and match them with Arrow datatypes. But I am not sure how to handle numerics.</p>
<p>The query <c... | <p>You can find the implementation details in <code>src/backend/utils/adt/numeric.c</code>. Scale and precision of the <code>numeric</code> are not stored in <code>pg_type</code>, because they are not part of the data type. The relevant attribute is <code>atttypmod</code> in <code>pg_attribute</code>, because scale and... | How to handle a numeric data type from PostgreSQL in C? | c|postgresql|libpq | 2 | 67 | 1 | 72,791,924 | 72,791,924 | 3 | true | 2022-06-28T15:03:44.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to handle a numeric data type from PostgreSQL in C?<p>I try to convert data queried via libpq in binary format into Arrow format in C. For that, I querie... |
72,970,532 | Is there a way in R to move all my labels off the map (into the margins)?<p>I am working on creating a choropleth map in R with certain cities and certain providers plotted as points on top of the map. I'm stuck with getting the names of the providers to move off the map into the margins (either at the top, to the righ... | <p>A rather straight forward workaround is to semi-manually define the label position and use geom_label, and add segments instead. In order to avoid overlap, add a nudge to every second label. Based on the example (further important comments in the code):</p>
<pre class="lang-r prettyprint-override"><code>library(maps... | Is there a way in R to move all my labels off the map (into the margins)? | r|ggplot2|choropleth|geom-text|choroplethr | 4 | 67 | 1 | 72,980,918 | 72,980,918 | 3 | true | 2022-07-13T17:45:06.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way in R to move all my labels off the map (into the margins)?<p>I am working on creating a choropleth map in R with certain cities and certain pr... |
72,992,051 | How to modify non-zero elements of a large sparse matrix based on a second sparse matrix in R<p>I have two large sparse matrices (about 41,000 x 55,000 in size). The density of nonzero elements is around 10%. They both have the same row index and column index for nonzero elements.</p>
<p>I now want to modify the values... | <blockquote>
<p>Is there a fundamental error in my approach?</p>
</blockquote>
<p>Yes. Here it is.</p>
<pre><code># This takes hours.
m2[position_matrix_from_m1[1,], position_matrix_from_m1[2,]] <- 1
m1[position_matrix_from_m1[1,], position_matrix_from_m1[2,]] <- 0
</code></pre>
<p>Syntax as <code>mat[rn, cn]</co... | How to modify non-zero elements of a large sparse matrix based on a second sparse matrix in R | r|performance|matrix|sparse-matrix | 2 | 67 | 1 | 72,994,359 | 72,994,359 | 3 | true | 2022-07-15T09:42:25.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to modify non-zero elements of a large sparse matrix based on a second sparse matrix in R<p>I have two large sparse matrices (about 41,000 x 55,000 in si... |
73,028,650 | How do I get all the functions that are available in a Golang package?<p>How can I get all list of functions that are available in the package, For example in <a href="https://pkg.go.dev/time#pkg-functions" rel="nofollow noreferrer">time</a> package, When I click the link to list the package functions it is listing on... | <p>Use the <a href="https://pkg.go.dev/cmd/go#hdr-Show_documentation_for_package_or_symbol" rel="nofollow noreferrer">go doc</a> command to list functions in a package:</p>
<pre><code>go doc -short time | grep "func "
</code></pre> | How do I get all the functions that are available in a Golang package? | go | 1 | 67 | 1 | 73,028,771 | 73,028,771 | 3 | true | 2022-07-18T21:08:08.230Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I get all the functions that are available in a Golang package?<p>How can I get all list of functions that are available in the package, For example i... |
72,990,982 | I need a regexp to parse in php a car license plate<p>I have a string that can contain multiple car license plates. In Spain licence car plates are composed by four digits and three letters, but the user can separate them by an space or a hyphen. So I have this regular expresion to try to match all cases.</p>
<pre><cod... | <p>This might be an approach:</p>
<pre><code><?php
$input = "1234-ABC 2345 rBC 9998DDD 9657 lJi";
preg_match_all('/(\d{4}[-\s]*[a-z]{3})/i', $input, $matches);
$output = array_shift($matches);
array_walk($output, function(&$value) {
$value = strtoupper(str_replace(" ", "", $va... | I need a regexp to parse in php a car license plate | php|regex | 0 | 67 | 2 | 72,991,175 | 72,991,175 | 3 | true | 2022-07-15T08:13:43.193Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I need a regexp to parse in php a car license plate<p>I have a string that can contain multiple car license plates. In Spain licence car plates are composed ... |
73,016,744 | How to stop transition when checkbox is unchecked javafx<p>So I've made a checkbox that applies a scale transition to a rectangle when checked. But the problem is that the transition keeps going even after I uncheck the checkbox. Any ideas on how to make it stop after un-checking?</p>
<pre><code>checkbox.setOnAction(e ... | <p><a href="https://i.stack.imgur.com/V2E1Q.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V2E1Q.gif" alt="stopping scale transition javafx" /></a></p>
<p>checking whether checkbox is selected or not with <code>.isSelected()</code> method . In this approach , scaled node will back to xy = 1 scale if... | How to stop transition when checkbox is unchecked javafx | javafx|checkbox|transition | 2 | 67 | 2 | 73,016,974 | 73,016,974 | 3 | true | 2022-07-18T02:25:24.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to stop transition when checkbox is unchecked javafx<p>So I've made a checkbox that applies a scale transition to a rectangle when checked. But the probl... |
72,774,361 | Pure Pandas approach to converting data in a text file into a table<p>I am looking to convert data in a textile into a table (data frame) using just methods from Pandas.</p>
<h2>Textfile</h2>
<pre class="lang-bash prettyprint-override"><code>00100
11110
10110
10111
10101
01111
00111
11100
10000
11001
00010
01010
</code... | <p>This should work in your case:</p>
<pre><code>df = pd.read_fwf('untitled.txt', widths=[1,1,1,1,1], header=None)
print(df)
</code></pre>
<p>Result:</p>
<pre><code> 0 1 2 3 4
0 0 0 1 0 0
1 1 1 1 1 0
2 1 0 1 1 0
3 1 0 1 1 1
4 1 0 1 0 1
5 0 1 1 1 1
6 0 0 1 1 1
7 1 1 1... | Pure Pandas approach to converting data in a text file into a table | python|pandas|text-files | 1 | 67 | 2 | 72,774,659 | 72,774,659 | 3 | true | 2022-06-27T15:06:50.237Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pure Pandas approach to converting data in a text file into a table<p>I am looking to convert data in a textile into a table (data frame) using just methods ... |
72,951,243 | Bash iterate through fields of a TSV file and divide it by the sum of the column<p>I have a tsv file with several columns, and I would like to iterate through each field, and divide it by the sum of that column:</p>
<p>Input:</p>
<pre><code>A 1 2 1
B 1 0 3
</code></pre>
<p>Output:</p>
<pre><code>A ... | <p>You may use this 2-pass <code>awk</code>:</p>
<pre class="lang-bash prettyprint-override"><code>awk '
BEGIN {FS=OFS="\t"}
NR == FNR {
for (i=2; i<=NF; ++i)
sum[i] += $i
next
}
{
for (i=2; i<=NF; ++i)
$i = (sum[i] ? $i/sum[i] : 0)
}
1' file file
A 0.5 1 0.25
B ... | Bash iterate through fields of a TSV file and divide it by the sum of the column | bash|awk | 1 | 67 | 2 | 72,951,335 | 72,951,335 | 3 | true | 2022-07-12T11:01:03.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bash iterate through fields of a TSV file and divide it by the sum of the column<p>I have a tsv file with several columns, and I would like to iterate throug... |
72,819,663 | Create DataFrame columns based on another columns (faster solution)<p>I have a <code>DataFrame</code> with 1mln of rows and two columns <code>Type</code> and <code>Name</code> whose values are a lists with non-unique values. Both <code>Type</code> and <code>Name</code> columns have the same number of elements because ... | <p>You can explode the whole dataframe and then use your exploded dataframe and pivot it with a <code>list</code> as the aggfunc (Resetting the index to use the index as the grouper for the pivot)</p>
<pre><code>df.explode(column=['Type','Name']).reset_index().pivot_table(index='index',columns='Type', values='Name',agg... | Create DataFrame columns based on another columns (faster solution) | python|python-3.x|pandas | 2 | 67 | 2 | 72,819,961 | 72,819,961 | 3 | true | 2022-06-30T17:12:06.207Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create DataFrame columns based on another columns (faster solution)<p>I have a <code>DataFrame</code> with 1mln of rows and two columns <code>Type</code> and... |
73,020,768 | Combine a SPLIT formula with a formula that chooses N unique words from the SPLIT outcome<p>I got a sentence which I SPLIT into words without the punctuation. Next I want to choose three random, but unique words from that split. I use the formula as seen in cell I2. Is it possible to combine both the SPLIT formula and ... | <p>I understand that you want to get 3 random unique words from a string.<br>
in what follows i am going to demonstrate how get <em>truly</em> random words when the sheet is modified plus handling exceptions, ponctuation and more, like this take a look at <a href="https://docs.google.com/spreadsheets/d/1qBoDlKPKMSykbh-... | Combine a SPLIT formula with a formula that chooses N unique words from the SPLIT outcome | google-sheets|google-sheets-formula | 0 | 67 | 2 | 73,022,431 | 73,022,431 | 3 | true | 2022-07-18T10:22:14.867Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Combine a SPLIT formula with a formula that chooses N unique words from the SPLIT outcome<p>I got a sentence which I SPLIT into words without the punctuation... |
72,884,999 | How do equals and hashCode work under the hood?<p>I researched this question and the answers I got do not satisfy me as they don't explain these things deeply enough. So, it is known that for HashSet with a parametrized custom class it is necessary to override hashCode and equals in order to forbid duplicates. But in p... | <p>In your class, you explained it very well.</p>
<p>The part that you are missing is that at some point, your code will delegate to the equals and hashCode on the <code>color</code> attribute, which is implemented by the <code>java.lang.String</code> class.</p>
<p>See e.g. <a href="https://github.com/openjdk-mirror/jd... | How do equals and hashCode work under the hood? | java | -1 | 67 | 2 | 72,885,145 | 72,885,145 | 4 | true | 2022-07-06T14:06:30.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do equals and hashCode work under the hood?<p>I researched this question and the answers I got do not satisfy me as they don't explain these things deepl... |
72,909,615 | Is there a way to define an indexable type in golang?<p>I recently came across a library that does graph processing by direct indexing i.e <code>graph[key]</code>, I have a node tree which has its child nodes under a certain attribute <code>node.childs[key]</code>.</p>
<p>I was wondering if there is a way to define a t... | <p>No, it's not possible to do what you want. The spec does not allow it. <a href="https://go.dev/ref/spec#Index_expressions" rel="nofollow noreferrer">Spec: Index expressions:</a></p>
<blockquote>
<p>A primary expression of the form</p>
<pre><code>a[x]
</code></pre>
<p>denotes the element of the array, pointer to arra... | Is there a way to define an indexable type in golang? | go|indexing|types | 3 | 67 | 1 | 72,910,004 | 72,910,004 | 4 | true | 2022-07-08T09:49:48.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to define an indexable type in golang?<p>I recently came across a library that does graph processing by direct indexing i.e <code>graph[key]</... |
72,883,243 | How to filter in kotlin using predicates<p>What i'm trying to achieve is using a filter function with dynamic predicates.
What I did so far is creating a function that choose the best predicate:</p>
<pre><code>fun buildDatePredicate(dateFrom: LocalDate?, dateTo: LocalDate?): Predicate<MyClass> {
if (dateFrom ... | <p>A simple solution is to just call the <code>test</code>-method on the predicate:</p>
<pre><code>myList.filter {
val pred = buildDatePredicate(fromDate.toLocalDate(), toDate.toLocalDate())
pred.test(it)
}
</code></pre>
<p>But a more idiomatic solution in Kotlin is to not use <code>java.util.function.Predicat... | How to filter in kotlin using predicates | kotlin|filter|predicate | 0 | 67 | 1 | 72,883,397 | 72,883,397 | 4 | true | 2022-07-06T12:01:56.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to filter in kotlin using predicates<p>What i'm trying to achieve is using a filter function with dynamic predicates.
What I did so far is creating a fun... |
72,955,404 | Are you allowed to save to the managed object context (Core Data) while typing in a TextEditor (Text Field Input)?<p>The question is best explained in an example:</p>
<pre><code>struct MyEditor: View {
@Environment(\.managedObjectContext) var managedObjectContext
@ObservedObject var song: Song
var... | <p>Yes, it is possible to use publisher of managed object (<code>ObservedObject</code>) directly, like</p>
<pre><code>var body: some View {
TextEditor(text: $song.lyrics)
.navigationTitle(song.title)
.onReceive(song.publisher(for: \.lyrics) // << here !!
.debounce(for: 0.5, sc... | Are you allowed to save to the managed object context (Core Data) while typing in a TextEditor (Text Field Input)? | core-data|swiftui|combine|observedobject | 2 | 67 | 2 | 72,955,595 | 72,955,595 | 4 | true | 2022-07-12T16:17:47.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Are you allowed to save to the managed object context (Core Data) while typing in a TextEditor (Text Field Input)?<p>The question is best explained in an exa... |
72,938,130 | Printing out MyArray[i] within foreach Loop<p>I coudn't find a way to properly search this on the internet but something strange occured when trying to print out a simple array on visual studio with foreach loop.</p>
<pre><code>int[] MyArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
foreach (int i in MyArray)
{
Console.... | <p>A <code>foreach</code> loop doesn't give you an index value, it gives you <em>the value</em> of the element. In your case, the first element is <code>1</code>, which you then used <em>like an index</em> to get <code>2</code>.</p>
<p>Here's your code with some additional information in the WriteLine method to illustr... | Printing out MyArray[i] within foreach Loop | c#|arrays|foreach | 2 | 67 | 4 | 72,938,204 | 72,938,204 | 4 | true | 2022-07-11T11:50:01.063Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Printing out MyArray[i] within foreach Loop<p>I coudn't find a way to properly search this on the internet but something strange occured when trying to print... |
73,029,675 | Java static factory to create not thread safe object<p>In the Clean Code book there is an example which I would like to understand better:</p>
<pre><code>public static SimpleDateFormat makeStandardHttpDateFormat() {
// SimpleDateFormat is not thread safe, so we need to create each instance independently
SimpleD... | <p>There isn't anything about the static-ness, or anything about the factory method, that magically makes something thread-safe that otherwise isn't.</p>
<p>I assume the strategy he's trying to recommend is that every time a piece of code wants a <code>SimpleDateFormat</code> which represents that format, then rather t... | Java static factory to create not thread safe object | java|multithreading|thread-safety|static-initializer | 0 | 67 | 1 | 73,029,855 | 73,029,855 | 5 | true | 2022-07-18T23:41:30.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java static factory to create not thread safe object<p>In the Clean Code book there is an example which I would like to understand better:</p>
<pre><code>pub... |
72,889,442 | Syntax errors with stored procedure<pre><code>USE AdventureWorks2019;
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE OR ALTER PROCEDURE dbo.EmployeeGenderbyJobTitle
AS
BEGIN
SET NOCOUNT ON;
DROP TABLE IF EXISTS #EmployeeGenderbyJobTitle
GO
CREATE TABLE #EmployeeGenderbyJobTitle
(
... | <p><code>GO</code> signals the end of a batch in SQL Server so you can't use <code>go</code> in middle of a batch (a <code>procedure</code>, <code>function</code> etc.)</p>
<p>Reference <a href="https://docs.microsoft.com/en-us/sql/t-sql/language-elements/sql-server-utilities-statements-go" rel="nofollow noreferrer">SQ... | Syntax errors with stored procedure | sql|sql-server|stored-procedures|syntax-error | 0 | 67 | 2 | 72,889,490 | 72,889,490 | 5 | true | 2022-07-06T20:21:45.577Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Syntax errors with stored procedure<pre><code>USE AdventureWorks2019;
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE OR ALTER PROCEDURE dbo.Em... |
72,953,786 | Java methods not working properly in certain directories<pre><code> int[] arr = new int[4];
Arrays.fill(arr, 4);
Arrays.stream(arr).forEach(System.out::println);
</code></pre>
<p>I was solving a problem and few of the methods were not recognized. I felt that posting the entire code wasn't necessary so I created... | <p>You have a naming conflict. You have a class called <code>Arrays</code> in the same package which conflicts with the <code>java.util.Arrays</code> class you're trying to use.</p>
<p>Get rid of the import statement and use the fully qualified class name instead:</p>
<pre><code>java.util.Arrays.fill(arr, 4);
</code></... | Java methods not working properly in certain directories | java | -1 | 67 | 1 | 72,953,828 | 72,953,828 | 5 | true | 2022-07-12T14:13:49.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java methods not working properly in certain directories<pre><code> int[] arr = new int[4];
Arrays.fill(arr, 4);
Arrays.stream(arr).forEach(System.ou... |
72,972,154 | Sparse array filled with constant in Julia<p>I have a matrix, <code>M</code>, with very simple form: <code>M[i,j]=a</code> if <code>i==j</code> and <code>M[i,j]=b</code> everywhere else. <code>M</code> is very large (>10000) so I cannot initialize it or store it without using some sort of sparse matrix. It seems tha... | <p>It depends on what you want to do with your matrix, but if you are only interested in performing matrix-vector products, you can use the <code>FillArrays.jl</code> package in conjunction with the <code>LinearMaps.jl</code> package:</p>
<pre><code>julia> using LinearMaps, FillArrays
julia> n=100 # can be bigge... | Sparse array filled with constant in Julia | julia|constants|sparse-matrix | 5 | 67 | 1 | 72,972,427 | 72,972,427 | 5 | true | 2022-07-13T20:18:22.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sparse array filled with constant in Julia<p>I have a matrix, <code>M</code>, with very simple form: <code>M[i,j]=a</code> if <code>i==j</code> and <code>M[i... |
72,963,769 | "Sequence contains no element" when it actually find one<p>I have actually all working around :</p>
<ul>
<li>my connection work well</li>
<li>my table is getted</li>
<li>my field is founded into my class</li>
<li>I get my mac address from my item to compare it</li>
</ul>
<p>But when I continue my debug the LINQ code go... | <blockquote>
<p>Ok a simple cast into dynamic fix it (-_-')</p>
<pre><code> return (from Item in GetLocalTable<T>()
where (dynamic)fieldFound.GetValue(Item.Value) == value
select Item.Value).First();
</code></pre>
</blockquote>
<p><strong>UPDATE - 18/07/2022</strong></p>
<p>Solution above work b... | "Sequence contains no element" when it actually find one | c#|linq | 0 | 67 | 1 | 72,963,869 | 72,963,869 | -1 | true | 2022-07-13T09:16:45.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"Sequence contains no element" when it actually find one<p>I have actually all working around :</p>
<ul>
<li>my connection work well</li>
<li>my table is get... |
72,771,837 | Cannot invoke "java.io.DataInputStream.readLine()" because "this.input" is null<p>I've been trying to connect a socket client with a URL. Am I supposed to add the URL's IP in the Windows <code>host</code> file (<code>"C:\Windows\System32\drivers\etc\hosts"</code>)?</p>
<blockquote>
<p>What is socket?<br />
So... | <p>I solved the problem. I've changed <a href="https://socket.edu.net" rel="nofollow noreferrer">https://socket.edu.net</a> to socket.edu.net.</p>
<p>Then successfully connected.</p>
<p>EDIT: I restored hosts file and now in its original form and still connected successfully.</p> | Cannot invoke "java.io.DataInputStream.readLine()" because "this.input" is null | java|sockets|client | -3 | 67 | 1 | 72,772,696 | 72,772,696 | -1 | true | 2022-06-27T12:07:42.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot invoke "java.io.DataInputStream.readLine()" because "this.input" is null<p>I've been trying to connect a socket client with a URL. Am I supposed to ad... |
72,860,850 | Extract first few lines of URL's text data without 'get'ting entire page data?<p>Use case: Need to check if JSON data from a url has been updated by checking it's created_date field which lies in the first few lines. The entire page's JSON data is huge and i don't want to retrieve the entire page just to check the firs... | <p>Original poster stated below solution worked:</p>
<p>Instead of GET request, one can try HEAD request:</p>
<p>"The GET method requests a representation of the specified resource. Requests using GET should only retrieve data. The HEAD method asks for a response identical to a GET request, but without the respons... | Extract first few lines of URL's text data without 'get'ting entire page data? | python|json|parsing|python-requests | 0 | 67 | 1 | 72,868,986 | 72,868,986 | -1 | true | 2022-07-04T18:38:24.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extract first few lines of URL's text data without 'get'ting entire page data?<p>Use case: Need to check if JSON data from a url has been updated by checking... |
72,783,071 | What does field 'predicate' exactly mean in (find_if) function in cpp?<p>I'm a beginner in c++. I was learning STL especially vectors & iterators uses..I was trying to use (find_if) function to display even numbers on the screen.I knew that I have to return boolean value to the third field in the function(find_if) ... | <p>You can use <code>std::find_if</code>, but each call finds only one element (at best). That means you need a loop. The first time, you start at <code>v.begin()</code>. This will return the iterator of the first even element. To find the second even element, you have to start the second <code>find_if</code> search no... | What does field 'predicate' exactly mean in (find_if) function in cpp? | c++|function|vector|stl|iterator | 1 | 68 | 1 | 72,783,562 | 72,783,562 | 0 | true | 2022-06-28T08:23:25.503Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What does field 'predicate' exactly mean in (find_if) function in cpp?<p>I'm a beginner in c++. I was learning STL especially vectors & iterators uses..I... |
72,787,373 | sql (errno 150 "Foreign key constraint is incorrectly formed")<pre><code> public function up()
{
Schema::create('reviews', function (Blueprint $table) {
$table->id();
$table->integer('product_id')->unsigned()->index();
$table->foreign... | <p>Replace</p>
<pre><code>$table->integer('product_id')->unsigned()->index();
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
</code></pre>
<p>with this</p>
<pre><code>$table->unsignedBigInteger('product_id')->index();
$table->foreign('product_id')->... | sql (errno 150 "Foreign key constraint is incorrectly formed") | php|mysql|sql|laravel|migration | -1 | 68 | 1 | 72,787,501 | 72,787,501 | 0 | true | 2022-06-28T13:32:41.427Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
sql (errno 150 "Foreign key constraint is incorrectly formed")<pre><code> public function up()
{
Schema::create('reviews', function (B... |
72,791,246 | Get dense rank and gapped rank for all items in array<p>I want to calculate and store the dense rank and gapped rank for all entries in an array using PHP.</p>
<p>I want to do this in PHP (not MySQL because I am dealing with dynamic combinations 100,000 to 900 combinations per week, that’s why I cannot use MySQL to mak... | <p>Given that your results are already sorted in an ascending fashion...</p>
<ul>
<li><p>For dense ranking, you need to only increment your counter when a new score is encountered.</p>
</li>
<li><p>For gapped ranking, you need to unconditionally increment your counter and use the counter value for all members with the ... | Get dense rank and gapped rank for all items in array | php|arrays|ranking|dense-rank | 1 | 68 | 2 | 72,794,015 | 72,794,015 | 0 | true | 2022-06-28T18:06:35.027Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get dense rank and gapped rank for all items in array<p>I want to calculate and store the dense rank and gapped rank for all entries in an array using PHP.</... |
72,807,482 | Laravel empty request after send ajax on keyup<p>I have empty request from ajax.
In site request send this input value but controller not catching any request value
my code:</p>
<pre><code>public function searchUser(Request $request): JsonResponse
{
$string = $request->input('searchUser');
$user = DB::table... | <p>I have view your JavaScript in Pastebin</p>
<pre><code>$.ajax({
.
.
.
data: {
'searchUser': textFieldValue
},
.
.
.
});
</code></pre>
<p>I think the variable name in the data you want to pass into controller should same with controller</p>
<p><strong>Controller.php</strong></p>
<pre><code>$string = $request... | Laravel empty request after send ajax on keyup | ajax|laravel|request|laravel-8 | 0 | 68 | 1 | 72,810,390 | 72,810,390 | 0 | true | 2022-06-29T20:29:49.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel empty request after send ajax on keyup<p>I have empty request from ajax.
In site request send this input value but controller not catching any reques... |
72,806,023 | How can we avoid existing EBS volumes from being deleted?<p>I'm using Terraform 1.1.3 with aws provider 3.75.2 to create TF code for the existing 2-node infra. The code snippet is like below:</p>
<pre><code>module:
resource "aws_ebs_volume" "backend-logs" {
count = var.create_ebs_log_volumes ? var... | <p>It seems that the issue relates to AZ stuff. You can try the workaround by adding these lines in aws_instance block.</p>
<pre><code>lifecycle {
ignore_changes = [ availability_zone ]
}
</code></pre> | How can we avoid existing EBS volumes from being deleted? | amazon-web-services|amazon-ec2|terraform|terraform-provider-aws | 0 | 68 | 1 | 72,814,693 | 72,814,693 | 0 | true | 2022-06-29T18:09:36.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can we avoid existing EBS volumes from being deleted?<p>I'm using Terraform 1.1.3 with aws provider 3.75.2 to create TF code for the existing 2-node infr... |
72,839,321 | Unable to load CSS file within nodeJS app<p>I have an app that I followed from a tutorial for the backend in nodeJS and Express. My connection to MongoDB via Mongoose is working. However, I've been trying to add a front-end- at the moment- just a simple html/ejs/css form. My endpoints are loading in localhost but only ... | <p>Instead of</p>
<pre class="lang-html prettyprint-override"><code><link rel="stylesheet" type="text/css" href='/public/styles.css'/>
</code></pre>
<p>write</p>
<pre class="lang-html prettyprint-override"><code><link rel="stylesheet" type="text/css" href='/styles.css'/&... | Unable to load CSS file within nodeJS app | javascript|html|css|node.js|express | 0 | 68 | 2 | 72,840,047 | 72,840,047 | 0 | true | 2022-07-02T13:13:56.300Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to load CSS file within nodeJS app<p>I have an app that I followed from a tutorial for the backend in nodeJS and Express. My connection to MongoDB via... |
72,852,286 | How to find a list of lists of all possible paths in a tree<p>I need to find a list of lists when traversing through a list of objects in python and need to create every possible path</p>
<p>The output should look something like this</p>
<pre><code>[[24,137,237], [24,137,251], [24,151,155], [24,151,155,154]]
</code></p... | <p>Here's the solution I came up with:</p>
<pre class="lang-py prettyprint-override"><code>def getAllPaths(tree, upto = [], current_trees = []):
upto = upto + [tree.id]
if len(tree.children) == 0:
current_trees.append(upto)
else:
for branch in tree.children:
getAllPaths(branch, u... | How to find a list of lists of all possible paths in a tree | python|list|recursion | -1 | 68 | 2 | 72,852,538 | 72,852,538 | 0 | true | 2022-07-04T05:54:23.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find a list of lists of all possible paths in a tree<p>I need to find a list of lists when traversing through a list of objects in python and need to ... |
72,854,427 | How can i insert multiple images, in html tag using Python html<p>i want to write multiple html file that contains multiple images at once but in the outputs files shows the last image in the list of images only</p>
<pre><code>path = pathlib.Path('./'+str(f))
images = ['1.png','2.png','3.png'....]
for image in im... | <p>You'r code should be:</p>
<pre><code>with open(str(f)+".html","w") as file:
for image in images:
file.write('''<div class="card"><img src="'''+image+'''" alt=" "/>''')
</code></pre> | How can i insert multiple images, in html tag using Python html | python|html|path|pathlib | 0 | 68 | 1 | 72,855,240 | 72,855,240 | 0 | true | 2022-07-04T09:20:20.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i insert multiple images, in html tag using Python html<p>i want to write multiple html file that contains multiple images at once but in the outputs... |
72,851,711 | Vaadin LoginForm Failure Handler Breaks login?error URL<p>I'm using the Vaadin LoginForm with Spring Security in a Spring Boot project. By default it redirects to <code>/login?error</code> if authentication fails for any reason. I want to redirect for certain failures, specifically if the user hasn't validated their em... | <p>You setting a <code>failureHandler</code> overrides the default of simply redirecting to <code>/login?error</code> (and automatically configuring this URL to not require authentication). Looking at the code you can only have one <code>AuthenticationFailureHandler</code>.</p> | Vaadin LoginForm Failure Handler Breaks login?error URL | spring-boot|kotlin|spring-security|vaadin|vaadin-flow | 0 | 68 | 1 | 72,859,368 | 72,859,368 | 0 | true | 2022-07-04T04:13:05.090Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vaadin LoginForm Failure Handler Breaks login?error URL<p>I'm using the Vaadin LoginForm with Spring Security in a Spring Boot project. By default it redirec... |
72,862,538 | pandas_datareader keeps returning historical Yahoo FInance data only for last 12 months<p>I'm following a portfolio optimization lecture on YouTube and writing the codes as it progresses (running Jupyter Notebook via VS Code), but stumbled upon an issue I just cannot manage to get fixed.</p>
<p>Below are the libraries ... | <p>Just found out where the problem was...</p>
<p>I was using decommissioned tickers for Facebook, which as we all know is now META, therefore 'META' and no longer 'FB', and Google's (Alphabet's nowadays, also as we all know) ticker was missing an 'L' at the end.</p> | pandas_datareader keeps returning historical Yahoo FInance data only for last 12 months | python|pandas|pandas-datareader | 1 | 68 | 1 | 72,871,230 | 72,871,230 | 0 | true | 2022-07-04T22:34:30.937Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pandas_datareader keeps returning historical Yahoo FInance data only for last 12 months<p>I'm following a portfolio optimization lecture on YouTube and writi... |
72,845,179 | Socket.IO is creating 2 socket IDS every time a new user joins a room instead of one<p>I am creating a collaborative react app, in that every time a new user is joining the room the socket io is generating 2 id's for every user, I have followed the documentation code, in the same way, I am not sure why is this happenin... | <p>If you have strict mode on, what's by default, then useEffect is called twice (from React 18). And your connection is created twice. And as every connection generates new Id, you get two id's.</p>
<p><a href="https://stackoverflow.com/a/72238236/8522881">https://stackoverflow.com/a/72238236/8522881</a></p>
<p><a hre... | Socket.IO is creating 2 socket IDS every time a new user joins a room instead of one | node.js|reactjs|sockets|socket.io | 0 | 68 | 1 | 72,871,348 | 72,871,348 | 0 | true | 2022-07-03T08:58:06.403Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Socket.IO is creating 2 socket IDS every time a new user joins a room instead of one<p>I am creating a collaborative react app, in that every time a new user... |
72,828,518 | How to remove children background color from ExpansionTile title on animation?<p>This is my code:</p>
<pre><code>class Temp extends StatefulWidget {
const Temp({Key? key}) : super(key: key);
@override
State<Temp> createState() => _TempState();
}
// stores ExpansionPanel state information
class Item {
... | <p>It is a bug in flutter. Issue is <a href="https://github.com/flutter/flutter/issues/107030" rel="nofollow noreferrer">here</a></p> | How to remove children background color from ExpansionTile title on animation? | flutter|dart | 1 | 68 | 1 | 72,873,538 | 72,873,538 | 0 | true | 2022-07-01T11:22:20.503Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove children background color from ExpansionTile title on animation?<p>This is my code:</p>
<pre><code>class Temp extends StatefulWidget {
const ... |
72,888,755 | Angular HTTP client GeoServer REST API mapping<p>I'm using an Angular service to interact with the GeoServer REST API. The JSON response for getting layers is:</p>
<pre><code>{
"layers": {
"layer": [
{
"name": "facility",
&... | <p>The error is that line:</p>
<pre><code>return this.http.get<Layer[]>(layerUrl, this.httpOptions)
</code></pre>
<p>You are writing that the return type from the GET should be <em>Layer[]</em> but it is not. It is an Object with a property Layers. The type of GET (value in <>) should be the type that the A... | Angular HTTP client GeoServer REST API mapping | angular|http|geoserver | -2 | 68 | 1 | 72,889,192 | 72,889,192 | 0 | true | 2022-07-06T19:10:37.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular HTTP client GeoServer REST API mapping<p>I'm using an Angular service to interact with the GeoServer REST API. The JSON response for getting layers ... |
72,891,491 | Creating a table in vuetify with v-data-iterator passing an object from an api<p>After a full day of searching and testing, here I am. I first tried to do a simple Row with 2 columns table and iterate on the object to fill the left column with the it's keys, but couldn't find how to do the same with the value of the ke... | <p>You could convert that object into an array of objects like so</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const exception= { producer: 'John', director: 'Jane', assista... | Creating a table in vuetify with v-data-iterator passing an object from an api | javascript|html|vue.js|vuetify.js|data-conversion | 0 | 68 | 1 | 72,891,583 | 72,891,583 | 0 | true | 2022-07-07T01:54:18.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating a table in vuetify with v-data-iterator passing an object from an api<p>After a full day of searching and testing, here I am. I first tried to do a ... |
72,890,904 | How to align strings in columns?<p>I am trying to print out a custom format but am facing an issue.</p>
<pre class="lang-py prettyprint-override"><code>header = ['string', 'longer string', 'str']
header1, header2, header3 = header
data = ['string', 'str', 'longest string']
data1, data2, data3 = data
len1 = len(header1)... | <p>Each cell is constructed according to the longest content, with additional spaces for any shortfall, printing a | at the beginning of each line, and the rest of the | is constructed using the end parameter of print</p>
<p>The content is placed in a nested list to facilitate looping, other ways of doing this are poss... | How to align strings in columns? | python|string | 0 | 68 | 4 | 72,891,908 | 72,891,908 | 0 | true | 2022-07-06T23:41:00.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to align strings in columns?<p>I am trying to print out a custom format but am facing an issue.</p>
<pre class="lang-py prettyprint-override"><code>heade... |
72,871,322 | Finding and averaging elements of multiple dataframes that are within 10% of each other<p>I have objects that store values are dataframes. I have been able to compare if values from two dataframes are within 10% of each other. However, I am having difficulty extending this to multiple dataframes. Moreover, I am wonderi... | <h2>Results:</h2>
<p>Using my solution on the dataframes of your image, I get the following:<br />
Threshold outlier = 0.2:</p>
<pre class="lang-py prettyprint-override"><code> 0
0 1.000000
1 1493.500000
2 5191.333333
3 35785.333333
4 43586.500000
5 78486.000000
6 100000.000000
</code><... | Finding and averaging elements of multiple dataframes that are within 10% of each other | python|arrays|pandas|numpy|comparison | 0 | 68 | 1 | 72,900,469 | 72,900,469 | 0 | true | 2022-07-05T14:42:44.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finding and averaging elements of multiple dataframes that are within 10% of each other<p>I have objects that store values are dataframes. I have been able t... |
72,894,508 | have a problem accessing the files in wwwroot<p>In the wwwroot folder I can access all files(images, java script, css, zip). But when I upload an apk file, it is not accessible.
When I compress this apk file to zip I can download it</p> | <p>AspNetCore uses this <a href="https://www.iana.org/assignments/media-types/media-types.xhtml" rel="nofollow noreferrer">list of media types</a> and according to this list, it does not know what an APK file is, so AspNetCore will return a 404 error.</p>
<p>To allow this, you can map your own. REF: <a href="https://do... | have a problem accessing the files in wwwroot | asp.net-core | 0 | 68 | 1 | 72,903,102 | 72,903,102 | 0 | true | 2022-07-07T08:21:50.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
have a problem accessing the files in wwwroot<p>In the wwwroot folder I can access all files(images, java script, css, zip). But when I upload an apk file, i... |
72,910,372 | How to get all previous logs written during current run (python logging)<p>I'm using the python <a href="https://docs.python.org/3/library/logging.html" rel="nofollow noreferrer">logging</a> module. How can I get all of the previously outputted logs that have been written-out by <code>logger</code> since the applicatio... | <p>If you're writing to a log file, then you can simply <a href="https://stackoverflow.com/questions/72910245/how-to-get-log-file-path-from-logging-after-getlogger">get the path to the log file</a> and then read its contents</p>
<pre><code>import logging
logger = logging.getLogger( __name__ )
# attempt to get debug lo... | How to get all previous logs written during current run (python logging) | python|logging | 0 | 68 | 1 | 72,911,971 | 72,911,971 | 0 | true | 2022-07-08T10:54:47.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get all previous logs written during current run (python logging)<p>I'm using the python <a href="https://docs.python.org/3/library/logging.html" rel=... |
72,903,796 | How to find duplicate emails due to case sensitivity<p>I am trying to find the IDs that have duplicate emails due to case sensitivity.</p>
<p>For below table</p>
<pre><code>ID Email
101 example@gmail.com
101 EXAMPLE@gmail.com
102 email@gmail.com
102 email@gmail.com
103 la@gmail.com
103 sf@y... | <p>The self-join suggestion was helpful. This should work!</p>
<pre><code>SELECT
distinct a.id
,a.email
FROM table1 AS a
JOIN table1 AS b
ON a.id = b.id
WHERE a.email != b.email
AND lower(a.email) = lower(b.email)
</code></pre> | How to find duplicate emails due to case sensitivity | sql|snowflake-cloud-data-platform | -2 | 68 | 3 | 72,913,214 | 72,913,214 | 0 | true | 2022-07-07T20:21:48.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find duplicate emails due to case sensitivity<p>I am trying to find the IDs that have duplicate emails due to case sensitivity.</p>
<p>For below table... |
72,917,391 | look up dynamic value from range in another table<p>I have 2 tables. The first one is a detail table with years and actual limit values. The second table has max control limits but only for certain years.</p>
<p><a href="https://i.stack.imgur.com/EsVrr.png" rel="nofollow noreferrer">Table 1 & 2</a></p>
<p>What I wa... | <p>You may use <code>Row_Number()</code> function as the following to remove duplicates:</p>
<pre><code>with cte as
(
Select D.id,D.yeard,D.val, C.limitVal,
row_number() over (partition by D.id order by C.yeard desc) as rn from
detailTbl D left join controlTbl C
on D.yeard>=C.yeard
)
Select B.id,B.yeard,B.... | look up dynamic value from range in another table | sql|join|range|max|lookup | -1 | 68 | 1 | 72,918,248 | 72,918,248 | 0 | true | 2022-07-08T22:00:52.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
look up dynamic value from range in another table<p>I have 2 tables. The first one is a detail table with years and actual limit values. The second table has... |
72,919,135 | How to write Assert condition to check a particular element is not displayed for dummy users?<pre><code>By.xpath("//button[@id='Edit']")
</code></pre>
<ul>
<li>This particular Edit button should be displayed for Admin users</li>
<li>If we login with a different user, we are not showing them the Edit Button</l... | <p>I will search for all elements with this XPath and put them in List:</p>
<pre><code>List<WebElement> elements = driver.findElements(By.Xpath("//button[@id='Edit']"));
</code></pre>
<p>Then I will check if the count (size) of the elements in the list is zero, this will mean that the element was not fo... | How to write Assert condition to check a particular element is not displayed for dummy users? | java|selenium|selenium-webdriver|assertion | 2 | 68 | 2 | 72,919,178 | 72,919,178 | 0 | true | 2022-07-09T05:19:08.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to write Assert condition to check a particular element is not displayed for dummy users?<pre><code>By.xpath("//button[@id='Edit']")
</code></p... |
72,929,870 | FirebaseError: Missing or insufficient permissions. with getDocs()<p>I tried reading the first couple of answers but none seem to have the same rule with the one I currently have my hands on.</p>
<p>When I try to call the getDocs() function (using react)</p>
<pre><code>let userInfo = await getDoc(doc(db, chargerInfo.us... | <p>You can change to:</p>
<pre><code> ...
allow read: if true;
allow update: if true;
...
</code></pre> | FirebaseError: Missing or insufficient permissions. with getDocs() | javascript|firebase|google-cloud-firestore|firebase-security | 0 | 68 | 2 | 72,929,920 | 72,929,920 | 0 | true | 2022-07-10T15:58:20.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
FirebaseError: Missing or insufficient permissions. with getDocs()<p>I tried reading the first couple of answers but none seem to have the same rule with the... |
72,901,637 | CS50 Blur (Floating point exception core dumped)<p>Im doing the filter-less problem in CS50, i did pretty much all the other filter correctly but im a little struggling with the blur.</p>
<p>I don't really get how malloc works (i just ctrl+c ctrl+v how they allocated space for 'image' to do 'copy') and how to do the av... | <p>Thanks to everyone for your useful tips and remarks</p>
<p>There was a lot of problems you guys pointed to and i tried fixing everything</p>
<p>First, i and j started at < 0 so it was impossible to go through the for loop, keeping x and y at 0 and causing a floating point exception by dividing by 0.
So i just def... | CS50 Blur (Floating point exception core dumped) | c|cs50|blur|floating-point-exceptions | -1 | 68 | 1 | 72,941,070 | 72,941,070 | 0 | true | 2022-07-07T16:53:38.187Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CS50 Blur (Floating point exception core dumped)<p>Im doing the filter-less problem in CS50, i did pretty much all the other filter correctly but im a little... |
72,940,561 | Reading txt file line by line and field by field<p>I'm struggling to read the attached TXT file to present as csv each field read from the file I made a code that comes close to what I want but I don't advance.</p>
<p>TXT file format:</p>
<pre><code> COMPANY TEST OF BRAZIL- Junho/2022 Horista
37-6 WALT... | <p>I think that you may use the following code to have your desired output. You should make sure if your first data has similar template. You can also edit the template if your desired output needs to be edited. Please see the code:</p>
<pre><code>!pip install ttp
from ttp import ttp
import json
with open ("test... | Reading txt file line by line and field by field | python|csv|txt | 0 | 68 | 1 | 72,953,509 | 72,953,509 | 0 | true | 2022-07-11T14:57:51.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reading txt file line by line and field by field<p>I'm struggling to read the attached TXT file to present as csv each field read from the file I made a code... |
72,949,842 | text-underline decoration not apply on all child element<p>I have a label "Show more", that display hidden content. I want all child element of this label to be underline including the arrow. The problem is that only the text has text-decoration and not the arrow. How can I solve this issue in order that also... | <p>So instead of using <code>text-decoration</code> (which only applies to text) you can either use <code>border-bottom</code> or to keep it more complicated there is also the possibility of using a css pseudo class.</p>
<h4>Using border bottom</h4>
<p><div class="snippet" data-lang="js" data-hide="false" data-console=... | text-underline decoration not apply on all child element | html|css|text-decorations | 1 | 68 | 3 | 72,958,452 | 72,958,452 | 0 | true | 2022-07-12T09:14:40.507Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
text-underline decoration not apply on all child element<p>I have a label "Show more", that display hidden content. I want all child element of thi... |
72,964,920 | UNITY - Crashes whenever I try to get a variable from another script<p>I have this simulation where the "Hunter" scans the area with the scannereyes object inside the hunter for an object called "Apple" and whenever it sees the apple its supposed to hunt after it. This is the same with other hunters... | <p>I don't understand if the engine crashes when you start the game or when you just save the scripts.</p>
<p>As far as I can see the Hunter checks that there is at least one GameObject with the "food" tag on it, but you are doing this in the Update() method.
This is very bad for performance since you are cal... | UNITY - Crashes whenever I try to get a variable from another script | c#|unity3d | -1 | 68 | 1 | 72,965,124 | 72,965,124 | 0 | true | 2022-07-13T10:39:59.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UNITY - Crashes whenever I try to get a variable from another script<p>I have this simulation where the "Hunter" scans the area with the scannereye... |
72,969,756 | how to get a full news article from a website with scrapy<p>I'm still learning how to do web scraping, and I'm trying to scrape a website by getting all the articles from an index page and then grab their information, and also the full text.
With the code below, I could get all the information I need – date, time, cate... | <p>Now your code is working fine with pulling full text along with pagination in start_urls. Actually, I go to the details page and from the details page, I grab all the required data items using xpath expression.</p>
<pre><code>import scrapy
from scrapy.crawler import CrawlerProcess
class CoalNewsFromOilPrice(scrapy.... | how to get a full news article from a website with scrapy | python|scrapy | 0 | 68 | 2 | 72,970,255 | 72,970,255 | 0 | true | 2022-07-13T16:38:20.553Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to get a full news article from a website with scrapy<p>I'm still learning how to do web scraping, and I'm trying to scrape a website by getting all the ... |
72,973,496 | Clearing Date picker in PySimpleGUI<p>I'm having trouble with the CalendarButton in PySimpleGUI whereby when I clear user input it also clears the title of the CalendarButton. So I'm left with a Calendar button with no title. I only need to clear the user input entries and not anything else like button titles. Any idea... | <p>All the items in <code>values</code> are not only for <code>Input</code> elements, but also some other elements, like the <code>CalendarButton</code> element here. It will also update the text of <code>CalendarButton</code> if you call your function <code>clear_input</code>.</p>
<p>Try to specify the condition for w... | Clearing Date picker in PySimpleGUI | python|pysimplegui | 0 | 68 | 1 | 72,975,720 | 72,975,720 | 0 | true | 2022-07-13T22:56:15.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Clearing Date picker in PySimpleGUI<p>I'm having trouble with the CalendarButton in PySimpleGUI whereby when I clear user input it also clears the title of t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.