Posts by Jéf Bueno • 67,331 points
1,254 posts
-
4
votes1
answer26
viewsA: Error running Updade-Database command
This is because there is a property that cannot be mapped. In this case, it is the property Image who’s kind HttpPostedFileBase. Add the attribute [NotMapped] on this property public class Project {…
-
3
votes1
answer71
viewsA: How to Recreate an Array with new values
Using the function map(). No need to use jQuery for this. Take an example, there is one array with three items and a new array with the square of these items. const array = [2, 3, 4]; const…
-
1
votes1
answer425
viewsA: How to uninstall nuget packages at once, including dependencies
Only use –RemoveDependencies. PM> Uninstall-Package NomeDoPacote –RemoveDependencies If I select everything and give a Del and then go to the Packages folder and delete everything and then in…
-
1
votes1
answer218
viewsA: Declare Entity Framework Relationship one for many
Would that be modelBuilder.Entity<Pessoa> .HasMany(p => p.Enderecos) .WithRequired() // Porque todo endereço precisa pertencer a uma Pessoa .HasForeignKey(p => p.PessoaId);…
-
5
votes4
answers571
viewsA: Apply class to a link within an echo?
The quotation marks must escape. Even, it’s almost right in the original code, but there’s a double quotation mark left and there’s no escape in the first double quotation mark. To correct can do…
-
3
votes1
answer547
viewsA: Why does the "container" class in Bootstrap leave side spaces on the page? Is that normal?
Yes, it’s normal. Even, this appears in the documentation. If you want to make better use of the side space, you can use the class container-fluid. See an example. Note: Unfortunately it does not…
-
9
votes1
answer12449
viewsA: Javascript function Cannot read Property 'value' of null
The right is to check if the return getElementById is null and not its value. if (document.getElementById("<%= txtDiaVencimento.ClientID %>") != null) { var data =…
javascriptanswered Jéf Bueno 67,331 -
2
votes1
answer505
viewsA: Object initialization can be simplified
That’s not a mistake, it’s a Warning that says boot can be done in a more readable and organized way. The hint is that you initialize the objects like this: GridTextColumn dataLib = new…
-
4
votes1
answer688
viewsA: How to do this in pure Javascript?
$() is a shorthand of jQuery() which, in turn, is a function that can receive different parameters and make a decision for each of them. At the beginning, its entire function is passed as a…
-
1
votes2
answers146
viewsA: Error writing new record in Access database
Tip: Maybe it’s important you start working with parameters in darlings. In the current way it is very easy that some invader can make a SQL Injection (read about it, here and here) in your code.…
-
3
votes1
answer323
viewsA: Call Get action that returns a view by jquery ASP.NET MVC
Based on the comments, what you want is to use CSS for anchor (<a>) look like a button (<button>). .btn { appearance: button; /* CSS3 */ -webkit-appearance: button; /* Safari and Chrome…
-
5
votes3
answers549
viewsA: How to filter through attribute on an object / array
It is possible to use the function filter. It takes as parameter one callback that will validate each item in your collection. Something like mouseenter: function () { $id = ($(this).attr("id"));…
-
1
votes2
answers342
viewsA: How to receive a javascript value within a c# ASP.NET block
This is not possible the way you show it. C# runs on server, and Javascript wheel on the client (browser). The C# code is used to generate the HTML (or CSS or JS) that will be sent to the browser.…
-
6
votes1
answer884
viewsA: Error: "classify 'class name' does not have a Companion Object,"
It’s a typo. This line val totalDeLikes = contarNumeroDeLikes(postId, RelacaoDeLike) Should be val totalDeLikes = contarNumeroDeLikes(postId, listaDeLikes) See working on Try.kotlinlang.…
-
5
votes2
answers200
viewsA: How to convert text into file to number with decimals?
By the rule described: just convert the number to integer and divide by 100. I took the opportunity to do with LINQ, so each line of the file will return an item to the list valores. var valores =…
-
6
votes2
answers264
viewsA: How to program a single check-box to checklistbox items?
Add an event CheckedChanged at the CheckBox and change the value of the CheckListBox based on the value of CheckBox leading. private void checkBoxMarcarDesmarcarTodos_CheckedChanged(object sender,…
-
2
votes1
answer334
views -
1
votes1
answer5595
viewsA: Pair or odd through Random module (Python)
You need to, instead of comparing the two numbers, compare the two modules. Note that at the time of comparison, you have the following code if user == r: That will compare if the two numbers are…
-
2
votes1
answer100
viewsA: Code error when compiling
Well, see what the mistake says: Abstract, error: Number is Abstract; cannot be instantiated What’s happening there is a class conflict jxl.write.Number and java.lang.Number. I think you want to use…
-
11
votes1
answer1089
viewsA: How does the for(;;)work?
In this specific form is a loop infinite. It will stop only when you have a break. The structure of a loop for, in most languages mainstream is the following: for(inicializacao; condicao; pós loop)…
-
4
votes1
answer471
viewsA: Angular - I cannot view table data
There is nothing wrong with the code itself. Probably the location of the script of Angularjs is not /lib/angular-1.4.8.min.js. HTML is a little weird, but that doesn’t stop the application from…
-
3
votes1
answer193
viewsA: Changing text from another form does not work
In the code you try to change the value of the label is being created a new instance form. That is, the instance being shown is intact. Move the form variable to a more comprehensive scope and use…
-
4
votes1
answer416
viewsA: How to copy text from one text file to another
All you need to do is: Read all lines from the first file and put in a collection of strings Create a new collection where each row is prefixed with - Save this new collection to an archive Code:…
-
9
votes3
answers364
viewsA: Drag and Change Position of a Groupbox at Runtime
There is nothing ready for this in Windows Forms, but it is possible to work with the events of mouse and locating controls to have this effect. I have here a class with extensions that does just…
-
1
votes1
answer256
viewsA: Disable Filter Case Sensitive in Angular
Just use :false after filtro, the very documentation says so. Actually, all you have to do is put false if you want to explain this, because it already the standard. Anyway, you can create a…
-
3
votes1
answer297
viewsA: How to hide fields in queries using eloquent Join method
You can use the method select passing by parameter one array with the name of the fields you want to return. $dados = Roda::join('veiculos', function($query) { $query->on('veiculos.id', '=',…
-
3
votes2
answers369
viewsA: Read Java console string
You need to use the class Scanner and instates it by passing System.in as a parameter. Scanner scanner = new Scanner(System.in); System.out.println("Entre com seu nome:"); String nome =…
-
3
votes1
answer328
viewsA: Consult children objects that satisfy condition in parent objects, Relationship with eloquent
Since you didn’t give a real example, I used the fictional classes Pai and Filho $dados = Pai::with('filhos')->where('coluna', 'algum valor')->get(); In this case, it is necessary to have the…
-
2
votes3
answers232
viewsA: Difference on screen Windows Forms C#
This is common. There are several factors that change the "real size" of the form. Like, for example, the edges or even that shadow that is "behind" the window in Windows 10. What you can do is work…
-
3
votes2
answers84
viewsA: Comparing two objects and copying conditionally
It is possible to do using reflection (Reflection). Keep in mind that although this greatly shortens the code, it may have a slower execution than simply writing "in hand" property by property or…
-
1
votes1
answer106
viewsA: Laravel Unit Tests. I can’t instantiate the class
You need to use the keyword new to instantiate something $user = new \Escola\User;
-
6
votes2
answers74
viewsA: What’s missing from this code?
There is no class called Tarefa, the class name is TarefaDeCasa fun main(args: Array<String>) { val minhaTarefa = TarefaDeCasa("Daniel", "Programação", 10, "30 de Setembro")…
-
2
votes2
answers257
viewsA: Windows Forms Application - Visual Studio 2017
Yes. Just run the installer again and check the box.
-
13
votes2
answers262
viewsA: Check "in" return change the Python result
What happens there is a little confusion, perhaps by the custom with other languages and by the "unclear" form of this expression. A little about comparisons In Python, unlike most languages I know,…
-
3
votes3
answers461
viewsA: Is there a significant difference in performance when using Netbeans IDE with JDK 9 instead of JDK 8?
No, absolutely no difference in PHP development. That’s because the JDK (Java Development Kit) is, as the name says, a set of tools that serves to java programming. Netbeans is an IDE that, say, has…
-
9
votes3
answers643
viewsA: How do I remove a "listener" that I added via addeventlistener?
It is only possible to remove a Listener using the reference to the function. That is, you cannot remove events that are created with anonymous functions. To remove the listeners using the…
javascriptanswered Jéf Bueno 67,331 -
3
votes1
answer256
viewsA: Disable Lazy Loading for a specific query
Just disable it before fetching the data. public IList<NotaMercadoria> GetAll(long pIdCadEmpresa) { entity.Configuration.LazyLoadingEnabled = entity.Configuration.ProxyCreationEnabled = false;…
-
2
votes2
answers1032
viewsA: How to add div before another div with Javascript
It is possible to use the function insertAdjacentHTML. The first parameter is the position you want to insert, use beforebegin to add before. You can see all possible values in the documentation.…
javascriptanswered Jéf Bueno 67,331 -
0
votes4
answers1204
viewsA: Capture the value of a text without the mask?
You need to use the method cleanVal(), see documentation. Applying to your example, which uses the get(indice) would be so: Note that the return of get(indice) is surrounded between $(), because the…
-
6
votes1
answer3967
views -
4
votes2
answers575
viewsA: jQuery - How to get the first character of an input?
Version without jQuery. Because it’s not necessary jQuery for that. const input = document.getElementById('input1'); const primeiro = input.value[0]; console.log(primeiro); <input id="input1"…
-
1
votes1
answer32
viewsA: Show grouped partial files
Just editing manually the file . csproj. If you’re willing to do this, here are the steps. Close the project in Visual Studio Open the file . csproj with any text editor Look for this (note that…
visual-studioanswered Jéf Bueno 67,331 -
4
votes1
answer346
viewsA: How to perform a Count in multiple columns?
You need to keep in mind that the GroupBy returns a grouping structure. This structure contains all the data of a given grouping and also the key (Key) from it. For example: if you have 5 items…
-
2
votes3
answers2857
viewsA: How to make a string in Appsettings and use it later
Only use ConfigurationManager.AppSettings[chave]. using System.Configuration; // outras coisas public static void AlgumaFuncao() { var valor = ConfigurationManager.AppSettings["exemplo"];…
-
2
votes1
answer115
viewsA: Does not install Xamarin.googleplayservices.base
The error says: (...) You are trying to install this package in a project that is intended for 'Monoandroid,Version=V6.0', but the package does not contain any Assembly reference or content file…
-
1
votes1
answer68
viewsA: Determine the time of execution of the next task based on the end of the current run in Windows Service C#
Just make the application wait a little before running the operation again. using System.Threading.Tasks; // outras coisas public static async void saveFiles() { // Fazer um monte de coisa demorada…
-
5
votes2
answers53
viewsA: Loop counter is not incrementing
The x is being initialized within the foreach. In this way, with each iteration (loop) it is initialized with the value 0. The solution would be to declare the x outside the loop. int x = 0; for…
-
4
votes1
answer234
viewsA: C# MVC5 EF - How not to lose data after Modelstate validation?
Well, you need to keep in mind that a web application is always stateless (or stateless). That is, basically, the server receives a request, processes it and returns it to the client. There is no…
-
3
votes3
answers542
viewsA: What files for an MEAN project should I send to Github?
NPM and Bower folders do not need to be uploaded to the repository. This is one of the advantages of using a package manager. To ignore these files, you need to create a file .gitignore at the root…
-
1
votes1
answer459
viewsA: Datagridview.Cellclick event
Just validate which column was clicked and return if it is not the one you want. private void DGW_chklist_CellClick(object sender, DataGridViewCellEventArgs e) { if(e.ColumnIndex !=…