Posts by RSinohara • 1,516 points
44 posts
-
1
votes2
answers1380
viewsA: Capture Machine Identification with C#
It depends a little on how much security you need in this identification. Differentiating machines without guaranteeing identity You can use cookies. When there is a request without the cookie, you…
-
0
votes3
answers821
viewsA: Razor - Send parameters to a Bootstrap modal
The viewbag is used to pass data from controller to the view, not to be used in view this way. Use variables. In the specific case of your code, each loop iteration overrides ViewBag.ImageFile and…
-
1
votes1
answer4042
viewsQ: Macro execution is stopped repeatedly - How to avoid?
When I am running a VBA macro, eventually the code is stopped, as if there were breakpoints. The message displayed is: Execution of code interrupted. If you accept the message and continue executing…
-
2
votes1
answer4042
viewsA: Macro execution is stopped repeatedly - How to avoid?
This is because VBA treated incorrectly a breakpoint which has been removed, or (more frequently) a breakpoint that was in a code snippet that was removed or moved. Unfortunately I don’t remember…
-
0
votes1
answer32
viewsQ: How to block form scrolling when I’m dragging a controller?
I have a form where I design a company’s supply network. For this, I need to allow the user to move the controls that are in the form. This is working. However, when the user moves the control…
-
0
votes1
answer32
viewsA: How to block form scrolling when I’m dragging a controller?
For the answer of Loathing in the Soen: You can prevent the form from scrolling using this code by overwriting the method ScrollToControl: protected override Point ScrollToControl(Control…
-
30
votes2
answers1659
viewsQ: Meaning of terminology: "Object oriented"
What is the correct term for a fully object-based language (C#), and a language that uses objects but is not completely based on them. Example: VB has (had) several functions that were not in…
-
3
votes2
answers1659
viewsA: Meaning of terminology: "Object oriented"
Here we can see the terms for the two classifications, as well as an explanation: Object orientation Languages object-oriented use objects internally to represent the elements that constitute the…
-
8
votes2
answers2937
viewsA: How to compare intervals?
I would do it this way. Below the formulas: First, I name each pair. Then I concatenate the numbers (with -- between them so as not to mix and confuse the numbers). Then I copy the name of each pair…
-
0
votes1
answer111
viewsA: How to restrict the time of manipulation of a table?
It is possible yes. Below a code that does this, extracted from Limit user access to a Certain time. CREATE TRIGGER usrLoginCheck_LogonTrigger ON ALL SERVER WITH EXECUTE AS 'batchid' FOR LOGON AS…
-
3
votes3
answers579
viewsA: Programming for the interface means programming for a super-type, why?
Means you can use any object that implements the interface. Using inheritance and polymorphism, you can access, say, a class cachorro as if it were a animal. A function can use the class, only…
-
1
votes1
answer841
viewsA: Vector union, adding the vectors?
I think this code works. Somewhat different from the logic you proposed... void uniao(int *A, int *B, int qnt) { int C[qnt*2], i,j, contResultado; bool novoA, novoB; contResultado=0; for(i= 0; i<…
-
1
votes1
answer164
viewsA: Repository Pattern - Usage Doubt
It is possible and common to use one service per entity. However, an aggregate root service is also used. That is, for each set of relations you elect a root, or main class, and create services for…
-
1
votes3
answers1160
viewsA: Validation to check if the record is being used before deleting
Taken from: SQL Server: how to know if any Row is referencing the Row to delete If your system is multi user, which is probably, verify if the record can be deleted can cause a critical racing…
-
1
votes1
answer56
viewsA: Always leave line at the top
There is the Fixedcolumns plugin, but it does not allow this functionality. What you can do is put a header with two lines, the second being the line you want to keep permanently. That example:…
-
1
votes3
answers785
viewsA: How can I make a query with LIKE or REGEXP ignoring table words?
It may not be the most appropriate way, but even for performance reasons (searching for 'wild' values can be costly), my first idea for this problem would be to store a 'fixed' auxiliary field,…
-
6
votes4
answers1510
viewsA: Why in PHP does the expression "2 + '6 apples'" equal 8?
The interpreter automatically converts the string started by 6 in the number 6.66 and '66' and '66 abacates' shall all be interpreted, in numerical instruction, as 66.…
-
4
votes1
answer560
viewsA: Handling possible typos in emails (@gamail, @hotnail .)
There is no way to confirm if an email exists directly. That’s because, as you said, spam would run loose. What should be done is to generate an activation code embedded in a link that is sent to…
-
1
votes2
answers445
viewsA: Dependency Injection - Two objects implementing the same interface
If you are injecting the two implementations, there is something wrong. Dependency injection has as its main motivation you only have one location to create the instances that implement each…
-
6
votes2
answers312
viewsQ: Where to call Savechanges() when you have multiple repositories?
I am developing an application with Entity Framework, with several repositories. Each repository encapsulates SaveChanges() dbcontext. When a business layer operation uses multiple repositories, and…
-
1
votes1
answer446
viewsA: Two submits on the same page
Translated from: How do you Handle Multiple Submit Buttons in ASP.NET MVC Framework? Name each Ubmit button, and check that name in the action: <% Html.BeginForm("MyAction", "MyController",…
-
9
votes3
answers18194
viewsA: What purpose of unsigned in C++
Numeric variables can be flagged or not. Flagged means that the first bit (the one on the left) indicates the sign: 0: the number is positive, 1, the number is negative. As in many applications it…
-
4
votes2
answers673
viewsA: When and in which columns should indexes be used?
Creating indexes has cost, yes. Each time you insert or change a column, the index needs to be rebuilt. The index is used to record the elements of the indexed column in another location. When you…
-
3
votes2
answers427
viewsA: Many-To-Many Entityframework update does not work
Well, a priori you do not need to load related entities always. Especially when making changes. Now, whenever using a reference to an entity that exists in the database, you need to give attach or…
entity-frameworkanswered RSinohara 1,516 -
0
votes2
answers100
viewsA: User by Company - Asp.net Identity
Login needs to be done with unique users. This is as a rule, but especially if you are using Asp.net Identity. There can be two users 'Eduardo'. Even if they’re in different branches. Users should…
asp.net-identityanswered RSinohara 1,516 -
3
votes3
answers224
viewsA: Use of using versus full name
There is no convention. Many will use the using, only by specifying the full name (with namespace) in case of name conflicts. Surely there is no rule, no indication.…
-
1
votes2
answers918
viewsA: How to cast a typed class in C#?
Your code is correct, the . NET just doesn’t do the implicit conversion (without you asking). Explicitly convert the object: ITeste<Objeto> teste = (ITeste<Objeto>) new CarroTeste();…
-
2
votes1
answer677
viewsA: How to do the mapping (Entitytypeconfiguration) of this complex type?
You declare a mapping to a.TipoAtividade.Identificador, where TipoAtividade is the type ETipoAtividade. ETipoAtividade does not contain a member Identificador. Seria Id? That seems to be the…
-
1
votes2
answers651
viewsA: Fill value in Internet page
After the lines oBrowser.navigate (sURL & ("build.php?tt=2&id=39")) ' navego até a pagina que quero ir Do While oBrowser.Busy DoEvents you need to reload the document with: Set HtmlDoc =…
-
1
votes2
answers117
viewsA: Error publishing site Asp.net mvc 4
You must have several controllers called Home, or separated the controller into partial classes but namespaces different. Change the name of one of the controllers, or change the namespace to stay…
-
1
votes1
answer499
viewsA: How to publish an Asp.net website mvc 4 on iis6?
According to Can we deploy MVC 4 application on IIS 6 in SO-en, you need to access IIS manager: expand the node IIS master, and choose the knot Extensões de Serviço Web. Then, on the left panel of…
-
0
votes2
answers516
viewsA: Should the Domain layer depend on Infrastructure?
The domain layer should not be 'married' to any other layer, but it needs to call functions to CRUD in the persistence layer. The idea of the domain layer not knowing the persistence layer (or any…
-
2
votes4
answers815
viewsA: Reflection of an Object that is owned by another
Now I understand what you need. I think, the way you implement the classes, it’s not possible. Check it out: the property (which you want to recover the name) is of the type GenericField. When a…
-
0
votes2
answers2498
viewsA: How to do a google search with vba?
On the google page, the ID is not "q". The element input where the search has attribute name="q". Again, I think this way to launch the search on google is contraindicated. I would run a Shell with…
-
0
votes1
answer2035
viewsA: Translation of Windows service name
The name of this service is Basic Filtering Mechanism. The short name is BFE. I was surprised that I could not find a list to compare the English/Portuguese names.…
-
3
votes2
answers84
viewsA: Stackoverflowerror when calling a class
Your class conexão extend MainActivity. When a new class instance Conexão is created, she has a member Conexão, inherited from MainActivity. That member, when created, will contain another member…
-
3
votes2
answers37
viewsA: Set a global error for Ajax requests
The answer is very neat here: Wrap jQuery’s $.ajax() method to define global error Handling, but the answer would basically be to use $(document).ajaxError $(document).ajaxError(function…
-
1
votes1
answer510
viewsA: Desktop App + DB Online (Hosting)
Well, let’s go in order. 1: How to keep communication safe: by accessing the bank directly through your application, there is no way (explanation below). How this communication would be done safely:…
-
1
votes2
answers53
viewsA: Return data difference from two sql tables
Try the following: SELECT Escola.nome_escola, count(Professores.ID) FROM Escolas LEFT JOIN Professores ON Escolas.ID_ESCOLA=Professores.FK_ID_ESCOLA GROUP BY Escolas.ID_ESCOLA;…
-
0
votes2
answers1938
viewsA: auto filter Vba
I modified the code, it should work for a filter. I also removed the Val (filtrosArray(0)), did nothing in his code. c = 1 Do While c <= coluna If MyRange = Cells(1, c) Then filtrocomp =…
-
3
votes3
answers185
viewsA: Ifs and Object Orientation - C#
Polymorphism does not apply here. Polymorphism happens in variables, in instances. For example: I have the class gato, and the class cachorro, both derived from animal. The animal class has a…
-
2
votes2
answers4418
viewsA: What does it mean to create an object with that asterisk?
This instruction declares the variable box pointer. Pointers, unlike common variables, contain no data but an address for some data. This is a very complex and confusing subject at first. Take a…
-
1
votes1
answer183
viewsA: Creating Properties, Summary and Custom Colors for Methods and Types
There’s nothing to do that. Neither do any of the plugins I know (some paid) do exactly that. To be able to choose the color of each method individually, the only way is to create a plugin for this,…
-
6
votes2
answers1180
viewsA: Is it possible to link a C# form to a VB.NET project?
Are two options: Convert the code c# to Vb.net, see this Ferrament C# to Vb.NET Converter As stated by Caffé, put the C# form in a separate project, and use the form in the VB.NET project. To open…