Posts by Augusto Vasques • 15,321 points
571 posts
-
0
votes1
answer214
viewsA: How to make an Insert in two distinct tables in C#
The problem is that there are three consultations: INSERT INTO PROFESSOR(nome) VALUES (@nome); SELECT SCOPE_IDENTIY(); INSERT INTO DISCIPLINA(disciplina, idProfessor) VALUES (@disciplina,…
c#answered Augusto Vasques 15,321 -
1
votes2
answers979
viewsA: Convert value to C#object
As your question appealed a variable input format it is difficult to stipulate a standardized class format to accommodate your data. What I did was create an parser so that it accepts any input…
-
0
votes2
answers567
viewsA: Method that takes 3 integer values per parameter and returns them ordered in ascending order as an array
His method Maior1 does not cover all possibility. Best output is to use a list sorts-there and devoler the array: public int[] Maior1 (int valor, int valor2, int valor3) { List<int> lista =…
-
2
votes1
answer38
viewsA: How to Recover User Name in Botframework?
The documentation doesn’t help much but I think you’re looking for the property IDialogContext.Activity.From.Name. private async Task MessageReceivedAsync(IDialogContext context,…
-
1
votes1
answer33
viewsA: Problems with wpf Data Grid
If you cannot delete hide. Change the property Visibility, of the column which it does not wish to display, to Visibility.Collapsed. dgProdutos.Columns[/*coloque aqui o indice da…
-
1
votes4
answers58
viewsA: Repeat loop on id
Just create a bond for for a variable i which lasts from 1 to 10 by adding i to the common text of each selector. $(document).ready(function() { for(var i = 1; i <= 10; i++){…
javascriptanswered Augusto Vasques 15,321 -
1
votes1
answer197
viewsA: How to separate sequence of numbers in an array
Use static class method Regex Replace(String, String, String) to make the replacements. What is not digit it replaces with ";" and then places a line break after six sequences of digits ended by ";"…
-
1
votes2
answers188
viewsA: Memory allocation of a service
To know information about a service just take the process associated with this service and evaluate its properties: // Pega todos os serviços ativos com o nome NomedoServiço.exe e faz uma inspeção…
c#answered Augusto Vasques 15,321 -
2
votes1
answer70
viewsA: How to Change a Data in the BD
At the end of the string "UPDATE Produto SET Nome = @NOME, Descricao = @DESCRICAO, PRECO = @PRECO, STATUS = @STATUS WHERE ID = @ID" which is passed to the constructor MySqlCommand command = new…
-
2
votes2
answers82
viewsA: Save changes to the bank
Using a fragment of your example to show the use of Begintransaction and Commit. note: I copied exactly the same content of the question. conectar.Open(); //inicia a transação de dados var…
-
1
votes3
answers339
viewsA: The name "Arthur" does not exist in the current context C#
First thing you could create a specialized constructor for the class Cliente and this constructor fills the fields nome, email, dataNascimento, cpf,rg, endereco and senha. Then overwrite the method…
c#answered Augusto Vasques 15,321 -
1
votes2
answers133
viewsA: Printdocument Printpageeventargs c# wpf Pagesize WPF
The problem is that you changed the sheet size but did not inform the printing system that you want to use a custom sheet size through the value PaperKind.Custom. What makes the system choose the…
-
1
votes2
answers1338
viewsA: How to generate sequential ID?
Just turn the field id in static. The keyword static indicates to the compiler that instead of creating a field in an instance you want to create a field in a class. class User { // Unica mudança…
javaanswered Augusto Vasques 15,321 -
1
votes1
answer49
viewsA: Database and Listview do not work
Try this code it puts the insert operation within a data transaction context that is opened with the method beginTransaction() is the data is passed to the database by the method…
-
1
votes2
answers300
viewsA: How to create an array through another?
Java arrays cannot grow dynamically after you set their length that can no longer be changed. When you do int[] arr2= {}; you are telling the compiler to create the array arr2 with length 0. To…
-
0
votes4
answers152
viewsA: How to know the exact line of a Nullreferenceexception error when creating a new instance of an object with multiple properties
Use a static method overload Isnotnull class Assert in namespace Microsoft.VisualStudio.Testtools.Unittesting. The class Assert is a collection of auxiliary methods aimed at testing various…
c#answered Augusto Vasques 15,321 -
2
votes4
answers2332
viewsA: Print String vertically in Python
Replace all your code with that line: for c in input("Digite seu nome: "): print(c) Don’t use the while to iterate over a string, the simplest way is for item in String:…
-
0
votes1
answer93
viewsA: Build Failure - 'okhttp-3.14.0.jar'
Import the file okhttp-3.14.0.jar, if it has dependencies also import dependencies, to libs. In the archive build.gradle: allprojects { repositories { flatDir { dirs 'libs' } } } dependencies { //…
android-studioanswered Augusto Vasques 15,321 -
0
votes1
answer201
viewsA: PHP error 'WPLANG' - assumed 'WPLANG'
Without reading your code, I can’t help you. The most I can do is assume a scenario based on the error message where on line 75 of your code has something like this: define ('WPLANG',…
-
2
votes1
answer57
viewsA: Datatable for a class
You are looking for the method Datatable.() which returns the structural clone of an object DataTable, including all schemes and restrictions assigned to that DataTable. Use: After defining the…
-
1
votes3
answers101
viewsA: C# Object reference not defined for an object instance
What’s the matter? The problem is that the field public List<Node> conectados; is not being initialized next to the object Node. Your program does all route calculation but at the time of…
c#answered Augusto Vasques 15,321 -
1
votes2
answers48
viewsA: Apache slave server
When so you have to create a cluster. What is a cluster? A computer cluster is a set of connected computers that work together so that in many ways they can be seen as a single system. Unlike simply…
-
0
votes3
answers145
viewsA: Save character by character within an array
In the section where you add the line: conteudo.add(linha); Replace with: conteudo.addAll(Arrays.asList(linha.split(" "))); String.split(String s) divides the String in a String[] where s is the…
javaanswered Augusto Vasques 15,321 -
1
votes1
answer64
viewsA: Method that returns the amount of objects removed from an object array
Probably or your method getNome() is returning a value other than intended or the array is empty or the item you intend to remove is not present. Without the array-related code it is not possible to…
javaanswered Augusto Vasques 15,321 -
3
votes1
answer251
viewsA: Capture the username logged in to Windows by IE 11
According to the documentation of the object Activexobject this object is supported by versions 6, 7, 8, 9 10 and 11 of Intenetexplorer. //JavaScript var WinNetwork = new…
-
4
votes1
answer135
viewsA: Converting from Java to Groovy. Problems with dynamic type promotion. How do I disable it?
Groovy is a dynamic language and by default uses a dynamic dispatch mechanism to execute method calls and properties accesses. This dynamic dispatch system provides great flexibility and power to…
-
1
votes3
answers142
viewsA: Switch locks command when entering a letter
Use a stringstream to receive cin as the stream processes the characters one by one and interrupts the process if there is an invalid character according to the type requested. #include…
c++answered Augusto Vasques 15,321 -
-1
votes1
answer135
viewsQ: Converting from Java to Groovy. Problems with dynamic type promotion. How do I disable it?
I’m converting an old Java application to Groovy. The syntax conversion is smooth. The problem is dynamic Groovy typification. Let me give you an example, I declare a method foo and its overload:…
-
0
votes2
answers1020
viewsA: I can’t use Android Studio (Gradle Project Sync failed. Basic Functionality ... )
Before anything else check that jdk is correctly installed on your system. Gradle does not work without an updated version of Java. What may be happening is that Android Studio must be looking for a…
-
2
votes2
answers119
viewsA: How to shuffle a list of objects through a default value?
Instead of using GUID within the method Enumerable.OrderBy use the method Random.Next(int maxValue) of an object Random instantiated by the constructor Random(int seed), so generating the same…
c#answered Augusto Vasques 15,321 -
0
votes1
answer130
viewsA: How to mount a BMP header (Bitmap) in C
biXPelsPerMeter is the suggested horizontal pixel per meter resolution for the device that will display the bitmap. The application can use this value to select within a group of bitmaps which image…
-
2
votes2
answers190
viewsA: Keyboard events in C# in textbox
First set the property KeyPreview from the form to true so that keyboard messages are received by the form before they reach the controls in the form. Place an event OnKeyPress() in the Form, use…
c#answered Augusto Vasques 15,321 -
2
votes2
answers148
viewsA: How to create a "Line Counter" in a texbox
Use the library Able Opus C# there you will find the component NumberedRTBwhich is a RichTextBox with a numbered panel next to: To use it just instantiate it in run-time or else add it in…
-
1
votes2
answers48
viewsA: How to create a new object containing all the values of an initial object but adding new attributes in C#
c# syntax does not allow Typescript inline cloning and recognition {...foo, Bin: 123};. What you can do is create a constructor that initializes some members of the class and emits a clone using the…
-
1
votes2
answers78
viewsA: Remove selection from a Strip Menu
My guess is you’re looking for class ToolStripLabel which is just a Label that can be used in conjunction with a Menustrip. Toollabel is descended from ToolStripItem so can be added to the…
-
2
votes1
answer161
viewsA: Eclipse IDE error
I believe your project can’t find the JRE runtimes. This would be java.lang.String and other java types. * generate this error. If this is the case configure the JRE in Eclipse: Once Eclipse starts…
-
3
votes2
answers419
viewsA: Global variables Xamarin
Declare a static class within the module App.xaml.cs and declare global as their fields. Example: public static class Globais { public static string Aplicativo = "teste de globais"; public static…
-
1
votes1
answer57
viewsA: Convert XSD file to c# class in visual studio 2010
Open a prompt from DOS and use the schema definition tool XSD with the file path xsd containing the scheme: > XSD arquivo.xsd…
-
0
votes2
answers10099
viewsA: 'npm' is not recognized as an internal or external command, a operable program or a batch file
What is causing the error? I believe you’re calling nmp of bash or of powershell. Why this error occurs? Because both the bash like the powershell do not give conventional support(DOS) environment…
-
0
votes1
answer176
viewsA: uses unchecked or unsafe Operations
Within the build.Radle allprojects { gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" } } }…
-
9
votes4
answers1103
viewsA: What is the Kubernetes?
What is the Kubernetes? Preambulo Container technologies such as Docker, are enabling a new approach to the way developers create and deploy apps. With containers, a developer can easily package an…
-
0
votes2
answers82
viewsA: How to turn multiple variables into one PHP
You can concatenate with the operator . . $resultado = $nbuffet1 . ' ' . $nbuffet2 . ' ' . $nbuffet3 . ' ' . $nbuffet4 . ' ' . $nbuffet5 . ' ' . $nbuffet6 . ' ' . $nbuffet7 . ' ' . $nbuffet8;…
-
3
votes2
answers96
viewsA: Passing object as parameter changes the original object
Yes this parameter passage you are doing is yes a parameter passage by reference and the obtained results respect the paradigms of the POO. As for your questions: This would be a standard behavior…
-
2
votes3
answers591
viewsA: Access to the path 'path' is denied. VS2017
There are three of your problems: First problem: You are trying to create a file when the permission you granted to your FileStream is sufficient only for reading. Change the FileMode and the…
-
0
votes2
answers186
viewsA: Make variable wait to be set by user after While? java
I believe the intent of your code is to force the user to enter a number less than 1000. Being for there are two solutions: The first solution is simpler than starting num 1000 and change the…
-
2
votes1
answer49
viewsA: Clone a native javascript constructor without changing the original
If you want to extend the native javascript classes you should take a look at the keywords class and extends and the concept of class Expression. //Extende a classe Date sem interferir com a classe…
-
1
votes1
answer49
viewsA: Return of a single element from a list to a LINQ
What’s the matter? Multilinear (multithread) code collections must have data access synchronization so that calls from two or more competing threads do not get stuck when deciding who will first…
-
2
votes7
answers1103
viewsA: Remove part of string until nth occurrence of a character
I’m sorry the taxpayers who used the method overloads String.Split, or other devices, but using a Regex.Match is the simplest and most efficient way to address this problem. Where:…
-
0
votes1
answer72
viewsA: Float field conversion problems
Use the function Number.prototype.toFixed() to format a number using fixed point notation. Example: console.log(Number.parseFloat("12.872").toFixed(2)); // retorna 12.87 Going back to your code: //…
-
1
votes1
answer405
viewsA: Transform string (date and time)
In that link you will find the Vbscript functions for time and date handling in ASP Classic. To solve your problem first you will take the current system date and time and put in a variable data and…