Posts by Jéf Bueno • 67,331 points
1,254 posts
-
1
votes1
answer348
viewsA: How do I edit an element of this array?
First, you should use a generic list. Non-generic collections are obsolete. Second, it is not possible to edit objects of anonymous types, they serve only for reading. That is, if you want to edit…
-
2
votes1
answer406
viewsA: Send data from a Gridview in a Form to Combobox in another Form
Do it in a way that this parameter is not mandatory for the functioning of the form or create a public property in the second form that will receive this value. Example: Optional parameter //…
-
8
votes2
answers675
viewsA: Sum of Timespan in C#?
The sum between the two structures works because the language allows to do operator overload. How this sum operation of the two Timespan structures works? This is defined in the creation of the…
-
3
votes2
answers8760
viewsA: How to create a list with some attributes in java?
That doesn’t make much sense. A ArrayList of avaliacaoMensal may only contain objects of the type avaliacaoMensal. You need to create an instance of this class and add the element to the list.…
-
7
votes1
answer98
viewsA: puts e p in Ruby
The two show different representations of a given object in the application’s standard output. The puts shows the most standard human readable representation by calling the method to_s, as long as…
-
4
votes1
answer290
viewsA: Publish Asp.NET MVC website?
Because files contained in these folders are not required for the application to run. In these folders there are the files you develop in C# (VB.NET or other supported language), these files will be…
-
7
votes2
answers1402
viewsA: Shaman is completely free?
Not completely. It’s part of Visual Studio now, so if you have a Visual Studio license you can use Xamarin. Visual Studio Community is free and can be used by individual developers, project…
-
9
votes2
answers967
viewsA: How to test private methods in C#?
At first, you shouldn’t test. The idea of unit testing is to test whether the public API is working as expected. Anyway, it is possible to use the class PrivateObject namespace…
-
5
votes2
answers93
viewsA: Syntax error jquery
You can’t use the if this way, you need a ternary operator. See the example below. If the condition is true will be concatenated what comes after the ?, otherwise, what comes after :. Obviously you…
-
6
votes1
answer2157
viewsA: Difference hashmap and arraylist
ArrayList is a set of elements of a defined type. It is an ordered structure of data, that is, the values can be accessed by its indices. Example: ArrayList<string> lista = new…
-
1
votes1
answer920
viewsA: Save an HTML - possibly dangerous value Request.Form
You need to add the annotation [AllowHtml] on the property of tb_conteudo that is receiving HTML content. Example: public class tb_conteudo { [AllowHtml] public string CONT_HTML { get; set; } /*…
-
1
votes1
answer46
viewsA: Problem with howling
There’s absolutely nothing wrong with the code, make sure the Javascript files are included correctly. The only problem there (existed before editing) is that the first HTML anchor is using an…
-
1
votes2
answers1397
viewsA: Adding multiple Gridview lines
The problem is that you are treating a web application as if it were a normal desktop application. It is necessary to note that a web application is always stateless, that is, no state is kept…
-
2
votes1
answer2196
viewsA: How to get the array object data in javascript inside a FOR?
Just need to create make one push in the array. var valores = [{descricao: 'Gesso convencional', habilidades: true, idHabilidade: 1}, {descricao: 'Gesso acartonado', habilidades: true, idHabilidade:…
javascriptanswered Jéf Bueno 67,331 -
1
votes2
answers416
viewsA: Active Process when I close the C# WPF program
You yourself answered what the problem is, the home screen is never closed. The right thing is you do this flow control in another class (maybe in the class App, which is who initializes the…
-
5
votes3
answers374
viewsA: Store CSS in string
I don’t know if I understand what you want, because I don’t understand the usefulness of this, but I think all you need to do is remove the line breaks and spaces from the text.…
-
11
votes4
answers8192
viewsA: How to exclude an item from an array by the attribute value?
You need to find the element using the method filter, then just capture the element content using indexOf and remove it. It is also possible to create a new array only with the elements that do not…
javascriptanswered Jéf Bueno 67,331 -
4
votes1
answer248
viewsA: How to access data from a subArray with Javascript
It is only access in the hierarchy that the data meet. Realize that itensPedido is a array, inside it has an object impressoraPedido and within this object is that you have what you need. var obj =…
-
3
votes1
answer122
viewsA: Fill a listbox with predicate<string>
Thus i.ToList().ForEach(item => listBox1.Items.Add(item)); If the method parameter Add is of the same type as item (string, in this case) you can still make it simpler…
-
4
votes1
answer7066
viewsA: Object reference is required for non-static "notificationhub" field, method or property
Yes. Exactly what it says in the error message, it is necessary to create an instance of NotificationHub to call the method SendNotification(). That’s because the method is non-static, that is, it…
-
0
votes1
answer63
viewsA: Can I assign value within a parameter?
Depending on the language, as it is pseudo-code, it will depend on your teacher whether to accept or not. This is called "predefined parameter" (or anything that has the same meaning). In general,…
-
4
votes1
answer205
viewsA: Convert string to Static?
Your problem is that the method that is using the property prefix is static and this member is non-static. If you need to access a non-static member (instance member) then the method that does this…
-
5
votes2
answers567
viewsA: Compare current date with saved in database and return validation
Just compare one date with the other, the same is done with integers. DateTime dataAtual = DataAtual(); DateTime dataLimite = /* Capturar a data do banco */; if(dataAtual > dataLimite) { // O…
-
4
votes2
answers1320
viewsA: How to hide a password in C#
Just define the property PasswordChar from Textbox, no extra event needed. txtSenha.PasswordChar = '*';…
-
3
votes3
answers99
viewsA: Problems with View Model Implementation
The estate Evolucoes of Viewmodel declares a ICollection and the return of the method Where (at least when applied to a IQueryable) is always a IQueryable, I mean, you’re trying to make a…
-
5
votes2
answers279
viewsA: Is there a difference in how polymorphism is applied in Java and C# ?
In java I believe I can access all methods and attributes declared as public in a subclass even when using a superclass type variable to reference this subclass. No, you can’t. It makes no sense to…
-
4
votes4
answers251
viewsA: substr only with string greater than 4 character
Just make a if counting the characters with the function strlen() $conta = "ABCDE"; if(strlen($conta) > 4){ $conta = substr($conta, -1); } echo $conta;…
-
1
votes1
answer394
viewsA: Clear whitespace of an array
You can do this easily with LINQ, see the example. It will also be possible to do with a for passing through all the elements and creating another array or a list. In this case, it would be much…
-
4
votes2
answers509
viewsA: How to view object information from my Arraylist?
That’s because there is no method getInfo() in class ArrayList and turma is an instance of this class. Maybe you want to call the method getInfo of each aluno public void listaAlunos(){ for (Aluno…
-
4
votes2
answers3358
viewsA: Javascript code does not work on Chrome
Problem may be the tag location script, it is not correct to put it after the closure of body. If you want the script to be loaded after the HTML body, tag before closing of body. This may vary from…
javascriptanswered Jéf Bueno 67,331 -
13
votes3
answers5013
viewsA: What is the difference between using Object.toString() and String.valueOf()?
Almost none. There is an additional indirect String.valueOf, which is checking whether the parameter is null or not. Paraphrasing the documentation of String.valueOf: The method will check whether…
-
7
votes2
answers124
viewsA: Remove half of the file name
If you want to capture only what comes after "Updates", as was said in the comments just capture the position in which the keyword ("updates", in case) lies within the full path and work on a…
-
4
votes2
answers756
viewsA: How do I break a line to send an email to a user with HTML?
Only use HTML line break tag <br>. conteudo = "Linha 1<br>Linha 2<br>Linha 3<br>";
-
5
votes2
answers60
viewsA: How to sort object vectors by checking an attribute?
It’s the same thing var listDistances = [ {distance: 857, location: {lat: 15.246, lnt:16.4552}}, {distance: 26, location: {lat: 18.246, lnt:16.4552}}, {distance: 740, location: {lat: 15.246,…
javascriptanswered Jéf Bueno 67,331 -
1
votes1
answer467
viewsA: Protect against HTML changes without blocking the browser console
Does not. All that rotate in the browser can be changed by the user. The treatments in client-side serve to improve the usability of the application, you can never fully rely on them, always make…
-
8
votes1
answer1524
viewsA: What is seeder and Migration?
What is a Migration? In this specific context, Migration is the definition that is given to the management of incremental and reversible changes in database schemes (structure). This allows you to…
-
3
votes1
answer1402
viewsA: Receiving System.Web.Mvc.Webviewpage<Tmodel>.Model.get returned null
Still need to pass the model to view. public ActionResult Create() { _produtoViewModel = new ProdutoViewModel(); _produtoViewModel.Categorias = _categoriaAppService.ObterTodas();…
-
4
votes2
answers1339
viewsA: Field check Combobox, Textbox Maskedtextbox
Basically you need to validate all fields that are TextBoxBase (this includes all types of TextBox) or ComboBox or if they have "children", in this case, you need to call the function again by…
-
4
votes1
answer3671
viewsA: string was not recognized as a Valid datetime
This is because your application does not define any culture. Therefore, the culture used will be the one defined in Windows. Locally this will work because your Windows is configured with a culture…
-
1
votes1
answer440
viewsA: While Exercise for Proof
Well, I won’t get into the merit of how hard you must have tried or not to do this. Basically, you need to go through all the elements of the list and check which one is the largest. This can be…
-
3
votes2
answers159
viewsA: What’s the point of continuing flow control?
It serves precisely to control the loop flow. It makes the execution go to the next loop, that’s all. In which situations its use is useful? When you intend to ignore the rest of the code in the…
-
2
votes4
answers8205
viewsA: How to get the highest value of a python array / vector?
First thing you need to notice is that the creation of the matrix is wrong, you need to add a new line after you have already inserted values in her four positions, for this the line m.append(linha)…
-
3
votes1
answer331
viewsA: Subtract from a number the values to your right in a list
There is no mystery, just make a loop to go through all elements of the array and within this loop make another loop that goes through all elements after the current and subtract. There’s nothing…
-
5
votes2
answers2462
views -
4
votes1
answer230
viewsA: Should I add the . suo file to my source control?
This file stores the settings and preferences that are set per user in Visual Studio. About sending them to an SCM: it depends on your intention. If you are in a project alone and want to keep this…
-
5
votes2
answers450
viewsA: Put two icons in the same paragraph
Yes, it is possible. Just add another tag with the classes fa and fa-whatsapp <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">…
-
3
votes2
answers2822
viewsA: How to print an integer vector by removing the last comma in Python 3?
In a way Pythonico it is possible to concatenate the list elements into a string separated by a comma. The map serves to convert list values (created by range()) for string. numeros =…
-
0
votes2
answers85
viewsA: Inclusion of data by the operator
The method getString() of ResultSet is named (if string) or index (if it is a int) one-column as a parameter, you are passing the data that was entered by the operator. Change the code block inside…
-
3
votes2
answers264
viewsA: Java + Firebird connection returning Null
It is because some error is breaking and the execution falls on the block catch where you simply rule ignore this error and return null. try { Class.forName(driver); conexao =…
-
0
votes1
answer911
viewsA: Create java icon button?
Usually, it works by having the image in the same folder as the compiled file (.class). I tested your code with any image and worked perfectly (compiling "in hand"). But, doing so, the image will…