question_id int64 37.6M 73.2M | input_text stringlengths 88 52.4k | output_text stringlengths 37 35.6k | title stringlengths 15 150 | tags stringlengths 1 107 | q_score int64 -19 397 | view_count int64 3 879k | answer_count int64 1 21 | accepted_answer_id int64 37.6M 73.8M | answer_id int64 37.6M 73.8M | a_score int64 -5 1.29k | is_accepted bool 1
class | creation_date stringlengths 20 24 | input_text_instruct stringlengths 251 52.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
72,205,467 | Calculate duration using timestamps (string)<p>Newcomer here to the coding world.</p>
<p>I've written this chunk of code to calculate the time difference (duration) between two timestamps. I'm pretty happy with it. But I want to know if there is any way I can improve on what I wrote and get the same outcome.</p>
<p>Her... | <p>You can subtract one timestamp directly from the other to get the difference in milliseconds. Your version will also only be accurate if both timestamps are on the same day.</p>
<pre class="lang-js prettyprint-override"><code> const startTime = "2202-05-12T10:00:00Z"
const endTime = "2202-05-12T11... | Calculate duration using timestamps (string) | javascript|react-native|datetime|timestamp | 0 | 69 | 1 | 72,205,598 | 72,205,598 | 0 | true | 2022-05-11T17:48:26.960Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calculate duration using timestamps (string)<p>Newcomer here to the coding world.</p>
<p>I've written this chunk of code to calculate the time difference (du... |
72,186,721 | How do I add a new line in a desktop notification in PowerShell<p>This is the project</p>
<pre><code>echo $ErrorActionPreference = "Stop"
echo $notificationTitle = "Aa1234567890"
echo [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $nu... | <p>Like @Jeroen Mostert said, you have to use the template ToastText02, you will be able to use <code><text id="1">$Title</text></code> for the title and <code><text id="2">$Text</text></code> for the text in your xml</p>
<pre><code>$ErrorActionPreference = "Stop"
$... | How do I add a new line in a desktop notification in PowerShell | powershell | 0 | 74 | 1 | 72,207,402 | 72,207,402 | 0 | true | 2022-05-10T12:55:14.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I add a new line in a desktop notification in PowerShell<p>This is the project</p>
<pre><code>echo $ErrorActionPreference = "Stop"
echo $not... |
72,226,851 | Getting a value Error : how to use string data type in model.fit for jupyter using DecisionTreeClassifier?<p>this is the code</p>
<pre><code>import pandas as pd
from sklearn.tree import DecisionTreeClassifier
dataset = pd.read_csv("emotion.csv")
X = dataset.drop(columns = ["mood"])
y = dataset['mood... | <h1>Feature engineering</h1>
<p>You can't use raw features represented with strings in <code>DecisionTreeClassifier</code>. You have to train your decision tree on the data represented with numbers. <code>ValueError: could not convert string to float: 'oh yeah'</code> means that decision tree tried to take <code>float(... | Getting a value Error : how to use string data type in model.fit for jupyter using DecisionTreeClassifier? | python|pandas|scikit-learn|jupyter-notebook | 0 | 47 | 1 | 72,227,645 | 72,227,645 | 0 | true | 2022-05-13T08:51:08.557Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting a value Error : how to use string data type in model.fit for jupyter using DecisionTreeClassifier?<p>this is the code</p>
<pre><code>import pandas as... |
72,163,251 | Telegram bot Error - AttributeError: 'int' object has no attribute 'chat'<p>What does this error mean and what do I need to do to make my code work?</p>
<p>This bot is a random number generator with customizable number range. It gets the first digit of the range, then the second digit of the range, and after that it in... | <p>It should work.
Also you can check this <a href="https://github.com/eternnoir/pyTelegramBotAPI/blob/master/examples/step_example.py" rel="nofollow noreferrer">example</a></p>
<pre><code>import telebot
import random
from telebot import types
bot = telebot.TeleBot('TOKEN')
# Start
@bot.message_handler(commands=['st... | Telegram bot Error - AttributeError: 'int' object has no attribute 'chat' | python | 0 | 177 | 1 | 72,164,287 | 72,164,287 | 0 | true | 2022-05-08T16:54:39.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Telegram bot Error - AttributeError: 'int' object has no attribute 'chat'<p>What does this error mean and what do I need to do to make my code work?</p>
<p>T... |
72,183,727 | Oracle Date in Where Clause give me this error ORA-00932: inconsistent datatypes: expected NUMBER got DATE<p>sql request is:</p>
<pre><code>select DRCR_CR_DT
from PS_DRCR
where
TRUNC(DRCR_CR_DT)= TO_DATE('1/4/2022','dd/mon/yyyy');
</code></pre>
<p>the type of DRCR_CR_DT is: DATE</p>
<p>DRCR_CR_DT contain something l... | <p>I'd expect something different; if date you provide is <code>1/4/2022</code>, then there's no <code>mon</code> format model in it:</p>
<pre><code>SQL> select to_date('1/4/2022', 'dd/mon/yyyy') from dual;
select to_date('1/4/2022', 'dd/mon/yyyy') from dual
*
ERROR at line 1:
ORA-01843: not a valid m... | Oracle Date in Where Clause give me this error ORA-00932: inconsistent datatypes: expected NUMBER got DATE | sql|oracle|date | 0 | 151 | 2 | 72,183,932 | 72,183,932 | 0 | true | 2022-05-10T09:20:16.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Oracle Date in Where Clause give me this error ORA-00932: inconsistent datatypes: expected NUMBER got DATE<p>sql request is:</p>
<pre><code>select DRCR_CR_DT... |
72,186,376 | i need to perform a oracle trigger with exception which has dependency on two tables but need to perform trogger on only one table<p>I had the below requirement</p>
<p>`<a href="https://i.stack.imgur.com/iprU5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iprU5.png" alt="TABLE1" /></a></p>
<p><a hr... | <p>That's not a <em>trigger</em> issue, but various <em>constraints</em>:</p>
<ul>
<li><strong>foreign key</strong> will check whether ID exists</li>
<li><code>NOT NULL</code> will make sure it isn't empty</li>
<li><strong>check</strong> constraint will check its length (but that's irrelevant as foreign key constraint ... | i need to perform a oracle trigger with exception which has dependency on two tables but need to perform trogger on only one table | oracle|exception|triggers | 0 | 24 | 1 | 72,186,454 | 72,186,454 | 0 | true | 2022-05-10T12:32:15.007Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
i need to perform a oracle trigger with exception which has dependency on two tables but need to perform trogger on only one table<p>I had the below requirem... |
72,226,289 | Need to get appropriate/expected row number in Oracle PLSQL<p>Getting the following output when i use the below query</p>
<p><a href="https://i.stack.imgur.com/W8tww.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W8tww.png" alt="enter image description here" /></a></p>
<pre><code>SELECT P.RefNum
... | <p>First find "groups" each of those rows belongs to (partitioned by refnum and name) (that's what the <code>temp</code> CTE does), and then apply dense_rank to fetch the final result.</p>
<p>Sample data (simplified, as I don't have your tables):</p>
<pre><code>SQL> WITH
2 test (refnum,
3 ... | Need to get appropriate/expected row number in Oracle PLSQL | sql|oracle|oracle12c|oracle19c | 0 | 17 | 1 | 72,226,342 | 72,226,342 | 0 | true | 2022-05-13T08:05:12.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need to get appropriate/expected row number in Oracle PLSQL<p>Getting the following output when i use the below query</p>
<p><a href="https://i.stack.imgur.c... |
72,170,895 | Display FullName on DropdownListFor but submit Id - ASP.NET MVC C#<p>I'm trying to build a form for information about upcoming exams. My plan is to make a dropdown list which shows a List of teachers to chose from and who will be responsible for the exam.</p>
<p>Here's a simplified version of my Models:</p>
<pre><code... | <p>I found a solution:</p>
<ol>
<li>First I created a second ViewModel with a property <code>Id</code> for <code>Teacher.Id</code> and <code>FullName</code> for <code>Person.FirstName + " " + Person.Surname</code>:</li>
</ol>
<pre><code>public class TeacherViewModel
{
public int Id { get; set; }
... | Display FullName on DropdownListFor but submit Id - ASP.NET MVC C# | c#|asp.net|asp.net-mvc|entity-framework | 0 | 83 | 2 | 72,187,707 | 72,187,707 | 0 | true | 2022-05-09T11:01:04Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Display FullName on DropdownListFor but submit Id - ASP.NET MVC C#<p>I'm trying to build a form for information about upcoming exams. My plan is to make a d... |
72,061,069 | Custom Element based in props with React<p>So I was wondering if can pass the element name with React to an child componenet, so for example I have this now:</p>
<pre class="lang-js prettyprint-override"><code>export default function Title({ title, style, size }) {
switch (size) {
case 'h1':
return <h1 s... | <p>You can use <a href="https://reactjs.org/docs/react-api.html#createelement" rel="nofollow noreferrer"><code>React.createElement</code></a> to achieve it</p>
<ul>
<li>The first param is your tag name like (<code>h1</code>, <code>h2</code>, etc.) or another React component</li>
<li>The second param is your props like ... | Custom Element based in props with React | reactjs | 0 | 31 | 1 | 72,061,147 | 72,061,147 | 0 | true | 2022-04-29T16:33:03.590Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Custom Element based in props with React<p>So I was wondering if can pass the element name with React to an child componenet, so for example I have this now:... |
72,145,546 | Unable to center the content within a Material UI TableCell<p>I have <code>TableCell</code> which shows a <code>status</code> and a <code>Button</code>. I want them to be vertically stacked and centered in the cell. I am able to get either working separately but not together. I am using <code>FlexBox</code> to vertical... | <p>You should add <code>textAlign: 'center'</code> and <code>margin: 'auto'</code> to <code>TableCell</code></p>
<ul>
<li><code>textAlign: 'center'</code> is for status text center</li>
<li><code>margin: 'auto'</code> is to center status and button when they have spare space from both sides (left and right)</li>
</ul>
... | Unable to center the content within a Material UI TableCell | reactjs|material-ui | 0 | 51 | 1 | 72,145,639 | 72,145,639 | 0 | true | 2022-05-06T17:49:07.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to center the content within a Material UI TableCell<p>I have <code>TableCell</code> which shows a <code>status</code> and a <code>Button</code>. I wa... |
72,020,788 | Field annotated with @Transient being persisted in @DataJpaTest<p>I'm practicing TDD,
So now I'm trying to make a test that will fail for now. About to test a <code>@Entity</code> that don't have a field relationship mapped so far. So I'm expecting my test to fail.</p>
<p>Here is TableA entity, you may notice that the ... | <p>So my friend and I spent some time trying to figure out what was going on. We've found <a href="https://github.com/spring-projects/spring-boot/issues/11183" rel="nofollow noreferrer">this github issue</a> that describes exactly the same issue. The person who open the issue also create a <a href="https://github.com/h... | Field annotated with @Transient being persisted in @DataJpaTest | java|testing|spring-data-jpa|tdd | 0 | 34 | 1 | 72,103,323 | 72,103,323 | 0 | true | 2022-04-26T21:35:27.180Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Field annotated with @Transient being persisted in @DataJpaTest<p>I'm practicing TDD,
So now I'm trying to make a test that will fail for now. About to test ... |
72,211,386 | How to auto select function with the arg type?<p>for example in c#</p>
<pre><code>void Foo(object obj){
Do(obj);
}
void Do(T1 obj){}
void Do(T2 obj){}
void Do(T3 obj){}
</code></pre>
<p>How can I implement that the Foo function can choose correct Do function to perform obj without using switch or if?</p> | <p>If you don't want <code>if</code> or <code>switch</code> or cast or pattern matching,
you can use <code>dynamic</code>. <br/>Not best practice, likely, but works.</p>
<pre><code>void Foo(object obj){
dynamic value = obj;
Do(value); // will throw if obj is not T1 T2 or T3
}
</code></pre> | How to auto select function with the arg type? | c# | 0 | 61 | 3 | 72,211,553 | 72,211,553 | 0 | true | 2022-05-12T07:07:56.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to auto select function with the arg type?<p>for example in c#</p>
<pre><code>void Foo(object obj){
Do(obj);
}
void Do(T1 obj){}
void Do(T2 obj){}
vo... |
72,119,449 | Rolling OLS Regressions and Predictions by Group<p>I have a Pandas dataframe with some data on race car drivers. The relevant columns look like this:</p>
<pre><code>
|Date |Name |Distance |avg_speed_calc
|---- |---- |---- |----
|9/6/20 | Smith | 8 | 85.6
|9/6/20 | Douglas | ... | <p>You should be able to achieve what you want using the groupby / apply pattern. The below code should be helpful.</p>
<p><strong>Create example data:</strong></p>
<pre><code>from statsmodels.regression.rolling import RollingOLS
from statsmodels.tools.tools import add_constant
import pandas as pd
import numpy as np
#... | Rolling OLS Regressions and Predictions by Group | python|dataframe|pandas-groupby|statsmodels|rolling-computation | 0 | 266 | 1 | 72,122,183 | 72,122,183 | 0 | true | 2022-05-04T21:02:56.897Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rolling OLS Regressions and Predictions by Group<p>I have a Pandas dataframe with some data on race car drivers. The relevant columns look like this:</p>
<pr... |
72,219,414 | How to get the block device name for a file?<p>This is <a href="https://en.wiktionary.org/wiki/yak_shaving" rel="nofollow noreferrer">yak-shaving</a> an <a href="https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem">X-Y problem</a>
So I shall start from the beginning.</p>
<p>I wish to test the behaviou... | <p>Here is the hideous script I created to do this.
Please let there be a better way!</p>
<pre><code>#!/bin/bash
#
# Given a file identify the block device on which it resides
#
PROGNAME=`basename $0`
STATUS=0
VERBOSE=0
showUsage() {
echo "usage:"
echo " $PROGNAME <filename>"
}
sho... | How to get the block device name for a file? | linux|mount|sysfs|block-device | 0 | 375 | 1 | 72,219,415 | 72,219,415 | 0 | true | 2022-05-12T16:49:58.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the block device name for a file?<p>This is <a href="https://en.wiktionary.org/wiki/yak_shaving" rel="nofollow noreferrer">yak-shaving</a> an <a h... |
72,236,039 | Custom PowerShell Label script<p>Asking for a bit of help on my script. I would like to get a list saved to a thumb drive with the computer name and the WAN address. I know I can add a custom label with the computer name but would get the default name. I already set the computer to change the name on reboot but I do no... | <p>I ended up just saving a TXT to the desktop of the computer, this way I can add the new computer name manually. This way I can then grab all the text files and consolidate them into one CSV or txt file. A bit of work but at least I can set the restart for later while I am able to install the rest of the software.</p... | Custom PowerShell Label script | powershell|csv|script|ps1 | 0 | 67 | 1 | 72,268,282 | 72,268,282 | 0 | true | 2022-05-13T22:45:28.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Custom PowerShell Label script<p>Asking for a bit of help on my script. I would like to get a list saved to a thumb drive with the computer name and the WAN ... |
72,207,714 | powershell script isn't working, but shows no errors. Find all .xml files in a directory, do a replace on some text, move to different directory<p>The powershell script errored out a few times b/c of missed commas and the like. Now it appears to run with no errors, but nothing happens - files aren't moved, text isn't r... | <p>You lose context of <code>$_</code> when you go to <code>Set-Content</code>. <code>$newContent = Set-Content $_</code> I assume the <code>$_</code> is supposed to reference the file name, but at that point it contains the modified content of the file. Try <code>Set-Content -Path $_ -Value $newContent</code> instea... | powershell script isn't working, but shows no errors. Find all .xml files in a directory, do a replace on some text, move to different directory | powershell | 0 | 31 | 1 | 72,208,110 | 72,208,110 | 0 | true | 2022-05-11T21:21:30.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
powershell script isn't working, but shows no errors. Find all .xml files in a directory, do a replace on some text, move to different directory<p>The powers... |
72,208,443 | ClosedXML cannot set cell data tyep to Number format with a long - v0.95.4.0<p>Hi all for my first question!</p>
<p>I am using ClosedXML (great solution to go to Excel) and everything seems to work as prescribed with the exception of making/formatting a cell to a Number.
At first I though it might be something with the... | <p>Welcome to SO.</p>
<p>ClosedXML should set the data type correctly by itself.
But that is in terms of Excel not what you intended to achieve.</p>
<p>You want to format the value as number, the dropdown in Excel therefore even is called number format.
In code this is done by modifying the cell style.</p>
<p>The follo... | ClosedXML cannot set cell data tyep to Number format with a long - v0.95.4.0 | c#|excel|closedxml | 0 | 294 | 1 | 72,222,684 | 72,222,684 | 0 | true | 2022-05-11T22:56:39.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ClosedXML cannot set cell data tyep to Number format with a long - v0.95.4.0<p>Hi all for my first question!</p>
<p>I am using ClosedXML (great solution to g... |
72,145,613 | malloc(): corrupted top size Process finished with exit code 134 (interrupted by signal 6: SIGABRT)<p>please tell me why memory is not allocated in the line <code>CLNAME* tmp=new CLNAME[this->Capacity_Ram];</code> the second day I'm looking for a problem, I can not understand what the problem is. The task is to writ... | <p>In <code>MyVector<CLNAME>::PushBack</code></p>
<pre><code>if (this->Size_Ram==0){
Array = new CLNAME[this->Capacity_Ram]; // already done in constructor, leaks.
// sets capacity of 5
this->Capacity_Ram=Capacity_Ram*2; // advertises a capacity o... | malloc(): corrupted top size Process finished with exit code 134 (interrupted by signal 6: SIGABRT) | c++ | 0 | 101 | 1 | 72,145,836 | 72,145,836 | 0 | true | 2022-05-06T17:54:00.597Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
malloc(): corrupted top size Process finished with exit code 134 (interrupted by signal 6: SIGABRT)<p>please tell me why memory is not allocated in the line ... |
72,225,361 | Updating notifications after being added<p>I want to update the content for a reminder after it has been added before being received by the user. After setting a reminder through AlarmManager using the data stored in sqlite database, the notification from the reminder set only shows the data, title and description, tha... | <p>For updating a pending intent, you need to use <code>FlAG_UPDATE_CURRENT</code> with the same <code>id</code> you used earlier to set the <strong>initial intent</strong>.</p>
<p>If you want to update the alarm associated with that pending intent, you need to <strong>cancel the old alarm & then the old <code>Pend... | Updating notifications after being added | java|android | 0 | 74 | 1 | 72,225,842 | 72,225,842 | 0 | true | 2022-05-13T06:37:06.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Updating notifications after being added<p>I want to update the content for a reminder after it has been added before being received by the user. After setti... |
72,182,715 | How to get json response from aiohttp?<p>how to get json response from aiohttp?
if i use .json() i getting the error:</p>
<blockquote>
<p>File "main.py", line 371, in _checker
user_name = f'{res_json["username"]}#{res_json["discriminator"]}'</p>
</blockquote>
<p>TypeError: 'coroutine' obje... | <p><code>.json()</code> <a href="https://docs.python.org/3/library/asyncio-task.html#coroutines" rel="nofollow noreferrer">returns a coroutine</a>, hence you need to <a href="https://docs.aiohttp.org/en/stable/client_quickstart.html#json-response-content" rel="nofollow noreferrer"><code>await</code> the <code>response.... | How to get json response from aiohttp? | python|json|python-3.x|aiohttp | 0 | 243 | 1 | 72,182,761 | 72,182,761 | 0 | true | 2022-05-10T08:05:11.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get json response from aiohttp?<p>how to get json response from aiohttp?
if i use .json() i getting the error:</p>
<blockquote>
<p>File "main.py&... |
72,065,425 | Does Flink task managers ever talk to the deep store service?<p>I am interested in understanding how Flink performs checkpoints (or savepoints) a little better. Here is my points of curiosity:</p>
<p>Does Flink Job manager gather all the state from the task managers and then push this data to the deep store service (li... | <p>Overall the design is that each task manager writes the state it is managing, and the job manager writes the metadata. Each of these machines (or containers) writes directly to the distributed filesystem, and they all need to use the same URI.</p>
<p>However, the details are a little more complex. A checkpoint (or s... | Does Flink task managers ever talk to the deep store service? | apache-flink|flink-streaming|distributed-system | 0 | 26 | 1 | 72,066,430 | 72,066,430 | 0 | true | 2022-04-30T03:16:08.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does Flink task managers ever talk to the deep store service?<p>I am interested in understanding how Flink performs checkpoints (or savepoints) a little bett... |
72,223,253 | AWK remove query params from URL<p>I have access.log file with >1m lines. The exaple of line:</p>
<pre><code>113.10.154.38 - - [27/May/2016:03:36:26 +0200] "POST /index.php?option=com_jce&task=plugin&plugin=imgmanager&file=imgmanager&method=form&cid=20&6bc427c8a7981f4fe1f5ac65c1246b5f=cf... | <p>Use the <code>sub()</code> function to remove a pattern from a string.</p>
<p>You also need to do this when you're extracting the field to sort and count unique values.</p>
<pre><code>awk '{sub(/\?.*/, "", $7); print $7}' test.log | sort | uniq -c | sort -rn | ...
</code></pre> | AWK remove query params from URL | parsing|url|awk | 0 | 97 | 1 | 72,223,424 | 72,223,424 | 0 | true | 2022-05-13T00:10:56.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AWK remove query params from URL<p>I have access.log file with >1m lines. The exaple of line:</p>
<pre><code>113.10.154.38 - - [27/May/2016:03:36:26 +0200... |
72,234,427 | How can I use the filter() function to filter this set of data from API?<p>API Call code:</p>
<pre><code>const settings = {
"async": true,
"crossDomain": true,
"url": "https://v3.football.api-sports.io/fixtures?date=2021-04-07",
"method": "GET",
"headers&... | <p>Use the <code>includes()</code> method to test if the league ID in the response is in the <code>arrWant</code> array.</p>
<p>Use <code>dataType: 'json'</code> so that <code>$.ajax()</code> will parse the JSON in the response.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel... | How can I use the filter() function to filter this set of data from API? | javascript|html|jquery|api|rest | 0 | 120 | 1 | 72,234,465 | 72,234,465 | 0 | true | 2022-05-13T19:11:11.837Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I use the filter() function to filter this set of data from API?<p>API Call code:</p>
<pre><code>const settings = {
"async": true,
"cr... |
72,228,747 | How can i show previous 30 days in my list calendar?<p>I have a calendar, that works correct but shows only current day and future. How can i set previous days? I'd like to highliht a current day but also give an opportunity to scroll it to right and left. Maybe have your already faced to this problem. Help me please.<... | <p>Have you tried using.</p>
<p><code>var lastMonth = new DateTime(date.year, date.month - 1, date.day);</code></p> | How can i show previous 30 days in my list calendar? | android|ios|flutter|dart | 0 | 37 | 1 | 72,228,878 | 72,228,878 | 0 | true | 2022-05-13T11:21:38.127Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i show previous 30 days in my list calendar?<p>I have a calendar, that works correct but shows only current day and future. How can i set previous da... |
72,102,088 | I want to save a .text file in a specific file directory for information entered by someone<p>Whenever this function is called all the information is saved to the list playerInfo. Now I would like to save this list as a .text file with the name being the name enter by the user (p_name) for later use in the directory:
C... | <p>Check if below mentioned code snippet works for you:</p>
<pre><code># to save playerInfo to .text file
playerFilePath = 'C:\\Users\\Vatiekakie\\OneDrive\\Documents\\CourseWorkProject\\Players'
playerFileName = p_name
outputPath = os.path.join(playerFilePath, playerFileName) ## import os library for this line to work... | I want to save a .text file in a specific file directory for information entered by someone | python|pyqt5|save | 0 | 28 | 2 | 72,102,180 | 72,102,180 | 0 | true | 2022-05-03T15:50:47.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I want to save a .text file in a specific file directory for information entered by someone<p>Whenever this function is called all the information is saved t... |
72,214,241 | Scaleproblem: VizFrame Dual Barchart Rendering of Values<p>I made a dual barchart with vizframe, but I ran into a problem.</p>
<p>The values of the two datasets don't render on the same scale.</p>
<p>This makes the comparison of the datasets near impossible.</p>
<p>Example:
<a href="https://i.stack.imgur.com/Kj6dk.png"... | <p>It seems to be a bug in Viz.</p>
<p>It will render wrong depending on the size of the window and the values of the dataset.
I checked it with different browsers and different PCs.
A workaround would be to set the max values of the axis.</p>
<p>A solution was found! I will at the code solution to the question.</p>
<p... | Scaleproblem: VizFrame Dual Barchart Rendering of Values | odata|sapui5|sap-fiori | 0 | 67 | 1 | 72,255,083 | 72,255,083 | 0 | true | 2022-05-12T10:49:17.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scaleproblem: VizFrame Dual Barchart Rendering of Values<p>I made a dual barchart with vizframe, but I ran into a problem.</p>
<p>The values of the two datas... |
72,147,219 | Thymeleaf + spring save new object instead of update<p>I am asking for a hint. I searched the internet for a long time for a solution to the problem, but I'm already desperate. I would like the update operation to update a record in the table instead of writing a new one. Sorry for my code i am a beginner.</p>
<p>It is... | <p>One way to do this is by first fetching the job that matches your job argument from the repository and then applying the necessary changes to it before saving (updating) it to the database.</p>
<pre><code>@Override
public void updateJob(Job job) {
//I assume job.getId() returns an integer here, otherwise use an... | Thymeleaf + spring save new object instead of update | java|mysql|spring|thymeleaf | 0 | 169 | 2 | 72,151,887 | 72,151,887 | 0 | true | 2022-05-06T20:50:12.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Thymeleaf + spring save new object instead of update<p>I am asking for a hint. I searched the internet for a long time for a solution to the problem, but I'm... |
72,067,775 | How to make specific component functional in a flatlist?<p>I am making an app where anyone can join a fantasy golf tournament. On my homepage there is a flatlist which is receiving data from api. There will be many tournaments but the user can only join the upcoming one. Now what i want to do is disable the functionali... | <p>You could use row index and modulus operator to define the disabled prop like this:</p>
<pre><code> const renderItem = ({ item, index }) => (
<View>
<Item title={item.name} disabled={index % 1 === 1} location={item.location} date={item.startDate} Id={item.Id} />
</View>
);`
</co... | How to make specific component functional in a flatlist? | react-native | 0 | 31 | 1 | 72,067,968 | 72,067,968 | 0 | true | 2022-04-30T10:40:02.233Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make specific component functional in a flatlist?<p>I am making an app where anyone can join a fantasy golf tournament. On my homepage there is a flat... |
72,236,884 | Pass URI to Bundled Application<p>I have a .app created with pyinstaller. The <code>info.plist</code> is excerpted below:</p>
<pre><code>...
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>Flagship</string... | <p>I ended up figuring this out using PySide6. Using a subclass of QApplication allowed me to define an event handler that catches a 'file open' event... the browser, even if it is not 'opening' a file, still passes the full uri. Code below:</p>
<pre><code>from PySide6.QtCore import QEvent, QUrl
from PySide6.QtWidgets ... | Pass URI to Bundled Application | python|pyinstaller | 0 | 33 | 1 | 72,243,422 | 72,243,422 | 0 | true | 2022-05-14T02:26:48.187Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pass URI to Bundled Application<p>I have a .app created with pyinstaller. The <code>info.plist</code> is excerpted below:</p>
<pre><code>...
<key>C... |
72,168,322 | yii2 mailer how to not automatically use smtp gmail username as "From" Header<p>I built a website which has a contact form. I use yii2 mailer and smtp gmail setup for sending email. This is my smtp setup:</p>
<pre><code>'host' => 'smtp.gmail.com',
'username' => 'websendmail1234@gmail.com',
'password' => 'mysec... | <p>According to <a href="https://forum.yiiframework.com/t/setting-reply-to-name-for-sending-an-email/81995" rel="nofollow noreferrer">this question</a> you must set <code>setFrom</code> as indexed array and add <code>setReplyTo</code> call:</p>
<pre class="lang-php prettyprint-override"><code>Yii::$app->mailer->c... | yii2 mailer how to not automatically use smtp gmail username as "From" Header | php|email|yii2|swiftmailer | 0 | 78 | 1 | 72,168,401 | 72,168,401 | 0 | true | 2022-05-09T07:25:51.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
yii2 mailer how to not automatically use smtp gmail username as "From" Header<p>I built a website which has a contact form. I use yii2 mailer and smtp gmail ... |
72,216,251 | How do I subset the columns of a dataframe based on the index of another dataframe?<p>The rows of <code>clin.index</code> (row length = 81) is a subset of the columns of <code>common_mrna</code> (col length = 151). I want to keep the columns of <code>common_mrna</code> only if the column names match to the row values o... | <p>Try this using <code>reindex</code>:</p>
<pre><code>common_mrna.reindex(clin.index, axis=1)
</code></pre>
<p>Output:</p>
<pre><code> A D
First 1 4
Second 5 7
</code></pre>
<hr />
<p>Update, IIUC:</p>
<pre><code>common_mrna.set_index('Hugo_Symbol').reindex(clin.index, axis=1).reset_index()
</code></pre> | How do I subset the columns of a dataframe based on the index of another dataframe? | pandas | 0 | 47 | 2 | 72,223,049 | 72,223,049 | 0 | true | 2022-05-12T13:13:07.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I subset the columns of a dataframe based on the index of another dataframe?<p>The rows of <code>clin.index</code> (row length = 81) is a subset of th... |
72,158,301 | Flutter black screen after phone sleeps or by pressing the power button<p>I want my app to run even if the screen closes to avoid accidental press and to consume less battery. But whenever I resume the app, it always displays a black screen even though I can still hear the app working as intended. I always needed to ho... | <p>it seems this bug is not visible in channel master. so <code>flutter channel master</code> does the trick in fixing this issue.</p> | Flutter black screen after phone sleeps or by pressing the power button | android|flutter|sleep|onresume | 0 | 238 | 1 | 72,162,070 | 72,162,070 | 0 | true | 2022-05-08T05:21:14.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter black screen after phone sleeps or by pressing the power button<p>I want my app to run even if the screen closes to avoid accidental press and to con... |
72,175,936 | React Redux Toolkit access value inside array of objects<p>Component:</p>
<pre><code>const postState = useSelector((state: RootState) => state.postsSlice.posts);
{postState?.map((post) => {
return (
<PostCard
key={post.id}
title={post.... | <p>For such case you can add a reducer that gets the post id and updates it with the value passed on the action payload, like so:</p>
<h3>Reducer</h3>
<pre><code>const PostSlice = createSlice({
name: "PostSlice",
initialState: initialState,
reducers: {
setPostsData(state, action: PayloadAction<Ar... | React Redux Toolkit access value inside array of objects | reactjs|typescript|redux|redux-toolkit | 0 | 354 | 1 | 72,180,077 | 72,180,077 | 0 | true | 2022-05-09T17:21:25.313Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React Redux Toolkit access value inside array of objects<p>Component:</p>
<pre><code>const postState = useSelector((state: RootState) => state.postsSlice.... |
72,147,369 | decrease number server making with express put method<p>I am trying to decrease the quantity, which I have to change on mongodb database, also I need to show it in body. I set a button called delivered which will decrease the quantity value by 1 . but when I click on the delivered button suddenly nodemon index.js cmd ... | <p>Client side:</p>
<pre><code>const handleQuantity = (quantity) => {
const newQuantity = parseInt(quantity) - 1;
// console.log(newQuantity);
fetch(`http://localhost:5000/inventory/${itemsId}`, {
method: "PUT",
headers: {
'content-type': 'application/json'
}... | decrease number server making with express put method | node.js|reactjs|mongodb|express | 0 | 32 | 1 | 72,147,449 | 72,147,449 | 0 | true | 2022-05-06T21:06:46.343Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
decrease number server making with express put method<p>I am trying to decrease the quantity, which I have to change on mongodb database, also I need to show... |
72,194,464 | Stop to bring duplicate results based in a condition<p>Even though my query is behaving the way it should be, I have an issue in the records that I can't fix in the database.
So, I want to fix it in the query.</p>
<p>The issue is: as the image attached, for one specific customer, there are duplicate IDs due to the Sale... | <ol>
<li>Basically, I have used the function ROW_NUMBER, as shown in the line before your "id" column.</li>
<li>In case you do not want to show the "row number column" or "rn" in the results, you can replace the <code>*</code> in the following query, <code>SELECT * FROM TMP WHERE rnk = 1</... | Stop to bring duplicate results based in a condition | sql-server-2008|ssms | 0 | 35 | 1 | 72,195,258 | 72,195,258 | 0 | true | 2022-05-11T01:28:06.990Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Stop to bring duplicate results based in a condition<p>Even though my query is behaving the way it should be, I have an issue in the records that I can't fix... |
72,053,579 | How to reenable required field validation for firstname field on place order click in checkout page of magento after disabling it in layout<p>Magento 2.4
PHP7.4</p>
<p>I need to move the validation of firstname field to click Place Order. This means when Place Order is clicked the firstname field validation should show... | <p>The answer was found by contacting Amasty support - the dynamic validation need to be turned off (shipping-mixin.js).</p> | How to reenable required field validation for firstname field on place order click in checkout page of magento after disabling it in layout | validation|checkout|magento2.4 | 0 | 263 | 1 | 72,136,624 | 72,136,624 | 0 | true | 2022-04-29T06:19:02.097Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reenable required field validation for firstname field on place order click in checkout page of magento after disabling it in layout<p>Magento 2.4
PHP... |
72,098,841 | Constructing an ECPublic Key in Java from Java Card<p>This question relates to this one here: <a href="https://stackoverflow.com/questions/30733932/recovering-an-ecpublickey-from-javacard-to-java">Recovering an ECPublicKey from JavaCard to Java</a></p>
<p>However in the answer it isn't explained how to extract x and y ... | <p>The 'w' value is made up of the x and y values.</p>
<p>The first byte should be either 04, 02 or 03 - which indicates if it is uncompressed or compressed. The last two bytes are status bytes, e.g. 90 00.</p>
<p>The remaining bytes are the x, then y value, which are both the same length</p> | Constructing an ECPublic Key in Java from Java Card | java|cryptography|smartcard|javacard|elliptic-curve | 0 | 33 | 1 | 72,100,063 | 72,100,063 | 0 | true | 2022-05-03T11:40:53.153Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Constructing an ECPublic Key in Java from Java Card<p>This question relates to this one here: <a href="https://stackoverflow.com/questions/30733932/recoverin... |
72,104,017 | Polymorphic deserialization of nested list object in Kotlin<p>Trying to deserialize a pretty complex json string, I've done simpler ones but am struggling with how to set this up. I've also found some examples on simple polymorphic deserialization but cannot figure out how to adapt it for this more complex situation wh... | <p>So this is a lot simpler than I thought. What it returns looks a little funny until you get into the polymorphic class but all the data is accessible using the data class structures I set up.</p>
<p>I created <code>dataClass</code> to hold a list of <code>Object1</code>'s and then slightly tweaked the response to in... | Polymorphic deserialization of nested list object in Kotlin | kotlin|deserialization|json-deserialization|kotlinx.serialization|polymorphic-deserialization | 0 | 282 | 2 | 72,134,197 | 72,134,197 | 0 | true | 2022-05-03T18:40:06.203Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Polymorphic deserialization of nested list object in Kotlin<p>Trying to deserialize a pretty complex json string, I've done simpler ones but am struggling wi... |
72,191,261 | accessing Priority form via REST API returns 404 form not ready<p>I did all configuration need as I read on priority SDK portal and other StackOverflow resources to use rest api:</p>
<ol>
<li>Installed License.</li>
<li>created api user name.</li>
<li>in forms for api/limited license I pulled the releveant forms and ch... | <p>This is a Priority side error.
The form in Priority is malfunctioning and not compiled. The Priority implementer / programmer should run the <em>Prepare Form</em> on this <code>DOCUMENTS_p</code>, and see if it completes or has errors.</p> | accessing Priority form via REST API returns 404 form not ready | priority-web-sdk | 0 | 40 | 1 | 72,191,395 | 72,191,395 | 0 | true | 2022-05-10T18:17:51.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
accessing Priority form via REST API returns 404 form not ready<p>I did all configuration need as I read on priority SDK portal and other StackOverflow resou... |
72,211,297 | Need someone to explain my situation about @Transactional (spring)<p>I have controller call a service_A, and service_A call service_B, in service_B have 3 method.</p>
<p>A method_A call method_B and method_C in order.</p>
<p>I want to rollback when method_B occur an exception, I tried many ways.</p>
<ol>
<li>Add @Trans... | <p>I use <code>PlatformTransactionManager</code> and <code>TransactionTemplate</code> for manual transaction (remove <code>@Transactional</code>).</p> | Need someone to explain my situation about @Transactional (spring) | spring-transactions | 0 | 22 | 1 | 72,322,718 | 72,322,718 | 0 | true | 2022-05-12T07:00:15.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need someone to explain my situation about @Transactional (spring)<p>I have controller call a service_A, and service_A call service_B, in service_B have 3 me... |
72,228,311 | Using Next Auth to silent log in users with external tokens from AWS Cognito<p>We have a website where users authenticate themselves using AWS Cognito. That has been implemented using Next Auth with the Cognito provider based of their example code. That is working fine. However, whenever a new potential lead (customer)... | <p>For anyone encountering a similar issue, this is how we solved it: After receiving the <code>id_token</code> from the external service we do a <code>router.push(...)</code> (next/router) to our own authorization callback API endpoint with the <code>id_token</code>. In our case, it became:</p>
<pre><code>/api/auth/ca... | Using Next Auth to silent log in users with external tokens from AWS Cognito | authentication|next.js|amazon-cognito|next-auth | 0 | 298 | 1 | 72,361,715 | 72,361,715 | 0 | true | 2022-05-13T10:44:07.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using Next Auth to silent log in users with external tokens from AWS Cognito<p>We have a website where users authenticate themselves using AWS Cognito. That ... |
72,162,907 | The 'add' method of input elements<p>I've struggled to find the documentation for the <code>add()</code> method that's called to add <code>Option</code>s to input elements.</p>
<p>I've looked on MDN <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#methods" rel="nofollow noreferrer">here</a>, but... | <p><a href="https://stackoverflow.com/questions/17730621/how-to-dynamically-add-options-to-an-existing-select-in-vanilla-javascript">SO Post</a></p>
<p><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/add" rel="nofollow noreferrer">Documentation for the <code>add</code> function</a></p>
<pre>... | The 'add' method of input elements | javascript | 0 | 31 | 1 | 72,162,953 | 72,162,953 | 0 | true | 2022-05-08T16:13:02.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The 'add' method of input elements<p>I've struggled to find the documentation for the <code>add()</code> method that's called to add <code>Option</code>s to ... |
72,206,304 | Azure Function - Managed IDs to write to storage table - failing with 403 AuthorizationPermissionMismatch<p>I have an Azure function application (HTTP trigger) that writes to the storage queue and table. Both fail when I try to change to managed Id. This post / question is about just the storage table part.</p>
<p>He... | <p>To manage data inside a storage account (like creating table etc.), you will need to assign different sets of permissions. <code>Owner</code> role is a control-plane role that enables you to manage storage accounts themselves and not the data inside them.</p>
<p>From this <a href="https://docs.microsoft.com/en-us/az... | Azure Function - Managed IDs to write to storage table - failing with 403 AuthorizationPermissionMismatch | azure|azure-functions|azure-table-storage|azure-managed-identity | 0 | 105 | 1 | 72,218,543 | 72,218,543 | 0 | true | 2022-05-11T19:01:25.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure Function - Managed IDs to write to storage table - failing with 403 AuthorizationPermissionMismatch<p>I have an Azure function application (HTTP trigge... |
72,176,261 | How to modify a figure properties, after placing it in a canvas<p>I have embedded a <code>matplotlib</code> figure inside a plot canvas. The idea is to be able to change the <code>figure</code> and <code>axes</code> properties. But, I couldn't modify the axis after initializing. Below is a simple example:</p>
<pre><cod... | <p>Apparently the 'font size' parameter in set_tick_params no, i removed it.
[tick_params][1]</p>
<p>Also did a redraw after the update. But, I failed to remove the warning
''User Warning: FixedFormatter should only be used together with Fixed Locator'.</p>
<pre><code>def changeProp(self):
self.sc.fig.axes[0].set_x... | How to modify a figure properties, after placing it in a canvas | python|matplotlib|pyqt|pyqt5 | 0 | 94 | 1 | 72,177,587 | 72,177,587 | 0 | true | 2022-05-09T17:51:38.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to modify a figure properties, after placing it in a canvas<p>I have embedded a <code>matplotlib</code> figure inside a plot canvas. The idea is to be ab... |
72,180,348 | 3d Plot Python Tuple Index out of Range<p>i'm trying to 3d plot of cluster centroids, but it said tuple index out of range. Can you help me? Here are the code:</p>
<pre><code>from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection = '3d')
ax.set_xlabel("DER (St.)")
ax... | <p>If you print out 'clusters', you will see that there are three values in each dimension.</p>
<p>print(clusters)</p>
<pre><code>[(-0.12855869, -0.49862774, -0.18206914), (-2.76121712, 2.90472514, -3.18620993), (0.78315222, -0.4328264, 0.81931112), (-0.38753925, 1.35436192, -0.18206914), (-1.96191743, 0.09194179, -2.1... | 3d Plot Python Tuple Index out of Range | python|k-means | 0 | 52 | 1 | 72,186,753 | 72,186,753 | 0 | true | 2022-05-10T03:15:31.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
3d Plot Python Tuple Index out of Range<p>i'm trying to 3d plot of cluster centroids, but it said tuple index out of range. Can you help me? Here are the cod... |
72,148,563 | Implementing stroke drawing similar to InkCanvas<p>My problem effectively boils down to accurate mouse movement detection.</p>
<p>I need to create my own implementation of an InkCanvas and have succeeded for the most part, except for drawing strokes accurately.</p>
<pre class="lang-cs prettyprint-override"><code>void O... | <p>I ended up being able to partially solve this.</p>
<pre><code>var position = e.GetPosition(this);
if (!Rect.Contains(position))
return;
if (DrawBrush == null)
return;
var ratio = new Point(Width / PixelDisplay.Size.X, Height / PixelDisplay.Size.Y);
var intPosition = new IntVector(Math2.FloorToInt(position... | Implementing stroke drawing similar to InkCanvas | wpf | 0 | 83 | 1 | 72,164,558 | 72,164,558 | 0 | true | 2022-05-07T00:28:01.720Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Implementing stroke drawing similar to InkCanvas<p>My problem effectively boils down to accurate mouse movement detection.</p>
<p>I need to create my own imp... |
72,152,574 | Compare each element in list of lists with a column in a dataframe python<p>I want to compare each element in a list of lists with a dataframe column.
For example,</p>
<pre class="lang-py prettyprint-override"><code>groups_rids=[['AX1','AX2'],['AX6','AX5','AX17']]
df = pd.DataFrame({'rid': ['AX1','AX2','AX6','AX5','AX1... | <p>Build a dict:</p>
<pre><code>d = df.set_index('rid').to_dict()['pid']
</code></pre>
<p>And use it to build the Dataframe:</p>
<pre><code>pd.DataFrame(((x, [d[el] for el in x]) for x in groups_rids), columns=['groups_rid', 'pid'])
</code></pre>
<pre><code> groups_rid pid
0 [AX1, AX2] [... | Compare each element in list of lists with a column in a dataframe python | python|pandas|list | 0 | 131 | 2 | 72,152,651 | 72,152,651 | 0 | true | 2022-05-07T12:38:05.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Compare each element in list of lists with a column in a dataframe python<p>I want to compare each element in a list of lists with a dataframe column.
For ex... |
72,154,977 | How to get a list of all objects present on the matplotlib axes<p>How can I get a list of all objects (ploted data, vertical lines, horizontal lines, points, etc.) that are present on matplotlib axes? If there's no easy way of getting all of them inside a single list then how can I get this kind of list containing only... | <p>You can get all artists (plotted objects) with <code>ax.get_children().</code>
If you only care about lines, you can use <code>ax.get_lines()</code>. This <a href="https://stackoverflow.com/questions/71961689/get-all-artists-of-an-axes-matplotlib/71966295#71966295">good answer</a> has more details.</p>
<p>To select ... | How to get a list of all objects present on the matplotlib axes | python|matplotlib | 0 | 169 | 1 | 72,155,297 | 72,155,297 | 0 | true | 2022-05-07T17:38:00.447Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get a list of all objects present on the matplotlib axes<p>How can I get a list of all objects (ploted data, vertical lines, horizontal lines, points,... |
72,181,024 | how to vectorize a for loop on pandas dataframe?<p>i am working whit a data of about 200,000 rows, in one column of the pandas i have some values that have a empty list, the most of them are list whit several values, here is a picture:</p>
<p><a href="https://i.stack.imgur.com/X2HYe.png" rel="nofollow noreferrer"><img ... | <p>Example data:</p>
<pre><code>import pandas as pd
df = pd.DataFrame({'close': [11763, 21763, 31763], 'buy':[[], [[21763, 21767]], []]})
</code></pre>
<pre><code> close buy
0 11763 []
1 21763 [[[21763, 21767]]]
2 31763 []
</code></pre>
<p>You could do it like th... | how to vectorize a for loop on pandas dataframe? | python|pandas | 0 | 63 | 1 | 72,181,338 | 72,181,338 | 0 | true | 2022-05-10T05:13:12.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to vectorize a for loop on pandas dataframe?<p>i am working whit a data of about 200,000 rows, in one column of the pandas i have some values that have a... |
72,195,219 | pyplot.scatter() plots points but has no meaningful axes?<p>I am trying to make a simple scatterplot with Matplotlib. I am passing an Numpy array for x and another one for y:</p>
<pre class="lang-py prettyprint-override"><code>df = df.to_numpy() # this was originally a pandas DataFrame
print(df)
plt.scatter(df[:,1]... | <p>As you can see from your prints, <code>df</code> contains only strings. <code>matplotlib</code> has no idea what to do with them.</p>
<p>Change:</p>
<pre><code>plt.scatter(df[:,1], df[:,2])
</code></pre>
<p>With:</p>
<pre><code>plt.scatter(df[:,1].astype(float), df[:,2].astype(float))
</code></pre>
<p>What it does i... | pyplot.scatter() plots points but has no meaningful axes? | python|matplotlib | 0 | 33 | 1 | 72,195,473 | 72,195,473 | 0 | true | 2022-05-11T03:53:13.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pyplot.scatter() plots points but has no meaningful axes?<p>I am trying to make a simple scatterplot with Matplotlib. I am passing an Numpy array for x and a... |
72,203,065 | Passing numpy ndarray as keras input<p>I have a dataset that consists of numpy array and I need to pass this data as input for keras.</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;">Idx</th>
<th style="text-align: center;">Target</th>
<th style="text-align: center;... | <p>As discussed in the comments, it would be best if you created your arrays directly instead of having a DataFrame in the middle.</p>
<p>The problem is that even if <code>X</code> is a numpy array, it contains other arrays because Pandas returns an array for each row and each cell. An example:</p>
<pre><code>import pa... | Passing numpy ndarray as keras input | python|numpy|tensorflow|keras | 0 | 134 | 1 | 72,206,160 | 72,206,160 | 0 | true | 2022-05-11T14:44:02.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing numpy ndarray as keras input<p>I have a dataset that consists of numpy array and I need to pass this data as input for keras.</p>
<div class="s-table... |
72,234,896 | Classify DataFrame rows based on first matching condition<p>I have a pandas DataFrame, each column represents a quarter, the most recent quarters are placed to the right, not all the information gets at the same time, some columns might be missing information (NaN values)</p>
<p>I would like to create a new column with... | <p>Probably using <code>apply</code> is the most straightforward, but I wanted to try a solution with numpy, which should be faster with dataframes with many rows.</p>
<pre><code>import numpy as np
# Rows with too many NaNs.
df_arr = df.to_numpy()
# Find NaNs.
nans = np.nonzero(np.isnan(df_arr))
# Roll the rows so t... | Classify DataFrame rows based on first matching condition | python|pandas|dataframe | 0 | 96 | 3 | 72,235,091 | 72,235,091 | 0 | true | 2022-05-13T20:04:53.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Classify DataFrame rows based on first matching condition<p>I have a pandas DataFrame, each column represents a quarter, the most recent quarters are placed ... |
72,236,565 | Concatenation layer raise Value Error: as_list() is not defined on an unknown Tensor Shape<p>I'm Trying to making DNN using Wide Deep Nural Network using keras the following code produces the following after trying to implement it, I also making my custome activation function <em><strong>Randomized Relu</strong></em>
h... | <p>The reason you get this error is explained in the documentation of <a href="https://www.tensorflow.org/guide/keras/sequential_model" rel="nofollow noreferrer"><code>tf.keras.Sequential</code></a>:</p>
<p><em>"A Sequential model is appropriate for a plain stack of layers where <strong>each layer has exactly one ... | Concatenation layer raise Value Error: as_list() is not defined on an unknown Tensor Shape | python|tensorflow|keras|deep-learning|concatenation | 0 | 49 | 1 | 72,237,831 | 72,237,831 | 0 | true | 2022-05-14T00:49:47.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Concatenation layer raise Value Error: as_list() is not defined on an unknown Tensor Shape<p>I'm Trying to making DNN using Wide Deep Nural Network using ker... |
72,140,192 | NumPy array value error from training in Auto-Keras with StratifiedKFold<h2>Background</h2>
<p>My sentiment analysis research comes across a variety of datasets. Recently I've encountered one dataset that somehow I just cannot train successfully. I mostly work with open data in <code>.CSV</code> file format, hence <cod... | <p>One of the strings is equal to <code>nan</code>. Just remove this entry and the corresponding label.</p> | NumPy array value error from training in Auto-Keras with StratifiedKFold | pandas|numpy|tensorflow|keras|auto-keras | 0 | 47 | 1 | 72,140,939 | 72,140,939 | 0 | true | 2022-05-06T10:42:18.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NumPy array value error from training in Auto-Keras with StratifiedKFold<h2>Background</h2>
<p>My sentiment analysis research comes across a variety of datas... |
72,236,982 | Is there a switch to store the Wagtail RichTextBlock content to database in UTF-8?<p>I am new in Django and Wagtail. I developed a website app using Django 4.0 and Wagtail 2.16.1. I found Django models.CharField by default stores content to database in UTF-8, while Wagtail RichTextBlock by default stores content to dat... | <p>Found some guy raised the same question several years ago. <a href="https://stackoverflow.com/questions/46412871/wagtail-default-search-not-working-with-not-english-fields">Wagtail default search not working with not english fields</a>.
The workaround to copy 2 fields just for searching index obviously is not an ele... | Is there a switch to store the Wagtail RichTextBlock content to database in UTF-8? | python|django|wagtail|wagtail-streamfield | 0 | 105 | 1 | 72,246,585 | 72,246,585 | 0 | true | 2022-05-14T02:55:57.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a switch to store the Wagtail RichTextBlock content to database in UTF-8?<p>I am new in Django and Wagtail. I developed a website app using Django 4... |
72,158,531 | how to export pdf data with dynamic Object in openpdf java<p>I'm trying to use <code>openpdf</code> for dynamic field.</p>
<p>maven:</p>
<pre><code><dependency>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
<version>1.3.8</version>
</dep... | <p>I write some code for that problem:</p>
<p>first I can get list of name methods:</p>
<pre><code>private final MethodCache cache = new MethodCache();
public List<Object> toArray(Object source, String[] nameMapping) throws Exception {
extractBeanValues(source, nameMapping);
return beanValues;
... | how to export pdf data with dynamic Object in openpdf java | java|dynamic|openpdf | 0 | 98 | 1 | 72,167,445 | 72,167,445 | 0 | true | 2022-05-08T06:05:47.040Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to export pdf data with dynamic Object in openpdf java<p>I'm trying to use <code>openpdf</code> for dynamic field.</p>
<p>maven:</p>
<pre><code><depen... |
72,215,202 | Metro Bundler fails while trying to resolve module `immer` from redux-toolkit<p>I'm building a react native app using Expo and Expo Go to test it on an android device. It has been working flawlessly until today. I encoutered an error on one of my components with this kind of error:</p>
<pre><code>Attempt to invoke virt... | <p><strong>Fix</strong></p>
<p>As suggested in <a href="https://github.com/reduxjs/redux-toolkit/issues/2315" rel="nofollow noreferrer">this redux-toolkit issue</a>, there seems to be an issue with <code>immer</code> version <code>9.0.13</code>. Temporary fix suggested there is working for me, adding <code>immer@9.0.1... | Metro Bundler fails while trying to resolve module `immer` from redux-toolkit | expo|redux-toolkit|metro-bundler|immer.js|expo-go | 0 | 793 | 1 | 72,215,352 | 72,215,352 | 0 | true | 2022-05-12T12:01:39.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Metro Bundler fails while trying to resolve module `immer` from redux-toolkit<p>I'm building a react native app using Expo and Expo Go to test it on an andro... |
72,200,339 | How to send CMSampleBuffer to WebRTC?<p>So I am using Replaykit to try stream my phone screen on a web browser.</p>
<pre><code>override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
//if source!.isSocketConnected {
switch sampleBufferType {
case RPSamp... | <p>Hi Sam WebRTC have one function which can process CMSampleBuffer frames to get Video Frames. But it is working with CVPixelBuffer. So you have to firstly convert your CMSampleBuffer to CVPixelBuffer. And than add this frames into your localVideoSource with RTCVideoCapturer. i have solved similar problem on AVCapture... | How to send CMSampleBuffer to WebRTC? | ios|swift|live-streaming|replaykit | 0 | 234 | 1 | 72,530,025 | 72,530,025 | 0 | true | 2022-05-11T11:34:23.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to send CMSampleBuffer to WebRTC?<p>So I am using Replaykit to try stream my phone screen on a web browser.</p>
<pre><code>override func processSampleBuf... |
72,204,307 | Custom MAUI layout don't show any Control, but control have correct position and size,<p>I custom a layout name ConstraintLayout according to AbsoluteLayout in MAUI.</p>
<p>It like AbsoluteLayout have a LayoutManager class,i overrride Measure and ArrangeChildren method in this class.</p>
<p>It also have a ConstrainLayo... | <p>I see that <code>AbsoluteLayout</code> works via a <code>LayoutManager</code>.</p>
<p>Find <code>AbsoluteLayout.cs</code>. See its:</p>
<pre class="lang-cs prettyprint-override"><code> protected override ILayoutManager CreateLayoutManager()
</code></pre>
<p>Do similar, but find <code>AbsoluteLayoutManager.cs</cod... | Custom MAUI layout don't show any Control, but control have correct position and size, | .net-6.0|maui|.net-maui|maui-windows | 0 | 209 | 1 | 72,221,456 | 72,221,456 | 0 | true | 2022-05-11T16:10:09.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Custom MAUI layout don't show any Control, but control have correct position and size,<p>I custom a layout name ConstraintLayout according to AbsoluteLayout ... |
72,198,750 | PHP exec | mysql command returns sh: -c: line 0: syntax error near unexpected token `newline'<p>I want to make multiple insertions into DB, but mysql command returns me:
<strong>sh: -c: line 0: syntax error near unexpected token `newline'</strong>.</p>
<p>Does anybody know, what this error means?</p>
<p>Here is my comm... | <p>Use</p>
<pre><code>mysql -h 127.0.0.1 -D db_name -u username --password=pass --debug-info true shared/local_sql/3.sql
</code></pre>
<p>You probably copied the characters <code><</code> and <code>></code> from some example where these characters are used to indicate a placeholder for the file name like <code>my... | PHP exec | mysql command returns sh: -c: line 0: syntax error near unexpected token `newline' | mysql|linux|sh | 0 | 77 | 2 | 72,199,135 | 72,199,135 | 0 | true | 2022-05-11T09:38:44.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP exec | mysql command returns sh: -c: line 0: syntax error near unexpected token `newline'<p>I want to make multiple insertions into DB, but mysql command... |
72,234,599 | How to dynamically resize image in richtextbox with event or zooming<p>How can I resize an <strong>image</strong> in <strong>richtextbox</strong>. Are there specific events to do it?</p>
<p>here is my code how to insert an image into richtextbox.</p>
<pre><code> private void insetImage_Click(object sender, RoutedEventA... | <p>The example below demonstrates how size of all images in the current selection increases by 25%.</p>
<pre class="lang-cs prettyprint-override"><code>using System.Windows;
using System.Windows.Controls;
namespace WpfApp17
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>... | How to dynamically resize image in richtextbox with event or zooming | c#|wpf|richtextbox|image-resizing|bitmapimage | 0 | 159 | 1 | 72,241,788 | 72,241,788 | 0 | true | 2022-05-13T19:32:26.480Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to dynamically resize image in richtextbox with event or zooming<p>How can I resize an <strong>image</strong> in <strong>richtextbox</strong>. Are there ... |
72,118,054 | grouopby.apply function isnt producing correct result<p>I have a data set that im grouping by account, name, and date. And creating a function to keep only the min value of 'alt_fee' of each unique combination.</p>
<pre><code>def drop(df):
return df[df['alt_fee']==df['alt_fee'].min()]
result = df.groupby(['account',... | <p>You can accomplish this without using <code>apply()</code> at all. When using the <code>groupby</code> function, only one record for each combination will be returned. By using <code>min()</code> as the aggregator, the minimum value for all other numeric fields in your data will be returned.</p>
<pre class="lang-py ... | grouopby.apply function isnt producing correct result | python|apply | 0 | 27 | 2 | 72,118,520 | 72,118,520 | 0 | true | 2022-05-04T18:49:41.360Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
grouopby.apply function isnt producing correct result<p>I have a data set that im grouping by account, name, and date. And creating a function to keep only t... |
72,228,959 | Is there an R function for setting rows on aggregate data?<p>The data I am working with is from eBird, and I am looking to sort out species occurrence by both name and year. There are over 30k individual observations, each with its own number of birds. From the raw data I posted below, on Jan 1, 2021 and someone observ... | <p>There are errors in the data and code in the question so we used the code and reproducible data given in the Note at the end.</p>
<p>Now, using xtabs we get an xtabs table directly from ebird.df like this. No packages are used.</p>
<pre><code>xtabs(individualCount ~ specificName + year, ebird.df)
## ... | Is there an R function for setting rows on aggregate data? | r|datatable|aggregate | 0 | 34 | 1 | 72,229,352 | 72,229,352 | 0 | true | 2022-05-13T11:37:40.607Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there an R function for setting rows on aggregate data?<p>The data I am working with is from eBird, and I am looking to sort out species occurrence by bot... |
72,203,351 | How to append a json variable to another?<p>I want to avoid using JSON files and use variables but it doesn't work</p>
<pre><code>element='{"x": "zero"}'
example='{
"a": "one",
"b": "two",
"c": "three",
}'
jq -s '.[0] * .[1]' e... | <p>It worked using the comment suggestions like this</p>
<pre><code>element='{"x":"zero"}'
example='{
"a":"one",
"b":"two",
"c":"three"
}'
jq -n --argjson el "$element" --argjson ex "$example" '$el + $ex'
</c... | How to append a json variable to another? | json|bash|shell|jq | 0 | 105 | 1 | 72,204,246 | 72,204,246 | 0 | true | 2022-05-11T15:03:00.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to append a json variable to another?<p>I want to avoid using JSON files and use variables but it doesn't work</p>
<pre><code>element='{"x": &q... |
72,154,120 | why is findOneAndUpdate not updating in the DB?<p>I'm creating a project using the mern stack. I'm trying to update a project from my frontend to my backend. When I update it it will return success but when I check the database nothing is updated? I'm trying to update the product with the prodID that is entered in the ... | <p>Following Mongoose Docs <a href="https://mongoosejs.com/docs/tutorials/findoneandupdate.html" rel="nofollow noreferrer">here</a></p>
<p>1st:</p>
<p>You added filter as a string, however it should've been an object like below</p>
<pre><code>const filter = {prodID: req.body.prodID}
</code></pre>
<p>2nd:</p>
<p>no need... | why is findOneAndUpdate not updating in the DB? | node.js|mongodb|mongoose | 0 | 32 | 3 | 72,154,493 | 72,154,493 | 0 | true | 2022-05-07T15:51:09.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why is findOneAndUpdate not updating in the DB?<p>I'm creating a project using the mern stack. I'm trying to update a project from my frontend to my backend.... |
72,154,477 | Only trigger function on the selected card where cards are displayed using v-for<p>Still trying out Vue with vue material; I used v-for to display the array objects into separate cards.</p>
<p>so in the <code>template</code>,it looks like this:</p>
<pre><code><md-card v-for="fruit in fruits" :key="fru... | <p>Replace boolean for <code>showInfo</code> with <code>fruit.id</code> or index:</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>Vue.use(VueMaterial.default)
new Vue({
el: '... | Only trigger function on the selected card where cards are displayed using v-for | javascript|vue.js|vuejs2|v-for|vue-material | 0 | 33 | 1 | 72,154,622 | 72,154,622 | 0 | true | 2022-05-07T16:33:02.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Only trigger function on the selected card where cards are displayed using v-for<p>Still trying out Vue with vue material; I used v-for to display the array ... |
72,152,090 | Webpage in the same row pictures<p>I want this photos in the same row what should i change ?
<a href="https://i.stack.imgur.com/EbvmR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EbvmR.png" alt="enter image description here" /></a></p>
<p>I tried float left and other commands but one picture is st... | <p>You can use <code>display: flex;</code> to fix this issue because it's more flexable, that's an example:</p>
<pre class="lang-html prettyprint-override"><code><section class="services">
<div class="service">
<img src="service.jpg">
<h3>Service</h3>... | Webpage in the same row pictures | javascript|html|jquery|css|bootstrap-4 | 0 | 33 | 2 | 72,152,211 | 72,152,211 | 0 | true | 2022-05-07T11:36:02.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Webpage in the same row pictures<p>I want this photos in the same row what should i change ?
<a href="https://i.stack.imgur.com/EbvmR.png" rel="nofollow nore... |
72,214,160 | GPU What are the proper thread dimensions for a compute shader with a very large work load?<p><br />
I'm working on a heightmap erosion compute shader in unity, where each point on the map is eroded separately. This is working well for small maps, but the project I'm working on requires 4096x4096 maps. This means 4096^... | <p>With <code>64x64</code> threads per work group, you can <code>Dispatch</code> <code>64x64</code> work groups to do what you need : remember that <code>64x64</code> threads will be invoked for each work group you dispatch, so you will have <code>64x64 work groups x 64x64 threads</code> = <code>4096 workgroups x 4096 ... | GPU What are the proper thread dimensions for a compute shader with a very large work load? | gpu|shader|compute-shader|threadgroup | 0 | 272 | 1 | 72,214,294 | 72,214,294 | 0 | true | 2022-05-12T10:43:16.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GPU What are the proper thread dimensions for a compute shader with a very large work load?<p><br />
I'm working on a heightmap erosion compute shader in uni... |
72,168,846 | .net 6 mvc localization both in view and in javascript<p>I wanted to share some important problem with localization (transilation of words in many languages) in javascript that i solved</p>
<p>this is the code in view that you use in view and you can you use in js as well</p>
<p>@inject Microsoft.AspNetCore.Mvc.Localiz... | <p>in view you can use like this
@localizer["addReference"].Value</p>
<p>in js you can use like this
@localizer["addReference"]</p>
<p>translation should be in double quatation mark such as "Add Reference" in resource.resx</p> | .net 6 mvc localization both in view and in javascript | javascript|.net|model-view-controller|.net-6.0|asp.net-core-localization | 0 | 140 | 1 | 72,168,847 | 72,168,847 | 0 | true | 2022-05-09T08:12:45.657Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
.net 6 mvc localization both in view and in javascript<p>I wanted to share some important problem with localization (transilation of words in many languages)... |
72,155,950 | how to set the gradient for a network in pytorch<p>I have a model in pytorch. The model can take any shape but lets assume this is the model</p>
<pre><code>torch_model = Sequential(
Flatten(),
Linear(28 * 28, 256),
Dropout(.4),
ReLU(),
BatchNorm1d(256),
ReLU(),
Linear(256, 128),
Dropout... | <p>In PyTorch, with a model defined as yours above, you can iterate over the layers like this:</p>
<pre><code>for layer in list(torch_model.modules())[1:]:
print(layer)
</code></pre>
<p>You have to add the <code>[1:]</code> since the first module returned is the sequential module itself. In any layer, you can access ... | how to set the gradient for a network in pytorch | python|neural-network|pytorch|gradient-descent|stochastic-gradient | 0 | 153 | 1 | 72,156,121 | 72,156,121 | 0 | true | 2022-05-07T19:55:04.037Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to set the gradient for a network in pytorch<p>I have a model in pytorch. The model can take any shape but lets assume this is the model</p>
<pre><code>t... |
72,149,747 | How to navigate between NavigationLink while leave a part of main window stay the same in SwiftUI<p>I would like to navigate between different <code>NavigationLink</code>s in <code>NavigationView</code> while some part of the main window stay the same. For example, I want to make a music app and I want to let the play ... | <p>In this case the <em>default</em> details view and navigated details view should be the same, but updated content can be injected in it in navigation link.</p>
<p>Here is a demo. Tested with Xcode 13.3 / iPadOS 15.4</p>
<p><a href="https://i.stack.imgur.com/N6Zxv.png" rel="nofollow noreferrer"><img src="https://i.st... | How to navigate between NavigationLink while leave a part of main window stay the same in SwiftUI | swift|swiftui | 0 | 48 | 2 | 72,149,795 | 72,149,795 | 0 | true | 2022-05-07T05:31:41.847Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to navigate between NavigationLink while leave a part of main window stay the same in SwiftUI<p>I would like to navigate between different <code>Navigati... |
72,187,803 | Subscribe to an observable and put values into an array<p>I'm new in angular and I need some help.
I have an observable getting users of type User[]</p>
<pre><code>User: [
id: string,
name: string
]
</code></pre>
<p>and I have another array Ids of type string getting the ids of the selected users from a mat-select</p>
... | <p>You use combineLatest to merge both observables and map all elements to accomplish it.</p>
<p>First, Create an observable with ids.</p>
<pre><code>selectedIds$ = of([1, 3]);
players$ = of([
{ id: 1, name: 'lebron' },
{ id: 2, name: 'irving' },
{ id: 3, name: 'love' },
]);
</code></pre>
<p>Next, combi... | Subscribe to an observable and put values into an array | arrays|angular|typescript|observable | 0 | 592 | 1 | 72,189,227 | 72,189,227 | 0 | true | 2022-05-10T14:03:00.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Subscribe to an observable and put values into an array<p>I'm new in angular and I need some help.
I have an observable getting users of type User[]</p>
<pre... |
72,139,143 | Powershell - run script on multiple computers simultaneously<p>Im working on a script that cleanup old user account and some data from computers.
I would like to run the script on 5 computers at one time from the attached list of PCs.
Is it possible?</p>
<pre><code> [CmdletBinding()]
Param(
[Parameter(Mandatory=... | <p>You can pass multiple computer names to <code>Invoke-Command</code> at once to achieve this:</p>
<pre><code>[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[string]$host_path = 'Host path'
)
$computerNames = Get-Content $host_path
Invoke-Command -ComputerName $computerNames -ScriptBlock {
Get-WM... | Powershell - run script on multiple computers simultaneously | powershell|script | 0 | 492 | 2 | 72,139,789 | 72,139,789 | 0 | true | 2022-05-06T09:25:57.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Powershell - run script on multiple computers simultaneously<p>Im working on a script that cleanup old user account and some data from computers.
I would lik... |
72,143,553 | Visual Studio Resource Editor corrupts rc files with UTF-8 encoding<p>Visual Studio 2019 and 2022 Resource Editor is able to correctly read and display .rc file in UTF-8 encoding if .rc file is saved without UTF-8 BOM.
The main requirements for it, .rc file must contain valid <code>#pragma code_page</code>.<br />
Examp... | <p>Microsoft knows about this bug and they decided not to fix it:</p>
<blockquote>
<p>Thank you very much for your feedback. We've decided to take no action on this feedback at the time.<br />
When working with Resource Compiler (.rc) source files, our suggestion has always been to use UTF-16 whenever resources contain... | Visual Studio Resource Editor corrupts rc files with UTF-8 encoding | visual-studio|utf-8|resource-editor | 0 | 61 | 1 | 72,172,555 | 72,172,555 | 0 | true | 2022-05-06T14:57:54.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Visual Studio Resource Editor corrupts rc files with UTF-8 encoding<p>Visual Studio 2019 and 2022 Resource Editor is able to correctly read and display .rc f... |
72,155,589 | The right way to add more padding to a bootstrap container<p>Scenario: More padding in container
<a href="https://i.stack.imgur.com/27KSv.png" rel="nofollow noreferrer">sketch</a></p>
<p>Hey, I use the bootstrap scss in typo3 and let ws_scss compile it.
I want more padding so the content area is a bit smaller.</p>
<p>B... | <p>If it's vertical padding you might chose just to adjust the settings in a content element, or to adjust the classes that are given to the according settings:
<a href="https://i.stack.imgur.com/I40xq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I40xq.png" alt="enter image description here" /></a... | The right way to add more padding to a bootstrap container | bootstrap-4|sass|typo3|padding|scss-mixins | 0 | 150 | 1 | 72,156,850 | 72,156,850 | 0 | true | 2022-05-07T18:57:28.680Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The right way to add more padding to a bootstrap container<p>Scenario: More padding in container
<a href="https://i.stack.imgur.com/27KSv.png" rel="nofollow ... |
72,152,637 | I have two tables and want the result of query in another table<p>I have 2 tables Comapnies and Trades:
Comapnies:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;">Country</th>
<th style="text-align: center;">center</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-a... | <p>You can use a conditional aggregation</p>
<pre><code>select c.center
, sum(case c.Country when t.seller then value end) export
, sum(case c.Country when t.buyer then value end) import
from Comapnies c
left join Trades t on c.Country in (t.seller, t.buyer)
group by c.center
order by c.center;
</code></pre>
<... | I have two tables and want the result of query in another table | mysql|sql | 0 | 28 | 1 | 72,152,774 | 72,152,774 | 0 | true | 2022-05-07T12:44:18.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I have two tables and want the result of query in another table<p>I have 2 tables Comapnies and Trades:
Comapnies:</p>
<div class="s-table-container">
<table... |
72,223,367 | setState provokes Minified React error #130 only on production build<p>Every time I interact with the drop-down button on the front page of my application, the error <a href="https://reactjs.org/docs/error-decoder.html/?invariant=130&args" rel="nofollow noreferrer">https://reactjs.org/docs/error-decoder.html/?invar... | <p>It was suggested to me to move <code>QuicklinkExpanded</code> and <code>Item</code> outside of the <code>Quicklinks</code> class. This actually fixed the crashing in production. I am not sure why, this is likely a bug with react and ts compiling to js.</p> | setState provokes Minified React error #130 only on production build | reactjs|typescript|netlify | 0 | 98 | 1 | 72,225,071 | 72,225,071 | 0 | true | 2022-05-13T00:36:33.183Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
setState provokes Minified React error #130 only on production build<p>Every time I interact with the drop-down button on the front page of my application, t... |
72,187,313 | How do I get selenium to open my electron app?<p>I'm attempting to setup Selenium to test my electron app. So far I have the code from the Electron documentation, however, this only opens the HTML file, not my actual app. Here is my code:</p>
<pre class="lang-js prettyprint-override"><code>import * as path from "p... | <p>The solution was to:</p>
<ol>
<li>Replace <code>'../../node_modules/electron/dist/electron.exe'</code> with <code>path.join(__dirname, '../../node_modules/electron/dist/electron.exe')</code></li>
<li>To change <code>chromeOptions</code> to <code>goog:chromeOptions</code></li>
<li>To add <code>"args": [path... | How do I get selenium to open my electron app? | selenium|testing|electron|automated-tests | 0 | 144 | 1 | 72,200,682 | 72,200,682 | 0 | true | 2022-05-10T13:33:25.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I get selenium to open my electron app?<p>I'm attempting to setup Selenium to test my electron app. So far I have the code from the Electron documenta... |
72,210,302 | Package installation using pip gives "DuplicateOptionError"<p>Hie everyone, I'm on a M1 mac with a python version 3.9.6
Whenever I try to "pip install package" I get the following error(inside or outside a virtual environment):</p>
<blockquote>
<p>ERROR: Exception:
Traceback (most recent call last):
File &quo... | <p>I found the solution...<br />
The configuration file i.e. <code>'/Users/ayusharma/.pydistutils.cfg'</code> had two similar keys which was causing the <code>DuplicateOptionError</code></p>
<p>So I went into the file and removed the duplicate line, which solved the issue for me.</p>
<p>Just go into the config file:</p... | Package installation using pip gives "DuplicateOptionError" | pip|python-3.6|apple-m1 | 0 | 66 | 1 | 72,238,508 | 72,238,508 | 0 | true | 2022-05-12T04:57:31.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Package installation using pip gives "DuplicateOptionError"<p>Hie everyone, I'm on a M1 mac with a python version 3.9.6
Whenever I try to "pip install p... |
72,157,828 | How i fix it? I need a transparent navigation bar<p><a href="https://i.stack.imgur.com/r6EsB.png" rel="nofollow noreferrer">background video image</a></p>
<p>Hi I have a background video (The jellyfish move) this is a photo of a frame of this video
I need to understand why writing "Medusa" text has a backgrou... | <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>* {
margin: 0;
padding: 0;
/* background-color: #222; remove this line */
}
video {
width: 100vw;
height: 100vh;
obj... | How i fix it? I need a transparent navigation bar | javascript|reactjs|frontend | 0 | 48 | 3 | 72,157,874 | 72,157,874 | 0 | true | 2022-05-08T03:23:05.007Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How i fix it? I need a transparent navigation bar<p><a href="https://i.stack.imgur.com/r6EsB.png" rel="nofollow noreferrer">background video image</a></p>
<p... |
72,219,581 | How do I install Cypress using CYPRESS_INSTALL_BINARY?<p>Due to company firewall I cannot just use npm install cypress.</p>
<p>I have the cypress.zip in my downloads folder</p>
<p>On windows command prompt I have tried the below:
CYPRESS_INSTALL_BINARY=/Users/HMiller/Downloads/cypress.zip npm install cypress
And i get ... | <p>You Can Try These steps,</p>
<p><code>set CYPRESS_INSTALL_BINARY=\your\path\to\cypress.x.x.x.zip</code></p>
<p><code>npm install cypress</code></p>
<p><code>npx cypress open</code></p>
<p>If you are trying to add scripts in package.json</p>
<pre><code> "test": "npm run cypressinstallbinary &&... | How do I install Cypress using CYPRESS_INSTALL_BINARY? | shell|cmd|binary|cypress | 0 | 394 | 1 | 72,219,875 | 72,219,875 | 0 | true | 2022-05-12T17:03:48.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I install Cypress using CYPRESS_INSTALL_BINARY?<p>Due to company firewall I cannot just use npm install cypress.</p>
<p>I have the cypress.zip in my d... |
72,181,063 | Embed JavaScript files inside a .NET class library for Blazor project<p>I'm working on a Blazor project and I'm trying to move one of the JavaScript files to a class library, I've read the following guides:</p>
<ol>
<li><a href="https://docs.microsoft.com/en-us/aspnet/core/razor-pages/ui-class?view=aspnetcore-6.0&t... | <p>Eventually I solved this by following the steps below:</p>
<ol>
<li>Created a new Blazor WebAssembly App with the following options: Configure for HTTPS, ASP.NET Core Hosted and Progressive Web App that generates 3 different projects in .NET 6 Client, Shared and Server.</li>
<li>Tested that it works as is and the Se... | Embed JavaScript files inside a .NET class library for Blazor project | c#|asp.net-core|blazor|blazor-webassembly | 0 | 671 | 5 | 72,254,228 | 72,254,228 | 0 | true | 2022-05-10T05:18:00.660Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Embed JavaScript files inside a .NET class library for Blazor project<p>I'm working on a Blazor project and I'm trying to move one of the JavaScript files to... |
72,199,862 | Receive the time now in an updated manner<p>I am performing an operation in Java code, this is the code I am performing:</p>
<pre><code>public String GetTheTimeNow() {
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
return dtf.format(now);
}
</code... | <p>Another way apart from what Phil Freihofner mentioned, call your <code>GetTheTimeNow()</code> from calling method & use <code>Thread.sleep</code>:</p>
<pre><code>public class Test {
public static void main(String[] args) throws Exception {
for (;;) {
System.out.println(new Test().GetTheTimeNow());
... | Receive the time now in an updated manner | java | 0 | 49 | 2 | 72,200,323 | 72,200,323 | 0 | true | 2022-05-11T11:01:04.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Receive the time now in an updated manner<p>I am performing an operation in Java code, this is the code I am performing:</p>
<pre><code>public String GetTheT... |
72,209,608 | Send a line on vim to another pane or section in tmux<p>I am trying to use a vim+tmux setup to write code in R.</p>
<p>For that, I need to find a way to send lines (better if motions) to a terminal in other tmux pane (or section, if possible) which is running R.</p>
<p>Looks like a simple task, but I don't understand m... | <p>With some minor tweaks to <a href="http://s3.amazonaws.com/mps/slime.vim" rel="nofollow noreferrer">slime.vim</a>, you can do this by putting the following file in your vim plugin dir (eg <code>$HOME/.vim/plugin</code>)</p>
<pre><code>function Send_to_Pane(text)
if !exists("g:tmux_target")
call Tmux_... | Send a line on vim to another pane or section in tmux | vim|tmux | 0 | 95 | 1 | 72,214,914 | 72,214,914 | 0 | true | 2022-05-12T02:52:32.177Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Send a line on vim to another pane or section in tmux<p>I am trying to use a vim+tmux setup to write code in R.</p>
<p>For that, I need to find a way to send... |
72,174,584 | C# add item to listbox from list<p>When a shortcut is pressed, a value is added to the list and passed to the listbox to add an item. However, if <code>AddRange(RecentColors.ToArray()</code> is used, not only new list items are added, but they are added continuously. If a new value is added to a list value, is there a ... | <p>The problem is that you has RecentColors with all items and each key press you add all items in the listbox. Try adding one element in RecentColors and also in the listbox:</p>
<pre><code>var item = hexToRGB(hexcode.Text);
RecentColors.Add(item);
color_list.Items.Add(item);
</code></pre>
<p><strong>UPDATE</strong></... | C# add item to listbox from list | c#|list|listbox | 0 | 84 | 2 | 72,175,066 | 72,175,066 | 0 | true | 2022-05-09T15:34:15.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# add item to listbox from list<p>When a shortcut is pressed, a value is added to the list and passed to the listbox to add an item. However, if <code>AddRa... |
72,193,590 | The FormClosing event seems to run after a different Form is started<p>I did a lot of research about this problem and tried methods but none of them worked. First I will show you what is in my application and what I want it to be with some pictures.</p>
<p><a href="https://i.stack.imgur.com/IZF5T.png" rel="nofollow nor... | <p>You can simply Hide the dialog instead of close.</p>
<p>First, create your childs types:</p>
<pre><code>private enum FormType
{
Result = 0,
Products = 1,
//...
}
</code></pre>
<p>An a method to create each form:</p>
<pre><code>private Form CreateChildForm(FormType formType)
{
switch (formType)
{
... | The FormClosing event seems to run after a different Form is started | c#|winforms|streamwriter|formclosing | 0 | 50 | 1 | 72,193,938 | 72,193,938 | 0 | true | 2022-05-10T22:33:38.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The FormClosing event seems to run after a different Form is started<p>I did a lot of research about this problem and tried methods but none of them worked. ... |
72,186,409 | Set a range to uppercase in sheets APP SCRIPT<p>I want to create a script that I will have in a menu that gets the range "A1:C" and uppercases it. The problem is that throws an error <strong>"TypeError: values.toUpperCase is not a function"</strong> trying to use <code>toUpperCase()</code>.</p>
<p>G... | <p><strong>Try:</strong></p>
<pre><code>function allUpper() {
const range = SpreadsheetApp.getActiveSheet()
.getRange("A1:C")
const values = range.getDisplayValues()
.map(row => row.map(col => (col) ? col.toUpperCase() : col))
range.setValues(v... | Set a range to uppercase in sheets APP SCRIPT | javascript|google-apps-script|google-sheets | 0 | 114 | 3 | 72,186,622 | 72,186,622 | 0 | true | 2022-05-10T12:34:01.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set a range to uppercase in sheets APP SCRIPT<p>I want to create a script that I will have in a menu that gets the range "A1:C" and uppercases it. ... |
72,141,468 | Numpy Array is not copying over all values of the array to csv file<p>I'm having trouble with the formatting of my array when it it saved to a csv file, each time I run the program I get a different result, sometimes the string "creditCard" is not displayed in the spread sheet but all other details are. and s... | <p>For you code, I think when you create the new <code>cardArray</code> you don't specify the type as you did for the initial array, this could be an issue.</p>
<p>Anyways, numpy might not be the best library to use here.<br />
For this kind of data I would use pandas:</p>
<pre class="lang-py prettyprint-override"><cod... | Numpy Array is not copying over all values of the array to csv file | python|numpy|spyder | 0 | 51 | 2 | 72,141,823 | 72,141,823 | 0 | true | 2022-05-06T12:26:27.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Numpy Array is not copying over all values of the array to csv file<p>I'm having trouble with the formatting of my array when it it saved to a csv file, each... |
72,067,070 | ServerInfo DiscordJS Issue<p>My issue here is when I execute the command the owner is only undefined instead of the actual owner of the server. How can I fix this issue?</p>
<pre><code>module.exports.run = async (client, message, args) => {
const { MessageEmbed } = require('discord.js');
message.delete();
... | <p>I'm pretty sure that there isn't an <code>owner</code> property in a <a href="https://discord.js.org/#/docs/main/stable/class/Guild" rel="nofollow noreferrer"><code>Guild</code></a>. To get the owner you have two methods:</p>
<p>Method 1 is using the <a href="https://discord.js.org/#/docs/main/stable/class/Guild?scr... | ServerInfo DiscordJS Issue | discord.js | 0 | 22 | 1 | 72,067,149 | 72,067,149 | 0 | true | 2022-04-30T09:02:34.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ServerInfo DiscordJS Issue<p>My issue here is when I execute the command the owner is only undefined instead of the actual owner of the server. How can I fix... |
72,170,511 | CSS class with nested elements<p>I want to display table elements as blocks only in a specific class without using a class on every single sub-element of the table.</p>
<p>What I've tried:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<p... | <p>To avoid using a class on every single 'sub-element' within the table you can use the <code>:is()</code> pseudo class to target certain descendants within your given class.</p>
<p>One issue is that by default the browser styles table elements... as a table. So you might have to flip your media query around</p>
<p><d... | CSS class with nested elements | html|css|class|responsive | 0 | 175 | 1 | 72,173,192 | 72,173,192 | 0 | true | 2022-05-09T10:27:31.310Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSS class with nested elements<p>I want to display table elements as blocks only in a specific class without using a class on every single sub-element of the... |
72,198,603 | Keep the button at bottom no matter the length of text<p>I want to keep the button at bottom previously which I was making it possible by writing more text to push it to bottom but it wasn't responsive for every device any way I can keep the button in a div at bottom?</p>
<p><div class="snippet" data-lang="js" data-hid... | <p>My solution would be:</p>
<pre class="lang-css prettyprint-override"><code>.container {
display: flex;
flex-flow: column nowrap; /* Flex everything inside your cards vertically */
}
.description {
flex-grow: 1;
/*
When a card has more space (because another card is taller
with more info) - grow the d... | Keep the button at bottom no matter the length of text | html|css | 0 | 57 | 1 | 72,198,808 | 72,198,808 | 0 | true | 2022-05-11T09:28:14.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Keep the button at bottom no matter the length of text<p>I want to keep the button at bottom previously which I was making it possible by writing more text t... |
72,138,757 | Firestore rules: Property is undefined on object. for 'list' @ L6<p>I am having an issue where I am trying to query a subquery by a field, and I have tried the emulator as well as firebase support (still on going, but not solutions yet).</p>
<p>When running the following query:</p>
<pre><code>const queryByNumber = quer... | <p>The issue was another query trying to get all resident data after the initial one was fired, which caused it to fail the rule because the second one wasn't querying by <code>cellNumber</code> anymore. I have changed the rules to validate by <code>UID</code> since that will always be provided</p> | Firestore rules: Property is undefined on object. for 'list' @ L6 | javascript|google-cloud-firestore|firebase-security|angularfire | 0 | 233 | 2 | 72,499,286 | 72,499,286 | 0 | true | 2022-05-06T08:52:51.477Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firestore rules: Property is undefined on object. for 'list' @ L6<p>I am having an issue where I am trying to query a subquery by a field, and I have tried t... |
72,194,356 | Extract a column's name to create a new column name<p>I have the following simplified dataframe.</p>
<pre><code>df <- data.frame("Task1_AI1" = 1:5, "Task1_AI2" = 6:10, "Task2_AI1" = 1:5, "Task2_AI2"= 6:10)
df
</code></pre>
<p>And it looks like this:</p>
<div class="s-table-con... | <p>With the help of data.table:</p>
<pre><code>library(data.table) # load package
sumEquals = function(df){
a = copy(df) # copy because data.table works on the object!
# Get the unique names of tasks (I assume there could be more than 2!)
uniqueNames = unique(substr(names(a), start = 1, stop = 5))
... | Extract a column's name to create a new column name | r|function | 0 | 36 | 2 | 72,194,690 | 72,194,690 | 0 | true | 2022-05-11T01:04:31.650Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extract a column's name to create a new column name<p>I have the following simplified dataframe.</p>
<pre><code>df <- data.frame("Task1_AI1" = 1... |
72,196,768 | SQL How to get full Array in a temporary table with condition?<p>Well, I am really sorry because my explanation was so poor. Thank you for all the answers.</p>
<p>I will explain better what should be the output and what is my question.</p>
<p>So, first of I have an array of tagCodes like ('code0','code1','code2').
Then... | <p>I think what you mean that 'TestCodeNull' does not exist in tags so you want to show null for 'TestCodeNull' in which case a join may be more appropriate. for example</p>
<pre><code>SELECT S.CODE,Tags.Code AS tagCode, Tags.TagTypeId,
TagTypes.Code AS tagType
INTO #TempTable
FROM (select '9034200124081816090... | SQL How to get full Array in a temporary table with condition? | sql|arrays|sql-server|temp-tables | 0 | 126 | 1 | 72,198,253 | 72,198,253 | 0 | true | 2022-05-11T07:07:12.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL How to get full Array in a temporary table with condition?<p>Well, I am really sorry because my explanation was so poor. Thank you for all the answers.</... |
72,186,215 | How to make an ifelse statement ignore NAs?<p>Hello I have this code</p>
<pre><code>df <- df %>%
mutate(prev_PC = ifelse(changed_PC == "No" & (is.na(prev_PC) | prev_PC == ""), new_PC, prev_PC))
</code></pre>
<p>I'm trying to change the previous postal code. Let's say we have old postal ... | <p>First solution looks like:</p>
<pre class="lang-r prettyprint-override"><code>df %>%
mutate(prev_PC = case_when(changed_PC == "No" &
is.na(prev_PC) ~ new_PC,
TRUE ~ prev_PC))
</code></pre>
<p>but this is probably better:</p>
<pre class="l... | How to make an ifelse statement ignore NAs? | r|dataframe|if-statement|data-wrangling | 0 | 44 | 1 | 72,187,224 | 72,187,224 | 0 | true | 2022-05-10T12:20:14.783Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make an ifelse statement ignore NAs?<p>Hello I have this code</p>
<pre><code>df <- df %>%
mutate(prev_PC = ifelse(changed_PC == "No"... |
72,182,575 | How do I SECURELY display images from Azure blob storage in an img tag?<p>I have a form with an Image upload in my website. whenever the user uploads an image, its saved under a new container with a random unique ID.
In a different page, I want to display that image. but by using an tag with a src attribute, im compro... | <p><strong>To securely display images from Azure blob storage, please try the following:</strong></p>
<p>The below permission must be set to <em><strong>Private</strong></em> because the content is only viewable to logged in user.</p>
<ul>
<li><em><strong>Go to Azure portal -> Storage Accounts -> Select container... | How do I SECURELY display images from Azure blob storage in an img tag? | azure|next.js|azure-blob-storage|azure-storage|nextjs-image | 0 | 429 | 1 | 72,186,338 | 72,186,338 | 0 | true | 2022-05-10T07:53:59.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I SECURELY display images from Azure blob storage in an img tag?<p>I have a form with an Image upload in my website. whenever the user uploads an imag... |
72,156,450 | display link_list menu on certain pages<p>I'd like to get a certain menu to display in the header on my product page instead of site-wide.</p>
<p>my <code>theme.liquid</code> file has the <code>{% section 'header' %}</code> tag within the <code><body></code> so my header is showing fine on all pages as expected.<... | <p>I ended up handling this with a switch statement and the <code>template</code> object.</p>
<p>In my navigation bar in my <code>sections/header.liquid</code> I created the switch statement:</p>
<pre><code><nav>
<ul>
{% case template.name %}
{% when 'article' %}
<li>
Show that
<... | display link_list menu on certain pages | shopify|liquid | 0 | 428 | 1 | 72,172,140 | 72,172,140 | 0 | true | 2022-05-07T21:21:16.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
display link_list menu on certain pages<p>I'd like to get a certain menu to display in the header on my product page instead of site-wide.</p>
<p>my <code>th... |
72,218,532 | Deleting an FFT plan in scikit-cuda destroys the pycuda context<p>I would like to use <a href="https://github.com/inducer/pycuda" rel="nofollow noreferrer">pycuda</a> and the FFT functions from <a href="https://github.com/lebedov/scikit-cuda" rel="nofollow noreferrer">scikit-cuda</a> together. The code below</p>
<ul>
<... | <p>The master replied (<a href="https://github.com/inducer/pycuda/discussions/356" rel="nofollow noreferrer">https://github.com/inducer/pycuda/discussions/356</a>):</p>
<blockquote>
<p>By using pycuda.autoinit, you're putting pycuda in charge of context management. That's not typically a good recipe for interacting wit... | Deleting an FFT plan in scikit-cuda destroys the pycuda context | pycuda|incompatibility|scikit-cuda | 0 | 71 | 1 | 72,222,307 | 72,222,307 | 0 | true | 2022-05-12T15:42:16.957Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deleting an FFT plan in scikit-cuda destroys the pycuda context<p>I would like to use <a href="https://github.com/inducer/pycuda" rel="nofollow noreferrer">p... |
72,217,899 | Add verification data in to my powershell script<p>I have a powershell script that generate a csv from xml files and than imports that csv in to a sql data base.
I want to add a verification cicle to check if the content that the script is creating in to the csv file already exists on it.</p>
<p><strong>Here is my code... | <p><strong>What i did was just download the table 1 into a csv and compare it with the one i have generate and then the different values i just insert them into the table 1</strong></p>
<pre><code>Clear-Host
Install-Module SqlServer
$fi = Get-Content "C:\scripts\xml_para_csv_sql\dados.txt"
$nx = $fi[0] #cam... | Add verification data in to my powershell script | powershell|script | 0 | 35 | 1 | 72,557,761 | 72,557,761 | 0 | true | 2022-05-12T15:00:01.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add verification data in to my powershell script<p>I have a powershell script that generate a csv from xml files and than imports that csv in to a sql data b... |
72,219,942 | Access component parameters inside caller component<p>I have a component which I call inside another component as:</p>
<p>COMPONENT 1</p>
<pre><code><template>
<FiltersComponent />
</template>
export default Vue.extend({
components: { FiltersComponent }
)}
</code></pre>
<p>So, this FiltersCompon... | <p>There are multiple possibilities: If one component is a child component or sibling of the other, you might want to take a loop at <a href="https://vuejs.org/guide/components/props.html#props-declaration" rel="nofollow noreferrer"><code>props</code></a> (passing data down) and <a href="https://vuejs.org/guide/essenti... | Access component parameters inside caller component | vue.js|vuejs2|vue-component | 0 | 28 | 3 | 72,219,991 | 72,219,991 | 0 | true | 2022-05-12T17:33:39.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Access component parameters inside caller component<p>I have a component which I call inside another component as:</p>
<p>COMPONENT 1</p>
<pre><code><temp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.