Most voted questions
150,413 questions
Sort by count of
-
13
votes5
answers3441
viewsShow text when typing in textarea
Consider the following example: I have a textarea that, when the user enters something on it, a small text just below should be displayed, and at a certain time after the user has finished typing…
-
13
votes2
answers36925
viewsChange the "placeholder" color without affecting the "value" color
In HTML5, we can make use of the attribute placeholder (English) in order to give the user a hint about the type of data that a given field accepts. To avoid confusion between data actually written…
-
13
votes3
answers3756
viewsProblem using subst in text with PHP
When using substr in a variable with text, it is returning a special character " "someone could help me? I’m using the following code: $excerpt = get_the_content(); $excerpt =…
-
13
votes3
answers2226
viewsPerformance: string "concatenated" or all in the same line?
I have a loop with thousands of results that renders a table. The string is mounted through Stringbuilder in this way (sample snippet): ScriptTbody.AppendLine("</select>");…
-
13
votes3
answers711
viewsExtend classes with private constructor
Because I can’t extend classes with private builder? Consindo the classes To: public class A { private A(){} public static void limao(){} } and B: public class B extends A { private B(){} public…
-
13
votes2
answers2787
viewsHow to determine which HTML element and/or which event called a function?
I have a function called by two different HTML elements and each element calls the function through a given event. $("#tempoInicial").on("blur", manipulaTempoFinal); $("#operadorTempo").on("change",…
-
13
votes4
answers3372
viewsGenerate random numbers that result in a fixed sum
I need to generate random values for the inputs text of my table (remembering that it can have N lines), my code today can generate the numbers but I need the generated number to be at most X so…
-
13
votes2
answers2267
viewsWhat is the best way to run a java application as a Service on Windows (32 or 64 bit)?
What you need to do to run a Java application (no visual interface) as a Windows service. The program basically uses the Filesystem API and the network API (java.net, java.io and java.nio.) If it is…
-
13
votes3
answers6699
viewsConversion of JSON string to Java object
I am trying to convert a JSON string into a Java object used by Gson. This is the json I get from the webservice: {"concurso": { "numero":1499, "data_sorteio":"01\/06\/2013",…
-
13
votes4
answers262
viewsHow to implement journaling in Python?
I need to do a series of operations involving binary files (you can’t use BD), and I need to ensure that they end successfully even in the event of failure in the middle of the operation. For this,…
-
13
votes8
answers59138
viewsHow to raise a number to a power without using the Math. h library?
How can I raise a number to a power without using the library math.h? Example: potencia = x ^ 1/2; How do I do it in c++?
-
13
votes3
answers6240
viewsWhat would be the best way to make a CRUD for a framework in the most generic way possible?
I’m studying to make a CRUD for a framework but I’m trying some problems to be able to do it in the most generic way possible. For example: have a class Pessoa() I want to do CRUD by passing only…
-
13
votes3
answers48813
viewsReceive external JSON data from PHP
I am trying to receive an external JSON file via PHP. I am doing so: <?php $json_file = file_get_contents( "http://www.moonwalk.com.br/api/VitrineDeProdutos/58e903df295cbc5c4639434d4c35090d");…
-
13
votes1
answer2014
viewsWhat is the difference between apply, call and bind methods when calling a function in Javascript?
Sometimes I use these methods but I don’t know what the difference is between them (and I want to know exactly what it’s for). function load( arg ) { console.log( this, arguments ); }…
javascriptasked 10 years, 12 months ago Iago Bruno 1,693 -
13
votes3
answers14931
viewsHow to style <select> tag
How do I style the tag select, like that arrow at the end of the field. The pseudo-classes :hover, :focus, work with this element?
-
13
votes7
answers180098
viewsFormat decimal places directly in the SQL command in Firebird
I have a table ESTOQUE containing a field called QTDE, this field has 3 decimal places. What would be the command to return directly from SQL formatted with 3 houses? Because the integer values are…
-
13
votes7
answers10092
viewsHow to make child form change values in parent form C#?
I have a register in C#. There is a "street search" button that opens a form search child. When executing the search, displays the result in the datagrid that form son. I would like the event…
-
13
votes3
answers15049
viewsHow to check if a file exists using Python
How to check if a file exists, in Python, without using a block try:?
-
13
votes4
answers20996
viewsDifference between null, Empty, 0 and false
The goal Differentiate the day-to-day use of null, empty, 0 and false. The problem Dealing every day with these 4 representations of variables is complicated and I don’t know how to differentiate…
-
13
votes2
answers1894
viewsHow to align strings to use in a listview?
In my Android project I need to create a table with a listview but the data always comes misaligned. I place each record of my database in a position of a string array to use it in listview. The…
-
13
votes2
answers1282
viewsHandle large files with GIT
Setting Some time ago, I tried to use GIT to restore some backups, mostly small files, git behaved very well by versioning them when the changes from one commit to another weren’t big, but on a…
-
13
votes5
answers704
viewsEvent is not tied to the element
I have an event at jQuery (version 1.5) as follows:: $('#refresh_abertos').click(function(){ // aqui o código irrelevante nesta pergunta }); Turns out my element #refresh_abertos is only loaded…
-
13
votes1
answer1462
viewsUse Resultset without knowing the column type
I need to use a Resultset that returned the data of a query in the database. I’m making a very generic class, it can be used in any table, so I don’t know what kind of data it’s returning. For…
-
13
votes4
answers13879
viewsHow to detect if an HTML element is empty?
How can I detect if an HTML element is empty with jQuery? I need to make a condition if the element is empty.
-
13
votes3
answers2326
viewsProblem accessing an accented file (matching character)
I’m trying to list a folder (files, subfolders) in Python [2.7 on Windows XP], and I’m having problems with sharp files. I know the method os.listdir behaves differently if the argument is a single…
-
13
votes2
answers345
viewsHow do I catch an error alert generated by the Google Maps API?
If, for some reason, an error occurs and Google disables access to the maps API, an alert of this kind will appear to the visitor: Google has disabled use of the Maps API for this application. The…
-
13
votes1
answer443
viewsIs an immutable Enummap thread safe?
An immutable map built on top of a EnumMap could be used in multi-thread environment or there is some risk of competition problems? public enum MyEnum { VALUE1, VALUE2, VALUE3, VALUE4; } private…
-
13
votes2
answers505
viewsIs it possible to program using the Winrt API without resorting to XAML?
Some time ago declarative languages took over the development of software for creating graphical user interfaces. The most obvious examples are the framework WPF that uses XAML (Extensible…
-
13
votes3
answers799
viewsFloats module in PHP returns integers?
How do I get the rest of the division (operation module %) with decimal places when using a divisor or dividend float? Example: echo 5 % 3; // imprime 2 como é esperado echo 5.6 % 3; // imprime 2…
-
13
votes1
answer865
viewsHow do I increase the brightness of an element with Javascript/jQuery?
On my page I have several elements with different background colors. I wonder how I could do to when clicking a button increase the brightness of the color, make it lighter. It is possible to do…
-
13
votes3
answers514
viewsJava / Android: how to view Stacktrace log
How can I display the whole exception error code (Fullstacktrace) in Android Log? try { //CODE }catch (Exception e){ Log.e(TAG,e.getStackTrace()); }…
-
13
votes2
answers1381
viewsWhy does Google Chrome accuse you that jquery.min.map is missing?
I downloaded the version of jQuery 1.10.1 minimized and Google Chrome is warning in the developer tools, Network tab, that jquery.min.map was not found: error 404 Note: jQuery works correctly. That…
-
13
votes1
answer560
viewsProblems decoding Assembly x86 from binary
I have written a program whose goal is to read a binary executable file compiled for the x86 (intel) architecture and interpret the Assembly code contained therein by executing instruction by…
-
13
votes3
answers4221
viewsTake only the values before the character "=" using regular expression?
I have a file containing the following contents: Maringa=123123 Marialva=789789 Mandaguacu=123456 Cidadex=A341a2 How do I pick up only the characters before the =, using regular expression? I tried…
-
13
votes1
answer300
viewsControl the fan (fan) of the CPU in C#
How do I read and set the fan speed (fan) of the CPU and also read the current speed? I tried to use this code but also could not get result. [DllImport("Cimwin32.dll")] static extern uint32…
-
13
votes4
answers6431
viewsHow does the interaction between the layers in C# work and what is the function of each one?
Assuming a project with these layers: DAL, Controller, Negocio, Model and View I’m trying to learn C# seeing ready-made project codes, but not quite understood yet the correct order of creation and…
-
13
votes2
answers32948
viewsHow to send SMS for free using PHP?
I wonder if there is any way to send SMS for free to mobile phones in Brazil. I have seen some PHP systems with this function, and I would like to have this function on my system as well.
-
12
votes2
answers200
viewsWhat are attributes in PHP? (Annotations/Attributes/Decorators)
Lately I have come across some snippets of code that I can’t understand their purpose, are usually used within comments, which doesn’t make much sense to me. Doing research on this subject falls in…
-
12
votes3
answers5507
viewsCount how many elements are duplicated in a string
The purpose is to account for the number of elements that are repeated in a string and not just check for duplicates or count how many times these elements appear. For example: "aabbca1m" // 2 (a,b)…
-
12
votes2
answers482
viewsWhat would be the "identity" of an object?
Reading more about objects, trying to "detach" me from the concept that object would only be provided with a "class", in this answer, I saw the following sentence: "Objects have identity. A variable…
-
12
votes2
answers286
viewsWhy does the exchange of values via de-structuring not work if we do not use semicolons?
We know that the semicolon is optional in Javascript, even always prefer not to use it. If I want to exchange values between two variables, via unstructuring, I can do: let a = 11; let b = 22; [a,…
-
12
votes1
answer572
viewsWhy should we scale/standardize values of variables and how to reverse this transformation?
When working with multivariable prediction algorithms I came across the function scale of the R, whose objective is to scale/standardize the values of the variables. I have no difficulty in using…
rasked 5 years ago Izak Mandrak 1,059 -
12
votes2
answers348
viewsShould or should not Httpclient be used within a using block?
Reading this reply, a question relating to the use of using, I was curious about the following statement: In fact everyone uses HttpClient wrong, I even used and did not know everything, because I…
-
12
votes2
answers623
viewsHow to publish a Typescript library on NPM?
I set up the package.json with the properties main and types: { "name": "idb2promise", "version": "0.0.5", "description": "TypeScript library to manage IndexedDB Storage", "main": "./dist/index.js",…
-
12
votes1
answer226
viewsWhat is a Vaporware?
I’ve been hearing the term Vaporware with some frequency. People talking that it is something does not sustain, straw fire, etc. But what qualifies a Vaporware, there are clear factors to classify…
-
12
votes3
answers1299
viewsDefine whether the letter is vowel or consonant
I was trying to create a code with Javascript that after reading the letter entered showed if it was a vowel or consonant but with any letter I put the code answers me that and a consonant even if…
-
12
votes4
answers1090
viewsHow to create an array filled with values from 0 to n in javascript?
I need to create an array that is filled with the values of 0 a n, as if using the function range(n), Python3, but using Javascript features. I thought I’d create a function: function…
-
12
votes2
answers143
viewsWhy does CSS have so many units of measurement?
After the window appeared auto-complete, I came across the following: and then I wondered: why the CSS has so many different units of measures?…
-
12
votes2
answers231
viewsWhat does " | " mean in Typescript?
I have the following code: export type Teste = Observable<'exemplo' | any>; What the bar means | within the generic argument? Is some kind of comparison any and the string for example?…
-
12
votes2
answers285
viewsTo what extent does hardware affect programming?
Nowadays the world is very dependent on the technology and the benefits it brings. Most of the time we are writing several lines of code that will be converted into machine language and thus give…