Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
6
votes3
answers5007
viewsA: Accent error in mysql
Wear this: ALTER DATABASE `sua_base` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; It will only change your database to UTF8, and that does not define anything and does not solve anything,…
-
5
votes1
answer272
viewsA: Writing PHP code without special characters
What’s new in PHP7: Unicode code escape syntax There is support for Unicode code escape syntax, for example: <?php echo "\u{00e1}\n"; echo "\u{2202}\n"; echo "\u{aa}\n"; echo "\u{0000aa}\n"; //o…
phpanswered Guilherme Nascimento 98,651 -
4
votes1
answer48
viewsA: Help with PHP and Mongodb
You can create a variable in the class and do so and create a method to check if it is already connected: private static $mongo; private static checkConnection() { if (!self::$mongo) {//Verifica se…
-
5
votes2
answers204
viewsA: How to select text between spaces - REGEX?
With regex a simple example would be to use .split with the meta-character \b: var names = ' GEO X GEO3 X GEO4 X'; var nameList = names.trim().split(/\b[\sX]+\b/i).filter(function (value) { return…
-
3
votes1
answer781
viewsA: Javascript does not work in Webview
I believe that to enable Javascript you have to define the WebChromeClient: webView.setWebChromeClient(new WebChromeClient()); And then enable Javascript…
-
2
votes1
answer294
viewsA: How do I make an RSS feed work in Angular 4?
You can download the document using HttpClient and can use the: https://developer.mozilla.org/en-US/docs/Web/API/DOMParser Basic example: import { HttpClient } from '@angular/common/http'; ... title…
angularanswered Guilherme Nascimento 98,651 -
1
votes1
answer267
viewsA: Lock an element inside the textarea
Ckeditor is not <textarea>, is contentEditable (or docMode), in any way I think it is impossible to prevent the user from interacting with the element, this because the control is all of the…
-
2
votes1
answer876
viewsA: error: Object {readyState: 4, responseText: "", status: 200, statusText: "OK"}
The first argument of the error function within $.ajax not the error message, but the Ajax object (in this case jqXHR), as documented: http://api.jquery.com/jquery.ajax/: Type: Function( jqXHR…
-
2
votes4
answers6996
viewsA: Typeerror Cannot read Property 'name' of Undefined at Angular 4
It’s probably because "view" is trying to display something that doesn’t exist yet, even before the HTTP request starts: <td>{{ cotas.USD.nome }}</td> <td>{{ cotas.USD.valor…
angularanswered Guilherme Nascimento 98,651 -
1
votes1
answer1411
viewsA: Fatal error: Cannot redeclare spl_autoload_register()
Because you are simply trying to create/redeclare a function with the name of a existing native function: function spl_autoload_register($class){require_once"{$class}.class.php";} If the intention…
-
1
votes1
answer550
viewsA: I cannot log into phpmyadmim
The standard access mysql in Wampserver is login root and the empty password. You have no way to change the phpmyadmin login and password, because they are not of phpmyadmin, phpmyadmin is a…
wampserveranswered Guilherme Nascimento 98,651 -
1
votes1
answer665
viewsA: Problem when creating an image with transparent background
Just apply: imagesavealpha($image, true); //canal alpha imagealphablending($image, false); //Desabilita a mesclagem imagesavealpha: Set the option to save the full alpha Channel information (instead…
-
2
votes1
answer233
viewsA: PHP (Preg_match)
If I understand you want the preg_match valide if it contains only the following types of characters: traces dots bars sign of + sign of - commas spaces numbers letters # (hash) * (asterisk) You can…
phpanswered Guilherme Nascimento 98,651 -
2
votes3
answers109
viewsA: Run Ajax script automatically
If I understand you want to run after filling the "correct format", that is to fill wrong (including the mask) should check the content of what was typed In case use onfocusout or onblur can only…
-
2
votes2
answers15220
viewsA: How to clear the screen in C++?
As already said, it depends on the environment, however as suggested I already fear the command: clear Which is usually used on Unix-like systems (linux for example) and the command: cls Used on…
-
3
votes1
answer472
viewsA: Environment variables will remain
The ~/.profile quoted in the video is not a command and so when type occurs the message: Permission denied It is a configuration document, meaning you have to edit it with a word processor, such as…
-
2
votes3
answers536
viewsA: Why can’t I pass summernote name="" via ajax
When typing the text via summernote it will not be inserted in the <textarea>, but in the generated editor, so when trying to take the textarea with .val it will return empty. To get from…
-
0
votes1
answer196
viewsA: Error 403 on request via $.ajax to instagram
Start Chrome like this: chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security It will not solve the problem of users who access your site, it only solves the problem of your own…
-
8
votes2
answers861
viewsA: What is the difference between :Nth-Child and :Nth-of-type?
the :nth-child() will consider all child elements "direct" value/past calculation between parentheses, so for example a "zebra effect": div, p { background: #cfcfcf; margin: 2px 0; }…
-
2
votes1
answer156
viewsA: Display all the awesome font icons on my website?
If I understood you want to create something to display all available without having to access the documentation, this would be it? You can use the document.styleSheets and then the cssRules to…
font-awesomeanswered Guilherme Nascimento 98,651 -
4
votes1
answer309
viewsA: Why is this json invalid?
Because you broke lines inside the quotes "...", which will invalidate JSON, what you can do to resolve this is before using the json_decode or send to output (application/json) is to convert the…
-
6
votes3
answers99
viewsA: Run Shell Script by checking the 32bit or 64bit system architecture
I found an answer that detects different types of architectures on Soen, note that each case checks: #!/bin/bash HOST_ARCH=$(uname -m) case "$HOST_ARCH" in x86) HOST_ARCH="x86" ;; i?86)…
shell-scriptanswered Guilherme Nascimento 98,651 -
7
votes3
answers1819
viewsA: Create shortcut for complex commands in CMD
Let me give a very simple example, which will not depend on any external programme: Create a folder in a specific place, for example C:\meus_comandos Go to your computer and right-click (mouse) and…
cmdanswered Guilherme Nascimento 98,651 -
8
votes3
answers331
viewsA: How to make this regex?
Even with regex you will need to loop, regex alone won’t be able, for example: <?php $filmes = array(); $str = '1ª Temporada – Shinigami Daikou 001. O Dia em que me Tornei Shinigami 002. Um…
-
5
votes4
answers23451
viewsA: How to convert seconds to "Hour:Minute:Second" format?
Beyond calculation, already passed by Maniero: $horas = floor($total / 3600); $minutos = floor(($total - ($horas * 3600)) / 60); $segundos = floor($total % 60); It is important to remember that if…
-
4
votes1
answer2642
viewsA: How to check the time of a video
In Javascript use the properties: .currentTime: position in seconds of video .duration: time in total seconds of video Note: cannot take the current position of the video via PHP, PHP is on the…
-
1
votes1
answer37
viewsA: Help with installing php 7.0 in Ubuntu as per video tutorial
I don’t quite understand where you failed, but first, to edit the php.ini in Nginx (remember this in Ubuntu uses FPM) edit this file (independent of text editor): /etc/php5/fpm/php.ini IS obligatory…
-
1
votes1
answer4200
viewsA: Creating JSON File with PHP
You can use the & commercial in foreach (reference), should look like this: <?php $json = '{ "title1": { "key1": "value1", "key2": "value2", "key3": "value3" }, "title2": { "key1": "value1",…
-
1
votes2
answers276
viewsA: ebit banner with 404 error and infinite loop with Adblock on
This is not a programming problem, it is a BUG in the script https://imgs.ebit.com.br/ebitBR/selo-ebit/js/getSelo.js that keeps trying to call GIF when error occurs when downloading it, the script…
-
4
votes2
answers2761
viewsA: JS Error: Uncaught Typeerror: Cannot read Property 'addeventlistener' of null
You have to use or window.onload or document.addEventListener('DOMContentLoaded');, because the script loaded before the page and therefore the HTML elements did not exist yet. So for example:…
-
1
votes2
answers537
viewsA: View code on page
Have to use < and > (HTML Entities), something like: <pre> <?php echo 'Olá'; <pre> You can make it easier by using the function htmlspecialchars of PHP itself, for…
-
0
votes4
answers765
viewsA: Numeric sequence loop in PHP
A more simplified example to do would be to take only the highest value and with a loop checking what exists, the logic would be to use the array coming from the database only to know how many loops…
-
1
votes2
answers309
viewsA: Include numbers to complete numeric sequence in PHP
I do not see well the need to complete, following the current need that sounds, it seems that only needs 1 to 12, so the use of range with str_pad would already solve: $valores = range(1, 12);…
-
3
votes1
answer145
viewsA: IF x SWITCH - Simulating
If you run more than a billion loops, you might feel some noticeable difference to the user, but overall they don’t make any difference that it means, 15 conditions for example you wouldn’t notice…
-
1
votes1
answer244
viewsA: How to insert excel table in mysql using php
If it is a job that will be done only once and/or this migrating from an excel to your bank, you can download the MySQL Installer which has several tools in:…
-
2
votes2
answers263
viewsA: How to transform the space of an input text to %20?
If you’re in one <input> only the message just use rawurlencode, so in PHP: <?php if (!empty($_POST['message'])) { $message = rawurlencode($_POST['message']); $url =…
-
0
votes1
answer74
viewsA: Javascript classes in an application with Cordova
Cordova does not support ES6, classes, the way you did, are only available from it. Understand that many technologies are still experimental and do not form fully implemented. Ionic with Cordova…
-
2
votes1
answer2887
viewsA: How to check the version of . net core and uninstall and reinstall another
According to doc https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet?tabs=netcore1x you can use via command line (CMD for example) If it is version 1.x the supported arguments are: dotnet…
c#answered Guilherme Nascimento 98,651 -
2
votes1
answer342
viewsA: Use . ini file to save connection data to DB?
It is not a matter of good practice or bad practice, it is a matter of whether you know how you are doing, for example in the Password of the main bank .env (this file is basically a format .ini…
phpanswered Guilherme Nascimento 98,651 -
1
votes2
answers52
viewsA: Error when trying to use class/method of a library.
For the error message: the name 'Devicelist' does not exist in the Current context. I think maybe the problem is in your class, where you call: _deviceList = DeviceList.Local.GetHidDevices(); If you…
c#answered Guilherme Nascimento 98,651 -
0
votes2
answers649
viewsA: Cordova can’t outrun "Android target: not installed"
I guess you didn’t add via cordova in its specific project. First check that Cordova is up to date, run the following command: npm update -g cordova If it is linux/mac: sudo npm update -g cordova…
-
2
votes2
answers992
viewsA: mkdir(): No such file or directory - Laravel
First, I believe that File::makeDirectory is laravel4 and not 5, paragraph 5 I believe that this function does not even exist (if I am not mistaken) Maybe you are trying to create in a folder that…
-
3
votes1
answer1234
viewsQ: Ionic-Native/http emits error "Nullinjectorerror: No Provider for HTTP!"
I’m starting at the Ionic 3.2 angled, as documented https://ionicframework.com/docs/native/http/ I installed the module in the project @ionic-native/http with the following commands via CMD: ionic…
-
4
votes2
answers18714
viewsA: Max length input type number html
the maxlength works by typed characters (inputados), and not for the specific numeric format, what you can use is the attribute max="" and will have to use the step to add from 0.01 to 0.01 (or…
-
17
votes1
answer256
viewsA: What is the difference between M.dot, responsive layout and adaptive layout?
Responsive () These may or may not make use of media-queries, what defines it is that the sizes of the objects accompany the screen usually based on percentage, so it fits as needed not having a set…
responsive-layoutanswered Guilherme Nascimento 98,651 -
1
votes3
answers51
viewsA: Check if phone field is equal
First, this is wrong: var telefone1 = ('[name="telc1"]').val(); var telefone2 = ('[name="telc2"]').val(); Should be: var telefone1 = $('[name="telc1"]').val(); var telefone2 =…
jqueryanswered Guilherme Nascimento 98,651 -
1
votes1
answer22
viewsA: Center an image that’s too big for the screen?
You can use as background and apply the background-position: center Documentation: https://developer.mozilla.org/en-US/docs/Web/CSS/background-position Note: background-position: center can be used…
cssanswered Guilherme Nascimento 98,651 -
1
votes4
answers2255
viewsA: Changing CSS by class in Javascript, is it possible?
Based on what you said: We were able to get the Divs by id with the command document.getElementById("nomedaiddadiv");. Have some command that does the same, but with the Divs classes? You want to…
-
3
votes2
answers902
viewsA: How to delete all jpg files inside a PHP folder
You can use the glob as @Juniornunes suggested, yet glob is case-sensitive (differs capital letters from minuscules), ie if you have files like this: 1.JPG 2.Jpg 3.jpg Only the 1.JPG shall be…
phpanswered Guilherme Nascimento 98,651 -
1
votes1
answer332
viewsA: File_exists solution in php check
It’s not necessary fopen to use getimagesize, in fact the fopen will keep the file open until the script is finished, which is really a huge problem, for example if you are going to do delete or…