Posts by Marconi • 17,287 points
267 posts
-
9
votes1
answer4461
viewsQ: What is a middleware for?
I see in some courses some people highlight something like a middleware, example: middleware(authentication, authorization). I found the explanation rather superficial because it was not focus of…
-
1
votes4
answers2332
viewsA: Regex to pick word between two words or "/"
That regex /\/resourceGroups\/(.*)\/providers\// will take what is between /resourceGroups/ and /providers/ by means of a group. Working let texto =…
-
1
votes3
answers396
viewsA: How to write a Regular Expression to find a paragraph?
The only thing that is incorrect in your regex is </p>, the bar should be escaped, getting like this: /<p>.*<\/p>/; I noticed that no one used a concept in regex called rearview…
-
5
votes2
answers660
viewsA: How to pick a value between brackets in the string?
You can do this with REGEX "\[(.*)\]" \[ Escape is necessary to be treated as text and not as a set. .* Look for any or several occurrences. In the C# take the first Group, that’s where the word…
-
3
votes1
answer77
viewsA: How do I verify that all data on my list exists in the database?
In the Dapper there’s no need to put () in(as is traditionally done in a query), this is done directly. Dapper allows you to pass Ienumerable and parametrize automatically your query. I changed your…
-
3
votes2
answers3227
viewsA: How to access mobile camera via Web Site?
Here in this answer How to access a mobile’s camera from a web app? On iPhone iOS6 and Android ICS onwards, HTML5 has the following tag, which allows you to take photos from your device: <input…
-
2
votes2
answers345
viewsA: Taking value from an attribute inside an input from a table column
How about with pure Javascript? var checkbox = document.querySelectorAll("table tr td input"); for(let i = 0; i < checkbox.length; i++){ console.log(checkbox[i].getAttribute('VeiculoId')); }…
-
8
votes2
answers2983
viewsA: How to exclude a certain group from the regular expression
The idea is to search for the pattern you want to remove. I understand you want to remove the |12 at the end of the text, that is, the pattern you are looking for is |número My expression is based…
-
2
votes3
answers5520
viewsA: How to install Jquery in Angular?
Root of the project: npm install jquery --save angular-cli.json "scripts": [ "../node_modules/jquery/dist/jquery.min.js", ] Ts: import $ from "jquery"; stackblitz…
-
0
votes2
answers2021
viewsA: How to check whether elements of an array are contained in another Jquery array
I understand that you want to check whether all the items in an array contain in another array. You can use the filter, where the result of the found items will be stored in a new array, so just…
-
1
votes1
answer375
viewsQ: How to return the total amount when using OFFSET and FETCH NEXT?
I had to use OFFSET and FETCH NEXT to return a data range between my query. Table CREATE TABLE [dbo].[Usuario] ( [Id] [int] IDENTITY(1,1) NOT NULL, [Email] [nvarchar](max) NULL, [Nome]…
-
1
votes3
answers605
viewsA: How to give a Regex before a string? And select?
There is a concept in regex what call positive lookahead, that is, looking forward to. .*(\w+)(?=:) Look for a text that has a front of the text : Running on regex101…
-
0
votes5
answers1540
viewsA: Regex with Javascript - Taking only part of the string
My regex was like this: /(\w+\.\w+)(?=\?)/ (\w+\.\w+) Look for a text that has a . followed by a text. (?=\?) use Positive Lookahead, that is, looking forward look for ? Running on regex101…
-
3
votes2
answers1541
viewsA: Regex filter only values in real
I believe you’re looking for the pattern numero.numero,numero, I would make a regex thus: /\d+\.\d+,\d+/ \d is a shorthand that searches for numbers, is the same as the set [0-9] + is a quantifier…
-
5
votes2
answers334
viewsA: Why do sets with intervals of A-z return symbols in REGEX?
The crease or intervals follow the table Unicode. I defined that my set should be A(maiúsculo) até z(minusculo), there are symbols in the middle of that range. It’s them: [ \ ] ^ _ ` Look at the…
-
5
votes2
answers334
viewsQ: Why do sets with intervals of A-z return symbols in REGEX?
Setting: const texto = 'ABC [abc] a-c 1234'; console.log(texto.match(/[A-z]/g)) Why the set of A(maiúsculo) until z(minusculo), that is to say, /[A-z]/g returned me to [ and ]? The result should not…
-
5
votes2
answers47
viewsA: Catch date previous to year 2000 Mysql
I would do it differently, using the function YEAR(). SELECT nome_funcionario FROM funcionario WHERE YEAR(data_contratacao) < 2000…
-
3
votes1
answer1565
viewsA: Bring the first line based on an SQL date
CREATE TABLE HISTPESSOA( PessoaId int, Situacao varchar(10), DataInsert date, Valor int ); INSERT INTO HISTPESSOA(PessoaId,Situacao,DataInsert,Valor) values (999,'Ativo','2018-01-10',1111),…
-
2
votes3
answers538
viewsA: How to take the value of each TD inside each TR dynamically using jQuery?
To william’s response da is very good, but another way to be doing using pure Javascript: var arrayTr = document.body.querySelectorAll('#tableEsportes > tbody > tr'); var array = []; for (let…
-
2
votes4
answers534
viewsA: Help with distinct
Yes your distinct will not work because you are adding to data in the result. I suggest you list your lines with the function ROW_NUMBER segmenting by name and sort the situation downwards(from the…
-
4
votes1
answer460
viewsQ: How to install the Typescript Plugin in Sublime Text 3?
I am trying to install the plugin in Sublime Text 3, and for this I did the steps: I installed the GIT I executed the available commands here at the GIT terminal. I pressed Control+Shift+P to see if…
-
4
votes2
answers528
viewsA: How to use the SUM aggregation function in a NHIBERNATE query?
For your mistake, that question: How to resolve No data type for Node error in Hibernate, says: An HQL Query must contain the object properties and not the fields of your table structure. In SQL:…
-
6
votes4
answers1976
viewsA: Remove numbers at the end of a Regex string C#
To extract the numbers at the end of the string use Regex @"\d+$" Check that the string’s character output is greater than 4 Utilize Replace and replaced with nothing. See working on dotnetfiddle.…
-
9
votes2
answers957
viewsA: What is the way to truncate a string in Csharp?
Just check if the string size is menor/igual to the limit, use a if ternary. texto1.Length <= limite ? texto1 : texto1.Substring(0, limite); Another way is to use Math.Min Method, which returns…
-
1
votes1
answer204
viewsA: How to do column operations where you give nicknames?
Use a subconsulta correlated. One subconsulta correlated is a subconsulta which cannot be executed independently of external consultation. The order of operations in a subconsulta correlated works…
-
4
votes1
answer197
viewsA: SQL SERVER odd line queries
Use ROW_NUMBER to list the lines, divide the line by 2 where the rest of that division is 1. The operator %(MOD) will be necessary in this case. Notice I used a subConsulta uncorrelated, i.e., a…
-
2
votes2
answers2282
viewsA: Error with Insert in SQL Server: The Conversion of a varchar data type to a datetime data type resulted in an out-of-range value
The correct date format is AAAA-MM-DD. Sqlfiddle Read more on: Date and time data types If you want to select your date in the format dd/mm/aa, use the function CONVERT. CONVERT(VARCHAR(10),…
-
3
votes1
answer95
viewsA: How to remove keywords between { } keys in the Mysql field?
Do: SELECT LOCATE('{', SEUCAMPO), LOCATE('}', SEUCAMPO) FROM SUATABELA; SELECT SUBSTRING(SEUCAMPO,LOCATE('{', SEUCAMPO), LOCATE('}', SEUCAMPO)) FROM SUATABELA; SELECT…
-
0
votes2
answers5083
viewsA: Convert Datatable to List C#
How did you give detail of how the structure of your columns is DataTable, and how the property of VoCliente, I did a basic example with Linq. It is only necessary to adjust to anticipate your need.…
-
0
votes1
answer68
viewsA: Retrieve data from an XML file using Xpath and C#
Xmlnode method.Selectnodes Selects a list of nodes that match the Xpath expression. Your code must be like this: XmlDocument doc = new XmlDocument(); doc.Load("EnderecoArquivo"); XmlNode root =…
-
7
votes2
answers277
viewsA: Why does type='date' not work in Firefox?
Why your code works in Chrome? The type='date' is not supported by Firefox. In this part of the code both browsers will generate different results. venc_array = vencimento.split("/"); vencimento =…
-
27
votes3
answers2676
viewsA: When to use SET and SELECT?
I always had this doubt, but I never researched and even this happens a lot to me. No Stackoverflow in English has this topic explaining when to use one and the other, the main differences are: SET…
-
0
votes4
answers1204
viewsA: Capture the value of a text without the mask?
In the documentation says you have to use cleanVal() to get the value without the mask. $("#txtnuminic").mask("99999999-9"); $('button').click(function (){ console.log($('#txtnuminic').cleanVal());…
-
7
votes1
answer6636
viewsA: How to calculate the average using conditions in SQL Server?
AVG (Transact-SQL) Returns the mean of the values in a group. The null values are ignored. Since you gave no details, I assume your SQL will be something like: SELECT CASE WHEN AVG(NOTA) > 7 THEN…
-
5
votes2
answers1392
viewsA: What are they, Readpast and Nolock?
Compare SQL Server NOLOCK and READPAST Table Hints TL;DR CREATE TABLE TESTE ( ID INT NOT NULL PRIMARY KEY, VALOR CHAR(1) ) INSERT INTO TESTE(ID,VALOR) VALUES (1,'A'),(2,'B'),(3,'C') Scroll this…
-
10
votes3
answers8992
viewsA: Select first record within a segmentation in SQL Server
CTE with ROW_NUMBER() ;WITH CTE AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY codigo_curso ORDER BY data_ingresso) AS row FROM ALUNOS ) SELECT * FROM CTE WHERE row= 1 SubQuery Correlated: SELECT…
-
3
votes3
answers556
viewsA: An image with display:None is loaded? Consume data?
First thing you should understand is : When to use the background CSS tag or property? If your image has no semantic value use the property background-image + display:none in a div, this will…
-
1
votes5
answers12287
viewsA: How to perform SQL concatenation
CONCAT (Transact-SQL) Returns a string that is the result of concatenating two or more string values. SQL-Server 2012 partition is available. Query: select CONCAT('O ano em que estamos é ',…
-
4
votes1
answer1278
viewsA: How to display the text in the datalist and not its value?
I understand you want to send the id and the input displays the teacher’s name. I made a little change in yours HTML, in value add the names of Teachers, and in data-value put the id.…
-
50
votes5
answers60507
viewsQ: DISTINCT and GROUP BY, what is the difference between the two statements?
DISTINCT The SELECT DISTINCT statement is used to return only values distinct (different). Within a table, a column usually contains many values duplicated; and sometimes you just want to list the…
-
4
votes4
answers1722
viewsA: How to recover a value from within a tag in XML?
value() Method (xml Data Type) Runs an Xquery against an XML and returns an SQL type value. This method returns a scalar value. You usually use this method to extract a value from an instance XML…
-
5
votes2
answers590
viewsA: How to disable Chrome Pop-UP to save passwords?
For commenting from @Wallace Maxters, I discovered that nowhere does it say exactly how to disable this Pop-UP(in the right ways), but there are ways to circumvent this. Why does that happen?…
-
6
votes2
answers590
viewsQ: How to disable Chrome Pop-UP to save passwords?
What would be a method to disable the Pop-Up: Want Google Chrome to update your password to this site? Feel free to choose language, but answer with JavaScript will be the answer accepted. Nota:…
-
2
votes2
answers1201
viewsA: How to return some* data with time interval?
Using CTE this is possible from the SQL Server 2005, is also available on MYSQL. But what turns out to be Common Table Expression (CTE) ? A Common Table Expression (CTE) can be viewed as a result…
-
46
votes2
answers45560
viewsQ: What is the correct way to use the float, double and decimal types?
Since college I can’t understand the real difference between the type DOUBLE and FLOAT, I ended up meeting the guy DECIMAL which also treats real values. About the type DECIMAL, found the following…
-
3
votes7
answers33990
viewsA: How do SELECT all fields except a few?
I found a non-performation solution, but it works. SELECT * INTO #TEMP FROM NOME_SUATABELA ALTER TABLE #TEMP DROP COLUMN COLUMN_1, COLUMN_2... SELECT * FROM #TEMP DROP TABLE #TEMP Enter any result…
-
46
votes3
answers1348
viewsQ: Should systems force the user to create a strong password?
I’ve been wondering why some systems require such strong passwords. Example: Minimum of 8 Characters Uppercase and Minuscule Numbers Special Characters In many places they say that strong passwords…
-
6
votes8
answers955
viewsA: split/regex only on the first vertical bar "|"
var str = 'João|||23anos|'; var splits = str.match(/([^|]*)\|(.*)/); splits.shift(); console.log(splits); Explanation: str.match(/([^|]*)\|(.*)/); returns 2 Groups plus the Full Match, then the…
-
3
votes2
answers402
viewsA: How to select records in an Auto-referenced table using Recursiveness?
Through the questions: Rescue all nodes from an Sqlite database tree Simplest way to do a recursive self-join? Recursive query I managed to reach the select below. In my case the stopping point will…
-
5
votes2
answers402
viewsQ: How to select records in an Auto-referenced table using Recursiveness?
In a scenario of areas where one area can be supervised by another is representing in a tree structure as follows: Problem: The need to select the Área (CBT - Cubatão Industrial Complex) plus all…