Posts by Thomas Erich Pimentel • 3,059 points
164 posts
-
2
votes0
answers175
viewsQ: Sharing Components and Services between Modules
In the development of Angular projects, it is common to share components and services between the various modules that the application may have. When it comes to services, Angular projects tend to…
-
-1
votes2
answers822
viewsA: Regex to pick sequence of letters or numbers
I will not address whether this practice is the best, or whether this is correct. Answering the question: Which regex to accept all characters? . Curinga: corresponde a qualquer caractere único,…
-
0
votes3
answers252
viewsA: How to return value in a javascript function
When reading Node driver documentation for Mongodb: Node.js Mongodb Driver API - findOneAndUpdate We find that the return is: Returns: Promise if no callback passed That is, the return is a Promise…
-
0
votes3
answers252
viewsQ: How to return value in a javascript function
I’m studying the framework Express to create a REST and when writing afunction I am unable to return the value that was processed. When making the call to endpoint /test, the code below is executed:…
-
0
votes1
answer97
viewsQ: Angular page composed of several components
When working with Angular projects the use of componentes brings several benefits, however, these benefits can lead you to make some mistakes, which may only be seen a few lines of code later. Would…
-
1
votes1
answer56
viewsQ: Apply Padding to all elements except one in particular
I would like to apply the property padding in the navbar elements, except for the last element in the class nav-login I use bootstrap 4.0 Html: <nav class="navbar navbar-expand-lg…
-
0
votes1
answer101
viewsA: How to call a method when using the switchMap operator
To be able to call the method resetaEnderecoFormulario(), I made the following change: this.formulario.get('endereco.cep').statusChanges .pipe( distinctUntilChanged(), switchMap(status => {…
-
0
votes1
answer101
viewsQ: How to call a method when using the switchMap operator
I’m studying reactive forms, working with Framework Angular. Thinking about functional and reactive programming, I’m listening to the status changes of the control cep, then, first I used the…
-
2
votes1
answer94
viewsQ: Tag <head> <body> in Angular projects
I’m studying Angular and I was left with a ref doubt. the use of tags <head> and <body> For example, in an html file would: <head> <title>{{ tittle }}</title>…
-
1
votes1
answer54
viewsQ: How to use Join or Aggregate in SQL query
When performing the query in a given table, numOrc is a list that may contain one or more values. So I needed to concatenate these values into one string, using ; as a limiter. So I tried: var model…
-
0
votes1
answer53
viewsA: How to create a list of objects?
If it’s just String you can use: List<string> nomeDaLista = new List<string>(); nomeDaLista.add(result.vfp.row[i].des); Apparently your code has some strange things. The object result is…
-
0
votes1
answer37
viewsQ: The difference between FOR and DOSEQ in clojure
What difference between for and doseq? I wrote a program, which returns me the highest value within the parameters informed. Note: I know that there is a function max and max-key, but I don’t want…
-
0
votes2
answers46
viewsA: How to create a clojure arrayList
To create a clojure arrayList, do as below: user=> (def newlist '(1 2 3)) remembering that, newlist is the name I set for the list, it is necessary to use ' at first, or exchange ' for (list 1 2…
clojureanswered Thomas Erich Pimentel 3,059 -
1
votes1
answer28
viewsQ: Generate a Partial Model from a complete Model
I have a Model called: Cliente_man that represents the customer register. But this Model, has a lot of information, and to the screen that I am developing not ah need of all, so I would like to move…
-
2
votes1
answer116
viewsQ: How to convert 39 hours to 'TIME' type
To accomplish a certain task, I count in my system the time spent of the respective task. Today I came across the following: Data Inicial: 17/12/2018 16:49:14 Data Final: 19/12/2018 08:02:58…
-
1
votes1
answer65
viewsQ: How to set a photo upload as a must
I am developing a page, for job applicants can enter and fill your personal information, one of these information is the photo, which has to be mandatory. So I created the following model: { . .…
-
3
votes1
answer63
viewsQ: Winforms application stops working if computer goes into hibernation
I have an application in winforms, which is on the company server, so I pull the shortcut to the desktop and the collaborator runs normally. The problem started to happen, when we exchanged some…
-
2
votes1
answer55
viewsQ: Is there a maximum amount of use of "using"?
My initial doubt was whether it was right to use using inside using, I was able to answer that question: It is correct to use a block using within another block using? But I kept asking myself, is…
-
0
votes2
answers663
viewsQ: Left Join or Sub-Select? which one has the best performance?
I’m studying which one of the fairs below would perform better. So I wrote them both and ran them in the same database with the same data: Query 1: select a.numeroOp as OP, a.codigo as CÓDIGO,…
-
4
votes1
answer164
viewsQ: Regular expressions, difference between [-] and -
I am working with some regular expressions and I came across the following case: string pattern = @"^.{2,9}[-].{4}[-].{4}$"; string pattern = @"^.{2,9}-.{4}-.{4}$"; I would like to understand, what…
regexasked Thomas Erich Pimentel 3,059 -
0
votes0
answers36
viewsQ: Why is the Activated event triggered more than once?
I need an event, which is triggered every time the user clicks Form, tried to use the event Activated but the event is shot 8 times for the same click. I’d like to understand why it’s shot so many…
-
3
votes2
answers1031
viewsQ: Null object on Deserializar Json
I request an API, which returns data in the form of JSON. Example: { "id": 8452, "creator_user_id": { "id": 46342, "name": "ADM. Suporte Comercial", "email": "*******@gmail.com", "has_pic": true,…
-
0
votes1
answer1913
viewsQ: How to Request JSON Data
I need to collect some data from a program that has API: Pipedrive API Reference If I understand correctly, for each task, a URL will be generated to do the Requeste from the data, example:…
-
1
votes2
answers446
viewsQ: How to check for async processes running
Does anyone know any way, to check if any process Async is being executed? For example, I would like to do a check, when the user closes the system, and not let close all processes Async be…
-
14
votes3
answers2118
viewsQ: Memorystream vs Stream
What would be the main difference between the two? There are advantages to performance gain? For web use, which is the most appropriate? I’m using to "read" a array Byte[]: private void…
-
1
votes1
answer178
viewsA: Force a Sqldatareader result
The instruction While performs the task, until the condition is false. Only your case dr.Read(), causes every loop to change the reading line of your DataTable, shall be executed until nay there are…
-
1
votes1
answer1478
viewsQ: @Html.Dropdownlistfor how to set the default value
I need to set the default value displayed by a @Html.DropDownListFor Researching found: @Html.Dropdownlistfor how to set default value So I did it in my code: @Html.DropDownListFor(model =>…
-
2
votes1
answer111
viewsQ: Error when performing LINQ query with equals in Where enclosure
When executing the query below: public ActionResult GridViewPartial() { if (Session["cod_cli"] != null) { int cod_cli = Convert.ToInt32(Session["cod_cli"]); //var model = db.DadosTecnicos; var model…
-
1
votes0
answers62
viewsQ: What is the difference between the forms of LINQ research?
What’s the difference between: var query = from s in db.DetailsRaWeb where s.cod_cli.Equals(Cod_Cli) && s.tag.Equals(TAG) select s; and this: query = query.Where(s =>…
-
1
votes1
answer27
viewsQ: Migrations adds the letter S in the table name
I have a model: public class pimentel { [Key] public int id { get; set; } public string cod_item_Crm { get; set; } public string tag { get; set; } public string data_anal { get; set; } public string…
-
2
votes1
answer47
viewsQ: Windows service, using async method, is there a need?
In my system, I have some auxiliary routines, which are fired at defined times, outside of work hours. These routines are run by a Windows service program. Would you need to run these asynchronous…
-
0
votes1
answer85
viewsQ: Operation Async how to know when completed?
I have 2 methods Async what to make a Insert in a cloud database.. For internet reasons, there may be transaction failure to treat this problem, I am using Commit and RollBack, to ai blz. However, I…
-
0
votes0
answers205
viewsQ: Save a byte array to sql from a Datatablereader
In one of the system tasks, I need to query an Sql Server database, which returns a Datatable, in this Datatable, one of the data is of the type Byte[] So to read the Datatable use a…
-
0
votes0
answers200
viewsQ: How to pass a parameter to the controller that contains / (bar)
I need to pass a parameter to a Controller, however, this parameter contains / (bar). Example: 5701/1_1 5966/2_5 7881/6_1 To pass the parameter I’m using @Url.Action: @Html.ActionLink("Visualizar",…
-
3
votes0
answers54
viewsQ: What are the means of replicating tables between SQL servers?
When developing a project, I came across the following situation: We have a system, where users enter information during the production process, and in the end a report is generated. This data is…
-
2
votes1
answer272
viewsQ: Is it correct to use List with Viewmodel?
I own the ViewModel down below: public class Crm_AnaliseViewModel { public string TAG { get; set; } public int ATUALIZACAO { get; set; } public string RELATORIOS { get; set; } } Then in the…
-
0
votes1
answer104
viewsQ: Error when using GROUP via LINQ
I’m trying to perform the query below: var query = from s in db.Crm_Analise where s.cliente_CRM == cod_cli group s by s.TAG into g select new { TAG = g.Key, ATUALIZAÇÃO = g.Max(t =>…
-
2
votes2
answers1028
viewsQ: How to query containing MAX and COUNT via LINQ
I got the following model: public class Crm_Analise { [Key] public int id { get; set; } public string cod_item_CRM { get; set; } public string TAG { get; set; } public string data_creat { get; set;…
-
3
votes1
answer10492
viewsQ: When to use Html.Beginform() and why to use it?
I came across the following situation, in one of the views I have a search ground: <form class="navbar-form navbar-right" role="search"> <div class="form-group">…
-
4
votes0
answers318
viewsQ: I make a change in CSS but after Reload it goes back to normal
I have the following View: I want to, change the position of CheckBox, then on View we have a div: <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <div…
-
4
votes2
answers94
viewsQ: How to perform a Where using Entity Framework
I have a web application that I need to present a list containing some data, for that, I created the Model: Crm_Analise: public class Crm_Analise { [Key] public int id { get; set; } public string…
-
0
votes1
answer80
viewsA: How to recover parameter from a Controller
I managed to solve the problem by starting to work with Sessions. For further information: What’s the difference between Sessions and Cookies After user login, the object with the user data is…
-
0
votes1
answer80
viewsQ: How to recover parameter from a Controller
After the user logs in, two parameters are passed to Controller Home: case SignInStatus.Success: { //recupera as informações do usuario que corresponda ao usuario e password var user = await…
-
0
votes1
answer59
viewsQ: After Login, how to pass value to the view
After logging in, the user is directed to the page Home and on this page, I would like to show a Label with the client code to which the user belongs. So I went to the table AspNetUsers added a…
-
2
votes1
answer403
viewsQ: Async method returning a List<string> how to use?
I have a method called consulta_usuario_email, that is responsible for searching in the table of registered users, the emails of users of a certain department: public async…
-
15
votes3
answers361
viewsQ: Is it correct to call a method, and pass your null parameters?
For example, I have the event of click of a button calling the method below: //Evento this.serviçoToolStripMenuItem1.Click += new System.EventHandler(this.Nivel_Serv_Click); //Metodo private void…
-
4
votes3
answers767
viewsA: Upload image to picturebox and write to database
To save a BD photo, one of the means I know, is to transform the photo into an Array of byte, for this I use the method below: if (Pic.Image != null) { using (MemoryStream stream = new…
c#answered Thomas Erich Pimentel 3,059 -
1
votes1
answer50
viewsQ: Forearch loop how to use with controler
I’m 6 PictureEdit in a PanelControl, and I need to make a run at all the PictureEdit then I made the following code: foreach (PictureEdit Pic in panel1.Controls) { //habilita o meno de zoom…
-
1
votes1
answer365
viewsQ: How to locate an object by name only?
I’m 6 PictureBox, then, when saving the photo in the database, save together in which PictureBox she was. So when uploading the photos in a view, I need each photo to be displayed in its respective…
-
5
votes2
answers330
viewsQ: Difference between Find, Exists and Contains of the List<T> class
I’m working with the class List<T>, so I came across some research methods, if I may call it: Find; Exists; Contains; I was in doubt of what the difference between them, so I searched on the…