Most voted questions
150,413 questions
Sort by count of
-
9
votes1
answer766
viewsWrite unit tests for the interface or for the implementation?
Given the following test scenario, where I have the interface: public interface UserService { /** * Registra um usuário no sistema. * * @param user * Usuário à ser registrado. Não deve ser {@code…
-
9
votes2
answers217
viewsUsing Jquery Library with Angularamd
I am implementing Angularjs + Requirejs through Angularamd. I want to add the Jquery library but returns the following error when using the "$": Error: $ is not defined I have the main.js configured…
-
9
votes2
answers3677
viewsHow to disable mouse scroll button?
I would like to know how to disable the central button of mouse who has the scroll? I don’t want to take the scroll just the button of scroll of mouse that features arrow to left up and down when…
-
9
votes2
answers1138
viewsWhy can’t the implemented methods of an interface be private?
When I implement an interface in my class, why your implemented methods cannot be private/protected/etc? And another question, when I implement an interface method explicitly, why can’t this method…
-
9
votes2
answers2492
viewsWhat’s the difference between SOME, IN and ANY?
What is the difference of SOME, IN and ANY in Mysql and when to use them? They have a bad performance if used often in the same SELECT?…
mysqlasked 9 years, 9 months ago Guilherme Nascimento 98,651 -
9
votes5
answers38375
viewsConvert date to dd/mm/yyyy format
I’m getting two PHP post of two dates in format dd/mm/yyyy, however to display the data need to convert dd/mm/yyyy for yyyy-mm-dd. Code: if (isset($_POST)) // Se existir o array post, pq ele não…
-
9
votes1
answer8470
viewsWhat is Curl/curl_setopt
I’m doing an integration with Mailchimp, and I came across this code: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $submit_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch,…
-
9
votes1
answer236
viewsDivide circle SVG into 12 parts
I’m using an SVG circle and I want to share it with a line dynamically created into 12 parts. I can only divide into 4 parts, through its radius. I know it is possible through the sin and cos.…
-
9
votes1
answer10051
viewsWhat is the difference between @Postconstruct and the constructor?
What’s the difference of using the annotation @PostConstruct instead of using constructor method and its advantages? I ask based on these two versions of the same class that only differ by this…
-
9
votes2
answers879
viewsRecover Error messages via json in Angular
I’m trying to register using Angularjs, but I want to get the validations that are in my model in Rails. But I’m having difficulties: Covenat(model) Rails validates :name, presence: true controller…
-
9
votes2
answers647
viewsHow to use Ruby blocks
I’m having a hard time understanding blocks in Ruby. Could someone explain to me why we use it?
-
9
votes3
answers2830
viewsExtract data from txt file to use in autocomplete
Update: Just for the record, there is no need to use jQuery-ui, it can be with another solution. I’m creating a autocomplete for a form, containing all the options in the CBO - Brazilian Code of…
-
9
votes3
answers14735
viewsHow to break a line of a Mysql field into an HTML page
I need to save a value with a line break in the table For example, instead of keeping: 0 anos, 3 dias Keep: 0 Anos 3 Dias I tried the following process: INSERT INTO tabela (tempo) VALUES ('0 Anos\n3…
-
9
votes1
answer5098
viewsFuncionamento @classmethod
I would like to better understand the @classmethod annotation of Python. Briefly it works as a second alternative to constructor. But what are the benefits? When to use? @classmethod def…
-
9
votes1
answer241
viewsWhat are the implementation differences between the Browser.log console and Node.js?
Yesterday I was using a Mootools class on Node.js and I came across strange behavior on console.log node.js. The code works great, but the console doesn’t show what I know is there. For example…
-
9
votes1
answer87
viewsRamdrive with video card ram
I use the R language for heavy matrix calculations. I’m using gpu for performance gain, which is fantastic indeed. However, I would like to take another step and dump the 2gb data matrix directly…
-
9
votes1
answer3671
viewsAre there any other low-level languages besides assembly?
Are there other low-level languages besides Assembly? LISP is not (I think) nor Fortran.. Low-level language would be language closer to binary, as well as Assembly, language that works directly…
-
9
votes1
answer280
viewsSearch tool for my site on Google
How to include a search within the Google search engine? It would have to include a meta tag in my website for this to appear on Google? A little difficult to explain, so I will illustrate with…
-
9
votes1
answer237
viewsKeyboard does not recognize Edittext
I have several EditText inside an item on my list ExpandleListView. Always by clicking on EditText appears the message below and is not typed text in the field: getSelectedText on inactive…
-
9
votes6
answers2106
viewsSmooth gradient color transition automatically
Hello, I own a div with the following css: background: linear-gradient(to right, #3e42e4, #e53472); And I would like the colors to change through Javascript. Similar to the top of this site:…
-
9
votes1
answer395
viewsConcat() VS Union()
What’s the difference between Concat() and Union() ? When to use Concat() and when to use Union() ? Can only be used in list ?…
-
9
votes1
answer136
viewsArrayindexoutofboundsexception in Java 8 Parameter Reflection
I was making a code with Reflection in Java 8 when I came across a strange behavior - A ArrayIndexOutOfBoundsException unexpected. Based on this, I decided to create a minimal, complete and…
-
9
votes6
answers8412
viewsFunction that enumerates letters of the alphabet
How to convert alphabet letters into one array of numbers according to its sequence? The array should start from paragraph 1, not zero. So the letter A valeria 1, B valeria 2, C valeria 3, and so…
-
9
votes1
answer1095
viewsBiometric readers output standard on fingerprint
I would like to know the following questions from someone who has worked with a biometric fingerprint reader: The outputs of biometric readers are standard, ie a reader model A of an X mark follows…
-
9
votes1
answer8805
viewsSeparate string by number of characters
I’m developing a component to read the file sent by Dataprev with the list of monthly obituaries. This file is a TXT and every 210 characters is a different person. The documentation can be seen in…
-
9
votes1
answer2783
viewsHow to pass a number in scientific notation in Java?
I’m using a method not to display scientific notation DecimalFormat dfor = new DecimalFormat("#"); dfor.setMaximumFractionDigits(10); txtTexto.setText(df.format(valorDouble)); But when you press a…
-
9
votes1
answer210
viewsNetbeans Project with git and Composer repository
I am developing a PHP project that requires two libraries separately. I am required to use NETBEANS. To develop the three separately but at the same time and because the main project "MAIN PROJECT"…
-
9
votes3
answers1348
viewsProblems with "or" in C++
I need to make an algorithm that gets 3 different numbers, and if it gets repeated numbers, it gives an error message. My program is all working properly, but when I put such a line to warn of the…
-
9
votes3
answers8626
viewsProtect folder from direct access
The user needs to log in to access a list of documents. All documents are in the "/uploads folder". Once you know the directory, it is easy to access it, just type in the browser…
-
9
votes2
answers731
viewsPriority in progress
It is possible to prioritize a progressdialog before a Thread? In my app, after clicking a button, I need to freeze a progressdialog for 2 seconds. After that, generate a query to my webservice, and…
-
9
votes2
answers1726
viewsHow to replace multiple using variable as first parameter?
When I want to replace all occurrences of a string I do so: var ola= "ola mundo ola mundo"; ola = ola.replace(/ola/g, "xxx"); Result: "xxx world xxx world"; But I want to use a variable instead of…
-
9
votes2
answers531
viewsDemoiselle Junit - Nullpointerexception
When running a unit test with br.gov.frameworkdemoiselle.junit.DemoiselleRunner, the following error is happening at the end of the test run: java.lang.NullPointerException at…
-
9
votes3
answers94464
viewsHow to mask an HTML5 input?
For example... I want one input unique to phone numbers. By typing the DDD it automatically receives the parentheses: (xx). When typing the rest of the numbers it divides with a hyphen, for example:…
-
9
votes3
answers1588
viewsHow to filter data entries in PHP
Good evening, I have a form serving data entry that is displayed on the screen. The problem is that this data can be html tags or scripts, if someone puts this code in my form, the page will be…
-
9
votes1
answer2134
viewsConvert RTSP stream to HTTP Live Stream
How do I convert RTSP stream to HTTP Live stream? I have an IP Camera that uses the RTSP protocol to perform video streaming, and would like to make it work on iOS using the Safari browser.…
-
9
votes2
answers3515
viewsRemove more than one item from an array
It is possible to remove more than one item from an array at a time. Follows the code: var teste = [6,4,5]; //meu objectivo é remover os itens 4, 5 por ex //removendo o item 4 teste.splice(1, 1)…
-
9
votes2
answers1032
viewsAttacks of data interception
What are known data interception attacks, type Man-in-the-Middle?
-
9
votes1
answer5672
viewsLeft Join with lambda Groupjoin and with condition
How can I make one left join with some conditions using lambda LINQ expressions? In SQL Server have this query: select usr.Id, usr.FirstName, usr.LastName, ex.Id from User usr left join Exam ex on…
-
9
votes2
answers42711
viewsHow to set date(’d/m/Y H:i:s') with Brasilia time instead of server time
I’m recording the date and time in the database with the script: $sql = "INSERT INTO admin_users (user_name, user_password_hash, user_email, user_data) VALUES('" . $user_name . "', '" .…
-
9
votes1
answer1798
viewsWhat are the advantages of using a "Generator" (Yield) in PHP?
As of PHP 5.5, the Generator. It can be used within a function from the keyword yield. In the manual, we have an example where one is compared to function range(0, 1000000) (that theoretically would…
-
9
votes2
answers3449
viewsIn R, count words and enter a line break
Dear friends, good afternoon Suppose I have a vector the following way caption<- c("I really liked the performance", "I didn’t like the performance", "I neither liked nor disliked") I want to…
-
9
votes1
answer164
viewsHow Google Analytics Works
How can Google Analytics verify the origin of the click? How the API knows the keywords that originated the Google search (which reached the site)? Those doubts have haunted me for years. If anyone…
-
9
votes1
answer1625
views -
9
votes2
answers589
viewsIs it possible to name a parameter at the time of the function call?
Can I "access" a specific parameter of a Javasscript function, that is, give a value for a given parameter? As an example is better than text (since I don’t know how to explain myself properly),…
-
9
votes2
answers3250
viewsHow can I purchase HTTPS in my web application?
In this link I learned how HTTPS works: Stackoverflow - How HTTPS works But I don’t know what applications I should use, and how to acquire HTTPS, depends on any host, programming language etc. To…
-
9
votes2
answers159
views"1-----1-+-1" is a valid integer value in PHP?
I’m testing a PHP value filter function called filter_var(). And a of your filters, focused on values like int seems to accept any combination of numbers, + and -. Example: filter_var("1teste2",…
-
9
votes1
answer1038
viewsIs there a data structure like an associative array in Java?
Well, I’m wanting to name an Array of Strings in Java, but I wanted it to be, for example: String[] symbols; And could be declared so: symbols["name"] = "Tiago"; I know there’s no such Array, but…
-
9
votes1
answer596
viewsHow does software licensing work?
I’ve searched a lot on Google but I couldn’t find an answer that made everything clear. Suppose I have a home project and publish this code in a very famous repository, like the Github. And he’s…
-
9
votes3
answers7855
viewsPrevent user from pasting special characters
I am creating a system in which the user must type in a input the mother’s name with only alphanumeric characters. I am using the code below that is working, but I noticed a flaw. Even allowing not…
-
9
votes3
answers4422
viewsHow to toggle text between "show / hide" inside a javascript button
I don’t know anything about Javascript. So even though it’s something "simple" for some people, it’s a seven-headed animal. Here’s the thing: In the following code is a script that I will use that…
javascriptasked 10 years, 1 month ago ivan veloso 2,900