Posts by William John Adam Trindade • 1,908 points
54 posts
-
-1
votes1
answer424
viewsA: How to check if a data exists in the table before inserting Mysql + Python
Imagine that you have a large company that uses your system and you have as a result of SELECT nomes FROM slogin more than 100,000 registrations. Imagine that each of the 100,000 users logs in at…
-
2
votes3
answers41
viewsA: Do not show element that has a certain value
This will require using a sub-query, in this way: SELECT usuario.id FROM usuario WHERE usuario.id in ( SELECT usuario_id FROM usuario_gerenciamento WHERE usuario_gerenciamento.credencial_id = 2 );…
mysqlanswered William John Adam Trindade 1,908 -
2
votes1
answer25
viewsA: Restructure table by dividing columns into rows
That would be an operation called UNPIVOT. To do this in Mysql, use UNION ALL, thus: select campo1 from mytable where campo1 is not null union ALL select campo2 from mytable where campo2 is not null…
mysqlanswered William John Adam Trindade 1,908 -
1
votes1
answer92
viewsA: Cint formatting in ASP Classic
The problem is that you are using an invalid syntax for the function formatnumber. What Voce has to do is add a PAD function like this: Function PadDigits(val, digits) PadDigits =…
-
1
votes3
answers157
viewsA: Show comments table
You have to inspect the system table extended_properties Take the example: CREATE table Tabela (id int , campo char (20)) EXEC sp_addextendedproperty 'Descrição', 'ID', 'user', dbo, 'table',…
-
5
votes1
answer664
viewsA: Problem in a simple Inner Join Update
This is because you have no criteria about the table being updated. See, you got: update reference_vendor set internalid = v.internal_id reference_vendor is the table you want to update. Then you…
-
1
votes2
answers1286
viewsA: Sort date by month
You will have to add the date in numerical format in the clause group by. Only in this way you will be able to create an ordination by Month and not by the word associated with Month, this way: Set…
-
2
votes2
answers159
viewsA: How to separate a letter from a Character in SQL?
For that there is the function replace substr(string, from [, Count]) substr('Alphabet', 3, 1) returns p (third position , a character) See working on Sqlfiddle…
-
0
votes4
answers5283
viewsA: Sort a SELECT in Mysql by a letter
You can do this in different ways. I’ll show you two methods: 1 - Through Union Select Nome,1 as ordem from tabela where Nome like 'P%' union Select Nome,2 as ordem from tabela where Nome like '%p%'…
-
5
votes4
answers271
viewsA: Javascript equivalent of "Date.now()" in C#?
The estate Now do C# brings the current date and time, different from JS Now. The estate Millisecond returns an integer equivalent to milliseconds from the time Now was evaluated. It is clearer with…
-
2
votes2
answers59
viewsA: Event does not work after running replaceWith
The code is a little confused in your Fiddle, but what I could notice is that replace "kills" the whole configuration made for the button id="teste" I made a small change: $( "#replaceWith"…
jqueryanswered William John Adam Trindade 1,908 -
2
votes1
answer102
viewsA: How to create a unique index in a table so that it only has a record with a specific value in Sqlserver
If the SQL Server version is higher than 2008, you can create a filtered index: create table TipoContato ( id int not null identity(1,1), descricao nvarchar(100) not null, padrao bit not null…
-
2
votes1
answer861
viewsA: How to list all Access table names?
The method Getschema which lists the tables (and other MDB structures) that you should use is a Connection method and not a Reader method. The getSchemaTable of Reader serves to read the schema of…
-
1
votes2
answers1006
viewsA: ISNULL in a Case When
Another simpler form of resolution would be using the COALESCE The advantage of coalesce is that you can provide a list of parameters and the first non-null is displayed COALESCE(A,B,C,D..Z) If A is…
-
2
votes1
answer499
viewsA: List Missing Period Days in SQL Server
Your example is unclear. We should consider only the Cods of the listed period? Independent of the answer to the above question: Yes, it is possible to generate a continuous list of dates virtually…
-
5
votes2
answers413
viewsA: Update with Case When you need Where?
Considering a generic table, what is the difference between Update tabela set campo= case when id=1 then 'abc' end and Update set campo='abc' where id=1 ? In terms of the result of the operation,…
-
4
votes2
answers332
viewsA: Mysql - Select between 2 tables with "String" field
If what you want is to bring only the names of tabela 1 which do not correspond to tabela 2, Voce can do this several different ways I will stick to SQL Ansi compliant syntax only (valid for all…
-
9
votes1
answer812
viewsQ: What does "Tree-Shaking" mean?
I closely follow the entire development of the Angular. I know the third generation of the rendering engine (the Ivy, code name for Render 3) will be released soon. Overall, the objectives for this…
-
1
votes1
answer332
viewsA: How to make an Event Change in ASP.NET Core MVC?
It is difficult to compare two so different paradigms: Web Forms x MVC. Just to illustrate, see the treatment flow of an event in ASP.NET Webforms and ASP.NET MVC: Image source: Slide share: Mvc…
-
2
votes2
answers1471
viewsA: How to automatically link to words with javascript?
Assuming this text is inside an HTML element, example: <div class="texto">Você talvez precise de ajuda, caso tenha duvidas entre em contato conosco</div> You can use this function:…
-
4
votes1
answer75
viewsA: Terms used in the CSS
Property is only one of the components of a style. CSS can be understood (in a very simplified way) as a simple list of properties/values pairs applied to an HTML element. This is clearer if you…
-
-1
votes1
answer292
viewsA: Convert 1.0 (string) to 1.0 (double) in c#
This is because Convert.Todouble uses the crop parameters set in Windows settings. If you really want the point to be considered decimal separator and not thousand (as it should be defined in your…
-
0
votes1
answer98
viewsA: C# List Console
One of the ways is by using Linq. In the example below I used the Where to select only "Rewinder table" item and the Select to create a list only with the quantity property. using System; using…
-
0
votes1
answer65
viewsA: What are CSS Feature Queries? How do you use them and what are they for?
According to the W3C specification, "Features querys" sane: The ː@Supports' Rule is a conditional group Rule Whose condition tests whether the user agent Supports CSS Property:value pairs. Authors…
-
2
votes1
answer34
viewsA: increment lines based on a postgresql record
With the native function generate_series(start, stop, step) For your case Select generate_series(10001 , 10003,1); See on working on Sqlfiddle…
-
0
votes1
answer91
viewsA: desectuate Json object
If you analyze JSON you will see that it is not an array. I used the site json2csharp to build the class from the json, and the result was: public class __invalid_type__0 { public string id { get;…
-
1
votes1
answer57
viewsA: How to get rendered html from an Actionresult in the ASP.NET MVC Controller
I used the solution of this other question(in English): public string RenderRazorViewToString(string viewName, object model) { ViewData.Model = model; using (var sw = new StringWriter()) { var…
-
5
votes1
answer2462
viewsA: Search with accents and without accents Postgresql
As of version 9.3 you have the module unaccent To install a module in Postgresql, do so: 1- Make sure the module is available Select * from pg_available_extensions(); 2- In this case, the module…
-
3
votes2
answers1346
viewsA: Difference between ADO.NET and Dapper
ADO.NET Not an Object-Relational Mapping (ORM). According to the documentation: ADO.NET is a set of classes that expose data access services to developers of . NET Framework. ADO.NET provides a rich…
-
7
votes1
answer732
viewsA: What is ~ (til) and (circumflex accent) in the Composer versioning scheme for?
Summary Consider the model of semantic versioning: MAJOR.MINOR.PATCH The operator (~) allows last digit to be incremented ~MAJOR.MINOR.PATCH >=MAJOR.MINOR.PATCH e < MAJOR.(MINOR+1).0 That is,…
commiserateanswered William John Adam Trindade 1,908 -
4
votes2
answers7405
viewsA: What is the difference between SCHEMA and DATABASE?
In Mysql they are synonymous. According to the documentation of Mysql: In Mysql, physically, a schema is synonymous with a database. You can substitute the keyword SCHEMA Instead of DATABASE in…
-
2
votes1
answer331
viewsA: Sybase database connection with c#
With the "SQL Anywhere . NET Data Provider" You can download it by Nuget and there are two versions: To the ASA16: iAnywhere.Data.Sqlanywhere.v4. 5 For the ASA2017: Sap.Data.Sqlanywhere Example:…
-
2
votes3
answers519
viewsA: How does C# run on other platforms?
First keep in mind the image below: The . NET FRAMERWORK, . NET CORE and XAMARIN, they are all compliant with . NET STANDARD. The . NET STANDARD is a specification and not a framework. "The . NET…
-
2
votes4
answers4547
viewsA: How to Merge 2 or more Json Objects into Only 1
The JS has the method Concat , that concatenates two arrays into one. Take the example var arrayA = [{ nome: "fulano 1", idade: 30 }, { nome: "fulano 2", idade: 31 }, { nome: "fulano 3", idade: 32…
-
6
votes1
answer237
viewsA: What is bit-a-bit operation?
Explanation The point is, what does it mean 15 ^ 3 or 15 xor 3 bit by bit? First we convert 15 and 3 of the decimal base into binary basis: 15 : 1111 3 : 0011 How the XOR works? Xor or OR Exclusive…
bitanswered William John Adam Trindade 1,908 -
0
votes1
answer53
viewsA: Motion sensor value 0 only
Before analyzing the code, check that the mini Pir works without the Arduino: Check your scheme if it is in accordance with the proposed scheme: with the code below: void setup() { pinMode(2,…
arduinoanswered William John Adam Trindade 1,908 -
7
votes2
answers4291
viewsA: Difference between date and datetime
Brief explanation about the types It’s not that simple a comparison. The only common ground between Date and DateTime is that the two are used to store dates. The guy DateTime and SmallDateTime are…
-
2
votes2
answers154
viewsA: Why . all in an empty list returns true?
According to the documentation of Enumerable.All method (Ienumerable, Func) Value Returned Type: System.Boolean true if all elements of the source sequence pass the test on the specified predicate…
-
3
votes2
answers360
viewsA: Why doesn’t my . svg work in Firefox?
Firefox interprets the character # as a Fragment Identifier. To resolve replace all # within the URL function by %23. In your case you must replace: <path fill="#1e7bbf"... for <path…
-
0
votes1
answer315
viewsA: See how long it takes for an event to happen - [mysql]
In the Mysql documentation it says that Voce should use INFORMATION_SCHEMA to redeem information about an event. The field you will use to know how much time is left STARTS SELECT * FROM…
-
1
votes1
answer425
viewsA: How to set the time of a "timestamp" to 23:59:59 in postgresql?
Operations with dates in postgresql are easy to implement, as we see in documentation In your case just do: SELECT data, data + time '23:59:59' FROM datas You can see it working on SQL Fiddle.…
-
7
votes2
answers128
viewsA: Query conditional ordering in Mysql
The problem is the null in the field comentario_pai. One of the ways to solve it is by using the COALESCE: select * from `comentarios` order by coalesce(comentario_pai, id); See how it works on sql…
-
2
votes1
answer293
viewsA: Select com group by duplo
The simplest way (maybe not the most elegant) is to do it with a subquery, this way: Select contato_status.detalhamento_id, count(*) ocorrencias From contato_status Inner Join (Select id_contato…
-
1
votes2
answers101
viewsA: How to create events in C#?
One way is to extend the List class by adding an event in this way: using System; using System.Collections.Generic; namespace teste { class Program { class ListaComEventos<T> : List<T> {…
-
3
votes1
answer565
viewsA: Connection of Visual Studio to an Access database
You are trying to create an ACCESS connection using Assembly System.Data.Sqlclient. For Acces, you must use Assembly System.Data.Oledbclient Here an example of code: public void ConnectToAccess() {…
visual-studioanswered William John Adam Trindade 1,908 -
2
votes1
answer112
viewsA: Missing IF in Procedure
This is because NULL compared to something is always NULL. Reference Digamos que o CPF não esteja cadastrado, nesse caso a Query "select cpf from tbl_usuario where cpf = n_cpf" retorna NULL e quando…
-
1
votes1
answer309
viewsA: What is it and how to use Sass and Npm in Bootstrap 4?
Sass (Syntactically Awesome Stylesheets) - It is an extension of CSS. A CSS preprocessor. It’s actually basically a "language" that is transliterated in CSS. You can read in detail here: Sass -…
-
0
votes1
answer37
viewsA: Problems with Visual Basic
Try this process: Close the Visual Studio Open folder: %USERPROFILE% Local Settings Application Data Microsoft Visualstudio V9.0 Delete the following files: Toolbox.tbd toolbox_reset.tbd…
-
0
votes1
answer74
viewsA: Taking value from mvc array
I wouldn’t use stringify to pass the list to the controller. If items is a string array just do: $scope.gravaItem = function () { $.ajax({ type: 'GET', url: '/TaxaPreco/SalvarItens', dataType:…
asp.net-mvcanswered William John Adam Trindade 1,908 -
1
votes0
answers197
viewsQ: PHP 7 (Debian) connection error with Sybase 16
I have the following difficulty: I need to configure the PHP environment to connect to a Sybase 16 base. I am not a PHP programmer and I am helping another colleague. Everything that has been tried…