Posts by gato • 22,329 points
373 posts
- 
		7 votes1 answer275 viewsQ: What is the purpose of while(*variable) and if(!*variable) in the statements "while" and "if"?In Code Review there is a implementation of a simply chained list that I am using. However, in the reply of one of the users, he made some modifications to the list, and had a particular… 
- 
		9 votes2 answers477 viewsQ: What types of resources are released in a "using" statement?According to Microsoft documentation: The using statement provides a convenient syntax that ensures use correct of Idisposable objects. Source. That is, the interface Idisposable provides a… 
- 
		5 votes1 answer944 viewsQ: How to switch between the next element and the previous element of a Listiterator with just one click?I have a list of words stored in my variable listaPalavra already initialized with values, of type ArrayList<T>: listaPalavra.add("Palavra 1"); listaPalavra.add("Palavra 2");… 
- 
		6 votes2 answers565 viewsQ: What are ASP.NET MVC routes?In ASP.NET MVC always appears to me the term route when I read something related to this technology, however, I started studying APS.NET MVC recently and this term route is causing me trouble.… 
- 
		6 votes2 answers475 viewsQ: What is the purpose of automatically generated directories in an ASP.NET MVC project?In Visual Studio Community 2015 when we create a new project in ASP.NET MVC in the project is automatically generated the following directory structure, see the image below: Being in total eight… 
- 
		16 votes3 answers1008 viewsQ: How is a class organized in memory?According to this definition of memory: In computing, memory refers to the physical devices used to store programs (sequence of instructions) or data (State information, for example) in a character… 
- 
		4 votes2 answers608 viewsQ: How do I know which Arraylist objects are being modified or deleted?I own a ArrayList that this preloaded with some objects of the type of my class Person, see: ArrayList<Pessoa> listaDePessoas = new ArrayList<>(); listaDePessoas.add(new Pessoa("Joao",… 
- 
		9 votes1 answer510 views
- 
		13 votes3 answers8989 viewsQ: What is "build" and what is its relationship to the IDE?In the area of software development has a term that appears very often that is the build. It always comes to me when I read about Android Studio and other development tools (usually Ides), I think… 
- 
		14 votes2 answers6664 viewsQ: How to create and manipulate lists in PHP?In java it is possible to create and manipulate list of any type of data using the List<E>, See the example below: List<String> lista = new ArrayList<>(); lista.add("Stack");… 
- 
		6 votes2 answers1284 viewsQ: Are there differences between Post and Request?When I read regarding the request I always get the term post together, and that raises me a doubt. I understand that the request serves to make a request for something to the server and then the… 
- 
		11 votes3 answers1181 viewsQ: How to create a filter from the words/phrases of interest to filter a particular wave from a "List"?In my example I have two classes that are SetorInteresse and Vaga, below follows the structure of the two: Setorinteresse class: public class SetorInteresse { private List<String> setores;… 
- 
		7 votes1 answer105 viewsQ: Is there an alternative to multiple while loops?I have a method alterar() that change the data of a particular element of my XML Person, however, this routine uses several whiles one for each element, see below the routine: public void alterar()… 
- 
		2 votes1 answer464 viewsQ: Can View talk directly to Model?In MVC a View serves to handle the entire user interface, the Model serves to contain the classes that represent the system and its business rules and the Controller performs the communication… 
- 
		32 votes4 answers8677 viewsQ: What’s the difference between data and information?According to this definition of Datum: Data is a set of information (quantitative, qualitative, categorical or indefinite) can be organized or not. Wikipedia. Following this line I can assume that… terminologyasked gato 22,329
- 
		5 votes1 answer2011 views
- 
		9 votes2 answers4637 viewsQ: What is the difference between "node", "attribute", "element" and "tag" in XML?I am confused about some features and terms of the XML markup language that are: knot, attribute, element and tag, I would like to know what each of them is and what are the differences between… 
- 
		3 votes1 answer5127 viewsA: Correct method to get Datatable populated Combobox valueJust make the conversion to whole using the method ToInt32() see: int valor = Convert.ToInt32(comboBox3.SelectedValue); 
- 
		2 votes2 answers117 viewsA: list.remove() in a rowYou can use the method filter and apply a lambda expression to remove whitespace and also empty strings: lista = filter(lambda item: item != ' ' and item != '', lista) Exit: ['a', b', 'c']… 
- 
		4 votes1 answer424 viewsA: As time passes and progressbar grows change the label textWhen using the Progressbar it is very useful to use the Backgroundworker to increase the bar (property Value from Progressbar) and leave the application free to do other things. Implementing the… 
- 
		5 votes1 answer159 viewsQ: Purpose of lambda syntax in function/methodIn some cases a function/method contains only one line in its scope, see the illustrative example: static int Soma(int a, int b) { return a + b; } Meanwhile, to a new feature in C# 6.0 that allows… 
- 
		8 votes2 answers577 viewsQ: What is the purpose of unsafe command?I saw the use of the command unsafe, in this code in the declaration of this method: public unsafe static int GetSquareStack(int value) {...} Within the method there seems to be pointer manipulation… 
- 
		3 votes1 answer150 viewsA: How to get the text of the line where the cursor is positioned?I imagine you have one TextBox with the property MultLine qualified to true. Thus, to obtain the contents of the line where the vertical bar is positioned | just use this method I created… 
- 
		13 votes2 answers2090 viewsQ: What is the IL code and where can I find this code?In my question about static builders the user Maniero showed how is the code generated from a static constructor by . NET, this code is called Code IL according to his reply. See the IL code of my… 
- 
		15 votes2 answers1287 viewsQ: What is the purpose of a static constructor?I’ve always used builders as follows: public MinhaClasse() { //Algo ... } However I found that in C# it is possible to create a static constructor as follows: public class MinhaClasse { public… 
- 
		2 votes1 answer119 viewsQ: How to get the content of a tag from a Linq query?I have XML with the following structure: <?xml version="1.0" encoding="UTF-8"?> <pessoas> <pessoa> <nome>Joao</nome> <email>[email protected]</email>… 
- 
		6 votes3 answers709 views
- 
		11 votes1 answer469 viewsQ: What is the purpose of empty parentheses in a lambda statement?I created an example of a Lambda statement with no arguments, however, I have doubts regarding the omission of the empty parenthesis () in the statement. Take the example: class Program { public… 
- 
		2 votes1 answer2017 viewsQ: How to store data in RAM and make it available to any module or class in my application?There are several ways to store the data of a particular application and some of them are: Disk Storage (HD). It can be a text file, XML, or a database file of some DBMS. Cloud Storage (Cloud). It… 
- 
		6 votes2 answers1543 viewsQ: How to select fields in a lambda expression query?Through the select new from LINQ I can select which fields will be displayed in the query, for example: var subCategorias = from s in db.SubCategoria join c in db.CategoriaProduto on s.id_categoria… 
- 
		2 votes4 answers835 views
- 
		2 votes1 answer2787 viewsA: C# Datagridview align header in centerYou could specify the columns, see a small example: dg.Columns["nomeDoMeuCampo"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; Editing: I was able to leave the Header… 
- 
		5 votes1 answer1234 viewsA: How to make notification through the taskbar in c#?You need to add one Contextmenustrip and its application, and then set it in the property ContextMenuStrip of Notifyicon, see in this example: // // notifyIcon // this.notifyIcon.BalloonTipIcon =… 
- 
		24 votes4 answers24580 viewsQ: Is there a difference between Program, Thread and Process?I wonder if there’s a difference between Thread, Process and Program? These three words are widely used in the area of Information Technology, so it would be interesting to know the difference… 
- 
		7 votes3 answers414 viewsQ: How to change the structure of a LINQ query at runtime?I have the following example of a program that implements the EF (Entity Framework). The structure of the database and the application is defined as follows: Table Pessoa: Primary key field:… 
- 
		8 votes1 answer557 viewsQ: TDD and Unit Test, both are the same thing and have the same purpose?Always when I read about TDD (Test Driven Development) it is related to Unit test, It makes me believe that TDD is the same as Unit test, and I don’t know if my definition is correct in relation to… 
- 
		8 votes2 answers1094 viewsQ: How to declare a function within another function in C#?In Delphi it is possible to declare function within the block of a given function, see this example done in Delphi: procedure TForm1.btnRunClick(Sender: TObject); begin mostrarNome('Carvalho'); end;… 
- 
		10 votes2 answers375 views
- 
		4 votes3 answers342 viewsQ: How and where to implement business rules in the Entity Framework?I have the following example of a software that uses Entity Framework, accessing a database with only one table called Produtos with the following fields: Field int produtoid. Field string… 
- 
		2 votes2 answers54285 viewsA: Analyze whether the number is even or odd, and which of the numbers is higherIn the instruction where you display the variable num2 when it is odd there was an error in function call print(), see where I’ve changed: #include <stdio.h> int main(void) { int num1,num2;… 
- 
		1 votes0 answers38 viewsQ: What is the purpose of the var command when used in the function statement?In Javascript it is possible to write functions with or without the use of the keyword var, see below two functions that illustrate this situation: var soma = function(a, b) { return a + b; }… 
- 
		3 votes1 answer1012 viewsA: How to know which keys are pressed in C# Consoleapp and set eventsBasically you can use the class ConsoleKeyInfo to get the keys pressed, see below an example: using System; using System.Collections.Generic; using System.Linq; using System.Text; using… 
- 
		10 votes1 answer3149 viewsQ: How does Javascript import libraries?In programming languages such as Java, C# and C, when we want to use some command or function we should include the library containing the commands we want or the classes if it is object oriented… 
- 
		17 votes2 answers2414 viewsQ: What is the purpose of the "id" and "name" properties of an HTML tag?When we create a tag in HTML we can assign values to its properties, however, the property id and name, I realize that they are widely used and generally the values that are assigned to them are the… 
- 
		31 votes2 answers7772 viewsQ: What characterizes imperative and functional programming?What characterizes the imperative and functional programming and what are the differences between them in relation to each other? I cannot understand these two paradigms. Note: If you can cite… 
- 
		12 votes2 answers19181 viewsA: How to check if a table exists in the SQL Server 2005 database and if it does not exist create it and the columnsThere is the view INFORMATION_SCHEMA which makes it possible for you to check, and one of its advantages is that it is set by default in different databases and versions of DBMS. See how to… 
- 
		11 votes3 answers2738 viewsQ: How does the browser handle infinite loop in Javascript?I was doing an exercise on loop repetition for in Javascript on Codecademy, however, in the exercise I came across the following warning: codecadeny Be very careful with your syntax - if you write a… 
- 
		22 votes1 answer5420 viewsQ: What is the programming paradigm used by Javascript?What is the programming paradigm used by Javascript or if it is like Python that uses multiple paradigms? 
- 
		4 votes3 answers3650 viewsQ: Scanf function with variable amount of parameters, how to implement?I have a text file (txt) that contains the following values: 12 90 These two values I keep and my variables a and b, that is to say a is equal 12 and b is equal 90, and I’m using the function… 
- 
		9 votes3 answers4376 viewsQ: What is the purpose of the return of the main function and the importance of this function?I would like to know the importance of the function main and what is the purpose of her return which is a whole? See a minimum example of function implementation main: int main() {…