Most voted questions
150,413 questions
Sort by count of
-
8
votes2
answers27161
viewsHow to destroy a specific session?
Here’s the thing: I have an application/game that uses sessions to memorize the data that users have chosen. Whenever the user restarts the game I need to reset the information, so was using…
-
8
votes1
answer9757
viewsHow to round up decimals to get an integer in C#?
I have the following account: var NumeroDePaginas = NumeroDeItens / 32; When I use the Math.Round It rounds both up and down. But whenever there is any decimal value I wish to return an integer…
-
8
votes5
answers35403
viewsHow to align a footer element always at the bottom of the page?
I have a page on which there’s a div with various contents inside, which are modified according to the user’s wish. Below there is another div who is the Footer. In case I put one position:…
-
8
votes3
answers1513
viewsIs there an application security flaw when using AJAX?
I am a programmer HTML/CSS/PHP a few years and by incredible and more impossible it seems, I’m just entering the world of Javascript with jQuery and AJAX now. My question is whether the security…
-
8
votes1
answer4355
viewsHow to calculate the difference between two dates by ignoring weekends in Java without using a loop
I was looking for a solution to this problem but I did not find a satisfactory algorithm, so I decided to create the algorithm. I hope it fits someone. public int betweenDaysIgnoreWeekends(DateTime…
-
8
votes3
answers1971
viewsRecords with recurring dates filtered for a period
The Problem I am creating a financial system where I need to register a recurring movement, for example, a light bill that repeats every month. In the system, this type of movement is treated as a…
-
8
votes3
answers3662
viewsFind quotes with blanks with Regex
I need to find errors where inside quotes have blank spaces at the beginning or at the end of them. Examples of errors: The news was given by " Jornal do Brasil". Paris is considered the "City of…
-
8
votes1
answer14926
viewsPointed Buttons and Text Balloons
I would like to know some alternatives to use some button'custom s and also the famous text balloon. Currently I use a <div id="container-button"></div> that inside has the <span…
-
8
votes2
answers15096
viewsHow to count the number of characters of the word that came from the first line of a text file?
Below is an example of how to count the number of characters in a string: $palavra ="coisa"; echo strlen($palavra); //retorna o número 5 However I am taking this word from a text file and the strlen…
-
8
votes1
answer856
viewsWhat is the correct way to declare an asmx Webmethod in C# to receive POST requests with parameters?
I’m trying to set up a file upload process for a web service done on c# .asmx, but I am not able to manipulate the sending of parameters through the method POST. This is the webMethod I created:…
-
8
votes1
answer1309
viewsWork with Angularjs in master page Asp.net
I’m involved with the Angularjs these days, so in this learning phase, I came up with a question. How I work with Angularjs on Asp.net pages that have a master page? For example, I realized that the…
-
8
votes3
answers3330
viewsConvert a date to the name of the day of the week
I am receiving from my database several dates entered by the user (the field is of the date type (yyyy-mm-dd)). What I want is to take that date and convert it to the name of the week day. For…
-
8
votes3
answers403
viewsAgile development and documentation update
Taking into account the second premise of the agile manifesto: “Software in operation more than comprehensive documentation" According to the agile practices, Scrum, XP, etc..., if during…
-
8
votes2
answers39212
viewsReplace in SQL - Character to keep a piece of text
I need to modify a part in the text of a table. The records of an email are [email protected] and I need to change everyone to jf.jus.br. Only the first part of the email doesn’t change (the xxx). I can…
-
8
votes2
answers472
viewsCreate columns in R from another where some values are null
I want to create a column from another in the R, where part of the lines have no value. The column should be constructed as follows: if the row of the base column has value, it will look for the…
-
8
votes2
answers9446
viewsExercise of family tree
I have to create an uncle relationship according to the next family tree: I already have the following code: mãe(ana, eva). mãe(eva, noé). mãe(bia, raí). mãe(bia, clô). mãe(bia, ary). mãe(lia, gal).…
prologasked 10 years, 2 months ago Wellington Viana 196 -
8
votes2
answers539
viewsEntity Framework - Bank Compatibility
I was reading a article that demonstrates the method of using the Entity Framework for connection to Mysql database, however, the article demonstrates techniques quite different from the ones I use.…
-
8
votes2
answers654
viewsPerformance of query LIKE in Mysql
Is there any way to increase the performance of a query with LIKE '%string%' in Mysql? I know that if the LIKE for 'string%', is faster. The problem is when the % is at the beginning of the string.…
-
8
votes4
answers1428
viewsApplication of 5S in agile methods
A lot has been said in Scrum, XP, Lean... But here at work they also talk a lot in Japanese 5S. There is some connection of this working methodology for software development?
-
8
votes3
answers13600
viewsHow to get the value of a column corresponding to the maximum of another column?
I have a table with columns codigo, data and valor. I would like to get, for each code, the value corresponding to the most recent date. In what ways can this be done? And if there is more than one,…
-
8
votes1
answer1158
viewsRecommended form for popular variables with database data
Assuming this fictitious method to obtain database data, say SQL Server: public List<DadosDTO> ObterDados() { try { comand = connectionFactory.CreateCommand(); comand.CommandText = "SELECT…
-
8
votes1
answer1660
viewsPooling Connection management by PDO
We often see in the applications multithreaded using connection to a database, the use of a Connection Polling, where you keep an open "pool" of connections, thus increasing performance so that you…
-
8
votes2
answers4221
viewsWhat is the difference between SOAP 1.1 and SOAP 1.2?
When I use SOAP UI ( http://www.soapui.org/ ) and I refer to my asmx webservices, it always creates the interface of operations for SOAP 1.1 and 1.2. And I don’t understand what the practical…
-
8
votes1
answer157
viewsAbout fallback for CDN
Some people recommend using the following technique (fallback) to load Javascript libraries locally if the CDN is out of order: <script…
-
8
votes1
answer9490
viewsWhat is the difference between TRUNCATE and DELETE + CHECKIDENT?
Both perform the same action (delete + reset the PK value), but in performance what is the difference between them? Example: When you have more records it is recommended to use which form? TRUNCATE:…
-
8
votes2
answers748
viewsHow to detect when the person starts speaking using Speechrecognition() in Javascript
I’m using the function Speechrecognition (native of each browser) to be able to do voice searches on a website and I noticed that Google can identify when the person starts talking (both in "Ok…
-
8
votes3
answers516
viewsClient router vs server router?
What is the advantage and disadvantage of routes being made by server(php,Asp.net, etc.) or by client(Angularjs,emberjs,backbone...) ? In terms of performance, which has the most? Security, mobile,…
-
8
votes1
answer1752
viewsVectors and Angles (Molecular Geometry)
Hello, I have a problem, more mathematical than computational, to solve, but I haven’t been able to solve it myself until now... I have a set of three atoms connected to each other forming an angle…
-
8
votes2
answers10723
viewsGood practices when creating elements with jQuery
When I need to create elements in the DOM through jQuery, I usually use the following syntax: $('<div>').addClass('minha-div').attr({id: 'id-da-div'}); However, what I usually see in Internet…
jqueryasked 10 years, 3 months ago Wallace Maxters 102,340 -
8
votes3
answers7767
viewsSend email with CCO in PHP
I wanted to know how to send email with CCO ("with hidden copy")? Formular code: require('config.php'); $sqlstt = "SELECT * FROM tb_site WHERE id='1'"; $resultstt = mysql_query($sqlstt); $rowtt =…
phpasked 10 years, 3 months ago feliphe felix 629 -
8
votes3
answers3787
viewsHow to decompose a number into powers of 2
I’m using javascript for my logic: I have a sequence of numbers: 1, 2, 4, 8, 16, 32 and so on. Given a number, which needs to be the sum of numbers in the sequence, for example: 44 (of which the…
javascriptasked 10 years, 3 months ago fsi 505 -
8
votes1
answer3788
viewsZipping directory with PHP
I have a code that compacts file and directory. The problem is that it compresses the files and directories that are at the root, but the subdirectories they are not compressed, for example I have…
-
8
votes2
answers1172
viewsIn Python, is there any rule or advantage regarding the use of 'Self'?
Let us consider the examples below: Example 1: > class PrintText(): > def __init__(self): > text = 'Funciona!' > self.printa(text) > > def printa(self, text): > print(text)…
-
8
votes1
answer8916
viewsRows with same height in table in Latex
I need to play in Latex a table with 3 columns and 5 rows. It should use the entire paragraph width, center the cell contents both horizontally and vertically, and auto-adjust longer texts. But most…
latexasked 10 years, 3 months ago Luiz Vieira 34,160 -
8
votes3
answers7725
views"HTML contains invalid UTF-8 Character(s)" error when using mpdf
I have a problem using mPDF. Basically, I have a code that makes a select of a table and then displays the values in a PDF page. The problem is that if any table value has an accent (example:…
-
8
votes3
answers12215
viewsCalculate distances between two coordinates
I am using this function below to calculate the difference between two coordinates. Through google maps is reported a difference of 2 to 3km. But the function is returning me the result…
-
8
votes2
answers11631
viewsSubtract JAVA dates from picking the days difference
I need to calculate the day of pregnancy a woman is in, taking the information of the date when the woman became pregnant and the date of today. I have the following instruction: Date dtToday = new…
-
8
votes2
answers389
views*apply with three-argument functions in R
I created a function of three arguments and I want to apply it to a Matrix 200 X 3 where in each line are the three arguments I need to use in the function. As a result I would get a vector of size…
-
8
votes1
answer158
viewsCreating PHP object from HTML
I imagine frameworks usually do the following to create a simple text field: $campoTexto = new CampoTexto("nomeDoCampo", "valorDoCampo"); $campoTexto->gera(); The result would be: <input…
-
8
votes2
answers10462
viewsRegular Expression for RG
I have a expressão regular which defines the points according to the maximum number of digits. Expression: function Rg(v){ v=v.replace(/\D/g,""); if(v.length == 9)…
javascriptasked 10 years, 4 months ago Felipe 579 -
8
votes3
answers16157
viewsAutomatically load content when you reach the bottom of the page
I want to make an automatic page like Facebook, which when it reaches the bottom of the page automatically loads another page with more posts. I’ve already researched the subject and I haven’t found…
-
8
votes1
answer698
viewsDoes Prolog have static or dynamic typing?
Although I’m quite familiar with the concept of static vs. dynamic types - can easily recognize if a certain language fits in one or the other - I never knew exactly what the Prolog typing is:…
-
8
votes2
answers11748
viewsHow do I get back to the previous commit from a remote branch?
I have an app that has some local and remote branchs, only I had to perform a git reset --hard HEAD~1 in the branchs dev and development(as in the image below), and each of these branchs have remote…
gitasked 10 years, 4 months ago augustoppimenta 527 -
8
votes1
answer1256
viewsInvalid parameter error when doing PDO perform action
I’m trying to learn how to use PDO, so I’ve already worked HARD looking for everything to understand it. So I’m at a point that has left me quite confused. I got the following code, he’s the:…
-
8
votes2
answers228
viewsData compression. Issue for Criminal Period 2012, CESPE/Unb
Hello, I have searched in several places answer to this question, but to date I did not find. The question is to be judged on Right or Wrong. Question Consider a file composed of a large number of…
-
8
votes2
answers3674
viewsHow to create a 404 error screen
I’ve seen a lot of tutorial teaching to customize 404 error screen, but only in CMS as Wordpress, I wanted to know how I do to style a 404 error page*(not found)*, so that the user sees a beautiful…
-
8
votes3
answers2685
viewsAlgorithm C language - Multiplication
Translate to the language C: take a number on the keyboard and repeat the operation of multiplying it by three (printing the new value) until it is greater than 100. Ex.: if the user type 5, we…
-
8
votes4
answers47612
viewsPin the footer of an html page and follow the page content
I need to pin the tag footer at the end of the html page, but when the content exceeds the page by tag footer should follow the content and not be fixed. See the CSS code is the HTML code I’m using…
-
8
votes1
answer3212
viewsDelphi, Tthread.Que. What is it? When should it be used?
I was looking at this method that makes use of thread: procedure TFormClient.QueueLogMsg(const s: string); begin TThread.Queue(nil, procedure begin LogMsg(s) end ); end; What is this method…
-
8
votes1
answer1324
viewsWhat do the security modules commonly used in bank websites do?
Most banks offer some kind of security module that acts on the client side for access to internet banking sites. They are usually made in Java and are usually quite boring to install. What exactly…