Most voted questions
150,413 questions
Sort by count of
-
4
votes2
answers673
viewsHow to identify if the user is at the top of the page?
When entering the site the page will be displayed from the top (by default), how to do to identify if the page is at the top using Javascript pure and jQuery? Examples: If the page is at the top,…
-
4
votes2
answers115
viewsHow to read comments of a class, function or method?
I’ve seen some implementations in the Symfony and Laravel framework that allow you to define through comments routes in controller methods, or the Doctrine Models' Annotation definitions. Sort of…
-
4
votes2
answers106
viewsFunction with a pointer?
Enunciation: A student’s grade is calculated from three grades awarded from 0 to 10 respectively to laboratory, a bimonthly evaluation and a final examination. The average three notes mentioned…
-
4
votes1
answer66
viewsCan any project be suited to the principles preached by SOLID? What are the steps to this?
I am trying to adapt one of my projects to the standards of SOLID, but I’m not getting out of ground zero. The project in question can be found at: https://github.com/crphp/webservice After some…
-
4
votes2
answers1213
viewsIs there any way to connect Python to a Websocket as a client?
Modern browsers own the object Websocket, which allows you to make a connection to a Websocket server, allowing real-time communication. My question is this:: Is there any library, in Python, that…
-
4
votes1
answer191
viewsWebcrypto keys derived from PBKDF2
I’m using PBKDF2 in Webcryptoapi to generate a "derivable" key based on a user input (a password) and derive a key from it AES-GCM. I’m doing a round of tests where: in the first round Gero the keys…
-
4
votes1
answer299
viewsHow do I use the break command within two loops in Ruby?
When the "break" command is executed in "if" there is a way to exit the internal and external loop ? not just one ? while (i < maior) do if tam1>tam2 for i2 in 0 .. tam2 do…
-
4
votes2
answers242
viewsHow to leave checked option when clicking div
There is a website where the customer should choose a cor and tamanho for certain product, what I have today are Divs that show colors and sizes but I’m not able to leave the option marcada when…
-
4
votes2
answers711
viewsIssue discriminant function constant - linear discriminant analysis [R]
How to issue the discriminant function constant (or constants, if multiple discriminant analysis)? Follows the dput for assistance in response. structure(list(REAÇÃO = structure(c(0, 1, 0, 0, 1, 0,…
-
4
votes2
answers646
viewsEnable HTTPS on Amazon Beanstalk in Spring Boot application
I’m finding it difficult to enable the HTTPS in an app on Amazon Beanstalk in single instance. The application is developed in Java (Spring Boot), with embedded Tomcat and for deployment I used the…
-
4
votes1
answer193
viewsJPA ordered return from the Many side of an @Onetomany entity using @Orderby
I have the following entity Cliente who owns Pedidos. The relationship between customers and orders is mapped with Cliente @OneToMany and Pedidos @ManyToOne. What I need is for the Customer Order…
-
4
votes4
answers2971
viewsIdentify how many days the month has (28, 29, 30, 31)
Is there any native function who identifies How many days is the month? Example: Step the value: 2018-08, then the return would be: 31. $dias = funcao('2018-08'); echo $dias; // resultado: 31 If not…
-
4
votes2
answers522
viewsDynamic allocation of vectors
Follows the statement: Make a program that reads keyboard numbers and store them on one dynamically allocated array. The user will type in a sequence of numbers, no quantity limit. The numbers will…
-
4
votes1
answer94
viewsCustomizing URI templates using Odata
I am working on a project that contains the package Microsoft.AspNet.WebApi.OData, which offers a well-simplified implementation to support Odata V3 by simply using the Attribute…
-
4
votes1
answer483
viewsWhen and where to handle exceptions with Laravel in developing an API
I’m having some doubts when it comes to handling errors in an API. We should always treat an Exception? It would be correct to return a message like the one below? Return: { "success" : false,…
-
4
votes3
answers465
viewsJoin arrays by equal keys, but separating values
Scenario (example): I have 2 Arrays, X and Y (dynamically created, individual): $arX = Array('AAA' => 173.696, 'BBB' => 72.436, 'CCC' => 142.692); $arY = Array('AAA' => 127, 'DDD' =>…
-
4
votes1
answer247
viewsSonarlint, complexity of the "equals() method"
Sonarlint for Eclipse, accuses error: Refactor this method to reduce its Cognitive Complexity from 64 to the 15 allowed. Rewrite this method to reduce your cognitive complexity of 64 for 15 allowed…
-
4
votes2
answers222
viewsBold "<b>" does not apply in a range
In a table, if I apply bold (<b>) out of cells (<td>), it doesn’t work: <table> <tr> <b> <td>Cell A</td> <td>Cell B</td> <td>Cell…
-
4
votes1
answer313
viewsC/C++ standard libraries
What’s the downside of using libraries standards such as the function getch() and the library conio.h, What is the downside of using such libraries from a development point of view? More precisely…
-
4
votes3
answers1001
views(Python) Find words with total vowels being even
I’d like to ask for your help. I have a code in Python where a part is missing: parse the words of a sentence and save the ones that have an even number of vowels. Example: "I came home and went to…
-
4
votes1
answer129
viewsWhen is the destroyer of an object called in C++?
Let’s assume I have a function: std::string empty_string() { std::string x{ "" }; return x; } As normal as it sounds, it gets a little fuzzy when we think: When the destroyer of the object x is…
-
4
votes1
answer910
viewsCustom resize of a div
How to customize the resize so that it is possible to resize anywhere at the bottom of the div Example of the stackoverflow: .caixa { background-color: #444; /* margin: 100px auto; */ height: 100px;…
-
4
votes1
answer394
viewsValidating USB Serial Port Name
People, I am doing the approval of a scale in c#, I can make the communication via code all right, however when making the connection, I need to specify the name of the port, I have other connected…
-
4
votes2
answers465
viewsHow to change the JSON serialization format of PHP Datetime?
In PHP, when I use a json_encode on an object of the type DateTime, it displays the following result: $date = new DateTime(); echo json_encode(compact('date'), JSON_PRETTY_PRINT); Exit: { "date": {…
-
4
votes2
answers3999
viewsHow to define the SET CLIENT_ENCODING = UTF8 permanently?
I am using Postgresql in my DATABASE Accent information is being recorded with accent problems. Ex: It records like it is. Shark records as Shark The encoding of my DATABASE and my server are using…
-
4
votes1
answer533
viewsWhat is the difference between Task and async Task?
In the code below I wrote two methods, one with the return Task and another async Task. What happens differently in the execution of these methods since for one added in the construction the…
-
4
votes1
answer2755
viewsGROUP BY in query with column by subquery
I have the following select: SELECT A.CARRO, (SELECT TOP 1 VALOR FROM tab2 B WHERE B.DATA <= A.DATA ORDER BY B.DATA DESC) VALOR FROM tab1 A In (SELECT TOP 1 VALOR FROM tab2 B WHERE B.DATA <=…
-
4
votes3
answers216
viewsHow does date comparison work using . toLocaleDateString();?
It is a doubt that I have some time and I can not find an answer anywhere on the internet (I searched here and on Soen). given the following code: var hoje = new Date(2018, 08,…
javascriptasked 6 years, 2 months ago Máttheus Spoo 1,746 -
4
votes0
answers207
viewsHow to make a mock in an android class at runtime?
I am having a certain difficulty in the tests, I wanted to know if there is a possibility to simulate a custom return in a method at runtime example: @RunWith(JUnit4.class) public class TesteSmile {…
-
4
votes1
answer1179
viewsAdd value to a date with PHP
I’m having a problem adding up a date that comes from the database that comes in the following way: Ex.: 10/05/2018 17:48:27 I am using the following method to add days to that date: date('d/m/Y…
-
4
votes3
answers702
viewsFunction that takes another function as a parameter in C#
In the language Lua has how to create a function that takes as argument another function, for example : exemplo = function(outrafunction) outrafunction() end exemplo(function print("alguma coisa")…
-
4
votes1
answer7418
viewsHow to insert white spaces - Javascript
I am doing some exercises and one of them asks me to create a code that reproduces an "ASCII art", I read about and saw that it was a special character and I tried to insert the space in its Unicode…
-
4
votes2
answers2601
viewsLink "Share on Whatsapp"
Based on this code <li><a class="whatsapp" title="<?php esc_html_e( 'Compartilhar no WhatsApp', 'grandmagazine' ); ?>" target="_blank" href="whatsapp://send?text=<?php…
-
4
votes1
answer1332
viewsWhat _: and _
What does _: and _. mean in the definition of functions as in the example below. constructor(){ router.events.subscribe((_:NavigationEnd) => this.currentUrl = _.url); } I have many doubts about.…
-
4
votes3
answers681
viewsExtract date with Regex
I’m trying to extract a date from a string, but I’m not getting it. Example: String stringQualquer = "um teste qualquer12/02/1998 19/09/1880 Nulo"; I want to pick up the first date of this example…
-
4
votes2
answers3370
viewsBring Datatable columns by Datatabe Ajax itself
Is there a way to bring Datatable columns through the API from Ajax? As an example we have this following code $(document).ready(function() { $('#example').DataTable( { "processing": true,…
asked 6 years, 3 months ago Bruno Carvalho Silva Correa 53 -
4
votes1
answer390
viewsObject Serialization (serialize/unserialize)
I was looking at a topic about serialize in PHP. A very interesting function, but in view, very little used. About the function, I would like to know: An example of where would apply this function…
-
4
votes1
answer75
viewsC# float++ and float-
I used the following code snippet: bool plus = false; int index = 0; index = plus ? index++ : index--; the index result is 0 and do not know why, when I do the way below it works: index += plus ? 1…
c#asked 6 years, 3 months ago Roberto Gomes 455 -
4
votes1
answer180
viewsWhy does Floattostr exist if Delphi does not possess the Float data type?
Reading about the data types of Delphi/Pascal I realized that there is no type Float, however, there is the function FloatToStr(), as well as StrToFloat(). In this case, you could use floating point…
-
4
votes1
answer112
viewsHow to print a hexadecimal value in high box?
I made a program in C++ that reads a number and prints it in hexadecimal, follows the code below. #include <iostream> using namespace std; int main(void) { int n; cin>>n;…
-
4
votes1
answer2112
viewsCommunicationexception: Error in client making HTTP (HTTP.SYS) request to third party Webservice
I’m developing for the eSocial for more than a year now, and, I am finding the following error in some customers, when trying to send to the service: System.ServiceModel.Communicationexception:…
-
4
votes1
answer256
viewsWhat is the purpose of a TT extension file?
Well, I was searching around the Internet for a way to create a string as template, based on an archive of template. I came across an answer from SOEN that talks about files .tt, to use a template…
-
4
votes5
answers1314
viewsHow to turn a Pyqt5 project into an executable?
I would like to know what would be the best way to convert an application Pyqt5 to an executable application. Is there any way to "compile" an application in Pyqt5? Is there any way to create an…
-
4
votes3
answers354
viewsClose() method in Try and catch blocks is necessary?
I am studying Java with database and after seeing a little more about this method close() and this protected block, I was a little confused, because in some codes and articles I see that was not…
-
4
votes3
answers16658
viewsHow to round up with Python?
Is there a native Python way to top up? Example: 10/3 resulting 4. What I’m wearing now is a parole: x=10 if x % 3 != 0: x += 1 But that’s not very practical.…
-
4
votes0
answers160
viewsHow to make the player move on "slide" in Unity?
I’m new to Unity and I’m doing the tutorial Roguelike 2D. By default the player will move, theoretically, using one of those coordinates per shift y+1, x+1, y-1, x-1, or just one block at a time.…
-
4
votes1
answer204
viewsSuggested script for creating an HTML tree?
Hello, I would like to know if there is a program of some kind that allows me to quickly create an html tree, as in the example: I would like to add along with the tags on the chart, the class name…
-
4
votes2
answers49
views -
4
votes1
answer157
viewsProblem generating javascript graph using Spring
I’m implementing Graphics in a web application I’m developing in Spring. I already made my API, it is bringing Json with all the information of my object Cart, however the graphic is not being…
-
4
votes1
answer2127
viewsHow to add Microsoft.ACE.OLEDB.12. 0 to my app’s installer . NET?
Hi, I have an app that I programmed through Visual Studio 2017 using the Microsoft.ACE.OLEDB.12.0 to consult on files Excel and return data. Now that I finished the project I had to publish. But…