Posts by Jéf Bueno • 67,331 points
1,254 posts
-
1
votes1
answer55
viewsA: A problem to solve with English expressions
Change the Select for .Select(lib => new Liberacao { TipoVenda = lib.t1.TipoVenda, // e assim por diante } Obviously this will only work if you really return a list of Liberacao.…
-
4
votes4
answers837
viewsA: Problems with conditional structures
Disclaimer: It’s obvious that the code can be a little more idiomatic and Pythonic without needing to change a lot, but for me, it doesn’t make sense to try to explain it now because as the AP said…
-
11
votes3
answers8606
viewsA: Switch case Kotlin
Kotlin works with a different flow control called when. Your code, using the when, be so. Obviously the code could be different, but I understand your doubt is only about the use of switch. fun…
-
1
votes1
answer89
viewsA: How to add properties in an Expandoobject()?
ExpandoObject is of the "kind" dynamic. So you should use it this way anyway. dynamic dObject = new ExpandoObject(); dObject.A = new ExpandoObject(); dObject.A.Nome = "Paulo";…
-
3
votes3
answers83
viewsA: How to make a max + 1 with lambda or Linq, but with tables from nothing, all null
The whole code can be written like this public int GeraIdBalanca() => contexto.Balancas.Max()?.IdBalanca + 1 ?? 1; Your problem is because it is necessary to check whether the return of Max is…
-
2
votes1
answer1134
viewsA: UPDATE in two tables
The syntax is wrong. The order of things should be different, something like: Update `tabela` Inner Join `OutraTabela` On CondicaoJoin Set Campo = 'Valor' Where Condicao Applying to your current…
-
0
votes1
answer84
viewsA: Change Tabindex
That’s not possible. By the way, the way you’re doing, you’re trying alter the Tabindex of active control, being that what it needs is precisely change control currently active. What you can do is…
-
2
votes2
answers46
viewsA: Doubt with relationships N to N or 1 to N
No, you don’t have to wear one Collection. This will make the relationship of Login for Usuarios be 1-N. The ratio needs to be 1-1, so you only need a property that represents one Usuario within a…
-
2
votes1
answer1197
viewsA: Differences between Commit Staged, Commit Staged and Push, Commit Staged and Sync?
Commit Staged Commits locally changes that are in the area of Stage. Is equivalent to $> git commit -m "mensagem de commit" Commit Staged and Push Commits locally changes that are in the area of…
-
7
votes1
answer1427
viewsA: Is it possible to make a line break inside a placeholder?
It is possible using HTML Entity line-breaking . <textarea placeholder="Excelentíssimo Senhor Professor Doutor" class="form-control" id="interessado" style="width: 500px; height:…
-
3
votes2
answers343
viewsA: Many to Many with Fluent API
You decide, it is not necessary to do this to work. Mapping only on one side already makes everything work as it should. Remember that having browsing properties on both sides of the relationship…
-
4
votes3
answers388
views -
4
votes2
answers1031
viewsA: Null object on Deserializar Json
The problem is that JSON is not in the format you indicated. I just saw the Pipedrive v1 API documentation and it says that the format of the response to resource requests deals (using the verb…
-
1
votes2
answers706
viewsA: Multiple error Object sets per type are not supported
What happens is that the IdentityDbContext already arrow the DbSet automatically and you are setting it again right below. Your Identity context should look like this public class…
-
4
votes3
answers171
viewsA: Is it possible to have properties other than those generated automatically in a data class?
Yes, it is possible. One way to do this is through of extensions. One can create both functions and properties in this way. To declare an extension, you need to prefix its name with the type being…
-
1
votes1
answer251
viewsA: Load list with Entity
You have to access the property Produtos of your context. public class ListaProdutos { private SiloContext contexto = new SiloContext(); public List<Produto> listaProdutos() { return…
-
9
votes2
answers335
viewsA: How to customize the getter in Kotlin?
It’s a bit like. In Kotlin, classes cannot have fields (Fields), that is, they can only have properties. But, for our joy, language has a mechanism of backing field implicit (called field) for when…
-
3
votes1
answer89
viewsA: Declare textbox event in XAML
You’re making a huge mess. First of all, KeyPressEventArgs is not a event is only one class used to pass parameters for the KeyPress. So, this does not exist. This class comes from Windows Forms, it…
-
24
votes4
answers8801
viewsQ: What is it and what is a "truth table" for?
Well, the question is just this, I want to know what it is and for what purpose a truth table. I don’t want to know all the details, just a basic definition and an example.
-
1
votes3
answers94
viewsA: How to reference the first loop from the second in a chain of loops?
You can use a number on continue to identify which loop you want to stop/continue. This works to break and switch also. And it is counted from the inside out, for example: the innermost loop is 1.…
-
2
votes1
answer355
viewsA: Show/hide div when selecting a select option
Only use the directive ng-show. angular.module('app', []).controller('mainController', function($scope){ $scope.mostrarDiv = false; $scope.opcoes = [ { descr: "Mostrar", valor: true }, { descr: "Não…
-
5
votes2
answers199
viewsA: How to popular a model from a Datareader in C#?
No. Automatically no way. One option is to use a little bit of Reflection and do this job. I’m not going to post an answer with that because it doesn’t seem to me the purpose of this question,…
-
1
votes1
answer41
viewsA: Is it possible to instantiate a database connection manually using the Entity Framework?
Yes, it is possible. One way to do this is to pass as context constructor parameter. One of the manufacturer’s overloads accepts a string. With this approach it is possible to work in two ways: 1)…
-
5
votes3
answers213
viewsA: What’s a Kotlin label for?
It’s for naming the code block. It’s like a goto. Your example is good to illustrate, if the condition of the if the for external will be stopped. If there was no label specifying it, would be the…
-
4
votes2
answers1264
viewsA: How to read a file with Kotlin?
(Almost) same as Java You can use the Java libraries for this. In fact, not only for this, much of the Kotlin library is Java. Obviously there are several ways to work with files. A simple example…
-
4
votes3
answers1764
viewsA: How to create a static method using Kotlin?
There are no static methods in Kotlin. It is possible to create functions at the package level/package because, in Kotlin, it is not necessary to have a class to have a defined function. Something…
-
1
votes1
answer61
viewsA: The show() method in my wpf does not work
The problem is that the class Menu of its code refers to System.Windows.Controls.Menu. Write the full name of your class Menu or define a alias for your namespace (or System.Windows.Controls). The…
-
2
votes1
answer35
viewsA: Code versioning problems in git restore in tfs
Missing push. In Git, the commits are done locally. To upload your changes to the remote repository you need to do a push of the amendments. Go to the right side panel, in the combo box (top) select…
-
5
votes2
answers707
viewsA: Is there any way to insert pre-defined code snippets in Visual Studio?
Yes, it is possible! Visual Studio allows you to create custom code snippets. For this it is necessary to create an XML file using the structure predefined by Visual Studio. See all the details on…
visual-studioanswered Jéf Bueno 67,331 -
8
votes1
answer472
viewsA: Ternary operator " ?: "
The name of that operator is Lvis Operator. It still exists in PHP 7. It may be just a matter of compatibility or even for comfort for those who are used to it, but only those who develop the…
-
2
votes1
answer1265
viewsA: Configure sql server without instance
This does not exist. SQL Server works with instances, at all times. To connect to the database without having to use the instance name, you can define an instance to fulfill the requests directly in…
sql-serveranswered Jéf Bueno 67,331 -
1
votes1
answer1397
viewsA: Does not insert lines in Datagridview
You need to add the line to the object that does the Binding data and not direct to DataGridView. In your case, you need to add the lines to the DataTable Something like private void…
-
7
votes2
answers10554
views -
3
votes3
answers108
viewsA: Value of type 'String? ' has no Member 'Int'
The error is because the structure String has no function called Int(). See in the official documentation. If you are using Swift 1.x Must use the toInt() and not Int(). let happines =…
-
2
votes2
answers52
viewsA: Error in Angularjs when save date, why?
This is because from version 1.3 of Angularjs, inputs with type date need to have a ng-model which is a valid date. The agenda.dia is a string, so this error happens. The code should be agenda.dia =…
-
1
votes1
answer85
viewsA: How to create an event for multiple elements?
Do something to select all the elements you want and then add the Event Listener to them. In the example, I select all inputs and add the event onblur. var elementos =…
javascriptanswered Jéf Bueno 67,331 -
5
votes1
answer1277
viewsA: How to do Union all in LINQ?
Using the method Concat. Note that this method requires that the input types are the same. If there is no contract between the classes bpai and bpac it will take that Select declaring all the fields…
-
2
votes2
answers183
viewsA: Reference System.Configuration
Your project is . NET Core, so you need to add this reference by Nuget PM> Install-Package CoreCompat.System.Configuration -Version 4.2.3-r4 -Pre…
-
4
votes2
answers2274
viewsA: How to use an angular input checkbox using Array?
It is possible to keep a property on the objects that control whether it was selected or not and handle when sending to the server. angular.module('app', []).controller("Ctrl", function ($scope){…
-
1
votes1
answer71
viewsA: I’m not able to add a reference to my program
You will need to download the DLL by nuget PM> Install-Package System.Numerics.Vectors…
-
2
votes1
answer417
viewsA: How to pass a list of integers as Dapper parameters?
Your first approach seems correct to me. The problem is that ids is not a list of integers but a array integer list. Also, you create an object adesoesids to put this data. Basically, your object…
-
0
votes1
answer523
viewsA: Javascript redirecttoaction does not work
Your first premise is quite wrong. When making an asynchronous request for the server-side, you should return data or anything that is possible to handle on the client side using Javascript, doing a…
-
3
votes2
answers724
viewsA: Razor in javascript file
It doesn’t solve. Javascript is one thing, Razor is another. The @ is part of the Razor syntax and means that this will be processed on the server side before the response is sent to the client.…
-
4
votes1
answer699
viewsA: Form validation in select with angular
Looks exactly the same. Take an example: angular.module('app', []); angular.module('app').controller('mainController', function($scope) { $scope.listaTipoTarefa = [ { codigo: 1, tipo: 'Tipo 1' }, {…
-
3
votes1
answer50
viewsA: Redirect to Action according to if
Using RedirectToAction, passing the action name as parameter. Tip: the extension method SingleOrDefault receives a predicate, you do not need to apply a Where and then SingleOrDefault. In addition,…
asp.net-mvcanswered Jéf Bueno 67,331 -
1
votes2
answers1072
viewsA: Open Form in tabcontrol specifies
Create some way in which the form that will open knows which tab it needs to select and then select it using TabControl.SelectedTab. You can, for example, pass a enum by parameter in the form…
-
1
votes2
answers97
viewsA: How to take content from a div with the same class?
Without modifying its original structure, you can do this for the job; function pegarValor(el){ console.log(el.innerText); } <div class="conteudo-select" style="display: block;"> <div…
-
5
votes2
answers354
viewsA: Why doesn’t this setTimeout work?
Mostly because it doesn’t make sense. $('#atualizaPagina') returns an HTML element and no HTML element has the property location, consequently, there is no method reload(). If you want to update the…
-
7
votes2
answers1021
viewsQ: What is a decision problem?
I started reading about computer theory and came across the "decision problems". What are these problems? I don’t want any highly elaborate scientific article to answer the question, just a quick…
-
2
votes1
answer496
viewsA: Creating folders within Program Files
You cannot just ignore permissions that are applied to folders. Also because, if you could, permissions would be useless, don’t you think? An alternative is to run your installer with administrative…