Posts by Ivan Ferrer • 12,096 points
772 posts
-
0
votes1
answer53
viewsQ: In regular expressions in . htaccess, what does this rule mean?
What this rule is doing exactly? RewriteCond %{HTTP_HOST} ^(www\.)?website\.com\.br$ RewriteRule . - [E=REWRITEBASE:/]
-
0
votes1
answer284
viewsA: htaccess removes a bar (/) from the url when using WWW in the Prestashop
Try it like this: //------------------------------------------------------------- RewriteCond %{HTTP_HOST} ^(www\.)?meudominio\.com$ RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^api(?:/(.*))?$…
-
3
votes1
answer1001
viewsQ: How do I update a component and go back to its initial state?
Authentication: It has a login screen produced with native language (React-Native), which when logging into a remote server through a webservice, accessed by an imported component within my app,…
-
1
votes2
answers384
viewsA: How do I find a particular file in all branches?
As I solved the problem, I used the following command: git log gulpfile.js Then I was reading the commit messages, and checking out the commits: Example: git checkout 374124d1 And seeing if the…
gitanswered Ivan Ferrer 12,096 -
2
votes2
answers384
viewsQ: How do I find a particular file in all branches?
First search: I need to find a branch or commit that has a file that was lost... but I have multiple branches and multiple commits in each of these branches... The file created would be called:…
gitasked Ivan Ferrer 12,096 -
1
votes0
answers73
viewsQ: What’s wrong with the CSS that makes the two Sos act weird?
I’m trying to solve a layout misalignment problem, which in Windows 10, with the latest Chrome it changes the padding from the height of a button. This button looks right on Mac OS Mojave, using the…
-
2
votes1
answer127
viewsA: How to make a regex to treat the text this way?
At @Guilhermenascimento’s suggestion, I arrived at a solution: var el = document.createElement('div'); el.innerHTML = result; var paragraphs = el.getElementsByTagName('p'); if (paragraphs.length…
-
1
votes1
answer127
viewsQ: How to make a regex to treat the text this way?
Whereas I have random classes, may or may not have a class in the paragraph. I need to put an empty paragraph, when there is not an empty paragraph on top of the text. I can receive texts in these…
-
0
votes3
answers859
viewsA: I am suffering attacks of type SQL Injection
Solution that can help your problem: Exchange all user passwords, and especially the access to the database, preferably a complex password, type: #@_12!aVxzHors12_8^. Put a new alias in the tables,…
-
2
votes4
answers729
viewsA: How to get the month formatted with zero left in Typescript
I believe you’ll have your month with zero: (new Date('Jan 05 2019')) .toLocaleDateString('pt-BR') .split('/')[1]; You can also get the month of a formatted date from the return in string, in ISO…
-
1
votes2
answers798
viewsA: How to get header data in PHP post
I would do something like this in front with javascript: var TRANSACTION_TYPE = 'boleto', ENCRYPTION_KEY = 'SUA_ENCRYPTION_KEY', URL_POST_BACK = 'url-retorno-que-marca-pago', URL_PAGAMENTO =…
-
2
votes1
answer671
viewsA: Prevent direct access to wordpress videos (Prevent direct access files)
Place the files you want to protect in a subdirectory of the directory in which your code is running: www.foo.com/player.html www.foo.com/videos/video.mp4 Save a file in this subdirectory called ".…
-
0
votes6
answers1947
viewsA: Use switch to test if a value is between a range of values
Try it like this, it’ll work: function determinarGeracao(anoDeNascimento) { /* Complete a função onde voce deve comparar o * valor da variavel anoDeNascimento e atribuir na variavel *resultado uma…
-
0
votes2
answers390
viewsA: Float with PHP precision
I guess in this case I wouldn’t have to round up? $valor = 6.3285714285714; echo number_format(floatval($valor), 2, '.', ''); Now if you don’t want to round it up: echo…
-
0
votes0
answers52
viewsQ: What is Ihtmldocument2?
When it’s used, how it’s used, I can’t find anything to explain it to me? Code example: WebBrowser wb = new WebBrowser(); wb.Navigate(new Uri(location, UriKind.Absolute)); IHTMLDocument2 myDoc = new…
-
1
votes2
answers438
viewsA: What are the possible values in Document.readyState?
Document.readyState: The Document.readyState aims to identify the upload status of a document. It is used to interact with the page in certain loading states. It is used based on notable reference…
-
1
votes1
answer37
viewsA: Error in entering data
You can do it this way, so it will work: for (j = 0; j < cliente.length; j++) { $('#table' + data[i].cliente.replace(/\s/g, '')).append('<tbody><tr><td><p…
-
3
votes2
answers113
viewsQ: Is there any difference between the two ways of making an exception?
Between the two formats below, the throw can be summed up, or create a new object, when casting exception, I just wanted to understand what the real meaning of writing this in different ways, has…
-
7
votes7
answers44529
viewsA: How to get only the numbers of a string in Javascript?
The leanest way I can imagine to do that: "5tr1ng0".split("").filter(n => (Number(n) || n == 0)).join(""); or: '5tr1ng0'.replace(/([^\d])+/gim, ''); or: '5tr1ng0'.replace(/\D/gim, '');…
-
1
votes2
answers36
viewsA: I enter a value in a div and it moves
Hello, welcome to Sopt, the problem is basically your line-height, when you put element X, it misaligned... the correct value would be: line-height: 182px;not to misalign but then your x, would not…
-
0
votes2
answers552
viewsA: How to insert a midnight datetime into mysql?
The problem has been solved. Mysql version 5.7.x does not have the incorrect Timezone from Brazil, correction: SET @@global.time_zone = '+3:00'; QUIT
-
1
votes3
answers1087
viewsA: Function to return letter frequencies in an array
Hey, buddy, here’s the deal: It checks while the letter array "nay" is undefined, that is, when it enters the rule of counting and starts to add up the values. The letter H in the case is defined,…
-
1
votes2
answers163
viewsA: How to dynamically increment a JSON.stringify
You can do it from n forms, but it all depends on how you wait your exit: var ObjUser = { UserName:"", Name:"", Surname:"", DateBirth:"", MobilePhone:"" } if (input1Change != 0 && input1 !=…
javascriptanswered Ivan Ferrer 12,096 -
-1
votes5
answers2164
viewsA: Square root manually in Javascript
If you need me, I have a function for that: function calculoRaiz(numero) { var divisorRaiz = 1, calcDiv = 0; for (var i = 0; i <= numero; i++) { calcDiv = numero / divisorRaiz; divisorRaiz =…
-
1
votes1
answer1408
viewsA: Pick width child element in Angular directive
See if this works for you: function getListTRandTDSize(idElementTable) { var tab = document.getElementById(idElementTable), tr = tab.getElementsByTagName("tr"), tdList = []; for (var i in tr) { var…
-
2
votes2
answers552
viewsQ: How to insert a midnight datetime into mysql?
I’m using the Laravel Framework 5.8, I am trying to register a record in the database where I need to set in API some dates. Although they are CURRENT_TIMESTAMP, i also need to be able to enter a…
-
1
votes2
answers451
viewsA: Loop in PHP to create a form dynamically
Whereas you have a collection: $collection = [ [ 'value' => 'php', 'label' => 'php' ], [ 'value' => 'java', 'label' => 'java' ], [ 'value' => 'mysql', 'label' => 'mysql' ] ]; Just…
-
1
votes3
answers86
viewsA: Receive data from external Json and display its contents in loop as array using PHP
By default json_decode is already true, so there is no need to set it unless you want to receive it in array, hence arrow to false. Try converting the charset before converting to the json Decode:…
phpanswered Ivan Ferrer 12,096 -
-1
votes2
answers327
viewsA: In PHP, does an array’s internal pointer make up its value?
The answer is yes. But it has nothing to do with the value itself, the fact is that the position of the key is that it contains the value. The pointer only tells you what the current key is, and if…
-
1
votes1
answer597
viewsA: How to understand the required requests in Curl?
Curl is a way to consume an API or html page, its return is rendered by the browser. To documentation is describing items that can be provided and accessed: Curl: is the URL called -H: are the…
-
-1
votes2
answers139
viewsA: am starting with React Nturn on and always give me this error cant find variable:Component
You need to import the Component to use it, and it must have the first letter capitalized: import React, { Component } from 'react';
syntax-erroranswered Ivan Ferrer 12,096 -
0
votes3
answers76
viewsA: I can’t get the algorithm to ask for a certain range of values
I would accumulate the notes and treat it out of the way: var notas = [], media = 0, i = 1, total = 0, qte = 4; while(i<=qte){ var num = Number(prompt(`Digite a nota ${i} do aluno: `)); //Valida…
-
1
votes2
answers432
viewsA: Set select search text in html
To use this library, you have to add all the dependencies on the page: the Chosen lib (js and css) and jquery. In your select element, put the lib class being called: chosen-select. See how it would…
-
4
votes2
answers142
viewsA: I need to make php only show the last 10 news
Limiting your query would be enough: SELECT * FROM noticia ORDER BY id DESC LIMIT 10;
-
-1
votes3
answers311
viewsA: Help escape special characters php
I’ll do an example that uses base64encode/base64decode ok: var Base64 = { _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", encode: function(input) { var output = ""; var…
phpanswered Ivan Ferrer 12,096 -
2
votes2
answers369
viewsA: Success message after sending message by form
Hello @Julianygarcia, welcome to Stackoverflowpt, there "n" ways to do this, using ajax, and posting directly on the page. I would recommend you to study Javascript, which is a client-side language.…
-
0
votes4
answers2055
viewsA: SSL: no Alternative Certificate Subject name Matches target host name 'xxx'
Usually happens when certificate does not match host name. The solution would be to contact the host and ask them to correct their certificate. Otherwise, you can disable checking the certificate by…
-
0
votes1
answer167
viewsA: Problem with environment variables for a non-existent application
I will leave here the solution that solved the problem: Delete iOS emulator cache: rm -rf ~/Library/Developer/Xcode/DerivedData/* Delete the build cache: rm -rf ios/build Start the React-Native…
-
0
votes2
answers41
viewsA: Write to a file from another PHP site
As @Leonardogetulio said, n ways to do this, I’ll give an example of how to do this through ajax: Your HTML on the site a: <!DOCTYPE html> <html> <head> <title>Site…
phpanswered Ivan Ferrer 12,096 -
0
votes7
answers811
viewsA: How to write variables in PHP?
You just didn’t know how to separate the wheat from the chaff. This is not a variable, this is an array $f, with a key "title": $f['titulo'] = 'título'; That is a variable: $titulo = 'título';…
-
1
votes3
answers51454
viewsA: How does the AES encryption algorithm work?
In cryptography, the Advanced Encryption Standard (AES), also known as Rijndael, is a block cipher adopted as an encryption standard by the US. It is expected to be used around the world and…
-
0
votes3
answers364
viewsA: How to overwrite a root HTACCESS in a subfolder with another HTACCESS
You can only overwrite rules that are not flags [L]: The flag QSA, informs that only QUERY_STRING can access them. The flag NC (nocase), is to ignore case sensitive (high/low box). The flag L (last)…
-
6
votes2
answers241
viewsA: Delete button crashes
1) Change your buttons: Edit (which opens the modal): <button type="button" name="edit" data-id="<?php echo $produto2["Id"]; ?>" id="open_<?php echo $produto2["Id"]; ?>"…
-
1
votes0
answers40
viewsQ: How to fix React-Native installation failures to run on IOS?
Hello, Following the React-Native documentation it would seem simple if it were only to do what is indicated, only that it is not quite so, it is a mistake to believe that the whole process will…
-
0
votes0
answers44
viewsQ: Cache error in React-Native for IOS version
I am working on an application inside a new directory, but the emulator insists on calling another application from a folder that has already been deleted. Where is the problem? I’m using the…
-
-2
votes1
answer167
viewsQ: Problem with environment variables for a non-existent application
I’m trying to simulate a new application done in Act-Turn on IOS, but after the emulator presents my app, 3 seconds later opens another address that has nothing to do with the directory of my app: I…
-
1
votes2
answers393
viewsA: Compressing a string to upload into a field of the JSON object
I do not know how it is in practice, because I am not used to windows, but maybe you can increase the limit of your publication, so there will be no interruptions in the sending process: On the…
-
0
votes1
answer185
viewsA: How to implement a grid and Infinite scroll together?
I think to do this, do not need a plugin, maybe a method that checks your page and scroll, example: function scrollPage() { window.onscroll = function(e) { var raw = this; var supportPageOffset =…
-
2
votes1
answer47
viewsA: How to join these two arrays
To save the data in the question database and activities the way you intended, you can do the following: $pergunta = $_POST['pergunta']: $opcoes = $_POST['opcao']: $prova = json_encode([$pergunta,…
phpanswered Ivan Ferrer 12,096 -
2
votes1
answer67
viewsA: Insert data into a Javascript array #NODE ERROR( EMFILE: Too Many open files, open )
See if that’s what you want: var info = ["101", "102", "103", "201"]; var infos = ["Oficiais generais das forças armadas", "Oficiais das forças armadas", "Praças das forças armadas", "Oficiais…