Posts by phduarte • 683 points
40 posts
-
1
votes1
answer95
viewsA: How to delete lines from a spreadsheet after performing a filter using VBA?
The problem is that the range you are trying to delete is variable, so before deleting you need to figure out which are these lines using the property UsedRange. ' aplicar filtro…
-
0
votes1
answer81
viewsA: Rename multiple files with VBA
You have created an infinite loop in: Do While Not IsEmpty(Range("C1")) The loop will always continue running because the C1 range is not empty, since it has been filled a few lines before in:…
-
0
votes1
answer27
viewsA: POST method in the ASP.NET Controller API is auto-incrementing foreign key even if the value should be empty
Change your Project class by making explicit the relationship between classes through the foreign key: public class Project { // public Course Course { get; set; } [ForeignKey("Course")] public int…
-
0
votes1
answer37
viewsA: I need to insert phone number and mobile number in the same textbox using masks in Windows form C#
The best option is to use a type control Maskedtextbox instead of Textbox. It will already include the mask in the phone format for example (XX) XXXX-XXXX. After changing control to Maskedtextbox,…
-
0
votes1
answer31
viewsA: I cannot return ID when entering data via ASP NET Controller POST
To ensure that your webApi is more compliant with the best practices of a Restful application, it is important that you return to status 201 when the item is servant and 200 when there is no error…
-
1
votes1
answer217
viewsA: Cannot convert implicitly type "System.Collections.Generic.Ienumberable<SS_API.Model.Project>"
You’re trying to return a Type Projecting while its function returns String. Instead of returning the Project, try returning (if any) its name for example or use the method ToString() if it makes…
-
0
votes1
answer56
viewsA: How to query Data values on a C# connection to excel using Oledb?
Your database may not understand the date format. Usually it works with the format YYYY-MM-DD. Include the method ToString in his dateTimePicker1.Value explaining in which format the date should be…
-
2
votes2
answers704
viewsA: Error: Unsupported operand type(s)
this occurs due python be a strong and dynamic typing language. Use the method int() to convert the value entered by the user (which is of the type str/string) to assign it to array keeping a set of…
-
0
votes1
answer105
viewsA: Use of unassigned local variable. How to resolve?
Note that your variables are in different scopes/blocks, state them before the if-else and correct the TryGetValue by removing the data type after the parameter out. DateTime date =…
-
0
votes1
answer51
viewsA: How to exit the VBA loop
You can do this by just adding a variable continuar then using it as a criterion for the While and updating the value of the variable at each loop. To better understand, check below all the places…
-
2
votes2
answers120
viewsA: How would I get the user to register a name and password to log in?
You will need to create a (non-volatile) persistence engine, for example, a database (Mysql, Postgree, Oracle, etc.) or a simple local text file (*.txt), where methods registrar_usuário and…
-
0
votes1
answer26
viewsA: How to change Combobox value according to case
You can do it in several ways, but I suggest that as you are starting out, try doing it the following way to exercise logic. Create a combobox with the name cmbType and add the "Letters" items and…
-
1
votes1
answer30
viewsA: Source URL in Angular REST request
In your service, include the http protocol in the signature of the apiURL variable: public apiURL = 'http://127.0.0.1:5000'
-
1
votes2
answers44
viewsA: Tags With Different Sizes
Add the tag below in the head of your html: <meta name="viewport" content="width=device-width, initial-scale=1"> see more about viewport articles.…
-
0
votes3
answers87
viewsA: Working logic error with list
You don’t need to use FOR for this, just create a list inline that will generate a dictionary. a = ['h', 'j', 'z'] c = [{a[0] : i} for i in a] print(f'esta é a lista{c}') Output: esta é a…
-
0
votes1
answer35
viewsA: Why can’t the played method_chooses and the computer_chooses can’t access the positions [0][0],[1][0] and [2][0]?
The problem is in the validation of column 0. Every time you select it, your code will keep asking the user to report the position again. Note that on line 19, you have the comparison c < 1 that…
-
4
votes1
answer125
viewsA: What are Assembly Languages (assembly language)?
But what are assembly languages? It’s the same as low-level languages? Assembly is a low-level language, but it is not the lowest level. A program written in Assembly still needs to be "converted"…
-
1
votes1
answer49
viewsA: Separation of responsibilities for implementation
If the date handling complies with a business specification and was requested by business experts, then it should be in a service class within its domain model to be consumed by the controller. Now,…
software-architectureanswered phduarte 683 -
0
votes3
answers621
viewsA: Change Asp.Net Core version
It is possible to change from the file . csproj. Right-click on the project, choose Unload Project. After the project gets disabled with the description (unloaded), click again and choose Edit…
-
0
votes1
answer145
viewsA: Simple quotes breaking the UPDATE query in mysql
Basically, the problem is solved by replacing single quotes with two quotes, e.g.: str_replace("'", "''", "Joana D'arc"), probably your case the change will be similar to the: $values = " empresa =…
-
0
votes1
answer39
viewsA: C#: Sending data to database (Sqlcompact)
As simple as possible! Start by creating a class to structure the information you want to save: public class REC { public int RecNum { get; set; } public int Year { get; set; } public int Month {…
-
2
votes1
answer75
viewsA: PYTHON LAYOUT ATTRIBUTE ERROR
You are trying to access a class variable that was not created. self.values = janela.Read() Add the variable and try again. import PySimpleGUI as sg class TelaPython: values = '' def _init_(self):…
-
0
votes2
answers56
views -
0
votes1
answer31
viewsA: Extract part of email cell text
The problem is that the formula LOOK FOR returns the first occurrence of the character, while what you need is the index of the last occurrence. To get the search behavior from right to left you…
-
0
votes1
answer37
viewsA: ASPNET Core - Error 500 when posting a method that returns a Partialview with only one object
Error occurs due to lack of validation of any of the arguments. Consider that if the error is 500 the defect is not in that endpoint call. The 500 family of errors refer to errors on the developer…
-
0
votes1
answer50
viewsA: How to put an ID in a variable? ASP.NET MVC
Your problem is in domain modeling. Some problems: You’re dealing with an N x N (Too Much) relationship, but you didn’t create one class / associative table to specify Order x Color relationship…
-
0
votes1
answer43
viewsA: Doubt in the Operator Conversion
I would like to understand if this difference "public Static Angle Operator" to "Public Shared Operator" brings any difference, because Angle in VB "some", or Byval a as Angle already reduces this…
-
1
votes1
answer70
viewsA: Location of pseudo-elements (xpath)
There are some spaces between the text, you will need to use the function normalize-space to find only the text "Product successfully Added to your Cart". //h2[normalize-space(text()='Product…
-
0
votes2
answers259
viewsA: C# - Can you run a task and return to the main thread later?
See an example to save file back to the main system stream after thread execution. With some modifications you can adapt to your scenario. public void SalvarArquivo() { //faz as ações antes de…
-
0
votes1
answer249
views -
0
votes2
answers100
viewsA: What kind of problems do routes solve?
Routes more easily solve the problem that you need to have a physical file for each URL and allow more friendly URL writing. When the concept of routes did not yet exist, each URL was a physical…
-
0
votes2
answers72
viewsA: How do I pass the right string value to my controller? from the error when returning to Edit View
Change your Controller to use the Post method: [HttpPost] public ActionResult EditarInstrutor(string nome) { return View(); }…
-
1
votes1
answer30
viewsA: .NET fix URL sent in a POST Request
My question is as follows; is there any way to convert this received value to the correct url? replacing these "%3a" with ":" and "%2f" with "/" so I can use this data? Yes! Use the function…
-
1
votes1
answer91
viewsA: C# press key multiple times
There’s a way I could have Tab pressed repeatedly more efficiently? Yes, you can do this by creating a Extension Method and a bow for. Ex: static class IWebElementExtensions { public static void…
-
1
votes1
answer209
viewsA: Search Widget for <Value> Selenium
Yes, you can search for the element using your text as a criterion. Use the XPATH language for this as the example below. var span = driver.FindElement(By.XPath("//span[text()='RANCHO RIO CLARO BAR…
-
2
votes2
answers489
viewsA: What are the differences between Value Objects and entities in object orientation?
The question is not whether the use of these concepts are good or not, the question is in relation to the conceptual difference of these types of objects. Difference is the Mutability. What will be…
-
7
votes4
answers694
viewsA: Why not comment on the code?
There is no definite reason not to use comments. There are recommendations. You have to ask yourself if it’s really useful to put them on or if it’s just adding noise to the code that will generate…
-
1
votes4
answers1233
viewsA: What is the difference between OO and DDD?
It’s easier to see the difference if you look at DDD as a guide that guides you in designing the logical solution and OOP as a way to implement this logical solution. DDD helps you make decisions…
-
1
votes1
answer117
viewsA: Property Hasrows in C#
Try including the clause having to secure lines only when SUM is greater than zero or some other counter is greater than zero. "select EMGroot.id, EMGroot.lbs_net, EMGroot.lbs_gross_aai,…
-
0
votes2
answers113
viewsA: Doubt C# ADO.NET class - Accessing data from a Datatable
Probably the clauses are in conflict, use parameters to define precedences when there are AND and OR in the same clause, otherwise the filter of FLAG will only work in conjunction with the ALBUM but…