Posts by Leonardo Bonetti • 5,313 points
231 posts
-
1
votes1
answer2592
viewsQ: Error converting Base64 to String
I have a Base64 string but the C# compiler says it is not valid, I get the following error: The entry is not a valid Base 64 character string, as it contains a non-base 64 character, more than two…
c#asked Leonardo Bonetti 5,313 -
0
votes0
answers22
viewsQ: How to simulate a background action to solve inactivity problem?
I have a website in ASP.NET MVC5 in the company "Vaipapai" (no merchandising here right), this hosting is shared and I can not decide the downtime for the session to fall, in the case as default…
asp.net-mvc-5asked Leonardo Bonetti 5,313 -
1
votes5
answers3081
viewsA: How to decide between using for or foreach?
Everything depends on your need, I think first comes your need to manipulate/go through that collection. For example: I always use for when I need to manipulate the objects I’m traveling, because in…
-
1
votes1
answer53
viewsA: Because when I’m treating an error it doesn’t load the _Layout file?
To render the page ,you need to return one View() in which case you just return Json(response, JsonRequestBehavior.AllowGet). Always create Actions separate for your Ajax requests. To solve, simply…
-
3
votes1
answer62
viewsQ: How to view "Commandtext" with the added parameters?
MySqlCommand comm = new MySqlCommand("", conexao); comm.CommandText = ("SELECT @select FROM @from WHERE @where LIKE '@like'"); comm.Parameters.AddWithValue("@select", select);…
c#asked Leonardo Bonetti 5,313 -
1
votes2
answers231
viewsA: Inserting date in American standard
I removed $itens[1] and inserted date("Y-m-d H:i:s", strtotime($itens[1])) that is making the conversion to international standard. <?php function Inserir($itens, Pdo $pdo){ $sts =…
-
1
votes4
answers1103
viewsA: SELECT with two results
First he will take all 'maria'+surname, then he returns the rest ordered alphabetically. SELECT * from pessoas ORDER BY nome LIKE 'maria%' desc, nome Source:…
-
0
votes1
answer225
viewsA: How does the Front-end part work with Oauth 2.0?
Depending on the way you use it is not necessary to stay authenticating every time it expires. 2 months ago I implemented the Gmail API(Gsuite) on my website. After the authentication process I was…
-
2
votes1
answer827
viewsA: Check if a string is a number and check if it is a special character
Using Regexp makes everything easier, to solve your problem I developed a while testing whether the input provided is a special character or number, while it is still asking for a letter, until the…
javascriptanswered Leonardo Bonetti 5,313 -
4
votes1
answer166
viewsQ: If I have two servers (application and database) with different time zones, which one is better to use as a base?
I am working with the Mysql server of a hosting, I can not change the time zone of the same, I mean it uses the "Mountain Standard time (MST)", on the other hand, I am using the ASP.NET server and I…
-
1
votes1
answer54
viewsA: Strange error in class c++
Work with builders, the problem is that when you declared your variable, it builds itself without value because you had no constructor method for it. When I went to compile your program and debugged…
c++answered Leonardo Bonetti 5,313 -
1
votes2
answers1544
viewsA: How to add a line break after a certain amount of characters?
It looks like this, so you can add whatever you want to every 40, and you can also customize that number according to your need. Remembering that the best solution is not this, the correct is via…
jqueryanswered Leonardo Bonetti 5,313 -
1
votes1
answer46
viewsQ: How to call the value of a Subquery within another Subquery and they are in the same View
I have a View with several Subqueries, one of them should be used to generate another Subquery within the View itself but I am receiving error, example: (SELECT COUNT(0) FROM `LICENCAS` WHERE…
mysqlasked Leonardo Bonetti 5,313 -
3
votes1
answer358
viewsA: Convert string to Javascript source code
You can use the val() that evaluates(and executes) the code represented in a string. Example: var comm = "alert('teste');"; eval(comm); //Executa o alert…
javascriptanswered Leonardo Bonetti 5,313 -
3
votes2
answers48
viewsQ: Does google take more into account the name View/Controller or Parameters?
I have this doubt because I am trying to raise my site in rank, and so far it does not appear in banco de imagens, came to doubt, google understands what is a parameter and what is a…
seoasked Leonardo Bonetti 5,313 -
0
votes2
answers830
viewsA: How to organize columns in a table
Only use colspan = total number of columns <table border="1"> <tr> <td> ola </td> <td> ola </td> <td> ola </td> <td> ola </td> </tr>…
-
2
votes1
answer308
viewsA: Return List in a View
Old I didn’t quite understand which object you want to pass as list, but what I did there was: I created a list of V500_ESTOQUE_ACAB List<V500_ESTOQUE_ACAB> estoque = new…
-
1
votes2
answers97
viewsQ: How to assign a class to the whole and not just attributes separately?
I have a class constructor method that when called makes a query in another database class that returns me the same constructor method class(only with the assigned data), example: public Invoice(int…
-
0
votes1
answer303
viewsA: javascript paging
Old, it is difficult to understand your code, but I believe that if you apply this code I made in your project you can solve it easily, because I used the Number Array, you just need to change the…
-
1
votes2
answers893
viewsA: Retrieve label value from select HTML
Using the Jquery(which I recommend you add to your project if you do not have): console.log($("#COMBOFAB option:selected" ).text()); //texto do item selecionado console.log($("#COMBOFAB…
-
0
votes1
answer45
viewsA: Deserialize for an Icollection without the need to create an extra class
You can use your own Newtonsoft which is already being used has this dynamic mode mode, it uses LINQ: json = @"{name: 'Leonardo', lastname: 'Bonetti'}"; JObject jObject =…
-
2
votes1
answer170
viewsA: Accept only specific numbers in an input
It makes no sense for your input type to be number (with the arrow behavior to increment and decrement being that you are not using sequence. So I switched to type="text", but I added a parameter…
-
4
votes1
answer1351
viewsQ: How to discover the file extension through the Bytes array?
I wonder if it is possible to get a get on the file extension through the Byte Array. Because I download a file from the server, and it can be both . JPEG and . EPS, however I am not able to know…
-
0
votes2
answers343
viewsQ: Gmail notifies that email is usually used to steal information when I use content-type ="text/html; charset=utf-8"
I use the Gmail API to send email’s marketing, and always respect anti-spam limits and standards. And yesterday I started sending mass emails, on average 2,000 a day, but after a while I realized…
-
1
votes1
answer63
viewsA: Create a class reference from a variable
It will be difficult for you to handle transactions without having a database. But let’s say you have already loaded your bank: You can add in your main a List: public List<Conta> contas = new…
c#answered Leonardo Bonetti 5,313 -
0
votes2
answers266
viewsA: ASP.NET Razor Pages error while processing the request
In the web.config change(or add if not available) the tag’s value environmentVariable for Development: <environmentVariables> <environmentVariable name = "ASPNETCORE_ENVIRONMENT"…
-
1
votes2
answers1008
viewsA: Returning select value with javascript/jquery
Easy, just grab the option selected via ID > option > Selected Using the Jquery that you have already imported into your project: $("#colchao option:selected").each(function() {…
-
1
votes2
answers302
viewsA: Force updating an element in HTML/Javascript/ASP.NET
In the signature of each Action that you do not want to cachear put the following annotation: [OutputCache(NoStore = true, Duration = 0)] in the following example I had problem with cache and solved…
-
0
votes1
answer115
viewsA: Insert Cities in Oracle Bank
Follow the link, in this repository there is a lot: https://github.com/chandez/Estados-Cidades-IBGE in Municipios.sql you have the following structure: Insert into Municipio (Codigo, Nome, Uf)…
oracleanswered Leonardo Bonetti 5,313 -
0
votes0
answers24
viewsQ: Parameter passed by value being modified as reference
I have the following situation, I have an object with value 2800, when I pass this object by value and divide the value of an object attribute within the scope of the function, the value of my…
c#asked Leonardo Bonetti 5,313 -
0
votes2
answers47
viewsA: How to pull a die from the same field?
If fator_preco is of the VARCHAR use type: SELECT fator_preco FROM Tabela WHERE fator_preco LIKE '0.9800%'; 0.9800% means you want strings that start with 0.9800, the % let’s say it means…
-
-2
votes1
answer184
viewsQ: Recommendation system based on previously registered data
I’m a machine-learning layman I started a course at Alura about classification system using Pip but it does not solve my problem, I would like a library for a recommendation system, i would collect…
machine-learningasked Leonardo Bonetti 5,313 -
5
votes1
answer330
viewsA: Shuffle playing cards
public class Baralho { public Carta[] Cartas { get; private set; } public Baralho() { this.Cartas = new Carta[52]; int c = 0; for (int nIdx = 0; nIdx < 4; ++nIdx) { Naipe naipe = (Naipe)(nIdx +…
c#answered Leonardo Bonetti 5,313 -
7
votes1
answer16562
viewsQ: Regex inside SQL Server
How to recover fields with the following pattern? a111/1111 or a111_1111 or a111-1111 or a111+1111 where: a = some letter of the alphabet; 1 = any digit of 1-9; I rode a Regex that is working…
-
2
votes3
answers156
viewsA: Condition in a select
Your SQL Query is wrong, the correct would be: SELECT * FROM filmes WHERE copias > 5 follows a syntax reference: https://www.w3schools.com/sql/sql_select.asp…
-
1
votes2
answers438
viewsA: Api with Item Array does not receive the posted data
You cannot receive the Objeto C# in the request parameter, you receive JSON(string) and then deserializes the same.…
-
1
votes2
answers3016
viewsA: Doubt with Webrequest get method passing token
GET method does not contain Body, or you need to send the AuthToken in Header as our colleague said. Try it like this: public string ConsultaPedido(string urlpedido, string NumeroPedido) { var…
-
5
votes1
answer1370
viewsA: How to read a JSON file using C#?
To turn a JSON into class c# you need to use the famous Deserialize. But before that you need to map your class perfectly the same as JSON. Let’s look at an example using the library Json.NET: Let’s…
-
1
votes1
answer274
viewsA: Why does MOD(11.2,2) give 1,2 and not 0?
The result you expected MOD(11.2,2) = 0 is incorrect because the result of the split will always be an integer already the rest of the division may or may not be an integer then the correct result…
-
2
votes1
answer1735
viewsA: Touch-action for what? CSS
The estate touch-action allows you to decide what will be the ringing behavior of that item on sensitive devices, for example: /* Keyword values */ touch-action: auto; touch-action: none;…
-
9
votes1
answer3563
viewsQ: What is the maximum size of a JSON file?
I will give an example to explain my doubt: I need to recover information from images coming from an API, this image bank returns JSON’s with information of the images I need, in all there are 33…
-
0
votes1
answer341
viewsQ: Does Google change the language of my site in the indexing process?
Google modifies the Culture info of the site in the indexing process? I noticed that on my page that has two languages, Google indexes only the page PT-BR version that is native to the site. Some…
-
1
votes3
answers5808
viewsQ: Problem running Visual studio debugger
I have a problem in my project, I use ASP.NET MVC 5 and for a while I get this message whenever I run my project, the problem is not the visual studio installed on the machine(as in that solution)…
-
1
votes2
answers537
viewsA: Show error message when Modelstate is not valid
Well, by elimination I believe your problem is the activation of ValidationSummary, because your model is ok, controller ok what lacked that line within your form. @Html.ValidationSummary(true) You…
-
3
votes1
answer64
viewsQ: Conflict of reference Google.api
I have a reference conflict problem in the Google API. In my API classes I always rename as follows: SiteTeste.APIS.Google.<Servico>, where service is, Gmail, Translate, Drive or whatever.…
-
3
votes1
answer254
viewsA: Compressing and organizing Json
My solution was to create a dictionary with the categories, so you do not need to fill the company object with attributes that belong to categoria: var categorias = { Hospital:{ descricao:…
-
1
votes1
answer633
viewsA: What is the validity of the Google Play developer account
Have your credit card in hand to pay the $25 registration fee in the next step. In other words, you only pay to register as a developer. source: https://play.google.com/apps/publish/signup/…
google-playanswered Leonardo Bonetti 5,313 -
0
votes2
answers682
viewsA: API User and password in Header
It’s safe but it’s not the practice. In all API’s I know (CIELO, Google and Unlisted Images) without exception the authentication is through a key which is generated from a Guid, where it can be…
-
1
votes1
answer29
viewsQ: How to view through breakpoint what values have been passed to my method?
I wonder if it’s possible without using the Debug.WriteLine view the values passed to my method through Visual studio using a Breakpoint, whether by some external resource or not.…
-
0
votes1
answer26
viewsA: table is not created in mysql
You have already created a Constraint with the name FK_ID_PESSOA on the table ENDERECO , on the table VENDA you tried to create another Constraint with the same name. Change the table creation code…