Posts by Gabriel Weber • 598 points
17 posts
-
1
votes2
answers181
viewsA: vscode removing Imports when saved file
I figured out how to solve the problem, the prefix was missing math in front of the function Sqrt. Anyway, problems of beginner in language. The whole code would look like this: package main import…
-
1
votes2
answers181
viewsQ: vscode removing Imports when saved file
I have a very simple code in GO. Using vs code, when saving the file I’m working on, the editor removes the import "math" Follows the code package main import "math" func main() { a :=…
-
4
votes1
answer234
viewsQ: Use of assert instead of if
I was reading a book about data structures implemented in C++ and here the author presents the following code snippet: T& operator[](int i) { assert(i >= 0 && i < length); return…
-
4
votes2
answers2249
viewsA: How to resolve a string formatting error?
Your mistake is on this line: Console.Write("Terça: {4}, {7}, {5}, {1}, {6}", A5, A8, A6, A2, A7); The indexes in this Console.Write should start at 0 and go up to at most the number of parameters…
-
4
votes3
answers759
viewsA: Replace in substring in c#
You can use the method Removeto remove a part of the string, passing as parameters the start of the removal index and how many characters you want to remove and then using the method Insert to…
c#answered Gabriel Weber 598 -
1
votes1
answer868
viewsA: How to do an action in jquery wait for another to finish to start?
You can try using the setTimeout() $('#abre-busca').click(function(event){ event.preventDefault(); $('#menu-principal-sub li').css({'opacity':0}); $('#menu-principal-sub li').css({'display':'none'})…
-
1
votes2
answers505
viewsA: Leave XML in a single line
If you get xml by a file: XDocument document = XDocument.Load("arquivo.xml"); document.Save("arquivo2.xml", SaveOptions.DisableFormatting); Or if you have xml in a string: XDocument document =…
-
1
votes2
answers332
viewsA: Designs of a C#Solution
Today as I need to test, I go and mark the application as "Startup Project" and then build. There is an approach technically best for this? You can start more than one project in your solution…
-
1
votes2
answers266
viewsA: Association 1 to 1 Entity
When it is a 1-to-1 relationship, one of the tips needs to be the main one and the other the dependent one. The main tip will be inserted first into the seat and can exist without the other. The…
-
2
votes2
answers818
viewsA: How to disable old dates in Bootstrap Datepiker version?
use the option startDate https://bootstrap-datepicker.readthedocs.io/en/latest/options.html#startdate ex: $('.datepicker').datepicker({ startDate: 'data_desejada' });…
-
4
votes1
answer501
viewsA: -[Lifestyle Mismatch] Applicationsigninmanager (Web Request) depends on Iauthenticationmanager (Transient)
I believe the error happens when you register yours owin authentications, using the method Register without passing as parameter his lifestyle, it assumes as standard the Transient, in this line:…
-
0
votes1
answer216
viewsA: How to display, in treeview format, only the folders and subfolders, and the contents of both, that are on the desktop?
A function is missing before this function you put in your reply. This previous function would only run through desktop folders. Here’s an example, of course, to fit your needs, but basically it…
-
2
votes2
answers1171
viewsA: DLL import in C#
It may be that one of the dll dependencies you are trying to reference is not being found. A good program for checking dlls dependencies is the Dependencywalker that will list the dlls dependencies…
-
1
votes1
answer60
viewsA: I’m not getting/knowing how to use Setter
You are always instantiating a new object when you are adding an item and when you are picking up the listing to write. Thus, the item you added in the previous instance is not inserted in the new…
-
7
votes1
answer843
viewsA: Dataannotations for checking between Start Time and End Time
Server-side You can make a comparison between two dates with a custom Dataannotation, here is a basic example, but you can already get an idea of how to compare the dates: using System; using…
-
2
votes1
answer426
viewsA: Jquery Maskmoney Asp.net Mvc
You’ll have to create your own Model Binder to deal with this specific case of decimal number conversion with location (the Brazilian formatting). follows an example class for this decimal Binder…
-
1
votes2
answers868
viewsA: how to work with Partialview
@{ Html.RenderPartial("~/Views/Controller/View.cshtml"); } Replacing Controller the name of the folder where your partial view was generated and View.cshtml by the name of your partial view.…