Posts by Jônatas Hudler • 2,267 points
50 posts
-
0
votes1
answer119
viewsA: Error while sending email
Probably the screen-informed user and password are not being effectively considered for authentication on the SMTP server. Try to complement by setting the property Usedefaultcredentials for false:…
-
1
votes3
answers8837
viewsA: How to work with dates in the dd/mm/yyyy format in Vb.net?
While the accepted solution will work, the literal format conversion approach will cast the application if needed in the future to make the presentation more flexible (as preferred by the user).…
-
5
votes2
answers3110
viewsA: Mysql = Mariadb, huh?
In 2008, the Mysql project was incorporated by Sun Microsystems. In 2009, Oracle purchased Sun - and incorporated Mysql into its product list. No change in product name. (Source). The founder of the…
-
1
votes1
answer26
viewsA: Aurelia bindable and jQuery plugins
First, the ideal: Like the Binding is connecting Aurelia objects (ie View and Viewmodel), ideally you would not use an external agent (jQuery in this case) to update your View directly. This will…
jqueryanswered Jônatas Hudler 2,267 -
0
votes2
answers33
viewsA: Why can’t I call cta1 instantiated object in btnCriarConta_Click?
Because the variable was created (therefore it is limited) to the scope of the function. That is, the variable cta1 is raised in btnCriarConta_Click and only accessible from this function (after its…
c#answered Jônatas Hudler 2,267 -
12
votes3
answers2118
viewsA: Memorystream vs Stream
Stream is nothing more than the basic and abstract class (i.e., cannot be instantiated) for all other types of Stream available. MemoryStream is one of the implementations of Stream, that provides a…
-
5
votes1
answer251
viewsQ: Does it make sense to store the salt of a password with the hash itself?
Looking at tables in a database of a certain product, I came across a structure similar to this: [LocalUsers] UserId Integer PasswordHash Byte[] Salt Byte[] If an intruder gets this list, it’s…
-
1
votes1
answer1045
viewsA: How to get the data from a specific field in an XML using LINQ VB.net/C#
For Each tagICMS As XmlNode In document.GetElementsByTagName("ICMS")) Dim tagImposto As XmlNode = tagICMS.ParentNode Dim tagDet As XmlNode = tagImposto.ParentNode Dim attribNItem As XmlAttribute =…
-
0
votes2
answers189
viewsA: Include 2 Yen in 1 View!
In your view, you ask for one IEnumerable<>, while you should only request a single object from your Viewmodel (after all, this is what you are associating in your Controller): Just change the…
asp.net-mvc-5answered Jônatas Hudler 2,267 -
0
votes1
answer54
viewsA: Opcnetapi performs faster reading while Marikonopc Explorer is open
Complicated to give a conclusive answer to this kind of question, as it is a difficult situation to reproduce (even more because it involves specialized external hardware). Still, I want to leave…
c#answered Jônatas Hudler 2,267 -
3
votes2
answers85
viewsA: Error while deleting second List item
You have not posted the entire code, only the deletion snippet, but I will assume the following (based on the error that occurs): Your grid starts with the variable listaPedido, which in turn should…
c#answered Jônatas Hudler 2,267 -
4
votes1
answer1938
viewsA: c# Nhibernate a Different Object with the same Identifier value was already Associated with the Session
Note that the SaveOrUpdate() should only be used under one of these circumstances: The object (entity) is new - that is, the primary key is empty (zeroed, null, etc.) and must be generated; It is…
-
1
votes2
answers244
viewsA: Remove Arrows from Editorfor
Another way is to add this CSS code: input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } input[type=number] {…
-
1
votes2
answers304
viewsA: How to Manipulate Objects in a Thread?
The delegate ParameterizedThreadStart has the following signature: public delegate void ParameterizedThreadStart(object obj); This indicates that your method Metodo should follow it, receiving the…
-
3
votes2
answers686
viewsA: Can you create in C# a String array type property with 2 positions?
There is no native . NET type that represents a fixed size array, criticizing already in the compilation if it is exceeded. What you can do in this case is initialize the fixed-size array in the…
c#answered Jônatas Hudler 2,267 -
2
votes0
answers40
viewsQ: How do I make the browser remember two different passwords (two distinct Forms) for the same website (domain)?
I have in a web application that, in a conventional way, asks a user and password to login to the system. This user and password are encapsulated in a form (simplified example): <form…
-
1
votes1
answer1927
viewsA: ORA-01799: a column may not be Outer-joined to a subquery
You can do it this way: SELECT A.NOME FROM A LEFT JOIN (SELECT B2.ID_A, B2.OUTRA_COLUNA FROM B B2 WHERE B2.NUMERO = (SELECT MAX(B3.NUMERO) FROM B B3 WHERE B3.ID = B2.ID ) ) B ON (A.ID = B.ID_A)…
-
2
votes3
answers2223
viewsA: How to group for weeks using sql?
You can group by week and present the full date: (Mysql) SELECT min(data_requisicao) as `Semana Requisição`, count(*) as `Contagem Requisições` FROM tbl_requisicoes GROUP BY WEEK(data_requisicao)…
-
2
votes1
answer37
viewsA: I do not know the feasibility of doing in lambda or Linq my expression
How about? var arquivosFiltrados = (from arquivo in arquivos where !(from dirEvitar in dirZipDireto where arquivo.Contains(dirEvitar) select dirEvitar).Any() select arquivo).ToList();…
-
9
votes3
answers203
viewsQ: Licensing: How to deal with date/local time tampering of a computer?
I am developing an application (Desktop) that requires license renewal periodically, following a model Saas. The model of the licence shall function as follows:: The license will be downloaded from…
-
1
votes2
answers376
viewsA: Subconsulta in Lambda
Select the last (largest) step for each customer: var query = from regAdmin in db.tbl_Admin select new { Cliente = regAdmin, EtapaAtual = (from regEtapa in db.tbl_estagioprocesso where…
-
2
votes3
answers818
viewsQ: How to configure a dynamic dimension div delimited by other div’s?
I am looking for a way to have a layout that meets the behavior below: The big question here is to make the central div delimite itself to the ends of the other div’s, so that they do not overlap…
-
0
votes1
answer58
viewsA: Group function does not work
Try to simplify your query: Select sum(ITENS_PEDIDO.QT_MERCADORIA), ITENS_PEDIDO.MERCADORIA From ITENS_PEDIDO Join PEDIDO On ITENS_PEDIDO.PEDIDO_ID = PEDIDO.IDPEDIDO Where PEDIDO.DT_PEDIDO Between…
-
2
votes3
answers321
viewsA: Pass List as LINQ expression parameter
Notice that when you make one new { t1.RA }, you are actually creating a new anonymous type that will not give you the desired result when comparing to the property type COD_DISCIPLINA. As a final…
-
1
votes1
answer1204
viewsA: Hibernate with multiple databases in the same application
We have a similar situation in Nhibernate (.NET) due to the architecture of our system, which uses a schema (database) for each branch. In this case, you can use a SessionFactory only, assuming the…
-
0
votes1
answer686
viewsA: HQL query with ENUM list as parameter
Use the method setParameterList when associating the respective parameter. Example: Generos[] paramGeneros = {Generos.ALTERNATIVE_ROCK, Generos.CLASSIC_ROCK}; IQuery minhaQuery =…
-
2
votes1
answer96
viewsA: Lambda com List
int countResposta = modulo.AlunoSatisfacoes.Where( x => x.AlunoSatisfacaoRespostas.Any( y => y.Resposta == "2" && y.SatisfacaoPerguntaID == 2 ) ).Count();…
c#answered Jônatas Hudler 2,267 -
2
votes1
answer761
viewsA: Difference between Nhibernate first and second level cache
The cache of first level is nothing more than the session (defined by the interface ISession) which stores the entities (records) loaded in memory. It is also called transaction cache. This cache…
nhibernateanswered Jônatas Hudler 2,267 -
4
votes1
answer4703
viewsA: Conversion is not valid
Based on the information you posted, I see two possible situations that are causing this problem: 1) The value returned by your query is null (DbNull). To avoid this case, it is worth consisting: if…
-
4
votes2
answers141
viewsA: Displaying massive amount of data
In my experience, I list some practices that help in this regard. I will quote them trying to answer in the order of their questions: Use of Pagination: It is certainly a good practice, mainly…
-
2
votes2
answers2135
viewsA: Problems installing a service on Windows Server
By deduction, apparently the unit G:\ corresponds to a network mapping. In this case, the actual installation will fail. Try moving all dependencies to a local drive (C:) and install the service in…
c#answered Jônatas Hudler 2,267 -
1
votes1
answer283
viewsA: Is there any way to set Nhibernate not to parameterize a query?
I’ve needed that, too, and as far as I’m concerned, there’s no direct way to solve it. What you can try in this case is to create a custom extension function for use in Linq. I did not test this…
-
2
votes4
answers2214
viewsA: Bring a Max(Date) with LINQ
Try the following: var resultado = ( from pdv in db.T_PDV (...) where pdv.CNPJ == "07599639000184" && parceiro.DataVisita == ( from parceiro2 in db.T_OsParceiro.Where(prf2 =>…
-
4
votes1
answer150
viewsQ: Static Code Analysis - Identify possible division by Zero
Does anyone know / built some logic (rule) of static source code analysis (for Fxcop or Gendarme) that searches for possible gaps in the code that incur a division by zero? That is, a logic that…
-
1
votes3
answers3813
viewsA: Reports in C# MVC
I believe that HTML is not the output for this case - you will be bothered enough to assemble and then fine-tune the layout. If your need in C# is punctual (you will continue to develop in Delphi),…
-
1
votes1
answer238
viewsA: How to play query with Mysql queries in Hibernate?
You can use HQL (Hibernate Query Language) for this purpose - HQL has a syntax very close to SQL and also supports sub-query’s:…
-
26
votes7
answers21276
viewsA: Best kind of data to work with money?
Utilize Decimal, because this type will represent descriptive values (i.e., exact values). Monetary values and absolute quantities are examples of this case; Floating point types (e.g.: float) are…
-
0
votes6
answers6055
viewsA: Part of the Label in Bold?
There is the open source project HTML Renderer that allows this you are asking for. He has the control HtmlLabel which enables the use of tags (Ex: texto em <b>negrito</b>) as already…
-
2
votes3
answers2806
viewsA: How to Change Windows Variable Records
You can: Use the regedit.exe to make the changes If you want to access via code, you can use the Windows API for this feature; Alternatively, export the desired Windows registry chunk to a file,…
windowsanswered Jônatas Hudler 2,267 -
2
votes2
answers1593
viewsA: How to register dll . net using Inno Setup
An Assembly (.dll) from . net needs to be registered differently from other . dll’s. Inno Setup won’t know this when you mark . dll as regserver. In this case, try placing at the end of your script…
-
9
votes3
answers2597
viewsQ: How to write commands in a console program through a batch (.bat) file?
I want to automate a routine through a .bat which will call a console program which, in turn, will receive successive commands from this .bat. This console program could be, for example, an ftp…
-
2
votes2
answers1412
viewsA: How to turn a DLL created in C# to VB6?
For some reason, Visual Studio doesn’t let you add a . dll COM knowing that this . dll was exposed from an Assembly . NET - it forces you to use this . dll as a common reference . NET. In this case,…
-
12
votes1
answer267
viewsQ: How to unify redundant XML namespaces?
I have the following XML: <?xml version="1.0" encoding="UTF-8"?> <DataTable> <Columns> <DataColumn xmlns:i="http://www.w3.org/2001/XMLSchema-instance">…
-
6
votes2
answers282
viewsA: Is there a way to save types not listed in Settings.Default?
You can create settings using your own types (created by you). For that you must: 1) Set using the attribute System.Configuration.SettingsSerializeAs how your class will be serialized in the…
-
0
votes3
answers157
viewsA: Refactoring function to collect constants with a certain prefix
Suggestion for code reduction (already removing the warning message suggested by @Lias): function get_constantsByPrefix($prefix) { foreach (get_defined_constants() as $key=>$value) { if($prefix…
-
20
votes2
answers3325
viewsQ: What would be real cases of use of functional programming in the world . NET (F#)?
Recently (Okay, it’s been a few good months) I’ve been interacting with f-language#, which is Microsoft’s response to offer a functional programming language on the . NET platform. However, it is…
-
4
votes2
answers6298
viewsA: How to find the default printer and print plain text on a dot matrix printer on . NET?
After a few searches, it follows the way we were able to do it: It’s not so elegant (we had to appeal to P/Invoke calls1), but it worked really well. using System.Drawing.Printing; (...) public void…
-
12
votes2
answers6298
viewsQ: How to find the default printer and print plain text on a dot matrix printer on . NET?
We have a thermal printer that does not support printing graphic elements - in this case, I will have to send simple text to it. Considering that our application will run on several different…
-
6
votes5
answers2566
viewsA: Is it recommended to use Linq instead of SQL?
Although your question is already answered, the title of your question attracted me to share some other benefits that we have felt in our company in the use of Linq, if someone is going through the…
-
2
votes2
answers960
viewsA: How to save a cascade collection in nhibernate without putting circular reference?
Noting his comment: [...] Having all this information Nhibernate could simply give an Insert in the table tClasse and then give an Insert in the table tMetodo by entering in the Idclass field the id…