Posts by aa_sp • 848 points
42 posts
-
-1
votes1
answer45
viewsQ: Decode does not work
I’m using the htmlagilitypack, where a url extraction is done inside a div, the problem is that it is not correctly bringing the encoding. Request from. net: string requisita = new…
-
2
votes1
answer129
viewsQ: Instantiating generic type of an Enum
I would like to instantiate a class from an Enum, for example: Instead of doing: var classeGenerica; if (viewModel.tipoCarro == 1) classeGenerica = new classeCarro(); else classeGenerica = new…
-
0
votes1
answer24
viewsQ: Lambda in related classes (EF Migrations)
It’s been a while since I’ve dealt with FE so I doubt it. Have the classes Product and Producthow much and need to make an inquiry in the products with quantity equal to 10; I tried to: var retorno…
-
0
votes1
answer352
viewsA: Sort form by javascript to form array
what I could suggest to you is to use jquery: $(document).ready(function() { var arrayPergunta = []; var arrayResposta = []; $('#add').click(function() { var pergunta = { Titulo: $("#titulo").val()…
-
1
votes1
answer239
viewsQ: Regex to remove HTML Entity
I have an excerpt of HTML in which I extract some information. However in one of these HTML is coming the code + in the middle, which means the sign +. I tried a few ways but no removing that…
-
1
votes1
answer68
viewsA: Case/when, help us
From what I understand, it would be something like this: DECLARE @TABELA_TEMP TABLE ( COD_DO_USUARIO INT , TEXTO VARCHAR(MAX) , DATA_ENVIO DATETIME ) INSERT INTO @TABELA_TEMP VALUES (1, 'mensagem…
-
0
votes1
answer141
viewsQ: Regex to extract HTML information
I am trying to extract information that comes from reading email. However when you pass the match line, it pops the following error: {"analyzing "(?si:(Information Type[ d]+(?[ d]+)|Information…
-
0
votes1
answer82
viewsA: I am trying to print an array using for in javascript, but it is not displayed correctly
See if that’s it: let mochila = new Array(); let item1 = ['corda', 2], item2 = ['faca', 3], item3 = ['cura', 23], item4 = ['prego', 35]; mochila.push(item1); mochila.push(item2);…
-
2
votes2
answers81
viewsA: Boostrap Vertical Alignment
A suggestion: <div class="container bottom-align-div"> <div class="row"> <div class="col-6"> d </div> <div class="col-6"> e </div> </div> </div> CSS:…
twitter-bootstrapanswered aa_sp 848 -
3
votes1
answer5325
viewsA: Validate agency DV and federal savings account
As found in the document: http://177.153. 6.25/ercompany.com.br/boleto/Laravel-boleto-master/manuals/Rules%20Validacao%20Conta%20Corrente%20VI_EPS.pdf the rules would be:…
-
1
votes2
answers818
viewsA: How do I repeat a phrase that the user has typed in n times in js?
Use the function repeat: var palavra = "oi"; var quantidade = 10; alert(palavra.repeat(quantidade)); In the excerpt of your code, would look like this (adapt as your need): var i; var nome =…
javascriptanswered aa_sp 848 -
1
votes1
answer140
viewsA: Hide information with javascript [DOUBT]
If I understand correctly, I will make a suggestion: What I changed was to add unique Ids to the reply Ids and I used Jquery. HTML: <div id="conteudo"> <div id="links"> <ul> <li…
-
1
votes2
answers61
viewsA: Variable keeps zeroed in a mathematical expression
I don’t know if it was your broker but you don’t usually use accentuation in programming. Change data type to decimal: decimal cSubida = 6, cDescida = 4, range = 10; Example:…
-
3
votes2
answers4471
viewsA: How to Store Strings in Vectors - C
You can make a two-dimensional array: #include <stdio.h> #include <stdlib.h> #include <locale.h> int i; float tvendas[10], pvendas[10]; char nome[15][15]; int main(void){…
-
3
votes5
answers869
viewsA: Fill <text> inputs after check <checkbox> and clear when unchecking
Follows a suggestion: <form> Deseja anonimato? <input type="checkbox" id="anonimo"> <div id="containerInput"> <input type="text" id="nome" placeholder="seu nome"> <input…
-
6
votes5
answers713
viewsA: indexof does not find element in an array
You can use the map to return: var pessoas = []; pessoas.push({"nome": "Pedro"}) pessoas.push({"nome": "João"}) pessoas.push({"nome": "Maria"}) pessoas.push({"nome": "José"}) function encontrar() {…
-
3
votes3
answers151
viewsA: Check if URL contains number
A very simple example: var valor1 = "https://answall.com#"; var valor2 = "https://answall.com#123i"; var verifica1 = valor1.substr(valor1.indexOf("#") + 1); var verifica2 =…
-
1
votes2
answers36
viewsA: Different titles for each slideToggle
In its code, it is defining the title by class, and all Divs have the same class. A suggestion would be to add an ID to each div and set the title individually: <style> #box-toggle {…
-
0
votes1
answer50
viewsA: How to take the return value of the function
I’ll leave it here as an answer to make it clearer: $.ajax(settings).done(function (response) { console.log(response); console.log(response.Payment.Status); }…
-
1
votes1
answer238
viewsA: Logic for Boolean variables in ASP
It can happen that one server is in PT/BR and another in EN. One way would be to add Global.asa to the configuration, so that both are in the same format: <script language="VBScript"…
-
0
votes2
answers876
viewsA: Case in Sub Select SQL SERVER
The following is an example of the use of ISNULL() and COALESCE functions() declare @ID_1 int = null declare @ID_2 int = 17 select ISNULL(@ID_1, @ID_2) teste1, COALESCE(@ID_1, @ID_2) teste2 If you…
-
2
votes1
answer546
viewsA: Time 0 with negative signal
Solved, I adapted the function TEXT (suggested by the colleague): =SE(TEXT(F4-E4;"[hh]:mm") = "-00:00"; "00:00"; F4-E4)
-
-1
votes1
answer546
viewsQ: Time 0 with negative signal
I have an excel spreadsheet which I changed the date system to 1904 to be able to display negative hours. The problem is that often happens to appear values -00:00 when I subtract schedules. From…
-
0
votes1
answer958
viewsA: Sum with Negative and Positive Numbers - Sql Server
I put together an example based on what you posted: create table temp (valor float) insert into temp (valor) values (-9.9961) insert into temp (valor) values (-30.41) insert into temp (valor) values…
-
2
votes3
answers8240
viewsA: Fill string with zeros
It could be so: int tamanhoFinal = 9; int numero = 988554; Console.WriteLine(numero.ToString("D" + tamanhoFinal.ToString())); https://dotnetfiddle.net/5I69S4…
-
0
votes5
answers6090
viewsA: Autofocus: position the cursor at the end of the value
A suggestion: <form> <div> <input type="text" name="p" autofocus value="teste" onfocus="this.value = this.value;"/> </div> </form>…
-
0
votes2
answers11440
viewsA: How to position a button anywhere on the screen, in html
Modify this excerpt: #centralizar{position: absolute; top:50%; left:50%} in operation: https://jsfiddle.net/e92qeyyn/2/…
-
1
votes1
answer1305
viewsA: Help for a Javascript exercise with for...of and Join()
You only need to first scroll through each object in the array usuarios and then print your attributes on the console. To print each user’s skills on a single line, use the method join to join all…
javascriptanswered aa_sp 848 -
0
votes2
answers69
viewsA: Help with handling employees' schedules
I put together an example by selecting randomly. See if it helps you: ;WITH grupoHorario AS ( SELECT almoco_saida, nome, ROW_NUMBER() OVER (PARTITION BY almoco_saida ORDER BY newid()) AS…
-
4
votes3
answers536
viewsA: How to show quantity of sales per month payment in SQL Server
Set an example, see if it fits: create table tempVendas ( DataVenda datetime, FormaPagamento varchar(100) ) insert into tempVendas values ('2018-01-01', 'Boleto') insert into tempVendas values…
-
0
votes3
answers86
viewsA: Conditional with if and Else
I would suggest: <script> function maiorMenor(metodo) { var numero1 = parseInt(document.getElementById("num1").value); var numero2 = parseInt(document.getElementById("num2").value); if…
-
1
votes1
answer104
viewsQ: riding a Regex
I’m picking up a bit here with to assemble the Regex of a pattern I set up, which would be this: ALTERAC[AO,OES] [DE] CADASTRO[S] [-] SOCIAL What is between [ ] is what may vary. The doubt is that…
-
2
votes3
answers253
viewsQ: Search for word variations
I have a sentence that I need to check if it meets a rule but there may be variation in writing (accentuation, more or less spaces,...) Example: string fraseProcurada = "Cadastro de Usuários - SP";…
-
0
votes1
answer110
views -
0
votes1
answer95
viewsA: Return data from 01 column in 03
A suggestion is to use CASE: create table tblTeste ( ID int, ID_STATUS int ) create table tblStatus ( ID_STATUS int, STATUS varchar(50) ) insert into tblTeste (ID, ID_STATUS) values (1, 1) insert…
-
0
votes4
answers487
viewsA: Fill a datatable from a txt
See if that helps you: var reader = cmd.ExecuteReader(); var columns = new List<string>(); for(int i = 0; i < reader.FieldCount; i++) { columns.Add(reader.GetName(i)); } another example var…
-
0
votes1
answer453
viewsA: Add two created columns
CREATE TABLE #CPARTIDA ( CODFILIAL INT, CODCCUSTO INT, VALOR DECIMAL (18,2), IDPARTIDA INT, CODLOTE INT, CODHISTP INT, CREDITO INT, DEBITO INT, CODCOLIGADA INT, COMPLEMENTO VARCHAR(100), DATA…
-
0
votes1
answer132
viewsA: SELECT with LEFT JOIN successfully but some wrong results
create table #tbCustosProd ( Id int NOT NULL identity primary key, ManuPart varchar(255) DEFAULT NULL, Qtd int DEFAULT NULL, CustoUnit decimal(9,2) DEFAULT NULL ) GO create table #tbEntregas ( Id…
-
3
votes2
answers161
viewsA: right div align
div.tres { float: right; justify-content: center; align-items: center; background-color: gray; border: 2px solid; border-color: gray gray gray gray; }
-
0
votes2
answers1662
viewsA: Insert multiple values into a table
With Sql Server, 2 suggestions: declare @sql nvarchar(max) set @sql = N'insert into tabela (coluna1, coluna2) values (''coluna1'', ''coluna2''); insert into tabela (coluna1, coluna2) values…
-
4
votes3
answers111
viewsA: How to do a function to calculate and alert the number of lamps needed to illuminate a particular room
The calculation should be done in this way: var potenciaTotal = (largura * comprimento) * 18; var resultado = potenciaTotal / potencia; Following example: function alertarNumeroDeLampadas(){ var…
-
0
votes1
answer58
viewsA: How to make two separate selections
I haven’t had much time to think of a good logic, but if it’s more or less that, you can get better as needed: <html> <head> <style type="text/css"> .azulMarcado { color: white;…