Most voted questions
150,413 questions
Sort by count of
-
10
votes5
answers5611
viewsDraw square on the canvas using wire fences (#)
Hello I’m starting to program in python and I’m having a hard time doing an exercise where I have to do a rectangle with "#". largura = int(input("Digite a largura: ")) altura = int(input("Digite a…
pythonasked 8 years ago Angelo Spinardi 103 -
10
votes2
answers256
viewsHow to print only the first 5 characters?
I need it to be displayed up to a maximum of 5 characters of the contents of each table cell in a specific resolution. I don’t know if there are any Pseudo Elemento do what I need, something like:…
-
10
votes3
answers228
viewsWhat is the default value for the "resize" attribute in a textarea?
How to leave a textarea adjustable after it was set "resize: None"? For example, I have a textarea which has a value defined as resize:none in CSS, but I want to leave the default value by placing…
-
10
votes2
answers3515
viewsWhat is the difference of an empty string and NULL in SQL?
What’s the difference of storing a string as NULL or empty in SQL? How these two can behave when I go to make one SELECT, or INSERT worthwhile '' in that column which is of the type varchar? If I…
-
10
votes1
answer152
viewsSealed class, with private constructor, versus Static class
When "studying" this class, I checked that it is sealed and has the private builder: public sealed class Interaction { /// <remarks> /// CA1053: Static holder types should not have public…
-
10
votes1
answer4201
views"__" or "Dunder" methods in Python, which are the most used?
In Python there are "Magic" methods, such as __len__, that allows the use of Len(Object), in addition to the one in specific, which are the most used that can facilitate the use of the structure ?…
python-3.xasked 8 years ago Arthur Silva 186 -
10
votes4
answers2392
viewsNPM, Bower and Composer, which one to use?
Can someone explain to me the difference between NPM, Bower and Composer. They are all package managers, correct? But when each must be used?
-
10
votes3
answers6900
viewsWhat’s the difference between Return and break in a switch case?
In some situations it is necessary to practice the switch case for optimization and improvement of code. I have an application developed for Android using Java, which in case is used of both…
-
10
votes1
answer1465
viewsWhat is "Extract" in PHP?
I was running a code analysis PHP, and in a script used Extract. I looked in some PHP documents and the examples are kind of abstract and unfortunately I didn’t notice much. I would like to know in…
-
10
votes3
answers24310
viewsHow to check if a String is empty in Javascript?
Given the following object: var pessoa = { nome: "fernando" } Note: sometimes I am receiving the object as follows: var pessoa = { nome: "" } How do I check the attribute name is empty, as the…
javascriptasked 8 years, 1 month ago fernandoocf 1,095 -
10
votes1
answer361
viewsPassport Session authentication on Android
I have a web app running with Nodejs, Express and Passport-JS authentication, and everything works perfectly. Now I’m developing an Android app and need to authenticate my users using the same API.…
-
10
votes2
answers559
viewsBinary Search Tree vs Sorted List
Consider an unbalanced binary search tree and an ordered vector list. Which of the two structures is best suited to perform a search for any element.
casked 8 years, 1 month ago Andrey França 2,313 -
10
votes1
answer470
viewsDLL’s communication with Java
I am layman on the subject of how to communicate with DLL’s using the JAVA platform. Would you like to know where to start studying, if there is any framework? I’ve heard of JNI but I don’t know if…
-
10
votes2
answers1616
viewsWhat is the use of the pseudo class :root?
I’m learning about pseudo structural classes, but I haven’t found an article about this pseudo class yet, and I only find it in English.
-
10
votes1
answer3809
viewsWhy use "git branch --unset-upstream"?
I created a project and left it hosted remotely. Dai clone it locally, create the remote (remote), create a test.php file and then add/commit/push. So far so good. Now I make a branch called test,…
gitasked 8 years, 1 month ago Paulo Luvisoto 907 -
10
votes2
answers3616
viewsWhat is the difference between a file . c and . cpp?
C and C++ are two different languages, however C++ is a "superset" or superconpin of the C language. So what is the difference between a file with the .c and .cpp?…
-
10
votes1
answer8714
viewsInformation Protection when inspecting code via browser
I would like to know if there is any way to hide the visible code in the inspect/Ctrl+U or make it difficult. Why I’ve been researching PHP makes it difficult to query the code, check it? What…
-
10
votes5
answers3128
viewsWhat is CDN and how do I enable it in my Javascript files?
On a performance verification site I received the message "Use CDN for all Static Assets" for my Javascript files. What are CDN and how to implement them?
-
10
votes6
answers4503
viewsIf null, Nan, false and Undefined in Javascript
I want to know how to make one if to verify any of these possible states.
javascriptasked 8 years, 2 months ago Allan Ramos 2,488 -
10
votes1
answer1055
viewsIIS mount server on PC at home
Hello, I need to know if I have how to set up, etc, the IIS in a notebook, so that when this notebook is connected in the company, it works as my server, so that I can access my ASP.NET MVC…
-
10
votes1
answer1006
viewsChat Python - Errno 9 - Bad File Descriptor
I am developing (for study only) a code for a chat in python, and I came across an error during client-server communication, I would like some guidance about it, since I cannot identify a solution.…
-
10
votes1
answer144
viewsHow to adapt my code to Android 4.1?
I’m making an app using Materialize. But a mistake is happening. The MENU is to work as in the second image. It is hidden with a TranslateX(-100%). And when I click on the MENU icon it opens the…
-
10
votes2
answers12658
viewsHow to comment code block in JSX (React)
I want to know if it is possible to comment on a code block inside the render() method in React, I tried every way I know and none of them worked. render() { return ( <div className="Events">…
-
10
votes2
answers3309
viewsWhat does the term "Consume an API" mean?
I see a lot of that term around here, what it would mean, and how you get it through code?
-
10
votes1
answer4477
viewsWhat does Traceback mean?
When creating some basic programs in Python, I occasionally come across errors that bring the word traceback, so I was curious to find out what traceback means.
-
10
votes1
answer2100
viewsDifference between Std::list, Std::vector and Std:array
All are containers used for data guards in a sequential manner, but what are the main differences between them?
-
10
votes3
answers1653
viewsPicking up part of the phone
In the registration, the user registers his phone and this field is masked (99)99999-9999 and this is saved in the BD. if I want to use only the DDD of this, and the separate numbers, how should I…
-
10
votes1
answer1326
viewsLaravel 5.3 - Events or Observers?
I have some scenarios where I can use Observers to fire a notification, however, for me it would be indifferent to use Observer or create an Event, a Listener and then use this to fire a…
php laravel pattern-design event-listener observer-patternasked 8 years, 3 months ago Fábio Jânio 3,407 -
10
votes3
answers2010
viewsHow to optimize the sum of elements in an array
I need to get the sum of the items of a array javascript. The quantity of these items can easily reach 2,000 items. The items are of the type int, no need to test. ar = [1,3,5,...,2000]; I already…
-
10
votes4
answers14893
viewsAdvantage and advantage between onClick and setOnClickListener
I have a certain situation where we see that it is possible to create in the XML file a property called onClick: onClick: XML: <Button android:layout_height="@dimen/edittext_min_height"…
-
10
votes2
answers2295
viewsGood Practices for URI in Restful API
I’m having doubts about the Uris of some of the api features I’m developing. I have the features projects and activities in connection with 1-N, that is, a project has several activities and an…
-
10
votes1
answer3650
viewsWhat is the difference between virtual and Abstract methods?
In which cases should I prefer to use one type instead of the other?
-
10
votes3
answers5691
viewsCan everyone see my projects on Github?
Personal greetings I’m starting there with the concepts of Github and would like to know when I put my project there it becomes accessible to all people with the download option. If yes: Is there a…
githubasked 8 years, 4 months ago Pedro Soares 786 -
10
votes5
answers1033
viewsWhat is the definition of each css selector combination
The . css files that are used follow a pattern: seletor{ atributo: valor } The attributes and values part I understand, but in some examples I see these selectors being separated with ',' or with a…
-
10
votes0
answers73
viewsNeo4j - cluster operation
Someone knows how the Neo4j cluster makes the "Keep Alive" between the nodes? I know you have the parameters ha.tx_push_factor (amount of Slaves that the master force the commit) and the…
neo4jasked 8 years, 4 months ago Danielle Almeida 101 -
10
votes1
answer1031
viewsSort Varchar field by taking into account groups and subgroups
I need to sort the values below in ascending order. They are Varchar type and the solutions I have found so far for Mysql have not worked. An example of the data type would be 1.12.02, because these…
-
10
votes2
answers513
viewsReflection C#, how does it work?
I’m doing some tests with Reflection, I made this code on the basis of trial and error, so I didn’t understand how exactly it works. This is the enum that I’m wearing: public enum TipoDoAmbiente {…
-
10
votes1
answer1490
viewsPolymorphism or inheritance?
I’m learning about polymorphism and I’ve been wondering if what I’m doing is actually polymorphism or just inheritance? If it’s polymorphism what’s in my code that I can clearly identify is…
c# oop software-engineering inheritance polymorphismasked 8 years, 4 months ago Mauricio Ferraz 2,074 -
10
votes2
answers49607
viewsHow to format a Datetime field in Brazilian dd/MM/yyyy format?
I would like to format the fields DataAfr and DataTrm of the kind DATETIME, in the Brazilian date format dd/MM/YYYY instead of the American format yyyy-mm-dd hh:mm:ss SELECT e.NmrCnt AS [Contrato]…
-
10
votes2
answers5514
viewsIs there a correct way to comment on a code snippet?
Is there a correct way to comment on a code snippet? For example: // Esconde a tela this.Hide() or would be: this.Hide() // Esconde a tela or even: this.Hide() // Esconde a tela Is there some kind…
-
10
votes1
answer751
viewsHow to send an audio file from Android phone to computer?
I’m working on an Android app that records the phone call on a mobile device. I just need to send a copy of the audio file to the computer via TCP/IP. I already have a function that sends text to…
-
10
votes3
answers9773
viewsHow to log in PHP?
I have a php code that keeps checking the server and when it is online or offline it returns a different message: <?php $server='LOJA 01 - '; $conectado = @ fsockopen('10.200.0.100', 135,…
phpasked 8 years, 4 months ago Igor Santana 651 -
10
votes1
answer4872
viewsHow to subtract dates in the Laravel?
I need to calculate the working time on a call. For this I need to do operations with date, how do I do this in the laravel? Code: public function ticketsByUserSearch(Request $request) { $user = new…
-
10
votes2
answers1078
viewsIncrease timeout of dblib connection with PDO
On a connection to an external server (MS SQL SERVER), from another system with which I integrate some data, it is extremely slow, and with that the connection with the database gives error. How to…
-
10
votes2
answers525
views -
10
votes2
answers229
viewsCan try catch be replaced by using?
I always used the blocks try, catch and finally when programming in Java, and when I switched to C# I noticed that some codes exchange the try/catch for using. Example: using (FileStream fs = new…
-
10
votes4
answers209
viewsHow to capture textarea tag with new line?
How to get the values of a <textarea> with Regex, including new line? I have the following expression to get a textarea: ([<]textarea.*[<\/textarea][>]) Online example. The problem is…
-
10
votes3
answers271
viewsHow to avoid the use of setters in such cases?
In object orientation it is recommended to avoid the use of setters. The usual justification for this is that the logic that modifies the state of an object must be encapsulated in the object.…
-
10
votes5
answers14272
viewsAdd all the latest changes to the commit in git
Whenever I make several changes to files in Git, I go out by adding the changes one-by-one through the git add. It’s a bit of a boring process, I wonder if you have a command to add all the "not…
gitasked 8 years, 6 months ago ldeoliveira 2,015 -
10
votes1
answer14408
viewsBlock direct access to files and directories
Well, my doubt is simple: How can I block direct access to files and directories on my website? For example, prevent the user from accessing the link: www.meusite.com/img and get the list of images,…
htaccessasked 8 years, 6 months ago celsomtrindade 8,038