Posts by Jéf Bueno • 67,331 points
1,254 posts
-
1
votes6
answers2251
viewsA: Remove all elements from an array that already exist in another
Just make a filter and check with the includes if each item in the array a exists in the array b. Just remember that objects are always compared by reference, that is, even if the properties of two…
-
5
votes2
answers1595
viewsA: Check if there is value in List
The Contains, naturally, makes use of the implementation of IEquatable if the class in question implements this interface, otherwise it makes use of the method Equals class. If you haven’t…
-
3
votes3
answers2830
viewsA: Loop of repetition in Assembly
I made a version a little simpler than the other answer. Without using the move - I changed my mind right after. main: li $t0, 0 # $t0 é o incrementador (o "i" da pergunta) li $t1, 6 # $t1 é o valor…
-
7
votes2
answers2154
viewsA: How do I convert a date into American format in Angular?
That’s what you put in view is a string and not a date. The filter date can only be applied to objects of the type date. angular.module('app', []); angular.module('app').controller('mainController',…
-
6
votes8
answers2184
viewsA: How to know all possible combinations of 0 and 1 in Java?
A good way to do this is to treat these combinations as binary numbers (very likely this is the actual intention). In this specific case, it is simple, the highest binary with 5 digits is 11111,…
-
8
votes2
answers772
viewsQ: How does XOR work for two binaries with more than one digit?
I learned that the XOR operator works as OR Exclusive, that is, the end result is only 1 when only one of the operators is equal to 1. The truth table illustrates this well: My question is: how the…
-
4
votes3
answers2830
viewsQ: Loop of repetition in Assembly
How can I do a repeat a certain number of times in Assembly (no MIPS)? Example in pseudocode, assuming the variable registrador be a registrar that I want to receive all numbers from 1 to 6 (one at…
-
4
votes1
answer1092
viewsA: Download Javascript Array on a Combobox
The id should be on select and not in the option. Anyway the current code should not present the error that you showed, this seems more a problem with the order of things, IE, check if it is not…
-
3
votes3
answers525
viewsA: How to insert an existing record into the Entity Framework?
The Entity Framework works with observable collections, that is, the records that are returned from your query are being "observed" by the context so that when (and if) there are changes these can…
-
3
votes1
answer528
viewsA: Possible to create an application with Angularjs without Nodejs?
Yes, it is possible. Probably the tutorials you have seen ask for the installation of Nodejs to be able to use NPM (which is the Node package manager). You can simply download Angular from another…
-
8
votes2
answers14542
viewsA: How to ignore Folders/Directories in GIT? Ex: . Metadata , . recommenders
Only using gitignore. Note that if you have already added the files in the repository, you need to remove them. git rm --cached -r /.metadata Use the argument -r (recursive) when removing a folder…
-
1
votes3
answers3589
viewsA: How to pick a word within a string (phrase) in Node.JS
Using the method indexOf. The method returns the index of a given character in a string. From there it’s just working with this information. Example with question code. var frase = 'Ola, bruno'; var…
-
8
votes2
answers3386
viewsA: How to call a nonstatic method within a static class?
In this case, it makes no difference whether the "outside" class is static or not. The problem of the code is that you are calling a method non-static of TagAnalogicaAtiva without first creating an…
-
3
votes3
answers1480
viewsA: How to make a query through LINQ ignoring accents?
In SQL Server it is possible to change the collation one-column "on the fly" during a Select. Something like: Select * From Entidades Where (Coluna Collate SQL_Latin1_General_CP1_CI_AI) Like 'Tê%'…
-
4
votes3
answers176
viewsA: Tooltip in a Listview in c#
There is a component to this, the ToolTip. Take a look at the linked documentation to see all possible settings options. For a minimum operation you only need to create an instance of it, and assign…
-
7
votes2
answers368
viewsA: How to get the properties of a type when using Generics C#
In fact it is not even necessary another method to do this, a simple GetProperties() using typeof would have done well. var properties = typeof(Pessoa).GetProperties(); Even if you want to follow…
-
8
votes2
answers8291
viewsA: create a file with C# content and save to a folder on the computer
There are several problems there. I improved your code in a general. Use Path.Combine() instead of concatenating the strings with the backslash (this is more of a hint). No need to check if the…
-
0
votes1
answer905
viewsA: Title bar text in the center
Of course, it is not possible. There are two ways to deal with this, neither is easy and maybe none is good for the specific case. Create a form personalized. This is somewhat laborious, but it…
-
3
votes2
answers80
viewsA: Inserting special character in view
Use item.OrderSend in parentheses, so the Razor will understand that the symbol "º" is not part of the variable name. <td>@(item.OrderSend)º</td>…
-
4
votes1
answer437
viewsA: Why does the Jframe size exceed the size of your Contentpane, even though it has a defined size?
That’s right. This extra space is referenced the edges of the window, these edges count in size. For example, in Windows 10, windows have a 1px border on each side. Other than that, there is another…
-
19
votes4
answers936
viewsA: Why is the use of Dynamic something to be avoided?
Basically, it should not be avoided. You have to know as use and when wear. This story of being "good practice" or "bad practice" is, mostly, a trick used to impose rules without having to base what…
-
1
votes2
answers241
viewsA: Check continence python list
Create two set's (set of elements without repetitions) and use the method issubset. lista1 = [5, 6, 7] lista2 = [4, 'a', 9, 5, 6, 7] set1 = set(lista1) set2 = set(lista2) if(set1.issubset(set2)):…
-
6
votes3
answers96
viewsA: Capture Textbox that called the event
Using the sender which is received per parameter in the event. private void txtBox_GotFocus(object sender, EventArgs e) { var txt = (TextBox)sender; txt.Text = ""; }…
-
0
votes1
answer94
viewsA: Doubt about Containsignorecase in a textbox
All that remains is to include the namespace in the class of Form. In fact, the name of namespace is not good, try to put something more descriptive, as MyExtensionsMethods. // Outros using using…
-
4
votes1
answer146
viewsA: Reflection with list property
The problem here is that you cannot convert a list of objects of a certain type to a list of objects of the base type. Try to do this without Reflection, something like: var listaMyClass = new…
-
0
votes1
answer44
viewsA: Doubt about looking for buttons
Well, I made all the code for you in the other post, just missed you understanding a little part. As I said in one of the items Define when the search will take place. In the example, I set that the…
-
1
votes3
answers3523
viewsA: ASP.MVC error "cannot find resource"
You are trying to access something not accessible, the code of view. Note that in the folder Views there is a file web config., he’s responsible for blocking this. The correct is to access…
asp.net-mvc-5answered Jéf Bueno 67,331 -
4
votes1
answer327
viewsA: New Line Stringbuilder message Box C#
This will be shown in an HTML, so instead of adding Environment.NewLine, add <br/>. var builder = new StringBuilder(); foreach(var item in tributoPagar) { builder.Append("***");…
-
4
votes1
answer463
viewsA: Error saving list of related objects
You already know the cause of the mistake Because in my object list, you’re not generating a primary key The solution is to create a new Guid for each Dependente, as it is done for Cliente.…
-
5
votes2
answers511
viewsA: Protect SQL Server Database
In the database itself is not possible. What you can do is change which users have access to the database, remember that the user master (the one defined at the installation of the bank, usually…
-
1
votes3
answers5873
viewsA: Remove repeated lines in all aspects on Oracle
Use a distinct. Select Distinct * From Tabela; See working on SQL Fiddle.
-
2
votes3
answers37
viewsA: Doubt about why it does not give nullpointexception
NullPointerException burst whenever an attempt is made to access a member of a null object. Realize that lista2 receives the result of teste() is the result of teste() will never be null. This is…
-
9
votes2
answers93
viewsA: Method equivalent to Biginteger.and() in C#
The and is the same thing as using the operator & (bitwise and) between the two values and this is equal in the two languages. I made other adaptations too. In C#, BigInteger is a guy by worth,…
-
2
votes1
answer273
viewsA: Error while uploading a Nodejs application to Heroku
The error returned is very clear Unable to parse package.json That is, the package.json file is invalid. See in the attribute scripts, has the attribute start, its value and then a comma, remove the…
-
4
votes2
answers48
viewsA: Use Firefox to run ASP.NET application
You can add it manually. Click on "Browse With...", you will see this screen Click on "Add" and look for the Firefox executable by clicking on the ellipsis Now Firefox will appear in the list.…
visual-studio-2015answered Jéf Bueno 67,331 -
10
votes1
answer5341
views -
7
votes2
answers76
viewsA: Foreach at a checklist in c#
The mistake is very clear, listView.Items is a collection of UltraListViewItem. To ListView that is being used is not the default of Winforms but a proper implementation. Without further details,…
-
5
votes2
answers230
viewsA: Question about how to position buttons
Demonstration of code working: Your question is very simple and it is very easy to develop a solution for that you need. I’ll give you a basis, the algorithm practically ready, you’ll need to adapt…
-
6
votes1
answer7728
viewsA: How to write in a file without erasing old things?
Pass as second parameter to string 'a', This says that you are opening the file to update it. The second function parameter open is a string which indicates how the file should be opened, the most…
-
1
votes2
answers212
viewsA: Read column values - C#
First: check that cmd6 is not null, this is a possibility. For your conversion, it’s not a good idea to do this cast as the return of ExecuteScalar() can be null and this can also cause a mistake. A…
-
5
votes4
answers69
viewsA: How to convert fields to a line with string?
You can do with Reflection. You need to be careful because usually, Reflection leaves execution much longer. Take an example: using System; using System.Linq; using System.Reflection; public class…
-
1
votes2
answers112
viewsQ: Use same sorting algorithm with different attributes
Setting: I am developing a small application as a task of my course. As the intention of the work is precisely to show what we learned during the classes, I can not escape much of what I already…
-
1
votes3
answers3386
viewsA: Limit of input characters
You can use the event keydown instead of input and use an attribute data-* to set the limit (since you said in the comments that you cannot "trust" the attribute maxlength. The implementation is…
-
5
votes3
answers3072
viewsA: Provide file download from server
If the file exists on the disk and you know its way, it would be better to return it without having to worry about opening it, right? public FileResult Download(int id) { string caminho = /*Buscar…
-
1
votes2
answers19135
viewsA: Syntax = Invalid Syntax for variable name
This syntax error is because a parenthesis is missing at the end of input. After solving this error, the script will still return another error Typeerror: Unsupported operand type(s) for : str and…
-
1
votes3
answers88
viewsA: What is the correct way to call function within another nested function?
I think that’s what you need. function principal() { function one_level_1(){ console.log('one level 1'); } principal.one_level_1 = one_level_1; function two_level_1(){ console.log('two level 1'); }…
javascriptanswered Jéf Bueno 67,331 -
0
votes2
answers158
viewsA: Actionlink + data-loading-text
Just create the anchor via HTML. <a href="@Url.Action("Listar", "Cadastro", new { cadastroId = id, area = "Formulario" })" class="btn btn-warning" style="margin-right: 735px;"> <i class='fa…
-
6
votes3
answers625
viewsA: How to treat Nullreferenceexception with Lambda
Just use the null-conditional operator of the C#. If the return of p.GetCustomAttribute<DisplayNameAttribute>() for null no attempt will be made to access the property DisplayName and the…
-
2
votes2
answers154
views -
3
votes2
answers6824
viewsA: Automatically create vector in Python
It’s simple. It would be nice to take a look at module random, there are several ways to work with random numbers. randint returns an integer between the two that have been passed by parameter. from…