Most voted questions
150,413 questions
Sort by count of
-
7
votes3
answers455
viewsWhat is Google One Tap?
Browsing some sites, I saw a pop-up saying I can login using my google account: I wonder what exactly he is. I got to that website however it does not have many details of its functioning and how I…
-
7
votes4
answers349
viewsHow to make an element cross the screen continuously and always visible?
I have a CSS animation of an element that crosses the entire screen, from right to left, continuously infinitely: #slider{ position: absolute; top: 50px; right: 0; background: red; width: 150px;…
-
7
votes1
answer115
viewsDoubt strings Pyhton
I created an algorithm that encrypts words and messages. To work it needs a simple numeric key, such as 9, 4, 2, where the first letter will be displaced 9 positions, the second 4, etc. All running…
-
7
votes1
answer2366
viewsHow to assign the result of a Promise to a variable?
Even reading this one another question of the site, I still do not understand why I can not withdraw a value from within a Promise. How do I do that kind of assignment? The idea is to execute…
-
7
votes2
answers136
viewsImprove code jQuery
I made a simple code for a button to open a sidebar, but I find this code repetitive, I wonder how I can improve it. $('.openbtn').click(function(event) { event.preventDefault();…
-
7
votes2
answers969
viewsWhat is the usefulness of the service layer in the Laravel?
What is the real usefulness of a service layer in the structure of Laravel? It’s just about separating the code from the Controller? How to use this layer correctly? My biggest question is whether…
-
7
votes1
answer2734
viewsWhat is the difference between r+ and w+ modes in Python?
I need to open a file to read and write at the same time, I was in doubt to choose between access modes. If I open the file like this: open('output.txt', mode='r+') Or open like this:…
pythonasked 5 years, 6 months ago Thiago Krempser 1,878 -
7
votes2
answers707
viewsAre class methods recreated for each instance in Python?
By what I observed when generating an instance of a class all class methods are recreated in a different memory position as in the excerpt below: class Foo(): def __init__ (self): self.x = 10 def…
-
7
votes1
answer8513
viewsHow to do Localdatetime(Datetimezone.forID("America/Sao_paulo")) in Java.time
I wonder if there’s any way to mimic that code on java.time: LocalDateTime(DateTimeZone.forID("America/Sao_Paulo")) I don’t work very well with date in Java, if you can also explain to me what this…
-
7
votes3
answers1301
viewsHow to catch the element where my cursor is?
I’m creating some functions for the text editor Alloyeditor. Then I came across the need to acquire the element in Jquery that the cursor is present. I just don’t know if there is any way through…
-
7
votes4
answers2085
viewsDoes the date conversion always remain in en-BR?
I’m trying to convert a date in Asp.Net MVC to yyyy-MM-dd, what happens is that always when I convert and display this date it gets dd/MM/yyyy and I don’t know why it happens. How to solve this?…
-
7
votes3
answers1856
viewsHow do NOT differentiate upper and lower case with index?
I have the following function: var name = $(".infoname").text(); if(name.indexOf("Carro")!=-1) { alert("existe"); } else { alert("não existe"); } How can I make for the indexOf do not differentiate…
javascriptasked 5 years, 7 months ago Josimara 1,965 -
7
votes4
answers4763
viewsDelete multiple rows from a database
I’d like to delete several figures. For example this would be to delete a line delete from paginasimagens where idPaginasImagens=121; my values are sequentially so a method that is between elements…
-
7
votes1
answer2286
viewsWhat is the difference between "git push" and "git Sync"?
After I make one git commit to save the changes to my local repository, I can upload them to the remote repository using both the command git push how much using the command git sync. What’s the…
gitasked 5 years, 7 months ago Thiago Krempser 1,878 -
7
votes4
answers4137
viewsIs there a "main()" function in Python?
In some languages, as in C, we have the function main() which is usually the default entry point of the program. There is something similar in Python?
-
7
votes1
answer177
viewsCreate a program that draws 6 numbers and shows how many times it was drawn
I’m making a program that draws 6 numbers (1 to 6) 1 million times and in the end shows how many times was drawn, but I have a doubt in the code, I’m optimizing in vectors not to use if, but in the…
-
7
votes1
answer265
viewsmake Sankey diagram with two-way links R
I have the following data I use to make the Sankey diagram: list(nodes = structure(list(name = c("1.1.1. Formação Florestal", "1.1.2. Formação Savanica", NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
-
7
votes1
answer170
viewsDoes DDD restrict code writing based on the client’s language?
My little knowledge about DDD has been subpoenaed and would like to know more about. The DDD restricts code writing based on the client’s language because of the ubiquitous language?
java c# software-engineering software-architecture dddasked 5 years, 7 months ago Thiago Cunha 1,356 -
7
votes1
answer309
viewsJava how to compare "float" to "null"?
public class NuloOuNao { public static boolean isZero(float num) { if(num == null) { return true; }else { return false; } } public static void main(String[] args) { isZero(10); } } Row 5: The…
-
7
votes2
answers506
viewsWith making CSS a Carbon Fiber type background? Is it possible to make carbon fiber style background with CSS?
I’d like to create a patter to my background in order to simulate the texture of carbon fiber. Like this image, or something close to it. What I have so far is this... It doesn’t have to be exactly…
-
7
votes1
answer926
viewsWhat would be WSGI?
I was reading about the term WSGI to understand a little more the operation of web applications in Python, and I realized that some microframeworks like Flask uses this technology. However, I still…
-
7
votes2
answers94
viewsProblem when typing str in Python
I wrote that code: while True: try: n1 = int(input('Digite o número 1/5: ')) except ValueError as e: print("Digite um número:",) if ValueError: n1 = int(input('Digite o número 1/5: ')) try: n2 =…
-
7
votes1
answer521
viewsHow to correctly multiply the decimal type in C#?
I’m multiplying monetary values in C#, and for that I’m using the type decimal to store these values. I have noticed that in it there is a method called Multiply(), which receives two values and…
-
7
votes7
answers1103
viewsRemove part of string until nth occurrence of a character
I have a string that always returns in any of these formats: "0001>0002>0003>0004>0005" "abcdef>ghi>jkl>mnopqr>stuvx" Always has the character > dividing something.…
-
7
votes3
answers5954
viewsHow to upload to Laravel 5.7
Controller <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Denuncia; use Illuminate\Support\Facades\DB; class AlunoController extends Controller { public function…
-
7
votes2
answers990
viewsLaravel Restful Api - JSON errors instead of HTML
How do I get the controller to automatically return a replay to the client in JSON format instead of HTML in case of an error (e. g. error 404, 500, 419, etc.). For example, if there is error 500 in…
-
7
votes2
answers173
viewsSearch range of numbers (string type) with Expression Lambda?
I have this data model and I don’t know how to do the instruction lambda: public class CidadeAbrangencia { [Key] public int CidadeAbrangencia_Id { get; set; } public string CEPInicial { get; set; }…
-
7
votes3
answers1959
viewsWhere should I really keep my JWT token?
In many tutorials (mostly Single Page Applications), the most common authentication method is JWT token. The problem is that most of them recommend persisting this token in the localStorage browser.…
-
7
votes4
answers1423
viewsHow to build custom queries using Entity Framework?
I have an SQL Server database that is accessed via ORM Entity Framework Core, where access to a collection of products, these products are filtered through a DTO that has the terms of the search,…
-
7
votes4
answers315
viewsHow to apply several functions to the same object?
How is it possible, in the R, apply several functions to the same object? Example: Let’s say I have a vector x. set.seed(123) x <- rnorm(10) x # [1] -0.56047565 -0.23017749 1.55870831 0.07050839…
-
7
votes2
answers292
viewsCumulative count of group occurrences on dates
I have a data set similar to the one below. It has a column with dates and another with occurrences of groups on these dates. data grupo 1 2019-01-01 a 2 2019-01-01 a 3 2019-01-01 a 4 2019-01-01 a 5…
-
7
votes1
answer146
viewsWhat is the purpose of the keyword "export"?
I created a angular design to start my learning and I am currently using Typescript to do the App. However, a question arose regarding the keyword export (if it really is a keyword). I used it to…
-
7
votes1
answer475
viewsWhat are application and domain services in Onion Architecture?
In Onion Architecture there is the core (application that includes domain objects, Domain Services and Application Services): I am in doubt about what the last two are (Domain services and…
-
7
votes3
answers1494
viewsWhy is Python so current?
I noticed that the world’s leading sites (Google, Facebook, Youtube) still use Python. I found in several sites the advantages of using Python (simplicity, robustness...), but I still follow with…
pythonasked 5 years, 9 months ago Luiz Augusto 2,482 -
7
votes1
answer145
viewsHow to exchange information in full-duplex mode?
Note the two codes below: Client. c: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <netdb.h> #include <unistd.h> #include <arpa/inet.h>…
-
7
votes2
answers630
viewsHow to check if any text was selected before copying it?
I have a table with several information, in local server. I use a jQuery to detect when I click on a line and pass this information via GET. On the same page, I treat this information with PHP…
-
7
votes2
answers80
viewsWhy does image transparency on the Firefox Button not work?
I have this code that is nothing more than an image with opacity inside a button. Chrome works normally, but Firefox is bugged, as you can see. Follow the code for the image above: button { padding:…
-
7
votes1
answer103
viewsHow can I define line breaks between elements of a layout?
I’m adding CSS and HTML and one of the doubts that always arise to me is in the way I should define the line break between elements of a layout. For example: <p>Nome</p> <input…
-
7
votes1
answer73
viewsLimiting the number of regex Matches with Python
I’m having a little trouble, I’d like to create a for in the Python to return a specific amount of match of regex. The way I did, he’s returning all the links that exist and that meet the defined…
-
7
votes1
answer318
viewsIs it possible to make CSS an infinity symbol with one circle passing through another?
I’m trying to make this way. Notice how one circle seems to pass inside the other... However I am not able to make an element "go through the other" with CSS, is it possible to arrive in this form…
-
7
votes1
answer1335
viewsIs it possible to "force" Javascript typing?
In PHP I’m used to creating a function and can declare the types of parameters I want, even knowing that the language is weakly typed, but in JS I can do this? Example in PHP: <?php class Teste {…
-
7
votes1
answer487
viewsWith CSS is it possible to make a hollow circle in an image?
I wanted to put a "leaked" area on the image, so that the image has an empty area and I can see the background that is behind that image. Example. I managed to get here, but I can’t place the image…
-
7
votes1
answer146
viewsWhat is Tree Depth and height?
I asked the question What is Breadth First and Depth First?. Perhaps a slightly simpler subject matter would be what are the depth and height of a tree structure. And why this matters in the data…
-
7
votes2
answers504
viewsReplace ")" by space using str_replace_all() in R
I got the following data.frame: cadastros <- data.frame( email = c('[email protected]', '[email protected]', '[email protected]', '[email protected]'), telefone = c('(61)99831-9482',…
-
7
votes2
answers339
viewsWhy does String hashcode() in Java use 31 as a multiplier?
In Java, the code hash for an object String is computed as s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1] using integer arithmetic, where s[i] is the i-nth character of the string, n is the string…
-
7
votes2
answers2451
viewsReact, why use props in the constructor?
Why should I wear props within the constructor and of props? constructor(props){super(props)} Why use props in the constructor? Why use props in the super? Why use super?…
-
7
votes1
answer99
viewsDouble rule in LIMIT
I have a news table with the fields titulo, conteudo and destaque, being the highlight int(1), is a boolean value just to check whether a news is featured or not, what I would like to do is select a…
-
7
votes2
answers232
viewsAbaloada shape with CSS how to do? How to make a Shape in this kind of aredondado format?
I would like to make an element half round, it is not an ellipse, nor a circle, nor an element with border-radius. It’s a kind of rounded shape as you can see in the image below and I couldn’t do it…
-
7
votes1
answer657
viewsReact Component vs Stateless Functional Components
I know that in React there are two types of declaration for a component. React Component export default class App extends Component { render() { return ( <Elemento/> ); } } React Stateless…
reactasked 5 years, 10 months ago João Pedro Schmitz 2,974 -
7
votes0
answers166
viewsHow to learn object orientation correctly?
A lot of the "OO" code you see around is procedural. I have already committed and continue to commit several "sins" per day by programming OO. The paradigm is not easy to learn and it takes time,…
oop software-engineering software-project programming-principlesasked 5 years, 10 months ago Piovezan 15,850