Posts by David Schrammel • 2,310 points
55 posts
-
0
votes2
answers568
viewsA: Gson: serialization of dates in various formats
Before you start, I suggest you use the correct format ISO8601, that is 2018-07-11T23:15:15.600Z. To do the procedure Voce wants Voce will have to implement…
-
0
votes1
answer114
viewsA: Typescript not enabling the use of the files property
It is not an error, what happens is that the method document.getElementById returns something like this HTMLElement | null, therefore Voce has to check the instance of its element. let element:…
-
4
votes2
answers459
viewsQ: What’s the "Never" type for?
Today I was asked what the guy is for never Typescript, but it got confused for me. It just serves to say that it does not return anything? What’s the difference to the void?…
-
0
votes1
answer52
viewsA: Problems with Javascript HTML function does not show content in the page source code
In order for the input type date to receive the value, you need to submit in the form yyyy-MM-dd, see the snippet function adicionar() { const tabela = $('#tabela'); const ParcelaVencimento =…
-
2
votes1
answer149
viewsA: Scope of service-worker?
A file inside /statics/sw.js will work the same way as one inside the project root?? Won’t work, it will only have access to fetch events that begin with /statics…
-
2
votes2
answers84
viewsA: indexof is not recognized inside the for
You have 2 problems: You are taking the element instead of the href attribute. // Nesse caso, a[i] é um elemento do DOM // var str = a[i]; // O correto seria: var str = a[i].href The index method…
-
3
votes1
answer1314
viewsQ: Angular2 - Inject Component to Body
Good afternoon! I have the following component import { Component, Input, ElementRef, HostListener, OnDestroy, OnInit } from '@angular/core'; /** * This class represents the navigation bar…
-
3
votes2
answers489
viewsQ: Sqlserver Trigger after update
Let’s imagine the following scenario: CREATE TABLE invalido ( ds_valor character varying(255) ) CREATE TABLE email ( email character varying(255) ) now I need a trigger that every time I run a…
-
0
votes1
answer33
viewsA: Inject script into Worker
To import the class just use the function self.importScripts Source: https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts Example: self.importScripts('/minhaClasse.js')…
-
2
votes1
answer33
viewsQ: Inject script into Worker
Hello, I have the following javascript class class MinhaClasse { static list() { return fetch('/api/endPoint', { method: 'GET', headers: { 'Authorization': Auth.getBasic() } }) } } When inside the…
-
3
votes2
answers616
viewsQ: Postgresql Trigger apos update
Let’s imagine the following scenario: CREATE TABLE invalido ( ds_valor character varying(255) ) CREATE TABLE email ( email character varying(255) ) now I need a trigger that every time I run a…
-
0
votes0
answers99
viewsQ: Maven does not export all Classnotfoundexception jars
I have a web project (.War) and it exports SOME jars to WEB-INF/lib folder, as it does not export the jar org.json and I’m getting Classnotfoundexception! I am using Maven, would like to know how I…
-
1
votes0
answers74
viewsQ: Extends and super difference - Generics Java 7
I would like to know the difference of super e extends when declaring something Eneric in java, let’s go to the code that is easier. class Pai { } class Filho extends Pai { } class Filha extends Pai…
-
2
votes3
answers211
viewsA: Regex to ignore invalid file names
You need to escape some characters, see below how your regex should be; [\.\\~#%&\*\{\}\:<>\?\|\-!] in its original failed to escape the . -> Equals for any character {} -> to inform…
-
1
votes1
answer6234
viewsA: How to use Angular onBlur?
var app = angular.module('myApp', []); app.controller('appController', function ($scope, $http){ $scope.pegaCep = function () { …
-
1
votes1
answer162
viewsA: Java command to ignore Encoding
Java command to ignore Encoding This is not how the band plays, encoding is necessary to resolve how the text bits will be interpreted. The site sends something like: header("Content-Type:…
-
1
votes1
answer48
viewsA: Nullpointerexception when connecting the server
You must create an instance of ServerSocket, you are declaring it as a null object try: @Override public void run() { synchronized (this) { this.serverthread = Thread.currentThread(); //Inicializa o…
-
6
votes4
answers11049
viewsA: How to select in 3 tables?
You need to list all 3 tables using the JOIN command See a simple example. SELECT * FROM tabelaA a INNER JOIN tabelaRelacao r on a.id_tabelaA = r.id_tabelaA INNER JOIN tabelaB b on a.id_tabelaB =…
-
1
votes4
answers9178
viewsA: Regex to pick a text between <>
Does anyone know how to remove the <>? Yes, you have to escape them. Java... public static void main(String[] args) { String texto = "Joao <[email protected]>"; String regex =…
-
3
votes2
answers949
viewsA: How to find the height and width of window WITHOUT JQUERY?
Get the size with toolbars/scrollbars Reference : w3schools var w = window.outerWidth; var h = window.outerHeight; document.write(w + ' width /' + h + ' height');…
javascriptanswered David Schrammel 2,310 -
4
votes4
answers8633
viewsA: SQL query comparing two fields of the same table
Case serie be a number the function Max() will work, there’s no mystery. select ra, nome, max(serie), cod_curso from alunos group by ra, nome, cod_curso…
-
2
votes3
answers1296
viewsA: How to use grid with ng-repeat in Angularjs?
I changed your code to work, I warn you that Voce will need to implement another controller called Sharenews var app = angular.module('myApp', []); app.controller('ListaNoticiasHome',…
angularjsanswered David Schrammel 2,310 -
3
votes1
answer730
viewsA: Prevent duplicate entry into a list using Angularjs
Hello, follow your code adapted! see the method $scope.verificaProdutoExistente = function(value) { for(var i = 0; i < $scope.itens.length; i++) { if($scope.itens[i].hasOwnProperty("produto")…
-
5
votes1
answer1106
viewsA: How to return the records of the last 7 days counting the current day with postgresql?
If you do not need to give a time limit, you can find everything after the current day -7 select * from postagem_pagina where data_postagem > current_date - interval '7 days'…
postgresqlanswered David Schrammel 2,310 -
1
votes2
answers2217
viewsA: Dynamic checkbox list in Angular and JSON API
A way without changing the server response {cats: ["1", "2"]} var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.categorias = [ { "id": "1", "id_module": "1",…
-
16
votes5
answers1499
viewsA: What is a gluttonous regular expression?
Greedy: search until the end of the string the last occurrence, ie, take as much as possible. Ex.: Regex: maça .* Input: maça melancia laranja What the regex will take is: maça melancia laranja Not…
regexanswered David Schrammel 2,310 -
0
votes2
answers50
viewsA: Join does not return the expected
This query works for what you requested! it’s right. SELECT c.codCidade, p.nome, c.codigoRegiaoCidade FROM tblcidade c, tblpessoa p WHERE c.ID_PESSOA = p.ID_PESSOA AND c.codCidade = 23 AND…
-
2
votes3
answers20750
viewsA: How to add option for a select by Jquery/Javascript
var cidades = [ 'São Paulo', 'Rio de Janeiro', 'Porto Alegre']; cidades.forEach(function(item){ addOption(item) }); function addOption(valor) { var option = new Option(valor, valor); var select =…
-
1
votes2
answers1397
viewsA: How to disable a combobox with a condition in jquery?
First of all in hisif ($(".card") == 'Spell') is not testing the value of card, you must fetch the value, ie, if ($(".card").val() == 'Spell') So you want when selecting an other combobox to be…
-
8
votes3
answers21104
viewsA: Wait x seconds and show a Ubmit
You can use the function setTimeout() and jQuery to solve your problem easily. In HTML style="display:none" - will make the button invisible at the start In Javascript $('#idSubmit') - represents…
javascriptanswered David Schrammel 2,310 -
1
votes2
answers52
viewsA: I believe my mistake is in the matrices, or type conversions, but how to solve?
Try Integer i; Integer j; x = ( Integer ) b.x; y = ( Integer ) b.y;
-
12
votes1
answer950
viewsQ: Java Interface 8
Java 8 allows you to implement methods in the interface itself. So I’d like to know what an abstract class can do that an interface cannot. Source:…
-
1
votes3
answers420
viewsA: java.util.Map, best implementation considering just get(Object key)
To solve my problem I performed a test with some implementations of Map, after populated in identical way with 1400 executed objects. speedTeste(hashMap, "hashMap"); speedTeste(treeMap, "treeMap");…
javaanswered David Schrammel 2,310 -
1
votes1
answer210
viewsA: What is the purpose of modifying protected access in Java? In what situations should I use it?
Default: You have access to a default attribute (identified by the absence of modifiers) all classes that are in the same package as the class that has the attribute. Protected: This is the one that…
oopanswered David Schrammel 2,310 -
0
votes2
answers100
viewsA: I define a value in a class, when I instate the same value is another
You are overwriting the constructor, and the default value is false public Domestico() { Console.WriteLine("Qual o nome do seu bicho de estimação?"); Nome = Console.ReadLine();…
-
4
votes1
answer348
viewsQ: How to clone values of an object
How can we make an object equal to the "values" of an object? Whereas my object has other objects, and lists of other objects.
javaasked David Schrammel 2,310 -
12
votes2
answers1714
viewsA: Invoking an object’s method - reflect
package java.lang.reflect; ... //Obtenha a classe pela instancia Class clazz = Class.forName( seuObjeto.getClass().getName() ); //Obtenha o metodo da classe pelo…
-
0
votes3
answers373
viewsA: Reset button on the form
You can add a type input reset, it will reset the form to its default values, example: Form: <form name="myform" method="POST"> <input type="text" size="25" value=""> <input…
cakephpanswered David Schrammel 2,310 -
1
votes3
answers2496
viewsA: How to submit a form automatically and without refresh?
Create a javascript function to run Submit and call the function from the event onchange function enviaSubmit(){ var valor = document.txtForm.valor.value; var valorant =…
-
2
votes2
answers570
viewsA: Optimize Mysql table Insert - Java
If you have a looping and are using java can separate the task into threads according to the amount of connection pool Voce can use in the database. If you need to store the status of each Insert…
-
2
votes3
answers178
viewsA: Validate a Form
In your saving method you can validate function saveTextAsFile() { var textToWrite = document.getElementById("inputTextToSave").value; if ( textToWrite !== "" ){ alert("Favor preencher todos…
javascriptanswered David Schrammel 2,310 -
34
votes3
answers30862
viewsQ: When to use Stateful or Stateless
I would like to know the difference and when to use. Stateful Stateless
-
10
votes1
answer441
viewsA: How to treat the submission of a form to be executed only once?
Disable the button after the first click, because if the request delay the user will have the perception that the request was really sent, and can not send another. $('form#id').submit( function( e…
javascriptanswered David Schrammel 2,310 -
1
votes4
answers11622
viewsA: Is it possible for a Javascript function to call a method that is in the Behind code of the page?
first step, in the server-side add the method. [WebMethod] public static string Message(){ return " MENSAGEM "; } Step 2, look for the tag <asp:ScriptManager ID="..." runat="server" /> and add…
-
5
votes2
answers1857
viewsA: OSI error when published application
Detailing In IIS 7, there are two request processing modes for application pools: integrated mode and classic mode. When you set up an application pool with integrated mode, IIS will process…
-
2
votes2
answers321
viewsA: Inner Join 3 tables
"SELECT ofertas.id, ofertas.titulo, ofertas.descricao, ofertas.valor, ofertas.user_of, ofertas.categ, ofertas.local, ofertas.fav, favoritos.id_oferta FROM ofertas INNER JOIN favoritos ON…
-
0
votes4
answers822
viewsA: When is a string considered a primitive type in web development?
Language-dependent! For example, in C# there is the primitive type string and the Object String but in the java only exists the object String. C#: string tipoString = "casa"; String objetoString =…
-
0
votes4
answers6032
viewsA: line break inside the string
Try <?php $str = "Vou para Manaus"; echo(strlen($str)); //exibe 15 $str = "Vou para \n Manaus"; echo(strlen($str)); //exibe 18 ?>…
phpanswered David Schrammel 2,310 -
0
votes3
answers164
viewsA: Return the id of a table in another table
First Voce should add a column in the table aprovacao ALTER TABLE aprovacao ADD id_cliente BIGINT; Now Voce needs to add the id_cliente I suggest you use a UPDATE with the SELECT, would be +/- like…
-
3
votes3
answers1792
viewsA: Is it a good idea to declare variables with accents?
Is there a possible problem in declaring accented variables (like $joão, $está_certo, $é_array) in relation to the PHP language? One of the biggest problems I see is that sometimes a developer might…