Most voted questions
150,413 questions
Sort by count of
-
3
votes1
answer159
viewsswitch case javascript (simplify this code)
I wonder if there’s any way to simplify this code... in the example 1 to 7 I want the same result but so far are few but... and if there were many numbers would have like not to have to put so many…
javascriptasked 4 years, 10 months ago PROF FERNANDO SILVEIRA 31 -
3
votes0
answers111
viewsWhat does "out" do in C# and what is the difference of the pointer?
I was playing Space Engineers and it is possible to add custom codes, called in-game script, in C#. Finally, I came across the need to use such a out, but I didn’t understand what he does and why he…
-
3
votes0
answers26
viewsHow to check all Checkboxs on my Grid? Not just the first pagination
var grid = new WebGrid( canPage: true, rowsPerPage: 10, selectionFieldName: "selectedRow", ajaxUpdateContainerId: "gridViewCV", ajaxUpdateCallback: "ajaxWebGrid"); var columns = new…
-
3
votes1
answer126
viewsHow efficient is Operator spread when copying Javascript objects?
I recently saw a comment around that talked about the performance of the operator "spread" or "scattering" in Javascript. The question essentially would be: if we wanted to copy an object and for…
-
3
votes2
answers57
viewsInput resulting in None
I was trying a new to present the texts in a basic game that I’m creating, which basically gives a sense that the text is being written The code is this below: def print_slow(txt): for x in txt:…
pythonasked 4 years, 10 months ago Wilson Bonato 45 -
3
votes1
answer3164
viewsCreate folder/directory with Node.JS
There is the module "Fs", which is used to create files: const fs = require("fs"); fs.writeFile(`./teste.txt`, "conteúdo", function (erro) { if (erro) { throw erro; } console.log("Arquivo salvo com…
node.jsasked 4 years, 10 months ago Gabriel Ribeiro 495 -
3
votes1
answer46
viewsProptypes always gives error no matter if the value is correct
I’m using the React (16.11.0) with Proptypes (15.7.2) and Hooks. And I have a component that receives an object with some data from the database. Testing the data using the console.log: {…
-
3
votes1
answer73
viewsGet-Nettcpconnection bring the event Count
How can I count the amount of return using this powershell parameter? In cmd I can execute the command below: C:\Users\admin>netstat -ano |find "8000" TCP 0.0.0.0:8000 0.0.0.0:0 LISTENING 14112…
powershellasked 4 years, 11 months ago Leandro de Matos 61 -
3
votes1
answer158
viewsRead file line by line and collect strings
I have these two functions in Javascript: function verificaExtensao($input) { var extPermitidas = ['txt']; var extArquivo = $input.value.split('.').pop(); if(typeof extPermitidas.find(function(ext){…
-
3
votes0
answers98
viewsNowadays.. How far does the front end go?
before marking as duplicate of the following question Difference between client-side and server-side. Let’s look at some facts. The previous question is from 2013 or 4 years ago, long before the…
-
3
votes2
answers440
viewsHow to do a subtraction operation between two columns of a dataframe and then add the result with another column?
I have this code: dados_train = pd.read_csv('arquivo.csv', delimiter=",") y = ((dados_train.pop('col_name1') - dados_train.pop('col_name2')) + (dados_train.pop('col_name2') When I try to run just…
pythonasked 4 years, 11 months ago Patricia Padula Lopes 183 -
3
votes0
answers113
viewsReturn repeated elements within an array
How to pick up only the repeated elements within an array? I have for example: let array = [1, 2, 2, 2, 3, 3, 4, 4, 5, 6, 8, 8, 9, 9]; And I want to return all duplicates to get: [2, 3, 4, 8, 9 ] If…
-
3
votes1
answer109
viewsHow to use await instead of . then() in Javascript?
I have this asynchronous code: const delay = () => new Promise(resolve => setTimeout(resolve, 1000)); async function umPorSegundo(){ console.log(await delay(), '1s') console.log(await delay(),…
-
3
votes1
answer770
views$router.push is not working in Vuejs
Good evening, I’m starting my studies in web development and I chose Vuejs with Vuetify to begin with. Right away I’m not getting a page change by clicking on a button. I installed the Vue-router by…
-
3
votes1
answer1083
viewsLimit contents of an Array
How can I limit the number of values/indices of a array? For example: let arr = [1, 2, 3, 4]; console.log(arr) // Exibirá: [1, 2, 3, 4] Goal: //Reduzindo o limite de índices do array para 2:…
-
3
votes1
answer97
viewsHow to make a list of recursive iterations - Python
I am implementing a python Hanoi tower and I need a log of all moves. It could be a list of the states of the 3 stacks. But when I try to use the append function for this list/log, the result is the…
-
3
votes4
answers101
viewsDealing with dates of heterogeneous formats in R
I have 236 files in . csv that have all the same columns. My goal is to join them all into one data frame only. However, each of them has 4 columns with date and time values. The problem is in the…
-
3
votes1
answer198
viewsMethod "include?" returning false when there is a character in the Ruby string
I’m a beginner in Ruby and I’m trying to create a Hangman game to test my language skills. In a part of the code, I need to get a letter chosen by the user and check if that letter is present in the…
-
3
votes1
answer77
viewsHow to express a predicate of equality in Java?
I have the following expression: final String idStatusAutorizada = ...; // valor constante return pendencias.stream() .map(TipoBlocCarga::getIdStatus) .anyMatch(idStatusPendencia ->…
-
3
votes1
answer66
viewsInsert an information into two Collections in Mongodb with Node.js
I have two degrees: courses and participants. an attendee when enrolling in a course, when I give a GET in any course, needs to return the enrolled attendees(participants) and when giving a GET to…
-
3
votes1
answer721
viewsGet IP from the computer that is accessing application via Node.js
I have an application . Net where for each access is recorded log with IP of the access machine, time etc. No. Net I use Request.UserHostAddress in the login POST to pick up the IP of the machine…
node.jsasked 4 years, 11 months ago Deividson Oliveira 503 -
3
votes1
answer41
viewsHow to define the possible values of a string in an iterface from an object?
I have that class Item: class Item { nome: string; idade: number; } And that interface ConfItem: interface ConfItem<TypeItem> { titulo: string; } How do I make for the title in ConfItem…
-
3
votes3
answers1393
viewsWhat do I need to know to work with C#backend?
What are the main technologies, tools, finally, what is needed to work with backend using C#?
-
3
votes1
answer2683
viewsUse status code 422 for Invalidargumentexception type exceptions
According to the PHP documentation the exception InvalidArgumentException should be used when an argument not expected by the application is received. Second status code 400 and 422 on the website…
-
3
votes1
answer1001
viewsHow do I update a component and go back to its initial state?
Authentication: It has a login screen produced with native language (React-Native), which when logging into a remote server through a webservice, accessed by an imported component within my app,…
-
3
votes1
answer59
viewsIs there any way to style the resize button?
Example: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">…
-
3
votes2
answers327
viewsJavascript run one click at a time
I have a problem when I click the button it triggers the function the amount of times clicked. when I click 3x in a row it fires the same 3x function generating slowness. how do I solve, code:…
-
3
votes1
answer60
viewsError installing R Rsqlite package in Windows10
While trying to install R Rsqlite package on Windows 10 I get the following error message. make: *** [C:/R/R-3.6.1/etc/x64/Makeconf:215: DbDataFrame.o] Error 1 ERROR: compilation failed for package…
rasked 4 years, 11 months ago Sandro Henrique Antunes Ribeir 31 -
3
votes2
answers127
viewsTotal nodes of a perfect binary tree
I have a perfect binary tree of height 10, which is the calculation to discover the amount of knots?
asked 4 years, 11 months ago user170877 -
3
votes1
answer65
viewsMessage from the validate datetimepicker
Good morning, everyone, I’m having a problem with my form validate() with the datetimepicker in a modal, the message is showing up to the right of the input and before the button, I need it to…
-
3
votes1
answer194
viewsRefresh token requests delayed
How to make the token be created at the same time the method gets: The way I implemented it, it checks that the token was created, but the token used for the request is the expired token. Only after…
-
3
votes2
answers299
viewsDo I need to open a Mysql connection for each PHP query?
I need to get several variables based on my bank to mount a full Dashboard. For example, I need the number of lines, the average value of a given field and the same average value only per FU. The…
-
3
votes1
answer88
viewsIs it possible to have a list as an attribute of a table in a relational database?
I’m doing a Java project using Sqlite as a relational database. Basically the project is a database of passwords, where a User can have several registered platforms and each platform having its…
-
3
votes1
answer1343
viewsThe Truth value of a Series is ambiguous. Use a.Empty, a.bool(), a.item(), a.any() or a.all()
I am a layperson in programming, in the stackoverflow community and I am not able to solve the following problem: Create two lists (or if you prefer 2 columns in a New Dataframe) in which you search…
-
3
votes4
answers1367
viewsSave dates in the right format (Orange)
Using Laravel 5.8, I’m using dates. I can even show the date in the right format, using Carbon. Data de Validade {{\Carbon\Carbon::parse($p->dt_validade)->format('d/m/Y') }} However I can only…
-
3
votes0
answers49
viewsUse a timer function to create multiple animated balls
Hello, I am learning Javascript and would like to know how to create several animated balls. I thought of creating this function so I didn’t have to repeat the code for all the balls: const canvas =…
-
3
votes2
answers304
viewsHow to get components beyond the standards in Fullcalendar?
I would like to know how to get other components (besides id, title, start and end) in Fullcalenda. I have a table, in the database, which has several fields such as status, responsibility,…
-
3
votes1
answer40
views -
3
votes4
answers1016
viewsExchanging elements in arrays with a function. How to do?
I apologize in advance for the beginner’s doubt, but I’m stuck in the next problem. The exercise asks us to declare a function called "replace" that has two arrays (arrayA, arrayB) and then remove…
javascriptasked 4 years, 11 months ago kathryn 47 -
3
votes2
answers106
viewsHow do I get a variable in another method?
I declared a variable within the class Main and I want to use it within a method, as I put it there? public class Main { static Scanner entrada = new Scanner(System.in); Aluno aluno = new Aluno();…
-
3
votes1
answer248
viewsFormatted printing that replaces the use of . format() in python versions from 3.6 onwards. How to use?
We know that: "{0}:{1}:{2}".format(hora,minuto, segundo) is equivalent to: f"{hora}:{minuto}:{segundo}" What is the equivalent of the expression below using the notation f" " ?…
-
3
votes6
answers2258
viewsExercise: loop and for
Run a function called passandoPor printing on the console "here I have the value of x" where x will be the value of i for each iteration, for each value from 0 to 3. The code I made was this below!…
-
3
votes3
answers398
viewsIntersection between pandas columns
Considering two dataframes like the ones below: import pandas as pd df = pd.DataFrame({'id':[3,6,9,12,15]}) df1 = pd.DataFrame({'id': [2,4,6,8,10,12,14]}) How to account for the intersection between…
-
3
votes1
answer153
viewsAny more pythonic way to solve the problem below?
Create a function that returns the expression value: 2/3 + 3/5 + 4/7 + 5/9 + ... + n/m, to a user-defined value of n. Check that the user-defined n value is positive and, if not, request another…
-
3
votes1
answer464
viewsWorking with PDF files on Nodejs server
Hello, I have a service that when performing a request via Postman for example, I get a file . pdf I’m calling this service from a new service nodejs, but I’m not getting the . pdf returned in a…
-
3
votes1
answer119
viewsHow do you protect a stateless API built on the Adonis framework against CSRF and XSS attacks?
Consider a REST API stateless with all endpoints protected with authentication, except endpoint for authentication. The authentication endpoint returns a JWT which is later sent in all requests…
-
3
votes2
answers3755
viewsOpen new tab using Selenium and python
I’ve tried everything. Here’s the thing. I open a page using selenium and the python language, then I try to open a new tab, and then go to that new tab, then close this tab. That’s it. But in…
pythonasked 4 years, 12 months ago André Oliveira 43 -
3
votes3
answers12331
viewshas been blocked by CORS policy: No 'Access-Control-Allow-Origin'
I am developing an integrated Java Backend (Rest Spring) with Angular Front 8. When trying to list the list of users(via JSON) I get this message: Access to Xmlhttprequest at…
-
3
votes3
answers843
viewsShow the amount of each alphabet letter in a String
I’m doing an exercise in Java where the user enters with a sentence. After that, I have to list how many letters there are in the sentence, for example: Input = Daniel Henrique Exit: A = 1 B = 0 C =…
-
3
votes2
answers96
viewsDeserializing JSON in PHP
Good afternoon, I’m having some doubts in PHP. I have a PHP file responsible only for presenting a CPF in JSON format, and with another file I am trying to consume this data to present on screen.…