Posts by Ricardo Pontual • 21,129 points
751 posts
-
2
votes3
answers121
viewsA: List value of checkbox items
You can use the following selector to pick all checkboxes that are selected: $('input[type="checkbox"]:checked') Below is an example with your code. By clicking on the checkbox, it selects/deselects…
-
0
votes1
answer607
viewsA: SOAP E-social Request Template
The message is very clear, you are sending a Content-type invalid, different from what the service is expecting. Try to add the Content-type correct in the request header, something like this:…
-
0
votes1
answer25
viewsA: Javascript, fails to "save" array ordering
I made some commented changes to your code: var matriz = []; var novamatriz = []; var i = 0; // Principal matriz = [1, 2, 10, 3, 200]; matriz.sort(); /* aqui estou fazendo uma copia realmente do…
-
1
votes1
answer231
viewsA: SQL Server - count records by combination
You can use a query to analyze the combinations using STUFF, see this link: https://sqlperformance.com/2014/08/t-sql-queries/sql-server-grouped-concatenation And from this query, analyze the…
sql-serveranswered Ricardo Pontual 21,129 -
1
votes2
answers42
viewsA: Show and hide from bank
Pass a reference to the function, of the element that triggered the event for example using this: <input type="button" value="Ver mercadorias" onclick="ver_endereco(this);"/> This will make it…
-
2
votes1
answer515
viewsA: Can I put the navigation menu inside the site header?
To answer your question in a more assertive way and less guided by opinions, I took the reference of W3C about the tag nav: http://w3c.github.io/html/sections.html#the-Nav-element In free…
html5answered Ricardo Pontual 21,129 -
1
votes1
answer667
viewsA: How to take the return of a trial to know if you had any lines affected?
There are two points to check: 1. To stored Procedure is returning the number of records affected? You must perform the Procedure and make sure it returns the number of affected records. For…
asp.net-coreanswered Ricardo Pontual 21,129 -
2
votes2
answers1867
viewsA: View with double SELECT from the same table
The @rLInhares solution solves this scenario well, just to quote, as a second alternative case the JOIN not possible, can also nest the SELECT. Taking your example, it would look like this: SELECT…
-
1
votes1
answer164
viewsA: Centering buttons on a div does not work
Hello, some considerations about the way you are trying to apply styles to your layout: 1) align="center" is obsolete in HTML5; 2) an element should not "align" unless you change the position,…
-
4
votes1
answer32
viewsA: How to convert XSLT to XSD?
It doesn’t make sense to do that because they have different purposes: XSLT is using to "parse" a XML turning into another XML (or another format such as HTML) Read more here:…
-
5
votes2
answers4177
viewsA: How does hierarchy elements work in css?
According to the documentation of Developer.mozilla.org: Origin is defined in 3 levels 1. Importance Styles with !important precedes all others and has higher priority. Followed comes style defined…
-
0
votes2
answers313
viewsA: Focus Textbox function and Check if it is filled
Just capture the event click to deal with when the field is clicked If you also want to remove the effect when leaving, just use the event blur: $('#i').click(function() { if ($(this).val() == '') {…
-
0
votes2
answers4663
viewsA: Select last record of a table - sql
I built a generic query using GROUP BY to group REG (including also PATIENT for easier reading) and MAX for the date: select REG, PACIENTE, max(DATA) from Tabela group by REG, PACIENTE Here a…
sqlanswered Ricardo Pontual 21,129 -
0
votes1
answer65
viewsA: Best way to ensure consultation isolation
You can execute both commands within a transaction using SqlTransaction: using (SqlTransaction trans = conn.BeginTransaction()) { using (SqlCommand command = conn.CreateCommand()) {…
-
4
votes2
answers58
viewsA: Left Join in SQL
There are two errors in your script: 1) LEFT JOIN PARCELAS PARCELA IN must be: LEFT JOIN PARCELAS PARCELA ON Documentation: https://technet.microsoft.com/pt-br/library/ms187518(v=sql.105). aspx 2)…
sql-serveranswered Ricardo Pontual 21,129 -
2
votes2
answers973
viewsA: Browse table with N lines with FOR and find specific values
To walk the lines you can do so: $('#tbPedidos> tbody > tr').each(function() { // aqui tem a linha (tr) var linha = $(this); }); However, if you specifically want the selects in the table, you…
-
2
votes4
answers13421
viewsA: Query INSERT with WHERE condition
As @Renan has already mentioned, it is not allowed WHERE in the INSERT, then use a SELECT how the @Danielle response will solve your case. It seems to me that the key to your table is the column id…
-
5
votes1
answer8375
viewsA: Use CASE in a WHERE clause
An alternative solution that does not involve the CASE WHEN is to test Tp_note on WHERE, thus: WHERE ( (NotFis.Tp_Nota='P' AND (NotFis.DT_Emissao between '2018-01-01' AND GETDATE())) OR…
-
2
votes4
answers636
viewsA: Check object array index by property
You can use splice to remove an element per index from an array: array.splice(i, 1); In the example, it removes 1 element from the index i Reference:…
-
3
votes3
answers411
viewsA: Pick last element attribute date from a list
You can use last to take the last item of an array of elements from its selector: var ultimoId = $('.dd-item:last').data('id'); Reference: https://api.jquery.com/last/…
-
1
votes1
answer31
viewsA: Function . not() does not work correctly
In your case it will not be possible to do this on the dial, but you can check it on Function. The click brings with it information of who shot the event among other things (read more here: click…
-
4
votes1
answer118
viewsA: Primary key return of an INSERT
Use the function mysql_insert_id(). Take this example: mysql_query("INSERT INTO mytable (product) values ('kossu')"); printf("Last inserted record has id %d\n", mysql_insert_id()); Source:…
-
1
votes2
answers132
viewsA: How to change EF6 to create Datetime fields as datetime2
In my case, I defined this in the method OnModelCreating, adding this line: modelBuilder.Properties<DateTime>().Configure(c => c.HasColumnType("datetime2")); It was an answer to that…
-
1
votes1
answer303
viewsA: datetime vs dateime2, which is the best?
DATETIME2 has a larger date range than DATETIME: DATETIME: 01/01/1753 E 31/12/9999 DATETIME2: 01/01/0001 A 31/12/9999 MSDN documentation recommends using DATETIME2 (from SQL Server 2008): Use time,…
-
1
votes1
answer57
viewsA: Optimize sequence of if
If I understand correctly you want to check if a dynamic property of a ExpandoObject and set a value is this? Adapting your code would be something like this: dynamic line = new ExpandoObject();…
-
1
votes1
answer221
viewsA: mysql_query() expects Parameter 1 to be string, Resource Give
The SQL command is wrong, the name of the fields in the insert should come in parentheses, like this: $result_leados = "INSERT INTO tb_usuarios(email) VALUES ('$email')"; In addition, it is not…
phpanswered Ricardo Pontual 21,129 -
2
votes3
answers253
viewsA: Search for word variations
Some comparison would not be possible, such as using "S.P" or even "São Paulo", because there is not enough generic code, such as Contains or IndexOf identify this, know for example that "SP" means…
-
2
votes1
answer25
viewsA: Compare if dates are in the period
You can compare date to date directly: Function ditadura(data) inicio = CDate("01/04/1964") fim= CDate("15/03/1985") If data >= inicio And data <= fim Then ditadura = "Você nasceu em um…
aspanswered Ricardo Pontual 21,129 -
2
votes2
answers433
viewsA: SQL server data default
Just add default in the Dtexpiration column with the date in YYYYMMDD format or in the language format defined for the database, thus: DtExpiracao datetime default ('19900101')…
sql-serveranswered Ricardo Pontual 21,129 -
2
votes1
answer216
viewsA: Angular - ng-Pattern - Hours
You can use this Pattern: /^([0-1]?[0-9]|2[0-3])$/ Explanation: ^ "deve iniciar por" ( "início de um grupo" [0-1]?[0-9] "zero ou um, seguido por zero a nove" | "ou" 2[0-3] "iniciado por dois,…
angularjsanswered Ricardo Pontual 21,129 -
4
votes3
answers1618
viewsA: Encoding string conversion
You can use the System.Text.Encoding // Obtém um array de bytes do texto byte[] bytes = System.Text.Encoding.Default.GetBytes("Cinto De Segurança"); // Codifica o obtém a string. Usando UTF8, mas…
-
6
votes2
answers314
viewsA: =, BINARY, LIKE, LIKE BINARY, REGEXP, SQL binary grouping
According to Mysql documentation (string comparation), comparisons of strings are not case-sensitive, unless one of the operators be it case-sensitive, or the collation country. Therefore, use = or…
-
3
votes5
answers453
viewsA: How to separate "words" in Camelcase in C#?
It can be like that too: string camelCaseString = "EuSouUmaStringCamelCase"; string retorno = System.Text.RegularExpressions.Regex.Replace( camelCaseString, "(?<=[a-z])([A-Z])", "-$1",…
-
1
votes2
answers742
viewsA: How to put paging in foreach that returns a JSON list with ajax
As you already have an object of the type List on the server side, you can use the methods Skip and Take for paging. They respectively "skip" some items and "take" some items from a list. For…
-
1
votes1
answer63
viewsA: Show div to scrolar the page?
This cannot be done simply with CSS, need to use Javascript, already user jQuery is an option to make things easier. You can use the event scroll and according to some criterion such as the position…
-
0
votes1
answer606
viewsA: Viewbag and Viewdata Doubt
The values of ViewData, ViewBagor TempData cannot be accessed in the file javascript, which makes further use of a Ajax. One solution is to read in the file .cshtml, and put in a javascript…
-
3
votes2
answers256
viewsA: Firebird sql error and doubts
I do not know the use of the word KEY isolated in control only CREATE TABLE, KEY is thus combined: PRIMARY KEY - to define the primary key FOREIGN KEY - to define a foreign key How could it be a…
-
2
votes1
answer318
viewsA: onclick "confirm" does not work Cancel button
You need to cancel the click event with a return false for example. Like the confirm already returns true or false just use return confirm so in your example: <a onclick="return confirm('mensagem…
-
3
votes1
answer819
viewsA: Link address with GPS applications
Yes you can. If you have the address, you can get the latitude and longitude coordinates. With this, you can use a resource from Waze called Deep Links. Is a API based on the url you can use to open…
-
3
votes3
answers241
viewsA: how to pass by value in Javascript
One solution is to serialize the object and deserialize in a new one using JSON, thus: let b=JSON.parse(JSON.stringify(a)) let a=[{nome:"oi"},{nome:"xau"}] let b=JSON.parse(JSON.stringify(a))…
-
1
votes1
answer60
viewsA: insert only the row that receives value in the date column
Well, you have a single command, it is natural that you will only insert 1x. If you have multiple rows in the table and want to insert all you need to run several Inserts, or execute the command…
-
2
votes3
answers53
viewsA: For each value of a table show the corresponding if no zero is shown
To bring sold and not sold, you need to change the INNER JOIN for RIGHT JOIN, to bring records from the "direct side" even if no records already corresponding from the "other side": RIGHT JOIN…
-
1
votes2
answers33
viewsA: Transform: Translate is compatible with which browsers?
According to the MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/transform#Browser_compatibility…
htmlanswered Ricardo Pontual 21,129 -
3
votes1
answer471
viewsA: Changing css class of an item already rendered by ng-repeat
There are some possible solutions: EXAMPLE 1: A way using the "Angular way" would be to use the ng-class and change it dynamically, like this: <li ng-class='classeDinamica'…
angularjsanswered Ricardo Pontual 21,129 -
1
votes1
answer55
viewsA: Loop status phrases in HTML
Javascript is the best option as you can change text according to events by showing different messages for each status. But you can use css to change the content of the message using the property…
htmlanswered Ricardo Pontual 21,129 -
1
votes1
answer37
viewsA: Dynamic attribute name in Post Jquery
So I think it solves your problem: var type = 'AlgumaCoisa'; var id = 'AlgumValor'; var x = { [`${type }`]: id, _method: 'PUT' }; console.log(x); This works in the Ecmascript 6…
-
1
votes3
answers1155
viewsA: Bring more than one line into a Subquery Sql Server
Why not using join? select t1.CD, t1.PF, t1.Data, t1.Total, t2.Motivo, t2.Total from t1 inner join t2 on t1.pf = t2.pf From what you’ve shown, the field that connects the tables is PF, then just one…
-
10
votes3
answers221
viewsA: List<> Best practice, start with fixed capacity or start without limit?
I did a test with both cases and the performance was irrelevant, with small values, but the memory lease is something that should be taken into account. When you create the list with Capacity 0…
-
1
votes1
answer99
viewsA: Problems with executescalar (System.Data.Sqlclient.Sqlexception)
I see two errors in your code: First, space in the query string. Missing a space after "INSERTED.ID" and before "VALUES": SqlCommand inserirAluno = new SqlCommand("INSERT INTO ALUNOS (Nome,…
-
6
votes3
answers1166
viewsA: How to access and stop a Thread? ASP.NET C#
Thinking of an answer to the question, and picking up the hook from the discussion with @Perozzo, who has already posted a solution using Thread.Abort, I kept thinking about other ways to abort the…
c#answered Ricardo Pontual 21,129