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,330,948
Bash regex overwrite line if multiple match<p>I have a bash script where I have 3 regular expressions. I would like to, through conditional if, to find the match of the first pattern in the file.</p> <p>If there is a match, then look for a match in the second pattern but only with the lines that have matched the first ...
<p>While an <code>awk</code> solution is going to be a bit faster ... we'll focus on a <code>bash</code> solution per OP's request.</p> <p>First issue is regex matching uses the <code>=~</code> operator and not the <code>==</code> operator.</p> <p>Second issue is that to keep a row if only all 3 regexes match means we ...
Bash regex overwrite line if multiple match
regex|bash|shell|grep|script
1
58
1
72,331,353
72,331,353
2
true
2022-05-21T15:30:57.083Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bash regex overwrite line if multiple match<p>I have a bash script where I have 3 regular expressions. I would like to, through conditional if, to find the m...
72,343,886
Most efficient way to loop through array elements that need to be processed asynchronously<p>I have 3 async functions. The output of the first is the input of the second. And the output of the first two are the input of the third. Now these 3 will be inside a loop, depending on the length of my array. What is an effici...
<p>Given the above code snipped the <code>thirdFunction</code> needs all of the outputs from <code>firstFunction</code> and <code>secondFunction</code>, but their invocations can be in parallel.</p> <p>So if each execution of first and second function takes a second the third function could be executed in about 2 seco...
Most efficient way to loop through array elements that need to be processed asynchronously
node.js|async-await|promise
0
58
1
72,344,551
72,344,551
2
true
2022-05-23T06:03:56.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Most efficient way to loop through array elements that need to be processed asynchronously<p>I have 3 async functions. The output of the first is the input o...
72,354,510
Change the url of fonts in Bootstrap 5<p>I want to change the url Bootstrap uses to search for fonts (to host them on myserver, rather than force users to ping Google every page load), however I cannot find the urls I see being hit when the page loads anywhere in the css of Bootstrap...</p> <p><a href="https://i.stack....
<p>Bootstrap 5 doesn't provide download links for fonts. Instead it has a list of possible system fonts that should cascade until it hits one of your system defaults - Roboto, in this case, being an android default. Are you sure you haven't included a link to Roboto somewhere else? Check for the initiator column in you...
Change the url of fonts in Bootstrap 5
css|fonts|bootstrap-5
0
58
1
72,355,112
72,355,112
2
true
2022-05-23T20:29:54.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change the url of fonts in Bootstrap 5<p>I want to change the url Bootstrap uses to search for fonts (to host them on myserver, rather than force users to pi...
72,359,878
Aggregate Query and display highest value of non-aggregated columns<p>how you doing? I've this question: Is it possible to aggregate a query with GroupBy on #col1 and then display the value of #col2 with the highest date?</p> <p>It's a problem that I've come accross multiple times and I've always got by using some logi...
<p>This is a generic greatest-n-per-group query. In MySQL 8 or later you can use <code>row_number</code> window function:</p> <pre><code>with cte as ( select t.*, row_number() over (partition by salElem order by datainizio desc) as rn from t ) select * from t where rn = 1 </code></pre>
Aggregate Query and display highest value of non-aggregated columns
mysql|sql|greatest-n-per-group
0
58
2
72,359,945
72,359,945
2
true
2022-05-24T08:50:07.470Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Aggregate Query and display highest value of non-aggregated columns<p>how you doing? I've this question: Is it possible to aggregate a query with GroupBy on ...
72,370,399
Pandas: Search and replace a string across all columns in a dataframe<p>I'm trying to search for a string 'NONE' that is in uppercase across all columns in a dataframe and replace it with 'None'. If it is already 'None' I don't do anything.</p> <p>I tried using the lambda function but its not working.</p> <p>ps: In the...
<p>Try this</p> <pre class="lang-py prettyprint-override"><code>df = pd.DataFrame({'A': ['None', 'NONE', '565'], 'B': ['234', 'NONE', '347']}) # replace NONE by None df = df.replace('NONE', 'None') print(df) </code></pre> <pre><code> A B 0 None 234 1 None None 2 565 347 </code></pr...
Pandas: Search and replace a string across all columns in a dataframe
python|pandas|numpy|contains
0
58
1
72,370,463
72,370,463
2
true
2022-05-24T23:14:47.753Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas: Search and replace a string across all columns in a dataframe<p>I'm trying to search for a string 'NONE' that is in uppercase across all columns in a...
72,370,788
Bring up macos print file dialog<p>I found <a href="https://www.tcl.tk/man/tcl/TkCmd/tk_mac.html#:%7E:text=args%20%7Bmy_open_document%20%24f%7D%0A%7D-,%3A%3Atk%3A%3Amac%3A%3APrintDocument%20file,path%20as%20an%20argument.,-%3A%3Atk%3A%3Amac%3A%3AQuit" rel="nofollow noreferrer">this</a>(::tk::mac::PrintDocument) when go...
<p>I don't think this does what you think it does. It's not a function you can call in order to print a document. Rather, if your script defines a tcl procedure with that name (<code>::tk::mac::PrintDocument</code>), that procedure will be called via applescript and passed a filename. You will then be responsible for a...
Bring up macos print file dialog
python|macos|tkinter|tcl|tk
-1
58
1
72,370,852
72,370,852
2
true
2022-05-25T00:24:53.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bring up macos print file dialog<p>I found <a href="https://www.tcl.tk/man/tcl/TkCmd/tk_mac.html#:%7E:text=args%20%7Bmy_open_document%20%24f%7D%0A%7D-,%3A%3A...
72,372,253
cannot find the nanosleep function when cross compile configure<p>I use toolchain from <a href="https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz" rel="nofollow noreferrer">here</a>, then extract to gcc11_arm_armv7_none_gnueabihf,</p> <...
<p><code>nanosleep</code> requires <code>_POSIX_C_SOURCE &gt;= 199309L</code> feature macro as specified by <code>man nanosleep</code>.</p> <p>Try adding <code>#define _POSIX_C_SOURCE 199309L</code> before <code>#include &lt;time.h&gt;</code>.</p>
cannot find the nanosleep function when cross compile configure
c++|gcc|cross-compiling
1
58
1
72,372,341
72,372,341
2
true
2022-05-25T05:13:56.657Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cannot find the nanosleep function when cross compile configure<p>I use toolchain from <a href="https://developer.arm.com/-/media/Files/downloads/gnu/11.2-20...
72,373,787
why onclick function is not working in my Vue app?<p>please help me solve the following. I am trying to add onclick event to my slider, and while am using Vue 3, the esling gives me 'is assigned a value but never used, no-unused-vars' error. the below is my code, could someone please help.</p> <pre><code>&lt;template&g...
<p>You need to return your function from setup also:</p> <pre><code>return { currentSlide, prevSlide, nextSlide }; </code></pre>
why onclick function is not working in my Vue app?
javascript|vue.js|vuejs3
1
58
1
72,373,815
72,373,815
2
true
2022-05-25T07:49:42.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why onclick function is not working in my Vue app?<p>please help me solve the following. I am trying to add onclick event to my slider, and while am using Vu...
72,384,747
Is a Bullet List With a Long Link Possible in RST Without Warnings?<p>I have a long link escaped like this:</p> <pre><code>`Build Azure Devops Agents With Linux cloud-init for Dotnet Development \ [terraform, azure, devops, docker, dotnet, cloud-init]`_ .. _Build Azure Devops Agents With Linux cloud-init for Dotnet De...
<p>This works for me. You need to indent second and subsequent lines in a list item to align with the first character in the first line.</p> <pre><code>- `Build Azure Devops Agents With Linux cloud-init for Dotnet Development \ [te3rraform, azure, devops, docker, dotnet, cloud-init]`_ .. _Build Azure Devops Agen...
Is a Bullet List With a Long Link Possible in RST Without Warnings?
python-sphinx|restructuredtext|read-the-docs
1
58
1
72,386,874
72,386,874
2
true
2022-05-25T22:24:18.253Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is a Bullet List With a Long Link Possible in RST Without Warnings?<p>I have a long link escaped like this:</p> <pre><code>`Build Azure Devops Agents With Li...
72,388,513
React, setInterval not working properly, h1 element not being updated correctly<p>I want to create a simple React app that upadates a h1 element every second with setInterval function. I have an array with strings and every second I want randomly pick a string from that array and uses that string inside h1. But my code...
<pre><code> import PersonalInfo from './PersonalInfo.js' import { useState } from 'react'; function App() { const myPersonalInfo = ['books', 'music', 'code']; const [state, changeState] = useState(myPersonalInfo[Math.floor(Math.random() * myPersonalInfo.length)]); useEffect(() =&...
React, setInterval not working properly, h1 element not being updated correctly
javascript|reactjs
2
58
3
72,388,578
72,388,578
2
true
2022-05-26T07:52:37.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React, setInterval not working properly, h1 element not being updated correctly<p>I want to create a simple React app that upadates a h1 element every second...
72,400,907
Methods signature got changed while compiling the gradle java application and referencing to other project<p>I have two projects known as (<code>Common</code> and <code>ApiGateway</code>).The common is a Gradle java project and ApiGateway is a Micronaut java application. In the common project, I am keeping all the comm...
<p>The documentation has a section about retaining parameter names <a href="https://docs.micronaut.io/latest/guide/#retainparameternames" rel="nofollow noreferrer">https://docs.micronaut.io/latest/guide/#retainparameternames</a></p>
Methods signature got changed while compiling the gradle java application and referencing to other project
java|gradle|build.gradle|micronaut|micronaut-rest
-2
58
1
72,401,121
72,401,121
2
true
2022-05-27T05:37:53.570Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Methods signature got changed while compiling the gradle java application and referencing to other project<p>I have two projects known as (<code>Common</code...
72,326,354
Select order by round table?<p>I have a table A like this:</p> <pre><code>WcsID Single_long, Single_short, Single_tag 1001 100 100 A 1002 100 100 A 1003 100 100 A 1004 100 100 B 1005 100 100 B 1006 100 ...
<p>you can try this:</p> <pre><code>CREATE TABLE test(col1 int, col2 varchar(10), col3 varchar(10), col4 varchar(10)); INSERT INTO test(col1, col2, col3, col4) VALUES (1001, 100, 100, 'A'),(1002, 100, 100, 'A'),(1003, 100, 100, 'A'),(1004, 100, 100, 'B'),(1005, 100, 100, 'B'),(1006, 100, 100, 'B'),(1007, 100, 100, 'C')...
Select order by round table?
sql|sql-server
2
58
2
72,326,477
72,326,477
2
true
2022-05-21T03:01:51.943Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select order by round table?<p>I have a table A like this:</p> <pre><code>WcsID Single_long, Single_short, Single_tag 1001 100 100 A ...
72,395,674
Export Postgresql Table to excel with header in Python<p>My code works but it doesn't bring the header with the names, it only brings the numbers 0 1 ... 10 , what can I do ?</p> <p>Utils_db.py</p> <pre class="lang-py prettyprint-override"><code> def consulta_sql(sql): try: connection = psycopg2.connect(u...
<p>You can ask psycopg2 to return the result as a dictionary, using the column names as keys for the dictionary.</p> <p>Pass the value <code> RealDictCursor</code> (import it from <code>psycopg2.extras</code>) to <code>cursor_factory</code> parameter in the connect method.</p> <p>The line will be</p> <pre><code>from ps...
Export Postgresql Table to excel with header in Python
python|psycopg2
1
58
1
72,395,751
72,395,751
2
true
2022-05-26T17:16:26.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Export Postgresql Table to excel with header in Python<p>My code works but it doesn't bring the header with the names, it only brings the numbers 0 1 ... 10 ...
72,301,009
.htaccess 301 redirect whole URL including Domain<p>I need to redirect around 300 URLs on a multidomain site that has the same URL structure on the different domains. For example:</p> <p><code>https://www.example.com/de/products.html</code> needs to be redirected to <code>https://www.example.org/de/products.html</code>...
<p>The mod_alias <code>RedirectMatch</code> directive matches against the URL-path only. To match the hostname you'll need to use mod_rewrite with an additional <em>condition</em> (<code>RewriteCond</code> directive) that checks against the <code>HTTP_HOST</code> server variable (the value of the <code>Host</code> HTTP...
.htaccess 301 redirect whole URL including Domain
apache|.htaccess|mod-rewrite|typo3
1
58
1
72,303,785
72,303,785
2
true
2022-05-19T08:19:22.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .htaccess 301 redirect whole URL including Domain<p>I need to redirect around 300 URLs on a multidomain site that has the same URL structure on the different...
72,250,491
Using excel built-in functions with a variable<p>I am an excel noob trying to make a custom excel function that uses degrees while calculating sin of an angle.</p> <pre><code>Public Function SIND(number As Double) Formula = &quot;SIN(RADIANS(number))&quot; Formula = Replace(Formula, &quot;number&quot;, number) SIND = E...
<p>Here's a better way:</p> <pre><code>Public Function SIND(degrees As Double) As Double Dim Rads As Double Rads = WorksheetFunction.Radians(degrees) SIND = Sin(Rads) End Function </code></pre> <p>The main problem with your way is that you were mixing string functions to do math calculations, and that's just not ...
Using excel built-in functions with a variable
excel|vba|function|trigonometry|degrees
2
58
1
72,251,050
72,251,050
2
true
2022-05-15T17:11:13.240Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using excel built-in functions with a variable<p>I am an excel noob trying to make a custom excel function that uses degrees while calculating sin of an angl...
72,395,426
tbb::parallel_invoke excuting the functions only once<p>So I started learning TBB just today. I'm working on Ubuntu system, so installed TBB using sudo apt</p> <p><code>sudo apt-get install libtbb-dev</code></p> <p>now I'm trying to compile and run HELLO_TBB</p> <pre><code>#include &lt;iostream&gt; #include &lt;tbb/tbb...
<p><strong>Regarding the output:</strong><br /> <a href="https://spec.oneapi.io/versions/1.0-rev-3/elements/oneTBB/source/algorithms/functions/parallel_invoke_func.html" rel="nofollow noreferrer"><code>tbb::parallel_invoke</code></a> is a:</p> <blockquote> <p>Function template that evaluates several functions in parall...
tbb::parallel_invoke excuting the functions only once
c++|parallel-processing|tbb
2
58
1
72,395,635
72,395,635
2
true
2022-05-26T16:57:45.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tbb::parallel_invoke excuting the functions only once<p>So I started learning TBB just today. I'm working on Ubuntu system, so installed TBB using sudo apt</...
72,261,874
Custom Menu in UI - selection changes selection in drop down list<p>I added a menu titled Reset Stats -&gt; Inning Reset clicking this will change a few other items previously setup in my doc. I want the button to also change the selection of the dropdown menu to the number that is next in line. 1 - 2 - 3 - 4 - 5 - 6 -...
<p>Probably something like this?</p> <pre><code>function onOpen() { SpreadsheetApp.getUi().createMenu('Reset stats') .addItem('Inning Reset', 'inning_reset') .addToUi(); } function inning_reset() { var cell = SpreadsheetApp.getActiveSheet().getRange('e3'); var current_value = '' + cell.getValue(); // it shou...
Custom Menu in UI - selection changes selection in drop down list
google-apps-script|google-sheets
0
58
1
72,264,474
72,264,474
2
true
2022-05-16T15:39:44.987Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Custom Menu in UI - selection changes selection in drop down list<p>I added a menu titled Reset Stats -&gt; Inning Reset clicking this will change a few othe...
72,345,073
Output number of non-consecutive failures from historical data in Bigquery<p>this is related to my previous scenario.</p> <p>I have a dataset like this:</p> <pre><code>WITH failure_table AS (SELECT 'Andrea' AS name, 'Failure' AS status, '2022-04-28 4:00:00' AS timestamp UNION ALL SELECT 'Karl', 'Failure', '2022-04...
<p>Take a look at below query although it's not refined yet. Hoping help you find some clue to approach your problem.</p> <ol> <li><code>failure_blocks</code> is for figuring out each consecutive failing days.</li> <li><code>last_blocks</code> is for finding last failing block to identify <code>started_recently_failing...
Output number of non-consecutive failures from historical data in Bigquery
sql|database|datetime|google-bigquery|data-analysis
0
58
2
72,346,625
72,346,625
2
true
2022-05-23T07:58:23.620Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Output number of non-consecutive failures from historical data in Bigquery<p>this is related to my previous scenario.</p> <p>I have a dataset like this:</p> ...
72,358,619
Split long dictionary value over two lines<p>Very new to python here. How do you split a very long dictionary value over two lines while still having it appear as one line when it is output with print()? See code below.</p> <pre><code>glossary = {'dictionary' : 'A mutable associative array (or dictionary) of key and va...
<p>you can use \ (backslash) to continue code onto the next line</p> <p>e.g.</p> <pre><code>print(&quot;hello \ how are you&quot;) </code></pre> <p>would return</p> <pre><code>hello how are you </code></pre> <p>edit: you should be able to use &quot;&quot;&quot; as (from my understanding) it just converts it to a normal...
Split long dictionary value over two lines
python
0
58
1
72,358,672
72,358,672
2
true
2022-05-24T07:12:23.263Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split long dictionary value over two lines<p>Very new to python here. How do you split a very long dictionary value over two lines while still having it appe...
72,332,660
pipe of "ps -e", "tee" and "head" behaves strange<p>I meant to use the following command to grep the &quot;zsh&quot; process with header. But this command only showed the header and then exited. The <code>grep</code> didn't run. I can do this task by other ways but I want to understand what happened here. The interes...
<p>I think Ondrej K. nailed it in a comment: <code>head</code> is reading just the first line it receives from <code>tee</code>, then exiting, so when <code>tee</code> tries to write the second line to that pipe, it gets an error (probably actually a SIGPIPE signal) and exits without writing the rest of <code>ps's</cod...
pipe of "ps -e", "tee" and "head" behaves strange
bash|macos
1
58
1
72,333,438
72,333,438
2
true
2022-05-21T19:29:24.047Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pipe of "ps -e", "tee" and "head" behaves strange<p>I meant to use the following command to grep the &quot;zsh&quot; process with header. But this command on...
72,271,103
Fail to prove a permutation property<p>I have created this simple type :</p> <pre><code>Inductive implist : nat -&gt; list nat -&gt; Prop := | GSSingle : forall (n:nat), implist n [n] | GSPairLeft : forall (a b n:nat) (l:list nat), implist n l -&gt; implist n ([a]++[b]++l) | GSPairRight : forall (a b n:nat) (l:l...
<p>The induction principle of this predicate is not very useful for proving this directly. It is much better to find an alternative formulation of <code>implist</code> to make your proof go through:</p> <pre><code>From Coq Require Import List PeanoNat Lia. Import ListNotations. Inductive implist : nat -&gt; list nat -...
Fail to prove a permutation property
coq
1
58
2
72,275,520
72,275,520
2
true
2022-05-17T09:01:38.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fail to prove a permutation property<p>I have created this simple type :</p> <pre><code>Inductive implist : nat -&gt; list nat -&gt; Prop := | GSSingle :...
72,303,105
Jquery nested click function abort child if container is triggered<p>I have onclick method in table tag.I also have it in my tag. I'm just trying to cancel the click method on when the delete button in is pressed.</p> <pre><code> @foreach (var item in Model.PickupTemplate.PickupBags.OrderByDescending(x =&gt; x.Id)...
<p>You need to stop the inner click event on the <code>a</code> element from propagating up the DOM to the <code>tr</code> for it to be caught there too.</p> <p>To do this, and also to improve the quality of your code, use unobtrusive event handlers which are assigned in JS code, not in your HTML. From there you can ac...
Jquery nested click function abort child if container is triggered
javascript|html|jquery
2
58
1
72,303,172
72,303,172
2
true
2022-05-19T10:41:33.550Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jquery nested click function abort child if container is triggered<p>I have onclick method in table tag.I also have it in my tag. I'm just trying to cancel...
72,337,859
SQL count recurring values per week<p>I've asked the same question for pandas: <a href="https://stackoverflow.com/questions/72330156/pandas-count-recurring-values-per-week">link</a></p> <p>And now I'm struggling to do the same thing with Big Query SQL. This is what I'm trying to achieve:</p> <p>I have a <code>Table</co...
<p>Try doing self-join and counting the results:</p> <pre><code>SELECT t1.date ,COUNT(t2.id) as count FROM Table t1 LEFT JOIN Table t2 ON t1.date = DATE_SUB(t2.date, INTERVAL 7 DAY) -- finding previous week AND t1.id = t2.id -- identifying matching ids GROUP BY 1 </code></pre> <p>Couple assumptions here:</p> <...
SQL count recurring values per week
sql|google-bigquery
-1
58
1
72,338,024
72,338,024
3
true
2022-05-22T13:11:50.393Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL count recurring values per week<p>I've asked the same question for pandas: <a href="https://stackoverflow.com/questions/72330156/pandas-count-recurring-v...
72,339,356
Python: Unsupported operand while adding 2 functions output in python?<p>I am using python 3.8.8 and while running a simple program of Fibonacci it is <strong>giving me an error</strong> i.e. <code>unsupported operand type(s) for +: 'NoneType' and 'NoneType'</code></p> <pre><code>def fibo(n): if n &lt;= 1: print(&q...
<p>Add a <code>return n</code> to your code</p> <pre class="lang-py prettyprint-override"><code>def fib(n): if n&lt;=1: return n else: return(fib(n-1) + fib(n-2)) for i in range(10): print(f&quot;fib({i}) = &quot; + str(fib(i))) </code></pre> <p>gives</p> <pre><code>fib(0) = 0 fib(1) = 1 f...
Python: Unsupported operand while adding 2 functions output in python?
python
-2
58
1
72,339,426
72,339,426
3
true
2022-05-22T16:24:01.870Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: Unsupported operand while adding 2 functions output in python?<p>I am using python 3.8.8 and while running a simple program of Fibonacci it is <stron...
72,326,893
Isolate used libraries in webpack project<p>I have written a WebGL JavaScript app to display small models. I am using WebPack 5.66 and some of my users report issues with libraries that I am using. For example I am using lodash and polyfill. Now my users are saying that some important lodash functions are missing. Or t...
<p>Is the root cause that your clients are using different versions of your libraries, and they are getting overridden by your installed versions?</p> <p>If so, you could try reinstalling your libraries with a different alias name, and reference that in your code.</p> <pre><code>npm install lodash@4.17.21@npm:lodashNew...
Isolate used libraries in webpack project
webpack
1
58
1
72,347,063
72,347,063
3
true
2022-05-21T05:24:08.630Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Isolate used libraries in webpack project<p>I have written a WebGL JavaScript app to display small models. I am using WebPack 5.66 and some of my users repor...
72,384,216
keyIsDown running when key isn't down?<p>I'm working on a basic first person camera controller in p5.JS, and I'm using the move function inside of an if statement (uses <code>keyIsDown</code>) and it still moves the camera when the key isn't pressed (I mean like its down for a second then no longer pressed).</p> <p>I'v...
<p>It's because you don't set a new <code>z</code> every time <code>keyIsDown(87)</code>, but you <code>cam.move</code> with <code>z</code> as the argument.</p> <p>So something like:</p> <pre class="lang-js prettyprint-override"><code>z = 0; cam.move(x,y,z); //here z = 0, so it doesn't move. z -= 0.1; cam.move(x,y,z);...
keyIsDown running when key isn't down?
javascript|p5.js
4
58
3
72,385,661
72,385,661
3
true
2022-05-25T21:09:26.780Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: keyIsDown running when key isn't down?<p>I'm working on a basic first person camera controller in p5.JS, and I'm using the move function inside of an if stat...
72,400,813
How to create a ranking variable/function for different periods in a panel data?<p>I have a dataset, <code>df</code>, that looks like this:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Date</th> <th>Code</th> <th>City</th> <th>State</th> <th>Population</th> <th>Quantity</th> <th>QTDPERCA...
<p>You can use:</p> <pre><code># MinMax scaler: (rank - min) / (max - min) ranking = lambda x: (x.rank() - 1) / (len(x) - 1) # Rank between [0, 1] -&gt; 0 the lowest, 1 the highest df['RANKING'] = df.groupby('Date')['QTDPERCAPITA'].apply(ranking) # Rank between [1, 4149] -&gt; 1 the lowest, 4149 the highest # df['RAN...
How to create a ranking variable/function for different periods in a panel data?
python|pandas|ranking-functions
0
58
2
72,400,919
72,400,919
3
true
2022-05-27T05:23:43.733Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a ranking variable/function for different periods in a panel data?<p>I have a dataset, <code>df</code>, that looks like this:</p> <div class="s...
72,318,133
Why is TypeScript expecting arguments for a function defined with no arguments that is returned in a tuple?<p>I am learning TypeScript. Just created this simple function and executed it. But I don't understand why does the compiler show the error in the below code. Please refer to the screenshot for the error.</p> <pre...
<h1>Problem (presumed)</h1> <blockquote> <p>Starting off with a caveat that this is what I presume the problem to be because my understanding of TypeScript isn't extremely deep. This explanation may not be totally correct or may not be elaborated well.</p> </blockquote> <p>Your function is declared without an explicit ...
Why is TypeScript expecting arguments for a function defined with no arguments that is returned in a tuple?
typescript
1
58
2
72,319,179
72,319,179
3
true
2022-05-20T11:23:19.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is TypeScript expecting arguments for a function defined with no arguments that is returned in a tuple?<p>I am learning TypeScript. Just created this sim...
72,276,679
Count changes for each ID<p>I have a set of data of 2000+ people with repeated measurements over multiple years between 2000-2022 (some people have data for the full time period whereas others only for a subset of these years). Within a single year, each person can only fall into one of four groups: 0, 1, 2, or 3. I wa...
<p>You can achieve it without any loop:</p> <pre class="lang-r prettyprint-override"><code>aggregate(Group ~ ID, df, \(x) sum(diff(x) != 0)) # ID Group # 1 1 3 # 2 2 0 </code></pre> <hr /> <p>Its <code>dplyr</code> equivalent is:</p> <pre class="lang-r prettyprint-override"><code>library(dplyr) df %&gt;% ...
Count changes for each ID
r|dataframe
1
58
2
72,276,825
72,276,825
3
true
2022-05-17T15:21:43.127Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Count changes for each ID<p>I have a set of data of 2000+ people with repeated measurements over multiple years between 2000-2022 (some people have data for ...
72,336,968
apply modulus operator to Scala generic type class member?<p>So i have the followig class:</p> <pre class="lang-scala prettyprint-override"><code>class MyClass[T] { var data: T = _ def isEven: Boolean = { if (this.data % 2 == 0) return true false } } </code></pre> <p>Scala isn't allowing me...
<p>There's a type class called <code>Numeric</code>, located in package <code>scala.math</code>. This class provides some functionalities, which numerics (like Int, Double, ...) must have, for instance, they can be negated, or they must be able to get converted to Int, and many others, <a href="https://www.scala-lang.o...
apply modulus operator to Scala generic type class member?
scala|generics
0
58
1
72,337,053
72,337,053
3
true
2022-05-22T11:02:39.870Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: apply modulus operator to Scala generic type class member?<p>So i have the followig class:</p> <pre class="lang-scala prettyprint-override"><code>class MyCla...
72,281,810
How can I specify a trait bound on an associated type that is a Result?<p>I'm trying to write a function that can take a <code>Stream</code> that returns <code>Result</code>s. The trouble is in specifying boundaries for the success values of the <code>Result</code>.</p> <p>This is an example that illustrates the proble...
<p>The syntax for equating associated types is <code>Trait&lt;Assoc = Type&gt;</code>.</p> <p>So:</p> <pre class="lang-rust prettyprint-override"><code>async fn handle_stream&lt;S, I, E&gt;(mut stream: S) where S: Stream&lt;Item = Result&lt;I, E&gt;&gt; + Unpin, I: AsRef&lt;str&gt;, { // ... } </code></pre>
How can I specify a trait bound on an associated type that is a Result?
rust
2
58
1
72,281,868
72,281,868
4
true
2022-05-17T23:44:02.393Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I specify a trait bound on an associated type that is a Result?<p>I'm trying to write a function that can take a <code>Stream</code> that returns <co...
72,339,197
Use conditional type as return type doesn't work correctly<p>I want to get a string based on the type of the input parameter of a function <code>toTypeString</code> as follows:</p> <pre class="lang-js prettyprint-override"><code>function toTypeString&lt;T extends string | number&gt;(x: T): T extends string ? &quot;S&qu...
<p>I would use function overloading here:</p> <pre><code>function toTypeString&lt;T extends string | number&gt;(x: T): T extends string ? &quot;S&quot; : T extends number ? &quot;N&quot;: never function toTypeString(x: string | number): &quot;S&quot; | &quot;N&quot; { if (typeof x === 'string') return 'S'; if (type...
Use conditional type as return type doesn't work correctly
typescript|conditional-types
1
58
1
72,339,273
72,339,273
4
true
2022-05-22T16:01:12.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use conditional type as return type doesn't work correctly<p>I want to get a string based on the type of the input parameter of a function <code>toTypeString...
72,365,070
Perl: Negative range indexing of array reference<p>I have an array reference that I would like to slice the last two elements of the array. I found that using <code>-2..-1</code> would work. I was using the following syntax:</p> <pre><code>subroutine($var-&gt;[-2..-1]); </code></pre> <p>This gave me the following error...
<p><code>-&gt;</code> is the dereference operator. <code>$aref-&gt;[$i]</code> is to an $aref like <code>$arr[$i]</code> is to <code>@arr</code>. To get a slice from an array, you need to change the sigil: <code>@arr[$i, $j]</code>. It's similar for dereference, but instead of changing the sigil, you first dereference...
Perl: Negative range indexing of array reference
arrays|perl
0
58
1
72,365,231
72,365,231
4
true
2022-05-24T14:52:30.127Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Perl: Negative range indexing of array reference<p>I have an array reference that I would like to slice the last two elements of the array. I found that usin...
72,372,495
Not able to load texture using DSA<p>My code works if i don't use DSA to create texture.</p> <p>This is how i am creating texture using DSA.</p> <p>My opengl version is 4.6</p> <pre><code>unsigned int loadTexture(char const* path) { unsigned int textureID; // glGenTextures(1, &amp;textureID); glCreateTextur...
<p>You have to create the texture storage with <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexStorage2D.xhtml" rel="nofollow noreferrer"><code>glTextureStorage2D</code></a>. e.g.:</p> <pre class="lang-cpp prettyprint-override"><code>glCreateTextures(GL_TEXTURE_2D, 1, &amp;textureID); </code></p...
Not able to load texture using DSA
c++|opengl
2
58
1
72,372,601
72,372,601
4
true
2022-05-25T05:46:36.067Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not able to load texture using DSA<p>My code works if i don't use DSA to create texture.</p> <p>This is how i am creating texture using DSA.</p> <p>My opengl...
72,362,411
javascript for loop with recursion and return value example<p>I am trying to convert json object into array of path string but not getting expected result. Don't know might be other way to achieve the same but tried using for loop and lodash <code>isObject</code> and <code>isEmpty</code> for validate object like below...
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>const json = { "info": { "account": {} }, "info2": { "address": { "mobile": { "phone": null } ...
javascript for loop with recursion and return value example
javascript
1
58
2
72,362,664
72,362,664
4
true
2022-05-24T11:51:17.880Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: javascript for loop with recursion and return value example<p>I am trying to convert json object into array of path string but not getting expected result. D...
72,251,278
How can a session detect if it's running with XACT_ABORT turned on?<p>We plan to globally enable XACT_ABORT on our databases using <a href="https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-user-options-server-configuration-option" rel="nofollow noreferrer">sp_configure</a>. However, ...
<p>From <a href="https://docs.microsoft.com/en-us/sql/t-sql/statements/set-xact-abort-transact-sql?view=sql-server-ver15" rel="nofollow noreferrer">the documentation</a>, to determine the current setting you can test bit 14 of <code>@@options</code></p> <pre><code>if (16384 &amp; @@options) = 16384 print 'xact abort...
How can a session detect if it's running with XACT_ABORT turned on?
sql-server|tsql
1
58
1
72,251,398
72,251,398
4
true
2022-05-15T18:50:00.153Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can a session detect if it's running with XACT_ABORT turned on?<p>We plan to globally enable XACT_ABORT on our databases using <a href="https://docs.micr...
72,264,331
What is '<Invoke>d__40'?<p>Using Powershell, System.Management.Automation.Cmdlet.Invoke() returns object of type <code>'&lt;Invoke&gt;d__40'</code> rather than specified OutputType.</p> <p>To reproduce:</p> <ol> <li>Copy <a href="https://docs.microsoft.com/en-us/powershell/scripting/developer/cmdlet/how-to-write-a-simp...
<p>To complement <a href="https://stackoverflow.com/a/72265158/45375">Guru Stron's helpful answer</a>, which explains that the name of the specific type returned is just an implementation detail; what matters is that the type implements the <a href="https://docs.microsoft.com/en-US/dotnet/api/System.Collections.IEnumer...
What is '<Invoke>d__40'?
c#|powershell|powershell-cmdlet
3
58
2
72,265,926
72,265,926
4
true
2022-05-16T19:00:30.527Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is '<Invoke>d__40'?<p>Using Powershell, System.Management.Automation.Cmdlet.Invoke() returns object of type <code>'&lt;Invoke&gt;d__40'</code> rather th...
72,282,185
Problem when learning forEach method in Javascript<p>I start learning Javascript since a week and I try to do some practice about the loop, So I try to make a function which each time I call it, I doubled the numbers in an array.</p> <p>I manage to do it with the classic &quot;for&quot; loop like this as an example:</p...
<p>Reassigning an identifier has no side-effects. That is, doing <code>someVariable = somethingNew</code> will only result in a discernable change in how your script runs if something else references the <code>someVariable</code> which has the new value in it. Here, the <code>number = number * 2</code> does nothing bec...
Problem when learning forEach method in Javascript
javascript
1
58
1
72,282,209
72,282,209
6
true
2022-05-18T01:01:44.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem when learning forEach method in Javascript<p>I start learning Javascript since a week and I try to do some practice about the loop, So I try to make ...
72,289,050
Why does Kotlin's null safety not work properly with local variable initializers?<p>Please look at this code:</p> <pre class="lang-kotlin prettyprint-override"><code>fun localVarNullSafety1(){ var number: Double? = 3.0 val sum = 2.0 + number // does not compile (Type mismatch: inferred type is Double? but Doub...
<p>This was discussed in <a href="https://youtrack.jetbrains.com/issue/KT-13663/Smartcast-variable-declaration-from-initializer-of-different-typ" rel="noreferrer">KT-13663</a>, and it remains an open ticket at the time of writing.</p> <p>They were considering the more general case of (Note that <code>T?</code> is a sup...
Why does Kotlin's null safety not work properly with local variable initializers?
kotlin|language-design|kotlin-null-safety
3
58
1
72,289,620
72,289,620
6
true
2022-05-18T12:19:48.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does Kotlin's null safety not work properly with local variable initializers?<p>Please look at this code:</p> <pre class="lang-kotlin prettyprint-overrid...
72,363,551
Perl : How to sort value and put them into array<p>I'm very new to Perl but here's what I'm trying to do for example the variable has a value of apple,banana,cat,dog, I need to put this value into individual array like for example</p> <pre><code>my $value = &quot;apple&quot;,&quot;banana&quot;,&quot;cat&quot;,&quot;dog...
<blockquote> <p>because I need it to be arranged in alphabetical order using array as a holder for those value. so if the script capture this letter it will go to that array , for example if the script has the value of yoyo it will go to array @Y. just like that , I hope you understand what I mean. thank you</p> </bloc...
Perl : How to sort value and put them into array
perl
1
58
2
72,363,907
72,363,907
6
true
2022-05-24T13:13:52.760Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Perl : How to sort value and put them into array<p>I'm very new to Perl but here's what I'm trying to do for example the variable has a value of apple,banana...
72,359,829
how does c evaluate less than and more than expretion?<p>I would like to know how i is evaluated in this code in C language ?</p> <pre><code> int x = 10, y = 20, z = 5, i; i = x &lt; y &lt; z; printf(&quot;%d\n&quot;,i); </code></pre>
<p>The result of a relational operator is either integer 1 if the condition is true or 0 otherwise. And relational operators evaluates from left to right.</p> <p>So this statement</p> <pre><code>i = x &lt; y &lt; z; </code></pre> <p>is equivalent to</p> <pre><code>i = ( x &lt; y ) &lt; z; </code></pre> <p>and as x is l...
how does c evaluate less than and more than expretion?
c|evaluation|relational-operators
-3
58
1
72,359,875
72,359,875
8
true
2022-05-24T08:46:00.137Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how does c evaluate less than and more than expretion?<p>I would like to know how i is evaluated in this code in C language ?</p> <pre><code> int x = 10, ...
72,397,187
Sum two list in sml<p>There are two list in sml and I want to add one to another</p> <pre><code>val one = [1.1,2.2,3.3] : real list; val two = [4.4,5.5,6.6] : real list; </code></pre> <p>The result should be [5.5, 7.7, 9.9].</p> <p>I not sure I'm doing this right but basically I'm trying to pass this two list to a fun ...
<p>How about following...</p> <pre class="lang-ml prettyprint-override"><code>fun add_lists any [] = any | add_lists [] any = any | add_lists (a::bs) (c::ds): real list = (a + c) :: add_lists bs ds; </code></pre> <hr /> <h2><em><strong>Test</strong></em></h2> <pre class="lang-ml prettyprint-override"><code>&gt; val...
Sum two list in sml
sml|smlnj
0
58
3
72,402,086
72,402,086
-1
true
2022-05-26T19:40:30.470Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sum two list in sml<p>There are two list in sml and I want to add one to another</p> <pre><code>val one = [1.1,2.2,3.3] : real list; val two = [4.4,5.5,6.6] ...
73,002,060
how can I convert strings like "2022.7.1" to "2022-07-01" in sqlite3?<p>I'm using sqlite3 library on python and have some strings on my sqlite DB as follows:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>date</th> </tr> </thead> <tbody> <tr> <td>2022.7.1</td> </tr> <tr> <td>2022.7.11</td>...
<p>It may be possible to do this using only SQL, but as the answer you linked shows, it will look very complicated. Assuming reasonable quantities of data, it's simpler to fetch the values into Python, reformat them, and update the database.</p> <p>The work is done in this statement:</p> <pre class="lang-py prettyprin...
how can I convert strings like "2022.7.1" to "2022-07-01" in sqlite3?
python|sqlite
-1
58
1
73,002,866
73,002,866
1
true
2022-07-16T06:35:18.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how can I convert strings like "2022.7.1" to "2022-07-01" in sqlite3?<p>I'm using sqlite3 library on python and have some strings on my sqlite DB as follows:...
72,911,156
How to return maximum value and it's associated keys from nested dictionaries<p>How can I find the maximum value from within the nested dictionaries and return this value with the key from the nested dictionary and the key from the 'main' dictionary (sorry, dont know the correct terminology for the outer dictionary)? F...
<p>You can do that in 2 steps, first you find the nested dictionary which has the maximum number in it's values :</p> <pre class="lang-py prettyprint-override"><code>my_dict = { 0: {1: 10, 2: 20, 3: 30}, 10: {10: 100, 20: 200, 30: 300}, 20: {100: 1000, 200: 2000, 300: 3000}, } # step 1 k_outer, v_outer = m...
How to return maximum value and it's associated keys from nested dictionaries
python|python-3.x|dictionary
2
58
2
72,911,812
72,911,812
1
true
2022-07-08T12:07:18.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to return maximum value and it's associated keys from nested dictionaries<p>How can I find the maximum value from within the nested dictionaries and retu...
72,821,407
When downloading csv files from webpage getting missing url scheme<p>I am fairly new to scraping and have been trying to directly download .csv files from a website. I managed to fix my last issue with the edit, however I get a new error when trying to download the files. The follow error is:</p> <blockquote> <p>raise ...
<p><code>item['file_urls']</code> should be a list:</p> <pre class="lang-py prettyprint-override"><code>if '.xls' in ind_files and 'Monthly' in ind_text: item['file_urls'] = [ind_files] item['original_file_name'] = ind_text yield item elif '.xls' in ind_files and 'Week' in ind_text: item['file_urls'] =...
When downloading csv files from webpage getting missing url scheme
scrapy
0
58
1
72,822,266
72,822,266
1
true
2022-06-30T20:02:04.363Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When downloading csv files from webpage getting missing url scheme<p>I am fairly new to scraping and have been trying to directly download .csv files from a ...
73,001,089
Passing data component to component in React JS<p>I'm super new to React JS and developing small employee data view and filtering app. Below is my working code.</p> <p><strong>EmployeeList.js</strong></p> <pre><code>function EmployeeList(props) { const [mainData, setMainData] = useState(props.data); const [sele...
<p>You can define a function in your <code>EmployeeList</code> component that receives the event and then filters the data. This function has to be passed via <code>props</code> to your <code>CommonCombo</code> component. Example:</p> <p>In your <code>EmployeeList</code> component:</p> <pre><code>function EmployeeList(...
Passing data component to component in React JS
reactjs
0
58
2
73,001,150
73,001,150
1
true
2022-07-16T02:13:20.793Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing data component to component in React JS<p>I'm super new to React JS and developing small employee data view and filtering app. Below is my working co...
72,942,106
How do I use qs.stringify in Vue 3?<p>I'm trying to use qs stringify to encode URL parameters in a Vue Axios call. In my main.js I have the following:</p> <pre><code>import { createApp } from 'vue' import Search from './Search.vue' import axios from 'axios' import VueAxios from 'vue-axios' import qs from 'qs' const se...
<p>In your <code>Search.vue</code>, you should do this:</p> <pre class="lang-js prettyprint-override"><code>import qs from 'qs' let queryString = qs.stringify(params) </code></pre> <p>You have to import the library into the component you want to use it.</p>
How do I use qs.stringify in Vue 3?
vuejs3
2
58
1
72,946,301
72,946,301
1
true
2022-07-11T16:59:02.460Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I use qs.stringify in Vue 3?<p>I'm trying to use qs stringify to encode URL parameters in a Vue Axios call. In my main.js I have the following:</p> <p...
72,883,390
DRF get_serializer_class doesn't pass<p>Here I have a viewset:</p> <pre><code>class TenderViewSet(viewsets.ModelViewSet): &quot;&quot;&quot; API ViewSet for Propopsition &quot;&quot;&quot; queryset = models.Tender.objects.all() serializer_class = serializers.TenderGetSerializer def get_serial...
<p>try to implement <code>get_serializer_class</code> method like this:</p> <pre><code> def get_serializer_class(self): if self.action == 'map': return serializers.TenderMapSerializer return super().get_serializer_class() </code></pre> <p>so return the serializer class instead of overwrit...
DRF get_serializer_class doesn't pass
python|django|django-rest-framework
1
58
2
72,883,630
72,883,630
1
true
2022-07-06T12:14:43.167Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DRF get_serializer_class doesn't pass<p>Here I have a viewset:</p> <pre><code>class TenderViewSet(viewsets.ModelViewSet): &quot;&quot;&quot; API ViewSet ...
72,868,308
React Redux Cart Items<p>so my reducer looks like that. I want to add items to cart and if the item is already in the state it should increase the qty of that item. I pass object to payload but it doesnt contain the quantity field so i create it manually.</p> <p>But when i add more than 2 of the same item it doesnt upd...
<p>You cannot mutate the state, it will then not update the react component, you can try the below code for updating the quantity</p> <pre><code>const init = { cartItems: [] }; export const cartReducer = (state = init, action) =&gt; { switch (action.type) { case 'ADD_TO_CART': { const itemIndex = state.car...
React Redux Cart Items
javascript|reactjs|redux
1
58
1
72,868,651
72,868,651
1
true
2022-07-05T11:00:50.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Redux Cart Items<p>so my reducer looks like that. I want to add items to cart and if the item is already in the state it should increase the qty of tha...
73,025,695
Pandas: Groupby with group size limited, based on rank of items<p>I'm trying to find a way to group the following DataFrame such:</p> <ol> <li>I <code>df.groupby(&quot;Strike&quot;)</code>, but limit the groupsize to 2.</li> <li>In the case of groupsize &gt; 2 (as in the example below), I would want the largest (+) gro...
<p>This ended up being somewhat complicated, so I am not entirely sure the logic is correct, but here is an attempt. I will break it down with explanation, but the full code is in a block below.</p> <p><em>Note this approach depends on the column <code>Index</code> being present - if it is actually the DataFrame index...
Pandas: Groupby with group size limited, based on rank of items
python|pandas
1
58
1
73,027,736
73,027,736
1
true
2022-07-18T16:33:43.780Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas: Groupby with group size limited, based on rank of items<p>I'm trying to find a way to group the following DataFrame such:</p> <ol> <li>I <code>df.gro...
72,894,259
Mapping data to a new array resulting in wrong data in a specific date range<p>I have a functionality in the snippet that takes an array of objects and re-map that into a new array with new fields and calculations. The calculation is done each day on a range of dates provided from another array of dates batch. The func...
<p>Your date filter is not correct. The time <code>statusTo</code> can be <code>null</code> but you use the <code>&amp;&amp;</code> condition.</p> <p>There aren't any elements in <code>matchingStatusesTime</code>.</p> <p><strong>UPDATE v2</strong> <div class="snippet" data-lang="js" data-hide="false" data-console="true...
Mapping data to a new array resulting in wrong data in a specific date range
javascript
0
58
1
72,894,694
72,894,694
1
true
2022-07-07T08:01:30.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mapping data to a new array resulting in wrong data in a specific date range<p>I have a functionality in the snippet that takes an array of objects and re-ma...
72,967,431
XSLT 1.0 grouping for text output<p>For a project with soil data im trying to group by STRAT whenever the data changes with increasing depth.</p> <p>Thanks to a lot of help already I am getting already onthat platform there are already some good results, but its not perfect still.</p> <p>Example:</p> <p>XML:</p> <pre><...
<p>This should get you going. It doesn't account for EGART=&quot;Lost_Data&quot; being in the first position. But, you should be able to make that adjustment if you need to.</p> <pre><code>&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:msxml=&quot;urn:schemas-microsoft-com:xslt&quot; xmlns:xsl=&quot;http://www....
XSLT 1.0 grouping for text output
xml|xslt|xslt-1.0
0
58
1
72,970,892
72,970,892
1
true
2022-07-13T13:47:39.743Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: XSLT 1.0 grouping for text output<p>For a project with soil data im trying to group by STRAT whenever the data changes with increasing depth.</p> <p>Thanks t...
72,789,417
How to correctly wait for dependent Neo4j bulk load tasks in C#<p>I need to bulk load two groups of data to Neo4j. The second group builds on the nodes and relationships created by the first group, so the second group cannot be loaded until the first group is fully committed.</p> <p>My current implementation reads like...
<p>What you need is to await the <code>result.ToListAsync</code> in the scope of the Func. Your transaction is completing before you read the results, and after the transaction is closed you can no longer access the results.</p> <pre><code> var groupA = session.WriteTransactionAsync(async x =&gt; { var r...
How to correctly wait for dependent Neo4j bulk load tasks in C#
c#|async-await|neo4j
0
58
1
72,854,008
72,854,008
1
true
2022-06-28T15:36:56.060Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to correctly wait for dependent Neo4j bulk load tasks in C#<p>I need to bulk load two groups of data to Neo4j. The second group builds on the nodes and r...
72,817,400
Oracle XE configuring for benchmark<p>Have a good day.</p> <p>The task is to configure Oracle XE for performance benchmark using HammerDB. Well, the HammerDB script for creating schema and driver script are both done. But trying to create schema or run a benchmark Oracle XE returns me different errors.</p> <p>Error can...
<h2>KPEDBG_HDL_PUSH_FCPTRMAX;</h2> <p>You have data structures in your Database which is protected. If you have (i. e. in a Benchmark) concurrent accesses by multiple threads in this structure this failure will be raised. You can lower down the threads in the benchmark. Push means you will ad something in the stack.</p...
Oracle XE configuring for benchmark
database|oracle|benchmarking|oracle-xe|hammerdb
1
58
1
72,818,814
72,818,814
1
true
2022-06-30T14:16:41.737Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle XE configuring for benchmark<p>Have a good day.</p> <p>The task is to configure Oracle XE for performance benchmark using HammerDB. Well, the HammerDB...
72,840,153
How to scroll Qt widgets by keyboard?<p>This is a portion of a Python class that I wrote:</p> <pre class="lang-py prettyprint-override"><code> def keyPressEvent(self, event): if event.text() == 'n': self.widget.scroll(0, -self.height()) elif event.text() == 'p': self.widget.sc...
<p>The <code>scroll()</code> function rarely needs to be directly used.</p> <p>QScrollBar already calls it <em>internally</em>, by overriding the virtual function of its inherited class (QAbstractScrollArea), <a href="https://doc.qt.io/qt-5/qabstractscrollarea.html#scrollContentsBy" rel="nofollow noreferrer"><code>scro...
How to scroll Qt widgets by keyboard?
python|qt|pyside
0
58
1
72,843,580
72,843,580
1
true
2022-07-02T15:10:50.630Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to scroll Qt widgets by keyboard?<p>This is a portion of a Python class that I wrote:</p> <pre class="lang-py prettyprint-override"><code> def keyPres...
73,023,822
Destructure multiple keys to the same variable name<p>I get a response from multiple APIs with relatively the same object structure but key names might vary as example:</p> <pre><code>response1 = {name:&quot;Something&quot;, image:&quot;path_to_image&quot;, ...} response2 = {title:&quot;Something&quot;, image:&quot;pat...
<p>You could do something weird with default initialisers:</p> <pre><code>const {name, label=name, title=label, ...rest} = response; // or const {name, label, title = name ?? label, ...rest} = response; </code></pre> <p>Notice however that this will also declare the variables <code>name</code> and <code>label</code>. Y...
Destructure multiple keys to the same variable name
javascript|destructuring
2
58
3
73,024,021
73,024,021
1
true
2022-07-18T14:16:51.943Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Destructure multiple keys to the same variable name<p>I get a response from multiple APIs with relatively the same object structure but key names might vary ...
72,782,152
Replacing zeros with last non-zero value for each column on multi-index dataframe<p>I have the following multi-index dataframe:</p> <pre><code> 0 1 2 3 0 0 0 0 0 0 0 1 36 19 2 4 0 2 233 21 2 4 0 3 505 25 1 4 0 4 751 27 1 4 0 5 976 28 1 4 0 9 0 0 0 0 0...
<p>You can use <code>replace</code> with <code>method='ffill'</code> for each group:</p> <pre><code>out = df.groupby(level=0).apply(lambda x: x.replace(0, method='ffill')) print(out) # Output 0 1 2 3 0 0 0 0 0 0 1 36 19 2 4 2 233 21 2 4 3 505 25 1 4 4 751 27 1 4 5 9...
Replacing zeros with last non-zero value for each column on multi-index dataframe
python|pandas|dataframe|multi-index
-1
58
4
72,782,270
72,782,270
2
true
2022-06-28T07:14:50.287Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replacing zeros with last non-zero value for each column on multi-index dataframe<p>I have the following multi-index dataframe:</p> <pre><code> 0 1 ...
72,782,383
SQL Server & MS Access separate Views for data entry and read only forms?<p>I'm working on a small company information system using MS Access as the front end and SQL Server 2019 Express as the back end. I am a bit confused about views at the moment.</p> <p>Here is what I have:</p> <pre><code>CREATE FUNCTION dbo.Displa...
<p>Linked Views with JOINs are editable in Access, if the PK of the underlying table you want to edit is included in the view, and you specify it as PK when linking the view.</p> <p>Percent formatting can be done in the form.</p> <p>Currency formatting: you simplify your life and the view by putting the currency symbol...
SQL Server & MS Access separate Views for data entry and read only forms?
sql-server|ms-access|sql-view
1
58
1
72,784,003
72,784,003
2
true
2022-06-28T07:33:39.517Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL Server & MS Access separate Views for data entry and read only forms?<p>I'm working on a small company information system using MS Access as the front en...
72,823,097
Visual Studio will not recognize Unity modules<p>I am a complete beginner to Unity, as well as Visual Studio 2022.</p> <p>I was trying to make a 2D game, and have been following along this tutorial, <a href="https://www.youtube.com/watch?v=7iYWpzL9GkM" rel="nofollow noreferrer">https://www.youtube.com/watch?v=7iYWpzL9G...
<p><a href="https://www.youtube.com/watch?v=7iYWpzL9GkM&amp;t=22m20s" rel="nofollow noreferrer">At 22:20 in the video</a> they get the Input System package from the Package Manager.</p> <p><a href="https://docs.unity3d.com/Packages/com.unity.inputsystem@0.9/api/UnityEngine.InputSystem.InputValue.html" rel="nofollow nor...
Visual Studio will not recognize Unity modules
visual-studio|unity3d
0
58
1
72,823,645
72,823,645
2
true
2022-06-30T23:47:29.937Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Visual Studio will not recognize Unity modules<p>I am a complete beginner to Unity, as well as Visual Studio 2022.</p> <p>I was trying to make a 2D game, and...
72,825,497
How to retrieve all values from a foreach loop C#?<p>I am developing a JavaScript calendar based system to display dates for events in .Net Core and the issue I am having is iterating through the foreach loop and the last value is the only value that is displaying on my calendar , controller code as follows:</p> <pre><...
<p>Your code does not work because you are overriding <code>jsonDate</code> in each loop iteration. If you want to retrieve all dates you will need to declare, for example, <code>jsonDates</code> as list, and then to append to list in each iteration. Something like this:</p> <pre><code>public IActionResult Calendar() {...
How to retrieve all values from a foreach loop C#?
c#|.net-core
0
58
1
72,825,596
72,825,596
2
true
2022-07-01T07:04:46.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to retrieve all values from a foreach loop C#?<p>I am developing a JavaScript calendar based system to display dates for events in .Net Core and the issu...
72,843,546
How to read the content from the second line onwards on a .txt file on C<p>I need help to read the numbers of a .txt file and put them in an array. But only from the second line onwards. I'm stuck and don't know where to go from the code that i built.</p> <p>Example of the .txt file:<br> 10 20<br> 45000000<br> 48000000...
<p>You just need a loop to keep reading <code>int</code>s from <code>file</code> and populate the <code>listOfNumers</code> array until reading an <code>int</code> fails.</p> <p>Since you don't know how many <code>int</code>s there are in the file, you could also allocate the memory dynamically. Example:</p> <pre class...
How to read the content from the second line onwards on a .txt file on C
arrays|c|file
0
58
2
72,843,704
72,843,704
2
true
2022-07-03T02:12:43.373Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read the content from the second line onwards on a .txt file on C<p>I need help to read the numbers of a .txt file and put them in an array. But only ...
72,846,084
Creating GIN index throws "function does not exist" error<p>My table has the following columns:</p> <ul> <li>content_vector tsvector</li> <li>lang VARCHAR(50)</li> </ul> <p>I'm struggling with creating a GIN index.</p> <h2>Approach one: Explicit type casting</h2> <pre><code>CREATE INDEX pages_vector_ix ON pages USING G...
<p>As content_vector is already a tsvector, just build the index on it. to_tsvector doesnt take a tsvector as it's second argument, not would it make sense to.</p>
Creating GIN index throws "function does not exist" error
postgresql|indexing|full-text-search
0
58
1
72,846,229
72,846,229
2
true
2022-07-03T11:26:48.020Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating GIN index throws "function does not exist" error<p>My table has the following columns:</p> <ul> <li>content_vector tsvector</li> <li>lang VARCHAR(50...
72,868,310
Angular 11 - Call parent function from child<p>I have used the passing of values ​​between Angular components several times correctly (Input/Output), but I found the following particular situation and I cannot find the solution:</p> <p>I have two components:</p> <ol> <li>home.component (parent component)</li> </ol> <p...
<p>It seems that child component (or grandchild component) is contained in a child route.</p> <p>In this case, one solution could be to use a shared service to send notification from child component to parent. (or any other component inside application).</p> <p>To do that, we need an injectable service (or integrated i...
Angular 11 - Call parent function from child
angular|typescript
0
58
1
72,869,245
72,869,245
2
true
2022-07-05T11:01:02.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular 11 - Call parent function from child<p>I have used the passing of values ​​between Angular components several times correctly (Input/Output), but I f...
72,870,706
SUM with Windows Function BIGQUERY<p>I want to know the number of goals scored away and at home for each team in each season</p> <pre><code>season |home_goal |away_goal |team_home |team_away| ----------------------------------------------------- 1 | 1 |0 |France |Spain | 1 | 1 ...
<p>Use below approach</p> <pre><code>select * from ( select season, 'home' location, team_home as team, home_goal as goal from your_table union all select season, 'away' location, team_away as team, away_goal as goal from your_table ) pivot (sum(goal) for location in ('home', 'away')) </code></...
SUM with Windows Function BIGQUERY
google-bigquery
1
58
1
72,871,574
72,871,574
2
true
2022-07-05T13:58:23.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SUM with Windows Function BIGQUERY<p>I want to know the number of goals scored away and at home for each team in each season</p> <pre><code>season |home_goa...
72,877,593
Why do I have to put an integer twice for my Scanner input to work?<p>I'm trying to make a simple program where you can put integers in, and it will tell you if it increased or decreased from the previous integer input. But when I run the code, I have to put an integer value twice, but I only want it put once.</p> <p>T...
<p>The loop behavior you are describing is:</p> <ul> <li>read a numeric input value</li> <li>do something with it (print a message)</li> <li>if the loop value meets a condition (input is 0 or less), exit the loop</li> <li>otherwise, repeat</li> </ul> <p>Here's a &quot;do-while&quot; loop that reads like those steps abo...
Why do I have to put an integer twice for my Scanner input to work?
java|java.util.scanner
1
58
3
72,877,659
72,877,659
2
true
2022-07-06T03:17:15.723Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do I have to put an integer twice for my Scanner input to work?<p>I'm trying to make a simple program where you can put integers in, and it will tell you...
72,880,329
Different aesthetic scales for different types of edges on same graph<p>I am trying to visualize some networks using the ggraph package. My network has two different types of edges, A and B, which have different scales. I'd like to color the edges by type (which I've done) and also modulate their opacity by the value. ...
<p>It would probably be better just to rescale the values yourself before plotting. You can scale the values to a 0-1 scale within each group</p> <pre><code>edges &lt;- edges %&gt;% group_by(type) %&gt;% mutate(value = scales::rescale(value)) </code></pre>
Different aesthetic scales for different types of edges on same graph
r|ggraph
3
58
1
72,884,052
72,884,052
2
true
2022-07-06T08:38:50.340Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Different aesthetic scales for different types of edges on same graph<p>I am trying to visualize some networks using the ggraph package. My network has two d...
72,897,394
Reflection with Delegates<p>I'm using reflection to compare two list of objects(of same type) and collecting the list of properties which have different values. I may iterate through lots of object list to compare which ended in performance lag. I came to know about using delegates in the reflection so we can bypass th...
<p>You can cache the getter delegates in a static field, by putting your code into a generic class.</p> <p>You can then cache the properties themselves using a two-level class hierarchy using some more generics.</p> <pre class="lang-cs prettyprint-override"><code>public List&lt;string&gt; Compare&lt;T&gt;(T A, T B) { ...
Reflection with Delegates
c#|reflection|delegates
0
58
1
72,899,810
72,899,810
2
true
2022-07-07T11:55:13.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reflection with Delegates<p>I'm using reflection to compare two list of objects(of same type) and collecting the list of properties which have different valu...
72,908,368
How can i create with fastest method 250.000.000.000 rows data<p>Helllo all,</p> <p>I wanted to create on azure cosmosdb items which one has location coordinates. Yesterday i created a method on API below:</p> <pre><code> [HttpGet(&quot;createzone&quot;)] public async Task&lt;ActionResult&lt;string&gt;&gt; Create...
<p>It does not look like you have implemented this using <a href="https://docs.microsoft.com/en-us/azure/cosmos-db/sql/tutorial-sql-api-dotnet-bulk-import" rel="nofollow noreferrer">bulk import pattern</a> with Cosmos DB. There's a lot to gain using that. While doing this, also monitor the used RUs when you execute and...
How can i create with fastest method 250.000.000.000 rows data
azure|azure-web-app-service|azure-cosmosdb
-1
58
1
72,909,390
72,909,390
2
true
2022-07-08T07:58:32.680Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i create with fastest method 250.000.000.000 rows data<p>Helllo all,</p> <p>I wanted to create on azure cosmosdb items which one has location coordin...
72,912,599
Looping over array of string using huge amounts of memory? (in C)<p>I use a program written in C (not mine) which simulates the chemistry in environments in space. The program is large and complex, but I want to make one very small amendment...</p> <p>I would like to create an array of 122 different molecules (<code>sp...
<p>You're not freeing <code>abundance</code> correctly; that's why you're seeing a huge memory use.</p> <p>Based on the declaration of <code>abundance</code> and the <code>abundance[i_x][i_y]</code> expression, it's clear that <code>get_abu</code> allocates a 2D structure that looks something like this:</p> <pre><code>...
Looping over array of string using huge amounts of memory? (in C)
arrays|c|loops|memory|memory-management
0
58
1
72,913,362
72,913,362
2
true
2022-07-08T14:04:06.067Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Looping over array of string using huge amounts of memory? (in C)<p>I use a program written in C (not mine) which simulates the chemistry in environments in ...
72,915,068
Operations with aggregate functions - SQL Server<p>I don't get how to make a subquery with aggregate functions, about how to handle the aggregate functions and use it with others.</p> <p>This is my code</p> <pre><code>SET DATEFORMAT DMY; GO SELECT NumeroD AS 'Bill ' , Descrip1 AS 'Product Description' ,...
<p>Firstly, to repeat a lot of my comments.</p> <p>Don't use literal strings for aliases; this is a bad habit and it doesn't work as people think. Take the query <code>SELECT [name] AS 'DatabaseName' FROM sys.databases ORDER BY 'DatabaseName';</code> This does <em>not</em> <code>ORDER BY</code> the column aliased as <c...
Operations with aggregate functions - SQL Server
sql|sql-server|database
0
58
2
72,915,410
72,915,410
2
true
2022-07-08T17:38:32.460Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Operations with aggregate functions - SQL Server<p>I don't get how to make a subquery with aggregate functions, about how to handle the aggregate functions a...
72,916,910
Do I need to worry about Stripe "payment_intent_client_secret"s leaking?<p>I've been testing a Stipe implementation against their <a href="https://stripe.com/docs/testing#use-test-cards" rel="nofollow noreferrer">test cards</a>. All of them perform as expected, but the first 3 3DS Required cards (as opposed to 3DS2) th...
<p>As you rightly identified, most of these errors are due to loading the outdated 3DSv1 content into the modal presented to the user. As you noticed the 3DS2 implementation does not experience these errors.</p> <p>Those URLs with the <code>http://localhost:3000/</code> and the parameters look to be how you are configu...
Do I need to worry about Stripe "payment_intent_client_secret"s leaking?
security|stripe-payments|access-control
1
58
1
72,917,646
72,917,646
2
true
2022-07-08T20:55:34.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Do I need to worry about Stripe "payment_intent_client_secret"s leaking?<p>I've been testing a Stipe implementation against their <a href="https://stripe.com...
72,917,672
type 'X' is not a direct type of 'Y' - but with std::conditional<p>I have a Base class, two classes inheriting from that base class (they are slightly different from each other) and a Last class which can either inherit from <code>Derived1</code> or <code>Derived2</code> based on a template. I use <code>std::conditiona...
<p>In your declaration of the base class:</p> <pre><code>template&lt; class T, class ...Args &gt; class Last&lt; T(Args...) &gt; : public std::conditional&lt; std::is_void&lt;T&gt;::value, Derived1&lt; void(Args...) &gt;, Derived2&lt; T(Args...) &gt; &gt; { ... } </code></pre> <p>You either need to say <cod...
type 'X' is not a direct type of 'Y' - but with std::conditional
c++|templates|inheritance|metaprogramming|conditional-compilation
1
58
1
72,919,189
72,919,189
2
true
2022-07-08T22:45:11.287Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: type 'X' is not a direct type of 'Y' - but with std::conditional<p>I have a Base class, two classes inheriting from that base class (they are slightly differ...
72,926,254
Avoid Division by Zero in Sigmoid function<p>With : <a href="https://nbviewer.org/github/ImadDabbura/blog-posts/blob/master/notebooks/Coding-Neural-Network-Forwad-Back-Propagation.ipynb" rel="nofollow noreferrer">https://nbviewer.org/github/ImadDabbura/blog-posts/blob/master/notebooks/Coding-Neural-Network-Forwad-Back-...
<blockquote> <p>I wonder how is division by zero avoided in the sigmoid function.</p> </blockquote> <p>For <code>1 + exp(-Z)</code> to be zero, <code>exp(-Z)</code> would need to be <code>-1</code> which won't happen because <code>exp</code> is always positive for all real numbers. <code>Z</code> is a real number in th...
Avoid Division by Zero in Sigmoid function
python|deep-learning
0
58
1
72,926,407
72,926,407
2
true
2022-07-10T05:03:52.117Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Avoid Division by Zero in Sigmoid function<p>With : <a href="https://nbviewer.org/github/ImadDabbura/blog-posts/blob/master/notebooks/Coding-Neural-Network-F...
72,928,090
Convert SQL Query to MongoDB syntax<p>I have a big problem with converting SQL queries to Mongo DB for Python. I have a question if you know better methods for transferring SQL queries to Mongo DB queries?</p> <p>I have two queries but I still have big problems with the syntax conversion to Mongo DB.<br /> Maybe there ...
<p>I personally do not know of any good converters, It's just easier to understand each query and translate it on your own, especially as the queries you posted here are not too complex.</p> <hr /> <p>Query 1:</p> <pre><code>{ id: &quot;KVV&quot;, areo: &quot;RSSO&quot;, sto: {$nin: [&quot;AMA&quot;, &quot;...
Convert SQL Query to MongoDB syntax
python|sql|mongodb
0
58
1
72,928,351
72,928,351
2
true
2022-07-10T11:19:23.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert SQL Query to MongoDB syntax<p>I have a big problem with converting SQL queries to Mongo DB for Python. I have a question if you know better methods f...
72,948,112
`concurrent.futures.ProcessPoolExecutor` on Python is ran from beginning of file instead of the defined function<p>I have a trouble with <code>concurrent.futures</code>. For the short background, I was trying to do a massive image manipulation with <code>python-opencv2</code>. I stumbled upon performance issue, which i...
<p>Yes, multiprocessing must load the file in the new processes before it can run the function (just as it does when you run the file yourself), so it runs all code you have written. So, either (1) move your multiprocessing code to a separate file with nothing extra in it and call that, or (2) enclose your top level co...
`concurrent.futures.ProcessPoolExecutor` on Python is ran from beginning of file instead of the defined function
python|python-3.x|concurrent.futures
0
58
1
72,950,756
72,950,756
2
true
2022-07-12T06:49:50.017Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: `concurrent.futures.ProcessPoolExecutor` on Python is ran from beginning of file instead of the defined function<p>I have a trouble with <code>concurrent.fut...
72,956,173
mutate in R dplyr using column indexes as opposed to column names<p>I have the following dataframe in R. I have created a new column called 'Average' which takes the mean of the first three columns in my dataframe, but I would like to do it using column indexes (e.g column 2,3,4) as opposed to the column name. Is there...
<p>We may need <code>rowMeans</code></p> <pre><code>library(dplyr) data &lt;- data %&gt;% mutate(Average = rowMeans(across(`2021-11-30`:`2022-01-31`), na.rm = TRUE), .after = 4) </code></pre> <p>-output</p> <pre><code>data # A tibble: 3 × 8 Model `2021-11-30` `2021-12-31` `2022-01-31` Aver...
mutate in R dplyr using column indexes as opposed to column names
r|dplyr|tidyverse
3
58
1
72,956,188
72,956,188
2
true
2022-07-12T17:23:44.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mutate in R dplyr using column indexes as opposed to column names<p>I have the following dataframe in R. I have created a new column called 'Average' which t...
72,970,975
What testing approach should I use?<p>I am testing a very complex quoting tool where I need to test discount margin price and discount price. Lets say price in catalog is 100$ And a partner is getting 25% discount, then partner price is 75$</p> <p>Should I test like this -&gt; <code>cy.get(partnerPriceField)/should('ha...
<p><code>cy.get(partnerPriceField).should('have.value', 75)</code> is preferred for e2e tests.</p> <p>The job of <em><strong>testing the calculation</strong></em> falls to <strong>unit tests</strong>, which are close to the source code so test can be changed if/when the src calculation changes.</p> <p>The job of e2e te...
What testing approach should I use?
javascript|testing|cypress|end-to-end
3
58
3
72,972,224
72,972,224
2
true
2022-07-13T18:24:53.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What testing approach should I use?<p>I am testing a very complex quoting tool where I need to test discount margin price and discount price. Lets say price ...
72,974,883
How to swap pairs of bits of unsigned int in C<p>This is the code I have so far? But its not working..</p> <pre><code>uint64_t bit_swap(uint64_t value) { return ((value &amp; 0xAAAAAAAA) &gt;&gt; 1) | ((value &amp; 0x55555555) &lt;&lt; 1); } </code></pre> <p>bit_swap(0x1111111111111111) should return...
<pre><code>value &amp; 0xAAAAAAAA </code></pre> <p>That is equivalent to : <code>value &amp; 0x00000000AAAAAAAA</code></p> <p>And since we know that anything anded with 0 will give 0 hence the top 32 bits will always be 0. Change to:</p> <pre><code>return ((value &amp; 0xAAAAAAAAAAAAAAAA) &gt;&gt; 1) | ((value ...
How to swap pairs of bits of unsigned int in C
c|binary|bit-manipulation|bitwise-operators
0
58
1
72,974,980
72,974,980
2
true
2022-07-14T03:30:50.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to swap pairs of bits of unsigned int in C<p>This is the code I have so far? But its not working..</p> <pre><code>uint64_t bit_swap(uint64_t value) { ...
72,981,879
Print dictionary to sheet<p>I have the below code that prints the dictionary to the watch window but how can I get this exact same format printed to a sheet?</p> <pre><code> Dim key As Variant For Each key In dict Set group = dict(key) With group Debug.Print .name, .rate, .volume End With Nex...
<p>One option is to create an array and then dumpy the array to the sheet:</p> <pre><code>Dim arr As Variant ReDim arr(1 To dict.Count, 1 To 3) Dim i As Long For i = LBound(dict.Items) To UBound(dict.Items) arr(i + 1, 1) = dict.Items(i).name arr(i + 1, 2) = dict.Items(i).rate arr(i + 1, 3) = dict.Items(i)....
Print dictionary to sheet
excel|vba
4
58
2
72,982,205
72,982,205
2
true
2022-07-14T14:06:35.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Print dictionary to sheet<p>I have the below code that prints the dictionary to the watch window but how can I get this exact same format printed to a sheet?...
72,994,140
Iterate Over Circular Area Of Hexagonal Grid?<p>I am currently working with a hexagonal grid of cells which are indexed like this:</p> <p><a href="https://docs.unity3d.com/uploads/Main/hex-tilemap-pointtop-offset.png" rel="nofollow noreferrer"><img src="https://docs.unity3d.com/uploads/Main/hex-tilemap-pointtop-offset....
<p><a href="https://i.stack.imgur.com/cnTPR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cnTPR.png" alt="enter image description here" /></a></p> <h2>The basic idea:</h2> <p>Let's scan each row of the hexagon left-to-right.</p> <h2>How to do it:</h2> <p>Let <strong>R</strong> be the &quot;cell rad...
Iterate Over Circular Area Of Hexagonal Grid?
algorithm
1
58
2
72,997,706
72,997,706
2
true
2022-07-15T12:39:44.767Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Iterate Over Circular Area Of Hexagonal Grid?<p>I am currently working with a hexagonal grid of cells which are indexed like this:</p> <p><a href="https://do...
73,001,133
Complete Server Lockdown Command Discord.py<p>I am trying to make a command which locks the whole server in discord.py but when I use the command, it just locks the channel which I used it in. Please help me if you can, Here is my current code.</p> <pre><code>@client.command() @commands.has_permissions(manage_channels=...
<p>You should be able to loop through each channel in the guild can lock each channel individually. Looking at the documentation, there doesn't seem to be a method for locking down the entire server.</p> <pre class="lang-py prettyprint-override"><code>@client.command() @commands.has_permissions(manage_channels=True) as...
Complete Server Lockdown Command Discord.py
python|discord|discord.py|bots
-1
58
1
73,001,170
73,001,170
2
true
2022-07-16T02:30:32.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Complete Server Lockdown Command Discord.py<p>I am trying to make a command which locks the whole server in discord.py but when I use the command, it just lo...
72,862,296
Exposing Resources using Tomcat Server<p>After debugging for a few hours, I am seeking help to set up a REST API using Jersey in Java. I am using a Tomcat 6 server and the following is my file structure of the Mavin project:</p> <p><a href="https://i.stack.imgur.com/bmz7h.png" rel="nofollow noreferrer"><img src="https:...
<p>You can't select this project because Tomcat 6 does not support <a href="https://en.m.wikipedia.org/wiki/Jakarta_Servlet" rel="nofollow noreferrer">Servlet</a> 4.0 projects. <a href="https://jakarta.ee/specifications/servlet/4.0/" rel="nofollow noreferrer">Servlet 4.0</a> requires Tomcat 9.x, which itself requires <...
Exposing Resources using Tomcat Server
java|eclipse|rest|maven|jersey
0
58
1
72,863,185
72,863,185
2
true
2022-07-04T21:48:46.957Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Exposing Resources using Tomcat Server<p>After debugging for a few hours, I am seeking help to set up a REST API using Jersey in Java. I am using a Tomcat 6 ...
72,906,033
How to format date to mm/dd/yyyy in moment / date-fns?<p>Here I am receiving the last updated data as an API response like this</p> <pre><code>let data = { &quot;year&quot;: 2021, &quot;monthValue&quot;: 11, &quot;dayOfMonth&quot;: 9 } </code></pre> <p>I have to covert this above ...
<p>You don't need a library just to zero-<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart" rel="nofollow noreferrer">pad</a> a 1–2 digit number:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snipp...
How to format date to mm/dd/yyyy in moment / date-fns?
javascript|momentjs|date-fns
0
58
1
72,906,095
72,906,095
2
true
2022-07-08T02:21:11.677Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to format date to mm/dd/yyyy in moment / date-fns?<p>Here I am receiving the last updated data as an API response like this</p> <pre><code>let data = { ...
72,840,629
OR and index creation<p>I use SQL Azure and try to create nonclustered index</p> <pre><code>CREATE NONCLUSTERED INDEX IX_SyncNotNull ON MyTable (IMEI, Sync1, Sync2, FieldA, FieldB, FieldC) WHERE (Sync1 = 1 OR Sync2 = 1); </code></pre> <p>But I get an error:</p> <blockquote> <p>Incorrect syntax near the key...
<p>Such expressions are <a href="https://docs.microsoft.com/en-us/sql/t-sql/statements/create-index-transact-sql?view=sql-server-ver16#syntax" rel="nofollow noreferrer">disallowed by the syntax</a> for filtered index.</p> <p>You could instead create an indexed view, which will behave much like a filtered index, althoug...
OR and index creation
sql|tsql|indexing
2
58
1
72,843,520
72,843,520
2
true
2022-07-02T16:19:13.817Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OR and index creation<p>I use SQL Azure and try to create nonclustered index</p> <pre><code>CREATE NONCLUSTERED INDEX IX_SyncNotNull ON MyTable (IMEI, ...
72,927,683
Is there a more efficient way to calculate percentage when I got two condictions under GROUP BY?<p>I got a field &quot;type&quot; which is either &quot;member&quot; or &quot;casual&quot;. I got another categorical field called &quot;duration_type&quot;.</p> <p>And I want to calculate the percentage of each categories ...
<p>You should <code>group by type, duration_type</code> and use <code>SUM()</code> window function to get the total number of rows for each <code>type</code>:</p> <pre><code>SELECT type, duration_type, CONCAT(ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER (PARTITION BY type), 2), '%') AS per FROM temp GROUP BY type...
Is there a more efficient way to calculate percentage when I got two condictions under GROUP BY?
mysql|sql|group-by|count|window-functions
1
58
1
72,928,024
72,928,024
2
true
2022-07-10T10:06:50.037Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a more efficient way to calculate percentage when I got two condictions under GROUP BY?<p>I got a field &quot;type&quot; which is either &quot;membe...
73,018,062
Conv1D for classify non-image dataset show error ValueError : `logits` and `labels` must have the same shape<p>I found <a href="https://dergipark.org.tr/en/download/article-file/2050893" rel="nofollow noreferrer">this paper</a> they present Convolutional Neural Network can get the best accuracy for non-image classify. ...
<p>You can use <a href="https://www.tensorflow.org/api_docs/python/tf/keras/layers/Flatten" rel="nofollow noreferrer"><code>tf.keras.layers.Flatten()</code></a>. Something like below can solve youe problem.</p> <pre><code>from sklearn.model_selection import train_test_split import tensorflow as tf import numpy as np ...
Conv1D for classify non-image dataset show error ValueError : `logits` and `labels` must have the same shape
python|tensorflow|keras|conv-neural-network
2
58
1
73,018,155
73,018,155
2
true
2022-07-18T06:24:53.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Conv1D for classify non-image dataset show error ValueError : `logits` and `labels` must have the same shape<p>I found <a href="https://dergipark.org.tr/en/d...
72,774,677
prevent access to page on small screen<p>I'm making small web pages for fun and hosting them on my server just to learn stuff and sometimes i send them to some people i know to show them what i've learn but i'd like it so that my web pages aren't accesible to people on small screen. i tried doing</p> <pre class="lang-h...
<p>Try this:</p> <pre class="lang-css prettyprint-override"><code>@media (max-width: 800px) { html { visibility: hidden; } } </code></pre>
prevent access to page on small screen
javascript|html|css
0
58
3
72,774,749
72,774,749
2
true
2022-06-27T15:29:35.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: prevent access to page on small screen<p>I'm making small web pages for fun and hosting them on my server just to learn stuff and sometimes i send them to so...
72,806,599
Can't use variable "ok" in "Togg"<p>I'm trying to make it so that when a button is clicked, the user presses any key and this is written to tog1. But I get that ok = null. I don't understand why &quot;ok&quot; which is a string only works inside &quot;nativeKeyReleased&quot;. Already tried to use tog1.setText inside &q...
<p>Your code doesn't work, because you are passing a new instance of <code>HelloController</code> to <code>GlobalScreen.addNativeKeyListener(...);</code>. This means <code>nativeKeyReleased()</code> is being called on one instance of <code>HelloController</code> (the one you create), but <code>togg()</code> (I have cha...
Can't use variable "ok" in "Togg"
java|javafx|jnativehook
0
58
1
72,808,195
72,808,195
2
true
2022-06-29T19:05:13.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't use variable "ok" in "Togg"<p>I'm trying to make it so that when a button is clicked, the user presses any key and this is written to tog1. But I get t...
72,785,581
How can I create several arrays on each of the values of other array of objects?<p>So currently I have this array structure:</p> <pre><code>const object = { object1: [&quot;01&quot;, &quot;02&quot;], object2: [&quot;item1&quot;, &quot;item2&quot;, &quot;item3&quot;], object3: [&quot;product1&quot;, &quot;product2...
<p>I'd suggest creating a generic solution that will iterate over the possible properties and values of the template <code>object</code> and create an array of all possible outcomes.</p> <p>We'd create a <code>addPossibleValues()</code> function than will expand the array of objects for each key in the template object....
How can I create several arrays on each of the values of other array of objects?
javascript|arrays|object|javascript-objects
3
58
3
72,785,937
72,785,937
2
true
2022-06-28T11:26:34.410Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I create several arrays on each of the values of other array of objects?<p>So currently I have this array structure:</p> <pre><code>const object = { ...
72,817,287
Test async communication in the microservices environment<p>I have an application with RabbitMQ that makes each Rest flow asynchronous and I’m struggling with creating tests for that</p> <p>How can I create tests for microservices backend applications that rely on async communication? Is there any tool for that?</p> <p...
<p>This is a real pain. Asynchronous communication makes testing microservices environments much harder, there is no accessibility to the status codes and exceptions. “layers” to applications like that make it harder to create tests.</p> <p>You have a few options if you want to create tests:</p> <p><strong>1. Log-based...
Test async communication in the microservices environment
testing|monitoring|open-telemetry
0
58
1
72,817,991
72,817,991
2
true
2022-06-30T14:09:14.813Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Test async communication in the microservices environment<p>I have an application with RabbitMQ that makes each Rest flow asynchronous and I’m struggling wit...
72,840,360
Google Sheets Query with mixed data - data starting with a letter not appearing in Query<p>I originally asked this here but my formula has now adapted and now require assistance again - <a href="https://stackoverflow.com/questions/72242820/google-sheets-query-using-dependent-dropdown">Google Sheets Query using dependen...
<p>try:</p> <pre><code>=ARRAYFORMULA(QUERY({Haulage!A3:A, TO_TEXT(Haulage!B3:U)}, &quot;where Col1 &gt;= date '&quot;&amp;TEXT(Stats!C1, &quot;yyyy-mm-dd&quot;)&amp;&quot;' and Col1 &lt;= date '&quot;&amp;TEXT(Stats!C2, &quot;yyyy-mm-dd&quot;)&amp;&quot;'&quot;&amp; IF(Stats!K1=&quot;All TOCs&quot;,, &quot; an...
Google Sheets Query with mixed data - data starting with a letter not appearing in Query
google-sheets|google-sheets-formula|google-query-language
0
58
1
72,841,701
72,841,701
2
true
2022-07-02T15:41:50.867Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Sheets Query with mixed data - data starting with a letter not appearing in Query<p>I originally asked this here but my formula has now adapted and no...
72,901,911
How to find an element with respect to its parent element with Selenium and Python<p>I am trying to scrape a website, but I need to search for an element whose parent is like this:</p> <pre><code>//div[@title=&quot;parent&quot;] </code></pre> <p>People are talking about getting an element from its child. Is there a way...
<p>You can try to use</p> <pre><code>//div[parent::div[@title=&quot;parent&quot;]] </code></pre> <p>or simply</p> <pre><code>//div[@title=&quot;parent&quot;]/div </code></pre> <p>In Python code you can also use</p> <pre><code>parent = driver.find_element(By.XPATH, '//div[@title=&quot;parent&quot;]') child = parent.find...
How to find an element with respect to its parent element with Selenium and Python
python|selenium|selenium-webdriver|xpath|css-selectors
2
58
2
72,901,962
72,901,962
2
true
2022-07-07T17:16:07.683Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find an element with respect to its parent element with Selenium and Python<p>I am trying to scrape a website, but I need to search for an element who...
72,931,024
Why += works when inserting string in vector<string> and then pushing in 2d string vector, but doesn't work when inserting char by char?<p>I was creating a vector of strings of size 4x4 with all characters as dots i.e. I was creating:</p> <pre><code>.... .... .... .... </code></pre> <p>And then I had to push this vecto...
<p>This code:</p> <pre><code>int n=4; vector&lt;string&gt; matrix(n); </code></pre> <p>Will create a vector filled with <code>n</code> default-constructed strings; i.e. a vector with 4 empty strings. So, in the following loop, you're accessing each string with an out-of-bound index (which is <em>undefined behavior</em>...
Why += works when inserting string in vector<string> and then pushing in 2d string vector, but doesn't work when inserting char by char?
c++|string|vector
0
58
2
72,931,130
72,931,130
2
true
2022-07-10T18:45:41.867Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why += works when inserting string in vector<string> and then pushing in 2d string vector, but doesn't work when inserting char by char?<p>I was creating a v...
72,991,359
Asterisk extension, conditional execution?<p>I have an this extension in file /etc/asterisk/extensions_custom.conf:</p> <pre><code> exten =&gt; _XXXX,1,NoOp(&quot;-- from internal custom --&quot;) exten =&gt; _XXXX,n,Set(CURL_RESULT=${CURL(https://your.domain.com/sip_webhook?callid=${EXTEN}&amp;sourceid=${CALLER...
<p>Yes, as arheops indicated, this is actually a common built-in concept in the dialplan: conditional executing and conditional branching.</p> <p>There are a lot of ways you could this - to give you some ideas:</p> <p>#1: Conditional execute if true</p> <pre><code>exten =&gt; _XXXX,1,ExecIf($[&quot;${CURL_RESULT}&quot;...
Asterisk extension, conditional execution?
asterisk
-1
58
1
73,197,635
73,197,635
2
true
2022-07-15T08:44:14.430Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Asterisk extension, conditional execution?<p>I have an this extension in file /etc/asterisk/extensions_custom.conf:</p> <pre><code> exten =&gt; _XXXX,1,No...
72,836,163
Passing a string as a prop and using it to make a class name in Svelte<p>I have this BigButton component where I want to pass a bgColor prop :</p> <pre class="lang-js prettyprint-override"><code>&lt;BigButton title=&quot;Join a Game&quot; description=&quot;Lorem ipsum dolor sit amet consectetur adipisic...
<p>You are using Tailwind, this relies heavily on post-processing of the code. My guess would be that if you do not include the full class name, the corresponding CSS will not be included in the output, because including every possible Tailwind class would create a massive file.</p> <p>If you know what classes will be ...
Passing a string as a prop and using it to make a class name in Svelte
javascript|tailwind-css|svelte
1
58
1
72,837,119
72,837,119
2
true
2022-07-02T03:01:02.953Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing a string as a prop and using it to make a class name in Svelte<p>I have this BigButton component where I want to pass a bgColor prop :</p> <pre class...
72,888,606
Query with join from answer table and post and user 2 column with the same name<p>I retrieve from the query the username of the person who post and the person who answer username but 2 tables return a column of the username of people who post and who answer but l want to make difference between username column of the p...
<p>The problem is that you are using the * to specify the output columns -- you just need to use the AS keyword to specify the output column name so something like this:</p> <pre><code>SELECT post.*, answer.*, user.username as post_username, useranswer.username as answer_username FROM [Post] JOIN [User] ...
Query with join from answer table and post and user 2 column with the same name
sql|sql-server
1
58
1
72,888,728
72,888,728
2
true
2022-07-06T18:55:22.030Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Query with join from answer table and post and user 2 column with the same name<p>I retrieve from the query the username of the person who post and the perso...
72,924,037
How to arrange on a grid conemu new consoles<p>I've read the <a href="https://conemu.github.io/en/NewConsole.html#syntax" rel="nofollow noreferrer">docs</a> about conemu regarding the switch <code>-new_console</code> but I find the syntax pretty confusing and I'm not sure how to create the exact grid layouts I want to....
<p>The best way I think is to create a new task in the settings and importing there the current tabs.<br /> And yes, the desired geometry is possible. You can create it easily, but it's not so intuitive in the beginning.<br /> To do it you've to right-click on a tab and then you can see this menu:</p> <p><a href="https...
How to arrange on a grid conemu new consoles
conemu
1
58
1
72,967,691
72,967,691
2
true
2022-07-09T19:21:55.477Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to arrange on a grid conemu new consoles<p>I've read the <a href="https://conemu.github.io/en/NewConsole.html#syntax" rel="nofollow noreferrer">docs</a> ...
72,886,797
How do I ensure that dask doesn't read unnecessary files from disk when querying a partitioned dataframe?<p>For example, say I have a parquet dataset in a directory tree, hive-style:</p> <pre><code>dataset/field1=A/field2=X/data.parquet dataset/field1=A/field2=Y/data.parquet dataset/field1=B/field2=X/data.parquet datas...
<p>This functionality is supported by <code>pyarrow</code> when using filters at read time (not as <code>.query</code> method):</p> <pre class="lang-py prettyprint-override"><code>from dask.dataframe import read_parquet from dask.datasets import timeseries df = timeseries(end=&quot;2000-01-03&quot;, seed=0).reset_inde...
How do I ensure that dask doesn't read unnecessary files from disk when querying a partitioned dataframe?
python|pandas|dask|pyarrow|dask-dataframe
1
58
1
72,892,141
72,892,141
2
true
2022-07-06T16:10:49.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I ensure that dask doesn't read unnecessary files from disk when querying a partitioned dataframe?<p>For example, say I have a parquet dataset in a di...
72,982,911
Retrieve gitlab pipeline docker image to debug job<p>I've got a build script that is running in Gitlab and generates some files that are used later in the build process.</p> <p>The reason is Gitlab pipeline fails and the failure is not reproduced locally. Is there a way to troubleshoot the failure?</p> <p>As far as I k...
<p>When the job container exits, it is removed automatically, so this would not be feasible to do.</p> <p>However, you might have a few other options to debug your job:</p> <h2>Interactive web session</h2> <p>If you are using self-hosted runners, the best way to do this would probably be with a <a href="https://docs.gi...
Retrieve gitlab pipeline docker image to debug job
docker|gitlab|gitlab-ci|gitlab-ci-runner
0
58
1
72,985,083
72,985,083
2
true
2022-07-14T15:18:47.907Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Retrieve gitlab pipeline docker image to debug job<p>I've got a build script that is running in Gitlab and generates some files that are used later in the bu...
72,826,011
Reference JS class instance from DOM element<p>It's easy to access DOM elements from JavaScript (<a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById" rel="nofollow noreferrer"><code>document.getElementById()</code></a>, <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/cre...
<p>Yes, since DOM elements are JS objects, you can just add any property you want, as you demonstrated in your snippet. This works, and is used by some libraries that wrap DOM elements or need to store non-string data on the elements (for string data, the <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLEl...
Reference JS class instance from DOM element
javascript|dom
0
58
2
72,826,241
72,826,241
2
true
2022-07-01T07:48:53.213Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reference JS class instance from DOM element<p>It's easy to access DOM elements from JavaScript (<a href="https://developer.mozilla.org/en-US/docs/Web/API/Do...