question_id int64 37.6M 73.2M | input_text stringlengths 88 52.4k | output_text stringlengths 37 35.6k | title stringlengths 15 150 | tags stringlengths 1 107 | q_score int64 -19 397 | view_count int64 3 879k | answer_count int64 1 21 | accepted_answer_id int64 37.6M 73.8M | answer_id int64 37.6M 73.8M | a_score int64 -5 1.29k | is_accepted bool 1
class | creation_date stringlengths 20 24 | input_text_instruct stringlengths 251 52.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73,003,608 | Power Query replace values (enter step for potential future occurrence)<p>In the Power Query editor of Power BI I try to enter a replace value step for something that currently does not exist in the table. But I know that future versions of the table will include the thing that I will have to replace. However the edito... | <p>I can't reproduce the problem either. Copy below query into the Advanced Editor and see yourself.</p>
<pre><code>let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText(
"i45WMjQ0MNYzNFWK1YlWMjIwMNCzNAGzTSwszcEMQz0jY6BQLAA="... | Power Query replace values (enter step for potential future occurrence) | powerbi|powerquery | 0 | 63 | 2 | 73,003,831 | 73,003,831 | 2 | true | 2022-07-16T11:00:04.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Power Query replace values (enter step for potential future occurrence)<p>In the Power Query editor of Power BI I try to enter a replace value step for somet... |
73,001,554 | How to define a TypedDict class with keys containing hyphens<p>How can I create a TypedDict class that supports keys containing hyphens or other characters that are supported in strings, such as "justify-content" in the example below.</p>
<pre class="lang-py prettyprint-override"><code>from typing import Type... | <p>It is possible with the functional syntax:</p>
<pre class="lang-py prettyprint-override"><code>from typing import TypedDict, Literal
from typing_extensions import NotRequired
Attributes = TypedDict(
"Attributes",
{
"width": NotRequired[
str,
],
"... | How to define a TypedDict class with keys containing hyphens | python|python-typing|typing | 2 | 63 | 1 | 73,005,975 | 73,005,975 | 2 | true | 2022-07-16T04:36:56.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to define a TypedDict class with keys containing hyphens<p>How can I create a TypedDict class that supports keys containing hyphens or other characters t... |
73,005,604 | How to make 'First Row' the Header when saving data to SQL Server with Databricks<p>Can someone let me know make the first row the header when saving to SQL Server with Databricks</p>
<p>I am currently using the following code to upload / save to SQL in Azure</p>
<pre><code>jdbcUrl = f"jdbc:sqlserver://{DBServer}.... | <p>JDBC driver creates the table according to the schema. It looks like that you're reading from the CSV file, and don't specify <code>.option("header", "true")</code> when reading. Just add this option to your read operation.</p> | How to make 'First Row' the Header when saving data to SQL Server with Databricks | pyspark|databricks|azure-databricks | 0 | 63 | 1 | 73,006,114 | 73,006,114 | 2 | true | 2022-07-16T15:48:58.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make 'First Row' the Header when saving data to SQL Server with Databricks<p>Can someone let me know make the first row the header when saving to SQL ... |
73,007,627 | Implementing redux-toolkit error with async function types and usage<p>I'm trying to implement react redux toolkit into my application. Everything went fine, but I will need a async function. I was following the basic docs to implement it but I don't know the cause of this issue.<br>
The first issue is regarding to typ... | <p>Inside the thunk, where you have <code>(dispatch: AppDispatch)</code>, remove the <code>: AppDispatch</code> part. That's already implied by the <code>AppThunk</code> usage right before it.</p> | Implementing redux-toolkit error with async function types and usage | typescript|redux|react-redux|redux-thunk|redux-toolkit | 0 | 63 | 1 | 73,007,925 | 73,007,925 | 2 | true | 2022-07-16T21:00:44.207Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Implementing redux-toolkit error with async function types and usage<p>I'm trying to implement react redux toolkit into my application. Everything went fine,... |
73,015,401 | React - update state with timeout in reducer<p>Can anyone help me to update state with timeout in react reducer.</p>
<p>I don't have much experience even with pure javascript, so I can hardly find an answer myself at this moment.</p>
<p>In my first ever react app (with useContex and useReducer) i have simple <strong>BU... | <p>Reducers are intended to be “pure” and synchronous, and they shouldn't mutate input arguments. Since mutating state after a delay is a side-effect, you should consider instead handling this in a <code>useEffect</code> hook separately.</p>
<p>E.g.:</p>
<pre class="lang-js prettyprint-override"><code>const SomeCompone... | React - update state with timeout in reducer | reactjs|settimeout|use-reducer | 1 | 63 | 2 | 73,015,899 | 73,015,899 | 2 | true | 2022-07-17T21:13:13.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React - update state with timeout in reducer<p>Can anyone help me to update state with timeout in react reducer.</p>
<p>I don't have much experience even wit... |
73,019,149 | Finding universal path that will work on both computers while reading the same data<p>How can I change code on both computers into code that will universally recognise the same file (see bellow absolute paths) that is located differently. I don't want to move data and making the same repo locations on both computers be... | <pre><code>from pathlib import Path
if running_on_pc_1():
base_path = Path("D:")
else:
base_path = Path("C:/Users/Uporabnik/Desktop/desktop/IJS/CESTEL")
file_path = base_path / "data/text.txt"
</code></pre>
<p>or...</p>
<pre><code>from pathlib import Path
import os
base_path = Path... | Finding universal path that will work on both computers while reading the same data | python|pandas|dataframe|path|relative-path | 1 | 63 | 2 | 73,019,252 | 73,019,252 | 2 | true | 2022-07-18T08:09:49.177Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finding universal path that will work on both computers while reading the same data<p>How can I change code on both computers into code that will universally... |
73,023,322 | Present results with alamofire/Swift<p><a href="https://i.stack.imgur.com/Qtjys.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qtjys.png" alt="My JSON" /></a></p>
<p>When I try to present the results I received this message "Response could not be decoded because of error:
The data couldn’t be r... | <p>Two mistakes</p>
<ol>
<li><p>The root object is a dictionary so it's <code>(type: Response.self)</code></p>
</li>
<li><p>and <code>model.data</code> is <code>[Datum]</code> so declare</p>
<pre><code>struct PostPresenter: Identifiable {
let id = UUID()
let data: [Datum]
init(with response: Response) {
... | Present results with alamofire/Swift | json|swift|alamofire|codable|jsondecoder | -1 | 63 | 2 | 73,023,606 | 73,023,606 | 2 | true | 2022-07-18T13:42:13.667Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Present results with alamofire/Swift<p><a href="https://i.stack.imgur.com/Qtjys.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qtjys.png"... |
73,029,348 | Dependent Dropdowns: 1 Independent, multiple dependent<p>So, this goal seemed simple at first, but I can't seem to wrap my head around how to accomplish it.</p>
<p>I have these independent dropdowns, with between 3 to 4 dependent dropdowns associated with each independent. I would like to be able to apply the associate... | <p>From your showing script, I guessed that you might have wanted to directly run the script with the script editor. So, in this modification, I didn't use the event object. By this, you can run the script with the OnEdit trigger and also directly run this modified script with the script editor.</p>
<p>And, in your scr... | Dependent Dropdowns: 1 Independent, multiple dependent | google-apps-script|google-sheets | 1 | 63 | 1 | 73,029,768 | 73,029,768 | 2 | true | 2022-07-18T22:45:10.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dependent Dropdowns: 1 Independent, multiple dependent<p>So, this goal seemed simple at first, but I can't seem to wrap my head around how to accomplish it.<... |
73,009,310 | Is it possible to extract the download syllabus link with requests or scrapy without selenium<p>I am trying to extract the download syllabus link from this website-
<a href="https://www.simplilearn.com/big-data-and-analytics/python-for-data-science-training" rel="nofollow noreferrer">https://www.simplilearn.com/big-dat... | <p>In this particular case,</p>
<p>The URL link is base64 encoded in the div with id = "DownloadSyllabus2", on its <code>data-url</code> attribute (right above the a href you are mentioning):</p>
<p><code>aHR0cHM6Ly93d3cuc2ltcGxpbGVhcm4uY29tL2ljZTkvcGRmcy9hZ2VuZGEvb25saW5lL0RhdGElMjBTY2llbmNlJTIwd2l0aCUyMFB5... | Is it possible to extract the download syllabus link with requests or scrapy without selenium | javascript|python|web-scraping|python-requests|scrapy | 0 | 63 | 1 | 73,062,049 | 73,062,049 | 2 | true | 2022-07-17T04:43:02.730Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to extract the download syllabus link with requests or scrapy without selenium<p>I am trying to extract the download syllabus link from this w... |
72,840,300 | & sign will not copy to clipboard<p>I am trying to copy the & sign to the clipboard using the code below. But it just gives me an error "| was unexpected at this time."</p>
<pre><code>import os
def addToClipBoard(text):
command = 'echo ' + text.strip() + '| clip'
os.system(command)
addToClipBoar... | <p>You need to quote (or escape) the <code>&</code> character:</p>
<pre class="lang-py prettyprint-override"><code>import os
def addToClipBoard(text):
command = "echo '{}' | clip".format(text.strip())
os.system(command)
addToClipBoard('&')
</code></pre>
<p>In Bash, <code>&</code> is a c... | & sign will not copy to clipboard | python | 1 | 63 | 3 | 72,840,351 | 72,840,351 | 2 | true | 2022-07-02T15:33:37.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
& sign will not copy to clipboard<p>I am trying to copy the & sign to the clipboard using the code below. But it just gives me an error "| was unexp... |
72,897,523 | GroupBy then Select with conditional record addition<p>I am having LINQ query in which I have to response with a result set which is depending on inner field collection. I have done the thing via LINQ query then a foreach but I wanted to avoid foreach loop and do it somehow from group by</p>
<pre class="lang-cs prettyp... | <p>You can use <a href="https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.selectmany?view=net-6.0" rel="nofollow noreferrer"><code>SelectMany</code></a> to flatten the array, e.g.:</p>
<pre><code>List<ResultModel> result = _context.MainRecordTable.Where(h => h.id)
.Select(lev => new
... | GroupBy then Select with conditional record addition | c#|linq|group-by | 2 | 63 | 2 | 72,897,713 | 72,897,713 | 2 | true | 2022-07-07T12:04:43.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GroupBy then Select with conditional record addition<p>I am having LINQ query in which I have to response with a result set which is depending on inner field... |
72,866,736 | Can we stop event hub capture for time being & re-enable?<p>I have the avro files generated by Event Hub Capture & stored in ADLS Gen1. Now I would like to migrate all these files ( size ~6 TB) to ADLS Gen2. During migration process, I don't want event hub capture to generate <em>new avro files</em> & place in ... | <p>Sure, you can disable the capture temporarily. However, make sure your retention period is long enough - 90 days for dedicated, that no data is purged w/o being captured.</p>
<p>See the capture description and the 'enabled' bool here > <a href="https://docs.microsoft.com/en-us/azure/templates/microsoft.eventhub/n... | Can we stop event hub capture for time being & re-enable? | azure|azure-data-lake|azure-eventhub|azure-eventhub-capture | 0 | 63 | 1 | 72,873,227 | 72,873,227 | 2 | true | 2022-07-05T09:04:36.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can we stop event hub capture for time being & re-enable?<p>I have the avro files generated by Event Hub Capture & stored in ADLS Gen1. Now I would like ... |
72,815,146 | How to convert a list of numbers to ctpyes array in Python<p>I imported a C library into Python and want to use the C function from Python.</p>
<p>The data in Python is saved in a list, for example: <code>user_data = [1, 255, 30, 100, 0, 12, 5, 216]</code>. All elements in the list are numbers (0..255). I need to conve... | <p>If you want <code>0</code> to just be a normal number, then you need another argument to your C function so that it knows how long the array is (unless the length is already known in advance on the C side). For the sake of a concrete example, I'll go with this as your C function:</p>
<pre class="lang-c prettyprint-o... | How to convert a list of numbers to ctpyes array in Python | python|arrays|list|pointers|ctypes | 1 | 63 | 2 | 72,822,979 | 72,822,979 | 2 | true | 2022-06-30T11:41:15.680Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert a list of numbers to ctpyes array in Python<p>I imported a C library into Python and want to use the C function from Python.</p>
<p>The data i... |
72,839,417 | How to stop from while loop in pyqt?<p>I tried to design a pyqt gui in when I press "x" will stop <code>run</code> function <code>a</code> counter , what should i do ?</p>
<p>I only know to use the following code</p>
<pre><code> def closeEvent(self,event):
pass
</code></pre>
<p>Logic Code</... | <p>Add an initiator and an is_running variable in your Thread class like so :</p>
<pre><code>def __init__(self):
self.is_running = True
</code></pre>
<p>Then make your loop depend on the truthness of this new variable :</p>
<pre><code>def run(self):
a = 0
while self.is_running:
... yo... | How to stop from while loop in pyqt? | python|pyqt5 | 1 | 63 | 1 | 72,839,702 | 72,839,702 | 2 | true | 2022-07-02T13:29:53.537Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to stop from while loop in pyqt?<p>I tried to design a pyqt gui in when I press "x" will stop <code>run</code> function <code>a</code> counter... |
72,888,978 | Pulling a vec out of a vec of structs<p>I'm working on a compiler for a toy language and I want to be able to check for errors on each file. I have a <code>MooFile</code> struct that has a <code>Vec<anyhow::Error></code> where I put errors when they are encountered. Now I want to go through the files, get the err... | <p>Most of these errors come from how you create your iterators. If you assume <code>x</code> is a <code>Vec<Y></code>:</p>
<ul>
<li><code>x.iter()</code>: Consumes <code>&x</code> and creates an iterator of <code>&Y</code>.</li>
<li><code>x.iter_mut()</code>: Consumes <code>&mut x</code> and creates ... | Pulling a vec out of a vec of structs | rust | 0 | 63 | 1 | 72,889,312 | 72,889,312 | 2 | true | 2022-07-06T19:33:27.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pulling a vec out of a vec of structs<p>I'm working on a compiler for a toy language and I want to be able to check for errors on each file. I have a <code>M... |
72,963,968 | How to optimize duplicated code between forms in C#<p>I have a self-made project called "Library Management", I have many forms: Book Form, Book Type Form, Author Form,...
But I realized that the code in the forms is very similar (only in some places like controls, ..).
How to reduce this duplication?. I know... | <p>There are a number of approaches you could take, but with inheritance, you could create an abstract base class:</p>
<pre><code>public abstract BaseForm : Form
{
protected virtual void CreateDALObject();
protected virtual void BindingData();
protected virtual void ApplyUIStrings();
protected void For... | How to optimize duplicated code between forms in C# | c#|code-duplication | 1 | 63 | 3 | 72,964,185 | 72,964,185 | 2 | true | 2022-07-13T09:31:02.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to optimize duplicated code between forms in C#<p>I have a self-made project called "Library Management", I have many forms: Book Form, Book Ty... |
72,861,034 | shopify text schema text not showing up<p>I can't work out why my text filed won't show, this is sections/product.liquid
the h1 wont show which tells me it thinks its empty but not only have I set the default but when I go into the editor I change the text it still wont show
note: shopify lets me save the file with no ... | <pre><code>{% unless section.settings.Under_Product_Title == blank %}
<h1>{{ section.settings.Under_Product_Title }}</h1>
{% endunless %}
{% schema %}
{
"name": "Product pages",
"settings": [
{
"type": "text",
... | shopify text schema text not showing up | shopify|liquid | 0 | 63 | 1 | 72,869,465 | 72,869,465 | 2 | true | 2022-07-04T19:02:39.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
shopify text schema text not showing up<p>I can't work out why my text filed won't show, this is sections/product.liquid
the h1 wont show which tells me it t... |
72,816,742 | Routine for non-manual argument of a set of variables in coalesce() dplyr function<p>I have a list of dfs to be combined into one. These dfs have some matching columns and rows and some distinct or missing ones.</p>
<p>The minimum structure (for understanding) of the first two dfs.</p>
<p>df1:</p>
<pre><code>df1 <- ... | <p>Joins by their nature don't natively fill in positions we have to implement a fix to solve this problem, and although you can use if else statements as shown in the answer above, <code>coalesce()</code> is a much cleaner function to use.</p>
<p>See this post here for another example (could potentially be seen as a r... | Routine for non-manual argument of a set of variables in coalesce() dplyr function | r|join|dplyr|merge|tidyverse | 1 | 63 | 3 | 72,816,986 | 72,816,986 | 2 | true | 2022-06-30T13:31:17.363Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Routine for non-manual argument of a set of variables in coalesce() dplyr function<p>I have a list of dfs to be combined into one. These dfs have some matchi... |
72,779,163 | Creating and storing a custom sort procedure as a function<p>I have the following pandas dataframe:</p>
<pre><code>PLAYER GRP
Mike F3.03
Max F2.01
El G7.99
Billy G7.09
Steve B13.99
Vecna F3.03
</code></pre>
<p>I need to sort the dataframe by the <code>grp</code> column, fi... | <pre><code>def sort_custom(d: pd.DataFrame,
primary: str = 'grp',
secondary: str | list = None,
inplace: bool = False) -> pd.DataFrame | None:
"""
Pass a DataFrame containing a LetterNumber column to sort by it.
Defaults to 'grp' columns.
... | Creating and storing a custom sort procedure as a function | python|pandas | 0 | 63 | 2 | 72,779,710 | 72,779,710 | 2 | true | 2022-06-27T23:13:01.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating and storing a custom sort procedure as a function<p>I have the following pandas dataframe:</p>
<pre><code>PLAYER GRP
Mike F3.03
Max ... |
72,832,820 | how to get the size of a text with line breaks with Pillow Python<p>I am trying to center a text inside a box using Pillow. I have followed the instructions in this <a href="https://stackoverflow.com/questions/67760340/how-to-add-text-in-a-textbox-to-an-image">stackoverflow post</a>, which gives the desired result. How... | <p>I have found the solution. The final code looks like this:</p>
<pre><code>title_text = "Hello\nWorld"
img = Image.new(size=(400, 300), mode='RGB')
draw = ImageDraw.Draw(img)
font_path = "/content/Charlie don't surf.ttf"
# draw white rectangle 200x100 with center in 200,150
draw.rectangle((200-1... | how to get the size of a text with line breaks with Pillow Python | python|python-imaging-library | 2 | 63 | 1 | 72,835,842 | 72,835,842 | 2 | true | 2022-07-01T17:31:05.590Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to get the size of a text with line breaks with Pillow Python<p>I am trying to center a text inside a box using Pillow. I have followed the instructions ... |
72,800,799 | clang-format causing compiled object files to change<p>I'm working on a large codebase that needs to be formatted. With many hiccups, it's been formatted with a clean start to finish run of clang-format, and I've moved on to comparing the object files between the original build and the formatted build, as an attempt to... | <p>If your code uses <code>assert</code> macros, the expansion in <code>DEBUG</code> mode does generate code that depends on line numbering because the macro <code>__LINE__</code> gets expanded to a different value, which is passed to <code>fprintf</code> to produce the diagnostic with the file name and line number.</p... | clang-format causing compiled object files to change | c|gcc|clang-format | 2 | 63 | 1 | 72,801,088 | 72,801,088 | 2 | true | 2022-06-29T11:39:25.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
clang-format causing compiled object files to change<p>I'm working on a large codebase that needs to be formatted. With many hiccups, it's been formatted wit... |
72,852,024 | Month wise task completed in minutes between two dates in sql<p>I want to get month-wise minutes spent on any assigned task to an employee.</p>
<p>For example when I select date between 1-Jan-2021 to 1-Jan-2022 then it should give the number of minutes spent by each employee month-wise in minutes.
Suppose in a filter I... | <p>Try the following recursive <code>CTE</code>:</p>
<pre><code>with cte as
(
select empid,format(st,'yyyy-MM-dd HH:mm') st,en from MyTable
union all
select empid,format(dateadd(month,1,st),'yyyy-MM-01 00:00'),en from cte
where dateadd(month,1,st)<=en
),
cte2 as
(
select empid, format(cast(st a... | Month wise task completed in minutes between two dates in sql | sql|sql-server | 0 | 63 | 1 | 72,852,931 | 72,852,931 | 2 | true | 2022-07-04T05:12:22.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Month wise task completed in minutes between two dates in sql<p>I want to get month-wise minutes spent on any assigned task to an employee.</p>
<p>For exampl... |
72,969,187 | Inject same scoped dependency inside itself<p>I'm learning dependency injection, because I don't want my BE to look spaghety no more. I have a good understanding of Asp.Net Core and EF Core. I just never learned dependecy injection properly. I'm playing around with an idea. Let's say, that I create an <code>EmailSender... | <blockquote>
<p>Am I going about this right? Like, is what I described above, the normal approach to things?</p>
</blockquote>
<p>There's not a right/wrong, but what you're describing is an accepted pattern, called the <em>decorator pattern</em>. One service adds behaviors around another one while implementing the same... | Inject same scoped dependency inside itself | c#|dependency-injection|circular-dependency | 1 | 63 | 2 | 72,969,718 | 72,969,718 | 2 | true | 2022-07-13T15:52:09.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Inject same scoped dependency inside itself<p>I'm learning dependency injection, because I don't want my BE to look spaghety no more. I have a good understan... |
72,938,543 | Next.js doesn't pick up variables from the .env file<p>I want to use a variable from the <code>.env</code> file, but I'm getting the following error:</p>
<pre><code>Uncaught (in promise) IntegrationError: Please call Stripe() with your publishable key. You used an empty string.
</code></pre>
<p><strong>code</strong></p... | <p>In Next.js you should declare your environment variables in a <code>.env.local</code> file.<br>
For more informations check the official <a href="https://nextjs.org/docs/basic-features/environment-variables" rel="nofollow noreferrer">docs</a>.</p>
<p>However, as suggested by @juliomalves, you can declare your enviro... | Next.js doesn't pick up variables from the .env file | next.js | 0 | 63 | 1 | 72,938,806 | 72,938,806 | 2 | true | 2022-07-11T12:23:53.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Next.js doesn't pick up variables from the .env file<p>I want to use a variable from the <code>.env</code> file, but I'm getting the following error:</p>
<pr... |
72,915,516 | How to extract attribute value from a tag in BeautifulSoup<p>I am trying to extract the value of an attribute from a tag (in this case, <code>TD</code>). The code is as follows (the HTML document is loaded correctly; <code>self.data</code> contains string with HTML data, this method is part of a class):</p>
<pre class=... | <p>Main issue is that you try to access the attribute key directly, what will return a <code>KeyError</code>, if the attribute is not available:</p>
<pre><code>currentLine["class"]
</code></pre>
<p>Instead use <code>get()</code> that will return in fact of a missing attribute <code>None</code>:</p>
<pre><code... | How to extract attribute value from a tag in BeautifulSoup | python|html|dictionary|web-scraping|beautifulsoup | 1 | 63 | 1 | 72,915,791 | 72,915,791 | 2 | true | 2022-07-08T18:20:55.273Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to extract attribute value from a tag in BeautifulSoup<p>I am trying to extract the value of an attribute from a tag (in this case, <code>TD</code>). The... |
72,921,262 | Split file based on the number of X symbol on each line<p>I'm not sure if this is possible, but I'm wondering if it'd be able to split a file into multiple files - dependent on the amount of a specified character there is on each line.</p>
<p>Lets use a colon (:) as an example</p>
<p>File.txt contains the following dat... | <p>With GNU AWK this approach will provide your expected outcome:</p>
<pre><code>awk -F":" '{print > ((NF - 1)".txt")}' file.txt
</code></pre>
<p>NB. if you have a large number of delimiters (hundreds - thousands) you may also run into trouble for having too many open files (I believe <code>ulimi... | Split file based on the number of X symbol on each line | regex|unix|awk|sed|grep | -1 | 63 | 2 | 72,921,389 | 72,921,389 | 2 | true | 2022-07-09T12:11:34.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Split file based on the number of X symbol on each line<p>I'm not sure if this is possible, but I'm wondering if it'd be able to split a file into multiple f... |
72,859,255 | Add a list to a dataframe in Python<p>I have a df</p>
<pre><code> col1 col2
0 1 ONE AAKLD
1 2 TWO ERBB
2 3 THE COCCNUT
3 4 WOW AACE
</code></pre>
<p>and I have the following lists</p>
<pre><code>list1 = ['a1', 'a2', 'a3']
list2 = ['b1', 'b2', 'b3']
list3 = ['c1', 'c2', 'c3']
</co... | <p>Check below provides required output.</p>
<pre><code>import pandas as pd
import numpy as np
df_1 = pd.DataFrame( {'col1':[1,2,3,4,], 'col2':['AA','BB','CC','AA']})
list1 = ['a1', 'a2', 'a3']
list2 = ['b1', 'b2', 'b3']
list3 = ['c1', 'c2', 'c3']
df = pd.DataFrame([list1, list2, list3], columns=['1','2','3'])
d... | Add a list to a dataframe in Python | python|python-3.x|list|dataframe | 1 | 63 | 3 | 72,859,918 | 72,859,918 | 2 | true | 2022-07-04T15:44:15.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add a list to a dataframe in Python<p>I have a df</p>
<pre><code> col1 col2
0 1 ONE AAKLD
1 2 TWO ERBB
2 3 THE COCCNUT
3 ... |
72,901,162 | Regex: table line matcher<p>I want to parse a table line using regex.</p>
<p>Input</p>
<pre><code> |---|---|---|
|---|---|---|
</code></pre>
<p>So far I've come up with this regex:</p>
<pre><code>/^(?<indent>\s*)\|(?<cell>-+|)/g
</code></pre>
<p>Regex101 Link: <a href="https://regex101.com/r/wzMYxd/1" rel... | <p>How about first verifying, if the line matches the pattern:</p>
<pre><code>^[ \t]*\|(?:-+\|)+$
</code></pre>
<p><a href="https://regex101.com/r/ErjZX0/1" rel="nofollow noreferrer">See this demo at regex101</a> - If it matches, extract the stuff:</p>
<pre><code>^(?<indent>[\t ]*)\||(?<cell>-+)\|
</code></... | Regex: table line matcher | node.js|regex|markdown|cell | 1 | 63 | 1 | 72,901,692 | 72,901,692 | 2 | true | 2022-07-07T16:16:45.313Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Regex: table line matcher<p>I want to parse a table line using regex.</p>
<p>Input</p>
<pre><code> |---|---|---|
|---|---|---|
</code></pre>
<p>So far I've... |
72,869,088 | How to add a dismiss on a listener argument in a AlertDialog<p>I'm doing a method to create a custom AlertDialog in which I can call this method passing text, and listener to open a dialog in everywhere.</p>
<p>My problem is that when I'm use it, I need to call a dismiss in every button of the custom view, but when I c... | <pre><code>fun showCustomDialog(
context: Context,
title: String?,
onPositiveButtonClicked: (() -> Unit)? = null,
onNegativeButtonClicked: (() -> Unit)? = null
) {
val binding =
LayoutCustomDialogBinding.inflate(LayoutInflater.fro... | How to add a dismiss on a listener argument in a AlertDialog | android|kotlin|android-alertdialog|onclicklistener | 0 | 63 | 1 | 72,869,422 | 72,869,422 | 2 | true | 2022-07-05T12:00:10.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add a dismiss on a listener argument in a AlertDialog<p>I'm doing a method to create a custom AlertDialog in which I can call this method passing text... |
72,982,772 | Python - extract "fields" from the string without specific separator<p>I am putting three fields <code>author, epoch_date and text</code> in one string <code>textData</code> They are separated with new row. Of course text can contain multiple rows or some special characters (#, blank spaces etc.)</p>
<pre><code>textDa... | <p>Instead of <code>splitlines</code>, which splits <em>all</em> the lines, manually <a href="https://docs.python.org/2/library/stdtypes.html#str.split" rel="nofollow noreferrer"><code>split</code></a> by <code>\n</code> with an additional <code>maxsplit</code> parameter, then split the parts by <code>:</code>, again w... | Python - extract "fields" from the string without specific separator | python|python-2.7 | -2 | 63 | 1 | 72,983,351 | 72,983,351 | 2 | true | 2022-07-14T15:07:35.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python - extract "fields" from the string without specific separator<p>I am putting three fields <code>author, epoch_date and text</code> in one string <code... |
72,840,140 | pytorch conv2d vs numpy results are different<p>I'm working on implementing pytorch conv2d with numpy. But pytorch conv2d vs numpy results are different for the same input and conv weight. How to fix it? Thanks for any help.</p>
<p>Code sample below:</p>
<p>Note:
The code contains 4 parts:</p>
<ol>
<li>Fixed random see... | <p>Your code works as expected. The result you observed is because of a difference in floating-point precisions between NumPy and PyTorch. To compare floating points you should not use a direct equal check, but instead something like <a href="https://numpy.org/doc/stable/reference/generated/numpy.allclose.html" rel="no... | pytorch conv2d vs numpy results are different | numpy|pytorch | -2 | 63 | 1 | 72,844,689 | 72,844,689 | 2 | true | 2022-07-02T15:09:06.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pytorch conv2d vs numpy results are different<p>I'm working on implementing pytorch conv2d with numpy. But pytorch conv2d vs numpy results are different for ... |
73,013,675 | how to jq by the desired key is inside nested json<p>Here is the id.json</p>
<pre><code>{
"name": "peter",
"path": "desktop/name",
"description": "male",
"env1": {
"school": "AAA",
"height"... | <p>Using your data as initially presented, the following jq program:</p>
<pre><code>keys_unsorted[] as $k
| select($k|startswith("env"))
| .[$k] | to_entries[]
| select(.key|IN("height","weight"))
| [$k, .key, .value]
| join(":")
</code></pre>
<p>produces</p>
<pre><code>env1:hei... | how to jq by the desired key is inside nested json | json|bash|shell|jq | 0 | 63 | 1 | 73,014,927 | 73,014,927 | 2 | true | 2022-07-17T16:49:28.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to jq by the desired key is inside nested json<p>Here is the id.json</p>
<pre><code>{
"name": "peter",
"path": &quo... |
72,986,311 | Rate of change of stock price in pandas<p>I have a pandas dataframe containing columns describing the following entities:</p>
<p>I) Stock Symbol,
II) Timestamp,
III) Price.</p>
<p>For each stock symbol, I’d like to find the discrete change in price defined by the current price minus the price from the closest but previ... | <p>If you start out with this data for example:</p>
<pre><code> stock time price
0 A 7 101.666400
1 A 15 101.577825
2 A 20 102.686615
3 A 21 101.869665
4 A 24 100.941477
5 A 25 101.777495
6 A 30 102.926569
7 A 33 99.433201
8 A 42... | Rate of change of stock price in pandas | python|pandas | 0 | 63 | 4 | 72,987,009 | 72,987,009 | 2 | true | 2022-07-14T20:27:15.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rate of change of stock price in pandas<p>I have a pandas dataframe containing columns describing the following entities:</p>
<p>I) Stock Symbol,
II) Timesta... |
72,822,544 | Scala match case with multiple branch with if<p>I have a match case with <code>if</code> and the expression is <strong>always the same</strong>.
I put some pseudo code:</p>
<pre class="lang-scala prettyprint-override"><code>value match {
case A => same expression
case B(_) if condition1 => same expression
c... | <p>Try to explain this code in words. "This function returns one of two values. The first is returned if the input is <code>A</code>. Or if the input is of type <code>B</code> and a condition holds. Oh, or if a different condition holds. Otherwise, it's the other value". That sounds incredibly complex to me.<... | Scala match case with multiple branch with if | scala | 2 | 63 | 1 | 72,822,859 | 72,822,859 | 3 | true | 2022-06-30T22:11:12.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scala match case with multiple branch with if<p>I have a match case with <code>if</code> and the expression is <strong>always the same</strong>.
I put some p... |
72,833,489 | Is conda case sensitive?<p>This question is related to <a href="https://stackoverflow.com/questions/26503509/is-pypi-case-sensitive">Is PyPI case sensitive?</a></p>
<p>Given that <code>pip</code> is case insensitive, is <code>conda</code> also case insensitive for package names?</p> | <p>Conda doesn't even allow uppercase in package names in the first place.</p>
<blockquote>
<p>Conda package names are normalized and they may contain only lowercase alpha characters, numeric digits, underscores, hyphens, or dots.</p>
</blockquote>
<p>from <a href="https://docs.conda.io/projects/conda-build/en/latest/c... | Is conda case sensitive? | python|conda | 1 | 63 | 2 | 72,833,637 | 72,833,637 | 3 | true | 2022-07-01T18:45:26.167Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is conda case sensitive?<p>This question is related to <a href="https://stackoverflow.com/questions/26503509/is-pypi-case-sensitive">Is PyPI case sensitive?<... |
72,856,715 | Class testing in Ruby<p>I have a custom class <code>Region</code>, which I instantiated as following : <code>node = Region.new</code></p>
<p>I wonder what is the differences, and why the following conditions act like that :</p>
<pre><code>puts node.class === Region # => false
puts node.class == Region ... | <p>In a <code>case</code> block you can do:</p>
<pre><code>case node
when Region
# node is an instance of Region
else
# node is not an instance of Region
end
</code></pre>
<p>Which would internally check the condition in this order: <code>Region === node</code>. For details about the <code>===</code> method read <... | Class testing in Ruby | ruby-on-rails|ruby | 0 | 63 | 1 | 72,857,077 | 72,857,077 | 3 | true | 2022-07-04T12:23:32.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Class testing in Ruby<p>I have a custom class <code>Region</code>, which I instantiated as following : <code>node = Region.new</code></p>
<p>I wonder what is... |
72,856,562 | MATLAB indexing by indexes in another matrix<p>I'm trying to generate a new matrix, based on index values stored in another matrix.</p>
<p>This is trivial to do with a for loop, but this is currently the slowest line in some code I'm trying to optimise, and so I'm looking for a way to do it without the loop, and pullin... | <p>I'm assuming the value of <code>n1</code> in your code is way bigger than in the example you provide, which would explain why it is "slow".</p>
<p>In order to do this without a loop, you can use <a href="https://www.mathworks.com/help/matlab/math/array-indexing.html" rel="nofollow noreferrer">Linear indexi... | MATLAB indexing by indexes in another matrix | matlab | 2 | 63 | 2 | 72,857,254 | 72,857,254 | 3 | true | 2022-07-04T11:43:17.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MATLAB indexing by indexes in another matrix<p>I'm trying to generate a new matrix, based on index values stored in another matrix.</p>
<p>This is trivial to... |
72,884,074 | How to properly create a template string with conditions in C#?<p>I'm new to C# and have troubles translating my experience into it in certain things.
I have two string variables in some class. They can be null or have a word stored in them. I need to create a result string out of them which depends on if they have val... | <p>You can use <code>StringBuilder</code> class to make the code more readable, an example:</p>
<pre><code>using System.Text;
var sb = new StringBuilder();
if (!string.IsNullOrWhiteSpace(SomeClass?.Str1))
{
sb.Append($"{SomeClass.Str1} ");
}
if (!string.IsNullOrWhiteSpace(SomeClass?.Str2))
{
sb.Appen... | How to properly create a template string with conditions in C#? | c# | 0 | 63 | 4 | 72,884,270 | 72,884,270 | 3 | true | 2022-07-06T13:03:59.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to properly create a template string with conditions in C#?<p>I'm new to C# and have troubles translating my experience into it in certain things.
I have... |
72,923,420 | How to get display message in Pyscript<p>New in Pyscript, please spare any dumb mistakes.</p>
<p>Wrote a simple rock-paper-scissor game as below and to run through web browser.
It is running fine, but what I need is that in the prompt it asks the user as "Enter r for rock, p for paper and s for scissor:" inst... | <p>Probably it's more elegant to use a <code>HTML form</code> to ask the user for inputs. I just imported <code>bulma</code> for nicer elements.
Additionally there is a <a href="https://github.com/pyscript/pyscript/issues/239" rel="nofollow noreferrer">bug</a> already reported covering you issue.</p>
<pre><code><!DO... | How to get display message in Pyscript | python|pyscripter|pyscript | 3 | 63 | 1 | 72,924,803 | 72,924,803 | 3 | true | 2022-07-09T17:29:12.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get display message in Pyscript<p>New in Pyscript, please spare any dumb mistakes.</p>
<p>Wrote a simple rock-paper-scissor game as below and to run t... |
72,935,566 | Convert YearQtr series to End of the month Date<p>I am trying to convert a quarterly series of data in to monthly series in R. I can repeat the same quarterly data for each of the three months in the quarter. Not sure why as.yearmon gives out "Jul" irrespective of Q1,Q2,Q3 etc. Also any help on splitting 1986... | <p>Using <code>zoo</code></p>
<pre><code>library(zoo)
qrtrs = c("1986Q1","1986Q2","1986Q3","1986Q4")
mnths = sapply(1:3, \(i) as.Date(as.yearmon(as.yearqtr(qrtrs)) + i/12) - 1)
sort(as.Date(mnths))
</code></pre>
<p>output</p>
<pre><code>[1] "1986-01-31" "1986-02-28... | Convert YearQtr series to End of the month Date | r|zoo|yearmonth | 3 | 63 | 3 | 72,936,567 | 72,936,567 | 3 | true | 2022-07-11T08:17:21.033Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert YearQtr series to End of the month Date<p>I am trying to convert a quarterly series of data in to monthly series in R. I can repeat the same quarterl... |
72,945,219 | how to pass variables between functions Django?<p>I have a function like this in views.py:</p>
<pre><code>def signin(request):
if request.method == 'POST':
uname = request.POST['username']
pwd = request.POST['password']
#and other code
</code></pre>
<p>And then i have another function like ... | <p>In the first view, save the value in the session:</p>
<pre><code>def signin(request):
if request.method == 'POST':
uname = request.POST['username']
request.session['uname'] = uname
</code></pre>
<p>Then in the second view, fetch the value from the session:</p>
<pre><code>def reservations(request)... | how to pass variables between functions Django? | python|django | 3 | 63 | 1 | 72,945,315 | 72,945,315 | 3 | true | 2022-07-11T22:19:29.847Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to pass variables between functions Django?<p>I have a function like this in views.py:</p>
<pre><code>def signin(request):
if request.method == 'POST... |
73,017,232 | How to define `last` iterator without collecting/allocating?<p>Using the example from the <a href="https://docs.julialang.org/en/v1/manual/interfaces/" rel="nofollow noreferrer">Julia Docs</a>, we can define an iterator like the following:</p>
<pre><code>struct Squares
count::Int
end
Base.iterate(S::Squares, state... | <p>As you can read in the docstring of <code>last</code>:</p>
<blockquote>
<p>Get the last element of an ordered collection, if it can be computed in O(1) time. This is accomplished by calling <code>lastindex</code> to get the last index.</p>
</blockquote>
<p>The crucial part is O(1) computation time. In your example t... | How to define `last` iterator without collecting/allocating? | interface|iterator|julia | 1 | 63 | 1 | 73,018,053 | 73,018,053 | 3 | true | 2022-07-18T04:09:39.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to define `last` iterator without collecting/allocating?<p>Using the example from the <a href="https://docs.julialang.org/en/v1/manual/interfaces/" rel="... |
73,025,296 | Multi thread parallel counter is slower than the simple concurrent lock based counter<p>I was comparing the performance of a approximate counter and a simple concurrent counter from the book <a href="https://pages.cs.wisc.edu/%7Eremzi/OSTEP/threads-locks-usage.pdf" rel="nofollow noreferrer">operating system three easy ... | <p>First of all, <code>local_values</code> and <code>local_locks</code> are allocated so that multiple items can share the same cache line. This is a problem when multiple threads access it because the cache coherence protocol causes a <strong>cache-line bouncing</strong> effect between the cores modifying the same cac... | Multi thread parallel counter is slower than the simple concurrent lock based counter | c|multithreading|locking | 2 | 63 | 2 | 73,027,916 | 73,027,916 | 3 | true | 2022-07-18T16:00:12.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multi thread parallel counter is slower than the simple concurrent lock based counter<p>I was comparing the performance of a approximate counter and a simple... |
72,787,050 | Typescript upload directory, Property 'directory' does not exist on type<p>I've got a basic file input and i want to allow users to upload an entire directory</p>
<pre><code> <input
type='file'
directory=''
webkitdirectory=''
className={cssClass}
onChange={processFiles}
... | <p>As of today, there doesn't seem to be a "native" way to do this with the current types React offers. You can checkout <a href="https://github.com/facebook/react/issues/3468#issuecomment-1031366038" rel="nofollow noreferrer">this issue</a> on React's repo. The best way seems to be declaring those types your... | Typescript upload directory, Property 'directory' does not exist on type | reactjs|typescript | 0 | 63 | 3 | 72,787,133 | 72,787,133 | 3 | true | 2022-06-28T13:09:04.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Typescript upload directory, Property 'directory' does not exist on type<p>I've got a basic file input and i want to allow users to upload an entire director... |
73,000,587 | Google Sheets Create Template<p>I have created a Google Sheet that I want to save as a template. Different people will re-use the template on a daily basis, then save/share their daily data inputs.</p>
<p>I cannot find how to do this and appreciate any suggestions.</p> | <h2>If it is for Google Workspace:</h2>
<p>Here's what you can do if it's part of Google Workspace.</p>
<p>1.) From the Google Sheets Home Page (<a href="https://sheets.google.com" rel="nofollow noreferrer">Sheets</a>) -> select <strong>Template gallery</strong>
<a href="https://i.stack.imgur.com/xb6lW.png" rel="nof... | Google Sheets Create Template | google-sheets | 0 | 63 | 1 | 73,000,990 | 73,000,990 | 3 | true | 2022-07-15T23:59:03.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Sheets Create Template<p>I have created a Google Sheet that I want to save as a template. Different people will re-use the template on a daily basis, ... |
72,964,285 | GNU Assembler .print expression instead of string<p>According this <em><a href="https://sourceware.org/binutils/docs/as/Print.html#Print" rel="nofollow noreferrer">https://sourceware.org/binutils/docs/as/Print.html#Print</a></em>, I only can print string instead of expression.</p>
<p>I tried this one line assembler</p>... | <p>According your both refference:</p>
<ul>
<li><p>Enable <code>.altmacro</code> which has more feature than legacy <code>as</code> such as LOCAL labeling.</p>
</li>
<li><p>Define macro with name <code>.printPlusPlus</code>, name inspired from C++ that upgraded version of C but this context is version of <code>.print</... | GNU Assembler .print expression instead of string | assembly|macros|gnu-assembler|preprocessor-directive | 0 | 63 | 1 | 72,965,563 | 72,965,563 | 3 | true | 2022-07-13T09:52:47.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GNU Assembler .print expression instead of string<p>According this <em><a href="https://sourceware.org/binutils/docs/as/Print.html#Print" rel="nofollow noref... |
72,888,319 | Heap corruption on deleting a pointer twice stored in different classes<p>Two classes A and B share pointer to a third class C and when either A or B are deleted they call delete C as well.</p>
<p>Issue is not observed when only either of A or B is deleted.
An exception is getting thrown in this scenario. I have specif... | <p><code>A</code> and <code>B</code> have separate copies of the pointer to <code>C</code>. So setting one classes copy of that pointer to <code>NULL</code> has no effect on the other pointer and you still get a double delete.</p>
<p>You have basically four options</p>
<ol>
<li><p>Decide that one class 'owns' the point... | Heap corruption on deleting a pointer twice stored in different classes | c++|c++11|memory-management|heap-corruption | 0 | 63 | 1 | 72,888,353 | 72,888,353 | 3 | true | 2022-07-06T18:27:06.583Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Heap corruption on deleting a pointer twice stored in different classes<p>Two classes A and B share pointer to a third class C and when either A or B are del... |
72,896,954 | While loop change variables<p>I need to change the text in the variable after one round of the cycle.
Like first round of loop a="A", second round a="B".</p>
<pre><code>a = ("A")
a1 = ("B")
a2 = ("C")
a3 = ("D")
a4 = ("F")
i = 0
while i < 5:
... | <p>Put the values in an array and access the values:</p>
<pre class="lang-py prettyprint-override"><code>a = ['A', 'B', 'C', 'D', 'E']
i = 0
while i<5:
print(a[i])
i += 1
</code></pre> | While loop change variables | python|while-loop | 1 | 63 | 4 | 72,897,000 | 72,897,000 | 3 | true | 2022-07-07T11:23:22.107Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
While loop change variables<p>I need to change the text in the variable after one round of the cycle.
Like first round of loop a="A", second round ... |
72,833,348 | How to pass content yielded in cy.wait() to the variable and reuse it in the next steps?<p>I use cy.intercept() and cy.wait() to listen to the request and yield content from it.</p>
<pre><code>let number;
describe("some test", () => {
before(() => {
cy.clearCookies();
});
it("some test&q... | <p>To make sure the value of number is passed on to the <code>type</code>, you have to add a <code>then</code>, something like:</p>
<pre class="lang-js prettyprint-override"><code>let number
describe('some test', () => {
before(() => {
cy.clearCookies()
})
it('some test', () => {
cy.someCommand(... | How to pass content yielded in cy.wait() to the variable and reuse it in the next steps? | javascript|cypress|cy.intercept | 0 | 63 | 3 | 72,833,377 | 72,833,377 | 3 | true | 2022-07-01T18:30:04.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass content yielded in cy.wait() to the variable and reuse it in the next steps?<p>I use cy.intercept() and cy.wait() to listen to the request and yi... |
72,866,861 | Create a Map from an array of objects with a condition on array elements<p>I have an array of objects which i receive from a db:</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... | <p>Use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce" rel="nofollow noreferrer">reduce</a> to create an object, if the key exists in the object then push to the array, otherwise create an array and push the item:</p>
<p><div class="snippet" data-lang="js" data-hi... | Create a Map from an array of objects with a condition on array elements | javascript|node.js|arrays|typescript | 0 | 63 | 4 | 72,866,925 | 72,866,925 | 3 | true | 2022-07-05T09:15:49.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create a Map from an array of objects with a condition on array elements<p>I have an array of objects which i receive from a db:</p>
<p><div class="snippet" ... |
73,018,536 | Indexing / identifying columns adjacent to a column of interest in R dataframe<p>I'm looking for a way to select data/columns adjacent to a particular column. For example, let's say I want to select the two columns to the left and to the right of 'cat_weight'</p>
<pre><code>df <- data.frame(dog_height = 1:5,
... | <p>You had a good idea, here's a solution using <code>dplyr</code>:</p>
<pre><code>library(dplyr)
df <- data.frame(dog_height = 1:5,
dog_weight = 2:6,
cat_height = 3:7,
cat_weight = 4:8,
bird_height = 5:9,
bird_weight = 6:10
)
ge... | Indexing / identifying columns adjacent to a column of interest in R dataframe | r | 4 | 63 | 4 | 73,018,968 | 73,018,968 | 3 | true | 2022-07-18T07:17:09.487Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Indexing / identifying columns adjacent to a column of interest in R dataframe<p>I'm looking for a way to select data/columns adjacent to a particular column... |
73,000,809 | Reactjs - Can't call setState on a component that is not yet mounted<p>I am getting an error can't call setState on a component that is not yet mounted.
Weirdly the Udemy video i am following does not get this error. I tried to check if this is due to v5 and v6 routing issue but found no solutions.
What I am trying to ... | <p>The constructor is called before the component is mounted, and therefore you may end up calling <code>setState</code> early. Generally you should not preform data fetching in the constructor of a react component. See more here: <a href="https://stackoverflow.com/a/55182747/5574617">https://stackoverflow.com/a/551827... | Reactjs - Can't call setState on a component that is not yet mounted | javascript|reactjs|react-dom | 1 | 63 | 2 | 73,000,832 | 73,000,832 | 3 | true | 2022-07-16T00:51:34.147Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reactjs - Can't call setState on a component that is not yet mounted<p>I am getting an error can't call setState on a component that is not yet mounted.
Weir... |
72,936,910 | python duplicate values and key in multiple dictionary rearrange into single dictionary<p>i have a list of dict like this</p>
<pre><code>list_1 = [{'id': '123', 'name': {'new': 'kevin'}},
{'id': '123', 'name': {'old': 'alan'}},
{'id': '456', 'name': {'new': 'jason'}},
{'id': '456', 'nam... | <p>Looks like you're looking for something like this:</p>
<pre><code>from collections import defaultdict
from pprint import pprint
def merge_group(group: list[dict]) -> dict:
"""
Merge a group of dicts into a single dict.
First-level nested dicts are merged, other values replace previou... | python duplicate values and key in multiple dictionary rearrange into single dictionary | python|dictionary | 1 | 63 | 3 | 72,937,007 | 72,937,007 | 3 | true | 2022-07-11T10:12:42.757Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python duplicate values and key in multiple dictionary rearrange into single dictionary<p>i have a list of dict like this</p>
<pre><code>list_1 = [{'id': '1... |
72,779,585 | How can I align text in a BufferedImage as columns?<p>I am using <code>BufferedImage</code> and <code>Graphics2D</code> to generate a GIF image, but I am struggling to have the layout like in the picture below. I am not even sure if it's possible at all.</p>
<p>The GIF will be animated and the values in <code>Heading3<... | <p>HTML can be used in Swing components which support rich text, like <code>JLabel</code>. The label can be <a href="https://stackoverflow.com/a/7775713/418556">painted onto an image</a>.</p>
<p>This HTML/CSS should do the trick.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babe... | How can I align text in a BufferedImage as columns? | java|swing|text|graphics|awt | -1 | 63 | 1 | 72,779,688 | 72,779,688 | 3 | true | 2022-06-28T00:39:31.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I align text in a BufferedImage as columns?<p>I am using <code>BufferedImage</code> and <code>Graphics2D</code> to generate a GIF image, but I am str... |
72,913,591 | How do you set the so-called "Style" - Xcode storyboard - of a UIButton, in code?<p><a href="https://i.stack.imgur.com/6Kz9J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Kz9J.png" alt="enter image description here" /></a></p>
<p>Notice the "Type". In fact you get to that in code with <c... | <p>That corresponds to the <a href="https://developer.apple.com/documentation/uikit/uibutton/3784627-configuration" rel="nofollow noreferrer"><code>configuration</code></a> property. The 4 non-default options in the picker in IB corresponds</p>
<pre><code>button.configuration = .plain()
button.configuration = .gray()
b... | How do you set the so-called "Style" - Xcode storyboard - of a UIButton, in code? | swift|xcode|uibutton | 1 | 63 | 1 | 72,913,854 | 72,913,854 | 4 | true | 2022-07-08T15:19:33.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you set the so-called "Style" - Xcode storyboard - of a UIButton, in code?<p><a href="https://i.stack.imgur.com/6Kz9J.png" rel="nofollow noreferrer"><... |
72,939,751 | if statement for if logical contains at least one TRUE (R)<p>I am creating an if statement for whether an output contains a specific string or not. I am using regular expression to do so.</p>
<p>I am using the grepl() function to investigate if the output contains the string 'Final evaluation: none (in check)' within t... | <p>Could you use any?</p>
<pre><code>if any(grepl_output == TRUE) {
# do something ...
}
</code></pre>
<p>See ?any for details.</p> | if statement for if logical contains at least one TRUE (R) | r|if-statement|logical-operators | 1 | 63 | 1 | 72,939,786 | 72,939,786 | 4 | true | 2022-07-11T13:56:20.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
if statement for if logical contains at least one TRUE (R)<p>I am creating an if statement for whether an output contains a specific string or not. I am usin... |
72,973,702 | Distributed Array Access Communication Cost<p>I'm finishing up implementing a sort of "Terasort Lite" <a href="https://stackoverflow.com/questions/72333680/idiomatic-chapel-way-to-create-uneven-distribution">program in Chapel</a>, based on a distributed bucket sort, and I'm noticing what seems to be significa... | <p>Thanks for your question. I can answer some of the questions here.</p>
<p>First, I'd like to point out some other distributed sort implementations in Chapel:</p>
<ul>
<li>The <a href="https://github.com/Bears-R-Us/arkouda/blob/master/src/RadixSortLSD.chpl" rel="nofollow noreferrer">distributed sort in Arkouda</a></l... | Distributed Array Access Communication Cost | chapel | 4 | 63 | 1 | 72,980,649 | 72,980,649 | 4 | true | 2022-07-13T23:33:52.943Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Distributed Array Access Communication Cost<p>I'm finishing up implementing a sort of "Terasort Lite" <a href="https://stackoverflow.com/questions/... |
72,808,947 | alternative way of providing index to querySelectorAll by :even and :odd<p>I am trying to get even <strong>(div)elements</strong> and give them <strong>different class Names</strong> compared to <strong>odd (div) elements</strong> in which they will have <strong>different class names</strong> also, I want to write insi... | <p><strong>NOTE:</strong> <em>This answer assumes all <code>.project</code> elements are all children of the same parent.</em></p>
<p>You can use <code>document.querySelectorAll('.project:nth-child(even)')</code>, check out <a href="https://www.w3.org/Style/Examples/007/evenodd.en.html" rel="nofollow noreferrer">EVEN A... | alternative way of providing index to querySelectorAll by :even and :odd | javascript|html|css | 2 | 63 | 4 | 72,809,057 | 72,809,057 | 4 | true | 2022-06-29T23:47:22.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
alternative way of providing index to querySelectorAll by :even and :odd<p>I am trying to get even <strong>(div)elements</strong> and give them <strong>diffe... |
73,020,709 | Creating Nested dictionary with multiple hierarchy separated with '.'<p>I'm trying to create a multiple hierarchy of nested dictionary. The hierarchy levels are separated with a dot(.) in variable <code>B</code> however the final key (<code>A</code>) and value (<code>D</code>) are fixed.</p>
<h3>Variables</h3>
<pre><co... | <p>Use this:</p>
<pre class="lang-py prettyprint-override"><code>A = "key"
B = "one.two.three.four"
D = "value"
x = {A: D}
for k in B.split('.')[::-1]:
x = {k: x}
print(x)
</code></pre>
<p>Output:</p>
<pre class="lang-py prettyprint-override"><code>{'one': {'two': {'three': {'four':... | Creating Nested dictionary with multiple hierarchy separated with '.' | python|python-3.x|dictionary | 2 | 63 | 2 | 73,020,828 | 73,020,828 | 4 | true | 2022-07-18T10:18:22.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating Nested dictionary with multiple hierarchy separated with '.'<p>I'm trying to create a multiple hierarchy of nested dictionary. The hierarchy levels ... |
72,900,665 | Assigning column values in for loops -- too slow<p>I have a for loop that I'm trying to run that is quite slow when I apply it to a dataset with 100k+ observations. What this code does is uses information from one column (<code>df$country</code>) that describes a country assigned to a particular ID (e.g., ID == 1 and c... | <p>You could loop over the columns instead of the rows:</p>
<pre><code>for (col in cols) df[[col]] = +(df$country == col)
# id country USA Japan Germany
# 1 1 USA 1 0 0
# 2 2 Japan 0 1 0
# 3 3 Germany 0 0 1
# 4 4 Japan 0 1 0
# 5 5 Japan 0 1 0... | Assigning column values in for loops -- too slow | r|loops|for-loop | 0 | 63 | 2 | 72,901,079 | 72,901,079 | 4 | true | 2022-07-07T15:38:24.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assigning column values in for loops -- too slow<p>I have a for loop that I'm trying to run that is quite slow when I apply it to a dataset with 100k+ observ... |
72,941,443 | How to convert a csv-file to a dictionnary of lists with python?<p>I'm trying to have this kind of result :</p>
<p><img src="https://i.stack.imgur.com/8sIKI.png" alt="Output_Screenshot" /></p>
<p>Here is the csv-file :</p>
<pre><code>OsmID,NewName,IdLocal
1020287758,NN1,Id0001
1021229973,NN2,Id0002
1025409497,NN3,Id... | <p>Instead of manually splitting each line by commas, use the CSV module that you've imported. This module contains a <a href="https://docs.python.org/3/library/csv.html#csv.DictReader" rel="nofollow noreferrer"><code>DictReader</code> class</a> that will yield dictionaries for each row. Then, you just need to add this... | How to convert a csv-file to a dictionnary of lists with python? | python|arcgis | 1 | 63 | 3 | 72,941,711 | 72,941,711 | 4 | true | 2022-07-11T16:02:23.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert a csv-file to a dictionnary of lists with python?<p>I'm trying to have this kind of result :</p>
<p><img src="https://i.stack.imgur.com/8sIKI.... |
72,926,524 | Encoding with image/jpeg cause image saturation / wrong pixels<p>I have been having this problem for some time: I'm creating a module to process images, one of my functions is to go through each pixel of an image and invert colors. The function returns the expected results when encoding .png images, but it "satura... | <p>You have two bugs in your code related to color-handling (the second of which is probably not relevant).</p>
<p>First, the <code>RGBA()</code> method returns 16-bit R, G, B, A, but you're treating them like 8-bit values.</p>
<p>Second, <code>color.RGBA</code> values are alpha-premultiplied, so the inverse of <code>(... | Encoding with image/jpeg cause image saturation / wrong pixels | image|go|image-processing | 2 | 63 | 1 | 72,927,198 | 72,927,198 | 4 | true | 2022-07-10T06:21:49.097Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Encoding with image/jpeg cause image saturation / wrong pixels<p>I have been having this problem for some time: I'm creating a module to process images, one ... |
72,910,829 | Same template class specialization for std::variant and boost::variant template types<p>I want to create a class specialization that has the same implementation if it gets passed any std::variant or any boost::variant. I tried to play around with std::enable_if, std::disjunction and std::is_same but I couldn't make it ... | <p>You can use a <a href="https://en.cppreference.com/w/cpp/language/template_parameters#Template_template_parameter" rel="noreferrer">template template parameter</a> e.g. like this</p>
<pre><code>template <typename T>
struct TypeChecker {
void operator()() {
std::cout << "I am other type\n... | Same template class specialization for std::variant and boost::variant template types | c++|templates|metaprogramming|variant | 0 | 63 | 3 | 72,911,415 | 72,911,415 | 5 | true | 2022-07-08T11:38:19.550Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Same template class specialization for std::variant and boost::variant template types<p>I want to create a class specialization that has the same implementat... |
73,009,006 | How to make Go channel worker have different result's length?<p>I made some edits from the <a href="https://gobyexample.com/worker-pools" rel="nofollow noreferrer">gobyexample</a>:</p>
<pre class="lang-golang prettyprint-override"><code>import (
"fmt"
"math/rand"
"time"
)
type... | <p>Use a <a href="https://godoc.org/sync#WaitGroup" rel="nofollow noreferrer">wait group</a> to detect when the workers are done. Close the results channel when the workers are done. Receive results until the channel is closed.</p>
<pre><code>func worker(wg *sync.WaitGroup, id int,
jobs <-chan int,
... | How to make Go channel worker have different result's length? | go|goroutine | 0 | 63 | 2 | 73,009,062 | 73,009,062 | 5 | true | 2022-07-17T03:05:56.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make Go channel worker have different result's length?<p>I made some edits from the <a href="https://gobyexample.com/worker-pools" rel="nofollow noref... |
72,862,641 | Why does math with ULong > 16 digits get wonky?<p>I am working on a "simple" base converter to convert ULong with base 10 to a String with any base. Here I use 64 chars. Usecase is to shorten ULong that are stored as String anyway.</p>
<pre><code>Public Class BaseConverter
'base64, but any length would wo... | <p>The exponent operator, <code>^</code>, <a href="https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/exponentiation-operator#result" rel="nofollow noreferrer">always returns a <code>Double</code></a>.<br />
This <a href="https://docs.microsoft.com/en-us/dotnet/visual-basic/language-refer... | Why does math with ULong > 16 digits get wonky? | .net|vb.net|math|.net-core|base | 2 | 63 | 1 | 72,862,750 | 72,862,750 | 5 | true | 2022-07-04T22:58:16.390Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does math with ULong > 16 digits get wonky?<p>I am working on a "simple" base converter to convert ULong with base 10 to a String with any base... |
72,841,621 | finding all the values with given key for multimap<p>I am searching for all pairs for a particular key in a multimap using the code below.</p>
<pre><code>int main() {
multimap<int,int> mp;
mp.insert({1,2});
mp.insert({11,22});
mp.insert({12,42});
mp.insert({1,2});
mp.insert({1,2});
fo... | <p>You're calling <code>find</code> only a single time in your code. It's perfectly acceptable for this call to return the same value as <code>mp.begin()</code> resulting in you iterating though all the entries in the map before reaching <code>mp.end()</code>.</p>
<p>You can use the <a href="https://en.cppreference.com... | finding all the values with given key for multimap | c++|multi-mapping|unordered-multimap | 0 | 63 | 2 | 72,841,670 | 72,841,670 | 5 | true | 2022-07-02T18:45:14.200Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
finding all the values with given key for multimap<p>I am searching for all pairs for a particular key in a multimap using the code below.</p>
<pre><code>int... |
73,028,210 | How to "translate" string into an integer in python?<p>I have the following df:</p>
<pre><code>print(df)
>>>
Marital Status Income Education
Married 66613 PhD
Married 12441 Bachelors
Single 52842 Masters Degree
Relationship 782... | <p>This may help you to get what you need.</p>
<pre class="lang-py prettyprint-override"><code>df['Marital Status'] = df['Marital Status'].astype('category').cat.codes
</code></pre>
<p>Reference: <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.astype.html" rel="noreferrer">https://pand... | How to "translate" string into an integer in python? | python|pandas|string|integer | 0 | 63 | 6 | 73,028,266 | 73,028,266 | 6 | true | 2022-07-18T20:25:14.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to "translate" string into an integer in python?<p>I have the following df:</p>
<pre><code>print(df)
>>>
Marital Status Income Educati... |
72,860,923 | Calculate the proportion of values every two rows by group in R<p>I have this dataset</p>
<pre><code>
df <- tibble(id, event, duration)
</code></pre>
<p>I need that the each "dive" row the duration proportion of surface be calculated using the subsequent "surface", and insert the result into a n... | <p>We can use <code>gl</code> to create the grouping index every 2 rows, and then create the column 'proportion' by dividing the 'duration' where event value is 'surface' (<code>event == 'surface'</code>) with the <code>sum</code> of 'duration'</p>
<pre><code>library(dplyr)
df %>%
group_by(id) %>%
group_by(... | Calculate the proportion of values every two rows by group in R | r|dplyr|datatable|data-manipulation | 2 | 63 | 1 | 72,860,943 | 72,860,943 | 7 | true | 2022-07-04T18:47:03.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calculate the proportion of values every two rows by group in R<p>I have this dataset</p>
<pre><code>
df <- tibble(id, event, duration)
</code></pre>
<p>... |
72,986,409 | How not get out of bound in Kotlin?<p>I got the code that compare current element with the next element in array. But it crashes with out of bound because I guess when its on the last element there is no next element to compare with so it crashes.How to handle this to avoid crash and stop comparing on the last element?... | <p><strong>The direct answer to your question:</strong></p>
<p>Instead of</p>
<pre><code>for (item in arr.indices)
</code></pre>
<p>you should write</p>
<pre><code>for (item in 0..(arr.lastIndex - 1))
</code></pre>
<p>Explanation: <code>arr.indices</code> returns the range <code>0..arr.lastIndex</code> but in the loop ... | How not get out of bound in Kotlin? | algorithm|kotlin | 2 | 63 | 1 | 72,986,720 | 72,986,720 | 8 | true | 2022-07-14T20:38:23.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How not get out of bound in Kotlin?<p>I got the code that compare current element with the next element in array. But it crashes with out of bound because I ... |
72,851,243 | How to migrate all packages, settings, user data etc. after updating to a newer Python version?<p>I've just installed Python 3.10 on Windows 10 and none of my scripts are working. For instance, when doing <code>jupyter notebook</code> I get</p>
<pre><code>'jupyter' is not recognized as an internal or external command,
... | <p>Okay, I can report a partial success in rescuing my working system: Uninstalling the newer Python version, removing all newly added PATH entries and rebooting seems at least to get Jupyter back operational.</p>
<p><strong>This means that installing newer Python version will only <em>soft</em>-brick your system.</str... | How to migrate all packages, settings, user data etc. after updating to a newer Python version? | python|path|package|migration|updates | -1 | 63 | 1 | 72,860,735 | 72,860,735 | -1 | true | 2022-07-04T02:30:16.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to migrate all packages, settings, user data etc. after updating to a newer Python version?<p>I've just installed Python 3.10 on Windows 10 and none of m... |
72,399,567 | Stuck with python functions and global variables thinking?<p>I'm currently analyzing financial data and for this reason I need to use a certain function, let's say a certain type of moving average, inside the code different times, for different time series and for different time frames too.</p>
<p>To initialize a funct... | <pre><code>import numpy as np
import pandas as pd
class Foo(object):
def __init__(self):
self.x_arr = list()
def _foo_append_(self,x_i,count):
self.x_arr.append(x_i)
return self.x_arr
for i in range(0,10):
rv_1 = np.round(np.random.normal(10,5),decimals=2)
rv_2 = np.round(n... | Stuck with python functions and global variables thinking? | python|function|global | 1 | 64 | 2 | 72,653,219 | 72,653,219 | 0 | true | 2022-05-27T01:28:07.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Stuck with python functions and global variables thinking?<p>I'm currently analyzing financial data and for this reason I need to use a certain function, let... |
72,776,642 | PyQt testing failing on testsuite TypeError<p>I am currently in the process of writing a testing suite using pytest for a PyQt class I have setup to house a desktop application. I am running into the error below when trying to run the tests. The error renders the tests unable to run at all (i.e. I don't get a success o... | <p>I believe the solution to this is related to the fact that you're trying to instantiate the MainWindow widget without first constructing a QApplication.</p>
<p><a href="https://pypi.org/project/pytest-qt/" rel="nofollow noreferrer"><strong>pytest-qt</strong></a> lets you avoid having to construct a QApplication for ... | PyQt testing failing on testsuite TypeError | python|testing|visual-studio-code|pyqt|pytest | 0 | 64 | 1 | 72,777,450 | 72,777,450 | 0 | true | 2022-06-27T18:11:28.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PyQt testing failing on testsuite TypeError<p>I am currently in the process of writing a testing suite using pytest for a PyQt class I have setup to house a ... |
72,773,568 | Python file always runs at C:/Users/User and not in the working directory<p>When I'm launching python file in VS Code that for example located at <code>C:\Users\andre\Desktop\NewFolder\Something.py</code> or <code>D:\Pythons\Something.py</code></p>
<p>I'm getting <code>C:\Users\andre</code> via <code>os.getcwd()</code>... | <p>VS Code takes the open <strong>folder</strong> as the workspace. So please open the whole folder in VS Code, not just a <code>.py</code> file, then VS Code will not be able to find your workspace and will use the computer user directory as the workspace by default. So naturally you get the wrong script path.</p>
<p>... | Python file always runs at C:/Users/User and not in the working directory | python|visual-studio-code | 0 | 64 | 1 | 72,779,804 | 72,779,804 | 0 | true | 2022-06-27T14:14:40.097Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python file always runs at C:/Users/User and not in the working directory<p>When I'm launching python file in VS Code that for example located at <code>C:\Us... |
72,777,276 | module 'ants' has no attribute 'from_numpy'<p>I am working in a jupyter notebook, and used pip to install ANTsPy:</p>
<pre><code>pip install antspyx
</code></pre>
<p>However, using the function <code>from_numpy</code> throws an error:</p>
<pre><code>import ants
Im2Use=Im[0,:,:,:]
fixed, moving, mytx=reg(Im2Use, t_rz)
... | <p>The issue in this case was scipy versioning. I downgraded from version 1.7.3 to version 1.2.0, which then solved the problem. Why? It's because ants library expects a function called "factorial" in scipy.misc, but version 1.7.3 moved the location of factorial.</p> | module 'ants' has no attribute 'from_numpy' | python|numpy|pip|ants|antspyx | 0 | 64 | 3 | 72,792,497 | 72,792,497 | 0 | true | 2022-06-27T19:12:53.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
module 'ants' has no attribute 'from_numpy'<p>I am working in a jupyter notebook, and used pip to install ANTsPy:</p>
<pre><code>pip install antspyx
</code><... |
72,792,627 | Loop over values in multiple colums with condition and print first column value if true in AWK<p>My data is as follows (this is just a sample, real data has ~20,000 lines) :</p>
<p>Original raw data (tsv):</p>
<pre><code>Names USA EU FR
Jim 3 12 5
John 8 4 7
Jane 12 35 3
Sue 6 3 9
</code><... | <p>The expected output you provided doesn't show what you describe as your requirements so maybe this is what you really want:</p>
<pre><code>$ cat tst.awk
BEGIN { FS=OFS="\t" }
NR > 1 {
for ( i=2; i<=NF; i++ ) {
$i = ( $i > 5 ? $1 : "" )
}
}
{
$1 = ""
sub(... | Loop over values in multiple colums with condition and print first column value if true in AWK | bash|awk | -2 | 64 | 3 | 72,793,153 | 72,793,153 | 0 | true | 2022-06-28T20:13:38.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Loop over values in multiple colums with condition and print first column value if true in AWK<p>My data is as follows (this is just a sample, real data has ... |
72,796,948 | python string to a function call with arguments, without using eval<p>I have a string stored in a database stands for a class instance creation for example <code>module1.CustomHandler(filename="abc.csv", mode="rb")</code>, where CustomHandler is a class defined in module1.</p>
<p>I would like to eva... | <p>You might want to take a look at the <code>ast</code> Python module, which stands for abstract syntax trees. It's mainly used when you need to process the grammar of the programming language, work with code in string format, and so much more functions available in the official <a href="https://docs.python.org/3/libr... | python string to a function call with arguments, without using eval | python|python-import|eval | 1 | 64 | 1 | 72,797,078 | 72,797,078 | 0 | true | 2022-06-29T06:51:52.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python string to a function call with arguments, without using eval<p>I have a string stored in a database stands for a class instance creation for example <... |
72,785,848 | Method not found: 'System.Threading.Tasks.Task`1<IdentityModel.Client.TokenResponse><p>I have a problem where the below code at</p>
<pre><code>XeroToken = Await c.RefreshAccessTokenAsync(XeroToken).ConfigureAwait(False)
</code></pre>
<p>throws the</p>
<blockquote>
<p>Method not found: 'System.Threading.Tasks.Task`1<... | <p>The problem was finally solved by removing all the <code>Xero</code> NuGet packages and installing them again. I hope this may be helpful to someone else as well.</p> | Method not found: 'System.Threading.Tasks.Task`1<IdentityModel.Client.TokenResponse> | .net|vb.net | 0 | 64 | 2 | 72,798,053 | 72,798,053 | 0 | true | 2022-06-28T11:46:58.263Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Method not found: 'System.Threading.Tasks.Task`1<IdentityModel.Client.TokenResponse><p>I have a problem where the below code at</p>
<pre><code>XeroToken = Aw... |
72,785,041 | ASP Core Identity | Cookie not set in browser in productive<p>While developing a SPA (React) which communicates with a ASP.Net Core API (both on localhost) the cookie will be set after a successfull login. But when deploying both applications under the same IIS (version 10) the API sets the cookie inside the login-res... | <p>So I figured out what the problem was:
When running in localhost/development environment doing api calls with Axios includes the "withCredentials" flag automatically. But when running on productive you need to add the flag explicitly.</p>
<p>Which means changing</p>
<pre><code> axios
.post(resultingUr... | ASP Core Identity | Cookie not set in browser in productive | c#|asp.net-core|cookies|setcookie | 0 | 64 | 2 | 72,800,461 | 72,800,461 | 0 | true | 2022-06-28T10:44:28.127Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ASP Core Identity | Cookie not set in browser in productive<p>While developing a SPA (React) which communicates with a ASP.Net Core API (both on localhost) t... |
72,809,128 | How can I generated a list of data then query into the list?<p>I am new to Java and I am trying to build a Java command-line program, which generates random dataset (as in getData()) and query into the generated dataset. But I don't know how to pass the generated data from getData() function to the main function so tha... | <p><code>generator.add(new Data(names[x], lastName[y], a, exampleId, country[z]));</code> works for me just fine</p> | How can I generated a list of data then query into the list? | java|list | -1 | 64 | 2 | 72,810,065 | 72,810,065 | 0 | true | 2022-06-30T00:20:43.397Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I generated a list of data then query into the list?<p>I am new to Java and I am trying to build a Java command-line program, which generates random ... |
72,790,490 | Google Cloud Datastore "out of bounds of 'Number.MAX_SAFE_INTEGER'"<p>One of the data in datastore is 7766277975020011920 and similarities.</p>
<p><a href="https://i.stack.imgur.com/icZJb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/icZJb.png" alt="enter image description here" /></a></p>
<p>The e... | <p>Moving my comment into an answer, according to the Node.js client reference for Datastore, when you run queries or calls for entities, you <a href="https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastorerequest#_google_cloud_datastore_DatastoreRequest_runQuery_member_1_" rel="nofollow nor... | Google Cloud Datastore "out of bounds of 'Number.MAX_SAFE_INTEGER'" | google-cloud-datastore | 1 | 64 | 1 | 72,819,483 | 72,819,483 | 0 | true | 2022-06-28T16:57:03.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Cloud Datastore "out of bounds of 'Number.MAX_SAFE_INTEGER'"<p>One of the data in datastore is 7766277975020011920 and similarities.</p>
<p><a href="h... |
72,822,633 | Why is my Event Listener not Firing After the Second Event?<p>I'm building a photo upload form with Livewire, Alpine, and FilePond. After the photos have finished processing I want to show a "Save" button to persist the files.</p>
<p>I'm using Alpine to handle the show/hide. Both event listeners are working c... | <p>This is because you're creating a second <code>Alpine.data</code> object, instead of editing the existing one.</p>
<pre class="lang-js prettyprint-override"><code><script>
document.addEventListener('alpine:init', () => {
Alpine.data('showSaveButtons', () => ({
open: false,
... | Why is my Event Listener not Firing After the Second Event? | javascript|alpine.js|filepond | 1 | 64 | 1 | 72,824,769 | 72,824,769 | 0 | true | 2022-06-30T22:25:50.397Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is my Event Listener not Firing After the Second Event?<p>I'm building a photo upload form with Livewire, Alpine, and FilePond. After the photos have fin... |
72,833,306 | How to subtract values from two different nested dictionaries?<p>I have two dicts as below:</p>
<pre><code>> type(dict1)
<class 'dict1'>
> dict1
{'index1': {'output': [{'quant': 27587.2, 'var1': 20, 'var2': 5, 'list1': {}}]},
'index2': {'output': [{'quant': 29795.9, 'var1': 22, 'var2': 5, 'list1': {}}]... | <p>Try:</p>
<pre class="lang-py prettyprint-override"><code>out = {}
for k2, v2 in dict2.items():
out.setdefault(k2, {})["output"] = [
{
**v2["output"][0],
"quant": v2["output"][0]["quant"] - dict1[k2]["output"][0]["qua... | How to subtract values from two different nested dictionaries? | python|dictionary | -2 | 64 | 2 | 72,834,440 | 72,834,440 | 0 | true | 2022-07-01T18:25:44.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to subtract values from two different nested dictionaries?<p>I have two dicts as below:</p>
<pre><code>> type(dict1)
<class 'dict1'>
> dict... |
72,833,391 | I want to create a column with a custom function based on another column on Power Query<p>The function searches a value in a Excel workbook and gives me a cetain info.</p>
<p>It Works like this:</p>
<pre><code>Excel
Column1 Column2
A 1
B 2
C 3
My Function ("A") - Ou... | <h1>Updated</h1>
<p>You can remove all of the Expression Evaluate calls. (The second step looks like you're passing the result of a function, but Table.AddColumn needs a function definition )</p>
<blockquote>
<p>PS. the output of the function is a M Formula(Ex:. [Column10] * [Column11])</p>
</blockquote>
<p>In that cas... | I want to create a column with a custom function based on another column on Power Query | powerbi|powerquery|powerbi-desktop | 0 | 64 | 1 | 72,835,482 | 72,835,482 | 0 | true | 2022-07-01T18:34:45.127Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I want to create a column with a custom function based on another column on Power Query<p>The function searches a value in a Excel workbook and gives me a ce... |
72,834,744 | Timeout option is not working in nodejs spawn child process<p>I was trying to run the Python program through spawn child process function and trying to give timeout option for TLE cases. But Timeout option is not working.
Code is running fine for smaller inputs, but when running on input size > 1e9 it should termina... | <p>Uh, if the timeout in <code>spawn</code> isn't working.. you can use <code>setTimeout</code> logic to kill the program that would have its <strong>Time Limit Exceeded</strong></p>
<pre class="lang-js prettyprint-override"><code> let python = spawn('python3', [`./uploads/${codefile}`]);
let timeout=set... | Timeout option is not working in nodejs spawn child process | javascript|node.js | -1 | 64 | 1 | 72,835,517 | 72,835,517 | 0 | true | 2022-07-01T21:25:17.177Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Timeout option is not working in nodejs spawn child process<p>I was trying to run the Python program through spawn child process function and trying to give ... |
72,803,054 | CentOs Partition Resize<p>I'm struggling with resizing a CentOs Partition on a Server. I found some steps, but I'm not sure which circumstances I face and whats the correct approach and i definitely cannot mess that up.
The space should already be available, but the partition is not resized as far as I can tell.
The go... | <p>As you can see the partition</p>
<pre><code>sdb 8:16 0 1T 0 disk
└─sdb1 8:17 0 1024G 0 part /var/www/vhosts
</code></pre>
<p>is already 1TB. So you need to extend the filesystem. If your filesystem is <code>ext4</code> you can use command:</p>
<pre><code>resize2fs /var/www/vhosts
</code></pre>
<p>if... | CentOs Partition Resize | centos|centos7|disk-partitioning | -1 | 64 | 1 | 72,839,052 | 72,839,052 | 0 | true | 2022-06-29T14:23:15.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CentOs Partition Resize<p>I'm struggling with resizing a CentOs Partition on a Server. I found some steps, but I'm not sure which circumstances I face and wh... |
72,835,443 | Can I create a closure in Ruby that adds functionality to a method and maintains its parameter definitions?<p>I would like to make a method that can take in a method name or other callable block and return a proc/lambda in order to add additional functionality, such as a call counter.</p>
<p>Here I have an example of a... | <p>You can use <a href="https://ruby-doc.org/core-3.1.2/Object.html#send-method" rel="nofollow noreferrer"><code>send</code></a> / <a href="https://ruby-doc.org/core-3.1.2/Object.html#public_send-method" rel="nofollow noreferrer"><code>public_send</code></a> to dynamically invoke a method with a given name, e.g.:</p>
<... | Can I create a closure in Ruby that adds functionality to a method and maintains its parameter definitions? | ruby|closures | 1 | 64 | 1 | 72,845,587 | 72,845,587 | 0 | true | 2022-07-01T23:30:51.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I create a closure in Ruby that adds functionality to a method and maintains its parameter definitions?<p>I would like to make a method that can take in ... |
72,846,263 | How to send custom array of objects with post body?<p>There is data classes <code>PlaylistInsertOperation</code>, <code>TrackId</code> and function <code>insertTracks</code> via Retrofit Interface.</p>
<pre class="lang-kotlin prettyprint-override"><code>data class PlaylistInsertOperation(
val tracks: List<TrackI... | <p>I create additional data class <code>PlaylistDiffRequest</code> with list of <code>InsertTracksOperation</code>. And override <code>toString</code> function that call <code>gson</code>.</p>
<pre><code>// Retrofit Interface
@FormUrlEncoded
@POST("/handlers/playlist-patch.jsx")
suspend fun patchPlaylist(
... | How to send custom array of objects with post body? | android|kotlin|gson|retrofit | 1 | 64 | 2 | 72,847,931 | 72,847,931 | 0 | true | 2022-07-03T11:51:44.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to send custom array of objects with post body?<p>There is data classes <code>PlaylistInsertOperation</code>, <code>TrackId</code> and function <code>ins... |
72,848,838 | How to communicate completion percentage from backend to front end<p>Ok so I have a Django backend that performs some tasks and one of the queries computes a complex calculation that can take from a couple of seconds up to 15 minutes based on the entered data.</p>
<p>The point is, I have a loop that I can calculate the... | <p>Requests should come from the client side. Hold the updated completion value in a model in the backend, send an AJAX request from the client side and ask for the latest completion value, get your response and display it.</p> | How to communicate completion percentage from backend to front end | node.js|django|webhooks|percentage | 0 | 64 | 1 | 72,849,299 | 72,849,299 | 0 | true | 2022-07-03T18:07:51.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to communicate completion percentage from backend to front end<p>Ok so I have a Django backend that performs some tasks and one of the queries computes a... |
72,853,348 | how can I add two different images to my code?<p>I'm trying to add two different images (png) to my code and The result shows me the same image twice,I tried to add the different image to the same code but it showed me an error, I tried to change the names of the function but did not giveת I tried to download the image... | <p>I don't know exactly how these modules work, but I think your problem is due to setting img and pic to the two different images.</p>
<p>I would guess that the presentation isn't saved until you call prs.save, and at that point it renders all of the slides. When this is called, img and pic both refer to pkar.png.</p... | how can I add two different images to my code? | python|python-imaging-library|sys|python-pptx | 0 | 64 | 1 | 72,854,516 | 72,854,516 | 0 | true | 2022-07-04T07:49:35.577Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how can I add two different images to my code?<p>I'm trying to add two different images (png) to my code and The result shows me the same image twice,I tried... |
72,839,299 | C# TCP NetworkStream with FileStream losing data<p>I'm programing an application where I need to make file transfers.</p>
<p>Most of the communication in my application is TCP and works just fine. But when I try to do a file transfer, I seem to lose some bytes at the start and/or end of the file.</p>
<p>Here is the pie... | <p>As I had assumed the problem lies on the TcpClient. When using normal sockets everything works as it should: no data loss.</p>
<p>Client code:</p>
<pre class="lang-cs prettyprint-override"><code>Thread receiveFile = new Thread(new ThreadStart(() =>
{
Socket socket = new Socket(AddressFamily.InterNetwork, Sock... | C# TCP NetworkStream with FileStream losing data | c#|tcp|filestream|networkstream | 0 | 64 | 1 | 72,855,793 | 72,855,793 | 0 | true | 2022-07-02T13:10:06.467Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# TCP NetworkStream with FileStream losing data<p>I'm programing an application where I need to make file transfers.</p>
<p>Most of the communication in my ... |
72,855,050 | Finish loop before exiting with a KeyboardInterrupt<p>I have some program logic that works as follows:</p>
<pre class="lang-py prettyprint-override"><code>for i in range(10**6):
foo(i)
print("foo executed with parameter", i)
bar(i)
print("bar executed with parameter", i)
</code></pre... | <p>Thank you to <a href="https://stackoverflow.com/users/5735038/omer-ben-haim">Omer Ben Haim</a> for providing an answer in the comments.</p>
<p>Indeed, the SIGINT signal can be captured using the <code>signal</code> module. Here is some proof-of-concept code that demonstrates this:</p>
<pre class="lang-py prettyprint... | Finish loop before exiting with a KeyboardInterrupt | python|python-3.x|exception|interrupt|keyboardinterrupt | 0 | 64 | 2 | 72,874,238 | 72,874,238 | 0 | true | 2022-07-04T10:09:50.487Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finish loop before exiting with a KeyboardInterrupt<p>I have some program logic that works as follows:</p>
<pre class="lang-py prettyprint-override"><code>fo... |
72,874,565 | Add values from another array, python<p>I have two sql queries, which I store in two arrays each; my first array contains 9 positions and the second 16, but I want to bring only certain positions from the second to the first.</p>
<p>What I can think of is to go through the first array (CutPoint) and look for the value... | <p>You can add two lists together like so</p>
<pre><code>>>> [1, 2, 3] + [4, 5, 6]
[1, 2, 3, 4, 5, 6]
</code></pre>
<p>It looks like you are trying to add everything after the first value of <code>val</code> to <code>apro</code>. You don't need the <code>for</code> loops, just take a slice of <code>val</code> ... | Add values from another array, python | python | 0 | 64 | 1 | 72,874,681 | 72,874,681 | 0 | true | 2022-07-05T19:25:09.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add values from another array, python<p>I have two sql queries, which I store in two arrays each; my first array contains 9 positions and the second 16, but... |
72,842,270 | Akeneo v6.x Community Edition: "This url is not allowed" on Event subscriptiion<p>I want to bind Akeneo 6 Community Edition Events API to a Laravel application, making this latter able to act on the creation of an Akeneo product within Akeneo, for example. In other words, when a user creates a product in Akeneo, Akeneo... | <p>Finally I modified the code of Akeneo CE by removing the exclusion of localhost in a PHP Array called BLACKCLIST and by removing the condition that excludes IP from Private ranges. Both modifications were done in the adequat Symfony validator's script caller.</p>
<p>Moreover, of course I've also done something about... | Akeneo v6.x Community Edition: "This url is not allowed" on Event subscriptiion | laravel|laravel-routing|akeneo | 0 | 64 | 1 | 72,884,828 | 72,884,828 | 0 | true | 2022-07-02T20:36:56.943Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Akeneo v6.x Community Edition: "This url is not allowed" on Event subscriptiion<p>I want to bind Akeneo 6 Community Edition Events API to a Laravel applicati... |
72,769,100 | How can I utilise the whitespace in Kendo Scheduler against a resource?<p>I'm looking into Telerik (JQuery UI) <a href="https://demos.telerik.com/kendo-ui/scheduler/resources-grouping-vertical" rel="nofollow noreferrer">documentation</a> on the Scheduler component they offer. The <code>dataSource</code> bound to the sc... | <p>Ok, so after raising a ticket, this is possible through templating and can be found in the documentation here: <a href="https://docs.telerik.com/kendo-ui/api/javascript/ui/scheduler/configuration/group?&_ga=2.60294062.244228060.1657095422-1203569827.1645623560#groupheadertemplate" rel="nofollow noreferrer">https... | How can I utilise the whitespace in Kendo Scheduler against a resource? | javascript|jquery|kendo-ui|kendo-scheduler | 0 | 64 | 1 | 72,885,301 | 72,885,301 | 0 | true | 2022-06-27T08:28:01.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I utilise the whitespace in Kendo Scheduler against a resource?<p>I'm looking into Telerik (JQuery UI) <a href="https://demos.telerik.com/kendo-ui/sc... |
72,885,066 | Query properties using the forge-viewer library without rendering model<p>I'm using the forge-viewer library to display models. I'm wondering if it is possible to at the same time query properties from another model, without rendering the other model or altering the state of the original viewer instance?</p>
<p>Prefera... | <p>As the documentation states, the <code>options</code> input variable for <a href="https://forge.autodesk.com/en/docs/viewer/v7/reference/Viewing/Viewer3D/#loaddocumentnode-avdocument-manifestnode-options" rel="nofollow noreferrer">loadDocumentNode()</a> is passed on to <a href="https://forge.autodesk.com/en/docs/vie... | Query properties using the forge-viewer library without rendering model | autodesk-forge|autodesk-viewer | 0 | 64 | 1 | 72,885,807 | 72,885,807 | 0 | true | 2022-07-06T14:11:10.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Query properties using the forge-viewer library without rendering model<p>I'm using the forge-viewer library to display models. I'm wondering if it is possib... |
72,877,545 | Weird behavior when using SwiftUI View as accessory view for NSSavePanel<p>I'm trying to use a view written in SwiftUI as an accessory view of my <code>NSSavePanel</code> but I struggled to get it working properly.</p>
<p>Here's the implementation for my SwiftUI view:</p>
<pre class="lang-swift prettyprint-override"><c... | <p>I remembered from back in the days when I was using XIB for implementing an accessory view: I used to embed the controls within an <code>NSView</code> and then set up constraints to make it work. So I applied the same idea here of embedding the <code>NSHostingView</code>'s <code>view</code> within a custom <code>NSV... | Weird behavior when using SwiftUI View as accessory view for NSSavePanel | swift|cocoa|swiftui|nssavepanel | 0 | 64 | 1 | 72,890,146 | 72,890,146 | 0 | true | 2022-07-06T03:07:38.617Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Weird behavior when using SwiftUI View as accessory view for NSSavePanel<p>I'm trying to use a view written in SwiftUI as an accessory view of my <code>NSSav... |
72,901,575 | python try to get next available number<p>From a range of numbers [0:2407] I need to know what are the ones that are already being used.</p>
<pre><code>arrray [0,1,2,..,2407]
</code></pre>
<p>To know the ones already used I have a file that I load with pandas.</p>
<p>example:</p>
<pre><code>...| Index |...
...| 100 |... | <p>Try this:</p>
<pre><code>import pandas as pd
import random
## for demo purpose max number is changed from 2407 to 27
max = 27
## list containing range of numbers
unsed= list(range(max+1))
print(f'all_n : {unsed}')
## define dataFrame exaple
df = pd.DataFrame(random.sample(range(max+1), 10), columns=['index'])
... | python try to get next available number | python | -1 | 64 | 2 | 72,902,753 | 72,902,753 | 0 | true | 2022-07-07T16:48:07.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python try to get next available number<p>From a range of numbers [0:2407] I need to know what are the ones that are already being used.</p>
<pre><code>arrra... |
72,900,230 | How to allocate redis-sentinel pods on different nodes?<p>I'm running the redis chart (<a href="https://artifacthub.io/packages/helm/bitnami/redis/15.7.0" rel="nofollow noreferrer">https://artifacthub.io/packages/helm/bitnami/redis/15.7.0</a>) as a dependency of a custom chart. I enabled sentinel, then the pods are run... | <p>Thank you all for your answers. Finally I solved it with:</p>
<pre><code>spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/component: node
app.kubernetes.io/instance: myapp
a... | How to allocate redis-sentinel pods on different nodes? | kubernetes|redis|redis-sentinel | 1 | 64 | 3 | 72,915,958 | 72,915,958 | 0 | true | 2022-07-07T15:07:19.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to allocate redis-sentinel pods on different nodes?<p>I'm running the redis chart (<a href="https://artifacthub.io/packages/helm/bitnami/redis/15.7.0" re... |
72,911,001 | simple way to confirm if a video has a black or transparent background<p>What is a method of determining if you are seeing a black or transparent background when working with videos without using anything other than the Windows OS?</p> | <p>I found an excellent method! In Windows, you can get a thumbnail out of your video by "zooming in" in the explorer. Make the icons for each file in the current folder as big as possible, like this</p>
<p><a href="https://i.stack.imgur.com/HV7zu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur... | simple way to confirm if a video has a black or transparent background | ffmpeg | -1 | 64 | 1 | 72,916,311 | 72,916,311 | 0 | true | 2022-07-08T11:54:17.417Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
simple way to confirm if a video has a black or transparent background<p>What is a method of determining if you are seeing a black or transparent background ... |
72,916,819 | Conversion from Markdown to HTML in Django project<p>I'm on a project which include use of Python, Django, HTML and Markdown. I have to develop a site similar to wikipedia, in fact the project is called encyclopedia. My goal is to make visiting / wiki / TITLE, where TITLE is the title of an encyclopedia entry, to displ... | <p>You need to disable escaping the rendered HTML content, by using the <a href="https://docs.djangoproject.com/en/dev/ref/templates/builtins/#safe" rel="nofollow noreferrer"><strong><code>|safe</code></strong> template filter <sup>[Django-doc]</sup></a>:</p>
<pre>{{ content<strong>|safe</strong> }}</pre> | Conversion from Markdown to HTML in Django project | python|django|django-views|python-markdown | 1 | 64 | 1 | 72,916,845 | 72,916,845 | 0 | true | 2022-07-08T20:44:21Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Conversion from Markdown to HTML in Django project<p>I'm on a project which include use of Python, Django, HTML and Markdown. I have to develop a site simila... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.