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,171,372 | Can you return a function in flask as well as return render_template?<p>When you are within an @app.route in Flask, can you return a value for your function in addition to returning render_template?</p> | <p>No, it's not possible to do so directly - return value of function decorated with <code>@app.route</code> is automatically passed back by Flask as a page to the client (render_template return value is actually a HTML string representing the page), and the control flow is such that you can't simply "pass" a... | Can you return a function in flask as well as return render_template? | python|flask | -1 | 95 | 1 | 72,171,484 | 72,171,484 | 0 | true | 2022-05-09T11:38:37.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can you return a function in flask as well as return render_template?<p>When you are within an @app.route in Flask, can you return a value for your function ... |
72,171,326 | How can I wait for an item sent to a queue to complete?<p>I have a priority queue that I send values to. These values are then aggregated onto another value. However, I want to wait until that value is processed.</p>
<p>Here's some pseudocode to demonstrate the problem:</p>
<pre><code>let heap = BinaryQueue::new();
... | <p>The solution wasn't to use any fancy future stuff, but to use Notify.</p>
<pre class="lang-rust prettyprint-override"><code>use tokio::sync::Notify;
#[derive(Debug, Clone)]
struct Task {
value: i64,
completed: Arc<Notify>
}
impl Task {
fn new(v: i64) -> Self {
Task { value: v, complete... | How can I wait for an item sent to a queue to complete? | rust | -1 | 114 | 1 | 72,173,479 | 72,173,479 | 0 | true | 2022-05-09T11:34:39.330Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I wait for an item sent to a queue to complete?<p>I have a priority queue that I send values to. These values are then aggregated onto another value... |
72,173,266 | While loop with sed<p>I have the following code but it doesnt work when i execute the code, the file th2.csv its empty.
The function of the sed is replace two words. I dont know how to make the script work correctly.
<em>It must be done with the <strong>while</strong></em>.</p>
<pre><code>bash th1.csv > th2.csv
</co... | <p>Given the requirements that you must loop and apply regex, line by line, then consider:</p>
<pre><code>#!/bin/bash
while read -r line; do
echo "$line" | sed -E "s/,True,/,ll,/g;s/,False,/,th,/" >> th2.csv
done < th1.csv
</code></pre>
<p>This reads, line by line, via a while loop. Each... | While loop with sed | linux|bash|loops|while-loop | -1 | 102 | 1 | 72,173,609 | 72,173,609 | 0 | true | 2022-05-09T14:03:06.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
While loop with sed<p>I have the following code but it doesnt work when i execute the code, the file th2.csv its empty.
The function of the sed is replace tw... |
72,169,520 | Find if a given functional dependency is implied from a set of functional dependencies<p>For : A→BC,CD→E,E→C,D→AEH,ABH→BD,DH→BC</p>
<p>Check : BCD→H</p>
<p>I am not understanding which axiom rule should I apply here to check. Do anyone know how to solve this.</p> | <p>There are two ways of checking if the dependency <code>BCD -> H</code> holds: the first one is by applying the <a href="https://en.wikipedia.org/wiki/Armstrong%27s_axioms" rel="nofollow noreferrer">Armstrong’s axioms</a> and see if we can prove the validity of the dependency. The second one is by computing the cl... | Find if a given functional dependency is implied from a set of functional dependencies | database|functional-dependencies | -1 | 52 | 1 | 72,174,619 | 72,174,619 | 0 | true | 2022-05-09T09:10:47.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find if a given functional dependency is implied from a set of functional dependencies<p>For : A→BC,CD→E,E→C,D→AEH,ABH→BD,DH→BC</p>
<p>Check : BCD→H</p>
<p>I... |
72,173,769 | VS reporting error with every variable of a class<p>I have realized a typical class called "FCB", and VS didn't report any problem while I was coding, and can recognize its members when referred to.
Yet as I try to compile it, it shows that every variable whose type is FCB or FCB* appear to be unrecognizable.... | <p>Like @RichardCritten ’s comment, I wrongly declared POS_POINTER before FCB. Just move it after the class and before the member functions will fix most of the porbl</p> | VS reporting error with every variable of a class | c++|visual-studio | -1 | 64 | 1 | 72,174,691 | 72,174,691 | 0 | true | 2022-05-09T14:36:32.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VS reporting error with every variable of a class<p>I have realized a typical class called "FCB", and VS didn't report any problem while I was codi... |
72,174,819 | warning: ‘dot_prod’ may be used uninitialized in this function [-Wmaybe-uninitialized]<p>I have been tinkering with this code and I cannot seem to make it work. when I run the error file it generates I get the warning</p>
<pre><code>dotp.c:39:11: warning: ‘dot_prod’ may be used uninitialized in this function [-Wmaybe-u... | <p>Change your declaration of dot_prod to:</p>
<pre><code>int dot_prod = 0;
int i;
</code></pre> | warning: ‘dot_prod’ may be used uninitialized in this function [-Wmaybe-uninitialized] | c|linux|openmp | -1 | 26 | 2 | 72,174,877 | 72,174,877 | 0 | true | 2022-05-09T15:52:14.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
warning: ‘dot_prod’ may be used uninitialized in this function [-Wmaybe-uninitialized]<p>I have been tinkering with this code and I cannot seem to make it wo... |
72,174,810 | convert from IIS rewrite to nginx<pre><code><?xml version="1.0" encoding="UTF-8"?>
<rules>
<clear />
<rule name="wfq2020">
<match url="^(auth|platform-admin|product|substation-admin)/(.*)" />
<action... | <p>I'm not super familiar with IIS rewrite, but I have checked <a href="https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module" rel="nofollow noreferrer">their doc</a> and it seems pretty close to NGINX.</p>
<p>On NGINX, is recommended to use <code>return</c... | convert from IIS rewrite to nginx | linux|nginx|iis | -1 | 44 | 1 | 72,176,032 | 72,176,032 | 0 | true | 2022-05-09T15:51:38.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
convert from IIS rewrite to nginx<pre><code><?xml version="1.0" encoding="UTF-8"?>
<rules>
<clear />
&l... |
72,171,691 | which part of the memory does the result of the expression of the return statements gets stored in?<p>the case is</p>
<pre><code> int func(void){
int A = 10;
int B = 20;
return A+B
}
</code></pre>
<p>which is being called by the main function</p>
<pre><code>int main(void){
int retVal = f... | <blockquote>
<p>in the function func() two local variables will be stored onto the stack for the scope of func() but where does the result of A+B stored?</p>
</blockquote>
<p>Depends on the specific calling convention for the target architecture, usually in a register (such <code>eax</code> on x86).</p>
<blockquote>
<p... | which part of the memory does the result of the expression of the return statements gets stored in? | c|function|return|call-by-value | -1 | 97 | 3 | 72,176,750 | 72,176,750 | 0 | true | 2022-05-09T12:02:28.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
which part of the memory does the result of the expression of the return statements gets stored in?<p>the case is</p>
<pre><code> int func(void){
int... |
72,176,921 | SQL Databases not getting the good result that i want<p><strong>For this problem I need to write a query that returns the name of all male persons that play soccer with a female player. Eliminate duplicates from your result.</strong></p>
<pre><code>select distinct name
FROM Persons, SportTogether S
WHERE Persons.gender... | <p>If I understand the SQL correctly, there should be "()" to make the Persons.gender = "male" work with the later "OR".
Could you try:</p>
<pre><code>select distinct name
FROM Persons, SportTogether S
WHERE Persons.gender = "male"
AND
((Persons.id = S.personA_id AND sport =&qu... | SQL Databases not getting the good result that i want | sql|database | -1 | 38 | 2 | 72,177,020 | 72,177,020 | 0 | true | 2022-05-09T18:53:30.033Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL Databases not getting the good result that i want<p><strong>For this problem I need to write a query that returns the name of all male persons that play ... |
72,143,329 | (ProcessingJS) Pixelating noise<p>As the title states, I want to know how to pixelate noise. I am using the code below to optimize performance:</p>
<pre><code>var totalXoff = 0.0;
var draw = function() {
background(0, 255, 255);
if (!this.loadPixels){ return; }
this.loadPixels();
var pixels=this.... | <p>I figured out how to do it, I simply spaced them out and used <code>rect()</code> instead of editing the pixels to create that "pixelated" effect.</p>
<p>Code:</p>
<pre><code>var totalXoff = 0.0;
var draw = function() {
background(0, 255, 255);
var xoff = 0.0+totalXoff;
for (var x = 0; x <... | (ProcessingJS) Pixelating noise | javascript|processing|processing.js | -1 | 34 | 1 | 72,177,914 | 72,177,914 | 0 | true | 2022-05-06T14:43:30.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
(ProcessingJS) Pixelating noise<p>As the title states, I want to know how to pixelate noise. I am using the code below to optimize performance:</p>
<pre><cod... |
72,177,372 | Error detected while processing ~/.vim/pack/plugins/start/clrzr/autoload/clrzr.vim:<p>I am trying to install a fork of the colorizer plugin. It has minimal requirements, awk being one. But I seem to run in a bunch of errors.</p>
<pre><code>line 31:
E492: Not an editor command: const s:RXFLT = '%(\d*\.)?\d+'
line 34... | <p><code>:help :const</code> was introduced in patch 8.1.1539. If your Vim doesn't recognize it, then it means that it is too old for that plugin.</p>
<p>You can either…</p>
<ul>
<li>use the original version of the plugin, which doesn't seem to be using too many new features,</li>
<li>or make your own backward-compatib... | Error detected while processing ~/.vim/pack/plugins/start/clrzr/autoload/clrzr.vim: | shell|vim | -1 | 36 | 1 | 72,177,921 | 72,177,921 | 0 | true | 2022-05-09T19:35:50.627Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error detected while processing ~/.vim/pack/plugins/start/clrzr/autoload/clrzr.vim:<p>I am trying to install a fork of the colorizer plugin. It has minimal r... |
72,177,802 | Python print the value of specific parameter in the function<p>I only want to return and print the error when the function is called, but it seems that the whole functions are being run when I print the function.</p>
<p>My expected output is only:</p>
<pre><code>false
list index out of range
</code></pre>
<p>but I ... | <p>You're running the function twice, once in the <code>if</code> statement, and then again in the <code>print()</code> statement.</p>
<p>If you only want to run it once, assign the result to a variable.</p>
<pre><code>err = test()
if not err:
print(err)
</code></pre> | Python print the value of specific parameter in the function | python | -1 | 26 | 2 | 72,178,005 | 72,178,005 | 0 | true | 2022-05-09T20:21:57.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python print the value of specific parameter in the function<p>I only want to return and print the error when the function is called, but it seems that the w... |
72,150,570 | Converting base64 to image | Not working | Flutter<p>So, I want to do a simple thing but for some reasons it is not working. I get a base64 string from the server which I need to convert to an image. When I put that retrieved in the websites like <a href="https://base64.guru/converter/decode/image" rel="nofollow norefe... | <p>Well, this got resolved when I wrapped SfPdfViewer.memory(bytes) inside a Container. Though, not sure why it wasn't working without a Container.</p>
<p>The whole solution:</p>
<pre><code>Uint8List bytes = base64.decode(pdf);
return Container(
child: SfPdfViewer.memory(bytes),
);
</code></pre>
<blockquote>
<p>Packa... | Converting base64 to image | Not working | Flutter | flutter|file|dart|base64|flutter-image | -1 | 396 | 2 | 72,178,159 | 72,178,159 | 0 | true | 2022-05-07T07:57:02.650Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Converting base64 to image | Not working | Flutter<p>So, I want to do a simple thing but for some reasons it is not working. I get a base64 string from the s... |
72,177,418 | Looking for simple example to write text into a NSImage using Cocoa<pre><code> NSImage *myNewIconImage=[[NSImage imageNamed:@"FanImage"] copy];
[myNewIconImage lockFocus];
[@"15" drawAtPoint:NSZeroPoint withAttributes:nil];
[myNewIconImage unlockFocus];
[myNewIconImage setTemplat... | <p>The following code will place a mutable attributed string on an NSImage:</p>
<pre><code>NSImageView *imageView = [[NSImageView alloc] initWithFrame:NSMakeRect( 0, 0, _wndW, _wndH )];
[[window contentView] addSubview:imageView];
NSImage *image = [NSImage imageNamed:@"myImage.jpg"];
[image lockFocus];
NSMut... | Looking for simple example to write text into a NSImage using Cocoa | macos|cocoa|nsstring|nsimage | -1 | 36 | 1 | 72,178,262 | 72,178,262 | 0 | true | 2022-05-09T19:41:16.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Looking for simple example to write text into a NSImage using Cocoa<pre><code> NSImage *myNewIconImage=[[NSImage imageNamed:@"FanImage"] copy];
... |
72,177,982 | Convert List Of XML Tags in varchar column to comma separated list<p>I have a table that contains a list of xml tags/values that I need to use to join to another table to retrieve their actual value and display the result as a csv list.</p>
<p>Example varchar data:</p>
<pre><code><choice id="100"/><c... | <p>Without proper sample data it's hard to give an exact query. But you would do something like this</p>
<ul>
<li>Use <code>CROSS APPLY</code> to convert the <code>varchar</code> to <code>xml</code></li>
<li>Use <code>.nodes</code> to shred the XML into separate rows.</li>
<li>Join using <code>.value</code> to get the ... | Convert List Of XML Tags in varchar column to comma separated list | sql|sql-server|xml | -1 | 78 | 1 | 72,178,415 | 72,178,415 | 0 | true | 2022-05-09T20:39:07.087Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert List Of XML Tags in varchar column to comma separated list<p>I have a table that contains a list of xml tags/values that I need to use to join to ano... |
72,178,435 | Check the answer<p>I try to see if the word entered in the form is the correct one. If it is correct then I open another page and otherwise I will get an error message, but I don't know how to make the script for this. Also I don't want to use a submit button.</p>
<pre><code><form id="form">
<inp... | <p>Try this:
In this code I check with the key event, if I press enter I call and ask if the answer is "Hello" is correct and I open another page, otherwise I send an alert with an error</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-co... | Check the answer | javascript|html | -1 | 37 | 2 | 72,178,582 | 72,178,582 | 0 | true | 2022-05-09T21:35:58.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Check the answer<p>I try to see if the word entered in the form is the correct one. If it is correct then I open another page and otherwise I will get an err... |
72,177,657 | aligned arrays of length zero in struct<pre><code>struct net_buf_simple {
/** Pointer to the start of data in the buffer. */
u8_t *data;
/** Length of the data behind the data pointer. */
u16_t len;
/** Amount of data that this buffer can store. */
u16_t size;
u8_t __buf[0] __attribute__ ((a... | <p>There is <em>no</em> unaccounted for space at the front of the <code>struct</code>.</p>
<p>However, even if we remove the <code>aligned</code> on <code>__buf</code>, it still does alignment of the <code>struct</code> length.</p>
<p>Unless, we add <code>__attribute__((packed))</code> to the struct definition.</p>
<hr... | aligned arrays of length zero in struct | arrays|c|struct | -1 | 48 | 1 | 72,178,743 | 72,178,743 | 0 | true | 2022-05-09T20:05:29.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
aligned arrays of length zero in struct<pre><code>struct net_buf_simple {
/** Pointer to the start of data in the buffer. */
u8_t *data;
/** Leng... |
72,178,816 | find main class in java<p>Why java can't find my main?
this is my first java code</p>
<pre><code>package MyPacage;
public class MyClass {
public static void main(string[] args) {
System.out.println("Hello world!");
}
}
</code></pre> | <pre><code>public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
</code></pre> | find main class in java | java|program-entry-point | -1 | 41 | 1 | 72,178,856 | 72,178,856 | 0 | true | 2022-05-09T22:26:37.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
find main class in java<p>Why java can't find my main?
this is my first java code</p>
<pre><code>package MyPacage;
public class MyClass {
public static v... |
72,156,338 | Custom Window with nested Generics produces NullReferencEException without Inner Exception<p>I have created a coupled <code>Window</code> <-> <code>Controller</code> (what I prefer to call my ViewModels) class relationship with the intent of handling a lot of boilerplate code that every window and controller uses... | <p>The issue appears to be generics, I was able to solve this by simply manually adding a "secondary" intermediary base abstract class that concrete type'd the generics. I needed a second generic as well for project needs, but the end result looks like this:</p>
<p>ControlledWindowBase.cs :</p>
<pre><code>pub... | Custom Window with nested Generics produces NullReferencEException without Inner Exception | c#|wpf|.net-core|dependency-injection | -1 | 40 | 1 | 72,179,689 | 72,179,689 | 0 | true | 2022-05-07T21:00:07.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Custom Window with nested Generics produces NullReferencEException without Inner Exception<p>I have created a coupled <code>Window</code> <-> <code>Con... |
72,179,763 | How do I find how much times something appears in a function without the count method?<p>I’m not completely sure how to explain it but I need to figure out how to find the number of times something is appearing in a function, without using the count method. Right now I have:</p>
<pre><code>def contains(list_to_check, n... | <p>You function can be simplified with only one return out of loop</p>
<pre><code>def contains(list_to_check, number):
return sum([x==number for x in list_to_check])
print(contains([4, 5, 6, 7, 8, 8, 4, 4, 2], 8))
</code></pre> | How do I find how much times something appears in a function without the count method? | python|function | -1 | 46 | 2 | 72,179,870 | 72,179,870 | 0 | true | 2022-05-10T01:23:46.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I find how much times something appears in a function without the count method?<p>I’m not completely sure how to explain it but I need to figure out h... |
72,179,445 | Converting a C program to use pointers in array and have the same output<p>Here is the code, I am having trouble converting it to use pointers and have the same output:</p>
<pre><code>#include <stdio.h>
int main() {
int i, s[4], t[4], u = 0;
for (i=0; i<=4; i++)
{
s[i] = i;
t[i] = i;
... | <p>Here is one possible solution that I am not sure if this might be what you are looking for:</p>
<pre><code>#include <stdio.h>
int main()
{
int i, s[4], t[4], u=0;
for (i=0; i<4; i++)
{
*(s+i) = i;
*(t+i) = i;
}
printf("s:t\n");
for(i=0; i<4; i++)
... | Converting a C program to use pointers in array and have the same output | arrays|c|pointers | -1 | 50 | 1 | 72,180,068 | 72,180,068 | 0 | true | 2022-05-10T00:16:04.147Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Converting a C program to use pointers in array and have the same output<p>Here is the code, I am having trouble converting it to use pointers and have the s... |
72,180,186 | Getting the following Error: FileNotFoundError: [WinError 3] The system cannot find the path specified:<p>I am new with Python and I am attempting to extract a specific column from a csv file (Column name = "Hostname"). I keep getting error: <strong>FileNotFoundError: [WinError 3] The system cannot find the p... | <p>You are reading the content of the .csv file in the variable <code>data_location</code>. Then, you are calling <code>os.listdir()</code> using the content of the .csv file, and this is not a string directory but a data frame so it will throw an error.</p>
<p>The variable <code>data_location</code> must be a string c... | Getting the following Error: FileNotFoundError: [WinError 3] The system cannot find the path specified: | python | -1 | 114 | 1 | 72,180,299 | 72,180,299 | 0 | true | 2022-05-10T02:44:57.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting the following Error: FileNotFoundError: [WinError 3] The system cannot find the path specified:<p>I am new with Python and I am attempting to extract... |
72,180,226 | Arel: Dynamically generate conditions from array of values<p>I'm looking to generate "or" conditions for a query in a Rails app, from an array of words i want to try to <code>match</code> against values in a single column, in Arel. I'm trying to follow advice in a <a href="https://stackoverflow.com/questions/... | <p>Whoops - it's super easy with Arel.</p>
<pre class="lang-rb prettyprint-override"><code>Table.where(Table.arel_table[:text].matches_any(patterns))
</code></pre>
<p>I'd still like to know more about chaining Arel conditions.</p> | Arel: Dynamically generate conditions from array of values | ruby-on-rails-5|arel | -1 | 88 | 1 | 72,180,861 | 72,180,861 | 0 | true | 2022-05-10T02:50:22.087Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Arel: Dynamically generate conditions from array of values<p>I'm looking to generate "or" conditions for a query in a Rails app, from an array of w... |
72,181,952 | jQuery width() messes up CSS width<p>I have two input elements, one is input file and one is input readonly text . I settled the main input file with a certain width in css file as :</p>
<pre><code>.myinputfile { width: 78% !important; max-width: 78% !important }
</code></pre>
<p>So with jQuery .offset() I put the inpu... | <p>It might be easier to do this via CSS directly since you have separate classes for both, using the <code>display: inline</code> property.</p>
<p>Working example snippet:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet... | jQuery width() messes up CSS width | jquery|css | -1 | 37 | 1 | 72,182,049 | 72,182,049 | 0 | true | 2022-05-10T07:03:47.200Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jQuery width() messes up CSS width<p>I have two input elements, one is input file and one is input readonly text . I settled the main input file with a certa... |
72,144,600 | Typescript - Object display correct datas but properties are undefined on access<p>When I log the entire object all the datas are displayed but when I try to access the properties they are undefined. As if the object's properties where not mapped to their datas.</p>
<p>A component containing the data :</p>
<pre class="... | <p>The problem was in the implementations of the abstract class. I was adding the <code>async</code> keyword to the <code>selectData</code> method since it's not possible to add it on the abstract original one. However that isn't enough to cause my problem, what really f****d it up was to call that method in the constr... | Typescript - Object display correct datas but properties are undefined on access | typescript|object|properties|undefined | -1 | 27 | 1 | 72,183,555 | 72,183,555 | 0 | true | 2022-05-06T16:19:59.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Typescript - Object display correct datas but properties are undefined on access<p>When I log the entire object all the datas are displayed but when I try to... |
72,183,508 | BeautifulSoup - How to select elements according to page order?<p>i am actually trying to parse a Wikipedia page for a project. I don't know how to automate my program in order to make him get the elements according to page order. This is the page : <a href="https://fr.wikipedia.org/wiki/Manga" rel="nofollow noreferrer... | <p>Cause question / expected output is not that clear, this just should point into one possible direction.</p>
<p>You could select your captions, iterate over its <code>.next_siblings</code> and <code>break</code> iteration if there is a specific tag:</p>
<pre><code>import urllib.request
from bs4 import BeautifulSoup
... | BeautifulSoup - How to select elements according to page order? | python|beautifulsoup | -1 | 44 | 1 | 72,184,851 | 72,184,851 | 0 | true | 2022-05-10T09:06:19.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
BeautifulSoup - How to select elements according to page order?<p>i am actually trying to parse a Wikipedia page for a project. I don't know how to automate ... |
72,184,724 | Extract and convert from JSON by Regex<p>Good afternoon, it is necessary to extract the data inside the token_dict object from the data received by the api and convert the data, example:</p>
<pre><code>"token_dict": {
"0x13a637026df26f846d55acc52775377717345c06": {
"chain": "bsc... | <p>Firstly, note that Regex is very far from the best solution to this issue.</p>
<p>A better approach to achieve what you require is to use <code>Object.keys()</code> to retrieve a list of all the unique property names within <code>token_dict</code> and then use <code>map()</code> to create an array of their associate... | Extract and convert from JSON by Regex | javascript|jquery|json | -1 | 30 | 2 | 72,184,960 | 72,184,960 | 0 | true | 2022-05-10T10:31:54.423Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extract and convert from JSON by Regex<p>Good afternoon, it is necessary to extract the data inside the token_dict object from the data received by the api a... |
72,184,788 | How can I get the android header again?<p><a href="https://i.stack.imgur.com/f0GOE.png" rel="nofollow noreferrer">Hello professionals. I'm new to android studio. I lost the studio header .how can I get this header again.</a></p> | <p>All you have to do is press <code>CTRL+SHIFT+N</code>, then it will open a menu, find where you see <strong>All</strong>, and then type <strong>Appearance</strong>. And then select Main menu, and your problem will be solved.</p> | How can I get the android header again? | android-studio | -1 | 14 | 1 | 72,185,088 | 72,185,088 | 0 | true | 2022-05-10T10:36:58.313Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get the android header again?<p><a href="https://i.stack.imgur.com/f0GOE.png" rel="nofollow noreferrer">Hello professionals. I'm new to android stu... |
72,185,313 | Is there shorthand conditional syntax in swift?<p>Is this the shortest way to write this in swift?</p>
<pre><code>if currentStep == .confirmSignInAttempt1 || currentStep == .confirmSignInAttempt2 || currentStep == .confirmSignInAttempt3
</code></pre> | <p>You can use</p>
<pre><code>if [.confirmSignInAttempt1,.confirmSignInAttempt2,.confirmSignInAttempt3].contains(currentStep)
</code></pre> | Is there shorthand conditional syntax in swift? | swift | -1 | 44 | 2 | 72,185,338 | 72,185,338 | 0 | true | 2022-05-10T11:11:08.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there shorthand conditional syntax in swift?<p>Is this the shortest way to write this in swift?</p>
<pre><code>if currentStep == .confirmSignInAttempt1 ||... |
72,186,367 | Adding a new column in a Dataframe based on two conditions from two different columns in dplyr<p>I have a data.frame containing two rows: <code>car</code> is a model of car and <code>num</code> is the number of cars of that model that I have observed in a car park.</p>
<p>Using <code>dplyr::mutate()</code>, I want add ... | <pre class="lang-r prettyprint-override"><code>require(dplyr)
mutate(df, pop_car = ifelse(num > 1, pop_car, "Other"))
</code></pre> | Adding a new column in a Dataframe based on two conditions from two different columns in dplyr | r|dplyr | -1 | 28 | 1 | 72,186,675 | 72,186,675 | 0 | true | 2022-05-10T12:31:25.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding a new column in a Dataframe based on two conditions from two different columns in dplyr<p>I have a data.frame containing two rows: <code>car</code> is... |
72,186,816 | extract number from string from another file<p>I am currently working on a batch file that is supposed to read a version number from another file.</p>
<p>Basically, I just need to extract the string from the other document and get the number from it (number changes over time).</p>
<pre><code>set dir=..\folder1\file1.vc... | <p><code>dir</code> is a poor name for a variable for two reasons. First <code>dir</code> is a keyword in batch, and then it implies that it's a directory when it seems to be a file.</p>
<p>Use <code>set "var1=value"</code> for setting <strong>STRING</strong> values - this avoids problems caused by trailing s... | extract number from string from another file | batch-file|cmd|extract | -1 | 27 | 1 | 72,187,729 | 72,187,729 | 0 | true | 2022-05-10T13:00:55.730Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
extract number from string from another file<p>I am currently working on a batch file that is supposed to read a version number from another file.</p>
<p>Bas... |
72,187,908 | JavaScript I can't send string parameter to function even I can send int parameter with div.innerHTML on click event<pre><code>script type="text/javascript">
function QueryAgain(teammate){
document.getElementById("researcher-name").value=teammate;
document.getElementById("publication-name&q... | <p>Just use a string template literal</p>
<pre><code>div.innerHTML += `
<br />
<a
href='#nav'
id='teammate'
onclick="QueryAgain('${holder}')">
${researcher_teammate[i][j]}
</a>
<br />
`;
</code></pre> | JavaScript I can't send string parameter to function even I can send int parameter with div.innerHTML on click event | javascript|string|onclick|syntax-error|innerhtml | -1 | 40 | 1 | 72,188,312 | 72,188,312 | 0 | true | 2022-05-10T14:09:08.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JavaScript I can't send string parameter to function even I can send int parameter with div.innerHTML on click event<pre><code>script type="text/javascr... |
72,189,022 | Is there any ways to save a value from a function which runs several times?<p>Well, I'm a relative beginner in Python and I wanted to make a simple login function, but I ran into a problem.</p>
<pre><code>def login():
loginTries = 0
loginName = str(input("\nPlease enter your username: "))
loginPas... | <p>The simplest approach is probably to create a separate function to handle attempts. You'd have to adjust your login function a bit to return the expected values, but you could do:</p>
<pre class="lang-py prettyprint-override"><code>def handle_login():
login_attempts = 0
while login_attempts < 3:
s... | Is there any ways to save a value from a function which runs several times? | python|function | -1 | 30 | 1 | 72,189,139 | 72,189,139 | 0 | true | 2022-05-10T15:22:46.417Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there any ways to save a value from a function which runs several times?<p>Well, I'm a relative beginner in Python and I wanted to make a simple login fun... |
72,188,924 | C++ Segmentation fault when changing value of pointer within method call<p>I'm programming a server - client application with a shared utils.cpp.</p>
<p>So the server and client use the (in utils.h) predefined methods:</p>
<pre><code>int listening_socket(int port);
int connect_socket(const char *hostname, const int por... | <p>Pointers are variables that should be use to point to some allocated memory.</p>
<p>In your initialization, you made your pointers point to NULL, i.e, no memory.</p>
<p>And after that you are trying to change the value of nothing. That's why you are getting a segmentation fault.</p>
<p>You should either:</p>
<p>Dec... | C++ Segmentation fault when changing value of pointer within method call | c++|pointers|methods|parameters|segmentation-fault | -1 | 169 | 2 | 72,189,239 | 72,189,239 | 0 | true | 2022-05-10T15:16:02.100Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++ Segmentation fault when changing value of pointer within method call<p>I'm programming a server - client application with a shared utils.cpp.</p>
<p>So t... |
72,190,271 | SQL query that considers data from other table<p>I have two tables:</p>
<p><code>employees</code>:</p>
<p><code>id, CMS_user_id, practice_group_id, ...</code></p>
<p>and</p>
<p><code>users</code>:</p>
<p><code>id, level, ...</code></p>
<p>I want to select all employees where <code>practice_group_id</code> is 2 but only... | <p>A <code>JOIN</code> will match the corresponding rows between two tables. Then, filtering can be done using <code>WHERE</code>.</p>
<p>For example:</p>
<pre><code>select e.*
from employees e
join users u on u.id = e.CMS_user_id
where e.practice_group = 2 and u.level = 1
</code></pre> | SQL query that considers data from other table | php|mysql|sql | -1 | 23 | 1 | 72,190,318 | 72,190,318 | 0 | true | 2022-05-10T16:54:28.413Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL query that considers data from other table<p>I have two tables:</p>
<p><code>employees</code>:</p>
<p><code>id, CMS_user_id, practice_group_id, ...</code... |
72,185,932 | Sorting a list with indexes of another<p>I am trying to sort a list of indexes based on a list of string, and I receive bellow error - Segmentation fault. I cannot understand why I receive this error and how to solve it?</p>
<pre><code>#include <iostream>
#include <string.h>
using namespace std;
int main()... | <p>In the inner loop you start with <code>j = size</code> and then <code>num[j]</code> is an out-of-bounds array access.</p>
<p>In modern C++ you would solve this like this:</p>
<pre><code>#include <iostream>
#include <array>
#include <algorithm>
int main() {
const int size = 5;
std::array<... | Sorting a list with indexes of another | c++ | -1 | 53 | 1 | 72,191,079 | 72,191,079 | 0 | true | 2022-05-10T11:59:18.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sorting a list with indexes of another<p>I am trying to sort a list of indexes based on a list of string, and I receive bellow error - Segmentation fault. I ... |
72,190,967 | can't iterate through dictionary<p>I have a JSON-File with some data in it. Now I try to extract some of the data, but I always get the error <br>
<em>Traceback (most recent call last):
File "C:\Users\Foo\PycharmProjects\youtube_stats\youtube_videos.py", line 29, in
title = vid["title"]
TypeError:... | <p>As it's been mentioned in other comments, running <code>for vid in vids[channel_id]["video_data"]:</code> will iterate through the dictionary keys. If you'd like to check the contents you can either use the key to access the values, or use <code>dict.values()</code> to iterate through the dictionary values... | can't iterate through dictionary | python|json | -1 | 31 | 1 | 72,191,333 | 72,191,333 | 0 | true | 2022-05-10T17:53:57.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
can't iterate through dictionary<p>I have a JSON-File with some data in it. Now I try to extract some of the data, but I always get the error <br>
<em>Trace... |
72,190,893 | Outputting on multiple lines and I need each line to be assigned to its own variable<p>The code below takes dna_string2 and matches it within dna_string1. It then outputs the index location of the match or matches and then increments then return value by 1 to simulate "counting itself". The problem I am facin... | <p>The function needs to be more flexible to allow for any number of matches.</p>
<p>The function should not be responsible for presentation of the result.</p>
<p>Therefore, let's just return a list and handle the presentation in the caller. For example:-</p>
<pre><code>def get_most_likely_ancestor(s1, s2):
offset ... | Outputting on multiple lines and I need each line to be assigned to its own variable | python|python-3.x|function|variables|visual-studio-code | -1 | 45 | 3 | 72,191,449 | 72,191,449 | 0 | true | 2022-05-10T17:47:40.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Outputting on multiple lines and I need each line to be assigned to its own variable<p>The code below takes dna_string2 and matches it within dna_string1. It... |
72,191,652 | Generating Hash JavaScript and HTML. Problems with innerHTML<p>Why does this doesn't work for the innerHTML while it works perfectly fine when printing it on console.log()?</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet... | <blockquote>
<p>it only generates one tr</p>
</blockquote>
<p>No, it generates all of them. Each one is just overwriting the previous one:</p>
<pre><code>hashTable.innerHTML = `
<tr>
<th scope="row">${stringToHash(element)}</th>
<td>${element}</td>
</tr>`;
</co... | Generating Hash JavaScript and HTML. Problems with innerHTML | javascript|html | -1 | 33 | 1 | 72,191,742 | 72,191,742 | 0 | true | 2022-05-10T18:53:03.027Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Generating Hash JavaScript and HTML. Problems with innerHTML<p>Why does this doesn't work for the innerHTML while it works perfectly fine when printing it on... |
72,191,914 | double space when exporting to TXT file in python<p>I have this code that works:</p>
<pre><code>print((tabulate(email_list, showindex=False, tablefmt = 'plain')), file=open(output + '\\' + "np.txt", "w"))
</code></pre>
<p>but when I open the file, the email addresses look like this:</p>
<pre><code>b... | <p>Thanks I just changed it completely:</p>
<pre><code>emails = email_list.tolist()
textfile = open(output + '\\' + "np.txt", "w")
for element in emails:
textfile.write(element + "\n")
textfile.close()
os.startfile(output + '\\' + 'np.txt')
</code></pre> | double space when exporting to TXT file in python | python|txt|tabulate|reactablefmtr | -1 | 28 | 1 | 72,192,058 | 72,192,058 | 0 | true | 2022-05-10T19:17:23.227Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
double space when exporting to TXT file in python<p>I have this code that works:</p>
<pre><code>print((tabulate(email_list, showindex=False, tablefmt = 'plai... |
72,191,290 | remove double quotes around dictionary object - python<p>I have a dictionary that I am using to populate a YAML config file for each key.</p>
<pre><code>{'id': ['HP:000111'], 'id1': ['HP:000111'], 'id2': ['HP:0001111', 'HP:0001123'])}
</code></pre>
<p>code to insert key:value pair into YAML template using <code>ruamel.... | <p>It is not entirely clear to me what you are trying to do and why you e.g. open files
'w+' for dumping.</p>
<p>However if you have something that comes out block style and unquoted, that can easily be remedied
by using a small function:</p>
<pre class="lang-py prettyprint-override"><code>import sys
from pathlib impo... | remove double quotes around dictionary object - python | python|yaml|ruamel.yaml | -1 | 79 | 1 | 72,192,357 | 72,192,357 | 0 | true | 2022-05-10T18:20:29.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
remove double quotes around dictionary object - python<p>I have a dictionary that I am using to populate a YAML config file for each key.</p>
<pre><code>{'id... |
72,193,720 | Sort multidimensional array by column value within a column<p>I have an array in PHP and I need to sort by a nested array inside of the array...</p>
<p>Here is my array:</p>
<pre><code>Array
(
[0] => Array
(
[project_id] => 1
[earnest_money_due] => Array
(
... | <p>Try this...</p>
<pre class="lang-php prettyprint-override"><code><?php
$array = [
[
'project_id' => 1,
'earnest_money_due' => [
'value' => 1000.00,
'currency' => 'USD',
],
],
[
'project_id' => 2,
'earnest_money_due' => ... | Sort multidimensional array by column value within a column | php|arrays|sorting|multidimensional-array|columnsorting | -1 | 135 | 2 | 72,193,821 | 72,193,821 | 0 | true | 2022-05-10T22:53:16.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sort multidimensional array by column value within a column<p>I have an array in PHP and I need to sort by a nested array inside of the array...</p>
<p>Here ... |
72,193,774 | Selenium, WebDriver : Get Element, " <a href=Javascript " with changing variables<p>javascript button source to get element:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code... | <p>Try:</p>
<pre><code>submit_btn = driver.find_element(By.XPATH,"//img[@src='/image/cal_app.jpg']/..")
</code></pre> | Selenium, WebDriver : Get Element, " <a href=Javascript " with changing variables | javascript|python|html|selenium | -1 | 63 | 2 | 72,193,823 | 72,193,823 | 0 | true | 2022-05-10T23:02:21.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Selenium, WebDriver : Get Element, " <a href=Javascript " with changing variables<p>javascript button source to get element:</p>
<p><div class="snippet" data... |
72,185,835 | Why i'm getting this error? python-weka-wrapper 3<p>Some days ago i executed this code and goes correctly but right now it started to show me that error:</p>
<pre class="lang-py prettyprint-override"><code>----------------------------------------------------------------------------
TEST MODEL
--------------------------... | <p>It is possible that SMOTE is very sensitive to there being enough instances per class (I don't know anything about the filter's inner workings). I was able to recreate this problem when using the UCI dataset labor. However, when I changed the train/test split to 90/10 (as is used by your cross-validation), it worked... | Why i'm getting this error? python-weka-wrapper 3 | python|python-3.x|weka|nearest-neighbor | -1 | 59 | 1 | 72,193,842 | 72,193,842 | 0 | true | 2022-05-10T11:53:03.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why i'm getting this error? python-weka-wrapper 3<p>Some days ago i executed this code and goes correctly but right now it started to show me that error:</p>... |
72,194,152 | PHP Sort Multi Dimensional Array Value - Not Sorting<p>I have a multi dimensional array in PHP but it is not sorting correctly.</p>
<p>Here is my code:</p>
<pre><code>$records = [
[
'project_id' => 3,
'purchase_amount' => [
'value' => 900000,
'currency' => 'USD',
... | <p><code>strcmp</code> compare ASCII of every character of the strings, if not equal it will stop, so for <code>strcmp</code>, <code>200</code> is small than <code>9</code> cuz ASCII of <code>2</code> < ASCII of <code>9</code>.</p>
<p>So in your case you should use</p>
<pre><code>usort($records, function ($a, $b) {
... | PHP Sort Multi Dimensional Array Value - Not Sorting | php|arrays | -1 | 28 | 1 | 72,194,522 | 72,194,522 | 0 | true | 2022-05-11T00:19:03.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP Sort Multi Dimensional Array Value - Not Sorting<p>I have a multi dimensional array in PHP but it is not sorting correctly.</p>
<p>Here is my code:</p>
<... |
72,195,215 | Can't multiply sequence by non-int<p>The following code is the minimum example of a error that I'm not sure how to solve it.</p>
<pre class="lang-py prettyprint-override"><code>import matplotlib.pyplot as plt
import numpy as np
x = [1, 2, 3, 4, 5]
y = [5, 4, 3, 2, 1]
a, b, c = np.polyfit(x, y, 2)
fig, ax = plt.subplo... | <p>You were trying to multiply a list with a non-integer. Instead, use numpy arrays</p>
<pre><code>import matplotlib.pyplot as plt
import numpy as np
x = np.array([1, 2, 3, 4, 5])
y = np.array([5, 4, 3, 2, 1])
a, b, c = np.polyfit(x, y, 2)
fig, ax = plt.subplots()
ax.plot(x, a*x)
plt.show()
</code></pre>
<p><a href="... | Can't multiply sequence by non-int | python|numpy|jupyter-notebook | -1 | 30 | 1 | 72,195,409 | 72,195,409 | 0 | true | 2022-05-11T03:52:27.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't multiply sequence by non-int<p>The following code is the minimum example of a error that I'm not sure how to solve it.</p>
<pre class="lang-py prettypr... |
72,181,605 | How to validate for a empty field for a mobile no in flutter?<p>How do I validate for a empty phone number field in a form in flutter without using any extra packages or dependencies?</p> | <p>The easiest way is to check the conditions before printing/returning the values.
Check for the following conditions before printing/returning the values.
Pass the following conditions in the onPressed.</p>
<pre><code> if(value == null || value.length <10)
print('Enter valid input');
else
print(... | How to validate for a empty field for a mobile no in flutter? | flutter|dart|mobile-application | -1 | 401 | 1 | 72,195,804 | 72,195,804 | 0 | true | 2022-05-10T06:27:57.957Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to validate for a empty field for a mobile no in flutter?<p>How do I validate for a empty phone number field in a form in flutter without using any extra... |
72,197,071 | Vuejs $emit doesnt work in some part of a function, and in other part works<p>I am using vuejs3 and trying to emit event from a child component.</p>
<p><strong>child Component</strong></p>
<pre><code><input type="button" v-if="edition_mode" @click="cancel()" class="btn btn-primary&... | <p>I am not sure what issue you are facing but it is working fine in the below code snippet. Please have a look and let me know if any further clarification/discussion required.</p>
<p>Demo <strong>:</strong></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class... | Vuejs $emit doesnt work in some part of a function, and in other part works | vue.js|emit | -1 | 210 | 2 | 72,197,718 | 72,197,718 | 0 | true | 2022-05-11T07:31:25.003Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vuejs $emit doesnt work in some part of a function, and in other part works<p>I am using vuejs3 and trying to emit event from a child component.</p>
<p><stro... |
72,198,173 | ModuleNotFoundError: No module named 'Tkinter' error although it has always worked<p>I can no longer use the Tkinter module. Before I switched to Python 3, the script started without any problems. Now this error appears:</p>
<pre><code>ModuleNotFoundError: No module named 'Tkinter'
</code></pre>
<p>Can you help me solv... | <p>Be careful, you must use tkinter for Python 3 and Tkinter for Python 2.</p>
<p>So, if you're using Python 3, the module has been renamed to tkinter.</p> | ModuleNotFoundError: No module named 'Tkinter' error although it has always worked | tkinter|modulenotfounderror | -1 | 42 | 1 | 72,198,190 | 72,198,190 | 0 | true | 2022-05-11T08:56:33.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ModuleNotFoundError: No module named 'Tkinter' error although it has always worked<p>I can no longer use the Tkinter module. Before I switched to Python 3, t... |
72,192,174 | How do I add timestamps to bot logs?<p>Is there a way to add a timestamp to when my bot logs something to the console?
For example, when it leaves a server, it says:</p>
<blockquote>
<p>I have been removed from the guild: "Server"</p>
</blockquote>
<p>And I want it to look something like [Day, Time]:</p>
<blo... | <p>You can get Date and normalize it with simple module <code>moment.js</code>.</p>
<p>Install it on terminal with <code>npm i moment</code>.</p>
<pre class="lang-js prettyprint-override"><code>const moment = require("moment")
moment.locale("en")
client.on("guildDelete", async guild =>... | How do I add timestamps to bot logs? | node.js|discord.js | -1 | 53 | 3 | 72,200,318 | 72,200,318 | 0 | true | 2022-05-10T19:47:53.757Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I add timestamps to bot logs?<p>Is there a way to add a timestamp to when my bot logs something to the console?
For example, when it leaves a server, ... |
72,200,293 | How do I make a web app with Google APIs?<p>I am pretty new to web dev, and I wanted to create a simple UI in Javascript with the Google Maps Places API to familiarize myself with everything. My question is, would I just make direct URL requests with the user’s variables, or would I have to create something server side... | <p>It depends on your application's functionality. Generally, you could keep all everything on the client-side. If you app is a server-rendered one, meaning you would be using a JavaScript framework like <a href="https://reactjs.org/" rel="nofollow noreferrer">React</a> or <a href="https://vuejs.org/" rel="nofollow nor... | How do I make a web app with Google APIs? | javascript|api|google-maps | -1 | 80 | 1 | 72,200,505 | 72,200,505 | 0 | true | 2022-05-11T11:31:27.293Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I make a web app with Google APIs?<p>I am pretty new to web dev, and I wanted to create a simple UI in Javascript with the Google Maps Places API to f... |
72,200,121 | Find multiple text in pdfs<p>I'm currently trying to pull pdf's with the following list of text. I was able to pull pdf's but with only one word. should i change my condition below? thanks in advance. newbie here.</p>
<pre><code>from tika import parser
import glob
path = glob.glob(r"C:\Users\kxdane\Desktop\TEST\O... | <p>In python, substring search works only with single argument. So you need to search for all substrings in a loop and combine the results using logical AND, for example like this:</p>
<pre class="lang-py prettyprint-override"><code>...
words = ['Disclosure','M.D.']
for file in pdf_files:
raw = parser.from_file(fil... | Find multiple text in pdfs | python|tika-python | -1 | 21 | 1 | 72,200,671 | 72,200,671 | 0 | true | 2022-05-11T11:19:44.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find multiple text in pdfs<p>I'm currently trying to pull pdf's with the following list of text. I was able to pull pdf's but with only one word. should i ch... |
72,201,321 | Can't render multiple components in the same page In React 18.1.0 version<p>I want to render both NavBar and Counters components in the same page. But when the applications always shows only the index element. I want to get both navigation bar and the counter component in my index page. As I am new to React could some... | <p>Route only loads only one component, You can add NavBar on top of the router, It'll always be visible.</p>
<p>Better way is create HOC and wrap if you have case like before auth and after auth.</p>
<pre><code>function App() {
return (
<>
<NavBar />
<Router className="App"&g... | Can't render multiple components in the same page In React 18.1.0 version | reactjs | -1 | 313 | 1 | 72,201,393 | 72,201,393 | 0 | true | 2022-05-11T12:46:08.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't render multiple components in the same page In React 18.1.0 version<p>I want to render both NavBar and Counters components in the same page. But when t... |
72,201,372 | get selected option of multi dropdown jquery angular dosn't work<p>Hello I'm workig with jquery in angular app, I want to get all selected option of many select list in my component ts file with jquery, what I did :</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<di... | <p>Like this it is working :</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code> $('#selectProp select').each((index, element) => {
var conceptName = $(element).find("... | get selected option of multi dropdown jquery angular dosn't work | javascript|jquery|angular | -1 | 31 | 1 | 72,201,814 | 72,201,814 | 0 | true | 2022-05-11T12:49:43.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
get selected option of multi dropdown jquery angular dosn't work<p>Hello I'm workig with jquery in angular app, I want to get all selected option of many sel... |
72,201,843 | Convert from JSON to Pandas<p><strong>How can i convert this from json to pandas</strong></p>
<pre><code>import json
import pandas as pd
import requests
from pandas import json_normalize
url = ("https://api.compound.finance/api/v2/market_history/graph? asset=0xf5dce57282a584d2746faf1593d3121fcac444dc&min_blo... | <p>It looks like a typo - when you write</p>
<pre class="lang-py prettyprint-override"><code>df = pd.DataFrame(url['borrow_rates'])
</code></pre>
<p>it should be</p>
<pre class="lang-py prettyprint-override"><code>df = pd.DataFrame(res['borrow_rates']) # res instead of url
</code></pre>
<p>the <code>url</code> variable... | Convert from JSON to Pandas | python|json|pandas | -1 | 31 | 1 | 72,201,948 | 72,201,948 | 0 | true | 2022-05-11T13:22:40.037Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert from JSON to Pandas<p><strong>How can i convert this from json to pandas</strong></p>
<pre><code>import json
import pandas as pd
import requests
fro... |
72,202,959 | What is mean by Code generation libraries?<p>Today I was going through the Android libraries update by referring some videos and documents.
There was a term mentioned Code Generation Libraries.</p>
<p>Can any one explain what does it mean or what type of libraries are addressed as Code Generation Libraries?</p>
<p>Than... | <p>A code generation library is a library that, if you use it, will generate some code for you, let me explain it :</p>
<p>One of common things in programmation is for example login forms. You use it really often and they are almost always the same structure (let say an email and a password).</p>
<p>If you are a web de... | What is mean by Code generation libraries? | android|androidx | -1 | 30 | 1 | 72,203,060 | 72,203,060 | 0 | true | 2022-05-11T14:36:31.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is mean by Code generation libraries?<p>Today I was going through the Android libraries update by referring some videos and documents.
There was a term ... |
72,173,225 | What is the best way to update the source of a XamDataGrid from a different form?<p>I have a <code>XamDataGrid</code> in my MainWindow which has a <code>Public Shared List(Of Artikelstammdaten)</code> as <code>DataSource</code>. After opening a few other forms I want to add more data to the <code>XamDataGrid</code> wit... | <p>If <code>dgArticleMasterData</code> is defined in the <code>MainWindow</code> class, you need to get a reference to the <code>MainWindow</code> instance to be able to access it.</p>
<p>You should be able to find it in the <code>Application.Current.Windows</code> collection:</p>
<pre><code>Private Sub Add_Click(sende... | What is the best way to update the source of a XamDataGrid from a different form? | wpf|vb.net|infragistics | -1 | 33 | 1 | 72,203,184 | 72,203,184 | 0 | true | 2022-05-09T13:59:53.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the best way to update the source of a XamDataGrid from a different form?<p>I have a <code>XamDataGrid</code> in my MainWindow which has a <code>Publ... |
72,202,316 | what happens if io.redisearch.client.Client.close() is not called in Redisearch?<p>I am using Redisearch through jredisearch api for storing the data in Redisearch Indexes. I access the Redisearch through io.redisearch.client.Client object with the args Client(String indexName, String host, int port, int timeout, int p... | <p>You would have a minimum of <code>0</code> to a maximum of <code>poolSize</code> number of idle socket connections till the rest of the lifetime of your application.</p> | what happens if io.redisearch.client.Client.close() is not called in Redisearch? | redis|redis-cluster|redisearch | -1 | 16 | 1 | 72,203,968 | 72,203,968 | 0 | true | 2022-05-11T13:53:47.227Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
what happens if io.redisearch.client.Client.close() is not called in Redisearch?<p>I am using Redisearch through jredisearch api for storing the data in Redi... |
72,203,886 | Combination of a list of objects<p>I have a problem that I can't solve.
I hope I can make you understand it.</p>
<p>Given the following list of Waypoint objects</p>
<p><code>List<Waypoint>myWaypoint = new ArrayList<Waypoint>();</code></p>
<p>I want to calculate the combinations <strong>no repetition</strong... | <p>If implementing the algorithm is not part of the task, I would recomend a library like <a href="https://github.com/dpaukov/combinatoricslib3" rel="nofollow noreferrer">combinatoricslib3</a> which will generate the combinations for you.</p>
<p>Using <code>combinatoricslib3</code> a simple example using Strings:</p>
<... | Combination of a list of objects | java|arrays | -1 | 156 | 1 | 72,204,547 | 72,204,547 | 0 | true | 2022-05-11T15:38:51.427Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Combination of a list of objects<p>I have a problem that I can't solve.
I hope I can make you understand it.</p>
<p>Given the following list of Waypoint obje... |
72,185,831 | Use fputcsv but create many tables<p>If you have a single block of data, creating a table with <code>fputcsv</code> works great; it assumes the first row is a header and the following rows are of the same format.</p>
<p>But what do you do if you have multiple, differently formatted blocks of data you want to write out ... | <p>As requested:</p>
<blockquote>
<p>But what do you do if you have multiple, differently formatted blocks
of data you want to write out to a CSV:</p>
</blockquote>
<p>You'd then have your own propitary definition of a CSV... it's not what I would expect from a CSV though, so don't blame on others if they can't underst... | Use fputcsv but create many tables | php|fputcsv | -1 | 46 | 1 | 72,205,021 | 72,205,021 | 0 | true | 2022-05-10T11:52:33.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use fputcsv but create many tables<p>If you have a single block of data, creating a table with <code>fputcsv</code> works great; it assumes the first row is ... |
72,204,801 | How to distinguish pages in Liferay?<p>How can you tell the difference between two pages in the Liferay App?</p>
<p>So, assume my application has 2 pages and I want to be able to tell which page is first and which is second. What data would I use to accomplish this?</p>
<p>I tried by using the PLID numbers, and this wo... | <p>While rendering, you can get the current context from a themeDisplay object, retrievable like this:</p>
<pre><code>ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
</code></pre>
<p>There are plenty of options - but as inherently there is no defined "order" betwe... | How to distinguish pages in Liferay? | java|liferay | -1 | 25 | 1 | 72,205,565 | 72,205,565 | 0 | true | 2022-05-11T16:48:23.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to distinguish pages in Liferay?<p>How can you tell the difference between two pages in the Liferay App?</p>
<p>So, assume my application has 2 pages and... |
72,205,744 | Unfreeze UI whilst performing a task<p>Threading noob here.</p>
<p>I'm trying to make a program that pulls a user's profile data from the osu! website, and while doing so the application freezes. You can't drag around the window or anything. I've tried making a task that returns the result after awaiting but it still f... | <p>You can't access UI elements (or any <code>DispatcherObject</code> in general) from a thread other than the UI thread (dispatcher thread). Either use the <code>Dispatcher.InvokeAsync</code> to access those objects or access them (to copy their values) before you run the background operation:</p>
<pre class="lang-cs ... | Unfreeze UI whilst performing a task | c#|.net|wpf|async-await|task | -1 | 54 | 2 | 72,206,046 | 72,206,046 | 0 | true | 2022-05-11T18:11:21.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unfreeze UI whilst performing a task<p>Threading noob here.</p>
<p>I'm trying to make a program that pulls a user's profile data from the osu! website, and w... |
72,204,757 | Unity - Actions Being Called Twice - OnTriggerEnter, OnClick, EVERYTHING?<p>So I'm creating a Sheep Counter Game and yesterday, when I went to bed everything was working great. Today, when I opened Unity up to do some finishing touches, everything I'm doing is being called twice...</p>
<p>So when I click the start butt... | <p>Each click you call start on your difficulty button. Which has already run. So you will get 2. See the choices in your start button inspector</p> | Unity - Actions Being Called Twice - OnTriggerEnter, OnClick, EVERYTHING? | c#|visual-studio|unity3d|counter | -1 | 225 | 1 | 72,206,310 | 72,206,310 | 0 | true | 2022-05-11T16:44:43.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unity - Actions Being Called Twice - OnTriggerEnter, OnClick, EVERYTHING?<p>So I'm creating a Sheep Counter Game and yesterday, when I went to bed everything... |
72,202,109 | Problems when compiling older version of Wt on Mac OS<p>We have an old project that we usually build on Linux in a virtual machine.
Working on this project is a chore since it currently only builds and runs in the virtual machine.
We aren’t ready yet to invest the resources necessary to rewrite the project with up to d... | <p>For anyone wondering, I got it to compile. It seems like the problem came from using clang++.</p>
<ol>
<li><p>Use the right version of Boost and MySQL.
For me that was Boost 1.54 and MariaDB.<br />
Boost 1.54 took some work to compile, make sure the libraries are actually present in the downloaded repository, I had ... | Problems when compiling older version of Wt on Mac OS | xcode|macos|gcc|clang|wt | -1 | 32 | 1 | 72,207,263 | 72,207,263 | 0 | true | 2022-05-11T13:39:25.477Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problems when compiling older version of Wt on Mac OS<p>We have an old project that we usually build on Linux in a virtual machine.
Working on this project i... |
72,200,364 | Gradle finished with non-zero exit value 255<p>I am very new to Java coding and I decided to modify Minecraft as a fun project following a tutorial. When I went to run the Minecraft client from the debug menu, I received:</p>
<pre><code>* What went wrong:
Execution failed for task ':runClient'.
> Process 'command '/... | <p>Generally, non-zero exit code means an irregular exit.
You should check out <code>latest.log</code> or <code>debug.log</code> in the running directory to inspect what was happened. They contain a crash report which helps identify your problem.</p> | Gradle finished with non-zero exit value 255 | java|gradle|build.gradle|gradlew|minecraft-forge | -1 | 628 | 1 | 72,207,389 | 72,207,389 | 0 | true | 2022-05-11T11:36:21.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Gradle finished with non-zero exit value 255<p>I am very new to Java coding and I decided to modify Minecraft as a fun project following a tutorial. When I w... |
72,207,400 | How do I get forms inline with each other?<p>This probably seems like a really dumb question, but i am building a website for my school project and i need to get these two forms next to each other rather then having a line break inbetween them:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="... | <p>Use <code>display: inline</code> style on the forms.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>form {
display: inline;
}</code></pre>
<pre class="snippet-code-html... | How do I get forms inline with each other? | php|html|css | -1 | 22 | 1 | 72,207,465 | 72,207,465 | 0 | true | 2022-05-11T20:44:09.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I get forms inline with each other?<p>This probably seems like a really dumb question, but i am building a website for my school project and i need to... |
72,205,277 | Plotting graph an answer to traveling-salesman problem<p>I need to plot the graph of the solution for the TSP. I am using the TSPLIB 95 library and public problem (ch130.tsp).</p>
<p>I have been given the requirements for the assignment to solve the problem in a rudimentary 3 steps.</p>
<p>Step 1. Select randomly start... | <p>You can use the <code>edgelist</code> argument to <code>nx.draw_networkx_edges()</code> to only draw specific edges:</p>
<pre class="lang-python prettyprint-override"><code>pos = G.nodes(data="coord")
nx.draw_networkx_nodes(G, pos)
nx.draw_networkx_labels(G, pos)
nx.draw_networkx_edges(G, pos, edgelist=lis... | Plotting graph an answer to traveling-salesman problem | python|traveling-salesman | -1 | 130 | 1 | 72,208,415 | 72,208,415 | 0 | true | 2022-05-11T17:30:34.427Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Plotting graph an answer to traveling-salesman problem<p>I need to plot the graph of the solution for the TSP. I am using the TSPLIB 95 library and public pr... |
72,208,478 | Local database systems for simple application<p>I have been thinking of making a program to use in my company. I would like to store information in a (local) database and use this to keep track of the payments of my clients. I am most experienced in programming in Java. Do you have any suggestions for these databases?<... | <p>I believe you are probably looking for <a href="https://www.sqlite.org/index.html" rel="nofollow noreferrer">SQLite</a>. It is very light, basic, works with SQL,but doesn’t have any built in relational methods to link multiple tables together(JOINS, etc). As you mentioned you’ll be using Java, here’s the <a href="ht... | Local database systems for simple application | database | -1 | 34 | 1 | 72,208,591 | 72,208,591 | 0 | true | 2022-05-11T23:03:10.063Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Local database systems for simple application<p>I have been thinking of making a program to use in my company. I would like to store information in a (local)... |
72,208,536 | What's the best practice for returning an HTTP 500 error description?<p>I'm working on an API service and I'm having a dilemma on how to implement 500 reponses.
I'm not certain on which is best between sending the actual error cause or just a generic "internal server error" message.</p>
<p>The arguments I can... | <p>The best practice would be to throw a generic error message returning as little information to the client as possible. If additional context is required for debugging purposes, you can write that context to a server-side log.</p>
<p>For example, in C#:</p>
<pre><code>try
{
// Do something
}
catch (Exception ex)
... | What's the best practice for returning an HTTP 500 error description? | rest|http|backend | -1 | 422 | 2 | 72,208,593 | 72,208,593 | 0 | true | 2022-05-11T23:13:10.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What's the best practice for returning an HTTP 500 error description?<p>I'm working on an API service and I'm having a dilemma on how to implement 500 repons... |
72,205,624 | Reading and writing a public google sheet with python<p>I have a public google sheet that has a bunch of license keys. I am trying to automate the read and write process from said sheet. eg. take code, run it, mark it as used.</p>
<p>After reading <a href="https://medium.com/analytics-vidhya/how-to-read-and-write-data-... | <p>To make requests to a Google Workspace API with a Python command-line application, you need to complete a couple of steps in the Google Cloud Platform Console. In this case if you're using the Google Sheets API to access a Google Sheet even if is public, you need the following <a href="https://developers.google.com/... | Reading and writing a public google sheet with python | python|google-sheets | -1 | 62 | 1 | 72,208,917 | 72,208,917 | 0 | true | 2022-05-11T18:01:06.453Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reading and writing a public google sheet with python<p>I have a public google sheet that has a bunch of license keys. I am trying to automate the read and w... |
72,208,794 | How to set a destination for shutil.copyfileobj?<p>This code saves a discord image to the folder which it is in. I tried to set a destination for the save file, but I haven't found anything on the shutil website which sets the destination. I tried to put a destination in the shutil.copyfileobj brackets, but that didn't... | <p>Your <code>imageName</code> doesn't contain a path, so it opens in whatever is your current working directory. That's a bit unpredictable. It's also easy to fix.</p>
<pre><code>from pathlib import Path
imageName = str(Path.home() / Path(str(uuid.uuid4()) + '.jpg'))
</code></pre>
<p>You can of course replace <code>... | How to set a destination for shutil.copyfileobj? | python-3.x|python-requests|discord.py|uuid|shutil | -1 | 137 | 1 | 72,209,071 | 72,209,071 | 0 | true | 2022-05-12T00:03:35.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set a destination for shutil.copyfileobj?<p>This code saves a discord image to the folder which it is in. I tried to set a destination for the save fi... |
72,208,751 | How can I create a program to print the sum of a dictionary<p>I am writing a Python program that will accomplish the following:</p>
<ol>
<li>loop over all of the items and sum their values.</li>
<li>the user needs to input the values into the program.</li>
<li>use the split method to break up the string.</li>
<li>loop ... | <p>This is a better way of doing what you're doing...</p>
<pre class="lang-py prettyprint-override"><code>data = {}
while True:
try:
string = input()
if string == 'quit':
break
number, item = string.split()
data[item] = int(number)
except:
print('Invalid Input... | How can I create a program to print the sum of a dictionary | python | -1 | 65 | 1 | 72,209,099 | 72,209,099 | 0 | true | 2022-05-11T23:54:18.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I create a program to print the sum of a dictionary<p>I am writing a Python program that will accomplish the following:</p>
<ol>
<li>loop over all of... |
72,208,809 | can we revert change made to SQL Azure API connection?<p>I am new to Azure.</p>
<p>While editing the SQL API connection, mistakenly I added the wrong username and password for SQL server authentication.
can I revert this change to the previous version?</p>
<p>as I don't know the username and password for the database.<... | <p>One of the workarounds is to change your connection directly from the connector itself.</p>
<p><a href="https://i.stack.imgur.com/SpVTn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SpVTn.png" alt="enter image description here" /></a></p>
<p>While if you are trying to get the credentials from SQ... | can we revert change made to SQL Azure API connection? | azure|azure-devops|azure-sql-database|azure-logic-apps | -1 | 46 | 1 | 72,209,130 | 72,209,130 | 0 | true | 2022-05-12T00:06:11.163Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
can we revert change made to SQL Azure API connection?<p>I am new to Azure.</p>
<p>While editing the SQL API connection, mistakenly I added the wrong usernam... |
72,209,320 | stop code outside useeffect from keep running<p>I bulit a timmer with useEffect and setInterval but this useEffect keep running the code that is out from useEffect and i don't want that</p>
<pre><code> const [seconds,setSeconds] = useState(0)
const [minutes,setMinutes] = useState(15)
const { orderId } = use... | <p>This is the expected behavior. The purpose of calling a set state function (eg, <code>setSeconds</code> or <code>setMinutes</code>) is to cause the component to rerender. Your console.log statement is in the body of the component, so it will run every time the component rerenders. And since you're setting state ever... | stop code outside useeffect from keep running | reactjs | -1 | 28 | 1 | 72,209,492 | 72,209,492 | 0 | true | 2022-05-12T01:58:52.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
stop code outside useeffect from keep running<p>I bulit a timmer with useEffect and setInterval but this useEffect keep running the code that is out from use... |
72,206,620 | print no match found only once after iterating all entires from input file in shell script<p>I know there is a way to do it but I can't seem to remember now.
I have a small shell script which has a simple while loop and it iterates through a CSV file and has an if else loop inside it. The problem is for every line the ... | <p>Use a variable that keeps track if a match was found or not, and display the message at the end only.</p>
<p>Like this:</p>
<pre><code>#!/bin/bash
SERVICE_NAME="blablabla"
ENV="blablabla"
input_file="input.txt"
match_found="no"
while IFS=, read -r path servicename app text1... | print no match found only once after iterating all entires from input file in shell script | bash|shell | -1 | 51 | 1 | 72,209,849 | 72,209,849 | 0 | true | 2022-05-11T19:27:51.447Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
print no match found only once after iterating all entires from input file in shell script<p>I know there is a way to do it but I can't seem to remember now.... |
72,210,074 | how to add solid line between word or sentence? HTML CSS<p>I was wondering how to add these lines between words/sentences as I saw many of solution involve the <code>border-bottom-line</code> or <code>js</code>. I was just curious that can these lines be done simply just using a <code>span</code> or <code>div</code>(co... | <p>you can do it with <code>pseudo elements</code>.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.ll{
display: flex;
flex-direction: row;
}
span:after{
content: '';
... | how to add solid line between word or sentence? HTML CSS | html|css | -1 | 62 | 1 | 72,210,293 | 72,210,293 | 0 | true | 2022-05-12T04:14:53.960Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to add solid line between word or sentence? HTML CSS<p>I was wondering how to add these lines between words/sentences as I saw many of solution involve t... |
72,210,577 | Getting Error Object of type bytes is not JSON serializable in django<p>I Everyone i my trying to to convert my response to to json its getting error which i have mention in question. how can i convert this response to json as per me problem is Decimal and b(byte), please help me out.</p>
<p><strong>code-</strong> excu... | <p>The reason for your error is that JSON doesn't understand 'bytes'. So you'd need to convert the bytestring to string.</p>
<p>The following is one way of doing it.</p>
<pre><code>def s(reqeust):
car_report= connection.cursor()
car_report.execute('''select....''')
car_report_data = car_report.fetchall()
... | Getting Error Object of type bytes is not JSON serializable in django | python|django|django-rest-framework | -1 | 319 | 1 | 72,211,482 | 72,211,482 | 0 | true | 2022-05-12T05:39:30.577Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting Error Object of type bytes is not JSON serializable in django<p>I Everyone i my trying to to convert my response to to json its getting error which i... |
72,211,413 | How to add the Material UI package to React app<p>I want to add material-ui/icon package to my react app. If I run <code>npm install @mui/material @emotion/react @emotion/styled</code> in my root folder I get the following error:</p>
<p><code>Invalid package name "material-ui/icons" of package "material-... | <p>Try this <code>npm install @emotion/react @emotion/styled @mui/icons-material @mui/material</code></p> | How to add the Material UI package to React app | reactjs|npm | -1 | 386 | 2 | 72,211,626 | 72,211,626 | 0 | true | 2022-05-12T07:11:05.213Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add the Material UI package to React app<p>I want to add material-ui/icon package to my react app. If I run <code>npm install @mui/material @emotion/r... |
72,211,206 | Return JSON string in a normal way<p>From one method I'm getting string like that one:</p>
<pre><code>"{\n \"Name\": \"Next steps for pathway activities\",\n \"Options\": [\n {\n \"Name\": \"Show next steps\",\n \"ActionType\": \"PathS... | <p>If you want to have an object and perform operations on this object in the future you can use Newtonsoft.Json NuGet package.</p>
<p>Just create classes that reflects your json like this:</p>
<pre><code>class MyObject
{
public string Name { get; set; }
public IEnumerable<Option> Options { get; set; }
}... | Return JSON string in a normal way | c#|.net | -1 | 81 | 3 | 72,211,791 | 72,211,791 | 0 | true | 2022-05-12T06:51:37.920Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return JSON string in a normal way<p>From one method I'm getting string like that one:</p>
<pre><code>"{\n \"Name\": \"Next steps for pa... |
72,211,755 | When to use @Controller and when @RestController annotation in RESTApi based on Spring<p>I am new to learning Spring and I created a simple RestApi. Now in some tutorials I see that the controller class is sometimes annotated with @Controller and others are annotated with @RestController.</p>
<p>Can anyone clarify the ... | <p>It only took one quick google search for me to get a lot of answers.
Also, this question has already been answered in another SO thread, found <a href="https://stackoverflow.com/questions/25242321/difference-between-spring-controller-and-restcontroller-annotation">here</a>.</p>
<p>But quickly summarized:</p>
<p><cod... | When to use @Controller and when @RestController annotation in RESTApi based on Spring | spring|spring-boot|spring-mvc | -1 | 104 | 1 | 72,211,847 | 72,211,847 | 0 | true | 2022-05-12T07:41:11.163Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When to use @Controller and when @RestController annotation in RESTApi based on Spring<p>I am new to learning Spring and I created a simple RestApi. Now in s... |
72,212,711 | Print dictionary pretty way in Python<p>Is there any way to print a dictionary from a class in a pretty way?</p>
<p>I have a dictionary and when I print de class I want to return it with its keys and its values, like this:</p>
<p>key1: value1</p>
<p>key2: value2</p>
<p>...</p>
<p>I can't find a way to return it this wa... | <p>You can loop through a dictionary key-value pairs using <code>items</code> method</p>
<pre class="lang-py prettyprint-override"><code>def __str__(self):
d = ""
for k, v in self.__dicc.items():
d += f"{k}: {v}\n"
return d
</code></pre> | Print dictionary pretty way in Python | python|dictionary|printing | -1 | 82 | 1 | 72,212,766 | 72,212,766 | 0 | true | 2022-05-12T08:57:29.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Print dictionary pretty way in Python<p>Is there any way to print a dictionary from a class in a pretty way?</p>
<p>I have a dictionary and when I print de c... |
72,212,839 | How does one get a value from <input> in an HTML file being run in NodeJS to a MongoDB db<p>Say, I wanted to get a certain value entered by a user in an HTML being run on NodeJS to be saved in my db, how would I do that?</p>
<p>I could get the value from HTML via the DOM, sure. Say example.html were being run via NodeJ... | <p>You need to send the value from the browser back to your node server:</p>
<pre><code>+---------+ <-1- +---------+ -3-> +----------+
| BROWSER | -2-> | SERVER | | DATABASE |
+---------+ +---------+ +----------+
</code></pre>
<p>What you currently implemented is 1 (serving ... | How does one get a value from <input> in an HTML file being run in NodeJS to a MongoDB db | javascript|node.js|mongodb | -1 | 41 | 1 | 72,213,075 | 72,213,075 | 0 | true | 2022-05-12T09:06:59.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How does one get a value from <input> in an HTML file being run in NodeJS to a MongoDB db<p>Say, I wanted to get a certain value entered by a user in an HTML... |
72,210,844 | Java API POST Call with special characters<p>I currently have a POST call with HTTPClient framework using JAVA, the method is not ours and i have found an interesting problem with the special characters.</p>
<ol>
<li>The call is sending a JSON Object, not using URL parameters.</li>
<li>The call works well in my code an... | <p>Finally i solved it.</p>
<p>The problem was deep in our framework but once spotted it was an easy fix:</p>
<p>When you send an Entity as a Post Call and it have special characters, yo usually encode it. Just as ewramner suggested i checked and i confirmed that we had the entity well encoded BUT at the moment to send... | Java API POST Call with special characters | java|post|httpclient|special-characters|jsonobjectrequest | -1 | 610 | 1 | 72,213,451 | 72,213,451 | 0 | true | 2022-05-12T06:13:34.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java API POST Call with special characters<p>I currently have a POST call with HTTPClient framework using JAVA, the method is not ours and i have found an in... |
72,213,467 | How to loop through an Array in an Object PhP<p>when I call this Cpanel API <code>$result = $cPanel->execute('uapi', 'DomainInfo', 'list_domains');</code> to Cpanel Uapi I get the Object value stated below. To display the object, I use <code>var_dump($result);</code>. It works as expected. Then access main_domain va... | <p>So I got the answer from u_mulder in the comment section. To solve, I did.</p>
<pre><code> foreach ($result->data->sub_domains as $value){
echo $value;
}
</code></pre>
<p>Try that it should solve the problem.</p> | How to loop through an Array in an Object PhP | php|arrays|cpanel | -1 | 29 | 1 | 72,213,577 | 72,213,577 | 0 | true | 2022-05-12T09:51:22.383Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to loop through an Array in an Object PhP<p>when I call this Cpanel API <code>$result = $cPanel->execute('uapi', 'DomainInfo', 'list_domains');</code>... |
72,213,632 | position element as if it is the first<p>My situation is something like this:</p>
<pre><code><div id="container">
<p id="first">...</p>
<p id="second">...</p>
</div>
</code></pre>
<p>I want <code>second</code> to come before first as if it was in the... | <p>Can you test with flexbox?</p>
<pre><code>#container {
display: flex;
flex-flow: column wrap;
}
#first {
order:2;
}
#second {
order:1;
}
</code></pre> | position element as if it is the first | html|css | -1 | 44 | 4 | 72,213,763 | 72,213,763 | 0 | true | 2022-05-12T10:03:41.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
position element as if it is the first<p>My situation is something like this:</p>
<pre><code><div id="container">
<p id="first"... |
72,210,790 | Sign Board like Buttons design via css<p>Buttons design link down below</p>
<p>I need this design tried via before after but need the arrow softer
used skew and all.
also found references but that didn't work out, it seems very easy and similar design but couldn't find similar ones on the internet via examples.</p>
<p>... | <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100&family=Poppins:wght@300&display=swap');
body {
... | Sign Board like Buttons design via css | html|css|twitter-bootstrap | -1 | 50 | 1 | 72,213,885 | 72,213,885 | 0 | true | 2022-05-12T06:07:36.087Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sign Board like Buttons design via css<p>Buttons design link down below</p>
<p>I need this design tried via before after but need the arrow softer
used skew ... |
72,214,042 | Can you use the 'action' attribute for a 'div' element?<p>My question is quite straight forward and simple. I am learning node JS and I know that the 'form' element has a 'action' attribute. I just want to know if even a div element has such an attribute...</p> | <p>No, action attribute only works for form tag.
If you want to perform same as action does in form, you can use <code><a href="https://www.websiteurl.com">Wrap div with this</a></code>.
If you want to pass dynamic values like form you can provide in <code>herf</code> followed by <code>url/?id=5</... | Can you use the 'action' attribute for a 'div' element? | html|frontend | -1 | 64 | 1 | 72,214,136 | 72,214,136 | 0 | true | 2022-05-12T10:34:30.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can you use the 'action' attribute for a 'div' element?<p>My question is quite straight forward and simple. I am learning node JS and I know that the 'form' ... |
72,213,351 | CSS Grid with Angular | Don't distribute grid items equally on width<p>I have a app which has rows and columns. I can dynamically remove rows. When I remove them then the other items distribute themself equaly over the width of the grid.</p>
<p>Now I want to have something like flex, but with grid. The grid items shoul... | <p>If you have a minimum and/or a max width of the grid items that are to be distributed, you can use a combination of different grid properties to get the desired outcome, like</p>
<p><code>grid-template-columns: repeat(auto-fit, minmax(100px, 100px));</code></p>
<p>In the example below, we have a grid where the items... | CSS Grid with Angular | Don't distribute grid items equally on width | html|css|angular | -1 | 67 | 2 | 72,214,296 | 72,214,296 | 0 | true | 2022-05-12T09:43:40.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSS Grid with Angular | Don't distribute grid items equally on width<p>I have a app which has rows and columns. I can dynamically remove rows. When I remove ... |
72,213,263 | React-Redux add new value to the state<p>I am having a two step form in react. The first step of the form we ask some information to the user and then I add it to the state. The second step of the form I ask some more information to the user and add it to the state, so instead of appending the information that was aske... | <p>check this out</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>import { ActionTypes } from "../../Constant/ActionType";
const initState = {
Auth: {},
};
const AuthRedu... | React-Redux add new value to the state | reactjs|redux|state|reduce | -1 | 63 | 2 | 72,214,525 | 72,214,525 | 0 | true | 2022-05-12T09:37:41.223Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React-Redux add new value to the state<p>I am having a two step form in react. The first step of the form we ask some information to the user and then I add ... |
72,209,659 | Jetty: How do I protect unpack war file<p>I developed web that deploy ROOT.war through jetty(windows10)</p>
<p>and I will deploy that to my client</p>
<p>but I don't want to who modify my unpacked war file.</p>
<p>and I want to protect my unpacked war file</p>
<p>Someone tell me How do I protect unpacked war file</p>
<... | <p>Standard filesystem protections is the only way.</p>
<p>Jetty runs on as a specific user against it's own private temp/work directory which no other user has access to.</p> | Jetty: How do I protect unpack war file | java|spring|jsp|jetty|embedded-jetty | -1 | 77 | 1 | 72,215,387 | 72,215,387 | 0 | true | 2022-05-12T02:59:15.233Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jetty: How do I protect unpack war file<p>I developed web that deploy ROOT.war through jetty(windows10)</p>
<p>and I will deploy that to my client</p>
<p>but... |
72,213,588 | How to make the loop faster?<p>My code looks as below, I am wondering if there any better way to make it faster:</p>
<pre><code>pos=NULL
row=data.frame(matrix(nrow=216,ncol=4))
colnames(row)=c("sub","subi","group","trial")
for (i in 1:100000){
row$sub="Positive"
row... | <p>The only thing different in each pass of the loop is <code>trial</code>. <code>rep</code> is your friend. For the other columns, R will automatically recycle to match the longest column (here, it is <code>trial</code> with 21.6M rows).</p>
<pre><code>pos <- data.frame(
sub = "Positive",
subi = c(1:1... | How to make the loop faster? | r|loops | -1 | 52 | 3 | 72,215,659 | 72,215,659 | 0 | true | 2022-05-12T10:01:21.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make the loop faster?<p>My code looks as below, I am wondering if there any better way to make it faster:</p>
<pre><code>pos=NULL
row=data.frame(matri... |
72,207,750 | how to submit two actions(forms) by the same submit btn ? (php)<p>I am using code given below. I want to submit two forms values and get both values on another page <strong>listeView</strong>(ajouterAideMat.php) . By this code only values of 2nd form fetched on another page and values of first form become null. So pl... | <p>Provided code isn't clear, but Yes it is possible,</p>
<blockquote>
<p>Simple method would be use ajax ,prevent submit button s from submitting form and use ajax define statement /. function on click of submit button</p>
</blockquote>
<p>Ref : <a href="https://www.w3schools.com/php/php_ajax_php.asp" rel="nofollow no... | how to submit two actions(forms) by the same submit btn ? (php) | javascript|php|mysql | -1 | 32 | 1 | 72,216,269 | 72,216,269 | 0 | true | 2022-05-11T21:25:44.943Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to submit two actions(forms) by the same submit btn ? (php)<p>I am using code given below. I want to submit two forms values and get both values on anot... |
72,215,334 | Why my image doesn't go on height on mobile?<p>I would the image on desktop to stay the same, but on mobile to be bigger on height. What should i change in the code ? I'm using Bootstrap 5 aswell.</p>
<p><a href="https://i.stack.imgur.com/YCeT4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YCeT4.pn... | <p>Here you go...</p>
<p>I think this is impossible to achieve with Bootstrap. I would use <code>@media</code> query if I were you.</p>
<p>Add this to your CSS:</p>
<pre><code>@media only screen and (max-width: 575px) {
.col-12 {
height: 500px; // Adjust the height
}
#img1 {
object-fit: cover;
... | Why my image doesn't go on height on mobile? | bootstrap-5 | -1 | 25 | 1 | 72,216,363 | 72,216,363 | 0 | true | 2022-05-12T12:10:51.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why my image doesn't go on height on mobile?<p>I would the image on desktop to stay the same, but on mobile to be bigger on height. What should i change in t... |
72,216,650 | Passing array as a function parameter and use it<p>I have two files - <code>file1.php</code> and <code>functions.php</code>.</p>
<p>What I'm trying to do is from <code>file1.php</code> to pass an array which to use in a <code>functions.php</code>. Here is what I mean</p>
<p>In <code>file1.php</code></p>
<pre><code>if( ... | <p>Are you sure you've all the code from the file1.php ?
You need to call the function that you want to execute so I'm guessing there should be an function call in the file1.php something like</p>
<pre><code>$var_id = calcuate_users($idsArr, someyear?)
</code></pre>
<p>this would go to the function but sorry to say you... | Passing array as a function parameter and use it | php | -1 | 25 | 1 | 72,216,784 | 72,216,784 | 0 | true | 2022-05-12T13:38:08.127Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing array as a function parameter and use it<p>I have two files - <code>file1.php</code> and <code>functions.php</code>.</p>
<p>What I'm trying to do is ... |
72,217,478 | C# use multithread to write to richtextBox<p>I am writing a C# script to do a ping test on a network. I have it <em>mostly</em> working, except the part to write to richtextbox. I need to write results as the ping test is happening. I know it needs multithreading, but I have spent the past week trying to figure it out,... | <p>Well, in the code you posted you never call the method <code>RunPingTest</code> which is probably why your <code>RichTextBox</code> never gets updated.</p>
<p>However, if you want to do this asynchronously, the <code>Ping</code> <code>class</code> contains a method called <a href="https://docs.microsoft.com/en-us/do... | C# use multithread to write to richtextBox | c#|wpf | -1 | 65 | 3 | 72,218,223 | 72,218,223 | 0 | true | 2022-05-12T14:30:19.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# use multithread to write to richtextBox<p>I am writing a C# script to do a ping test on a network. I have it <em>mostly</em> working, except the part to w... |
72,218,112 | React fetch JSON data inside loop<p>I need to render a list of buttons, in which I have the value coming from one JSON (an url to an object in a server, stored in a local file), and the displayed text from another JSON (the title of the object, which I can only get through a fetch function).</p>
<p>My local JSON looks ... | <p><em>fetch</em> is an <a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Introducing" rel="nofollow noreferrer">asynchronous</a> function, i.e the rest of the code doesn't wait for it to finish executing unless explicitly instructed to do so. Instead of:</p>
<pre><code>fetch(item + "... | React fetch JSON data inside loop | reactjs|json|fetch|state|use-effect | -1 | 63 | 1 | 72,218,285 | 72,218,285 | 0 | true | 2022-05-12T15:11:51.757Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React fetch JSON data inside loop<p>I need to render a list of buttons, in which I have the value coming from one JSON (an url to an object in a server, stor... |
72,218,717 | Checking a Calculator display has one number in the innerHTML string<p>I'm working on a calculator with vanilla JavaScript. I'm trying to make an if statement to find out whether the current result displayed has only one number left in the string. If this is true I want to make sure when the user clicks the delete butt... | <pre><code>let re = new RegExp('^[0-9]$');
re.test(str)
</code></pre>
<p>or:</p>
<pre><code>str.length === 1 && "0123456789".split("").includes(str)
</code></pre> | Checking a Calculator display has one number in the innerHTML string | javascript | -1 | 32 | 1 | 72,218,929 | 72,218,929 | 0 | true | 2022-05-12T15:55:53.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Checking a Calculator display has one number in the innerHTML string<p>I'm working on a calculator with vanilla JavaScript. I'm trying to make an if statemen... |
72,203,913 | Get an list of lists with multiple attributes an obtain a new list with a specific attribute in C#<p>I have a problem manipulating lists and I don´t remember very well how to do this...</p>
<pre><code> var allUsers = _userService.GetAll();
List<string> result = new List<string>();
<... | <p>You will want to use <code>AddRange</code> of <code>List<T></code> in conjunction with the <code>Select</code> method found in the <code>System.Linq</code> assembly.</p>
<pre><code>result.AddRange(allUsers.Select(u => u.Username));
</code></pre>
<p>or simply</p>
<pre><code>var result = allUsers.Select(u =... | Get an list of lists with multiple attributes an obtain a new list with a specific attribute in C# | c#|list|dbcontext | -1 | 107 | 1 | 72,219,241 | 72,219,241 | 0 | true | 2022-05-11T15:40:14.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get an list of lists with multiple attributes an obtain a new list with a specific attribute in C#<p>I have a problem manipulating lists and I don´t remember... |
72,219,766 | What sorting algorithm is possible in o(nlogn)-time (little o notation)?<p>I am currently doing revision for my course and came across the question in the title, I wasn't able to find the answer online so I come to stack overflow for help.</p> | <p>There are no comparison-based sorts that are faster than O(N log N).</p>
<p>Radix sort is O(N) in the <em>size of the input</em>, i.e., O(num_keys * average_length), which can be considered o(n log n) in some contexts.</p>
<p>Counting sort is O(N + num_possible_values), which is also o(n log n) in applicable cases.<... | What sorting algorithm is possible in o(nlogn)-time (little o notation)? | algorithm | -1 | 34 | 1 | 72,219,935 | 72,219,935 | 0 | true | 2022-05-12T17:19:05.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What sorting algorithm is possible in o(nlogn)-time (little o notation)?<p>I am currently doing revision for my course and came across the question in the ti... |
72,220,396 | How do I make a wall in pygame?<p>I am trying to learn the basics of pygame by making a simple pacman game with a friend, but I have been having trouble figuring out how to make walls and check collision with the pacman and the wall, and also stopping the movement through a wall.
(this is a 2 player pacman, ghost is ar... | <p>To check if a circle is colliding with a wall you just need to do 2 things</p>
<p>Get the distance between the circle and the wall</p>
<p>Then check if the distance is smaller or equal to the circles distance</p>
<p>Pretty much like this:</p>
<pre><code>distance = abs(circle.x - wall.x) + abs(circle.y - wall.y)
if d... | How do I make a wall in pygame? | python|pygame|collision | -1 | 80 | 1 | 72,220,721 | 72,220,721 | 0 | true | 2022-05-12T18:18:31.983Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I make a wall in pygame?<p>I am trying to learn the basics of pygame by making a simple pacman game with a friend, but I have been having trouble figu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.