Posts by William Pereira • 3,998 points
51 posts
-
1
votes2
answers365
viewsQ: Why do browsers render the same page in different ways?
I would like to know why browsers read the same page (HTML, CSS and scripts) and the displayed result is different in some cases.
-
3
votes1
answer695
viewsA: Notice: Undefined index in variable $_FILES (upload PHP)
The only error I found in your code was in the section below, where the enctype="Multipart/form-data" is not with " (quotation marks) correctly. The insertion of this attribute in the form to make…
-
0
votes1
answer108
viewsA: Take CSS link with Regex
As mentioned in the comments of the question, you can include the excerpt (<link[^>]*>) in its regular expression. This expression obtains all tags link, as examples may be: <link…
-
4
votes2
answers2648
viewsA: What is a shebang?
In the case of scripting languages in Linux distributions, a script can start with the shebang which is the #!, plus the interpreter path to be used in the script ex.: #!/bin/bash. Using an example…
-
0
votes4
answers6919
viewsA: SELECT of month/year in DATES
To make this query, you can do as follows: SELECT * FROM FRCAST WHERE TO_CHAR(DATA_ID,'MM-YYYY')='07-2010'; References:How to select Rows for a specific MonthTO_CHAR (datetime)…
-
9
votes2
answers5391
viewsA: What is the HMAC?
A brief introduction to Message Authentication Code (MAC¹): A message authentication code is information used to authenticate a message. A MAC algorithm receives as a parameter a secret key (shared…
-
16
votes3
answers1673
viewsA: When should I use the </img> tag or the background CSS property?
Recommended uses of tag <img>: When the image must appear if the page is printed. The browsers do not insert background images into prints, by default. When it is important to insert a…
-
8
votes4
answers1870
viewsA: What are Progressive Web Apps?
Large companies and technology enthusiasts already realize that the number of mobile app downloads has been decreasing each year and in the face of this situation emerged the Progressive web apps.…
-
11
votes3
answers179
viewsQ: Why does CSS work with "fake" HTML elements?
I saw some examples like this on the internet, showing that html elements with custom names work in relation to the application of css styles. elementofake { color:red; font-size:30px;…
-
10
votes6
answers24229
viewsA: What is the difference between padding and margin in CSS?
Some interesting differences, besides those mentioned in the other answers: margin can have the value auto. padding can’t use auto as a value. margin:auto can be useful to center one element within…
-
1
votes1
answer408
viewsQ: Differences between Cache and CDN usage
What are the advantages and disadvantages when using CDN (Content Delivery Network) and Cache and how they can complement each other?
-
2
votes1
answer191
viewsA: Post to two tables simultaneously in AJAX
It is not possible to use more than one url in the same request. Alternatively, you can use a function to send the request from a given url, thus not repeating the code. Example: function…
-
3
votes1
answer553
viewsQ: autocomplete="off" input type "password" is required? Why?
One of the systems I work on was analyzed by a security team and among some security practices they recommended was the inclusion of autocomplete="off" in elements input of the kind password. I…
htmlasked William Pereira 3,998 -
1
votes3
answers1056
viewsA: Redirect "dominio.com.br" to "Subdominio.xyz.com.br"
In the apache settings file, where you configured the server the VirtualHost (similar to the code below) etiquetasribeirao.netshops.com.br, you must create a ServerAlias as is below: <VirtualHost…
-
3
votes2
answers872
viewsA: Return only integers
You could use more than parseInt() quoted in another reply, the Bitwise (bit-to-bit) OR operator | var num1 = 2.43; var num2 = num1 | 0; // 2 document.getElementById('num2').innerHTML =…
-
9
votes2
answers5074
viewsQ: What is the use of 'SELECT 1'?
I am making a query using NOT EXISTS on a college job. The situation is as follows: 1.14 - Designing the CPF and the amount to pay in rentals by customers who have rented media and have not made any…
-
1
votes2
answers920
viewsQ: Problem with PHP login/logout
I have a small login/logout system in PHP/Mysql where when I log out, and try to log in again at the same time, the page does not enter. It only works after a few minutes. What would be?…
-
2
votes1
answer85
viewsA: Ruby on Rails and Javascript
Try this way: <script type="text/javascript"> var teste = <%= raw @categorias.to_json %>; alert(teste.length); </script>
-
4
votes1
answer250
viewsQ: Is it possible to use vertical, edge or face coloring in a DIRECTED graph?
I would like to know if it is possible to use the staining technique in directed graphs? Whether yes or no, why?
graphasked William Pereira 3,998 -
2
votes4
answers5695
viewsA: Get list of changed files in working directory (Working directory)
The command to view the changed files that were not committed is git status, as an example below: In the link below, you can find more information about recording changes in the repository and…
gitanswered William Pereira 3,998 -
2
votes1
answer397
viewsQ: Which files should be inserted into . gitignore in a Rails project?
I’m starting in Git and also in Ruby on Rails. I created a new project using rails new myapp -d mysql and added to my Github repository. When creating the project Rails generates multiple files. So…
-
14
votes2
answers598
viewsA: Git workflow (workflow) using Github?
Documentation I will make a brief explanation, but whenever there is doubt, please refer to git documentation. I recommend these links with good explanations about the question: Git - Practical…
-
9
votes2
answers598
viewsQ: Git workflow (workflow) using Github?
I need to learn how to clone a project from github to my local computer and, after making the necessary changes, send the modifications back to the remote project. Basically the workflow git by…
-
22
votes3
answers12225
viewsQ: What is deadlock in SQL Server?
I am trying to solve a problem with an error in SQL Server and seeing a question in the OS, in the reply is quoted a possible 'deadlock' in SQL Server. What is this?…
sql-serverasked William Pereira 3,998 -
13
votes4
answers7944
viewsQ: How to take print (screenshot) from a web page?
I would like to know how to print a page, and save in image. Follow example for understanding:…
-
2
votes2
answers312
viewsA: localhost goes straight to projects
Clinton, I advise reinstalling the Wampserver for the original files to come back and the problem is solved.
wampanswered William Pereira 3,998 -
9
votes4
answers34013
viewsA: How to make a loading screen before opening the site
You can use the code below as a template to mount your loading. You can put a simple message like "Loading.. Wait", like a gif image as simulation below. Obs. I put the interval to simulate, but in…
-
7
votes1
answer6657
viewsQ: What is attr_accessor in Ruby?
I’m learning Ruby on Rails and in the content I am studying I could not understand well what is the attr_accessor and how it works.…
-
0
votes1
answer62
viewsA: Changing a Word document through an Asp.Net Web Forms application
Jucinei, I believe this may help you: Manipulating Word 2007 Files with Openxml
-
71
votes6
answers56799
viewsQ: What is Nullpointerexception and what are its main causes?
What are the exceptions NullPointerException? What are its main causes? What methods/practices can be used to prevent?
-
5
votes3
answers143
viewsA: Doubt with PHP and Apache
I advise to follow a tutorial for configuration of PHP, Apache and Mysql (if you want) on linux. You have this tutorial from Digital Ocean, that I always use when I need.…
-
2
votes2
answers111
viewsA: Auto Publication Wordpress c#
I believe that this project at Github in C# (in Console) where you can do a post using Wordpress XML-RPC interface may help you.…
-
5
votes2
answers509
viewsQ: Is using version control on the production server a good practice?
In the company where I work today, we have a Web system (C# ASP.NET) where we use the Team Foundation Server 2013 in the development environment. On the production server we don’t use any version…
-
2
votes1
answer204
viewsQ: How to convert numbers 2.15600e+03 (Uler) to numeric type?
I have the following problem: I have to read a file that contains several very large numbers as an example below. When trying to read them and send to a variable double/long/int, the error accusing…
javaasked William Pereira 3,998 -
7
votes3
answers4198
viewsA: Align image with text
GWER, I tried to do as close as you need. I’m putting the CSS code below. On the margin, you can place an image. If this is not possible, I found some content on gradient edges in the Stack (in…
-
4
votes2
answers14697
viewsA: Why does the address of some sites contain number after www?
Complementing the response of Paulo Costa, if you want to put an address www1, www2, www10.. on your website, just go to your domain’s DNS manager and create a record type A as an example below…
-
2
votes2
answers4617
viewsA: Querysyntaxexception: Unexpected token: . near
According to the error returned: java.lang.Illegalargumentexception: org.hibernate.hql.internal.Ast.Querysyntaxexception: Unexpected token: . near line 1, column 49 [select c from…
-
20
votes7
answers1682
viewsQ: Make the class builder private?
When placing a constructor of a class in C# as private, get the following error: I would like to know the technical explanation for the reason of this error and whether there is any case of use of a…
-
2
votes1
answer249
viewsQ: Error when exporting SQL Server database to another Server
I have a database on an SQL Server Web Edition (64-bit) server (11.0.5556.0) and need to export it to a server with SQL Server Express Edition with Advanced Services (64-bit) (10.50.4297.0). When…
-
27
votes2
answers42711
viewsA: How to set date(’d/m/Y H:i:s') with Brasilia time instead of server time
Just use the date_default_timezone_set php and set the time zone as Brasilia time, in this case 'America/Sao_paulo'. Here you can refer to the list of Supported Timezones. NOTE: If your server is in…
-
4
votes3
answers13363
viewsA: How to validate an input?
You can validate the form by following the example below, complementing put the validation to check if one or both fields are empty: html <form action="_graphes.php" method="post"…
-
2
votes2
answers1114
viewsA: Add array elements to other arrays
On the basis of their information data1, data2, data3 use only one array with all data's the method below can solve your problem: var arr = []; arr[0]='<img class="images" src="1.jpg">';…
javascriptanswered William Pereira 3,998 -
1
votes2
answers6682
viewsA: Woocommerce registration
I suggest using the plugin Woocommerce Checkout Manager, with it you can remove unnecessary fields and it has several features for customization of the checkout page.…
-
0
votes2
answers1143
viewsA: Pass variable with various input/select
How do you have a form with several input, and do not want to repeat the values the solution would be to insert a name with [] at the end for the values to be saved in an array. Example: page.html…
-
4
votes3
answers13485
viewsA: Change the Datetime Timezone.
If you don’t have access to the server settings (to change its time zone) you can use the following method to convert the time public DateTime HrBrasilia() { DateTime dateTime = DateTime.UtcNow;…
-
1
votes2
answers565
viewsQ: Format String to insert into Mysql (TIMESTAMP)
I need to insert a string that is like: "2014-11-25T14:13:35.000Z" in a Mysql database and using PHP in a field TIMESTAMP. How can I format the string for insertion using PHP?…
-
12
votes2
answers2282
viewsQ: How 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…
-
2
votes1
answer1902
viewsQ: Is it possible to get a specific line of txt/csv file using an address?
It is possible to access a line from a file txt/csv (example below) by your address directly without having to go through each line using C#?…
-
2
votes1
answer139
viewsQ: Doubt in the complexity analysis of an algorithm
I need to know how to compute the complexity of this algorithm using the recurrence equation. public int qdr(int x, int n) { if(n == 0) return 1; else return x * qdr(x, n-1); } It is a recursive…
-
2
votes4
answers1688
viewsA: Fill fields of a multidimensional array with null
Buddy, I think this is what you’re looking for: $minhaArray = array('A'=>1,'B'=>'','C'=>3,'D'=>'','E'=>5,'F'=>6); foreach($minhaArray as $elemento) { if(strlen($elemento) == 0) {…