Most voted questions
150,413 questions
Sort by count of
-
12
votes4
answers172
viewsRewriting vs Incremental Improvement?
In the place where I work I am implementing new features in a legacy system. The system in question was written around 2008. Some problems encountered in the system: Database tables with 90+ columns…
-
12
votes2
answers5497
viewsHow to perform method overload with PHP?
How to perform method overload with PHP? To declare methods with the same name but with different parameters.
-
12
votes2
answers4565
viewsWhat are DDD aggregates and how to identify them?
In DDD there is the notion of aggregate. A definition I’ve seen around is as follows: Compounds of Entities or Objects of Values that are encapsulated in a single class. The Aggregate serves to…
-
12
votes7
answers552
viewsWhat is the difference between these parameters (array) in these methods?
I see it a lot in methods class Exemplo { public function exemplo1(array $parameters = array()) { } public function exemplo2(array $parameters) { } public function exemplo3($parameters = array()) {…
-
12
votes3
answers68478
viewsDisplay PDF file in the body of the HTML page
I am creating an HTML page and would like to know if it is possible to display a PDF file in the body of the page, so that it can be viewed without having to open the file or download. Or I will…
-
12
votes1
answer1866
viewsWhat is the difference between printf() and print()?
I was doing some simple algorithms in Java and most of the time it is used System.out.println() or System.out.print(), but to make the definition of the number of decimal places I am using…
-
12
votes4
answers4731
viewsHow to check if the first four characters of a string match 'www.'?
What is the best way to verify this? More simply and with better performance. I could only imagine doing so: var string = "www.google.com"; if(string[0] == "w" && string[1] == "w" &&…
-
12
votes2
answers189
viewsAre libraries downloaded multiple times?
I have an application that uses 3 libraries (Bootstrap, jQuery, jQueryUI) on 10 different pages. Browsers cache libraries?
-
12
votes2
answers2447
viewsWhat is the difference between define() and const?
What is the difference between declaring constants with define() or with const. Would it be the same thing or have some detail I should know? define('TESTE', 'constante 1'); const TESTE2 =…
-
12
votes2
answers13989
viewsWhat is the function of the super in a Java constructor?
I have a daughter class that inherits from another abstract class, and in the class builder I have the following: Public aluno(String nome, int idade){ super(nome,idade); } What is the function of…
-
12
votes2
answers1715
viewsBack previous position in Visual Studio
When we want to see some method, we press F12 and then we are "transported" to the said method. It turns out that this method can be in another project or other form or in one user control etc and…
-
12
votes1
answer159
viewsWhat can be done to improve the performance of a very large CSS (384KB)
My site has a style sheet, already minified, with a total size of 384KB. If possible, what can I do to improve performance? I thought of compressing with GZIP, which would leave the sheet with 59KB,…
cssasked 10 years, 1 month ago Alexandre Lopes 2,769 -
12
votes4
answers7973
views -
12
votes2
answers1480
viewsHow to edit a list in C#?
I want to edit a record of a client in which I can already register, consult and remove. But I have no idea how to edit just a few items without others being lost. class Program { static…
-
12
votes4
answers7268
viewsGet a Youtube video ID from the URL
I have this string "https://www.youtube.com/watch?v=jNQXAC9IVRw" and I want to take only the ID, ie from "? v=" How can I do this in PHP?…
phpasked 10 years, 1 month ago Nickolas Carlos 632 -
12
votes1
answer13778
viewsHow does the MD5 hash algorithm work?
I would like to understand how the hash algorithm works MD5 (Message-Digest Algorithm 5). He is considered safe? I seek didactic answers, which make me understand the processes used by this…
-
12
votes3
answers4720
viewsImplement HTTP POST and GET Requests on Android
How do I send information via get to an Android url, passing parameters? And how do I return data like JSON from my PHP?
-
12
votes1
answer7882
viewsWhat are . phtml files and when should I use them?
Until recently, I had never heard of phtml, but recently I see that it is being used a lot, mainly by some frameworks (such as Zend2). Since I can normally put html content inside a file .php, I…
-
12
votes1
answer191
viewsIs the appropriate type to serve Javascript "text/javascript" or "application/x-javascript" or "application/javascript"?
When analyzing the source code of several pages, it can be seen that the Javascript headers vary with regard to the mime (English) indicated, but the doubt remains about which we should effectively…
-
12
votes4
answers2204
viewsHow to get page load percentage?
How to get the size of a page and how much it was downloaded to calculate the percentage of its load. But I would like to not use any framework, only pure JS. I really want to try that.…
-
12
votes2
answers4037
viewsArrows using CSS only
I would like to know if it is possible to do the following arrow using CSS only: I usually do other types of arrows, using CSS, but whenever I struggle with cases like this, where the arrow has a…
-
12
votes1
answer680
viewsCode First versus Database First?
I’m used to creating projects on Asp.net-MVC with Entity Framework Database First. From a modeling, the database and the system are created. However, I see a lot of programmers prefer Code First,…
asp.net-mvc entity-framework code-first database-firstasked 10 years, 2 months ago Andre Figueiredo 5,030 -
12
votes4
answers80887
viewsHow to force the opening of a link in another tab and not window?
I have a button (anchor) that needs to be 'hidden', or no text. Its structure is this: <a class="testeimprimir" href="javascript:teste1();" target="_blank">TESTE</a> The Function is…
-
12
votes2
answers1619
viewsHow do CSS rules take precedence?
I know that if two CSS rules apply to the same element, the more specific one will have priority: p { color:red; } /* Todos os "p"s serão vermelhos... */ .umaClasse { color:yellow; } /* ...exceto os…
-
12
votes2
answers2282
viewsHow to do binary search in a txt file?
I am with a txt file that stores data from several books (example below) I would like to make a binary research that returns the line that is with the first field (ISBN of the book) equivalent to…
-
12
votes1
answer998
viewsWhat’s the difference between "ON" and "USING"?
Considering two ways to declare one INNER JOIN, we have: SELECT * FROM tabela1 INNER JOIN tabela2 ON tabela1.cd_tabela1 = tabela2.cd_tabela1; and SELECT * FROM tabela1 INNER JOIN tabela2…
-
12
votes1
answer633
viewsDesign Pattern
Good use the following design pattern: Where the Interface will communicate only with the application and this will communicate with the Repository. Thus the interface will have no restrictions and…
asp.net-mvc software-architecture software-engineeringasked 10 years, 5 months ago Diego Zanardo 3,301 -
12
votes2
answers10072
viewsHow to rename a local branch in Git?
How do I rename my local Git branch? I don’t want to rename a remote branch, I want a simple way to rename my local branch.
-
12
votes4
answers2869
viewsIs it recommended to use natural primary key?
Natural primary key is one that contains real data, not just a random value, but an integer. Example: // comum CREATE TABLE pessoas ( id INTEGER PRIMARY KEY, cpf INTEGER NOT NULL, // outros campos…
-
12
votes1
answer281
viewsCakephp actions not found in Wampserver Vhost
I am trying to make my administrator actions SSL-protected, including the login action. However, whenever I try to access one of these actions, I always get error 404. For example, when trying to…
-
12
votes5
answers36368
viewsTake value from an attribute in td
I have a dynamic table where there are 9 columns In one of the last columns there is a button disapproval, and when I click on it, I wanted to take the name that is inside a td in the same tr…
jqueryasked 10 years, 6 months ago Tafarel_Brayan 415 -
12
votes2
answers23421
viewsIs there any way to dynamically put a mask in php?
I would like to put masks in different fields, all via php, for example: cnpj - "##.###.###/####-##" Cpf - "###.###.###-##" zip code - "#####-###" telephone - "(##)####-####" date - "##/##/####" I…
phpasked 10 years, 6 months ago Flaviano Silva 1,131 -
12
votes3
answers23020
viewsHow to initialize postgresql with Ubuntu?
I have the following problem, every time I turn on my machine, I go to the terminal and give sudo service postgresql status, always appears 9.3/main (port 5432): down. On other machines I have…
-
12
votes5
answers14658
viewsHow to validate date taking into account leap year?
How to validate leap year date in Javascript?
-
12
votes1
answer193
viewsWhen is it useful to capture DOM events?
The events of the DOM traverse the document tree up to his target, with a phase of catching and a phase of bubbling. The default behavior when creating a Listener with addEventListener is to treat…
-
12
votes4
answers2351
viewsMerge word docx documents from a template and replace words
I need to get the contents of a file docx as template, which contains as content a text and some identifiers to be changed with other data, and from that template create a single other docx with the…
-
12
votes2
answers5287
viewsHow to implement the Repository Standard in C# with EF?
I want to make an implementation of the standard Repository where I will be using the Entityframework and have the following: Interface IRepository: public interface IRepository<T> where T :…
-
12
votes2
answers949
views -
12
votes3
answers1032
viewsReturn the "period" size of a bit string
Recently I did a very interesting online test (from Codility). Unfortunately this test was timed (30 minutes) and I ended up not being able to reach a satisfactory solution to one of the questions.…
algorithmasked 10 years, 9 months ago Anthony Accioly 20,516 -
12
votes6
answers12772
viewsHow to locate a value in an array with a specific structure
I need to locate the position of one array within another, in the following structure: array{ [0]=>{ ["id"]=>"5744" ["fk"]=>"7" ["nome"]=>"Nivel 1" ["created"]=>"2014-04-30 16:54:14"…
-
12
votes1
answer100
viewsHow to define Titlecase using regex in Javascript?
I have this Function: var titleCase = function(s) { return s.replace(/(\w)(\w*)/g, function(g0, g1, g2) { return g1.toUpperCase() + g2.toLowerCase(); }); } If I call her by passing something she…
-
12
votes1
answer1319
viewsHow to install a Windows Service without Setup?
I have a Windows Service project in Visual Studio in C#, however, I need to install this project from lines of code, without use the Installutil of console nor the Setup of Visual Studio. There’s…
-
12
votes4
answers3355
viewsPHP login with permission levels
I have a problem with my code to separate logins. I want when a login with Rank = 1 it redirects to a page, and when the Rank is = 0 go to another. I tried to do it but I didn’t get it because he…
-
12
votes2
answers7696
viewsGet the current date and time by internet in desktop application
I am implementing a system lock by date, and I need to get the current date of Brasilia for example, which would be the official time of Brazil, or the date in time zone -3. I believe that there are…
-
12
votes5
answers6123
viewsPhysical Exclusion vs Logical Exclusion
What is the advantage of making logical exclusion (Ex: Set a flag indicating that the record is active or not), instead of performing physical exclusion? Is it common practice? It’s safe? Derived…
-
12
votes2
answers4009
viewsFormat decimal with comma and thousand with dot
How can I format a float for the Brazilian value format(price)? Example: in php number_format($float,2,',','.') separates decimal with comma and unit of thousand with dot.…
-
12
votes6
answers5531
viewsWhy use Javascript if there are so many other technologies to generate dynamic content?
Specialized technologies and programming languages for the Web, such as PHP, have as part of their set of roles, generate dynamic HTML content (the page will be presented by the browser according to…
-
12
votes5
answers20277
viewsHow do I use @import in a CSS file?
Inside a.css style file I am using the option @import url() to call another file CSS. For example: @import url("/css/fonts.css") Both the file and the path are correct and still I can’t import that…
-
12
votes2
answers33836
viewsVertical alignment of text with CSS
How can I align this text "Adopt the rhythm of nature: her secret is patience", vertically and horizontally within the white field? I used the following code: <ul> <li> <a> adote o…
-
12
votes8
answers56968
viewsPHP echo Special character problem ("ç")
I’m developing a website that displays the names of the months with strftime. HTML is already charset=UTF-8. The problem is that in the month name display it appears as in the image below I did a…