Posts by carlos • 375 points
21 posts
-
0
votes1
answer24
viewsQ: When dealing with delete/update, should I unsubscribe in Async Pipe mode?
I’m new to Angular. One of the main goals of async pipe is to automatically take care of signing up (subscribe) and unsubscribe (unsubscribe). I have two doubts: First Doubt When dealing with delete…
-
3
votes1
answer73
viewsQ: What is the best way to login auth?
Authservice login(user: User){ return this.http.post<any>(`${this.API_URL}`, { email: user.username, password: user.password }); } isUserLoggedIn(){ return…
-
-5
votes1
answer36
viewsQ: Is it too expensive to search directly for the key?
var products = {}; for(var i = 0; i < 300; i++){ products["product" + (i + 1)] = {} products["product" + (i + 1)]["qtd" + (i + 1)] = i + 1 } //Busca pela key console.log(products["product" +…
javascriptasked carlos 375 -
0
votes0
answers56
viewsQ: Carbon producing inconsistent results
Correct $datSuspensao = Carbon::parse($objAlt->dat_inclusao)->addDays(8)->startOfDay(); $datNow = Carbon::now()->startOfDay(); $diasRestantes = $datNow->diffInDays($datSuspensao,…
-
3
votes1
answer326
viewsQ: Carbon diffInDays does not bring the negative value between two dates (only positive)
$datNow = Carbon::parse('2018-10-23 18:40:11.000000'); $datSuspensao = Carbon::parse('2018-10-18 00:00:00.390176'); $diasRestantes =…
-
0
votes3
answers149
viewsQ: How to open a message screen in all the views the user logs in? + Laravel
After logging in, I need to show a message (open a message screen -a modal or in a separate view-) on every page he visits. The message will only stop being shown when it is pressed "No longer show…
-
0
votes0
answers36
viewsQ: Why do they recommend using Let if most plugins/applications/Ibraries still use var?
Why do they recommend using let if most of the plugins/aplicativos/libraries still use var? Should I start adopting in my applications use or not? Some examples of plugins/applications/Ibraries that…
-
-1
votes3
answers917
viewsQ: JSON: Insert an element into a given index (or key)
var fields = [ { "Category": "Computers", "Price": "125.60", "Book ID": "1", "Book Name": "Computer Architecture" }, { "Book ID": "2", "Category": "Programming", "Price": "56.00", "Book Name":…
-
0
votes2
answers85
viewsQ: Why is the H1 tag not generating a new line?
$scope.html = [{ "name": "teste", "data": [{ "tag": { "name": "h1", "text": "Titulo 1", "colValue": "" } }, { "tag": { "name": "text", "colValue": "col-xs-4" } }, { "tag": { "name": "h1", "text":…
-
5
votes1
answer124
viewsQ: Is it a good practice to have the same name with the column name of the bank?
Let’s say I have one input text de name="txtnome", it is a good practice to have a column of the same name as this input on my table? Being that I’m using PDO for CRUD $st…
-
3
votes2
answers113
viewsQ: problems increasing decimal place within loop for
var iniciaEm = 0; var terminaEm = 20; var variacao = 0.1; var s = ""; var str = ""; for(var i =iniciaEm; i<=terminaEm; i=i+variacao){ str += i; s += "<option…
-
1
votes1
answer191
viewsQ: How to verify if the connection has dropped before sending a data via ajax?
var erroEnvio = false; //global $(".proxima-questao").on("click",function(){ $(".loading").show(); $.ajax({ url: urlBase+"123123123/adasdasdasdas", type: "POST", data: $("#form").serialize(),…
-
5
votes1
answer95
viewsQ: Do static methods equate to functions?
In OOP we have static methods (do not depend on any instance variable). Citing examples: class Somar { public static function soma($a,$b){ return $a+$b; } } echo Somar::soma(20,30); The equivalent…
-
0
votes1
answer158
viewsQ: popular within the mysql textarea for the form
public function geraFormTipo1(){ return <<<EOT <div class="questao-{$this->objQuestoes->numQuestao()}" {$this->isHide}> {$this->label()} <table class="table…
-
0
votes2
answers68
viewsQ: find() is not searching for all input’s
I have a series of questionnaires in which all fields must be answered, the problem is that some inputs are not required, as in the example below: The input type text is not going through validation…
-
1
votes1
answer945
viewsQ: Error 550 when deleting a directory via FTP
I am using Filezilla. Follow the error when trying to delete a folder: Answer: 550 Could not delete 33: Invalid argument I followed a tutorial for uploading images, the difference is that I created…
-
2
votes1
answer53
viewsQ: problems adding an element to HTML with JSON
var componente = { HTML :'<div class="alert" style="background-color:#951f2c !important;">' + '<input type="text" class="form-control titulo-valor" placeholder="Digite o Título do Bloco"…
-
0
votes1
answer84
viewsQ: Is there any alternative to a giant parole other than by switch case?
$metodo = array( "1"=> fazMetodo1(), //retorna algum valor "2"=> fazMetodo2(), //retorna algum valor "3"=> fazMetodo3() //retorna algum valor //... assim vai ); $inputId = "2"; if…
-
3
votes1
answer502
viewsQ: How to catch the key in a while loop?
Let’s say I have an associative array $array=array( "teste" => "1". "teste2" => "2" ); foreach($array AS $key=>$arr){ echo $key; } how does loop? has some way?…
-
1
votes1
answer62
viewsQ: Click event is not working
I’m trying to create a dynamic object for a click event. Every time a page is loaded, the data that is saved in the database will be filled in at the front. The click event has the same rule as the…
-
0
votes2
answers883
viewsQ: Remove empty fields from an array
for(var j =0; j<data.length; j++){ var valorEmBranco = 0; for(var i =0; i<data[j].length; i++){ var porcentagem = 0; var valorPorColuna = data[j][i].valor; //alert(valorPorColuna);…